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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0b0e14;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  outline: none;
  cursor: grab;
}
#scene:active { cursor: grabbing; }

/* ---------- loader ---------- */
#loader {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 30%, #1a2030 0%, #06070b 70%);
  z-index: 1000;
  transition: opacity .6s ease;
}
#loader.gone { opacity: 0; pointer-events: none; }
.loader-inner { width: min(420px, 80vw); text-align: center; }
.brand {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 900;
  letter-spacing: .14em;
  margin-bottom: 28px;
  color: #ff7a1a;
  text-shadow: 0 0 32px rgba(255,122,26,.5);
}
.brand span { color: #fff; }
.bar {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,.08);
  border-radius: 4px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff7a1a, #ffd66d);
  transition: width .3s ease;
}
.hint {
  margin-top: 14px;
  font-size: 13px;
  color: rgba(255,255,255,.55);
  letter-spacing: .04em;
}

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud.hidden { display: none; }

.hud-top {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}
.pill {
  background: rgba(10,14,22,.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.08);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .03em;
  color: rgba(255,255,255,.85);
}
#speed-pill {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}
.speed-num { font-size: 18px; color: #fff; }
.speed-unit { font-size: 10px; color: rgba(255,255,255,.5); }

#minimap {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.12);
  background: rgba(10,14,22,.55);
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  backdrop-filter: blur(6px);
}

#controls-help {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: rgba(10,14,22,.55);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.7;
  color: rgba(255,255,255,.75);
}
#controls-help b {
  color: #ff7a1a;
  font-weight: 700;
  display: inline-block;
  min-width: 78px;
}

#splash {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.4);
  pointer-events: auto;
  cursor: pointer;
  transition: opacity .4s ease;
}
#splash.hidden { opacity: 0; pointer-events: none; }
.splash-title {
  font-size: clamp(36px, 7vw, 80px);
  font-weight: 900;
  letter-spacing: .15em;
  color: #fff;
  text-shadow: 0 0 40px rgba(255,122,26,.6);
}
.splash-sub {
  margin-top: 14px;
  font-size: 14px;
  color: rgba(255,255,255,.7);
  letter-spacing: .12em;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: .4 } 50% { opacity: 1 } }
