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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(70, 90, 160, 0.35), transparent 45%),
    radial-gradient(ellipse at 80% 80%, rgba(40, 20, 80, 0.4), transparent 50%),
    #050816;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: #f4f6ff;
}

#canvas3d { display: block; width: 100vw; height: 100vh; cursor: grab; }
#canvas3d:active { cursor: grabbing; }

.hud {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(680px, calc(100vw - 48px));
  text-align: center;
  pointer-events: none;
  text-shadow: 0 2px 18px #000;
  z-index: 2;
}

.hud h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: linear-gradient(90deg, #fff7d6, #ffe08a, #fff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hud p { margin-top: 6px; font-size: 13px; opacity: 0.9; }
#clock { color: #ffd76a; font-variant-numeric: tabular-nums; font-weight: 600; }

.hud-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 6;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 28, 0.85);
  border: 1px solid rgba(255, 215, 120, 0.35);
  border-radius: 10px;
  color: #ffd76a;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.hud-btn:hover {
  background: rgba(215, 162, 26, 0.25);
  border-color: rgba(255, 215, 106, 0.65);
  transform: translateY(-1px);
}

.hud-btn:focus-visible {
  outline: 2px solid rgba(255, 215, 106, 0.75);
  outline-offset: 2px;
}

.hud-btn.hidden { display: none; }

.hud-btn__icon {
  width: 20px;
  height: 20px;
}

.hud-btn__icon.hidden { display: none; }

#hover-name {
  position: fixed;
  pointer-events: none;
  background: rgba(8, 12, 28, 0.85);
  border: 1px solid rgba(255, 215, 120, 0.35);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
  z-index: 5;
}
#hover-name.hidden { display: none; }

#info-panel {
  position: fixed;
  left: 0;
  top: 0;
  width: min(360px, 92vw);
  height: 100vh;
  padding: 28px 22px 170px;
  background:
    linear-gradient(165deg, rgba(18, 24, 52, 0.97), rgba(8, 10, 24, 0.95)),
    radial-gradient(circle at top left, rgba(255, 200, 80, 0.12), transparent 45%);
  border-right: 1px solid rgba(255, 215, 106, 0.35);
  box-shadow: 18px 0 50px rgba(0, 0, 0, 0.45);
  overflow-y: auto;
  z-index: 3;
  backdrop-filter: blur(8px);
}
#info-panel.hidden { display: none; }

#close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}
#close-btn:hover { background: rgba(215, 162, 26, 0.35); }

.panel-kicker {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #ffd76a;
  margin-bottom: 6px;
}

#info-panel h2 {
  font-size: 32px;
  margin-bottom: 8px;
  text-shadow: 0 0 24px rgba(255, 215, 106, 0.25);
}
.diameter { color: #9ec5ff; margin-bottom: 10px; }
#info-panel dl div { margin-bottom: 14px; }
#info-panel dt {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8aa0c8;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sf {
  width: 18px;
  height: 18px;
  color: #ffd76a;
  flex: none;
}
#info-panel dd { line-height: 1.55; white-space: pre-wrap; }

#facts {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#facts li {
  position: relative;
  padding-left: 14px;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
}

#facts li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #ffd76a;
}

#moons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.moon-chip {
  background: linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.04));
  border: 1px solid rgba(255, 215, 106, 0.4);
  color: #f4f6ff;
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12px;
  cursor: pointer;
  transition: 0.15s ease;
}

.moon-chip:hover {
  background: linear-gradient(180deg, #ffd76a, #d7a21a);
  color: #1a1408;
  border-color: #ffd76a;
  transform: translateY(-1px);
}

#loader {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at center, rgba(80, 100, 180, 0.25), #050816 60%);
  z-index: 10;
  font-size: 18px;
}
#loader.hidden { display: none; }

#planet-nav {
  position: fixed;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: min(980px, calc(100vw - 20px));
  z-index: 4;
  padding: 4px 6px;
  border-radius: 14px;
  background: rgba(6, 10, 24, 0.55);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
}

.nav-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-row-label {
  width: 100%;
  text-align: center;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  padding: 1px 0 0;
}

#planet-nav button {
  background: rgba(255,255,255,0.06);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  padding: 4px 9px;
  cursor: pointer;
  font-size: 12px;
}

#planet-nav button:hover {
  border-color: rgba(255, 215, 106, 0.55);
}

#planet-nav button.active {
  background: linear-gradient(180deg, #ffd76a, #d7a21a);
  color: #1a1408;
  border-color: #ffd76a;
  font-weight: 650;
}

#fullscreen-btn{position:fixed;top:14px;right:14px;z-index:6;width:40px;height:40px;border-radius:10px;border:1px solid rgba(255,215,106,.4);background:rgba(8,12,28,.75);color:#ffd76a;font-size:18px;cursor:pointer}
#fullscreen-btn:hover{background:rgba(215,162,26,.35)}

.body-photo {
  display: block;
  width: 168px;
  height: 168px;
  max-width: 100%;
  object-fit: cover;
  object-position: center;
  margin: 10px auto 14px;
  background: transparent;
  border-radius: 50%;
  /* clip square black corners — show only the planet disk */
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}
/* Saturn / Uranus: full disk + rings visible on both sides */
.body-photo.body-photo--rings {
  width: 100%;
  height: auto;
  max-height: 150px;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: none;
}
.body-photo.hidden { display: none; }

.hidden { display: none !important; }

.cover {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255, 200, 80, 0.18), transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(60, 80, 160, 0.35), transparent 55%),
    #050816;
}
.cover.gone {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}
.cover-kicker {
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 13px;
  color: #ffd76a;
  margin-bottom: 14px;
}
.cover-title {
  font-size: clamp(36px, 7vw, 64px);
  font-weight: 700;
  letter-spacing: 0.06em;
  background: linear-gradient(90deg, #fff7d6, #ffe08a, #fff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 14px;
}
.cover-sub {
  font-size: 18px;
  color: #9ec5ff;
  margin-bottom: 36px;
  max-width: 520px;
}
.cover-btn {
  border: none;
  cursor: pointer;
  font-size: 20px;
  font-weight: 700;
  padding: 16px 42px;
  border-radius: 999px;
  color: #1a1408;
  background: linear-gradient(180deg, #ffd76a, #d7a21a);
  box-shadow: 0 10px 40px rgba(215, 162, 26, 0.35);
}
.cover-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.cover-hint {
  margin-top: 22px;
  font-size: 13px;
  color: rgba(244, 246, 255, 0.55);
}
