:root {
  --bg: #0a0e24;
  --bg2: #121a3d;
  --card: #18214d;
  --card2: #202b5e;
  --ink: #f6f1e7;
  --muted: #9aa3c7;
  --gold: #ffcf5c;
  --gold2: #f4a62a;
  --line: rgba(255, 255, 255, 0.12);
  --good: #3ddc97;
  --bad: #ff5d73;
  --r: 18px;
  --glow1: rgba(255, 207, 92, 0.16);
  --glow2: rgba(155, 93, 229, 0.18);
  --shade: #a8650c;
  --font: 'Bricolage Grotesque', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 80% -10%, var(--glow1), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, var(--glow2), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
h1, h2 { margin: 0; line-height: 1.1; letter-spacing: -0.02em; }
p { margin: 0; }

/* ---------- shared bits ---------- */

.logo { font-weight: 800; font-size: 2.4rem; letter-spacing: -0.04em; }
.logo span { color: var(--logo, var(--gold)); }
.logo small { font-size: 0.45em; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.logo.small { font-size: 1.4rem; display: flex; align-items: baseline; gap: 10px; }
.logo em { font-style: normal; font-size: 0.7em; padding: 2px 10px; border-radius: 99px; background: var(--card); color: var(--gold); letter-spacing: 0.1em; }
.muted { color: var(--muted); }
.lead { font-size: 1.25rem; font-weight: 600; }
.error { color: var(--bad); font-weight: 600; }

.btn {
  appearance: none; border: 0; cursor: pointer; border-radius: 14px;
  padding: 12px 20px; font-weight: 700;
  background: linear-gradient(180deg, var(--gold), var(--gold2)); color: #2a1b00;
  box-shadow: 0 6px 0 var(--shade), 0 10px 24px rgba(244, 166, 42, 0.25);
  transition: transform 0.08s, box-shadow 0.08s, opacity 0.2s;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 var(--shade); }
.btn:disabled { opacity: 0.35; cursor: default; }
.btn.big { font-size: 1.3rem; padding: 16px 28px; width: 100%; }
.btn.ghost { background: var(--card); color: var(--ink); box-shadow: 0 4px 0 #0b112e; }
.btn.danger, button.danger { color: var(--bad); }
.btn.arm, button.arm { background: var(--bad) !important; color: #fff !important; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 6px; }

.field { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.field > span { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
input, select {
  background: var(--bg2); border: 2px solid var(--line); border-radius: 12px;
  padding: 12px 14px; width: 100%; outline: none; min-width: 0;
}
input:focus, select:focus { border-color: var(--gold); }
input[type=radio], input[type=checkbox] { width: auto; accent-color: var(--gold2); }
.field.check .row { min-height: 50px; font-weight: 600; }

.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 28px; }
.setup { width: min(480px, calc(100% - 32px)); margin: 8vh auto; }

.seg { display: inline-flex; background: var(--bg2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button, .seg label span { border: 0; background: none; padding: 8px 14px; border-radius: 9px; cursor: pointer; display: block; font-weight: 600; color: var(--muted); }
.seg label { position: relative; }
.seg label input { position: absolute; opacity: 0; }
.seg button.on, .seg label input:checked + span { background: var(--card2); color: var(--ink); }

.timer { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.timer i { display: block; height: 100%; background: var(--gold); transform-origin: left; transition: background 0.3s; }
.timer i.low { background: var(--bad); }
.timer.wide { width: 100%; border-radius: 0; height: 10px; }

.conn {
  position: fixed; top: env(safe-area-inset-top, 0px); left: 50%; transform: translateX(-50%); z-index: 50;
  background: var(--bad); color: #fff; padding: 6px 14px; border-radius: 0 0 12px 12px; font-weight: 700; font-size: 0.9rem;
}

.ready {
  position: fixed; inset: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 94%, transparent);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 24px;
}
.ready span { font-size: 1.5rem; font-weight: 700; color: var(--gold); }
.ready b { font-size: min(40vw, 14rem); line-height: 1; font-weight: 800; animation: pulse 1s infinite; }
@keyframes pulse { 0% { transform: scale(1.15); opacity: 0.6; } 30% { transform: scale(1); opacity: 1; } }

/* ---------- phone ---------- */

body.phone {
  overscroll-behavior: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  touch-action: manipulation;
}
body.phone input { -webkit-user-select: text; user-select: text; font-size: 18px; /* ≥16px stops iOS zoom-on-focus */ }
.screen {
  min-height: 100dvh; padding: calc(20px + env(safe-area-inset-top, 0px)) 20px calc(20px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; max-width: 560px; margin: 0 auto;
}
.screen.center { justify-content: center; align-items: center; text-align: center; }
.screen form, form.screen { justify-content: center; }
.codein { text-align: center; font-size: 2.6rem !important; letter-spacing: 0.3em; text-transform: uppercase; font-weight: 800; padding: 10px; }

.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.sw { aspect-ratio: 1; border-radius: 50%; border: 3px solid transparent; background: var(--c); cursor: pointer; padding: 0; }
.sw.on { border-color: #fff; box-shadow: 0 0 0 3px var(--c); transform: scale(1.05); }
.sw:disabled { opacity: 0.15; }

.avatar { width: 112px; height: 112px; border-radius: 50%; background: var(--c); color: #111; display: grid; place-items: center; font-size: 3.5rem; font-weight: 800; box-shadow: 0 0 0 6px rgba(255,255,255,0.08), 0 0 60px var(--c); }
.avatar.small { width: 64px; height: 64px; font-size: 2rem; }
.tag { padding: 3px 10px; border-radius: 99px; background: var(--c); color: #111; font-weight: 700; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.screen.play { padding: 0; height: 100dvh; min-height: 0; max-width: none; }
.qhead { padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 12px; background: var(--bg2); display: flex; flex-direction: column; gap: 8px; }
.qmeta { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; color: var(--muted); font-weight: 600; gap: 8px; }
.prompt { font-size: 1.2rem; font-weight: 700; }
.mapwrap { flex: 1; position: relative; min-height: 0; touch-action: none; }
.mapcanvas { position: absolute; inset: 0; }
/* Parked map: off-screen but full-size, so it keeps its WebGL context and loaded tiles. */
.mapcanvas.parked { position: fixed; top: 0; left: -300vw; width: 100vw; height: 100dvh; pointer-events: none; visibility: hidden; }
.hint { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); background: color-mix(in srgb, var(--bg) 85%, transparent); padding: 8px 14px; border-radius: 99px; font-size: 0.9rem; font-weight: 600; pointer-events: none; white-space: nowrap; }
.bar { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--bg2); }

.choices { flex: 1; display: grid; grid-template-rows: repeat(4, 1fr); gap: 10px; padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px)); }
.choice {
  border: 0; border-radius: 20px; background: var(--c); color: #fff; display: flex; align-items: center; gap: 14px;
  padding: 0 18px; text-align: left; font-size: 1.25rem; font-weight: 700; cursor: pointer;
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.25); text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.choice b { width: 44px; height: 44px; flex: none; border-radius: 12px; background: rgba(0, 0, 0, 0.2); display: grid; place-items: center; }
.choice:active { transform: scale(0.97); }
.choice:disabled { opacity: 0.5; }

.dial { flex: 1; display: flex; justify-content: center; align-items: center; gap: 10px; padding: 16px; }
.wheel { display: flex; flex-direction: column; align-items: center; background: var(--card); border-radius: 20px; width: 21vw; max-width: 96px; overflow: hidden; touch-action: none; }
.wheel output { font-size: min(16vw, 4.5rem); font-weight: 800; padding: 6px 0; font-variant-numeric: tabular-nums; }
.step { width: 100%; border: 0; background: var(--card2); padding: 18px 0; font-size: 1.4rem; cursor: pointer; color: var(--gold); }
.step:active { background: var(--gold2); color: #111; }

.check { width: 96px; height: 96px; border-radius: 50%; background: var(--good); color: #062; display: grid; place-items: center; font-size: 3rem; font-weight: 800; }
.youranswer { font-size: 1.4rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.chip { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--c); color: #fff; }
.bignum { font-size: 3.2rem; font-weight: 800; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; color: var(--gold); }
.bigicon { font-size: 3rem; }
.screen .timer.wide { width: 70%; border-radius: 99px; }

.result .points { font-size: 5.5rem; font-weight: 800; line-height: 1; }
.result.good .points { color: var(--gold); text-shadow: 0 0 40px rgba(255, 207, 92, 0.5); }
.result.bad .points { color: var(--muted); }
.rank { font-size: 5rem; font-weight: 800; color: var(--gold); line-height: 1; }
.rank .up { color: var(--good); font-size: 1.6rem; vertical-align: middle; }
.rank .down { color: var(--bad); font-size: 1.6rem; vertical-align: middle; }
.score { font-size: 1.4rem; font-weight: 700; }
.ny { font-size: 2.2rem; color: var(--gold); }

.mg-intro .kicker, .kicker { color: var(--gold); text-transform: uppercase; letter-spacing: 0.2em; font-weight: 800; }
.mg-icon { font-size: 4.5rem; line-height: 1; }
.how { color: var(--ink); opacity: 0.85; max-width: 32ch; margin-inline: auto; }
.you-play { font-size: 1.6rem; font-weight: 800; color: var(--gold); animation: pulse 1.2s infinite; }

/* minigame stage: owns all touches */
.mg-stage { position: fixed; inset: 0; touch-action: none; overscroll-behavior: none; }
.mg-full {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px)); text-align: center;
}
.mg-goal { font-size: 1.5rem; font-weight: 700; }
.mg-goal b { color: var(--gold); }
.mg-tip { color: var(--muted); font-weight: 600; }
.mg-time { font-size: min(30vw, 9rem); font-weight: 800; font-variant-numeric: tabular-nums; }
.mg-time.stopped { color: var(--gold); }
.mg-react { transition: background 0.1s; }
.mg-react.wait { background: #3a1830; }
.mg-react.go { background: var(--good); color: #052; }
.mg-react.early { background: var(--bad); }
.mg-react.hit { background: var(--card2); }
.mg-big { font-size: min(16vw, 5rem); font-weight: 800; }
.mg-count { font-size: min(28vw, 8rem); font-weight: 800; color: var(--gold); line-height: 1; font-variant-numeric: tabular-nums; }
.mg-pad { width: min(70vw, 300px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff8fa3, #e63946); display: grid; place-items: center; font-size: 2.4rem; font-weight: 800; box-shadow: inset 0 -12px 0 rgba(0,0,0,0.25), 0 0 60px rgba(230,57,70,0.4); }
.mg-pad.pop { animation: pop 0.12s; }
@keyframes pop { 50% { transform: scale(0.93); } }
.mg-mash .timer, .mg-swipe .timer { width: 80%; }
.mg-banana { justify-content: flex-start; }
.mg-banana .banana { position: absolute; overflow: visible; filter: drop-shadow(0 10px 20px rgba(0,0,0,0.4)); }
.mg-banana .half { transition: transform 0.8s cubic-bezier(.2,.8,.2,1); }
.mg-banana .hl { transform: translate(-14px, 6px) rotate(-4deg); }
.mg-banana .hr { transform: translate(14px, 6px) rotate(4deg); }
.mg-banana .trail { position: absolute; inset: 0; pointer-events: none; }
.mg-banana .trail polyline { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 6px #fff); }
.mg-msg { position: absolute; bottom: calc(18% + env(safe-area-inset-bottom, 0px)); left: 0; right: 0; font-size: 1.6rem; font-weight: 700; }
.mg-msg b { color: var(--gold); font-size: 2.2rem; }
.mg-target { justify-content: flex-start; }
.tgt { position: absolute; left: 0; top: 0; border-radius: 50%; will-change: transform;
  background: radial-gradient(circle, #fff 0 9%, var(--bad) 9% 26%, #fff 26% 44%, var(--bad) 44% 62%, #fff 62% 80%, var(--bad) 80%); box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.hitdot { position: absolute; transform: translate(-50%, -50%); font-style: normal; font-weight: 800; font-size: 1.1rem; padding: 4px 8px; border-radius: 99px; pointer-events: none; animation: rise 1.2s forwards; }
.hitdot.great { background: var(--good); color: #052; }
.hitdot.ok { background: var(--gold); color: #2a1b00; }
.hitdot.miss { background: var(--bad); color: #fff; }
@keyframes rise { to { transform: translate(-50%, -160%); opacity: 0; } }
.mg-swipe .arrow { font-size: min(45vw, 14rem); line-height: 1; color: var(--ink); }
.mg-swipe .arrow.red { color: var(--bad); }
.mg-swipe.ok { animation: flashok 0.25s; }
.mg-swipe.bad { animation: flashbad 0.25s; }
@keyframes flashok { from { background: rgba(61, 220, 151, 0.45); } }
@keyframes flashbad { from { background: rgba(255, 93, 115, 0.5); } }

/* ---------- TV ---------- */

body.tvbody { overflow: hidden; }
.tv { height: 100vh; display: flex; flex-direction: column; font-size: clamp(16px, 1.25vw, 30px); }
.tv > main { flex: 1; min-height: 0; }
.tvhead { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.5em; padding: 1.2em 2em; }
.tvhead.center { grid-template-columns: 1fr; text-align: center; }
.tvhead h1 { font-size: 2.4em; }
.qnum { color: var(--gold); font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.9em; white-space: nowrap; }
.fact { color: var(--gold); font-weight: 600; display: block; font-size: 0.6em; margin-top: 0.2em; }
.clock { width: 3.6em; height: 3.6em; border-radius: 50%; background: var(--card); border: 4px solid var(--gold); display: grid; place-items: center; font-size: 1.6em; font-weight: 800; font-variant-numeric: tabular-nums; }
.tvbar { display: flex; align-items: center; gap: 1.2em; padding: 1em 2em; background: rgba(0,0,0,0.2); }
.tvbar .hint { position: static; transform: none; background: none; color: var(--muted); margin-left: auto; font-size: 0.85em; padding: 0; }
.tvbar .btn.big { width: auto; font-size: 1.1em; }
.tvbar:not(:has(.chips, .seg, #mgbtn)) .hint { margin-left: auto; }

.tv.lobby { display: grid; grid-template-columns: 1.1fr 1fr; grid-template-rows: minmax(0, 1fr) auto; }
.lobby .tvbar { grid-column: 1 / -1; }
.lobby-join { display: flex; flex-direction: column; justify-content: center; padding: 3em; gap: 1em; }
.logo.huge { font-size: 6em; line-height: 0.9; }
.subtitle { font-size: 1.4em; color: var(--muted); }
.joinbox { display: flex; gap: 2em; align-items: center; margin-top: 1.5em; }
.qr { background: #fff; padding: 0.6em; border-radius: 20px; width: 14em; flex: none; }
.qr svg { display: block; width: 100%; height: auto; }
.joininfo p { font-size: 1.3em; color: var(--muted); }
.joininfo .url { color: var(--ink); font-weight: 700; font-size: 1.8em; }
.joininfo .code { font-size: 5em; font-weight: 800; letter-spacing: 0.12em; color: var(--gold); line-height: 1; margin-top: 0.15em; }
.lobby-teams { padding: 3em 3em 3em 0; display: flex; flex-direction: column; gap: 1em; overflow: hidden; }
.lobby-teams h2 { font-size: 1.6em; color: var(--muted); }
.teams { display: flex; flex-wrap: wrap; gap: 0.8em; align-content: flex-start; }
.team { display: flex; align-items: center; gap: 0.6em; border: 0; background: var(--card); border-radius: 99px; padding: 0.4em 1.2em 0.4em 0.4em; font-size: 1.3em; font-weight: 700; cursor: pointer; animation: popin 0.4s cubic-bezier(.2,1.6,.4,1); }
.team i { width: 2em; height: 2em; border-radius: 50%; background: var(--c); color: #111; display: grid; place-items: center; font-style: normal; }
.team.off { opacity: 0.4; }
.team.arm::after { content: '✕'; margin-left: 0.3em; }
@keyframes popin { from { transform: scale(0.3); opacity: 0; } }

.stage { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.5em; padding: 0 2em 1.5em; min-height: 0; }
.photo { max-width: 100%; max-height: 100%; min-height: 0; flex: 1 1 auto; object-fit: contain; border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.kind-choice.has-img .photo { max-height: 50vh; }
.bigemoji { font-size: 12em; }
.numhint { font-size: 4em; font-weight: 800; color: var(--muted); letter-spacing: 0.1em; }
.tvchoices { display: grid; grid-template-columns: 1fr 1fr; gap: 1em; width: 100%; max-width: 90em; }
.tvchoice { display: flex; align-items: center; gap: 0.8em; background: var(--c); border-radius: 18px; padding: 0.8em 1.2em; font-size: 1.6em; font-weight: 700; color: #fff; box-shadow: inset 0 -6px 0 rgba(0,0,0,0.25); transition: opacity 0.4s, transform 0.4s; }
.tvchoice b { width: 1.8em; height: 1.8em; border-radius: 10px; background: rgba(0,0,0,0.2); display: grid; place-items: center; flex: none; }
.tvchoice em { margin-left: auto; font-style: normal; font-size: 1.2em; background: rgba(0,0,0,0.25); padding: 0 0.6em; border-radius: 10px; }
.tvchoice.dim { opacity: 0.3; }
.tvchoice.right { transform: scale(1.03); box-shadow: 0 0 0 5px #fff, 0 0 40px var(--c); }
.chips { display: flex; gap: 0.4em; flex-wrap: wrap; }
.mini { width: 2.2em; height: 2.2em; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--card); color: var(--muted); border: 3px solid var(--c); transition: all 0.3s; }
.mini.done { background: var(--c); color: #111; transform: scale(1.1); }
.count { font-weight: 700; color: var(--muted); }

.split { display: grid; grid-template-columns: 1fr 30em; gap: 1.5em; padding: 0 2em 1.5em; min-height: 0; }
.split > :first-child { min-height: 0; align-self: stretch; }
.reveal .split .tvchoices { grid-template-columns: 1fr; align-content: center; }
.rmap { border-radius: 20px; overflow: hidden; position: relative; min-height: 50vh; }
.rmap .thumb { position: absolute; left: 1em; bottom: 1em; z-index: 3; width: 14em; border-radius: 12px; border: 4px solid #fff; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.pinmark { width: 2em; height: 2em; border-radius: 50%; background: var(--c); border: 3px solid #fff; color: #111; display: grid; place-items: center; font-weight: 800; font-size: 14px; box-shadow: 0 4px 12px rgba(0,0,0,0.5); animation: drop 0.5s backwards cubic-bezier(.2,1.6,.4,1); }
@keyframes drop { from { transform: translateY(-60px) scale(0.4); opacity: 0; } }
.truth { font-size: 46px; color: var(--gold); text-shadow: 0 0 4px #000, 0 0 24px var(--gold); line-height: 1; }
.bigans { display: flex; flex-direction: column; justify-content: center; align-items: center; background: var(--card); border-radius: 20px; }
.bigans span { font-size: 1.6em; color: var(--muted); }
.bigans b { font-size: 10em; color: var(--gold); letter-spacing: 0.06em; font-variant-numeric: tabular-nums; line-height: 1; }

.results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5em; overflow: auto; }
.results li { display: grid; grid-template-columns: 2.2em 1fr auto auto; align-items: center; gap: 0.7em; background: var(--card); border-radius: 14px; padding: 0.5em 0.8em; font-size: 1.15em; animation: slidein 0.4s backwards; }
.results li:nth-child(n) { animation-delay: calc(var(--i, 0) * 60ms); }
.results i { width: 2em; height: 2em; border-radius: 50%; background: var(--c); color: #111; display: grid; place-items: center; font-style: normal; font-weight: 800; }
.results .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results .det { color: var(--muted); }
.results b { color: var(--gold); min-width: 3.5em; text-align: right; }
.results b.neg { color: var(--bad); }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }

.scores main { padding: 0 2em 1.5em; overflow: hidden; }
.board { list-style: none; margin: 0 auto; padding: 0; display: flex; flex-direction: column; gap: 0.6em; max-width: 70em; }
.board li { position: relative; display: grid; grid-template-columns: 2.4em 1.6em 1fr auto 5em; align-items: center; gap: 0.8em; padding: 0.7em 1.2em; border-radius: 16px; background: var(--card); overflow: hidden; font-size: 1.35em; animation: slidein 0.5s backwards; animation-delay: var(--d); }
.board li { background: linear-gradient(90deg, color-mix(in srgb, var(--c) 45%, var(--card)), color-mix(in srgb, var(--c) 15%, var(--card)) calc(var(--w) * 100%), var(--card) calc(var(--w) * 100%)); }
.board .rk { font-weight: 800; font-size: 1.3em; }
.board .mv { font-size: 0.8em; color: var(--muted); }
.board .mv.up { color: var(--good); }
.board .mv.down { color: var(--bad); }
.board .name { font-weight: 700; }
.board .gain { color: var(--gold); font-weight: 700; }
.board .tot { text-align: right; font-size: 1.2em; }

.mg { background: radial-gradient(800px 500px at 50% 30%, var(--glow2), transparent 70%); }
.mgcenter { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2em; padding: 1em 2em; text-align: center; min-height: 0; }
.mgcenter .kicker { font-size: 2em; }
.slot { height: 5em; overflow: hidden; font-size: 2.2em; font-weight: 800; mask-image: linear-gradient(transparent, #000 25%, #000 75%, transparent); }
.slot-reel > div { height: 5em; display: flex; align-items: center; justify-content: center; gap: 0.4em; }
.slot-reel span { font-size: 1.6em; }
.mgreveal { display: flex; flex-direction: column; align-items: center; gap: 0.8em; animation: popin 0.5s cubic-bezier(.2,1.6,.4,1); }
.mgreveal h1 { font-size: 3em; color: var(--gold); }
.mgreveal .how { font-size: 1.4em; max-width: 40ch; }
.mgmode { font-size: 2em; font-weight: 800; }
.stake { font-size: 1.3em; color: var(--gold); font-weight: 700; }
.duel { display: flex; align-items: center; gap: 1em; font-size: 2.4em; font-weight: 800; }
.duel span { padding: 0.2em 0.8em; border-radius: 99px; background: var(--c); color: #111; }
.duel em { font-style: normal; color: var(--muted); font-size: 0.7em; }
.mglist { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8em; max-width: 80em; }
.mglist li { display: flex; align-items: center; gap: 0.6em; background: var(--card); padding: 0.4em 1.2em 0.4em 0.4em; border-radius: 99px; font-size: 1.3em; font-weight: 700; }
.mglist i { width: 2em; height: 2em; border-radius: 50%; background: var(--c); color: #111; display: grid; place-items: center; font-style: normal; }
.mglist em { font-style: normal; color: var(--muted); font-size: 0.8em; }
.mglist li.done { box-shadow: 0 0 0 3px var(--good); }
.mglist li.done em { color: var(--good); }
.mgresults { width: min(50em, 100%); }
.tvready b { font-size: 16em; }

.final { position: relative; }
.final canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.final > :not(canvas) { position: relative; z-index: 1; }
.final main { display: flex; flex-direction: column; align-items: center; gap: 1.5em; padding: 1em 2em; overflow: hidden; }
.final .ny { font-size: 3em; text-shadow: 0 0 40px rgba(255, 207, 92, 0.6); }
.podium { display: flex; align-items: flex-end; gap: 1.2em; }
.pod { width: 14em; display: flex; flex-direction: column; align-items: center; gap: 0.6em; animation: rise-in 0.8s backwards cubic-bezier(.2,1.2,.3,1); }
.pod.p1 { animation-delay: 1.2s; } .pod.p2 { animation-delay: 0.6s; } .pod.p3 { animation-delay: 0.1s; }
@keyframes rise-in { from { transform: translateY(80px); opacity: 0; } }
.pod .who { display: flex; flex-direction: column; align-items: center; gap: 0.2em; font-size: 1.3em; font-weight: 700; text-align: center; }
.pod .who i { width: 3em; height: 3em; border-radius: 50%; background: var(--c); color: #111; display: grid; place-items: center; font-style: normal; font-size: 1.3em; box-shadow: 0 0 40px var(--c); }
.pod .who b { color: var(--gold); }
.pod .block { width: 100%; border-radius: 14px 14px 0 0; background: linear-gradient(180deg, var(--card2), var(--card)); display: grid; place-items: center; font-size: 3em; font-weight: 800; color: var(--gold); }
.pod.p1 .block { height: 2.4em; font-size: 3.6em; }
.pod.p2 .block { height: 2em; }
.pod.p3 .block { height: 1.3em; }
.pod.empty { width: 14em; }
.rest { list-style-position: inside; display: flex; flex-wrap: wrap; gap: 0.6em 1.4em; justify-content: center; padding: 0; margin: 0; font-size: 1.1em; color: var(--muted); }
.rest li span { color: var(--ink); font-weight: 700; margin-right: 0.4em; }

/* ---------- admin ---------- */

.admin { display: grid; grid-template-columns: 300px 1fr; min-height: 100vh; }
.side { background: var(--bg2); padding: 24px; display: flex; flex-direction: column; gap: 16px; border-right: 1px solid var(--line); }
.side .logo { font-size: 1.8rem; }
.quizlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.quizlist button { width: 100%; text-align: left; background: none; border: 0; padding: 10px 12px; border-radius: 10px; cursor: pointer; display: flex; justify-content: space-between; font-weight: 600; }
.quizlist button.on, .quizlist button:hover { background: var(--card); }
.quizlist small { color: var(--muted); }
.side form input { flex: 1; }
.adminmain { padding: 28px; display: flex; flex-direction: column; gap: 18px; max-width: 1100px; }
.titlein { font-size: 1.6rem; font-weight: 800; flex: 1; background: transparent; border-color: transparent; }
.titlein:hover, .titlein:focus { border-color: var(--line); }
.qlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.qlist li { display: grid; grid-template-columns: 2em 2em 72px 1fr auto; align-items: center; gap: 12px; background: var(--card); border-radius: 14px; padding: 10px 14px; }
.qlist .n { color: var(--muted); font-weight: 700; }
.qlist img, .qlist .noimg { width: 72px; height: 48px; object-fit: cover; border-radius: 8px; background: var(--bg2); }
.qtext { display: flex; flex-direction: column; min-width: 0; }
.qtext b, .qtext small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qtext small { color: var(--muted); }
.acts { display: flex; gap: 4px; }
.acts button { background: var(--bg2); border: 0; border-radius: 8px; padding: 8px 10px; cursor: pointer; font-weight: 600; }
.acts button:disabled { opacity: 0.3; }

dialog { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 20px; padding: 0; width: min(900px, calc(100% - 32px)); max-height: calc(100vh - 40px); }
dialog::backdrop { background: rgba(5, 7, 20, 0.7); backdrop-filter: blur(4px); }
.editor { padding: 24px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 8px; margin-top: 8px; }
.narrow { max-width: 220px; }
.emap { height: 320px; border-radius: 12px; overflow: hidden; }
.optrow { display: grid; grid-template-columns: auto auto 1fr 1fr; gap: 8px; align-items: center; }
.chipl { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: #fff; }
.chipl.c0 { background: #e63946; } .chipl.c1 { background: #3a86ff; } .chipl.c2 { background: #f4a300; } .chipl.c3 { background: #2a9d8f; }

@media (max-width: 760px) {
  .admin { grid-template-columns: 1fr; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .qlist li { grid-template-columns: 1.5em 56px 1fr; }
  .qlist .kind { display: none; }
  .qlist .acts { grid-column: 1 / -1; justify-content: flex-end; }
  }

/* ---------- teams ---------- */

.teampick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tp { display: flex; align-items: center; gap: 10px; padding: 14px 12px; border-radius: 14px; border: 3px solid transparent; background: var(--card); cursor: pointer; font-weight: 700; font-size: 1.05rem; text-align: left; }
.tp i { width: 18px; height: 18px; border-radius: 50%; background: var(--c); flex: none; }
.tp span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp small { color: var(--muted); font-weight: 600; }
.tp.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 22%, var(--card)); }
.teamname { color: var(--c); font-weight: 800; }
.teamname.big { font-size: 1.8rem; }
.teamline { font-weight: 600; }
.teamline b { color: var(--c); }

.lineup { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.6em 0.8em; }
.lu { display: flex; flex-direction: column; align-items: center; background: var(--c); color: #111; border-radius: 16px; padding: 0.35em 1em; }
.lu b { font-size: 1.1em; }
.lu span { font-size: 0.85em; font-weight: 600; opacity: 0.8; }
.lineup em { font-style: normal; color: var(--muted); font-weight: 800; }
.tv .lineup { font-size: 1.8em; }
.tv .lineup.all { font-size: 1.3em; }

.teamgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13em, 1fr)); gap: 1em; align-content: start; overflow: auto; }
.teamcard { background: var(--card); border-radius: 18px; padding: 0.9em 1em; border-top: 6px solid var(--c); }
.teamcard h3 { margin: 0 0 0.5em; font-size: 1.4em; color: var(--c); }
.teamcard ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4em; }
.member { border: 0; background: var(--bg2); color: inherit; border-radius: 99px; padding: 0.3em 0.8em; font-size: 1.05em; font-weight: 600; cursor: pointer; }
.member.new { animation: popin 0.4s cubic-bezier(.2,1.6,.4,1); }
.lobby-teams .teamgrid { flex: 1; min-height: 0; }
.membercount { margin: 0; font-size: 1.3em; font-weight: 700; color: var(--muted); }
.membercount b { font-size: 2.2em; color: var(--ink); margin-right: 0.15em; display: inline-block; }
.membercount.bump b { animation: popin 0.4s cubic-bezier(.2,1.6,.4,1); }
.chips[data-size='l'] { font-size: 0.8em; gap: 0.3em; }
.chips[data-size='xl'] { font-size: 0.62em; gap: 0.25em; }
.chips[data-size] .mini { border-width: 2px; }
.count { white-space: nowrap; }
.member.off { opacity: 0.4; }
.member.arm::after { content: ' ✕'; }

.chipgroup { display: inline-flex; gap: 0.3em; padding-right: 0.6em; margin-right: 0.3em; border-right: 1px solid var(--line); }
.chipgroup:last-child { border-right: 0; }
.mini.off { opacity: 0.35; }

.roundres { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr); gap: 1em; align-items: start; min-height: 0; overflow: hidden; }
.roundres ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35em; }
.roundres li { animation: slidein 0.4s backwards; animation-delay: calc(var(--i, 0) * 70ms); }
.rteams li { display: flex; align-items: baseline; gap: 0.5em; background: var(--card); border-left: 6px solid var(--c); border-radius: 12px; padding: 0.55em 0.8em; font-size: 1.15em; }
.rteams b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--c); }
.rteams span { color: var(--gold); font-weight: 800; font-variant-numeric: tabular-nums; }
.rplayers li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 0.1em 0.5em; padding: 0 0 0.3em; border-bottom: 1px solid var(--line); }
.rplayers b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rplayers span { font-weight: 800; font-variant-numeric: tabular-nums; }
.rplayers .tag { grid-column: 1 / -1; justify-self: start; max-width: 100%; font-size: 0.72em; font-style: normal; padding: 1px 8px; }
.rplayers li.more { color: var(--muted); border: 0; font-weight: 600; }
.teamresults { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6em; overflow: auto; }
.teamresults li { background: var(--card); border-radius: 14px; padding: 0.6em 0.9em; border-left: 6px solid var(--c); animation: slidein 0.4s backwards; animation-delay: calc(var(--i, 0) * 80ms); }
.trhead { display: flex; align-items: center; gap: 0.6em; font-size: 1.2em; }
.trhead i { display: none; }
.trhead b { flex: 1; }
.trhead .det { color: var(--muted); font-weight: 600; }
.trhead .gain { color: var(--gold); font-weight: 800; }
.trhead .gain.neg { color: var(--bad); }
.trmembers { display: flex; flex-wrap: wrap; gap: 0.2em 0.9em; margin-top: 0.25em; font-size: 0.92em; }
.trmembers em { font-style: normal; color: var(--muted); }
.mgresults { width: min(56em, 100%); }
.mglist { flex-direction: column; align-items: stretch; width: min(60em, 100%); }
.mglist .mgteam { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5em 1em; border-left: 6px solid var(--c); border-radius: 14px; padding: 0.6em 1em; }
.mgteam b { color: var(--c); min-width: 7em; }
.mgteam span { color: var(--muted); }
.mgteam span.done { color: var(--ink); }
.mgteam span.done em { color: var(--good); font-style: normal; }
.board .name small, .pod .who small { display: block; color: var(--muted); font-size: 0.65em; font-weight: 500; }

/* ---------- location reveal ---------- */

.split.solo { grid-template-columns: 1fr; }
.split.solo aside { display: none; }
.banner {
  position: absolute; z-index: 4; left: 50%; bottom: 1.4em; transform: translateX(-50%);
  background: color-mix(in srgb, var(--bg) 88%, transparent); border: 2px solid rgba(255, 207, 92, 0.4); backdrop-filter: blur(6px);
  border-radius: 24px; padding: 0.7em 2em; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0.1em;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.banner.pop { animation: bannerpop 0.5s cubic-bezier(.2,1.5,.4,1); }
@keyframes bannerpop { from { transform: translateX(-50%) scale(0.6); opacity: 0; } }
.banner .kicker { font-size: 1em; }
.banner b { font-size: 3em; line-height: 1.05; color: var(--c, var(--ink)); }
.banner small { font-size: 1.6em; color: var(--gold); font-weight: 700; }

/* Where the dart lands: a ripple on impact, then a small marker once the map zooms out. */
.impact { width: 0; height: 0; position: relative; }
.impact.hit::after { content: ''; position: absolute; left: -10px; top: -10px; width: 20px; height: 20px; border-radius: 50%; border: 4px solid var(--gold); animation: ripple 1.2s ease-out forwards; }
.impact.small { width: 22px; height: 22px; margin: -11px; border-radius: 50%; background: #ff4d6d; box-shadow: 0 0 0 3px #fff, 0 0 18px rgba(255, 207, 92, 0.9); transition: all 0.6s; }
@keyframes ripple { to { left: -70px; top: -70px; width: 140px; height: 140px; opacity: 0; } }

/* Shadow on the ground that converges onto the tip as the dart comes down. */
.dartshadow { width: 26px; height: 26px; margin: -13px; border-radius: 50%; background: rgba(20, 15, 5, 0.5); filter: blur(5px);
  animation: shadowin 1.05s cubic-bezier(.5,0,.75,.2) backwards; }
.dartshadow.hit { animation: none; width: 16px; height: 16px; margin: -8px; filter: blur(3px); }
.dartshadow.small { opacity: 0; }
@keyframes shadowin { from { transform: translate(180px, 80px) scale(3.5); opacity: 0.05; } }

.dart { pointer-events: none; z-index: 3; }
.dart-fly { transform-origin: 6px 184px; animation: dartin 1.05s cubic-bezier(.5,0,.75,.2) backwards, wobble 0.6s 1.05s ease-out; filter: drop-shadow(8px 14px 8px rgba(0,0,0,0.45)); }
@keyframes dartin { from { transform: translate(560px, -560px) scale(1.6); opacity: 0; } 12% { opacity: 1; } }
@keyframes wobble { 25% { transform: rotate(-6deg); } 55% { transform: rotate(3.5deg); } 80% { transform: rotate(-1.5deg); } }
.dart svg { display: block; transition: width 0.8s, height 0.8s; }
.dart.small svg { width: 100px; height: 100px; }

.pinwrap { display: flex; flex-direction: column; align-items: center; }
.pinwrap .pinmark { order: 2; }
.pinlabel { order: 1; margin-bottom: 6px; background: var(--c); color: #111; font-weight: 800; padding: 4px 10px; border-radius: 10px; font-size: 15px; white-space: nowrap; box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
.sidehead { margin: 8px 0 0; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; }
.teamrows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.teamrows li { display: grid; grid-template-columns: 160px 1fr auto; gap: 12px; align-items: center; background: var(--card); padding: 10px 12px; border-radius: 14px; }
.swatches.mini { grid-template-columns: repeat(6, 22px); gap: 5px; }
.swatches.mini .sw { width: 22px; height: 22px; border-width: 2px; }
.grow { flex: 1; }


/* ---------- polish: preloading, animated reveals, scoreboard, awards ---------- */

.iconbtn { padding: 10px 14px; font-size: 1.2em; }
.rmap .mapfill { position: absolute; inset: 0; }
.mapfill.parked { position: fixed; top: 0; left: -300vw; width: 95vw; height: 70vh; visibility: hidden; pointer-events: none; }
.rmap .banner, .rmap .thumb { z-index: 5; }

.stage { overflow: hidden; }
.photo.kenburns { animation: kenburns var(--dur, 30s) linear forwards; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.08); } }

.tvchoice { position: relative; overflow: hidden; }
.tvchoice > :not(.share) { position: relative; z-index: 1; }
.tvchoice .share { position: absolute; inset: 0 auto 0 0; width: 100%; background: rgba(255, 255, 255, 0.22); transform-origin: left; transform: scaleX(0); transition: transform 1.2s cubic-bezier(.2,.8,.2,1); }
.tvchoices.grow .share { transform: scaleX(var(--share)); }
.tvchoice.right { transform: scale(1.03); box-shadow: 0 0 0 5px #fff, 0 0 40px var(--c); }
.tvchoice.dim { opacity: 0.3; }

.bigans b { transition: transform 0.3s, text-shadow 0.3s; }
.bigans b.landed { transform: scale(1.08); text-shadow: 0 0 50px rgba(255, 207, 92, 0.7); }

@property --w { syntax: '<number>'; inherits: true; initial-value: 0; }
.board li.moving { transition: transform 1s cubic-bezier(.3,1.25,.4,1), --w 1.1s ease-out; }
.board .mv.up, .board .mv.down { animation: popin 0.4s 0.9s backwards; }

.suspense { color: var(--muted) !important; animation: pulse 0.6s infinite; }

.awards main { display: grid; place-items: center; }
.award { display: flex; flex-direction: column; align-items: center; gap: 0.4em; text-align: center; padding: 2em 4em; border-radius: 32px;
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--c, var(--gold)) 25%, var(--card)), var(--card)); box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  animation: popin 0.5s cubic-bezier(.2,1.5,.4,1); min-width: 28em; }
.award .aw-icon { font-size: 6em; line-height: 1; }
.award .kicker { font-size: 1.6em; }
.award .aw-name { font-size: 4.5em; line-height: 1.05; color: var(--c, var(--ink)); }
.award .aw-team { font-size: 1.5em; color: var(--muted); font-weight: 600; min-height: 1.2em; }
.award .aw-value { font-size: 1.8em; color: var(--gold); font-weight: 800; min-height: 1.2em; }
.award.shown .aw-name { animation: popin 0.5s cubic-bezier(.2,1.6,.4,1); }

/* Progressive photos: stacked in one grid cell, later ones fade in over the earlier. */
.photostack { position: relative; display: grid; place-items: center; flex: 1 1 auto; min-height: 0; width: 100%; }
.photostack .photo { grid-area: 1 / 1; max-height: 100%; opacity: 0; transition: opacity 0.8s; animation-play-state: paused; }
.photostack .photo.on { opacity: 1; animation-play-state: running; }
.photostep { position: absolute; top: 0.6em; right: 0.6em; z-index: 2; background: color-mix(in srgb, var(--bg) 85%, transparent); color: var(--gold); font-weight: 800; padding: 0.3em 0.9em; border-radius: 99px; font-size: 1.1em; }
.photostep.pop { animation: popin 0.5s cubic-bezier(.2,1.6,.4,1); }
.photoslots { display: flex; gap: 12px; flex-wrap: wrap; min-height: 40px; align-items: center; }
.photoslots .slot { margin: 0; width: 180px; background: var(--bg2); border-radius: 12px; overflow: hidden; }
.photoslots img { width: 100%; height: 110px; object-fit: cover; display: block; }
.photoslots figcaption { padding: 4px 8px; font-size: 0.85rem; font-weight: 700; color: var(--gold); }
.slotacts { display: flex; gap: 4px; padding: 0 6px 6px; }
.slotacts button { flex: 1; border: 0; border-radius: 6px; background: var(--card2); padding: 4px; cursor: pointer; }
.slotacts button:disabled { opacity: 0.3; }
.thumbwrap { position: relative; display: block; }
.thumbwrap em { position: absolute; right: 4px; bottom: 4px; font-style: normal; font-size: 0.75rem; font-weight: 800; background: var(--gold); color: #2a1b00; border-radius: 6px; padding: 0 5px; }
.kind-choice.has-img .photostack { max-height: 50vh; }
.photostack { height: 100%; grid-template: minmax(0, 1fr) / minmax(0, 1fr); }
.photostack .photo { max-width: 100%; }

/* ---------- themes (ids match public/js/themes.js) ---------- */

[data-theme='christmas'] { --bg: #071a14; --bg2: #0d261d; --card: #12342a; --card2: #184235; --muted: #93b5a6; --gold: #ffd166; --gold2: #e9a53a; --logo: #ff4d5e; --glow1: rgba(230, 57, 70, 0.22); --glow2: rgba(46, 160, 90, 0.22); --shade: #9a5f12; }
[data-theme='newyear'] { --bg: #07070d; --bg2: #111018; --card: #1b1a26; --card2: #252335; --muted: #a9a3b8; --gold: #f3d27a; --gold2: #c9a24a; --logo: #f3d27a; --glow1: rgba(243, 210, 122, 0.18); --glow2: rgba(120, 90, 220, 0.2); --shade: #8a6a22; }
[data-theme='easter'] { --bg: #1a1030; --bg2: #241640; --card: #2f1f52; --card2: #3a2763; --muted: #b9a9d6; --gold: #ffe066; --gold2: #f2b531; --logo: #ffb3d1; --glow1: rgba(255, 224, 102, 0.18); --glow2: rgba(124, 212, 140, 0.2); --shade: #a8720c; }
[data-theme='midsummer'] { --bg: #0a1a2e; --bg2: #10253f; --card: #15304f; --card2: #1c3c61; --muted: #a2b8d0; --gold: #ffe45c; --gold2: #f2b705; --logo: #ffe45c; --glow1: rgba(255, 228, 92, 0.16); --glow2: rgba(90, 200, 120, 0.22); --shade: #a07400; }
[data-theme='halloween'] { --bg: #0d0812; --bg2: #170e1f; --card: #23142e; --card2: #2d1a3b; --muted: #a996b5; --gold: #ff9a1f; --gold2: #e0670b; --logo: #ff9a1f; --glow1: rgba(255, 140, 30, 0.2); --glow2: rgba(130, 60, 200, 0.24); --shade: #8a3c05; }
[data-theme='party'] { --bg: #12082a; --bg2: #1c0d3d; --card: #26124f; --card2: #311762; --muted: #b8a6dc; --gold: #ffd23f; --gold2: #f59e0b; --logo: #ff5fd2; --glow1: rgba(255, 79, 216, 0.24); --glow2: rgba(0, 200, 255, 0.2); --shade: #a8650c; }

.greet { font-size: 1.6em; font-weight: 800; color: var(--logo, var(--gold)); }
.themesel { flex: none; width: auto; max-width: 16em; background: var(--card); border: 0; border-radius: 12px; padding: 0.5em 0.8em; font-weight: 600; }

/* Decorations sit behind everything and never take clicks. */
#app { position: relative; z-index: 1; }
.fx { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; transition: opacity 1s; }
.fx.calm { opacity: 0.3; }
.fx i { position: absolute; top: 0; font-style: normal; line-height: 1; opacity: var(--o); will-change: transform;
  animation: var(--d) linear var(--delay) infinite; }
.fx-snow i { width: var(--s); height: var(--s); border-radius: 50%; background: #fff; filter: blur(1px); }
.fx-sparkle i { font-size: var(--s); color: var(--gold); text-shadow: 0 0 8px var(--gold); }
.fx-sparkle i:nth-child(3n) { color: #fff; }
.fx-emoji i { font-size: var(--s); }
.fx-confetti i { width: var(--s); height: calc(var(--s) * 0.45); border-radius: 2px; }
@keyframes fall {
  from { transform: translate(0, -8vh) rotate(0); }
  50% { transform: translate(var(--sway), 50vh) rotate(calc(var(--rot) / 2)); }
  to { transform: translate(0, 108vh) rotate(var(--rot)); }
}
@keyframes rise {
  from { transform: translate(0, 108vh) rotate(0); }
  50% { transform: translate(var(--sway), 50vh) rotate(calc(var(--rot) / 4)); }
  to { transform: translate(0, -8vh) rotate(calc(var(--rot) / 2)); }
}
