:root {
  color-scheme: dark;
  --space: #070B14;
  --panel: #0F172A;
  --border: rgba(148, 163, 184, 0.16);
  --text: #F8FAFC;
  --muted: #94A3B8;
  --accent: #38BDF8;
  --warning: #FB7185;
  font-family: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.55;
  color: var(--text);
  background: var(--space);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

h1, h2, h3, p { margin: 0; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: 0; }

.console {
  width: min(100% - 32px, 560px);
  margin-inline: auto;
  padding-block: max(18px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-bottom));
}

.panel {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
}

.play-panel, .result-panel, .summary-panel {
  padding: clamp(18px, 5vw, 32px);
}

.eyebrow, .telemetry-label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.08em;
}

h2 { font-size: clamp(1.55rem, 5vw, 2.15rem); line-height: 1.3; }
h3 { font-size: 0.95rem; }
.subtitle, .constraint { color: var(--muted); font-size: 0.9rem; }

.rules {
  display: grid;
  gap: 11px;
  margin: 18px 0 24px;
  padding: 0;
  list-style: none;
}

.rules li { display: grid; grid-template-columns: minmax(7em, auto) 1fr; gap: 8px; }
.rules strong { font-size: 0.86rem; }
.rules span { color: var(--muted); font-size: 0.82rem; }

.actions { display: grid; gap: 9px; }

.button {
  min-height: 46px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 750;
  text-align: center;
  touch-action: manipulation;
}

.primary { background: var(--accent); color: var(--space); }
.primary:hover { background: #7DD3FC; }
.primary:active { background: #0EA5E9; }
.button:disabled { opacity: 0.64; cursor: wait; }
.secondary { background: var(--space); color: var(--text); border-color: var(--border); }
.secondary:hover { border-color: var(--accent); }
.text-button { background: transparent; color: var(--muted); font-size: 0.85rem; }
.text-button:hover { border-color: var(--border); color: var(--text); }
.full-width { width: 100%; }

.telemetry {
  position: sticky;
  z-index: 1;
  top: max(4px, env(safe-area-inset-top));
  display: grid;
  grid-template-columns: 1.3fr 1fr 0.9fr;
  gap: 6px;
  margin-bottom: 12px;
  padding: 9px 12px;
}

.telemetry-block { display: grid; align-content: center; gap: 2px; min-width: 0; }
.telemetry-block + .telemetry-block { padding-left: 9px; border-left: 1px solid var(--border); }
.telemetry-value { font-size: 0.9rem; font-weight: 750; }
.numeric, .mission-line, .telemetry-label { font-variant-numeric: tabular-nums; }
.timer { color: var(--accent); }
.timer.is-urgent { color: var(--warning); }
.timer-value { font-size: 1.3rem; font-weight: 800; line-height: 1.16; white-space: nowrap; }
.timer-unit { font-size: 0.75rem; }

.orbit-frame {
  height: clamp(64px, 17vw, 76px);
  margin-bottom: 12px;
  border-radius: 12px;
  background: radial-gradient(ellipse at 30% 40%, #102035, transparent 76%), var(--space);
}

.orbit-chart { display: block; width: 100%; height: 100%; }
.orbit-baseline, .orbit-trail { fill: none; vector-effect: non-scaling-stroke; }
.orbit-baseline { stroke: rgba(148, 163, 184, 0.22); stroke-width: 1; }
.orbit-trail { stroke: var(--accent); stroke-width: 1.5; filter: drop-shadow(0 0 2px var(--accent)); }
.orbit-node { color: rgba(148, 163, 184, 0.35); fill: none; stroke: currentColor; stroke-width: 1; }
.orbit-node .planet-body { fill: #0B1523; }
.orbit-node text { fill: #8798AF; stroke: none; text-anchor: middle; font-size: 11.5px; }
.orbit-node.is-reached { color: var(--node-color); }
.orbit-node.is-reached text { fill: #C4DAEB; }
.orbit-node.is-reached .planet-body { fill: color-mix(in srgb, var(--node-color) 20%, #0B1523); }
.orbit-chart .earth { --node-color: #55BBF5; }
.orbit-chart .mars { --node-color: #F18F72; }
.orbit-chart .asteroids { --node-color: #BAC4D3; }
.orbit-chart .jupiter { --node-color: #E4B38B; }
.orbit-chart .saturn { --node-color: #EBD19A; }
.orbit-chart .uranus { --node-color: #90DFD9; }
.orbit-chart .neptune { --node-color: #688DF8; }
.orbit-chart .kuiper { --node-color: #FACC15; }
.probe-halo { fill: var(--accent); opacity: 0.26; animation: probe-pulse 2.4s ease-in-out infinite; }
.probe-core { fill: #DAF7FF; filter: drop-shadow(0 0 3px var(--accent)); }
.planet-wave, .probe-wave {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1;
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0.25;
  animation: radar-wave 2.8s ease-out infinite;
}
.planet-wave { stroke: var(--node-color, var(--accent)); animation-delay: -1.4s; }
.orbit-frame.is-advancing :is(.planet-wave, .probe-wave) { visibility: hidden; }

@keyframes probe-pulse {
  50% { opacity: 0.58; }
}
@keyframes radar-wave {
  0% { opacity: 0.64; transform: scale(0.68); }
  75%, 100% { opacity: 0; transform: scale(1.66); }
}

.constraint { margin-block: 9px 16px; }
.answer-row { display: flex; gap: 8px; }
.answer-row button { flex: 0 0 auto; white-space: nowrap; }

.answer-row input, .manual-copy {
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 9px;
  background: var(--space);
  color: var(--text);
  font-size: 1rem;
}

.answer-row input { flex: 1; }
.answer-row input::placeholder { color: var(--muted); }
.answer-row input[aria-invalid="true"] { border-color: var(--warning); }

.answer-error {
  min-height: 1.35rem;
  margin-top: 8px;
  color: var(--warning);
  font-size: 0.83rem;
}

.answer-row.shake { animation: shake 200ms ease-out; }

@keyframes shake {
  25%, 75% { transform: translateX(3px); }
  50% { transform: translateX(-3px); }
}

.result-panel h2, .summary-panel h2 { margin-block: 4px 9px; }
.result-panel { position: relative; }
.result-panel .orbit-frame { border: 1px solid var(--border); margin-bottom: 16px; }
.round-answer { color: var(--muted); }
.round-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.round-score { font-size: 1.35rem; }
.round-telemetry { margin-top: 8px; color: #B5C6D8; font-size: 0.88rem; }
.result-panel[data-tier="collision"] .round-telemetry { color: #FDBA74; }
.result-panel[data-tier="warp"] .round-telemetry { color: #FDE68A; }

.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.78rem;
  white-space: nowrap;
}

.tier-badge::before {
  flex: 0 0 9px;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--tier-color, var(--muted));
  content: "";
}

.examples { margin-block: 20px; padding-block: 12px; border-block: 1px solid var(--border); }
.examples ul { display: grid; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }
.examples li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; font-size: 0.95rem; }

.summary-hero {
  margin: 14px 0 18px;
  padding: 13px 15px 16px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: linear-gradient(125deg, rgba(56, 189, 248, 0.13), transparent 75%), var(--space);
}

.summary-landmark { color: var(--accent); font-size: clamp(1.3rem, 5vw, 1.8rem); font-weight: 800; }
.summary-description { margin: 2px 0 8px; color: #B5C6D8; font-size: 0.83rem; }
.summary-score { color: var(--muted); font-size: 0.9rem; }
.summary-score strong { margin-right: 4px; color: var(--text); font-size: 2.25rem; line-height: 1.15; }
.summary-hero meter {
  display: block;
  width: 100%;
  height: 7px;
  margin-top: 10px;
  border: 0;
  border-radius: 99px;
  background: #1E293B;
  appearance: none;
}
.summary-hero meter::-webkit-meter-bar { border: 0; border-radius: 99px; background: #1E293B; }
.summary-hero meter::-webkit-meter-optimum-value { border-radius: 99px; background: var(--accent); }
.summary-hero meter::-moz-meter-bar { border-radius: 99px; background: var(--accent); }

.share-preview { margin: 0 0 13px; }
.share-preview img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  background: var(--space);
}
.share-preview figcaption { margin-top: 8px; color: var(--muted); font-size: 0.75rem; text-align: center; }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.share-actions .button { flex: 1 1 124px; white-space: nowrap; font-size: 0.88rem; }
.share-actions a { display: grid; place-items: center; text-decoration: none; }
.log-title { margin-top: 17px; }
.log-list { margin: 7px 0 16px; padding: 0; list-style: none; }
.log-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; padding: 9px 0; border-top: 1px solid var(--border); }
.log-question { grid-column: 1 / -1; font-size: 0.87rem; }
.log-answer { color: var(--muted); font-size: 0.83rem; overflow-wrap: anywhere; }
.log-score { display: flex; align-items: center; gap: 7px; font-size: 0.83rem; }
.copy-status, .storage-notice { color: var(--muted); font-size: 0.83rem; }
.copy-status:empty { margin-block: -4.5px; }
.storage-notice { margin-top: 10px; }
.manual-copy { width: 100%; resize: vertical; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.desktop-only { display: none; }
.round-readout, .round-controls,
.summary-heading, .summary-share, .summary-detail { display: contents; }

@media (min-height: 720px) and (min-width: 600px) {
  .console { padding-top: 68px; }
}

@media (max-height: 430px) {
  .console { padding-top: max(8px, env(safe-area-inset-top)); }
  .telemetry { margin-bottom: 8px; padding-block: 6px; }
  .orbit-frame { margin-bottom: 8px; }
  .play-panel { padding-block: 12px; }
  .play-panel h2 { font-size: 1.18rem; line-height: 1.25; }
  .constraint { margin-block: 5px 8px; font-size: 0.79rem; line-height: 1.35; }
}

@media (min-width: 960px) {
  .console {
    width: min(100% - 64px, 1080px);
    padding-block: clamp(36px, 7vh, 62px) 36px;
  }

  .desktop-only { display: block; }

  #play-view {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    grid-template-areas: "orbit orbit" "answer telemetry";
    gap: 20px;
  }

  .orbit-frame,
  .result-panel .orbit-frame {
    grid-area: orbit;
    height: 96px;
    margin: 0;
    border-radius: 13px;
    background:
      repeating-linear-gradient(90deg, transparent 0 71px, rgba(117, 159, 197, 0.045) 71px 72px),
      radial-gradient(ellipse at 45% 0%, #17314B, transparent 83%),
      #0B1423;
  }

  .orbit-node text { font-size: 0.86rem; }
  .orbit-node .planet-body { stroke-width: 1.3; }

  .play-panel {
    grid-area: answer;
    min-width: 0;
    padding: clamp(28px, 3.3vw, 44px);
    background: radial-gradient(ellipse at 12% 0%, rgba(37, 67, 99, 0.52), transparent 77%), var(--panel);
  }

  .play-panel h2 { margin-block: 14px 0; font-size: clamp(1.95rem, 2.75vw, 2.6rem); line-height: 1.28; }
  .play-panel .constraint { margin: 12px 0 25px; font-size: 0.97rem; }
  .play-panel .answer-row { gap: 10px; }
  .play-panel .answer-row input { min-height: 54px; padding-inline: 14px; }
  .play-panel .answer-row button { padding-inline: 19px; }

  .keyboard-hint { color: #94A9BE; font-size: 0.79rem; }
  .keyboard-hint kbd {
    padding: 1px 5px;
    border: 1px solid #35465A;
    border-radius: 4px;
    background: #111B2B;
    color: #CCD8E9;
    font-family: inherit;
    font-size: 0.78rem;
  }

  .telemetry {
    position: static;
    grid-area: telemetry;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    grid-template-areas: "timer timer" "score destination" "stages stages";
    align-content: start;
    gap: 16px 11px;
    margin: 0;
    padding: 25px;
    background: #0D1727;
  }

  .telemetry-block + .telemetry-block { padding-left: 0; border-left: 0; }
  .telemetry-score { grid-area: score; }
  .telemetry-destination { grid-area: destination; border-left: 1px solid var(--border); padding-left: 14px; }
  #play-progress { display: none; }
  .telemetry-value { color: #DCEAFE; font-size: 1.08rem; }
  .telemetry .timer { grid-area: timer; gap: 6px; }
  .timer .telemetry-label { color: #ABC2D9; }
  .timer.is-urgent .telemetry-label { color: var(--warning); }
  .timer-value { font-size: 3.75rem; line-height: 0.98; letter-spacing: -0.04em; }
  .timer-unit { font-size: 0.98rem; letter-spacing: 0; }
  .timer-track { height: 4px; margin-top: 7px; overflow: hidden; border-radius: 3px; background: #25354D; }
  .timer-track span {
    display: block;
    height: 100%;
    background: currentColor;
    transform: scaleX(var(--timer-fraction, 0));
    transform-origin: left;
    transition: transform 110ms linear;
  }

  .telemetry-stages { grid-area: stages; padding-top: 13px; border-top: 1px solid var(--border); }
  .telemetry-stages ol {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
  }

  .telemetry-stages li {
    display: grid;
    justify-items: center;
    gap: 4px;
    min-width: 0;
    padding: 4px 0 5px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #0A1322;
    color: #9BAEC3;
    font-size: 0.73rem;
  }

  .telemetry-stages li::after {
    width: 53%;
    height: 3px;
    border-radius: 3px;
    background: var(--stage-color, #334155);
    content: "";
  }

  .telemetry-stages li[aria-current="step"] {
    border-color: var(--accent);
    color: #D9EFFF;
  }

  .telemetry-stages li[aria-current="step"]::after { background: var(--accent); }

  .result-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    grid-template-areas: "orbit orbit" "readout examples" "controls examples";
    column-gap: 20px;
    padding: 0;
    border: 0;
    background: none;
  }

  .result-panel .orbit-frame { margin-bottom: 20px; }
  .round-readout, .round-controls {
    display: block;
    padding-inline: clamp(26px, 3vw, 40px);
    border: 1px solid var(--border);
    background: var(--panel);
  }
  .round-readout {
    grid-area: readout;
    padding-top: clamp(25px, 2.8vw, 36px);
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
  }
  .round-readout h2 { font-size: clamp(1.95rem, 2.7vw, 2.45rem); }
  .round-readout .round-score { font-size: 1.85rem; }
  .round-controls {
    grid-area: controls;
    padding-block: 18px 25px;
    border-top: 0;
    border-radius: 0 0 18px 18px;
  }
  .round-controls .button { width: auto; min-width: 176px; min-height: 49px; }
  .round-controls .keyboard-hint { display: inline-block; margin-left: 12px; }

  .result-panel .examples {
    grid-area: examples;
    margin: 0;
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #0D1727;
  }
  .result-panel .examples h3 { color: #C4D5E8; }
  .result-panel .examples ul { gap: 9px; margin-top: 13px; }
  .result-panel .examples li {
    min-height: 54px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--space);
  }

  .summary-panel {
    display: grid;
    grid-template-columns: clamp(360px, 26vw, 390px) minmax(0, 1fr);
    grid-template-areas: "share heading" "share log";
    grid-template-rows: auto 1fr;
    align-items: start;
    gap: 16px 24px;
    padding: 0;
    border: 0;
    background: none;
  }

  .summary-share {
    position: sticky;
    top: 24px;
    display: block;
    grid-area: share;
    align-self: start;
    min-width: 0;
  }
  .summary-share .share-preview { margin-bottom: 12px; }
  .summary-share figcaption { display: none; }
  .summary-share .share-actions .button { min-height: 48px; }

  .summary-heading, .summary-detail {
    display: block;
    min-width: 0;
    padding: 21px clamp(20px, 2.1vw, 30px);
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel);
  }

  .summary-heading { grid-area: heading; background: radial-gradient(ellipse at 12% 0%, #18304A, transparent 79%), var(--panel); }
  .summary-heading h2 { margin: 4px 0 12px; font-size: clamp(1.85rem, 2.65vw, 2.5rem); }
  .summary-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    column-gap: 12px;
    margin: 0;
    padding: 12px 14px;
  }
  .summary-hero > :not(.summary-score, meter) { grid-column: 1; }
  .summary-score { grid-area: 1 / 2 / span 3; align-self: center; white-space: nowrap; }
  .summary-score strong { font-size: clamp(2.35rem, 4vw, 3.45rem); }
  .summary-hero meter { grid-column: 1 / -1; margin-top: 2px; }
  .summary-landmark { font-size: clamp(1.15rem, 2.1vw, 1.65rem); }
  .summary-description { margin-bottom: 5px; }
  .summary-detail { grid-area: log; }
  .summary-detail .log-title { margin: 0 0 9px; }
  .summary-detail .log-list { margin-bottom: 12px; }
  .summary-detail .log-list li {
    grid-template-columns: minmax(0, 1.35fr) minmax(4em, 0.73fr) auto;
    align-items: center;
    min-height: 42px;
    padding: 7px 0;
  }
  .summary-detail .log-question { grid-column: auto; }
  .summary-detail .log-score { justify-content: end; white-space: nowrap; }
  .summary-detail .actions { justify-items: end; }
  .summary-detail .text-button { border-color: var(--border); }
}

@media (prefers-reduced-motion: reduce) {
  .answer-row.shake, .probe-halo { animation: none; }
  .timer-track span { transition: none; }
}

/* Full-viewport scene. Controls remain above the non-interactive art. */
body {
  position: relative;
  isolation: isolate;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: #03060C;
}

body::after {
  position: fixed;
  z-index: 999;
  inset: 0;
  background: repeating-linear-gradient(to bottom, #849DB5 0 1px, transparent 1px 4px);
  opacity: 0.055;
  pointer-events: none;
  content: "";
}

.scene-stack, .scene-stack > *, .launch-world {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scene-stack {
  position: fixed;
  z-index: -2;
  overflow: hidden;
  background: linear-gradient(#03060C 5%, #091220 63%, #030813);
}

.starfield { width: 100%; height: 100%; }
.starfield-drift, .starfield-urgent {
  width: calc(100% + 233px);
  height: calc(100% + 175px);
  /* One complete SVG tile, so the last and first frames are equivalent. */
  animation: star-drift 54s linear infinite;
}
.starfield-drift { opacity: 0.56; }
body[data-view="play"] .starfield-drift { animation-duration: 36s; }
.starfield-glints { overflow: hidden; }
.star-glints {
  opacity: 0.66;
  transform-origin: center;
  animation: star-twinkle 5.8s ease-in-out infinite;
}
.star-glints:nth-child(2) { animation-duration: 7.4s; animation-delay: -1.8s; }
.star-glints:nth-child(3) { animation-duration: 6.2s; animation-delay: -4.4s; }
.starfield-urgent, .starfield-warp { opacity: 0; animation: none; }
body[data-urgent="true"] .starfield-urgent { opacity: 0.32; animation: star-drift 22s linear infinite; }
body[data-view="round"][data-round-effect="warp"] .starfield-warp { animation: warp-stars 600ms ease-out both; }

.urgent-vignette {
  position: fixed;
  z-index: 2;
  inset: 0;
  background: linear-gradient(90deg, #FB7185 0, transparent min(8vw, 88px), transparent calc(100% - min(8vw, 88px)), #FB7185),
    linear-gradient(0deg, #FB7185 0, transparent 58px, transparent calc(100% - 58px), #FB7185);
  opacity: 0;
  pointer-events: none;
}
body[data-urgent="true"] .urgent-vignette { opacity: 0.29; animation: urgent-pulse 1.6s ease-in-out infinite; }

@keyframes star-drift { to { transform: translate(-233px, -175px); } }
@keyframes star-twinkle {
  0%, 100% { opacity: 0.23; transform: scale(1); }
  48% { opacity: 1; transform: scale(1.006); }
}
@keyframes urgent-pulse { 50% { opacity: 0.49; } }
@keyframes warp-stars {
  0% { opacity: 0.16; transform: translate(-2.5%, 2%); }
  28% { opacity: 0.84; }
  100% { opacity: 0; transform: translate(5%, -3%); }
}

.zone-layer {
  opacity: 0;
  background:
    radial-gradient(ellipse at 79% 54%, var(--zone-light), transparent 65%),
    radial-gradient(ellipse at 20% 95%, var(--zone-base), transparent 72%),
    linear-gradient(#02040A, var(--zone-base));
  transition: opacity 800ms ease;
}

.zone-layer::before {
  position: absolute;
  top: 36%;
  right: -11vmin;
  width: min(74vmin, 620px);
  aspect-ratio: 1;
  border: 1px solid var(--zone-rim);
  border-radius: 50%;
  background: radial-gradient(at 19% 22%, var(--zone-light), #030711 70%);
  opacity: 0.36;
  content: "";
}

.zone-earth { --zone-light: #134872; --zone-base: #061426; --zone-rim: #24587C; }
.zone-mars { --zone-light: #6A3438; --zone-base: #261520; --zone-rim: #935457; }
.zone-asteroids { --zone-light: #454F66; --zone-base: #131924; --zone-rim: #5A6582; }
.zone-jupiter { --zone-light: #62432D; --zone-base: #211A1B; --zone-rim: #866847; }
.zone-saturn { --zone-light: #514936; --zone-base: #1C1922; --zone-rim: #9D8557; }
.zone-uranus { --zone-light: #235456; --zone-base: #092128; --zone-rim: #428288; }
.zone-neptune { --zone-light: #203F83; --zone-base: #080E27; --zone-rim: #355BA5; }
.zone-kuiper { --zone-light: #55401B; --zone-base: #090B14; --zone-rim: #AA8749; }

.zone-saturn::after, .zone-asteroids::after, .zone-kuiper::after {
  position: absolute;
  top: 56%;
  right: -22vmin;
  width: min(113vmin, 880px);
  height: 15vmin;
  border: 1px solid var(--zone-rim);
  border-radius: 50%;
  transform: rotate(-20deg);
  opacity: 0.33;
  content: "";
}

.zone-asteroids::before, .zone-kuiper::before { background: transparent; border-style: dashed; }

body:not([data-view="start"])[data-zone="earth"] .zone-earth,
body:not([data-view="start"])[data-zone="mars"] .zone-mars,
body:not([data-view="start"])[data-zone="asteroids"] .zone-asteroids,
body:not([data-view="start"])[data-zone="jupiter"] .zone-jupiter,
body:not([data-view="start"])[data-zone="saturn"] .zone-saturn,
body:not([data-view="start"])[data-zone="uranus"] .zone-uranus,
body:not([data-view="start"])[data-zone="neptune"] .zone-neptune,
body:not([data-view="start"])[data-zone="kuiper"] .zone-kuiper { opacity: 1; }

/* Launch uses its own sky, horizon and foreground silhouette. */
body[data-view="start"] .scene-stack {
  background: radial-gradient(ellipse at 50% 64%, #102238, transparent 62%),
    linear-gradient(#03060C 3%, #060D1C 36%, #0A1628 62%, #030711);
}

body[data-view="start"] .console { width: 100%; padding: 0; }
body[data-view="start"] #storage-notice {
  margin: 0;
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  background: #070C17;
}

#start-view {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 100vh;
  min-height: 100dvh;
}

.launch-world { z-index: -1; overflow: hidden; }
.launch-horizon { position: absolute; inset: auto 0 0; width: 100%; height: 48%; }
.horizon-glow { opacity: 0.62; animation: horizon-breathe 6s ease-in-out infinite; }

.launch-sky { position: absolute; inset: 0 0 53%; overflow: hidden; }
.meteor {
  position: absolute;
  top: 9%;
  left: 17%;
  width: clamp(32px, 5vw, 74px);
  height: 2px;
  background: linear-gradient(90deg, transparent, #487499 56%, #B8DFF6 96%);
  opacity: 0;
  animation: meteor-first 6.5s linear -0.18s infinite;
}
.meteor-second { top: 18%; left: 62%; animation: meteor-second 11s linear -4.3s infinite; }
.satellite-track {
  position: absolute;
  top: 13%;
  left: -7%;
  animation: satellite-cross 22s linear -8s infinite;
}
.satellite {
  display: block;
  width: 3px;
  height: 2px;
  color: #D4F0E6;
  background: currentColor;
  box-shadow: -2px 0 #476D82, 2px 0 #476D82, 0 0 6px #76AAB9;
  opacity: 0.8;
  animation: satellite-arc 22s linear -8s infinite;
}

@keyframes horizon-breathe { 0%, 100% { opacity: 0.45; } 50% { opacity: 0.88; } }
@keyframes meteor-first {
  0% { opacity: 0; transform: translate(-5vw, -2vh) rotate(24deg); }
  3% { opacity: 0.89; }
  14%, 100% { opacity: 0; transform: translate(14vw, 9vh) rotate(24deg); }
}
@keyframes meteor-second {
  0% { opacity: 0; transform: translate(-4vw, -2vh) rotate(20deg); }
  2% { opacity: 0.71; }
  8.2%, 100% { opacity: 0; transform: translate(16vw, 8vh) rotate(20deg); }
}
@keyframes satellite-cross { to { transform: translateX(114vw); } }
@keyframes satellite-arc {
  0%, 100% { transform: translateY(16px); }
  25%, 75% { transform: translateY(4px); }
  50% { transform: translateY(0); }
}

.distant-orbit {
  position: absolute;
  top: 9%;
  right: 14%;
  width: clamp(156px, 24vw, 326px);
  opacity: 0.5;
  animation: distant-float 9s ease-in-out infinite;
}
.distant-ring-glint { opacity: 0; animation: ring-glint 10s linear -1.4s infinite; }

.distant-binary { position: absolute; top: 17%; left: 17%; }
.distant-binary i {
  position: relative;
  display: inline-block;
  width: 3px;
  height: 3px;
  color: #F0A298;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  opacity: 0.65;
  animation: binary-breathe 4.6s ease-in-out infinite;
}
.distant-binary i + i { margin-left: 8px; color: #F5D17C; animation-delay: -2.3s; }
.distant-binary i::after {
  position: absolute;
  inset: -3px;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0;
  animation: binary-wave 4.6s ease-out infinite;
  content: "";
}
.distant-binary i + i::after { animation-delay: -2.3s; }

@keyframes distant-float {
  25% { transform: translateY(-5px); }
  75% { transform: translateY(5px); }
}
@keyframes ring-glint {
  0% { opacity: 0; stroke-dashoffset: 15; }
  16% { opacity: 0.68; }
  46%, 100% { opacity: 0; stroke-dashoffset: -100; }
}
@keyframes binary-breathe { 50% { opacity: 0.23; transform: scale(0.8); } 0%, 100% { opacity: 1; } }
@keyframes binary-wave {
  0% { opacity: 0.7; transform: scale(0.6); }
  63%, 100% { opacity: 0; transform: scale(2.55); }
}

.launch-vessel {
  position: absolute;
  left: clamp(44px, 13.5vw, 230px);
  bottom: 15%;
  width: clamp(248px, 30vw, 430px);
  filter: drop-shadow(0 4px 0 rgba(1, 4, 10, 0.42));
}

.launch-flag {
  transform-box: fill-box;
  transform-origin: left;
  animation: flag-drift 4.4s ease-in-out infinite alternate;
}
.launch-beacon { opacity: 0.78; filter: drop-shadow(0 0 1.2px #FF516C); animation: launch-beacon 1.8s steps(1, end) infinite; }
.engine-idle { opacity: 0.66; animation: engine-breathe 2.8s ease-in-out infinite; }
.engine-core { filter: drop-shadow(0 0 1.4px #38BDF8); }
.exhaust-pixel { opacity: 0; animation: cold-exhaust 2.8s linear infinite; }
.exhaust-pixel:nth-child(1) { --exhaust-x: -24px; --exhaust-y: -7px; animation-delay: -0.8s; }
.exhaust-pixel:nth-child(2) { --exhaust-x: -17px; --exhaust-y: -12px; animation-delay: -2.3s; }
.exhaust-pixel:nth-child(3) { --exhaust-x: -14px; --exhaust-y: -5px; animation-delay: -1.55s; }
.exhaust-pixel:nth-child(4) { --exhaust-x: 22px; --exhaust-y: -10px; animation-delay: -1.3s; }
.exhaust-pixel:nth-child(5) { --exhaust-x: 13px; --exhaust-y: -14px; animation-delay: -0.3s; }
.exhaust-pixel:nth-child(6) { --exhaust-x: 16px; --exhaust-y: -5px; animation-delay: -2.55s; }
.ignition-flame { opacity: 0; }
.launch-vessel.is-launching .engine-idle { opacity: 0; animation: none; }
.launch-vessel.is-launching .launch-rocket { animation: rocket-liftoff var(--ignition-time) cubic-bezier(0.55, 0.04, 0.9, 0.45) both; }
.launch-vessel.is-launching .ignition-flame {
  transform-origin: 92px 61px;
  animation: ignition-flame var(--ignition-time) steps(4, end) both;
}
@keyframes flag-drift { to { transform: scaleX(0.74) skewY(9deg); } }
@keyframes launch-beacon { 0% { opacity: 1; } 19.45%, 100% { opacity: 0; } }
@keyframes engine-breathe { 0%, 100% { opacity: 0.34; } 50% { opacity: 1; } }
@keyframes cold-exhaust {
  0% { opacity: 0; transform: translate(0, 0); }
  19% { opacity: 0.81; }
  100% { opacity: 0; transform: translate(var(--exhaust-x), var(--exhaust-y)); }
}
@keyframes rocket-liftoff { 10% { transform: translateY(0); } 100% { transform: translateY(-40px); } }
@keyframes ignition-flame {
  0% { opacity: 0.82; transform: scale(1, 0.7); }
  44% { opacity: 1; transform: scale(1.2, 1.1); }
  100% { opacity: 1; transform: scale(0.92, 1.34); }
}

.launch-hero {
  width: min(100% - 40px, 820px);
  margin-inline: auto;
  padding-top: max(112px, min(20dvh, 194px));
  padding-bottom: 55px;
  text-align: center;
}

.launch-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(15px, 2vw, 29px);
  margin: 0;
}

.pixel-word {
  display: block;
  overflow: visible;
  height: clamp(58px, 7.25vw, 103px);
  width: auto;
}
.pixel-face { fill: #E9F8FF; }
.pixel-shadow-cool, .pixel-shadow-warm {
  transform: translate(var(--title-fringe), var(--title-rise));
  animation: title-calibrate 5.6s steps(1, end) infinite;
}
.pixel-shadow-cool { fill: #38BDF8; opacity: 0.80; --title-fringe: -0.19px; --title-rise: 0.11px; }
.pixel-shadow-warm { fill: #F4AC5E; opacity: 0.68; --title-fringe: 0.19px; --title-rise: -0.11px; }
@keyframes title-calibrate {
  97.857% { transform: translate(calc(var(--title-fringe) * 2.8), var(--title-rise)); }
  98.929% { transform: translate(calc(var(--title-fringe) * 0.4), calc(var(--title-rise) * 2)); }
}

.launch-subtitle {
  margin-top: 14px;
  color: #8FE4FC;
  font-size: clamp(1rem, 1.75vw, 1.45rem);
  font-weight: 710;
  letter-spacing: 0.24em;
}

.launch-tagline { margin-top: 12px; color: #B4C6DC; font-size: clamp(0.78rem, 1.25vw, 1rem); }
.launch-actions { width: min(100%, 354px); margin: clamp(42px, 10dvh, 90px) auto 0; }
.launch-actions .launch-button { min-height: 57px; color: #B7F2FF; letter-spacing: 0.075em; }
.launch-arrow { display: inline-block; animation: launch-arrow 1.8s ease-in-out infinite; }
.launch-button .launch-arrow:last-child { animation-delay: -0.18s; }
#start-button::after {
  position: absolute;
  inset: -2px;
  border: 1px solid #81E7FA;
  box-shadow: 0 0 11px #3CBFE9, inset 0 0 7px #3A9DBE;
  opacity: 0.22;
  pointer-events: none;
  animation: launch-button-glow 1.8s ease-in-out infinite;
  content: "";
}
@keyframes launch-arrow { 50% { transform: translateY(-3px); } }
@keyframes launch-button-glow { 50% { opacity: 0.58; } }
.launch-actions .launch-replay { border: 1px solid rgba(133, 201, 230, 0.3); background: #061323; color: #B9CCE1; }
.launch-actions .storage-notice { margin: 0; }
.launch-footer {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px max(20px, 4vw, env(safe-area-inset-right))
    max(10px, env(safe-area-inset-bottom)) max(20px, 4vw, env(safe-area-inset-left));
  border-top: 1px solid rgba(56, 189, 248, 0.25);
  background: rgba(2, 7, 16, 0.86);
}
.mission-line { min-width: 0; color: #C2DCED; font-size: 0.82rem; font-weight: 630; letter-spacing: 0.05em; }
.launch-footer .button { min-height: 44px; flex: 0 0 auto; color: #C4E8F8; font-size: 0.79rem; }

.launch-scale { display: none; }
@media (min-width: 960px) {
  .launch-scale {
    position: absolute;
    top: 14%;
    right: max(30px, 3.4vw);
    bottom: 29%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    padding: 0 13px 0 0;
    border-right: 1px solid rgba(129, 190, 223, 0.39);
    list-style: none;
  }
  .launch-scale li { position: relative; display: grid; justify-items: end; line-height: 1.28; }
  .launch-scale li::after {
    position: absolute;
    right: -14px;
    top: 5px;
    width: 6px;
    height: 1px;
    background: #6794AE;
    content: "";
  }
  .launch-scale li strong { color: #A9C7DC; font-size: 0.71rem; font-weight: 650; letter-spacing: 0.04em; }
  .launch-scale li span { color: #829AB3; font-size: 0.67rem; }
  .launch-scale::before {
    position: absolute;
    inset: 6px -7px 12px auto;
    width: 13px;
    background: linear-gradient(90deg, #42AFC4, #ADF6FF 56%, #67DEF2) left bottom / 100% 1px no-repeat;
    filter: drop-shadow(0 0 2px #50D4F4);
    opacity: 0.68;
    pointer-events: none;
    animation: scale-scan 8s linear -2s infinite;
    content: "";
  }
}
@keyframes scale-scan { to { transform: translateY(-100%); } }

@media not all and (min-width: 960px) {
  .launch-hero { padding-top: max(72px, min(15dvh, 136px)); }
  .launch-title { flex-direction: column; gap: 5px; }
  .pixel-word { height: auto; width: min(74vw, 370px); }
  .word-solar { width: min(47vw, 234px); }
  .launch-subtitle { margin-top: 9px; }
  .launch-tagline { margin-top: 10px; }
  .launch-actions { width: min(100%, 324px); margin-top: clamp(35px, 9.5dvh, 76px); }
  .launch-vessel { left: max(3.5vw, 12px); bottom: 18%; width: min(65vw, 360px); }
  .launch-horizon { height: 49%; }
  .distant-orbit { top: 7%; right: -5%; width: clamp(130px, 39vw, 260px); opacity: 0.45; }
  .distant-binary { left: 12%; top: 11%; }
  .launch-footer { padding-inline: max(14px, env(safe-area-inset-left)) max(14px, env(safe-area-inset-right)); }
  .mission-line { font-size: 0.75rem; }
}

@media (max-height: 500px) {
  .launch-hero { padding-top: 22px; padding-bottom: 35px; }
  .launch-title {
    display: grid;
    grid-template-columns: minmax(0, 31fr) minmax(0, 49fr);
    gap: 11px;
    /* The 31:49 tracks match the two SVG viewBox widths. */
    width: min(100%, calc(71.1vh + 11px), 464px);
    margin-inline: auto;
  }
  .launch-title .pixel-word { height: auto; width: 100%; }
  .launch-actions { margin-top: 22px; }
  .launch-vessel { bottom: 18%; width: min(33vw, 260px); }
}

/* HUD borders and corner marks use shared color tokens across play and logs. */
:root {
  --hud-bg: rgba(4, 7, 14, 0.78);
  --hud-line: rgba(56, 189, 248, 0.28);
  --hud-cross: #78C5E2;
}

.console-label { color: #9FC2D7; font-size: 0.81rem; font-weight: 700; letter-spacing: 0.07em; }
:is(.panel, .button, .tier-badge, .orbit-frame, .summary-hero, .share-preview img, .answer-row input, .manual-copy,
  .summary-heading, .summary-detail, .round-readout, .round-controls, .examples, .rules li, .tier-legend li,
  .telemetry-stages li, .keyboard-hint kbd, .timer-track) {
  border-radius: 0;
}
.telemetry-stages li::after { border-radius: 0; }

:is(.panel, .summary-heading, .summary-detail, .round-readout, .round-controls, .result-panel .examples) {
  border-color: var(--hud-line);
  background: var(--hud-bg);
}

:where(.play-panel, .orbit-frame, .result-panel, .summary-panel, .summary-heading, .summary-detail, .daily-leaderboard,
  .result-panel .examples, .button.primary, .help-dialog)::before,
.telemetry::before, .round-readout::before, .round-controls::before {
  position: absolute;
  inset: -1px;
  background:
    linear-gradient(var(--hud-cross), var(--hud-cross)) top left / 10px 1px,
    linear-gradient(var(--hud-cross), var(--hud-cross)) top left / 1px 10px,
    linear-gradient(var(--hud-cross), var(--hud-cross)) top right / 10px 1px,
    linear-gradient(var(--hud-cross), var(--hud-cross)) top right / 1px 10px,
    linear-gradient(var(--hud-cross), var(--hud-cross)) bottom left / 10px 1px,
    linear-gradient(var(--hud-cross), var(--hud-cross)) bottom left / 1px 10px,
    linear-gradient(var(--hud-cross), var(--hud-cross)) bottom right / 10px 1px,
    linear-gradient(var(--hud-cross), var(--hud-cross)) bottom right / 1px 10px;
  background-repeat: no-repeat;
  pointer-events: none;
  content: "";
}

:where(.play-panel, .orbit-frame, .summary-panel, .summary-heading, .summary-detail, .result-panel .examples, .button.primary) {
  position: relative;
}

#play-orbit, .result-panel .orbit-frame {
  background:
    repeating-linear-gradient(90deg, transparent 0 71px, rgba(107, 157, 182, 0.075) 71px 72px),
    var(--hud-bg);
  border-color: var(--hud-line);
}

.button.primary {
  position: relative;
  border: 2px solid var(--accent);
  background: rgba(3, 16, 27, 0.82);
  color: #BEEFFF;
  --hud-cross: #B9F5FF;
}
.button.primary:hover, .button.primary:focus-visible, .button.primary:active {
  background: #122D41;
  box-shadow: 0 0 17px rgba(26, 188, 243, 0.22);
}
.secondary { border-color: var(--hud-line); background: #080F1E; color: #B9D6ED; }
.secondary:hover, .text-button:hover { border-color: var(--accent); }
.answer-row { position: relative; }
.answer-row::before {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  color: #7EDFFA;
  font: 550 0.93rem ui-monospace, monospace;
  pointer-events: none;
  content: ">";
}
.answer-row input, .play-panel .answer-row input {
  padding-left: 29px;
  border-color: rgba(93, 166, 196, 0.46);
  background: #050C17;
}
.answer-row input:focus-visible { border-color: var(--accent); outline-offset: 1px; }
#answer[aria-invalid="true"] { border-color: var(--warning); }

.result-panel[data-tier="collision"] { --hud-cross: #F97316; --hud-line: rgba(249, 115, 22, 0.6); }
.result-panel[data-tier="warp"] { --hud-cross: #FACC15; --hud-line: rgba(250, 204, 21, 0.58); }
.result-panel .round-score { animation: score-pop 260ms ease-out both; }
body[data-round-effect="warp"] .result-panel { --result-effect: warp-sweep; --result-duration: 600ms; }
body[data-round-effect="collision"] .result-panel { --result-effect: collision-jolt; --result-duration: 320ms; }
body[data-round-effect] :is(.result-panel, .round-readout)::after {
  position: absolute;
  inset: 0;
  border: 1px solid var(--hud-cross);
  box-shadow: 0 0 15px var(--hud-line), inset 0 0 9px var(--hud-line);
  opacity: 0;
  pointer-events: none;
  animation: var(--result-effect) var(--result-duration) ease-out both;
  content: "";
}
body[data-round-effect="warp"] :is(.result-panel, .round-readout)::after {
  background: linear-gradient(90deg, transparent, #FACC15 28%, #FFDF64 63%, transparent) top / 100% 2px no-repeat;
}
@keyframes warp-sweep {
  0% { transform: translateX(-4%) scaleX(0.78); opacity: 0; }
  26% { opacity: 0.86; }
  100% { transform: translateX(3%) scaleX(0.92); opacity: 0; }
}
@keyframes collision-jolt {
  12% { transform: translateX(-3px); opacity: 0.85; }
  32% { transform: translateX(3px); opacity: 0.64; }
  56% { transform: translateX(-2px); opacity: 0.45; }
  100% { transform: translateX(0); opacity: 0; }
}
@keyframes score-pop {
  0% { transform: translateY(7px) scale(0.93); opacity: 0.35; }
  68% { transform: translateY(-2px) scale(1.04); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.summary-hero {
  border-color: var(--hud-line);
  background: linear-gradient(100deg, rgba(17, 49, 64, 0.55), transparent 84%), #060E1A;
}
.summary-hero meter, .summary-hero meter::-webkit-meter-bar { border-radius: 0; }
.summary-hero meter::-webkit-meter-optimum-value { border-radius: 0; }
.summary-hero meter::-moz-meter-bar { border-radius: 0; }
.share-preview img { border-color: var(--hud-line); }
.log-list li { border-top-color: rgba(88, 169, 203, 0.27); }

@media (min-width: 960px) {
  #summary-view .summary-panel, #round-view .result-panel { background: none; }
  .summary-panel::before, .result-panel::before { display: none; }
  .telemetry { position: relative; top: auto; }
  .round-readout, .round-controls { position: relative; }
  .round-readout::before { clip-path: inset(0 0 50% 0); }
  .round-controls::before { clip-path: inset(50% 0 0 0); }
  body[data-round-effect] .result-panel::after { content: none; }
}

@media not all and (min-width: 960px) {
  .round-readout::before, .round-controls::before { display: none; }
  body[data-round-effect] .round-readout::after { content: none; }
}

/* The native dialog provides modal focus, keyboard dismissal and scroll. */
.help-dialog.panel {
  position: fixed;
  width: min(calc(100% - 28px), 495px);
  max-height: calc(100vh - 28px);
  max-height: min(calc(100dvh - 28px), 600px);
  padding: clamp(16px, 4vw, 29px);
  overflow: auto;
  color: var(--text);
  background: #071320;
  animation: help-appear 160ms ease-out both;
}
.help-dialog:not([open]) { display: none; }
.help-dialog::backdrop { background: rgba(2, 5, 12, 0.78); }
.help-fallback { overflow: hidden; }
.help-fallback .console { pointer-events: none; }
.help-fallback .help-dialog[open] {
  z-index: 1000;
  inset: 50% auto auto 50%;
  margin: 0;
  box-shadow: 0 0 0 100vmax rgba(2, 5, 12, 0.78);
  transform: translate(-50%, -50%);
  animation: none;
}
.help-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.help-heading h2 { color: #CCF1FF; font-size: clamp(1.15rem, 4vw, 1.6rem); }
.help-heading .button { min-width: 62px; min-height: 44px; padding-inline: 10px; }
.help-dialog .rules { gap: 7px; margin: 12px 0 18px; }
.help-dialog .rules li {
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border: 1px solid rgba(51, 119, 154, 0.44);
  background: #081825;
}
.tier-legend ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.tier-legend li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 5px 7px;
  border: 1px solid rgba(51, 119, 154, 0.44);
  background: #081825;
}
.legend-label { display: inline-flex; gap: 5px; align-items: center; min-width: 0; font-size: 0.76rem; }
.legend-label::before { width: 7px; height: 7px; flex: 0 0 7px; background: var(--tier-color); content: ""; }
.legend-score, .legend-note { color: #ABC6D8; font-size: 0.76rem; }
.legend-note { margin-top: 8px; }
@keyframes help-appear { from { opacity: 0; transform: translateY(6px); } }

@media (prefers-reduced-motion: reduce) {
  .star-glints, .starfield-drift, .meteor, .satellite-track, .satellite, .distant-orbit, .distant-ring-glint,
  .distant-binary i, .distant-binary i::after, .horizon-glow, .launch-flag, .launch-beacon, .engine-idle,
  .exhaust-pixel, .pixel-shadow-cool, .pixel-shadow-warm, .launch-arrow, #start-button::after, .launch-scale::before,
  .planet-wave, .probe-wave, .result-panel .round-score, .help-dialog,
  .launch-vessel.is-launching :is(.launch-rocket, .ignition-flame), body[data-urgent="true"] .urgent-vignette,
  body[data-urgent="true"] .starfield-urgent, body[data-view="round"][data-round-effect="warp"] .starfield-warp,
  body[data-round-effect] :is(.result-panel, .round-readout)::after { animation: none; }
  body[data-urgent="true"] .starfield-urgent { opacity: 0; }
  .satellite-track { transform: translateX(39vw); }
  .launch-scale::before { transform: translateY(-45%); }
  .zone-layer { transition: none; }
}


/* Online telemetry appears only after a verified finish. */
.captain-entry { white-space: nowrap; }
.launch-footer .captain-entry { color: #A9DEF0; }
.ranking-telemetry {
  margin-top: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(56, 189, 248, 0.46);
  background: rgba(15, 62, 83, 0.42);
  color: #BCEEFF;
  font-size: 0.88rem;
  font-weight: 750;
}
.ranking-telemetry strong { color: #E2FAFF; }
.practice-note { margin: 7px 0 0; color: #ABBDD0; font-size: 0.77rem; }

.daily-leaderboard {
  position: relative;
  min-width: 0;
  margin: 18px 0;
  padding: 14px;
}
.leaderboard-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--hud-line);
}
.leaderboard-heading h3 { font-size: 1.08rem; }
.leaderboard-limit { color: #9CC3D4; font: 600 0.7rem ui-monospace, monospace; letter-spacing: 0.08em; }
.leaderboard-rows { margin-top: 7px; }
.leaderboard-row { border-bottom: 1px solid rgba(86, 156, 189, 0.19); }
.leaderboard-row.is-mine { background: rgba(25, 107, 137, 0.18); box-shadow: inset 2px 0 #65DBF5; }
.leaderboard-row summary {
  display: grid;
  grid-template-columns: 33px minmax(0, 1fr) 38px 43px auto 11px;
  align-items: center;
  min-height: 44px;
  gap: 5px;
  padding: 5px 6px;
  list-style: none;
  font-size: 0.75rem;
  cursor: pointer;
  touch-action: manipulation;
}
.leaderboard-row summary::-webkit-details-marker { display: none; }
.leaderboard-row summary:hover { background: rgba(27, 90, 119, 0.23); }
.leaderboard-row summary:focus-visible { outline-offset: -2px; }
.leaderboard-row[open] summary { color: #D2F5FE; }
.leaderboard-row[open] .leaderboard-chevron { transform: rotate(90deg); }
.leaderboard-rank { color: #94DBEF; font-family: ui-monospace, monospace; }
.leaderboard-name { overflow-wrap: anywhere; }
.leaderboard-score { color: #ECF8FD; text-align: right; white-space: nowrap; }
.leaderboard-time { color: #ABC0D6; text-align: right; white-space: nowrap; }
.leaderboard-chevron { color: #9AC7DA; text-align: center; font-size: 1rem; line-height: 1; }
.leaderboard-tiers { display: flex; justify-content: flex-end; gap: 2px; padding-left: 2px; }
.leaderboard-tiers span { width: 5px; height: 5px; background: var(--tier-color); }
.leaderboard-answer-list {
  margin: 0 0 5px;
  padding: 3px 8px 6px;
  background: rgba(4, 12, 23, 0.78);
  list-style: none;
}
.leaderboard-answer-list li {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 6px;
  min-height: 26px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(88, 169, 203, 0.13);
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}
.leaderboard-answer-list li:last-child { border-bottom: 0; }
.leaderboard-answer-list li > span:first-child { color: #9DB3C8; }
.leaderboard-answer-list .tier-badge { min-width: 0; font-size: 0.58rem; padding: 1px 4px; }
.leaderboard-private, #leaderboard-empty { padding: 9px 8px; color: #B0C0D0; font-size: 0.79rem; }
.leaderboard-row[open] :is(.leaderboard-answer-list, .leaderboard-private) { animation: answers-reveal 160ms ease-out both; }
@keyframes answers-reveal { from { opacity: 0; transform: translateY(-3px); } }
.claim-captain {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  margin-top: 9px;
  padding-inline: 10px;
  text-align: left;
  font-size: 0.8rem;
}
.claim-captain span { color: #8DDDF2; font-size: 1.18rem; }

.captain-dialog { --hud-cross: #8DEBFD; }
.captain-dialog::before { inset: 0; }
.captain-intro { margin-top: 5px; color: #A9C3D6; font-size: 0.82rem; }
.captain-current-name { color: #9AE9FD; font-size: 1.36rem; font-weight: 750; overflow-wrap: anywhere; }
.captain-form { display: grid; gap: 8px; margin-top: 18px; }
.captain-form label:not(.captain-privacy) {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: #D5E8F4;
  font-size: 0.83rem;
  font-weight: 650;
}
.captain-form label span { color: #91ACBE; font-size: 0.72rem; font-weight: 500; }
.captain-form input:not([type="checkbox"]) {
  width: 100%;
  min-height: 44px;
  margin-bottom: 6px;
  padding: 9px 12px;
  border: 1px solid rgba(93, 166, 196, 0.53);
  border-radius: 0;
  color: var(--text);
  background: #050C17;
  font: inherit;
}
.captain-privacy {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  color: #B7CEDD;
  font-size: 0.8rem;
  cursor: pointer;
}
.captain-privacy input { width: 16px; height: 16px; margin: 0; accent-color: #54DAF3; }
#captain-status { margin-top: 8px; color: #F8BEC4; }
#captain-close { min-height: 44px; flex: 0 0 auto; }

@media (min-width: 960px) {
  .summary-panel:has(.daily-leaderboard:not([hidden])) {
    grid-template-areas: "share heading" "share leaderboard" "share log";
    grid-template-rows: auto auto 1fr;
  }
  .daily-leaderboard { grid-area: leaderboard; margin: 0; padding: 16px clamp(16px, 2.1vw, 30px); }
  .leaderboard-row summary {
    grid-template-columns: 48px minmax(0, 1fr) 54px 63px 71px 14px;
    gap: 11px;
    font-size: 0.86rem;
    padding-inline: 9px;
  }
  .leaderboard-tiers { gap: 3px; }
  .leaderboard-tiers span { width: 7px; height: 7px; }
  .leaderboard-answer-list { padding-inline: 10px; }
  .leaderboard-answer-list li { min-height: 27px; font-size: 0.76rem; }
  .leaderboard-answer-list .tier-badge { font-size: 0.65rem; }
}

@media (max-width: 550px) {
  .launch-footer:has(.captain-entry:not([hidden])) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 8px;
  }
  .launch-footer:has(.captain-entry:not([hidden])) .mission-line { grid-column: 1 / -1; }
  .launch-footer .captain-entry { min-width: 0; text-overflow: ellipsis; overflow: hidden; }
}
@media (max-width: 350px) {
  .leaderboard-row summary { grid-template-columns: 27px minmax(0, 1fr) 31px 36px auto 8px; gap: 4px; }
  .leaderboard-tiers span { width: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .leaderboard-row[open] :is(.leaderboard-answer-list, .leaderboard-private) { animation: none; }
}
