/* ==========================================================================
   Diwali Dhamaka — design system (owned by PLAYER+DESIGN; stage.css builds on it)
   --------------------------------------------------------------------------
   TOKENS (:root)
     colour   --bg0 --bg1 --bg2 --ink --ink-2 --muted --faint --line --line-2
              --gold --gold-2 --gold-ink --marigold --pink --teal --emerald --violet --red --sky
              --glass --glass-2 --glass-3            (translucent panel fills)
              --t0..--t3  answer tile colours (pink/teal/marigold/violet), --t-true --t-false
     type     --font --font-num  sizes --fs-xs --fs-s --fs-m --fs-l --fs-xl --fs-2xl --fs-hero
     shape    --r-xs --r-s --r --r-l --r-xl --r-pill
     depth    --shadow --shadow-l --glow-gold --glow-pink
     space    --gut (page gutter) --safe-t --safe-b --safe-l --safe-r
     motion   --ease-out --ease-spring --dur
   LAYOUT
     .dd-root           app root (night-sky background)          .sky-canvas  (fx Sky canvas, fixed)
     .screen            page column (safe-area padded)           .screen.wide .screen.full .screen.center
     .topbar .brand .brand-mark .brand-name   header row         .spacer .row .col .wrap .grow .between .center-x
     .stack-s/.stack/.stack-l  vertical rhythm                   .grid-2 .grid-3
     .bg-rangoli        rotating mandala behind content (absolute, decorative)  .rangoli.rg-spin
   TEXT
     .h-hero .h1 .h2 .h3 .eyebrow .lead .muted .faint .tnum .shimmer (gold shimmer text) .gold .center-text
   CONTROLS
     .btn (gold primary) + .ghost .glass .pink .teal .violet .emerald .danger .big .huge .sm .block .pill
     .icon-btn (+ .sm .lg .on)   .spin (spinner)   .link-btn
     .field > label + .input/.textarea/select    .help    .input.big
     .chips > .chip[aria-pressed=true]  (.chip .chip-emoji .chip-count)
     .switch (input[type=checkbox] + .track)      .stepper (button span button)   .seg > button.on
     .codeboxes (.box .box.filled .box.active .dash, real <input> overlaid)   .codeboxes.shake
   SURFACES
     .card (+ .glow .flat .tight .gold-edge)  .panel  .badge (+ .live .gold .pink .teal)  .divider
     .toast-wrap > .toast(.ok .error .warn .gold .out)   .banner (+ .warn .ok) fixed reconnect banner
   GAME COMPONENTS
     .avatar > .avatar-emoji   (--av colour, --av-size)  .avatar.bounce .avatar.pop .avatar.ring
     .player-chip (avatar + name)   .player-grid (lobby roster)   .player-chip.off (offline) .player-chip.new
     .tiles (.tf for 2) > .tile.t0..t3 (.tile-motif .tile-text .tile-count)
        states: .picked .dim .correct .wrong .locked .reveal   (.tile.true/.false for TF)
     .timer-ring (.tr-svg .tr-track .tr-fill .tr-tip .tr-num) .low .done   (ui.timerRing)
     .getready > .getready-fill (animated bar; set --dur)
     .score-pill (.score-pill .sp-label .sp-value)  .points-big (gold count-up)  .delta.up/.down/.same
     .streak (flame + n)  .streak.hot   .rank-badge (+ .r1 .r2 .r3)
     .q-meta .q-cat .q-num .q-double   .q-text (+ .long)
     .leader-list > .leader-row (+ .me .r1 .r2 .r3) (.lr-rank .lr-name .lr-score .lr-move)
     .podium > .podium-col.p1/.p2/.p3 (.podium-av .podium-name .podium-score .podium-block)  .podium.reveal-3/2/1
     .hint-letters > .hint-word > .hint-box(.shown)    (ui.codeLetters)
     .guess-feed > .guess (.ok .close .miss)
     .react-bar > .react-btn
     .stat-grid > .stat (.stat-v .stat-l)
     .result-hero (.good .bad .slow)  full-screen reveal card on phones
     .diya (.diya-flame .diya-glow) animated lamp (ui.diya)   .rangoli.rg-spin (ui.rangoli)
     .motif   answer tile motif (ui.motif)    .qr-wrap (QR on white card)
   FX
     .fx-overlay (fireworks canvas)  .emoji-layer > .emoji-float (.ef-emoji .ef-label)  .fx-shake
   ANIMATION UTILITIES
     .a-pop .a-pop-in .a-slide-up .a-slide-down .a-fade .a-float .a-bounce .a-pulse .a-flicker .a-wiggle
     stagger: style="--i:3" on children of .stagger
   Keyframes: dd-pop dd-pop-in dd-slide-up dd-slide-down dd-fade dd-float dd-bounce dd-pulse dd-flicker
              dd-shimmer dd-shake dd-spin dd-rise dd-glow dd-wiggle dd-grow dd-drop dd-ripple
   ========================================================================== */

:root {
  --bg0: #120a2a;
  --bg1: #2a0f3d;
  --bg2: #3b1450;
  --ink: #fff6e0;
  --ink-2: #ffe9c2;
  --muted: rgba(255, 246, 224, 0.72);
  --faint: rgba(255, 246, 224, 0.5);
  --line: rgba(255, 220, 160, 0.16);
  --line-2: rgba(255, 220, 160, 0.3);
  --gold: #ffcf5a;
  --gold-2: #ffb020;
  --gold-ink: #3a1d00;
  --marigold: #ff8a1f;
  --pink: #ff3d8b;
  --teal: #18c3b4;
  --emerald: #2fd27a;
  --violet: #7b5cff;
  --red: #ff5a5a;
  --sky: #6fb6ff;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-2: rgba(255, 255, 255, 0.1);
  --glass-3: rgba(255, 255, 255, 0.16);
  --t0: #ff3d8b;
  --t1: #18c3b4;
  --t2: #ff8a1f;
  --t3: #7b5cff;
  --t-true: #2fd27a;
  --t-false: #ff3d8b;

  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-num: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-xs: 12px; --fs-s: 14px; --fs-m: 16px; --fs-l: 19px; --fs-xl: 24px; --fs-2xl: 32px; --fs-hero: clamp(40px, 11vw, 88px);

  --r-xs: 8px; --r-s: 12px; --r: 18px; --r-l: 24px; --r-xl: 32px; --r-pill: 999px;
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.55);
  --shadow-l: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
  --glow-gold: 0 0 0 1px rgba(255, 207, 90, 0.35), 0 0 32px -4px rgba(255, 176, 32, 0.55);
  --glow-pink: 0 0 0 1px rgba(255, 61, 139, 0.4), 0 0 32px -4px rgba(255, 61, 139, 0.55);

  --gut: 16px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);

  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur: 0.35s;
  color-scheme: dark;
}
@media (min-width: 700px) { :root { --gut: 28px; } }
@media (min-width: 1280px) { :root { --gut: 40px; --fs-m: 17px; } }

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg0); }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  font-size: var(--fs-m);
  line-height: 1.4;
  color: var(--ink);
  background:
    radial-gradient(120% 80% at 50% -10%, #3d1655 0%, transparent 60%),
    radial-gradient(90% 60% at 100% 100%, rgba(255, 61, 139, 0.16) 0%, transparent 60%),
    radial-gradient(90% 70% at 0% 90%, rgba(24, 195, 180, 0.12) 0%, transparent 60%),
    radial-gradient(140% 120% at 50% 0%, var(--bg1) 0%, var(--bg0) 65%);
  background-color: var(--bg0);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img, svg, canvas { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--gold); }
h1, h2, h3, h4, p { margin: 0; }
::selection { background: rgba(255, 207, 90, 0.4); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 10px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ layout */
.dd-root { position: relative; min-height: 100vh; min-height: 100dvh; isolation: isolate; overflow-x: hidden; }
.sky-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.dd-root > .sky-canvas, .screen > .sky-canvas { position: fixed; }

.screen {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh; min-height: 100dvh;
  padding: calc(var(--safe-t) + 12px) calc(var(--safe-r) + var(--gut)) calc(var(--safe-b) + 24px) calc(var(--safe-l) + var(--gut));
  display: flex; flex-direction: column; gap: 16px;
}
.screen.wide { max-width: 1120px; }
.screen.full { max-width: none; }
.screen.center { justify-content: center; }
.screen.tight { gap: 10px; }

.topbar { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.topbar .spacer, .spacer { flex: 1; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand-mark { width: 38px; height: 38px; flex: none; display: grid; place-items: center; }
.brand-name { font-weight: 900; font-size: 19px; letter-spacing: 0.01em; white-space: nowrap; }
.brand-name b { color: var(--gold); font-weight: 900; }

.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row.top { align-items: flex-start; }
.col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.between { justify-content: space-between; }
.center-x { justify-content: center; }
.center-text { text-align: center; }
.stack-s > * + * { margin-top: 6px; }
.stack > * + * { margin-top: 12px; }
.stack-l > * + * { margin-top: 22px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 420px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.bg-rangoli { position: absolute; pointer-events: none; z-index: -1; opacity: 0.22; }
.bg-rangoli.center { left: 50%; top: 50%; transform: translate(-50%, -50%); }

/* ------------------------------------------------------------------ text */
.h-hero { font-size: var(--fs-hero); font-weight: 900; line-height: 0.98; letter-spacing: -0.02em; }
.h1 { font-size: clamp(28px, 7vw, 44px); font-weight: 900; line-height: 1.05; letter-spacing: -0.01em; }
.h2 { font-size: clamp(22px, 5.4vw, 30px); font-weight: 850; line-height: 1.12; }
.h3 { font-size: 18px; font-weight: 800; line-height: 1.2; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); }
.lead { font-size: clamp(16px, 4.2vw, 20px); color: var(--muted); line-height: 1.45; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.gold { color: var(--gold); }
.tnum, .tnum * { font-variant-numeric: tabular-nums; font-family: var(--font-num); }
.shimmer {
  background: linear-gradient(100deg, #ffb020 0%, #ffe6a0 22%, #fff8dc 30%, #ffcf5a 42%, #ff9b1f 60%, #ffe6a0 78%, #ffb020 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: dd-shimmer 3.6s linear infinite;
  filter: drop-shadow(0 2px 14px rgba(255, 176, 32, 0.35));
}

/* ------------------------------------------------------------------ buttons */
.btn {
  --b1: #ffd970; --b2: #ffad1f; --bink: var(--gold-ink); --bedge: #b86a00;
  appearance: none; border: 0; position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 22px;
  border-radius: var(--r);
  font-weight: 850; font-size: 17px; letter-spacing: 0.01em;
  color: var(--bink);
  background: linear-gradient(180deg, var(--b1), var(--b2));
  box-shadow: 0 4px 0 var(--bedge), 0 10px 24px -8px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition: transform 0.12s var(--ease-out), box-shadow 0.12s var(--ease-out), filter 0.2s, opacity 0.2s;
  text-decoration: none; white-space: nowrap; user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--bedge), 0 4px 12px -6px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; filter: grayscale(0.3); }
.btn .ico { flex: none; }
.btn.pink { --b1: #ff6aa6; --b2: #ff2f7e; --bink: #fff; --bedge: #a3134c; }
.btn.teal { --b1: #3fe0d0; --b2: #10a99c; --bink: #032b28; --bedge: #06665e; }
.btn.violet { --b1: #9a82ff; --b2: #6a48ff; --bink: #fff; --bedge: #3d22b0; }
.btn.emerald { --b1: #5ae89a; --b2: #22b866; --bink: #032713; --bedge: #117040; }
.btn.danger { --b1: #ff7a7a; --b2: #e83a3a; --bink: #fff; --bedge: #8f1c1c; }
.btn.ghost, .btn.glass {
  color: var(--ink); background: var(--glass-2);
  box-shadow: inset 0 0 0 1.5px var(--line-2), 0 8px 20px -12px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.btn.ghost:active, .btn.glass:active { transform: translateY(1px); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.btn.ghost { background: transparent; }
.btn.big { min-height: 62px; font-size: 20px; border-radius: var(--r-l); padding: 0 28px; }
.btn.huge { min-height: 76px; font-size: 24px; border-radius: var(--r-l); padding: 0 32px; }
.btn.sm { min-height: 40px; font-size: 15px; padding: 0 14px; border-radius: var(--r-s); box-shadow: 0 3px 0 var(--bedge), inset 0 1px 0 rgba(255, 255, 255, 0.5); }
.btn.sm.ghost, .btn.sm.glass { box-shadow: inset 0 0 0 1.5px var(--line-2); }
.btn.block { display: flex; width: 100%; }
.btn.pill { border-radius: var(--r-pill); }
.link-btn { appearance: none; background: none; border: 0; padding: 6px 4px; color: var(--gold); font-weight: 750; text-decoration: underline; text-underline-offset: 3px; }

.icon-btn {
  appearance: none; border: 0; flex: none;
  width: 44px; height: 44px; border-radius: 50%;
  display: inline-grid; place-items: center;
  color: var(--ink); background: var(--glass-2);
  box-shadow: inset 0 0 0 1px var(--line);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: transform 0.12s, background 0.2s;
  touch-action: manipulation;
}
.icon-btn:hover { background: var(--glass-3); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn.sm { width: 36px; height: 36px; }
.icon-btn.lg { width: 56px; height: 56px; }
.icon-btn.on { background: var(--gold); color: var(--gold-ink); }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid currentColor; border-right-color: transparent; animation: dd-spin 0.7s linear infinite; display: inline-block; }

/* ------------------------------------------------------------------ inputs */
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field > label, .label { font-weight: 800; font-size: 14px; color: var(--ink-2); letter-spacing: 0.02em; }
.help { font-size: 13px; color: var(--faint); }
.input, .textarea, select.input {
  width: 100%; min-height: 52px; padding: 12px 16px;
  border-radius: var(--r);
  border: 1.5px solid var(--line-2);
  background: rgba(10, 4, 26, 0.55);
  color: var(--ink); font-size: 17px; font-weight: 650;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.textarea { min-height: 88px; resize: vertical; line-height: 1.4; }
.input::placeholder, .textarea::placeholder { color: rgba(255, 246, 224, 0.38); font-weight: 600; }
.input:focus, .textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(255, 207, 90, 0.2); background: rgba(10, 4, 26, 0.75); }
.input.big { min-height: 64px; font-size: 22px; font-weight: 800; border-radius: var(--r-l); text-align: center; }
.input.err { border-color: var(--red); box-shadow: 0 0 0 4px rgba(255, 90, 90, 0.2); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  appearance: none; border: 0;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px 0 10px;
  border-radius: var(--r-pill);
  background: var(--glass); color: var(--muted);
  box-shadow: inset 0 0 0 1.5px var(--line);
  font-weight: 750; font-size: 15px;
  transition: transform 0.15s var(--ease-spring), background 0.2s, color 0.2s, box-shadow 0.2s;
  touch-action: manipulation;
}
.chip:active { transform: scale(0.95); }
.chip-emoji { font-size: 20px; line-height: 1; }
.chip-count { font-size: 12px; font-weight: 800; opacity: 0.7; }
.chip[aria-pressed="true"] {
  color: var(--gold-ink);
  background: linear-gradient(180deg, #ffe08a, #ffb83a);
  box-shadow: 0 0 0 1.5px rgba(255, 230, 160, 0.8), 0 6px 18px -6px rgba(255, 176, 32, 0.7);
}

.switch { position: relative; display: inline-block; width: 56px; height: 34px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: 99px; background: rgba(255, 255, 255, 0.16); box-shadow: inset 0 0 0 1.5px var(--line); transition: background 0.25s; }
.switch .track::after { content: ""; position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); transition: transform 0.25s var(--ease-spring); }
.switch input:checked + .track { background: linear-gradient(180deg, #ffd970, #ffad1f); }
.switch input:checked + .track::after { transform: translateX(22px); }
.switch input:focus-visible + .track { outline: 3px solid var(--gold); outline-offset: 3px; }

.stepper { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: rgba(10, 4, 26, 0.5); box-shadow: inset 0 0 0 1.5px var(--line); }
.stepper button { appearance: none; border: 0; width: 42px; height: 42px; border-radius: 50%; background: var(--glass-2); color: var(--ink); font-size: 22px; font-weight: 800; line-height: 1; display: grid; place-items: center; touch-action: manipulation; }
.stepper button:active { transform: scale(0.9); background: var(--glass-3); }
.stepper button:disabled { opacity: 0.35; }
.stepper span, .stepper output { min-width: 56px; text-align: center; font-weight: 900; font-size: 20px; font-variant-numeric: tabular-nums; }

.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: var(--r-pill); background: rgba(10, 4, 26, 0.5); box-shadow: inset 0 0 0 1.5px var(--line); }
.seg > button { appearance: none; border: 0; min-height: 40px; padding: 0 16px; border-radius: var(--r-pill); background: transparent; color: var(--muted); font-weight: 800; }
.seg > button.on, .seg > button[aria-pressed="true"] { background: var(--gold); color: var(--gold-ink); }

/* 6 big letter boxes over one real input */
.codeboxes { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(6px, 2vw, 12px); width: 100%; max-width: 440px; margin: 0 auto; }
.codeboxes .box {
  aspect-ratio: 0.82; display: grid; place-items: center;
  border-radius: var(--r);
  background: rgba(10, 4, 26, 0.6);
  box-shadow: inset 0 0 0 2px var(--line-2), 0 8px 24px -12px rgba(0, 0, 0, 0.8);
  font-size: clamp(28px, 9vw, 44px); font-weight: 900; color: var(--gold);
  transition: box-shadow 0.2s, transform 0.2s var(--ease-spring), background 0.2s;
  font-variant-numeric: tabular-nums;
}
.codeboxes .box.filled { background: rgba(255, 207, 90, 0.1); box-shadow: inset 0 0 0 2px rgba(255, 207, 90, 0.7); animation: dd-pop 0.28s var(--ease-spring); }
.codeboxes .box.active { box-shadow: inset 0 0 0 3px var(--gold), 0 0 0 5px rgba(255, 207, 90, 0.18), 0 0 24px rgba(255, 176, 32, 0.4); }
.codeboxes .box.active:not(.filled)::after { content: ""; width: 3px; height: 42%; border-radius: 2px; background: var(--gold); animation: dd-blink 1s steps(1) infinite; }
.codeboxes input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; border: 0; background: transparent; color: transparent; caret-color: transparent;
  font-size: 16px; /* no iOS zoom */ letter-spacing: 1em; text-transform: uppercase;
  cursor: text;
}
.codeboxes.shake { animation: dd-shake 0.5s; }
.codeboxes.err .box { box-shadow: inset 0 0 0 2px var(--red); }

/* ------------------------------------------------------------------ surfaces */
.card {
  position: relative;
  border-radius: var(--r-l);
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.04));
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
}
.card.tight { padding: 12px; border-radius: var(--r); }
.card.flat { box-shadow: inset 0 0 0 1px var(--line); backdrop-filter: none; -webkit-backdrop-filter: none; }
.card.glow { box-shadow: var(--glow-gold), var(--shadow); }
.card.gold-edge::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 220, 140, 0.9), rgba(255, 61, 139, 0.5) 40%, rgba(24, 195, 180, 0.5) 70%, rgba(255, 207, 90, 0.9));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.panel { border-radius: var(--r); background: rgba(10, 4, 26, 0.45); box-shadow: inset 0 0 0 1px var(--line); padding: 14px; }
.divider { height: 1px; background: var(--line); border: 0; margin: 4px 0; }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: var(--r-pill); font-size: 13px; font-weight: 850; background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; }
.badge.gold { background: rgba(255, 207, 90, 0.18); color: var(--gold); box-shadow: inset 0 0 0 1px rgba(255, 207, 90, 0.45); }
.badge.pink { background: rgba(255, 61, 139, 0.18); color: #ff8fbf; box-shadow: inset 0 0 0 1px rgba(255, 61, 139, 0.45); }
.badge.teal { background: rgba(24, 195, 180, 0.18); color: #6ff0e3; box-shadow: inset 0 0 0 1px rgba(24, 195, 180, 0.45); }
.badge.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #ff4d6d; box-shadow: 0 0 0 0 rgba(255, 77, 109, 0.7); animation: dd-ripple 1.6s infinite; }

.toast-wrap { position: fixed; left: 50%; bottom: calc(var(--safe-b) + 20px); transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: min(92vw, 440px); }
.toast { display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: var(--r-pill); background: rgba(24, 12, 48, 0.92); box-shadow: inset 0 0 0 1px var(--line-2), var(--shadow-l); font-weight: 750; font-size: 15px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); animation: dd-slide-up 0.35s var(--ease-spring); transition: opacity 0.35s, transform 0.35s; max-width: 100%; }
.toast.ok { box-shadow: inset 0 0 0 1.5px rgba(47, 210, 122, 0.6), var(--shadow-l); }
.toast.ok .ico { color: var(--emerald); }
.toast.error { box-shadow: inset 0 0 0 1.5px rgba(255, 90, 90, 0.7), var(--shadow-l); }
.toast.error .ico { color: var(--red); }
.toast.warn .ico, .toast.gold .ico { color: var(--gold); }
.toast.gold { box-shadow: var(--glow-gold), var(--shadow-l); }
.toast.out { opacity: 0; transform: translateY(8px); }

.banner {
  position: fixed; top: calc(var(--safe-t) + 10px); left: 50%; transform: translateX(-50%); z-index: 900;
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: var(--r-pill);
  background: rgba(40, 14, 40, 0.94); box-shadow: inset 0 0 0 1.5px rgba(255, 176, 32, 0.6), var(--shadow-l);
  font-weight: 800; font-size: 14px; white-space: nowrap; animation: dd-slide-down 0.35s var(--ease-spring);
}
.banner .spin { width: 16px; height: 16px; border-width: 2.5px; color: var(--gold); }
.banner.ok { box-shadow: inset 0 0 0 1.5px rgba(47, 210, 122, 0.7), var(--shadow-l); }

/* ------------------------------------------------------------------ avatars & players */
.avatar {
  --av: #ff8a1f; --av-size: 48px;
  position: relative; flex: none; display: inline-grid; place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--av) 55%, #fff 45%), var(--av) 55%, color-mix(in srgb, var(--av) 60%, #000 40%));
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85), 0 0 18px -2px color-mix(in srgb, var(--av) 80%, transparent), 0 6px 14px -6px rgba(0, 0, 0, 0.6);
  line-height: 1; user-select: none;
}
.avatar-emoji { display: block; transform: translateY(2%); filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3)); }
.avatar.ring { box-shadow: 0 0 0 3px var(--gold), 0 0 0 6px rgba(255, 207, 90, 0.25), 0 0 30px rgba(255, 176, 32, 0.6); }
.avatar.bounce { animation: dd-bounce 1.6s var(--ease-out) infinite; }
.avatar.pop { animation: dd-pop-in 0.5s var(--ease-spring) both; }

.player-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.player-chip {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px 8px;
  border-radius: var(--r); background: var(--glass); box-shadow: inset 0 0 0 1px var(--line);
  min-width: 0; text-align: center;
}
.player-chip .pc-name { font-weight: 800; font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-chip.me { box-shadow: inset 0 0 0 2px rgba(255, 207, 90, 0.7); background: rgba(255, 207, 90, 0.08); }
.player-chip.off { opacity: 0.45; }
.player-chip.new { animation: dd-pop-in 0.55s var(--ease-spring) both; }
.player-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.player-row .pr-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ------------------------------------------------------------------ answer tiles */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: 100%; }
.tiles.tf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile {
  --tc: var(--t0);
  appearance: none; border: 0; position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 10px;
  min-height: 132px; padding: 14px 14px 16px;
  border-radius: var(--r-l);
  color: #fff; text-align: left;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(255, 255, 255, 0.28), transparent 55%),
    linear-gradient(160deg, color-mix(in srgb, var(--tc) 92%, #fff 8%), color-mix(in srgb, var(--tc) 78%, #000 22%));
  box-shadow: 0 6px 0 color-mix(in srgb, var(--tc) 55%, #000 45%), 0 16px 30px -12px color-mix(in srgb, var(--tc) 70%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: transform 0.16s var(--ease-out), box-shadow 0.16s, opacity 0.3s, filter 0.3s;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.tile::after { /* subtle festive pattern */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.12;
  background-image: radial-gradient(circle at 20% 20%, #fff 1.4px, transparent 1.6px), radial-gradient(circle at 70% 60%, #fff 1.4px, transparent 1.6px);
  background-size: 26px 26px, 34px 34px;
}
.tile.t0 { --tc: var(--t0); }
.tile.t1 { --tc: var(--t1); }
.tile.t2 { --tc: var(--t2); }
.tile.t3 { --tc: var(--t3); }
.tile.true { --tc: var(--t-true); }
.tile.false { --tc: var(--t-false); }
.tile-motif { width: 44px; height: 44px; display: grid; place-items: center; color: rgba(255, 255, 255, 0.95); filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25)); flex: none; }
.tile-text { position: relative; z-index: 1; font-weight: 850; font-size: clamp(17px, 4.6vw, 22px); line-height: 1.15; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); overflow-wrap: anywhere; }
.tile-count { position: absolute; right: 12px; top: 12px; z-index: 1; min-width: 34px; height: 30px; padding: 0 10px; border-radius: 99px; display: grid; place-items: center; background: rgba(0, 0, 0, 0.28); font-weight: 900; font-variant-numeric: tabular-nums; }
.tile:not(:disabled):hover { filter: brightness(1.05); }
.tile:not(:disabled):active { transform: translateY(4px) scale(0.985); box-shadow: 0 2px 0 color-mix(in srgb, var(--tc) 55%, #000 45%), 0 8px 18px -10px color-mix(in srgb, var(--tc) 70%, transparent); }
.tile:disabled { cursor: default; }
.tile.locked { filter: saturate(0.4) brightness(0.65); }
.tile.picked { animation: dd-pick 0.45s var(--ease-spring) both; box-shadow: 0 0 0 4px #fff, 0 0 0 9px color-mix(in srgb, var(--tc) 50%, transparent), 0 20px 40px -10px color-mix(in srgb, var(--tc) 80%, transparent); z-index: 2; filter: none; }
.tile.dim { opacity: 0.28; transform: scale(0.95); filter: saturate(0.5); }
.tile.correct { filter: none; opacity: 1; box-shadow: 0 0 0 4px var(--emerald), 0 0 40px 6px rgba(47, 210, 122, 0.55); }
.tile.correct::before { content: "✓"; position: absolute; right: 12px; bottom: 8px; font-size: 36px; font-weight: 900; z-index: 1; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); }
.tile.wrong { opacity: 0.55; filter: saturate(0.4); }
.tile.wrong.picked::before { content: "✕"; position: absolute; right: 14px; bottom: 8px; font-size: 32px; font-weight: 900; z-index: 1; }
@media (min-width: 700px) {
  .tiles { gap: 16px; }
  .tile { min-height: 168px; padding: 18px 20px 20px; }
  .tile-motif { width: 56px; height: 56px; }
}
@media (max-height: 700px) and (max-width: 500px) { .tile { min-height: 108px; } }

/* ------------------------------------------------------------------ timers */
.timer-ring { position: relative; display: inline-grid; place-items: center; flex: none; }
.timer-ring .tr-svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(0deg); overflow: visible; }
.tr-track { fill: rgba(10, 4, 26, 0.55); stroke: rgba(255, 255, 255, 0.12); stroke-width: 7; }
.tr-fill { fill: none; stroke: var(--gold); stroke-width: 7; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset 0.25s linear, stroke 0.3s; filter: drop-shadow(0 0 4px rgba(255, 176, 32, 0.8)); }
.tr-tip-glow { fill: rgba(255, 207, 90, 0.35); }
.tr-tip-flame { fill: #fff2b8; stroke: #ff8a1f; stroke-width: 1.2; transform-origin: 0 2px; animation: dd-flicker 0.32s ease-in-out infinite alternate; }
.tr-num { position: relative; font-weight: 900; font-size: calc(var(--tr-size, 96px) * 0.36); font-variant-numeric: tabular-nums; line-height: 1; }
.timer-ring.low .tr-fill { stroke: var(--pink); filter: drop-shadow(0 0 6px rgba(255, 61, 139, 0.9)); }
.timer-ring.low .tr-num { color: #ff9cc4; animation: dd-pulse 0.5s ease-in-out infinite alternate; }
.timer-ring.done .tr-tip { display: none; }

.getready { position: relative; height: 12px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.getready-fill { position: absolute; inset: 0; transform-origin: left center; background: linear-gradient(90deg, var(--marigold), var(--gold), #fff2b8); box-shadow: 0 0 16px rgba(255, 176, 32, 0.8); animation: dd-grow var(--dur, 3.5s) linear both; }

/* ------------------------------------------------------------------ scores */
.score-pill { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 6px; border-radius: var(--r-pill); background: rgba(10, 4, 26, 0.6); box-shadow: inset 0 0 0 1.5px rgba(255, 207, 90, 0.4); font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; }
.score-pill .sp-label { font-size: 12px; color: var(--muted); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.score-pill .sp-value { color: var(--gold); font-size: 17px; }
.points-big { font-weight: 900; font-size: clamp(56px, 18vw, 120px); line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 900; font-size: 13px; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--emerald); }
.delta.down { color: #ff7aa8; }
.delta.same { color: var(--faint); }
.streak { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: var(--r-pill); background: rgba(255, 106, 0, 0.16); box-shadow: inset 0 0 0 1.5px rgba(255, 138, 31, 0.5); font-weight: 900; color: #ffc27a; }
.streak .flame { font-size: 1.3em; display: inline-block; transform-origin: 50% 90%; animation: dd-flicker 0.4s ease-in-out infinite alternate; }
.streak.hot { background: linear-gradient(90deg, rgba(255, 61, 0, 0.35), rgba(255, 176, 32, 0.3)); color: #fff2b8; box-shadow: inset 0 0 0 1.5px rgba(255, 176, 32, 0.8), 0 0 24px rgba(255, 106, 0, 0.5); }
.rank-badge { display: inline-grid; place-items: center; min-width: 38px; height: 38px; padding: 0 8px; border-radius: 12px; font-weight: 900; font-variant-numeric: tabular-nums; background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line); }
.rank-badge.r1 { background: linear-gradient(180deg, #ffe58a, #ffb020); color: var(--gold-ink); box-shadow: 0 0 18px rgba(255, 176, 32, 0.6); }
.rank-badge.r2 { background: linear-gradient(180deg, #f3f5ff, #b8bfd6); color: #252a3d; }
.rank-badge.r3 { background: linear-gradient(180deg, #ffc49a, #d9824a); color: #3a1800; }

/* ------------------------------------------------------------------ question */
.q-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.q-num { font-weight: 900; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-variant-numeric: tabular-nums; }
.q-cat { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px 0 8px; border-radius: 99px; background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line); font-weight: 800; font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-cat .e { font-size: 18px; }
.q-double { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 99px; font-weight: 900; font-size: 13px; color: var(--gold-ink); background: linear-gradient(90deg, #ffe08a, #ff9b1f); box-shadow: 0 0 20px rgba(255, 176, 32, 0.6); animation: dd-pulse 0.9s ease-in-out infinite alternate; }
.q-text { font-size: clamp(22px, 6.2vw, 34px); font-weight: 850; line-height: 1.2; letter-spacing: -0.005em; overflow-wrap: anywhere; text-wrap: balance; }
.q-text.long { font-size: clamp(19px, 5.2vw, 28px); }

/* ------------------------------------------------------------------ leaderboard */
.leader-list { display: flex; flex-direction: column; gap: 8px; list-style: none; margin: 0; padding: 0; }
.leader-row {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px;
  padding: 10px 14px 10px 10px; border-radius: var(--r);
  background: var(--glass); box-shadow: inset 0 0 0 1px var(--line);
  animation: dd-slide-up 0.45s var(--ease-spring) both; animation-delay: calc(var(--i, 0) * 70ms);
}
.leader-row.me { background: rgba(255, 207, 90, 0.12); box-shadow: inset 0 0 0 2px rgba(255, 207, 90, 0.7); }
.lr-name { font-weight: 850; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-score { font-weight: 900; font-variant-numeric: tabular-nums; color: var(--gold); }
.lr-move { min-width: 34px; text-align: right; }

/* ------------------------------------------------------------------ podium */
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: clamp(6px, 2vw, 18px); width: 100%; max-width: 760px; margin: 0 auto; padding-top: 30px; }
.podium-col { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; opacity: 0; transform: translateY(40px); transition: opacity 0.6s, transform 0.8s var(--ease-spring); }
.podium-col.p1 { order: 2; } .podium-col.p2 { order: 1; } .podium-col.p3 { order: 3; }
.podium-col.in { opacity: 1; transform: none; }
.podium-name { font-weight: 900; font-size: clamp(14px, 3.8vw, 22px); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.podium-score { font-weight: 900; color: var(--gold); font-variant-numeric: tabular-nums; font-size: clamp(13px, 3.4vw, 20px); }
.podium-block {
  width: 100%; border-radius: var(--r) var(--r) 6px 6px; display: grid; place-items: start center; padding-top: 10px;
  font-weight: 900; font-size: clamp(28px, 8vw, 56px); color: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 20px 40px -14px rgba(0, 0, 0, 0.7);
}
.p1 .podium-block { height: clamp(130px, 30vw, 220px); background: linear-gradient(180deg, #ffe08a, #ffb020 50%, #c2700a); color: var(--gold-ink); }
.p2 .podium-block { height: clamp(96px, 22vw, 165px); background: linear-gradient(180deg, #f0f2ff, #a9b0cb 60%, #6c7392); color: #262b40; }
.p3 .podium-block { height: clamp(72px, 16vw, 125px); background: linear-gradient(180deg, #ffc49a, #d9824a 60%, #8f4a1d); color: #3a1800; }
.p1 .podium-av { position: relative; }
.p1 .podium-av::before { content: "👑"; position: absolute; top: -0.9em; left: 50%; transform: translateX(-50%) rotate(-8deg); font-size: clamp(22px, 6vw, 40px); animation: dd-float 2.4s ease-in-out infinite; }

/* ------------------------------------------------------------------ sketch round */
.hint-letters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; }
.hint-word { display: flex; gap: clamp(4px, 1.2vw, 7px); }
.hint-box {
  width: clamp(26px, 7.4vw, 46px); height: clamp(34px, 9.6vw, 58px);
  display: grid; place-items: center; border-radius: 10px;
  background: rgba(10, 4, 26, 0.55); box-shadow: inset 0 -3px 0 rgba(255, 207, 90, 0.75), inset 0 0 0 1px var(--line);
  font-weight: 900; font-size: clamp(18px, 5vw, 30px); text-transform: uppercase; color: var(--gold);
}
.hint-box.shown { background: rgba(255, 207, 90, 0.18); animation: dd-pop 0.4s var(--ease-spring); }
.guess-feed { display: flex; flex-direction: column; gap: 6px; list-style: none; margin: 0; padding: 0; }
.guess { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border-radius: 14px; background: var(--glass); font-weight: 700; font-size: 14px; animation: dd-slide-up 0.3s var(--ease-out); min-width: 0; }
.guess .g-name { font-weight: 850; flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guess .g-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; color: var(--muted); }
.guess.ok { background: rgba(47, 210, 122, 0.16); box-shadow: inset 0 0 0 1px rgba(47, 210, 122, 0.5); }
.guess.ok .g-text { color: #8ff0b8; font-weight: 850; }
.guess.close { background: rgba(255, 176, 32, 0.14); box-shadow: inset 0 0 0 1px rgba(255, 176, 32, 0.45); }
.guess.close .g-text { color: #ffd27a; }

/* ------------------------------------------------------------------ reactions */
.react-bar { display: flex; gap: 6px; justify-content: space-between; padding: 6px; border-radius: var(--r-pill); background: rgba(10, 4, 26, 0.55); box-shadow: inset 0 0 0 1px var(--line); overflow-x: auto; scrollbar-width: none; }
.react-bar::-webkit-scrollbar { display: none; }
.react-btn { appearance: none; border: 0; flex: none; width: 46px; height: 46px; border-radius: 50%; background: transparent; font-size: 26px; line-height: 1; display: grid; place-items: center; transition: transform 0.15s var(--ease-spring), background 0.2s; touch-action: manipulation; }
.react-btn:active { transform: scale(1.35); background: var(--glass-2); }
.react-btn.sent { animation: dd-pop 0.4s var(--ease-spring); }
@media (max-width: 380px) { .react-btn { width: 40px; height: 40px; font-size: 23px; } }

/* ------------------------------------------------------------------ stats */
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { padding: 12px 14px; border-radius: var(--r); background: rgba(10, 4, 26, 0.45); box-shadow: inset 0 0 0 1px var(--line); min-width: 0; }
.stat-v { font-size: 26px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-l { font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 2px; }

/* ------------------------------------------------------------------ phone reveal hero */
.result-hero {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center;
  min-height: 52vh; padding: 28px 18px; border-radius: var(--r-xl); overflow: hidden;
  background: radial-gradient(100% 80% at 50% 20%, rgba(255, 255, 255, 0.12), transparent 70%), rgba(10, 4, 26, 0.5);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-l);
  animation: dd-pop-in 0.5s var(--ease-spring) both;
}
.result-hero.good { background: radial-gradient(90% 70% at 50% 30%, rgba(47, 210, 122, 0.45), transparent 70%), linear-gradient(180deg, rgba(18, 80, 52, 0.75), rgba(10, 30, 26, 0.75)); box-shadow: inset 0 0 0 2px rgba(47, 210, 122, 0.65), 0 0 60px -10px rgba(47, 210, 122, 0.6); }
.result-hero.bad { background: radial-gradient(90% 70% at 50% 30%, rgba(255, 61, 139, 0.35), transparent 70%), linear-gradient(180deg, rgba(80, 14, 46, 0.75), rgba(30, 8, 30, 0.75)); box-shadow: inset 0 0 0 2px rgba(255, 61, 139, 0.55); }
.result-hero.slow { background: radial-gradient(90% 70% at 50% 30%, rgba(123, 92, 255, 0.35), transparent 70%), rgba(20, 10, 50, 0.7); box-shadow: inset 0 0 0 2px rgba(123, 92, 255, 0.5); }
.rh-emoji { font-size: clamp(64px, 20vw, 110px); line-height: 1; animation: dd-pop-in 0.6s var(--ease-spring) 0.05s both; filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.4)); }
.rh-title { font-size: clamp(30px, 9vw, 52px); font-weight: 900; line-height: 1; }

/* ------------------------------------------------------------------ diya, rangoli, motif, QR */
.diya { overflow: visible; }
.diya .diya-flame { transform-origin: 32px 30px; animation: dd-flicker 0.28s ease-in-out infinite alternate; }
.diya .diya-glow { transform-origin: 32px 26px; animation: dd-glow 1.6s ease-in-out infinite alternate; }
.rangoli.rg-spin { animation: dd-spin 90s linear infinite; }
.rangoli.rg-spin .rg-ring-1 { transform-origin: 0 0; animation: dd-spin 60s linear infinite reverse; }
.motif { display: block; }
.qr-wrap { display: inline-grid; place-items: center; padding: 10px; border-radius: var(--r); background: #fff; box-shadow: var(--glow-gold); }
.qr-wrap svg { display: block; }

/* ------------------------------------------------------------------ fx layers */
.fx-overlay { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; pointer-events: none; z-index: 800; }
.emoji-layer { position: fixed; inset: 0; pointer-events: none; z-index: 780; overflow: hidden; }
.emoji-float { position: absolute; bottom: -70px; display: flex; flex-direction: column; align-items: center; gap: 2px; transform: translateX(-50%); animation: dd-rise var(--dur, 3.4s) cubic-bezier(0.3, 0.6, 0.4, 1) forwards; will-change: transform, opacity; }
.ef-emoji { font-size: var(--sz, 44px); line-height: 1; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45)); }
.ef-label { font-size: 12px; font-weight: 850; padding: 2px 8px; border-radius: 99px; background: rgba(10, 4, 26, 0.7); white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.fx-shake { animation: dd-shake 0.55s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; }

/* ------------------------------------------------------------------ animation utilities */
.a-pop { animation: dd-pop 0.4s var(--ease-spring) both; }
.a-pop-in { animation: dd-pop-in 0.55s var(--ease-spring) both; }
.a-slide-up { animation: dd-slide-up 0.5s var(--ease-spring) both; }
.a-slide-down { animation: dd-slide-down 0.45s var(--ease-spring) both; }
.a-fade { animation: dd-fade 0.5s ease both; }
.a-float { animation: dd-float 4s ease-in-out infinite; }
.a-bounce { animation: dd-bounce 1.6s var(--ease-out) infinite; }
.a-pulse { animation: dd-pulse 1s ease-in-out infinite alternate; }
.a-flicker { animation: dd-flicker 0.3s ease-in-out infinite alternate; }
.a-wiggle { animation: dd-wiggle 1.2s ease-in-out infinite; }
.stagger > * { animation-delay: calc(var(--i, 0) * 80ms); }

@keyframes dd-pop { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes dd-pop-in { 0% { transform: scale(0.3); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes dd-pick { 0% { transform: scale(1); } 35% { transform: scale(1.07); } 100% { transform: scale(1.03); } }
@keyframes dd-slide-up { from { transform: translateY(22px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes dd-slide-down { from { transform: translate(-50%, -20px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
@keyframes dd-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dd-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes dd-bounce { 0%, 100% { transform: translateY(0) scale(1, 1); } 30% { transform: translateY(-16px) scale(0.96, 1.04); } 50% { transform: translateY(0) scale(1.06, 0.94); } 62% { transform: translateY(-5px) scale(1); } 75% { transform: translateY(0); } }
@keyframes dd-pulse { from { transform: scale(1); } to { transform: scale(1.06); } }
@keyframes dd-flicker { 0% { transform: scale(1, 1) rotate(-2deg); opacity: 0.92; } 50% { transform: scale(0.94, 1.06) rotate(1deg); } 100% { transform: scale(1.04, 0.95) rotate(2deg); opacity: 1; } }
@keyframes dd-glow { from { opacity: 0.35; transform: scale(0.92); } to { opacity: 0.7; transform: scale(1.08); } }
@keyframes dd-shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }
@keyframes dd-shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(5px); } 30%, 50%, 70% { transform: translateX(-9px); } 40%, 60% { transform: translateX(9px); } }
@keyframes dd-spin { to { transform: rotate(360deg); } }
@keyframes dd-rise { 0% { transform: translate(-50%, 0) scale(0.6); opacity: 0; } 10% { opacity: 1; transform: translate(-50%, -8vh) scale(1.1); } 100% { transform: translate(calc(-50% + var(--drift, 0px)), -95vh) scale(0.9); opacity: 0; } }
@keyframes dd-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
@keyframes dd-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes dd-drop { from { transform: translateY(-40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes dd-ripple { 0% { box-shadow: 0 0 0 0 rgba(255, 77, 109, 0.7); } 100% { box-shadow: 0 0 0 10px rgba(255, 77, 109, 0); } }
@keyframes dd-blink { 50% { opacity: 0; } }

/* ------------------------------------------------------------------ big screens (iPad / TV) */
@media (min-width: 700px) {
  .btn { min-height: 56px; font-size: 18px; }
  .btn.big { min-height: 66px; font-size: 21px; }
  .card { padding: 24px; }
  .q-text { font-size: clamp(28px, 4vw, 48px); }
}
@media (min-width: 1280px) {
  .h1 { font-size: 52px; }
  .card { padding: 28px; border-radius: var(--r-xl); }
}

/* ------------------------------------------------------------------ reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .getready-fill { animation: dd-grow var(--dur, 3.5s) linear both !important; animation-duration: var(--dur, 3.5s) !important; }
  .shimmer { animation: none; background-position: 30% 0; }
  .rangoli.rg-spin, .rangoli.rg-spin .rg-ring-1, .avatar.bounce, .a-float, .a-bounce, .diya .diya-flame, .diya .diya-glow { animation: none !important; }
  .podium-col { transition: opacity 0.2s !important; transform: none; }
  .emoji-float { animation: dd-fade-rise-reduced var(--dur, 1.6s) linear forwards !important; animation-duration: var(--dur, 1.6s) !important; }
}
@keyframes dd-fade-rise-reduced { 0% { opacity: 0; transform: translate(-50%, -20vh); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -30vh); } }

/* ==========================================================================
   PAGES (landing / home / create / join / play) — page-scoped, owned by PLAYER+DESIGN
   ========================================================================== */

/* ---------- landing */
.landing { gap: 28px; }
.hero { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; padding: 28px 0 8px; }
.hero-art { position: absolute; inset: -40px 0 auto; height: 520px; display: grid; place-items: center; pointer-events: none; z-index: -1; }
.hero-rangoli { width: min(560px, 130vw); height: auto; opacity: 0.32; filter: drop-shadow(0 0 30px rgba(255, 176, 32, 0.25)); }
.hero-diyas { display: flex; align-items: flex-end; gap: 14px; margin-bottom: -4px; }
.hero-diyas .hd { filter: drop-shadow(0 6px 18px rgba(255, 138, 31, 0.6)); }
.hero-diyas .hd1, .hero-diyas .hd3 { animation: dd-float 4.5s ease-in-out infinite; }
.hero-diyas .hd3 { animation-delay: -2s; }
.hero-title { margin-top: 6px; }
.hero-title > span:last-child { display: inline-block; color: #fff; text-shadow: 0 0 40px rgba(255, 61, 139, 0.55), 0 4px 0 #ff3d8b; }
.hero-lead { max-width: 560px; }
.hero-cta { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.google-btn { --b1: #ffffff; --b2: #f1ecff; --bink: #1f1640; --bedge: #b8a9e8; }
.g-disc { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08); }
.landing-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.preview { display: flex; flex-direction: column; gap: 14px; }
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.preview .q-text { font-size: clamp(19px, 5vw, 26px); }
.demo-tiles .tile { min-height: 96px; animation: dd-slide-up 0.6s var(--ease-spring) both; animation-delay: calc(var(--i, 0) * 90ms + 200ms); cursor: default; }
.demo-tiles .tile:nth-child(1) { animation-name: dd-slide-up; }
.code-card { display: flex; flex-direction: column; gap: 14px; align-self: start; }
.code-card .codeboxes .box { font-size: clamp(24px, 7.5vw, 38px); }
.how { display: flex; flex-direction: column; gap: 16px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.step { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; row-gap: 4px; align-items: center; }
.step-n { display: none; }
.step-e { grid-row: 1 / span 2; font-size: 34px; width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; background: rgba(255, 207, 90, 0.12); box-shadow: inset 0 0 0 1px rgba(255, 207, 90, 0.3); }
.feats { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.feat { display: flex; gap: 14px; align-items: flex-start; padding: 4px 2px; }
.feat-e { font-size: 28px; flex: none; width: 46px; text-align: center; }
.final-cta { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px 20px; }
.final-cta .btn { max-width: 380px; }
.dd-footer { text-align: center; color: var(--faint); font-size: 13px; padding: 10px 0 4px; }
.dd-footer a { color: var(--muted); }
@media (min-width: 760px) {
  .landing-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { padding-top: 56px; }
}
@media (min-width: 1100px) {
  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .step { grid-template-columns: 1fr; text-align: left; }
  .step-e { grid-row: auto; margin-bottom: 8px; }
  .feats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .feat { flex-direction: column; }
}

/* ---------- home */
.home { gap: 22px; }
.home-hero { position: relative; padding: 18px 0 4px; display: flex; flex-direction: column; gap: 8px; }
.home-hero-art { position: absolute; right: -90px; top: -60px; z-index: -1; opacity: 0.28; pointer-events: none; }
.home-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.action-card { display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.ac-art { position: absolute; right: 14px; top: 10px; opacity: 0.95; pointer-events: none; }
.ac-emoji { font-size: 54px; display: block; transform: rotate(10deg); filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4)); }
.action-card .h2, .action-card > p { padding-right: 86px; }
.join-card .codeboxes .box { font-size: clamp(24px, 7.5vw, 36px); }
.recent { display: flex; flex-direction: column; gap: 12px; }
.recent-h { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.recent-ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.recent-link { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 12px 12px 12px 12px; border-radius: var(--r); background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); text-decoration: none; transition: background 0.2s, transform 0.15s; }
.recent-link:hover { background: var(--glass-2); }
.recent-link:active { transform: scale(0.99); }
.recent-code { font-weight: 900; letter-spacing: 0.08em; color: var(--gold); padding: 6px 10px; border-radius: 10px; background: rgba(255, 207, 90, 0.1); font-size: 14px; }
.recent-main { display: flex; flex-direction: column; min-width: 0; }
.recent-title { font-weight: 850; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-sub { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-row { animation: dd-slide-up 0.45s var(--ease-spring) both; animation-delay: calc(var(--i, 0) * 60ms); }
.skel-row { height: 66px; border-radius: var(--r); background: linear-gradient(90deg, var(--glass) 0%, var(--glass-2) 50%, var(--glass) 100%); background-size: 200% 100%; animation: dd-shimmer 1.4s linear infinite; }
.empty-recent { padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.er-e { font-size: 40px; }
@media (max-width: 420px) { .recent-link .badge { display: none; } .recent-link { grid-template-columns: auto minmax(0, 1fr) auto; } }
@media (min-width: 760px) { .home-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- create */
.create { gap: 18px; padding-bottom: calc(var(--safe-b) + 120px); }
.create-head { display: flex; flex-direction: column; gap: 4px; }
.create-body { gap: 14px; }
.loading-card { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 36px; }
.create-sec { display: flex; flex-direction: column; gap: 14px; }
.cs-head { display: flex; gap: 12px; align-items: flex-start; }
.cs-emoji { font-size: 26px; width: 44px; height: 44px; flex: none; border-radius: 14px; display: grid; place-items: center; background: rgba(255, 207, 90, 0.12); box-shadow: inset 0 0 0 1px rgba(255, 207, 90, 0.28); }
.cs-body { gap: 16px; }
.form-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.form-row > .grow { min-width: 140px; }
.form-row .seg { flex-wrap: wrap; max-width: 100%; }
.form-row .seg > button { padding: 0 12px; min-width: 50px; }
@media (max-width: 420px) { .form-row .seg { width: 100%; justify-content: space-between; } .form-row .seg > button { flex: 1; padding: 0 4px; min-width: 0; } }
.custom-list { gap: 12px; }
.custom-q { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.custom-opts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.custom-opt { display: flex; align-items: center; gap: 8px; }
.custom-opt .input { min-height: 46px; font-size: 16px; }
.opt-mark { appearance: none; border: 0; flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: color-mix(in srgb, var(--tc, var(--t0)) 40%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--tc, var(--t0)) 80%, transparent); opacity: 0.75; }
.opt-mark.t0 { --tc: var(--t0); } .opt-mark.t1 { --tc: var(--t1); } .opt-mark.t2 { --tc: var(--t2); } .opt-mark.t3 { --tc: var(--t3); }
.opt-mark.on { opacity: 1; background: var(--tc); box-shadow: 0 0 0 3px #fff, 0 0 16px color-mix(in srgb, var(--tc) 70%, transparent); }
@media (min-width: 600px) { .custom-opts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.create-go {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  padding: 12px calc(var(--gut) + var(--safe-r)) calc(12px + var(--safe-b)) calc(var(--gut) + var(--safe-l));
  background: linear-gradient(180deg, rgba(18, 10, 42, 0) 0%, rgba(18, 10, 42, 0.92) 30%, rgba(18, 10, 42, 0.98) 100%);
  display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.create-go .btn { max-width: 528px; }
.create-summary { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; font-size: 14px; color: var(--muted); }
.create-summary b { color: var(--ink); font-variant-numeric: tabular-nums; }
.cs-dot { color: var(--faint); }

/* ---------- join */
.join-stage { flex: 1; justify-content: center; gap: 18px; padding-bottom: 20px; }
.join-code { gap: 16px; }
.join-hero { display: grid; place-items: center; height: 84px; }
.jh-emoji { font-size: 64px; filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.4)); display: inline-block; }
.join-err { min-height: 1.4em; color: #ff9aa8; font-weight: 750; text-align: center; font-size: 15px; }
.host-choice { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.join-profile { gap: 14px; }
.join-game-pill { display: flex; align-items: center; gap: 10px; justify-content: center; min-width: 0; }
.jg-title { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.join-preview { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 16px 18px; text-align: center; }
.join-preview-av { height: 120px; display: grid; place-items: end center; }
.join-preview-name { font-size: 26px; font-weight: 900; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.av-pick { appearance: none; border: 0; background: var(--glass); border-radius: 18px; aspect-ratio: 1; display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line); transition: transform 0.15s var(--ease-spring), background 0.2s, box-shadow 0.2s; touch-action: manipulation; padding: 0; }
.av-pick .avatar { width: 78% !important; height: 78% !important; box-shadow: none; }
.av-pick:active { transform: scale(0.92); }
.av-pick.on { background: rgba(255, 207, 90, 0.2); box-shadow: inset 0 0 0 3px var(--gold), 0 0 18px rgba(255, 176, 32, 0.45); transform: scale(1.04); }
@media (min-width: 520px) { .avatar-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.join-go { position: sticky; bottom: calc(var(--safe-b) + 10px); z-index: 5; padding-top: 6px; }
.join-go .btn { box-shadow: 0 5px 0 var(--bedge), 0 18px 40px -10px rgba(0, 0, 0, 0.8), 0 0 40px -6px rgba(255, 176, 32, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.55); }

/* ---------- play: chrome */
.play { gap: 12px; padding-top: calc(var(--safe-t) + 8px); }
.play-top { min-height: 44px; gap: 8px; }
.pt-me { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pt-av { display: inline-flex; }
.pt-name { font-weight: 850; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; max-width: 40vw; }
.play-top .score-pill { height: 38px; padding: 0 12px; }
.play-stage { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.play-stage > * { flex: 1; }
.play-loading { justify-content: center; align-items: center; gap: 12px; }
.gone { justify-content: center; align-items: center; gap: 14px; }
.gone-e { font-size: 72px; }

/* ---------- play: lobby */
.lobby { gap: 16px; }
.lobby-hero { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 0 6px; }
.lobby-rangoli { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); width: 330px; z-index: -1; opacity: 0.35; pointer-events: none; }
.lobby-title { font-size: clamp(40px, 12vw, 60px); }
.lobby-av { height: 150px; display: grid; place-items: end center; }
.lobby-name { font-size: 26px; font-weight: 900; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.waiting { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.dots i { font-style: normal; animation: dd-blink 1.4s infinite; display: inline-block; }
.dots i:nth-child(2) { animation-delay: 0.2s; } .dots i:nth-child(3) { animation-delay: 0.4s; }
.lobby-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }

/* ---------- play: question */
.question { gap: 14px; }
.question .tiles { flex: 1; min-height: 300px; grid-auto-rows: 1fr; }
.question .tiles .tile { min-height: 0; }
.question .tiles.tf { min-height: 260px; }
.q-head { display: flex; align-items: flex-start; gap: 12px; }
.q-head-l { flex: 1; gap: 8px; min-width: 0; }
.getready-wrap { display: flex; flex-direction: column; gap: 8px; transition: opacity 0.25s, transform 0.25s; }
.getready-wrap.gone { opacity: 0; transform: translateY(-6px); }
.gr-label { display: flex; align-items: center; gap: 8px; font-weight: 850; color: var(--gold); }
.gr-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px var(--gold); animation: dd-pulse 0.5s ease-in-out infinite alternate; }
.tiles:not(.open) .tile { filter: saturate(0.55) brightness(0.75); }
.tiles.open .tile { animation: dd-pop 0.35s var(--ease-spring) both; }
.tiles.open .tile:nth-child(2) { animation-delay: 40ms; } .tiles.open .tile:nth-child(3) { animation-delay: 80ms; } .tiles.open .tile:nth-child(4) { animation-delay: 120ms; }
.tiles.open .tile.picked { animation: dd-pick 0.45s var(--ease-spring) both; }
.tiles.tf .tile { min-height: 180px; align-items: center; justify-content: center; text-align: center; }
.tiles.tf .tile-motif { width: 60px; height: 60px; }
.tiles.tf .tile-text { font-size: 26px; }
.tiles.three .tile:last-child { grid-column: 1 / -1; min-height: 100px; }
.q-status { min-height: 56px; display: grid; place-items: center; text-align: center; }
.locked-in { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.li-title { font-size: 24px; font-weight: 900; color: var(--gold); text-shadow: 0 0 20px rgba(255, 176, 32, 0.6); }
.li-sub { color: var(--muted); font-weight: 750; }
.q-err { color: #ff9aa8; font-weight: 750; }

/* ---------- play: reveal */
.reveal { gap: 14px; }
.tile.mini { min-height: 0; width: 100%; max-width: 340px; flex-direction: row; align-items: center; justify-content: flex-start; padding: 12px 16px; gap: 12px; }
.tile.mini .tile-motif { width: 32px; height: 32px; }
.tile.mini::before { position: static; margin-left: auto; font-size: 26px; order: 3; }
.rh-break { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; font-size: 13px; font-weight: 800; color: rgba(255, 255, 255, 0.85); }
.rh-break span { padding: 4px 10px; border-radius: 99px; background: rgba(0, 0, 0, 0.25); }
.fact { display: flex; gap: 12px; align-items: flex-start; }
.fact-e { font-size: 24px; flex: none; }
.fact p { color: var(--ink-2); }
.rank-line { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 850; font-size: 17px; text-align: left; padding: 4px 0; animation: dd-slide-up 0.5s var(--ease-spring) 0.3s both; }

/* ---------- play: leaderboard */
.leaderboard { gap: 14px; }
.big-rank { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0 6px; animation: dd-pop-in 0.6s var(--ease-spring) both; }
.br-label { font-weight: 800; color: var(--muted); font-size: 18px; }
.br-num { font-size: clamp(72px, 24vw, 128px); font-weight: 900; line-height: 0.95; }
.br-move { display: inline-flex; align-items: center; gap: 6px; font-weight: 900; padding: 6px 14px; border-radius: 99px; }
.br-move.up { color: #0d3a22; background: var(--emerald); box-shadow: 0 0 24px rgba(47, 210, 122, 0.6); }
.br-move.down { color: #ffd0e0; background: rgba(255, 61, 139, 0.25); }
.br-move.same { color: var(--muted); background: var(--glass-2); }
.br-score { color: var(--muted); font-weight: 750; }
.br-score b { color: var(--gold); font-size: 20px; }
.lr-gap { text-align: center; color: var(--faint); letter-spacing: 0.3em; list-style: none; }

/* ---------- play: sketch */
.draw-pick, .drawer { justify-content: center; align-items: center; gap: 14px; }
.dp-art { position: relative; display: grid; place-items: center; height: 200px; }
.dp-art .rangoli { position: absolute; opacity: 0.5; }
.dp-emoji { font-size: 84px; position: relative; filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.45)); display: inline-block; }
.dp-drawer { height: 110px; display: grid; place-items: end center; }
.rules { display: flex; flex-direction: column; gap: 10px; text-align: left; width: 100%; }
.rule { display: flex; align-items: center; gap: 12px; font-weight: 750; }
.rule-e { font-size: 22px; width: 32px; text-align: center; flex: none; }
.drawer-ring { padding: 6px; }
.drawer-solved { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ds-count { font-size: 18px; font-weight: 800; color: var(--muted); }
.ds-count b { color: var(--gold); font-size: 28px; }
.ds-avs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.guess-scene { gap: 10px; }
.gs-head { display: flex; align-items: center; gap: 10px; }
.gs-who { font-weight: 850; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sketch-box { position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: var(--r-l); overflow: hidden; background: #fff6e6; box-shadow: 0 0 0 3px rgba(255, 207, 90, 0.55), 0 18px 40px -16px rgba(0, 0, 0, 0.8); display: grid; place-items: center; }
.sketch-box canvas { display: block; }
.sketch-wait { position: absolute; inset: 0; display: grid; place-items: center; color: #6b4a2a; font-weight: 800; }
.hint-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0; }
.guess-form { display: flex; gap: 8px; }
.guess-input { flex: 1; min-width: 0; min-height: 56px; font-size: 18px; }
.send-btn { width: 60px; min-height: 56px; padding: 0; flex: none; }
.guess-feedback { min-height: 1.5em; text-align: center; font-weight: 850; font-size: 17px; }
.guess-feedback.correct { color: #8ff0b8; }
.guess-feedback.close { color: var(--gold); }
.guess-feedback.miss, .guess-feedback.already { color: var(--muted); }
.solved-card { background: linear-gradient(180deg, rgba(47, 210, 122, 0.3), rgba(47, 210, 122, 0.12)); box-shadow: inset 0 0 0 2px rgba(47, 210, 122, 0.6), 0 0 40px -10px rgba(47, 210, 122, 0.7); }
.sc-e { font-size: 40px; }
.reveal-word .hint-box { background: rgba(255, 207, 90, 0.2); color: #fff; box-shadow: inset 0 -3px 0 var(--gold), 0 0 16px rgba(255, 176, 32, 0.35); }
.solvers { display: flex; flex-direction: column; gap: 10px; }

/* ---------- play: podium */
.podium-scene { gap: 16px; }
.podium-scene .podium { padding-top: 46px; }
.my-final { display: flex; flex-direction: column; gap: 14px; }
.rematch-slot:empty { display: none; }

/* ---------- play on iPad / desktop: keep it phone-shaped but roomier */
@media (min-width: 700px) {
  .play .screen, .screen.play { max-width: 620px; }
  .tiles.tf .tile { min-height: 220px; }
}
