:root {
  --panel: rgba(10, 15, 28, 0.76);
  --line: rgba(127, 188, 255, 0.18);
  --line-strong: rgba(127, 188, 255, 0.42);
  --text: #eef5ff;
  --muted: #8ba6ca;
  --accent: #62d3ff;
  --accent-2: #e29b52;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --display: "Syne", "Segoe UI", sans-serif;
  --body: "Space Grotesk", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(37, 92, 173, 0.18), transparent 24%),
    radial-gradient(circle at 80% 20%, rgba(255, 190, 92, 0.1), transparent 18%),
    linear-gradient(180deg, #010308 0%, #030912 50%, #010308 100%);
  color: var(--text);
  font-family: var(--body);
}
body { overflow-x: hidden; }
button, input { font: inherit; }
.hidden { display: none; }

.cosmos { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.nebula, .starfield { position: absolute; inset: 0; }
.nebula-a {
  background:
    radial-gradient(circle at 18% 20%, rgba(42, 128, 255, 0.18), transparent 18%),
    radial-gradient(circle at 78% 30%, rgba(255, 173, 63, 0.12), transparent 16%);
  filter: blur(28px);
}
.nebula-b {
  background:
    radial-gradient(circle at 70% 76%, rgba(34, 112, 255, 0.14), transparent 15%),
    radial-gradient(circle at 30% 58%, rgba(255, 255, 255, 0.08), transparent 10%);
  filter: blur(42px);
}
.starfield-a, .starfield-b {
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.75) 1px, transparent 1.5px),
    radial-gradient(circle, rgba(120,188,255,0.45) 1px, transparent 1.5px);
  background-size: 180px 180px, 260px 260px;
  background-position: 0 0, 100px 70px;
}
.starfield-b { opacity: 0.5; transform: scale(1.15); animation: drift 30s linear infinite; }

.kicker {
  margin: 0 0 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
}

.map-page, .mission-shell {
  position: relative;
  z-index: 1;
  width: min(1560px, calc(100vw - 20px));
  margin: 0 auto;
}

.map-page { padding: 18px 0 20px; min-height: 100vh; }
.map-topbar, .topbar, .story-card, .command-panel, .hero-stage, .telemetry-strip, .telemetry-panel, .manifest-panel, .planet-button, .toggle-button, .search-field input {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.map-topbar, .topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  padding: 18px 20px;
  border-radius: 24px;
}

.map-topbar h1, .topbar h2, .panel-header h3, .panel-header h2, .hero-copy h2 {
  margin: 0;
  font-family: var(--display);
}

.map-topbar h1 { font-size: clamp(2rem, 4vw, 4rem); }
.map-topbar-meta, .live-indicator, .manifest-summary, .toggle-button, .search-field input::placeholder, .fact-label, .planet-button small, .satellite-pill span {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
}
.map-topbar-meta { display: flex; gap: 18px; flex-wrap: wrap; }

.map-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.story-panel {
  display: grid;
  gap: 10px;
  align-content: start;
}

.story-heading {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 1rem;
}

.story-card {
  display: grid;
  gap: 8px;
  padding: 20px;
  border-radius: 20px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.story-card strong { font-size: 1.8rem; font-weight: 500; }
.story-card span { color: var(--muted); line-height: 1.6; }
.story-card.active { border-color: var(--line-strong); }

.orbit-map-shell {
  position: relative;
  min-height: calc(100vh - 150px);
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(3, 7, 14, 0.5);
}

.orbit-map {
  position: relative;
  min-height: calc(100vh - 150px);
  overflow: hidden;
  cursor: grab;
}

.orbit-map.dragging {
  cursor: grabbing;
}

.map-viewport {
  position: absolute;
  inset: 0;
  transform-origin: center center;
  will-change: transform;
}

.solar-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 180px;
  height: 180px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,221,110,0.3), transparent 65%);
  filter: blur(18px);
}

.sun-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46px;
  height: 46px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, #fff8a8 0%, #f0d15d 40%, #6b5412 100%);
  box-shadow: 0 0 34px rgba(255, 224, 117, 0.8);
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.orbit-layer { position: absolute; inset: 0; }
.map-orbit {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.14);
  transform: translate(-50%, -50%);
}
.map-orbit.ringed { border-color: rgba(226,155,82,0.35); }
.map-planet {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  background: rgba(0,0,0,0.6);
  box-shadow: 0 0 12px currentColor;
  transform: translate(-50%, -50%);
  cursor: pointer;
}
.map-planet::after {
  content: attr(data-name);
  position: absolute;
  left: 16px;
  top: -8px;
  white-space: nowrap;
  color: rgba(255,255,255,0.78);
  font-weight: 700;
  letter-spacing: 0.2em;
  font-size: 0.72rem;
}
.map-planet.active { transform: translate(-50%, -50%) scale(1.18); }

.map-overlay {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
}
.map-overlay-top { top: 0; }
.map-overlay-bottom { bottom: 0; }

.map-zoom-controls {
  position: absolute;
  right: 20px;
  bottom: 88px;
  z-index: 3;
  display: grid;
  gap: 8px;
}

.zoom-button {
  min-width: 48px;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(10, 15, 28, 0.82);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
}

.zoom-reset {
  height: 40px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.enter-button, .action-button {
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(98, 211, 255, 0.12);
  color: var(--text);
  cursor: pointer;
}
.live-indicator { color: #61ff9d; font-weight: 700; }

.mission-shell { padding: 18px 0 26px; }
.topbar { align-items: center; }
.topbar-actions { display: flex; }
.topbar-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 12px;
  width: min(520px, 100%);
}
.topbar-stat { padding: 12px 14px; border-radius: 16px; background: rgba(255,255,255,0.03); }
.topbar-stat span { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; }
.topbar-stat strong { display: block; margin-top: 8px; font-size: 1.25rem; }

.control-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 360px;
  gap: 18px;
  margin-top: 18px;
}
.command-panel, .manifest-panel { padding: 18px; border-radius: 24px; }
.planet-nav { display: grid; gap: 10px; }
.planet-button {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 13px 14px;
  border-radius: 18px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.planet-button.active { border-color: var(--line-strong); background: rgba(98,211,255,0.1); }
.planet-dot { width: 18px; height: 18px; border-radius: 50%; box-shadow: 0 0 16px rgba(255,255,255,0.22); }
.planet-button strong, .planet-button small { display: block; }
.moon-total { color: var(--accent-2); font-weight: 700; }

.main-stage { display: grid; gap: 18px; }
.hero-stage {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
  padding: 22px;
  border-radius: 28px;
}
.hero-copy h2 { font-size: clamp(3rem, 5vw, 5.4rem); line-height: 0.9; }
.hero-description { color: var(--muted); line-height: 1.8; font-size: 1rem; max-width: 58ch; }

.orbital-stage {
  position: relative;
  min-height: 480px;
  border-radius: 24px;
  overflow: hidden;
  background: radial-gradient(circle at center, rgba(127,188,255,0.08), transparent 34%);
}
.scan-ring, .orbit-band {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.scan-ring { border: 1px solid rgba(127,188,255,0.22); }
.scan-ring-a { width: 340px; height: 340px; animation: pulse 8s ease-in-out infinite; }
.scan-ring-b { width: 470px; height: 470px; border-style: dashed; animation: spin 24s linear infinite; }
.orbit-band { border: 1px dashed rgba(255,255,255,0.12); }
.orbit-band-a { width: 620px; height: 260px; transform: translate(-50%, -50%) rotate(-14deg); }
.orbit-band-b { width: 430px; height: 180px; transform: translate(-50%, -50%) rotate(18deg); }
.planet-display-wrap { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); }
.planet-display {
  position: relative;
  width: min(28vw, 260px);
  min-width: 180px;
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: inset -24px -28px 44px rgba(0,0,0,0.32), inset 14px 10px 20px rgba(255,255,255,0.08), 0 0 100px rgba(98,211,255,0.16);
  animation: float 7s ease-in-out infinite;
}
.planet-display::after {
  content: "";
  position: absolute;
  inset: 12% auto auto 20%;
  width: 32%;
  height: 16%;
  border-radius: 999px;
  background: rgba(255,255,255,0.24);
  filter: blur(10px);
}
.planet-display.ringed::before {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: calc(100% + 84px);
  height: 56px;
  border: 8px solid rgba(238,216,160,0.45);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(-14deg);
}
.world-badge {
  position: absolute;
  left: 18px;
  bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(3,8,18,0.72);
}
.world-badge-label { display: block; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.68rem; }
.world-badge strong { display: block; margin-top: 8px; font-size: 1.5rem; }

.telemetry-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border-radius: 24px;
}
.fact-card { padding: 14px; border-radius: 18px; background: rgba(255,255,255,0.03); }
.fact-value { margin: 0; font-size: 1.1rem; font-weight: 700; }

.secondary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.telemetry-panel { padding: 20px; border-radius: 24px; }
.brief-list { margin: 16px 0 0; padding-left: 18px; display: grid; gap: 10px; color: var(--muted); }
.featured-moons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.featured-tag { padding: 10px 14px; border-radius: 999px; border: 1px solid rgba(98,211,255,0.18); background: rgba(98,211,255,0.08); }

.manifest-tools { display: grid; gap: 12px; }
.search-field input { width: 100%; padding: 14px 16px; border-radius: 999px; color: var(--text); outline: none; }
.toggle-row { display: flex; flex-wrap: wrap; gap: 10px; }
.toggle-button { padding: 10px 14px; border-radius: 999px; color: var(--muted); cursor: pointer; }
.toggle-button.active { color: var(--text); border-color: var(--line-strong); background: rgba(98,211,255,0.16); }
.manifest-summary { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.satellite-list { display: grid; gap: 10px; max-height: 60vh; overflow: auto; padding-right: 4px; }
.satellite-pill { padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,0.03); }
.satellite-pill.provisional { background: rgba(255,209,102,0.08); }
.satellite-pill strong, .satellite-pill span { display: block; }
.satellite-pill strong { margin-bottom: 8px; font-size: 1rem; }
.satellite-pill .moon-code { color: var(--accent); }
.satellite-pill .moon-type { margin-top: 10px; }
.empty-state { padding: 22px; border: 1px dashed var(--line); border-radius: 18px; text-align: center; color: var(--muted); line-height: 1.7; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@keyframes spin { to { transform: translate(-50%, -50%) rotate(346deg); } }
@keyframes pulse { 0%,100% { opacity: 0.35; transform: translate(-50%, -50%) scale(0.96); } 50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.04); } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes drift { from { transform: scale(1.15) translate3d(0,0,0); } to { transform: scale(1.15) translate3d(-40px,30px,0); } }

@media (max-width: 1220px) {
  .map-layout, .control-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1080px) {
  .hero-stage, .secondary-grid { grid-template-columns: 1fr; }
  .topbar, .map-topbar { flex-direction: column; align-items: start; }
}
@media (max-width: 760px) {
  .map-page, .mission-shell { width: min(100vw - 12px, 100%); }
  .orbit-map, .orbit-map-shell { min-height: 72vh; }
  .topbar-stats, .telemetry-strip { grid-template-columns: 1fr; width: 100%; }
  .telemetry-strip { grid-template-columns: 1fr; }
  .hero-copy h2 { font-size: clamp(2.5rem, 14vw, 4rem); }
}
