:root {
  --bg: #020611;
  --bg-soft: #071226;
  --panel: rgba(6, 14, 30, 0.78);
  --panel-border: rgba(152, 202, 255, 0.16);
  --text: #edf5ff;
  --muted: #a8bfd9;
  --accent: #8dd6ff;
  --accent-strong: #38a6ff;
  --sun-glow: rgba(255, 177, 74, 0.42);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(54, 114, 187, 0.14), transparent 30%),
    radial-gradient(circle at 20% 20%, rgba(173, 90, 255, 0.1), transparent 26%),
    linear-gradient(180deg, #030712 0%, #02050d 100%);
  overflow: hidden;
}

.page-shell {
  min-height: 100vh;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 340px;
  gap: 20px;
  align-items: end;
}

.hero-copy,
.control-panel,
.viewer-card,
.info-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-copy,
.control-panel,
.info-card {
  border-radius: 24px;
  padding: 24px;
}

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

h1, h2 {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  line-height: 1;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 5rem);
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.hero-text,
.hint,
.planet-description,
.info-note {
  color: var(--muted);
}

.hero-text {
  max-width: 58ch;
  margin: 14px 0 0;
  font-size: 1.02rem;
  line-height: 1.65;
}

.control-panel label,
.control-panel p,
.planet-tagline,
.planet-stats dt,
.planet-stats dd {
  margin: 0;
}

.control-panel {
  display: grid;
  gap: 10px;
}

.control-panel label {
  font-weight: 700;
}

#zoomRange {
  width: 100%;
  accent-color: var(--accent-strong);
}

#zoomValue {
  font-family: "Orbitron", sans-serif;
  color: var(--accent);
}

.main-grid {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) 360px;
  gap: 20px;
}

.viewer-card {
  position: relative;
  min-height: 0;
  border-radius: 28px;
  overflow: hidden;
}

.viewer-frame {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 560px;
  cursor: grab;
}

.viewer-frame.dragging {
  cursor: grabbing;
}

.viewer-backdrop,
.star-layer,
.nebula,
.scene-viewport,
.solar-scene {
  position: absolute;
  inset: 0;
}

.viewer-backdrop {
  background:
    radial-gradient(circle at 18% 48%, rgba(255, 183, 76, 0.06), transparent 18%),
    radial-gradient(circle at 70% 20%, rgba(39, 130, 255, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(5, 12, 24, 0.9), rgba(2, 4, 12, 0.98));
}

.star-layer {
  opacity: 0.75;
}

.star-layer-a {
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.95) 0 1px, transparent 1.6px),
    radial-gradient(circle, rgba(141,214,255,0.9) 0 1px, transparent 1.7px),
    radial-gradient(circle, rgba(255,224,163,0.95) 0 1px, transparent 1.8px);
  background-size: 210px 210px, 290px 290px, 360px 360px;
  background-position: 10px 18px, 110px 90px, 40px 170px;
  animation: drift 80s linear infinite;
}

.star-layer-b {
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.9) 0 1px, transparent 1.6px),
    radial-gradient(circle, rgba(112,190,255,0.8) 0 1px, transparent 1.8px);
  background-size: 240px 240px, 410px 410px;
  background-position: 80px 40px, 140px 180px;
  opacity: 0.5;
  animation: drift 120s linear infinite reverse;
}

.nebula {
  filter: blur(30px);
  opacity: 0.32;
}

.nebula-a {
  background: radial-gradient(circle at 20% 35%, rgba(97, 185, 255, 0.36), transparent 20%);
}

.nebula-b {
  background: radial-gradient(circle at 80% 65%, rgba(225, 103, 255, 0.24), transparent 18%);
}

.scene-viewport {
  overflow: hidden;
}

.solar-scene {
  transform-origin: center center;
  transition: transform 180ms ease-out;
}

.sun {
  position: absolute;
  left: 120px;
  top: 50%;
  transform: translateY(-50%);
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, #fff7cd, #ffbe52 32%, #ff7d2c 70%, #ba3308 100%);
  box-shadow:
    0 0 30px rgba(255, 194, 112, 0.85),
    0 0 100px var(--sun-glow),
    0 0 180px rgba(255, 142, 51, 0.32);
}

.sun::after {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  border: 1px solid rgba(255, 224, 166, 0.2);
  animation: pulse 5s ease-in-out infinite;
}

.orbit {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid rgba(147, 180, 225, 0.18);
  border-radius: 999px;
}

.planet-group {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translate(50%, -50%);
  animation: orbit-spin linear infinite;
}

.planet {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow:
    inset -8px -12px 18px rgba(0, 0, 0, 0.32),
    0 0 18px rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.planet:hover,
.planet:focus-visible,
.planet.active {
  transform: translate(-50%, -50%) scale(1.12);
  box-shadow:
    inset -8px -12px 18px rgba(0, 0, 0, 0.32),
    0 0 0 2px rgba(255,255,255,0.14),
    0 0 24px rgba(141, 214, 255, 0.34);
  outline: none;
}

.planet-label {
  position: absolute;
  top: calc(50% + 20px);
  left: calc(50% + 20px);
  min-width: max-content;
  color: rgba(235, 244, 255, 0.92);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

.ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  border: 4px solid rgba(210, 194, 157, 0.55);
  transform: translate(-50%, -50%) rotateX(72deg);
  opacity: 0.82;
}

.moon-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px dashed rgba(199, 213, 235, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.moon {
  position: absolute;
  top: 50%;
  right: 0;
  border-radius: 50%;
  transform: translate(50%, -50%);
  background: radial-gradient(circle at 30% 30%, #f5f8ff, #95a6bf 70%, #607086 100%);
  box-shadow: 0 0 8px rgba(255,255,255,0.16);
}

.info-card {
  display: grid;
  align-content: start;
  gap: 18px;
}

.planet-tagline {
  font-size: 1.06rem;
  color: #d9ebff;
}

.planet-stats {
  display: grid;
  gap: 14px;
}

.planet-stats div {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.planet-stats dt {
  color: var(--muted);
  font-size: 0.84rem;
  margin-bottom: 6px;
}

.planet-stats dd {
  font-size: 1rem;
  font-weight: 700;
}

.planet-description {
  line-height: 1.7;
}

.info-note {
  font-size: 0.86rem;
}

@keyframes orbit-spin {
  from { transform: translate(50%, -50%) rotate(0deg); }
  to { transform: translate(50%, -50%) rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.08); opacity: 0.9; }
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-160px, 120px, 0); }
}

@media (max-width: 1100px) {
  body {
    overflow: auto;
  }

  .hero,
  .main-grid {
    grid-template-columns: 1fr;
  }

  .main-grid {
    grid-template-rows: auto auto;
  }

  .viewer-frame {
    min-height: 500px;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 16px;
  }

  .hero-copy,
  .control-panel,
  .info-card {
    padding: 18px;
  }

  .viewer-frame {
    min-height: 420px;
  }

  .sun {
    left: 90px;
    width: 96px;
    height: 96px;
  }
}
