:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #e9f2ff;
  background: #050b14;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --bg: #050b14;
  --panel: #0a1422;
  --panel-2: #0e1b2d;
  --line: #20364f;
  --text: #e9f2ff;
  --muted: #98abc0;
  --sky: #69c3ff;
  --sky-2: #9cdbff;
  --good: #6ee7a8;
  --bad: #ff8f8f;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 25% 0%, #102742 0, var(--bg) 40%); }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
a { color: var(--sky-2); }

.shell { width: min(1060px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 54px; }
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 28px; }
.brand-line { display: flex; align-items: center; gap: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 800; letter-spacing: .14em; }
.signal-mark { color: var(--sky); font-size: 32px; line-height: 1; }
.tagline { margin: 4px 0 0 42px; color: var(--muted); font-size: .95rem; }
.pool-badge { border: 1px solid var(--line); background: #0a1727cc; color: var(--sky-2); padding: 9px 12px; border-radius: 999px; font: 700 .78rem ui-monospace, SFMono-Regular, Menlo, monospace; }

.hero-grid { display: grid; grid-template-columns: 1fr 260px; gap: 16px; margin-bottom: 16px; }
.intro-card, .stats-card, .question-card, .result-card, .loading-card { border: 1px solid var(--line); background: linear-gradient(180deg, #0d1a2b 0%, #09131f 100%); border-radius: 18px; box-shadow: 0 24px 80px #0005; }
.intro-card { padding: 28px; }
.eyebrow { margin: 0 0 10px; color: var(--sky); font: 800 .72rem ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .14em; }
h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.45rem); line-height: .98; letter-spacing: -.045em; max-width: 700px; }
.lede { color: var(--muted); font-size: 1.04rem; line-height: 1.55; max-width: 720px; margin: 18px 0 22px; }
.mode-row { display: flex; flex-wrap: wrap; gap: 9px; }
.mode-button { border: 1px solid var(--line); background: #07101b; color: var(--text); padding: 10px 14px; border-radius: 10px; font-weight: 750; }
.mode-button:hover:not(:disabled) { border-color: #3e6389; background: #0d1d30; }
.mode-button.active { background: var(--sky); color: #06101a; border-color: var(--sky); }

.stats-card { padding: 22px; display: grid; align-content: start; gap: 18px; }
.stats-card div { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid #16283b; padding-bottom: 12px; }
.stats-card strong { font-size: 1.65rem; }
.stats-card span { color: var(--muted); font-size: .82rem; }
.text-button { border: 0; background: transparent; color: var(--muted); padding: 0; text-align: left; text-decoration: underline; text-underline-offset: 3px; }

.question-card { padding: clamp(20px, 4vw, 34px); }
.question-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.question-meta span { color: var(--muted); background: #06101b; border: 1px solid #172a3e; border-radius: 999px; padding: 5px 9px; font: 700 .72rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.question-card h2 { font-size: clamp(1.45rem, 3.6vw, 2.15rem); line-height: 1.2; margin: 0 0 24px; letter-spacing: -.025em; }
.answers { display: grid; gap: 10px; }
.answer-button { width: 100%; display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: center; text-align: left; color: var(--text); background: #08121f; border: 1px solid #1b3047; border-radius: 13px; padding: 13px 16px 13px 12px; line-height: 1.35; transition: transform 120ms ease, border-color 120ms ease, background 120ms ease; }
.answer-button:hover:not(:disabled) { transform: translateY(-1px); border-color: #4d789f; background: #0c1b2d; }
.answer-button:disabled { opacity: 1; cursor: default; }
.answer-letter { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: #10243a; color: var(--sky-2); font-weight: 850; }
.answer-button.correct { background: #0c2a22; border-color: #2b7c5a; }
.answer-button.correct .answer-letter { background: #174b37; color: #c8ffe2; }
.answer-button.incorrect { background: #321619; border-color: #8e4248; }
.answer-button.incorrect .answer-letter { background: #5c2429; color: #ffd2d2; }
.figure-wrap { margin: 0 0 24px; padding: 12px; background: #f3f5f8; border-radius: 12px; }
.figure-wrap img { display: block; max-width: 100%; max-height: 420px; margin: 0 auto; }
.feedback { margin-top: 18px; display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; border: 1px solid #69383c; background: #241417; color: #ffd0d0; }
.feedback.good { border-color: #2b694f; background: #0c211b; color: #c6ffe0; }
.next-button { border: 0; border-radius: 9px; padding: 9px 12px; background: #e7f4ff; color: #07121c; font-weight: 800; white-space: nowrap; }
.keyboard-hint { color: #687d92; font-size: .76rem; text-align: right; margin: 12px 2px 0; }

.result-card { padding: 42px; text-align: center; }
.score { font-size: clamp(4.5rem, 15vw, 8rem); font-weight: 900; line-height: 1; letter-spacing: -.08em; color: var(--bad); }
.score.pass { color: var(--good); }
.score span { font-size: .3em; color: var(--muted); letter-spacing: -.03em; }
.result-card h2 { font-size: 2rem; margin: 14px 0 8px; }
.result-card > p:not(.eyebrow) { color: var(--muted); }
.centered { justify-content: center; margin-top: 20px; }
.loading-card { margin-top: 20vh; padding: 40px; text-align: center; color: var(--muted); }
.error-card h1 { margin-bottom: 16px; }
.error-card code { color: var(--bad); }

footer { color: #6f8499; font-size: .76rem; line-height: 1.5; margin: 24px 8px 0; }
footer p { margin: 5px 0; }

@media (max-width: 760px) {
  .shell { width: min(100% - 20px, 1060px); padding-top: 20px; }
  .site-header { align-items: flex-start; }
  .tagline { margin-left: 0; }
  .pool-badge { max-width: 140px; text-align: center; }
  .hero-grid { grid-template-columns: 1fr; }
  .stats-card { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .stats-card div { display: block; }
  .stats-card strong, .stats-card span { display: block; }
  .text-button { grid-column: 1 / -1; }
  .feedback { align-items: stretch; flex-direction: column; }
  .next-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
