/* TV screen. Everything is sized in rem, and rem scales with the screen width. */
html { font-size: clamp(12px, 1.05vw, 30px); }
body.host { height: 100vh; display: grid; grid-template-rows: auto 1fr; overflow: hidden; }

.topbar { display: flex; align-items: center; gap: 1.2rem; padding: 1rem 1.8rem; }
.topbar .logo { font-size: 1.7rem; }
.pill { background: var(--surface); border-radius: 99px; padding: 0.35rem 1rem; font-weight: 700; font-size: 1rem; color: var(--muted); }
.join-hint { color: var(--muted); font-size: 1rem; }
.join-hint b { color: #fff; letter-spacing: 0.08em; }
.controls { margin-left: auto; display: flex; gap: 0.5rem; align-items: center; }
.icon-btn { background: var(--surface); border-radius: 50%; width: 2.6rem; height: 2.6rem; font-size: 1.15rem; display: grid; place-items: center; color: #fff; }
.icon-btn:hover { background: var(--surface2); }
.menu { position: relative; }
.menu-pop { position: absolute; right: 0; top: 3.1rem; background: var(--surface); border: 1px solid var(--card-line); border-radius: 14px; padding: 0.4rem; z-index: 50; min-width: 18rem; box-shadow: 0 20px 50px rgba(0,0,0,0.6); }
.menu-pop button { display: flex; gap: 0.7rem; align-items: center; width: 100%; text-align: left; background: none; padding: 0.7rem 0.9rem; border-radius: 10px; font-size: 1rem; font-weight: 600; }
.menu-pop button:hover { background: var(--surface2); }

#main { position: relative; padding: 0 2.2rem 2rem; min-height: 0; }
#main > section { height: 100%; }

.audio-nudge { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); background: var(--surface); color: var(--muted); padding: 0.5rem 1.1rem; border-radius: 99px; font-size: 0.9rem; font-weight: 600; }

/* ---------- Lobby ---------- */
.lobby { display: grid; grid-template-columns: 1fr 1.25fr; gap: 4rem; align-items: center; }
.lobby-left { text-align: center; }
.lobby-left .logo { font-size: 6rem; display: inline-block; animation: glitch 4s infinite; }
.tagline { color: var(--muted); font-size: 1.3rem; font-weight: 500; margin: 0.6rem auto 2.2rem; max-width: 26rem; }
.qr-card { display: inline-block; background: #fff; color: #000; border-radius: 22px; padding: 1.1rem 1.1rem 0.9rem; box-shadow: -0.4rem -0.3rem 0 var(--cyan), 0.4rem 0.3rem 0 var(--pink); }
.qr-card svg:not(.ic) { width: 15rem; height: 15rem; display: block; }
.qr-card .scan { font-weight: 800; font-size: 1.3rem; margin-top: 0.5rem; display: flex; align-items: center; justify-content: center; gap: 0.4rem; }
.qr-card .url { font-size: 0.8rem; color: #71717a; word-break: break-all; max-width: 15rem; }
.room-code { margin-top: 1.6rem; font-size: 1.1rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; }
.room-code b { color: #fff; font-size: 2.6rem; letter-spacing: 0.18em; vertical-align: middle; margin-left: 0.4rem; text-shadow: var(--split); }

.lobby-right h2 { font-size: 2.2rem; margin-bottom: 1.2rem; display: flex; align-items: center; gap: 0.6rem; }
.lobby-right h2 small { color: var(--muted); font-weight: 600; font-size: 1.2rem; }
.player-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 1rem; min-height: 8.5rem; align-content: start; }
.pcard { background: var(--surface); border-radius: var(--radius); padding: 1.2rem 1rem 1rem; text-align: center; position: relative; }
.pcard .av { font-size: 2.6rem; }
.pcard .nm { margin-top: 0.6rem; font-weight: 700; font-size: 1.15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .kick { position: absolute; top: 0.4rem; right: 0.4rem; background: none; opacity: 0; font-size: 1rem; color: var(--muted); }
.pcard:hover .kick { opacity: 1; }
.pcard .vip { position: absolute; top: -0.65rem; left: 50%; transform: translateX(-50%); background: var(--pink); color: #fff; font-size: 0.7rem; font-weight: 800; padding: 0.15rem 0.6rem; border-radius: 99px; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.04em; }
.empty-slot { border: 2px dashed rgba(255,255,255,0.14); border-radius: var(--radius); display: grid; place-items: center; color: var(--muted); padding: 1.5rem 1rem; font-size: 1rem; font-weight: 600; }
.lobby-controls { margin-top: 1.6rem; display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.rounds { display: flex; align-items: center; gap: 0.5rem; font-size: 1.1rem; font-weight: 700; color: var(--muted); }
.rounds button { width: 2.8rem; height: 2.8rem; border-radius: 50%; background: var(--surface); font-weight: 800; font-size: 1.1rem; }
.rounds button.on { background: #fff; color: #000; }
.lobby .btn { font-size: 1.4rem; }
.fine { color: var(--muted); font-size: 0.95rem; margin-top: 0.9rem; }

/* ---------- Turn / Spin ---------- */
.turn { display: grid; grid-template-columns: 1.15fr 1fr; gap: 3rem; align-items: center; }
.wheel-slot { display: grid; place-items: center; height: 100%; }
.wheel-wrap { position: relative; width: min(38rem, 72vh); aspect-ratio: 1; }
.wheel-wrap svg#wheel { width: 100%; height: 100%; display: block; border-radius: 50%; box-shadow: -0.5rem -0.3rem 0 var(--cyan), 0.5rem 0.3rem 0 var(--pink), 0 0 5rem rgba(157, 77, 255, 0.25); }
.wheel-wrap .pointer { position: absolute; top: -1.3rem; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 1.4rem solid transparent; border-right: 1.4rem solid transparent; border-top: 2.8rem solid #fff; z-index: 2; filter: drop-shadow(-3px 0 0 var(--cyan)) drop-shadow(3px 0 0 var(--pink)); transform-origin: 50% 0; }
.wheel-wrap .pointer.flick { animation: flick 0.12s ease-out; }
@keyframes flick { 50% { transform: translateX(-50%) rotate(-18deg); } }
.wheel-wrap .hub { position: absolute; inset: 0; margin: auto; width: 22%; height: 22%; border-radius: 50%; background: #000; color: #fff; border: 0.3rem solid #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; letter-spacing: 0.04em; text-shadow: var(--split); }
.wheel-wrap.idle svg#wheel { animation: idle-spin 40s linear infinite; }
@keyframes idle-spin { to { rotate: 360deg; } }

.side { display: flex; flex-direction: column; gap: 1.4rem; min-width: 0; }
.now-up { display: flex; gap: 1.2rem; align-items: center; background: var(--surface); border-radius: 22px; padding: 1.4rem; }
.now-up .av { font-size: 3.4rem; }
.now-up small { color: var(--muted); font-size: 1rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.now-up h2 { font-size: 2.6rem; }
.now-up p { margin: 0.4rem 0 0; font-size: 1.2rem; color: var(--cyan); font-weight: 700; display: flex; align-items: center; gap: 0.4rem; }
.now-up .bounce { animation: pulse 0.6s ease-in-out infinite alternate; display: inline-flex; }

.scoreboard { display: flex; flex-direction: column; gap: 0.4rem; }
.scoreboard .row { display: flex; align-items: center; gap: 0.8rem; background: var(--surface); border-radius: 14px; padding: 0.5rem 0.9rem; font-size: 1.2rem; transition: transform 0.3s; }
.scoreboard .row.me { box-shadow: inset 0.25rem 0 0 var(--pink); background: var(--surface2); }
.scoreboard .rk { width: 1.8rem; color: var(--muted); font-weight: 800; }
.scoreboard .nm { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scoreboard .sc { font-weight: 800; font-variant-numeric: tabular-nums; }
.scoreboard.compact .row { font-size: 1rem; padding: 0.3rem 0.8rem; }

.landed { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 5; background: rgba(0,0,0,0.55); }
.landed .card { background: var(--seg); color: var(--seg-ink); border-radius: 28px; padding: 2.6rem 4rem; text-align: center; box-shadow: -0.6rem -0.4rem 0 var(--cyan), 0.6rem 0.4rem 0 var(--pink); max-width: 52rem; animation: pop-in 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.3) both; border: 1px solid rgba(255,255,255,0.15); }
.landed .em { font-size: 5rem; line-height: 1; }
.landed .em .ic { stroke-width: 1.8; }
.landed h1 { font-size: 4.4rem; margin: 0.5rem 0; letter-spacing: -0.04em; }
.landed p { font-size: 1.5rem; margin: 0; font-weight: 600; opacity: 0.85; }

/* ---------- Challenge ---------- */
.challenge { display: flex; flex-direction: column; gap: 1.5rem; align-items: center; justify-content: center; text-align: center; }
.cat-pill { display: inline-flex; align-items: center; gap: 0.5rem; background: var(--seg); color: var(--seg-ink); border-radius: 99px; padding: 0.45rem 1.3rem; font-weight: 800; font-size: 1.15rem; border: 1px solid rgba(255,255,255,0.18); }
.question { font-size: 3.2rem; max-width: 64rem; text-wrap: balance; letter-spacing: -0.035em; }
.question.small { font-size: 2.4rem; }
.emoji-clue { font-size: 8rem; line-height: 1.1; letter-spacing: 0.1em; animation: float 3s ease-in-out infinite; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; width: min(70rem, 100%); }
.opt { display: flex; align-items: center; gap: 1.1rem; text-align: left; padding: 1rem 1.4rem 1rem 1rem; border-radius: 18px; font-size: 1.8rem; font-weight: 700; background: var(--surface); position: relative; min-height: 5.5rem; transition: opacity 0.3s, transform 0.3s; }
.opt .shape { flex: none; width: 3rem; height: 3rem; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; background: var(--oc); color: #000; }
.opt.o0 { --oc: var(--o0); } .opt.o1 { --oc: var(--o1); } .opt.o2 { --oc: var(--o2); } .opt.o3 { --oc: var(--o3); }
.opt.o0 .shape, .opt.o3 .shape { color: #fff; }
.opt.wrong { opacity: 0.3; transform: scale(0.97); }
.opt.right { box-shadow: 0 0 0 0.25rem #fff; transform: scale(1.02); }
.opt .pickers { display: flex; gap: 0.2rem; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.opt .pickers .av { font-size: 1.1rem; }
.timer-row { display: flex; align-items: center; gap: 1rem; width: min(60rem, 100%); }
.timer-row .tbar { flex: 1; height: 0.6rem; }
.timer-row .count { font-size: 2.2rem; width: 3.5rem; }
.answered-row { display: flex; gap: 0.6rem; flex-wrap: wrap; justify-content: center; min-height: 3.2rem; }
.answered-row .av { font-size: 1.6rem; transition: opacity 0.3s, transform 0.3s; }
.answered-row .av.waiting { opacity: 0.25; }
.answered-row .av.done { animation: pop-in 0.35s both; }
.big-note { font-size: 1.5rem; color: var(--muted); font-weight: 600; }

.secret { display: flex; flex-direction: column; align-items: center; gap: 1.1rem; }
.secret .actor .av { font-size: 6rem; animation: pulse 0.8s ease-in-out infinite alternate; }
.secret h1 { font-size: 4rem; }
.secret p { font-size: 1.7rem; color: var(--cyan); margin: 0; font-weight: 700; }
.ring { font-size: 5rem; font-weight: 800; width: 11rem; height: 11rem; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--pink) calc(var(--p) * 1turn), #ffffff1a 0); position: relative; }
.ring::before { content: ''; position: absolute; inset: 0.7rem; border-radius: 50%; background: #000; }
.ring .count { position: relative; }
.rate-faces { display: flex; gap: 3.5rem; font-size: 5rem; }
.rate-faces div { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; }
.rate-faces .ic { stroke-width: 1.6; }
.rate-faces div:nth-child(1) { color: #fff; } .rate-faces div:nth-child(2) { color: var(--cyan); } .rate-faces div:nth-child(3) { color: var(--pink); }
.rate-faces small { font-size: 1.3rem; color: var(--muted); font-weight: 700; }

/* ---------- Results ---------- */
.results { display: flex; flex-direction: column; gap: 1.3rem; align-items: center; justify-content: center; text-align: center; }
.reveal { font-size: 4rem; font-weight: 800; letter-spacing: -0.04em; text-shadow: var(--split); }
.deltas { display: flex; flex-wrap: wrap; gap: 0.7rem; justify-content: center; max-width: 80rem; }
.delta { display: flex; align-items: center; gap: 0.6rem; background: var(--surface); border-radius: 99px; padding: 0.4rem 1.1rem 0.4rem 0.4rem; font-size: 1.25rem; font-weight: 600; }
.delta .av { font-size: 1.4rem; }
.delta b { color: var(--cyan); font-size: 1.45rem; font-weight: 800; }
.delta b.neg { color: var(--pink); }
.delta small { color: var(--muted); font-weight: 600; }
.nobody { font-size: 1.9rem; color: var(--muted); font-weight: 700; }
.guesses { display: flex; flex-direction: column; gap: 0.45rem; width: min(44rem, 100%); }
.guesses .g { display: flex; align-items: center; gap: 1rem; background: var(--surface); border-radius: 14px; padding: 0.5rem 1rem; font-size: 1.45rem; }
.guesses .g.win { background: var(--cyan); color: #000; }
.guesses .g .nm { flex: 1; text-align: left; font-weight: 700; }
.guesses .g .off { color: var(--muted); font-size: 1.05rem; font-weight: 600; }
.guesses .g.win .off { color: #000; opacity: 0.7; }
.tally { display: flex; gap: 2.5rem; align-items: flex-end; justify-content: center; height: 21rem; }
.tally .col { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; justify-content: flex-end; height: 100%; }
.tally .bar { width: 6rem; background: var(--c); color: #000; border-radius: 14px 14px 4px 4px; display: grid; place-items: start center; padding-top: 0.5rem; font-size: 1.6rem; font-weight: 800; min-height: 2.6rem; animation: grow 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; transform-origin: bottom; }
@keyframes grow { from { transform: scaleY(0); } }
.tally .av { font-size: 2.4rem; }
.crown { font-size: 2.4rem; color: var(--yellow); animation: float 1.5s ease-in-out infinite; line-height: 1; }
.tally .nm { font-weight: 700; font-size: 1.15rem; }
.mystery-card { background: var(--surface); color: #fff; border-radius: 28px; padding: 2.6rem 3.6rem; max-width: 56rem; box-shadow: -0.6rem -0.4rem 0 var(--cyan), 0.6rem 0.4rem 0 var(--pink); }
.mystery-card .em { font-size: 5.5rem; line-height: 1; color: var(--yellow); }
.mystery-card .em .ic { stroke-width: 1.8; }
.mystery-card h1 { font-size: 3.8rem; margin-top: 0.6rem; letter-spacing: -0.04em; }
.mystery-card p { font-size: 1.8rem; margin: 0.6rem 0 0; color: #d4d4d8; font-weight: 500; }
.next-hint { color: var(--muted); font-size: 1rem; font-weight: 600; display: flex; gap: 1rem; align-items: center; }
.next-hint .btn { font-size: 0.95rem; padding: 0.45rem 1rem; }

/* ---------- Final ---------- */
.final { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.1rem; text-align: center; }
.final h1.winner { font-size: 4rem; letter-spacing: -0.045em; text-shadow: var(--split); }
.podium { display: flex; align-items: flex-end; gap: 1.4rem; }
.podium .spot { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; width: 13rem; }
.podium .av { font-size: 3.8rem; }
.podium .spot.p1 .av { font-size: 4.4rem; }
.podium .crown { font-size: 3rem; }
.podium .nm { font-weight: 800; font-size: 1.5rem; }
.podium .block { width: 100%; border-radius: 16px 16px 0 0; display: grid; place-items: start center; padding-top: 0.8rem; font-size: 3rem; font-weight: 800; animation: grow 1s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; transform-origin: bottom; }
.podium .p1 .block { height: 11rem; background: var(--pink); color: #fff; animation-delay: 1.2s; }
.podium .p2 .block { height: 8rem; background: var(--cyan); color: #000; animation-delay: 0.6s; }
.podium .p3 .block { height: 5.5rem; background: #fff; color: #000; }
.podium .pts { font-size: 1.2rem; color: var(--muted); font-weight: 600; }
.awards { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.award { background: var(--surface); border-radius: 18px; padding: 0.8rem 1.3rem; display: flex; align-items: center; gap: 0.9rem; font-size: 1.15rem; text-align: left; }
.award .em { font-size: 1.9rem; color: var(--cyan); display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; background: var(--surface2); }
.award .em .ic { font-size: 1.5rem; }
.award small { display: block; color: var(--muted); font-size: 0.9rem; }
.final-actions { display: flex; gap: 1rem; }

/* ---------- Theme picker (lobby) ---------- */
.sec-label { margin: 1.8rem 0 0.8rem; font-size: 0.95rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.theme-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; }
.theme { display: flex; flex-direction: column; align-items: flex-start; gap: 0.3rem; text-align: left; background: var(--surface); border-radius: 16px; padding: 1rem; border: 2px solid transparent; transition: border-color 0.15s, background 0.15s; }
.theme:hover { background: var(--surface2); }
.theme .theme-ic { font-size: 1.6rem; color: var(--muted); margin-bottom: 0.2rem; }
.theme b { font-size: 1.1rem; font-weight: 800; line-height: 1.15; }
.theme small { font-size: 0.85rem; color: var(--muted); line-height: 1.3; }
.theme.on { border-color: var(--pink); background: var(--surface2); box-shadow: -0.2rem -0.15rem 0 var(--cyan), 0.2rem 0.15rem 0 var(--pink); }
.theme.on .theme-ic { color: var(--cyan); }
.levels { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.9rem; flex-wrap: wrap; }
.levels-label { font-weight: 700; color: var(--muted); margin-right: 0.3rem; }
.levels button { display: flex; flex-direction: column; align-items: flex-start; background: var(--surface); border-radius: 12px; padding: 0.45rem 0.9rem; border: 2px solid transparent; }
.levels button b { font-size: 1rem; }
.levels button small { font-size: 0.78rem; color: var(--muted); }
.levels button.on { background: #fff; color: #000; }
.levels button.on small { color: #52525b; }

/* Category pill + decade/category chip */
.pill-row { display: flex; align-items: center; gap: 0.6rem; }
.tag-chip { background: transparent; color: var(--cyan); border: 2px solid var(--cyan); border-radius: 99px; padding: 0.3rem 0.9rem; font-weight: 800; font-size: 1.05rem; letter-spacing: 0.02em; }
