* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #7ec8ff; overscroll-behavior: none; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body { font-family: 'Fredoka', 'Arial Rounded MT Bold', 'Nunito', system-ui, sans-serif; }
#app { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
#stage { position: relative; }
#game, #ui { position: absolute; left: 0; top: 0; display: block; }
/* world: low-res pixel canvas, nearest-neighbour upscale. ui: device-resolution overlay for text/HUD, never receives input */
#game { image-rendering: pixelated; image-rendering: crisp-edges; touch-action: none; cursor: pointer; }
#ui { pointer-events: none; z-index: 2; }

/* HUD: big round buttons for small fingers. pointerdown-driven, never click. */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.big-btn {
  position: absolute; pointer-events: auto; width: 72px; height: 72px; border-radius: 50%;
  border: 4px solid #fff; background: #ffcc33; box-shadow: 0 6px 0 #c98a00, 0 10px 18px rgba(0,0,0,.25);
  font-size: 34px; line-height: 1; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: transform .08s ease; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.big-btn:active, .big-btn.pressed { transform: translateY(4px) scale(.94); box-shadow: 0 2px 0 #c98a00, 0 4px 10px rgba(0,0,0,.25); }
.big-btn .emoji { pointer-events: none; }
.big-btn img { width: 44px; height: 44px; image-rendering: pixelated; pointer-events: none; }
#btn-garage { left: calc(14px + env(safe-area-inset-left)); top: calc(14px + env(safe-area-inset-top)); background: #6fd3ff; box-shadow: 0 6px 0 #2f8fc0, 0 10px 18px rgba(0,0,0,.25); }
#btn-garage:active, #btn-garage.pressed { box-shadow: 0 2px 0 #2f8fc0, 0 4px 10px rgba(0,0,0,.25); }
#btn-music { right: calc(14px + env(safe-area-inset-right)); top: calc(14px + env(safe-area-inset-top)); width: 56px; height: 56px; font-size: 26px; background: #ff8fb8; box-shadow: 0 6px 0 #c04a78, 0 10px 18px rgba(0,0,0,.25); }
#btn-music:active, #btn-music.pressed { box-shadow: 0 2px 0 #c04a78, 0 4px 10px rgba(0,0,0,.25); }
#btn-music.muted { filter: grayscale(1) brightness(.85); }
#btn-horn { right: calc(18px + env(safe-area-inset-right)); bottom: calc(18px + env(safe-area-inset-bottom)); width: 96px; height: 96px; font-size: 46px; background: #ff6b57; box-shadow: 0 8px 0 #b8362a, 0 12px 20px rgba(0,0,0,.3); }
#btn-horn:active, #btn-horn.pressed { box-shadow: 0 2px 0 #b8362a, 0 4px 10px rgba(0,0,0,.3); }
@media (max-width: 600px) {
  .big-btn { width: 58px; height: 58px; font-size: 26px; }
  #btn-horn { width: 76px; height: 76px; font-size: 36px; }
  #btn-music { width: 46px; height: 46px; font-size: 20px; }
}

.hidden { display: none !important; }

#loading { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: linear-gradient(#7ec8ff, #d9f3ff); transition: opacity .5s ease; }
#loading .logo { color: #ff6b57; font-weight: 700; font-size: clamp(40px, 9vw, 84px); line-height: .95; text-align: center; text-shadow: 0 4px 0 #b8362a, 0 8px 0 rgba(0,0,0,.15); letter-spacing: 1px; }
#track { width: min(320px, 70vw); height: 18px; background: rgba(255,255,255,.55); border-radius: 12px; overflow: hidden; border: 3px solid #fff; }
#bar { height: 100%; width: 0%; border-radius: 12px; background: linear-gradient(90deg, #ffcc33, #ff6b57); transition: width .2s ease; }
#loadtxt { color: #245b8a; font-size: 16px; font-weight: 600; }
