/* Layout: a game-show stage. The TV gets a two-panel lobby and full-bleed question cards; phones get one big column of buttons. */
:root {
  --stage: #0e1a2b;
  --stage-2: #16273f;
  --stage-3: #213756;
  --ink: #f4efe4;
  --muted: #9aabc3;
  --marigold: #ffb838;
  --coral: #ff6b5a;
  --teal: #3cc9b4;
  --magenta: #e2458f;
  --line: rgba(244, 239, 228, .12);
  --display: "Bricolage Grotesque", "Arial Black", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mode: var(--teal);
  color-scheme: dark;
}
html, body { min-height: 100%; }
body {
  background: radial-gradient(120% 80% at 50% -10%, var(--stage-3) 0%, var(--stage) 60%) fixed, var(--stage);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
body[data-mode="friends"] { --mode: var(--marigold); }
body[data-mode="silly"] { --mode: #7aa7ff; }
body[data-mode="afterdark"] { --mode: var(--magenta); }
body[data-mode="spicy"] { --mode: var(--coral); }
#app { max-width: 1200px; margin: 0 auto; padding-block: 20px 40px; display: flex; flex-direction: column; gap: 24px; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.05; margin: 0; text-wrap: balance; letter-spacing: -.01em; }
p { margin: 0; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--marigold); outline-offset: 3px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { font-family: var(--display); font-weight: 800; font-size: 1.35rem; display: flex; align-items: center; gap: 10px; }
.brand .mark { width: 28px; height: 28px; border-radius: 50%; background: conic-gradient(var(--marigold) 0 33%, var(--coral) 0 66%, var(--teal) 0); }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); }
.status i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.status.live i { background: var(--teal); box-shadow: 0 0 0 4px rgba(60, 201, 180, .2); }
.status.off i { background: var(--coral); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: color-mix(in srgb, var(--mode) 18%, transparent); color: var(--mode); border: 1px solid color-mix(in srgb, var(--mode) 45%, transparent); }
.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

.panel { background: var(--stage-2); border: 1px solid var(--line); border-radius: 20px; padding: 24px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.lobby { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 24px; }
@media (max-width: 760px) { .lobby { grid-template-columns: minmax(0, 1fr); } }
.qr { background: #fff; border-radius: 14px; padding: 14px; align-self: center; width: 248px; max-width: 100%; aspect-ratio: 1; display: grid; place-items: center; }
.qr img, .qr canvas { width: 100% !important; height: auto !important; }
.qr.empty { background: var(--stage-3); color: var(--muted); font-size: .9rem; text-align: center; padding: 20px; }
.url { font-size: .85rem; color: var(--muted); word-break: break-all; text-align: center; user-select: all; }

.plist { display: flex; flex-wrap: wrap; gap: 10px; min-height: 52px; }
.pl { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 999px; background: var(--stage-3); font-weight: 700; animation: pop .35s ease-out; }
.dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--stage); font-family: var(--display); font-weight: 800; font-size: .95rem; flex: none; }
.pl small { color: var(--muted); font-weight: 500; }
.empty-note { color: var(--muted); }

.modes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 1100px) { .modes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 340px) { .modes { grid-template-columns: minmax(0, 1fr); } }
.mode { text-align: left; padding: 14px; border-radius: 14px; background: var(--stage-3); border: 2px solid transparent; display: flex; flex-direction: column; gap: 2px; }
.mode b { font-family: var(--display); font-size: 1.15rem; }
.mode span { font-size: .82rem; color: var(--muted); }
.mode[data-m="family"] { --c: var(--teal); }
.mode[data-m="friends"] { --c: var(--marigold); }
.mode[data-m="silly"] { --c: #7aa7ff; }
.mode[data-m="afterdark"] { --c: var(--magenta); }
.mode b { color: var(--c); }
.mode.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--stage-3)); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.seg button { padding: 8px 14px; border-radius: 10px; background: var(--stage-3); border: 2px solid transparent; font-weight: 700; font-variant-numeric: tabular-nums; }
.seg button.on { border-color: var(--ink); }

.btn { padding: 14px 26px; border-radius: 14px; border: 0; background: var(--marigold); color: var(--stage); font-family: var(--display); font-weight: 800; font-size: 1.15rem; transition: transform .12s; }
.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); font-size: 1rem; padding: 10px 18px; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 0; font-size: .9rem; }
.hint { color: var(--muted); font-size: .9rem; }
.err { color: var(--coral); font-size: .9rem; font-weight: 700; }

.pin { border: 2px solid var(--magenta); }
.pin input { font: inherit; font-size: 1.6rem; letter-spacing: .5em; width: 7.5em; max-width: 100%; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--stage); color: var(--ink); font-variant-numeric: tabular-nums; }

/* Question stage */
.stage { display: flex; flex-direction: column; gap: 28px; align-items: center; text-align: center; padding-block: 12px; }
.qcard { width: 100%; background: var(--stage-2); border-radius: 28px; padding: clamp(28px, 6vw, 64px) clamp(20px, 5vw, 56px); border: 1px solid var(--line); position: relative; overflow: hidden; }
.qcard::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; background: var(--mode); }
.qcard h2 { font-size: clamp(2rem, 5.2vw, 4.2rem); }
.qmeta { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.timer { width: 110px; height: 110px; position: relative; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 9; }
.timer .track { stroke: var(--stage-3); }
.timer .bar { stroke: var(--mode); stroke-linecap: round; transition: stroke-dashoffset .3s linear; }
.timer b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 2rem; font-variant-numeric: tabular-nums; }
.voters { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.voter { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--stage-2); color: var(--muted); font-weight: 700; opacity: .55; transition: opacity .25s, background .25s; }
.voter.in { opacity: 1; color: var(--ink); background: var(--stage-3); }
.voter.in::after { content: "✓"; color: var(--teal); }

.verdict { font-size: clamp(2.4rem, 7vw, 5.5rem); color: var(--mode); animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }
.bars { width: 100%; max-width: 760px; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.barrow { display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr) 2.5rem; gap: 12px; align-items: center; font-weight: 700; }
.barrow .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track2 { height: 22px; border-radius: 999px; background: var(--stage-2); overflow: hidden; }
.fill { height: 100%; border-radius: 999px; width: 0; transition: width .9s cubic-bezier(.2, .9, .3, 1); }
.barrow .n { font-variant-numeric: tabular-nums; text-align: right; font-family: var(--display); font-size: 1.3rem; }
.scores { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; color: var(--muted); font-variant-numeric: tabular-nums; }
.scores b { color: var(--ink); }

.podium { width: 100%; max-width: 620px; display: flex; flex-direction: column; gap: 10px; }
.place { display: grid; grid-template-columns: 3rem auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 18px; border-radius: 16px; background: var(--stage-2); text-align: left; font-weight: 700; }
.place:first-child { background: color-mix(in srgb, var(--marigold) 22%, var(--stage-2)); font-size: 1.25rem; }
.place .rk { font-family: var(--display); font-size: 1.6rem; color: var(--muted); }
.place:first-child .rk { color: var(--marigold); }
.place .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place .pts { font-family: var(--display); font-variant-numeric: tabular-nums; }

/* Phone */
.phone { max-width: 480px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.phone h2 { font-size: 1.9rem; }
.phone input[type="text"] { font: inherit; font-size: 1.3rem; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--stage-2); color: var(--ink); width: 100%; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.sw { width: 44px; height: 44px; border-radius: 50%; border: 3px solid transparent; }
.sw.on { border-color: var(--ink); }
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--stage-2); text-align: left; font-size: 1.15rem; font-weight: 700; }
.choice.on { border-color: var(--mode); background: color-mix(in srgb, var(--mode) 16%, var(--stage-2)); }
.big { font-family: var(--display); font-weight: 800; font-size: 3rem; line-height: 1; }
.banner { padding: 12px 16px; border-radius: 12px; background: var(--stage-2); border: 1px solid var(--line); color: var(--muted); font-size: .9rem; }

@keyframes pop { from { transform: scale(.85); opacity: .3; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

/* Website version additions */
body { margin: 0; min-height: 100vh; }
.code { font-family: var(--display); font-weight: 800; font-size: clamp(2.6rem, 6vw, 3.6rem); letter-spacing: .14em; color: var(--marigold); line-height: 1; font-variant-numeric: tabular-nums; }
.joinform { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.joinform input { font: inherit; text-transform: uppercase; letter-spacing: .2em; width: 7em; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--stage); color: var(--ink); }

/* Fill-in-the-blank rounds */
.blank { display: inline-block; width: 3.2em; height: .9em; border-bottom: .08em solid var(--mode); margin: 0 .12em; vertical-align: baseline; }
.filled { color: var(--mode); text-decoration: underline; text-decoration-thickness: .06em; text-underline-offset: .15em; }
.bprompt { font-size: clamp(1.6rem, 3.6vw, 2.8rem); max-width: 1000px; }
.answers { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 14px; text-align: left; }
.answer { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: 18px; background: var(--stage-2); border: 2px solid var(--line); font-size: clamp(1.1rem, 2.2vw, 1.6rem); font-weight: 700; overflow-wrap: anywhere; animation: pop .35s ease-out; }
.albl { flex: none; width: 2em; height: 2em; border-radius: 50%; display: grid; place-items: center; background: var(--mode); color: var(--stage); font-family: var(--display); font-weight: 800; font-size: .8em; }
.answers.reveal .answer { flex-direction: column; align-items: flex-start; gap: 8px; }
.answers.reveal .answer.won { border-color: var(--marigold); background: color-mix(in srgb, var(--marigold) 16%, var(--stage-2)); }
.aby { display: inline-flex; align-items: center; gap: 8px; font-size: .95rem; color: var(--muted); }
.avotes { font-family: var(--display); font-size: 1rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.choice .albl { font-size: .9rem; }
.choice:disabled { opacity: .45; cursor: not-allowed; }

/* Card rounds */
.judgeline { display: inline-flex; align-items: center; gap: 10px; margin-top: 18px; color: var(--muted); font-weight: 700; flex-wrap: wrap; justify-content: center; }
.judgeline b { color: var(--ink); }
.hand { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pcard { display: flex; align-items: flex-start; gap: 10px; min-height: 92px; padding: 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--ink); color: var(--stage); text-align: left; font-family: var(--display); font-weight: 800; font-size: 1.05rem; line-height: 1.2; overflow-wrap: anywhere; }
.pcard.on { border-color: var(--mode); box-shadow: 0 0 0 3px var(--mode); }
.answer.pcard { min-height: 0; font-size: clamp(1.1rem, 2.2vw, 1.6rem); cursor: pointer; }
.answer.pcard:hover { transform: translateY(-2px); }
@media (max-width: 360px) { .hand { grid-template-columns: minmax(0, 1fr); } }

/* Sound toggle and 18+ warning */
.mute { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--stage-2); color: var(--ink); padding: 0; }
.mute[aria-pressed="true"] { color: var(--muted); }
@media (hover: none) { .mute { width: 46px; height: 46px; } } /* bigger tap target on phones */
.warn { padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--magenta) 16%, var(--stage)); border: 1px solid color-mix(in srgb, var(--magenta) 55%, transparent); color: var(--ink); font-weight: 700; }

/* ---------- Lobby avatars ---------- */
.plist { gap: 14px; }
.plist .pl { gap: 12px; padding: 6px 20px 6px 6px; font-size: 1.15rem; animation: none; }
.plist .pl .dot { width: 56px; height: 56px; font-size: 1.55rem; }
.pl .bob { display: inline-block; animation: bob 2.6s ease-in-out infinite; animation-delay: var(--bob, 0s); }
.pl.enter { animation: fadein .25s ease-out both; }
.pl.enter .bob .dot { animation: dropin .8s cubic-bezier(.34, 1.56, .64, 1) both; }
.pl.enter .nm { display: inline-block; animation: slidein .45s .25s ease-out both; }
.pl.leaving { animation: leave .42s ease-in forwards; pointer-events: none; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes dropin { 0% { transform: translateY(-140px) scale(.6); opacity: 0; } 55% { transform: translateY(8px) scale(1.08); opacity: 1; } 75% { transform: translateY(-4px) scale(.97); } 100% { transform: none; } }
@keyframes slidein { from { transform: translateX(-16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes leave { to { transform: scale(.3); opacity: 0; } }

/* ---------- Round layout: stage plus leaderboard ---------- */
.roundwrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: 24px; align-items: start; }
@media (max-width: 900px) { .roundwrap { grid-template-columns: minmax(0, 1fr); } }
.lbpanel { position: relative; background: var(--stage-2); border: 1px solid var(--line); border-radius: 20px; padding: 16px 12px; display: flex; flex-direction: column; gap: 10px; }
.lbpanel > .eyebrow { padding-left: 6px; }
.lb { display: flex; flex-direction: column; gap: 4px; }
.lbrow { position: relative; display: grid; grid-template-columns: 1.4rem 30px minmax(0, 1fr) .9rem 1.3rem 2.2rem; gap: 8px; align-items: center; padding: 5px 8px; border-radius: 12px; font-weight: 700; transition: background .5s; }
.lbrow .rk { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.lbrow .dot { width: 30px; height: 30px; font-size: .9rem; transition: box-shadow .6s; }
.lbrow .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lbrow .pts { font-family: var(--display); font-size: 1.2rem; text-align: right; font-variant-numeric: tabular-nums; }
.lbrow .mv { font-size: .7rem; text-align: center; }
.lbrow .mv.up { color: var(--teal); }
.lbrow .mv.down { color: var(--coral); }
.lbrow .crown { font-size: 1.05rem; text-align: center; }
.lbrow.lead .dot { box-shadow: 0 0 0 3px var(--pc), 0 0 14px 3px color-mix(in srgb, var(--pc) 55%, transparent); }
.plus { position: absolute; right: 2.9rem; top: 4px; font-family: var(--display); font-weight: 800; color: var(--teal); pointer-events: none; animation: floatup 1.5s ease-out forwards; }
@keyframes floatup { 0% { transform: translateY(6px); opacity: 0; } 15% { transform: translateY(0); opacity: 1; } 70% { opacity: 1; } 100% { transform: translateY(-14px); opacity: 0; } }
.newlead { position: absolute; top: -16px; left: 50%; z-index: 61; transform: translateX(-50%); white-space: nowrap; padding: 6px 14px; border-radius: 999px; background: var(--marigold); color: var(--stage); font-family: var(--display); font-weight: 800; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); }
.newlead.show { animation: banner 2.6s ease-out both; }
@keyframes banner { 0% { transform: translateX(-50%) scale(.4); opacity: 0; } 12% { transform: translateX(-50%) scale(1.12); opacity: 1; } 20%, 85% { transform: translateX(-50%) scale(1); opacity: 1; } 100% { transform: translateX(-50%) scale(.9); opacity: 0; } }

/* ---------- Spotlight on the leader ---------- */
body::after { content: ""; position: fixed; inset: 0; z-index: 50; background: rgba(4, 8, 16, .5); opacity: 0; pointer-events: none; transition: opacity .6s; }
body.spot::after { opacity: 1; }
body.spot .lbrow.lead { z-index: 60; background: color-mix(in srgb, var(--pc) 22%, var(--stage-2)); }
body.spot .lbrow.lead .dot { box-shadow: 0 0 0 3px var(--pc), 0 0 26px 10px color-mix(in srgb, var(--pc) 65%, transparent); }
.place.champ { position: relative; }
.place.champ .dot { width: 60px; height: 60px; font-size: 1.7rem; animation: glow 1.6s ease-in-out infinite; }
body.spot .place.champ { z-index: 60; background: color-mix(in srgb, var(--pc) 28%, var(--stage-2)); }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 3px var(--pc), 0 0 16px 4px color-mix(in srgb, var(--pc) 50%, transparent); } 50% { box-shadow: 0 0 0 5px var(--pc), 0 0 40px 16px color-mix(in srgb, var(--pc) 75%, transparent); } }

/* ---------- Vote-by-vote reveal ---------- */
.arena { position: relative; width: 100%; display: flex; justify-content: center; gap: 12px; padding-top: 70px; }
.seat { display: flex; flex-direction: column; align-items: center; gap: 6px; width: calc(var(--sz, 80px) + 12px); min-width: 0; transition: opacity .5s; }
.seat .dot { width: var(--sz, 80px); height: var(--sz, 80px); font-size: calc(var(--sz, 80px) * .42); transition: transform .55s cubic-bezier(.34, 1.56, .64, 1), box-shadow .55s; }
.seat .nm { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: .95rem; transition: margin .55s; }
.seat .cnt { font-family: var(--display); font-size: 1.7rem; line-height: 1; font-variant-numeric: tabular-nums; }
.seat.win { position: relative; z-index: 1; }
.seat.win .dot { transform: scale(1.35); box-shadow: 0 0 0 4px var(--pc), 0 0 40px 12px color-mix(in srgb, var(--pc) 60%, transparent); }
.seat.win .nm { margin-top: calc(var(--sz, 80px) * .2); }
.seat.win .cnt { color: var(--pc); }
.seat.lose { opacity: .45; }
.token { position: absolute; left: 0; top: 0; z-index: 3; width: 22px; height: 22px; border-radius: 50%; pointer-events: none; border: 3px solid var(--ink); box-shadow: 0 0 0 2px var(--stage), 0 0 16px var(--tc); }
.verdictbox:empty { display: none; }
.slam { animation: slam .55s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes slam { 0% { transform: scale(2.6); opacity: 0; } 60% { transform: scale(.94); opacity: 1; } 100% { transform: scale(1); } }
.summary { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; animation: fadein .5s ease-out both; }

@media (prefers-reduced-motion: reduce) { *::after, .pl .bob, .place.champ .dot { animation: none !important; transition: none !important; } }

/* Short screens (e.g. a 720p TV): tighten the stage so a round fits without scrolling. */
@media (max-height: 820px) {
  #app { padding-block: 12px 20px; gap: 14px; }
  .stage { gap: 14px; padding-block: 4px; }
  .arena { padding-top: 46px; }
  .verdict { font-size: clamp(2rem, 5vw, 3.6rem); }
  .qcard { padding: 24px 32px; }
  .qcard h2 { font-size: clamp(1.8rem, 4.2vw, 3.2rem); }
  .timer { width: 84px; height: 84px; }
  .timer b { font-size: 1.6rem; }
  .bars { gap: 6px; }
  .track2 { height: 16px; }
  .lbpanel { padding: 12px 10px; gap: 6px; }
  .lb { gap: 2px; }
  .lbrow { padding: 3px 8px; }
  .lbrow .dot { width: 26px; height: 26px; }
  .podium { gap: 6px; }
  .place { padding: 8px 16px; }
}

/* Big games: final scores in two columns, with the winner across both. */
.podium.many { max-width: 980px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.podium.many .place { padding: 8px 14px; }
.podium.many .place.champ { grid-column: 1 / -1; padding: 12px 18px; }
@media (max-width: 700px) { .podium.many { grid-template-columns: minmax(0, 1fr); } }
@media (max-height: 820px) {
  .place.champ .dot { width: 46px; height: 46px; font-size: 1.35rem; }
  .podium.many .place { padding: 6px 14px; }
}
.lbrow .mv, .lbrow .crown { transition: opacity .3s; }
.lbrow.scoring .mv, .lbrow.scoring .crown { opacity: 0; }
body.spot .champline { position: relative; z-index: 60; }
@media (max-height: 820px) {
  .lobby .panel { padding: 16px 20px; gap: 10px; }
  .qr { width: 190px; padding: 10px; }
  .code { font-size: 2.4rem; }
  .mode { padding: 10px 12px; }
  .plist { gap: 10px; }
  .plist .pl .dot { width: 48px; height: 48px; font-size: 1.35rem; }
  .plist .pl { padding: 4px 16px 4px 4px; font-size: 1.05rem; }
}

/* Read-aloud button on the TV question card */
.readaloud { position: absolute; top: 16px; right: 16px; width: 64px; height: 64px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--mode) 60%, transparent); background: color-mix(in srgb, var(--mode) 18%, var(--stage-3)); color: var(--ink); display: grid; place-items: center; padding: 0; }
.readaloud:hover:not(:disabled) { background: color-mix(in srgb, var(--mode) 32%, var(--stage-3)); }
.readaloud:disabled { opacity: .35; cursor: not-allowed; }
.readaloud.speaking { box-shadow: 0 0 0 4px color-mix(in srgb, var(--mode) 45%, transparent); }
@media (max-height: 820px) { .readaloud { width: 52px; height: 52px; top: 12px; right: 12px; } }
.qcard .qmeta, .qcard h2 { padding-inline: 56px; }
@media (max-width: 600px) { .qcard .qmeta, .qcard h2 { padding-inline: 0; } .readaloud { position: static; margin: 0 auto 10px; } }

/* Padding counts inside the width, so full-width cards and inputs don't spill out of their column. */
.qcard, .phone input[type="text"] { box-sizing: border-box; }

/* ---------- Removing players ---------- */
.kick { display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--stage); color: var(--muted); font-size: 1.1rem; line-height: 1; opacity: 0; transition: opacity .2s, color .2s, background .2s; }
.kick:hover, .kick:focus-visible { color: #fff; background: var(--coral); opacity: 1; }
.pl:hover .kick, .pl:focus-within .kick, .lbrow:hover .kick, .lbrow:focus-within .kick { opacity: 1; }
@media (hover: none) { .kick { opacity: 1; } }       /* touch screens: always visible */
.plist .pl .kick { margin-left: -4px; }
/* Leaderboard ×: floats over the row on screens that can hover; gets its own always-visible column on touch screens. */
.lbrow .kick { position: absolute; right: 3.4rem; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; font-size: .95rem; }
@media (hover: none) {
  .roundwrap { grid-template-columns: minmax(0, 1fr) minmax(240px, 330px); }
  .lbrow { grid-template-columns: 1.3rem 28px minmax(0, 1fr) .8rem 1.2rem 2rem 22px; gap: 6px; padding-inline: 6px; }
  .lbrow .kick { position: static; transform: none; }
}
.lbrow.leaving { animation: leave .42s ease-in forwards; pointer-events: none; }
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(4, 8, 16, .6); animation: fadein .2s ease-out both; }
.modalcard { background: var(--stage-2); border: 1px solid var(--line); border-radius: 20px; padding: 28px 32px; display: flex; flex-direction: column; gap: 20px; text-align: center; max-width: 420px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); animation: pop .25s ease-out both; }
.modaltext { font-family: var(--display); font-weight: 800; font-size: 1.6rem; overflow-wrap: anywhere; }
.btn.danger { background: var(--coral); color: #fff; }
.banner.removed { border-color: var(--coral); color: var(--ink); }

/* ---------- Lobby: Start pulses once 2+ players are in ---------- */
#start.ready { animation: ready 1.8s ease-in-out infinite; }
@keyframes ready { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--marigold) 55%, transparent); transform: scale(1); } 50% { box-shadow: 0 0 0 12px transparent; transform: scale(1.04); } }

/* ---------- Question appears: card flips in, words follow quickly ---------- */
.qcard.enter { animation: cardin .6s cubic-bezier(.2, .9, .3, 1.15) backwards; transform-origin: 50% 0; }
@keyframes cardin { from { transform: perspective(1200px) rotateX(-75deg) translateY(-20px); opacity: 0; } to { transform: perspective(1200px); opacity: 1; } }
.qcard h2 .w { display: inline-block; animation: wordin .32s ease-out backwards; animation-delay: calc(.32s + var(--i, 0) * 55ms); }
@keyframes wordin { from { transform: translateY(.35em); opacity: 0; } to { transform: none; opacity: 1; } }

/* Timer: green, then yellow, then red; a small shake on each of the last beeps */
.timer .bar { transition: stroke-dashoffset .3s linear, stroke .6s; }
.timer[data-level="ok"] .bar { stroke: #46d37a; }
.timer[data-level="mid"] .bar { stroke: var(--marigold); }
.timer[data-level="low"] .bar { stroke: var(--coral); }
.timer.shake { animation: shake .35s ease-in-out; }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-4px) rotate(-2deg); } 40% { transform: translateX(4px) rotate(2deg); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }

/* A player's chip lights up when they lock in */
.voter.lit { animation: lit .8s ease-out; }
@keyframes lit { 0% { transform: scale(1); box-shadow: 0 0 0 0 color-mix(in srgb, var(--teal) 70%, transparent); } 30% { transform: scale(1.1); } 100% { transform: scale(1); box-shadow: 0 0 0 14px transparent; } }

/* Nobody voted */
.shrug { font-size: 4.5rem; line-height: 1; animation: shrug 1.2s ease-in-out 2; }
@keyframes shrug { 0%, 100% { transform: none; } 25% { transform: translateY(-10px) rotate(-8deg); } 50% { transform: none; } 75% { transform: translateY(-10px) rotate(8deg); } }

/* Final scores: places arrive from last to first */
.place.waiting { opacity: 0; transform: translateY(14px) scale(.96); }
.place.arrive { animation: placein .45s cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes placein { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }

/* Phone: the "+1" pops in when you score */
.big.popin { display: inline-block; animation: popin .6s cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes popin { 0% { transform: scale(.2); opacity: 0; } 60% { transform: scale(1.35); opacity: 1; } 100% { transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  #start.ready, .qcard.enter, .qcard h2 .w, .timer.shake, .voter.lit, .shrug, .place.arrive, .big.popin, .modal, .modalcard { animation: none !important; }
  .place.waiting { opacity: 1; transform: none; }
}
.pl.away { opacity: .45; transition: opacity .3s; }

/* ---------- Reveal: drumroll countdown, winner pop ---------- */
.countnum { font-family: var(--display); font-weight: 800; font-size: clamp(5rem, 16vw, 11rem); line-height: 1; color: var(--mode); text-shadow: 0 0 40px color-mix(in srgb, var(--mode) 55%, transparent); animation: countin .8s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes countin { 0% { transform: scale(2.4); opacity: 0; } 35% { transform: scale(.92); opacity: 1; } 55% { transform: scale(1.04); } 85% { transform: scale(1); opacity: 1; } 100% { transform: scale(.8); opacity: 0; } }
.winpop { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; cursor: pointer;
  background: radial-gradient(60% 50% at 50% 50%, color-mix(in srgb, var(--pc) 30%, transparent), color-mix(in srgb, var(--stage) 82%, transparent)); animation: fadein .25s both; }
.winpop .eyebrow { font-size: clamp(1rem, 2.4vw, 1.6rem); color: var(--ink); }
.wpname { font-family: var(--display); font-weight: 800; font-size: clamp(3.5rem, 13vw, 10rem); line-height: .95; color: var(--pc); overflow-wrap: anywhere; text-wrap: balance;
  text-shadow: 0 0 60px color-mix(in srgb, var(--pc) 60%, transparent), 0 6px 0 color-mix(in srgb, var(--pc) 35%, var(--stage)); animation: wpin .7s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes wpin { 0% { transform: scale(.2) rotate(-8deg); opacity: 0; } 55% { transform: scale(1.12) rotate(2deg); opacity: 1; } 100% { transform: none; } }
.winpop.out { animation: wpout .45s ease-in both; }
@keyframes wpout { to { opacity: 0; transform: scale(1.08); } }

/* ---------- Most voted this game (under the leaderboard) ---------- */
.mvpanel { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.mvpanel > .eyebrow { padding-left: 6px; }
.mvempty { padding-left: 6px; margin: 0; }
.mvlist { display: flex; flex-direction: column; gap: 4px; }
.mvrow { display: grid; grid-template-columns: 26px minmax(0, 5.5rem) minmax(0, 1fr) 1.6rem; gap: 8px; align-items: center; padding: 3px 8px; border-radius: 10px; font-weight: 700; font-size: .92rem; }
.mvrow .dot { width: 26px; height: 26px; font-size: .8rem; }
.mvrow .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mvrow b { font-family: var(--display); text-align: right; font-variant-numeric: tabular-nums; }
.mvbar { height: 8px; border-radius: 99px; background: var(--stage-3); overflow: hidden; }
.mvbar i { display: block; height: 100%; border-radius: inherit; background: var(--pc); transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.mvrow.top { background: color-mix(in srgb, var(--pc) 16%, transparent); }
.mvrow.top .nm::after { content: " 😈"; }
.mvrow.bump { animation: mvbump .7s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes mvbump { 0% { transform: scale(1); } 40% { transform: scale(1.06); background: color-mix(in srgb, var(--pc) 30%, transparent); } 100% { transform: scale(1); } }

/* ---------- End-of-game titles ---------- */
.awards { width: 100%; max-width: 980px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.award { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 12px; border-radius: 16px; background: var(--stage-2); border: 1px solid var(--line); text-align: center; }
.award .aemoji { font-size: 2.2rem; line-height: 1; }
.award .atitle { font-family: var(--display); font-size: 1.25rem; color: var(--marigold); }
.award .awho { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; font-weight: 700; }
.award .aname { display: inline-flex; align-items: center; gap: 6px; }
.award .aname .dot { width: 24px; height: 24px; font-size: .75rem; }
.award .hint { margin: 0; font-size: .85rem; }
.award.waiting { opacity: 0; transform: translateY(14px) scale(.9); }
.award.arrive { animation: awardin .55s cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes awardin { from { opacity: 0; transform: translateY(18px) scale(.8) rotate(-3deg); } to { opacity: 1; transform: none; } }
.mytitle b { color: var(--marigold); }

@media (prefers-reduced-motion: reduce) {
  .countnum, .winpop, .wpname, .mvrow.bump, .award.arrive { animation: none !important; }
  .award.waiting { opacity: 1; transform: none; }
}

/* ---------- Player-written questions ---------- */
.pwchip { background: color-mix(in srgb, var(--mode) 22%, var(--stage-3)); border-color: color-mix(in srgb, var(--mode) 55%, transparent); }
.pqbox { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 16px; background: var(--stage-2); border: 1px solid var(--line); text-align: left; }
.pqbox .hint, .pqbox .err { margin: 0; }
.pqprefix { font-family: var(--display); font-weight: 800; font-size: 1.15rem; }
.pqtext { margin: 0; font-family: var(--display); font-weight: 800; font-size: 1.2rem; line-height: 1.2; color: var(--mode); overflow-wrap: anywhere; }
.pqbox.sent { border-color: color-mix(in srgb, var(--teal) 55%, transparent); }

/* ---------- Phones: vibration toggle and the countdown beat ---------- */
.vibe.off { opacity: .55; }
.beatpop { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; pointer-events: none; background: color-mix(in srgb, var(--stage) 55%, transparent); }
@media (prefers-reduced-motion: reduce) { .beatpop { display: none; } }
