:root {
  color-scheme: dark;
  --ink: #f8fafc;
  --muted: #a9b7c9;
  --canvas: #08111f;
  --surface: #111e31;
  --surface-strong: #182943;
  --line: rgba(203, 213, 225, 0.15);
  --blue: #5ba8ff;
  --blue-strong: #2385f5;
  --green: #35d39a;
  --red: #ff7187;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 50% -15%, #1c426b 0%, var(--canvas) 43rem); color: var(--ink); }
button { font: inherit; }

.app-shell { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; }
.screen { width: min(100%, 760px); animation: enter .25s ease-out; }
.brand { display: flex; align-items: center; gap: 10px; color: #d6e7fc; font-size: .92rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.brand-mark { width: 29px; height: 29px; display: grid; place-items: center; background: var(--blue-strong); border-radius: 8px; font-size: .82rem; color: white; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(2.25rem, 7vw, 4.25rem); letter-spacing: -.055em; line-height: 1; margin: 20px 0 18px; }
h2 { font-size: clamp(1.8rem, 5vw, 2.65rem); letter-spacing: -.04em; margin-bottom: 10px; }
.lede { max-width: 540px; color: var(--muted); font-size: 1.05rem; line-height: 1.55; }
.panel { background: linear-gradient(145deg, rgba(24, 41, 67, .96), rgba(14, 27, 46, .96)); border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(0,0,0,.22); border-radius: 24px; padding: clamp(22px, 5vw, 42px); }
.topic-card { width: 100%; border: 1px solid rgba(91, 168, 255, .42); border-radius: 18px; padding: 24px; text-align: left; color: var(--ink); background: linear-gradient(110deg, rgba(35,133,245,.18), rgba(35,133,245,.04)); cursor: pointer; transition: transform .16s, border-color .16s, background .16s; }
.topic-card:hover, .topic-card:focus-visible { transform: translateY(-3px); border-color: var(--blue); background: linear-gradient(110deg, rgba(35,133,245,.29), rgba(35,133,245,.07)); outline: none; }
.topic-kicker, .eyebrow { color: #9acaff; text-transform: uppercase; letter-spacing: .12em; font-size: .76rem; font-weight: 800; }
.topic-title { display: block; font-size: 1.6rem; margin: 8px 0; font-weight: 800; }
.topic-copy { color: var(--muted); line-height: 1.4; }
.arrow { float: right; color: var(--blue); font-size: 1.5rem; }
.section-label { display: block; font-weight: 750; margin: 29px 0 12px; }
.choice-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice { min-height: 60px; padding: 10px 14px; color: #dceaff; border: 1px solid var(--line); border-radius: 12px; background: rgba(8,17,31,.4); cursor: pointer; font-weight: 750; transition: .15s; }
.choice:hover { border-color: rgba(91,168,255,.7); }
.choice.is-selected { color: #06111f; background: #8ac5ff; border-color: #8ac5ff; }
.primary { margin-top: 30px; min-height: 58px; width: 100%; border: 0; border-radius: 13px; color: white; background: var(--blue-strong); font-weight: 800; cursor: pointer; box-shadow: 0 8px 24px rgba(35,133,245,.28); transition: transform .15s, background .15s; }
.primary:hover { transform: translateY(-2px); background: #459eff; }
.back { padding: 0; border: 0; color: #a6cfff; background: transparent; cursor: pointer; font-weight: 700; }

.test-screen { width: min(100%, 700px); }
.test-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; color: var(--muted); font-weight: 700; }
.progress-track { height: 7px; margin: -14px 0 40px; overflow: hidden; border-radius: 999px; background: rgba(203,213,225,.13); }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4f9fff, #5ee0bd); transition: width .22s; }
.test-title { margin: 0; font-size: clamp(2rem, 6vw, 3.45rem); letter-spacing: -.05em; line-height: 1.05; }
.hand-context { margin-top: 52px; }
.context-label { color: #9db0c9; font-size: clamp(1.2rem, 3.5vw, 1.65rem); font-weight: 750; }
.context-value { margin-left: 8px; color: var(--ink); }
.hand-row { margin-top: 28px; }
.hand-value { color: #91c6ff; font-size: clamp(2.6rem, 10vw, 5.5rem); letter-spacing: -.07em; font-weight: 850; }
.answer-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 74px; }
.answer { min-height: 104px; border-radius: 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); cursor: pointer; font-weight: 850; font-size: 1.4rem; transition: transform .15s, border-color .15s, background .15s; }
.answer:hover, .answer:focus-visible { transform: translateY(-3px); outline: none; }
.answer.open:hover, .answer.open:focus-visible { background: rgba(53,211,154,.15); border-color: var(--green); }
.answer.fold:hover, .answer.fold:focus-visible { background: rgba(255,113,135,.13); border-color: var(--red); }

.score { font-size: clamp(4.6rem, 18vw, 8.5rem); letter-spacing: -.09em; line-height: .92; margin: 35px 0 12px; }
.score-detail { color: var(--muted); font-size: 1.12rem; }
.mistakes { margin-top: 42px; }
.mistake-list { display: grid; gap: 11px; }
.mistake { display: grid; grid-template-columns: 1.2fr .8fr 1fr 1fr; gap: 12px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: rgba(8,17,31,.35); }
.mistake strong { display: block; font-size: 1.1rem; }
.mistake small { display: block; color: var(--muted); margin-bottom: 3px; }
.mistake .wrong { color: #ff9bab; }.mistake .right { color: #7ce9bf; }
.perfect { padding: 22px; border: 1px solid rgba(53,211,154,.35); border-radius: 14px; color: #a7f3d0; background: rgba(53,211,154,.08); }

@keyframes enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@media (max-width: 540px) { :root { font-size: 17px; } .app-shell { padding: 20px 14px; } .panel { border-radius: 18px; } .answer-buttons { margin-top: 56px; gap: 10px; } .answer { min-height: 92px; } .mistake { grid-template-columns: 1fr 1fr; } .choice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
