/* ============ Alus ============ */
:root {
  --bg: #0d1322; --bg2: #121a2d; --panel: #18223a; --panel2: #202c48; --line: #2d3b5c; --line2: #3c4d75;
  --text: #eef1f7; --muted: #97a3bc; --gold: #e9b949; --gold2: #f6d77a; --teal: #4fb3a5; --red: #e0705c; --green: #63bf86; --blue: #7c9cf0;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --r: 12px; --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --c0: #c9553f; --c1: #3d7dca; --c2: #c2932a; --c3: #3f9a78; --c4: #8a62c4; --c5: #c0588f;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; font-weight: 650; }
h1 { font-family: var(--serif); font-size: 28px; letter-spacing: -.01em; }
h2 { font-size: 21px; } h3 { font-size: 17px; } h4 { font-size: 14px; }
p { margin: 0; } a { color: var(--gold); }
img { max-width: 100%; }
.muted { color: var(--muted); } .small { font-size: 13px; } .block { display: block; }
.err { color: #ff9c8a; } .ok { color: var(--green); }
.center { text-align: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .78em; color: var(--gold); font-weight: 600; }
.code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; letter-spacing: .12em; font-weight: 700; color: var(--gold2); }
.dot { display: inline-block; width: .7em; height: .7em; border-radius: 50%; flex: none; vertical-align: baseline; }
kbd { font: 600 11px var(--sans); border: 1px solid currentColor; border-radius: 4px; padding: 0 5px; opacity: .6; margin-left: 8px; }

.row { display: flex; align-items: center; gap: 8px; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; } .row.end { justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: 14px; } .stack.tight { gap: 6px; }
.grow { flex: 1; }
.grid2, .grid3, .grid4 { display: grid; gap: 10px; align-items: start; }
.grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: repeat(3, 1fr); } .grid4 { grid-template-columns: repeat(4, 1fr); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line2); background: var(--panel2); color: var(--text);
  font: 600 14px var(--sans); padding: 8px 14px; border-radius: 9px; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:hover:not(:disabled) { background: #2a385a; border-color: #53679a; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #1b1505; }
.btn.primary:hover:not(:disabled) { background: var(--gold2); border-color: var(--gold2); }
.btn.primary.quiet { background: transparent; color: var(--gold); }
.btn.big { padding: 14px 20px; font-size: 17px; border-radius: 12px; }
.btn.small { padding: 5px 10px; font-size: 13px; } .btn.tiny { padding: 2px 9px; font-size: 15px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.danger { color: #ff9c8a; } .btn.danger:hover:not(:disabled) { background: #4a2620; border-color: var(--red); }
.btn.good { background: #1f5a3a; border-color: var(--green); color: #d9ffe8; } .btn.good:hover:not(:disabled) { background: #277349; }
.btn.bad { background: #5a2a22; border-color: var(--red); color: #ffe1db; } .btn.bad:hover:not(:disabled) { background: #74352b; }
.btn.on { border-color: var(--gold); color: var(--gold2); background: rgba(233, 185, 73, .12); }
.btn.dashed { border-style: dashed; background: transparent; color: var(--muted); width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--gold); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link.danger { color: #ff9c8a; }
.icon { background: none; border: 0; color: var(--muted); font-size: 15px; width: 26px; height: 26px; border-radius: 6px; cursor: pointer; flex: none; }
.icon:hover:not(:disabled) { background: var(--panel2); color: var(--text); } .icon:disabled { opacity: .25; cursor: default; } .icon.danger:hover:not(:disabled) { color: #ff9c8a; }

input, select, textarea { font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; border-color: transparent; }
textarea { resize: vertical; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--gold); }
input[type=range] { padding: 0; accent-color: var(--gold); border: 0; background: none; }
select.mini, input.mini { width: auto; padding: 4px 6px; font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; } .field > span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; cursor: pointer; } .check input { margin-top: 3px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; } .card.pad0 { padding: 0; overflow: hidden; } .card.narrow { max-width: 420px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--panel2); color: var(--muted); border: 1px solid var(--line); }
.badge.st-running, .badge.stage.open { color: var(--green); border-color: #2f6a48; } .badge.st-lobby, .badge.stage.intro, .badge.stage.wager { color: var(--gold2); border-color: #6d5a26; }
.badge.stage.revealed { color: var(--blue); border-color: #3b4d86; } .badge.stage.locked { color: #ff9c8a; border-color: #6d3a30; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: var(--panel2); font-size: 13px; border: 1px solid var(--line); }
.chip.off { opacity: .45; } .chip.btnlike { cursor: pointer; color: var(--text); font: inherit; font-size: 13px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font: 600 14px var(--sans); padding: 8px 12px; cursor: pointer; margin-bottom: -1px; }
.tab small { margin-left: 6px; opacity: .6; } .tab:hover { color: var(--text); } .tab.on { color: var(--gold2); border-color: var(--gold); } .tab.add { color: var(--gold); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; flex-wrap: wrap; }
.seg button { background: var(--bg2); border: 0; color: var(--muted); font: 600 13px var(--sans); padding: 7px 11px; cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; } .seg button.on { background: rgba(233, 185, 73, .14); color: var(--gold2); }
.tbl { width: 100%; border-collapse: collapse; } .tbl td, .tbl th { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; } .tbl th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.tbl .r { text-align: right; } .tbl.big td, .tbl.big th { padding: 11px 14px; } .tbl tr.ok .ans { color: #b6f0cc; } .tbl tr.no .ans { color: #ffb9ab; }
.tbl td.top { color: var(--gold2); font-weight: 700; }
.scroll-x { overflow-x: auto; }
.modal-bg { position: fixed; inset: 0; background: rgba(5, 8, 16, .7); display: grid; place-items: center; z-index: 50; padding: 20px; backdrop-filter: blur(3px); }
.modal { background: var(--panel); border: 1px solid var(--line2); border-radius: 16px; padding: 20px; width: min(520px, 100%); max-height: 90vh; overflow: auto; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.modal.wide { width: min(900px, 100%); }
.center-page { min-height: 100%; display: grid; place-items: center; padding: 20px; }
.login { width: min(360px, 100%); display: flex; flex-direction: column; gap: 14px; text-align: center; } .login img { width: 64px; margin: 0 auto; } .login .field { text-align: left; }

.timer { display: flex; align-items: center; gap: 10px; } .timer-bar { flex: 1; height: 8px; border-radius: 99px; background: var(--panel2); overflow: hidden; }
.timer-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--gold)); transform-origin: left; transition: transform .1s linear; }
.timer-num { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }
.timer.hurry .timer-bar i { background: var(--red); } .timer.hurry .timer-num { color: var(--red); animation: pulse .5s infinite alternate; } .timer.paused { opacity: .6; }

.dots { display: inline-flex; gap: 6px; margin-left: 6px; } .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); animation: bounce 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-6px); opacity: 1; } }
@keyframes pulse { from { opacity: 1; } to { opacity: .45; } }
@keyframes popIn { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes deal { from { transform: perspective(600px) rotateX(-70deg) translateY(-10px); opacity: 0; } to { transform: none; opacity: 1; } }
.pop-in { animation: popIn .45s cubic-bezier(.2, .9, .3, 1.2) both; } .rise { animation: rise .6s cubic-bezier(.2, .8, .2, 1) both; } .deal { animation: deal .5s cubic-bezier(.2, .8, .2, 1) both; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* valikvastuste värvid */
.c0 { --oc: var(--c0); } .c1 { --oc: var(--c1); } .c2 { --oc: var(--c2); } .c3 { --oc: var(--c3); } .c4 { --oc: var(--c4); } .c5 { --oc: var(--c5); }

/* mosaiik */
.mosaic { position: relative; display: inline-block; line-height: 0; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.mosaic img { display: block; max-width: 100%; }
.mosaic .tiles { position: absolute; inset: 0; display: grid; }
.mosaic .tiles i { background: linear-gradient(135deg, #24345a, #1a2644); border: 1px solid rgba(233, 185, 73, .35); transition: transform .6s cubic-bezier(.5, 0, .3, 1), opacity .6s; }
.mosaic .tiles i.off { transform: scale(.2) rotate(90deg); opacity: 0; }
.mosaic.small img { max-height: 220px; }

/* ============ Mängija (telefon) ============ */
body.play { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
body.play input { user-select: text; -webkit-user-select: text; font-size: 17px; padding: 13px 14px; border-radius: 12px; }
body.play #app { min-height: 100dvh; display: flex; flex-direction: column; background: radial-gradient(120% 60% at 50% 0%, #1b2748 0%, var(--bg) 60%); }
.p-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 24px 18px calc(24px + env(safe-area-inset-bottom)); }
.brand { display: flex; align-items: center; gap: 10px; font: 600 22px var(--serif); } .brand img { width: 40px; }
.p-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.p-card.flat { box-shadow: none; padding: 14px; gap: 8px; }
.code-input { text-align: center; font: 700 34px ui-monospace, Menlo, Consolas, monospace !important; letter-spacing: .3em; text-transform: uppercase; padding: 14px 0 14px .3em !important; }
.team-pick { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; max-height: 38vh; overflow: auto; }
.team-opt { text-align: left; background: var(--bg2); border: 1.5px solid var(--line); border-left: 6px solid var(--c); border-radius: 12px; padding: 10px 12px; color: var(--text); font: inherit; display: flex; flex-direction: column; cursor: pointer; }
.team-opt small { color: var(--muted); } .team-opt.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 16%, var(--bg2)); }
.p-app { flex: 1; display: flex; flex-direction: column; min-height: 100dvh; transition: background .3s; }
.p-app.flash-correct { background: #1c5a3a; } .p-app.flash-wrong { background: #5a221c; }
.p-head { display: flex; justify-content: space-between; align-items: center; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: rgba(13, 19, 34, .85); border-bottom: 3px solid var(--team); position: sticky; top: 0; z-index: 2; backdrop-filter: blur(8px); }
.p-who { display: flex; align-items: center; gap: 10px; min-width: 0; } .p-who .dot { width: 14px; height: 14px; } .p-who div { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.p-who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .p-who small, .p-score small { color: var(--muted); font-size: 12px; }
.p-score { text-align: right; display: flex; flex-direction: column; line-height: 1.1; } .p-score b { font-size: 22px; font-variant-numeric: tabular-nums; color: var(--gold2); }
.p-banner { background: #5a2a22; color: #ffe1db; text-align: center; padding: 6px; font-size: 13px; }
.p-body { flex: 1; display: flex; flex-direction: column; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
.p-stack { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 460px; margin: 0 auto; } .p-stack.center { align-items: center; text-align: center; justify-content: center; flex: 1; } .p-stack.grow { flex: 1; }
.pulse-ring { width: 84px; height: 84px; border-radius: 50%; background: color-mix(in srgb, var(--team) 25%, transparent); border: 3px solid var(--team); display: grid; place-items: center; font-size: 38px; animation: ring 2s infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--team) 50%, transparent); } 100% { box-shadow: 0 0 0 26px transparent; } }
.turn { font-size: 18px; } .turn.mine { color: var(--gold2); font-weight: 700; font-size: 22px; animation: pulse .8s infinite alternate; }
.place { font: 700 54px var(--serif); color: var(--gold2); }
.p-lb { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.p-lb li { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.p-lb li.me { border-color: var(--gold); background: rgba(233, 185, 73, .1); } .p-lb .pl { color: var(--muted); width: 2ch; } .p-lb b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .p-lb .sc { font-variant-numeric: tabular-nums; font-weight: 700; }
.p-q { flex: 1; display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 520px; margin: 0 auto; }
.q-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; } .q-meta b { color: var(--gold2); white-space: nowrap; }
.p-q .q-text { font: 500 20px/1.3 var(--serif); }
.q-hints { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; } .p-q .q-hints li { background: rgba(233, 185, 73, .1); border: 1px solid #6d5a26; border-radius: 10px; padding: 8px 10px; font-size: 14px; }
.buzz-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.buzzer { width: min(74vw, 46vh, 320px); aspect-ratio: 1; border-radius: 50%; border: 0; cursor: pointer; color: #fff; font: 800 clamp(26px, 9vw, 44px) var(--sans); letter-spacing: .04em;
  background: radial-gradient(circle at 35% 28%, #5a6582, #323b55 70%); box-shadow: 0 0 0 10px #1a2238, 0 0 0 13px var(--line2), 0 14px 0 6px #0a0e1a; transition: transform .06s, box-shadow .06s, background .2s; touch-action: none; }
.buzzer.armed { background: radial-gradient(circle at 35% 28%, #ff9d87, #d2452f 65%, #a02f1e); box-shadow: 0 0 0 10px #1a2238, 0 0 0 13px var(--gold), 0 14px 0 6px #0a0e1a, 0 0 60px rgba(224, 112, 92, .55); animation: arm 1.4s infinite; }
.buzzer.armed:active { transform: translateY(8px) scale(.98); box-shadow: 0 0 0 10px #1a2238, 0 0 0 13px var(--gold), 0 4px 0 6px #0a0e1a; }
.buzzer.mine { background: radial-gradient(circle at 35% 28%, #fff0b8, var(--gold) 60%, #b98a22); color: #231a03; box-shadow: 0 0 0 10px #1a2238, 0 0 0 13px #fff, 0 14px 0 6px #0a0e1a, 0 0 80px rgba(233, 185, 73, .8); animation: popIn .4s both; }
.buzzer.dim { opacity: .55; }
@keyframes arm { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.15); } }
.buzz-sub { min-height: 1.5em; color: var(--muted); text-align: center; font-size: 16px; } .buzz-sub.mine { color: var(--gold2); font-weight: 700; }
.choices { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: stretch; } .choices.many { grid-auto-rows: 1fr; }
.choice { border: 0; border-radius: 16px; background: var(--oc); color: #fff; font: 600 17px/1.2 var(--sans); padding: 14px 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: pointer; min-height: 96px; box-shadow: 0 5px 0 rgba(0, 0, 0, .3); text-align: center; overflow-wrap: anywhere; }
.choice:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0, 0, 0, .3); } .choice i { font-style: normal; font-size: 24px; opacity: .9; } .choice.gone { background: transparent; box-shadow: none; border: 2px dashed var(--line); }
.choices.mil { grid-template-columns: 1fr; align-content: center; gap: 12px; }
.choices.mil .choice { flex-direction: row; justify-content: flex-start; background: linear-gradient(180deg, #1c2a52, #101a36); border: 2px solid var(--gold); border-radius: 99px; min-height: 60px; padding: 10px 22px; text-align: left; box-shadow: none; }
.choices.mil .choice i { color: var(--gold); font-weight: 800; font-size: 19px; } .choices.mil .choice:active { background: var(--gold); color: #1b1505; } .choices.mil .choice.gone { border: 2px dashed var(--line); background: none; }
.answer-input { font-size: 22px !important; padding: 16px !important; } .answer-input.center { text-align: center; font-weight: 700; }
.order { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.order li { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.order .n { width: 28px; height: 28px; border-radius: 50%; background: var(--gold); color: #1b1505; font-weight: 800; display: grid; place-items: center; flex: none; } .order .t { flex: 1; font-size: 16px; }
.order .mv { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line2); background: var(--panel2); color: var(--text); font-size: 16px; } .order .mv:disabled { opacity: .3; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lock-in { background: var(--panel); border: 1px solid var(--line2); border-radius: 16px; padding: 16px 20px; display: flex; flex-direction: column; gap: 4px; width: 100%; } .lock-in small { color: var(--muted); } .lock-in b { font-size: 20px; overflow-wrap: anywhere; }
.result { display: flex; flex-direction: column; align-items: center; gap: 6px; animation: popIn .5s both; } .result .ico { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; font-size: 46px; font-weight: 800; background: var(--panel2); }
.result b { font-size: 30px; font-variant-numeric: tabular-nums; } .result.good .ico { background: var(--green); color: #06230f; } .result.good b { color: var(--green); } .result.bad .ico { background: var(--red); color: #2b0903; } .result.bad b { color: #ff9c8a; }

/* ============ Telekas ============ */
body.tv { overflow: hidden; }
.tv-enter { height: 100%; display: grid; place-items: center; text-align: center; } .tv-enter form { display: flex; flex-direction: column; gap: 16px; align-items: center; width: 300px; } .tv-enter img { width: 80px; }
.tv-root { position: fixed; inset: 0; font-size: min(1.3vw, 2.3vh); display: flex; flex-direction: column; overflow: hidden; }
.tv-bg { position: absolute; inset: -20%; z-index: -1; background:
  radial-gradient(40% 40% at 20% 15%, rgba(233, 185, 73, .13), transparent 70%), radial-gradient(45% 45% at 85% 80%, rgba(79, 179, 165, .12), transparent 70%),
  radial-gradient(60% 60% at 60% 30%, rgba(124, 156, 240, .08), transparent 70%), linear-gradient(160deg, #0b1020, #131c36 50%, #0b1020); animation: drift 40s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translate(-3%, -2%) rotate(0deg); } to { transform: translate(3%, 2%) rotate(3deg); } }
.tv-top { display: flex; justify-content: space-between; align-items: center; padding: 1.2em 2.4em .4em; color: var(--muted); font-size: 1.05em; flex: none; }
.tv-title { display: flex; align-items: center; gap: .6em; font-family: var(--serif); font-size: 1.25em; color: var(--text); } .tv-title img { width: 1.6em; }
.tv-join b { color: var(--text); } .tv-join .code { color: var(--gold2); font-size: 1.15em; }
.tv-stage { flex: 1; min-height: 0; display: flex; padding: 1em 2.4em 2em; position: relative; } .tv-stage > * { flex: 1; min-width: 0; min-height: 0; }
.tv-root h1 { font-size: 4.2em; } .tv-root .eyebrow { font-size: 1.2em; }
.tv-sound { position: absolute; bottom: 1em; left: 50%; transform: translateX(-50%); background: rgba(0, 0, 0, .6); color: #fff; border: 1px solid var(--line2); border-radius: 99px; padding: .5em 1.2em; font: inherit; font-size: 1em; z-index: 30; pointer-events: none; animation: hintOut 5s forwards; }
@keyframes hintOut { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }
.tv-lost { position: absolute; top: 1em; left: 50%; transform: translateX(-50%); background: #5a2a22; padding: .4em 1em; border-radius: 99px; z-index: 30; }

.tv-lobby { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 3em; align-items: center; }
.join-card { background: linear-gradient(180deg, rgba(32, 44, 72, .9), rgba(24, 34, 58, .9)); border: 1px solid var(--line2); border-radius: 1.6em; padding: 2.2em; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1em; box-shadow: var(--shadow); }
.join-url { font-size: 2.4em; font-weight: 700; overflow-wrap: anywhere; line-height: 1.1; }
.join-code { display: flex; gap: .35em; } .join-code span { font: 800 4.6em ui-monospace, Menlo, Consolas, monospace; background: var(--bg); border: .05em solid var(--gold); color: var(--gold2); border-radius: .16em; width: 1.25em; line-height: 1.5; }
.qr { width: 15em; height: 15em; background: #fff; border-radius: 1em; padding: .6em; }
.lobby-teams { align-self: stretch; display: flex; flex-direction: column; gap: 1.2em; min-height: 0; }
.lobby-teams h2 { font: 600 2.6em var(--serif); } .lobby-teams h2 small { font: 400 .45em var(--sans); color: var(--muted); margin-left: .6em; } .lobby-teams .wait { font-size: 1.5em; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15em, 1fr)); gap: 1em; align-content: start; overflow: hidden; } .team-grid.dense { grid-template-columns: repeat(auto-fill, minmax(11em, 1fr)); gap: .7em; }
.team-card { background: color-mix(in srgb, var(--c) 14%, var(--panel)); border: 1px solid color-mix(in srgb, var(--c) 50%, var(--line)); border-left: .5em solid var(--c); border-radius: 1em; padding: .8em 1em; }
.team-card b { font-size: 1.5em; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .team-grid.dense .team-card b { font-size: 1.15em; }
.members { display: flex; flex-wrap: wrap; gap: .35em; margin-top: .4em; } .members span { background: rgba(0, 0, 0, .28); border-radius: 99px; padding: .1em .7em; font-size: .95em; }

.tv-round { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 1em; }
.tv-round h1 { font-size: 6.5em; background: linear-gradient(180deg, #fff, var(--gold2)); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .1em; }
.mult { font-size: 1.6em; color: var(--gold2); border: 1px solid var(--gold); border-radius: 99px; padding: .2em 1em; }
.round-cats { display: flex; flex-wrap: wrap; justify-content: center; gap: 1em; margin-top: 1.4em; max-width: 90%; }
.round-cat { background: var(--panel); border: 1px solid var(--line2); border-radius: 1em; padding: .8em 1.4em; display: flex; flex-direction: column; } .round-cat b { font-size: 1.6em; } .round-cat small { color: var(--muted); }

.tv-board-wrap { display: flex; flex-direction: column; gap: .8em; }
.tv-board { flex: 1; display: grid; gap: .7em; min-height: 0; }
.b-cat { color: #fff; background: linear-gradient(180deg, #24345e, #1a2749); border: 1px solid var(--line2); border-bottom: .2em solid var(--gold); border-radius: .7em; display: grid; place-items: center; text-align: center; padding: .6em .4em; font: 700 1.45em/1.1 var(--sans); text-transform: uppercase; letter-spacing: .04em; overflow-wrap: anywhere; min-height: 3.2em; }
.b-cell { background: linear-gradient(180deg, #1d2b55, #152043); border: 1px solid #33467c; border-radius: .7em; display: grid; place-items: center; font: 700 3.3em var(--serif); color: var(--gold2); text-shadow: 0 .05em 0 rgba(0, 0, 0, .5); font-variant-numeric: tabular-nums; min-height: 0; }
.b-cell.used { background: rgba(21, 32, 67, .3); border-color: rgba(51, 70, 124, .3); }
.b-ctrl { text-align: center; font-size: 1.4em; color: var(--muted); } .b-ctrl b { color: var(--text); }

.tv-strip { flex: none; display: flex; gap: .7em; padding: 0 2.4em 1.4em; justify-content: center; }
.strip-team { flex: 0 1 16em; min-width: 0; background: rgba(24, 34, 58, .9); border: 1px solid var(--line); border-top: .3em solid var(--c); border-radius: .8em; padding: .45em .9em; display: flex; flex-direction: column; position: relative; transition: transform .25s, box-shadow .25s, opacity .25s; }
.strip-team .nm { color: var(--muted); font-size: .95em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .strip-team b { font-size: 1.7em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tv-strip.dense .strip-team b { font-size: 1.3em; } .tv-strip.dense .strip-team .nm { font-size: .8em; }
.strip-team.hot { transform: translateY(-.5em) scale(1.06); box-shadow: 0 0 2em color-mix(in srgb, var(--c) 70%, transparent); border-color: var(--c); } .strip-team.out { opacity: .4; }
.strip-team em { position: absolute; right: .6em; top: -.9em; font-style: normal; font-weight: 800; font-size: 1.2em; padding: 0 .5em; border-radius: 99px; animation: popIn .5s 1.3s both; } .strip-team em.up { background: var(--green); color: #06230f; } .strip-team em.down { background: var(--red); color: #2b0903; }
.strip-team .tick { position: absolute; right: .6em; bottom: .5em; font-style: normal; color: var(--green); font-weight: 800; font-size: 1.3em; }

.tv-q { display: flex; flex-direction: column; gap: 1em; }
.tv-q.wager { align-items: center; justify-content: center; text-align: center; } .tv-q.wager h1 { font-size: 6em; } .tv-q.wager p { font-size: 1.8em; }
.q-head { display: flex; justify-content: space-between; align-items: center; flex: none; }
.q-cat { font-size: 1.5em; text-transform: uppercase; letter-spacing: .12em; color: var(--gold); font-weight: 700; }
.q-val { font: 700 2.6em var(--serif); color: var(--gold2); background: var(--bg); border: 1px solid var(--gold); border-radius: .3em; padding: 0 .5em; animation: popIn .4s both; font-variant-numeric: tabular-nums; }
.q-val s { font-size: .5em; color: var(--muted); margin-left: .5em; } .q-val.cut { color: #ffb9ab; border-color: var(--red); }
.tv-q .timer.big .timer-bar { height: .8em; } .tv-q .timer.big .timer-num { font-size: 2.2em; min-width: 2.2ch; }
.q-main { flex: 1; min-height: 0; display: flex; gap: 2.4em; align-items: center; justify-content: center; }
.q-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1em; justify-content: safe center; max-height: 100%; }
.tv-q:not(.has-visual) .q-side { align-items: center; text-align: center; max-width: 88%; } .tv-q:not(.has-visual) .q-side > * { width: 100%; }
.q-media { flex: 1.1; min-width: 0; height: 100%; display: flex; align-items: center; justify-content: center; }
.q-media.audio { flex: none; position: absolute; right: 2.4em; top: 5.2em; height: auto; }
.q-media img, .q-media video { max-width: 100%; max-height: 100%; border-radius: 1em; box-shadow: var(--shadow); object-fit: contain; }
.q-media .mosaic { max-height: 100%; } .q-media .mosaic img { max-height: 66vh; border-radius: 0; box-shadow: none; }
.tv-q .q-text { font: 500 3.4em/1.2 var(--serif); text-wrap: balance; } .tv-q.has-visual .q-text { font-size: 2.5em; } .tv-q .q-text.long, .tv-q.has-extra .q-text { font-size: 2.5em; } .tv-q.has-visual.has-extra .q-text { font-size: 2em; } .tv-q .q-text.xlong, .tv-q.has-visual .q-text.long { font-size: 1.9em; }
.tv-q .q-hints li { font-size: 1.6em; background: rgba(233, 185, 73, .12); border: 1px solid #7a6428; border-radius: .6em; padding: .4em .8em; text-align: left; }
.audio-viz { display: flex; align-items: center; gap: 1em; background: var(--panel); border: 1px solid var(--line2); border-radius: 99px; padding: .6em 1.4em; font-size: 1.3em; color: var(--muted); }
.audio-viz .bars { display: flex; gap: .22em; align-items: center; height: 2.4em; } .audio-viz .bars i { width: .28em; height: 15%; background: var(--line2); border-radius: 99px; }
.audio-viz.on { border-color: var(--gold); color: var(--gold2); } .audio-viz.on .bars i { background: var(--gold); animation: eq 1s ease-in-out infinite alternate; }
@keyframes eq { from { height: 12%; } to { height: 100%; } }

.opts { display: grid; grid-template-columns: 1fr 1fr; gap: .9em; }
.opt { color: #fff; background: var(--oc); border-radius: .8em; padding: .7em 1em; font-size: 1.9em; font-weight: 600; display: flex; align-items: center; gap: .7em; text-align: left; position: relative; overflow: hidden; transition: opacity .5s, filter .5s, transform .5s; box-shadow: 0 .18em 0 rgba(0, 0, 0, .3); min-height: 2.6em; }
.opt i { font-style: normal; opacity: .9; flex: none; } .opt span { flex: 1; overflow-wrap: anywhere; line-height: 1.15; } .opts.many .opt { font-size: 1.5em; }
.opt.gone { opacity: .12; filter: grayscale(1); } .opt.wrong { opacity: .32; filter: grayscale(.7); } .opt.right { transform: scale(1.03); box-shadow: 0 0 0 .14em #fff, 0 0 1.4em rgba(255, 255, 255, .5); z-index: 1; }
.opt em { font-style: normal; font-size: .8em; font-variant-numeric: tabular-nums; background: rgba(0, 0, 0, .35); border-radius: .4em; padding: 0 .5em; position: relative; z-index: 1; }
.opt em u { position: absolute; left: 0; bottom: 0; height: .14em; background: #fff; border-radius: 99px; }
.opts.mil { gap: .9em 1.6em; }
.opts.mil .opt { background: linear-gradient(180deg, #1c2a55, #0f1936); border: .09em solid var(--gold); box-shadow: none; clip-path: polygon(1.1em 0, calc(100% - 1.1em) 0, 100% 50%, calc(100% - 1.1em) 100%, 1.1em 100%, 0 50%); padding: .55em 1.8em; }
.opts.mil .opt i { color: var(--gold); font-weight: 800; } .opts.mil .opt.right { background: linear-gradient(180deg, #2f9a5e, #1c6b3e); transform: none; animation: blink .35s 4 alternate; } .opts.mil .opt.wrong { opacity: .4; }
@keyframes blink { from { filter: brightness(1); } to { filter: brightness(1.7); } }
.order-tv { list-style: none; margin: 0; padding: 0; display: grid; gap: .5em; } .order-tv.cols { grid-template-columns: 1fr 1fr; }
.order-tv li { background: var(--panel); border: 1px solid var(--line2); border-radius: .6em; padding: .3em .9em; font-size: 1.55em; text-align: left; display: flex; gap: .7em; align-items: center; }
.order-tv li i { font-style: normal; width: 1.5em; height: 1.5em; border-radius: 50%; background: var(--gold); color: #1b1505; font-weight: 800; display: grid; place-items: center; font-size: .8em; flex: none; } .order-tv.done li { border-color: var(--green); }
.answered { display: flex; align-items: center; justify-content: center; gap: 1em; font-size: 1.4em; color: var(--muted); } .answered b { font-size: 1.9em; color: var(--text); font-variant-numeric: tabular-nums; } .answered b small { color: var(--muted); font-size: .6em; }
.ans-dots { display: flex; gap: .4em; flex-wrap: wrap; } .ans-dots i { width: 1em; height: 1em; border-radius: 50%; border: .14em solid var(--c); opacity: .5; transition: all .3s; } .ans-dots i.on { background: var(--c); opacity: 1; transform: scale(1.25); }
.reveal { display: flex; flex-direction: column; gap: 1em; align-items: inherit; }
.ans-banner { background: linear-gradient(180deg, #2a8a56, #1b663d); border: 1px solid #7fe0a6; border-radius: .9em; padding: .5em 1.2em; display: inline-flex; flex-direction: column; animation: popIn .6s both; box-shadow: 0 0 2.4em rgba(99, 191, 134, .35); align-self: center; max-width: 100%; }
.tv-q.has-visual .ans-banner { align-self: flex-start; } .ans-banner small { text-transform: uppercase; letter-spacing: .14em; font-size: .95em; opacity: .85; } .ans-banner b { font: 700 2.8em/1.15 var(--serif); overflow-wrap: anywhere; }
.ans-img { max-height: 30vh; border-radius: 1em; align-self: center; }
.res-chips { display: flex; flex-wrap: wrap; gap: .6em; justify-content: center; } .tv-q.has-visual .res-chips { justify-content: flex-start; }
.res-chip { display: flex; align-items: center; gap: .6em; background: var(--panel); border: 1px solid var(--line2); border-left: .4em solid var(--c); border-radius: .6em; padding: .3em .8em; font-size: 1.3em; }
.res-chips.dense .res-chip { font-size: 1em; } .res-chip span { color: var(--muted); max-width: 14em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .res-chip em { font-style: normal; font-weight: 800; font-variant-numeric: tabular-nums; }
.res-chip.good em { color: var(--green); } .res-chip.bad em { color: #ff9c8a; } .res-chip.none { opacity: .6; }

.survey { display: flex; flex-direction: column; gap: 1em; align-items: center; }
.sv-slots { display: grid; gap: .5em; width: min(100%, 34em); font-size: 1.15em; } .sv-slots.two { grid-template-columns: 1fr 1fr; width: 100%; grid-auto-flow: column; }
.sv-slot { height: 2.9em; perspective: 60em; position: relative; }
.sv-slot > div { position: absolute; inset: 0; border-radius: .6em; display: flex; align-items: center; padding: 0 1em; backface-visibility: hidden; transition: transform .6s cubic-bezier(.4, 0, .2, 1); }
.sv-slot .front { background: linear-gradient(180deg, #24345e, #172244); border: 1px solid var(--line2); justify-content: center; }
.sv-slot .front i { font-style: normal; font: 700 1.6em var(--serif); width: 1.7em; height: 1.7em; border-radius: 50%; background: var(--bg); border: 1px solid var(--gold); color: var(--gold2); display: grid; place-items: center; }
.sv-slot .back { background: linear-gradient(180deg, #e9b949, #c9982f); color: #1b1505; transform: rotateX(180deg); gap: .6em; font-weight: 700; font-size: 1.4em; }
.sv-slot .back span { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .sv-slot .back b { background: #1b1505; color: var(--gold2); border-radius: .3em; padding: 0 .5em; font-variant-numeric: tabular-nums; }
.sv-slot.open .front { transform: rotateX(-180deg); } .sv-slot.open .back { transform: none; } .sv-slot.late .back { background: var(--panel2); color: var(--muted); }
.sv-strikes { display: flex; gap: .5em; } .sv-strikes span { color: var(--red); font-weight: 900; font-size: 1.8em; line-height: 1; border: .1em solid var(--red); border-radius: .2em; padding: 0 .2em; }

.spot { position: absolute; inset: 0; z-index: 20; pointer-events: none; }
.spot-flash { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle, color-mix(in srgb, var(--c) 40%, rgba(8, 12, 24, .85)), rgba(8, 12, 24, .93)); animation: spotOut 2.2s forwards; overflow: hidden; }
@keyframes spotOut { 0% { opacity: 0; } 8% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
.spot-rays { position: absolute; width: 200vmax; height: 200vmax; background: repeating-conic-gradient(color-mix(in srgb, var(--c) 30%, transparent) 0 8deg, transparent 8deg 20deg); animation: spin 14s linear infinite; opacity: .5; }
@keyframes spin { to { transform: rotate(360deg); } }
.spot-card { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .3em; animation: slam .55s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes slam { from { transform: scale(2.6); opacity: 0; } to { transform: none; opacity: 1; } }
.spot-card small { text-transform: uppercase; letter-spacing: .3em; font-size: 1.6em; color: #fff; opacity: .85; }
.spot-card b { font: 700 8em/1 var(--serif); color: #fff; text-shadow: 0 .06em 0 rgba(0, 0, 0, .35), 0 0 .8em var(--c); padding: 0 .3em; overflow-wrap: anywhere; }
.spot-card span { font-size: 2.2em; } .spot-card em { font-style: normal; font: 700 2.2em ui-monospace, Menlo, monospace; background: #fff; color: #111; border-radius: 99px; padding: .05em .7em; margin-top: .3em; }
.spot-banner { position: absolute; left: 50%; bottom: 7.4em; transform: translateX(-50%); background: var(--c); color: #10131c; font-size: 1.9em; padding: .3em 1.2em; border-radius: 99px; display: flex; align-items: center; gap: .5em; white-space: nowrap; box-shadow: 0 0 2em color-mix(in srgb, var(--c) 60%, transparent); animation: bannerIn .5s 1.9s both; }
@keyframes bannerIn { from { transform: translate(-50%, 2em); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }
.spot-banner i { width: .6em; height: .6em; border-radius: 50%; background: #10131c; animation: pulse .5s infinite alternate; } .spot-banner em { font-style: normal; font: 700 .8em ui-monospace, Menlo, monospace; background: rgba(0, 0, 0, .2); border-radius: 99px; padding: 0 .6em; }
.fx { position: absolute; inset: 0; z-index: 25; display: grid; place-items: center; pointer-events: none; animation: fxFade 2.2s forwards; }
.fx.correct { background: radial-gradient(circle, rgba(36, 130, 76, .97), rgba(10, 40, 24, .97)); } .fx.wrong { background: radial-gradient(circle, rgba(150, 50, 36, .97), rgba(46, 12, 8, .97)); } .fx.strike { background: rgba(30, 6, 4, .75); animation-duration: 1.4s; }
@keyframes fxFade { 0% { opacity: 0; } 10% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }
.fx-card { text-align: center; display: flex; flex-direction: column; align-items: center; animation: slam .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.fx-card .ico { width: 2.2em; height: 2.2em; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 5em; font-weight: 900; } .fx.correct .ico { color: #1b7a47; } .fx.wrong .ico { color: #b03a28; animation: shake .5s .2s; }
.fx-card b { font: 700 6em var(--serif); } .fx-card small { font-size: 2.4em; }
@keyframes shake { 20%, 60% { transform: translateX(-.12em); } 40%, 80% { transform: translateX(.12em); } }
.fx .xs { display: flex; gap: 2em; } .fx .xs span { font-size: 16em; font-weight: 900; color: var(--red); border: .08em solid var(--red); border-radius: .12em; line-height: 1; padding: 0 .12em; background: rgba(0, 0, 0, .4); animation: slam .4s cubic-bezier(.2, 1.4, .4, 1) both; }

.tv-lb { display: flex; flex-direction: column; gap: 1.2em; align-items: center; } .tv-lb h1 { flex: none; }
.lb-rows { position: relative; width: min(100%, 70em); }
.lb-row { position: absolute; left: 0; right: 0; top: 0; height: calc(var(--rh) - .7vh); display: flex; align-items: center; gap: 1em; transition: transform 1.1s cubic-bezier(.3, .1, .2, 1); animation: fadeIn .5s var(--d) both; font-size: calc(var(--rh) * .2); }
@keyframes fadeIn { from { opacity: 0; } }
.lb-row .pl { width: 1.6em; text-align: center; font: 700 2.2em var(--serif); color: var(--muted); } .lb-row.lead .pl { color: var(--gold2); }
.lb-row .bar { flex: 1; height: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: .7em; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: 0 1em; min-width: 0; }
.lb-row .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 55%, transparent), color-mix(in srgb, var(--c) 22%, transparent)); border-right: .25em solid var(--c); transition: width 1.2s cubic-bezier(.3, .1, .2, 1); min-width: .5em; }
.lb-row .bar b { position: relative; font-size: 2em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.15; } .lb-row .bar small { position: relative; color: var(--muted); font-size: 1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-row.lead .bar { border-color: var(--gold); box-shadow: 0 0 1.6em rgba(233, 185, 73, .25); }
.lb-row .sc { width: 4.2em; text-align: right; font: 700 2.4em var(--serif); font-variant-numeric: tabular-nums; color: var(--gold2); }
.lb-row em { font-style: normal; font-weight: 800; font-size: 1.5em; border-radius: 99px; padding: 0 .6em; } .lb-row em.up { background: var(--green); color: #06230f; } .lb-row em.down { background: var(--red); color: #2b0903; }

.tv-final { display: flex; flex-direction: column; align-items: center; gap: .6em; text-align: center; position: relative; }
.podium { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 1.4em; width: 100%; min-height: 0; }
.pod { width: 22em; min-width: 0; display: flex; flex-direction: column; align-items: center; opacity: 0; transform: translateY(6em); transition: all .9s cubic-bezier(.2, 1.1, .3, 1); } .pod.on { opacity: 1; transform: none; }
.pod-who { display: flex; flex-direction: column; margin-bottom: .6em; width: 100%; } .pod-who b { font: 700 2.5em/1.1 var(--serif); overflow-wrap: break-word; text-wrap: balance; } .pod-who small { color: var(--muted); font-size: 1.05em; } .pod-who span { font-size: 1.8em; color: var(--gold2); font-weight: 700; font-variant-numeric: tabular-nums; }
.pod-block { width: 100%; border-radius: 1em 1em 0 0; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 75%, #fff 5%), color-mix(in srgb, var(--c) 35%, var(--bg))); display: grid; place-items: start center; padding-top: .2em; box-shadow: inset 0 .3em 0 rgba(255, 255, 255, .25); }
.pod-block i { font: 800 4.4em/1.3 var(--serif); font-style: normal; color: rgba(0, 0, 0, .45); } .pod.p1 .pod-block { height: 24vh; } .pod.p2 .pod-block { height: 17vh; } .pod.p3 .pod-block { height: 11vh; }
.final-rest { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5em 1.6em; justify-content: center; opacity: 0; transition: opacity 1s; font-size: 1.3em; flex: none; } .final-rest.on { opacity: 1; }
.final-rest li { display: flex; gap: .4em; align-items: center; } .final-rest span { color: var(--muted); } .final-rest em { font-style: normal; color: var(--gold2); font-variant-numeric: tabular-nums; }
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; } .confetti i { position: absolute; top: -5%; animation: fall linear infinite; border-radius: .1em; }
@keyframes fall { 0% { transform: translateY(0) rotate(var(--r)); } 100% { transform: translateY(110vh) rotate(calc(var(--r) + 720deg)); } }

/* ============ Mängujuht ============ */
.host { min-height: 100%; display: flex; flex-direction: column; }
.h-top { display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: var(--bg2); border-bottom: 1px solid var(--line); flex-wrap: wrap; position: sticky; top: 0; z-index: 5; }
.h-top .back { text-decoration: none; font-size: 20px; } .h-title { display: flex; flex-direction: column; line-height: 1.2; flex: 1; min-width: 160px; } .h-title small { color: var(--muted); }
.h-links { display: flex; gap: 6px; flex-wrap: wrap; } .conn { font-size: 12px; color: #ff9c8a; } .conn.ok { color: var(--green); }
.h-grid { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 16px; padding: 16px; align-items: start; }
.h-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.h-teams { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; position: sticky; top: 120px; max-height: calc(100vh - 136px); overflow: auto; }
.btn.next { font-size: 18px; padding: 16px; border-radius: 12px; width: 100%; box-shadow: 0 4px 0 #8a6a1c; } .btn.next:active { box-shadow: 0 1px 0 #8a6a1c; }
.h-board { display: grid; gap: 4px; } .hb-col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hb-cat { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 2px; }
.hb-cell { background: #1d2b55; border: 1px solid #33467c; border-radius: 6px; color: var(--gold2); font: 700 14px var(--sans); padding: 2px; height: 40px; justify-content: center; cursor: pointer; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.hb-cell small { color: var(--muted); font-size: 10px; } .hb-cell:hover { border-color: var(--gold); } .hb-cell.used { opacity: .3; } .hb-cell.cur { background: var(--gold); color: #1b1505; opacity: 1; }
.h-list { display: flex; flex-direction: column; gap: 4px; } .hl-cat { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--gold); margin: 10px 0 4px; }
.hl-q { display: grid; grid-template-columns: 22px 1fr; gap: 0 6px; text-align: left; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; width: 100%; margin-bottom: 4px; }
.hl-q .n { color: var(--muted); grid-row: span 2; } .hl-q .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .hl-q small { color: var(--muted); font-size: 11px; }
.hl-q:hover { border-color: var(--line2); } .hl-q.used { opacity: .4; } .hl-q.cur { border-color: var(--gold); background: rgba(233, 185, 73, .12); opacity: 1; }
.qp { display: flex; flex-direction: column; gap: 14px; } .qp-head { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; } .qp-head .val { margin-left: auto; font: 700 22px var(--serif); color: var(--gold2); } .qp-head .val s { font-size: 14px; color: var(--muted); }
.qp-text { font: 500 24px/1.3 var(--serif); white-space: pre-wrap; }
.qp-answer { background: rgba(99, 191, 134, .1); border: 1px solid #2f6a48; border-radius: 10px; padding: 10px 14px; } .qp-answer small, .qp-notes small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 2px; } .qp-answer b { font-size: 20px; color: #b6f0cc; }
.qp-notes { background: rgba(124, 156, 240, .08); border: 1px solid #3b4d86; border-radius: 10px; padding: 10px 14px; white-space: pre-wrap; }
.qp-opts { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; } .qp-opts.plain { grid-template-columns: 1fr; }
.qp-opts li { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; display: flex; gap: 8px; } .qp-opts i { font-style: normal; font-weight: 800; color: var(--gold); } .qp-opts li.ok { border-color: var(--green); color: #b6f0cc; } .qp-opts li.gone { opacity: .35; text-decoration: line-through; }
.box { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--bg2); } .box h4 small { font-weight: 400; }
.box.buzz { flex-direction: row; align-items: center; flex-wrap: wrap; border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 14%, var(--bg2)); animation: popIn .3s both; }
.box.buzz > div { flex: 1; display: flex; flex-direction: column; min-width: 140px; } .box.buzz b { font-size: 26px; line-height: 1.1; } .box.buzz small, .box.buzz span { color: var(--muted); font-size: 13px; }
.sv-host { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; } .sv-host .btn { justify-content: space-between; white-space: normal; text-align: left; }
.btn.hint { justify-content: space-between; white-space: normal; text-align: left; width: 100%; } .btn.hint b { color: var(--gold2); white-space: nowrap; }
.thumb { max-height: 150px; border-radius: 8px; align-self: flex-start; } .qp-foot { border-top: 1px solid var(--line); padding-top: 12px; }
.lobby-row { display: flex; gap: 18px; margin-top: 14px; flex-wrap: wrap; } .lobby-row .qr { width: 150px; height: 150px; background: #fff; border-radius: 10px; padding: 6px; }
.step { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; } .step input { width: 70px; padding: 3px 6px; }
.ht { border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 8px; background: var(--bg2); } .ht.hot { border-color: var(--c); box-shadow: 0 0 0 2px var(--c); } .ht.ctrl .ht-name b::after { content: ' ◂ valib'; color: var(--gold); font-weight: 400; font-size: 11px; }
.ht-row { display: flex; align-items: center; gap: 6px; padding: 5px 6px; } .ht-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--text); font: inherit; cursor: pointer; text-align: left; padding: 0; }
.ht-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ht-name small { color: var(--muted); font-size: 11px; } .ht-score { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 4ch; text-align: right; }
.ht-row em { font-style: normal; font-size: 12px; font-weight: 700; } .ht-row em.up { color: var(--green); } .ht-row em.down { color: #ff9c8a; }
.ht-more { border-top: 1px solid var(--line); padding: 8px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; } .mem { color: var(--muted); } .mem.on { color: var(--text); } .mem.on::first-letter { color: var(--green); }
@media (max-width: 900px) { .h-grid { grid-template-columns: 1fr; } .h-teams { position: static; max-height: none; } }
.h-steps { background: var(--bg2); border-bottom: 1px solid var(--line); padding: 8px 16px; display: flex; flex-direction: column; gap: 6px; }
.steps-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; } .steps-row > i { font-style: normal; color: var(--line2); } .steps-row.sub { padding-left: 4px; font-size: 13px; }
.step { background: var(--panel); border: 1px solid var(--line); color: var(--muted); font: 600 13px var(--sans); padding: 6px 12px; border-radius: 99px; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
.step small { font-weight: 400; opacity: .7; } .step:hover:not(:disabled) { color: var(--text); border-color: var(--line2); } .step:disabled { opacity: .4; cursor: default; }
.step.on { background: var(--gold); border-color: var(--gold); color: #1b1505; } .step.round { border-radius: 8px; } .step.done:not(.on) { text-decoration: line-through; }
.h-now { font-size: 13px; color: var(--muted); } .h-now b { color: var(--gold2); }
.h-main .h-board { gap: 8px; } .h-main .hb-col { gap: 8px; } .h-main .hb-cat { font-size: 13px; padding: 6px 2px; color: var(--gold); }
.h-main .hb-cell { height: 62px; font-size: 20px; border-radius: 10px; } .h-main .hb-cell b { font-family: var(--serif); } .h-main .hb-cell small { font-size: 11px; } .hb-cell.cur small { color: #1b1505; }
.h-rounds { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.h-rounds li { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; } .h-rounds small { color: var(--muted); }
.give { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.game-desc { font-size: 1.8em; color: var(--muted); max-width: 30em; }
.spot-banner.now { animation-delay: .2s; } .spot-banner.now em { font-family: var(--sans); text-transform: uppercase; letter-spacing: .1em; font-size: .6em; }

/* ============ Haldus ============ */
.adm { display: grid; grid-template-columns: 220px 1fr; min-height: 100%; }
.adm-nav { background: var(--bg2); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.adm-brand { display: flex; align-items: center; gap: 10px; font: 600 20px var(--serif); color: var(--text) !important; padding: 4px 8px 16px; } .adm-brand img { width: 34px; }
.adm-nav > a { color: var(--muted); text-decoration: none; padding: 9px 10px; border-radius: 8px; font-weight: 600; display: flex; gap: 10px; align-items: center; } .adm-nav > a i { font-style: normal; width: 18px; text-align: center; opacity: .8; }
.adm-nav > a:hover { background: var(--panel); color: var(--text); } .adm-nav > a.on { background: rgba(233, 185, 73, .12); color: var(--gold2); }
.adm-me { margin-top: auto; padding: 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; font-size: 13px; align-items: flex-start; } .adm-me small { color: var(--muted); margin-bottom: 6px; }
.adm-main { padding: 26px 30px 60px; min-width: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; } .card.game { display: flex; flex-direction: column; gap: 8px; } .game-types { display: flex; gap: 6px; flex-wrap: wrap; }
.empty-state { text-align: center; padding: 40px; display: flex; flex-direction: column; gap: 8px; }
.tpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tpl { text-align: left; background: var(--bg2); border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--text); font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 3px; } .tpl small { color: var(--muted); line-height: 1.3; } .tpl:hover { border-color: var(--line2); } .tpl.on { border-color: var(--gold); background: rgba(233, 185, 73, .1); }
.results th small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.ed { display: flex; flex-direction: column; gap: 16px; } .ed-top { display: flex; align-items: center; gap: 12px; }
.title-input { flex: 1; font: 600 24px var(--serif); background: transparent; border-color: transparent; padding: 4px 8px; } .title-input:hover { border-color: var(--line); }
.ed-settings, .ed-round { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; } .ed-settings .field.wide { flex: 1; min-width: 220px; } .ed-round .field { width: 240px; } .ed-round { align-items: flex-start; } .ed-round > .row { margin-top: 21px; }
.ed-cats { display: flex; gap: 12px; align-items: flex-start; overflow-x: auto; padding-bottom: 12px; }
.ed-cat { flex: 0 0 250px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.ed-cat.add { border-style: dashed; background: transparent; color: var(--muted); font: 600 14px var(--sans); cursor: pointer; padding: 22px; flex-basis: 140px; } .ed-cat.add:hover { color: var(--gold); border-color: var(--gold); }
.ed-cat-head { display: flex; gap: 2px; align-items: center; } .ed-cat-head input { font-weight: 700; padding: 5px 8px; }
.ed-q { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 8px; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; cursor: pointer; align-items: center; }
.ed-q:hover { border-color: var(--line2); } .ed-q.on { border-color: var(--gold); background: rgba(233, 185, 73, .1); } .ed-q.empty { border-style: dashed; }
.ed-q > b { color: var(--gold2); font-variant-numeric: tabular-nums; } .ed-q .t { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ed-q .t i { color: var(--muted); }
.ed-q .tags { grid-column: 1 / 3; display: flex; gap: 4px; flex-wrap: wrap; } .ed-q .tags em { font-style: normal; font-size: 11px; color: var(--muted); background: var(--panel2); border-radius: 4px; padding: 0 5px; }
.ed-q .mv { grid-column: 3; grid-row: 1 / 3; display: flex; flex-direction: column; } .ed-q .mv .icon { height: 18px; font-size: 10px; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(600px, 100vw); background: var(--panel); border-left: 1px solid var(--line2); box-shadow: -20px 0 50px rgba(0, 0, 0, .45); z-index: 20; display: flex; flex-direction: column; animation: drawerIn .2s both; }
@keyframes drawerIn { from { transform: translateX(40px); opacity: 0; } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.drawer-body { flex: 1; overflow: auto; padding: 4px 18px 40px; } .drawer section { padding: 16px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; } .drawer section:last-child { border: 0; }
.drawer section h4 { text-transform: uppercase; letter-spacing: .1em; font-size: 12px; color: var(--gold); }
.file-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .preview { max-height: 200px; border-radius: 8px; align-self: flex-start; } .mini-thumb { height: 40px; border-radius: 6px; }
.list { display: flex; flex-direction: column; gap: 6px; } .list-row { display: flex; gap: 6px; align-items: center; } .list-row .let { width: 22px; text-align: center; font-weight: 800; color: var(--gold); flex: none; } .list-row .pts { width: 80px; flex: none; }
.ok-toggle { width: 34px; height: 34px; flex: none; border: 1px solid var(--line); border-radius: 8px; display: grid; place-items: center; cursor: pointer; color: var(--muted); font-weight: 800; } .ok-toggle input { display: none; } .ok-toggle.on { background: #1f5a3a; border-color: var(--green); color: #d9ffe8; }
.clip { display: flex; flex-direction: column; gap: 8px; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; } .clip video { max-height: 220px; border-radius: 8px; background: #000; align-self: flex-start; max-width: 100%; }
.wave { width: 100%; height: 90px; background: #0a0f1c; border-radius: 8px; cursor: crosshair; touch-action: none; } .wave.thin { height: 34px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.media-card { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; } .media-card.pick { cursor: pointer; } .media-card.pick:hover { border-color: var(--gold); }
.mc-prev { height: 120px; display: grid; place-items: center; background: #0a0f1c; } .mc-prev img, .mc-prev video { max-height: 120px; max-width: 100%; } .mc-prev audio { width: 92%; height: 36px; }
.mc-info { display: flex; align-items: center; gap: 6px; padding: 6px 8px; font-size: 12px; } .mc-info b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; } .mc-info small { color: var(--muted); }
@media (max-width: 800px) { .adm { grid-template-columns: 1fr; } .adm-nav { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; } .adm-brand { padding: 4px 8px; } .adm-me { margin: 0 0 0 auto; border: 0; flex-direction: row; gap: 10px; align-items: center; } .adm-me small { margin: 0; } .adm-main { padding: 16px; } .grid4 { grid-template-columns: 1fr 1fr; } }

/* mosaiigi järgmise ruudu taimerijoon */
.mosaic-wrap { display: flex; flex-direction: column; gap: .7em; align-items: stretch; max-height: 100%; }
.q-media .mosaic-wrap .mosaic img { max-height: 60vh; }
.mosaic-next { display: flex; align-items: center; gap: .8em; font-size: 1.1em; color: var(--muted); }
.mosaic-next .bar { flex: 1; height: .5em; border-radius: 99px; background: var(--panel2); overflow: hidden; }
.mosaic-next .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--gold)); transform-origin: left; }
.mosaic-next.paused { opacity: .5; } .mosaic-next span { white-space: nowrap; }

.open-in { flex: none; } .res-chip small { color: var(--muted); font-size: .7em; }

/* paus */
.tv-paused { position: absolute; top: 1em; left: 50%; transform: translateX(-50%); background: var(--gold); color: #1b1505; font-weight: 800; font-size: 1.4em; padding: .2em 1.2em; border-radius: 99px; z-index: 30; box-shadow: var(--shadow); }
.p-banner.pause { background: var(--gold); color: #1b1505; font-weight: 700; }
.paused-note { border-color: var(--gold); background: rgba(233, 185, 73, .1); padding: 10px 14px; }

/* ============ Redaktor: kaardid ja küsimuse aken ============ */
.tab.drop-on { background: rgba(233, 185, 73, .2); color: var(--gold2); border-radius: 8px 8px 0 0; outline: 2px dashed var(--gold); }
.tab[draggable=true] { cursor: grab; } .tab small { background: var(--panel2); border-radius: 99px; padding: 0 7px; font-size: 11px; opacity: 1; }
.ed-round { align-items: flex-start; } .ed-round-opts { padding-top: 21px; flex: 1; min-width: 260px; } .ed-round details summary, .q-more summary { cursor: pointer; color: var(--gold); font-weight: 600; font-size: 13.5px; }
.ed-round details[open] { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; } .row.top { align-items: flex-start; gap: 14px; margin-top: 10px; } .row.top .btn { margin-top: 21px; }
.q-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; align-items: stretch; }
.q-cols { display: flex; gap: 12px; align-items: flex-start; overflow-x: auto; padding-bottom: 12px; }
.q-col { flex: 0 0 260px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.q-col.add { border-style: dashed; background: transparent; color: var(--muted); font: 600 14px var(--sans); cursor: pointer; padding: 22px; flex-basis: 140px; align-items: center; } .q-col.add:hover { color: var(--gold); border-color: var(--gold); }
.q-col-head { display: flex; gap: 2px; align-items: center; } .q-col-head input { font-weight: 700; padding: 5px 8px; }
.q-card { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; min-height: 104px; text-align: left; color: var(--text); font: inherit; position: relative; transition: border-color .12s, transform .12s; }
.q-grid .q-card { background: var(--panel); }
.q-card:hover { border-color: var(--gold); transform: translateY(-1px); } .q-card[draggable=true] { cursor: grab; } .q-card[draggable=true]:active { cursor: grabbing; }
.q-card.drop-before::before { content: ''; position: absolute; left: -7px; top: 0; bottom: 0; width: 3px; border-radius: 3px; background: var(--gold); } .q-col .q-card.drop-before::before { left: 0; right: 0; top: -6px; bottom: auto; width: auto; height: 3px; }
.q-card.add { border-style: dashed; background: transparent; color: var(--gold); font-weight: 600; align-items: center; justify-content: center; } .q-col .q-card.add { min-height: 48px; }
.qc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; } .qc-top b { color: var(--gold2); font-variant-numeric: tabular-nums; }
.qc-type { color: var(--muted); font-weight: 600; } .qc-text { font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1; } .qc-text.empty { color: var(--muted); font-style: italic; }
.qc-tags { display: flex; gap: 4px; flex-wrap: wrap; } .qc-tags em { font-style: normal; font-size: 11px; color: var(--muted); background: var(--panel2); border-radius: 4px; padding: 0 6px; } .qc-tags em.topic { color: var(--gold2); background: rgba(233, 185, 73, .14); }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.type-card { background: var(--bg2); border: 1.5px solid var(--line); border-radius: 12px; padding: 14px; text-align: left; color: var(--text); font: inherit; cursor: pointer; display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; }
.type-card i { font-style: normal; font-size: 26px; grid-row: span 2; width: 44px; height: 44px; border-radius: 10px; background: var(--panel2); display: grid; place-items: center; color: var(--gold2); }
.type-card b { font-size: 15px; } .type-card small { color: var(--muted); line-height: 1.3; } .type-card:hover, .type-card.on { border-color: var(--gold); background: rgba(233, 185, 73, .08); }
.modal.q-modal { width: min(860px, 100%); padding: 0; gap: 0; max-height: 94vh; overflow: hidden; }
.q-modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.q-type { display: flex; align-items: center; gap: 12px; } .q-type i { font-style: normal; font-size: 22px; width: 40px; height: 40px; border-radius: 10px; background: var(--panel2); display: grid; place-items: center; color: var(--gold2); }
.q-type div { display: flex; flex-direction: column; line-height: 1.25; } .q-type small { color: var(--muted); }
.q-modal-body { overflow: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 16px; } .q-modal-body section { display: flex; flex-direction: column; gap: 10px; }
.q-modal-body section h4 { text-transform: uppercase; letter-spacing: .1em; font-size: 12px; color: var(--gold); } .q-modal-body textarea { font-size: 16px; }
.q-answer { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.answer-ok input, .opt-ok input:not(.pts) { border-color: #2f6a48; background: rgba(99, 191, 134, .1); } .answer-ok > span { color: var(--green); }
.opt-ok .let { color: var(--green); } .opt-no .let { color: #ff9c8a; } .opt-no input { border-color: #5a3a35; }
.q-more { border-top: 1px solid var(--line); padding-top: 12px; } .q-more[open] summary { margin-bottom: 12px; }
.q-modal-foot { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--bg2); }

/* pildi kärpimine */
.crop-modal { width: min(1000px, 100%); }
.crop-stage { display: grid; place-items: center; background: #0a0f1c; border-radius: 10px; padding: 10px; }
.crop-box { position: relative; display: inline-block; line-height: 0; touch-action: none; user-select: none; }
.crop-box img { max-width: 100%; max-height: 58vh; display: block; }
.crop-rect { position: absolute; border: 2px solid var(--gold); box-shadow: 0 0 0 9999px rgba(5, 8, 16, .65); cursor: move; }
.crop-box { overflow: hidden; }
.crop-rect .h { position: absolute; width: 18px; height: 18px; background: var(--gold); border-radius: 4px; }
.crop-rect .nw { left: -2px; top: -2px; cursor: nwse-resize; } .crop-rect .se { right: -2px; bottom: -2px; cursor: nwse-resize; }
.crop-rect .ne { right: -2px; top: -2px; cursor: nesw-resize; } .crop-rect .sw { left: -2px; bottom: -2px; cursor: nesw-resize; }

/* AI abiga loomine */
.ai-step { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: #1b1505; font-size: 14px; margin-right: 6px; }
.ai-prompt { font: 12.5px/1.45 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; } .ai ul { margin: 4px 0 0; padding-left: 18px; } .ai .chip.btnlike { user-select: none; }
.ai .chip:not(.off) { border-color: var(--gold); color: var(--gold2); background: rgba(233, 185, 73, .12); opacity: 1; }

/* ============ Hele stiil (telekas ja mängija telefon) ============ */
body.theme-light {
  --bg: #f4f1ea; --bg2: #ebe6da; --panel: #ffffff; --panel2: #efeadf; --line: #d8d1c0; --line2: #bfb6a0;
  --text: #1b2233; --muted: #626c84; --gold: #a9780a; --gold2: #8a6100; --green: #23874f; --red: #c24a33; --teal: #1f8a7c; --blue: #3d62c9;
  --shadow: 0 10px 30px rgba(60, 50, 20, .16); color-scheme: light; background: var(--bg); color: var(--text);
}
body.theme-light .tv-bg { background: radial-gradient(40% 40% at 20% 15%, rgba(233, 185, 73, .28), transparent 70%), radial-gradient(45% 45% at 85% 80%, rgba(79, 179, 165, .2), transparent 70%), linear-gradient(160deg, #faf7f0, #efe9db 50%, #f7f3ea); }
body.theme-light .tv-round h1 { background: linear-gradient(180deg, #1b2233, #8a6100); -webkit-background-clip: text; background-clip: text; }
body.theme-light .join-card { background: #fff; } body.theme-light .join-code span { background: #1b2233; color: #f6d77a; border-color: #1b2233; }
body.theme-light .strip-team { background: #fff; } body.theme-light .team-card { background: color-mix(in srgb, var(--c) 16%, #fff); } body.theme-light .members span { background: rgba(0, 0, 0, .07); }
body.theme-light .b-cell { color: #f6d77a; } body.theme-light .b-cell.used { background: rgba(21, 32, 67, .08); border-color: rgba(21, 32, 67, .1); }
body.theme-light .q-val { background: #1b2233; color: #f6d77a; border-color: #1b2233; } body.theme-light .q-val.cut { color: #ffb9ab; }
body.theme-light .ans-banner { color: #fff; } body.theme-light .fx, body.theme-light .spot-card, body.theme-light .spot-card span { color: #fff; }
body.theme-light .opts.mil .opt, body.theme-light .sv-slot .front i { color: #fff; } body.theme-light .sv-slot .front i { color: #f6d77a; }
body.theme-light .tv-q .q-hints li, body.theme-light .p-q .q-hints li { background: rgba(233, 185, 73, .2); border-color: #c9a646; }
body.theme-light .timer-bar, body.theme-light .mosaic-next .bar { background: #ddd6c5; }
body.theme-light .tv-sound { color: #fff; } body.theme-light .tv-paused { background: #1b2233; color: #f6d77a; }
body.theme-light .lb-row.lead .bar { box-shadow: 0 0 1.6em rgba(169, 120, 10, .25); } body.theme-light .pod-block i { color: rgba(0, 0, 0, .4); }
body.theme-light.play #app { background: radial-gradient(120% 60% at 50% 0%, #fffdf7 0%, var(--bg) 60%); }
body.theme-light .p-head { background: rgba(255, 255, 255, .9); } body.theme-light .p-app.flash-correct { background: #c9efd8; } body.theme-light .p-app.flash-wrong { background: #f6d2ca; }
body.theme-light .buzzer { box-shadow: 0 0 0 10px #fff, 0 0 0 13px var(--line2), 0 14px 0 6px #c9c1ad; color: #fff; }
body.theme-light .buzzer.armed { box-shadow: 0 0 0 10px #fff, 0 0 0 13px #c9982f, 0 14px 0 6px #c9c1ad, 0 0 60px rgba(224, 112, 92, .45); }
body.theme-light .buzzer.mine { box-shadow: 0 0 0 10px #fff, 0 0 0 13px #1b2233, 0 14px 0 6px #c9c1ad, 0 0 80px rgba(233, 185, 73, .8); color: #231a03; }
body.theme-light .btn { background: #fff; color: var(--text); } body.theme-light .btn.primary { background: #e9b949; border-color: #e9b949; color: #1b1505; } body.theme-light .btn.ghost { background: transparent; }
body.theme-light .order .n, body.theme-light .order-tv li i { background: #e9b949; } body.theme-light .result.good .ico, body.theme-light .result.bad .ico { color: #fff; }
body.theme-light .p-score b { color: var(--gold2); } body.theme-light .choices.mil .choice { color: #fff; } body.theme-light .p-banner.pause { background: #1b2233; color: #f6d77a; }
body.theme-light .code { color: var(--gold2); } body.theme-light .res-chip.bad em, body.theme-light .err { color: var(--red); }

/* ============ Avaleht, rakendusest, versioon ============ */
.home { gap: 26px; } .home .brand { font-size: 34px; } .home .brand img { width: 60px; }
.home-btns { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; width: min(820px, 100%); }
.home-btn { flex: 1 1 220px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 16px; border-radius: 18px; background: var(--panel); border: 1.5px solid var(--line2); color: var(--text); font: inherit; text-decoration: none; cursor: pointer; text-align: center; box-shadow: var(--shadow); transition: transform .12s, border-color .12s; }
.home-btn:hover, .home-btn:focus-visible { transform: translateY(-2px); border-color: var(--gold); outline: none; } .home-btn i { font-style: normal; font-size: 34px; } .home-btn b { font-size: 19px; } .home-btn small { color: var(--muted); }
.home-btn.primary { background: var(--gold); border-color: var(--gold); color: #1b1505; } .home-btn.primary small { color: #4a3a0c; }
.about { color: var(--muted); font-size: 14px; line-height: 1.5; text-align: center; max-width: 560px; } .about b { color: var(--text); }
.adm-me .ver { margin-top: 10px; background: none; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font: 600 12px var(--sans); padding: 3px 10px; cursor: pointer; } .adm-me .ver:hover { color: var(--gold2); border-color: var(--gold); }
.changelog .about { text-align: left; max-width: none; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.cl-list { display: flex; flex-direction: column; gap: 14px; overflow: auto; } .cl-list section { border-left: 3px solid var(--line2); padding-left: 14px; } .cl-list section:first-child { border-color: var(--gold); }
.cl-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .cl-head b { font-size: 16px; } .cl-list ul { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }
.scanner { position: fixed; inset: 0; background: #000; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 14px; padding: 24px; color: #fff; text-align: center; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; } .scanner p, .scanner .btn { position: relative; } .scanner p { background: rgba(0, 0, 0, .55); padding: 8px 14px; border-radius: 10px; }
.scan-frame { position: absolute; left: 50%; top: 42%; width: min(64vw, 280px); aspect-ratio: 1; transform: translate(-50%, -50%); border: 3px solid var(--gold); border-radius: 18px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .35); }
/* telekavaate koodi sisestus */
.tv-code { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2vh; padding: 3vh 4vw; font-size: min(1.5vw, 2.6vh); text-align: center; }
.tvc-head { display: flex; align-items: center; gap: .6em; } .tvc-head img { width: 3em; } .tvc-head h1 { font-size: 2.6em; } .tv-code > p { font-size: 1.1em; } .tvc-msg { min-height: 1.6em; }
.tvc-slots { display: flex; gap: .5em; margin: .6em 0 .2em; } .tvc-slots span { width: 1.5em; height: 1.8em; font: 800 3.4em ui-monospace, Menlo, Consolas, monospace; display: grid; place-items: center; background: var(--bg); border: .06em solid var(--line2); border-radius: .16em; color: var(--gold2); }
.tvc-slots span.cur { border-color: var(--gold); box-shadow: 0 0 .5em rgba(233, 185, 73, .5); } .tvc-slots.bad span { border-color: var(--red); }
.tvc-keys { display: grid; gap: .5em; width: min(92vw, 46em); }
.tvc-keys button, .tvc-keys .link-btn { font: 700 1.9em var(--sans); padding: .35em 0; border-radius: .35em; border: .08em solid var(--line2); background: var(--panel); color: var(--text); cursor: pointer; text-decoration: none; display: grid; place-items: center; }
.tvc-keys .wide { grid-column: span 4; font-size: 1.3em; padding: .55em 0; } .tvc-keys .link-btn { color: var(--muted); }
.tvc-keys button:focus, .tvc-keys .link-btn:focus { outline: none; background: var(--gold); border-color: var(--gold); color: #1b1505; transform: scale(1.08); box-shadow: 0 0 1em rgba(233, 185, 73, .6); }
@media (max-width: 640px) {
  .home-btn { flex: 1 1 100%; display: grid; grid-template-columns: auto 1fr; gap: 0 14px; text-align: left; padding: 16px 18px; align-items: center; }
  .home-btn i { grid-row: span 2; font-size: 30px; } .home .brand { font-size: 28px; } .home .brand img { width: 48px; }
}

.about p { margin: 0; } .about .sign { margin-top: 12px; line-height: 1.6; color: var(--text); }
.about .sign a { display: inline-flex; align-items: center; gap: 6px; color: var(--gold2); text-decoration: none; font-weight: 600; } .about .sign a:hover { text-decoration: underline; } .about .ig { flex: none; }
