*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #090d16;
  color: #f8fafc;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}

.app-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  width: 100dvw;
  height: 100dvh;
  overflow: hidden;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

#game-canvas.is-pointer {
  cursor: pointer;
}

.touch-controls {
  position: fixed;
  left: 0;
  right: 0;
  bottom: max(10px, env(safe-area-inset-bottom));
  display: none;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 12px;
  pointer-events: none;
  z-index: 10;
}

body.touch-enabled .touch-controls {
  display: flex;
}

@media (pointer: coarse), (max-width: 900px) {
  .touch-controls {
    display: flex;
  }
}

.touch-cluster {
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: auto;
}

body.in-garage .touch-drive-pad {
  opacity: 0.18;
  pointer-events: none;
}

.touch-row {
  display: flex;
  gap: 6px;
}

.touch-btn {
  appearance: none;
  border: 2px solid rgba(0, 255, 162, 0.55);
  border-radius: 12px;
  background: rgba(10, 16, 28, 0.78);
  color: #f8fafc;
  font-weight: 800;
  font-size: 13px;
  padding: 10px 13px;
  min-width: 62px;
  min-height: 44px;
  touch-action: none;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: transform 0.06s ease, background-color 0.1s ease, border-color 0.1s ease;
}

.touch-horn {
  border-color: #ffd700;
  background: rgba(52, 36, 6, 0.84);
  color: #ffd700;
  font-size: 14px;
  padding: 12px 16px;
}

.touch-garage.is-active {
  background: rgba(0, 184, 118, 0.9);
  color: #041f14;
  border-color: #ffffff;
}

.touch-mute.is-muted {
  border-color: #ef233c;
  color: #fca5a5;
}

.touch-btn.is-pressed {
  transform: scale(0.94);
  background: rgba(0, 255, 162, 0.34);
  border-color: #ffffff;
}
