* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #05070a;
  font-family: 'Consolas', 'Courier New', monospace;
  color: #7fe7ff;
}

#scene {
  position: fixed;
  inset: 0;
  display: block;
  outline: none;
}

/* ---------- HUD ---------- */
#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  transform: translate(-50%, -50%);
}
.ch-line {
  position: absolute;
  background: rgba(120, 240, 255, 0.85);
  box-shadow: 0 0 4px rgba(120,240,255,0.8);
}
.ch-h { top: 50%; left: 0; width: 100%; height: 1px; transform: translateY(-50%); }
.ch-v { left: 50%; top: 0; width: 1px; height: 100%; transform: translateX(-50%); }
.ch-dot {
  position: absolute;
  top: 50%; left: 50%;
  width: 4px; height: 4px;
  background: #ff5d3a;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

#topbar {
  position: absolute;
  top: 18px;
  left: 18px;
  right: 18px;
  display: flex;
  justify-content: flex-start;
}

#bottombar {
  position: absolute;
  bottom: 18px;
  left: 18px;
  right: 18px;
  display: flex;
  gap: 24px;
}

.panel {
  min-width: 220px;
}
.label {
  font-size: 11px;
  letter-spacing: 2px;
  color: #9fd8e8;
  text-shadow: 0 0 4px rgba(120,240,255,0.5);
  margin-bottom: 4px;
}
.bar {
  width: 100%;
  height: 10px;
  background: rgba(20, 40, 50, 0.6);
  border: 1px solid rgba(120,240,255,0.35);
  clip-path: polygon(6px 0, 100% 0, 100% 100%, 0 100%, 0 6px);
  overflow: hidden;
}
.fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff5d3a, #ffb23a);
  transition: width 0.08s linear;
}
.fill.boost {
  background: linear-gradient(90deg, #2ad1ff, #7fe7ff);
}
.fill.heat {
  background: linear-gradient(90deg, #ffdd3a, #ff5d3a);
}

#speed-readout, #alt-readout {
  position: absolute;
  bottom: 70px;
  font-size: 12px;
  letter-spacing: 1px;
  color: #9fd8e8;
}
#speed-readout { left: 18px; }
#alt-readout { left: 160px; }

#hitmarker {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26px;
  height: 26px;
  transform: translate(-50%, -50%) rotate(45deg) scale(0.4);
  opacity: 0;
  pointer-events: none;
}
#hitmarker::before, #hitmarker::after {
  content: "";
  position: absolute;
  background: #ff5d3a;
}
#hitmarker::before { top: 50%; left: 0; width: 100%; height: 2px; transform: translateY(-50%); }
#hitmarker::after { left: 50%; top: 0; width: 2px; height: 100%; transform: translateX(-50%); }
#hitmarker.show {
  animation: hitflash 0.25s ease-out;
}
@keyframes hitflash {
  0% { opacity: 1; transform: translate(-50%, -50%) rotate(45deg) scale(0.9); }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(45deg) scale(1.3); }
}

/* ---------- Start screen ---------- */
#start-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(10,20,28,0.9), rgba(2,4,6,0.98));
  text-align: center;
}
#start-screen h1 {
  font-size: 42px;
  letter-spacing: 8px;
  color: #7fe7ff;
  text-shadow: 0 0 14px rgba(120,240,255,0.6);
}
#start-screen .sub {
  margin-top: 8px;
  color: #6c8b94;
  font-size: 13px;
  letter-spacing: 1px;
}
#start-screen .controls {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 28px;
  font-size: 13px;
  color: #9fd8e8;
}
#start-btn {
  margin-top: 34px;
  padding: 12px 28px;
  background: transparent;
  border: 1px solid #7fe7ff;
  color: #7fe7ff;
  letter-spacing: 3px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px);
  transition: background 0.15s, color 0.15s;
}
#start-btn:hover {
  background: #7fe7ff;
  color: #05070a;
}
#start-screen.hidden {
  display: none;
}
