/* ============ Apolo Barber Shop · Tarjeta de fidelidad (maqueta) ============ */
:root {
  --bg: #151515;
  --bg-2: #1e1e1e;
  --bg-3: #262523;
  --line: rgba(236, 228, 212, 0.09);
  --line-2: rgba(236, 228, 212, 0.16);
  --gold: #c9a24a;
  --gold-2: #e2c27a;
  --gold-3: #f3dfa8;
  --gold-deep: #8f6f28;
  --gold-soft: rgba(201, 162, 74, 0.14);
  --cream: #ece4d4;
  --muted: rgba(236, 228, 212, 0.62);
  --faint: rgba(236, 228, 212, 0.38);
  --danger: #e0715b;
  --wa: #25d366;
  --radius: 22px;
  --radius-sm: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --display: "Bebas Neue", "Oswald", Impact, sans-serif;
  --text: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(120% 50% at 50% -8%, rgba(201, 162, 74, 0.16), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--cream);
  font-family: var(--text);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
body.no-scroll { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }

.app {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
}

/* ---------- Header ---------- */
.brand { text-align: center; padding: 10px 0 18px; }
.brand-logo { display: block; height: 62px; width: auto; margin: 0 auto; }
.brand-text { display: flex; flex-direction: column; align-items: center; line-height: 0.9; }
.brand-word { font-family: var(--display); font-size: 52px; letter-spacing: 0.08em; color: var(--cream); }
.brand-small { font-size: 11px; letter-spacing: 0.42em; color: var(--gold); margin-top: 6px; padding-left: 0.42em; }
.brand-sub {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.brand-sub::before, .brand-sub::after {
  content: "";
  display: inline-block;
  width: 18px; height: 1px;
  background: var(--gold);
  opacity: 0.6;
  vertical-align: middle;
  margin: 0 10px;
}

/* ---------- Segmented control ---------- */
.tabs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--n, 3), 1fr);
  padding: 4px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  margin-bottom: 20px;
  --i: 0;
}
.tabs-pill {
  position: absolute;
  top: 4px; bottom: 4px; left: 4px;
  width: calc((100% - 8px) / var(--n, 3));
  border-radius: 999px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  box-shadow: 0 6px 18px -6px rgba(201, 162, 74, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transform: translateX(calc(var(--i) * 100%));
  transition: transform 0.42s var(--ease);
}
.tab {
  position: relative;
  z-index: 1;
  height: 42px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.3s var(--ease);
}
.tab[aria-selected="true"] { color: #1a1408; }

/* ---------- Views ---------- */
.view { animation: viewIn 0.45s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.panel {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 14px;
}
.panel-title {
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.04em;
  margin: 0 0 12px;
  font-weight: 400;
}
.eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.h2 { font-family: var(--display); font-weight: 400; font-size: 34px; letter-spacing: 0.03em; margin: 2px 0 0; line-height: 1; }
.muted { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 52px;
  padding: 0 20px;
  border-radius: 16px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: transform 0.18s var(--ease), background 0.2s, box-shadow 0.2s, opacity 0.2s;
  user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-block { width: 100%; }
.btn-gold {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #1a1408;
  box-shadow: 0 10px 24px -12px rgba(201, 162, 74, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-ghost {
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  color: var(--cream);
}
.btn-wa {
  background: var(--wa);
  color: #06260f;
  box-shadow: 0 10px 24px -14px rgba(37, 211, 102, 0.9);
}
.btn-danger { background: rgba(224, 113, 91, 0.12); color: var(--danger); border: 1px solid rgba(224, 113, 91, 0.3); }
.link-btn { color: var(--danger); font-size: 14px; font-weight: 600; padding: 10px; }

/* ---------- Demo selector ---------- */
.demo-bar {
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-sm);
  padding: 10px 12px 10px;
  margin-bottom: 14px;
}
.demo-bar label { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); margin-bottom: 6px; }
.select-wrap { position: relative; }
.select-wrap::after {
  content: "";
  position: absolute;
  right: 14px; top: 50%;
  width: 8px; height: 8px;
  border-right: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.select {
  width: 100%;
  height: 44px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 0 38px 0 12px;
  font-size: 15px;
  font-weight: 500;
}
.demo-note { margin: 8px 0 0; font-size: 12px; color: var(--faint); line-height: 1.4; }

/* ---------- Loyalty card ---------- */
.loyalty {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  padding: 20px 18px 18px;
  background:
    radial-gradient(90% 60% at 100% 0%, rgba(201, 162, 74, 0.16), transparent 60%),
    linear-gradient(160deg, #23211d 0%, #1a1918 55%, #161616 100%);
  border: 1px solid rgba(201, 162, 74, 0.28);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.loyalty::before {
  /* barber-pole sutil en el borde superior */
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), var(--gold-3), var(--gold), transparent);
  opacity: 0.8;
}
.lc-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.lc-label { font-size: 11px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
.lc-no { font-size: 11px; letter-spacing: 0.12em; color: var(--faint); font-variant-numeric: tabular-nums; }
.lc-name {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(40px, 12vw, 50px);
  line-height: 0.95;
  letter-spacing: 0.02em;
  margin: 14px 0 4px;
  overflow-wrap: anywhere;
}
.lc-meta { margin: 0 0 18px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.lc-meta svg { width: 14px; height: 14px; color: var(--gold); }

.stamps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.stamp {
  position: relative;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1.5px dashed rgba(236, 228, 212, 0.22);
  color: var(--faint);
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: 0.02em;
}
.stamp.filled {
  border: 0;
  background:
    radial-gradient(circle at 35% 30%, var(--gold-3), var(--gold) 55%, var(--gold-deep) 100%);
  color: #1d1608;
  box-shadow: 0 6px 14px -6px rgba(201, 162, 74, 0.8), inset 0 -2px 4px rgba(0, 0, 0, 0.25), inset 0 2px 3px rgba(255, 255, 255, 0.35);
}
.stamp.filled::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px solid rgba(29, 22, 8, 0.25);
}
.stamp svg { width: 46%; height: 46%; }
.stamp.pop { animation: stampPop 0.55s var(--spring) both; animation-delay: var(--d, 0ms); }
@keyframes stampPop {
  0% { transform: scale(0.2) rotate(-25deg); opacity: 0; }
  60% { transform: scale(1.18) rotate(6deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.free-cell {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1.5px dashed rgba(201, 162, 74, 0.55);
  background: var(--gold-soft);
  color: var(--gold-2);
}
.free-num {
  flex: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1.5px solid currentColor;
  font-family: var(--display);
  font-size: 20px;
}
.free-num svg { width: 20px; height: 20px; }
.free-text strong { display: block; font-family: var(--display); font-weight: 400; font-size: 24px; letter-spacing: 0.06em; line-height: 1; }
.free-text span { font-size: 12px; color: var(--muted); }
.free-cell.ready {
  position: relative;
  overflow: hidden;
  border: 0;
  color: #1a1408;
  background: linear-gradient(120deg, var(--gold-deep), var(--gold) 30%, var(--gold-3) 50%, var(--gold) 70%, var(--gold-deep));
  background-size: 250% 100%;
  animation: shimmer 3.2s linear infinite;
  box-shadow: 0 14px 30px -14px rgba(201, 162, 74, 0.9);
}
.free-cell.ready .free-text span { color: rgba(26, 20, 8, 0.75); }
.free-cell.just { animation: shimmer 3.2s linear infinite, freePop 0.7s var(--spring) both; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }
@keyframes freePop { 0% { transform: scale(0.85); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }

.progress {
  margin-top: 18px;
  height: 8px;
  border-radius: 999px;
  background: rgba(236, 228, 212, 0.08);
  overflow: hidden;
}
.progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold), var(--gold-3));
  transition: width 0.9s var(--ease);
}
.lc-status { margin: 12px 0 0; font-size: 15px; color: var(--cream); }
.lc-status b { color: var(--gold-2); font-weight: 700; }
.lc-status.ready { font-family: var(--display); font-size: 24px; letter-spacing: 0.04em; color: var(--gold-2); }

.cta { margin-top: 14px; }

/* QR */
.qr-panel { display: flex; align-items: center; gap: 16px; }
.qr {
  flex: none;
  width: 124px; height: 124px;
  padding: 8px;
  border-radius: 16px;
  background: var(--cream);
  display: grid;
  place-items: center;
}
.qr img, .qr canvas { width: 100% !important; height: 100% !important; display: block; image-rendering: pixelated; }
.qr-fallback { color: #151515; font-size: 11px; text-align: center; word-break: break-all; }
.qr-panel h3 { margin: 0 0 6px; font-family: var(--display); font-weight: 400; font-size: 22px; letter-spacing: 0.04em; }
.qr-panel p { margin: 0; font-size: 14px; color: var(--muted); }
.qr-code-id { margin-top: 8px !important; font-size: 12px !important; letter-spacing: 0.14em; color: var(--gold) !important; font-variant-numeric: tabular-nums; }

/* History */
.history { list-style: none; margin: 0; padding: 0; }
.history li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.history li:first-child { border-top: 0; padding-top: 2px; }
.h-icon {
  flex: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg-3);
  color: var(--gold);
}
.h-icon.free { background: var(--gold); color: #1a1408; }
.h-icon svg { width: 16px; height: 16px; }
.h-main { flex: 1; min-width: 0; }
.h-main strong { display: block; font-weight: 600; font-size: 14px; }
.h-main span { font-size: 12px; color: var(--faint); }
.h-date { font-size: 13px; color: var(--muted); white-space: nowrap; }
.history li.is-free {
  margin: 0 -10px;
  padding-left: 10px;
  padding-right: 10px;
  border-radius: 14px;
  border-top-color: transparent;
  background: linear-gradient(90deg, rgba(201, 162, 74, 0.16), rgba(201, 162, 74, 0.03));
}
.history li.is-free + li { border-top-color: transparent; }
.history li.is-free strong { color: var(--gold-2); }
.history li.is-free .h-date { color: var(--gold); }

/* Tarjeta no encontrada */
.notfound { text-align: center; padding: 28px 18px 18px; margin-top: 4px; }
.notfound .pin-sub { margin-bottom: 20px; }

/* Banner "agregar a inicio" */
.a2hs {
  position: relative;
  margin-bottom: 14px;
  padding: 12px 44px 12px 14px;
  border-radius: 16px;
  background: var(--bg-2);
  border: 1px solid rgba(201, 162, 74, 0.3);
  animation: viewIn 0.45s var(--ease);
  transition: opacity 0.25s, transform 0.25s var(--ease);
}
.a2hs.bye { opacity: 0; transform: translateY(-6px) scale(0.98); }
.a2hs-title { margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.a2hs-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 12.5px; color: var(--muted); }
.a2hs-steps b { color: var(--cream); font-weight: 600; }
.a2hs-steps li.is-mine { color: var(--cream); }
.a2hs-steps li.is-mine b:first-child { color: var(--gold-2); }
.kbd { display: inline-block; min-width: 20px; padding: 0 5px; border-radius: 6px; background: var(--bg-3); border: 1px solid var(--line-2); text-align: center; font-size: 12px; line-height: 18px; }
.a2hs-x { position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; border-radius: 50%; font-size: 20px; line-height: 1; color: var(--muted); }
.a2hs-install { margin-top: 10px; height: 36px; padding: 0 14px; border-radius: 10px; background: var(--gold-soft); color: var(--gold-2); font-size: 13px; font-weight: 700; }
.empty { color: var(--faint); font-size: 14px; text-align: center; padding: 18px 8px; }

/* ---------- PIN ---------- */
.pin { text-align: center; padding: 18px 4px 4px; }
.pin-icon {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--gold-soft);
  color: var(--gold);
  border: 1px solid rgba(201, 162, 74, 0.35);
}
.pin-icon svg { width: 24px; height: 24px; }
.pin-title { font-family: var(--display); font-weight: 400; font-size: 32px; letter-spacing: 0.04em; margin: 0; }
.pin-sub { margin: 6px auto 0; color: var(--muted); font-size: 14px; max-width: 280px; }
.pin-dots { display: flex; justify-content: center; gap: 16px; margin: 24px 0 8px; }
.pin-dots i {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid var(--line-2);
  transition: background 0.2s, border-color 0.2s, transform 0.25s var(--spring);
}
.pin-dots i.on { background: var(--gold); border-color: var(--gold); transform: scale(1.15); }
.pin-dots.ok i { background: var(--gold-2); border-color: var(--gold-2); }
.pin-dots.shake { animation: shake 0.42s; }
.pin-dots.shake i { border-color: var(--danger); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(9px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(4px); }
}
.pin-error { min-height: 20px; margin: 0; font-size: 13px; color: var(--danger); }
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 76px);
  justify-content: center;
  gap: 14px 22px;
  margin-top: 10px;
}
.keypad button {
  width: 76px; height: 76px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-family: var(--display);
  font-size: 32px;
  letter-spacing: 0.02em;
  transition: background 0.15s, transform 0.15s var(--ease);
}
.keypad button:active { background: var(--gold-soft); transform: scale(0.93); }
.keypad button.del { background: transparent; border-color: transparent; font-family: var(--text); font-size: 15px; color: var(--muted); }
.pin-hint {
  display: inline-block;
  margin: 22px 0 0;
  font-size: 12px;
  color: var(--faint);
  border: 1px dashed var(--line-2);
  border-radius: 999px;
  padding: 5px 12px;
}

/* ---------- Barbero ---------- */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-size: 13px; font-weight: 500; color: var(--muted);
}
.chip-btn svg { width: 14px; height: 14px; }
.actions-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions-2 .btn { padding: 0 12px; font-size: 14px; }
.search {
  position: relative;
  display: block;
  margin: 12px 0 14px;
}
.search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input {
  width: 100%;
  height: 48px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  padding: 0 14px 0 42px;
  font-size: 16px; /* evita zoom en iOS */
}
.search input::placeholder { color: var(--faint); }
.search input:focus { outline: none; border-color: rgba(201, 162, 74, 0.6); box-shadow: 0 0 0 3px var(--gold-soft); }

.client-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  transition: border-color 0.3s;
}
.row.is-ready { border-color: rgba(201, 162, 74, 0.45); background: linear-gradient(90deg, rgba(201, 162, 74, 0.1), var(--bg-2) 70%); }
.row-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
}
.avatar {
  flex: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  font-size: 13px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--gold-2);
}
.row.is-ready .avatar { background: var(--gold); color: #1a1408; border-color: var(--gold); }
.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-name { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 15px; }
.row-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-name svg { flex: none; width: 13px; height: 13px; color: var(--faint); }
.row-meta { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-count { display: inline-block; color: var(--cream); font-weight: 600; }
.row-count.pop { animation: countPop 0.5s var(--spring); }
@keyframes countPop { 0% { transform: scale(1); } 40% { transform: scale(1.35); color: var(--gold-3); } 100% { transform: scale(1); } }
.mini-bar { display: block; height: 4px; border-radius: 999px; background: rgba(236, 228, 212, 0.08); overflow: hidden; margin-top: 5px; }
.mini-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold-deep), var(--gold-2)); transition: width 0.6s var(--ease); }
.btn-stamp {
  flex: none;
  min-width: 112px;
  height: 46px;
  padding: 0 12px;
  border-radius: 14px;
  background: var(--bg-3);
  border: 1px solid rgba(201, 162, 74, 0.45);
  color: var(--gold-2);
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.15s var(--ease), background 0.2s;
}
.btn-stamp:active { transform: scale(0.95); background: var(--gold-soft); }
.btn-stamp.is-free {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  border-color: transparent;
  color: #1a1408;
  box-shadow: 0 8px 18px -10px rgba(201, 162, 74, 0.9);
}

/* ---------- Estadísticas ---------- */
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.metric {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 104px;
}
.metric.hero {
  grid-column: span 2;
  min-height: 0;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(201, 162, 74, 0.18), var(--bg-2) 70%);
  border-color: rgba(201, 162, 74, 0.3);
}
.metric-icon { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); margin-bottom: 4px; }
.metric-icon svg { width: 16px; height: 16px; }
.metric-num { font-family: var(--display); font-size: 40px; line-height: 1; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.metric.hero .metric-num { font-size: 56px; color: var(--gold-2); }
.metric-label { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.metric.hero .metric-label { font-size: 14px; color: var(--cream); }
.metric.hero small { display: block; color: var(--faint); font-size: 12px; margin-top: 2px; }

.chart { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; align-items: end; height: 190px; padding-top: 8px; }
.bar-col { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; }
.bar-val { font-family: var(--display); font-size: 22px; line-height: 1; color: var(--cream); }
.bar {
  width: 100%;
  max-width: 54px;
  min-height: 4px;
  border-radius: 12px 12px 6px 6px;
  background: linear-gradient(180deg, var(--gold-3), var(--gold) 40%, var(--gold-deep));
  transform-origin: bottom;
  animation: grow 0.9s var(--ease) both;
  animation-delay: var(--d, 0ms);
}
.bar.dim { background: linear-gradient(180deg, rgba(201, 162, 74, 0.55), rgba(201, 162, 74, 0.25)); }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.bar-label { font-size: 11px; color: var(--faint); text-align: center; white-space: nowrap; }
.bar-col.current .bar-label { color: var(--gold); font-weight: 600; }

.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.people li:first-child { border-top: 0; padding-top: 0; }
.people .p-main { flex: 1; min-width: 0; }
.people .p-main strong { display: block; font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.people .p-main span { font-size: 12px; color: var(--faint); }
.rank { flex: none; width: 28px; font-family: var(--display); font-size: 26px; color: var(--gold); text-align: center; line-height: 1; }
.people li:nth-child(1) .rank { color: var(--gold-3); }
.btn-sm {
  flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 14px;
  border-radius: 12px;
  background: rgba(37, 211, 102, 0.12);
  border: 1px solid rgba(37, 211, 102, 0.35);
  color: #7ee2a4;
  font-size: 13px; font-weight: 600;
  text-decoration: none;
}
.btn-sm svg { width: 15px; height: 15px; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-2); margin-left: 4px; }

/* ---------- Sheet (modal) ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; transition: opacity 0.3s; }
.sheet-panel {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: 92dvh;
  overflow-y: auto;
  background: #1b1b1a;
  border: 1px solid var(--line-2);
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  padding: 26px 18px max(22px, env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.42s var(--ease);
}
.sheet-panel::before { content: ""; position: absolute; top: 9px; left: 50%; width: 40px; height: 4px; border-radius: 4px; background: var(--line-2); transform: translateX(-50%); }
.sheet.open .sheet-backdrop { opacity: 1; }
.sheet.open .sheet-panel { transform: none; }
.sheet-x { position: absolute; right: 12px; top: 12px; width: 38px; height: 38px; border-radius: 50%; background: var(--bg-3); font-size: 22px; line-height: 1; color: var(--muted); }
.sheet-title { font-family: var(--display); font-weight: 400; font-size: 30px; letter-spacing: 0.04em; margin: 4px 0 16px; padding-right: 44px; }
.stack { display: grid; gap: 10px; }

.form { display: grid; gap: 14px; }
.field span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%; height: 50px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  padding: 0 14px;
  font-size: 16px;
}
.field input:focus { outline: none; border-color: rgba(201, 162, 74, 0.6); box-shadow: 0 0 0 3px var(--gold-soft); }
.form-error { margin: -4px 0 0; min-height: 18px; font-size: 13px; color: var(--danger); }

.success { text-align: center; }
.success-icon {
  width: 64px; height: 64px; margin: 6px auto 12px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #1a1408;
  animation: stampPop 0.6s var(--spring) both;
}
.success-icon svg { width: 30px; height: 30px; }
.success h3 { font-family: var(--display); font-weight: 400; font-size: 30px; letter-spacing: 0.03em; margin: 0 0 4px; }
.success p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.link-box {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 6px 6px 12px;
  border-radius: 14px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  margin-bottom: 14px;
  text-align: left;
}
.link-box code { flex: 1; min-width: 0; font-size: 12.5px; color: var(--gold-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.link-box button { flex: none; height: 38px; padding: 0 12px; border-radius: 10px; background: var(--bg-3); font-size: 13px; font-weight: 600; }

/* Escáner simulado */
.scanner { text-align: center; }
.scan-frame {
  position: relative;
  width: 220px; height: 220px;
  margin: 4px auto 14px;
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(236, 228, 212, 0.05), transparent 70%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.015) 0 2px, transparent 2px 4px),
    #0d0d0d;
}
.scan-frame .corner { position: absolute; width: 34px; height: 34px; border: 3px solid var(--gold); }
.scan-frame .c1 { top: 14px; left: 14px; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.scan-frame .c2 { top: 14px; right: 14px; border-left: 0; border-bottom: 0; border-radius: 0 10px 0 0; }
.scan-frame .c3 { bottom: 14px; left: 14px; border-right: 0; border-top: 0; border-radius: 0 0 0 10px; }
.scan-frame .c4 { bottom: 14px; right: 14px; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }
.scan-line {
  position: absolute; left: 22px; right: 22px; height: 2px;
  background: var(--gold-2);
  box-shadow: 0 0 14px 3px rgba(201, 162, 74, 0.6);
  animation: scan 1.6s ease-in-out infinite alternate;
}
.scan-ghost { position: absolute; inset: 58px; opacity: 0.12; background:
  conic-gradient(from 90deg at 30% 30%, var(--cream) 25%, transparent 0) 0 0 / 22px 22px; border-radius: 6px; }
@keyframes scan { from { top: 24px; } to { top: calc(100% - 26px); } }
.scan-status { color: var(--muted); font-size: 14px; margin: 0 0 6px; }
.scan-note { font-size: 12px; color: var(--faint); margin: 0; }

.detected { text-align: center; animation: viewIn 0.4s var(--ease); }
.detected .check { width: 58px; height: 58px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-2); border: 1px solid rgba(201, 162, 74, 0.4); animation: stampPop 0.55s var(--spring) both; }
.detected .check svg { width: 26px; height: 26px; }
.detected-name { font-family: var(--display); font-weight: 400; font-size: 38px; letter-spacing: 0.02em; margin: 4px 0 2px; line-height: 1; }
.dots10 { display: flex; justify-content: center; gap: 6px; margin: 12px 0 18px; }
.dots10 i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px dashed rgba(236, 228, 212, 0.25); }
.dots10 i.on { border: 0; background: radial-gradient(circle at 35% 30%, var(--gold-3), var(--gold)); }

.confirm-text { color: var(--muted); margin: -6px 0 18px; font-size: 14.5px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 60;
  width: calc(100% - 32px);
  max-width: 428px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 16px;
  border-radius: 16px;
  background: #2a2826;
  border: 1px solid var(--line-2);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  transform: translate(-50%, 140%);
  transition: transform 0.38s var(--ease);
}
.toast.show { transform: translate(-50%, 0); }
.toast-msg { flex: 1; font-size: 14px; font-weight: 500; }
.toast-btn { flex: none; height: 38px; padding: 0 14px; border-radius: 10px; background: var(--gold-soft); color: var(--gold-2); font-weight: 700; font-size: 14px; }
.toast-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--gold); transform-origin: left; animation: drain linear forwards; }
@keyframes drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---------- Footer ---------- */
.footer { text-align: center; margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; }
.footer p { margin: 0 0 10px; }
.reset-btn { font-size: 12px; color: var(--muted); padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-2); }

.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 70; }

@media (min-width: 520px) {
  .app { padding-top: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
