/* ═══════════════════════════════════════════════
   HEADS UP DISPLAY (HUD), MINIMAP & TOOLTIPS
   ═══════════════════════════════════════════════ */

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  font-family: 'Inter', system-ui, sans-serif;
}

#hud > * {
  pointer-events: auto;
}

.hud-panel {
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  border-radius: 14px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 10px 16px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 245, 255, 0.08);
}

/* ═══ LIVE COMPASS ═══ */
#compass-wrap {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 72px;
}

#compass-dir {
  font-size: 22px;
  font-weight: 800;
  color: var(--neon-cyan);
  text-align: center;
  letter-spacing: 1px;
  line-height: 1;
}

#compass-deg {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--ink-dim);
  text-align: center;
  margin-top: 3px;
}

/* ═══ STATS COUNTER ═══ */
#stats-wrap {
  position: absolute;
  top: 18px;
  right: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stats-indicator {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--neon-green);
  font-weight: 700;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--neon-green);
  box-shadow: 0 0 8px var(--neon-green);
  animation: pulseLive 1.5s infinite alternate;
}

@keyframes pulseLive {
  from { opacity: 0.4; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1.3); }
}

#stats-text {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
}

.stats-subline {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--ink-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
}

.stats-subline .subline-sep {
  opacity: 0.4;
}

#stats-visitors-count {
  color: var(--neon-gold, #f59e0b);
  font-weight: 600;
}

.stats-indicator.idle .pulse-dot {
  background: #38bdf8;
  box-shadow: 0 0 6px #38bdf8;
  animation: none;
  opacity: 0.75;
}

.stats-indicator.idle #stats-live-label {
  color: #94a3b8;
}

/* ═══ MODE SWITCHER & AUDIO BUTTONS ═══ */
#mode-wrap {
  position: absolute;
  bottom: 24px;
  right: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hud-btn-pill {
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  border-radius: 12px;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 16px rgba(0, 245, 255, 0.12);
}

.hud-btn-pill:hover {
  background: rgba(20, 18, 45, 0.95);
  border-color: var(--neon-cyan);
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(0, 245, 255, 0.4);
}

.return-ground-btn {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.3), rgba(245, 158, 11, 0.3));
  border: 1.5px solid #f59e0b;
  color: #fef08a;
  animation: pulseReturnBtn 2s infinite alternate;
}

.return-ground-btn:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.6), rgba(245, 158, 11, 0.6));
  border-color: #facc15;
  box-shadow: 0 0 28px rgba(245, 158, 11, 0.6);
}

@keyframes pulseReturnBtn {
  from { box-shadow: 0 0 12px rgba(245, 158, 11, 0.3); }
  to { box-shadow: 0 0 24px rgba(245, 158, 11, 0.6); }
}

.hud-btn-circle {
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  border-radius: 12px;
  color: var(--ink);
  font-size: 16px;
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}


.hud-btn-circle:hover {
  background: rgba(20, 18, 45, 0.95);
  border-color: var(--neon-cyan);
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(0, 245, 255, 0.3);
}

#mode-btn {

  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  border-radius: 12px;
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 12px 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

#mode-btn:hover {
  background: rgba(20, 18, 45, 0.95);
  border-color: var(--neon-cyan);
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(0, 245, 255, 0.3);
}

/* ═══ CONTROLS HINT ═══ */
#controls-hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--ink-dim);
  white-space: nowrap;
  background: rgba(8, 6, 20, 0.7);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

#controls-hint kbd {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--ink);
}

.mobile-hint {
  display: none;
}

.touch-device .desktop-hint {
  display: none;
}

.touch-device .mobile-hint {
  display: inline;
}

/* ═══ RADAR MINIMAP ═══ */
#minimap-wrap {
  position: absolute;
  bottom: 24px;
  left: 18px;
  padding: 6px;
}

#minimap {
  border-radius: 10px;
  display: block;
}

/* ═══ 3D BILLBOARD HOVER TOOLTIP ═══ */
.billboard-tooltip {
  position: fixed;
  z-index: 30;
  pointer-events: none;
  background: rgba(10, 8, 25, 0.92);
  border: 1px solid var(--neon-cyan);
  border-radius: 10px;
  padding: 10px 14px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), 0 0 25px rgba(0, 245, 255, 0.25);
  opacity: 0;
  transition: opacity 0.18s ease-out;
  max-width: 250px;
}

.tooltip-tier {
  font-size: 9.5px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--neon-cyan);
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.tooltip-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 3px;
}

.tooltip-price {
  font-size: 11px;
  color: var(--neon-gold);
  font-weight: 600;
}

/* ═══ MOBILE JOYSTICK ═══ */
#joystick {
  display: none;
  position: fixed;
  bottom: 30px;
  left: 30px;
  width: 120px;
  height: 120px;
  z-index: 20;
}

.touch-device #joystick {
  display: block;
}

#joystick-base {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
}

#joystick-thumb {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 245, 255, 0.35);
  border: 1px solid rgba(0, 245, 255, 0.6);
  top: 36px;
  left: 36px;
  pointer-events: none;
  box-shadow: 0 0 20px rgba(0, 245, 255, 0.4);
}

@media (max-width: 768px) {
  #minimap-wrap {
    display: none;
  }
  #controls-hint {
    font-size: 9.5px;
    bottom: 110px;
  }
  #mode-wrap {
    bottom: 105px;
    right: 14px;
  }
  #stats-wrap {
    top: 14px;
    right: 14px;
  }
  #compass-wrap {
    top: 14px;
  }
}

/* ═══ POLICY LINKS ═══ */
#legal-links {
  position: absolute;
  top: 18px;
  left: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  max-width: 260px;
  font-size: 10.5px;
  padding: 5px 12px;
  background: rgba(8, 6, 20, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

#legal-links a {
  color: var(--ink-dim);
  text-decoration: none;
}

#legal-links a:hover,
#legal-links a:focus-visible {
  color: var(--neon-cyan);
}

@media (max-width: 768px) {
  /* Narrow enough to clear the centred compass on a 360px screen. */
  #legal-links {
    top: 14px;
    left: 14px;
    max-width: 128px;
    font-size: 10px;
  }
}
