:root {
  --bg: #150e33;
  --bg-2: #24175a;
  --panel: rgba(255, 255, 255, 0.07);
  --panel-2: rgba(255, 255, 255, 0.12);
  --panel-solid: #251a57;
  --line: rgba(255, 255, 255, 0.16);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.7);
  --faint: rgba(255, 255, 255, 0.45);
  --gold: #ffc53d;
  --gold-ink: #2b1a00;
  --a0: #e5484d;
  --a1: #2f7cf6;
  --a2: #e09f00;
  --a3: #27a253;
  --ok: #27a253;
  --bad: #e5484d;
  --radius: 18px;
  --display: 'Fredoka', 'Nunito', 'Segoe UI', system-ui, sans-serif;
  --font: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1100px 760px at 12% -12%, #4a2aa6 0%, transparent 62%),
    radial-gradient(900px 700px at 112% 112%, #6d2287 0%, transparent 58%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold); }
[hidden] { display: none !important; }

/* Floating glow in the background */
.bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bg::before, .bg::after {
  content: ""; position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 197, 61, 0.13), transparent 62%);
  animation: drift 22s ease-in-out infinite alternate;
}
.bg::before { top: -22vmax; right: -12vmax; }
.bg::after {
  bottom: -26vmax; left: -16vmax; animation-duration: 29s;
  background: radial-gradient(circle, rgba(110, 150, 255, 0.13), transparent 62%);
}
@keyframes drift { to { transform: translate(-8vmax, 6vmax) scale(1.15); } }
@media (prefers-reduced-motion: reduce) {
  .bg::before, .bg::after { animation: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- Screens */
.screen { display: none; position: relative; z-index: 1; min-height: 100dvh; flex-direction: column; }
.screen.active { display: flex; animation: screenIn 0.35s ease both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Logo */
.logo { display: inline-flex; align-items: center; gap: 0.45em; font-family: var(--display); font-weight: 700; letter-spacing: 0.01em; text-decoration: none; color: var(--text); }
.logo svg { width: 1.6em; height: 1.6em; flex: none; }
.logo b { color: var(--gold); font-weight: 700; }

/* ---------- Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  font-family: var(--display); font-weight: 600; font-size: 1.05rem; line-height: 1.1;
  border: 0; border-radius: 14px; padding: 0.8em 1.4em; cursor: pointer;
  color: var(--text); background: var(--panel-2);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.28);
  text-decoration: none; transition: transform 0.08s ease, filter 0.15s ease, opacity 0.15s;
  user-select: none;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.28); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; transform: none; }
.btn:focus-visible, .icon-btn:focus-visible, .chip:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn.gold { background: var(--gold); color: var(--gold-ink); }
.btn.white { background: #fff; color: #24175a; }
.btn.danger { background: var(--bad); }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 2px var(--line); }
.btn.big { font-size: 1.35rem; padding: 0.85em 1.7em; border-radius: 16px; }
.btn.small { font-size: 0.9rem; padding: 0.55em 0.9em; border-radius: 10px; }
.btn.block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  border: 0; background: var(--panel); color: var(--text); cursor: pointer; font-size: 1.2rem;
}
.icon-btn:hover { background: var(--panel-2); }

/* ---------- Form controls */
.field { display: grid; gap: 6px; }
.field > span { font-size: 0.85rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.input, select.input, textarea.input {
  width: 100%; padding: 0.75em 0.9em; border-radius: 12px; border: 2px solid var(--line);
  background: rgba(0, 0, 0, 0.22); color: var(--text); outline: none; transition: border-color 0.15s;
}
.input:focus { border-color: var(--gold); }
.input::placeholder { color: var(--faint); }
select.input option { background: var(--panel-solid); }
.toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 8px 0; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle .knob { width: 46px; height: 28px; border-radius: 99px; background: rgba(255, 255, 255, 0.18); position: relative; flex: none; transition: background 0.2s; }
.toggle .knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.toggle input:checked + .knob { background: var(--ok); }
.toggle input:checked + .knob::after { transform: translateX(18px); }
.toggle input:focus-visible + .knob { outline: 3px solid var(--gold); outline-offset: 2px; }
.toggle small { display: block; color: var(--muted); font-size: 0.85rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 2px solid var(--line); background: transparent; color: var(--text);
  padding: 0.5em 0.9em; border-radius: 99px; cursor: pointer; font-weight: 700; font-size: 0.95rem;
}
.chip[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.chip small { opacity: 0.7; font-weight: 600; }
.err { color: #ff9a9d; font-weight: 700; min-height: 1.4em; margin: 8px 0 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; backdrop-filter: blur(8px); }

/* ---------- Answer shapes / colours (shared) */
.shape { width: 1em; height: 1em; flex: none; fill: currentColor; }
.c0 { --c: var(--a0); } .c1 { --c: var(--a1); } .c2 { --c: var(--a2); } .c3 { --c: var(--a3); }

/* ---------- Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); z-index: 50;
  background: #fff; color: #24175a; font-weight: 800; padding: 12px 20px; border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35); transition: transform 0.3s ease; max-width: calc(100% - 32px);
}
.toast.show { transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); color: #fff; }

#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40; }

/* =====================================================================
   LANDING
   ===================================================================== */
.landing { max-width: 1080px; margin: 0 auto; padding: 48px 20px 64px; position: relative; z-index: 1; }
.landing .hero { text-align: center; margin-bottom: 40px; }
.landing .hero .logo { font-size: clamp(2.6rem, 8vw, 4.6rem); }
.landing .hero p { color: var(--muted); font-size: 1.2rem; margin: 10px 0 0; }
.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.mode {
  display: flex; flex-direction: column; gap: 10px; padding: 26px 22px; border-radius: 22px; text-decoration: none; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); transition: transform 0.15s, background 0.15s; position: relative; overflow: hidden;
}
.mode:hover { transform: translateY(-4px); background: var(--panel-2); }
.mode .ico { font-size: 2.4rem; }
.mode h2 { font-family: var(--display); margin: 0; font-size: 1.5rem; }
.mode p { margin: 0; color: var(--muted); line-height: 1.45; }
.mode .go { margin-top: auto; padding-top: 8px; color: var(--gold); font-weight: 800; }
.mode.feature { background: linear-gradient(135deg, #ffc53d, #ff9f1c); color: var(--gold-ink); border: 0; }
.mode.feature p, .mode.feature .go { color: rgba(43, 26, 0, 0.8); }
.quick-join { display: flex; gap: 10px; margin-top: 6px; }
.quick-join .input { font-size: 1.2rem; font-weight: 800; letter-spacing: 0.12em; text-align: center; }
.how { margin-top: 44px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.how div { color: var(--muted); line-height: 1.5; }
.how b { color: var(--text); display: block; font-family: var(--display); font-size: 1.1rem; margin-bottom: 4px; }

/* =====================================================================
   HOST (big screen)
   ===================================================================== */
body.host { overflow: hidden; }
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 14px 22px; pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.topbar .logo { font-size: 1.35rem; }
.topbar .spacer { flex: 1; }
.pin-chip { background: #fff; color: #24175a; font-weight: 800; border-radius: 12px; padding: 8px 14px; font-size: 1.05rem; }
.pin-chip span { font-family: var(--display); font-size: 1.25rem; letter-spacing: 0.06em; }

/* Setup */
.setup { width: min(980px, calc(100% - 32px)); margin: 90px auto 40px; overflow-y: auto; max-height: calc(100dvh - 120px); padding-right: 4px; }
body.host .setup { overflow-y: auto; }
.setup h1 { font-family: var(--display); font-size: 2.4rem; margin: 0 0 18px; }
.tabs { display: inline-flex; background: rgba(0, 0, 0, 0.25); border-radius: 14px; padding: 5px; gap: 4px; margin-bottom: 18px; }
.tabs button { border: 0; background: transparent; color: var(--muted); font-weight: 800; padding: 10px 18px; border-radius: 10px; cursor: pointer; font-size: 1rem; }
.tabs button[aria-selected="true"] { background: #fff; color: #24175a; }
.quiz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.quiz-card {
  text-align: left; border: 2px solid var(--line); background: var(--panel); border-radius: 16px; padding: 16px; cursor: pointer;
  display: grid; gap: 6px; transition: border-color 0.15s, transform 0.15s; color: var(--text);
}
.quiz-card:hover { transform: translateY(-2px); }
.quiz-card[aria-pressed="true"] { border-color: var(--gold); background: rgba(255, 197, 61, 0.12); }
.quiz-card b { font-family: var(--display); font-size: 1.2rem; font-weight: 600; }
.quiz-card span { color: var(--muted); font-size: 0.92rem; }
.quiz-card .count { color: var(--gold); font-weight: 800; }
.empty { color: var(--muted); padding: 24px; text-align: center; border: 2px dashed var(--line); border-radius: 16px; }
.setup-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.setup-actions { display: flex; align-items: center; gap: 16px; margin-top: 22px; flex-wrap: wrap; }
.seg { display: inline-flex; background: rgba(0, 0, 0, 0.25); border-radius: 12px; padding: 4px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; color: var(--muted); font-weight: 800; padding: 8px 14px; border-radius: 9px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); }
.range-row { display: flex; align-items: center; gap: 14px; }
.range-row input { flex: 1; accent-color: var(--gold); }
.range-row output { font-family: var(--display); font-size: 1.6rem; min-width: 2ch; text-align: right; }

/* Lobby */
.lobby { flex: 1; display: flex; flex-direction: column; padding: 78px 3vw 24px; gap: 2.2vh; }
.join-panel { display: flex; align-items: stretch; gap: 2vw; justify-content: center; }
.join-box {
  background: #fff; color: #24175a; border-radius: 22px; padding: 2.2vh 3vw; display: flex; flex-direction: column; justify-content: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}
.join-box .step { font-size: clamp(1rem, 1.6vw, 1.6rem); font-weight: 700; }
.join-box .step b { font-family: var(--display); color: #6a3df0; }
.join-box .pin-label { margin-top: 1.2vh; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; font-size: clamp(0.8rem, 1vw, 1.1rem); color: #7a6fa8; }
.pin { font-family: var(--display); font-weight: 700; font-size: clamp(3.2rem, 8vw, 8rem); line-height: 1; letter-spacing: 0.04em; }
.qr-box { background: #fff; border-radius: 22px; padding: 1.2vh; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35); display: grid; place-items: center; }
.qr-box img { display: block; width: clamp(140px, 22vh, 300px); height: auto; image-rendering: pixelated; }
.qr-box small { color: #7a6fa8; font-weight: 800; font-size: 0.85rem; padding-bottom: 4px; }
.lobby-bar { display: flex; align-items: center; gap: 16px; }
.lobby-bar .count { background: var(--panel-2); border-radius: 14px; padding: 10px 18px; font-weight: 800; font-size: 1.3rem; display: flex; align-items: center; gap: 10px; }
.lobby-bar .count span { font-family: var(--display); font-size: 2rem; }
.lobby-bar h2 { flex: 1; text-align: center; font-family: var(--display); font-weight: 600; margin: 0; font-size: clamp(1.3rem, 2.2vw, 2.2rem); }
.player-cloud { flex: 1; display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: center; gap: 12px; overflow-y: auto; padding: 8px; }
.bubble {
  border: 0; cursor: pointer; background: #fff; color: #24175a; font-weight: 800; font-size: clamp(1rem, 1.6vw, 1.6rem);
  padding: 0.45em 0.9em; border-radius: 99px; display: inline-flex; align-items: center; gap: 0.4em; animation: pop 0.45s cubic-bezier(.2, 1.6, .4, 1) both;
}
.bubble:hover { background: #ffd7d8; text-decoration: line-through; }
.bubble.away { opacity: 0.45; }
@keyframes pop { from { transform: scale(0.2); opacity: 0; } }
.lobby .waiting { text-align: center; color: var(--muted); font-size: 1.4rem; margin: auto; }
.lobby .waiting .dots::after { content: ""; animation: dots 1.4s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

/* Intro */
.intro { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 80px 6vw 40px; gap: 3vh; }
.intro .qnum { font-family: var(--display); font-size: clamp(1.3rem, 2.4vw, 2.4rem); color: var(--gold); font-weight: 600; }
.intro .qbig { font-family: var(--display); font-weight: 600; font-size: clamp(2rem, 4.6vw, 4.8rem); line-height: 1.15; max-width: 22ch; animation: rise 0.6s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes rise { from { transform: translateY(30px) scale(0.95); opacity: 0; } }
.intro .bar { width: min(640px, 70vw); height: 12px; border-radius: 99px; background: rgba(255, 255, 255, 0.15); overflow: hidden; }
.intro .bar i { display: block; height: 100%; width: 100%; background: var(--gold); transform-origin: left; }
.badge { display: inline-flex; align-items: center; gap: 6px; background: var(--gold); color: var(--gold-ink); font-weight: 800; border-radius: 99px; padding: 6px 14px; font-size: clamp(0.9rem, 1.3vw, 1.3rem); }
.badge.none { background: rgba(255, 255, 255, 0.2); color: #fff; }

/* Question + reveal */
.play { flex: 1; display: grid; grid-template-rows: auto 1fr auto; gap: 2.2vh; padding: 76px 2.4vw 2.4vw; min-height: 100dvh; }
.q-head { background: #fff; color: #1b1240; border-radius: 20px; padding: 2.2vh 3vw; text-align: center; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3); position: relative; }
.q-head .q-text { font-family: var(--display); font-weight: 600; font-size: clamp(1.5rem, 3.3vw, 3.4rem); line-height: 1.2; }
.q-head .q-meta { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: #6a3df0; color: #fff; font-weight: 800; border-radius: 99px; padding: 4px 14px; font-size: clamp(0.8rem, 1.1vw, 1.1rem); white-space: nowrap; }
.q-mid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 2vw; min-height: 0; }
.timer { position: relative; width: clamp(110px, 17vh, 210px); aspect-ratio: 1; justify-self: start; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 10; }
.timer .track { stroke: rgba(255, 255, 255, 0.14); }
.timer .ring { stroke: var(--gold); stroke-linecap: round; transition: stroke 0.3s; }
.timer.low .ring { stroke: var(--bad); }
.timer .num { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: clamp(2.4rem, 6vh, 4.6rem); }
.timer.low .num { animation: throb 1s ease infinite; }
@keyframes throb { 50% { transform: scale(1.12); } }
.center-slot { display: grid; place-items: center; gap: 10px; text-align: center; }
.center-slot .hint { color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.5rem); }
.answered-box { justify-self: end; text-align: center; background: var(--panel); border-radius: 20px; padding: 1.4vh 2vw; min-width: 9vw; }
.answered-box b { display: block; font-family: var(--display); font-size: clamp(2.4rem, 6vh, 4.6rem); line-height: 1; }
.answered-box span { color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; font-size: clamp(0.75rem, 1vw, 1rem); }

.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4vh 1vw; }
.answer {
  display: flex; align-items: center; gap: 1.2vw; background: var(--c); border-radius: 16px; padding: 2.4vh 1.6vw; min-height: 11vh;
  font-weight: 800; font-size: clamp(1.15rem, 2.3vw, 2.4rem); line-height: 1.15; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.22);
  transition: opacity 0.4s, transform 0.4s, filter 0.4s; position: relative; animation: rise 0.45s cubic-bezier(.2, 1.3, .4, 1) both;
}
.answer:nth-child(2) { animation-delay: 0.06s; } .answer:nth-child(3) { animation-delay: 0.12s; } .answer:nth-child(4) { animation-delay: 0.18s; }
.answer .shape { font-size: clamp(1.8rem, 3.6vw, 3.6rem); }
.answer .mark { margin-left: auto; font-size: 1.3em; }
.play.revealed .answer.wrong { opacity: 0.28; filter: saturate(0.4); transform: scale(0.98); }
.play.revealed .answer.right { transform: scale(1.02); box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.22), 0 0 0 5px #fff; }

.chart { display: flex; align-items: flex-end; justify-content: center; gap: 1.6vw; height: 100%; min-height: 18vh; max-height: 32vh; }
.chart .col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; width: clamp(60px, 8vw, 130px); height: 100%; }
.chart .bar { width: 100%; background: var(--c); border-radius: 10px 10px 4px 4px; min-height: 8px; transform-origin: bottom; animation: grow 0.8s cubic-bezier(.2, 1.1, .4, 1) both; box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.2); }
.chart .col.wrong .bar { opacity: 0.35; }
.chart .val { font-family: var(--display); font-weight: 700; font-size: clamp(1.4rem, 2.6vw, 2.6rem); display: flex; align-items: center; gap: 6px; }
.chart .lbl { color: var(--c); background: #fff; border-radius: 8px; padding: 4px 10px; display: grid; place-items: center; font-size: clamp(1.1rem, 2vw, 2rem); }
@keyframes grow { from { transform: scaleY(0); } }
.reveal-info { display: grid; gap: 10px; justify-items: center; text-align: center; }
.ref-chip { background: #fff; color: #24175a; font-weight: 800; border-radius: 99px; padding: 8px 18px; font-size: clamp(1rem, 1.6vw, 1.6rem); }
.note { color: var(--muted); font-size: clamp(0.95rem, 1.4vw, 1.4rem); max-width: 40ch; }
.stat-line { font-weight: 800; font-size: clamp(1rem, 1.5vw, 1.5rem); }
.host-next { position: fixed; right: 22px; top: 70px; z-index: 25; }

/* Leaderboard */
.board { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 90px 4vw 40px; gap: 2.6vh; }
.board h1 { font-family: var(--display); font-size: clamp(2rem, 4vw, 4rem); margin: 0; background: #fff; color: #24175a; padding: 0.15em 0.9em; border-radius: 16px; }
.board ol { list-style: none; margin: 0; padding: 0; width: min(1100px, 92vw); display: grid; gap: 1.4vh; }
.board li {
  display: flex; align-items: center; gap: 1.6vw; background: var(--panel-2); border-radius: 16px; padding: 1.6vh 2vw;
  font-weight: 800; font-size: clamp(1.2rem, 2.4vw, 2.6rem); animation: slideIn 0.5s cubic-bezier(.2, 1.2, .4, 1) both;
}
.board li:first-child { background: #fff; color: #24175a; }
.board li .rk { font-family: var(--display); width: 2ch; text-align: center; opacity: 0.8; }
.board li .av { font-size: 1.2em; }
.board li .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board li .mv { font-size: 0.6em; padding: 2px 8px; border-radius: 8px; }
.board li .mv.up { background: var(--ok); color: #fff; }
.board li .mv.down { background: rgba(229, 72, 77, 0.85); color: #fff; }
.board li .fire { font-size: 0.65em; }
.board li .sc { font-family: var(--display); font-variant-numeric: tabular-nums; }
@keyframes slideIn { from { transform: translateX(-40px); opacity: 0; } }

/* Podium */
.podium-screen { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 80px 3vw 24px; gap: 2vh; overflow-y: auto; }
.podium-screen h1 { font-family: var(--display); font-size: clamp(2rem, 4vw, 4rem); margin: 0; text-align: center; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 1.6vw; height: 52vh; width: min(1000px, 94vw); }
.podium .place { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; opacity: 0; transform: translateY(40px); transition: opacity 0.6s, transform 0.6s cubic-bezier(.2, 1.3, .4, 1); }
.podium .place.show { opacity: 1; transform: none; }
.podium .who { text-align: center; margin-bottom: 1.4vh; }
.podium .who .av { font-size: clamp(2.6rem, 6vh, 5rem); display: block; }
.podium .who .nm { font-family: var(--display); font-weight: 700; font-size: clamp(1.3rem, 2.6vw, 2.8rem); display: block; max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .who .sc { color: var(--muted); font-weight: 800; font-size: clamp(1rem, 1.5vw, 1.5rem); }
.podium .block { width: 100%; border-radius: 16px 16px 0 0; display: grid; place-items: start center; padding-top: 2vh; font-family: var(--display); font-weight: 700; font-size: clamp(3rem, 7vh, 6rem); box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.18); }
.podium .p1 .block { height: 62%; background: linear-gradient(#ffd666, #f5a800); color: var(--gold-ink); }
.podium .p2 .block { height: 44%; background: linear-gradient(#e9eef5, #aeb8c6); color: #2c3440; }
.podium .p3 .block { height: 30%; background: linear-gradient(#f1b47a, #c27a3c); color: #3c1f06; }
.podium-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.standings { width: min(800px, 94vw); background: var(--panel); border-radius: 16px; padding: 10px 16px; max-height: 26vh; overflow-y: auto; }
.standings table { width: 100%; border-collapse: collapse; }
.standings td { padding: 7px 6px; border-bottom: 1px solid var(--line); font-weight: 700; }
.standings td:first-child { width: 3ch; color: var(--muted); }
.standings td:last-child, .standings td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* =====================================================================
   PLAYER (phone)
   ===================================================================== */
body.player { overflow-x: hidden; }
.p-top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px; background: rgba(0, 0, 0, 0.25); backdrop-filter: blur(10px); font-weight: 800;
}
.p-top .me { display: flex; align-items: center; gap: 8px; min-width: 0; }
.p-top .me span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-top .score { background: #fff; color: #24175a; border-radius: 10px; padding: 4px 12px; font-family: var(--display); font-variant-numeric: tabular-nums; }
.p-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; gap: 18px; text-align: center; width: 100%; max-width: 520px; margin: 0 auto; }
.p-wrap h1 { font-family: var(--display); margin: 0; font-size: 2rem; }
.p-wrap p { margin: 0; color: var(--muted); font-size: 1.1rem; line-height: 1.4; }
.join-card { width: 100%; background: #fff; color: #24175a; border-radius: 20px; padding: 20px; display: grid; gap: 12px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35); }
.join-card .input { background: #f3f0ff; border-color: #dcd3ff; color: #24175a; font-weight: 800; font-size: 1.3rem; text-align: center; }
.join-card .input:focus { border-color: #6a3df0; }
.join-card .input::placeholder { color: #9a90c4; }
.join-card .err { color: #d0262c; margin: 0; }
.join-card .game-name { font-weight: 800; color: #6a3df0; }
.avatars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.avatars button { font-size: 1.7rem; aspect-ratio: 1; border-radius: 12px; border: 3px solid transparent; background: #f3f0ff; cursor: pointer; padding: 0; }
.avatars button[aria-pressed="true"] { border-color: #6a3df0; background: #e5dcff; transform: scale(1.06); }
.big-av { font-size: 4.5rem; line-height: 1; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 5px solid rgba(255, 255, 255, 0.2); border-top-color: var(--gold); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.p-question { flex: 1; display: flex; flex-direction: column; padding: 12px; gap: 12px; }
.p-qtext { background: #fff; color: #1b1240; border-radius: 14px; padding: 12px 14px; font-weight: 800; font-size: 1.1rem; text-align: center; line-height: 1.3; }
.p-timer { height: 8px; background: rgba(255, 255, 255, 0.15); border-radius: 99px; overflow: hidden; }
.p-timer i { display: block; height: 100%; width: 100%; background: var(--gold); transform-origin: left; }
.answer-grid { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; min-height: 260px; }
.answer-grid.n2 { grid-template-columns: 1fr; }
.answer-grid.n3 > :last-child { grid-column: span 2; }
.ans {
  border: 0; border-radius: 16px; background: var(--c); color: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; font-weight: 800; font-size: 1.15rem; line-height: 1.2; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.22); touch-action: manipulation;
  animation: rise 0.35s cubic-bezier(.2, 1.3, .4, 1) both;
}
.ans .shape { font-size: 3rem; }
.ans:active { transform: scale(0.96); }
.answer-grid.has-text .ans .shape { font-size: 1.8rem; }
.p-intro .qbig { font-family: var(--display); font-size: 1.6rem; font-weight: 600; line-height: 1.25; }
.locked-shape { width: 120px; height: 120px; border-radius: 26px; display: grid; place-items: center; background: var(--c); box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.22); }
.locked-shape .shape { font-size: 4rem; }

.result { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px 16px; text-align: center; }
.result.ok { background: radial-gradient(circle at 50% 35%, #36c46a, #1b7f40); }
.result.bad { background: radial-gradient(circle at 50% 35%, #ef5a5f, #a8232a); }
.result.none { background: radial-gradient(circle at 50% 35%, #5b4b9a, #2b2063); }
.result .icon { font-size: 4.4rem; width: 110px; height: 110px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); display: grid; place-items: center; animation: pop 0.5s cubic-bezier(.2, 1.6, .4, 1) both; }
.result h1 { font-family: var(--display); font-size: 2.6rem; margin: 0; }
.result .pts { font-family: var(--display); font-size: 1.8rem; background: rgba(0, 0, 0, 0.22); border-radius: 12px; padding: 6px 18px; }
.result .streak { font-weight: 800; font-size: 1.1rem; }
.result .rankline { font-weight: 800; font-size: 1.15rem; background: rgba(0, 0, 0, 0.2); border-radius: 12px; padding: 10px 16px; }
.result .correct-was { font-weight: 700; opacity: 0.9; }
.final-rank { font-family: var(--display); font-size: 5rem; line-height: 1; }

.banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--gold); color: var(--gold-ink); font-weight: 800; text-align: center; padding: 10px 14px; }

/* =====================================================================
   ADMIN
   ===================================================================== */
.admin { display: grid; grid-template-columns: 290px 1fr; min-height: 100dvh; position: relative; z-index: 1; }
.admin aside { border-right: 1px solid var(--line); padding: 20px 16px; display: flex; flex-direction: column; gap: 14px; background: rgba(0, 0, 0, 0.18); position: sticky; top: 0; height: 100dvh; overflow-y: auto; }
.admin aside .logo { font-size: 1.3rem; }
.qlist { display: grid; gap: 8px; }
.qlist button { text-align: left; border: 2px solid transparent; background: var(--panel); border-radius: 12px; padding: 10px 12px; cursor: pointer; display: grid; gap: 2px; color: var(--text); }
.qlist button[aria-current="true"] { border-color: var(--gold); }
.qlist b { font-weight: 800; }
.qlist small { color: var(--muted); }
.admin main { padding: 24px clamp(16px, 3vw, 40px) 120px; max-width: 1000px; width: 100%; }
.editor-head { display: grid; gap: 12px; margin-bottom: 18px; }
.editor-head .title-input { font-family: var(--display); font-size: 1.9rem; font-weight: 600; border: 0; border-bottom: 2px solid var(--line); border-radius: 0; background: transparent; padding: 6px 2px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar .spacer { flex: 1; }
.qcard { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 14px; display: grid; gap: 12px; }
.qcard-head { display: flex; gap: 10px; align-items: flex-start; }
.qnum { flex: none; width: 34px; height: 34px; border-radius: 10px; background: #fff; color: #24175a; display: grid; place-items: center; font-weight: 800; margin-top: 4px; }
.qcard-head textarea { flex: 1; resize: vertical; min-height: 48px; font-weight: 700; font-size: 1.05rem; }
.qtools { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.qtools button { width: 36px; height: 36px; border-radius: 9px; border: 0; background: rgba(255, 255, 255, 0.08); color: var(--text); cursor: pointer; font-size: 1rem; }
.qtools button:hover { background: rgba(255, 255, 255, 0.18); }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt { display: flex; align-items: center; gap: 8px; background: var(--c); border-radius: 12px; padding: 6px 10px 6px 12px; }
.opt .shape { font-size: 1.3rem; }
.opt input[type="text"] { flex: 1; min-width: 0; border: 0; background: rgba(0, 0, 0, 0.18); border-radius: 8px; padding: 8px 10px; color: #fff; font-weight: 700; outline: none; }
.opt input[type="text"]::placeholder { color: rgba(255, 255, 255, 0.65); }
.opt input[type="text"]:focus { background: rgba(0, 0, 0, 0.3); }
.opt label { display: flex; align-items: center; gap: 4px; font-size: 0.8rem; font-weight: 800; cursor: pointer; white-space: nowrap; }
.opt input[type="radio"] { width: 20px; height: 20px; accent-color: #fff; cursor: pointer; }
.opt.is-correct { box-shadow: 0 0 0 3px #fff; }
.qmeta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.qmeta .field > span { font-size: 0.72rem; }
.qmeta .input { padding: 0.55em 0.7em; }
.qcard .tag { font-size: 0.75rem; font-weight: 800; color: var(--gold); }
.add-row { display: flex; gap: 10px; flex-wrap: wrap; }
.add-row .btn { flex: 1; min-width: 200px; }
.savebar { position: fixed; right: 20px; bottom: 20px; z-index: 30; display: flex; gap: 10px; align-items: center; }
.savebar .dirty { background: var(--panel-solid); border-radius: 10px; padding: 8px 12px; font-weight: 800; color: var(--gold); }
.mobile-quiz-select { display: none; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(8, 4, 24, 0.7); display: grid; place-items: center; padding: 16px; }
.modal-box { background: var(--panel-solid); border: 1px solid var(--line); border-radius: 20px; width: min(860px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; overflow: hidden; }
.modal-box header { padding: 16px 18px; border-bottom: 1px solid var(--line); display: grid; gap: 12px; }
.modal-box header h2 { margin: 0; font-family: var(--display); }
.modal-box .filters { display: grid; grid-template-columns: 2fr 1.4fr 1fr; gap: 8px; }
.modal-box .list { overflow-y: auto; padding: 8px 18px; flex: 1; }
.modal-box footer { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.modal-box footer .spacer { flex: 1; }
.bank-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.bank-item input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--gold); flex: none; }
.bank-item .t { font-weight: 700; }
.bank-item .s { color: var(--muted); font-size: 0.88rem; margin-top: 2px; }
.bank-item .s b { color: #7ee2a0; }
.bank-item.added { opacity: 0.5; }
.pill { display: inline-block; font-size: 0.72rem; font-weight: 800; padding: 1px 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); margin-left: 6px; vertical-align: 1px; }
.pill.easy { background: rgba(39, 162, 83, 0.35); } .pill.medium { background: rgba(224, 159, 0, 0.35); } .pill.hard { background: rgba(229, 72, 77, 0.4); }

/* =====================================================================
   SOLO
   ===================================================================== */
.solo { width: min(820px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 48px; position: relative; z-index: 1; display: flex; flex-direction: column; gap: 18px; min-height: 100dvh; }
.solo-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.solo-top .logo { font-size: 1.25rem; }
.solo-hud { display: flex; gap: 10px; align-items: center; font-weight: 800; }
.solo-hud span { background: var(--panel-2); border-radius: 10px; padding: 6px 12px; }
.solo .q-head { margin-top: 10px; }
.solo .q-head .q-text { font-size: clamp(1.3rem, 4.5vw, 2rem); }
.solo .answers { gap: 10px; }
.solo .answer { min-height: 76px; font-size: clamp(1rem, 3.6vw, 1.3rem); padding: 14px; cursor: pointer; border: 0; color: #fff; text-align: left; font-family: inherit; }
.solo .answer .shape { font-size: 1.8rem; }
.solo .answer:disabled { cursor: default; }
.solo .answer.wrong { opacity: 0.3; }
.solo .answer.right { box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.22), 0 0 0 4px #fff; }
.solo .answer.picked.wrong { opacity: 0.75; box-shadow: 0 0 0 4px #000 inset; }
.solo-feedback { text-align: center; display: grid; gap: 8px; justify-items: center; min-height: 92px; }
.solo-feedback .verdict { font-family: var(--display); font-size: 1.8rem; font-weight: 700; }
.review { display: grid; gap: 10px; }
.review div { background: var(--panel); border-radius: 12px; padding: 12px 14px; }
.review b { display: block; }
.review small { color: var(--muted); }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 900px) {
  .setup-row { grid-template-columns: 1fr; }
  .admin { grid-template-columns: 1fr; }
  .admin aside { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin aside .qlist { display: none; }
  .mobile-quiz-select { display: block; }
  .qmeta { grid-template-columns: 1fr 1fr; }
  .join-panel { flex-direction: column; align-items: center; }
}
@media (max-width: 560px) {
  .opts { grid-template-columns: 1fr; }
  .modal-box .filters { grid-template-columns: 1fr; }
  .solo .answers { grid-template-columns: 1fr; }
  .qcard-head { flex-wrap: wrap; }
  .qcard-head textarea { flex-basis: calc(100% - 44px); }
  .qtools { width: 100%; }
  .savebar { left: 16px; right: 16px; justify-content: flex-end; }
}

/* =====================================================================
   ARCADE (hub, shared game shell, results, stats)
   ===================================================================== */
.arcade-bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 10px clamp(12px, 3vw, 28px); background: rgba(16, 10, 40, 0.72); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.arcade-bar .logo { font-size: 1.25rem; }
.arcade-bar .bar-title { font-family: var(--display); font-weight: 600; color: var(--muted); font-size: 1.05rem; padding-left: 14px; border-left: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arcade-bar .spacer { flex: 1; }
.lvl-chip { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-decoration: none; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 6px 12px 6px 8px; }
.lvl-chip:hover { background: var(--panel-2); }
.lvl-av { grid-row: span 2; font-size: 1.6rem; line-height: 1; }
.lvl-text { display: flex; flex-direction: column; line-height: 1.1; }
.lvl-text b { font-size: 0.92rem; max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lvl-text small { color: var(--gold); font-weight: 800; font-size: 0.72rem; }
.lvl-bar { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.15); overflow: hidden; margin-top: 4px; }
.lvl-bar i { display: block; height: 100%; background: var(--gold); }
@media (max-width: 520px) { .arcade-bar .bar-title { display: none; } .lvl-text b { max-width: 8ch; } }

.hub { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 26px 0 70px; position: relative; z-index: 1; }
.hub-hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; margin-bottom: 26px; }
.hub-hero .welcome { padding: 26px; border-radius: 24px; background: linear-gradient(135deg, rgba(255, 197, 61, 0.18), rgba(110, 60, 240, 0.25)); border: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.hub-hero h1 { font-family: var(--display); font-size: clamp(1.8rem, 4vw, 2.8rem); margin: 0; line-height: 1.1; }
.hub-hero p { margin: 0; color: var(--muted); font-size: 1.08rem; }
.hub-hero .me-card { padding: 20px; border-radius: 24px; background: var(--panel); border: 1px solid var(--line); display: grid; gap: 12px; align-content: center; }
.me-row { display: flex; align-items: center; gap: 12px; }
.me-row .big { font-size: 2.6rem; line-height: 1; }
.me-row b { font-family: var(--display); font-size: 1.3rem; display: block; }
.me-row small { color: var(--gold); font-weight: 800; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini-stats div { background: rgba(0, 0, 0, 0.2); border-radius: 12px; padding: 8px; text-align: center; }
.mini-stats b { display: block; font-family: var(--display); font-size: 1.3rem; }
.mini-stats small { color: var(--muted); font-weight: 700; font-size: 0.75rem; }
.name-form { display: grid; gap: 10px; }
.name-form .row { display: flex; gap: 8px; }
.avatar-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.avatar-pick button { font-size: 1.4rem; width: 42px; height: 42px; border-radius: 10px; border: 2px solid transparent; background: rgba(255, 255, 255, 0.08); cursor: pointer; padding: 0; }
.avatar-pick button[aria-pressed="true"] { border-color: var(--gold); background: rgba(255, 197, 61, 0.18); }
.section-head { display: flex; align-items: center; gap: 12px; margin: 8px 0 14px; flex-wrap: wrap; }
.section-head h2 { font-family: var(--display); margin: 0; font-size: 1.6rem; }
.section-head .spacer { flex: 1; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 20px; min-height: 230px; border-radius: 24px; color: #fff; text-decoration: none; overflow: hidden;
  background: linear-gradient(140deg, var(--from), var(--to)); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), inset 0 -6px 0 rgba(0, 0, 0, 0.18);
  transition: transform 0.18s cubic-bezier(.2, 1.4, .4, 1), box-shadow 0.18s;
}
.tile::after { content: ""; position: absolute; width: 180px; height: 180px; right: -50px; top: -60px; border-radius: 50%; background: rgba(255, 255, 255, 0.13); }
.tile:hover { transform: translateY(-6px) rotate(-0.6deg); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4), inset 0 -6px 0 rgba(0, 0, 0, 0.18); }
.tile:hover .tile-emoji { transform: scale(1.15) rotate(-8deg); }
.tile-emoji { font-size: 3.4rem; line-height: 1; transition: transform 0.25s cubic-bezier(.2, 1.6, .4, 1); filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.25)); position: relative; z-index: 1; }
.tile h3 { font-family: var(--display); font-size: 1.55rem; margin: 6px 0 0; line-height: 1.1; position: relative; z-index: 1; }
.tile p { margin: 0; font-weight: 600; opacity: 0.92; line-height: 1.35; position: relative; z-index: 1; }
.tile .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; position: relative; z-index: 1; }
.tile .tags span { background: rgba(0, 0, 0, 0.22); border-radius: 99px; padding: 3px 10px; font-size: 0.78rem; font-weight: 800; }
.tile .best { position: absolute; top: 16px; right: 16px; z-index: 2; background: rgba(0, 0, 0, 0.28); border-radius: 10px; padding: 4px 10px; font-weight: 800; font-size: 0.8rem; }
.tile .best.new { background: #fff; color: #24175a; }
.tile.hidden { display: none; }
.leader-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 30px; }
.leader-row .card { display: grid; gap: 10px; }
.leader-row h3 { margin: 0; font-family: var(--display); }
.leader-row p { margin: 0; color: var(--muted); }
@media (max-width: 760px) { .hub-hero { grid-template-columns: 1fr; } }

/* Shared game shell */
.game { width: min(820px, calc(100% - 32px)); margin: 0 auto; padding: 22px 0 60px; position: relative; z-index: 1; display: flex; flex-direction: column; gap: 16px; }
.game .screen { min-height: auto; gap: 16px; }
.hud { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hud span { background: var(--panel-2); border-radius: 10px; padding: 6px 12px; font-weight: 800; }
.hud .spacer { flex: 1; background: none; padding: 0; }
.intro-card { display: grid; gap: 16px; }
.intro-card h1 { font-family: var(--display); margin: 0; font-size: clamp(1.8rem, 5vw, 2.4rem); }
.intro-card p { margin: 0; color: var(--muted); font-size: 1.05rem; line-height: 1.5; }
.intro-card ul { margin: 0; padding-left: 20px; color: var(--muted); line-height: 1.6; }
.prompt { background: #fff; color: #1b1240; border-radius: 20px; padding: 22px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3); }
.prompt .label { font-weight: 800; color: #6a3df0; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; }
.prompt .text { font-family: var(--display); font-weight: 600; font-size: clamp(1.25rem, 4vw, 1.75rem); line-height: 1.25; margin-top: 6px; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice {
  display: flex; align-items: center; gap: 12px; text-align: left; border: 2px solid var(--line); background: var(--panel); color: var(--text);
  border-radius: 16px; padding: 14px 16px; font-weight: 800; font-size: 1.05rem; cursor: pointer; transition: transform 0.1s, background 0.15s, border-color 0.15s, opacity 0.2s;
}
.choice:hover:not(:disabled) { background: var(--panel-2); border-color: rgba(255, 255, 255, 0.35); transform: translateY(-2px); }
.choice .letter { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.14); font-family: var(--display); }
.choice:disabled { cursor: default; }
.choice.right { background: rgba(39, 162, 83, 0.35); border-color: #3ddc84; }
.choice.right .letter { background: #27a253; }
.choice.wrong { background: rgba(229, 72, 77, 0.3); border-color: #ff6b70; }
.choice.wrong .letter { background: var(--bad); }
.choice.out { opacity: 0.35; text-decoration: line-through; }
.choice.mine { box-shadow: 0 0 0 3px var(--gold); }
@media (max-width: 560px) { .choices { grid-template-columns: 1fr; } }
.timebar { height: 8px; background: rgba(255, 255, 255, 0.15); border-radius: 99px; overflow: hidden; }
.timebar i { display: block; height: 100%; width: 100%; background: var(--gold); transform-origin: left; }
.feedback { display: grid; gap: 10px; justify-items: center; text-align: center; }
.feedback .verdict { font-family: var(--display); font-size: 1.7rem; font-weight: 700; }
.feedback .verdict.ok { color: #7ee2a0; } .feedback .verdict.bad { color: #ff9a9d; }
.shake { animation: shake 0.35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* Results */
.results { text-align: center; display: grid; gap: 10px; justify-items: center; }
.results-icon { font-size: 3.6rem; animation: pop 0.5s cubic-bezier(.2, 1.6, .4, 1) both; }
.results h1 { font-family: var(--display); margin: 0; font-size: 2.1rem; }
.results p { margin: 0; font-size: 1.12rem; }
.xp-gain { font-family: var(--display); font-size: 1.4rem; color: var(--gold); margin-top: 6px; }
.level-up { background: var(--gold); color: var(--gold-ink); border-radius: 12px; padding: 8px 14px; font-weight: 800; }
.xp-track { width: min(380px, 100%); height: 12px; border-radius: 99px; background: rgba(255, 255, 255, 0.15); overflow: hidden; }
.xp-track i { display: block; height: 100%; background: linear-gradient(90deg, #ffc53d, #ff8a3d); border-radius: 99px; transition: width 1.2s cubic-bezier(.2, .9, .3, 1); }
.xp-caption { color: var(--muted); font-weight: 700; }
.new-badges { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.badge-pop { background: rgba(255, 197, 61, 0.15); border: 2px solid var(--gold); border-radius: 16px; padding: 10px 14px; display: grid; justify-items: center; gap: 2px; max-width: 200px; animation: pop 0.6s cubic-bezier(.2, 1.6, .4, 1) both; }
.badge-pop span { font-size: 2rem; }
.badge-pop small { color: var(--muted); }
.results-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.review > div { background: var(--panel); border-radius: 12px; padding: 12px 14px; }

/* Guess the Prophet */
.clues { display: grid; gap: 10px; }
.clue { display: flex; gap: 12px; align-items: flex-start; background: #fff; color: #1b1240; border-radius: 16px; padding: 14px 16px; font-weight: 700; font-size: 1.08rem; line-height: 1.4; animation: rise 0.4s cubic-bezier(.2, 1.3, .4, 1) both; }
.clue .n { flex: none; width: 30px; height: 30px; border-radius: 50%; background: #6a3df0; color: #fff; display: grid; place-items: center; font-family: var(--display); }
.clue.locked { background: rgba(255, 255, 255, 0.07); color: var(--faint); border: 2px dashed var(--line); animation: none; }
.clue.locked .n { background: rgba(255, 255, 255, 0.12); color: var(--muted); }
.worth { font-family: var(--display); font-size: 1.1rem; }
.reveal-card { display: flex; gap: 16px; align-items: center; background: linear-gradient(135deg, #6d3cf0, #c04cff); border-radius: 20px; padding: 18px; }
.reveal-card .big { font-size: 3rem; }
.reveal-card h2 { margin: 0; font-family: var(--display); }
.reveal-card p { margin: 4px 0 0; opacity: 0.92; }

/* Riddles */
.answer-input { display: flex; gap: 10px; }
.answer-input .input { font-size: 1.2rem; font-weight: 800; }
.letters { font-family: var(--display); font-size: 1.6rem; letter-spacing: 0.18em; color: var(--gold); text-align: center; }
.hint-box { background: rgba(255, 197, 61, 0.14); border: 1px solid rgba(255, 197, 61, 0.5); border-radius: 14px; padding: 12px 14px; font-weight: 700; }
.tool-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* Books in Order / Verse Scramble */
.pool, .built { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.built { min-height: 64px; padding: 14px; border-radius: 18px; border: 2px dashed var(--line); background: rgba(0, 0, 0, 0.15); }
.piece {
  border: 0; border-radius: 14px; padding: 12px 16px; font-weight: 800; font-size: 1.1rem; cursor: pointer; color: #1b1240; background: #fff;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.15); transition: transform 0.1s, opacity 0.2s;
}
.piece:hover { transform: translateY(-2px); }
.piece.placed { background: #7ee2a0; cursor: default; transform: none; animation: pop 0.35s cubic-bezier(.2, 1.6, .4, 1) both; }
.piece.used { visibility: hidden; }
.piece .num { display: inline-block; margin-left: 6px; font-size: 0.8rem; opacity: 0.7; }
.book-piece { min-width: 150px; font-family: var(--display); font-size: 1.25rem; padding: 18px 20px; }
.testament { font-size: 0.72rem; font-weight: 800; display: block; color: #6a3df0; letter-spacing: 0.08em; }
.verse-built { font-family: Georgia, 'Times New Roman', serif; font-size: 1.2rem; line-height: 1.6; justify-content: flex-start; }
.verse-built .piece { font-family: Georgia, 'Times New Roman', serif; font-weight: 600; }

/* Duel */
.versus { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.fighter { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; min-width: 0; }
.fighter.them { flex-direction: row-reverse; text-align: right; }
.fighter .av { font-size: 2.2rem; line-height: 1; }
.fighter b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fighter .pts { font-family: var(--display); font-size: 1.5rem; color: var(--gold); }
.fighter .status { font-size: 0.8rem; color: var(--muted); font-weight: 800; min-height: 1.2em; }
.vs { font-family: var(--display); font-weight: 700; font-size: 1.6rem; color: var(--gold); }
.matchmaking { display: grid; gap: 14px; justify-items: center; text-align: center; padding: 30px 18px; }
.radar { width: 120px; height: 120px; border-radius: 50%; border: 3px solid rgba(255, 197, 61, 0.5); position: relative; display: grid; place-items: center; font-size: 2.6rem; }
.radar::before, .radar::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 3px solid var(--gold); animation: ping 1.8s ease-out infinite; }
.radar::after { animation-delay: 0.9s; }
@keyframes ping { from { transform: scale(1); opacity: 0.8; } to { transform: scale(1.8); opacity: 0; } }
.code-box { font-family: var(--display); font-size: 3rem; letter-spacing: 0.25em; background: #fff; color: #24175a; border-radius: 16px; padding: 6px 18px 6px 28px; }
.duel-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.duel-options .card { display: grid; gap: 10px; align-content: start; }
.duel-options h3 { margin: 0; font-family: var(--display); }
.duel-options p { margin: 0; color: var(--muted); }

/* Stats page */
.stats-page { width: min(1100px, calc(100% - 32px)); margin: 0 auto; padding: 26px 0 70px; position: relative; z-index: 1; display: grid; gap: 18px; }
.stat-hero { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.level-ring { width: 130px; height: 130px; position: relative; }
.level-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.level-ring .num { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-family: var(--display); line-height: 1; }
.level-ring .num b { font-size: 2.6rem; display: block; }
.level-ring .num small { font-size: 0.8rem; color: var(--muted); font-family: var(--font); font-weight: 800; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.kpi small { color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.72rem; }
.kpi b { display: block; font-family: var(--display); font-size: 1.9rem; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--muted); font-size: 0.85rem; font-weight: 700; }
.panel-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }
@media (max-width: 860px) { .panel-grid { grid-template-columns: 1fr; } .stat-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; } }
.panel-title { font-family: var(--display); font-size: 1.25rem; margin: 0 0 4px; }
.panel-sub { color: var(--muted); margin: 0 0 14px; font-size: 0.9rem; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-svg text { fill: var(--muted); font: 700 11px var(--font); }
.chart-svg .grid { stroke: rgba(255, 255, 255, 0.1); }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 38%) 1fr 48px; gap: 10px; align-items: center; font-weight: 700; font-size: 0.92rem; }
.bar-row .track { height: 14px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.bar-row .track i { display: block; height: 100%; border-radius: 99px; }
.bar-row .pct { text-align: right; font-variant-numeric: tabular-nums; }
.bar-row small { display: block; color: var(--faint); font-size: 0.75rem; }
.game-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.game-stat { border-radius: 16px; padding: 14px; background: linear-gradient(140deg, var(--from), var(--to)); display: grid; gap: 6px; }
.game-stat .top { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 1.1rem; }
.game-stat .row { display: flex; justify-content: space-between; font-weight: 700; font-size: 0.9rem; background: rgba(0, 0, 0, 0.18); border-radius: 8px; padding: 4px 8px; }
.game-stat.unplayed { filter: grayscale(0.7); opacity: 0.6; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.badge-card { border-radius: 14px; padding: 12px; text-align: center; background: var(--panel); border: 1px solid var(--line); display: grid; gap: 4px; }
.badge-card .e { font-size: 2rem; }
.badge-card small { color: var(--muted); font-size: 0.78rem; }
.badge-card.locked .e { filter: grayscale(1); opacity: 0.35; }
.badge-card.locked b { color: var(--muted); }
.badge-card.got { border-color: var(--gold); background: rgba(255, 197, 61, 0.1); }
.history { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.history td, .history th { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.history th { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }
.history td.num, .history th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty-stats { text-align: center; padding: 40px 20px; display: grid; gap: 12px; justify-items: center; }

/* Tribes (party mode) */
.camps { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.2vw; overflow-y: auto; align-content: start; }
.camp { border-radius: 18px; background: var(--panel); border-top: 6px solid var(--tc); padding: 1.4vh 1vw; display: flex; flex-direction: column; gap: 8px; min-height: 22vh; }
.camp-head { display: flex; align-items: center; gap: 10px; }
.camp-head .e { font-size: clamp(1.8rem, 3vw, 3rem); }
.camp-head b { font-family: var(--display); font-size: clamp(1.1rem, 1.8vw, 1.8rem); display: block; }
.camp-head small { color: var(--muted); font-size: clamp(0.7rem, 0.9vw, 0.95rem); font-style: italic; }
.camp-head .cnt { margin-left: auto; background: var(--tc); color: #1b1240; font-weight: 800; border-radius: 99px; padding: 2px 10px; font-family: var(--display); }
.camp .members { display: flex; flex-wrap: wrap; gap: 6px; }
.camp .bubble { font-size: clamp(0.85rem, 1.2vw, 1.2rem); padding: 0.3em 0.75em; }
.journey { flex: 1; display: grid; grid-template-rows: auto 1fr auto; gap: 1.6vh; padding: 76px 2.4vw 2vh; min-height: 100dvh; }
.journey h1 { margin: 0; text-align: center; font-family: var(--display); font-size: clamp(1.6rem, 3vw, 3rem); }
.map-wrap { position: relative; background: radial-gradient(ellipse at 30% 30%, #e9d7a8, #c9a86a 70%, #a8844a); border-radius: 26px; box-shadow: inset 0 0 60px rgba(80, 50, 10, 0.55), 0 20px 50px rgba(0, 0, 0, 0.4); overflow: hidden; min-height: 0; }
.map-wrap svg { width: 100%; height: 100%; display: block; }
.map-wrap .route { fill: none; stroke: #6b4a1e; stroke-width: 7; stroke-dasharray: 2 16; stroke-linecap: round; }
.map-wrap .route-glow { fill: none; stroke: rgba(255, 255, 255, 0.35); stroke-width: 26; stroke-linecap: round; }
.map-wrap .station-name { font: 800 26px var(--display); fill: #4a2f0c; text-anchor: middle; }
.map-wrap .station-emoji { font-size: 46px; text-anchor: middle; dominant-baseline: central; }
.map-wrap .water { fill: #3d8bd6; opacity: 0.75; }
.map-wrap .token-ring { stroke: #fff; stroke-width: 5; }
.map-wrap .token-emoji { font-size: 34px; text-anchor: middle; dominant-baseline: central; }
.journey-foot { display: grid; grid-template-columns: 1fr auto; gap: 1.6vw; align-items: start; }
.tribe-list { display: flex; gap: 10px; flex-wrap: wrap; }
.tribe-pill { display: flex; align-items: center; gap: 8px; background: var(--panel-2); border-left: 6px solid var(--tc); border-radius: 12px; padding: 8px 14px; font-weight: 800; font-size: clamp(0.95rem, 1.4vw, 1.4rem); }
.tribe-pill .gain { color: #7ee2a0; font-size: 0.85em; }
.events { display: grid; gap: 6px; }
.event { background: #fff; color: #24175a; border-radius: 12px; padding: 8px 14px; font-weight: 800; font-size: clamp(0.95rem, 1.4vw, 1.4rem); animation: slideIn 0.5s cubic-bezier(.2, 1.2, .4, 1) both; }
.mvp { background: var(--gold); color: var(--gold-ink); border-radius: 14px; padding: 10px 16px; font-weight: 800; font-size: clamp(0.95rem, 1.3vw, 1.3rem); }
.tribe-choose { display: grid; gap: 8px; }
.tribe-choose button { display: flex; align-items: center; gap: 10px; text-align: left; border: 3px solid transparent; border-radius: 14px; padding: 10px 12px; background: #f3f0ff; color: #24175a; cursor: pointer; }
.tribe-choose button[aria-pressed="true"] { border-color: var(--tc); background: #fff; box-shadow: 0 0 0 3px var(--tc) inset; }
.tribe-choose .e { font-size: 1.8rem; }
.tribe-choose b { display: block; }
.tribe-choose small { color: #6b6290; font-style: italic; font-size: 0.8rem; }
.tribe-choose .cnt { margin-left: auto; font-weight: 800; color: #6b6290; font-size: 0.85rem; white-space: nowrap; }
.finale { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2vh; padding: 76px 3vw 3vh; overflow-y: auto; }
.finale h1 { font-family: var(--display); font-size: clamp(2rem, 4.4vw, 4.4rem); margin: 0; text-align: center; line-height: 1.1; }
.winner-emoji { font-size: clamp(5rem, 14vh, 10rem); line-height: 1; animation: bob 2.4s ease-in-out infinite; }
.finale .blessing { font-style: italic; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.6rem); text-align: center; }
.tribe-results { display: grid; gap: 1vh; width: min(900px, 94vw); }
.tribe-result { display: grid; grid-template-columns: 3ch auto 1fr auto; gap: 1vw; align-items: center; background: var(--panel-2); border-radius: 14px; padding: 1.2vh 1.4vw; font-weight: 800; font-size: clamp(1rem, 1.8vw, 1.8rem); }
.tribe-result .meter { height: 12px; background: rgba(255, 255, 255, 0.15); border-radius: 99px; overflow: hidden; }
.tribe-result .meter i { display: block; height: 100%; background: var(--tc); border-radius: 99px; transition: width 1.4s cubic-bezier(.2, .9, .3, 1); }
.heroes { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.hero-chip { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 8px 14px; font-weight: 800; font-size: clamp(0.9rem, 1.3vw, 1.3rem); }

.intro .qnum { white-space: nowrap; }
body.host { user-select: none; }

/* Name easter eggs */
.emoji-rain { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 45; }
.six-seven {
  position: fixed; inset: 0; z-index: 46; display: flex; align-items: center; justify-content: center; gap: 2vw; pointer-events: none;
  font-size: clamp(4rem, 14vw, 12rem); line-height: 1; animation: eggShow 3s ease forwards;
}
.six-seven .n { font-family: var(--display); font-weight: 700; color: var(--gold); text-shadow: 0 6px 0 rgba(0, 0, 0, 0.35); }
.six-seven .up { animation: sevenUp 0.42s ease-in-out infinite alternate; }
.six-seven .down { animation: sevenDown 0.42s ease-in-out infinite alternate; }
@keyframes sevenUp { from { transform: translateY(-14%); } to { transform: translateY(14%); } }
@keyframes sevenDown { from { transform: translateY(14%); } to { transform: translateY(-14%); } }
@keyframes eggShow { 0% { opacity: 0; transform: scale(0.6); } 12% { opacity: 1; transform: scale(1); } 85% { opacity: 1; } 100% { opacity: 0; } }
.bubble .egg { display: inline-block; }
.bubble.egg-sixseven .egg { animation: sevenUp 0.4s ease-in-out infinite alternate; }
.bubble.egg-giant, .camp .bubble.egg-giant { font-size: clamp(1.4rem, 2.4vw, 2.4rem); }
.six-seven.static, .six-seven.static * { animation: none !important; }

/* Accounts */
a.icon-btn { text-decoration: none; }
.account-modal { width: min(520px, 100%); }
.account-modal-body { padding: 16px 18px; display: grid; gap: 12px; }
.account-modal-body p { margin: 0; line-height: 1.5; }
.account-card { display: grid; gap: 16px; }
.signin-nudge { background: rgba(255, 197, 61, 0.12); border: 1px solid rgba(255, 197, 61, 0.45); border-radius: 12px; padding: 10px 14px; font-size: 1rem !important; }
.invite-card {
  position: fixed; right: 16px; bottom: 16px; z-index: 70; width: min(360px, calc(100% - 32px)); display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center;
  background: #fff; color: #24175a; border-radius: 18px; padding: 14px 16px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45); animation: rise 0.4s cubic-bezier(.2, 1.3, .4, 1) both; font-weight: 700;
}
.invite-av { font-size: 2.4rem; grid-row: span 2; }
.invite-actions { display: flex; gap: 8px; justify-content: flex-end; }
.invite-actions .btn:not(.gold) { background: #efeafd; color: #24175a; }
.lb { width: 100%; border-collapse: collapse; }
.lb td { padding: 10px 6px; border-bottom: 1px solid var(--line); font-weight: 700; }
.lb td.rk { width: 3ch; text-align: center; font-family: var(--display); font-size: 1.15rem; }
.lb td.av { width: 2.2em; font-size: 1.5rem; }
.lb td small { display: block; color: var(--muted); font-weight: 700; font-size: 0.78rem; }
.lb td small.you { display: inline-block; background: var(--gold); color: var(--gold-ink); border-radius: 99px; padding: 0 8px; }
.lb td.num { text-align: right; font-family: var(--display); font-size: 1.15rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lb td.num small { display: inline; }
.lb tr.me td { background: rgba(255, 197, 61, 0.12); }
.friend { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.friend:last-child { border-bottom: 0; }
.friend-av { position: relative; font-size: 2rem; line-height: 1; }
.friend-av .dot { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 3px var(--panel-solid); }
.friend-info { flex: 1; min-width: 0; }
.friend-info b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-info small { color: var(--muted); font-weight: 700; }
.friend-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.friend-actions a[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.host-account { color: var(--muted); font-weight: 700; margin: -6px 0 16px; }
.flag-btn { border: 0; background: transparent; color: var(--faint); cursor: pointer; font-size: 1rem; padding: 4px 6px; border-radius: 8px; }
.flag-btn:hover, .flag-btn:focus-visible { color: #ff9a9d; background: rgba(255, 255, 255, 0.08); }
.lb td.flag { width: 2.2em; text-align: center; padding-left: 0; padding-right: 0; }

/* Homepage "about" section (also what search engines read) */
.about { margin-top: 30px; display: grid; gap: 14px; }
.about h2 { font-family: var(--display); margin: 6px 0 0; font-size: 1.5rem; }
.about > p { margin: 0; color: var(--muted); line-height: 1.6; }
.about-games { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.about-games li { display: grid; gap: 2px; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,0.04); border: 1px solid var(--line); }
.about-games a { font-weight: 800; color: #fff; text-decoration: none; }
.about-games a:hover { color: var(--gold, #ffcc33); }
.about-games span { color: var(--muted); font-size: .92rem; }
.faq { display: grid; gap: 8px; }
.faq details { border-radius: 14px; background: rgba(255,255,255,0.04); border: 1px solid var(--line); padding: 12px 16px; }
.faq summary { cursor: pointer; font-weight: 800; }
.faq details p { margin: 8px 0 0; color: var(--muted); line-height: 1.55; }
