:root {
  --font-display: 'Orbitron', -apple-system, sans-serif;
  --font-body: 'Space Grotesk', -apple-system, sans-serif;
  
  --bg-color: #02040a;
  --primary-cyan: #00f3ff;
  --primary-violet: #8a2be2;
  --neon-magenta: #ff007f;
  --holo-white: #e6ffff;
  
  --text-main: #e0f2fe;
  --text-dim: #64748b;
  --text-glow: rgba(0, 243, 255, 0.6);
  
  --glass-bg: rgba(6, 15, 30, 0.55);
  --glass-border: rgba(0, 243, 255, 0.2);
  --glass-border-hover: rgba(0, 243, 255, 0.5);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.6);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 14px;
}

/* Background Atmosphere Layers */
.bg-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 35%, rgba(1, 3, 8, 0.7) 70%, #010206 100%);
  z-index: 2;
}

.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.25) 50%
  );
  background-size: 100% 4px;
  opacity: 0.4;
  z-index: 3;
}

.noise-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.03;
  background-image: radial-gradient(#fff 1px, transparent 1px);
  background-size: 32px 32px;
  z-index: 2;
}

/* 3D Canvas Container */
#canvas-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  cursor: grab;
}

#canvas-container:active {
  cursor: grabbing;
}

/* Cursor Glow Follower */
#cursor-glow {
  position: absolute;
  width: 450px;
  height: 450px;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(0, 243, 255, 0.08) 0%, rgba(138, 43, 226, 0.03) 50%, transparent 70%);
  z-index: 2;
  transition: width 0.3s, height 0.3s, opacity 0.3s;
  will-change: left, top;
}

/* HUD Overlay Layer */
.hud-layer {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px 36px;
  pointer-events: none;
  z-index: 10;
}

/* Interactive elements inside HUD */
.hud-layer button,
.hud-layer .modes-wrapper {
  pointer-events: auto;
}

/* Top Header */
.hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.hud-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  padding: 8px 18px;
  border-radius: 9999px;
  box-shadow: var(--glass-shadow);
}

.status-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--primary-cyan);
  box-shadow: 0 0 12px var(--primary-cyan);
  animation: pulse-glow 2s infinite ease-in-out;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 0 8px rgba(0, 243, 255, 0.6);
}

.version-tag {
  font-family: var(--font-display);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.hud-telemetry {
  display: flex;
  gap: 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  padding: 8px 20px;
  border-radius: 9999px;
  box-shadow: var(--glass-shadow);
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 1px;
}

.telemetry-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.telemetry-item .label {
  color: var(--text-dim);
}

.telemetry-item .value {
  color: var(--primary-cyan);
  font-weight: 600;
  text-shadow: 0 0 6px rgba(0, 243, 255, 0.4);
}

/* Center Instruction Hint */
.center-instruction {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(-50% + 220px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-dim);
  opacity: 0.85;
  transition: opacity 0.8s ease, transform 0.8s ease;
  pointer-events: none;
}

.center-instruction.fade-out {
  opacity: 0;
  transform: translate(-50%, calc(-50% + 240px));
}

.crosshair-icon {
  color: var(--primary-cyan);
  opacity: 0.6;
  animation: rotate-slow 20s linear infinite;
}

.hint-text {
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(224, 242, 254, 0.65);
  text-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

/* Bottom Footer Controls */
.hud-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
}

.modes-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  padding: 10px 16px;
  border-radius: 14px;
  box-shadow: var(--glass-shadow);
}

.modes-label {
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--text-dim);
}

.modes-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mode-btn {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.mode-btn .btn-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: transparent;
  border: 1px solid currentColor;
  transition: all 0.25s;
}

.mode-btn:hover {
  border-color: var(--glass-border-hover);
  color: #fff;
  transform: translateY(-2px);
}

.mode-btn.active {
  background: rgba(0, 243, 255, 0.12);
  border-color: var(--primary-cyan);
  color: #fff;
  box-shadow: 0 0 16px rgba(0, 243, 255, 0.25);
}

.mode-btn.active .btn-indicator {
  background-color: var(--primary-cyan);
  box-shadow: 0 0 8px var(--primary-cyan);
}

/* Quick Action Buttons */
.hud-actions {
  display: flex;
  gap: 10px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: var(--glass-shadow);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.action-btn:hover {
  background: rgba(0, 243, 255, 0.15);
  border-color: var(--primary-cyan);
  color: #fff;
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.35);
  transform: translateY(-2px);
}

.action-btn:active {
  transform: scale(0.96);
}

.action-btn svg {
  transition: transform 0.2s;
}

.action-btn:hover svg {
  transform: scale(1.1);
}

.hidden {
  display: none !important;
}

/* Keyframes */
@keyframes pulse-glow {
  0%, 100% {
    opacity: 0.6;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
    box-shadow: 0 0 16px var(--primary-cyan);
  }
}

@keyframes rotate-slow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hud-layer {
    padding: 16px;
  }
  .hud-telemetry {
    display: none;
  }
  .hud-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .modes-wrapper {
    width: 100%;
  }
  .modes-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .hud-actions {
    justify-content: flex-end;
  }
  .center-instruction {
    display: none;
  }
}
