:root {
  color-scheme: light;
  --ink: #172a26;
  --muted: #68736c;
  --paper: #f2efe7;
  --card: #fffdf7;
  --line: #d8d6c9;
  --green: #164b3c;
  --orange: #e87936;
  --road: #485451;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-rounded, "Trebuchet MS", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; }
.page { width: min(1040px, calc(100% - 40px)); margin: 0 auto; padding: 25px 0 20px; }
.topbar { height: 34px; display: flex; justify-content: space-between; align-items: flex-start; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.back-link { color: inherit; text-decoration: none; letter-spacing: 0; font-size: 13px; }
.back-link:hover { color: var(--green); }
.edition { border: 1px solid var(--line); padding: 6px 9px; border-radius: 99px; font-size: 9px; }
.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 14px 0 22px; }
.eyebrow { margin: 0 0 7px; color: #b85b2c; font-size: 10px; font-weight: 900; letter-spacing: .17em; }
h1 { margin: 0; font-size: clamp(38px, 6vw, 58px); line-height: .97; letter-spacing: -.055em; }
h1 span { color: var(--orange); }
.dek { max-width: 515px; margin: 12px 0 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.intro-stamp { width: 74px; height: 74px; margin: 0 8px 2px 0; border: 2px solid #cad1bd; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--green); transform: rotate(10deg); flex: 0 0 auto; }
.intro-stamp span { font-size: 8px; letter-spacing: .12em; font-weight: 900; }
.intro-stamp b { font-size: 23px; line-height: 1.1; }
.game-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(250px, .75fr); align-items: start; gap: 18px; }
.game-card, .instruction-card, .best-card { border: 1px solid var(--line); border-radius: 17px; background: var(--card); box-shadow: 0 4px 16px #26372a0a; }
.game-card { overflow: hidden; }
.hud { display: grid; grid-template-columns: 1fr 1fr 1fr; min-height: 68px; padding: 11px 15px 9px; border-bottom: 1px solid var(--line); }
.hud-item { display: flex; flex-direction: column; justify-content: center; gap: 1px; }
.hud-item + .hud-item { border-left: 1px solid var(--line); padding-left: 16px; }
.hud-label { color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.hud strong { font-size: 25px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.lives-item strong { color: var(--orange); font-size: 14px; letter-spacing: .14em; padding-top: 5px; white-space: nowrap; }
.lives-item strong .spent { color: #d7d7cb; }
.timer-item strong { color: var(--green); }
.timer-item small { color: var(--muted); font-size: 11px; font-weight: 700; }
.road-wrap { position: relative; width: 100%; aspect-ratio: 2 / 3; overflow: hidden; background: #dbe3c5; touch-action: manipulation; }
canvas { display: block; width: 100%; height: 100%; cursor: crosshair; }
.screen { position: absolute; inset: 0; display: grid; place-items: center; padding: 18px; background: #1429238c; transition: opacity .18s ease; }
.screen.is-hidden { opacity: 0; pointer-events: none; }
.screen-card { width: min(100%, 300px); padding: 25px 22px 21px; border: 1px solid #ffffffc9; border-radius: 17px; background: #fffdf7; text-align: center; box-shadow: 0 12px 36px #10241e42; }
.screen-icon { font-size: 34px; }
.screen-kicker { margin: 6px 0 7px; color: #b85b2c; font-size: 9px; font-weight: 900; letter-spacing: .16em; }
.screen-card h2 { margin: 0; font-size: 26px; letter-spacing: -.04em; }
.screen-card > p:not(.screen-kicker):not(.keyboard-hint) { margin: 9px 0 15px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.start-button { width: 100%; min-height: 47px; border: 0; border-radius: 10px; background: var(--green); color: white; font-weight: 900; cursor: pointer; box-shadow: 0 4px 0 #0c3026; }
.start-button span { margin-left: 5px; }
.start-button:hover { background: #21634e; }
.start-button:active { transform: translateY(2px); box-shadow: 0 2px 0 #0c3026; }
.keyboard-hint { margin: 13px 0 0; color: var(--muted); font-size: 10px; }
kbd { padding: 2px 5px; border: 1px solid var(--line); border-radius: 4px; background: #f4f1e7; color: var(--ink); font: inherit; }
.game-footer { display: flex; justify-content: space-between; gap: 10px; padding: 12px 15px; color: var(--muted); font-size: 10px; font-weight: 700; }
.game-footer span { display: flex; align-items: center; gap: 6px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dot-wrong { background: var(--orange); }
.dot-right { background: #76a486; }
.side-panel { display: grid; gap: 14px; }
.instruction-card { padding: 19px 19px 18px; }
.card-number { display: flex; justify-content: space-between; color: #b85b2c; font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.card-number span { color: #929a8e; }
.instruction-card h2 { margin: 15px 0 12px; font-size: 23px; letter-spacing: -.04em; line-height: 1.1; }
.instruction-card ol { list-style: none; margin: 0; padding: 0; counter-reset: steps; }
.instruction-card li { position: relative; margin-top: 12px; padding-left: 28px; color: var(--muted); font-size: 12px; line-height: 1.48; counter-increment: steps; }
.instruction-card li::before { content: counter(steps); position: absolute; left: 0; top: 0; width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center; background: #e8eee1; color: var(--green); font-size: 10px; font-weight: 900; }
.instruction-card li b { color: var(--ink); }
.best-card { padding: 16px 19px; background: #e6ebdd; border-color: #d4ddca; }
.best-card > span { color: #597265; font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.best-card strong { display: flex; align-items: baseline; gap: 6px; margin-top: 4px; color: var(--green); }
.best-card strong b { font-size: 36px; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.best-card strong small { color: #597265; font-size: 11px; font-weight: 700; }
.best-card p { margin: 1px 0 0; color: #66766a; font-size: 10px; }
.signoff { margin: 2px 4px; color: #758076; font-size: 12px; line-height: 1.5; }
.signoff b { color: var(--green); }
.page-footer { display: flex; justify-content: space-between; gap: 10px; margin: 17px 2px 0; color: #7c847b; font-size: 10px; }

@media (min-width: 760px) {
  .game-card { max-width: 550px; }
}
@media (max-width: 680px) {
  .page { width: min(100% - 24px, 480px); padding-top: 17px; }
  .game-layout { grid-template-columns: 1fr; gap: 12px; }
  .intro { padding: 12px 0 17px; }
  .intro-stamp { width: 59px; height: 59px; margin-right: 2px; }
  .intro-stamp span { font-size: 7px; }
  .intro-stamp b { font-size: 19px; }
  .dek { max-width: 390px; font-size: 13px; }
  .side-panel { grid-template-columns: 1fr 1fr; align-items: stretch; gap: 10px; }
  .instruction-card { grid-row: span 2; padding: 16px 14px; }
  .instruction-card h2 { margin-top: 12px; font-size: 20px; }
  .instruction-card li { font-size: 11px; }
  .best-card { padding: 13px; }
  .signoff { align-self: center; font-size: 11px; }
  .page-footer { font-size: 9px; }
}
@media (max-width: 390px) {
  .edition { font-size: 8px; }
  .intro-stamp { display: none; }
  .game-footer { padding: 10px 9px; font-size: 9px; }
  .side-panel { grid-template-columns: 1fr; }
  .instruction-card { grid-row: auto; }
  .best-card { display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .best-card strong { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
  .best-card p { grid-column: 1; }
  .page-footer span:last-child { text-align: right; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }
