:root {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  color: #f7f9fc;
  background: #080e1c;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top, #111c33 0, #080e1c 48rem); }
button, input { font: inherit; }
button { min-height: 44px; border: 1px solid #2563eb; border-radius: 10px; padding: .7rem 1rem; background: #2563eb; color: #fff; font-weight: 700; cursor: pointer; }
button.secondary { background: #111c33; color: #f7f9fc; }
button:disabled { cursor: not-allowed; opacity: .45; }
button:focus-visible, input:focus-visible, canvas:focus-visible { outline: 3px solid #5eead4; outline-offset: 3px; }
.game-shell { width: min(1500px, calc(100% - 2rem)); margin: 0 auto; padding: 2rem 0 3rem; }
.game-header { display: flex; justify-content: space-between; gap: 2rem; align-items: end; margin-bottom: 1rem; }
.eyebrow { margin: 0 0 .4rem; color: #5eead4; font: 700 .8rem ui-monospace, monospace; text-transform: uppercase; letter-spacing: .12em; }
h1 { margin: 0; font-size: clamp(2.4rem, 7vw, 5rem); letter-spacing: -.05em; }
.lede { max-width: 65ch; color: #94a3b8; margin-bottom: 0; }
.target-card { min-width: 260px; padding: 1rem; border: 1px solid #334155; border-radius: 14px; background: #0f172a; display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; align-items: center; }
.target-card strong { font-size: 2.8rem; color: #5eead4; grid-row: span 2; }
.target-card code { color: #f7f9fc; font-family: ui-monospace, monospace; }
.hud { display: grid; grid-template-columns: repeat(6, 1fr); gap: .65rem; margin-bottom: .8rem; }
.hud article { padding: .8rem 1rem; border: 1px solid #24324a; border-radius: 10px; background: #0d1525; }
.hud span { display: block; color: #64748b; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.hud strong { display: block; margin-top: .2rem; font: 700 1.1rem ui-monospace, monospace; }
.play-area { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 1rem; align-items: start; }
canvas { width: 100%; height: auto; display: block; border: 1px solid #334155; border-radius: 16px; background: #080e1c; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.side-panel { display: grid; gap: .75rem; }
.controls-card, .legend-card { border: 1px solid #24324a; border-radius: 12px; background: #0f172a; padding: 1rem; }
.side-panel h2 { margin: 0 0 .7rem; font-size: 1rem; }
kbd { display: inline-grid; min-width: 1.8rem; min-height: 1.8rem; place-items: center; margin-right: .2rem; border: 1px solid #475569; border-bottom-width: 3px; border-radius: 5px; background: #111c33; font: 700 .8rem ui-monospace, monospace; }
.button-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
dl { margin: 0; }
dl div { display: grid; grid-template-columns: 5rem 1fr; gap: .6rem; padding: .3rem 0; }
dt { color: #5eead4; font: 700 .8rem ui-monospace, monospace; }
dd { margin: 0; color: #94a3b8; font-size: .85rem; }
.run-footer { margin-top: 1rem; display: grid; grid-template-columns: minmax(220px,1fr) auto minmax(160px,240px) auto auto; align-items: center; gap: .6rem; padding: .75rem; border: 1px solid #24324a; border-radius: 12px; background: #0d1525; }
.run-footer p { margin: 0; color: #94a3b8; }
.run-footer input { min-height: 44px; border-radius: 9px; border: 1px solid #475569; background: #080e1c; color: #f7f9fc; padding: .55rem .7rem; }
.touch-controls { display: none; margin-top: .8rem; text-align: center; }
.touch-controls div { display: flex; justify-content: center; gap: .4rem; margin-top: .4rem; }
.touch-controls button { width: 58px; min-height: 54px; font-size: 1.4rem; }
[hidden] { display: none !important; }
@media (max-width: 1050px) {
  .hud { grid-template-columns: repeat(3, 1fr); }
  .play-area { grid-template-columns: 1fr; }
  .side-panel { grid-template-columns: repeat(3, 1fr); }
  .run-footer { grid-template-columns: 1fr 1fr; }
  .run-footer p { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .game-shell { width: min(100% - 1rem, 1500px); padding-top: 1rem; }
  .game-header { display: grid; }
  .target-card { min-width: 0; }
  .hud { grid-template-columns: repeat(2, 1fr); }
  .side-panel { grid-template-columns: 1fr; }
  .button-row { grid-template-columns: 1fr; }
  .run-footer { grid-template-columns: 1fr; }
  .run-footer p { grid-column: auto; }
}
@media (pointer: coarse) { .touch-controls { display: block; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
