* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #000; }
#game { display: block; width: 100vw; height: 100vh; }

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  user-select: none;
  font-family: 'Menlo', 'Consolas', 'Courier New', monospace;
  color: white;
}

/* Score — top-right, dominant readout. */
#score {
  position: absolute;
  top: 20px;
  right: 20px;
  text-align: right;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}
.score-label {
  font-size: 13px;
  letter-spacing: 0.25em;
  opacity: 0.85;
  margin-bottom: 4px;
}
.score-value {
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.score-unit { font-size: 28px; opacity: 0.9; }

/* Timer — sits just below the score, top-right. Turns red in the final 30 s. */
#timer {
  position: absolute;
  top: 110px;
  right: 20px;
  text-align: right;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}
.timer-label {
  font-size: 11px;
  letter-spacing: 0.3em;
  opacity: 0.75;
  margin-bottom: 2px;
}
.timer-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: color 0.15s ease;
}
.timer-value.danger { color: #ff4040; }

/* High score — bottom-right, quieter target reference. */
#high-score {
  position: absolute;
  bottom: 20px;
  right: 20px;
  text-align: right;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}
.high-score-label {
  font-size: 11px;
  letter-spacing: 0.3em;
  opacity: 0.75;
  margin-bottom: 2px;
}
.high-score-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.high-score-unit { font-size: 14px; opacity: 0.85; }

/* Speedometer + odometer cluster — bottom-left. */
#speedometer {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  height: 160px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}
.dial-bg {
  fill: rgba(18, 20, 26, 0.78);
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 1;
}
.dial-arc {
  fill: none;
  stroke: rgba(255, 255, 255, 0.55);
  stroke-width: 2;
}
.dial-tick {
  stroke: rgba(255, 255, 255, 0.8);
  stroke-width: 1.6;
  stroke-linecap: round;
}
.dial-tick-label {
  fill: rgba(255, 255, 255, 0.88);
  font-size: 9px;
  font-weight: 700;
  text-anchor: middle;
  font-family: inherit;
}
.dial-mph-label {
  fill: rgba(255, 255, 255, 0.7);
  font-size: 9px;
  letter-spacing: 0.25em;
  text-anchor: middle;
  font-family: inherit;
}
.dial-needle {
  stroke: #ff5252;
  stroke-width: 2.5;
  stroke-linecap: round;
}
.dial-needle-pivot { fill: #ddd; }

.odo-whole-bg {
  fill: #0a0a0a;
  stroke: rgba(255, 255, 255, 0.35);
  stroke-width: 0.5;
}
.odo-whole {
  fill: white;
  font-size: 12px;
  font-weight: 700;
  text-anchor: end;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}
.odo-tenths-bg {
  fill: #e8e8e8;
  stroke: rgba(0, 0, 0, 0.35);
  stroke-width: 0.5;
}
.odo-tenths {
  fill: #0a0a0a;
  font-size: 12px;
  font-weight: 700;
  text-anchor: middle;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}

/* Wheelie cooldown ring — dead-center screen overlay so it sits in the player's eyeline. */
#wheelie-cooldown {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 96px;
  height: 96px;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.15s ease;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
}
#wheelie-cooldown.show { opacity: 0.92; }
.cooldown-track {
  fill: none;
  stroke: rgba(0, 0, 0, 0.55);
  stroke-width: 6;
}
.cooldown-fill {
  fill: none;
  stroke: #ffb84a;
  stroke-width: 6;
  stroke-linecap: butt;
}

/* Crash overlay — centered modal, fades in over slow-mo window. */
#crash-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.8s ease;
}
#crash-overlay.show { opacity: 1; }
.crash-content {
  text-align: center;
  color: white;
}
.crash-title {
  font-size: 64px;
  font-weight: 900;
  letter-spacing: 0.18em;
  margin-bottom: 14px;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.8);
}
.crash-score {
  font-size: 44px;
  font-weight: 700;
  margin-bottom: 44px;
  opacity: 0.95;
  font-variant-numeric: tabular-nums;
}
.crash-prompt {
  font-size: 16px;
  letter-spacing: 0.3em;
  opacity: 0.85;
}

/* Mute indicator — bottom-left. Hint when audio is on, alert when muted. */
#mute-indicator {
  position: absolute;
  bottom: 20px;
  left: 20px;
  font-size: 13px;
  letter-spacing: 0.25em;
  font-weight: 700;
  opacity: 0.4;
  transition: opacity 0.15s ease;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}
#mute-indicator.muted { opacity: 0.85; }
