:root {
  color-scheme: dark;
  --ink: #f5ead8;
  --muted: #bda98f;
  --bg: #17110e;
  --panel: #241914;
  --card: #34241d;
  --open: #f0d9ae;
  --open-ink: #231812;
  --accent: #f08a5d;
  --good: #98d88a;
  --bad: #d7a7ff;
  --line: rgba(245, 234, 216, 0.18);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(240, 138, 93, 0.2), transparent 34rem),
    linear-gradient(135deg, #17110e 0%, #251914 60%, #120d0b 100%);
}
button { font: inherit; }
.shell { width: min(1180px, calc(100vw - 32px)); margin: 0 auto; padding: 36px 0 28px; }
.hero { max-width: 780px; margin-bottom: 24px; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 800; font-size: 0.78rem; }
h1 { font-size: clamp(2.2rem, 6vw, 5.4rem); line-height: 0.92; margin: 0 0 14px; }
.lede { color: var(--muted); font-size: 1.1rem; line-height: 1.55; margin: 0; }
.play { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(280px, 420px); gap: 22px; align-items: start; }
.board-panel, .text-panel { background: rgba(36, 25, 20, 0.88); border: 1px solid var(--line); border-radius: 24px; padding: 18px; box-shadow: 0 24px 80px rgba(0,0,0,0.25); }
.coach { margin: 0 0 14px; color: var(--ink); background: rgba(240, 138, 93, 0.12); border: 1px solid rgba(240, 138, 93, 0.35); border-radius: 16px; padding: 12px 14px; font-weight: 800; }
.hud { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; color: var(--muted); margin-bottom: 14px; }
.hud span { border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; background: rgba(255,255,255,0.03); }
.board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.card { min-height: 108px; border: 1px solid var(--line); border-radius: 18px; padding: 10px; display: grid; place-items: center; text-align: center; background: linear-gradient(145deg, #3b2921, #261a15); color: var(--ink); cursor: pointer; transition: transform 140ms ease, background 140ms ease, border-color 140ms ease; }
.card:hover:not(:disabled), .card:focus-visible { transform: translateY(-2px); border-color: var(--accent); outline: none; }
.card::before { content: "✦"; font-size: 1.5rem; color: rgba(245,234,216,0.48); }
.card.open, .card.matched, .card.miss { background: var(--open); color: var(--open-ink); font-family: Georgia, "Times New Roman", serif; font-size: clamp(0.86rem, 1.7vw, 1rem); line-height: 1.25; }
.card.open::before, .card.matched::before, .card.miss::before { content: attr(data-fragment); color: inherit; font-size: inherit; }
.card.matched { border-color: rgba(152,216,138,0.9); box-shadow: 0 0 0 2px rgba(152,216,138,0.18) inset; }
.card.miss { border-color: rgba(215,167,255,0.9); box-shadow: 0 0 0 2px rgba(215,167,255,0.18) inset; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.actions button { border: 1px solid var(--line); background: #4a3026; color: var(--ink); border-radius: 999px; padding: 10px 14px; cursor: pointer; }
.actions button:hover, .actions button:focus-visible { border-color: var(--accent); outline: none; }
.text-panel { display: grid; gap: 18px; }
.quiet { display: none; }
h2 { margin: 0 0 8px; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); }
ol { margin: 0; padding-left: 1.35rem; display: grid; gap: 8px; }
.matched li { color: var(--ink); font-family: Georgia, "Times New Roman", serif; line-height: 1.35; }
.misreadings li { color: #dfc4ff; font-family: Georgia, "Times New Roman", serif; font-style: italic; line-height: 1.35; }
.threads li { color: var(--muted); line-height: 1.35; }
.final { min-height: 2rem; margin: 0; color: var(--good); font-weight: 800; }
.note { color: var(--muted); border-top: 1px solid var(--line); margin-top: 24px; padding-top: 16px; font-size: 0.92rem; }
@media (max-width: 820px) {
  .play { grid-template-columns: 1fr; }
  .card { min-height: 86px; }
}
