:root { color-scheme: dark; font-family: Arial, Helvetica, sans-serif; background: #071b26; }
* { box-sizing: border-box; }
html, body, #game-shell { min-height: 100%; margin: 0; }
body { background: #071b26; color: #f4fff8; overflow: hidden; }
button { font: inherit; }
#game-shell { display: grid; min-height: 100vh; place-items: center; }
#stage { background: #071b26; height: min(56.25vw, 540px); max-height: 100vh; max-width: 177.7778vh; overflow: hidden; position: relative; width: min(100vw, 960px); }
#game-canvas { display: block; height: 100%; outline: none; touch-action: none; width: 100%; }
#hud { display: grid; gap: 7px; grid-template-columns: repeat(4, 1fr); inset: 14px 16px auto; pointer-events: none; position: absolute; }
#hud div { background: rgba(3, 25, 34, .84); border: 1px solid rgba(126, 238, 203, .34); border-radius: 7px; min-width: 0; padding: 6px 8px; }
#hud span, .kicker { color: #89e8ca; display: block; font-size: 9px; font-weight: 800; letter-spacing: 1.2px; }
#hud strong { color: #f4fff8; display: block; font-size: 16px; line-height: 1.1; margin-top: 2px; }
#utility-controls { display: flex; gap: 7px; position: absolute; right: 16px; top: 73px; }
#utility-controls button, .result-actions button { background: rgba(5, 37, 48, .95); border: 1px solid rgba(151, 255, 221, .52); border-radius: 7px; color: #effff8; cursor: pointer; font-weight: 900; min-height: 44px; min-width: 44px; }
#utility-controls button:focus-visible, .move-button:focus-visible, .jump-button:focus-visible, .panel button:focus-visible { outline: 3px solid #ffd26e; outline-offset: 2px; }
.panel { background: rgba(3, 24, 33, .96); border: 1px solid rgba(128, 239, 204, .58); border-radius: 8px; box-shadow: 0 20px 56px rgba(0, 0, 0, .48); left: 50%; padding: 25px; position: absolute; text-align: center; top: 50%; transform: translate(-50%, -50%); width: min(440px, calc(100% - 32px)); }
.panel.compact { width: min(360px, calc(100% - 32px)); }
.panel h1, .panel h2 { color: #f4fff8; font-size: 30px; letter-spacing: .2px; margin: 8px 0 10px; }
.panel h2 { font-size: 24px; }
.panel p { color: #c8ebe2; font-size: 15px; line-height: 1.45; margin: 9px 0; }
.panel .controls-copy { color: #98d4c5; font-size: 13px; }
.primary { background: #8df0cc; border: 0; border-radius: 7px; color: #062a25; cursor: pointer; font-weight: 900; min-height: 48px; padding: 0 18px; }
.result-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }
.result-actions button { padding: 0 14px; }
.result-actions button.primary { background: #8df0cc; border-color: transparent; color: #062a25; }
.best-result { color: #ffd26e !important; font-weight: 800; }
#move-controls { bottom: 13px; display: grid; gap: 8px; grid-template-columns: 64px minmax(120px, 170px) 64px; left: 50%; position: absolute; transform: translateX(-50%); }
.move-button, .jump-button { background: rgba(6, 42, 54, .94); border: 1px solid rgba(146, 247, 215, .58); border-radius: 8px; color: #effff8; cursor: pointer; font-weight: 900; min-height: 52px; touch-action: manipulation; }
.move-button { font-size: 22px; }
.jump-button { background: #245f58; font-size: 12px; letter-spacing: 1px; }
.move-button[data-active="true"] { background: #357e71; border-color: #b1ffdf; }
#toast { background: rgba(2, 16, 23, .9); border-radius: 999px; bottom: 76px; color: #f4fff8; font-size: 12px; font-weight: 800; left: 50%; letter-spacing: .4px; margin: 0; padding: 7px 12px; pointer-events: none; position: absolute; transform: translateX(-50%); }
body[data-game-state="ready"] #hud, body[data-game-state="ready"] #utility-controls { opacity: .42; }
body[data-game-state="ready"] #move-controls, body[data-game-state="paused"] #move-controls, body[data-game-state="crashed"] #move-controls, body[data-game-state="complete"] #move-controls { visibility: hidden; }
@media (orientation: landscape) { #stage { height: 100vh; width: 177.7778vh; } }
@media (max-width: 600px) {
  #hud { gap: 3px; inset: 7px 7px auto; }
  #hud div { border-radius: 5px; padding: 3px 4px; }
  #hud span { font-size: 6px; letter-spacing: .5px; }
  #hud strong { font-size: 11px; }
  #utility-controls { gap: 4px; right: 7px; top: 49px; }
  #utility-controls button { font-size: 9px; min-height: 40px; min-width: 40px; }
  #move-controls { bottom: 7px; gap: 5px; grid-template-columns: 52px minmax(112px, 140px) 52px; }
  .move-button, .jump-button { border-radius: 6px; min-height: 44px; }
  .move-button { font-size: 17px; }
  .jump-button { font-size: 9px; }
  #toast { bottom: 59px; font-size: 8px; padding: 5px 8px; }
  .panel { padding: 15px; }
  .panel h1 { font-size: 22px; }
  .panel h2 { font-size: 19px; }
  .panel p { font-size: 11px; margin: 7px 0; }
  .panel .controls-copy { font-size: 9px; }
  .primary { font-size: 12px; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; scroll-behavior: auto !important; transition-duration: .01ms !important; } }
