/* Planets — solar system explorer */
:root {
  --bg-0: #050414;
  --bg-1: #0a0820;
  --ink: #f4f1e8;
  --ink-dim: rgba(244, 241, 232, 0.62);
  --ink-faint: rgba(244, 241, 232, 0.35);
  --panel: rgba(14, 12, 32, 0.78);
  --panel-border: rgba(255, 255, 255, 0.09);
  --accent: #ffd66b;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

html,
body,
#root {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-0);
  color: var(--ink);
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
@keyframes counter-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(-360deg);
  }
}
@keyframes orbit {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
@keyframes twinkle {
  0%,
  100% {
    opacity: var(--o, 0.6);
  }
  50% {
    opacity: 0.15;
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes detail-enter {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes info-slide {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes planet-dance-bob {
  0%,
  100% {
    transform: translateY(0) scale(1);
    filter: saturate(1);
  }
  25% {
    transform: translateY(-12%) scale(1.06);
    filter: saturate(1.25);
  }
  50% {
    transform: translateY(4%) scale(0.98);
    filter: saturate(1.1);
  }
  75% {
    transform: translateY(-8%) scale(1.04);
    filter: saturate(1.22);
  }
}
@keyframes planet-heart-float {
  from {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.76);
  }
  18% {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translate(-50%, -34px) scale(1.2);
  }
}

/* Honor OS reduce-motion: kill spins/orbits/bobs/flickers, keep simple fades.
   Critical for kids/accessibility — this app stacks orbital spins, sticker
   wiggles, treasure pulses, rocket flame flickers, and a comet flyby, any
   of which can trigger vestibular issues. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

.app {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 50%, #0c0a26 0%, #050414 70%), var(--bg-0);
  overflow: hidden;
}
.app.quiet-mode {
  background:
    radial-gradient(ellipse at 50% 50%, #090820 0%, #02020b 72%), #02020b;
}
.app.quiet-mode .overview-stage,
.app.quiet-mode .draggable-astronaut {
  filter: saturate(0.72) brightness(0.78);
}
.app.quiet-mode .nebula {
  opacity: 0.08 !important;
}
.app.quiet-mode .star {
  opacity: calc(var(--o, 0.6) * 0.58) !important;
}

/* AGENT_TARGET: lullaby-orbit-mode — dreamy bedtime palette */
.app.lullaby-mode {
  background: radial-gradient(ellipse at 50% 50%, #06051a 0%, #010108 72%),
    #010108;
  transition: background 2s ease;
}
.app.lullaby-mode .overview-stage,
.app.lullaby-mode .draggable-astronaut {
  filter: saturate(0.45) brightness(0.6) hue-rotate(20deg);
  transition: filter 2s ease;
}
.app.lullaby-mode .nebula {
  opacity: 0.04 !important;
}
.app.lullaby-mode .star {
  opacity: calc(var(--o, 0.6) * 0.35) !important;
}
.app.lullaby-mode .planet-marker {
  animation-timing-function: linear !important;
}

/* ---------- Starfield ---------- */
.starfield {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.star {
  position: absolute;
  border-radius: 50%;
  --o: 0.6;
  animation: twinkle ease-in-out infinite;
}
.starfield-still .star,
.quality-low .star {
  animation: none !important;
}
.nebula {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
}

/* ---------- Meteor Swipe ---------- */
.meteor-swipe-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}
.meteor-swipe-cue {
  position: fixed;
  z-index: 3;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 12px));
  width: min(210px, calc(100vw - 28px));
  padding: 8px 10px;
  border: 1px solid rgba(255, 245, 170, 0.34);
  border-radius: 8px;
  background: rgba(12, 16, 36, 0.82);
  color: #fff8c8;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
  animation: meteor-swipe-cue-pop 180ms ease-out both;
}
.meteor-swipe-cue.settling {
  animation: meteor-swipe-cue-settle 900ms ease-out both;
}
.meteor-swipe-cue span,
.meteor-swipe-cue strong {
  display: block;
  overflow-wrap: anywhere;
}
.meteor-swipe-cue span {
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
}
.meteor-swipe-cue strong {
  margin-top: 4px;
  font-size: 10px;
  color: rgba(230, 240, 255, 0.78);
}
.meteor-swipe-cue i {
  display: block;
  height: 4px;
  margin-top: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, #7db7ff, #fff2a0, #ff9f5f);
}
.meteor-swipe-cue i::after {
  content: "";
  display: block;
  width: var(--meteor-swipe-strength, 25%);
  height: 100%;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 12px rgba(255, 245, 170, 0.7);
}
@keyframes meteor-swipe-cue-pop {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-100% - 6px)) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, calc(-100% - 12px)) scale(1);
  }
}
@keyframes meteor-swipe-cue-settle {
  0% {
    opacity: 1;
    transform: translate(-50%, calc(-100% - 12px)) scale(1);
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, calc(-100% - 24px)) scale(0.98);
  }
}

/* AGENT_TARGET: venus-rain — acid rain overlay */
.venus-rain-overlay {
  position: fixed;
  inset: 0;
  z-index: 680;
  background: radial-gradient(ellipse at 50% 0%, rgba(180, 140, 0, 0.28) 0%, rgba(80, 60, 0, 0.18) 60%, transparent 100%);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.venus-rain-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 48px;
  padding: 14px 22px;
  background: rgba(20, 14, 0, 0.75);
  border: 1px solid rgba(220, 180, 30, 0.5);
  border-radius: 14px;
  color: #ffe88a;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  pointer-events: none;
  z-index: 2;
}
.venus-rain-clouds {
  font-size: 26px;
  letter-spacing: 6px;
}
.venus-rain-fact {
  font-size: 13px;
  font-weight: normal;
  color: #f0d080;
  max-width: 280px;
}
.venus-rain-sequence {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  max-width: 320px;
  margin-top: 4px;
}
.venus-rain-sequence b {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(240, 208, 128, 0.34);
  border-radius: 999px;
  background: rgba(240, 208, 128, 0.12);
  color: #fff2b8;
  font-size: 11px;
  font-weight: 900;
  padding: 4px 8px;
}
.venus-rain-drop {
  position: absolute;
  top: -20px;
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(200, 230, 80, 0.0) 0%, rgba(190, 220, 60, 0.85) 60%, rgba(160, 200, 40, 0.4) 100%);
  animation: venus-drop-fall linear infinite;
}
@keyframes venus-drop-fall {
  0%   { transform: translateY(-20px); opacity: 0; }
  10%  { opacity: 1; }
  85%  { opacity: 0.9; }
  100% { transform: translateY(110vh); opacity: 0; }
}
.venus-rain-dismiss {
  position: absolute;
  bottom: 28px;
  font-size: 12px;
  color: rgba(200, 180, 60, 0.6);
  pointer-events: none;
}

/* AGENT_TARGET: galileo-eyepiece — era slider overlay */
.galileo-overlay {
  position: fixed;
  inset: 0;
  z-index: 700;
  background: rgba(4, 4, 20, 0.93);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 32px 20px 24px;
  overflow-y: auto;
}
.galileo-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.galileo-title {
  font-size: 22px;
  font-weight: bold;
  color: #e8d8a0;
  text-align: center;
}
.galileo-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,0.12);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 18px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.galileo-year-label {
  font-size: 44px;
  font-weight: bold;
  color: #ffe580;
  letter-spacing: 2px;
  margin: 8px 0 4px;
  font-variant-numeric: tabular-nums;
}
.galileo-era-stepper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: min(320px, 90vw);
  margin: 6px 0 4px;
}
.galileo-era-stepper button {
  min-height: 46px;
  border: 1px solid rgba(255, 229, 128, 0.32);
  border-radius: 999px;
  background: rgba(255, 229, 128, 0.12);
  color: #ffe580;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
}
.galileo-era-stepper button:hover:not(:disabled),
.galileo-era-stepper button:focus-visible {
  background: rgba(255, 229, 128, 0.22);
  border-color: rgba(255, 229, 128, 0.62);
  outline: none;
}
.galileo-era-stepper button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}
.galileo-slider-wrap {
  width: min(420px, 90vw);
  margin: 8px 0 12px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.galileo-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, #4a3a10, #c8a020);
  outline: none;
  cursor: pointer;
}
.galileo-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffe580;
  border: 2px solid #c8a020;
  cursor: pointer;
}
.galileo-era-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 11px;
  color: rgba(220, 200, 100, 0.6);
}
.galileo-discovery-meter {
  width: min(360px, 90vw);
  display: grid;
  gap: 6px;
  margin: 0 0 8px;
  padding: 10px 12px;
  border: 1px solid rgba(232, 216, 160, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}
.galileo-discovery-meter strong {
  color: #ffe580;
  font-size: 13px;
  font-weight: 1000;
  text-transform: uppercase;
}
.galileo-discovery-meter i {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}
.galileo-discovery-meter b {
  display: block;
  min-width: 10px;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5c85ff, #ffe580);
}
.galileo-discovery-meter span {
  color: #8898b0;
  font-size: 12px;
  font-weight: 800;
}
.galileo-note {
  font-size: 14px;
  color: #b8c8e0;
  text-align: center;
  max-width: 400px;
  margin: 6px 0 16px;
  line-height: 1.5;
  min-height: 3em;
}
.galileo-system {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(460px, 95vw);
}
.galileo-planet-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-radius: 10px;
  width: 100%;
  transition: opacity 0.4s, background 0.3s;
}
.galileo-planet-row.known {
  background: rgba(255, 220, 80, 0.08);
  opacity: 1;
}
.galileo-planet-row.unknown {
  background: transparent;
  opacity: 0.22;
}
.galileo-planet-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}
.galileo-planet-name {
  font-size: 16px;
  font-weight: bold;
  color: #e0d090;
  min-width: 80px;
}
.galileo-planet-detail {
  font-size: 12px;
  color: #8898b0;
}
.galileo-planet-row.known .galileo-planet-detail {
  color: #a0b8d0;
}
