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

body {
  background: #000;
  overflow: hidden;
  font-family: 'Orbitron', 'Courier New', monospace;
  color: #0f0;
}

/* ─── Babylon canvas ───────────────────────────────────── */
#renderCanvas {
  width: 100vw;
  height: 100vh;
  display: block;
  touch-action: none;
  outline: none;
}

/* ─── HUD ──────────────────────────────────────────────── */
#hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: none;                /* shown when playing */
  justify-content: space-between;
  padding: 14px 22px;
  pointer-events: none;
  z-index: 10;
  font-size: 13px;
  letter-spacing: 1px;
  text-shadow: 0 0 6px #0f0;
}
#hudLeft, #hudRight { display: flex; flex-direction: column; gap: 5px; }
#hudRight { text-align: right; }

.hud-label { opacity: 0.55; font-size: 10px; }

/* fuel bar */
#fuelBar {
  width: 120px; height: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(0,255,0,0.3);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 2px;
}
#fuelFill {
  height: 100%;
  width: 100%;
  background: #0f0;
  transition: width 0.2s, background 0.3s;
  border-radius: 2px;
}

/* ─── Overlays ─────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.82);
  z-index: 20;
  text-align: center;
  gap: 16px;
}

.overlay h1 {
  font-size: clamp(28px, 6vw, 56px);
  color: #0f0;
  text-shadow: 0 0 20px #0f0, 0 0 40px #090;
  letter-spacing: 6px;
}
.overlay h2 {
  font-size: clamp(22px, 4vw, 40px);
  letter-spacing: 3px;
  text-shadow: 0 0 12px currentColor;
}
.overlay h2.crash { color: #f44; text-shadow: 0 0 18px #f44; }

.overlay p {
  font-size: 14px;
  opacity: 0.8;
  max-width: 480px;
  line-height: 1.6;
}

.overlay .instructions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0;
  font-size: 13px;
  opacity: 0.7;
}

.overlay button {
  margin-top: 18px;
  padding: 12px 32px;
  font-family: inherit;
  font-size: 15px;
  letter-spacing: 2px;
  color: #0f0;
  background: transparent;
  border: 1.5px solid #0f0;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  text-transform: uppercase;
}
.overlay button:hover,
.overlay button:focus {
  background: rgba(0, 255, 0, 0.1);
  box-shadow: 0 0 18px rgba(0, 255, 0, 0.35);
  outline: none;
}

#resultOverlay { display: none; }

/* scanline effect */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.06) 2px,
    rgba(0,0,0,0.06) 4px
  );
  pointer-events: none;
  z-index: 100;
}

/* ─── Mobile helpers ───────────────────────────────────── */
@media (max-width: 640px) {
  #hud { font-size: 11px; padding: 8px 12px; }
  #fuelBar { width: 80px; }
}
