/* =====================================================================
   SUPERLATIVES v2 — design system
   Direction: dark editorial, one electric accent, characterful grotesk.
   Type: Bricolage Grotesque (display) + Inter Tight (UI) + JetBrains Mono.
   Accent lock: lime. Player colors are functional data, not decoration.
   ===================================================================== */

:root {
  /* surfaces (dark, locked theme) */
  --bg: #0E0E11;
  --surface: #161619;
  --surface-2: #1C1C21;
  --surface-3: #232329;
  --line: rgba(255,255,255,.08);
  --line-2: rgba(255,255,255,.14);
  --line-3: rgba(255,255,255,.22);

  /* text */
  --text: #F2F1EC;
  --muted: #9D9CA6;
  --faint: #6B6A75;

  /* single accent (locked) */
  --acc: #CBF24B;
  --acc-press: #B9E236;
  --acc-soft: rgba(203,242,75,.14);
  --acc-ink: #131707;

  /* radii (locked scale) */
  --r-card: 20px;
  --r-card-lg: 26px;
  --r-input: 14px;
  --r-pill: 999px;

  /* shadow (tinted to bg) */
  --sh-1: 0 1px 2px rgba(0,0,0,.4);
  --sh-2: 0 10px 30px rgba(0,0,0,.45);
  --sh-3: 0 24px 60px rgba(0,0,0,.55);
  --sh-acc: 0 10px 30px rgba(203,242,75,.18);

  /* motion */
  --e: cubic-bezier(.2,.7,.3,1);
  --e-back: cubic-bezier(.2,.7,.3,1);
  --t1: .16s; --t2: .3s; --t3: .55s;

  --f-disp: 'Bricolage Grotesque', system-ui, sans-serif;
  --f-ui: 'Inter Tight', system-ui, -apple-system, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--f-ui);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.5;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
::selection { background: var(--acc); color: var(--acc-ink); }

i[class^="ph"], i[class*=" ph"] { display: inline-block; line-height: 1; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; letter-spacing: inherit; }
input, textarea { font-family: inherit; letter-spacing: inherit; }
a { color: var(--acc); text-decoration: none; }
svg { display: block; }

/* fixed grain overlay (pointer-events none, single layer) */
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------------- app shell ---------------- */
.app {
  position: relative; z-index: 2;
  width: 100%; max-width: 540px; margin: 0 auto;
  padding: 20px 20px 132px; min-height: 100vh;
  display: flex; flex-direction: column;
}
@media (min-width: 600px) { .app { padding: 30px 24px 132px; } }

.screen { display: flex; flex-direction: column; flex: 1; animation: screenIn .4s var(--e) both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------------- top bar ---------------- */
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand .mark { width: 26px; height: 26px; }
.brand .name { font-family: var(--f-disp); font-weight: 700; font-size: 19px; letter-spacing: -0.02em; }
.topbar .tools { display: flex; gap: 8px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: var(--r-pill); display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 19px;
  transition: border-color var(--t2), color var(--t2), background var(--t2);
}
.icon-btn:hover { border-color: var(--line-2); color: var(--text); }

/* ---------------- typography ---------------- */
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--acc); }
.eyebrow.muted { color: var(--faint); }
h1.display {
  font-family: var(--f-disp); font-weight: 700;
  font-size: clamp(44px, 13vw, 72px); line-height: .92; letter-spacing: -0.04em;
}
.display-2 { font-family: var(--f-disp); font-weight: 700; font-size: clamp(30px,8vw,40px); line-height: .98; letter-spacing: -0.03em; }
.h-sec { font-family: var(--f-disp); font-weight: 700; font-size: 27px; line-height: 1.02; letter-spacing: -0.025em; }
.lead { font-size: 16.5px; color: var(--muted); line-height: 1.5; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.tiny { font-size: 13px; }
.mono { font-family: var(--f-mono); letter-spacing: 0; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 600; font-size: 16px; letter-spacing: -0.01em;
  padding: 16px 22px; border-radius: var(--r-pill); white-space: nowrap; user-select: none;
  transition: background var(--t2), border-color var(--t2), color var(--t2), box-shadow var(--t2);
}
.btn i { font-size: 19px; }
.btn-primary { background: var(--acc); color: var(--acc-ink); box-shadow: var(--sh-acc); font-weight: 700; }
.btn-primary:hover { background: var(--acc-press); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--line-2); }
.btn-ghost:hover { border-color: var(--line-3); background: var(--surface-2); }
.btn-quiet { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn-quiet:hover { color: var(--text); border-color: var(--line-2); }
.btn-block { width: 100%; }
.btn-lg { padding: 19px 26px; font-size: 17px; }
.btn[disabled] { opacity: .4; pointer-events: none; box-shadow: none; }
.btn-row { display: flex; gap: 11px; }

.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  padding: 16px 20px calc(18px + env(safe-area-inset-bottom));
  display: flex; justify-content: center; pointer-events: none;
  background: linear-gradient(to top, var(--bg) 55%, rgba(14,14,17,0));
}
.dock > * { pointer-events: auto; width: 100%; max-width: 500px; }

/* ---------------- back link ---------------- */
.back { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-weight: 500; font-size: 14.5px; margin-bottom: 18px; transition: color var(--t2); }
.back:hover { color: var(--text); }
.back i { font-size: 17px; }

/* ---------------- cards / surfaces ---------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px; }

/* ---------------- HOME (editorial hero) ---------------- */
.hero { padding: 8px 0 0; }
.hero .kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 500; margin-bottom: 26px; }
.hero .kicker .dot { width: 7px; height: 7px; border-radius: var(--r-pill); background: var(--acc); }
.hero h1 .it { font-style: italic; color: var(--acc); }
.hero .sub { font-size: 17px; color: var(--muted); line-height: 1.45; margin: 22px 0 0; max-width: 30ch; }

.mode-list { display: grid; gap: 12px; margin-top: 30px; }
.mode {
  display: flex; align-items: center; gap: 16px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 18px; transition: border-color var(--t2), background var(--t2);
}
.mode:hover { border-color: var(--line-2); background: var(--surface-2); }
.mode .m-ic { flex: none; width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; font-size: 25px; }
.mode .m-ic.solid { background: var(--acc); color: var(--acc-ink); }
.mode .m-ic.line { background: var(--surface-3); color: var(--text); border: 1px solid var(--line-2); }
.mode .m-body { flex: 1; min-width: 0; }
.mode .m-body h3 { font-family: var(--f-disp); font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.mode .m-body p { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.mode .m-go { color: var(--faint); font-size: 20px; transition: color var(--t2); }
.mode:hover .m-go { color: var(--text); }

.howline { display: flex; gap: 22px; margin-top: 34px; padding-top: 26px; border-top: 1px solid var(--line); }
.howline .h-item { flex: 1; }
.howline .h-n { font-family: var(--f-mono); font-size: 12px; color: var(--acc); font-weight: 700; }
.howline .h-item h4 { font-size: 14px; font-weight: 600; margin-top: 8px; }
.howline .h-item p { font-size: 12.5px; color: var(--faint); margin-top: 3px; line-height: 1.4; }
@media (max-width: 460px) { .howline { flex-direction: column; gap: 16px; } .howline .h-item { display: flex; gap: 12px; align-items: baseline; } .howline .h-item > div { flex: 1; } }

/* ---------------- avatars ---------------- */
.av { flex: none; border-radius: var(--r-pill); display: grid; place-items: center; color: #0c0c0e; font-family: var(--f-disp); font-weight: 700; box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
.av.s { width: 32px; height: 32px; font-size: 14px; }
.av.m { width: 42px; height: 42px; font-size: 17px; }
.av.l { width: 64px; height: 64px; font-size: 27px; }
.av.xl { width: 120px; height: 120px; font-size: 52px; }

/* ---------------- player setup ---------------- */
.field { display: flex; gap: 10px; margin-bottom: 16px; }
.input {
  flex: 1; padding: 15px 16px; border-radius: var(--r-input);
  background: var(--surface); border: 1px solid var(--line-2); color: var(--text); font-size: 16px;
  transition: border-color var(--t2), box-shadow var(--t2);
}
.input::placeholder { color: var(--faint); }
.input:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }

.players { display: flex; flex-direction: column; gap: 9px; }
.prow {
  display: flex; align-items: center; gap: 13px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-input);
  padding: 10px 10px 10px 11px; animation: popIn .32s var(--e-back) both;
}
.prow .pname { flex: 1; font-weight: 500; font-size: 16px; }
.prow .rm { width: 34px; height: 34px; border-radius: var(--r-pill); display: grid; place-items: center; color: var(--faint); font-size: 17px; transition: background var(--t2), color var(--t2); }
.prow .rm:hover { background: var(--surface-3); color: #ff7a66; }
.note { font-size: 13.5px; color: var(--muted); margin: 12px 2px 0; }

/* ---------------- packs ---------------- */
.pack-grid { display: grid; gap: 11px; }
.pack {
  position: relative; text-align: left; display: flex; gap: 14px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 16px; transition: border-color var(--t2), background var(--t2);
}
.pack:hover { border-color: var(--line-2); }
.pack[aria-pressed="true"] { border-color: var(--acc); background: linear-gradient(180deg, var(--acc-soft), transparent); }
.pack .p-ic { flex: none; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 23px; background: var(--surface-3); color: var(--text); border: 1px solid var(--line-2); transition: background var(--t2), color var(--t2); }
.pack[aria-pressed="true"] .p-ic { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); }
.pack .p-body { flex: 1; min-width: 0; padding-right: 26px; }
.pack h3 { font-family: var(--f-disp); font-weight: 700; font-size: 16.5px; letter-spacing: -0.02em; }
.pack .p-tag { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.pack .p-meta { display: block; font-family: var(--f-mono); font-size: 11px; color: var(--faint); margin-top: 7px; letter-spacing: 0; }
.pack .p-check { position: absolute; top: 15px; right: 15px; width: 22px; height: 22px; border-radius: var(--r-pill); border: 1.5px solid var(--line-3); display: grid; place-items: center; font-size: 13px; color: var(--acc-ink); transition: all var(--t1) var(--e-back); }
.pack[aria-pressed="true"] .p-check { background: var(--acc); border-color: var(--acc); }
.pack .p-check i { opacity: 0; transition: opacity var(--t1); }
.pack[aria-pressed="true"] .p-check i { opacity: 1; }

/* ---------------- options ---------------- */
.opt { display: flex; align-items: center; gap: 14px; padding: 17px 2px; border-bottom: 1px solid var(--line); }
.opt:last-child { border-bottom: none; }
.opt .o-t { flex: 1; }
.opt h4 { font-size: 15.5px; font-weight: 600; }
.opt p { font-size: 13px; color: var(--muted); margin-top: 1px; }
.switch { flex: none; width: 50px; height: 30px; border-radius: var(--r-pill); background: var(--surface-3); border: 1px solid var(--line-2); position: relative; transition: background var(--t2); }
.switch[aria-checked="true"] { background: var(--acc); border-color: var(--acc); }
.switch .kn { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: var(--r-pill); background: var(--text); transition: transform var(--t2) var(--e-back); }
.switch[aria-checked="true"] .kn { transform: translateX(19px); background: var(--acc-ink); }
.stepper { display: flex; align-items: center; gap: 3px; }
.stepper button { width: 38px; height: 38px; border-radius: var(--r-pill); display: grid; place-items: center; background: var(--surface-3); border: 1px solid var(--line-2); font-size: 20px; color: var(--text); transition: border-color var(--t2), background var(--t2); }
.stepper button:hover { border-color: var(--line-3); background: var(--surface); }
.stepper .val { min-width: 38px; text-align: center; font-family: var(--f-mono); font-weight: 700; font-size: 18px; }

.summary { display: flex; gap: 12px; align-items: center; margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px 18px; }
.summary .s-ic { flex: none; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--acc-soft); color: var(--acc); font-size: 22px; }
.summary .s-main { font-weight: 600; font-size: 15px; }
.summary .s-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* custom questions */
.cq-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.cq { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-input); padding: 12px 12px 12px 14px; font-size: 14.5px; animation: popIn .3s var(--e-back) both; }
.cq span { flex: 1; }
.cq .rm { color: var(--faint); font-size: 16px; }

/* ---------------- handoff ---------------- */
.handoff { text-align: center; margin: auto 0; padding: 24px 0; }
.handoff .av { margin: 0 auto 24px; }
.handoff h2 { font-family: var(--f-disp); font-weight: 700; font-size: clamp(34px,9vw,46px); line-height: .98; letter-spacing: -0.03em; }
.handoff .pp { color: var(--muted); margin-top: 14px; font-size: 16px; }
.tag-priv { display: inline-flex; align-items: center; gap: 7px; margin-top: 20px; font-size: 13px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); padding: 9px 14px; border-radius: var(--r-pill); }
.tag-priv i { color: var(--acc); font-size: 16px; }

/* ---------------- ballot ---------------- */
.b-head { margin-bottom: 18px; }
.b-who { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.b-who b { font-weight: 600; }
.progress { height: 6px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: var(--r-pill); background: var(--acc); transition: width var(--t3) var(--e); }
.qcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px; margin-bottom: 14px; }
.qcard .q-n { font-family: var(--f-mono); font-size: 12px; color: var(--acc); font-weight: 700; }
.qcard .q-t { font-family: var(--f-disp); font-weight: 600; font-size: 23px; line-height: 1.08; letter-spacing: -0.02em; margin: 7px 0 18px; }
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
@media (max-width: 380px) { .opt-grid { grid-template-columns: 1fr; } }
.vote { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border-radius: var(--r-input); background: var(--surface-2); border: 1.5px solid transparent; transition: background var(--t2), border-color var(--t2); }
.vote:hover { background: var(--surface-3); }
.vote .vn { font-weight: 500; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vote[aria-pressed="true"] { background: var(--acc-soft); border-color: var(--acc); }

/* ---------------- counting ---------------- */
.counting { text-align: center; margin: auto 0; }
.counting .orb { width: 110px; height: 110px; margin: 0 auto 28px; position: relative; }
.counting .orb i { position: absolute; width: 14px; height: 14px; border-radius: var(--r-pill); top: 0; left: 50%; margin-left: -7px; transform-origin: 7px 55px; }
.counting h2 { font-family: var(--f-disp); font-weight: 700; font-size: 28px; letter-spacing: -0.02em; }
.counting p { color: var(--muted); margin-top: 8px; }

/* ---------------- STAGE (reveal) ---------------- */
.stage {
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column;
  padding: 24px 22px calc(28px + env(safe-area-inset-bottom));
  background: radial-gradient(120% 70% at 50% -5%, #1a1d10 0%, var(--bg) 55%);
  overflow: hidden;
}
.stage .beam { position: absolute; top: -20%; left: 50%; transform: translateX(-50%); width: 150%; height: 80%; background: radial-gradient(closest-side, rgba(203,242,75,.20), transparent 70%); filter: blur(6px); pointer-events: none; animation: beam 4.5s ease-in-out infinite; }
.s-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 2; }
.s-top .step { font-family: var(--f-mono); font-size: 12px; color: var(--acc); font-weight: 700; }
.reveal { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; position: relative; z-index: 2; }
.reveal .award { font-family: var(--f-disp); font-weight: 600; font-size: clamp(26px,7vw,40px); line-height: 1.05; letter-spacing: -0.025em; max-width: 16ch; margin-bottom: 30px; animation: fadeUp .5s var(--e) both; }
.win { animation: winIn .6s var(--e-back) both; }
.win .crown { color: var(--acc); font-size: 30px; margin-bottom: 14px; }
.win .av { margin: 0 auto 18px; box-shadow: 0 0 0 5px rgba(203,242,75,.14), 0 18px 50px rgba(0,0,0,.5); }
.win .wn { font-family: var(--f-disp); font-weight: 700; font-size: clamp(38px,12vw,60px); letter-spacing: -0.03em; line-height: .95; }
.win .ws { color: var(--muted); font-weight: 500; margin-top: 10px; font-size: 15px; }
.win .ws b { color: var(--acc); font-family: var(--f-mono); }
.tally { width: min(340px,84%); margin: 22px auto 0; }
.tally .bar { height: 9px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.tally .bar > span { display: block; height: 100%; border-radius: var(--r-pill); background: var(--acc); width: 0; transition: width .9s var(--e) .2s; }
.runner { margin-top: 18px; color: var(--faint); font-size: 14px; }
.runner b { color: var(--muted); font-weight: 600; }
.s-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 18px; position: relative; z-index: 2; }
.s-dots i { width: 6px; height: 6px; border-radius: var(--r-pill); background: var(--line-3); transition: all var(--t2); }
.s-dots i.on { background: var(--acc); width: 20px; }
.s-act { display: flex; gap: 11px; position: relative; z-index: 2; }

/* ---------------- results ---------------- */
.sheet-h { margin-bottom: 22px; }
.sheet-h h2 { font-family: var(--f-disp); font-weight: 700; font-size: clamp(34px,9vw,46px); letter-spacing: -0.03em; line-height: .96; margin-top: 6px; }
.sheet-h p { color: var(--muted); margin-top: 8px; }
.star {
  display: flex; gap: 15px; align-items: center; margin-bottom: 18px;
  background: linear-gradient(180deg, var(--acc-soft), transparent); border: 1px solid var(--acc); border-radius: var(--r-card-lg); padding: 18px;
}
.star .av { box-shadow: 0 0 0 4px rgba(203,242,75,.16); }
.star .st-k { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--acc); }
.star .st-n { font-family: var(--f-disp); font-weight: 700; font-size: 26px; letter-spacing: -0.02em; line-height: 1; margin-top: 4px; }
.star .st-s { font-size: 13px; color: var(--muted); margin-top: 5px; }
.awards { display: grid; gap: 10px; }
.aw { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px 16px; animation: fadeUp .4s var(--e) both; }
.aw .aw-ic { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); color: var(--acc); font-size: 20px; border: 1px solid var(--line-2); }
.aw .aw-b { flex: 1; min-width: 0; }
.aw .aw-t { font-size: 13px; color: var(--muted); }
.aw .aw-w { font-family: var(--f-disp); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.aw .aw-w .av { box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
.aw .aw-v { flex: none; font-family: var(--f-mono); font-size: 12px; font-weight: 700; color: var(--acc); }

/* ---------------- ONLINE lobby ---------------- */
.lobby-code { text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card-lg); padding: 22px; margin-bottom: 16px; }
.lobby-code .lc-k { font-size: 12px; color: var(--muted); font-weight: 500; }
.lobby-code .code { font-family: var(--f-mono); font-weight: 700; font-size: 38px; letter-spacing: .12em; color: var(--acc); margin: 6px 0 4px; }
.qr { width: 150px; height: 150px; margin: 14px auto 0; background: #fff; border-radius: 14px; padding: 10px; }
.qr svg, .qr img { width: 100%; height: 100%; }
.share-row { display: flex; gap: 10px; margin-top: 16px; }
.live-players { display: grid; gap: 9px; margin-top: 8px; }
.lp { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-input); padding: 10px 14px; animation: popIn .3s var(--e-back) both; }
.lp .pname { flex: 1; font-weight: 500; }
.lp .badge { font-size: 11px; font-weight: 700; color: var(--acc-ink); background: var(--acc); padding: 3px 8px; border-radius: var(--r-pill); }
.lp .you { font-size: 11px; color: var(--faint); font-weight: 600; }
.dotpulse { display: inline-flex; gap: 4px; }
.dotpulse i { width: 6px; height: 6px; border-radius: var(--r-pill); background: var(--acc); animation: pulse 1.2s ease-in-out infinite; }
.dotpulse i:nth-child(2){ animation-delay:.2s } .dotpulse i:nth-child(3){ animation-delay:.4s }

.wait { text-align: center; margin: auto 0; }
.wait .av { margin: 0 auto 22px; }
.wait h2 { font-family: var(--f-disp); font-weight: 700; font-size: clamp(28px,7vw,38px); letter-spacing: -0.02em; }
.wait p { color: var(--muted); margin-top: 10px; }
.wait .bar-wrap { width: min(320px,86%); margin: 22px auto 0; }

/* ---------------- modal ---------------- */
.scrim { position: fixed; inset: 0; background: rgba(8,8,10,.66); backdrop-filter: blur(6px); z-index: 80; display: grid; place-items: center; padding: 22px; animation: fadeIn var(--t2) both; }
.modal { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-card-lg); padding: 24px; box-shadow: var(--sh-3); animation: popIn .34s var(--e-back) both; }
.modal h3 { font-family: var(--f-disp); font-weight: 700; font-size: 23px; letter-spacing: -0.02em; }
.modal p { color: var(--muted); margin: 8px 0 18px; font-size: 14.5px; }

/* ---------------- toast ---------------- */
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: var(--r-pill); font-size: 14px; font-weight: 600; z-index: 90; box-shadow: var(--sh-2); animation: toastIn .3s var(--e-back) both; display: flex; align-items: center; gap: 8px; }
.toast i { color: #1f8a3a; font-size: 17px; }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; }

.spin { width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--acc); margin: 0 auto; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- utils ---------------- */
.stack > * + * { margin-top: 13px; }
.spacer { flex: 1; }
.center-col { display: flex; flex-direction: column; flex: 1; }
.hide { display: none !important; }
.chiprow { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 500; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.chip i { font-size: 15px; color: var(--acc); }

/* ---------------- keyframes ---------------- */
@keyframes popIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes winIn { 0% { opacity: 0; transform: translateY(16px); } 100% { opacity: 1; transform: none; } }
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes beam { 0%,100% { opacity: .75; } 50% { opacity: 1; } }
@keyframes pulse { 0%,100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .06s !important; }
  .grain { display: none; }
}
