/* ==========================================================================
   NASA Abandoned Artifacts: 3D Storytelling Experience
   Aesthetic: NASA JPL Telemetry & Mission Control Glassmorphism
   Version: 3.0 (High Quality, Cinematic Simulation & Flawless Mobile UX)
   ========================================================================== */

:root {
  --bg-deep: #05070c;
  --bg-panel: rgba(10, 14, 24, 0.85);
  --bg-panel-border: rgba(0, 240, 255, 0.25);
  --bg-panel-hover: rgba(18, 26, 44, 0.95);
  
  --cyan-primary: #00f0ff;
  --cyan-glow: rgba(0, 240, 255, 0.45);
  --amber-gold: #ffb300;
  --amber-glow: rgba(255, 179, 0, 0.4);
  --mars-rust: #ff5722;
  --mars-glow: rgba(255, 87, 34, 0.45);
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --font-mono: 'Space Mono', 'JetBrains Mono', 'Consolas', monospace;
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  --trans-smooth: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

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

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

/* Telemetry CRT Scanline Grid Overlay (Subtle) */
.scanlines-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.12) 50%
  );
  background-size: 100% 3px;
  opacity: 0.5;
}

/* UI Overlay Layer */
.ui-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.interactive {
  pointer-events: auto;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: linear-gradient(180deg, rgba(6, 9, 16, 0.92) 0%, rgba(6, 9, 16, 0) 100%);
  gap: 16px;
  z-index: 20;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nasa-meatball {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #0b3d91, #001233);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(11, 61, 145, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.nasa-meatball::after {
  content: "NASA";
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 1px;
  color: #fff;
}

.title-group h1 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.title-group h1 .sub-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid var(--cyan-primary);
  color: var(--cyan-primary);
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.title-group p {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Planet Switcher Switch */
.planet-toggle-container {
  display: flex;
  background: rgba(12, 17, 30, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 30px;
  padding: 4px;
  backdrop-filter: blur(14px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.planet-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 7px 16px;
  border-radius: 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--trans-smooth);
}

.planet-btn .btn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
  transition: var(--trans-smooth);
}

.planet-btn.active[data-body="moon"] {
  background: rgba(0, 240, 255, 0.2);
  color: #fff;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.35);
  border: 1px solid var(--cyan-primary);
}
.planet-btn.active[data-body="moon"] .btn-dot {
  background: var(--cyan-primary);
  box-shadow: 0 0 8px var(--cyan-primary);
}

.planet-btn.active[data-body="mars"] {
  background: rgba(255, 87, 34, 0.25);
  color: #fff;
  box-shadow: 0 0 15px rgba(255, 87, 34, 0.45);
  border: 1px solid var(--mars-rust);
}
.planet-btn.active[data-body="mars"] .btn-dot {
  background: var(--mars-rust);
  box-shadow: 0 0 8px var(--mars-rust);
}

/* Header Action Controls (Desktop) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-btn {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-main);
  padding: 8px 13px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(8px);
  transition: var(--trans-smooth);
  white-space: nowrap;
}

.hud-btn:hover {
  background: var(--bg-panel-hover);
  border-color: var(--cyan-primary);
  color: var(--cyan-primary);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}

.hud-btn.btn-primary-sim {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--cyan-primary);
  color: #fff;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.3);
}
.hud-btn.btn-primary-sim:hover {
  background: var(--cyan-primary);
  color: #000;
  box-shadow: 0 0 20px var(--cyan-glow);
}

.hud-btn.active-tour {
  background: rgba(255, 179, 0, 0.22);
  border-color: var(--amber-gold);
  color: var(--amber-gold);
  animation: pulseGold 2s infinite;
}

@keyframes pulseGold {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 179, 0, 0.3); }
  50% { box-shadow: 0 0 20px rgba(255, 179, 0, 0.7); }
}

/* ==========================================================================
   Left Telemetry Dock & Relics Quick Search
   ========================================================================== */
.left-dock {
  position: absolute;
  left: 20px;
  top: 80px;
  width: 290px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 25;
}

.glass-card {
  background: var(--bg-panel);
  border: 1px solid var(--bg-panel-border);
  border-radius: 12px;
  padding: 14px;
  backdrop-filter: blur(18px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan-primary), transparent);
}

.card-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--cyan-primary);
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.card-label .live-badge {
  font-size: 9px;
  color: #10b981;
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-label .live-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: blink 1.2s infinite ease-in-out;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Planetary Stats Table */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stat-item {
  background: rgba(255, 255, 255, 0.03);
  padding: 7px 9px;
  border-radius: 6px;
  border-left: 2px solid rgba(0, 240, 255, 0.35);
}

.stat-title {
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--text-dim);
  text-transform: uppercase;
}

.stat-val {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  margin-top: 2px;
}

.stat-item.full-width {
  grid-column: span 2;
  border-left-color: var(--amber-gold);
}

/* Search Box */
.search-wrapper {
  position: relative;
  margin-bottom: 10px;
}

.search-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 8px 12px 8px 32px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 12px;
  outline: none;
  transition: var(--trans-smooth);
}

.search-input:focus {
  border-color: var(--cyan-primary);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 13px;
  pointer-events: none;
}

/* Artifacts Quick List */
.artifacts-list {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 4px;
}

.artifacts-list::-webkit-scrollbar {
  width: 4px;
}
.artifacts-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.artifact-list-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--trans-smooth);
}

.artifact-list-item:hover {
  background: rgba(0, 240, 255, 0.12);
  border-color: rgba(0, 240, 255, 0.4);
  transform: translateX(3px);
}

.artifact-list-item.selected {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--cyan-primary);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.item-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.item-name {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 175px;
}

.item-meta {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
}

.item-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.mobile-close-list-btn {
  display: none !important;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
}

/* ==========================================================================
   Bottom Timeline & Decade Filter Bar (Desktop)
   ========================================================================== */
.bottom-dock {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  pointer-events: none;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-panel);
  border: 1px solid var(--bg-panel-border);
  padding: 6px 14px;
  border-radius: 30px;
  backdrop-filter: blur(14px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.7);
  pointer-events: auto;
}

.filter-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-right: 4px;
}

.pill-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--trans-smooth);
}

.pill-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.pill-btn.active {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--cyan-primary);
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.35);
}

.controls-hint {
  position: fixed;
  bottom: 20px;
  right: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 20;
  pointer-events: none;
  background: rgba(8, 12, 22, 0.75);
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
}

.controls-hint kbd {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 2px 6px;
  color: #fff;
}

@media (max-width: 1350px) {
  .controls-hint {
    display: none !important;
  }
}

/* ==========================================================================
   Guided Story Tour Top Banner
   ========================================================================== */
.tour-banner {
  position: fixed;
  top: 75px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 15, 28, 0.95);
  border: 1px solid var(--amber-gold);
  border-radius: 30px;
  padding: 8px 24px;
  display: none !important;
  align-items: center;
  gap: 16px;
  backdrop-filter: blur(20px);
  box-shadow: 0 0 30px rgba(255, 179, 0, 0.35), 0 8px 32px rgba(0, 0, 0, 0.8);
  z-index: 150;
  white-space: nowrap;
}

.tour-banner.active {
  display: flex !important;
}

.tour-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--amber-gold);
  letter-spacing: 1px;
}

.tour-progress {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #fff;
  font-weight: 600;
}

.tour-btn {
  background: rgba(255, 179, 0, 0.15);
  border: 1px solid var(--amber-gold);
  color: #fff;
  padding: 5px 14px;
  border-radius: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: var(--trans-smooth);
}

.tour-btn:hover {
  background: var(--amber-gold);
  color: #000;
  box-shadow: 0 0 12px rgba(255, 179, 0, 0.5);
}

/* ==========================================================================
   Right Story Drawer (Rich Narrative Modal)
   ========================================================================== */
.story-drawer {
  position: absolute;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: 480px;
  max-width: calc(100vw - 32px);
  background: rgba(9, 13, 22, 0.95);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 16px;
  backdrop-filter: blur(24px);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 240, 255, 0.15);
  display: flex;
  flex-direction: column;
  transform: translateX(110%);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
  overflow: hidden;
}

.story-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(0, 240, 255, 0.08) 0%, transparent 100%);
}

.header-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mission-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--amber-gold);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}

.artifact-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: var(--trans-smooth);
  flex-shrink: 0;
}

.close-btn:hover {
  background: rgba(255, 87, 34, 0.25);
  border-color: var(--mars-rust);
  color: #fff;
}

.drawer-content {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.drawer-content > * {
  flex-shrink: 0;
}

.drawer-content::-webkit-scrollbar {
  width: 5px;
}
.drawer-content::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.25);
  border-radius: 4px;
}

/* Prominent 3D Simulation Action Button */
.big-sim-action-btn {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2) 0%, rgba(14, 165, 233, 0.25) 100%);
  border: 1.5px solid var(--cyan-primary);
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.25);
  transition: var(--trans-smooth);
  text-align: left;
}

.big-sim-action-btn:hover {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.35) 0%, rgba(14, 165, 233, 0.45) 100%);
  box-shadow: 0 0 30px var(--cyan-glow);
  transform: translateY(-2px);
}

.sim-play-icon {
  font-size: 26px;
  filter: drop-shadow(0 0 8px var(--cyan-primary));
}

.sim-btn-text-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sim-btn-main {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}

.sim-btn-sub {
  font-size: 10px;
  color: #bae6fd;
}

/* 3D Holographic Artifact Mini-Viewport */
.mini-model-box {
  width: 100%;
  height: 180px;
  background: radial-gradient(circle at 50% 50%, rgba(0, 240, 255, 0.08) 0%, rgba(10, 15, 25, 0.6) 100%);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#mini-model-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: pan-y;
}

#mini-model-canvas:active {
  cursor: grabbing;
}

.model-hud-badge {
  position: absolute;
  bottom: 8px;
  right: 10px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--cyan-primary);
  background: rgba(0, 0, 0, 0.6);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.model-compass-badge {
  position: absolute;
  top: 8px;
  left: 10px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
}

/* Quote Card */
.quote-card {
  background: rgba(255, 179, 0, 0.06);
  border-left: 3px solid var(--amber-gold);
  border-radius: 0 8px 8px 0;
  padding: 12px 14px;
  font-style: italic;
  color: #fde68a;
  font-size: 12px;
  line-height: 1.5;
}

.quote-author {
  display: block;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
  text-transform: uppercase;
}

/* Story Narrative Text */
.story-headline {
  font-size: 14px;
  font-weight: 600;
  color: var(--cyan-primary);
  line-height: 1.4;
}

.story-text {
  font-size: 12px;
  line-height: 1.7;
  color: #cbd5e1;
  white-space: pre-line;
}

/* Narrative Alert Blocks */
.info-block {
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.info-block.why-left {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
}
.info-block.why-left .block-title { color: #f87171; }

.info-block.condition {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
}
.info-block.condition .block-title { color: #60a5fa; }

.block-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.block-desc {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-main);
}

/* Discarded Items Checklist */
.items-list-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-heading {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--cyan-primary);
  letter-spacing: 1px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 6px;
}

.checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.checklist li {
  font-size: 12px;
  color: #cbd5e1;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.checklist li::before {
  content: "✦";
  color: var(--amber-gold);
  font-size: 10px;
  margin-top: 2px;
}

/* Audio Snippet Broadcast Bar */
.audio-broadcast-box {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.audio-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.audio-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.audio-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #fff;
  line-height: 1.4;
}

/* Animated Waveform Equalizer */
.waveform-equalizer {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 14px;
  opacity: 0.35;
  transition: opacity 0.3s ease;
}

.waveform-equalizer.active {
  opacity: 1;
}

.eq-bar {
  width: 3px;
  height: 4px;
  background: var(--cyan-primary);
  border-radius: 2px;
}

.waveform-equalizer.active .eq-bar:nth-child(1) { animation: soundWave 0.5s infinite ease-in-out alternate; }
.waveform-equalizer.active .eq-bar:nth-child(2) { animation: soundWave 0.8s infinite ease-in-out alternate 0.1s; }
.waveform-equalizer.active .eq-bar:nth-child(3) { animation: soundWave 0.4s infinite ease-in-out alternate 0.2s; }
.waveform-equalizer.active .eq-bar:nth-child(4) { animation: soundWave 0.7s infinite ease-in-out alternate 0.15s; }
.waveform-equalizer.active .eq-bar:nth-child(5) { animation: soundWave 0.6s infinite ease-in-out alternate 0.25s; }

@keyframes soundWave {
  0% { height: 3px; }
  100% { height: 14px; background: #00ff88; }
}

.play-tone-btn {
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid var(--cyan-primary);
  color: var(--cyan-primary);
  padding: 8px 14px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--trans-smooth);
  flex-shrink: 0;
}

.play-tone-btn:hover {
  background: var(--cyan-primary);
  color: #000;
  box-shadow: 0 0 12px var(--cyan-glow);
}

.play-tone-btn.transmitting {
  background: rgba(16, 185, 129, 0.25);
  border-color: #10b981;
  color: #10b981;
  animation: pulseGreen 1s infinite alternate;
}

@keyframes pulseGreen {
  0% { box-shadow: 0 0 6px rgba(16, 185, 129, 0.3); }
  100% { box-shadow: 0 0 16px rgba(16, 185, 129, 0.8); }
}

/* Drawer Footer Navigation */
.drawer-footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(6, 9, 16, 0.85);
}

.nav-site-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 7px 14px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--trans-smooth);
}

.nav-site-btn:hover {
  border-color: var(--cyan-primary);
  color: var(--cyan-primary);
}

/* ==========================================================================
   CINEMATIC 3D MISSION SIMULATION THEATER
   ========================================================================== */
.sim-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.96);
  z-index: 10000;
  display: none !important;
  align-items: center;
  justify-content: center;
}

.sim-modal-overlay.open {
  display: flex !important;
}

.sim-modal-container {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: #000;
}

.sim-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: linear-gradient(180deg, rgba(10, 15, 25, 0.95) 0%, rgba(10, 15, 25, 0) 100%);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 20;
}

.sim-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sim-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--cyan-primary);
  color: var(--cyan-primary);
  width: fit-content;
}

.sim-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.sim-top-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sim-cam-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 4px 10px;
}

.sim-cam-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
}

.sim-select {
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  outline: none;
  cursor: pointer;
}
.sim-select option {
  background: #0f172a;
  color: #fff;
}

.sim-action-btn {
  background: rgba(255, 179, 0, 0.15);
  border: 1px solid var(--amber-gold);
  color: #fff;
  padding: 6px 14px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--trans-smooth);
}
.sim-action-btn:hover {
  background: var(--amber-gold);
  color: #000;
}

.sim-close-btn {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid #ef4444;
  color: #fff;
  padding: 6px 14px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: var(--trans-smooth);
}
.sim-close-btn:hover {
  background: #ef4444;
  color: #fff;
}

.sim-canvas-wrapper {
  width: 100%;
  height: 100%;
  flex: 1 1 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

#sim-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Simulation Real-time HUD */
.sim-hud-overlay {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 20;
  pointer-events: none;
  width: 90%;
  max-width: 680px;
}

.hud-gauge-row {
  display: flex;
  gap: 12px;
  width: 100%;
  justify-content: center;
}

.hud-gauge {
  background: rgba(8, 12, 22, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 8px;
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  backdrop-filter: blur(12px);
  min-width: 140px;
}

.gauge-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.gauge-val {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--cyan-primary);
  margin-top: 2px;
}

.hud-phase-bar {
  background: rgba(8, 12, 22, 0.9);
  border: 1px solid var(--amber-gold);
  border-radius: 20px;
  padding: 6px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 0 16px rgba(255, 179, 0, 0.3);
}

.phase-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: blink 1s infinite alternate;
}

.phase-text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   OFFICIAL SOURCES MODAL DIALOG
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 5, 10, 0.88);
  backdrop-filter: blur(16px);
  z-index: 10000;
  display: none !important;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex !important;
}

.modal-content {
  width: 680px;
  max-width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.9), 0 0 24px rgba(0, 240, 255, 0.2);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-title-group h2 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}

.sources-intro {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

.sources-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  max-height: 50vh;
  padding-right: 4px;
}

.source-item-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: var(--trans-smooth);
}

.source-item-card:hover {
  background: rgba(0, 240, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.3);
}

.source-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.source-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--cyan-primary);
}

.source-curator {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--amber-gold);
}

.source-desc {
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.5;
}

.source-link-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 4px;
}

.source-link {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #60a5fa;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.source-link:hover {
  text-decoration: underline;
  color: #93c5fd;
}

.modal-footer-note {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* ==========================================================================
   3D Floating Tooltip
   ========================================================================== */
.beacon-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(6, 10, 20, 0.9);
  border: 1px solid var(--cyan-primary);
  border-radius: 8px;
  padding: 8px 12px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 12px rgba(0, 240, 255, 0.3);
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 50;
  transform: translate(-50%, -130%);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.beacon-tooltip.visible {
  opacity: 1;
}

.tooltip-title {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.tooltip-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--cyan-primary);
}

/* ==========================================================================
   Mobile Bottom Navigation Dock (STRICTLY HIDDEN on Desktop)
   ========================================================================== */
.mobile-nav-bar {
  display: none !important;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(8, 12, 20, 0.95);
  border-top: 1px solid rgba(0, 240, 255, 0.25);
  padding: 8px 12px;
  z-index: 999;
  backdrop-filter: blur(20px);
  justify-content: space-around;
  align-items: center;
}

.mobile-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  transition: var(--trans-smooth);
}

.mobile-nav-btn .m-icon {
  font-size: 18px;
}

.mobile-nav-btn .m-label {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
}

.mobile-nav-btn.active {
  color: var(--cyan-primary);
}
.mobile-nav-btn.active .m-icon {
  transform: translateY(-2px);
  filter: drop-shadow(0 0 6px var(--cyan-primary));
}

/* ==========================================================================
   AUTHENTIC NASA ARCHIVE PHOTOS & SECRET RELICS
   ========================================================================== */
.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.pill-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(0, 240, 255, 0.12);
  color: var(--cyan-primary);
  border: 1px solid rgba(0, 240, 255, 0.35);
  letter-spacing: 0.5px;
}

.photos-subtext {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 12px;
}

/* Secret Relic / Easter Egg Box */
.secret-relic-box {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-left: 4px solid var(--amber-glow);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 4px 24px rgba(245, 158, 11, 0.15);
  flex-shrink: 0;
  min-height: fit-content;
}

.relic-header {
  display: flex;
  align-items: center;
}

.relic-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--amber-glow);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 4px;
  padding: 3px 8px;
  display: inline-block;
  line-height: 1.4;
}

.relic-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin: 2px 0 0 0;
  line-height: 1.4;
}

.relic-desc {
  font-size: 12px;
  color: #e2e8f0;
  line-height: 1.6;
  margin: 0;
}

/* NASA Photos Grid */
.nasa-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.nasa-photo-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.nasa-photo-card:hover {
  transform: translateY(-3px);
  border-color: var(--cyan-primary);
  box-shadow: 0 8px 24px rgba(0, 240, 255, 0.2);
}

.photo-thumb-wrapper {
  position: relative;
  width: 100%;
  height: 110px;
  background: #000;
  overflow: hidden;
}

.photo-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.nasa-photo-card:hover .photo-thumb {
  transform: scale(1.06);
}

.photo-overlay-tag {
  position: absolute;
  bottom: 6px;
  left: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.85);
  color: var(--cyan-primary);
  border: 1px solid rgba(0, 240, 255, 0.4);
}

.photo-card-info {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.photo-card-title {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  line-height: 1.4;
}

.photo-card-meta {
  font-size: 10px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* Photo Fullscreen Modal Lightbox */
.photo-modal-card {
  width: 820px;
  max-width: 95vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(8, 12, 20, 0.95);
  border: 1px solid rgba(0, 240, 255, 0.3);
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.95), 0 0 32px rgba(0, 240, 255, 0.25);
}

.photo-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.8);
}

.photo-cat-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0, 240, 255, 0.15);
  color: var(--cyan-primary);
  border: 1px solid rgba(0, 240, 255, 0.4);
}

.photo-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin: 4px 0 0 0;
}

.photo-img-wrapper {
  flex: 1;
  min-height: 250px;
  max-height: 56vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #020408;
  overflow: hidden;
  padding: 10px;
}

.photo-img-wrapper img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.photo-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(10, 15, 25, 0.9);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.photo-meta-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.photo-meta-item {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 11px;
}

.photo-meta-item .meta-label {
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.photo-meta-item .meta-val {
  color: var(--cyan-primary);
  font-family: var(--font-mono);
  font-weight: 600;
}

.photo-modal-desc {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.6;
  margin: 0;
}

/* ==========================================================================
   RESPONSIVE MOBILE STYLES (< 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .header-bar {
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .brand-section {
    gap: 8px;
  }

  .nasa-meatball {
    width: 34px;
    height: 34px;
  }

  .title-group h1 {
    font-size: 13px;
  }

  .title-group p {
    display: none;
  }

  .header-actions {
    display: none !important; /* Managed via mobile bottom navigation */
  }

  .planet-toggle-container {
    margin-left: auto;
  }

  .planet-btn {
    padding: 5px 12px;
    font-size: 11px;
  }

  /* Left dock becomes a collapsible overlay drawer */
  .left-dock {
    position: fixed;
    top: auto;
    bottom: 60px;
    left: 10px;
    right: 10px;
    width: calc(100vw - 20px);
    max-height: 65vh;
    z-index: 800;
    transform: translateY(125%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
  }

  .left-dock.mobile-visible {
    transform: translateY(0);
    pointer-events: auto;
  }

  .mobile-close-list-btn {
    display: block !important;
  }

  /* Show mobile bottom nav bar */
  .mobile-nav-bar {
    display: flex !important;
  }

  /* Story drawer adapts to bottom sheet or full screen */
  .story-drawer {
    width: 100vw;
    max-width: 100vw;
    right: 0;
    top: 0;
    bottom: 0;
    border-radius: 0;
    z-index: 1200;
  }

  .drawer-content {
    padding: 14px;
    gap: 14px;
    -webkit-overflow-scrolling: touch;
  }

  .mini-model-box {
    height: 150px;
  }

  .bottom-dock {
    display: none !important;
  }

  .controls-hint {
    display: none !important;
  }

  .tour-banner {
    top: 55px;
    width: 92%;
    padding: 6px 12px;
    gap: 8px;
  }

  .tour-progress {
    font-size: 10px;
  }

  /* Simulation on mobile */
  .sim-top-bar {
    padding: 10px 14px;
  }
  .sim-title {
    font-size: 13px;
  }
  .hud-gauge {
    min-width: 90px;
    padding: 6px 8px;
  }
  .gauge-val {
    font-size: 11px;
  }
}
