:root {
  --bg-space: #060b14;
  --bg-hud: rgba(11, 19, 37, 0.85);
  --border-cyan: rgba(0, 240, 255, 0.3);
  --accent-cyan: #00f0ff;
  --accent-green: #00ff88;
  --accent-yellow: #facc15;
  --accent-red: #ef4444;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --font-sans: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  background-color: var(--bg-space);
  color: var(--text-main);
  font-family: var(--font-sans);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

.twin-container {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Nav HUD */
.twin-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: linear-gradient(180deg, rgba(6, 11, 20, 0.9) 0%, rgba(6, 11, 20, 0) 100%);
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  pointer-events: auto;
}

.logo-badge {
  background: linear-gradient(135deg, #0284c7, var(--accent-cyan));
  color: #000;
  font-weight: 800;
  font-size: 1.1rem;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.4);
}

.brand h1 {
  font-size: 1.15rem;
  font-weight: 600;
}

.brand .subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.brand .subtitle a {
  color: var(--accent-cyan);
  text-decoration: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  pointer-events: auto;
}

.telemetry-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  background: var(--bg-hud);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-cyan);
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  color: var(--accent-cyan);
}

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

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* 3D Canvas */
#canvas-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* Floating Sensor HUD */
.floating-hud {
  position: absolute;
  top: 5rem;
  right: 1.5rem;
  width: 320px;
  background: var(--bg-hud);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-cyan);
  border-radius: 12px;
  padding: 1.25rem;
  z-index: 30;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  transition: transform 0.3s ease;
}

.hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.hud-tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--accent-cyan);
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.floating-hud h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.hud-metric-box {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.hud-value {
  font-size: 2.2rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

.hud-unit {
  font-size: 1rem;
  color: var(--text-muted);
}

.hud-status-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(0, 255, 136, 0.15);
  color: var(--accent-green);
  border: 1px solid var(--accent-green);
  margin-bottom: 1rem;
}

.hud-specs {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.75rem;
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.8rem;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
}

.spec-row strong {
  color: var(--text-main);
}

.hud-instructions {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Training Banner */
.training-banner {
  position: absolute;
  bottom: 4rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-hud);
  backdrop-filter: blur(16px);
  border: 1px solid var(--accent-green);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  z-index: 30;
  width: 480px;
  max-width: 90vw;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.badge-scenario {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent-green);
  text-transform: uppercase;
}

.training-info h4 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.training-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.progress-bar-wrapper {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-green));
  transition: width 0.3s ease;
}

#training-progress-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #0284c7, var(--accent-cyan));
  color: #000;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: transform 0.15s;
}

.btn-primary:hover {
  transform: scale(1.02);
}

.btn-success {
  background: var(--accent-green);
  color: #000;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  align-self: flex-start;
}

/* Bottom Controls Guide */
.controls-guide {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(0deg, rgba(6, 11, 20, 0.9) 0%, rgba(6, 11, 20, 0) 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  z-index: 20;
  pointer-events: none;
}
