/* ============================================================
   HANDS UP!  —  "broadcast studio" design system
   Dark, quiet, expensive. Colour used as light, not as paint.
   ============================================================ */

:root {
  /* surfaces */
  --bg:        #08090F;
  --bg-2:      #0C0E16;
  --surface:   #12141F;
  --surface-2: #181B28;
  --surface-3: #1F2331;
  --line:      rgba(255,255,255,.07);
  --line-2:    rgba(255,255,255,.13);

  /* ink */
  --text:   #ECEEF5;
  --text-2: #B7BCCC;
  --muted:  #7E8599;

  /* accents */
  --accent:   #7C5CFF;
  --accent-2: #22D3EE;
  --gold:     #E8B750;
  --good:     #2FD39B;
  --bad:      #F2607C;
  --amber:    #F0A338;

  --grad: linear-gradient(135deg, var(--accent), var(--accent-2));

  /* depth */
  --shadow:    0 18px 44px -16px rgba(0,0,0,.8);
  --shadow-lg: 0 34px 80px -24px rgba(0,0,0,.9);
  --inset:     inset 0 1px 0 rgba(255,255,255,.055);

  --r:    18px;
  --r-lg: 24px;
  --r-sm: 12px;

  --display: "Sora", system-ui, sans-serif;
  --body:    "Inter", system-ui, sans-serif;

  --ease: cubic-bezier(.22,.61,.36,1);
}

:root[data-theme="light"] {
  --bg:        #F4F5F9;
  --bg-2:      #EDEFF5;
  --surface:   #FFFFFF;
  --surface-2: #F7F8FC;
  --surface-3: #EEF0F6;
  --line:      rgba(12,14,22,.09);
  --line-2:    rgba(12,14,22,.16);
  --text:      #0D0F17;
  --text-2:    #3C4255;
  --muted:     #6B7287;
  --shadow:    0 14px 34px -16px rgba(16,20,40,.3);
  --shadow-lg: 0 30px 70px -28px rgba(16,20,40,.35);
  --inset:     inset 0 1px 0 rgba(255,255,255,.9);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; min-height: 100%;
  font-family: var(--body);
  font-size: 16px;
  font-weight: 450;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}

h1, h2, h3, .head {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -.022em;
  line-height: 1.12;
  margin: 0;
}
h1 { font-size: clamp(26px, 4.4vw, 38px); }
h2 { font-size: 19px; }

/* ---------- ambient background ---------- */
.bg-blobs { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.blob {
  position: absolute; border-radius: 50%;
  filter: blur(100px);
  opacity: .30;
  animation: drift 34s var(--ease) infinite alternate;
}
:root[data-theme="light"] .blob { opacity: .22; filter: blur(90px); }
.blob.b1 { width: 54vmax; height: 54vmax; background: #4C3AFF; top: -22%; left: -14%; }
.blob.b2 { width: 44vmax; height: 44vmax; background: #0E7490; top: 28%; right: -18%; animation-duration: 44s; }
.blob.b3 { width: 38vmax; height: 38vmax; background: #5B21B6; bottom: -18%; left: 16%; animation-duration: 39s; }
.blob.b4 { width: 30vmax; height: 30vmax; background: #0F766E; bottom: 8%; right: 18%; animation-duration: 49s; opacity: .22; }
@keyframes drift {
  from { transform: translate3d(0,0,0) scale(1); }
  to   { transform: translate3d(5vmax,-4vmax,0) scale(1.18); }
}

/* a fine grid, barely there */
.doodles {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
}
:root[data-theme="light"] .doodles {
  background-image:
    linear-gradient(rgba(12,14,22,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(12,14,22,.04) 1px, transparent 1px);
}
.doodle { display: none; }

/* ---------- layout ---------- */
.wrap { max-width: 560px; margin: 0 auto; padding: 18px 16px 124px; position: relative; }
.wrap.wide { max-width: 1280px; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrapped { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.center { justify-content: center; }
.col { display: flex; flex-direction: column; gap: 14px; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 14px; }
.hide { display: none !important; }

/* ---------- panels ---------- */
.sticker {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow), var(--inset);
  padding: 22px;
  position: relative;
}
.sticker.flat { padding: 15px; border-radius: var(--r); box-shadow: none; background: var(--surface); }
.sticker.tilt-l, .sticker.tilt-r { transform: none; }

/* a hairline of accent across the top of feature panels */
.sticker.lit::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: var(--grad); opacity: .85;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--body);
  font-size: 11px; font-weight: 700;
  letter-spacing: .11em; text-transform: uppercase;
  padding: 6px 11px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
}
.tag.pink  { color: #fff; background: rgba(124,92,255,.16); border-color: rgba(124,92,255,.42); }
.tag.mint  { color: var(--good); background: rgba(47,211,155,.12); border-color: rgba(47,211,155,.34); }
.tag.sky   { color: var(--accent-2); background: rgba(34,211,238,.12); border-color: rgba(34,211,238,.32); }
.tag.grape { color: #C4B5FD; background: rgba(124,92,255,.16); border-color: rgba(124,92,255,.42); }

/* ---------- buttons ---------- */
.btn {
  font-family: var(--body);
  font-size: 15px; font-weight: 650;
  letter-spacing: -.01em;
  padding: 13px 20px;
  border: 1px solid var(--line-2);
  border-radius: 13px;
  background: var(--surface-3);
  color: var(--text);
  cursor: pointer;
  transition: transform .14s var(--ease), background .2s, border-color .2s, box-shadow .2s, opacity .2s;
  user-select: none; text-align: center; text-decoration: none;
  display: inline-block;
  box-shadow: var(--inset);
}
.btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--line-2); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0) scale(.985); }
.btn:disabled { opacity: .38; cursor: not-allowed; }

.btn.pink, .btn.grape {
  background: var(--grad); border-color: transparent; color: #fff;
  box-shadow: 0 10px 26px -12px rgba(124,92,255,.9);
}
.btn.pink:hover:not(:disabled), .btn.grape:hover:not(:disabled) { filter: brightness(1.08); }
.btn.mint { background: rgba(47,211,155,.14); border-color: rgba(47,211,155,.4); color: var(--good); }
.btn.sky  { background: rgba(34,211,238,.12); border-color: rgba(34,211,238,.36); color: var(--accent-2); }
.btn.tang { background: rgba(242,96,124,.12); border-color: rgba(242,96,124,.4); color: var(--bad); }
.btn.ghost { background: transparent; color: var(--text-2); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.btn.sm { font-size: 13.5px; padding: 9px 14px; border-radius: 11px; }
.btn.xs { font-size: 12.5px; padding: 7px 11px; border-radius: 9px; font-weight: 600; }
.btn.block { display: block; width: 100%; }
.btn.big { font-size: 17px; padding: 16px 24px; border-radius: 15px; }

/* ---------- inputs ---------- */
.inp, select.inp, textarea.inp {
  font-family: var(--body); font-weight: 500; font-size: 15.5px;
  width: 100%; padding: 13px 15px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--bg-2);
  color: var(--text);
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.inp::placeholder { color: var(--muted); }
.inp:focus { border-color: rgba(124,92,255,.75); box-shadow: 0 0 0 4px rgba(124,92,255,.16); }
.inp.code {
  font-family: var(--display); font-size: 27px; font-weight: 600;
  text-align: center; letter-spacing: .34em; text-transform: uppercase;
  padding-left: 15px; padding-right: 0;
}
label.lab {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--muted);
  display: block; margin-bottom: 7px;
}
textarea.inp { resize: vertical; min-height: 78px; line-height: 1.5; }

/* ---------- avatars (monograms, not cartoons) ---------- */
.ava {
  --a: var(--accent);
  width: 42px; height: 42px; flex: 0 0 auto;
  border-radius: 13px;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 600;
  font-size: 15px; letter-spacing: .01em;
  color: #fff;
  background: linear-gradient(145deg, var(--a), color-mix(in srgb, var(--a) 42%, #0B0D15));
  box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--a) 70%, transparent), var(--inset);
  border: 1px solid color-mix(in srgb, var(--a) 40%, transparent);
  overflow: hidden;
}
.tc > .ava, .ava.center { margin-inline: auto; }
.ava.sm { width: 32px; height: 32px; font-size: 12px; border-radius: 10px; }
.ava.lg { width: 60px; height: 60px; font-size: 21px; border-radius: 18px; }
.ava.xl { width: 92px; height: 92px; font-size: 32px; border-radius: 26px; }
.ava.joy   { animation: joy .7s var(--ease) 1; }
.ava.dizzy { animation: dizzy .7s var(--ease) 1; }
@keyframes joy   { 0%,100%{transform:translateY(0)} 35%{transform:translateY(-10px) scale(1.06)} }
@keyframes dizzy { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-5px) rotate(-4deg)} 75%{transform:translateX(5px) rotate(4deg)} }

/* ---------- lobby ---------- */
.bubbles { display: flex; flex-wrap: wrap; gap: 16px 14px; justify-content: center; padding: 4px 0; }
.bub { display: flex; flex-direction: column; align-items: center; gap: 7px; max-width: 92px; }
.bub span.nm {
  font-size: 12.5px; font-weight: 550; color: var(--text-2);
  text-align: center; word-break: break-word; line-height: 1.25;
}
@keyframes popin { from { transform: translateY(8px) scale(.96); opacity: 0 } to { transform: none; opacity: 1 } }
.popin { animation: popin .4s var(--ease) both; }

/* ---------- the hand button ---------- */
.hand-zone { display: grid; place-items: center; padding: 10px 0 4px; }
.hand-btn {
  position: relative;
  width: min(58vw, 252px); aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.14);
  background:
    radial-gradient(120% 120% at 32% 22%, rgba(255,255,255,.14), rgba(255,255,255,0) 52%),
    linear-gradient(150deg, #2A1E66, #0E1120 68%);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 26px 60px -24px rgba(124,92,255,.75), var(--inset);
  transition: transform .16s var(--ease), box-shadow .22s, filter .22s, border-color .22s;
  overflow: hidden;
}
.hand-btn::after {            /* accent ring */
  content: ""; position: absolute; inset: -1px; border-radius: 50%;
  padding: 1px; background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: .5; transition: opacity .25s;
}
.hand-btn .emo {
  width: 42%; display: grid; place-items: center;
  transform: translateY(-6px);
}
.hand-btn .emo svg { width: 100%; height: auto; display: block; }
.hand-btn .cap {
  position: absolute; bottom: 19%;
  font-family: var(--body); font-size: clamp(11px, 2.9vw, 13px);
  font-weight: 700; letter-spacing: .17em; text-transform: uppercase;
  color: rgba(255,255,255,.72);
}
.hand-btn.live { animation: breathe 2.6s var(--ease) infinite; }
.hand-btn.live::after { opacity: 1; }
@keyframes breathe {
  0%,100% { box-shadow: 0 26px 60px -24px rgba(124,92,255,.75), 0 0 0 0 rgba(124,92,255,.32), var(--inset); }
  50%     { box-shadow: 0 30px 70px -22px rgba(124,92,255,.95), 0 0 0 16px rgba(124,92,255,0), var(--inset); }
}
.hand-btn:hover:not(:disabled) { filter: brightness(1.1); }
.hand-btn:active:not(:disabled) { transform: scale(.955); }
.hand-btn:disabled {
  cursor: not-allowed; animation: none;
  background: linear-gradient(150deg, #15171F, #0C0E15);
  border-color: var(--line);
  box-shadow: none;
  color: var(--muted);
}
.hand-btn:disabled::after { opacity: .12; }
.hand-btn:disabled .emo { opacity: .35; }

/* ---------- option tiles ---------- */
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.opts.one-col { grid-template-columns: 1fr; }
.opt {
  --a: var(--accent);
  display: flex; align-items: center; gap: 12px;
  font-family: var(--body); font-weight: 550; font-size: 15.5px;
  text-align: left; line-height: 1.3;
  padding: 15px 15px;
  border: 1px solid var(--line-2);
  border-radius: 15px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer; min-height: 70px;
  box-shadow: var(--inset);
  transition: transform .14s var(--ease), border-color .2s, background .2s, box-shadow .2s;
  animation: popin .36s var(--ease) both;
  position: relative; overflow: hidden;
}
.opt::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--a); opacity: .9;
}
.opt:nth-child(1) { --a: #7C5CFF; animation-delay: .02s; }
.opt:nth-child(2) { --a: #22D3EE; animation-delay: .08s; }
.opt:nth-child(3) { --a: #F0A338; animation-delay: .14s; }
.opt:nth-child(4) { --a: #2FD39B; animation-delay: .20s; }
.opt .shape {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 600; font-size: 13px;
  background: color-mix(in srgb, var(--a) 17%, transparent);
  color: var(--a);
  border: 1px solid color-mix(in srgb, var(--a) 36%, transparent);
}
.opt:hover:not(:disabled) { background: var(--surface-2); border-color: var(--line-2); transform: translateY(-1px); }
.opt:active:not(:disabled) { transform: scale(.99); }
.opt:disabled { cursor: default; }
.opt.chosen { border-color: color-mix(in srgb, var(--accent) 70%, transparent); box-shadow: 0 0 0 3px rgba(124,92,255,.2); }
.opt.right  { border-color: rgba(47,211,155,.75); box-shadow: 0 0 0 3px rgba(47,211,155,.18); background: rgba(47,211,155,.07); }
.opt.wrongpick { opacity: .4; }

/* ---------- timer ring ---------- */
.ring-wrap { position: relative; width: 112px; height: 112px; flex: 0 0 auto; }
.ring-wrap.sm { width: 76px; height: 76px; }
.ring-wrap.xl { width: 180px; height: 180px; }
.ring { transform: rotate(-90deg); width: 100%; height: 100%; }
.ring circle { fill: none; stroke-width: 6; stroke-linecap: round; }
.ring .track { stroke: var(--line-2); }
.ring .bar { stroke: var(--good); transition: stroke-dashoffset .25s linear, stroke .5s; filter: drop-shadow(0 0 6px currentColor); }
.ring-num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--display); font-weight: 600; font-size: 34px;
  font-variant-numeric: tabular-nums; color: var(--text);
}
.ring-wrap.sm .ring-num { font-size: 25px; }
.ring-wrap.xl .ring-num { font-size: 60px; }
.ring-wrap.panic .ring-num { color: var(--bad); }
.ring-wrap.panic { animation: pulse .9s var(--ease) infinite; }
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.045)} }

/* ---------- question ---------- */
.q-card { text-align: center; }
.q-num {
  font-size: 11px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
}
.q-text {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(21px, 5.2vw, 31px);
  letter-spacing: -.02em; line-height: 1.22;
  margin: 12px 0 2px; word-break: break-word;
}
.q-img {
  width: 100%; max-height: 220px; object-fit: contain;
  border: 1px solid var(--line); border-radius: 14px;
  margin-top: 14px; background: var(--bg-2);
}

/* ---------- top bar + chips ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 11px;
  padding: 11px 16px; margin: -18px -16px 16px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--display); font-weight: 600; font-size: 15px;
  font-variant-numeric: tabular-nums;
  padding: 7px 13px; border-radius: 10px;
  border: 1px solid rgba(47,211,155,.3);
  background: rgba(47,211,155,.1); color: var(--good);
  white-space: nowrap;
}
.chip.neg { border-color: rgba(242,96,124,.32); background: rgba(242,96,124,.1); color: var(--bad); }
.chip.flat { border-color: var(--line-2); background: var(--surface-3); color: var(--text-2); }

/* ---------- leaderboard ---------- */
.lb-rows { display: flex; flex-direction: column; gap: 8px; }
.lb-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  transition: transform .5s var(--ease), background .3s, border-color .3s;
  position: relative;
}
.lb-row.me { border-color: rgba(124,92,255,.45); background: rgba(124,92,255,.08); }
.lb-row.gold   { border-color: rgba(232,183,80,.4); background: linear-gradient(100deg, rgba(232,183,80,.12), transparent 60%); }
.lb-row.silver { border-color: rgba(255,255,255,.14); }
.lb-row.bronze { border-color: rgba(240,163,56,.26); }
.lb-row.off { opacity: .45; }
.lb-rank {
  font-family: var(--display); font-weight: 600; font-size: 14px;
  font-variant-numeric: tabular-nums;
  width: 26px; text-align: center; flex: 0 0 auto; color: var(--muted);
}
.lb-row.gold .lb-rank { color: var(--gold); }
.lb-name { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-sub { font-size: 11.5px; font-weight: 500; color: var(--muted); margin-top: 2px; letter-spacing: .01em; }
.lb-score {
  font-family: var(--display); font-weight: 600; font-size: 19px;
  font-variant-numeric: tabular-nums;
  margin-left: auto; flex: 0 0 auto;
}
.streak { color: var(--amber); }
.fly {
  position: absolute; right: 14px; top: 4px;
  font-family: var(--display); font-weight: 600; font-size: 16px;
  animation: fly 1.5s var(--ease) forwards; pointer-events: none;
}
.fly.up { color: var(--good); }
.fly.down { color: var(--bad); }
@keyframes fly {
  0% { transform: translateY(4px); opacity: 0 }
  22% { transform: translateY(-4px); opacity: 1 }
  100% { transform: translateY(-34px); opacity: 0 }
}

/* pull-up sheet */
.sheet-handle {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; gap: 9px; justify-content: center;
  padding: 13px 16px calc(13px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  color: var(--text-2);
  font-size: 12.5px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase;
  cursor: pointer;
}
.sheet-handle:hover { color: var(--text); }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  max-height: 78vh; overflow: auto;
  background: var(--bg-2);
  border-top: 1px solid var(--line-2);
  border-radius: 24px 24px 0 0;
  padding: 16px 16px calc(28px + env(safe-area-inset-bottom));
  transform: translateY(103%);
  transition: transform .42s var(--ease);
  box-shadow: 0 -30px 70px -30px rgba(0,0,0,.9);
}
.sheet.open { transform: translateY(0); }
.sheet-bar { width: 42px; height: 4px; border-radius: 999px; background: var(--line-2); margin: 0 auto 16px; }

/* ---------- result popup ---------- */
.pop-over {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  background: rgba(5,6,12,.72);
  backdrop-filter: blur(10px);
  padding: 20px;
  animation: fadein .22s var(--ease) both;
}
@keyframes fadein { from{opacity:0} to{opacity:1} }
.pop-card {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line-2);
  border-radius: 26px;
  box-shadow: var(--shadow-lg);
  padding: 30px 26px; text-align: center;
  max-width: 420px; width: 100%;
  animation: rise .42s var(--ease) both;
  position: relative; overflow: hidden;
}
.pop-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--grad);
}
.pop-card.good::before { background: linear-gradient(90deg, var(--good), var(--accent-2)); }
.pop-card.bad::before  { background: linear-gradient(90deg, var(--bad), var(--amber)); }
.pop-card.good { box-shadow: var(--shadow-lg), 0 0 90px -30px rgba(47,211,155,.6); }
.pop-card.bad  { box-shadow: var(--shadow-lg), 0 0 90px -30px rgba(242,96,124,.5); }
@keyframes rise {
  from { transform: translateY(14px) scale(.97); opacity: 0 }
  to   { transform: none; opacity: 1 }
}
.pop-icon {
  width: 54px; height: 54px; margin: 0 auto;
  border-radius: 50%; display: grid; place-items: center;
  font-family: var(--display); font-size: 25px; font-weight: 600; line-height: 1;
  border: 1px solid var(--line-2); background: var(--surface-3); color: var(--text-2);
}
.pop-card.good .pop-icon { color: var(--good); border-color: rgba(47,211,155,.45); background: rgba(47,211,155,.12); }
.pop-card.bad  .pop-icon { color: var(--bad);  border-color: rgba(242,96,124,.45); background: rgba(242,96,124,.12); }
.pop-title {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(21px, 5.4vw, 27px); letter-spacing: -.02em;
  margin: 12px 0 6px;
}
.pop-sub { font-size: 14px; font-weight: 500; color: var(--muted); }
.pop-delta {
  font-family: var(--display); font-weight: 600; font-size: 38px;
  font-variant-numeric: tabular-nums; margin-top: 14px; letter-spacing: -.02em;
}
.pop-delta.up { color: var(--good); }
.pop-delta.down { color: var(--bad); }
.shake { animation: nudge .4s var(--ease) 1; }
@keyframes nudge {
  0%,100% { transform: translateX(0) } 25% { transform: translateX(-5px) } 75% { transform: translateX(5px) }
}

/* ---------- countdown overlay ---------- */
.burst {
  position: fixed; inset: 0; z-index: 85;
  display: grid; place-items: center; pointer-events: none;
  background: rgba(5,6,12,.5);
  backdrop-filter: blur(3px);
}
.burst-num {
  font-family: var(--display); font-weight: 600;
  font-size: min(30vw, 190px); letter-spacing: -.04em;
  color: var(--text);
  animation: countOut .64s var(--ease) both;
  text-shadow: 0 0 80px rgba(124,92,255,.55);
}
@keyframes countOut {
  0%   { transform: scale(.82); opacity: 0 }
  28%  { transform: scale(1); opacity: 1 }
  100% { transform: scale(1.16); opacity: 0 }
}

/* ---------- reactions ---------- */
.reax { position: fixed; inset: 0; z-index: 70; pointer-events: none; overflow: hidden; }
.reax-emo { position: absolute; bottom: 86px; font-size: 30px; animation: rise-up 3.2s var(--ease) forwards; opacity: .9; }
@keyframes rise-up {
  0% { transform: translateY(0) scale(.7); opacity: 0 }
  14% { transform: translateY(-24px) scale(1); opacity: .95 }
  100% { transform: translateY(-66vh) scale(.85); opacity: 0 }
}
.reax-bar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(60px + env(safe-area-inset-bottom));
  z-index: 50; display: flex; gap: 8px;
}
.reax-btn {
  width: 44px; height: 44px; border-radius: 13px;
  border: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  font-size: 19px; cursor: pointer; display: grid; place-items: center;
  transition: transform .14s var(--ease), background .2s;
}
.reax-btn:hover { background: var(--surface-2); }
.reax-btn:active { transform: scale(.9); }

/* ---------- podium ---------- */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 12px; margin-top: 26px; }
.ped { display: flex; flex-direction: column; align-items: center; gap: 10px; flex: 1; max-width: 150px; }
.ped .block {
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: 14px 14px 0 0;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 600; font-size: 24px;
  font-variant-numeric: tabular-nums;
  animation: rise-block .85s var(--ease) both;
  box-shadow: var(--inset);
}
.ped.p1 .block {
  height: 132px; color: #0B0D15;
  background: linear-gradient(180deg, var(--gold), #B98B2C);
  border-color: rgba(232,183,80,.5); animation-delay: .5s;
}
.ped.p2 .block {
  height: 98px; color: var(--text);
  background: linear-gradient(180deg, var(--surface-3), var(--surface));
  animation-delay: .24s;
}
.ped.p3 .block {
  height: 74px; color: var(--text);
  background: linear-gradient(180deg, rgba(240,163,56,.3), var(--surface));
  border-color: rgba(240,163,56,.3); animation-delay: 0s;
}
@keyframes rise-block { from { transform: translateY(34px); opacity: 0 } to { transform: none; opacity: 1 } }
.ped .who { font-weight: 600; font-size: 13.5px; text-align: center; word-break: break-word; }

/* ---------- host: lists ---------- */
.qlist { display: flex; flex-direction: column; gap: 9px; }
.qrow {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 13px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface);
  transition: border-color .2s, background .2s;
}
.qrow:hover { border-color: var(--line-2); }
.qrow.active { border-color: rgba(124,92,255,.5); background: rgba(124,92,255,.07); }
.qrow.done { opacity: .5; }
.qrow .idx {
  font-family: var(--display); font-weight: 600; font-size: 13px;
  width: 22px; flex: 0 0 auto; color: var(--muted); padding-top: 1px;
}
.qrow .body { flex: 1; min-width: 0; }
.qrow .qt { font-weight: 600; font-size: 14.5px; margin-bottom: 5px; word-break: break-word; }
.qrow .ans { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.qrow .acts { display: flex; flex-direction: column; gap: 5px; flex: 0 0 auto; }
.mini {
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2);
  border-radius: 8px; width: 28px; height: 25px; cursor: pointer;
  font-size: 11.5px; font-weight: 600; transition: background .18s, color .18s, border-color .18s;
}
.mini:hover { background: var(--surface-3); color: var(--text); border-color: var(--line-2); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.grid4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
@media (max-width: 760px) { .grid3, .grid4 { grid-template-columns: 1fr 1fr; } }

.opt-edit { display: flex; align-items: center; gap: 10px; }
.opt-edit .pick {
  width: 40px; height: 40px; flex: 0 0 auto; border-radius: 11px;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--muted);
  font-family: var(--display); font-size: 13px; font-weight: 600;
  cursor: pointer; display: grid; place-items: center;
  transition: all .18s var(--ease);
}
.opt-edit .pick:hover { border-color: var(--line-2); color: var(--text); }
.opt-edit .pick.on {
  background: rgba(47,211,155,.14); border-color: rgba(47,211,155,.5); color: var(--good);
}

/* ---------- monitor (/stats) ---------- */
.mon-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1000px) { .mon-grid { grid-template-columns: 1fr; } }

.mon-opts { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.mon-opt {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px; border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 14.5px; font-weight: 500;
  transition: border-color .25s, background .25s;
}
.mon-opt .shape {
  width: 26px; height: 26px; flex: 0 0 auto; border-radius: 8px;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 600; font-size: 12px;
  background: var(--surface-3); color: var(--text-2); border: 1px solid var(--line-2);
}
.mon-opt.right { border-color: rgba(47,211,155,.5); background: rgba(47,211,155,.08); }
.mon-opt.right .shape { color: var(--good); border-color: rgba(47,211,155,.5); background: rgba(47,211,155,.12); }
.mon-opt.picked { border-color: rgba(124,92,255,.65); box-shadow: 0 0 0 3px rgba(124,92,255,.14); }
.mon-opt.picked .shape { color: #fff; background: var(--accent); border-color: transparent; }

.live-hand {
  display: flex; align-items: center; gap: 15px;
  padding: 15px; border-radius: 15px;
  border: 1px solid rgba(124,92,255,.45);
  background: rgba(124,92,255,.08);
  animation: fadein .25s var(--ease) both;
}
.live-hand.good { border-color: rgba(47,211,155,.45); background: rgba(47,211,155,.08); }
.live-hand.bad  { border-color: rgba(242,96,124,.45); background: rgba(242,96,124,.08); }

.feed { display: flex; flex-direction: column; gap: 2px; max-height: 420px; overflow: auto; }
.feed-row {
  display: flex; align-items: baseline; gap: 10px;
  padding: 7px 8px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--text-2);
  animation: fadein .3s var(--ease) both;
}
.feed-row:nth-child(odd) { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.feed-time {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 11px; color: var(--muted); flex: 0 0 auto;
}
.feed-dot {
  width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto;
  background: var(--muted); align-self: center;
}
.feed-row.hand     .feed-dot { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.feed-row.pick     .feed-dot { background: var(--accent-2); box-shadow: 0 0 8px var(--accent-2); }
.feed-row.right    .feed-dot { background: var(--good); box-shadow: 0 0 8px var(--good); }
.feed-row.wrong    .feed-dot { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.feed-row.question .feed-dot { background: var(--gold); }
.feed-row.join     .feed-dot { background: var(--good); }
.feed-row.right, .feed-row.question { color: var(--text); }

/* ---------- switch ---------- */
.switch-row { display: flex; align-items: center; gap: 16px; }
.switch {
  width: 46px; height: 27px; border-radius: 999px; flex: 0 0 auto;
  border: 1px solid var(--line-2); background: var(--surface-3);
  cursor: pointer; padding: 2px; position: relative;
  transition: background .22s, border-color .22s;
}
.switch .knob {
  display: block; width: 21px; height: 21px; border-radius: 50%;
  background: var(--muted);
  transition: transform .24s var(--ease), background .22s;
}
.switch.on { background: rgba(124,92,255,.22); border-color: rgba(124,92,255,.6); }
.switch.on .knob { transform: translateX(19px); background: var(--accent); }

/* ---------- host control room ---------- */
.ctrl-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1000px) { .ctrl-grid { grid-template-columns: 1fr; } }
.code-box {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(30px, 5.4vw, 46px);
  letter-spacing: .2em; text-align: center;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  padding: 14px 10px 14px 20px;
  color: var(--text);
  box-shadow: var(--inset);
  position: relative; overflow: hidden;
}
.code-box::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 2px; background: var(--grad);
}
.qr-box {
  background: #fff; padding: 10px; border: 1px solid var(--line-2);
  border-radius: 14px; display: grid; place-items: center; line-height: 0;
}
.phase-pill {
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  padding: 7px 13px; border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--surface-3); color: var(--text-2);
}
.phase-pill.HANDS_OPEN { color: var(--good); border-color: rgba(47,211,155,.4); background: rgba(47,211,155,.1); }
.phase-pill.ANSWERING  { color: var(--amber); border-color: rgba(240,163,56,.4); background: rgba(240,163,56,.1); }
.phase-pill.RESULT     { color: var(--bad); border-color: rgba(242,96,124,.4); background: rgba(242,96,124,.1); }
.phase-pill.REVEAL     { color: var(--accent-2); border-color: rgba(34,211,238,.4); background: rgba(34,211,238,.1); }
.phase-pill.LOBBY, .phase-pill.READY { color: #C4B5FD; border-color: rgba(124,92,255,.4); background: rgba(124,92,255,.1); }
.phase-pill.FINAL      { color: var(--gold); border-color: rgba(232,183,80,.4); background: rgba(232,183,80,.1); }

.plist { display: flex; flex-direction: column; gap: 7px; max-height: 430px; overflow: auto; }
.prow {
  display: flex; align-items: center; gap: 10px; padding: 8px 11px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  font-size: 14px;
}
.prow.out { opacity: .45; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); flex: 0 0 auto;
       box-shadow: 0 0 10px var(--good); }
.dot.off { background: var(--muted); box-shadow: none; }

.kbd {
  font-family: ui-monospace, SFMono-Regular, monospace; font-size: 11px;
  background: var(--surface-3); color: var(--text-2);
  padding: 3px 7px; border-radius: 6px; border: 1px solid var(--line-2);
}

/* ---------- projector ---------- */
.proj { padding: 30px 34px; max-width: 1600px; margin: 0 auto; }
.proj .q-text { font-size: clamp(32px, 4.8vw, 68px); }
.proj-grid { display: grid; grid-template-columns: 1.75fr 1fr; gap: 28px; align-items: start; }
@media (max-width: 900px) { .proj-grid { grid-template-columns: 1fr; } }
.proj .lb-name { font-size: 19px; }
.proj .lb-score { font-size: 28px; }
.proj .lb-rank { font-size: 20px; width: 38px; }
.proj .ava { width: 48px; height: 48px; font-size: 17px; border-radius: 15px; }

/* ---------- misc ---------- */
.muted { color: var(--muted); font-weight: 500; }
.tc { text-align: center; }
.big-emo { font-size: 38px; line-height: 1; opacity: .9; }
.bar-note {
  padding: 13px 15px; border: 1px solid var(--line-2); border-radius: 12px;
  background: var(--bg-2); color: var(--text-2);
  font-size: 13.5px; font-weight: 500;
}
.toast-host {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 95; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; width: calc(100% - 32px); max-width: 420px;
}
.toast {
  font-size: 13.5px; font-weight: 550;
  background: color-mix(in srgb, var(--surface-3) 92%, transparent);
  backdrop-filter: blur(14px);
  color: var(--text);
  padding: 11px 17px; border-radius: 11px;
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  animation: toastin .3s var(--ease) both;
  text-align: center;
}
@keyframes toastin { from { transform: translateY(-10px); opacity: 0 } to { transform: none; opacity: 1 } }

.spin { animation: spin 1.1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg) } }

.wait-dots span { animation: dot 1.4s infinite; }
.wait-dots span:nth-child(2) { animation-delay: .2s }
.wait-dots span:nth-child(3) { animation-delay: .4s }
@keyframes dot { 0%,100%{opacity:.2} 50%{opacity:1} }

.soundbtn {
  position: fixed; top: 12px; right: 12px; z-index: 60;
  width: 38px; height: 38px; border-radius: 11px;
  border: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: blur(12px);
  color: var(--text-2);
  font-size: 15px; cursor: pointer;
  transition: background .2s, color .2s;
}
.soundbtn:hover { background: var(--surface-2); color: var(--text); }

/* brand wordmark */
.brand {
  font-family: var(--display); font-weight: 600;
  letter-spacing: -.03em;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* ---------- the player's screen fills the phone ---------- */
.game-screen {
  display: flex; flex-direction: column; gap: 14px;
  min-height: calc(100dvh - 168px);
}
.game-screen > .hand-zone { margin-top: auto; }
.handmark { display: block; width: 100%; color: #fff; }
.handmark svg { width: 100%; height: auto; display: block; }

/* ---------- leaderboard page ---------- */
.lb-head { margin-bottom: 18px; }
.livedot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--good);
  box-shadow: 0 0 10px var(--good); animation: blink 2s var(--ease) infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.35} }

.stat-tiles {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 10px; margin-bottom: 16px;
}
@media (max-width: 860px) { .stat-tiles { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .stat-tiles { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 13px 14px; box-shadow: var(--inset);
}
.stat .l {
  font-size: 10.5px; font-weight: 700; letter-spacing: .11em;
  text-transform: uppercase; color: var(--muted);
}
.stat .n {
  font-family: var(--display); font-weight: 600; font-size: 25px;
  font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin: 5px 0 2px;
}
.stat .s { font-size: 11.5px; color: var(--muted); font-weight: 500; }

.board { display: flex; flex-direction: column; gap: 6px; }
.board-row {
  display: flex; align-items: center; gap: 13px;
  padding: 11px 12px; border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  transition: transform .5s var(--ease), background .3s, border-color .3s;
}
.board-row:nth-child(odd) { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.board-row.gold { border-color: rgba(232,183,80,.35); background: linear-gradient(100deg, rgba(232,183,80,.1), transparent 55%); }
.board-row.hot  { border-color: rgba(124,92,255,.5); }
.board-row.off  { opacity: .45; }
.board-row .lb-rank { font-size: 15px; }
.board-row.gold .lb-rank { color: var(--gold); }
.board-row .lb-score { font-size: 22px; min-width: 56px; text-align: right; }

.acc { display: flex; align-items: center; gap: 9px; width: 190px; flex: 0 0 auto; }
.acc-bar {
  flex: 1; height: 6px; border-radius: 999px;
  background: var(--surface-3); overflow: hidden;
}
.acc-bar span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--good));
  border-radius: 999px; transition: width .6s var(--ease);
}
.acc-n {
  font-family: var(--display); font-size: 12.5px; font-weight: 600;
  font-variant-numeric: tabular-nums; color: var(--text-2); width: 34px; text-align: right;
}
@media (max-width: 680px) {
  .acc { display: none; }
  .board-row { gap: 11px; padding: 10px 8px; }
}

/* ---------- phones ---------- */
@media (max-width: 560px) {
  .ava.lg { width: 52px; height: 52px; font-size: 18px; border-radius: 16px; }
  .ava.xl { width: 80px; height: 80px; font-size: 28px; border-radius: 24px; }
  .podium { gap: 8px; }
  .ped .block { font-size: 20px; }
  .ped.p1 .block { height: 108px; }
  .ped.p2 .block { height: 82px; }
  .ped.p3 .block { height: 62px; }
  .opt { font-size: 14.5px; padding: 13px 12px; min-height: 64px; }
  .sticker { padding: 18px; }
}

/* ---------- accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .1s !important;
  }
  .blob { animation: none !important; }
  .popin, .pop-card, .burst-num, .opt { animation: fadein .2s both !important; }
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: rgba(124,92,255,.35); }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
