:root { color-scheme: dark; }
* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; background: #091526; }
body { color: #f0f7ff; font-family: Arial, sans-serif; overflow: hidden; }
button { min-height: 44px; border: 1px solid #64d9ff; border-radius: 6px; background: #102c48; color: #f3fbff; cursor: pointer; font: inherit; font-weight: 800; touch-action: manipulation; }
button:hover, button:focus-visible { border-color: #ffe277; background: #1c4f76; outline: 2px solid transparent; }
button:focus-visible { outline-color: #ffe277; }
button.secondary { border-color: #597088; background: #17283b; color: #d3dfeb; }
#game-shell { position: relative; width: min(100vw, 960px); height: min(56.25vw, 540px); margin: 0 auto; overflow: hidden; }
#game-canvas { display: block; width: 100%; height: 100%; background: #091526; touch-action: manipulation; }
#hud { position: absolute; z-index: 2; top: 14px; right: 16px; left: 16px; display: flex; gap: 8px; pointer-events: none; }
#hud span { min-height: 28px; padding: 7px 9px; border: 1px solid rgba(106, 207, 246, .46); border-radius: 5px; background: rgba(5, 18, 34, .78); color: #d8f2ff; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
#hud #best-label { margin-left: auto; }
.overlay { position: absolute; z-index: 4; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 18px; background: rgba(4, 15, 29, .85); text-align: center; }
.overlay[hidden] { display: none; }
.overlay h1, .overlay h2 { margin: 0 0 10px; font-size: clamp(25px, 4vw, 42px); }
.overlay p { max-width: 450px; margin: 0; color: #c8ddec; line-height: 1.45; }
.eyebrow { margin-bottom: 8px !important; color: #79e9ba !important; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.overlay-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
.overlay-actions button, #start-button { min-width: 142px; padding: 9px 14px; }
#start-button { margin-top: 18px; }
#controls { position: absolute; z-index: 3; right: 12px; bottom: 12px; left: 12px; display: flex; justify-content: center; gap: 8px; }
#controls button { min-width: 48px; padding: 7px 12px; }
#pause-button { min-width: 104px !important; }
@media (max-width: 560px) {
  #hud { top: 8px; right: 8px; left: 8px; gap: 4px; }
  #hud span { min-height: 25px; padding: 6px; font-size: 9px; }
  #controls { right: 7px; bottom: 7px; left: 7px; gap: 4px; }
  #controls button { min-width: 42px; min-height: 42px; padding: 6px 8px; }
  #pause-button { min-width: 76px !important; }
  .overlay { padding: 12px; }
  .overlay p { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }
