:root { view-transition-name: none; }

#galaxy { position: relative; container-type: inline-size; }
.scene { view-transition-name: nova-scene; }
.solar-map { position: relative; isolation: isolate; padding-top: 16px; }
.solar-map[inert] { view-transition-name: none; }

.map-intro {
  position: absolute;
  top: 7px;
  left: 12px;
  z-index: 2;
  pointer-events: none;
}
.map-intro h1 {
  font-size: clamp(1.28rem, 3.15cqw, 1.95rem);
  font-weight: 540;
  letter-spacing: -.036em;
  line-height: 1.2;
}
.map-intro .greeting-name { color: #68b0ff; }
.map-intro time { display: block; margin-top: 7px; color: #b1bfd4; font-size: clamp(.72rem, 1.5cqw, .88rem); }

.orbit-chart { position: relative; container-type: inline-size; width: 100%; aspect-ratio: 900 / 820; }
.orbit-lines { position: absolute; inset: 0; display: block; width: 100%; height: 100%; pointer-events: none; }
.orbit-rings {
  fill: none;
  stroke: #2353a5;
  stroke-width: .65;
  stroke-dasharray: 2 4;
  opacity: .56;
}
.orbit-rings circle:nth-child(3n + 1) { stroke-dasharray: 1 3; opacity: .65; }
.orbit-links { stroke: #70b9ff; filter: drop-shadow(0 0 3px #268bff); }
.planet-link { stroke-width: 1.25; }
.moon-link { stroke-width: .9; opacity: .91; }
.orbit-compact { display: none; }

.orb, .detail-orb {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border: 1px solid #a3d3ff;
  border-radius: 50%;
  color: #eff6ff;
  background: radial-gradient(circle at 48% 46%, #051023 0%, #020812 66%, #061632 100%);
  box-shadow: 0 0 5px #699fff, 0 0 19px #1975f378, inset 0 0 15px #195aba70;
  text-align: center;
}
.orb {
  position: absolute;
  z-index: 1;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  transition: box-shadow 180ms ease, border-color 180ms ease, scale 180ms ease;
}
.orb:hover, .orb:focus-visible {
  z-index: 2;
  border-color: #d6f2ff;
  box-shadow: 0 0 8px #8ccaff, 0 0 25px #1979ff, inset 0 0 19px #1a66d896;
  scale: 1.035;
}
.orb .icon, .detail-orb .icon { color: #4aa7ff; filter: drop-shadow(0 0 5px #2064e9a3); }

.stat-orb {
  width: 39.1cqw;
  gap: clamp(3px, .66cqw, 7px);
  border-color: #c1eaff;
  background: #02040a url("../assets/eclipse.webp") 79% 50% / 420% auto no-repeat;
  box-shadow: 0 0 5px #c2eeff, 0 0 19px #0084ffda, 0 0 54px #135af291, inset 0 0 12px #2d9effad;
}
.stat-orb:hover, .stat-orb:focus-visible { box-shadow: 0 0 7px #d8f4ff, 0 0 25px #0084ff, 0 0 64px #135af2cd, inset 0 0 13px #34a0ffca; }
.star-label { color: #e7eeff; font-size: clamp(.57rem, 1.35cqw, .79rem); letter-spacing: .03em; text-transform: uppercase; }
.star-value {
  color: #eef5ff;
  font-size: clamp(1.6rem, 5.65cqw, 4.1rem);
  font-weight: 650;
  line-height: .99;
  letter-spacing: -.065em;
  text-shadow: 0 0 22px #5f95fd65;
}
.star-coverage { color: #8ec9ff; font-size: clamp(.55rem, 1.15cqw, .68rem); }
.star-metrics { display: grid; width: 68%; gap: clamp(3px, .73cqw, 7px); margin: clamp(3px, 1.04cqw, 10px) 0; }
.star-metric {
  display: grid;
  grid-template-columns: minmax(10px, .25fr) minmax(0, 1.55fr) minmax(15px, 1.15fr) minmax(20px, .45fr);
  align-items: center;
  gap: clamp(2px, .67cqw, 6px);
  color: #c2cde0;
  font-size: clamp(.54rem, 1.21cqw, .72rem);
  text-align: left;
}
.star-metric .icon { width: clamp(10px, 1.62cqw, 15px); height: clamp(10px, 1.62cqw, 15px); color: #aebbd1; filter: none; }
.star-metric > :last-child { text-align: right; font-variant-numeric: tabular-nums; }
.star-metric progress { height: 4px; }
.star-action {
  padding: 5px 11px;
  border: 1px solid #18365b;
  border-radius: 999px;
  color: #81c8ff;
  background: #040d1c;
  font-size: clamp(.53rem, 1.25cqw, .75rem);
}

.planet {
  width: 15.1cqw;
  gap: clamp(2px, .46cqw, 5px);
  font-size: clamp(.56rem, 1.65cqw, .97rem);
  font-weight: 550;
  text-transform: uppercase;
}
.planet .icon { width: 4.65cqw; height: 4.65cqw; stroke-width: 1.15; }
.planet strong { color: #81c9ff; font-size: clamp(.53rem, 1.4cqw, .8rem); font-weight: 550; line-height: 1; }
.planet progress { width: 42%; height: 3px; }
.moon {
  width: 6.55cqw;
  padding: 3px 5px;
  border-color: #66a9ef;
  background: radial-gradient(circle at 49% 43%, #081628, #020912 78%);
  box-shadow: 0 0 10px #1a72d287, inset 0 0 10px #1b4b8260;
  font-size: clamp(.49rem, 1.12cqw, .66rem);
  line-height: 1.25;
}

.body-view {
  min-height: min(780px, 90cqw);
  margin-top: 14px;
  padding: clamp(13px, 2.1cqw, 20px);
  border: 1px solid #1b2c49;
  border-radius: 17px;
  background: radial-gradient(ellipse at 28% 43%, #0a1d3f65, #030814b8 68%);
}
.scene-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: .78rem;
}
.scene-breadcrumb a { display: inline-flex; align-items: center; gap: 5px; padding-block: 6px; color: var(--blue); }
.scene-breadcrumb a:hover { color: #d2e9ff; }
.scene-breadcrumb .icon { width: 13px; height: 13px; }
.scene-heading { margin: 15px 0 19px; }
.scene-heading h1 { font-size: clamp(1.7rem, 4.8cqw, 3rem); font-weight: 610; letter-spacing: -.045em; }
.scene-heading p { max-width: 57ch; margin-top: 6px; color: var(--muted); font-size: .85rem; line-height: 1.55; }

.moon-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-bottom: 15px; }
.moon-tabs a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 9px;
  border: 1px solid #243b62;
  border-radius: 9px;
  color: #c8d9f4;
  background: #091527;
  font-size: .75rem;
}
.moon-tabs a:hover, .moon-tabs a[aria-current="page"] { color: #f1f7ff; border-color: #639eeb; background: #142b52; }
.moon-dot {
  width: 14px;
  height: 14px;
  flex: none;
  border: 1px solid #84c6ff;
  border-radius: 50%;
  background: #0a213f;
  box-shadow: 0 0 5px #3b8be0aa, inset 0 0 3px #3b8be0aa;
}
.planet-tabs { grid-template-columns: repeat(auto-fit, minmax(115px, 1fr)); margin: 15px 0 0; }
.planet-tabs a strong { margin-left: auto; color: #9ad2ff; font-size: .72rem; font-weight: 500; }
.planet-tabs a .icon { width: 17px; height: 17px; color: #67b2ff; }

.body-grid { display: grid; grid-template-columns: minmax(0, .94fr) minmax(0, 1.16fr); gap: 14px; align-items: start; }
.orb-stage { position: relative; isolation: isolate; display: grid; place-items: center; min-height: 310px; }
.orb-stage::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: repeating-radial-gradient(circle at center, #3a6db965 0 .6px, transparent 1px 20px);
  mask-image: radial-gradient(ellipse, #000 20%, transparent 72%);
}
.detail-orb { width: min(85%, 284px); gap: clamp(6px, .95cqw, 11px); }
.detail-orb .icon { width: min(21%, 55px); height: auto; aspect-ratio: 1; stroke-width: 1.15; }
.detail-moon { border-color: #80aaff; box-shadow: 0 0 8px #719bff, 0 0 28px #2566eb86, inset 0 0 24px #4766d986; }
.detail-panel { padding: 15px; }
.detail-panel h2 { margin-bottom: 13px; font-size: .98rem; font-weight: 610; }
.detail-panel h3 { margin-bottom: 8px; font-size: .77rem; font-weight: 610; }
.detail-panel > p { margin-top: 11px; }
.detail-panel form > button { justify-self: start; }

.score-breakdown { display: grid; }
.score-breakdown > div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid #192946; }
.score-breakdown dt { color: #d9e4f6; font-size: .79rem; }
.score-breakdown dt span { display: block; margin-top: 4px; color: var(--dim); font-size: .69rem; line-height: 1.4; }
.score-breakdown dd { color: #9bd1ff; font-size: .81rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.check-history { margin-top: 14px; padding-top: 11px; border-top: 1px solid var(--line); }
.history-entry { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; padding: 5px 4px; border: 0; border-radius: 5px; color: #cedef8; background: none; font-size: .74rem; text-align: left; }
.history-entry:hover { background: #132442; }
.history-entry span { margin-left: auto; overflow-wrap: anywhere; }
.history-entry .icon { width: 13px; height: 13px; color: var(--blue); }

.focus-flight { view-transition-name: nova-focus; }
::view-transition { pointer-events: none; }
::view-transition-group(nova-focus) { z-index: 2; animation-duration: 460ms; animation-timing-function: cubic-bezier(.23, .74, .2, 1); }
::view-transition-old(nova-scene) { animation: nova-exit 220ms ease both; }
::view-transition-new(nova-scene) { animation: nova-enter 400ms ease both; }
@keyframes nova-exit { to { opacity: 0; transform: scale(1.012); } }
@keyframes nova-enter { from { opacity: 0; transform: scale(.984); } }

@container (max-width: 550px) {
  .solar-map { padding-top: 0; }
  .map-intro { position: relative; inset: auto; padding: 9px 4px 4px; }
  .orbit-chart { margin-top: -2px; }
  .orbit-wide, .moon { display: none; }
  .orbit-compact { display: inline; }
  .orb { left: var(--mx); top: var(--my); }
  .stat-orb { width: 42cqw; }
  .star-metrics { display: none; }
  .star-action { margin-top: 4px; }
  .planet { width: 17.8cqw; min-width: 44px; }
  .planet .icon { width: 5.55cqw; height: 5.55cqw; }
  .body-view { min-height: 0; }
  .body-grid { grid-template-columns: minmax(0, 1fr); }
  .orb-stage { min-height: clamp(145px, 58cqw, 280px); }
  .detail-orb { width: clamp(135px, 49cqw, 230px); }
}
@container (max-width: 355px) {
  .moon-tabs { gap: 5px; }
  .moon-tabs a { gap: 5px; padding-inline: 5px; font-size: .66rem; }
  .moon-dot { width: 11px; height: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .orb { transition: none; }
  .orb:hover, .orb:focus-visible { scale: 1; }
  ::view-transition-old(nova-scene), ::view-transition-new(nova-scene), ::view-transition-group(nova-focus) { animation-duration: 1ms; }
}

#mission-quote {
  max-width: 35ch;
  margin-top: 6px;
  color: #afc8e8;
  font-size: clamp(.7rem, 1.42cqw, .87rem);
  line-height: 1.35;
}
.map-intro time { margin-top: 4px; }
.scene-heading .sample-note { color: #9dd0ff; font-size: .75rem; }

.orbit-backdrop {
  position: absolute;
  z-index: 3;
  inset: 0;
  background: #02061080;
  cursor: zoom-out;
}
.body-view {
  position: relative;
  z-index: 4;
  margin: 8px clamp(12px, 3cqw, 35px);
  background: radial-gradient(ellipse at 28% 43%, #0a1b37, #040a16 74%);
}
.detail-open .solar-map { position: absolute; inset: 0; }
.detail-open { display: flow-root; }
#score-storage-error { position: absolute; z-index: 5; inset-inline: 10px; bottom: 8px; }

@media (min-width: 926px) {
  #galaxy { container-type: size; }
  .solar-map { display: grid; place-items: center; height: 100%; padding-top: 7px; }
  .orbit-chart { width: min(100%, calc((100cqh - 7px) * 900 / 820)); }
  .body-view {
    position: absolute;
    inset: clamp(8px, 2cqh, 20px) clamp(15px, 4.4cqw, 45px);
    min-height: 0;
    margin: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
  .orb-stage { min-height: clamp(215px, 38dvh, 310px); }
}
@media (min-width: 926px) and (max-height: 825px) {
  .map-intro h1 { font-size: clamp(1.18rem, 2.8cqw, 1.65rem); }
  .scene-heading { margin-block: 8px 12px; }
  .scene-heading h1 { font-size: clamp(1.6rem, 3.95cqw, 2.65rem); }
  .body-view { padding-block: 10px; }
}
