/* ============================================================
   ROCKET LAB — Escape Velocity Simulator
   Styled to the HumanityAGSI design system.
   Palette: warm gold on deep ink-navy. No light mode.
   Source of truth: HumanityAGSI Design System (colors_and_type.css)
   ============================================================ */

/* ===== DESIGN TOKENS ===== */
:root,
.dark {
  /* ---- HumanityAGSI brand tokens (HSL triplets) ---- */
  --background:        220 30% 4%;     /* #070912 page base */
  --foreground:        38 30% 92%;     /* #f0e9dd warm off-white */
  --border:            220 20% 14%;    /* #1d2230 hairlines */
  --card:              220 28% 6%;     /* #0a0d15 card surface (used @40%) */
  --primary:           36 60% 60%;     /* #e0b06a brand gold */
  --muted-foreground:  38 12% 62%;     /* #a89e8e captions, eyebrows */

  /* Chart sequence: gold, blue, bronze, slate, warm-yellow */
  --chart-1: 36 60% 60%;
  --chart-2: 220 50% 50%;
  --chart-3: 30 40% 45%;
  --chart-4: 220 20% 35%;
  --chart-5: 45 70% 65%;

  /* Direct brand hexes */
  --brand-gold:      #e9b265;
  --brand-gold-deep: #d6a55c;
  --brand-navy-glow: #1e325a;
  --brand-ink-1:     #090b11;
  --brand-ink-2:     #05070a;
  --brand-parchment: #f8f6f2;

  /* ---- Compatibility aliases used throughout this file ---- */
  --font-display: "Editorial New", "Source Serif 4", Georgia, serif;
  --font-body:    "Cabinet Grotesk", "General Sans", "Inter", system-ui, sans-serif;
  --font-mono:    "IBM Plex Mono", "Geist Mono", Menlo, monospace;

  --color-bg:            #070912;
  --color-surface:       hsl(var(--card) / 0.4);
  --color-surface-2:     hsl(var(--card) / 0.7);
  --color-border:        hsl(var(--border) / 0.6);
  --color-border-bright: hsl(var(--primary) / 0.4);
  --color-text:          hsl(var(--foreground));
  --color-text-muted:    hsl(var(--muted-foreground));
  --color-text-faint:    hsl(var(--muted-foreground) / 0.55);
  --color-primary:       hsl(var(--primary));            /* brand gold */
  --color-primary-dim:   hsl(var(--primary) / 0.14);
  --color-accent-warm:   hsl(var(--chart-3));            /* bronze */
  --color-accent-gold:   hsl(var(--chart-5));            /* warm yellow */
  --color-danger:        hsl(0 55% 58%);
  --color-warning:       hsl(var(--chart-3));            /* bronze for "orbit" */
  --color-success:       hsl(var(--primary));

  /* Type scale */
  --text-xs: clamp(0.7rem, 0.65rem + 0.25vw, 0.78rem);
  --text-sm: clamp(0.8rem, 0.75rem + 0.25vw, 0.875rem);
  --text-base: clamp(0.875rem, 0.85rem + 0.15vw, 0.9375rem);
  --text-lg: clamp(1rem, 0.9rem + 0.5vw, 1.25rem);
  --text-xl: clamp(1.5rem, 1.1rem + 1.4vw, 2rem);
  --text-2xl: clamp(1.75rem, 1.2rem + 2vw, 2.75rem);
  --text-hero: clamp(2.75rem, 1.2rem + 6vw, 5.25rem);

  --space-1: 4px; --space-2: 8px; --space-3: 12px;
  --space-4: 16px; --space-5: 20px; --space-6: 24px;
  --space-8: 32px; --space-10: 40px; --space-12: 48px;

  /* HumanityAGSI radii — "rectangular, corners taken off". No aggressive rounding. */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 6px;
  --radius-xl: 6px;
  --radius-full: 9999px;

  --tracking-eyebrow: 0.22em;

  --panel-blur: 6px;
  --shadow-card-hover: 0 30px 60px -30px rgba(233, 178, 101, 0.25);
  --transition-ui: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --ease-expressive: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== PAGE BACKGROUND — half the brand. Always fixed. ===== */
body.page-background {
  background:
    radial-gradient(ellipse 60% 50% at 70% 90%, #e9b26514, #e9b26500 60%),
    radial-gradient(ellipse 70% 60% at 20% 10%, #1e325a2e, #1e325a00 60%),
    linear-gradient(180deg, #090b11, #05070a);
  background-attachment: fixed;
}

/* Film-grain warmth overlay. */
body.page-noise::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

::selection {
  background-color: rgba(214, 165, 92, 0.30);
  color: #f8f6f2;
}

/* ===== Brand utility: eyebrow ===== */
.font-eyebrow {
  font-family: var(--font-body);
  font-weight: 500;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  font-size: 0.72rem;
  color: hsl(var(--primary) / 0.8);
}
.font-mono { font-family: var(--font-mono); }

/* ===== Logo mark — absolute, top-left ===== */
.brand-mark {
  position: fixed;
  top: var(--space-6);
  left: var(--space-6);
  z-index: 120;
  display: block;
  line-height: 0;
  border-radius: var(--radius-md);
  transition: transform var(--transition-ui);
}
.brand-mark:hover { transform: translateY(-1px); }
.brand-mark svg { width: 30px; height: 30px; }
@media (min-width: 640px) {
  .brand-mark { top: var(--space-8); left: var(--space-10); }
}
/* On the simulator the HUD carries its own mark — avoid a duplicate. */
body.sim-active .brand-mark { display: none; }

/* ===== TITLE SCREEN ===== */
#title-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  z-index: 100;
}

#stars-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.title-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-5);
  padding: var(--space-12) var(--space-6);
  margin: auto;
  max-width: 46rem;
  animation: fade-up 1.2s var(--ease-expressive) both;
}

/* Eyebrow pill — the single use of backdrop blur on the page */
.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: hsl(var(--card) / 0.4);
  border: 1px solid hsl(var(--border) / 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.eyebrow-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 0 12px 1px hsl(var(--primary) / 0.7);
}

.title-headline {
  font-family: var(--font-display);
  font-weight: 200;
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-size: var(--text-hero);
  color: var(--color-text);
  max-width: 16ch;
}
.title-headline em {
  font-style: italic;
  color: var(--color-primary);
}

.subtitle-lede {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  line-height: 1.6;
  color: hsl(var(--foreground) / 0.7);
  max-width: 40rem;
}

/* ===== Primary button — gold ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  background: var(--color-primary);
  color: hsl(var(--background));
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: filter var(--transition-ui), transform var(--transition-ui);
  margin-top: var(--space-2);
}
.btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

/* Ghost button — same footprint as primary, hairline instead of gold fill */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  background: transparent;
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--transition-ui), color var(--transition-ui);
  margin-top: var(--space-2);
}
.btn-ghost:hover { border-color: var(--color-border-bright); color: var(--color-primary); }

.title-cta-row {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-content: center;
}

.hint-text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 380px;
}

/* ===== Brand footer (cross-links) ===== */
.brand-footer {
  margin-top: var(--space-8);
  padding-top: var(--space-5);
  width: min(100%, 42rem);
  border-top: 1px solid hsl(var(--border) / 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: 0.74rem;
}
.brand-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2) var(--space-4);
}
.brand-footer-nav a {
  color: hsl(var(--muted-foreground) / 0.85);
  text-decoration: none;
  transition: color var(--transition-ui);
}
.brand-footer-nav a:hover { color: var(--color-primary); }
.brand-footer-here { color: var(--color-primary); }
.brand-footer-copy { color: hsl(var(--muted-foreground) / 0.7); }

/* ===== SIMULATOR LAYOUT ===== */
#simulator { position: fixed; inset: 0; }

#sim-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* ===== HUD TOP BAR ===== */
.hud-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: hsl(var(--background) / 0.65);
  backdrop-filter: blur(var(--panel-blur));
  -webkit-backdrop-filter: blur(var(--panel-blur));
  border-bottom: 1px solid var(--color-border);
}

.hud-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.02em;
  font-size: var(--text-sm);
  color: var(--color-text);
}
.hud-logo svg { width: 26px; height: 26px; }
.hud-logo { transition: color var(--transition-ui); }
.hud-logo:hover { color: var(--color-primary); }

/* "Tour" chip — only shown while body.tour-mode */
.tour-chip {
  display: none;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: hsl(var(--primary) / 0.14);
  color: var(--color-primary);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
}
body.tour-mode .tour-chip { display: inline-block; }

/* ===== GRAND TOUR goal banner ===== */
.tour-banner {
  position: absolute;
  top: 65px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: var(--space-3) var(--space-5);
  background: hsl(var(--card) / 0.4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(var(--panel-blur));
  -webkit-backdrop-filter: blur(var(--panel-blur));
  text-align: center;
  animation: fade-up 0.6s var(--ease-expressive) both;
  max-width: calc(100vw - 2 * var(--space-4));
}
.tour-goal {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text);
}
.tour-ticks {
  display: flex;
  gap: 5px;
  margin-top: 2px;
}
.tour-ticks .tick {
  width: 14px;
  height: 3px;
  border-radius: 2px;
  background: var(--color-border);
  transition: background var(--transition-ui), box-shadow var(--transition-ui);
}
.tour-ticks { align-items: flex-end; min-height: 14px; }
.tour-ticks .tick { position: relative; }
.tour-ticks .tick.done { background: var(--color-primary); }
/* Leg-cleared stamp — a small gold check above a completed tick (pure CSS, no emoji) */
.tour-ticks .tick.done::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 4px;
  height: 8px;
  transform: translateX(-50%) rotate(45deg);
  border: solid var(--color-primary);
  border-width: 0 1.5px 1.5px 0;
}
.tour-ticks .tick.current {
  background: var(--color-primary);
  box-shadow: 0 0 8px 1px hsl(var(--primary) / 0.6);
}

.hud-stats { display: flex; gap: var(--space-6); }

.stat { display: flex; align-items: baseline; gap: var(--space-1); }
.stat-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.stat-value {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--color-text);
  min-width: 48px;
}
.stat-unit {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.status-badge {
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  background: var(--color-primary-dim);
  color: var(--color-primary);
  min-width: auto;
}
.status-badge.crashed {
  background: hsl(0 55% 58% / 0.15);
  color: var(--color-danger);
}
.status-badge.orbiting {
  background: hsl(var(--chart-3) / 0.18);
  color: hsl(30 50% 60%);
}
.status-badge.escaped {
  background: hsl(var(--primary) / 0.15);
  color: var(--color-success);
}

.icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  transition: color var(--transition-ui), background var(--transition-ui);
}
.icon-btn:hover {
  color: var(--color-primary);
  background: hsl(var(--card) / 0.6);
}

/* ===== PANELS ===== */
.panel {
  position: absolute;
  top: 57px;
  z-index: 10;
  width: 292px;
  max-height: calc(100dvh - 57px);
  overflow-y: auto;
  padding: var(--space-5);
  background: hsl(var(--card) / 0.4);
  backdrop-filter: blur(var(--panel-blur));
  -webkit-backdrop-filter: blur(var(--panel-blur));
  border: 1px solid var(--color-border);
}

.panel::-webkit-scrollbar { width: 4px; }
.panel::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 2px; }

.panel-eyebrow { margin-bottom: var(--space-1); }

.panel h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 200;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--color-text);
  margin-bottom: var(--space-5);
}

.panel-left {
  left: 0;
  border-right: 1px solid var(--color-border);
  bottom: 96px; /* clear the floating launch bar */
}

.panel-right {
  right: 0;
  border-left: 1px solid var(--color-border);
  bottom: 96px;
}

/* ===== CONTROLS ===== */
.control-group { margin-bottom: var(--space-5); }

.control-group label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-2);
}

.slider-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--color-primary);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

select {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: hsl(var(--card) / 0.6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23a89e8e' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  transition: border-color var(--transition-ui);
}
select:hover { border-color: var(--color-border-bright); }
select option { background: #0a0d15; color: var(--color-text); }
select:disabled { opacity: 0.7; cursor: not-allowed; }
select:disabled:hover { border-color: var(--color-border); }

/* Range slider */
input[type="range"] {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: hsl(var(--card) / 0.8);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  border: 2px solid #070912;
  box-shadow: 0 0 10px 1px hsl(var(--primary) / 0.4);
  transition: transform var(--transition-ui);
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.12); }
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  border: 2px solid #070912;
}

.slider-marks {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: var(--space-2);
}

/* ===== BOTTOM LAUNCH BAR ===== */
/* Floating action bar — desktop: centered pill; mobile: full-width footer. */
.launch-bar {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: var(--space-6);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  max-width: calc(100vw - 2 * var(--space-6));
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
  background: hsl(var(--card) / 0.6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  backdrop-filter: blur(var(--panel-blur));
  -webkit-backdrop-filter: blur(var(--panel-blur));
  box-shadow: 0 20px 50px -28px rgba(0, 0, 0, 0.8);
  animation: fade-up 0.7s var(--ease-expressive) both;
}

.launch-summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
  padding-right: var(--space-1);
}
.launch-summary #summary-speed { color: var(--color-primary); }
.summary-arrow { color: hsl(var(--muted-foreground) / 0.6); }
.summary-sep { color: hsl(var(--muted-foreground) / 0.4); }

/* "Controls" toggle — only on mobile */
.btn-controls {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-sm);
  transition: border-color var(--transition-ui), color var(--transition-ui);
}
.btn-controls:hover { border-color: var(--color-border-bright); color: var(--color-primary); }

.btn-launch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  background: var(--color-primary);
  color: hsl(var(--background));
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-sm);
  border-radius: var(--radius-full);
  transition: filter var(--transition-ui), transform var(--transition-ui);
}
.btn-launch:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-launch:active { transform: translateY(0); }
.btn-launch:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.btn-reset {
  padding: var(--space-3) var(--space-4);
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius-full);
  transition: border-color var(--transition-ui), color var(--transition-ui);
}
.btn-reset:hover {
  border-color: var(--color-border-bright);
  color: var(--color-primary);
}

/* Escape velocity indicator */
.escape-indicator {
  padding: var(--space-3);
  background: hsl(var(--card) / 0.4);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.escape-bar-bg {
  position: relative;
  height: 6px;
  background: hsl(var(--card) / 0.8);
  border-radius: var(--radius-full);
  overflow: visible;
}

.escape-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, hsl(var(--primary)) 0%, hsl(var(--chart-5)) 100%);
  width: 0%;
  transition: width 0.3s ease, box-shadow var(--transition-ui), filter var(--transition-ui);
}
/* Bloom once the chosen speed can break free */
.escape-bar-fill.at-escape {
  filter: brightness(1.18) saturate(1.1);
  box-shadow: 0 0 10px 1px hsl(var(--primary) / 0.55);
}

.escape-bar-marker {
  position: absolute;
  top: -5px;
  width: 2px;
  height: 16px;
  background: var(--color-text);
  border-radius: 1px;
  left: 50%;
  transition: left 0.3s ease;
}
.escape-bar-marker.pulse {
  background: hsl(var(--primary));
  animation: escapePulse 1.4s ease-in-out infinite;
}
@keyframes escapePulse {
  0%, 100% { box-shadow: 0 0 0 0 hsl(var(--primary) / 0); }
  50%      { box-shadow: 0 0 8px 1px hsl(var(--primary) / 0.7); }
}

.escape-labels {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}
#escape-vel-label {
  color: var(--color-text-muted);
  font-weight: 400;
}

/* ===== INFO PANEL ===== */
.planet-visual {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-5);
}

.planet-sphere {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
}
.planet-sphere::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.15), transparent 60%);
}

.earth-sphere { background: linear-gradient(135deg, #1a6b4a, #2b8cc4, #1a6b4a); }
.moon-sphere { background: linear-gradient(135deg, #888, #bbb, #999); }
.mars-sphere { background: linear-gradient(135deg, #a0522d, #d2691e, #8b4513); }
.jupiter-sphere { background: linear-gradient(135deg, #c4956a, #d2a679, #a67b4c, #c4956a); }
.venus-sphere { background: linear-gradient(135deg, #daa520, #f0c050, #cd853f); }
.mercury-sphere { background: linear-gradient(135deg, #8c7853, #a89070, #6b5a3e); }
.saturn-sphere { background: linear-gradient(135deg, #c4a35a, #e6c876, #a08840); }
.titan-sphere { background: linear-gradient(135deg, #d4851e, #e8a040, #b06810); }

.info-grid { display: grid; gap: 0; }

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
}
.info-item:last-child { border-bottom: none; }

.info-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}
.info-value {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}
.info-value.highlight { color: var(--color-primary); }

.fun-fact {
  margin-top: var(--space-5);
  padding: var(--space-4);
  background: hsl(var(--card) / 0.4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.fact-eyebrow {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: hsl(var(--primary) / 0.8);
}
.fun-fact p {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.55;
}

/* ===== OUTCOME OVERLAY ===== */
#outcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsl(var(--background) / 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.outcome-content {
  text-align: center;
  padding: var(--space-10) var(--space-8);
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  animation: fade-up 0.7s var(--ease-expressive) both;
}

.outcome-icon {
  color: var(--color-primary);
  margin-bottom: var(--space-1);
}
.outcome-icon svg { width: 44px; height: 44px; }

#outcome-eyebrow { margin: 0; }

.outcome-content h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 200;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--color-text);
}
.outcome-content h2 em { font-style: italic; color: var(--color-primary); }

.outcome-content p {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: hsl(var(--foreground) / 0.7);
  line-height: 1.6;
  margin-bottom: var(--space-3);
}

.outcome-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-content: center;
}
.outcome-actions .btn-ghost { margin-top: 0; }

/* ===== FADE-UP keyframe (brand entrance) ===== */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== MOBILE ===== */
.mobile-only { display: none; }

@media (max-width: 900px) {
  .panel-right { display: none; }
  .panel-left { width: 264px; }
  .hud-stats { gap: var(--space-3); }
}

/* ---- Mobile: full-width launch bar + slide-up controls drawer ---- */
@media (max-width: 640px) {
  .hud-top { padding-left: var(--space-4); }
  .brand-mark { top: var(--space-3); left: var(--space-3); }

  /* The launch bar becomes a fixed full-width footer. */
  .launch-bar {
    left: 0;
    right: 0;
    bottom: 0;
    transform: none;
    max-width: none;
    width: 100%;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-3) calc(var(--space-3) + env(safe-area-inset-bottom));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }
  .launch-bar .btn-launch { flex: 1; }
  /* The mission summary is shown in the drawer header on mobile, not the bar. */
  .launch-bar .launch-summary { display: none; }

  /* Controls become a drawer that slides up above the launch bar. */
  .panel-left {
    position: fixed;
    left: 0; right: 0;
    bottom: 72px;
    top: auto;
    width: 100%;
    max-height: 56dvh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-right: none;
    border-bottom: none;
    border-top: 1px solid var(--color-border);
    transform: translateY(120%);
    transition: transform 0.35s var(--ease-expressive);
    z-index: 20;
  }
  .panel-left.expanded { transform: translateY(0); }

  .mobile-only { display: inline-flex; }
  .hud-stats .stat:nth-child(3) { display: none; } /* Peak — first to drop on narrow screens */
  .hud-logo span:not(.tour-chip) { display: none; }

  .tour-banner {
    top: 58px;
    padding: var(--space-2) var(--space-4);
  }
  .tour-goal { font-size: var(--text-xs); }
}

/* ===== "WHY" TOOLTIP ===== */
.escape-vel-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.info-tip {
  position: relative;
  width: 15px;
  height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color var(--transition-ui), border-color var(--transition-ui);
}
.info-tip:hover,
.info-tip:focus-visible {
  color: var(--color-primary);
  border-color: var(--color-border-bright);
}
.info-tip-pop {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  width: 220px;
  padding: var(--space-3);
  background: hsl(var(--card) / 0.96);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(var(--panel-blur));
  -webkit-backdrop-filter: blur(var(--panel-blur));
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  line-height: 1.5;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity var(--transition-ui), transform var(--transition-ui), visibility var(--transition-ui);
  z-index: 40;
  pointer-events: none;
}
.info-tip:hover .info-tip-pop,
.info-tip:focus-visible .info-tip-pop,
.info-tip:focus-within .info-tip-pop,
.info-tip.open .info-tip-pop {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ===== ONBOARDING CUE ===== */
#onboarding-cue {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  z-index: 35;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: hsl(var(--card) / 0.7);
  border: 1px solid var(--color-border-bright);
  border-radius: var(--radius-full);
  backdrop-filter: blur(var(--panel-blur));
  -webkit-backdrop-filter: blur(var(--panel-blur));
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  white-space: nowrap;
  box-shadow: 0 0 24px -8px hsl(var(--primary) / 0.45);
  pointer-events: none;
}
.onboarding-arrow {
  color: var(--color-primary);
  animation: onboardPulse 1.2s ease-in-out infinite;
}
@keyframes onboardPulse {
  0%, 100% { transform: translateY(0);   opacity: 0.7; }
  50%      { transform: translateY(3px); opacity: 1; }
}
@media (max-width: 640px) {
  #onboarding-cue { bottom: 84px; font-size: var(--text-xs); }
}

/* ===== STARS ANIMATION FOR ESCAPE ===== */
@keyframes warpStars {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(1.5); opacity: 0.3; }
}
