:root {
  --ink: #17252b;
  --muted: #718087;
  --paper: #f5f6f1;
  --card: #fffefa;
  --mint: #b9e9d4;
  --mint-deep: #2c9a72;
  --coral: #f47b62;
  --line: #e2e7e2;
  --display: Georgia, 'Times New Roman', serif;
}

body { background: var(--paper); color: var(--ink); }
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; opacity: .45; background-image: radial-gradient(#c5d1ca 0.7px, transparent .7px); background-size: 18px 18px; }
#stage { width: min(100%, 560px); min-height: 100%; overflow-y: auto; padding: 28px 24px 24px; z-index: 1; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 9px; background: var(--ink); color: var(--mint); font: 700 21px/1 var(--display); }
.streak { display: flex; align-items: center; gap: 7px; color: var(--muted); letter-spacing: .04em; }
.streak-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 4px #fbe4dc; }
.hero { padding: 73px 0 40px; }
.eyebrow, .card-topline, .question-kicker, .tip { font-size: 11px; font-weight: 800; letter-spacing: .16em; color: var(--mint-deep); margin: 0; }
h1 { margin: 12px 0 14px; font: 700 clamp(3.3rem, 14vw, 5.1rem)/.91 var(--display); letter-spacing: -.065em; }
h1 em { color: var(--coral); font-style: italic; }
#tagline { margin: 0; color: var(--muted); font-size: 15px; }
.practice-card { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 24px; box-shadow: 0 18px 45px rgba(23,37,43,.08); }
.card-topline { display: flex; justify-content: space-between; align-items: center; color: var(--muted); }
.spark { color: var(--coral); font-size: 19px; }
.table-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 21px; }
button { font: inherit; cursor: pointer; }
.table-button { border: 1px solid var(--line); border-radius: 13px; background: #fbfcf8; color: var(--ink); min-height: 57px; font: 700 23px var(--display); transition: transform .15s, background .15s, border-color .15s; }
.table-button:active { transform: scale(.94); background: var(--mint); border-color: var(--mint-deep); }
.question-view { text-align: center; padding-top: 29px; }
.question-kicker { color: var(--muted); }
.question { margin: 12px 0 23px; font: 700 clamp(3.2rem, 15vw, 5.5rem)/1 var(--display); letter-spacing: -.06em; }
.question span { color: var(--coral); margin-left: 8px; }
#answer-form { display: flex; gap: 10px; max-width: 390px; margin: auto; }
#answer { width: 92px; min-width: 0; border: 2px solid var(--ink); border-radius: 13px; background: white; color: var(--ink); text-align: center; font: 700 26px var(--display); outline: none; }
#answer:focus { border-color: var(--mint-deep); box-shadow: 0 0 0 4px rgba(185,233,212,.55); }
.answer-button { flex: 1; border: 0; border-radius: 13px; background: var(--ink); color: white; font-size: 14px; font-weight: 800; letter-spacing: .02em; transition: transform .15s, background .2s; }
.answer-button span { color: var(--mint); font-size: 20px; margin-left: 5px; }
.answer-button:active { transform: scale(.97); }
.success .answer-button { background: var(--mint-deep); }
.feedback { min-height: 22px; margin: 16px 0 4px; font-size: 13px; font-weight: 700; }
.feedback.correct { color: var(--mint-deep); animation: pop .35s ease; }
.feedback.error { color: var(--coral); }
.text-button { border: 0; background: transparent; color: var(--muted); font-size: 12px; padding: 9px; }
.text-button:hover { color: var(--ink); }
.tip { color: #9aa5a5; text-align: center; margin: 22px 0 0; font-size: 10px; }
.tip span { color: var(--coral); margin: 0 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@keyframes pop { 50% { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
