:root {
  --ink: #172034;
  --muted: #63708a;
  --paper: #f7f5ef;
  --card: #fffdfa;
  --line: #e4e0d7;
  --coral: #e76852;
  --coral-pale: #fff1ed;
  --teal: #1b9e94;
  --teal-pale: #e5f6f3;
  --gold: #edb64b;
  --choice: #fff;
  --subtle: #fbfaf7;
  --mark: #ffe0d9;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: radial-gradient(circle at 8% 0%, #fff 0, transparent 24rem), var(--paper);
  font-family: "DM Sans", sans-serif;
}
button { font: inherit; }
.shell { width: min(100% - 40px, 860px); margin: 0 auto; }
.topbar { height: 91px; display: flex; align-items: center; justify-content: space-between; }
.brand { color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 9px; font-family: Fraunces, serif; font-size: 24px; font-weight: 700; letter-spacing: -.9px; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px 9px 12px 9px; background: var(--ink); color: #fff; font: 700 20px/1 Fraunces, serif; }
.scoreboard { display: flex; gap: 20px; }
.scoreboard div { min-width: 36px; text-align: right; }
.score-label { display: block; margin-bottom: 2px; color: var(--muted); font: 500 9px/1 "DM Mono", monospace; letter-spacing: .1em; text-transform: uppercase; }
.scoreboard strong { font: 700 20px/1 Fraunces, serif; }
.hero { padding: 51px 0 42px; max-width: 625px; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--teal); font: 500 11px/1 "DM Mono", monospace; letter-spacing: .1em; text-transform: uppercase; }
.eyebrow span { width: 16px; height: 2px; background: currentColor; }
h1, h2 { margin: 0; font-family: Fraunces, serif; letter-spacing: -0.05em; }
h1 { font-size: clamp(44px, 8vw, 70px); line-height: .96; }
h1 em { color: var(--coral); font-style: italic; }
.intro { max-width: 455px; margin: 24px 0 0; color: var(--muted); font-size: 17px; line-height: 1.55; }
.game-card { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: 0 12px 30px rgba(27, 32, 52, .06); }
.round-meta { height: 54px; padding: 0 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; color: var(--muted); font: 500 10px/1 "DM Mono", monospace; letter-spacing: .1em; text-transform: uppercase; }
.round-status { display: flex; align-items: center; gap: 10px; }
.new-round { border: 0; padding: 9px 0 9px 12px; background: transparent; color: var(--teal); font: inherit; cursor: pointer; }
.new-round:hover { color: var(--ink); }
.sentence-wrap { padding: 42px 38px 34px; text-align: center; }
.instruction { margin: 0 0 18px; color: var(--muted); font-size: 15px; }
.sentence { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: end; gap: 15px 14px; font: 600 clamp(27px, 5vw, 40px)/1.08 Fraunces, serif; letter-spacing: -.035em; }
.word-unit { display: grid; grid-template-rows: auto auto; justify-items: center; align-items: end; min-width: max-content; text-align: center; }
.gloss { margin-bottom: 8px; color: var(--ink); font: 600 12px/1.15 "DM Sans", sans-serif; letter-spacing: 0; white-space: nowrap; opacity: .72; }
.latin-word { display: block; white-space: nowrap; }
.word-unit.is-blank .latin-word { min-width: 88px; padding: 1px 8px 3px; color: var(--coral); border-bottom: 2px solid #f2b9ad; letter-spacing: .07em; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 22px 25px; }
.choice { min-height: 67px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: var(--choice); text-align: left; cursor: pointer; transition: transform .13s ease, border-color .13s ease, background .13s ease; }
.choice:hover:not(:disabled) { border-color: var(--teal); transform: translateY(-2px); }
.choice:focus-visible, .new-round:focus-visible, .next-button:focus-visible { outline: 3px solid rgba(27, 158, 148, .35); outline-offset: 2px; }
.choice:disabled { cursor: default; }
.choice .abbr { display: block; color: var(--teal); font: 500 10px/1 "DM Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.choice .name { display: block; margin-top: 5px; font: 600 15px/1.1 Fraunces, serif; }
.form-choice { display: flex; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.form-choice .form { font: 700 21px/1 Georgia, "Times New Roman", serif; letter-spacing: -.02em; }
.form-choice .form-case { padding: 5px 7px; border-radius: 5px; color: var(--teal); background: var(--teal-pale); font: 700 11px/1 "DM Sans", sans-serif; }
.choice.is-correct { border-color: var(--teal); background: var(--teal-pale); }
.choice.is-wrong { border-color: var(--coral); background: var(--coral-pale); }
.feedback { min-height: 90px; padding: 16px 22px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 12px; background: var(--subtle); }
.feedback-icon { flex: 0 0 30px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; font-weight: 700; }
.feedback.correct .feedback-icon { color: #087269; background: var(--teal-pale); }
.feedback.wrong .feedback-icon { color: #b84937; background: var(--coral-pale); }
.feedback-title { margin: 0 0 3px; font-weight: 700; font-size: 14px; }
.feedback-detail { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.35; }
.next-button { margin-left: auto; border: 0; border-radius: 8px; padding: 11px 14px; color: #fff; background: var(--ink); font-weight: 600; cursor: pointer; white-space: nowrap; }
.next-button:hover { background: var(--teal); }
.case-key { padding: 82px 0 72px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 19px; }
h2 { font-size: 28px; line-height: 1; }
.section-heading .eyebrow { margin: 0; }
.key-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.key-grid article { min-height: 83px; padding: 16px 17px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.key-grid b { display: block; margin-bottom: 6px; color: var(--coral); font: 600 17px/1 Fraunces, serif; }
.key-grid span { color: var(--muted); font-size: 13px; }
.key-grid small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.3; }

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #f1f4fa;
    --muted: #aab5c9;
    --paper: #111827;
    --card: #182235;
    --line: #2d3a52;
    --coral: #ff927d;
    --coral-pale: #3c272a;
    --teal: #5ad2c6;
    --teal-pale: #193d40;
    --gold: #f1c96c;
    --choice: #1c2940;
    --subtle: #152036;
    --mark: #4a3034;
  }

  body { background: radial-gradient(circle at 8% 0%, #1e2d47 0, transparent 24rem), var(--paper); }
  .brand-mark { color: #172034; background: #f1f4fa; }
  .game-card { box-shadow: 0 12px 30px rgba(0, 0, 0, .22); }
  .word-unit.is-blank .latin-word { border-bottom-color: #b96f65; }
  .next-button { color: #172034; background: #f1f4fa; }
  .next-button:hover { color: #172034; background: var(--teal); }
  .feedback.correct .feedback-icon { color: var(--teal); background: var(--teal-pale); }
  .feedback.wrong .feedback-icon { color: var(--coral); background: var(--coral-pale); }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 28px, 860px); }
  .topbar { height: 72px; }
  .hero { padding: 38px 0 32px; }
  .sentence-wrap { padding: 32px 12px 26px; }
  .sentence { gap: 12px 8px; font-size: 23px; line-height: 1.08; }
  .gloss { margin-bottom: 6px; font-size: 10px; }
  .word-unit.is-blank .latin-word { width: 62px; min-width: 62px; padding: 1px 0 3px; color: transparent; letter-spacing: 0; }
  .choices { grid-template-columns: repeat(2, 1fr); padding: 0 13px 18px; }
  .form-choice { gap: 6px; padding: 10px 6px; }
  .form-choice .form { font-size: 18px; }
  .form-choice .form-case { padding: 4px 5px; font-size: 9px; }
  .round-status { gap: 6px; }
  .feedback { align-items: flex-start; flex-wrap: wrap; }
  .feedback > div:nth-child(2) { flex: 1; }
  .next-button { margin-left: 42px; margin-top: -5px; }
  .case-key { padding: 58px 0; }
  .section-heading { display: block; }
  .section-heading .eyebrow { margin-bottom: 10px; }
  .key-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 400px) {
  .sentence { gap: 10px 6px; font-size: 20px; }
  .gloss { font-size: 9px; }
  .word-unit.is-blank .latin-word { width: 54px; min-width: 54px; }
}
