:root {
  --ink: #163d37;
  --ink-soft: #52736c;
  --cream: #f7f3e7;
  --paper: #fffdf6;
  --coral: #ef6e58;
  --leaf: #7ab083;
  --sun: #f5c66a;
  --line: rgba(22, 61, 55, .15);
  --shadow: 0 24px 50px rgba(22, 61, 55, .12);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--cream); }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 12%, rgba(245, 198, 106, .18), transparent 23rem),
    radial-gradient(circle at 90% 50%, rgba(122, 176, 131, .13), transparent 28rem),
    var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "kern" 1;
}
body::before {
  content: "";
  display: block;
  height: 9px;
  background: var(--ink);
}
button, canvas { -webkit-tap-highlight-color: transparent; }
.game-shell { width: min(1120px, calc(100% - 44px)); margin: 0 auto; padding: 26px 0 30px; }
.masthead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.brand-lockup { display: flex; gap: 11px; align-items: center; letter-spacing: -.04em; }
.brand-mark { width: 31px; height: 31px; border: 2px solid var(--ink); border-radius: 50%; display: grid; place-items: center; color: var(--coral); font-size: 24px; line-height: 1; transform: rotate(-18deg); }
.brand-mark::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); position: absolute; transform: translate(7px, -8px); }
.brand-lockup strong { display: block; font-size: 17px; letter-spacing: .08em; line-height: 1; }
.brand-lockup small { display: block; margin-top: 5px; color: var(--ink-soft); font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 8px; letter-spacing: .18em; font-weight: 700; }
.top-tip { color: var(--ink-soft); font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 9px; font-weight: 700; letter-spacing: .15em; }
.tip-dot { display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 4px rgba(239,110,88,.13); }
.game-card { overflow: hidden; border: 1px solid rgba(22,61,55,.08); background: var(--paper); border-radius: 19px; box-shadow: var(--shadow); }
.hud { height: 74px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(255,253,246,.85); }
.hud-stat { display: flex; gap: 6px; align-items: baseline; }
.hud-stat-right { justify-content: flex-end; }
.hud-label { color: var(--ink-soft); font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 9px; font-weight: 700; letter-spacing: .15em; }
.hud-stat strong { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 23px; letter-spacing: -.08em; }
.hud-unit { color: var(--ink-soft); font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 10px; }
.run-state { display: flex; align-items: center; gap: 8px; padding: 9px 15px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 9px; font-weight: 700; letter-spacing: .1em; white-space: nowrap; }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--leaf); box-shadow: 0 0 0 4px rgba(122,176,131,.14); }
.canvas-wrap { position: relative; overflow: hidden; background: #bfe4cf; }
canvas { position: relative; z-index: 1; display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; outline: none; cursor: pointer; image-rendering: auto; }
.canvas-wrap:focus-within { box-shadow: inset 0 0 0 3px var(--coral); }
.canvas-glow { position: absolute; z-index: 2; inset: 0; pointer-events: none; box-shadow: inset 0 0 65px rgba(17,51,43,.12); }
.card-footer { display: flex; align-items: center; justify-content: space-between; height: 54px; padding: 0 26px; border-top: 1px solid var(--line); background: var(--paper); }
.mini-instruction, .speed-readout { color: var(--ink-soft); font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 9px; font-weight: 700; letter-spacing: .09em; }
.keycap { display: inline-grid; place-items: center; min-width: 24px; height: 20px; margin-right: 3px; padding: 0 5px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: #f5f0df; font-size: 8px; }
.tap-icon, .speed-leaf { color: var(--coral); font-size: 14px; vertical-align: -1px; }
.intro-row { display: grid; grid-template-columns: 1.08fr .92fr; gap: 80px; padding: 56px 4px 42px; }
.eyebrow { margin: 0 0 12px; color: var(--coral); font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 10px; font-weight: 700; letter-spacing: .15em; }
h1 { margin: 0; font-size: clamp(46px, 7vw, 78px); letter-spacing: -.08em; line-height: .88; font-weight: 760; }
h1 em { color: var(--coral); font-family: Georgia, serif; font-weight: 400; letter-spacing: -.08em; }
.intro-copy { align-self: end; max-width: 390px; padding-bottom: 2px; }
.intro-copy p { margin: 0 0 19px; color: var(--ink-soft); font-size: 16px; line-height: 1.58; letter-spacing: -.02em; }
.control-list { display: flex; flex-wrap: wrap; gap: 8px 17px; color: var(--ink-soft); font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 9px; letter-spacing: .05em; }
.control-list b { color: var(--ink); }
.footer-note { margin: 0; color: var(--ink-soft); font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 8px; letter-spacing: .13em; text-align: center; }
@media (max-width: 700px) {
  .game-shell { width: min(100% - 22px, 1120px); padding-top: 18px; }
  .top-tip { display: none; }
  .hud { height: 65px; padding: 0 13px; }
  .hud-label { display: none; }
  .hud-stat strong { font-size: 19px; }
  .run-state { padding: 7px 10px; font-size: 8px; gap: 6px; }
  .card-footer { height: 48px; padding: 0 13px; }
  .mini-instruction, .speed-readout { font-size: 8px; letter-spacing: .03em; }
  .speed-readout { display: none; }
  .intro-row { grid-template-columns: 1fr; gap: 22px; padding: 35px 3px 30px; }
  .intro-copy { max-width: none; }
}
@media (max-width: 420px) {
  .hud { grid-template-columns: 1fr auto 1fr; }
  .run-state { max-width: 115px; overflow: hidden; text-overflow: ellipsis; }
  .mini-instruction:last-child { font-size: 0; }
  .mini-instruction:last-child .tap-icon { font-size: 16px; }
}
