:root { --paper: #f7f7f7; --ink: #535353; --muted: #aaa; font-family: monospace; color: var(--ink); background: var(--paper); }
:root[data-theme="dark"] { --paper: #202226; --ink: #ececec; --muted: #919499; }
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; min-height: 100svh; display: grid; place-items: start center; align-content: start; }
.game-shell { width: min(900px, 100%); padding: 0 14px; }
.game-area { position: relative; width: 100%; aspect-ratio: 900 / 420; min-height: 290px; overflow: hidden; touch-action: manipulation; }
canvas { display: block; width: 100%; height: 100%; }
.scoreboard, .game-over span, .hint { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
#highScore { color: var(--muted); }
#highScore:empty { display: none; }
.game-over { position: absolute; left: 50%; top: 49%; transform: translateX(-50%); color: var(--ink); }
.game-over[hidden] { display: none; }
.game-over button { display: grid; place-items: center; width: 44px; height: 38px; border: 0; border-radius: 3px; background: var(--ink); color: var(--paper); cursor: pointer; }
.game-over button svg { width: 24px; height: 24px; }
.game-over button:hover, .game-over button:focus-visible { filter: brightness(.85); outline: 2px solid var(--ink); outline-offset: 3px; }
.mobile-controls { display: none; }
@media (max-width: 600px) {
  .game-shell { padding: 12px 10px; }
  .game-area { aspect-ratio: auto; height: min(290px, 52svh); min-height: 250px; }
  .game-over button { width: 56px; height: 52px; }
  .game-over button svg { width: 29px; height: 29px; }
  .mobile-controls { display: flex; justify-content: center; margin-top: 12px; }
  .mobile-controls button { display: grid; place-items: center; width: 88px; height: 64px; border: 0; border-radius: 6px; background: var(--ink); color: var(--paper); touch-action: none; user-select: none; cursor: pointer; }
  .mobile-controls button:active, .mobile-controls button:focus-visible { outline: 3px solid var(--muted); outline-offset: 3px; }
  .mobile-controls button svg { width: 35px; height: 35px; }
}
