@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;800&display=swap');

:root {
  --bg: #101626; --bg-2: #171f33; --surface: #1c2539; --surface-2: #26304a;
  --line: rgba(255,255,255,.09); --text: #f3efe4; --muted: #9aa4bd;
  --ok: #3ccf6b; --bad: #ff5c5c; --accent: #3d7bff; --gold: #ffb627;
  --me: var(--accent);
  --font: 'Sora', 'Segoe UI', system-ui, -apple-system, sans-serif; --r: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 17px; line-height: 1.45; min-height: 100vh; min-height: 100dvh; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .4em; font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: 2rem; } h2 { font-size: 1.4rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
code { background: var(--surface-2); padding: .1em .4em; border-radius: 6px; }
button { font: inherit; }
:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

.page-plain { display: grid; place-items: center; padding: 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 28px; }
.card.narrow { width: min(100%, 460px); }
.muted { color: var(--muted); }
.plainlist { padding-left: 1.2em; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; background: var(--accent); color: #fff; border: 0; border-radius: 12px; padding: 14px 22px; font-weight: 700; font-size: 1.05rem; cursor: pointer; min-height: 52px; width: 100%; }
.btn.secondary { background: var(--surface-2); color: var(--text); }
.btn.ready { background: var(--ok); color: #062; }
.btn.small { min-height: 40px; padding: 8px 14px; font-size: .95rem; border-radius: 10px; width: auto; }
.btn:disabled { opacity: .45; cursor: default; }
.field { width: 100%; background: var(--bg-2); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; font-size: 1.15rem; }
.error { background: rgba(255,92,92,.14); border: 1px solid rgba(255,92,92,.4); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; }
.notice { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; color: var(--muted); }

.app { display: flex; flex-direction: column; min-height: 100dvh; max-width: 560px; margin: 0 auto; }
.top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 3px solid var(--me); background: var(--bg-2); }
.top .who { flex: 1; min-width: 0; }
.top .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .who span { color: var(--muted); font-size: .85rem; }
.top .avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--me); display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; }
.top .where { color: var(--muted); font-size: .85rem; text-align: right; }
.main { flex: 1; padding: 20px 16px 28px; display: flex; flex-direction: column; gap: 16px; }
.main.center { justify-content: center; align-items: center; text-align: center; }

.timer { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.timer > i { display: block; height: 100%; background: var(--me); width: 100%; transform-origin: left; }
.timer.urgent > i { background: var(--bad); }
.tlabel { text-align: right; font-size: .85rem; color: var(--muted); margin-top: 4px; }

.qmeta { color: var(--muted); font-size: .9rem; }
.qtext { font-size: 1.3rem; font-weight: 700; line-height: 1.3; }
.qtext.big { font-size: 1.7rem; }
.countdown { font-size: 3.4rem; font-weight: 800; color: var(--me); line-height: 1; }

.options { display: grid; gap: 12px; }
.opt { display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; background: var(--surface); color: var(--text); border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px; font-size: 1.05rem; font-weight: 600; line-height: 1.3; cursor: pointer; min-height: 58px; }
.opt .letter { flex: 0 0 38px; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); font-weight: 800; }
.opt:disabled { cursor: default; }
.opt.chosen { border-color: var(--me); }
.opt.chosen .letter { background: var(--me); color: #fff; }
.opt.correct { border-color: var(--ok); background: rgba(60,207,107,.16); }
.opt.correct .letter { background: var(--ok); color: #062; }
.opt.wrong { border-color: var(--bad); }
.opt.wrong .letter { background: var(--bad); color: #fff; }
.opt.dim { opacity: .4; }
.locked { text-align: center; color: var(--muted); padding: 6px; }
.locked b { color: var(--text); }

.verdict { border-radius: var(--r); padding: 16px; text-align: center; }
.verdict.ok { background: rgba(60,207,107,.14); border: 1px solid rgba(60,207,107,.35); }
.verdict.bad { background: rgba(255,92,92,.12); border: 1px solid rgba(255,92,92,.35); }
.verdict h2 { margin: 0 0 .1em; }

/* player list (lobby, scoreboard) */
.plist { display: grid; gap: 8px; }
.prow { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 12px; padding: 10px 14px; border-left: 5px solid var(--pc); }
.prow .av { width: 34px; height: 34px; border-radius: 50%; background: var(--pc); display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; font-size: .95rem; }
.prow .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.prow .nm small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.prow .st { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.prow .st.ok { color: var(--ok); font-weight: 700; }
.prow .st.bad { color: var(--bad); font-weight: 700; }
.prow .st.in { color: var(--text); }
.prow .pts { font-weight: 800; font-size: 1.15rem; min-width: 2ch; text-align: right; }
.prow.me { outline: 2px solid var(--pc); }
.prow.off { opacity: .45; }
.prow .pos { color: var(--muted); font-weight: 800; width: 1.6em; }
.prow.first .pos { color: var(--gold); }
.slots { color: var(--muted); font-size: .9rem; }

/* victory */
.podium { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: end; gap: 10px; width: 100%; }
.podium .step { text-align: center; }
.podium .step .name { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.podium .step .pts { color: var(--muted); font-size: .85rem; }
.podium .step .block { margin-top: 8px; background: var(--pc); border-radius: 12px 12px 0 0; display: grid; place-items: center; font-size: 2rem; font-weight: 800; color: #fff; }
.podium .p1 .block { height: 120px; }
.podium .p2 .block { height: 85px; }
.podium .p3 .block { height: 60px; }
.crown { font-size: 2.6rem; line-height: 1; }
