/* Live quiz: builds on the shared /styles.css. */
[hidden] { display: none !important; }
:root {
  --opt-0: #e0453a; --opt-1: #2a6fd6; --opt-2: #d99a00; --opt-3: #1e9a55; --opt-4: #7b4fd6; --opt-5: #ec6a1f;
  --ink: #172033; --muted: #5e6a82; --line: #e3e8f0; --surface: #fff; --page: #f4f7fb;
  --accent: #2457d6; --good: #178447; --bad: #b42318; --partial: #b26a00;
  --stage-a: #2b2d7c; --stage-b: #5b2a86;
}
.opt-0 { --opt: var(--opt-0); } .opt-1 { --opt: var(--opt-1); } .opt-2 { --opt: var(--opt-2); }
.opt-3 { --opt: var(--opt-3); } .opt-4 { --opt: var(--opt-4); } .opt-5 { --opt: var(--opt-5); }

/* ---------- Teacher pages ---------- */
.eyebrow { margin: 0 0 4px; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 700; color: var(--muted); }
.flash { background: #fdecea; color: var(--bad); border: 1px solid #f0b8b3; border-radius: 12px; padding: 12px 16px; font-weight: 600; }
.hint { color: var(--muted); font-size: 14px; font-weight: 400; line-height: 1.45; margin: 0; }
.big-button { font-size: 18px; padding: 14px 22px; }
button:disabled { opacity: .45; cursor: not-allowed; }
.section-title { margin: 28px 0 14px; }
select { font: inherit; width: 100%; padding: 11px; border: 1px solid #cbd5e1; border-radius: 9px; background: #fff; }
h3 { margin: 10px 0 0; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.question-editor { display: grid; gap: 14px; }
.option-rows { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.option-rows legend { font-weight: 650; margin-bottom: 8px; padding: 0; }
.option-row { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; }
.correct-toggle { display: flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.correct-toggle input { width: 18px; height: 18px; }
.shape-badge { width: 36px; height: 36px; border-radius: 9px; background: var(--opt); color: #fff; display: grid; place-items: center; }
.shape-badge svg { width: 20px; height: 20px; }
.shape-0 { --opt: var(--opt-0); } .shape-1 { --opt: var(--opt-1); } .shape-2 { --opt: var(--opt-2); }
.shape-3 { --opt: var(--opt-3); } .shape-4 { --opt: var(--opt-4); } .shape-5 { --opt: var(--opt-5); }
.question-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.question-number { width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; }
.push-right { margin-left: auto; }
.question-card-head button { padding: 7px 12px; background: #eef1f6; }
.question-card-head button.danger { background: var(--bad); }
.pill { display: inline-block; background: #eef1f6; border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 600; color: #344055; }
.pill.accent { background: #e7edff; color: var(--accent); }
.phase-finished { background: #e3f4ea; color: var(--good); }
.phase-question, .phase-results { background: #fff4dc; color: #8a5a00; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.data-table th { text-align: left; color: var(--muted); font-size: 13px; font-weight: 650; border-bottom: 1px solid var(--line); padding: 8px 10px; }
.data-table td { border-bottom: 1px solid var(--line); padding: 10px; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; font-weight: 700; }
@media (max-width: 800px) { .field-row { grid-template-columns: 1fr; } }

/* ---------- Charts ---------- */
.chart { position: relative; margin: 6px 0 22px; }
.chart h3 { font-size: 16px; margin: 0 0 2px; }
.chart .chart-sub { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text, .chart .label { fill: var(--muted); font-size: 12px; }
.chart .value { fill: var(--ink); font-size: 12px; font-weight: 650; }
.chart .grid line { stroke: #e9edf3; stroke-width: 1; }
.chart .legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink); margin: 8px 0 0; padding: 0; list-style: none; }
.chart .legend li { display: flex; align-items: center; gap: 6px; }
.chart .legend .key { width: 14px; height: 3px; border-radius: 2px; background: var(--key); }
.chart .legend .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--key); }
.chart-tooltip { position: absolute; pointer-events: none; background: #172033; color: #fff; font-size: 13px; line-height: 1.4; padding: 8px 10px; border-radius: 8px; box-shadow: 0 8px 20px rgba(0,0,0,.18); white-space: nowrap; z-index: 5; transform: translate(-50%, calc(-100% - 10px)); }
.chart-tooltip[hidden] { display: none; }
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.distribution { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.distribution-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.distribution-card h4 { margin: 0 0 8px; font-size: 15px; }
.dist-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) 40px; gap: 8px; align-items: center; margin: 6px 0; font-size: 14px; }
.dist-row .dist-shape { width: 22px; height: 22px; border-radius: 6px; background: var(--opt); color: #fff; display: grid; place-items: center; }
.dist-row .dist-shape svg { width: 13px; height: 13px; }
.dist-track { position: relative; height: 22px; }
.dist-bar { position: absolute; left: 0; top: 4px; height: 14px; border-radius: 0 4px 4px 0; background: var(--opt); min-width: 2px; }
.dist-text { position: relative; z-index: 1; display: block; padding-left: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 22px; }
.dist-row .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.dist-correct { color: var(--good); font-weight: 700; }
.dist-label { display: flex; flex-direction: column; min-width: 0; }
.dist-label .dist-track { height: 12px; }
.dist-label .dist-bar { top: 2px; height: 8px; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 8px; }
.stat-tile { background: #f6f8fc; border-radius: 12px; padding: 14px 16px; }
.stat-tile span { display: block; color: var(--muted); font-size: 13px; }
.stat-tile strong { font-size: 26px; }
@media (max-width: 900px) { .report-grid { grid-template-columns: 1fr; } }

/* ---------- Projector (host) ---------- */
body.stage { background: radial-gradient(circle at 15% 10%, #3c3fb0 0, transparent 45%), linear-gradient(135deg, var(--stage-a), var(--stage-b)); color: #fff; min-height: 100vh; }
.host { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }
.host-top { display: flex; align-items: center; gap: 16px; padding: 14px 28px; }
.host-top .title { font-weight: 800; font-size: 20px; }
.teacher-badge { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 700; letter-spacing: .04em; }
.join-strip { margin-left: auto; display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.12); border-radius: 12px; padding: 6px 14px; font-weight: 600; }
.join-strip strong { font-size: 22px; letter-spacing: .12em; }
.host-main { padding: 8px 28px 20px; display: flex; flex-direction: column; min-height: 0; }
.host-bottom { display: flex; align-items: center; gap: 12px; padding: 14px 28px 22px; }
.host-bottom .spacer { flex: 1; }
.stage-button { border: 0; border-radius: 12px; padding: 14px 26px; font-size: 19px; font-weight: 800; background: #fff; color: var(--stage-a); box-shadow: 0 6px 0 rgba(0,0,0,.18); }
.stage-button:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(0,0,0,.18); }
.stage-button.ghost { background: rgba(255,255,255,.14); color: #fff; box-shadow: none; font-weight: 700; font-size: 16px; }
.counter-chip { background: rgba(255,255,255,.14); border-radius: 12px; padding: 10px 16px; font-weight: 700; font-size: 18px; }
.counter-chip strong { font-size: 26px; margin-left: 6px; }

.lobby { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 28px; align-items: start; }
.join-panel { background: #fff; color: var(--ink); border-radius: 22px; padding: 28px 32px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.join-panel .join-label { font-size: 22px; color: var(--muted); font-weight: 600; margin: 0; }
.join-panel .join-url { font-size: clamp(26px, 3.4vw, 46px); font-weight: 800; margin: 2px 0 18px; word-break: break-all; }
.join-panel .join-code { font-size: clamp(56px, 8vw, 112px); font-weight: 900; letter-spacing: .14em; line-height: 1; margin: 4px 0 0; color: var(--stage-a); }
.qr-panel { background: #fff; border-radius: 22px; padding: 18px; text-align: center; color: var(--muted); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.qr-panel svg { width: 100%; max-width: 340px; height: auto; display: block; margin: 0 auto; }
.counts { display: flex; gap: 14px; margin: 26px 0 18px; flex-wrap: wrap; }
.count-card { background: rgba(255,255,255,.14); border-radius: 18px; padding: 16px 24px; min-width: 200px; }
.count-card span { display: block; font-size: 17px; font-weight: 600; opacity: .85; }
.count-card strong { font-size: 54px; line-height: 1.05; }
.count-card.ready { background: rgba(46, 204, 113, .22); }
.player-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.player-chip { background: #fff; color: var(--ink); border-radius: 999px; padding: 9px 18px; font-size: 20px; font-weight: 700; animation: pop .35s cubic-bezier(.2,1.6,.4,1); }
.empty-note { opacity: .8; font-size: 20px; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.question-head { display: flex; align-items: center; gap: 14px; font-weight: 700; font-size: 18px; opacity: .95; }
.multiplier-badge { background: #ffd34d; color: #3a2a00; border-radius: 999px; padding: 4px 14px; font-weight: 800; }
.prompt-card { background: #fff; color: var(--ink); border-radius: 20px; padding: 26px 32px; margin: 16px 0 22px; font-size: clamp(28px, 3.6vw, 52px); font-weight: 800; line-height: 1.15; text-align: center; box-shadow: 0 16px 40px rgba(0,0,0,.22); }
.question-body { display: grid; grid-template-columns: 170px 1fr 170px; align-items: center; gap: 20px; margin-bottom: 22px; }
.timer { position: relative; width: 150px; height: 150px; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer .track { fill: none; stroke: rgba(255,255,255,.18); stroke-width: 10; }
.timer .ring { fill: none; stroke: #fff; stroke-width: 10; stroke-linecap: round; transition: stroke .3s; }
.timer.urgent .ring { stroke: #ffb4a8; }
.timer .seconds { position: absolute; inset: 0; display: grid; place-items: center; font-size: 54px; font-weight: 900; }
.answered-box { text-align: center; }
.answered-box strong { display: block; font-size: 64px; font-weight: 900; line-height: 1; }
.answered-box span { font-size: 18px; font-weight: 600; opacity: .85; }
.kind-note { text-align: center; font-size: 20px; font-weight: 700; opacity: .9; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tile { position: relative; display: flex; align-items: center; gap: 18px; background: var(--opt); color: #fff; border-radius: 16px; padding: 20px 24px; font-size: clamp(20px, 2.3vw, 32px); font-weight: 800; min-height: 96px; box-shadow: 0 6px 0 rgba(0,0,0,.2); transition: opacity .4s, transform .4s, filter .4s; }
.tile.opt-2 { color: #241800; }
.tile svg { width: 44px; height: 44px; flex: none; }
.tile .tile-text { flex: 1; overflow-wrap: anywhere; }
.tile .tile-count { font-size: 34px; font-weight: 900; }
.tile.dim { opacity: .35; filter: saturate(.5); transform: scale(.98); }
.tile .tick { width: 42px; height: 42px; border-radius: 50%; background: #fff; color: var(--good); display: grid; place-items: center; font-size: 28px; font-weight: 900; flex: none; }
.tile-bar { position: absolute; left: 0; bottom: 0; height: 6px; border-radius: 0 0 0 16px; background: rgba(255,255,255,.75); transition: width .8s cubic-bezier(.2,.8,.2,1); }

.results-view { display: flex; flex-direction: column; gap: 18px; }
.results-prompt { font-size: 24px; font-weight: 800; text-align: center; opacity: .95; }
.leaderboard { position: relative; max-width: 980px; width: 100%; margin: 0 auto; }
.leaderboard h2 { text-align: center; font-size: 36px; margin: 0 0 16px; }
.lb-rows { position: relative; }
.lb-row { position: absolute; left: 0; right: 0; height: 58px; display: grid; grid-template-columns: 60px minmax(0, 1fr) auto auto auto; gap: 16px; align-items: center; background: #fff; color: var(--ink); border-radius: 14px; padding: 0 20px; font-size: 24px; font-weight: 800; box-shadow: 0 6px 16px rgba(0,0,0,.18); transition: transform 1.1s cubic-bezier(.2,.8,.2,1), opacity .5s; }
.lb-row .lb-rank { font-size: 26px; color: var(--stage-a); }
.lb-row .lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-row .lb-gain { font-size: 18px; color: var(--good); font-weight: 800; opacity: 0; transition: opacity .4s .5s; }
.lb-row.revealed .lb-gain { opacity: 1; }
.lb-row .lb-move { font-size: 15px; font-weight: 800; min-width: 42px; text-align: right; opacity: 0; transition: opacity .4s 1s; }
.lb-row.revealed .lb-move { opacity: 1; }
.lb-move.up { color: var(--good); } .lb-move.down { color: var(--bad); }
.lb-row .lb-score { font-variant-numeric: tabular-nums; min-width: 90px; text-align: right; }
.lb-row.first { background: #fff4c7; }
.lb-more { text-align: center; margin-top: 10px; opacity: .8; font-weight: 600; }

.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 260px)); justify-content: center; align-items: end; gap: 18px; margin: 10px auto 26px; }
.podium-place { text-align: center; animation: rise .9s cubic-bezier(.2,.9,.3,1.2) both; }
.podium-place .podium-name { font-size: 28px; font-weight: 900; overflow-wrap: anywhere; }
.podium-place .podium-score { font-size: 20px; font-weight: 700; opacity: .9; margin-bottom: 10px; }
.podium-block { border-radius: 16px 16px 0 0; display: grid; place-items: center; font-size: 72px; font-weight: 900; color: rgba(0,0,0,.35); }
.place-1 .podium-block { height: 240px; background: #ffd34d; }
.place-2 .podium-block { height: 180px; background: #dfe6f0; }
.place-3 .podium-block { height: 130px; background: #f0b27a; }
.place-1 { order: 2; animation-delay: 1.2s; } .place-2 { order: 1; animation-delay: .6s; } .place-3 { order: 3; animation-delay: 0s; }
@keyframes rise { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }
.final-list { max-width: 700px; margin: 0 auto; display: grid; gap: 8px; }
.final-row { display: grid; grid-template-columns: 50px 1fr auto; background: rgba(255,255,255,.12); border-radius: 12px; padding: 10px 18px; font-size: 20px; font-weight: 700; }
.final-links { display: flex; justify-content: center; gap: 12px; margin-top: 22px; }
.final-links a { text-decoration: none; }
.final-links a.ghost { color: #fff; }
.connection-banner { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); background: #fff4dc; color: #6b4500; border-radius: 999px; padding: 8px 18px; font-weight: 700; z-index: 50; box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.connection-banner[hidden] { display: none; }
.host-error { background: #fdecea; color: var(--bad); border-radius: 12px; padding: 10px 16px; font-weight: 700; }
.host-error[hidden] { display: none; }
@media (max-width: 900px) {
  .lobby { grid-template-columns: 1fr; }
  .question-body { grid-template-columns: 1fr 1fr; }
  .kind-note { grid-column: 1 / -1; order: 3; }
  .tiles { grid-template-columns: 1fr; }
  .host-top, .host-main, .host-bottom { padding-left: 16px; padding-right: 16px; }
  .join-strip { display: none; }
}

/* ---------- Phone (student) ---------- */
body.phone { background: linear-gradient(160deg, var(--stage-a), var(--stage-b)); color: #fff; min-height: 100vh; min-height: 100dvh; }
.phone-shell { max-width: 560px; margin: 0 auto; padding: 14px 16px 24px; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.phone-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 700; }
.phone-top .who { background: rgba(255,255,255,.16); border-radius: 999px; padding: 6px 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.phone-top .score { background: #fff; color: var(--stage-a); border-radius: 999px; padding: 6px 12px; font-variant-numeric: tabular-nums; }
.phone-main { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 18px 0; }
.phone-card { background: #fff; color: var(--ink); border-radius: 22px; padding: 26px 22px; text-align: center; box-shadow: 0 16px 40px rgba(0,0,0,.25); }
.phone-card h1 { font-size: 30px; margin: 0 0 8px; }
.phone-card p { color: var(--muted); font-size: 18px; margin: 6px 0; }
.phone-card .big { font-size: 46px; font-weight: 900; color: var(--ink); margin: 6px 0; }
.phone-q-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin-bottom: 10px; }
.time-bar { height: 8px; border-radius: 999px; background: rgba(255,255,255,.2); overflow: hidden; margin-bottom: 14px; }
.time-bar span { display: block; height: 100%; background: #fff; border-radius: 999px; }
.shape-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; flex: 1; min-height: 52vh; }
.shape-grid.count-2 { grid-template-columns: 1fr; }
.shape-button { border: 0; border-radius: 18px; background: var(--opt); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 0 rgba(0,0,0,.25); padding: 0; min-height: 110px; position: relative; transition: transform .1s, opacity .2s; }
.shape-button.opt-2 { color: #241800; }
.shape-button svg { width: 42%; max-width: 96px; height: auto; }
.shape-button:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.shape-button.selected { outline: 6px solid #fff; outline-offset: -6px; }
.shape-button.selected::after { content: "✓"; position: absolute; top: 8px; right: 12px; font-size: 26px; font-weight: 900; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.4); }
.shape-button.opt-2.selected::after { color: #241800; text-shadow: none; }
.shape-button:disabled { opacity: .5; }
.phone-hint { text-align: center; font-weight: 700; margin: 0 0 10px; font-size: 17px; }
.submit-multi { margin-top: 14px; width: 100%; border: 0; border-radius: 14px; padding: 16px; font-size: 20px; font-weight: 800; background: #fff; color: var(--stage-a); }
.result-card.correct { background: #e3f6ea; } .result-card.partial { background: #fff4dc; } .result-card.wrong, .result-card.none { background: #fdecea; }
.result-card .result-title { font-size: 32px; font-weight: 900; margin: 0; }
.result-card.correct .result-title { color: var(--good); } .result-card.partial .result-title { color: var(--partial); } .result-card.wrong .result-title, .result-card.none .result-title { color: var(--bad); }
.result-card .gain { font-size: 40px; font-weight: 900; color: var(--ink); margin: 8px 0; }
.mini-shapes { display: flex; justify-content: center; gap: 8px; margin: 14px 0 4px; }
.mini-shape { width: 38px; height: 38px; border-radius: 9px; background: var(--opt); color: #fff; display: grid; place-items: center; position: relative; }
.mini-shape svg { width: 22px; height: 22px; }
.mini-shape.faded { opacity: .25; }
.mini-shape.picked { outline: 3px solid var(--ink); outline-offset: 2px; }
.phone-error { background: #fdecea; color: var(--bad); border-radius: 12px; padding: 10px 14px; font-weight: 700; text-align: center; margin-top: 12px; }
.phone-error[hidden] { display: none; }
.join-card form { text-align: left; }
.join-card input { font-size: 20px; text-align: center; }
.join-card .primary { width: 100%; font-size: 20px; padding: 14px; }
.code-input { font-size: 30px !important; letter-spacing: .3em; text-transform: uppercase; text-align: center; font-weight: 800; }
.phone .language button { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.3); }
.phone .teacher-link { color: rgba(255,255,255,.85); text-align: center; }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.button-link { display: inline-block; border-radius: 9px; padding: 10px 16px; background: #eef1f6; color: #172033; text-decoration: none; font-weight: 600; }
.button-link:hover { background: #e3e8f0; }
.pill.muted-pill { background: #f4f6fa; color: #65718a; font-weight: 500; }
.notice { background: #e8f6ee; color: #14633a; border-radius: 10px; padding: 12px 16px; font-weight: 600; }
.settings-stats { display: flex; gap: 24px; flex-wrap: wrap; color: #59657c; margin: 0; }
.settings-stats strong { color: #172033; }
.field-row { align-items: end; }
/* Native selects ignore padding in Safari; draw our own so they match the text inputs. */
select { -webkit-appearance: none; appearance: none; padding: 12px 38px 12px 12px; line-height: 1.25; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2365718a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center; }
/* Form fields share one box: text inputs, number inputs and selects have the same height, padding,
   border and text weight (labels are bold, fields are not). */
label > input:not([type=checkbox]):not([type=radio]), label > select, .option-row > input {
  box-sizing: border-box; height: 48px; margin: 0; padding: 0 14px; border: 1px solid #cbd5e1; border-radius: 9px;
  font: inherit; font-size: 16px; font-weight: 500; line-height: 1.25; color: #172033; background-color: #fff;
}
label > select { padding-right: 40px; }
label > input:focus, label > select:focus, .option-row > input:focus { outline: 2px solid #2457d6; outline-offset: 1px; border-color: #2457d6; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
/* In the half-width cards three fields do not fit one row: the first takes the whole row, the other two share the next. */
.two-column .field-row { grid-template-columns: 1fr 1fr; }
.two-column .field-row > label:first-child:nth-last-child(3) { grid-column: 1 / -1; }
@media (max-width: 800px) { .two-column .field-row { grid-template-columns: 1fr; } }

/* Answer reveal: votes per option stay readable on the wrong options too. */
.tile.dim { opacity: .55; filter: saturate(.6); }
.tile.correct { outline: 4px solid #fff; outline-offset: 3px; }
.tile .tile-votes { display: grid; justify-items: end; line-height: 1; flex: none; min-width: 64px; }
.tile .tile-votes strong { font-size: 40px; font-weight: 900; }
.tile .tile-votes small { font-size: 16px; font-weight: 700; opacity: .85; margin-top: 4px; }
.votes-summary { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin: 0; font-size: 22px; font-weight: 800; }
.votes-summary .muted-note { opacity: .75; font-weight: 700; }

/* End of the game: the podium alone, then the whole ranking. */
.finished-title { text-align: center; font-size: 44px; margin: 0 0 10px; }
.finished-title.small { font-size: 32px; margin-bottom: 4px; }
.podium.compact { margin: 0 auto 18px; }
.podium.compact .podium-place { animation: none; }
.podium.compact .podium-name { font-size: 22px; }
.podium.compact .podium-score { font-size: 16px; margin-bottom: 6px; }
.podium.compact .podium-block { font-size: 40px; }
.podium.compact .place-1 .podium-block { height: 110px; }
.podium.compact .place-2 .podium-block { height: 80px; }
.podium.compact .place-3 .podium-block { height: 60px; }
.final-list { max-width: 1100px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.final-row { animation: rise .5s cubic-bezier(.2,.9,.3,1.1) both; align-items: center; gap: 10px; }
.final-row .final-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.final-row .final-score { font-variant-numeric: tabular-nums; }

/* Quiz page: start a normal game or one in English. */
.start-run { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.secondary-button { background: #eef1f6; color: #172033; font-weight: 700; }
.secondary-button:hover { background: #e3e8f0; }
.secondary-button:disabled, .big-button:disabled { opacity: .5; cursor: not-allowed; }

/* Header actions: language switch, links and logout share one height and baseline. */
.header-actions { align-items: center; gap: 10px; flex-wrap: wrap; }
.header-actions .language { margin: 0; gap: 6px; }
.header-actions .language button, .header-actions .button-link, .header-actions form > button {
  box-sizing: border-box; height: 42px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 16px; border-radius: 9px; font-size: 15px; font-weight: 600; line-height: 1; margin: 0; }
.header-actions .language button { min-width: 46px; padding: 0 12px; background: #fff; border: 1px solid #d6dce7; color: #172033; }
.header-actions .language button:hover { background: #f4f7fb; }
.header-actions form > button { background: #eef1f6; color: #172033; border: 0; }
.header-actions form > button:hover, .header-actions .button-link:hover { background: #e3e8f0; }
.header-actions form { display: inline-flex; margin: 0; }
