/* 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;
}

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;
}

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

/* ---------- Overview ---------- */
.overview-canvas {
  position: absolute;
  inset: 0;
  cursor: grab;
  perspective: 1800px;
  touch-action: none;
}
.overview-canvas:active {
  cursor: grabbing;
}

.overview-stage {
  position: absolute;
  left: 50%;
  top: calc(50% + 60px);
  transform-style: preserve-3d;
  transition: transform 0.05s linear;
}

.orbits {
  position: absolute;
  left: -700px;
  top: -700px;
  pointer-events: none;
}

.sun-anchor {
  position: absolute;
  left: 0;
  top: 0;
}

.orbit-ring {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
  pointer-events: none;
  animation: orbit linear infinite;
}

.orbit-anchor {
  position: absolute;
  left: 50%;
  top: 0;
  /* counter-rotate so the planet stays upright */
  animation: counter-spin linear infinite;
  animation-duration: inherit;
}
.orbit-ring {
  animation-name: orbit;
}
.orbit-anchor {
  animation-name: counter-spin;
  animation-duration: inherit;
}

/* Make sure counter-spin uses the parent's duration */
.orbit-ring > .orbit-anchor {
  animation-duration: inherit;
}

.planet-marker {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  pointer-events: auto;
  transition:
    filter 0.25s,
    transform 0.25s;
}
.planet-canvas {
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.planet-dance-canvas {
  transform-origin: center;
  animation: planet-dance-bob 0.78s ease-in-out infinite;
}
.planet-canvas-detail {
  width: 100%;
  height: 100%;
}
.planet-marker:hover {
  filter: brightness(1.15) drop-shadow(0 0 12px rgba(255, 255, 255, 0.4));
  transform: translate(-50%, -50%) scale(1.12);
}
.planet-marker.focused {
  filter: brightness(1.2) drop-shadow(0 0 16px rgba(255, 214, 107, 0.6));
}
.planet-marker.planet-pressed::after {
  content: "♥";
  position: absolute;
  left: 50%;
  top: -12px;
  z-index: 3;
  color: #ffb1d4;
  font-size: 18px;
  font-weight: 900;
  text-shadow: 0 0 12px rgba(255, 177, 212, 0.78);
  pointer-events: none;
  animation: planet-heart-float 0.72s ease-out forwards;
}

.planet-label {
  position: absolute;
  left: 50%;
  top: -22px;
  transform: translateX(-50%);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: rgba(20, 18, 40, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 3px 8px;
  border-radius: 100px;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.32);
  transition:
    opacity 0.22s cubic-bezier(0.22, 0.61, 0.36, 1),
    background 0.22s cubic-bezier(0.22, 0.61, 0.36, 1),
    color 0.22s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.labels-off .planet-label {
  opacity: 0;
}
.planet-marker:hover .planet-label {
  background: rgba(40, 36, 80, 0.95);
  color: var(--accent);
  opacity: 1 !important;
}

.solar-rocket-orbit {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 7;
  width: 520px;
  height: 520px;
  margin-left: -260px;
  margin-top: -260px;
  border-radius: 50%;
  pointer-events: none;
  animation: orbit 16s linear infinite;
}
.controlled-solar-rocket {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 8;
  width: 86px;
  height: 132px;
  pointer-events: none;
  transition: transform 0.14s cubic-bezier(0.2, 0.7, 0.15, 1);
  filter: drop-shadow(0 0 18px rgba(126, 231, 255, 0.42));
}
.solar-rocket-sprite {
  position: absolute;
  left: 50%;
  top: 0;
  width: 86px;
  height: 132px;
  transform: translate(-50%, -50%) rotate(42deg);
  filter: drop-shadow(0 0 14px rgba(255, 214, 107, 0.55));
  animation: solar-rocket-bob 1.1s ease-in-out infinite;
}
.controlled-solar-rocket .solar-rocket-sprite {
  left: 0;
  top: 0;
  transform: translate(-50%, -50%) rotate(0deg);
}
.solar-rocket-sprite img {
  position: absolute;
  left: 50%;
  height: auto;
  object-fit: contain;
  transform: translateX(-50%);
  pointer-events: none;
}
.solar-rocket-booster {
  top: 36px;
  z-index: 1;
  width: 92px;
}
.solar-rocket-nose {
  top: 0;
  z-index: 4;
  width: 52px;
}
.solar-rocket-body {
  top: 36px;
  z-index: 3;
  width: 56px;
}
.solar-rocket-fins {
  top: 94px;
  z-index: 2;
  width: 82px;
}
.solar-rocket-fire {
  top: 116px;
  z-index: 0;
  width: 50px;
  transform: translateX(-50%) scaleY(0.86);
  transform-origin: top;
  animation: solar-rocket-flame 0.14s ease-in-out infinite alternate;
}
@keyframes solar-rocket-bob {
  0%,
  100% {
    margin-top: 0;
  }
  50% {
    margin-top: -8px;
  }
}
@keyframes solar-rocket-flame {
  from {
    transform: translateX(-50%) scaleY(0.78) scaleX(0.88);
  }
  to {
    transform: translateX(-50%) scaleY(1.08) scaleX(1.08);
  }
}

/* ---------- Header ---------- */
.header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 22px 28px;
  pointer-events: none;
  z-index: 500;
}
.title-block {
  pointer-events: auto;
}
.title {
  font-family: "Fraunces", "Georgia", serif;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
}
.subtitle {
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: 0.01em;
}
.field-journal {
  display: inline-grid;
  grid-template-columns: auto auto auto auto auto auto;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  max-width: min(720px, calc(100vw - 56px));
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  background: rgba(14, 12, 32, 0.58);
  backdrop-filter: blur(10px);
}
.field-journal-label {
  color: var(--ink-dim);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.field-journal-worlds {
  display: flex;
  gap: 5px;
  min-width: 0;
}
.field-journal-dot {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.055);
  color: rgba(244, 241, 232, 0.42);
  font: inherit;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 0.16s,
    border-color 0.16s,
    background 0.16s,
    color 0.16s;
}
.field-journal-dot:hover,
.field-journal-dot:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 214, 107, 0.45);
  background: rgba(255, 214, 107, 0.16);
  color: var(--ink);
  outline: none;
}
.field-journal-dot.seen {
  border-color: color-mix(in srgb, var(--world-color) 72%, #ffffff 20%);
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--world-color) 72%, #ffffff 8%),
    rgba(255, 255, 255, 0.08)
  );
  color: #050414;
  box-shadow: 0 0 14px color-mix(in srgb, var(--world-color) 42%, transparent);
}
.field-journal-next,
.field-journal-complete,
.field-journal-reset,
.field-journal-favorite,
.field-journal-daily {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 10px;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.field-journal-next {
  border: 1px solid rgba(255, 214, 107, 0.28);
  background: rgba(255, 214, 107, 0.12);
  color: #fff4c2;
  cursor: pointer;
}
.field-journal-next:hover,
.field-journal-next:focus-visible {
  background: rgba(255, 214, 107, 0.2);
  border-color: rgba(255, 214, 107, 0.48);
  outline: none;
}
.field-journal-complete {
  border: 1px solid rgba(154, 215, 255, 0.28);
  color: #ccecff;
  background: rgba(154, 215, 255, 0.1);
}
.field-journal-reset {
  min-width: 48px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.055);
  color: rgba(244, 241, 232, 0.68);
  cursor: pointer;
}
.field-journal-reset:hover,
.field-journal-reset:focus-visible {
  border-color: rgba(255, 214, 107, 0.34);
  background: rgba(255, 214, 107, 0.12);
  color: var(--ink);
  outline: none;
}
.field-journal-favorite {
  border: 1px solid rgba(255, 214, 107, 0.3);
  background: rgba(255, 214, 107, 0.11);
  color: #fff2b5;
  cursor: pointer;
}
.field-journal-favorite:hover,
.field-journal-favorite:focus-visible {
  border-color: rgba(255, 214, 107, 0.5);
  background: rgba(255, 214, 107, 0.18);
  color: var(--ink);
  outline: none;
}
.field-journal-daily {
  border: 1px solid rgba(154, 215, 255, 0.3);
  background: rgba(154, 215, 255, 0.1);
  color: #d9f6ff;
  cursor: pointer;
}
.field-journal-daily.done {
  border-color: rgba(126, 231, 255, 0.38);
  background: rgba(126, 231, 255, 0.16);
  color: #ecfeff;
}
.field-journal-daily:hover,
.field-journal-daily:focus-visible {
  border-color: rgba(154, 215, 255, 0.5);
  background: rgba(154, 215, 255, 0.18);
  color: var(--ink);
  outline: none;
}
.actions {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 8px;
  pointer-events: auto;
  position: relative;
  z-index: 520;
}
.btn-tour,
.btn-icon,
.btn-menu {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(12px);
  border-radius: 100px;
  padding: 14px 20px;
  min-height: 48px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    background 0.2s,
    color 0.2s,
    border-color 0.2s,
    transform 0.2s,
    opacity 0.2s,
    box-shadow 0.2s,
    filter 0.2s;
  font-family: inherit;
}
.btn-icon {
  width: 48px;
  height: 48px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-tour:hover,
.btn-icon:hover,
.btn-menu:hover {
  background: rgba(40, 36, 80, 0.85);
  border-color: rgba(255, 214, 107, 0.4);
  color: var(--accent);
}
.btn-tour.on,
.btn-menu.on {
  background: rgba(255, 214, 107, 0.18);
  color: var(--accent);
  border-color: rgba(255, 214, 107, 0.4);
}
.btn-menu {
  min-width: 92px;
}
.action-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 540;
  width: min(760px, calc(100vw - 32px));
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(13, 12, 32, 0.78), rgba(6, 7, 18, 0.9)),
    rgba(13, 12, 32, 0.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  animation: kid-pop 0.18s ease-out;
  max-height: calc(100vh - 142px);
  overflow-y: auto;
  overscroll-behavior: contain;
  isolation: isolate;
}
.action-menu::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: rgba(6, 7, 18, 0.92);
}
body.rocket-control-active .action-menu {
  max-height: calc(100vh - 300px);
}
.menu-map-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 12px;
  padding: 2px 2px 0;
}
.menu-map-heading span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.menu-map-heading strong {
  color: #fff7d8;
  font-family: "Fraunces", serif;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 500;
  line-height: 1;
}
.game-map-window {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-height: 412px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(5, 8, 22, 0.18), rgba(5, 8, 22, 0.62)),
    url("data/generated-assets/menu/moon-map-menu-bg.png") center / cover no-repeat,
    #080b18;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 16px 42px rgba(0, 0, 0, 0.28);
  isolation: isolate;
}
.game-map-window::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 18% 24%, rgba(126, 231, 255, 0.18), transparent 24%),
    radial-gradient(circle at 82% 76%, rgba(255, 214, 107, 0.16), transparent 25%);
  pointer-events: none;
}
.game-map-window::after {
  content: "";
  position: absolute;
  inset: 12px;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  pointer-events: none;
}
.menu-item {
  min-height: 56px;
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  padding: 8px 10px;
}
.menu-item:hover,
.menu-item.on {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 214, 107, 0.22);
}
.game-map-tile {
  min-height: 88px;
  grid-template-columns: 42px minmax(0, 1fr);
  align-content: center;
  border-color: rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(12, 18, 42, 0.88), rgba(25, 31, 58, 0.66)),
    rgba(255, 255, 255, 0.04);
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.game-map-tile:hover,
.game-map-tile:focus-visible {
  background:
    linear-gradient(145deg, rgba(255, 214, 107, 0.22), rgba(126, 231, 255, 0.12)),
    rgba(18, 28, 58, 0.9);
  border-color: rgba(255, 235, 173, 0.56);
  transform: translateY(-2px);
}
.menu-item span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
}
.game-map-tile span {
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.34), transparent 36%),
    rgba(255, 214, 107, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.13);
  color: #fff7d8;
  font-size: 14px;
  font-weight: 1000;
}
.menu-item strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.game-map-tile strong {
  color: #fff7d8;
  font-size: 14px;
  line-height: 1.08;
}
.menu-more {
  display: grid;
  gap: 6px;
}
.menu-more summary {
  min-height: 48px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink-dim);
  font-size: 14px;
  font-weight: 900;
  padding: 8px 14px;
  cursor: pointer;
  list-style: none;
}
.menu-more summary::-webkit-details-marker {
  display: none;
}
.menu-more summary::after {
  content: "+";
  justify-self: end;
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
}
.menu-more[open] summary::after {
  content: "-";
}
.menu-more .menu-item {
  margin-top: 6px;
  background: rgba(255, 255, 255, 0.035);
}
@media (max-width: 760px) {
  .actions {
    position: static;
  }
  .action-menu {
    position: fixed;
    left: 12px;
    right: 12px;
    top: max(86px, env(safe-area-inset-top));
    width: auto;
    max-height: calc(100vh - 112px);
    background:
      linear-gradient(180deg, rgba(13, 12, 32, 0.94), rgba(6, 7, 18, 0.98)),
      rgba(13, 12, 32, 0.96);
  }
  .menu-map-heading {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 4px;
  }
  .game-map-window {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 0;
    gap: 8px;
    padding: 12px;
    background:
      linear-gradient(180deg, rgba(5, 8, 22, 0.48), rgba(5, 8, 22, 0.86)),
      url("data/generated-assets/menu/moon-map-menu-bg.png") center / cover no-repeat,
      #080b18;
  }
  .game-map-tile {
    min-height: 74px;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
  }
  .game-map-tile span {
    width: 34px;
    height: 34px;
  }
  .game-map-tile strong {
    font-size: 13px;
  }
}

/* ---------- Hint ---------- */
.hint {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  z-index: 10;
  pointer-events: none;
}
.hint-key {
  color: var(--ink-dim);
  font-weight: 500;
}
.hint-sep {
  margin: 0 10px;
  color: var(--ink-faint);
}

/* ---------- Little Explorer mode ---------- */
.kid-panel {
  position: absolute;
  left: 28px;
  bottom: 24px;
  z-index: 42;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  pointer-events: auto;
}
.kid-toggle {
  min-height: 48px;
  border: 1px solid rgba(255, 214, 107, 0.35);
  border-radius: 999px;
  padding: 0 18px;
  background: rgba(18, 16, 38, 0.76);
  color: #fff4c2;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.kid-toggle img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}
.kid-toggle.on {
  background: linear-gradient(
    135deg,
    rgba(255, 214, 107, 0.34),
    rgba(118, 216, 255, 0.24)
  );
  border-color: rgba(255, 244, 194, 0.72);
}
.kid-mission {
  width: min(338px, calc(100vw - 56px));
  display: grid;
  grid-template-columns: 1fr 48px;
  gap: 10px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(16, 14, 36, 0.82);
  color: var(--ink);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.42);
  animation: kid-pop 0.24s ease-out;
}
.kid-mission-text {
  min-width: 0;
}
.kid-mission-kicker {
  display: block;
  margin-bottom: 2px;
  color: #9ad7ff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.kid-mission strong {
  display: block;
  font-family: "Fraunces", serif;
  font-size: 30px;
  font-weight: 500;
  line-height: 1;
}
.kid-skip {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  font-size: 22px;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    transform 0.15s cubic-bezier(0.22, 0.61, 0.36, 1),
    background 0.15s cubic-bezier(0.22, 0.61, 0.36, 1),
    border-color 0.15s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.kid-skip:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.06);
}
.kid-skip:active {
  transform: scale(0.92);
}
.kid-sticker-row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 34px;
  align-items: center;
}
.kid-sticker-chip {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--sticker-color, #ffd66b) 24%, #111024);
  border: 1px solid color-mix(in srgb, var(--sticker-color, #ffd66b) 60%, white);
  font-size: 18px;
  box-shadow: 0 0 18px
    color-mix(in srgb, var(--sticker-color, #ffd66b) 28%, transparent);
}
.kid-sticker-chip img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}
.kid-sticker-empty {
  color: var(--ink-dim);
  font-size: 12px;
}
.kid-stars {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}
.kid-star-button {
  position: absolute;
  width: 64px;
  height: 64px;
  border: 1px solid rgba(255, 244, 194, 0.2);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 244, 194, 0.16), transparent 64%),
    rgba(20, 18, 44, 0.24);
  padding: 8px;
  cursor: pointer;
  pointer-events: auto;
  filter: drop-shadow(0 0 14px rgba(255, 240, 160, 0.55));
  animation: treasure-bob 3.1s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  transition: transform 0.12s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.kid-star-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.kid-star-button:hover {
  transform: scale(1.08);
}
.kid-star-button:active {
  filter: brightness(1.35) drop-shadow(0 0 24px rgba(255, 240, 160, 0.8));
  transform: scale(0.94);
}
.kid-star-button:focus-visible {
  outline: 3px solid rgba(255, 214, 107, 0.85);
  outline-offset: 4px;
}
.kid-star-button.next {
  border-color: rgba(255, 214, 107, 0.72);
  box-shadow:
    0 0 0 8px rgba(255, 214, 107, 0.1),
    0 0 28px rgba(255, 214, 107, 0.46);
}
.kid-star-button.next::after {
  content: "";
  position: absolute;
  inset: -12px;
  border: 2px solid rgba(255, 214, 107, 0.55);
  border-radius: 50%;
  animation: target-ring-pulse 1.25s ease-in-out infinite;
}
.treasure-level .kid-star-button.next::after {
  inset: -9px;
}
@keyframes target-ring-pulse {
  0%,
  100% {
    opacity: 0.42;
    transform: scale(0.86);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}
.treasure-level {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 30;
  background:
    radial-gradient(
      circle at 50% 46%,
      rgba(118, 216, 255, 0.12),
      transparent 36%
    ),
    #070714;
}
.treasure-level .kid-stars {
  z-index: 34;
}
.treasure-level .kid-star-button {
  width: 84px;
  height: 84px;
  padding: 10px;
  animation: none;
}
.treasure-level .kid-star-button:not(.next) {
  opacity: 0.72;
}
.treasure-level .kid-star-button.next {
  transform: scale(1.12);
}
.treasure-level .kid-star-button.collecting {
  animation: treasure-waiting-pulse 0.38s ease-in-out infinite alternate;
  pointer-events: none;
}
.treasure-tap-helper {
  position: absolute;
  z-index: 37;
  width: 84px;
  height: 84px;
  display: grid;
  place-items: end center;
  pointer-events: none;
}
.treasure-tap-helper span {
  margin-bottom: -36px;
  padding: 8px 12px;
  border: 2px solid rgba(255, 214, 107, 0.58);
  border-radius: 999px;
  background: rgba(13, 12, 32, 0.84);
  color: #fff7d8;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.34);
  animation: tap-helper-pop 1s ease-in-out infinite;
}
@keyframes tap-helper-pop {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-5px) scale(1.06);
  }
}
.treasure-astronaut-pickup {
  position: fixed;
  width: 126px;
  height: 90px;
  z-index: 45;
  pointer-events: none;
  background-image: url("data/sprites/astronaut-flying.png");
  background-repeat: no-repeat;
  background-size: 504px 270px;
  background-position: 0 0;
  transform-origin: center center;
  filter: drop-shadow(0 8px 18px rgba(255, 190, 82, 0.55));
  will-change: transform, left, top, opacity, background-position;
}
.treasure-pickup-beam {
  position: absolute;
  left: 6px;
  top: 52px;
  width: 48px;
  height: 20px;
  border-radius: 999px;
  background: radial-gradient(
    circle,
    rgba(255, 214, 107, 0.62),
    transparent 68%
  );
  filter: blur(5px);
  opacity: 0.75;
}
.treasure-pickup-cargo {
  position: absolute;
  left: 94px;
  top: 30px;
  width: 34px;
  height: 34px;
  object-fit: contain;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.4);
  transition:
    opacity 0.12s ease,
    transform 0.18s ease;
  filter: drop-shadow(0 3px 8px rgba(255, 214, 107, 0.7));
}
.treasure-hud {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 20px;
  z-index: 42;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  pointer-events: none;
}
.treasure-hud > * {
  pointer-events: auto;
}
.treasure-back,
.treasure-complete button {
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: rgba(13, 12, 32, 0.72);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 20px;
  min-height: 48px;
  cursor: pointer;
  touch-action: manipulation;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.treasure-back {
  justify-self: start;
  width: max-content;
  max-width: 100%;
}
.treasure-title {
  font-family: "Fraunces", serif;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 0.9;
}
.treasure-subtitle {
  margin-top: 6px;
  color: var(--ink-dim);
  font-size: 13px;
}
.treasure-count {
  min-width: 130px;
  display: grid;
  justify-items: end;
  gap: 2px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 214, 107, 0.28);
  border-radius: 14px;
  background: rgba(13, 12, 32, 0.68);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.treasure-count strong {
  color: var(--accent);
  font-family: "Fraunces", serif;
  font-size: 32px;
  line-height: 1;
}
.treasure-count span {
  color: var(--ink-dim);
  font-size: 12px;
}
.treasure-next-card {
  position: absolute;
  left: 24px;
  top: 166px;
  z-index: 42;
  display: grid;
  grid-template-columns: auto 42px auto;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border: 1px solid rgba(154, 215, 255, 0.3);
  border-radius: 999px;
  background: rgba(13, 12, 32, 0.64);
  color: var(--ink);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.24);
  pointer-events: none;
}
.treasure-next-card span {
  color: #bfefff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.treasure-next-card img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(255, 214, 107, 0.55));
}
.treasure-next-card strong {
  font-size: 13px;
  line-height: 1.05;
}
.treasure-tray {
  position: absolute;
  left: 50%;
  bottom: 24px;
  z-index: 42;
  display: flex;
  gap: 10px;
  transform: translateX(-50%);
  padding: 8px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: rgba(13, 12, 32, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  max-width: calc(100vw - 36px);
  overflow-x: auto;
  scrollbar-width: none;
}
.treasure-tray::-webkit-scrollbar {
  display: none;
}
.treasure-tray-item {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  opacity: 0.38;
  filter: grayscale(0.5);
}
.treasure-tray-item.found {
  opacity: 1;
  filter: none;
  background: rgba(255, 214, 107, 0.16);
}
.treasure-tray-item img {
  width: 86%;
  height: 86%;
  object-fit: contain;
}
.treasure-progress {
  position: absolute;
  left: 50%;
  bottom: 88px;
  z-index: 42;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
}
.treasure-progress span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.treasure-progress span.done {
  background: var(--accent);
  box-shadow: 0 0 14px rgba(255, 214, 107, 0.7);
}
.treasure-complete {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 50;
  width: min(330px, calc(100vw - 44px));
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 22px;
  border: 1px solid rgba(255, 214, 107, 0.4);
  border-radius: 18px;
  background: rgba(13, 12, 32, 0.82);
  color: var(--ink);
  transform: translate(-50%, -50%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.46),
    0 0 48px rgba(255, 214, 107, 0.16);
}
.treasure-level ~ .kid-reward-burst {
  z-index: 49;
}
.treasure-complete-sparkles {
  position: absolute;
  inset: -36px;
  pointer-events: none;
}
.treasure-complete-sparkles span {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(255, 214, 107, 0.86);
  animation: treasure-complete-pop 1.6s ease-in-out infinite;
}
.treasure-complete-sparkles span:nth-child(1) {
  left: 8%;
  top: 20%;
}
.treasure-complete-sparkles span:nth-child(2) {
  right: 12%;
  top: 10%;
  animation-delay: 0.18s;
}
.treasure-complete-sparkles span:nth-child(3) {
  left: 16%;
  bottom: 14%;
  animation-delay: 0.36s;
}
.treasure-complete-sparkles span:nth-child(4) {
  right: 9%;
  bottom: 20%;
  animation-delay: 0.54s;
}
.treasure-complete-sparkles span:nth-child(5) {
  left: 50%;
  top: -2%;
  animation-delay: 0.72s;
}
@keyframes treasure-complete-pop {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.64);
  }
  50% {
    opacity: 1;
    transform: scale(1.18);
  }
}
.treasure-complete img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}
.treasure-complete strong {
  font-family: "Fraunces", serif;
  font-size: 26px;
  font-weight: 500;
  color: #fff3b8;
}
.treasure-complete p {
  max-width: 260px;
  color: var(--ink-dim);
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
}
.treasure-complete-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.treasure-complete-actions button:first-child {
  background: var(--accent);
  color: #1b1308;
  border-color: transparent;
}

/* ---------- Pack Rocket mini game ---------- */
.rocket-pack-level {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 68px clamp(16px, 3vw, 38px) 20px;
  background:
    linear-gradient(180deg, rgba(7, 7, 20, 0.2), rgba(7, 7, 20, 0.92)),
    radial-gradient(
      ellipse at 38% 62%,
      rgba(126, 231, 255, 0.16),
      transparent 34%
    ),
    radial-gradient(
      circle at 78% 24%,
      rgba(255, 214, 107, 0.12),
      transparent 28%
    ),
    #070714;
}
.rocket-pack-back {
  position: fixed;
  left: 24px;
  top: 24px;
  z-index: 44;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: rgba(13, 12, 32, 0.76);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  padding: 12px 18px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.solar-rocket-reset {
  min-height: 48px;
  border: 1px solid rgba(255, 214, 107, 0.42);
  border-radius: 999px;
  background: rgba(13, 12, 32, 0.8);
  color: #fff7d8;
  font-family: inherit;
  font-size: 13px;
  font-weight: 900;
  padding: 12px 18px;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.solar-rocket-actions {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 44;
  display: flex;
  gap: 10px;
  align-items: center;
}
.solar-rocket-control {
  min-height: 48px;
  border: 1px solid rgba(126, 231, 255, 0.48);
  border-radius: 999px;
  background: linear-gradient(180deg, #7ee7ff, #2c9dff);
  color: #05101a;
  font-family: inherit;
  font-size: 13px;
  font-weight: 1000;
  padding: 12px 18px;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
}
.solar-rocket-key-hint {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 214, 107, 0.42);
  border-radius: 999px;
  background: rgba(13, 12, 32, 0.82);
  color: #fff7d8;
  font-size: 12px;
  font-weight: 900;
  padding: 10px 14px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ---------- Rocket Cause and Effect lab ---------- */
.rocket-cause-level {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: auto;
  padding: 68px clamp(16px, 3vw, 38px) 24px;
  background:
    radial-gradient(circle at 78% 18%, rgba(255, 214, 107, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(7, 7, 20, 0.28), rgba(7, 7, 20, 0.94)),
    #070714;
}
.rocket-cause-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  min-height: min(720px, calc(100vh - 104px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(360px, 1fr) minmax(280px, 340px);
  grid-template-areas: "copy stage controls";
  gap: 16px;
  align-items: stretch;
}
.rocket-cause-copy,
.rocket-cause-controls,
.rocket-cause-stage {
  border: 1px solid rgba(126, 231, 255, 0.24);
  border-radius: 18px;
  background: rgba(13, 12, 32, 0.72);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.rocket-cause-copy {
  grid-area: copy;
  padding: clamp(18px, 2.5vw, 28px);
}
.rocket-cause-controls {
  grid-area: controls;
}
.rocket-cause-stage {
  grid-area: stage;
}
.rocket-cause-copy > span,
.rocket-cause-control span {
  color: #9be8ff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}
.rocket-cause-copy h1 {
  margin: 8px 0 10px;
  max-width: 14ch;
  color: #fff7d8;
  font-size: clamp(30px, 4.2vw, 52px);
  line-height: 0.98;
}
.rocket-cause-copy p,
.rocket-cause-result span {
  color: rgba(255, 248, 216, 0.82);
  font-weight: 700;
}
.rocket-cause-prompt,
.rocket-cause-result {
  margin-top: 18px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 214, 107, 0.12);
  border: 1px solid rgba(255, 214, 107, 0.24);
}
.rocket-cause-prompt strong,
.rocket-cause-result strong {
  display: block;
  color: #fff7d8;
  font-size: 17px;
  line-height: 1.18;
}
.rocket-cause-prompt button,
.rocket-cause-launch,
.rocket-cause-stepper button {
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #7ee7ff, #2c9dff);
  color: #06101a;
  font-family: inherit;
  font-weight: 1000;
  cursor: pointer;
}
.rocket-cause-prompt button {
  margin: 12px 8px 0 0;
  padding: 10px 14px;
}
.rocket-cause-stage {
  position: relative;
  min-height: min(720px, calc(100vh - 104px));
  overflow: hidden;
  display: grid;
  place-items: end center;
}
.rocket-cause-stage::before {
  content: "";
  position: absolute;
  inset: auto 18% 42px 18%;
  height: 46px;
  border-radius: 50%;
  background: rgba(126, 231, 255, 0.18);
  filter: blur(8px);
}
.rocket-cause-height {
  position: absolute;
  inset: 24px auto 24px 22px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  align-items: center;
  color: rgba(255, 248, 216, 0.76);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.rocket-cause-height i {
  width: 4px;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffd66b, rgba(126, 231, 255, 0.22));
}
.rocket-cause-ship {
  position: absolute;
  left: 50%;
  bottom: 34px;
  width: min(168px, 25vw);
  transform: translateX(-50%);
  animation: rocket-cause-launch 1.3s ease-out both;
}
.rocket-cause-ship > img,
.rocket-cause-ship > .safe-asset-image {
  width: 100%;
  display: block;
}
.rocket-cause-ship > img:not(.rocket-cause-flame) {
  position: relative;
  z-index: 2;
}
.rocket-cause-flame {
  position: absolute;
  left: 50%;
  bottom: -42px;
  z-index: 1;
  width: 68px;
  height: 112px;
  object-fit: contain;
  object-position: bottom center;
  transform: translateX(-50%);
}
.rocket-cause-controls {
  padding: clamp(16px, 2vw, 22px);
  display: grid;
  gap: 10px;
  align-content: start;
}
.rocket-cause-control {
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}
.rocket-cause-control > div:first-child {
  display: grid;
  gap: 3px;
  margin-bottom: 10px;
}
.rocket-cause-control strong {
  color: #fff7d8;
  font-size: 16px;
}
.rocket-cause-stepper {
  display: grid;
  grid-template-columns: 48px minmax(92px, 1fr) 48px;
  gap: 8px;
  align-items: center;
}
.rocket-cause-stepper span {
  min-height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(7, 7, 20, 0.48);
  color: #fff7d8;
  text-transform: none;
}
.rocket-cause-launch {
  min-height: 58px;
  margin-top: 4px;
  font-size: 15px;
}
@keyframes rocket-cause-launch {
  0% {
    transform: translate(-50%, 0) rotate(0deg);
  }
  55% {
    transform: translate(-50%, calc(0px - var(--rocket-result-lift)))
      rotate(var(--rocket-result-wobble));
  }
  100% {
    transform: translate(-50%, calc(0px - var(--rocket-result-settle)))
      rotate(var(--rocket-result-counter-wobble));
  }
}
@media (max-width: 920px) {
  .rocket-cause-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "stage"
      "controls";
    min-height: auto;
  }
  .rocket-cause-copy h1 {
    max-width: 14ch;
  }
  .rocket-cause-stage {
    min-height: min(520px, 58svh);
  }
  .rocket-cause-ship {
    width: min(150px, 38vw);
  }
}

/* ---------- UFO Builder mini game ---------- */
.ufo-builder-level {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: auto;
  padding: 68px clamp(16px, 3vw, 38px) 24px;
  background:
    radial-gradient(circle at 22% 20%, rgba(255, 214, 107, 0.15), transparent 30%),
    radial-gradient(circle at 80% 62%, rgba(181, 117, 255, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(8, 12, 38, 0.26), rgba(7, 7, 20, 0.95)),
    #070714;
}
.ufo-builder-shell {
  position: relative;
  z-index: 1;
  width: min(1160px, 100%);
  min-height: calc(100vh - 104px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(230px, 0.78fr) minmax(300px, 1fr) minmax(300px, 0.95fr);
  gap: clamp(16px, 2.4vw, 28px);
  align-items: stretch;
}
.ufo-builder-copy,
.ufo-builder-stage,
.ufo-part-grid {
  border: 1px solid rgba(126, 231, 255, 0.24);
  border-radius: 18px;
  background: rgba(13, 12, 32, 0.72);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.ufo-builder-copy {
  padding: clamp(18px, 2.5vw, 28px);
}
.ufo-builder-copy > span {
  color: #9be8ff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}
.ufo-builder-copy h1 {
  margin: 8px 0 10px;
  max-width: 11ch;
  color: #fff7d8;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 0.94;
}
.ufo-builder-copy p,
.ufo-builder-message span,
.ufo-part-card small {
  color: rgba(255, 248, 216, 0.82);
  font-weight: 700;
}
.ufo-builder-message {
  margin-top: 18px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 214, 107, 0.12);
  border: 1px solid rgba(255, 214, 107, 0.24);
}
.ufo-builder-message strong,
.ufo-part-card strong {
  display: block;
  color: #fff7d8;
  font-size: 18px;
}
.ufo-builder-message span {
  display: block;
  margin-top: 5px;
}
.ufo-builder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.ufo-builder-actions button,
.ufo-part-card {
  font-family: inherit;
  cursor: pointer;
}
.ufo-builder-actions button {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #7ee7ff, #2c9dff);
  color: #06101a;
  font-weight: 1000;
  padding: 10px 14px;
}
.ufo-saved-builds {
  margin-top: 14px;
  display: grid;
  gap: 7px;
}
.ufo-saved-builds > span {
  color: #9be8ff;
  font-size: 12px;
  font-weight: 1000;
  text-transform: uppercase;
}
.ufo-saved-builds small {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 248, 216, 0.86);
  font-weight: 800;
}
.ufo-builder-stage {
  position: relative;
  min-height: 500px;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.ufo-light-burst {
  position: absolute;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 205, 0.82), rgba(255, 214, 107, 0.24) 42%, transparent 66%);
  opacity: 0;
  transform: scale(0.62);
}
.ufo-builder-stage.beaming .ufo-light-burst {
  animation: ufo-materialize 0.82s ease-out both;
}
.ufo-spark-trail {
  position: absolute;
  width: 72%;
  height: 4px;
  transform: rotate(-12deg);
  background: linear-gradient(90deg, transparent, rgba(126, 231, 255, 0.75), transparent);
  opacity: 0.55;
}
.ufo-craft {
  position: relative;
  width: min(300px, 74vw);
  height: 180px;
  display: grid;
  place-items: center;
  animation: ufo-hover 2.8s ease-in-out infinite;
}
.ufo-generated-preview-art {
  position: absolute;
  inset: -22px -8px -32px;
  z-index: 1;
  pointer-events: none;
}
.ufo-stage-piece {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  background-image: url("data/generated-assets/ufo-builder/ufo-builder-parts.png");
  background-repeat: no-repeat;
  background-size: 300% 400%;
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.42));
  transform: translate(-50%, -50%);
}
.ufo-stage-piece.art-bronzeHull,
.ufo-stage-piece.art-orangeOrb,
.ufo-stage-piece.art-starCraft,
.ufo-stage-piece.art-blueWindows,
.ufo-stage-piece.art-smileWindows,
.ufo-stage-piece.art-radarWindows,
.ufo-stage-piece.art-orbPods,
.ufo-stage-piece.art-sparkTrail,
.ufo-stage-piece.art-quietBeam,
.ufo-stage-piece.art-starDrive,
.ufo-stage-piece.art-lightBurst,
.ufo-stage-piece.art-cometGlow {
  background-image: url("data/generated-assets/ufo-builder/ufo-builder-parts.png");
}
.ufo-stage-piece.art-bronzeHull {
  background-position: 0% 0%;
}
.ufo-stage-piece.art-orangeOrb {
  background-position: 50% 0%;
}
.ufo-stage-piece.art-starCraft {
  background-position: 100% 0%;
}
.ufo-stage-piece.art-blueWindows {
  background-position: 0% 33.333%;
}
.ufo-stage-piece.art-smileWindows {
  background-position: 50% 33.333%;
}
.ufo-stage-piece.art-radarWindows {
  background-position: 100% 33.333%;
}
.ufo-stage-piece.art-orbPods {
  background-position: 0% 66.666%;
}
.ufo-stage-piece.art-sparkTrail {
  background-position: 100% 66.666%;
}
.ufo-stage-piece.art-quietBeam {
  background-position: 0% 100%;
}
.ufo-stage-piece.art-starDrive {
  background-position: 50% 100%;
}
.ufo-stage-piece.art-lightBurst {
  background-position: 86% 100%;
}
.ufo-stage-piece.art-cometGlow {
  background-position: 100% 100%;
}
.ufo-stage-piece.stage-body {
  width: 270px;
  height: 202px;
  z-index: 1;
}
.ufo-craft.body-orangeOrb .stage-body {
  width: 216px;
  height: 216px;
}
.ufo-craft.body-starCraft .stage-body {
  width: 242px;
  height: 220px;
}
.ufo-stage-piece.stage-windows {
  width: 92px;
  height: 70px;
  z-index: 2;
  top: 50%;
}
.ufo-craft.windows-smileWindows .stage-windows {
  width: 122px;
  height: 78px;
}
.ufo-craft.windows-radarWindows .stage-windows {
  width: 82px;
  height: 82px;
}
.ufo-stage-piece.stage-launcher {
  z-index: 3;
  top: 78%;
}
.ufo-stage-piece.stage-launcher.art-orbPods {
  width: 98px;
  height: 76px;
}
.ufo-stage-piece.stage-launcher.art-sparkTrail {
  width: 116px;
  height: 66px;
  left: 61%;
  top: 78%;
}
.ufo-stage-piece.stage-launcher.art-quietBeam {
  width: 104px;
  height: 116px;
  top: 84%;
}
.ufo-stage-piece.stage-energy {
  z-index: 4;
  left: 68%;
  top: 28%;
}
.ufo-stage-piece.stage-energy.art-starDrive {
  width: 96px;
  height: 96px;
}
.ufo-stage-piece.stage-energy.art-lightBurst {
  width: 110px;
  height: 96px;
}
.ufo-stage-piece.stage-energy.art-cometGlow {
  width: 122px;
  height: 88px;
}
.ufo-stage-piece.stage-drop-ufos {
  width: 176px;
  height: 176px;
  z-index: 3;
  top: 82%;
  background-image: url("data/generated-assets/ufo-builder/drop-ufos.png");
  background-repeat: no-repeat;
  background-size: 300% 100%;
  background-position: 50% 0%;
  animation: ufo-drop-float 2.7s ease-in-out infinite;
}
.ufo-part-grid {
  display: grid;
  gap: 12px;
  padding: clamp(14px, 2vw, 20px);
  align-content: start;
  overflow: auto;
}
.ufo-part-group {
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.ufo-part-group h2 {
  margin: 0 0 8px;
  color: #9be8ff;
  font-size: 14px;
  font-weight: 1000;
  letter-spacing: 0;
  text-transform: uppercase;
}
.ufo-part-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.ufo-part-card {
  min-height: 98px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff7d8;
  display: grid;
  gap: 4px;
  justify-items: center;
  align-content: center;
  padding: 12px;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
}
.ufo-part-card strong {
  font-size: 14px;
}
.ufo-part-card small {
  font-size: 11px;
  line-height: 1.15;
}
.ufo-art-icon {
  width: 68px;
  height: 52px;
  display: block;
  background: url("data/generated-assets/ufo-builder/ufo-builder-parts.png") no-repeat;
  background-size: 300% 400%;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.38));
}
.ufo-art-icon.art-bronzeHull {
  background-position: 0% 0%;
}
.ufo-art-icon.art-orangeOrb {
  background-position: 50% 0%;
}
.ufo-art-icon.art-starCraft {
  background-position: 100% 0%;
}
.ufo-art-icon.art-blueWindows {
  background-position: 0% 33.333%;
}
.ufo-art-icon.art-smileWindows {
  background-position: 50% 33.333%;
}
.ufo-art-icon.art-radarWindows {
  background-position: 100% 33.333%;
}
.ufo-art-icon.art-orbPods {
  background-position: 0% 66.666%;
}
.ufo-art-icon.art-sparkTrail {
  background-position: 100% 66.666%;
}
.ufo-art-icon.art-quietBeam {
  background-position: 0% 100%;
}
.ufo-art-icon.art-starDrive {
  background-position: 50% 100%;
}
.ufo-art-icon.art-lightBurst {
  background-position: 86% 100%;
}
.ufo-art-icon.art-cometGlow {
  background-position: 100% 100%;
}
.ufo-art-icon.art-dropUfos {
  position: relative;
  width: 70px;
  height: 54px;
  background: url("data/generated-assets/ufo-builder/drop-ufos.png") no-repeat 50% 0%;
  background-size: 300% 100%;
}
.ufo-art-icon.art-dropUfos::before,
.ufo-art-icon.art-dropUfos::after {
  content: none;
}
.ufo-part-card.selected {
  transform: translateY(-3px);
  border-color: rgba(255, 214, 107, 0.82);
  background: rgba(255, 214, 107, 0.16);
}
@keyframes ufo-hover {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}
@keyframes ufo-wheel-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes ufo-wheel-spin-reverse {
  to {
    transform: rotate(-360deg);
  }
}
@keyframes ufo-drop-float {
  0%, 100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -10px;
  }
}
@keyframes ufo-materialize {
  0% {
    opacity: 0;
    transform: scale(0.38);
  }
  38% {
    opacity: 1;
    transform: scale(1.05);
  }
  100% {
    opacity: 0;
    transform: scale(1.5);
  }
}
@media (max-width: 920px) {
  .ufo-builder-shell {
    grid-template-columns: 1fr;
  }
  .ufo-builder-copy h1 {
    max-width: 14ch;
  }
}

/* ---------- Mashup Maker creative chaining game ---------- */
.mashup-maker-level {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: auto;
  padding: 68px clamp(16px, 3vw, 38px) 24px;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 214, 107, 0.16), transparent 28%),
    radial-gradient(circle at 82% 66%, rgba(126, 231, 255, 0.13), transparent 32%),
    linear-gradient(180deg, rgba(7, 7, 20, 0.24), rgba(7, 7, 20, 0.94)),
    #070714;
}
.mashup-maker-shell {
  position: relative;
  z-index: 1;
  width: min(1160px, 100%);
  min-height: calc(100vh - 104px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(230px, 0.72fr) minmax(280px, 0.9fr) minmax(300px, 1fr);
  gap: clamp(16px, 2.4vw, 28px);
  align-items: stretch;
}
.mashup-maker-copy,
.mashup-maker-board,
.mashup-card-grid {
  border: 1px solid rgba(126, 231, 255, 0.24);
  border-radius: 18px;
  background: rgba(13, 12, 32, 0.72);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.mashup-maker-copy {
  padding: clamp(18px, 2.5vw, 28px);
}
.mashup-maker-copy > span,
.mashup-helper-card span {
  color: #9be8ff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}
.mashup-maker-copy h1 {
  margin: 8px 0 10px;
  max-width: 12ch;
  color: #fff7d8;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 0.94;
}
.mashup-maker-copy p,
.mashup-invention p,
.mashup-card small {
  color: rgba(255, 248, 216, 0.82);
  font-weight: 700;
}
.mashup-helper-card,
.mashup-invention {
  margin-top: 18px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 214, 107, 0.12);
  border: 1px solid rgba(255, 214, 107, 0.24);
}
.mashup-helper-card strong {
  display: block;
  margin: 6px 0 12px;
  color: #fff7d8;
  font-size: 21px;
}
.mashup-helper-card button,
.mashup-actions button {
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #7ee7ff, #2c9dff);
  color: #06101a;
  font-family: inherit;
  font-weight: 1000;
  padding: 10px 14px;
  cursor: pointer;
}
.mashup-maker-board {
  display: grid;
  place-items: center;
  padding: clamp(16px, 2.2vw, 24px);
}
.mashup-invention {
  width: 100%;
  margin: 0;
  text-align: center;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}
.mashup-invention.ready {
  transform: translateY(-4px);
  border-color: rgba(126, 231, 255, 0.62);
  background: rgba(126, 231, 255, 0.13);
}
.mashup-orbit {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
}
.mashup-orbit span {
  min-height: 96px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  font-size: clamp(42px, 7vw, 70px);
}
.mashup-orbit i {
  color: #ffd66b;
  font-style: normal;
  font-size: 34px;
  font-weight: 1000;
}
.mashup-invention h2 {
  margin: 18px 0 8px;
  color: #fff7d8;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
}
.mashup-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.mashup-actions button:disabled {
  opacity: 0.45;
  cursor: default;
}
.mashup-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: clamp(14px, 2vw, 20px);
}
.mashup-card {
  min-height: 132px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff7d8;
  font-family: inherit;
  display: grid;
  gap: 4px;
  justify-items: center;
  align-content: center;
  padding: 12px;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
}
.mashup-card span {
  font-size: 38px;
}
.mashup-card strong {
  font-size: 17px;
}
.mashup-card.selected {
  transform: translateY(-3px);
  border-color: rgba(255, 214, 107, 0.82);
  background: rgba(255, 214, 107, 0.16);
}
@media (max-width: 920px) {
  .mashup-maker-shell {
    grid-template-columns: 1fr;
  }
  .mashup-maker-copy h1 {
    max-width: 14ch;
  }
}

/* ---------- Connection Quest flexible-thinking game ---------- */
.connection-quest-level {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: auto;
  padding: 68px clamp(16px, 3vw, 38px) 24px;
  background:
    radial-gradient(circle at 22% 24%, rgba(126, 231, 255, 0.16), transparent 30%),
    radial-gradient(circle at 82% 70%, rgba(255, 214, 107, 0.14), transparent 32%),
    linear-gradient(180deg, rgba(7, 7, 20, 0.24), rgba(7, 7, 20, 0.94)),
    #070714;
}
.connection-quest-shell {
  position: relative;
  z-index: 1;
  width: min(1160px, 100%);
  min-height: calc(100vh - 104px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(230px, 0.75fr) minmax(280px, 0.95fr) minmax(300px, 1fr);
  gap: clamp(16px, 2.4vw, 28px);
  align-items: stretch;
}
.connection-quest-problem,
.connection-quest-board,
.connection-card-grid {
  border: 1px solid rgba(126, 231, 255, 0.24);
  border-radius: 18px;
  background: rgba(13, 12, 32, 0.72);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.connection-quest-problem {
  padding: clamp(18px, 2.5vw, 28px);
}
.connection-quest-problem > span {
  color: #9be8ff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}
.connection-quest-problem h1 {
  margin: 8px 0 10px;
  max-width: 11ch;
  color: #fff7d8;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 0.94;
}
.connection-quest-problem p,
.connection-build p,
.connection-card small {
  color: rgba(255, 248, 216, 0.82);
  font-weight: 700;
}
.connection-problem-icon {
  min-height: 110px;
  display: grid;
  place-items: center;
  margin: 18px 0;
  border-radius: 18px;
  background: rgba(255, 214, 107, 0.12);
  font-size: clamp(52px, 8vw, 84px);
}
.connection-quest-problem button,
.connection-actions button {
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #7ee7ff, #2c9dff);
  color: #06101a;
  font-family: inherit;
  font-weight: 1000;
  padding: 10px 14px;
  cursor: pointer;
}
.connection-quest-board {
  display: grid;
  align-content: center;
  gap: 14px;
  padding: clamp(16px, 2.2vw, 24px);
}
.connection-brain-spark {
  padding: 14px;
  border-radius: 16px;
  background: rgba(126, 231, 255, 0.14);
  border: 1px solid rgba(126, 231, 255, 0.34);
  text-align: center;
}
.connection-brain-spark span {
  color: #9be8ff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.connection-brain-spark strong {
  display: block;
  margin: 4px 0 10px;
  color: #fff7d8;
  font-size: 18px;
}
.connection-brain-spark button {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  background: #ffd66b;
  color: #1b1431;
  font-family: inherit;
  font-weight: 1000;
  padding: 8px 12px;
  cursor: pointer;
}
.connection-build {
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 214, 107, 0.12);
  border: 1px solid rgba(255, 214, 107, 0.24);
  text-align: center;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}
.connection-build.ready {
  transform: translateY(-4px);
  border-color: rgba(126, 231, 255, 0.62);
  background: rgba(126, 231, 255, 0.13);
}
.connection-pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
}
.connection-pair span {
  min-height: 96px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  font-size: clamp(42px, 7vw, 70px);
}
.connection-pair i {
  color: #ffd66b;
  font-style: normal;
  font-size: 34px;
  font-weight: 1000;
}
.connection-build h2 {
  margin: 18px 0 8px;
  color: #fff7d8;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
}
.connection-thinking-cue {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #dff8ff;
  font-size: 14px;
  font-weight: 900;
}
.connection-parent-prompt {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(126, 231, 255, 0.1);
  color: #fff7d8;
  font-size: 14px;
  font-weight: 900;
}
.connection-sequence-cue {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 214, 107, 0.1);
  color: #fff7d8;
  font-size: 14px;
  font-weight: 900;
}
.connection-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.connection-actions button:disabled {
  opacity: 0.45;
  cursor: default;
}
.connection-counter {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.connection-counter span {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}
.connection-counter span.on {
  background: #ffd66b;
  box-shadow: 0 0 18px rgba(255, 214, 107, 0.65);
}
.connection-flex-cue {
  text-align: center;
  color: rgba(255, 248, 216, 0.84);
  font-size: 14px;
  font-weight: 900;
}
.connection-made-list {
  display: grid;
  gap: 8px;
}
.connection-made-list span {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff7d8;
  font-size: 13px;
  font-weight: 900;
}
.connection-made-list b {
  font-size: 18px;
}
.connection-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: clamp(14px, 2vw, 20px);
}
.connection-card {
  min-height: 132px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff7d8;
  font-family: inherit;
  display: grid;
  gap: 4px;
  justify-items: center;
  align-content: center;
  padding: 12px;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
}
.connection-card span {
  font-size: 38px;
}
.connection-card strong {
  font-size: 17px;
}
.connection-card.selected {
  transform: translateY(-3px);
  border-color: rgba(255, 214, 107, 0.82);
  background: rgba(255, 214, 107, 0.16);
}
@media (max-width: 920px) {
  .connection-quest-shell {
    grid-template-columns: 1fr;
  }
  .connection-quest-problem h1 {
    max-width: 14ch;
  }
}
body.rocket-control-active .home-astronaut-dragger {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.88);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}
.rocket-builder-stage {
  position: relative;
  z-index: 34;
  display: grid;
  grid-template-columns: minmax(430px, 1.1fr) minmax(300px, 0.82fr);
  align-items: stretch;
  gap: clamp(16px, 3vw, 34px);
  max-width: 1120px;
  width: 100%;
  min-height: min(760px, calc(100vh - 104px));
  margin: 0 auto;
}
.rocket-build-pad {
  position: relative;
  min-height: 640px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(154, 215, 255, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.05),
      transparent 16%,
      transparent 84%,
      rgba(255, 255, 255, 0.04)
    ),
    repeating-linear-gradient(
      90deg,
      rgba(154, 215, 255, 0.08) 0 2px,
      transparent 2px 84px
    ),
    radial-gradient(
      circle at 50% 44%,
      rgba(154, 215, 255, 0.16),
      transparent 42%
    ),
    rgba(13, 12, 32, 0.34);
  box-shadow:
    inset 0 -90px 90px rgba(0, 0, 0, 0.32),
    inset 0 0 70px rgba(0, 0, 0, 0.22),
    0 24px 70px rgba(0, 0, 0, 0.35);
  perspective: 900px;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}
.rocket-build-pad:focus-visible,
.rocket-build-pad:hover {
  border-color: rgba(255, 214, 107, 0.46);
  outline: none;
  box-shadow:
    inset 0 -90px 90px rgba(0, 0, 0, 0.32),
    inset 0 0 70px rgba(0, 0, 0, 0.22),
    0 0 0 6px rgba(255, 214, 107, 0.09),
    0 24px 70px rgba(0, 0, 0, 0.35);
}
.rocket-builder-stage.dragging .rocket-build-pad {
  border-color: rgba(255, 214, 107, 0.76);
  box-shadow:
    inset 0 -90px 90px rgba(0, 0, 0, 0.3),
    inset 0 0 80px rgba(255, 214, 107, 0.13),
    0 0 0 8px rgba(255, 214, 107, 0.08),
    0 24px 70px rgba(0, 0, 0, 0.35);
}
.rocket-build-pad::before,
.rocket-build-pad::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.rocket-build-pad::before {
  left: 9%;
  right: 9%;
  bottom: 32px;
  height: 34%;
  border-radius: 50%;
  background:
    radial-gradient(
      ellipse at center,
      rgba(126, 231, 255, 0.12),
      transparent 62%
    ),
    repeating-radial-gradient(
      ellipse at center,
      rgba(255, 255, 255, 0.11) 0 2px,
      transparent 2px 24px
    );
  transform: rotateX(70deg);
}
.rocket-build-pad::after {
  left: 50%;
  bottom: 52px;
  width: 260px;
  height: 54px;
  border: 2px solid rgba(255, 214, 107, 0.22);
  border-radius: 50%;
  transform: translateX(-50%) rotateX(68deg);
  box-shadow: 0 0 26px rgba(255, 214, 107, 0.16);
}
.rocket-drop-hint {
  position: absolute;
  left: 50%;
  bottom: 22px;
  z-index: 4;
  padding: 9px 14px;
  border: 2px dashed rgba(255, 214, 107, 0.58);
  border-radius: 999px;
  background: rgba(13, 12, 32, 0.72);
  color: #fff7d8;
  font-size: 13px;
  font-weight: 900;
  transform: translateX(-50%);
  pointer-events: none;
  animation: tap-helper-pop 1.2s ease-in-out infinite;
}
.rocket-builder-stage.dragging .rocket-drop-hint {
  border-style: solid;
  background: rgba(255, 214, 107, 0.2);
  color: #fff7d8;
  box-shadow: 0 0 26px rgba(255, 214, 107, 0.26);
}
.rocket-build-ship {
  position: relative;
  width: 250px;
  height: 472px;
  transform-origin: 50% 82%;
  transition: transform 0.4s ease;
  margin-top: -28px;
  transform: rotateX(7deg) rotateY(-8deg);
}
.rocket-builder-stage.launching .rocket-build-ship {
  animation: rocket-launch-away 2.6s ease-in forwards;
}
.rocket-part,
.rocket-part-img {
  position: absolute;
  left: 50%;
  opacity: 0.3;
  filter: grayscale(0.7);
  transform: translateX(-50%) scale(0.92);
  transition:
    opacity 0.26s ease,
    filter 0.26s ease,
    transform 0.26s ease;
}
.rocket-part.on,
.rocket-part-img.on {
  opacity: 1;
  filter: drop-shadow(0 12px 26px rgba(0, 0, 0, 0.42));
  transform: translateX(-50%) scale(1);
}
.rocket-part:not(.on),
.rocket-part-img:not(.on) {
  outline: 2px dashed rgba(255, 255, 255, 0.26);
  outline-offset: 4px;
}
.rocket-part-img {
  object-fit: contain;
  pointer-events: none;
}
.rocket-builder-stage.color-blue .rocket-part-img {
  filter: grayscale(0.7) hue-rotate(0deg);
}
.rocket-builder-stage.color-yellow .rocket-part-img.on,
.rocket-builder-stage.color-yellow .pack-next-choice img {
  filter: hue-rotate(118deg) saturate(1.12)
    drop-shadow(0 12px 26px rgba(0, 0, 0, 0.42));
}
.rocket-builder-stage.color-green .rocket-part-img.on,
.rocket-builder-stage.color-green .pack-next-choice img {
  filter: hue-rotate(170deg) saturate(1.12)
    drop-shadow(0 12px 26px rgba(0, 0, 0, 0.42));
}
.rocket-builder-stage.color-yellow .rocket-part-img.no-tint.on,
.rocket-builder-stage.color-green .rocket-part-img.no-tint.on,
.rocket-part-img.no-tint.on {
  filter: drop-shadow(0 12px 26px rgba(0, 0, 0, 0.42));
}
.rocket-nose-img {
  top: 0;
  z-index: 5;
  width: 142px;
}
.rocket-body-img {
  top: 96px;
  z-index: 4;
  width: 148px;
}
.rocket-fins-img {
  top: 258px;
  z-index: 3;
  width: 220px;
}
.rocket-window-img {
  top: 132px;
  z-index: 7;
  width: 66px;
}
.rocket-engine-img {
  top: 308px;
  z-index: 6;
  width: 100px;
}
.rocket-fuel-tank-img {
  top: 216px;
  z-index: 2;
  width: 66px;
  margin-left: -78px;
}
.rocket-fuel-pipes-img {
  top: 248px;
  z-index: 5;
  width: 132px;
}
.rocket-igniter-img {
  top: 318px;
  z-index: 7;
  width: 48px;
  margin-left: 58px;
}
.rocket-booster-img {
  top: 112px;
  z-index: 2;
  width: 248px;
}
.rocket-antenna-img {
  top: -52px;
  z-index: 6;
  width: 92px;
}
.rocket-badge-img {
  top: 204px;
  z-index: 7;
  width: 58px;
  margin-left: 42px;
}
.rocket-nose {
  top: 6px;
  width: 118px;
  height: 118px;
  background: var(--rocket-color);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.rocket-body {
  top: 112px;
  width: 126px;
  height: 180px;
  border-radius: 56px 56px 24px 24px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.46), transparent 38%),
    var(--rocket-color);
}
.rocket-window {
  position: absolute;
  left: 50%;
  top: 36px;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 5px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  background: #102748;
  transform: translateX(-50%);
  box-shadow: inset 0 0 16px rgba(118, 216, 255, 0.65);
}
.rocket-window img {
  width: 110px;
  max-width: none;
  transform: translateY(10px) scale(1.35);
}
.rocket-fins {
  top: 260px;
  width: 170px;
  height: 76px;
}
.rocket-fins span {
  position: absolute;
  bottom: 0;
  width: 56px;
  height: 76px;
  background: #ffd66b;
}
.rocket-fins span:first-child {
  left: 0;
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}
.rocket-fins span:last-child {
  right: 0;
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}
.rocket-flame {
  position: absolute;
  left: 50%;
  top: 340px;
  z-index: 1;
  width: 210px;
  height: auto;
  opacity: 0;
  transform: translateX(-50%) scaleY(0.35);
  transform-origin: top;
  pointer-events: none;
  filter: drop-shadow(0 0 24px rgba(255, 122, 61, 0.7));
}
.rocket-builder-stage.launching .rocket-flame {
  opacity: 1;
  animation: rocket-flame-flicker 0.13s ease-in-out infinite alternate;
}
@keyframes rocket-flame-flicker {
  from {
    transform: translateX(-50%) scaleY(0.82) scaleX(0.9);
  }
  to {
    transform: translateX(-50%) scaleY(1.18) scaleX(1.08);
  }
}
@keyframes rocket-launch-away {
  0%,
  20% {
    transform: translateY(0) rotate(0deg);
  }
  100% {
    transform: translateY(-820px) rotate(4deg);
  }
}
.rocket-pack-copy {
  display: grid;
  gap: 12px;
  color: var(--ink);
}
.rocket-pack-copy > span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.rocket-pack-copy h1 {
  font-family: "Fraunces", serif;
  font-size: clamp(42px, 7vw, 74px);
  line-height: 0.92;
  margin: 0;
}
.rocket-pack-copy p {
  max-width: 480px;
  color: var(--ink-dim);
  font-size: 15px;
  line-height: 1.45;
}
.rocket-pack-slots {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.rocket-pack-slots span {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  background: rgba(13, 12, 32, 0.52);
  color: var(--ink-faint);
  font-size: 24px;
  font-weight: 900;
}
.rocket-pack-slots span.packed {
  border-style: solid;
  border-color: rgba(255, 214, 107, 0.48);
  background: rgba(255, 214, 107, 0.14);
}
.rocket-pack-slots span.next {
  border-style: solid;
  border-color: rgba(126, 231, 255, 0.82);
  background:
    radial-gradient(circle, rgba(126, 231, 255, 0.3), transparent 62%),
    rgba(13, 12, 32, 0.72);
  color: #fff7d8;
  box-shadow:
    0 0 0 5px rgba(126, 231, 255, 0.08),
    0 0 22px rgba(126, 231, 255, 0.22);
  animation: rocket-pack-hint 1.2s ease-in-out infinite;
}
.rocket-pack-slots img {
  width: 82%;
  height: 82%;
  object-fit: contain;
}
.rocket-color-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.rocket-mode-toggle {
  width: min(360px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(154, 215, 255, 0.22);
  border-radius: 999px;
  background: rgba(13, 12, 32, 0.66);
}
.rocket-mode-toggle button {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-dim);
  font-family: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}
.rocket-mode-toggle button.on {
  background: rgba(255, 214, 107, 0.2);
  color: #fff7d8;
  box-shadow: inset 0 0 0 1px rgba(255, 214, 107, 0.32);
}
.rocket-color-row button {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255, 255, 255, 0.34);
  border-radius: 50%;
  background: var(--swatch);
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26);
}
.rocket-color-row button.on {
  border-color: #fff7d8;
  box-shadow:
    0 0 0 5px rgba(255, 214, 107, 0.22),
    0 10px 24px rgba(0, 0, 0, 0.26);
}
.rocket-pack-fact,
.rocket-pack-done {
  display: grid;
  gap: 4px;
  max-width: 500px;
  padding: 12px 14px;
  border: 1px solid rgba(154, 215, 255, 0.26);
  border-radius: 16px;
  background: rgba(13, 12, 32, 0.62);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.rocket-pack-fact.good {
  border-color: rgba(255, 214, 107, 0.48);
  background: rgba(255, 214, 107, 0.12);
}
.rocket-pack-fact.try {
  border-color: rgba(154, 215, 255, 0.34);
}
.rocket-pack-fact strong,
.rocket-pack-done strong {
  color: #fff7d8;
  font-size: 15px;
}
.rocket-pack-fact span {
  color: var(--ink-dim);
  font-size: 14px;
  line-height: 1.35;
}
.rocket-pack-done {
  grid-template-columns: 1fr;
  align-items: center;
  border-color: rgba(140, 255, 176, 0.45);
}
.rocket-pack-done button {
  min-height: 54px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #1b1308;
  font-family: inherit;
  font-weight: 900;
  font-size: 16px;
  padding: 13px 18px;
  cursor: pointer;
  box-shadow:
    0 8px 0 rgba(120, 72, 18, 0.72),
    0 16px 24px rgba(0, 0, 0, 0.24);
}
.rocket-pack-done button:active {
  transform: translateY(5px);
  box-shadow:
    0 3px 0 rgba(120, 72, 18, 0.72),
    0 10px 18px rgba(0, 0, 0, 0.2);
}
.pack-next-choice {
  width: min(360px, 100%);
  min-height: 150px;
  display: grid;
  grid-template-columns: 92px 1fr;
  align-items: center;
  justify-items: start;
  column-gap: 16px;
  row-gap: 4px;
  border: 2px solid rgba(255, 214, 107, 0.58);
  border-radius: 20px;
  background: rgba(13, 12, 32, 0.76);
  color: var(--ink);
  font-family: inherit;
  padding: 16px;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  box-shadow:
    0 0 0 8px rgba(255, 214, 107, 0.09),
    0 18px 44px rgba(0, 0, 0, 0.34);
}
.pack-next-choice img {
  grid-row: 1 / 4;
  width: 86px;
  height: 86px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(255, 214, 107, 0.42));
  pointer-events: none;
}
.rocket-drag-ghost {
  position: fixed;
  z-index: 1000;
  width: 132px;
  max-height: 150px;
  object-fit: contain;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(1.08);
  filter: drop-shadow(0 20px 28px rgba(0, 0, 0, 0.4));
}
.rocket-part-icon {
  grid-row: 1 / 3;
  width: 86px;
  height: 86px;
  display: block;
  filter: drop-shadow(0 0 18px rgba(255, 214, 107, 0.42));
}
.rocket-part-icon.nose {
  background: var(--rocket-color);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.rocket-part-icon.body {
  border-radius: 38px 38px 16px 16px;
  background:
    radial-gradient(circle at 50% 42%, #9ad7ff 0 18%, transparent 20%),
    var(--rocket-color);
}
.rocket-part-icon.fins {
  position: relative;
}
.rocket-part-icon.fins::before,
.rocket-part-icon.fins::after {
  content: "";
  position: absolute;
  bottom: 8px;
  width: 42px;
  height: 62px;
  background: #ffd66b;
}
.rocket-part-icon.fins::before {
  left: 0;
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}
.rocket-part-icon.fins::after {
  right: 0;
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}
.pack-next-choice span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.pack-next-choice strong {
  color: #fff7d8;
  font-family: "Fraunces", serif;
  font-size: 28px;
  line-height: 0.98;
  letter-spacing: 0;
}
.pack-next-choice em {
  color: var(--ink-dim);
  font-size: 13px;
  font-style: normal;
  line-height: 1.2;
}
@keyframes rocket-pack-hint {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}
/* ---------- Planet Sort mini game ---------- */
.planet-sort-level {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 82px clamp(16px, 3vw, 36px) 28px;
  background:
    radial-gradient(
      circle at 28% 32%,
      rgba(126, 231, 255, 0.16),
      transparent 34%
    ),
    radial-gradient(
      circle at 78% 68%,
      rgba(255, 214, 107, 0.16),
      transparent 30%
    ),
    linear-gradient(180deg, rgba(7, 7, 20, 0.2), rgba(7, 7, 20, 0.92)), #070714;
}
.planet-sort-back {
  position: fixed;
  left: 24px;
  top: 24px;
  z-index: 44;
  min-height: 48px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: rgba(13, 12, 32, 0.78);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 900;
  padding: 12px 18px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.planet-sort-shell {
  position: relative;
  z-index: 34;
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: minmax(260px, 0.64fr) minmax(0, 1fr);
  align-items: stretch;
  gap: clamp(16px, 3vw, 30px);
}
.planet-sort-copy {
  display: grid;
  align-content: center;
  gap: 16px;
  min-height: 520px;
}
.planet-sort-copy > span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 1000;
  text-transform: uppercase;
}
.planet-sort-copy h1 {
  max-width: 440px;
  color: #fff7d8;
  font-family: "Fraunces", serif;
  font-size: clamp(42px, 6vw, 74px);
  font-weight: 500;
  line-height: 0.92;
}
.planet-sort-copy p {
  max-width: 390px;
  color: var(--ink-dim);
  font-size: 17px;
  line-height: 1.35;
}
.planet-sort-message {
  min-height: 86px;
  width: min(390px, 100%);
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(13, 12, 32, 0.76);
  color: #fff7d8;
  padding: 15px 17px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.planet-sort-message.good {
  border-color: rgba(255, 214, 107, 0.5);
  background: rgba(72, 54, 10, 0.58);
}
.planet-sort-message.try {
  border-color: rgba(126, 231, 255, 0.42);
  background: rgba(24, 55, 76, 0.56);
}
.planet-sort-message img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}
.planet-sort-message strong {
  font-size: 16px;
  line-height: 1.3;
}
.planet-sort-progress {
  display: flex;
  gap: 10px;
}
.planet-sort-progress span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.planet-sort-progress span.on {
  background: var(--accent);
  box-shadow: 0 0 16px rgba(255, 214, 107, 0.72);
}
.planet-sort-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.planet-sort-actions button {
  min-height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(13, 12, 32, 0.76);
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  padding: 12px 18px;
  cursor: pointer;
}
.planet-sort-actions button:first-child {
  border-color: transparent;
  background: var(--accent);
  color: #1b1308;
}
.planet-sort-choices {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}
.game-keyboard-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.planet-sort-card {
  min-height: 520px;
  display: grid;
  grid-template-rows: minmax(250px, 1fr) auto auto;
  justify-items: center;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 38%),
    rgba(13, 12, 32, 0.72);
  color: var(--ink);
  font-family: inherit;
  padding: 18px 12px 22px;
  cursor: pointer;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.36);
  transition:
    border-color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}
.planet-sort-card:hover,
.planet-sort-card:focus-visible,
.planet-sort-card.selected {
  border-color: rgba(255, 214, 107, 0.55);
  transform: translateY(-3px);
  box-shadow:
    0 26px 66px rgba(0, 0, 0, 0.42),
    0 0 0 5px rgba(255, 214, 107, 0.09);
  outline: none;
}
.planet-sort-card.correct {
  border-color: rgba(255, 214, 107, 0.82);
  background:
    radial-gradient(
      circle at 50% 32%,
      rgba(255, 214, 107, 0.22),
      transparent 46%
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 38%),
    rgba(72, 54, 10, 0.62);
  box-shadow:
    0 26px 66px rgba(0, 0, 0, 0.42),
    0 0 0 6px rgba(255, 214, 107, 0.12),
    0 0 28px rgba(255, 214, 107, 0.3);
}
.planet-sort-card.wrong {
  border-color: rgba(126, 231, 255, 0.58);
  animation: planet-sort-wiggle 0.36s ease-in-out;
}
.planet-sort-card.hint {
  border-color: rgba(255, 214, 107, 0.72);
  box-shadow:
    0 26px 66px rgba(0, 0, 0, 0.42),
    0 0 0 7px rgba(255, 214, 107, 0.12),
    0 0 28px rgba(255, 214, 107, 0.28);
}
.planet-sort-card:disabled {
  cursor: default;
  opacity: 0.72;
}
@keyframes planet-sort-wiggle {
  0%,
  100% {
    transform: translateX(0);
  }
  30% {
    transform: translateX(-7px);
  }
  66% {
    transform: translateX(7px);
  }
}
.planet-sort-planet-wrap {
  min-height: 250px;
  display: grid;
  place-items: center;
  width: 100%;
}
.planet-sort-planet {
  position: relative;
  display: block;
  max-width: 100%;
  max-height: 230px;
}
.planet-sort-card strong {
  color: #fff7d8;
  font-family: "Fraunces", serif;
  font-size: 30px;
  font-weight: 500;
  line-height: 1;
}
.planet-sort-card small {
  min-height: 34px;
  color: var(--ink-dim);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}
@media (max-width: 840px) {
  .planet-sort-level {
    align-items: start;
    padding: 78px 14px 20px;
  }
  .planet-sort-back {
    left: 14px;
    top: 14px;
  }
  .planet-sort-shell {
    grid-template-columns: 1fr;
  }
  .planet-sort-copy {
    min-height: 0;
    justify-items: center;
    text-align: center;
  }
  .planet-sort-copy h1 {
    font-size: clamp(36px, 11vw, 56px);
  }
  .planet-sort-choices {
    grid-template-columns: 1fr;
  }
  .planet-sort-card {
    min-height: 138px;
    grid-template-columns: 112px minmax(0, 1fr);
    grid-template-rows: auto auto;
    justify-items: start;
    padding: 12px;
    text-align: left;
  }
  .planet-sort-planet-wrap {
    grid-row: 1 / 3;
    min-height: 112px;
  }
  .planet-sort-planet {
    max-width: 106px;
    max-height: 106px;
  }
}

/* ---------- Engine Match mini game ---------- */
.engine-match-level {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 82px clamp(16px, 3vw, 36px) 28px;
  background:
    radial-gradient(
      circle at 22% 72%,
      rgba(255, 103, 72, 0.18),
      transparent 32%
    ),
    radial-gradient(
      circle at 80% 28%,
      rgba(126, 231, 255, 0.15),
      transparent 30%
    ),
    linear-gradient(180deg, rgba(7, 7, 20, 0.16), rgba(7, 7, 20, 0.94)), #070714;
}
.engine-match-shell {
  position: relative;
  z-index: 34;
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(320px, 1fr);
  align-items: center;
  gap: clamp(18px, 5vw, 54px);
}
.engine-match-rocket {
  position: relative;
  min-height: 560px;
  display: grid;
  place-items: center;
}
.engine-match-rocket img:first-child {
  width: min(300px, 72vw);
  height: auto;
  filter: drop-shadow(0 28px 46px rgba(0, 0, 0, 0.46));
  transform: rotate(-8deg);
}
.engine-match-fire {
  position: absolute;
  left: 50%;
  bottom: 50px;
  width: 120px;
  height: auto;
  transform: translateX(-50%) rotate(-8deg);
  filter: drop-shadow(0 0 26px rgba(255, 136, 70, 0.55));
  animation: rocket-flame-flicker 0.22s ease-in-out infinite alternate;
}
.engine-match-panel {
  display: grid;
  gap: 16px;
}
.engine-match-panel > span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 1000;
  text-transform: uppercase;
}
.engine-match-panel h1 {
  color: #fff7d8;
  font-family: "Fraunces", serif;
  font-size: clamp(42px, 6vw, 74px);
  font-weight: 500;
  line-height: 0.92;
}
.engine-match-panel p {
  max-width: 470px;
  color: var(--ink-dim);
  font-size: 17px;
  line-height: 1.35;
}
.engine-match-message {
  min-height: 74px;
  display: grid;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(13, 12, 32, 0.76);
  color: #fff7d8;
  padding: 15px 17px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.engine-match-message.done {
  border-color: rgba(255, 214, 107, 0.5);
  background: rgba(72, 54, 10, 0.58);
}
.engine-match-progress {
  display: flex;
  gap: 10px;
}
.engine-match-progress span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.engine-match-progress span.on {
  background: var(--accent);
  box-shadow: 0 0 16px rgba(255, 214, 107, 0.72);
}
.engine-match-choices {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.engine-match-choices button {
  min-height: 210px;
  display: grid;
  grid-template-rows: minmax(120px, 1fr) auto;
  justify-items: center;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 46%),
    rgba(13, 12, 32, 0.74);
  color: #fff7d8;
  font: inherit;
  font-weight: 900;
  padding: 14px 10px 16px;
  cursor: pointer;
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.34);
  transition:
    border-color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}
.engine-match-choices button:hover,
.engine-match-choices button:focus-visible,
.engine-match-choices button.selected {
  border-color: rgba(255, 214, 107, 0.55);
  transform: translateY(-3px);
  box-shadow:
    0 26px 66px rgba(0, 0, 0, 0.42),
    0 0 0 5px rgba(255, 214, 107, 0.09);
  outline: none;
}
.engine-match-choices button.correct {
  border-color: rgba(255, 214, 107, 0.82);
  background:
    radial-gradient(
      circle at 50% 32%,
      rgba(255, 214, 107, 0.22),
      transparent 46%
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 38%),
    rgba(72, 54, 10, 0.62);
  box-shadow:
    0 26px 66px rgba(0, 0, 0, 0.42),
    0 0 0 6px rgba(255, 214, 107, 0.12),
    0 0 28px rgba(255, 214, 107, 0.3);
}
.engine-match-choices button.wrong {
  border-color: rgba(126, 231, 255, 0.58);
  animation: planet-sort-wiggle 0.36s ease-in-out;
}
.engine-match-choices button.hint {
  border-color: rgba(255, 214, 107, 0.76);
  box-shadow:
    0 26px 66px rgba(0, 0, 0, 0.42),
    0 0 0 7px rgba(255, 214, 107, 0.12),
    0 0 28px rgba(255, 214, 107, 0.28);
}
.engine-match-choices img {
  width: min(126px, 80%);
  max-height: 132px;
  object-fit: contain;
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.38));
}
.engine-match-choices strong {
  font-size: 15px;
  line-height: 1.15;
  text-align: center;
}
@media (max-width: 840px) {
  .engine-match-level {
    align-items: start;
    padding: 78px 14px 20px;
  }
  .engine-match-shell {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .engine-match-rocket {
    min-height: 120px;
  }
  .engine-match-rocket img:first-child {
    width: 104px;
  }
  .engine-match-fire {
    bottom: -2px;
    width: 44px;
  }
  .engine-match-panel {
    justify-items: center;
    text-align: center;
  }
  .engine-match-panel h1 {
    font-size: clamp(32px, 10vw, 48px);
  }
  .engine-match-choices {
    width: 100%;
    grid-template-columns: 1fr;
  }
  .engine-match-choices button {
    min-height: 94px;
    grid-template-columns: 86px minmax(0, 1fr);
    grid-template-rows: 1fr;
    justify-items: start;
    text-align: left;
  }
  .engine-match-choices img {
    width: 70px;
    max-height: 76px;
  }
}

/* ---------- Asteroid Dodge mini game ---------- */
.asteroid-dodge-level {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 82px clamp(16px, 3vw, 36px) 28px;
  background:
    radial-gradient(
      circle at 18% 24%,
      rgba(255, 180, 86, 0.16),
      transparent 32%
    ),
    radial-gradient(
      circle at 78% 70%,
      rgba(126, 231, 255, 0.15),
      transparent 31%
    ),
    linear-gradient(180deg, rgba(7, 7, 20, 0.12), rgba(7, 7, 20, 0.94)), #070714;
}
.asteroid-dodge-level.playing {
  overflow: hidden;
  padding: 0;
}
.asteroid-dodge-opening {
  position: relative;
  z-index: 34;
  width: min(1080px, 100%);
  min-height: min(690px, calc(100vh - 126px));
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(280px, 0.72fr);
  align-items: center;
  gap: clamp(18px, 4vw, 44px);
}
.asteroid-dodge-opening-art {
  position: relative;
  min-height: 590px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 28px;
  background: #070714;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
  isolation: isolate;
}
.asteroid-opening-bg,
.asteroid-track-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.asteroid-opening-bg {
  opacity: 0.96;
  animation: asteroid-bg-drift 9s ease-in-out infinite alternate;
}
.asteroid-dodge-opening-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 50% 55%,
      transparent 0 36%,
      rgba(7, 7, 20, 0.28) 70%
    ),
    linear-gradient(180deg, transparent 0 58%, rgba(7, 7, 20, 0.36));
  pointer-events: none;
}
.asteroid-opening-rocket {
  position: absolute;
  left: 12%;
  bottom: 10%;
  z-index: 2;
  width: min(280px, 42%);
  height: auto;
  transform: rotate(-45deg);
  filter: drop-shadow(0 28px 36px rgba(0, 0, 0, 0.42));
  animation: asteroid-rocket-float 2.4s ease-in-out infinite;
}
.asteroid-opening-rock {
  position: absolute;
  z-index: 2;
  height: auto;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.45));
}
.asteroid-opening-rock.rock-one {
  top: 11%;
  right: 18%;
  width: min(150px, 24%);
  animation: asteroid-opening-rock-one 4.6s ease-in-out infinite;
}
.asteroid-opening-rock.rock-two {
  top: 44%;
  right: 8%;
  width: min(118px, 20%);
  animation: asteroid-opening-rock-two 5.2s ease-in-out infinite;
}
.asteroid-dodge-opening-copy {
  display: grid;
  gap: 18px;
  align-content: center;
}
.asteroid-dodge-opening-copy > span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 1000;
  text-transform: uppercase;
}
.asteroid-dodge-opening-copy h1 {
  color: #fff7d8;
  font-family: "Fraunces", serif;
  font-size: clamp(48px, 7vw, 82px);
  font-weight: 500;
  line-height: 0.9;
}
.asteroid-dodge-opening-copy p {
  max-width: 390px;
  color: var(--ink-dim);
  font-size: 18px;
  line-height: 1.35;
}
.asteroid-begin-button {
  width: min(320px, 100%);
  min-height: 86px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #1b1308;
  font: inherit;
  font-size: 28px;
  font-weight: 1000;
  cursor: pointer;
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.36),
    0 0 34px rgba(255, 214, 107, 0.34);
}
.asteroid-begin-button:focus-visible {
  outline: 4px solid rgba(126, 231, 255, 0.82);
  outline-offset: 5px;
}
.asteroid-dodge-shell {
  display: none;
}
.asteroid-dodge-progress {
  display: flex;
  gap: 10px;
}
.asteroid-dodge-progress span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.asteroid-dodge-progress span.on {
  background: var(--accent);
  box-shadow: 0 0 16px rgba(255, 214, 107, 0.72);
}
.asteroid-dodge-stage {
  position: relative;
  z-index: 34;
  width: 100vw;
  min-height: 100vh;
  background: rgba(13, 12, 32, 0.72);
  overflow: hidden;
  isolation: isolate;
}
.asteroid-stage-bg {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
  transform: scale(1.04);
  animation: asteroid-bg-drift 12s ease-in-out infinite alternate;
}
.asteroid-dodge-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(
      circle at var(--rocket-x) 78%,
      rgba(255, 214, 107, 0.24),
      transparent 20%
    ),
    linear-gradient(
      180deg,
      rgba(7, 7, 20, 0.18),
      rgba(7, 7, 20, 0.52) 55%,
      rgba(7, 7, 20, 0.8)
    );
}
.asteroid-dodge-hud {
  position: absolute;
  z-index: 5;
  top: max(82px, env(safe-area-inset-top));
  left: clamp(16px, 4vw, 42px);
  right: clamp(16px, 4vw, 42px);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  pointer-events: none;
}
.asteroid-dodge-hud > div:first-child {
  display: grid;
  gap: 4px;
}
.asteroid-dodge-hud span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 1000;
  text-transform: uppercase;
}
.asteroid-dodge-hud strong {
  color: #fff7d8;
  font-family: "Fraunces", serif;
  font-size: clamp(32px, 5vw, 62px);
  font-weight: 500;
  line-height: 0.92;
}
.asteroid-dodge-message {
  position: absolute;
  z-index: 6;
  top: clamp(146px, 20vh, 184px);
  left: 50%;
  width: min(440px, calc(100vw - 34px));
  min-height: 58px;
  display: grid;
  place-items: center;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(13, 12, 32, 0.72);
  color: #fff7d8;
  padding: 13px 18px;
  text-align: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.asteroid-dodge-message.done {
  border-color: rgba(255, 214, 107, 0.5);
  background: rgba(72, 54, 10, 0.62);
}
.asteroid-speed-line {
  position: absolute;
  z-index: 1;
  top: -28%;
  width: 5px;
  height: 130px;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(126, 231, 255, 0.78),
    transparent
  );
  opacity: 0.72;
  animation: asteroid-speed-drop 1.4s linear infinite;
}
.asteroid-speed-line.line-one {
  left: 21%;
}
.asteroid-speed-line.line-two {
  left: 53%;
  animation-delay: 0.45s;
}
.asteroid-speed-line.line-three {
  left: 78%;
  animation-delay: 0.9s;
}
.asteroid-danger-lane {
  position: absolute;
  z-index: 2;
  left: var(--asteroid-x);
  top: clamp(210px, 28vh, 270px);
  bottom: clamp(160px, 22vh, 210px);
  width: clamp(84px, 12vw, 138px);
  transform: translateX(-50%);
  border: 2px dashed rgba(255, 214, 107, 0.32);
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(255, 214, 107, 0.08),
    rgba(255, 101, 86, 0.04)
  );
  box-shadow: 0 0 28px rgba(255, 214, 107, 0.14);
  pointer-events: none;
}
.asteroid-danger-lane span {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(7, 7, 20, 0.72);
  color: #fff4c2;
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.asteroid-safe-lane {
  position: absolute;
  z-index: 2;
  top: clamp(220px, 30vh, 286px);
  bottom: clamp(164px, 23vh, 216px);
  width: clamp(92px, 14vw, 156px);
  border: 2px solid rgba(126, 231, 255, 0.5);
  border-radius: 999px;
  background: rgba(126, 231, 255, 0.08);
  box-shadow:
    0 0 0 7px rgba(126, 231, 255, 0.08),
    0 0 30px rgba(126, 231, 255, 0.22);
  pointer-events: none;
}
.asteroid-safe-lane.left {
  left: 22%;
  transform: translateX(-50%);
}
.asteroid-safe-lane.right {
  right: 22%;
  transform: translateX(50%);
}
.asteroid-safe-lane span {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(7, 7, 20, 0.72);
  color: #9ff0ff;
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.asteroid-dodge-stage.phase-done .asteroid-danger-lane {
  display: none;
}
.asteroid-dodge-stage.phase-done .asteroid-safe-lane,
.asteroid-dodge-stage.phase-bump .asteroid-safe-lane {
  display: none;
}
.asteroid-rock {
  position: absolute;
  z-index: 3;
  left: var(--asteroid-x);
  top: -120px;
  width: clamp(86px, 12vw, 150px);
  height: auto;
  transform: translateX(-50%) rotate(-8deg);
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.42));
  animation: asteroid-hover 1.2s ease-in-out infinite alternate;
}
.asteroid-dodge-stage.phase-falling .asteroid-rock {
  animation: asteroid-drop-full 1.45s cubic-bezier(0.2, 0.72, 0.3, 1) forwards;
}
.asteroid-dodge-stage.phase-bump .asteroid-rock {
  animation: asteroid-bump-pop 0.45s ease-out forwards;
}
.asteroid-dodge-stage.phase-done .asteroid-rock {
  display: none;
}
.asteroid-ship {
  position: absolute;
  z-index: 4;
  left: var(--rocket-x);
  bottom: clamp(110px, 16vh, 150px);
  width: clamp(112px, 15vw, 190px);
  height: auto;
  transform: translateX(-50%) rotate(-45deg);
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.38));
  animation: asteroid-ship-thrum 0.8s ease-in-out infinite alternate;
  transition: left 0.18s ease-out;
}
.asteroid-dodge-controls {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  width: min(520px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  transform: translateX(-50%);
}
.asteroid-dodge-controls button,
.asteroid-dodge-win button {
  min-height: 72px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: var(--accent);
  color: #1b1308;
  font: inherit;
  font-size: 20px;
  font-weight: 1000;
  padding: 14px 22px;
  cursor: pointer;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28);
}
.asteroid-dodge-controls button:disabled,
.asteroid-dodge-win button:disabled {
  cursor: default;
  opacity: 0.52;
}
.asteroid-dodge-win {
  position: absolute;
  z-index: 9;
  left: 50%;
  bottom: clamp(108px, 18vh, 156px);
  width: min(520px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  transform: translateX(-50%);
}
.asteroid-dodge-win button + button {
  background: rgba(13, 12, 32, 0.82);
  color: var(--ink);
}
@keyframes asteroid-drop {
  0% {
    transform: translate(-50%, -40px) scale(0.72);
  }
  72% {
    transform: translate(-50%, 330px) scale(1.08);
  }
  100% {
    transform: translate(-50%, 420px) scale(1.14);
  }
}
@keyframes asteroid-bg-drift {
  0% {
    transform: scale(1.04) translate3d(-1.5%, -1%, 0);
  }
  100% {
    transform: scale(1.08) translate3d(1.5%, 1%, 0);
  }
}
@keyframes asteroid-rocket-float {
  0% {
    transform: translate3d(0, 0, 0) rotate(-45deg);
  }
  100% {
    transform: translate3d(18px, -14px, 0) rotate(-45deg);
  }
}
@keyframes asteroid-opening-rock-one {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(-9deg);
  }
  50% {
    transform: translate3d(-34px, 26px, 0) rotate(18deg);
  }
}
@keyframes asteroid-opening-rock-two {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(14deg);
  }
  50% {
    transform: translate3d(24px, -30px, 0) rotate(-16deg);
  }
}
@keyframes asteroid-hover {
  0% {
    transform: translateX(-50%) rotate(-4deg);
  }
  100% {
    transform: translateX(-50%) rotate(5deg);
  }
}
@keyframes asteroid-ship-thrum {
  0% {
    transform: translateX(-50%) translateY(0) rotate(-45deg);
  }
  100% {
    transform: translateX(-50%) translateY(-6px) rotate(-45deg);
  }
}
@keyframes asteroid-drop-full {
  0% {
    transform: translate(-50%, 0) scale(0.74) rotate(-18deg);
  }
  72% {
    transform: translate(-50%, calc(100vh - 255px)) scale(1.08) rotate(18deg);
  }
  100% {
    transform: translate(-50%, calc(100vh - 178px)) scale(1.14) rotate(28deg);
  }
}
@keyframes asteroid-bump-pop {
  0% {
    transform: translate(-50%, calc(100vh - 190px)) scale(1.12) rotate(20deg);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, calc(100vh - 190px)) scale(1.7) rotate(38deg);
    opacity: 0;
  }
}
@keyframes asteroid-speed-drop {
  0% {
    transform: translateY(0);
    opacity: 0;
  }
  12% {
    opacity: 0.7;
  }
  100% {
    transform: translateY(760px);
    opacity: 0;
  }
}
@media (max-width: 840px) {
  .asteroid-dodge-level {
    align-items: start;
    padding: 78px 14px 20px;
  }
  .asteroid-dodge-opening {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .asteroid-dodge-opening-art {
    min-height: min(46vh, 360px);
    border-radius: 22px;
  }
  .asteroid-dodge-opening-copy {
    justify-items: center;
    text-align: center;
  }
  .asteroid-dodge-opening-copy h1 {
    font-size: clamp(38px, 13vw, 56px);
  }
  .asteroid-dodge-opening-copy p {
    max-width: 330px;
    font-size: 16px;
  }
  .asteroid-begin-button {
    width: min(300px, 100%);
    min-height: 76px;
    font-size: 26px;
  }
  .asteroid-dodge-hud {
    top: max(72px, env(safe-area-inset-top));
    left: 14px;
    right: 14px;
    align-items: center;
  }
  .asteroid-dodge-hud strong {
    font-size: clamp(28px, 9vw, 42px);
  }
  .asteroid-dodge-hud .asteroid-dodge-progress {
    gap: 7px;
  }
  .asteroid-dodge-message {
    top: 164px;
    min-height: 54px;
    font-size: 15px;
  }
  .asteroid-rock {
    width: clamp(72px, 22vw, 104px);
  }
  .asteroid-ship {
    width: clamp(100px, 28vw, 128px);
    bottom: 112px;
  }
  .asteroid-dodge-controls button {
    min-height: 64px;
    font-size: 18px;
  }
  .asteroid-dodge-win {
    bottom: 96px;
  }
  @keyframes asteroid-drop-full {
    0% {
      transform: translate(-50%, 0) scale(0.72) rotate(-18deg);
    }
    72% {
      transform: translate(-50%, calc(100vh - 240px)) scale(1.04) rotate(18deg);
    }
    100% {
      transform: translate(-50%, calc(100vh - 176px)) scale(1.1) rotate(28deg);
    }
  }
}

/* ---------- Launch Countdown mini game ---------- */
.launch-countdown-level {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 82px clamp(16px, 3vw, 36px) 28px;
  background:
    radial-gradient(
      circle at 74% 24%,
      rgba(255, 214, 107, 0.16),
      transparent 32%
    ),
    radial-gradient(
      circle at 22% 72%,
      rgba(255, 103, 72, 0.17),
      transparent 30%
    ),
    linear-gradient(180deg, rgba(7, 7, 20, 0.14), rgba(7, 7, 20, 0.94)), #070714;
}
.launch-countdown-shell {
  position: relative;
  z-index: 34;
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(260px, 0.62fr) minmax(320px, 1fr);
  align-items: center;
  gap: clamp(16px, 4vw, 48px);
}
.launch-countdown-copy {
  display: grid;
  align-content: center;
  gap: 16px;
  min-height: 540px;
}
.launch-countdown-copy > span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 1000;
  text-transform: uppercase;
}
.launch-countdown-copy h1 {
  max-width: 440px;
  color: #fff7d8;
  font-family: "Fraunces", serif;
  font-size: clamp(42px, 6vw, 74px);
  font-weight: 500;
  line-height: 0.92;
}
.launch-countdown-copy p {
  max-width: 390px;
  color: var(--ink-dim);
  font-size: 17px;
  line-height: 1.35;
}
.launch-countdown-message {
  min-height: 78px;
  width: min(390px, 100%);
  display: grid;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(13, 12, 32, 0.76);
  color: #fff7d8;
  padding: 15px 17px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.launch-countdown-progress {
  display: flex;
  gap: 10px;
}
.launch-countdown-progress span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.launch-countdown-progress span.on {
  background: var(--accent);
  box-shadow: 0 0 16px rgba(255, 214, 107, 0.72);
}
.launch-countdown-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.launch-countdown-actions button {
  min-height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(13, 12, 32, 0.76);
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  padding: 12px 18px;
  cursor: pointer;
}
.launch-countdown-actions button:first-child {
  border-color: transparent;
  background: var(--accent);
  color: #1b1308;
}
.launch-countdown-actions button:disabled {
  cursor: default;
  opacity: 0.5;
}
.launch-pad {
  position: relative;
  min-height: 590px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(126, 231, 255, 0.1), transparent 40%),
    radial-gradient(
      circle at 50% 88%,
      rgba(255, 147, 62, 0.18),
      transparent 34%
    ),
    rgba(13, 12, 32, 0.74);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}
.launch-count {
  position: absolute;
  top: 28px;
  left: 50%;
  min-width: 150px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(7, 7, 20, 0.72);
  color: #fff7d8;
  font-family: "Fraunces", serif;
  font-size: 54px;
  line-height: 1;
  text-align: center;
  padding: 14px 26px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}
.launch-count.go {
  background: var(--accent);
  color: #1b1308;
  box-shadow: 0 0 30px rgba(255, 214, 107, 0.6);
}
.launch-rocket {
  width: min(260px, 58vw);
  height: auto;
  transform: rotate(90deg);
  filter: drop-shadow(0 24px 32px rgba(0, 0, 0, 0.42));
  transition:
    transform 0.7s ease,
    opacity 0.4s ease;
}
.launch-fire {
  position: absolute;
  left: 50%;
  bottom: 150px;
  width: 92px;
  height: auto;
  transform: translateX(-50%);
  opacity: 0;
  filter: drop-shadow(0 0 24px rgba(255, 136, 70, 0.6));
}
.launch-pad.launched .launch-rocket {
  transform: translateY(-190px) rotate(90deg) scale(0.86);
}
.launch-pad.launched .launch-fire {
  opacity: 1;
  animation: rocket-flame-flicker 0.14s ease-in-out infinite alternate;
}
.launch-button {
  position: absolute;
  left: 50%;
  bottom: 28px;
  min-width: min(320px, calc(100% - 44px));
  min-height: 82px;
  transform: translateX(-50%);
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #1b1308;
  font: inherit;
  font-size: 26px;
  font-weight: 1000;
  cursor: pointer;
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.32);
}
@media (max-width: 840px) {
  .launch-countdown-level {
    align-items: start;
    padding: 78px 14px 20px;
  }
  .launch-countdown-shell {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .launch-countdown-copy {
    min-height: 0;
    justify-items: center;
    text-align: center;
  }
  .launch-countdown-copy h1 {
    font-size: clamp(34px, 10vw, 50px);
  }
  .launch-pad {
    min-height: 410px;
  }
  .launch-count {
    top: 16px;
    min-width: 118px;
    font-size: 40px;
  }
  .launch-rocket {
    width: min(170px, 50vw);
  }
  .launch-fire {
    bottom: 124px;
    width: 66px;
  }
  .launch-pad.launched .launch-rocket {
    transform: translateY(-126px) rotate(90deg) scale(0.82);
  }
  .launch-button {
    bottom: 18px;
    min-height: 76px;
    font-size: 24px;
  }
}

/* ---------- Mission Control mini game ---------- */
.mission-control-level {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 82px clamp(16px, 3vw, 36px) 28px;
  background:
    radial-gradient(
      circle at 24% 26%,
      rgba(126, 231, 255, 0.17),
      transparent 32%
    ),
    radial-gradient(
      circle at 78% 72%,
      rgba(255, 214, 107, 0.15),
      transparent 30%
    ),
    linear-gradient(180deg, rgba(7, 7, 20, 0.12), rgba(7, 7, 20, 0.94)), #070714;
}
.mission-control-shell {
  position: relative;
  z-index: 34;
  width: min(1060px, 100%);
  display: grid;
  grid-template-columns: minmax(260px, 0.58fr) minmax(320px, 1fr);
  align-items: center;
  gap: clamp(16px, 4vw, 48px);
}
.mission-control-copy {
  display: grid;
  align-content: center;
  gap: 16px;
  min-height: 540px;
}
.mission-control-copy > span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 1000;
  text-transform: uppercase;
}
.mission-control-copy h1 {
  max-width: 440px;
  color: #fff7d8;
  font-family: "Fraunces", serif;
  font-size: clamp(42px, 6vw, 74px);
  font-weight: 500;
  line-height: 0.92;
}
.mission-control-copy p {
  max-width: 390px;
  color: var(--ink-dim);
  font-size: 17px;
  line-height: 1.35;
}
.mission-control-message {
  min-height: 78px;
  width: min(390px, 100%);
  display: grid;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(13, 12, 32, 0.76);
  color: #fff7d8;
  padding: 15px 17px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
}
.mission-control-message.done {
  border-color: rgba(255, 214, 107, 0.5);
  background: rgba(72, 54, 10, 0.58);
}
.mission-control-progress {
  display: flex;
  gap: 10px;
}
.mission-control-progress span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.mission-control-progress span.on {
  background: var(--accent);
  box-shadow: 0 0 16px rgba(255, 214, 107, 0.72);
}
.mission-control-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.mission-control-actions button {
  min-height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(13, 12, 32, 0.76);
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  padding: 12px 18px;
  cursor: pointer;
}
.mission-control-actions button:first-child {
  border-color: transparent;
  background: var(--accent);
  color: #1b1308;
}
.mission-switchboard {
  min-height: 560px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 38%),
    rgba(13, 12, 32, 0.74);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}
.mission-switch {
  min-height: 250px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  background:
    radial-gradient(
      circle at 50% 34%,
      rgba(255, 255, 255, 0.08),
      transparent 48%
    ),
    rgba(255, 255, 255, 0.04);
  color: #fff7d8;
  font: inherit;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}
.mission-switch.target {
  border-color: var(--switch-color);
  box-shadow:
    0 0 0 6px color-mix(in srgb, var(--switch-color) 16%, transparent),
    0 0 28px color-mix(in srgb, var(--switch-color) 38%, transparent);
}
.mission-switch.online {
  border-color: var(--switch-color);
  background:
    radial-gradient(
      circle at 50% 34%,
      color-mix(in srgb, var(--switch-color) 24%, transparent),
      transparent 48%
    ),
    rgba(255, 255, 255, 0.06);
}
.mission-switch.wrong {
  animation: planet-sort-wiggle 0.36s ease-in-out;
}
.mission-switch:disabled {
  cursor: default;
}
.mission-switch-light {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 8px rgba(7, 7, 20, 0.5);
}
.mission-switch.target .mission-switch-light,
.mission-switch.online .mission-switch-light {
  background: var(--switch-color);
  box-shadow:
    inset 0 0 0 8px rgba(7, 7, 20, 0.42),
    0 0 28px color-mix(in srgb, var(--switch-color) 62%, transparent);
}
.mission-switch.target .mission-switch-light {
  animation: mission-light-pulse 0.9s ease-in-out infinite alternate;
}
@keyframes mission-light-pulse {
  from {
    transform: scale(0.94);
  }
  to {
    transform: scale(1.04);
  }
}
.mission-switch strong {
  font-family: "Fraunces", serif;
  font-size: 32px;
  font-weight: 500;
  line-height: 1;
}
.mission-switch small {
  color: var(--ink-dim);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}
@media (max-width: 840px) {
  .mission-control-level {
    align-items: start;
    padding: 78px 14px 20px;
  }
  .mission-control-shell {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .mission-control-copy {
    min-height: 0;
    justify-items: center;
    text-align: center;
  }
  .mission-control-copy h1 {
    font-size: clamp(34px, 10vw, 50px);
  }
  .mission-switchboard {
    min-height: 0;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 10px;
  }
  .mission-switch {
    min-height: 150px;
    gap: 8px;
  }
  .mission-switch-light {
    width: 56px;
    height: 56px;
  }
  .mission-switch strong {
    font-size: 24px;
  }
}

/* ---------- Gravity Jump mini game ---------- */
.gravity-jump-level {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 82px clamp(16px, 3vw, 36px) 28px;
  background:
    radial-gradient(
      circle at 24% 68%,
      rgba(166, 184, 196, 0.16),
      transparent 32%
    ),
    radial-gradient(
      circle at 82% 24%,
      rgba(126, 231, 255, 0.14),
      transparent 30%
    ),
    linear-gradient(180deg, rgba(7, 7, 20, 0.12), rgba(7, 7, 20, 0.94)), #070714;
}
.gravity-jump-shell {
  position: relative;
  z-index: 34;
  width: min(1060px, 100%);
  display: grid;
  grid-template-columns: minmax(260px, 0.58fr) minmax(320px, 1fr);
  align-items: center;
  gap: clamp(16px, 4vw, 48px);
}
.gravity-jump-copy {
  display: grid;
  align-content: center;
  gap: 16px;
  min-height: 540px;
}
.gravity-jump-copy > span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 1000;
  text-transform: uppercase;
}
.gravity-jump-copy h1 {
  max-width: 440px;
  color: #fff7d8;
  font-family: "Fraunces", serif;
  font-size: clamp(42px, 6vw, 74px);
  font-weight: 500;
  line-height: 0.92;
}
.gravity-jump-copy p {
  max-width: 390px;
  color: var(--ink-dim);
  font-size: 17px;
  line-height: 1.35;
}
.gravity-jump-message {
  min-height: 78px;
  width: min(390px, 100%);
  display: grid;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(13, 12, 32, 0.76);
  color: #fff7d8;
  padding: 15px 17px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
}
.gravity-jump-progress {
  display: flex;
  gap: 10px;
}
.gravity-jump-progress span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.gravity-jump-progress span.on {
  background: var(--accent);
  box-shadow: 0 0 16px rgba(255, 214, 107, 0.72);
}
.gravity-jump-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.gravity-jump-actions button {
  min-height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(13, 12, 32, 0.76);
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  padding: 12px 18px;
  cursor: pointer;
}
.gravity-jump-actions button:first-child {
  border-color: transparent;
  background: var(--accent);
  color: #1b1308;
}
.gravity-jump-stage {
  position: relative;
  min-height: 590px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(126, 231, 255, 0.09), transparent 42%),
    radial-gradient(
      ellipse at 50% 86%,
      rgba(180, 188, 196, 0.3),
      transparent 36%
    ),
    rgba(13, 12, 32, 0.74);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}
.gravity-jump-stage.earth {
  background:
    linear-gradient(180deg, rgba(126, 231, 255, 0.13), transparent 42%),
    radial-gradient(
      ellipse at 50% 86%,
      rgba(75, 180, 116, 0.28),
      transparent 36%
    ),
    rgba(13, 12, 32, 0.74);
}
.gravity-world-label {
  position: absolute;
  left: 50%;
  top: 24px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(7, 7, 20, 0.72);
  color: #fff7d8;
  font-size: 15px;
  font-weight: 1000;
  padding: 10px 16px;
}
.gravity-jump-pad {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 112px;
  height: 40px;
  border-radius: 50%;
  background:
    radial-gradient(
      ellipse at center,
      rgba(255, 214, 107, 0.24),
      transparent 62%
    ),
    rgba(255, 255, 255, 0.08);
  transform: perspective(420px) rotateX(62deg);
}
.gravity-astronaut {
  position: absolute;
  left: 50%;
  bottom: 124px;
  width: 126px;
  height: 90px;
  background-image: url("data/sprites/astronaut-flying.png");
  background-size: 504px 270px;
  background-repeat: no-repeat;
  background-position: 0 0;
  transform: translateX(-50%);
  filter: drop-shadow(0 22px 26px rgba(0, 0, 0, 0.38));
  animation: moon-gravity-jump 1.45s ease-in-out both;
}
.gravity-jump-stage.earth .gravity-astronaut {
  animation: earth-gravity-jump 0.75s ease-in-out both;
}
.gravity-jump-controls {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.gravity-jump-controls button {
  min-height: 68px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: var(--accent);
  color: #1b1308;
  font: inherit;
  font-size: 18px;
  font-weight: 1000;
  cursor: pointer;
}
.gravity-jump-controls button:first-child {
  background: linear-gradient(180deg, #7ee7ff, #2c9dff);
  color: #04111c;
}
@keyframes moon-gravity-jump {
  0%,
  100% {
    transform: translate(-50%, 0) rotate(-2deg);
  }
  48% {
    transform: translate(-50%, -210px) rotate(5deg);
  }
}
@keyframes earth-gravity-jump {
  0%,
  100% {
    transform: translate(-50%, 0) rotate(-2deg);
  }
  45% {
    transform: translate(-50%, -92px) rotate(3deg);
  }
}
@media (max-width: 840px) {
  .gravity-jump-level {
    align-items: start;
    padding: 78px 14px 20px;
  }
  .gravity-jump-shell {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .gravity-jump-copy {
    min-height: 0;
    justify-items: center;
    text-align: center;
  }
  .gravity-jump-copy h1 {
    font-size: clamp(34px, 10vw, 50px);
  }
  .gravity-jump-stage {
    min-height: 430px;
  }
  .gravity-astronaut {
    width: 126px;
    height: 90px;
  }
  .gravity-jump-controls button {
    min-height: 62px;
    font-size: 16px;
  }
  @keyframes moon-gravity-jump {
    0%,
    100% {
      transform: translate(-50%, 0) rotate(-2deg);
    }
    48% {
      transform: translate(-50%, -132px) rotate(5deg);
    }
  }
  @keyframes earth-gravity-jump {
    0%,
    100% {
      transform: translate(-50%, 0) rotate(-2deg);
    }
    45% {
      transform: translate(-50%, -62px) rotate(3deg);
    }
  }
}

/* ---------- Story shelf ---------- */
.gravity-jump-stage.moon {
  min-height: 620px;
  border-radius: 26px;
  background:
    radial-gradient(
      circle at 76% 16%,
      rgba(126, 231, 255, 0.24),
      transparent 8%
    ),
    radial-gradient(
      circle at 22% 24%,
      rgba(255, 214, 107, 0.16),
      transparent 24%
    ),
    linear-gradient(
      180deg,
      rgba(8, 12, 32, 0.34) 0%,
      rgba(8, 12, 32, 0.72) 60%,
      rgba(22, 21, 34, 0.94) 100%
    ),
    #070714;
}
.gravity-jump-stage.moon::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 76% 16%,
      #4bb7ff 0 25px,
      #2382d9 26px 43px,
      #eef9ff 44px 45px,
      transparent 46px
    ),
    radial-gradient(
      circle at 30% 28%,
      rgba(255, 255, 255, 0.85) 0 2px,
      transparent 3px
    ),
    radial-gradient(
      circle at 18% 42%,
      rgba(255, 255, 255, 0.65) 0 1.5px,
      transparent 2.5px
    ),
    radial-gradient(
      circle at 56% 20%,
      rgba(255, 255, 255, 0.75) 0 1.5px,
      transparent 2.5px
    ),
    radial-gradient(
      circle at 88% 35%,
      rgba(255, 255, 255, 0.62) 0 1.5px,
      transparent 2.5px
    );
  pointer-events: none;
}
.gravity-earth-rise {
  position: absolute;
  right: 11%;
  top: 9%;
  width: 102px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(
      circle at 36% 28%,
      rgba(255, 255, 255, 0.72),
      transparent 12%
    ),
    radial-gradient(circle at 38% 52%, #79e090 0 17%, transparent 18%),
    radial-gradient(circle at 66% 35%, #79e090 0 13%, transparent 14%),
    linear-gradient(140deg, #4fc3ff, #146bd5);
  box-shadow: 0 0 34px rgba(126, 231, 255, 0.36);
}
.gravity-moon-hills {
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: 80px;
  height: 190px;
  border-radius: 50% 50% 0 0 / 48% 48% 0 0;
  background:
    radial-gradient(
      ellipse at 28% 42%,
      rgba(74, 73, 88, 0.62) 0 26px,
      transparent 27px
    ),
    radial-gradient(
      ellipse at 70% 56%,
      rgba(74, 73, 88, 0.5) 0 20px,
      transparent 21px
    ),
    radial-gradient(
      ellipse at 48% 22%,
      rgba(255, 255, 255, 0.08),
      transparent 36%
    ),
    linear-gradient(180deg, #9d9ba3, #6d6b76 62%, #53515f);
  box-shadow: inset 0 18px 34px rgba(255, 255, 255, 0.16);
}
.gravity-jump-stage.moon .gravity-jump-pad {
  left: 28%;
  right: 28%;
  bottom: 130px;
  height: 48px;
  background:
    radial-gradient(
      ellipse at center,
      rgba(255, 214, 107, 0.28),
      transparent 62%
    ),
    rgba(255, 255, 255, 0.1);
}
.gravity-jump-stage.moon .gravity-astronaut {
  bottom: 150px;
  width: clamp(118px, 18vw, 168px);
  height: clamp(236px, 36vw, 336px);
  background-image: url("data/generated-assets/gravity-jump/astronaut-moon-jump-sheet.png");
  background-size: 600% 100%;
  background-position: 0 0;
  filter: drop-shadow(0 24px 28px rgba(0, 0, 0, 0.34));
  animation:
    moon-jump-path 1.55s cubic-bezier(0.16, 0.72, 0.22, 1) both,
    moon-jump-frames 1.55s steps(5) both;
}
.gravity-float-trail {
  position: absolute;
  left: 50%;
  bottom: 202px;
  width: 220px;
  height: 250px;
  transform: translateX(-50%);
  pointer-events: none;
}
.gravity-float-trail i {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  animation: moon-dust-pop 1.55s ease-out both;
}
.gravity-float-trail i:nth-child(1) {
  left: 30px;
  bottom: 18px;
}
.gravity-float-trail i:nth-child(2) {
  right: 38px;
  bottom: 44px;
  animation-delay: 0.08s;
}
.gravity-float-trail i:nth-child(3) {
  left: 108px;
  bottom: 4px;
  animation-delay: 0.16s;
}
.gravity-jump-stage.moon .gravity-jump-controls {
  bottom: 22px;
  grid-template-columns: 1.4fr 0.8fr;
}
.gravity-jump-stage.moon .gravity-jump-controls button:first-child {
  min-height: 84px;
  background: var(--accent);
  color: #1b1308;
  font-size: 28px;
}
.gravity-jump-stage.moon .gravity-jump-controls button:last-child {
  background: rgba(13, 12, 32, 0.82);
  color: var(--ink);
}
@keyframes moon-jump-frames {
  from {
    background-position-x: 0%;
  }
  to {
    background-position-x: 100%;
  }
}
@keyframes moon-jump-path {
  0% {
    transform: translate(-50%, 0) rotate(-4deg);
  }
  12% {
    transform: translate(-50%, 8px) rotate(-5deg);
  }
  46% {
    transform: translate(-50%, -230px) rotate(7deg);
  }
  72% {
    transform: translate(-50%, -176px) rotate(3deg);
  }
  100% {
    transform: translate(-50%, 0) rotate(0deg);
  }
}
@keyframes moon-dust-pop {
  0%,
  64% {
    transform: translateY(0) scale(0.4);
    opacity: 0;
  }
  72% {
    opacity: 0.9;
  }
  100% {
    transform: translateY(-34px) scale(1.3);
    opacity: 0;
  }
}
@media (max-width: 840px) {
  .gravity-jump-stage.moon {
    min-height: 500px;
  }
  .gravity-earth-rise {
    width: 74px;
    right: 8%;
    top: 10%;
  }
  .gravity-moon-hills {
    bottom: 76px;
    height: 140px;
  }
  .gravity-jump-stage.moon .gravity-astronaut {
    bottom: 128px;
    width: 116px;
    height: 232px;
  }
  .gravity-jump-stage.moon .gravity-jump-controls button:first-child {
    min-height: 72px;
    font-size: 24px;
  }
  @keyframes moon-jump-path {
    0% {
      transform: translate(-50%, 0) rotate(-4deg);
    }
    12% {
      transform: translate(-50%, 8px) rotate(-5deg);
    }
    46% {
      transform: translate(-50%, -138px) rotate(7deg);
    }
    72% {
      transform: translate(-50%, -106px) rotate(3deg);
    }
    100% {
      transform: translate(-50%, 0) rotate(0deg);
    }
  }
}

.gravity-jump-level.full {
  overflow: hidden;
  display: block;
  padding: 0;
  background: #070714;
}
.gravity-full-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--gravity-bg-position, center center);
}
.gravity-jump-level.full::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(
      180deg,
      rgba(4, 5, 18, 0.34) 0%,
      transparent 30%,
      rgba(4, 5, 18, 0.18) 70%,
      rgba(4, 5, 18, 0.48) 100%
    ),
    radial-gradient(
      circle at var(--gravity-x) 70%,
      rgba(255, 214, 107, 0.18),
      transparent 19%
    );
  pointer-events: none;
}
.gravity-jump-shell.full {
  position: relative;
  z-index: 3;
  width: 100vw;
  min-height: 100vh;
  display: block;
}
.gravity-jump-shell.full .gravity-jump-copy {
  position: absolute;
  top: max(86px, env(safe-area-inset-top));
  left: clamp(18px, 4vw, 52px);
  z-index: 5;
  min-height: 0;
  max-width: min(440px, calc(100vw - 36px));
  display: grid;
  gap: 10px;
}
.gravity-jump-shell.full .gravity-jump-copy h1 {
  max-width: 420px;
  font-size: clamp(42px, 6vw, 76px);
}
.gravity-jump-shell.full .gravity-jump-copy p {
  max-width: 390px;
  color: rgba(255, 247, 216, 0.82);
}
.gravity-jump-shell.full .gravity-jump-message {
  min-height: 58px;
  width: min(410px, 100%);
  border-radius: 18px;
  background: rgba(7, 7, 20, 0.68);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.gravity-best-jump {
  width: max-content;
  max-width: 100%;
  border: 1px solid rgba(255, 214, 107, 0.32);
  border-radius: 999px;
  background: rgba(7, 7, 20, 0.62);
  color: #fff7d8;
  font-size: 14px;
  font-weight: 900;
  padding: 9px 13px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.gravity-best-jump strong {
  color: var(--accent);
}
.gravity-pull-meter {
  width: min(390px, 100%);
  display: grid;
  gap: 8px;
  border: 1px solid rgba(126, 231, 255, 0.22);
  border-radius: 16px;
  background: rgba(7, 7, 20, 0.58);
  color: #fff7d8;
  padding: 12px 13px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.gravity-pull-meter div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.gravity-pull-meter span {
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.gravity-pull-meter strong {
  color: #7ee7ff;
  font-size: 14px;
  font-weight: 1000;
}
.gravity-pull-meter i {
  position: relative;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}
.gravity-pull-meter b {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #7ee7ff, var(--accent));
}
.gravity-jump-stage.full {
  position: absolute;
  inset: 0;
  min-height: 100vh;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.gravity-jump-stage.full::before,
.gravity-jump-stage.full .gravity-earth-rise,
.gravity-jump-stage.full .gravity-moon-hills,
.gravity-jump-stage.full .gravity-jump-pad {
  display: none;
}
.gravity-jump-stage.full .gravity-world-label {
  left: var(--gravity-x);
  top: auto;
  bottom: clamp(220px, 28vh, 300px);
  z-index: 5;
  transform: translateX(-50%);
  white-space: nowrap;
  background: rgba(7, 7, 20, 0.74);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.gravity-jump-stage.full .gravity-astronaut {
  left: var(--gravity-x);
  bottom: clamp(82px, 12vh, 118px);
  z-index: 4;
  width: clamp(110px, 12.4vw, 166px);
  aspect-ratio: 420 / 760;
  height: auto;
  display: block;
  background: none;
  background-image: none;
  object-fit: contain;
  animation: gravity-world-jump var(--gravity-time)
    cubic-bezier(0.16, 0.72, 0.22, 1) both;
}
.gravity-jump-stage.full.jupiter .gravity-astronaut {
  animation-timing-function: cubic-bezier(0.34, 0.64, 0.46, 1);
}
.gravity-jump-stage.full .gravity-float-trail {
  left: var(--gravity-x);
  bottom: clamp(160px, 22vh, 214px);
  z-index: 3;
}
.gravity-jump-stage.full .gravity-world-picker {
  position: absolute;
  z-index: 7;
  right: clamp(18px, 4vw, 52px);
  top: max(92px, env(safe-area-inset-top));
  width: min(330px, calc(100vw - 36px));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.gravity-world-picker button {
  min-height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(7, 7, 20, 0.68);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 1000;
  cursor: pointer;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.gravity-world-picker button.on {
  border-color: transparent;
  background: var(--accent);
  color: #1b1308;
}
.gravity-world-picker button.hint:not(.on) {
  border-color: rgba(126, 231, 255, 0.62);
  box-shadow:
    0 0 0 6px rgba(126, 231, 255, 0.1),
    0 0 22px rgba(126, 231, 255, 0.24);
}
.gravity-jump-stage.full .gravity-jump-controls {
  z-index: 8;
  left: 50%;
  right: auto;
  bottom: max(22px, env(safe-area-inset-bottom));
  width: min(620px, calc(100vw - 32px));
  grid-template-columns: 0.62fr 1.28fr 0.62fr 0.86fr;
  transform: translateX(-50%);
}
.gravity-jump-stage.full .gravity-jump-controls .gravity-jump-button {
  min-height: 82px;
  background: var(--accent);
  color: #1b1308;
  font-size: 28px;
}
.gravity-jump-stage.full .gravity-jump-controls .gravity-move-button,
.gravity-jump-stage.full .gravity-jump-controls .gravity-reset-button {
  background: rgba(7, 7, 20, 0.74);
  color: var(--ink);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.gravity-jump-stage.full .gravity-jump-controls .gravity-move-button {
  font-size: 28px;
}
.gravity-key-hint {
  position: absolute;
  z-index: 7;
  left: 50%;
  bottom: max(116px, calc(env(safe-area-inset-bottom) + 116px));
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(7, 7, 20, 0.68);
  color: rgba(255, 247, 216, 0.86);
  font-size: 14px;
  font-weight: 900;
  padding: 9px 14px;
  white-space: nowrap;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.gravity-jump-stage.full .gravity-jump-actions {
  position: absolute;
  z-index: 9;
  left: 50%;
  bottom: max(116px, calc(env(safe-area-inset-bottom) + 116px));
  width: min(520px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: 1fr 1fr;
  transform: translateX(-50%);
}
@keyframes gravity-world-jump {
  0% {
    transform: translate(-50%, 0) scaleX(var(--gravity-facing)) rotate(-4deg);
  }
  12% {
    transform: translate(calc(-50% + var(--gravity-arc-start)), 8px)
      scaleX(var(--gravity-facing)) rotate(-5deg);
  }
  46% {
    transform: translate(
        calc(-50% + var(--gravity-arc)),
        calc(-1 * var(--gravity-jump))
      )
      scaleX(var(--gravity-facing)) rotate(7deg);
  }
  72% {
    transform: translate(
        calc(-50% + var(--gravity-arc-fall)),
        calc(-0.72 * var(--gravity-jump))
      )
      scaleX(var(--gravity-facing)) rotate(3deg);
  }
  100% {
    transform: translate(-50%, 0) scaleX(var(--gravity-facing)) rotate(0deg);
  }
}
@media (max-width: 840px) {
  .gravity-jump-shell.full .gravity-jump-copy {
    top: 74px;
    left: 14px;
    right: 14px;
    justify-items: start;
    text-align: left;
  }
  .gravity-jump-shell.full .gravity-jump-copy h1 {
    font-size: clamp(34px, 10vw, 48px);
  }
  .gravity-jump-shell.full .gravity-jump-copy p {
    display: none;
  }
  .gravity-jump-shell.full .gravity-jump-message {
    width: min(360px, 100%);
    min-height: 52px;
    font-size: 15px;
  }
  .gravity-best-jump {
    font-size: 13px;
    padding: 8px 11px;
  }
  .gravity-jump-stage.full .gravity-world-picker {
    top: auto;
    left: 14px;
    right: 14px;
    bottom: 106px;
    width: auto;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
  }
  .gravity-world-picker button {
    min-height: 52px;
    padding: 0 6px;
    font-size: 13px;
  }
  .gravity-jump-stage.full .gravity-world-label {
    bottom: 238px;
    font-size: 13px;
    padding: 8px 12px;
  }
  .gravity-jump-stage.full .gravity-astronaut {
    bottom: 150px;
    width: 106px;
  }
  .gravity-jump-stage.full .gravity-jump-controls {
    bottom: 18px;
    width: calc(100vw - 28px);
    grid-template-columns: 0.56fr 1.12fr 0.56fr 0.8fr;
    gap: 7px;
  }
  .gravity-jump-stage.full .gravity-jump-controls .gravity-jump-button {
    min-height: 72px;
    font-size: 24px;
  }
  .gravity-jump-stage.full .gravity-jump-controls .gravity-move-button {
    font-size: 22px;
    padding: 0;
  }
  .gravity-jump-stage.full .gravity-jump-controls .gravity-reset-button {
    padding: 0 8px;
    font-size: 14px;
  }
  .gravity-key-hint {
    bottom: 96px;
    font-size: 12px;
    padding: 7px 10px;
  }
}

.story-shelf-page {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 86px 22px 32px;
  background:
    radial-gradient(
      circle at 50% 22%,
      rgba(154, 215, 255, 0.14),
      transparent 36%
    ),
    #070714;
}
.story-shelf-panel {
  position: relative;
  z-index: 36;
  width: min(980px, 100%);
  display: grid;
  gap: 22px;
}
.story-shelf-heading {
  display: grid;
  justify-items: center;
  gap: 7px;
  text-align: center;
}
.story-shelf-heading span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.story-shelf-heading h1 {
  margin: 0;
  color: #fff7d8;
  font-family: "Fraunces", serif;
  font-size: clamp(38px, 6vw, 70px);
  line-height: 0.92;
  letter-spacing: 0;
}
.story-shelf-heading p {
  margin: 0;
  color: var(--ink-dim);
  font-size: 15px;
}
.story-shelf-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.story-shelf-book {
  position: relative;
  min-height: 430px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto auto;
  justify-items: start;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(13, 12, 32, 0.72);
  color: var(--ink);
  padding: 12px;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.story-shelf-book img {
  width: 100%;
  height: auto;
  max-height: 230px;
  display: block;
  align-self: stretch;
  border-radius: 12px;
  object-fit: contain;
  background: #06051a;
}
.story-shelf-book.moon-seed img {
  max-height: 230px;
  object-fit: contain;
}
.story-shelf-icon {
  position: absolute;
  right: 22px;
  top: 22px;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 214, 107, 0.5);
  border-radius: 50%;
  background: rgba(13, 12, 32, 0.82);
  font-size: 27px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}
.story-shelf-book strong {
  color: #fff7d8;
  font-family: "Fraunces", serif;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 0.96;
}
.story-shelf-book small {
  color: var(--ink-dim);
  font-size: 14px;
  line-height: 1.25;
}
.story-shelf-book em {
  margin-top: 4px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 214, 107, 0.14);
  color: var(--accent);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}
.story-shelf-book:focus-visible,
.story-shelf-book:hover {
  border-color: rgba(255, 214, 107, 0.52);
  transform: translateY(-2px);
}
.story-shelf-stage {
  position: relative;
  min-height: min(62svh, 620px);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
  isolation: isolate;
}
.story-shelf-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 52%;
  transform: scale(1.02);
}
.story-shelf-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(7, 7, 20, 0.12), rgba(7, 7, 20, 0.42)),
    radial-gradient(circle at 50% 58%, transparent 30%, rgba(4, 4, 15, 0.3));
  pointer-events: none;
}
.story-shelf-hotspots {
  position: absolute;
  inset: 0;
  z-index: 3;
}
.story-shelf-hotspot {
  position: absolute;
  top: 38.2%;
  width: 12.2%;
  height: 30.8%;
  border: 2px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: transparent;
  cursor: pointer;
  transform-origin: 50% 90%;
}
.story-shelf-hotspot span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.story-shelf-hotspot.star-home {
  left: 13.1%;
}
.story-shelf-hotspot.moon-seed {
  left: 26.2%;
}
.story-shelf-hotspot.comet-hat {
  left: 39%;
}
.story-shelf-hotspot.rocket-pajamas {
  left: 51.7%;
}
.story-shelf-hotspot.saturn-ring {
  left: 64.2%;
}
.story-shelf-hotspot.black-hole-peekaboo {
  left: 76.8%;
}
.story-shelf-hotspot:hover,
.story-shelf-hotspot:focus-visible,
.story-shelf-hotspot.selected {
  border-color: rgba(255, 247, 216, 0.72);
  background: rgba(255, 214, 107, 0.09);
  outline: 0;
  transform: translateY(-7px) rotate(-1deg);
}
.story-pulled-book {
  position: absolute;
  left: 50%;
  bottom: 28px;
  z-index: 5;
  width: min(620px, calc(100% - 44px));
  min-height: 230px;
  display: grid;
  grid-template-columns: minmax(150px, 0.78fr) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 2px solid rgba(255, 247, 216, 0.44);
  border-radius: 18px;
  background:
    linear-gradient(
      135deg,
      rgba(255, 247, 216, 0.18),
      rgba(255, 214, 107, 0.05)
    ),
    rgba(13, 12, 32, 0.9);
  color: var(--ink);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.54);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: story-book-pull 520ms cubic-bezier(0.2, 0.95, 0.22, 1.08) both;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.story-pulled-book:disabled {
  cursor: default;
}
.story-pulled-cover {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 12px;
  background: #080719;
  box-shadow:
    inset -12px 0 24px rgba(0, 0, 0, 0.22),
    0 18px 42px rgba(0, 0, 0, 0.42);
  transform: rotate(-3deg);
}
.story-pulled-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.story-pulled-copy {
  display: grid;
  justify-items: start;
  gap: 8px;
  min-width: 0;
}
.story-pulled-copy span {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 214, 107, 0.16);
  font-size: 26px;
}
.story-pulled-copy strong {
  color: #fff7d8;
  font-family: "Fraunces", serif;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 0.96;
  overflow-wrap: anywhere;
}
.story-pulled-copy small {
  color: var(--ink-dim);
  font-size: 15px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.story-pulled-copy em {
  border-radius: 999px;
  background: rgba(255, 214, 107, 0.14);
  color: var(--accent);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  padding: 7px 11px;
}
.story-pulled-copy .story-open-cue {
  width: auto;
  height: auto;
  display: inline-grid;
  place-items: center;
  min-height: 48px;
  margin-top: 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #1b1308;
  font-size: 16px;
  font-weight: 1000;
  padding: 0 22px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.34);
}
.story-shelf-fallback {
  display: none;
}
@keyframes story-book-pull {
  0% {
    opacity: 0;
    transform: translate(-50%, 74px) scale(0.58) rotate(-7deg);
  }
  72% {
    opacity: 1;
    transform: translate(-50%, -8px) scale(1.03) rotate(1deg);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1) rotate(0);
  }
}

/* ---------- Clickable Story Book ---------- */
.storybook-page {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(
      circle at 52% 36%,
      rgba(255, 214, 107, 0.12),
      transparent 36%
    ),
    #070714;
}
.storybook-close {
  position: fixed;
  left: 24px;
  top: 24px;
  z-index: 44;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: rgba(13, 12, 32, 0.76);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  padding: 14px 22px;
  min-height: 48px;
  cursor: pointer;
  touch-action: manipulation;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.storybook-shell {
  position: relative;
  z-index: 36;
  width: min(880px, calc(100vw - 42px));
  max-height: calc(100svh - 112px);
}
.storybook-empty {
  position: relative;
  z-index: 36;
  width: min(420px, calc(100vw - 42px));
  display: grid;
  gap: 8px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: rgba(11, 10, 30, 0.84);
  color: var(--ink-dim);
  text-align: center;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.34);
}
.storybook-empty strong {
  color: #fff7d8;
  font-size: 20px;
}
.storybook-title {
  margin: 0 0 10px;
  color: #fff7d8;
  font-family: "Fraunces", serif;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1;
  text-align: center;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.55);
}
.storybook-card {
  width: 100%;
  display: grid;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(14, 12, 32, 0.78);
  color: var(--ink);
  padding: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.storybook-card img {
  width: 100%;
  height: auto;
  max-height: min(58svh, 660px);
  display: block;
  border-radius: 12px;
  object-fit: contain;
  background: #06051a;
}
.storybook-shell.moon-seed .storybook-card img {
  max-height: min(58svh, 640px);
}
.storybook-shell.comet-hat .storybook-card img {
  max-height: min(58svh, 640px);
}
.storybook-card p {
  min-height: 78px;
  display: grid;
  place-items: center;
  padding: 0 26px 8px;
  color: #fff7d8;
  font-family: "Fraunces", serif;
  font-size: clamp(28px, 4.2vw, 46px);
  line-height: 1.08;
  letter-spacing: 0;
}
.storybook-big-next {
  width: min(340px, 100%);
  min-height: 58px;
  display: grid;
  place-items: center;
  margin: 12px auto 0;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #1b1308;
  font-family: inherit;
  font-size: 18px;
  font-weight: 1000;
  cursor: pointer;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}
.storybook-counter {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 214, 107, 0.32);
  border-radius: 999px;
  background: rgba(13, 12, 32, 0.74);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  padding: 7px 12px;
}
.storybook-counter strong {
  color: #fff7d8;
  font-size: 13px;
}
.storybook-counter span {
  color: var(--accent);
}
.storybook-character-badge {
  position: absolute;
  left: 16px;
  top: 12px;
  z-index: 3;
  width: clamp(58px, 9vw, 92px);
  aspect-ratio: 1 / 1;
  border: 2px solid rgba(255, 214, 107, 0.58);
  border-radius: 50%;
  overflow: hidden;
  background: rgba(13, 12, 32, 0.76);
  box-shadow:
    0 0 0 5px rgba(13, 12, 32, 0.44),
    0 12px 28px rgba(0, 0, 0, 0.34);
  pointer-events: none;
}
.storybook-character-badge img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 50% 18%;
  transform: scale(1.42);
}
.storybook-nav {
  position: absolute;
  top: 41%;
  z-index: 4;
  width: 60px;
  height: 60px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(13, 12, 32, 0.75);
  color: var(--ink);
  font-size: 40px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.storybook-nav:disabled {
  opacity: 0.32;
  cursor: default;
}
.storybook-nav.prev {
  left: -26px;
}
.storybook-nav.next {
  right: -26px;
}
.storybook-audio-tools {
  position: fixed;
  right: 24px;
  top: 24px;
  z-index: 44;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}
.storybook-audio-tools span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}
.storybook-replay {
  border: 1px solid rgba(255, 214, 107, 0.42);
  border-radius: 999px;
  background: rgba(13, 12, 32, 0.78);
  color: var(--accent);
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  padding: 14px 22px;
  min-height: 48px;
  cursor: pointer;
  touch-action: manipulation;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.storybook-replay:hover {
  background: rgba(28, 24, 56, 0.88);
}
.storybook-close:focus-visible,
.storybook-card:focus-visible,
.storybook-big-next:focus-visible,
.storybook-nav:focus-visible,
.storybook-replay:focus-visible,
.storybook-dots button:focus-visible {
  outline: 3px solid rgba(255, 214, 107, 0.96);
  outline-offset: 4px;
}
.storybook-dots {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 38;
  display: flex;
  gap: 4px;
  transform: translateX(-50%);
}
.storybook-dots button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}
.storybook-dots button::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.32);
}
.storybook-dots button.on::before {
  width: 24px;
  border-radius: 999px;
  background: var(--accent);
}
.storybook-open-book {
  position: relative;
  min-height: min(62svh, 620px);
  grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  overflow: hidden;
  border-radius: 22px;
  background:
    linear-gradient(
      90deg,
      #f4e4bd,
      #fff5d8 48%,
      #debd80 50%,
      #fff5d8 52%,
      #f8e8c4
    ),
    #f7e6c2;
  color: #2a1a0d;
  transform-style: preserve-3d;
}
.storybook-open-book.opening {
  animation: storybook-open-cover 820ms cubic-bezier(0.18, 0.86, 0.22, 1) both;
}
.storybook-page-left,
.storybook-page-right {
  position: relative;
  min-width: 0;
  display: grid;
  place-items: center;
  padding: clamp(8px, 1.5vw, 14px);
  background:
    radial-gradient(
      circle at 30% 18%,
      rgba(255, 255, 255, 0.5),
      transparent 26%
    ),
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.45),
      rgba(246, 222, 179, 0.34)
    );
}
.storybook-page-left {
  border-right: 1px solid rgba(95, 61, 22, 0.16);
}
.storybook-page-right {
  border-left: 1px solid rgba(255, 255, 255, 0.5);
}
.storybook-book-gutter {
  position: relative;
  display: block;
  background: linear-gradient(
    90deg,
    rgba(75, 43, 16, 0.24),
    rgba(255, 255, 255, 0.36),
    rgba(75, 43, 16, 0.28)
  );
  box-shadow:
    inset 7px 0 14px rgba(58, 33, 13, 0.22),
    inset -7px 0 14px rgba(58, 33, 13, 0.18);
}
.storybook-open-book img {
  width: 100%;
  height: 100%;
  max-height: min(58svh, 580px);
  border-radius: 12px;
  object-fit: cover;
  background: #080719;
  box-shadow: 0 14px 38px rgba(52, 30, 12, 0.2);
}
.asset-image-fallback {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  min-height: 24px;
  border-radius: 8px;
  background: rgba(255, 247, 216, 0.16);
  color: inherit;
  font-size: 12px;
  line-height: 1.1;
}
.storybook-image-fallback {
  width: 100%;
  min-height: min(42svh, 360px);
  display: grid;
  place-items: center;
  padding: 18px;
  border: 2px dashed rgba(95, 61, 22, 0.22);
  border-radius: 12px;
  background: rgba(255, 247, 216, 0.56);
  color: #5a3514;
  font-weight: 900;
  text-align: center;
}
.storybook-page-text {
  display: grid;
  place-items: center;
  min-height: 100%;
  color: #2f1d0d;
  font-family: "Fraunces", serif;
  font-size: clamp(30px, 4.2vw, 56px);
  line-height: 1.04;
  text-align: center;
}
@keyframes storybook-open-cover {
  0% {
    opacity: 0;
    transform: perspective(900px) rotateY(-72deg) scale(0.82);
    transform-origin: 0 50%;
  }
  72% {
    opacity: 1;
    transform: perspective(900px) rotateY(8deg) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: perspective(900px) rotateY(0deg) scale(1);
  }
}
.kid-reward-burst {
  position: fixed;
  left: 50%;
  top: 44%;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  width: min(520px, calc(100vw - 32px));
  border-radius: 24px;
  background: rgba(13, 12, 32, 0.84);
  border: 1px solid rgba(255, 214, 107, 0.45);
  color: #fff4c2;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.45);
  animation: kid-reward 1.8s ease both;
  pointer-events: none;
}
.kid-reward-emoji {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  font-size: 36px;
  line-height: 1;
}
.kid-reward-emoji img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.kid-reward-text {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}
.surprise-comet {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 12;
  width: 132px;
  height: 112px;
  border: 0;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.02);
  color: #fff4c2;
  padding: 0;
  cursor: pointer;
  filter: drop-shadow(0 0 18px rgba(118, 216, 255, 0.58));
  animation: comet-fly 5.8s cubic-bezier(0.18, 0.7, 0.26, 1) both;
}
.surprise-comet img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
@keyframes kid-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
}
@keyframes treasure-waiting-pulse {
  from {
    transform: translateY(0) scale(1) rotate(-3deg);
    filter: drop-shadow(0 0 16px rgba(255, 214, 107, 0.35));
  }
  to {
    transform: translateY(-8px) scale(1.12) rotate(5deg);
    filter: drop-shadow(0 0 28px rgba(255, 214, 107, 0.85));
  }
}
@keyframes kid-float {
  0%,
  100% {
    transform: translateY(0) rotate(-4deg);
  }
  50% {
    transform: translateY(-10px) rotate(7deg);
  }
}
@keyframes sticker-selected-wiggle {
  0%,
  100% {
    transform: translate(-50%, -50%) rotate(-4deg) scale(1.04);
  }
  50% {
    transform: translate(-50%, -50%) rotate(5deg) scale(1.12);
  }
}
@keyframes sticker-float {
  0%,
  100% {
    transform: translate(-50%, -50%) translateY(0) rotate(-3deg);
  }
  50% {
    transform: translate(-50%, -50%) translateY(-6px) rotate(4deg);
  }
}
@keyframes treasure-bob {
  0%,
  100% {
    transform: translateY(0) scale(1) rotate(-3deg);
  }
  50% {
    transform: translateY(-12px) scale(1.06) rotate(5deg);
  }
}
@keyframes kid-reward {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.72);
  }
  16%,
  72% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -70%) scale(0.92);
  }
}
@keyframes comet-fly {
  0% {
    opacity: 0;
    transform: translate3d(-160px, 18vh, 0) rotate(-10deg) scale(0.82);
  }
  12% {
    opacity: 1;
  }
  38% {
    transform: translate3d(32vw, 8vh, 0) rotate(-3deg) scale(1);
  }
  68% {
    transform: translate3d(66vw, 24vh, 0) rotate(8deg) scale(1.04);
  }
  100% {
    opacity: 0.92;
    transform: translate3d(calc(100vw + 180px), 46vh, 0) rotate(16deg)
      scale(0.9);
  }
}
@keyframes planet-boop {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    filter: none;
  }
  44% {
    transform: translate(-50%, -50%) scale(1.08) rotate(-2deg);
    filter: brightness(1.18) drop-shadow(0 0 24px rgba(255, 214, 107, 0.45));
  }
  70% {
    transform: translate(-50%, -50%) scale(0.98) rotate(1deg);
  }
}
@keyframes astronaut-wave {
  0%,
  100% {
    filter: drop-shadow(0 4px 12px rgba(255, 180, 80, 0.55));
  }
  35% {
    filter: drop-shadow(0 4px 18px rgba(154, 215, 255, 0.9));
  }
  55% {
    transform: rotate(10deg) scale(1.1);
  }
}

/* ---------- Detail view ---------- */
.detail-view {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  z-index: 20;
  animation: fade-in 0.5s ease;
}
.detail-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.detail-planet-wrap.sun-wrap .planet-canvas-detail {
  -webkit-mask-image: radial-gradient(
    circle at 50% 50%,
    #000 0%,
    #000 46%,
    rgba(0, 0, 0, 0.78) 48%,
    transparent 52%
  );
  mask-image: radial-gradient(
    circle at 50% 50%,
    #000 0%,
    #000 46%,
    rgba(0, 0, 0, 0.78) 48%,
    transparent 52%
  );
}
.detail-hint {
  margin-top: 16px;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
}

.detail-planet-wrap {
  position: absolute;
  left: 32%;
  top: 50%;
  transform: translate(-50%, -50%);
  animation: detail-enter 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-view[data-narrow="1"] .detail-planet-wrap {
  left: 50%;
  top: 38%;
}
.detail-planet-wrap.boop {
  animation: planet-boop 0.44s cubic-bezier(0.2, 0.9, 0.2, 1);
}
.detail-planet-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 180%;
  height: 180%;
  transform: translate(-50%, -50%);
  filter: blur(60px);
  pointer-events: none;
}

.detail-info {
  position: absolute;
  right: clamp(24px, 5vw, 80px);
  top: clamp(28px, 7vh, 80px);
  width: clamp(320px, 32vw, 460px);
  max-height: calc(100vh - clamp(60px, 12vh, 140px));
  overflow-y: auto;
  padding-right: 6px;
  animation: info-slide 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) 0.15s both;
}
.detail-info::-webkit-scrollbar {
  width: 4px;
}
.detail-info::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.detail-eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  font-weight: 600;
  margin-bottom: 12px;
}
.detail-name {
  font-family: "Fraunces", serif;
  font-size: 96px;
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin-bottom: 22px;
  text-wrap: balance;
}
.detail-favorite-badge {
  width: fit-content;
  margin: -12px 0 16px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 214, 107, 0.32);
  border-radius: 999px;
  background: rgba(255, 214, 107, 0.12);
  color: #fff2b5;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.02em;
}
.detail-blurb {
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-dim);
  margin-bottom: 20px;
  text-wrap: pretty;
  max-width: 380px;
}
.kid-i-spy {
  display: inline-flex;
  max-width: 390px;
  margin: 0 0 16px;
  padding: 9px 13px;
  border: 1px solid rgba(154, 215, 255, 0.35);
  border-radius: 999px;
  background: rgba(154, 215, 255, 0.12);
  color: #ccecff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}

/* ---------- Helmet Lab ---------- */
.helmet-lab-view {
  overflow: hidden;
}
.helmet-lab-view .detail-name {
  font-size: clamp(54px, 8vw, 92px);
}
.helmet-lab-bg {
  background:
    radial-gradient(
      circle at 30% 45%,
      rgba(118, 216, 255, 0.2),
      transparent 48%
    ),
    radial-gradient(
      circle at 70% 65%,
      rgba(255, 214, 107, 0.13),
      transparent 45%
    );
}
.helmet-lab-preview {
  position: absolute;
  left: 31%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(44vw, 520px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
.helmet-rotate-btn {
  position: absolute;
  top: 50%;
  z-index: 12;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(13, 12, 32, 0.68);
  color: var(--ink);
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  transform: translateY(-50%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.helmet-rotate-btn.prev {
  left: -62px;
}
.helmet-rotate-btn.next {
  right: -62px;
}
.helmet-side-label {
  position: absolute;
  left: 50%;
  bottom: 2%;
  z-index: 12;
  transform: translateX(-50%);
  padding: 6px 14px;
  border: 1px solid rgba(154, 215, 255, 0.35);
  border-radius: 999px;
  background: rgba(13, 12, 32, 0.68);
  color: #d8f2ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.helmet-lab-suit {
  position: relative;
  width: 92%;
  height: 92%;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 26px 70px rgba(0, 0, 0, 0.45));
  transition:
    transform 0.32s ease,
    filter 0.32s ease;
}
.helmet-lab-suit.side-front {
  transform: scale(1);
}
.helmet-lab-suit.side-right {
  transform: scale(1.05);
}
.helmet-lab-suit.side-left {
  transform: scale(1.05);
}
.helmet-lab-suit.side-back {
  transform: scale(1.08);
}
.helmet-lab-base {
  position: absolute;
  width: 96%;
  height: auto;
  object-fit: contain;
  z-index: 3;
}
.helmet-lab-suit.side-back .helmet-lab-ear {
  display: none;
}
.helmet-lab-suit.side-right .helmet-lab-sticker,
.helmet-lab-suit.side-left .helmet-lab-sticker {
  width: clamp(34px, 4.3vw, 52px);
  height: clamp(34px, 4.3vw, 52px);
}
.helmet-lab-suit.side-back .helmet-lab-sticker {
  width: clamp(40px, 5vw, 64px);
  height: clamp(40px, 5vw, 64px);
}
.helmet-lab-shell {
  position: absolute;
  width: 90%;
  aspect-ratio: 1.18;
  top: 8%;
  border-radius: 50% 50% 42% 42%;
  background: transparent;
  z-index: 4;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.helmet-lab-shell:active {
  cursor: grabbing;
}
.helmet-lab-visor {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}
.helmet-lab-sticker {
  position: absolute;
  width: clamp(40px, 5vw, 64px);
  height: clamp(40px, 5vw, 64px);
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--ink);
  padding: 0;
  font-family: inherit;
  font-size: clamp(28px, 4.4vw, 52px);
  line-height: 1;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
  animation: sticker-float 2.8s ease-in-out infinite;
  z-index: 5;
  transform: translate(-50%, -50%);
  cursor: pointer;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
}
.helmet-lab-sticker::before {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: 24px;
}
.helmet-lab-sticker img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.helmet-lab-sticker.selected {
  outline: 2px solid rgba(255, 214, 107, 0.95);
  outline-offset: 4px;
  background: rgba(255, 214, 107, 0.1);
  animation: sticker-selected-wiggle 1.05s ease-in-out infinite;
}
.helmet-lab-sticker.dragging {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.08);
  animation: none;
  z-index: 8;
}
.helmet-lab-choice {
  touch-action: none;
}
.helmet-lab-sticker.asset {
  object-fit: contain;
}
.helmet-lab-ear {
  position: absolute;
  top: 45%;
  width: 13%;
  height: 20%;
  border-radius: 999px;
  background: var(--suit-accent, #76d8ff);
  opacity: 0.45;
  z-index: 2;
  display: none;
}
.helmet-lab-ear.left {
  left: 2%;
}
.helmet-lab-ear.right {
  right: 2%;
}
.helmet-lab-neck {
  position: absolute;
  left: 32%;
  right: 32%;
  bottom: 13%;
  height: 22%;
  border-radius: 34px;
  background: linear-gradient(180deg, var(--suit-accent, #76d8ff), #26304c);
  z-index: 1;
}
.helmet-lab-backpack {
  position: absolute;
  left: 10%;
  top: 51%;
  width: 28%;
  height: 32%;
  display: grid;
  place-items: center;
  border-radius: 30% 22% 28% 34%;
  background:
    radial-gradient(
      circle at 30% 26%,
      rgba(255, 255, 255, 0.28),
      transparent 26%
    ),
    linear-gradient(145deg, var(--suit-accent, #76d8ff), #26304c 72%);
  border: 3px solid rgba(255, 255, 255, 0.5);
  box-shadow: inset -12px -16px 24px rgba(0, 0, 0, 0.25);
  z-index: 4;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
}
.helmet-lab-suit.placement-helmet .helmet-lab-backpack {
  opacity: 0;
  transform: translateX(-18%) scale(0.72);
  pointer-events: none;
}
.helmet-lab-backpack-strap {
  position: absolute;
  inset: 16% -22% 16% auto;
  width: 40%;
  border: 4px solid rgba(255, 255, 255, 0.25);
  border-left: 0;
  border-radius: 0 999px 999px 0;
}
.helmet-lab-backpack-sticker {
  width: 60%;
  height: 60%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.42));
  animation: kid-float 2.8s ease-in-out infinite;
}
.helmet-lab-backpack-sticker.glyph {
  display: grid;
  place-items: center;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
}
.helmet-lab-backpack-sticker.sticker-art-fallback {
  display: grid;
  place-items: center;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
}
.helmet-lab-info {
  top: 50%;
  max-height: min(78vh, 620px);
  padding-right: 8px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.helmet-lab-section {
  margin-top: 14px;
}
.helmet-lab-label {
  margin-bottom: 8px;
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.helmet-lab-note {
  margin: -2px 0 10px;
  color: var(--ink-dim);
  font-size: 12px;
  line-height: 1.35;
}
.helmet-side-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  margin: 0 0 10px;
  padding: 7px 10px;
  border: 1px solid rgba(154, 215, 255, 0.26);
  border-radius: 999px;
  background: rgba(154, 215, 255, 0.1);
  color: #d8f2ff;
  font-size: 12px;
}
.helmet-side-status span {
  color: rgba(216, 242, 255, 0.72);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.helmet-side-status strong {
  font-weight: 800;
}
.helmet-side-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.helmet-side-tools .placement-choice:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.helmet-lab-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}
.helmet-lab-choice {
  min-height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  cursor: pointer;
}
.helmet-lab-choice span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-size: 30px;
  line-height: 1;
}
.helmet-lab-choice span img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.helmet-lab-choice small {
  color: var(--ink-dim);
  font-size: 10px;
}
.helmet-lab-choice.on {
  background: rgba(255, 214, 107, 0.2);
  border-color: rgba(255, 214, 107, 0.62);
}
.placement-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.placement-choice {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.placement-choice.on {
  background: rgba(154, 215, 255, 0.18);
  border-color: rgba(154, 215, 255, 0.62);
  color: #d8f2ff;
}
.helmet-lab-flying-sticker {
  position: fixed;
  z-index: 120;
  width: clamp(72px, 8vw, 110px);
  height: clamp(72px, 8vw, 110px);
  display: grid;
  place-items: center;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: sticker-fly-to-helmet 0.72s cubic-bezier(0.16, 0.86, 0.24, 1)
    forwards;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.45));
}
.helmet-lab-flying-sticker img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.helmet-lab-flying-sticker span {
  font-size: clamp(48px, 7vw, 84px);
  line-height: 1;
}
@keyframes sticker-fly-to-helmet {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.45) rotate(-12deg);
  }
  14% {
    opacity: 1;
  }
  62% {
    transform: translate(
        calc(-50% + var(--fly-x) * 0.72),
        calc(-50% + var(--fly-y) * 0.72 - 70px)
      )
      scale(1.18) rotate(10deg);
  }
  100% {
    opacity: 1;
    transform: translate(calc(-50% + var(--fly-x)), calc(-50% + var(--fly-y)))
      scale(0.9) rotate(0deg);
  }
}
.suit-color-row {
  display: flex;
  gap: 10px;
}
.suit-color-choice {
  width: 42px;
  height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background:
    linear-gradient(
      135deg,
      var(--suit-color),
      var(--suit-color) 56%,
      var(--suit-accent) 57%
    ),
    var(--suit-color);
  cursor: pointer;
}
.suit-color-choice.on {
  border-color: #fff4c2;
  box-shadow: 0 0 0 4px rgba(255, 214, 107, 0.22);
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
}
.stat {
  padding: 14px 16px;
  background: rgba(14, 12, 32, 0.6);
  backdrop-filter: blur(8px);
}
.stat-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  font-weight: 500;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.stat-value {
  font-size: 15px;
  color: var(--ink);
  font-weight: 500;
}

.detail-composition {
  padding: 14px 16px;
  background: rgba(14, 12, 32, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}
.comp-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  font-weight: 500;
  margin-bottom: 6px;
}
.comp-value {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.4;
}

.gravity-play-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-top: 14px;
  padding: 15px;
  border: 1px solid color-mix(in srgb, var(--planet-color) 38%, transparent);
  border-radius: 12px;
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--planet-color) 18%, transparent),
      rgba(14, 12, 32, 0.74)
    ),
    rgba(14, 12, 32, 0.68);
  backdrop-filter: blur(8px);
}
.gravity-play-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.gravity-play-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  font-weight: 600;
}
.gravity-play-copy strong {
  font-size: 15px;
  line-height: 1.3;
  color: var(--ink);
}
.gravity-play-copy span {
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink-dim);
}
.gravity-weight-control {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
  min-width: 112px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink-dim);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.gravity-weight-control span {
  grid-column: 1 / -1;
}
.gravity-weight-control input {
  width: 72px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(5, 4, 20, 0.72);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  letter-spacing: 0;
}
.gravity-weight-control small {
  color: var(--ink-faint);
  font-size: 11px;
  text-transform: none;
}
.gravity-jump-meter {
  grid-column: 1 / -1;
  position: relative;
  height: 48px;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}
.gravity-jump-meter span {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  max-height: 100%;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(255, 214, 107, 0.1),
    rgba(255, 214, 107, 0.45)
  );
}
.gravity-jump-meter b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.age-play-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-top: 10px;
  padding: 14px 15px;
  border: 1px solid rgba(154, 215, 255, 0.24);
  border-radius: 12px;
  background: rgba(14, 12, 32, 0.62);
  backdrop-filter: blur(8px);
}
.age-play-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.age-play-copy strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.3;
}
.age-control {
  min-width: 104px;
}
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 8px;
  margin-top: 16px;
}

/* Detail nav */
.detail-close {
  position: absolute;
  top: 24px;
  left: 28px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(12px);
  border-radius: 100px;
  padding: 9px 14px 9px 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  font-family: inherit;
  transition:
    background 0.2s,
    color 0.2s,
    border-color 0.2s,
    transform 0.2s,
    opacity 0.2s,
    box-shadow 0.2s,
    filter 0.2s;
}
.detail-close:hover {
  background: rgba(40, 36, 80, 0.85);
  color: var(--accent);
  border-color: rgba(255, 214, 107, 0.4);
}
.detail-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(12px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 30;
  transition:
    background 0.2s,
    color 0.2s,
    border-color 0.2s,
    transform 0.2s,
    opacity 0.2s,
    box-shadow 0.2s,
    filter 0.2s;
}
.detail-nav.prev {
  left: 28px;
  top: auto;
  bottom: 28px;
}
.detail-nav.next {
  left: 84px;
  top: auto;
  bottom: 28px;
}
.detail-nav:hover {
  background: rgba(40, 36, 80, 0.85);
  color: var(--accent);
  border-color: rgba(255, 214, 107, 0.4);
}

/* ---------- Tweaks helpers ---------- */
.tw-jump-btn {
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s,
    transform 0.15s,
    opacity 0.15s,
    box-shadow 0.15s,
    filter 0.15s;
}
.tw-jump-btn:hover {
  background: rgba(255, 214, 107, 0.18);
  color: var(--accent);
  border-color: rgba(255, 214, 107, 0.4);
}

/* ---------- Astronaut flight ---------- */
.astronaut-flight {
  position: fixed;
  width: 126px;
  height: 90px;
  background-image: url("data/sprites/astronaut-flying.png");
  background-size: 504px 270px; /* 4 cols × 126 = 504, 3 rows × 90 = 270 */
  background-repeat: no-repeat;
  background-position: 0 0;
  pointer-events: none;
  z-index: 26;
  transform-origin: center center;
  filter: drop-shadow(0 4px 12px rgba(255, 180, 80, 0.55));
  will-change: transform, left, top, opacity;
}
.astronaut-flight.waving {
  animation: astronaut-wave 0.9s ease-in-out;
}
.home-astronaut-dragger {
  position: fixed;
  z-index: 42;
  width: 126px;
  height: 116px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #fff7d8;
  transform: translate(-50%, -50%);
  cursor: grab;
  touch-action: none;
  user-select: none;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.38));
}
.home-astronaut-dragger.dragging {
  cursor: grabbing;
  z-index: 80;
}
.home-astronaut-sprite {
  position: absolute;
  left: 0;
  top: 8px;
  width: 126px;
  height: 90px;
  background-image: url("data/sprites/astronaut-flying.png");
  background-size: 504px 270px;
  background-position: var(--idle-x, 0) 0;
  transform: rotate(var(--fly-rotate, -14deg)) scale(1.04);
  pointer-events: none;
  transition: filter 0.16s ease;
  animation: astronaut-zero-g-bob 3.8s ease-in-out infinite;
}
.home-astronaut-dragger.dragging .home-astronaut-sprite {
  background-position: 0 0;
  animation: none;
  filter: drop-shadow(0 0 18px rgba(255, 214, 107, 0.58));
}
.home-astronaut-dragger.over-planet .home-astronaut-sprite {
  filter: drop-shadow(0 0 22px rgba(126, 231, 255, 0.9));
}
@keyframes astronaut-zero-g-bob {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -7px;
  }
}
.home-astronaut-dragger .suit-color-glow {
  left: 34px;
  top: 40px;
  pointer-events: none;
}
.home-astronaut-dragger .astronaut-sticker-overlay {
  pointer-events: none;
}
.home-astronaut-hint {
  position: absolute;
  left: 50%;
  bottom: 0;
  padding: 6px 10px;
  border: 1px solid rgba(255, 214, 107, 0.46);
  border-radius: 999px;
  background: rgba(13, 12, 32, 0.78);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
}
.astronaut-name-tag {
  position: absolute;
  left: 50%;
  top: -6px;
  max-width: 132px;
  padding: 5px 9px;
  border: 1px solid rgba(126, 231, 255, 0.46);
  border-radius: 999px;
  background: rgba(13, 12, 32, 0.8);
  color: #d8f6ff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: translateX(-50%);
  pointer-events: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(10px);
}
.astronaut-name-tag.flight {
  top: -16px;
  width: max-content;
}
.suit-color-glow {
  position: absolute;
  left: 28px;
  top: 38px;
  width: 58px;
  height: 36px;
  border-radius: 50%;
  background: var(--suit-accent, #76d8ff);
  mix-blend-mode: screen;
  opacity: 0.2;
  pointer-events: none;
}

.astronaut-sticker-overlay {
  position: absolute;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  pointer-events: none;
  font-size: 22px;
  line-height: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.45));
}
.astronaut-sticker-overlay img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.astronaut-sticker-overlay.helmet {
  top: 4px;
  left: 50%;
  transform: translateX(-50%) rotate(0deg);
}
.astronaut-sticker-overlay.backpack {
  left: 28px;
  top: 44px;
  transform: rotate(-10deg);
  width: 34px;
  height: 34px;
}

/* ---------- Helmet picker ---------- */
.helmet-picker {
  position: fixed;
  top: 84px;
  right: 28px;
  z-index: 60;
  width: 240px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.5);
  color: var(--ink);
  animation: fade-in 0.18s ease-out;
}
.helmet-picker-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
  color: var(--ink-dim);
}
.helmet-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.helmet-sticker {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  transition:
    background 0.12s,
    color 0.12s,
    border-color 0.12s,
    transform 0.12s,
    opacity 0.12s,
    box-shadow 0.12s,
    filter 0.12s;
}
.helmet-sticker:hover {
  background: rgba(255, 214, 107, 0.12);
  border-color: rgba(255, 214, 107, 0.4);
}
.helmet-sticker.on {
  background: rgba(255, 214, 107, 0.22);
  border-color: var(--accent);
  color: var(--accent);
}
.helmet-sticker-glyph {
  font-size: 22px;
  line-height: 1;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
}
.helmet-sticker-glyph img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.helmet-sticker-label {
  font-size: 10px;
  color: var(--ink-dim);
}
.helmet-sticker.on .helmet-sticker-label {
  color: var(--accent);
}
.helmet-picker-close {
  width: 100%;
  margin-top: 10px;
  background: rgba(255, 214, 107, 0.18);
  color: var(--accent);
  border: 1px solid rgba(255, 214, 107, 0.4);
  border-radius: 999px;
  padding: 7px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.helmet-picker-close:hover {
  background: rgba(255, 214, 107, 0.28);
}

/* ---------- Constellation drawing ---------- */
.constellation-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}
.constellation-draw {
  position: fixed;
  inset: 0;
  z-index: 30;
  cursor: pointer;
  background: rgba(8, 6, 24, 0.18);
}
.constellation-draw-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.constellation-toolbar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--ink);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}
.constellation-tip {
  font-size: 12px;
  color: var(--ink-dim);
  margin-right: 4px;
}
@media (max-width: 720px) {
  .constellation-toolbar {
    left: 14px;
    right: 14px;
    bottom: 14px;
    transform: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-radius: 18px;
  }
  .constellation-tip {
    grid-column: 1 / -1;
    margin-right: 0;
    text-align: center;
  }
  .constellation-toolbar button {
    min-height: 48px;
  }
  .constellation-toolbar .btn-tour {
    grid-column: 1 / -1;
  }
}
.constellation-clear-btn {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 40;
  background: rgba(14, 12, 32, 0.7);
  color: var(--ink-dim);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}
.constellation-clear-btn:hover {
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 900px) {
  .header {
    padding: 16px;
    flex-direction: column;
    gap: 12px;
    background: linear-gradient(
      180deg,
      rgba(5, 4, 20, 0.78) 0%,
      rgba(5, 4, 20, 0.46) 72%,
      transparent 100%
    );
  }
  .subtitle {
    max-width: 260px;
    line-height: 1.35;
  }
  .field-journal {
    grid-template-columns: 1fr;
    gap: 7px;
    align-items: start;
    border-radius: 14px;
  }
  .field-journal-worlds {
    flex-wrap: wrap;
  }
  .actions {
    max-width: 100%;
    justify-content: flex-start;
  }
  .action-menu {
    position: fixed;
    left: 12px;
    right: 12px;
    top: max(86px, env(safe-area-inset-top));
    width: auto;
    max-height: calc(100vh - 112px);
    overflow-y: auto;
  }
  .hint {
    bottom: 92px;
    width: calc(100vw - 32px);
    text-align: center;
    line-height: 1.45;
  }
  .kid-panel.active {
    left: 14px;
    right: 14px;
    bottom: 14px;
    flex-direction: column;
    align-items: flex-start;
  }
  .kid-panel.active .kid-mission {
    width: 100%;
  }
  .treasure-hud {
    left: 14px;
    right: 14px;
    top: 14px;
    grid-template-columns: 1fr auto;
    gap: 10px;
  }
  .treasure-title-block {
    grid-column: 1 / -1;
    order: 2;
  }
  .treasure-title {
    font-size: 38px;
  }
  .treasure-subtitle {
    font-size: 12px;
  }
  .treasure-count {
    min-width: 96px;
  }
  .treasure-next-card {
    left: 14px;
    top: 150px;
    max-width: calc(100vw - 28px);
    grid-template-columns: auto 36px minmax(0, auto);
    gap: 7px;
    padding: 7px 10px;
  }
  .treasure-next-card img {
    width: 36px;
    height: 36px;
  }
  .treasure-next-card strong {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .treasure-level .kid-star-button {
    width: 68px;
    height: 68px;
  }
  .treasure-tap-helper {
    width: 68px;
    height: 68px;
  }
  .treasure-tap-helper span {
    margin-bottom: -30px;
    font-size: 12px;
    padding: 7px 10px;
  }
  .treasure-progress {
    bottom: 72px;
  }
  .treasure-tray {
    bottom: 14px;
    max-width: calc(100vw - 28px);
    gap: 5px;
    border-radius: 18px;
  }
  .treasure-tray-item {
    width: 38px;
    height: 38px;
  }
  .treasure-complete {
    padding: 18px;
  }
  .treasure-complete strong {
    font-size: 23px;
    text-align: center;
  }
  .storybook-close {
    left: 14px;
    top: 14px;
    padding: 12px 18px;
    min-height: 48px;
  }
  .storybook-shell {
    width: min(96vw, 560px);
    max-height: calc(100svh - 92px);
    overflow-y: auto;
    padding: 2px 0 6px;
    scrollbar-width: none;
  }
  .storybook-shell::-webkit-scrollbar {
    display: none;
  }
  .storybook-card {
    padding: 10px;
    gap: 10px;
    border-radius: 14px;
  }
  .storybook-card img {
    border-radius: 10px;
    max-height: 46svh;
  }
  .storybook-shell.moon-seed .storybook-card img {
    max-height: 44svh;
  }
  .storybook-character-badge {
    left: 12px;
    top: 10px;
    width: 54px;
  }
  .storybook-card p {
    min-height: 92px;
    padding: 0 10px 6px;
    font-size: clamp(25px, 7vw, 38px);
  }
  .storybook-big-next {
    min-height: 56px;
    margin-top: 10px;
    font-size: 17px;
  }
  .storybook-nav {
    top: 38%;
    width: 52px;
    height: 52px;
    font-size: 34px;
  }
  .storybook-nav.prev {
    left: 8px;
  }
  .storybook-nav.next {
    right: 8px;
  }
  .storybook-audio-tools {
    right: 14px;
    top: 14px;
  }
  .storybook-replay {
    padding: 12px 18px;
    min-height: 48px;
  }
  .storybook-dots {
    bottom: 12px;
  }
  .story-shelf-page {
    place-items: start center;
    padding: 76px 14px 20px;
  }
  .story-shelf-panel {
    gap: 16px;
  }
  .story-shelf-heading h1 {
    font-size: 46px;
  }
  .story-shelf-heading p {
    max-width: 280px;
    font-size: 13px;
  }
  .story-shelf-stage {
    min-height: min(620px, calc(100svh - 116px));
    border-radius: 18px;
  }
  .story-shelf-art {
    object-position: 50% 44%;
  }
  .story-shelf-hotspot {
    top: 36.8%;
    width: 12.8%;
    height: 27%;
  }
  .story-shelf-hotspot.star-home {
    left: 12.7%;
  }
  .story-shelf-hotspot.moon-seed {
    left: 25.9%;
  }
  .story-shelf-hotspot.comet-hat {
    left: 38.9%;
  }
  .story-shelf-hotspot.rocket-pajamas {
    left: 51.7%;
  }
  .story-shelf-hotspot.saturn-ring {
    left: 64.1%;
  }
  .story-shelf-hotspot.black-hole-peekaboo {
    left: 76.6%;
  }
  .story-pulled-book {
    bottom: 16px;
    width: calc(100% - 24px);
    min-height: 0;
    grid-template-columns: 118px 1fr;
    gap: 12px;
    padding: 12px;
  }
  .story-pulled-copy {
    gap: 6px;
  }
  .story-pulled-copy span {
    width: 38px;
    height: 38px;
    font-size: 22px;
  }
  .story-pulled-copy strong {
    font-size: 26px;
  }
  .story-pulled-copy small {
    font-size: 13px;
  }
  .story-open-cue {
    min-height: 42px;
    font-size: 14px;
    padding: 0 16px;
  }
  .storybook-open-book {
    min-height: min(58svh, 520px);
    grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr);
    padding: 0;
  }
  .storybook-book-gutter {
    display: block;
  }
  .storybook-page-left {
    min-height: 0;
    border-right: 1px solid rgba(95, 61, 22, 0.16);
    border-bottom: 0;
    padding: 7px;
  }
  .storybook-page-right {
    border-left: 1px solid rgba(255, 255, 255, 0.5);
    padding: 9px;
  }
  .storybook-open-book img {
    max-height: min(48svh, 380px);
  }
  .storybook-page-text {
    font-size: clamp(22px, 5.8vw, 34px);
  }
  .story-shelf-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .story-shelf-book {
    min-height: 0;
    grid-template-columns: 112px 1fr;
    grid-template-rows: auto auto auto;
    align-items: center;
    column-gap: 12px;
    padding: 10px;
  }
  .story-shelf-book img {
    grid-row: 1 / 4;
    max-height: 112px;
    object-fit: contain;
  }
  .story-shelf-book strong {
    font-size: 28px;
  }
  .story-shelf-book small {
    font-size: 13px;
  }
  .story-shelf-book em {
    margin-top: 0;
  }
  .story-shelf-icon {
    right: auto;
    left: 78px;
    top: 18px;
    width: 42px;
    height: 42px;
    font-size: 22px;
  }
  .rocket-pack-level {
    display: block;
    padding: 68px 14px 14px;
    overflow-y: auto;
  }
  .rocket-pack-back {
    left: 14px;
    top: 14px;
    padding: 10px 14px;
  }
  .rocket-builder-stage {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .rocket-build-pad {
    min-height: 300px;
    border-radius: 20px;
  }
  .rocket-build-ship {
    width: 178px;
    height: 300px;
    transform: scale(1.13);
    margin-top: -18px;
  }
  .rocket-nose-img {
    width: 92px;
  }
  .rocket-body-img {
    top: 62px;
    width: 98px;
  }
  .rocket-fins-img {
    top: 172px;
    width: 148px;
  }
  .rocket-window-img {
    top: 92px;
    width: 46px;
  }
  .rocket-engine-img {
    top: 208px;
    width: 70px;
  }
  .rocket-fuel-tank-img {
    top: 146px;
    width: 46px;
    margin-left: -54px;
  }
  .rocket-fuel-pipes-img {
    top: 168px;
    width: 92px;
  }
  .rocket-igniter-img {
    top: 214px;
    width: 34px;
    margin-left: 40px;
  }
  .rocket-booster-img {
    top: 78px;
    width: 176px;
  }
  .rocket-antenna-img {
    top: -34px;
    width: 64px;
  }
  .rocket-badge-img {
    top: 138px;
    width: 42px;
    margin-left: 30px;
  }
  .rocket-nose {
    width: 82px;
    height: 82px;
  }
  .rocket-body {
    top: 78px;
    width: 88px;
    height: 126px;
  }
  .rocket-window {
    top: 25px;
    width: 46px;
    height: 46px;
    border-width: 4px;
  }
  .rocket-fins {
    top: 178px;
    width: 118px;
    height: 54px;
  }
  .rocket-fins span {
    width: 40px;
    height: 54px;
  }
  .rocket-flame {
    top: 242px;
    width: 128px;
    height: auto;
  }
  .rocket-pack-copy {
    gap: 8px;
  }
  .rocket-pack-copy h1 {
    font-size: 42px;
  }
  .rocket-pack-copy p {
    font-size: 13px;
  }
  .pack-next-choice {
    width: 100%;
    min-height: 118px;
    grid-template-columns: 76px 1fr;
    padding: 12px;
  }
  .rocket-part-icon {
    width: 70px;
    height: 70px;
  }
  .pack-next-choice strong {
    font-size: 24px;
  }
  .rocket-pack-done {
    grid-template-columns: 1fr;
  }
  .helmet-lab-preview {
    left: 50%;
    top: 25%;
    width: min(76vw, 38svh, 300px);
  }
  .helmet-lab-info {
    top: auto;
    left: 16px;
    right: 16px;
    bottom: 12px;
    width: auto;
    max-height: 48vh;
    overflow-x: hidden;
  }
  .helmet-lab-view .detail-name {
    font-size: 42px;
    line-height: 0.95;
    margin-bottom: 14px;
  }
  .helmet-lab-view .kid-i-spy {
    margin-bottom: 4px;
  }
  .helmet-lab-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .helmet-rotate-btn {
    width: 52px;
    height: 52px;
  }
  .detail-name {
    font-size: 48px;
  }
  .detail-info {
    width: auto;
    left: 5%;
    right: 5%;
    top: auto;
    bottom: 16px;
    transform: none;
    max-height: 50vh;
  }
  .detail-blurb {
    font-size: 14px;
    margin-bottom: 18px;
    max-width: none;
  }
  .stat-grid {
    margin-bottom: 12px;
  }
  .stat {
    padding: 10px 12px;
  }
  .stat-value {
    font-size: 13px;
  }
  .gravity-play-card {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 10px;
    padding: 12px;
  }
  .gravity-weight-control {
    grid-template-columns: auto 74px auto;
  }
  .gravity-weight-control span {
    grid-column: auto;
  }
  .gravity-jump-meter {
    height: 40px;
  }
  .age-play-card {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }
  .detail-nav.prev {
    bottom: auto;
    top: 24px;
    left: auto;
    right: 80px;
  }
  .detail-nav.next {
    bottom: auto;
    top: 24px;
    left: auto;
    right: 28px;
  }
}

@media (max-width: 900px) and (max-height: 700px) {
  .helmet-lab-preview {
    top: 21%;
    width: min(70vw, 32svh, 260px);
  }
  .helmet-lab-info {
    max-height: 56svh;
  }
  .helmet-lab-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }
  .helmet-lab-choice {
    min-height: 50px;
  }
  .helmet-lab-choice span {
    width: 32px;
    height: 32px;
    font-size: 24px;
  }
  .helmet-lab-choice small {
    display: none;
  }
  .helmet-rotate-btn.prev {
    left: 2px;
  }
  .helmet-rotate-btn.next {
    right: 2px;
  }
}

/* ---------- Black hole level ---------- */
.bh-level {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: #000;
  cursor: grab;
  animation: fade-in 0.4s ease;
}
.bh-level:active {
  cursor: grabbing;
}
.bh-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.bh-loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  z-index: 100;
  transition: opacity 0.6s;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: rgba(244, 241, 232, 0.6);
}
.bh-loading.hide {
  opacity: 0;
  pointer-events: none;
}

.bh-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 32;
}
.bh-title {
  position: absolute;
  top: 28px;
  left: 32px;
  font-family: "Fraunces", serif;
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.8);
  color: #f4f1e8;
}
.bh-subtitle {
  margin-top: 4px;
  font-size: 12px;
  font-family: "Inter", sans-serif;
  font-weight: 400;
  color: rgba(244, 241, 232, 0.55);
  letter-spacing: 0.02em;
}
.bh-stats {
  position: absolute;
  bottom: 24px;
  left: 32px;
  font-size: 11px;
  color: rgba(244, 241, 232, 0.5);
  letter-spacing: 0.04em;
  line-height: 1.8;
}
.bh-stats b {
  color: rgba(244, 241, 232, 0.85);
  font-weight: 500;
  margin-right: 6px;
}

.bh-btn-back-floating {
  position: fixed;
  top: 26px;
  right: 32px;
  z-index: 33;
  background: rgba(0, 0, 0, 0.45);
  color: rgba(244, 241, 232, 0.92);
  border: 1px solid rgba(244, 241, 232, 0.18);
  border-radius: 999px;
  padding: 8px 18px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s,
    transform 0.15s,
    opacity 0.15s,
    box-shadow 0.15s,
    filter 0.15s;
}
.bh-btn-back-floating:hover {
  background: rgba(0, 0, 0, 0.65);
  border-color: rgba(244, 241, 232, 0.4);
}

.bh-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  justify-content: center;
  color: var(--ink-dim);
  font-size: 14px;
}

.bh-finished {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 3, 18, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 34;
  animation: fade-in 0.5s ease;
}
.bh-finished-card {
  background: linear-gradient(
    180deg,
    rgba(28, 16, 40, 0.96),
    rgba(8, 4, 22, 0.96)
  );
  border: 1px solid rgba(255, 170, 80, 0.35);
  border-radius: 24px;
  padding: 36px 44px;
  text-align: center;
  max-width: 460px;
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(255, 130, 60, 0.18);
  animation: detail-enter 0.5s ease;
}
.bh-finished-emoji {
  font-size: 56px;
  margin-bottom: 8px;
}
.bh-finished h1 {
  font-family: "Fraunces", serif;
  font-size: 38px;
  font-weight: 400;
  color: #ffd9a8;
  margin-bottom: 6px;
  letter-spacing: 0.005em;
}
.bh-finished p {
  color: var(--ink-dim);
  margin-bottom: 24px;
  font-size: 15px;
}
.bh-finished-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.bh-btn-primary {
  background: #ffb066;
  color: #2a1408;
  border: none;
  border-radius: 999px;
  padding: 10px 24px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s,
    transform 0.15s,
    opacity 0.15s,
    box-shadow 0.15s,
    filter 0.15s;
}
.bh-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(255, 176, 102, 0.45);
}
.bh-btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 10px 22px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s,
    transform 0.15s,
    opacity 0.15s,
    box-shadow 0.15s,
    filter 0.15s;
}
.bh-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.3);
}

@media (max-width: 900px) {
  .bh-title {
    top: 16px;
    left: 18px;
    font-size: 22px;
  }
  .bh-subtitle {
    font-size: 11px;
  }
  .bh-stats {
    bottom: 16px;
    left: 18px;
    font-size: 10px;
  }
  .bh-btn-back-floating {
    top: 14px;
    right: 16px;
    padding: 6px 14px;
    font-size: 11px;
  }
  .bh-finished-card {
    padding: 28px 22px;
    max-width: 92vw;
  }
  .bh-finished h1 {
    font-size: 30px;
  }
}

/* ---------- Maze level ---------- */
.btn-maze {
  background: linear-gradient(
    135deg,
    rgba(120, 220, 255, 0.18),
    rgba(255, 140, 220, 0.18)
  );
  color: #e8f4ff;
  border: 1px solid rgba(150, 220, 255, 0.4);
  border-radius: 999px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition:
    background 0.2s,
    color 0.2s,
    border-color 0.2s,
    transform 0.2s,
    opacity 0.2s,
    box-shadow 0.2s,
    filter 0.2s;
}
.btn-maze:hover {
  background: linear-gradient(
    135deg,
    rgba(120, 220, 255, 0.3),
    rgba(255, 140, 220, 0.3)
  );
  border-color: rgba(150, 220, 255, 0.7);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(120, 220, 255, 0.25);
}

.maze-level {
  position: fixed;
  inset: 0;
  z-index: 30;
  animation: fade-in 0.3s ease;
}
.maze-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.maze-planets-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 31;
}
.maze-planet {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 35%,
    color-mix(in srgb, var(--planet-color, #ffd66b) 80%, white),
    var(--planet-color, #ffd66b) 65%,
    color-mix(in srgb, var(--planet-color, #ffd66b) 60%, black) 100%
  );
  transform-origin: center center;
  will-change: transform, opacity;
  transition: opacity 0.45s ease;
  filter: drop-shadow(0 0 14px var(--glow, #ffd66b));
}
.maze-planet::after {
  content: "";
  position: absolute;
  inset: -18%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--glow, #ffd66b) 38%, transparent) 0%,
    transparent 65%
  );
  z-index: -1;
  animation: maze-planet-pulse 2.4s ease-in-out infinite;
}
.maze-planet.next {
  filter: drop-shadow(0 0 18px var(--glow, #ffd66b))
    drop-shadow(0 0 28px rgba(255, 214, 107, 0.52));
}
.maze-planet.next::before {
  content: "";
  position: absolute;
  inset: -28%;
  border: 2px solid rgba(255, 214, 107, 0.62);
  border-radius: 50%;
  animation: target-ring-pulse 1.25s ease-in-out infinite;
  pointer-events: none;
}
.maze-planet-canvas {
  width: 100%;
  height: 100%;
  display: block;
}
@keyframes maze-planet-pulse {
  0%,
  100% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

.maze-hud-top {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 8px 14px 8px 8px;
  z-index: 32;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.maze-btn-back {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 12px 18px;
  min-height: 44px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  letter-spacing: 0.02em;
  transition:
    background 0.16s cubic-bezier(0.22, 0.61, 0.36, 1),
    color 0.16s cubic-bezier(0.22, 0.61, 0.36, 1),
    border-color 0.16s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.16s cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 0.16s cubic-bezier(0.22, 0.61, 0.36, 1),
    box-shadow 0.16s cubic-bezier(0.22, 0.61, 0.36, 1),
    filter 0.16s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.maze-btn-back:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}
.maze-btn-back:active {
  transform: translateY(0) scale(0.97);
}
.maze-counter {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-family: "Fraunces", serif;
}
.maze-counter-num {
  font-size: 26px;
  font-weight: 500;
  color: var(--accent);
  line-height: 1;
}
.maze-counter-sep {
  font-size: 18px;
  color: var(--ink-faint);
}
.maze-counter-total {
  font-size: 18px;
  color: var(--ink-dim);
}
.maze-counter-label {
  font-family: "Inter", sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  margin-left: 4px;
}
.maze-icons {
  display: flex;
  gap: 6px;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}
.maze-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid;
  transition:
    background 0.4s,
    color 0.4s,
    border-color 0.4s,
    transform 0.4s,
    opacity 0.4s,
    box-shadow 0.4s,
    filter 0.4s;
}
.maze-icon.found {
  transform: scale(1.15);
  box-shadow: 0 0 10px currentColor;
}
.maze-next-card {
  position: absolute;
  left: 50%;
  top: auto;
  bottom: 82px;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 34px minmax(0, auto) auto;
  align-items: center;
  gap: 9px;
  padding: 10px 16px;
  border: 2px solid rgba(154, 215, 255, 0.42);
  border-radius: 999px;
  background: rgba(13, 12, 32, 0.68);
  color: var(--ink);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.28);
  max-width: calc(100vw - 48px);
  transform: translateX(-50%);
  pointer-events: none;
}
.maze-next-card span {
  color: #7ee7ff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.maze-next-card strong {
  font-size: 20px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.maze-next-card em {
  color: var(--ink-dim);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}
.maze-next-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.maze-hint {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  color: #fff7d8;
  font-weight: 900;
  letter-spacing: 0;
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 10px 18px;
  z-index: 32;
  pointer-events: none;
  max-width: calc(100vw - 32px);
  line-height: 1.3;
  text-align: center;
}

.maze-toast {
  position: absolute;
  top: 32%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-family: "Fraunces", serif;
  font-size: 36px;
  letter-spacing: 0.01em;
  background: rgba(14, 12, 32, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 14px 28px;
  z-index: 33;
  pointer-events: none;
  animation: toast-pop 2.6s ease forwards;
  white-space: nowrap;
}
.maze-toast-text {
  color: var(--ink-dim);
  font-size: 22px;
  font-weight: 300;
}
.maze-toast-name {
  font-weight: 500;
  text-shadow: 0 0 24px currentColor;
}
.maze-toast-emoji {
  font-size: 28px;
}
@keyframes toast-pop {
  0% {
    opacity: 0;
    transform: translateX(-50%) scale(0.8) translateY(8px);
  }
  18% {
    opacity: 1;
    transform: translateX(-50%) scale(1.05) translateY(0);
  }
  28% {
    transform: translateX(-50%) scale(1) translateY(0);
  }
  82% {
    opacity: 1;
    transform: translateX(-50%) scale(1) translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) scale(0.96) translateY(-12px);
  }
}

.maze-victory {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 4, 20, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 34;
  animation: fade-in 0.4s ease;
}
.maze-victory-card {
  background: linear-gradient(
    180deg,
    rgba(20, 18, 44, 0.95),
    rgba(10, 8, 28, 0.95)
  );
  border: 1px solid rgba(255, 214, 107, 0.3);
  border-radius: 24px;
  padding: 40px 48px;
  text-align: center;
  max-width: 460px;
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(255, 214, 107, 0.15);
  animation: detail-enter 0.5s ease;
}
.maze-victory-emoji {
  font-size: 64px;
  margin-bottom: 12px;
  animation: rocket-bob 1.6s ease-in-out infinite;
}
@keyframes rocket-bob {
  0%,
  100% {
    transform: translateY(0) rotate(-4deg);
  }
  50% {
    transform: translateY(-8px) rotate(4deg);
  }
}
.maze-victory h1 {
  font-family: "Fraunces", serif;
  font-size: 42px;
  font-weight: 400;
  color: var(--accent);
  margin-bottom: 8px;
  letter-spacing: 0.005em;
}
.maze-victory p {
  color: var(--ink-dim);
  margin-bottom: 24px;
  font-size: 15px;
}
.maze-victory-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
}
.maze-victory-planet {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.4);
  animation: vp-pop 0.6s ease backwards;
}
.maze-victory-planet:nth-child(1) {
  animation-delay: 0.05s;
}
.maze-victory-planet:nth-child(2) {
  animation-delay: 0.12s;
}
.maze-victory-planet:nth-child(3) {
  animation-delay: 0.19s;
}
.maze-victory-planet:nth-child(4) {
  animation-delay: 0.26s;
}
.maze-victory-planet:nth-child(5) {
  animation-delay: 0.33s;
}
.maze-victory-planet:nth-child(6) {
  animation-delay: 0.4s;
}
.maze-victory-planet:nth-child(7) {
  animation-delay: 0.47s;
}
@keyframes vp-pop {
  from {
    opacity: 0;
    transform: scale(0.4);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.maze-victory-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.maze-btn-primary {
  background: var(--accent);
  color: #1a1108;
  border: none;
  border-radius: 999px;
  padding: 16px 28px;
  min-height: 56px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  letter-spacing: 0.02em;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s,
    transform 0.15s,
    opacity 0.15s,
    box-shadow 0.15s,
    filter 0.15s;
}
.maze-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(255, 214, 107, 0.4);
}
.maze-btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 16px 26px;
  min-height: 56px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  letter-spacing: 0.02em;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s,
    transform 0.15s,
    opacity 0.15s,
    box-shadow 0.15s,
    filter 0.15s;
}
.maze-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.3);
}

@media (max-width: 900px) {
  .helmet-rotate-btn {
    width: 52px;
    height: 52px;
  }
  .helmet-rotate-btn.prev {
    left: -8px;
  }
  .helmet-rotate-btn.next {
    right: -8px;
  }
  .maze-next-card {
    left: 50%;
    top: auto;
    bottom: 78px;
    right: auto;
    grid-template-columns: auto 28px minmax(82px, 1fr) auto;
    gap: 7px;
    width: min(296px, calc(100vw - 32px));
    padding: 7px 11px;
  }
  .maze-next-card strong {
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
  }
  .maze-hint {
    bottom: 10px;
    white-space: normal;
  }
}

.maze-joy {
  position: fixed;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 214, 107, 0.4);
  background: rgba(14, 12, 32, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 33;
  pointer-events: none;
}
.maze-joy-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  margin-left: -22px;
  margin-top: -22px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 35%,
    rgba(255, 255, 255, 0.9),
    rgba(255, 214, 107, 0.9)
  );
  box-shadow: 0 4px 14px rgba(255, 214, 107, 0.5);
  transition: transform 0.05s linear;
}

@media (max-width: 900px) {
  .maze-hud-top {
    top: 10px;
    gap: 10px;
    padding: 6px 10px 6px 6px;
  }
  .maze-icons {
    display: none;
  }
  .maze-counter-num {
    font-size: 22px;
  }
  .maze-victory-card {
    padding: 28px 24px;
    max-width: 92vw;
  }
  .maze-victory h1 {
    font-size: 32px;
  }
  .maze-toast {
    max-width: calc(100vw - 32px);
    white-space: normal;
    text-align: center;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 26px;
    padding: 10px 20px;
  }
  .maze-toast-text {
    font-size: 16px;
  }
}

/* ===========================================================================
   GARGANTUA v2 — HUD, telemetry, captions, share bar, particle overlay
   =========================================================================== */

.bh-particle-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: screen;
}

.bh-panel {
  position: fixed;
  top: 86px;
  right: 18px;
  width: 280px;
  background: rgba(8, 11, 22, 0.62);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(120, 200, 255, 0.18);
  border-radius: 14px;
  padding: 0;
  z-index: 6;
  font-family: "Inter", system-ui, sans-serif;
  color: rgba(220, 235, 255, 0.92);
  box-shadow:
    0 12px 40px rgba(0, 8, 24, 0.55),
    inset 0 0 0 1px rgba(120, 200, 255, 0.06);
  transition:
    width 0.25s ease,
    opacity 0.2s ease;
}
.bh-panel-hidden {
  width: 200px;
}
.bh-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: rgba(120, 200, 255, 0.75);
  border-bottom: 1px solid rgba(120, 200, 255, 0.12);
}
.bh-panel-toggle {
  background: transparent;
  border: 1px solid rgba(120, 200, 255, 0.25);
  color: rgba(120, 200, 255, 0.9);
  width: 26px;
  height: 22px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}
.bh-panel-toggle:hover {
  background: rgba(120, 200, 255, 0.12);
}
.bh-panel-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bh-slider-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bh-slider-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(220, 235, 255, 0.78);
}
.bh-slider-val {
  font-feature-settings: "tnum";
  color: rgba(120, 200, 255, 0.95);
  font-weight: 500;
}
.bh-slider {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    rgba(120, 200, 255, 0.35) 0%,
    rgba(120, 200, 255, 0.1) 100%
  );
  outline: none;
}
.bh-slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(120, 200, 255, 1);
  border: 2px solid rgba(8, 11, 22, 0.9);
  box-shadow: 0 0 12px rgba(120, 200, 255, 0.6);
  cursor: pointer;
}
.bh-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(120, 200, 255, 1);
  border: 2px solid rgba(8, 11, 22, 0.9);
  cursor: pointer;
}

.bh-presets {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.bh-presets-label,
.bh-q-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(120, 200, 255, 0.7);
}
.bh-preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.bh-preset-btn {
  background: rgba(15, 22, 38, 0.55);
  border: 1px solid rgba(120, 200, 255, 0.18);
  color: rgba(220, 235, 255, 0.9);
  padding: 7px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.08s;
}
.bh-preset-btn:hover {
  background: rgba(120, 200, 255, 0.12);
  border-color: rgba(120, 200, 255, 0.45);
}
.bh-preset-btn:active {
  transform: scale(0.97);
}
.bh-preset-num {
  font-size: 9px;
  color: rgba(255, 165, 90, 0.85);
  letter-spacing: 0.12em;
}
.bh-preset-name {
  font-size: 11px;
  letter-spacing: 0.02em;
}

.bh-quality {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.bh-q-label {
  flex: 0 0 auto;
}
.bh-q-btn {
  flex: 1;
  background: rgba(15, 22, 38, 0.55);
  border: 1px solid rgba(120, 200, 255, 0.18);
  color: rgba(220, 235, 255, 0.85);
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 0.04em;
}
.bh-q-active {
  background: rgba(120, 200, 255, 0.22);
  border-color: rgba(120, 200, 255, 0.6);
  color: rgba(255, 255, 255, 0.98);
}
.bh-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: rgba(220, 235, 255, 0.85);
  cursor: pointer;
}
.bh-toggle-row input {
  accent-color: rgb(120, 200, 255);
}

.bh-telemetry {
  position: fixed;
  left: 18px;
  bottom: 22px;
  width: 280px;
  background: rgba(8, 11, 22, 0.62);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(120, 200, 255, 0.18);
  border-radius: 12px;
  padding: 10px 14px 12px;
  z-index: 6;
  font-family: "Inter", system-ui, sans-serif;
  color: rgba(220, 235, 255, 0.92);
  font-feature-settings: "tnum";
}
.bh-tel-title {
  font-size: 10px;
  letter-spacing: 0.22em;
  color: rgba(120, 200, 255, 0.75);
  margin-bottom: 6px;
}
.bh-tel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 16px;
}
.bh-tel-grid > div {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  border-bottom: 1px dotted rgba(120, 200, 255, 0.12);
  padding: 2px 0;
}
.bh-tel-grid b {
  color: rgba(180, 220, 255, 0.7);
  font-weight: 400;
}
.bh-tel-grid span {
  color: rgba(255, 220, 180, 0.95);
}

.bh-caption {
  position: fixed;
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
  max-width: 640px;
  width: 90%;
  z-index: 7;
  pointer-events: none;
  animation: bhCaptionIn 0.45s ease-out;
}
.bh-caption-inner {
  background: rgba(8, 11, 22, 0.78);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 165, 90, 0.3);
  border-radius: 10px;
  padding: 12px 18px;
  font-family: "Fraunces", serif;
  font-size: 17px;
  line-height: 1.4;
  color: rgba(255, 245, 230, 0.96);
  text-align: center;
}
@keyframes bhCaptionIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.bh-look-label {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translateY(80px);
  z-index: 5;
  pointer-events: none;
  width: 320px;
  text-align: center;
  animation: bhLookIn 0.5s ease-out;
}
.bh-look-title {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.32em;
  color: rgba(120, 220, 255, 0.85);
  text-shadow: 0 0 16px rgba(120, 220, 255, 0.6);
}
.bh-look-body {
  margin-top: 4px;
  font-family: "Fraunces", serif;
  font-size: 14px;
  line-height: 1.4;
  color: rgba(230, 245, 255, 0.85);
}
@keyframes bhLookIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.bh-fact {
  position: fixed;
  top: 86px;
  left: 18px;
  max-width: 320px;
  z-index: 6;
  background: rgba(8, 11, 22, 0.62);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 165, 90, 0.25);
  border-radius: 10px;
  padding: 10px 14px;
  animation: bhFactIn 0.5s ease-out;
}
.bh-fact-tag {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: rgba(255, 165, 90, 0.85);
  margin-bottom: 4px;
}
.bh-fact-body {
  font-family: "Fraunces", serif;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(230, 245, 255, 0.95);
}
@keyframes bhFactIn {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.bh-egg {
  position: fixed;
  bottom: 22px;
  right: 22px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid rgba(255, 200, 120, 0.6);
  z-index: 8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: bhEggPulse 2s ease-in-out infinite;
}
.bh-egg-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 200, 120, 0.95);
  box-shadow: 0 0 12px rgba(255, 200, 120, 0.8);
}
@keyframes bhEggPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.18);
    opacity: 1;
  }
}

.bh-sharebar {
  position: fixed;
  top: 72px;
  right: 18px;
  display: flex;
  gap: 6px;
  z-index: 34;
}
.bh-share-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(8, 11, 22, 0.62);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(120, 200, 255, 0.22);
  color: rgba(220, 235, 255, 0.9);
  font-size: 18px;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.08s;
}
.bh-share-btn:hover {
  background: rgba(120, 200, 255, 0.18);
}
.bh-share-btn:active {
  transform: scale(0.94);
}
.bh-share-rec {
  background: rgba(255, 80, 80, 0.4);
  border-color: rgba(255, 80, 80, 0.8);
  color: rgba(255, 255, 255, 0.98);
  animation: bhRecBlink 1s ease-in-out infinite;
}
@keyframes bhRecBlink {
  0%,
  100% {
    background: rgba(255, 80, 80, 0.4);
  }
  50% {
    background: rgba(255, 80, 80, 0.7);
  }
}

.bh-watermark {
  position: fixed;
  right: 12px;
  bottom: 4px;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 9px;
  letter-spacing: 0.32em;
  color: rgba(120, 200, 255, 0.35);
  pointer-events: none;
  z-index: 4;
}

@media (max-width: 720px) {
  .bh-btn-back-floating {
    right: 18px;
  }
  .bh-sharebar {
    left: 18px;
    right: auto;
    top: 72px;
  }
  .bh-panel {
    width: calc(100vw - 36px);
    right: 18px;
    top: auto;
    bottom: 78px;
    max-height: 56vh;
    overflow-y: auto;
  }
  .bh-telemetry {
    width: calc(100vw - 36px);
    left: 18px;
    bottom: 12px;
  }
  .bh-fact {
    max-width: calc(100vw - 36px);
  }
}

/* ---------- Sun's life-cycle flipbook ---------- */
.lifecycle-launch {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 35;
  background: rgba(20, 14, 6, 0.62);
  border: 1px solid rgba(255, 214, 107, 0.35);
  color: #ffe9a8;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    background 0.2s,
    transform 0.2s,
    box-shadow 0.2s;
}
.lifecycle-launch:hover {
  background: rgba(50, 30, 8, 0.78);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(255, 180, 60, 0.25);
}

.lifecycle-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background-color: #02010a;
  background-image: radial-gradient(
    ellipse at 50% 50%,
    rgba(20, 6, 2, 0.85) 0%,
    rgba(2, 1, 8, 0.97) 70%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: fade-in 0.4s ease;
  overflow: hidden;
}

.lifecycle-stage {
  position: relative;
  width: min(82vw, 560px);
  height: min(82vw, 560px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lifecycle-sun {
  position: absolute;
  border-radius: 50%;
  transition:
    width 0.7s cubic-bezier(0.4, 0, 0.2, 1),
    height 0.7s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.7s ease,
    box-shadow 0.7s ease,
    opacity 0.5s ease;
}

.lifecycle-orbit-dot {
  position: absolute;
  border-radius: 50%;
  transition:
    opacity 0.6s ease,
    transform 0.7s ease;
  pointer-events: none;
}
.lifecycle-orbit-dot.mercury {
  width: 6px;
  height: 6px;
  background: #a89078;
  box-shadow: 0 0 6px rgba(168, 144, 120, 0.6);
}
.lifecycle-orbit-dot.venus {
  width: 9px;
  height: 9px;
  background: #d8a45a;
  box-shadow: 0 0 8px rgba(216, 164, 90, 0.6);
}
.lifecycle-orbit-dot.earth {
  width: 9px;
  height: 9px;
  background: #5b8fd3;
  box-shadow: 0 0 8px rgba(91, 143, 211, 0.6);
}

.lifecycle-nebula {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.7s ease;
}

/* --- Frame 1: baby star inside dust cloud --- */
.lifecycle-frame-1 .lifecycle-sun {
  width: 70px;
  height: 70px;
  background: radial-gradient(
    circle at 50% 50%,
    #ffb16a 0%,
    #c44a1f 60%,
    #4a1208 100%
  );
  box-shadow:
    0 0 36px 6px rgba(255, 120, 60, 0.6),
    0 0 100px 30px rgba(220, 80, 40, 0.25);
  opacity: 0.92;
}
.lifecycle-frame-1 .lifecycle-nebula {
  opacity: 1;
  background:
    radial-gradient(
      circle at 30% 40%,
      rgba(255, 140, 200, 0.35) 0%,
      transparent 35%
    ),
    radial-gradient(
      circle at 70% 60%,
      rgba(180, 120, 220, 0.32) 0%,
      transparent 38%
    ),
    radial-gradient(
      circle at 50% 50%,
      rgba(80, 30, 60, 0.4) 0%,
      transparent 70%
    );
  filter: blur(6px);
}

/* --- Frame 2: young main sequence --- */
.lifecycle-frame-2 .lifecycle-sun {
  width: 130px;
  height: 130px;
  background: radial-gradient(
    circle at 50% 50%,
    #ffffff 0%,
    #fff4c2 50%,
    #ffae3a 100%
  );
  box-shadow:
    0 0 60px 10px rgba(255, 240, 180, 0.7),
    0 0 160px 40px rgba(255, 200, 100, 0.35);
}

/* --- Frame 3: today's Sun --- */
.lifecycle-frame-3 .lifecycle-sun {
  width: 180px;
  height: 180px;
  background: radial-gradient(
    circle at 50% 50%,
    #fff7d0 0%,
    #ffd66b 55%,
    #ff7b2a 100%
  );
  box-shadow:
    0 0 80px 14px rgba(255, 200, 100, 0.7),
    0 0 200px 60px rgba(255, 120, 50, 0.35);
}

/* --- Frame 4: getting bigger (subgiant) --- */
.lifecycle-frame-4 .lifecycle-sun {
  width: 320px;
  height: 320px;
  background: radial-gradient(
    circle at 50% 50%,
    #ffe2a0 0%,
    #ff9a3a 55%,
    #c64414 100%
  );
  box-shadow:
    0 0 100px 24px rgba(255, 150, 60, 0.7),
    0 0 240px 80px rgba(220, 80, 30, 0.4);
}

/* --- Frame 5: red giant --- */
.lifecycle-frame-5 .lifecycle-sun {
  width: 520px;
  height: 520px;
  background: radial-gradient(
    circle at 50% 50%,
    #ffb874 0%,
    #d8421a 50%,
    #6a1408 100%
  );
  box-shadow:
    0 0 120px 32px rgba(255, 110, 50, 0.6),
    0 0 320px 120px rgba(180, 40, 20, 0.4);
}

/* --- Frame 6: white dwarf in planetary nebula --- */
.lifecycle-frame-6 .lifecycle-sun {
  width: 26px;
  height: 26px;
  background: radial-gradient(
    circle at 50% 50%,
    #ffffff 0%,
    #c8e0ff 60%,
    #6a8ad8 100%
  );
  box-shadow:
    0 0 30px 6px rgba(200, 224, 255, 0.95),
    0 0 90px 18px rgba(140, 180, 255, 0.5);
}
.lifecycle-frame-6 .lifecycle-nebula {
  opacity: 1;
  background:
    radial-gradient(
      circle at 50% 50%,
      transparent 18%,
      rgba(120, 220, 200, 0.18) 30%,
      rgba(180, 120, 220, 0.15) 45%,
      transparent 70%
    ),
    radial-gradient(
      circle at 50% 50%,
      transparent 25%,
      rgba(255, 160, 100, 0.12) 38%,
      transparent 60%
    );
  filter: blur(2px);
}

.lifecycle-caption {
  position: absolute;
  left: 50%;
  bottom: 11vh;
  transform: translateX(-50%);
  width: min(86vw, 620px);
  text-align: center;
  font-size: 19px;
  line-height: 1.5;
  color: #fff7e0;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.85);
  pointer-events: none;
}
.lifecycle-caption .when {
  display: block;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 214, 107, 0.78);
  margin-bottom: 10px;
}

.lifecycle-counter {
  position: fixed;
  top: 18px;
  right: 22px;
  font-size: 11px;
  letter-spacing: 0.28em;
  color: rgba(255, 214, 107, 0.68);
  pointer-events: none;
}

.lifecycle-iframe-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #03050a;
  animation: fade-in 0.4s ease;
}
.lifecycle-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.lifecycle-iframe-overlay .lifecycle-back {
  z-index: 84;
  bottom: auto;
  top: 18px;
  right: 18px;
  left: auto;
}

.lifecycle-back {
  position: fixed;
  bottom: 22px;
  left: 22px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(14, 12, 32, 0.78);
  border: 1px solid var(--panel-border);
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.lifecycle-back:hover {
  background: rgba(30, 24, 60, 0.86);
}

.lifecycle-tap-hint {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(244, 241, 232, 0.32);
  pointer-events: none;
}

@media (max-width: 720px) {
  .lifecycle-launch {
    font-size: 10px;
    padding: 6px 10px;
    top: 10px;
    right: 10px;
  }
  .lifecycle-caption {
    font-size: 16px;
    bottom: 14vh;
  }
  .lifecycle-frame-5 .lifecycle-sun {
    width: 86vw;
    height: 86vw;
  }
  .lifecycle-frame-4 .lifecycle-sun {
    width: 70vw;
    height: 70vw;
  }
}

/* ---------- Moon Rover level ---------- */
.moon-rover-level {
  --rover-panel: rgba(8, 11, 18, 0.78);
  --rover-border: rgba(246, 242, 216, 0.24);
  --rover-gold: #ffd86b;
  --rover-cyan: #7ee7ff;
  --rover-peach: #ff9f7a;
  --rover-green: #b8ff9a;
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: hidden;
  background: #05060b;
  animation: fade-in 0.3s ease;
}
.moon-rover-level::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 38vh;
  z-index: 34;
  pointer-events: none;
  background:
    radial-gradient(
      circle at 8% 18%,
      rgba(255, 255, 255, 0.95) 0 1.3px,
      transparent 1.8px
    ),
    radial-gradient(
      circle at 18% 56%,
      rgba(126, 231, 255, 0.9) 0 1.1px,
      transparent 1.7px
    ),
    radial-gradient(
      circle at 31% 24%,
      rgba(255, 255, 255, 0.9) 0 1.2px,
      transparent 1.8px
    ),
    radial-gradient(
      circle at 44% 48%,
      rgba(255, 242, 184, 0.92) 0 1.3px,
      transparent 1.9px
    ),
    radial-gradient(
      circle at 59% 16%,
      rgba(255, 255, 255, 0.95) 0 1px,
      transparent 1.6px
    ),
    radial-gradient(
      circle at 72% 58%,
      rgba(126, 231, 255, 0.86) 0 1.1px,
      transparent 1.8px
    ),
    radial-gradient(
      circle at 86% 28%,
      rgba(255, 255, 255, 0.95) 0 1.4px,
      transparent 2px
    ),
    radial-gradient(
      circle at 96% 62%,
      rgba(255, 242, 184, 0.9) 0 1.1px,
      transparent 1.8px
    );
  opacity: 0.88;
}
.moon-rover-stage,
.moon-rover-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.moon-rover-canvas {
  touch-action: none;
  cursor: crosshair;
}
.moon-rover-ui {
  position: absolute;
  inset: 0;
  z-index: 36;
  pointer-events: none;
}
.moon-rover-back,
.moon-rover-hud,
.moon-rover-toast,
.moon-rover-finish,
.moon-rover-controls {
  pointer-events: auto;
}
.moon-rover-back {
  position: fixed;
  top: 18px;
  left: 18px;
  min-width: 92px;
  min-height: 50px;
  border: 1px solid var(--rover-border);
  border-radius: 999px;
  background: var(--rover-panel);
  color: #f7f5ea;
  font-family: inherit;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.26);
}
.moon-rover-back:hover {
  border-color: rgba(255, 216, 107, 0.58);
  color: var(--rover-gold);
}
.moon-rover-hud {
  position: fixed;
  top: 16px;
  left: 126px;
  right: 18px;
  display: grid;
  grid-template-columns: minmax(260px, 440px) auto;
  align-items: start;
  justify-content: end;
  gap: 10px;
}
.moon-rover-mission-card {
  min-height: 74px;
  border: 2px solid rgba(255, 216, 107, 0.42);
  border-radius: 8px;
  padding: 12px 16px;
  background:
    linear-gradient(135deg, rgba(255, 216, 107, 0.18), transparent 52%),
    rgba(8, 11, 18, 0.78);
  color: #fff9dc;
  text-align: left;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.3);
}
.moon-rover-mission-card strong {
  display: block;
  color: #fff3a4;
  font-family: "Fraunces", serif;
  font-size: clamp(22px, 3.5vw, 34px);
  font-weight: 650;
  line-height: 1;
}
.moon-rover-mission-card span {
  display: block;
  margin-top: 6px;
  color: rgba(247, 245, 234, 0.86);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.15;
}
.moon-rover-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 178px;
}
.moon-rover-badges span {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--rover-border);
  border-radius: 999px;
  padding: 0 14px;
  background: var(--rover-panel);
  color: #f7f5ea;
  font-size: 14px;
  font-weight: 1000;
  white-space: nowrap;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
}
.moon-rover-badges span.is-airborne {
  color: #fff2a6;
  border-color: rgba(255, 65, 65, 0.64);
  box-shadow:
    0 0 22px rgba(255, 48, 48, 0.34),
    inset 0 0 18px rgba(255, 199, 63, 0.14);
  animation: moon-rover-gravity-pulse 700ms ease-in-out infinite;
}
.moon-rover-badges span.moon-rover-next-distance {
  color: #031018;
  border-color: rgba(126, 231, 255, 0.7);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.46), transparent 58%), #7ee7ff;
  box-shadow:
    0 0 0 4px rgba(126, 231, 255, 0.12),
    0 12px 34px rgba(0, 0, 0, 0.22);
}
.moon-rover-badges span.moon-rover-next-distance.is-close {
  border-color: rgba(140, 255, 176, 0.9);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), transparent 58%), #8cffb0;
  box-shadow:
    0 0 0 5px rgba(140, 255, 176, 0.16),
    0 0 28px rgba(140, 255, 176, 0.44),
    0 12px 34px rgba(0, 0, 0, 0.22);
  animation: rover-close-pulse 900ms ease-in-out infinite;
}
.moon-rover-badges span.moon-rover-next-direction {
  border-color: rgba(255, 214, 107, 0.44);
  color: #fff4c2;
  background: rgba(75, 56, 10, 0.68);
}

@keyframes rover-close-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}
@keyframes moon-rover-gravity-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}
.moon-rover-sample-dots {
  grid-column: 1 / -1;
  justify-self: end;
  display: flex;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid rgba(126, 231, 255, 0.2);
  border-radius: 999px;
  background: rgba(8, 11, 18, 0.58);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.moon-rover-sample-dots span {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(247, 245, 234, 0.68);
  border-radius: 50%;
  background: var(--sample-color);
  box-shadow: 0 0 15px color-mix(in srgb, var(--sample-color) 70%, transparent);
  opacity: 0.42;
}
.moon-rover-sample-dots span.is-collected {
  opacity: 1;
  transform: scale(1.18);
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.12),
    0 0 20px color-mix(in srgb, var(--sample-color) 82%, white);
}
.moon-rover-toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  min-width: min(340px, calc(100vw - 190px));
  max-width: min(470px, calc(100vw - 190px));
  border: 2px solid rgba(126, 231, 255, 0.34);
  border-radius: 8px;
  padding: 12px 16px;
  background:
    linear-gradient(
      135deg,
      rgba(126, 231, 255, 0.16),
      rgba(255, 159, 122, 0.1)
    ),
    rgba(8, 11, 18, 0.78);
  color: #f7f5ea;
  text-align: center;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.32);
  animation: moon-rover-toast-in 0.28s ease both;
}
.moon-rover-toast strong,
.moon-rover-finish strong {
  display: block;
  color: var(--rover-gold);
  font-family: "Fraunces", serif;
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 650;
  line-height: 1.05;
}
.moon-rover-toast span,
.moon-rover-finish span {
  display: block;
  margin-top: 5px;
  color: rgba(247, 245, 234, 0.86);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.2;
}
.moon-rover-controls {
  position: fixed;
  right: 22px;
  bottom: 22px;
  display: flex;
  align-items: flex-end;
  gap: 14px;
}
.moon-rover-joystick {
  position: relative;
  width: clamp(128px, 16vw, 168px);
  height: clamp(128px, 16vw, 168px);
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 216, 107, 0.42);
  border-radius: 50%;
  background:
    radial-gradient(
      circle at 50% 50%,
      rgba(255, 216, 107, 0.28) 0 24%,
      transparent 25%
    ),
    radial-gradient(circle, rgba(126, 231, 255, 0.16), rgba(8, 11, 18, 0.74));
  color: #fff2b8;
  font-size: 15px;
  font-weight: 1000;
  text-transform: uppercase;
  letter-spacing: 0;
  touch-action: none;
  cursor: grab;
  box-shadow:
    inset 0 0 24px rgba(255, 216, 107, 0.1),
    0 20px 44px rgba(0, 0, 0, 0.34);
}
.moon-rover-joy-arrow {
  position: absolute;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 216, 107, 0.16);
  color: rgba(255, 242, 184, 0.9);
  font-style: normal;
  font-size: 18px;
  line-height: 1;
  pointer-events: none;
}
.moon-rover-joy-arrow.forward {
  top: 13px;
  left: 50%;
  transform: translateX(-50%);
}
.moon-rover-joy-arrow.left {
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
}
.moon-rover-joy-arrow.right {
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
}
.moon-rover-joystick:active {
  cursor: grabbing;
  border-color: rgba(126, 231, 255, 0.72);
}
.moon-rover-jump,
.moon-rover-guide {
  width: clamp(92px, 11vw, 118px);
  height: clamp(92px, 11vw, 118px);
  border: 2px solid rgba(126, 231, 255, 0.55);
  border-radius: 50%;
  background:
    radial-gradient(
      circle at 50% 26%,
      rgba(255, 255, 255, 0.46),
      transparent 22%
    ),
    linear-gradient(180deg, #7ee7ff 0%, #36a6e9 54%, #17619c 100%);
  color: #04111c;
  font-family: inherit;
  font-size: 17px;
  font-weight: 1000;
  text-transform: uppercase;
  letter-spacing: 0;
  touch-action: manipulation;
  cursor: pointer;
  box-shadow:
    inset 0 -10px 20px rgba(0, 28, 48, 0.22),
    0 18px 34px rgba(0, 0, 0, 0.34),
    0 0 28px rgba(126, 231, 255, 0.28);
}
.moon-rover-guide {
  border-color: rgba(255, 216, 107, 0.58);
  background:
    radial-gradient(
      circle at 50% 26%,
      rgba(255, 255, 255, 0.4),
      transparent 22%
    ),
    linear-gradient(180deg, #ffd86b 0%, #f3a83f 58%, #9f5d18 100%);
  color: #1b1205;
  box-shadow:
    inset 0 -10px 20px rgba(70, 38, 0, 0.2),
    0 18px 34px rgba(0, 0, 0, 0.34),
    0 0 28px rgba(255, 216, 107, 0.26);
}
.moon-rover-jump:active,
.moon-rover-guide:active {
  transform: translateY(3px) scale(0.97);
  filter: brightness(1.08);
}
.moon-rover-finish {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(430px, calc(100vw - 34px));
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 216, 107, 0.4);
  border-radius: 8px;
  padding: 24px;
  background:
    linear-gradient(
      135deg,
      rgba(255, 216, 107, 0.16),
      rgba(184, 255, 154, 0.12)
    ),
    rgba(8, 11, 18, 0.86);
  text-align: center;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}
.moon-rover-finish button {
  margin-top: 18px;
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  padding: 0 24px;
  background: var(--rover-gold);
  color: #17140a;
  font-family: inherit;
  font-size: 16px;
  font-weight: 1000;
  cursor: pointer;
}
@keyframes moon-rover-toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (max-width: 720px) {
  .moon-rover-back {
    top: 12px;
    left: 12px;
  }
  .moon-rover-hud {
    top: 66px;
    left: 12px;
    right: 12px;
    grid-template-columns: 1fr;
    justify-content: stretch;
    gap: 8px;
  }
  .moon-rover-mission-card {
    min-height: 66px;
    padding: 10px 12px;
  }
  .moon-rover-mission-card strong {
    font-size: 24px;
  }
  .moon-rover-mission-card span {
    font-size: 13px;
  }
  .moon-rover-badges {
    justify-content: flex-start;
    min-width: 0;
  }
  .moon-rover-badges span {
    min-height: 34px;
    padding: 0 11px;
    font-size: 12px;
  }
  .moon-rover-sample-dots {
    justify-self: start;
    gap: 7px;
    padding: 7px 9px;
  }
  .moon-rover-sample-dots span {
    width: 15px;
    height: 15px;
  }
  .moon-rover-toast {
    left: 12px;
    right: 12px;
    bottom: 220px;
    min-width: 0;
    max-width: none;
    transform: none;
    padding: 12px 13px;
    text-align: left;
  }
  .moon-rover-toast strong,
  .moon-rover-finish strong {
    font-size: 22px;
  }
  .moon-rover-toast span,
  .moon-rover-finish span {
    font-size: 13px;
  }
  .moon-rover-controls {
    right: 12px;
    bottom: 12px;
    gap: 9px;
  }
  .moon-rover-joystick {
    width: 104px;
    height: 104px;
    font-size: 13px;
  }
  .moon-rover-joy-arrow {
    width: 23px;
    height: 23px;
    font-size: 15px;
  }
  .moon-rover-jump,
  .moon-rover-guide {
    width: 78px;
    height: 78px;
    font-size: 13px;
  }
  @keyframes moon-rover-toast-in {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

.pilot-level {
  position: fixed;
  inset: 0;
  z-index: 35;
  overflow: hidden;
  background:
    radial-gradient(
      circle at 48% 42%,
      rgba(38, 92, 160, 0.22),
      transparent 34%
    ),
    linear-gradient(180deg, #07111f 0%, #0b1524 48%, #05070d 100%);
  color: #fff;
}

.pilot-back {
  position: absolute;
  z-index: 5;
  top: 22px;
  left: 24px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(24, 18, 33, 0.86);
  color: #fff;
  font-weight: 850;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.3);
}

.pilot-mute {
  position: absolute;
  z-index: 5;
  top: 22px;
  right: 24px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(24, 18, 33, 0.86);
  color: #fff;
  font-weight: 850;
  font-size: 15px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease;
}
.pilot-mute span {
  font-size: 20px;
  line-height: 1;
}
.pilot-mute.off {
  background: rgba(64, 22, 22, 0.86);
  border-color: rgba(255, 132, 132, 0.4);
}
.pilot-mute:hover {
  background: rgba(40, 30, 60, 0.92);
}

.pilot-space-window {
  position: absolute;
  inset: 72px 430px 46px 38px;
  border: 6px solid rgba(180, 213, 238, 0.32);
  border-radius: 30px;
  overflow: hidden;
  background:
    radial-gradient(
      circle at 62% 20%,
      rgba(255, 231, 145, 0.28),
      transparent 18%
    ),
    radial-gradient(
      circle at 36% 70%,
      rgba(94, 198, 255, 0.16),
      transparent 22%
    ),
    rgba(7, 14, 25, 0.78);
  box-shadow:
    inset 0 0 70px rgba(104, 196, 255, 0.22),
    0 28px 80px rgba(0, 0, 0, 0.42);
}

.pilot-space-window::before {
  content: "";
  position: absolute;
  inset: auto -8% -18% -8%;
  height: 34%;
  border-radius: 50% 50% 0 0;
  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(255, 255, 255, 0.18),
      transparent 45%
    ),
    linear-gradient(180deg, #314a6c, #102036);
  opacity: 0.78;
}

.pilot-gate {
  position: absolute;
  width: 118px;
  height: 118px;
  transform: translate(-50%, -50%);
  border: 8px solid rgba(111, 224, 255, 0.9);
  border-radius: 50%;
  box-shadow:
    0 0 22px rgba(62, 216, 255, 0.85),
    inset 0 0 24px rgba(255, 255, 255, 0.34);
  display: grid;
  place-items: center;
  animation: pilot-gate-pulse 1.2s ease-in-out infinite;
}

.pilot-gate span {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(5, 13, 24, 0.72);
  color: #fff5bd;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pilot-course-dot {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.48);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.42);
}

.pilot-course-dot.next {
  background: #ff4b4b;
  box-shadow: 0 0 26px rgba(255, 81, 81, 0.95);
}

.pilot-ship {
  position: absolute;
  width: 118px;
  height: 154px;
  transform-origin: 50% 54%;
  transition: transform 120ms ease-out;
  filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.35));
}

.pilot-ship img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: rotate(90deg);
}

.pilot-ship span {
  position: absolute;
  left: -24px;
  top: 50%;
  width: 62px;
  height: 30px;
  transform: translateY(-50%);
  border-radius: 999px 20px 20px 999px;
  background: radial-gradient(
    circle at 82% 50%,
    #fff7ad,
    #ff8f2e 42%,
    rgba(255, 64, 18, 0) 72%
  );
  filter: blur(0.2px) drop-shadow(0 0 18px rgba(255, 129, 45, 0.82));
}

.pilot-panel {
  position: absolute;
  top: 72px;
  right: 26px;
  bottom: 46px;
  width: 360px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 16px;
  padding: 22px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(30, 40, 58, 0.93), rgba(13, 18, 28, 0.96)),
    repeating-linear-gradient(
      90deg,
      transparent 0 14px,
      rgba(255, 255, 255, 0.025) 14px 15px
    );
  box-shadow: -18px 0 44px rgba(0, 0, 0, 0.25);
}

.pilot-lesson {
  min-height: 150px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  align-content: start;
  gap: 12px;
}

.pilot-lesson.powered {
  border-color: rgba(255, 216, 107, 0.42);
  background:
    linear-gradient(
      135deg,
      rgba(255, 216, 107, 0.16),
      rgba(126, 231, 255, 0.08)
    ),
    rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 22px rgba(255, 216, 107, 0.08);
}

.pilot-lesson strong {
  font-size: 30px;
  line-height: 1;
}

.pilot-lesson span {
  font-size: 17px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.82);
}

.pilot-gauges {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pilot-gauges div {
  min-height: 76px;
  border-radius: 12px;
  background: #07101c;
  border: 1px solid rgba(104, 206, 255, 0.28);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  box-shadow: inset 0 0 28px rgba(65, 202, 255, 0.12);
}

.pilot-gauges strong {
  font-size: 29px;
  line-height: 1;
  color: #7ee7ff;
}

.pilot-gauges span,
.pilot-throttle span {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}

.pilot-throttle {
  display: grid;
  align-content: center;
  gap: 20px;
  min-height: 190px;
  padding: 20px;
  border-radius: 20px;
  background: rgba(8, 14, 24, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.pilot-throttle input {
  width: 100%;
  accent-color: #ffbc42;
}

.pilot-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.pilot-controls button {
  min-height: 68px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffe58d, #ff8d37);
  color: #231006;
  font-size: 18px;
  font-weight: 950;
  box-shadow:
    0 12px 0 #8c3b16,
    0 20px 24px rgba(0, 0, 0, 0.22);
}

.pilot-controls button:active {
  transform: translateY(6px);
  box-shadow:
    0 6px 0 #8c3b16,
    0 12px 18px rgba(0, 0, 0, 0.18);
}
.pilot-controls button:disabled {
  opacity: 0.72;
  cursor: default;
  transform: none;
  background: linear-gradient(180deg, #eef6ff, #92a7b9);
  box-shadow:
    0 8px 0 #4d5965,
    0 14px 18px rgba(0, 0, 0, 0.18);
}

.pilot-steer-pad {
  position: relative;
}

.pilot-power-hint-arrow {
  position: absolute;
  left: 50%;
  top: -34px;
  z-index: 3;
  width: 54px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.74);
  border-radius: 999px;
  background: linear-gradient(180deg, #ff5656, #c60000);
  color: #fff7d8;
  font-size: 30px;
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(80, 0, 0, 0.58);
  box-shadow:
    0 0 0 5px rgba(255, 0, 0, 0.12),
    0 0 22px rgba(255, 0, 0, 0.42),
    0 10px 20px rgba(0, 0, 0, 0.3);
  transform: translateX(-50%) rotate(90deg);
  pointer-events: none;
  animation: pilot-power-hint-blink 760ms ease-in-out infinite;
}

@keyframes pilot-power-hint-blink {
  0%,
  100% {
    opacity: 1;
    translate: 0 0;
  }
  50% {
    opacity: 0.25;
    translate: 0 7px;
  }
}

@keyframes pilot-gate-pulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(0.96);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.04);
  }
}

@media (max-width: 900px) {
  .pilot-space-window {
    inset: 72px 14px 270px 14px;
    border-radius: 24px;
  }
  .pilot-panel {
    top: auto;
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    padding: 14px;
    gap: 10px;
  }
  .pilot-lesson {
    min-height: 112px;
    padding: 13px;
  }
  .pilot-lesson strong {
    font-size: 23px;
  }
  .pilot-lesson span {
    font-size: 13px;
  }
  .pilot-throttle {
    min-height: 0;
    padding: 14px;
  }
  .pilot-controls button {
    min-height: 54px;
    font-size: 15px;
  }
}

.pilot-engineering {
  display: grid;
  grid-template-rows: minmax(240px, 42vh) 1fr;
  gap: 16px;
  padding: 74px 22px 18px;
  background:
    radial-gradient(
      circle at 50% 8%,
      rgba(126, 231, 255, 0.16),
      transparent 32%
    ),
    linear-gradient(180deg, #07101c 0%, #111827 46%, #07090f 100%);
}

.pilot-front-view {
  position: relative;
  overflow: hidden;
  width: min(980px, calc(100vw - 44px));
  justify-self: center;
  border: 8px solid rgba(166, 184, 196, 0.38);
  border-radius: 22px;
  background:
    radial-gradient(
      circle at 72% 28%,
      rgba(255, 244, 176, 0.26),
      transparent 12%
    ),
    radial-gradient(
      circle at 28% 62%,
      rgba(72, 157, 255, 0.16),
      transparent 22%
    ),
    linear-gradient(180deg, rgba(3, 9, 18, 0.86), rgba(5, 12, 24, 0.96));
  box-shadow:
    inset 0 0 60px rgba(126, 231, 255, 0.16),
    0 24px 60px rgba(0, 0, 0, 0.34);
  transform: translate3d(0, 0, 0);
}

.pilot-front-view {
  isolation: isolate;
}

.pilot-front-view::before,
.pilot-front-view::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.pilot-front-view::before {
  inset: -12%;
  background:
    radial-gradient(circle at 18% 28%, white 0 1px, transparent 2px),
    radial-gradient(circle at 64% 44%, white 0 1px, transparent 2px),
    radial-gradient(circle at 82% 18%, white 0 1px, transparent 2px),
    radial-gradient(circle at 38% 76%, white 0 1px, transparent 2px),
    radial-gradient(
      circle at 12% 72%,
      rgba(255, 241, 168, 0.85) 0 1px,
      transparent 2px
    ),
    radial-gradient(
      circle at 74% 84%,
      rgba(126, 231, 255, 0.82) 0 1px,
      transparent 2px
    );
  opacity: 0.58;
  transform: translate(var(--pilot-drift-x, 0), var(--pilot-drift-y, 0));
  transition:
    transform 180ms ease-out,
    opacity 180ms ease-out;
}

.pilot-front-view::after {
  inset: auto -10% -42% -10%;
  height: 54%;
  border-radius: 50% 50% 0 0;
  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(255, 255, 255, 0.22),
      transparent 42%
    ),
    linear-gradient(180deg, #42587a, #101b2c);
  opacity: 0.86;
}

.pilot-front-view.power-on {
  box-shadow:
    inset 0 0 74px rgba(126, 231, 255, 0.24),
    inset 0 -26px 60px rgba(255, 216, 107, 0.1),
    0 24px 60px rgba(0, 0, 0, 0.34);
}

.pilot-front-view.power-on::before {
  opacity: 0.86;
}

.pilot-front-view.engine-ready {
  border-color: rgba(90, 255, 152, 0.5);
  box-shadow:
    inset 0 0 84px rgba(126, 231, 255, 0.26),
    inset 0 -30px 70px rgba(90, 255, 152, 0.14),
    0 0 30px rgba(90, 255, 152, 0.18),
    0 24px 60px rgba(0, 0, 0, 0.34);
}

.pilot-front-view.boost-on {
  box-shadow:
    inset 0 0 92px rgba(126, 231, 255, 0.28),
    inset 0 -30px 70px rgba(255, 216, 107, 0.12),
    0 24px 60px rgba(0, 0, 0, 0.34);
}

.pilot-front-view.docking-zoom {
  box-shadow:
    inset 0 0 94px rgba(126, 231, 255, 0.34),
    inset 0 -30px 74px rgba(255, 216, 107, 0.12),
    0 0 36px rgba(126, 231, 255, 0.18),
    0 24px 60px rgba(0, 0, 0, 0.34);
}
.pilot-window-monitor {
  position: absolute;
  z-index: 5;
  top: 18px;
  width: 128px;
  min-height: 72px;
  display: grid;
  gap: 4px;
  align-content: center;
  padding: 10px 12px;
  border: 1px solid rgba(126, 231, 255, 0.24);
  border-radius: 8px;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(126, 231, 255, 0.06) 0 2px,
      transparent 2px 6px
    ),
    rgba(5, 12, 23, 0.78);
  box-shadow:
    inset 0 0 22px rgba(126, 231, 255, 0.1),
    0 12px 28px rgba(0, 0, 0, 0.28);
  text-transform: uppercase;
}

.pilot-window-monitor.left {
  left: 24px;
}

.pilot-window-monitor.right {
  right: 24px;
}

.pilot-window-monitor strong {
  color: #7ee7ff;
  font-size: 13px;
  font-weight: 1000;
}

.pilot-window-monitor span {
  color: #fff1a8;
  font-size: 12px;
  font-weight: 900;
}

.pilot-window-status {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  max-width: calc(100% - 330px);
  overflow: hidden;
  padding: 6px;
  border: 1px solid rgba(126, 231, 255, 0.18);
  border-radius: 999px;
  background: rgba(5, 12, 23, 0.62);
}

.pilot-window-status span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  font-weight: 1000;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.05);
}

.pilot-school-redesign .pilot-window-status {
  top: 20px;
}

.pilot-window-status span.next {
  color: #fff1a8;
  border-color: rgba(255, 216, 107, 0.52);
  box-shadow: 0 0 16px rgba(255, 216, 107, 0.18);
}

.pilot-window-status span.on {
  color: #d8ffe4;
  border-color: rgba(90, 255, 152, 0.46);
  box-shadow: 0 0 16px rgba(90, 255, 152, 0.18);
}

@media (max-width: 720px) {
  .pilot-window-status {
    display: none;
  }
}

.pilot-star-target {
  position: absolute;
  z-index: 2;
  right: 12%;
  top: 26%;
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.32);
  font-weight: 1000;
  text-transform: uppercase;
  transform-origin: center;
  transition:
    transform 0.45s ease,
    filter 0.45s ease;
}

.pilot-star-target.on {
  border-color: rgba(255, 65, 65, 0.82);
  color: #ffe2c7;
  box-shadow:
    0 0 24px rgba(255, 65, 65, 0.56),
    inset 0 0 22px rgba(255, 65, 65, 0.22);
  animation: pilot-radar-lock 0.8s ease-in-out infinite alternate;
}

.pilot-front-view.docking-zoom .pilot-star-target {
  transform: scale(1.28);
  filter: drop-shadow(0 0 18px rgba(126, 231, 255, 0.34));
}
.pilot-view-ship {
  position: absolute;
  z-index: 3;
  width: 118px;
  height: 118px;
  filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.35));
  transition:
    filter 140ms ease-out,
    width 0.45s ease,
    height 0.45s ease;
  will-change: left, top, transform;
}

.pilot-view-ship img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: rotate(90deg);
}

.pilot-view-ship::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 24px -22px 24px 56px;
  border-radius: 999px;
  background: radial-gradient(
    circle,
    rgba(126, 231, 255, 0.24),
    transparent 68%
  );
  opacity: calc(0.16 + var(--pilot-thrust, 0) * 0.58);
  transform: scale(calc(0.8 + var(--pilot-thrust, 0) * 0.7));
}

.pilot-view-ship::after {
  content: "";
  position: absolute;
  z-index: -2;
  left: 58%;
  top: 44%;
  width: 170px;
  height: 42px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(126, 231, 255, 0.34),
    transparent 78%
  );
  opacity: 0;
  pointer-events: none;
}

.pilot-view-ship > span {
  position: absolute;
  z-index: 1;
  left: calc(9px - var(--pilot-thrust, 0) * 18px);
  top: 51%;
  width: calc(34px + var(--pilot-thrust, 0) * 56px);
  height: calc(14px + var(--pilot-thrust, 0) * 18px);
  transform: translateY(-50%);
  border-radius: 999px 20px 20px 999px;
  background:
    radial-gradient(
      circle at 90% 50%,
      rgba(255, 255, 230, 0.96),
      rgba(255, 177, 62, 0.86) 32%,
      rgba(255, 95, 28, 0.42) 58%,
      rgba(255, 64, 18, 0) 78%
    ),
    linear-gradient(90deg, rgba(255, 44, 14, 0), rgba(255, 176, 56, 0.5));
  filter: drop-shadow(0 0 12px rgba(255, 129, 45, 0.62));
  pointer-events: none;
}

.pilot-view-ship.boosting > span {
  animation: pilot-flame-flicker 0.12s ease-in-out infinite alternate;
}

.pilot-view-ship.engine-ready::before {
  background:
    radial-gradient(
      circle at 40% 50%,
      rgba(90, 255, 152, 0.32),
      transparent 45%
    ),
    radial-gradient(circle, rgba(126, 231, 255, 0.28), transparent 68%);
  opacity: calc(0.28 + var(--pilot-thrust, 0) * 0.64);
}

.pilot-view-ship.engine-ready > span {
  background:
    radial-gradient(
      circle at 92% 48%,
      #ffffff,
      #fff6a7 22%,
      #ff9a31 48%,
      rgba(255, 35, 18, 0) 78%
    ),
    linear-gradient(90deg, rgba(255, 44, 14, 0), rgba(255, 176, 56, 0.58));
  filter: drop-shadow(0 0 16px rgba(255, 129, 45, 0.9))
    drop-shadow(0 0 28px rgba(90, 255, 152, 0.34));
}

.pilot-view-ship.lights-on {
  filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.35))
    drop-shadow(0 0 18px rgba(126, 231, 255, 0.72));
}

.pilot-view-ship.lights-on::after {
  opacity: 0.84;
}

.pilot-view-readout {
  position: absolute;
  z-index: 4;
  left: 18px;
  bottom: 16px;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(126, 231, 255, 0.28);
  border-radius: 8px;
  background: rgba(5, 11, 20, 0.74);
}

.pilot-view-readout strong {
  color: #fff1a8;
  font-size: 20px;
}

.pilot-view-readout span {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 850;
}
.pilot-control-board {
  position: relative;
  width: min(1120px, calc(100vw - 34px));
  justify-self: center;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr) minmax(0, 1.2fr);
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(67, 75, 88, 0.96), rgba(24, 29, 38, 0.98)),
    repeating-linear-gradient(
      90deg,
      transparent 0 18px,
      rgba(255, 255, 255, 0.025) 18px 19px
    );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 22px 58px rgba(0, 0, 0, 0.36);
}

.pilot-control-board.engine-ready {
  border-color: rgba(90, 255, 152, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 0 30px rgba(90, 255, 152, 0.08),
    0 22px 58px rgba(0, 0, 0, 0.36);
}

.pilot-control-board::before {
  content: "";
  position: absolute;
  inset: 10px;
  pointer-events: none;
  border-radius: 12px;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent),
    repeating-linear-gradient(
      90deg,
      transparent 0 66px,
      rgba(0, 0, 0, 0.16) 66px 68px
    );
  opacity: 0.72;
}

.pilot-board-column {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
}

.pilot-board-column.mission {
  grid-template-rows: auto 1fr;
}

.pilot-panel-title {
  min-width: 0;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 1000;
  text-transform: uppercase;
}

.pilot-panel-title i {
  min-width: 0;
  max-width: 46%;
  padding: 5px 8px;
  border: 1px solid rgba(126, 231, 255, 0.2);
  border-radius: 999px;
  background: rgba(5, 10, 18, 0.36);
  color: #7ee7ff;
  font-style: normal;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pilot-panel-title span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pilot-task-list {
  display: grid;
  gap: 8px;
}

.pilot-task-list span {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(5, 10, 18, 0.42);
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 900;
}

.pilot-task-list span.next {
  color: #fff1a8;
  border-color: rgba(255, 216, 107, 0.52);
  box-shadow: 0 0 18px rgba(255, 216, 107, 0.14);
}

.pilot-task-list span.done {
  color: #c8ffd1;
  border-color: rgba(89, 231, 131, 0.42);
  background: rgba(39, 143, 75, 0.18);
}

.pilot-switch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pilot-power-bus {
  min-height: 42px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(126, 231, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(
      90deg,
      rgba(126, 231, 255, 0.08),
      rgba(255, 216, 107, 0.05)
    ),
    rgba(5, 10, 18, 0.5);
}

.pilot-power-bus span {
  min-height: 22px;
  display: grid;
  place-items: center;
  align-self: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.42);
  font-size: 10px;
  font-weight: 1000;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.34);
}

.pilot-power-bus span.on {
  background: linear-gradient(90deg, #7ee7ff, #fff1a8);
  color: #07101c;
  box-shadow:
    0 0 16px rgba(126, 231, 255, 0.42),
    0 0 22px rgba(255, 216, 107, 0.24);
}

.pilot-switch {
  min-height: 76px;
  display: grid;
  grid-template-columns: 18px 34px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 10px;
  background: rgba(7, 13, 22, 0.68);
  color: rgba(255, 255, 255, 0.7);
  text-align: left;
}

.pilot-switch .pilot-switch-light {
  grid-row: 1 / 3;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.48);
}

.pilot-switch .pilot-switch-lever {
  grid-row: 1 / 3;
  width: 30px;
  height: 46px;
  border-radius: 999px;
  background: linear-gradient(180deg, #2a2f38, #0c1018);
  box-shadow: inset 0 -10px 0 rgba(0, 0, 0, 0.34);
}

.pilot-switch strong {
  align-self: end;
  font-size: 13px;
  font-weight: 1000;
  text-transform: uppercase;
}

.pilot-switch em {
  align-self: start;
  color: rgba(255, 255, 255, 0.46);
  font-size: 11px;
  font-style: normal;
  font-weight: 950;
  text-transform: uppercase;
}

.pilot-switch.on {
  color: #fff7cc;
  border-color: rgba(255, 216, 107, 0.6);
  background: rgba(88, 68, 22, 0.36);
}

.pilot-switch.orange.on {
  border-color: rgba(255, 157, 56, 0.62);
  background: rgba(100, 57, 22, 0.38);
}

.pilot-switch.red.on {
  border-color: rgba(255, 93, 93, 0.66);
  background: rgba(108, 28, 28, 0.38);
}

.pilot-switch.on .pilot-switch-light {
  background: #fff4a8;
  box-shadow: 0 0 16px rgba(255, 216, 107, 0.72);
}

.pilot-switch.on .pilot-switch-lever {
  background: linear-gradient(180deg, #fff4a8, #ff9a30);
  box-shadow:
    0 0 18px rgba(255, 190, 64, 0.68),
    inset 0 -10px 0 rgba(116, 51, 0, 0.25);
}

.pilot-switch.on em {
  color: #fff1a8;
}

.pilot-switch.green.on {
  border-color: rgba(90, 255, 152, 0.56);
  background: rgba(26, 90, 55, 0.34);
}

.pilot-switch.cyan.on {
  border-color: rgba(126, 231, 255, 0.58);
  background: rgba(24, 80, 96, 0.36);
}

.pilot-switch.pink.on {
  border-color: rgba(255, 139, 208, 0.58);
  background: rgba(94, 34, 75, 0.34);
}

.pilot-gauges div.ready {
  border-color: rgba(90, 255, 152, 0.56);
  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(90, 255, 152, 0.18),
      transparent 62%
    ),
    #07101c;
  box-shadow:
    0 0 18px rgba(90, 255, 152, 0.14),
    inset 0 0 28px rgba(90, 255, 152, 0.12);
}

.pilot-board-column.controls {
  grid-template-rows: auto auto auto auto auto;
}

.pilot-engine-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(126, 231, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(
      90deg,
      rgba(126, 231, 255, 0.08),
      rgba(255, 216, 107, 0.05)
    ),
    rgba(5, 10, 18, 0.46);
}

.pilot-engine-strip span {
  min-height: 42px;
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  font-weight: 1000;
  text-transform: uppercase;
  overflow: hidden;
}

.pilot-engine-strip i {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.54);
  font-style: normal;
  font-size: 11px;
}

.pilot-engine-strip span.on {
  color: #d8ffe4;
  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(90, 255, 152, 0.24),
      transparent 74%
    ),
    rgba(25, 91, 58, 0.34);
  box-shadow: inset 0 0 18px rgba(90, 255, 152, 0.1);
}

.pilot-engine-strip span.on i {
  background: linear-gradient(180deg, #d8ffe4, #5aff98);
  color: #07101c;
}

.pilot-engineering .pilot-throttle {
  min-height: 0;
  padding: 13px;
  gap: 10px;
  border-radius: 8px;
}

.pilot-engineering .pilot-controls {
  grid-template-columns: repeat(4, 1fr);
}

.pilot-engineering .pilot-controls button {
  min-height: 54px;
  border-radius: 8px;
  font-size: 14px;
}

.pilot-engineering .pilot-front-view {
  border: 10px solid rgba(154, 174, 188, 0.42);
  border-radius: 18px;
  box-shadow:
    inset 0 0 0 6px rgba(7, 13, 22, 0.82),
    inset 0 0 60px rgba(126, 231, 255, 0.16),
    0 24px 60px rgba(0, 0, 0, 0.34);
}

.pilot-engineering .pilot-front-view::after {
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.04) 0 3px,
      transparent 3px 22px
    ),
    radial-gradient(
      circle at 50% 0%,
      rgba(255, 255, 255, 0.22),
      transparent 42%
    ),
    linear-gradient(180deg, #42587a, #101b2c);
}

.pilot-engineering .pilot-control-board {
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(82, 91, 105, 0.98), rgba(29, 34, 45, 0.99)),
    repeating-linear-gradient(
      90deg,
      transparent 0 18px,
      rgba(255, 255, 255, 0.035) 18px 19px
    );
  box-shadow:
    inset 0 0 0 5px rgba(7, 12, 20, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 22px 58px rgba(0, 0, 0, 0.36);
}

.pilot-engineering .pilot-control-board::before {
  background:
    radial-gradient(
      circle at 12px 12px,
      rgba(255, 236, 161, 0.38) 0 3px,
      transparent 4px
    ),
    radial-gradient(
      circle at calc(100% - 12px) 12px,
      rgba(255, 236, 161, 0.38) 0 3px,
      transparent 4px
    ),
    radial-gradient(
      circle at 12px calc(100% - 12px),
      rgba(255, 236, 161, 0.26) 0 3px,
      transparent 4px
    ),
    radial-gradient(
      circle at calc(100% - 12px) calc(100% - 12px),
      rgba(255, 236, 161, 0.26) 0 3px,
      transparent 4px
    ),
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent),
    repeating-linear-gradient(
      90deg,
      transparent 0 66px,
      rgba(0, 0, 0, 0.16) 66px 68px
    );
}

.pilot-engineering .pilot-board-column {
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(8, 15, 26, 0.44), rgba(5, 10, 18, 0.24)),
    rgba(255, 255, 255, 0.035);
}

.pilot-engineering .pilot-panel-title {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(2, 6, 12, 0.5);
  color: #f6fbff;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
}

.pilot-engineering .pilot-panel-title i {
  color: #fff1a8;
}

.pilot-engineering .pilot-lesson {
  min-height: 124px;
  border-radius: 8px;
  background:
    linear-gradient(
      135deg,
      rgba(126, 231, 255, 0.1),
      rgba(255, 216, 107, 0.06)
    ),
    rgba(5, 11, 20, 0.56);
}

.pilot-engineering .pilot-lesson strong {
  font-size: 25px;
}

.pilot-engineering .pilot-lesson span {
  font-size: 15px;
}

.pilot-engineering .pilot-task-list span {
  position: relative;
  min-height: 32px;
  padding: 0 11px 0 30px;
}

.pilot-engineering .pilot-task-list span::before {
  content: "";
  position: absolute;
  left: 10px;
  width: 10px;
  height: 10px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.pilot-engineering .pilot-task-list span.next::before {
  border-color: rgba(255, 216, 107, 0.82);
  background: #ffd86b;
  box-shadow: 0 0 12px rgba(255, 216, 107, 0.46);
}

.pilot-engineering .pilot-task-list span.done::before {
  border-color: rgba(89, 231, 131, 0.72);
  background: #8cffaa;
}

.pilot-engineering .pilot-power-bus {
  position: relative;
  min-height: 56px;
  grid-template-columns: repeat(7, 1fr);
  padding: 12px 8px 8px;
  background:
    linear-gradient(
      90deg,
      rgba(126, 231, 255, 0.08),
      rgba(255, 216, 107, 0.08),
      rgba(255, 128, 191, 0.07)
    ),
    rgba(5, 10, 18, 0.5);
}

.pilot-engineering .pilot-power-bus::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 15px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(126, 231, 255, 0.22),
    rgba(255, 216, 107, 0.28),
    rgba(255, 154, 223, 0.2)
  );
  box-shadow: 0 0 14px rgba(126, 231, 255, 0.14);
}

.pilot-engineering .pilot-power-bus span {
  position: relative;
  height: 30px;
  padding-bottom: 3px;
  place-items: end center;
  background:
    radial-gradient(
      circle at 50% 7px,
      rgba(255, 255, 255, 0.32) 0 3px,
      transparent 4px
    ),
    rgba(255, 255, 255, 0.12);
}

.pilot-engineering .pilot-power-bus span.on {
  background:
    radial-gradient(circle at 50% 7px, #ffffff 0 3px, transparent 4px),
    linear-gradient(180deg, #7ee7ff, #fff1a8);
}

.pilot-engineering .pilot-switch {
  --switch-glow: #ffd86b;
  position: relative;
  min-height: 84px;
  gap: 4px 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(0, 0, 0, 0.05)),
    rgba(7, 13, 22, 0.68);
  box-shadow:
    inset 0 -4px 0 rgba(0, 0, 0, 0.18),
    0 8px 18px rgba(0, 0, 0, 0.16);
}

.pilot-engineering .pilot-switch.gold {
  --switch-glow: #ffd86b;
}

.pilot-engineering .pilot-switch.orange {
  --switch-glow: #ffb24e;
}

.pilot-engineering .pilot-switch.red {
  --switch-glow: #ff6f6f;
}

.pilot-engineering .pilot-switch.green {
  --switch-glow: #83ff9f;
}

.pilot-engineering .pilot-switch.cyan {
  --switch-glow: #7ee7ff;
}

.pilot-engineering .pilot-switch.pink {
  --switch-glow: #ff9adf;
}

.pilot-engineering .pilot-switch::after {
  content: "";
  position: absolute;
  left: 36px;
  right: 14px;
  top: 18px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.pilot-engineering .pilot-switch .pilot-switch-lever {
  position: relative;
  width: 32px;
  height: 52px;
  box-shadow:
    inset 0 -10px 0 rgba(0, 0, 0, 0.34),
    inset 0 4px 0 rgba(255, 255, 255, 0.08);
}

.pilot-engineering .pilot-switch .pilot-switch-lever::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 8px;
  width: 18px;
  height: 18px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.pilot-engineering .pilot-switch.on::after {
  background: linear-gradient(
    90deg,
    var(--switch-glow),
    rgba(255, 255, 255, 0.24)
  );
  box-shadow: 0 0 12px var(--switch-glow);
}

.pilot-engineering .pilot-switch.on .pilot-switch-light {
  background: #ffffff;
  box-shadow:
    0 0 12px var(--switch-glow),
    0 0 20px var(--switch-glow);
}

.pilot-engineering .pilot-switch.on .pilot-switch-lever {
  background: linear-gradient(180deg, #fffef4, var(--switch-glow) 54%, #ff8d37);
  box-shadow:
    0 0 18px var(--switch-glow),
    inset 0 -10px 0 rgba(116, 51, 0, 0.25);
}

.pilot-engineering .pilot-gauges {
  gap: 10px;
}

.pilot-engineering .pilot-gauges div {
  min-height: 66px;
  border-radius: 8px;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(126, 231, 255, 0.045) 0 2px,
      transparent 2px 8px
    ),
    #07101c;
}

.pilot-engineering .pilot-gauges strong {
  font-size: 24px;
}

.pilot-engineering .pilot-throttle {
  padding: 12px;
  gap: 8px;
  background:
    linear-gradient(
      90deg,
      rgba(126, 231, 255, 0.08),
      rgba(255, 216, 107, 0.06)
    ),
    rgba(8, 14, 24, 0.78);
}

.pilot-engineering .pilot-controls {
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.pilot-engineering .pilot-gauges span,
.pilot-engineering .pilot-throttle span {
  letter-spacing: 0;
}

@keyframes pilot-window-boost {
  from {
    transform: translate3d(-1px, 0, 0);
  }
  to {
    transform: translate3d(1px, 1px, 0);
  }
}

@keyframes pilot-radar-lock {
  from {
    transform: scale(0.96);
  }
  to {
    transform: scale(1.04);
  }
}

@keyframes pilot-flame-flicker {
  from {
    opacity: calc(0.55 + var(--pilot-thrust, 0) * 0.28);
    transform: translateY(-50%) scaleX(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) scaleX(1.08);
  }
}

@keyframes pilot-ship-thrum {
  from {
    transform: rotate(90deg) translateX(-1px);
  }
  to {
    transform: rotate(90deg) translateX(2px);
  }
}

@media (max-width: 900px) {
  .pilot-engineering {
    grid-template-rows: 32vh 1fr;
    padding: 68px 12px 12px;
  }
  .pilot-control-board {
    grid-template-columns: 1fr;
    overflow: auto;
  }
  .pilot-front-view {
    width: calc(100vw - 24px);
  }
  .pilot-view-ship {
    width: 88px;
    height: 88px;
  }
  .pilot-engineering .pilot-controls {
    grid-template-columns: 1fr 1fr;
  }
}

.pilot-school-redesign {
  grid-template-rows: minmax(220px, 31vh) 1fr;
  gap: 12px;
  padding: 70px 18px 14px;
  background:
    radial-gradient(
      circle at 50% 8%,
      rgba(110, 178, 224, 0.18),
      transparent 30%
    ),
    linear-gradient(180deg, #07101c 0%, #171d26 54%, #06080d 100%);
}

.pilot-school-redesign .pilot-front-view {
  width: min(1040px, calc(100vw - 36px));
  border-radius: 16px;
  background:
    radial-gradient(
      circle at 72% 36%,
      rgba(255, 238, 154, 0.24),
      transparent 10%
    ),
    linear-gradient(
      115deg,
      transparent 0 44%,
      rgba(126, 231, 255, 0.08) 45% 46%,
      transparent 47%
    ),
    linear-gradient(
      65deg,
      transparent 0 52%,
      rgba(255, 216, 107, 0.07) 53% 54%,
      transparent 55%
    ),
    linear-gradient(180deg, rgba(5, 18, 31, 0.94), rgba(4, 10, 20, 0.98));
}

.pilot-school-redesign .pilot-view-readout {
  max-width: min(430px, 62%);
  transition:
    opacity 0.45s ease,
    transform 0.45s ease;
}

.pilot-school-redesign .pilot-view-readout.hidden {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.pilot-docking-meter {
  position: absolute;
  z-index: 5;
  right: 24px;
  bottom: 18px;
  width: 190px;
  min-height: 48px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  padding: 8px 10px;
  border: 1px solid rgba(126, 231, 255, 0.26);
  border-radius: 8px;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(126, 231, 255, 0.05) 0 2px,
      transparent 2px 7px
    ),
    rgba(5, 12, 23, 0.78);
  box-shadow: inset 0 0 18px rgba(126, 231, 255, 0.08);
}

.pilot-docking-meter span,
.pilot-docking-meter strong {
  position: relative;
  z-index: 1;
}

.pilot-docking-meter span {
  color: rgba(255, 255, 255, 0.74);
  font-size: 11px;
  font-weight: 1000;
  text-transform: uppercase;
}

.pilot-docking-meter strong {
  color: #fff1a8;
  font-size: 21px;
  font-weight: 1000;
}

.pilot-docking-meter i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    rgba(126, 231, 255, 0.18),
    rgba(90, 255, 152, 0.24)
  );
}

.pilot-docking-meter.docked {
  border-color: rgba(90, 255, 152, 0.56);
  box-shadow:
    0 0 18px rgba(90, 255, 152, 0.16),
    inset 0 0 20px rgba(90, 255, 152, 0.12);
}

.pilot-docking-meter.hidden {
  opacity: 0;
  pointer-events: none;
}

.engineering-console {
  width: min(1160px, calc(100vw - 28px));
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.28fr) minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border-radius: 10px;
  background:
    radial-gradient(
      circle at 18px 18px,
      rgba(255, 255, 255, 0.18) 0 3px,
      transparent 4px
    ),
    radial-gradient(
      circle at calc(100% - 18px) 18px,
      rgba(255, 255, 255, 0.18) 0 3px,
      transparent 4px
    ),
    radial-gradient(
      circle at 18px calc(100% - 18px),
      rgba(255, 255, 255, 0.18) 0 3px,
      transparent 4px
    ),
    radial-gradient(
      circle at calc(100% - 18px) calc(100% - 18px),
      rgba(255, 255, 255, 0.18) 0 3px,
      transparent 4px
    ),
    linear-gradient(180deg, rgba(72, 81, 93, 0.98), rgba(30, 35, 44, 0.99)),
    repeating-linear-gradient(
      90deg,
      transparent 0 22px,
      rgba(255, 255, 255, 0.035) 22px 23px
    );
  box-shadow:
    inset 0 0 0 5px rgba(6, 10, 16, 0.44),
    0 24px 58px rgba(0, 0, 0, 0.36);
}

.engineering-console::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 48px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(126, 231, 255, 0.18),
    rgba(255, 216, 107, 0.34),
    rgba(126, 231, 255, 0.18)
  );
  pointer-events: none;
}

.engineering-console .pilot-board-column {
  min-height: 0;
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background:
    linear-gradient(
      90deg,
      transparent 0 48%,
      rgba(255, 255, 255, 0.05) 48% 52%,
      transparent 52%
    ),
    linear-gradient(180deg, rgba(10, 17, 28, 0.72), rgba(6, 10, 18, 0.42)),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.engineering-brief {
  grid-template-rows: auto auto auto;
  overflow: hidden;
}

.engineering-brief .pilot-lesson {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  align-self: start;
  overflow: hidden;
  contain: paint;
  border-radius: 8px;
  padding: 12px 14px 14px;
  gap: 6px;
}

.engineering-brief .pilot-lesson strong {
  font-size: 20px;
}

.engineering-brief .pilot-lesson span {
  display: block;
  width: min(100%, 31ch);
  max-width: 31ch;
  font-size: 13px;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
}

.engineering-brief .pilot-lesson strong,
.engineering-brief .pilot-lesson span {
  min-width: 0;
}

.pilot-engine-strip span.next {
  color: #fff1a8;
  border: 1px solid rgba(255, 216, 107, 0.42);
  background: rgba(122, 82, 24, 0.28);
  box-shadow: inset 0 0 18px rgba(255, 216, 107, 0.08);
}

.rocket-schematic {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  gap: 10px;
  min-height: 260px;
  padding: 14px;
  border: 1px solid rgba(126, 231, 255, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(8, 17, 28, 0.92), rgba(4, 9, 16, 0.92)),
    repeating-linear-gradient(
      0deg,
      transparent 0 24px,
      rgba(126, 231, 255, 0.05) 24px 25px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0 24px,
      rgba(126, 231, 255, 0.04) 24px 25px
    );
}

.rocket-schematic.pilot-board-image {
  grid-template-columns: repeat(4, minmax(92px, 1fr));
  align-items: end;
  gap: 14px;
  padding: 22px 20px 18px;
  background:
    radial-gradient(
      circle at 50% 12%,
      rgba(126, 231, 255, 0.16),
      transparent 34%
    ),
    linear-gradient(180deg, rgba(5, 10, 18, 0.18), rgba(5, 10, 18, 0.44)),
    var(--pilot-board-bg) center / cover no-repeat,
    linear-gradient(180deg, rgba(8, 17, 28, 0.92), rgba(4, 9, 16, 0.92));
  box-shadow:
    inset 0 0 0 2px rgba(126, 231, 255, 0.1),
    inset 0 -24px 42px rgba(0, 0, 0, 0.3);
}

.rocket-schematic.pilot-board-image::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  top: 15px;
  height: 18px;
  border-radius: 999px;
  background:
    radial-gradient(
      circle at 8% 50%,
      rgba(255, 216, 107, 0.7) 0 3px,
      transparent 4px
    ),
    radial-gradient(
      circle at 18% 50%,
      rgba(90, 255, 152, 0.55) 0 3px,
      transparent 4px
    ),
    radial-gradient(
      circle at 28% 50%,
      rgba(126, 231, 255, 0.55) 0 3px,
      transparent 4px
    ),
    linear-gradient(
      90deg,
      rgba(126, 231, 255, 0.18),
      rgba(255, 216, 107, 0.1),
      rgba(126, 231, 255, 0.18)
    );
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.rocket-schematic::before {
  content: "";
  position: absolute;
  left: 38px;
  right: 38px;
  top: 82px;
  height: 8px;
  border-radius: 999px;
  background: rgba(104, 123, 140, 0.32);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.36);
}

.rocket-schematic-part {
  position: relative;
  z-index: 1;
  min-height: 220px;
  display: grid;
  grid-template-rows: 104px auto auto;
  gap: 8px;
  align-items: center;
  justify-items: center;
  padding: 14px 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(0, 0, 0, 0.08)),
    #111923;
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
  box-shadow:
    inset 0 -5px 0 rgba(0, 0, 0, 0.2),
    0 10px 18px rgba(0, 0, 0, 0.18);
}

.rocket-schematic-part:focus {
  outline: none;
}

.rocket-schematic-part.next:focus-visible {
  outline: 3px solid rgba(255, 216, 107, 0.72);
  outline-offset: 2px;
}

.pilot-board-image .rocket-schematic-part {
  min-height: 152px;
  align-self: stretch;
  grid-template-rows: 66px auto auto;
  border: 2px solid rgba(197, 220, 235, 0.28);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(40, 50, 62, 0.92), rgba(11, 17, 26, 0.96)),
    rgba(9, 16, 27, 0.84);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.12),
    inset 0 -8px 0 rgba(0, 0, 0, 0.28),
    0 10px 16px rgba(0, 0, 0, 0.2);
}

.pilot-board-image .rocket-schematic-part.next {
  background:
    radial-gradient(
      circle at 50% 18%,
      rgba(255, 216, 107, 0.28),
      transparent 58%
    ),
    linear-gradient(180deg, rgba(88, 63, 24, 0.9), rgba(14, 18, 25, 0.96));
}

.pilot-board-image .rocket-schematic-part.on {
  background:
    radial-gradient(
      circle at 50% 18%,
      rgba(90, 255, 152, 0.28),
      transparent 58%
    ),
    linear-gradient(180deg, rgba(21, 82, 59, 0.92), rgba(6, 23, 18, 0.96));
}

.pilot-board-image .rocket-schematic-part .schematic-icon {
  width: 64px;
  height: 64px;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background-color: rgba(18, 25, 35, 0.92);
}

.pilot-board-image .rocket-schematic-part::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: 14px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 8px rgba(126, 231, 255, 0.12);
}

.pilot-board-image .rocket-schematic-part.next::before {
  background: linear-gradient(90deg, #fff4a8, #ff9a30);
  box-shadow: 0 0 14px rgba(255, 216, 107, 0.46);
}

.pilot-board-image .rocket-schematic-part.on::before {
  background: linear-gradient(90deg, #d8ffe4, #5aff98);
  box-shadow: 0 0 14px rgba(90, 255, 152, 0.36);
}

.rocket-schematic-part.next {
  border-color: rgba(255, 216, 107, 0.68);
  color: #fff4c7;
  transform: translateY(-2px);
  box-shadow:
    0 0 0 3px rgba(255, 216, 107, 0.08),
    0 0 22px rgba(255, 216, 107, 0.12),
    inset 0 -5px 0 rgba(0, 0, 0, 0.18);
  animation: schematic-next-pulse 0.9s ease-in-out infinite alternate;
}

.rocket-schematic-part.on {
  border-color: rgba(90, 255, 152, 0.55);
  background:
    radial-gradient(
      circle at 50% 18%,
      rgba(90, 255, 152, 0.18),
      transparent 58%
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(0, 0, 0, 0.06)),
    #14221f;
  color: #d8ffe4;
}

.rocket-schematic-part strong {
  font-size: 15px;
  font-weight: 1000;
  line-height: 1;
  text-transform: uppercase;
}

.rocket-schematic-part em {
  color: rgba(255, 255, 255, 0.56);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.rocket-schematic-part.on em,
.rocket-schematic-part.next em {
  color: inherit;
}

.rocket-schematic-part b {
  position: absolute;
  z-index: -1;
  right: -18px;
  top: 82px;
  width: 26px;
  height: 8px;
  border-radius: 999px;
  background: rgba(104, 123, 140, 0.4);
}

.rocket-schematic-part b.on {
  background: linear-gradient(90deg, #7ee7ff, #fff1a8);
  box-shadow: 0 0 14px rgba(126, 231, 255, 0.4);
}

.schematic-icon {
  position: relative;
  width: 82px;
  height: 82px;
  border-radius: 18px;
  background: linear-gradient(180deg, #4f5b69, #202936);
  box-shadow:
    inset 0 6px 0 rgba(255, 255, 255, 0.12),
    inset 0 -8px 0 rgba(0, 0, 0, 0.2);
}

.schematic-icon::before,
.schematic-icon::after {
  content: "";
  position: absolute;
}

.schematic-icon.electricity {
  border-radius: 14px;
  background: linear-gradient(180deg, #6e7781, #242d38);
}

.schematic-icon.electricity::before {
  left: 31px;
  top: 14px;
  width: 18px;
  height: 52px;
  clip-path: polygon(54% 0, 20% 42%, 48% 42%, 34% 100%, 82% 34%, 52% 34%);
  background: #ffd86b;
  filter: drop-shadow(0 0 10px rgba(255, 216, 107, 0.6));
}

.schematic-icon.fuel {
  border-radius: 999px 999px 18px 18px;
  background: linear-gradient(180deg, #a8f0ff, #2487a0 58%, #193544);
}

.schematic-icon.fuel::before {
  inset: 14px 18px 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.44);
}

.schematic-icon.spark {
  border-radius: 999px;
  background: radial-gradient(
    circle,
    #fff7ba 0 18%,
    #ff9a30 19% 38%,
    #642f68 39% 66%,
    #232936 67%
  );
}

.schematic-icon.spark::before {
  left: 10px;
  right: 10px;
  top: 39px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  transform: rotate(-25deg);
}

.schematic-icon.thrust {
  border-radius: 48% 48% 18px 18px;
  background: linear-gradient(180deg, #cbd5df, #667686 52%, #1f2732);
}

.schematic-icon.thrust::before {
  left: 18px;
  right: 18px;
  bottom: -14px;
  height: 30px;
  border-radius: 0 0 999px 999px;
  background: radial-gradient(
    circle at 50% 0,
    #fff6a7,
    #ff9a30 44%,
    rgba(255, 60, 20, 0) 72%
  );
  opacity: 0.76;
}

.rocket-schematic-part.on .schematic-icon {
  box-shadow:
    0 0 18px rgba(90, 255, 152, 0.24),
    inset 0 6px 0 rgba(255, 255, 255, 0.16),
    inset 0 -8px 0 rgba(0, 0, 0, 0.2);
}

.flight-controls-simple {
  grid-template-rows: auto auto auto auto auto;
}

.big-throttle {
  min-height: 150px;
}

.big-throttle input {
  height: 34px;
}

.throttle-joystick {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  padding: 12px;
}

.throttle-joystick > span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.06em;
}

.throttle-stick-track {
  position: relative;
  height: 126px;
  min-width: 78px;
  border: 1px solid rgba(126, 231, 255, 0.28);
  border-radius: 10px;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.12) 0 2px,
      transparent 2px 15px
    ),
    linear-gradient(180deg, rgba(8, 14, 24, 0.94), rgba(4, 8, 14, 0.98));
  box-shadow:
    inset 0 0 22px rgba(0, 0, 0, 0.5),
    0 10px 18px rgba(0, 0, 0, 0.18);
  touch-action: none;
}

.throttle-stick-rail {
  position: absolute;
  left: 50%;
  top: 12px;
  bottom: 12px;
  width: 14px;
  transform: translateX(-50%);
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.12), transparent), #121923;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.72);
}

.throttle-stick-fill {
  position: absolute;
  left: 50%;
  bottom: 12px;
  width: 12px;
  max-height: calc(100% - 24px);
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(180deg, #fff1a8, #ff9a30);
  box-shadow: 0 0 14px rgba(255, 190, 64, 0.42);
}

.throttle-stick-handle {
  position: absolute;
  left: 50%;
  width: 62px;
  height: 34px;
  border: 1px solid rgba(255, 216, 107, 0.68);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffe58d, #ff9b36 58%, #d96820);
  transform: translate(-50%, 50%);
  box-shadow:
    0 6px 0 #8c3b16,
    0 12px 20px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  pointer-events: none;
}

.pilot-meter-row {
  position: relative;
  min-height: 64px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  padding: 12px;
  border: 1px solid rgba(126, 231, 255, 0.22);
  border-radius: 8px;
  background: #07101c;
}

.pilot-meter-row span {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 1000;
  text-transform: uppercase;
}

.pilot-meter-row strong {
  position: relative;
  z-index: 1;
  color: #fff1a8;
  font-size: 26px;
  font-weight: 1000;
}

.pilot-meter-row i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background:
    linear-gradient(
      90deg,
      rgba(126, 231, 255, 0.22),
      rgba(255, 216, 107, 0.26)
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0 18px,
      rgba(255, 255, 255, 0.1) 18px 20px
    );
}

.pilot-steer-pad {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.pilot-steer-pad button,
.support-toggle-row button {
  min-height: 66px;
  border: 1px solid rgba(255, 216, 107, 0.28);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffe58d, #ff963d);
  color: #211207;
  font-size: 17px;
  font-weight: 1000;
  box-shadow:
    0 8px 0 #8c3b16,
    0 14px 18px rgba(0, 0, 0, 0.2);
}

.pilot-steer-pad button:active,
.support-toggle-row button:active {
  transform: translateY(5px);
  box-shadow:
    0 3px 0 #8c3b16,
    0 8px 14px rgba(0, 0, 0, 0.18);
}

.pilot-dock-button {
  min-height: 70px;
  border: 1px solid rgba(126, 231, 255, 0.46);
  border-radius: 8px;
  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(255, 255, 255, 0.28),
      transparent 58%
    ),
    linear-gradient(180deg, #8df4ff, #3fa7ff 56%, #1661a8);
  color: #04111e;
  font-size: 20px;
  font-weight: 1000;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  box-shadow:
    0 8px 0 #0b3f70,
    0 16px 22px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.pilot-dock-button.active {
  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(255, 255, 255, 0.34),
      transparent 58%
    ),
    linear-gradient(180deg, #d8ffe4, #5aff98 56%, #1d8f5a);
  box-shadow:
    0 8px 0 #11643a,
    0 0 24px rgba(90, 255, 152, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.pilot-dock-button:active {
  transform: translateY(5px);
  box-shadow:
    0 3px 0 #0b3f70,
    0 10px 16px rgba(0, 0, 0, 0.2);
}

.pilot-school-redesign .pilot-view-ship {
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.42))
    drop-shadow(0 0 10px rgba(126, 231, 255, 0.24));
  width: 122px;
  height: 122px;
  isolation: isolate;
  transform-origin: center;
  transition:
    filter 140ms ease-out,
    width 0.45s ease,
    height 0.45s ease,
    transform 0.45s ease;
}

.pilot-school-redesign .pilot-view-ship img {
  position: relative;
  z-index: 3;
  transform: rotate(0deg) scale(1.12);
  filter: saturate(1.08) contrast(1.05)
    drop-shadow(0 0 8px rgba(126, 231, 255, 0.22));
}

.pilot-school-redesign .pilot-view-ship::after {
  z-index: 0;
  left: auto;
  right: 82%;
  top: 55%;
  width: calc(34px + var(--pilot-thrust, 0) * 92px);
  height: calc(12px + var(--pilot-thrust, 0) * 12px);
  transform: translateY(-50%) rotate(-2deg);
  border-radius: 999px;
  background:
    radial-gradient(
      circle at 92% 50%,
      rgba(255, 255, 255, 0.88),
      rgba(255, 225, 120, 0.72) 22%,
      rgba(255, 128, 38, 0.42) 44%,
      transparent 72%
    ),
    linear-gradient(90deg, transparent, rgba(126, 231, 255, 0.22));
  opacity: calc(0.06 + var(--pilot-thrust, 0) * 0.54);
  filter: blur(0.2px) drop-shadow(0 0 18px rgba(255, 153, 61, 0.54));
}

.pilot-school-redesign .pilot-view-ship > span {
  z-index: 1;
  left: calc(-48px - var(--pilot-thrust, 0) * 42px);
  top: 56%;
  width: calc(52px + var(--pilot-thrust, 0) * 78px);
  height: calc(16px + var(--pilot-thrust, 0) * 20px);
  transform: translateY(-50%) rotate(-2deg);
  border-radius: 999px 26px 26px 999px;
  background:
    radial-gradient(
      circle at 90% 50%,
      #fffef4,
      #fff4a8 18%,
      #ff9a30 42%,
      rgba(255, 72, 23, 0.18) 62%,
      transparent 78%
    ),
    linear-gradient(90deg, rgba(126, 231, 255, 0), rgba(255, 154, 52, 0.76));
}

.pilot-school-redesign .pilot-view-ship.backing-up::after,
.pilot-school-redesign .pilot-view-ship.backing-up > span {
  opacity: 0 !important;
  animation: none;
}

.pilot-school-redesign .pilot-view-ship.backing-up::before {
  inset: 36px 72px 34px -10px;
  background:
    radial-gradient(
      circle at 20% 50%,
      rgba(199, 246, 255, 0.7),
      transparent 52%
    ),
    radial-gradient(
      circle at 72% 35%,
      rgba(126, 231, 255, 0.42),
      transparent 58%
    );
  opacity: 0.72;
  filter: drop-shadow(0 0 14px rgba(126, 231, 255, 0.42));
}

.pilot-school-redesign .pilot-star-target {
  width: 138px;
  height: 96px;
  border: 0;
  border-radius: 16px;
  background:
    radial-gradient(
      circle at 50% 50%,
      rgba(126, 231, 255, 0.12),
      transparent 66%
    ),
    rgba(5, 12, 23, 0.24);
  color: #d8f7ff;
  box-shadow: none;
}

.pilot-docking-lane {
  position: absolute;
  z-index: 1;
  left: 43%;
  right: 16%;
  top: 46%;
  height: 46px;
  border-top: 2px dashed rgba(126, 231, 255, 0.18);
  border-radius: 50%;
  transform: rotate(-10deg);
  opacity: 0;
  pointer-events: none;
}

.pilot-docking-lane::after {
  content: "";
  position: absolute;
  right: -4px;
  top: -8px;
  width: 14px;
  height: 14px;
  border-top: 3px solid rgba(126, 231, 255, 0.35);
  border-right: 3px solid rgba(126, 231, 255, 0.35);
  transform: rotate(45deg);
}

.pilot-docking-lane.on {
  border-color: rgba(90, 255, 152, 0.6);
  opacity: 0.72;
  filter: drop-shadow(0 0 8px rgba(90, 255, 152, 0.3));
}

.pilot-docking-lane.on::after {
  border-color: rgba(90, 255, 152, 0.72);
}

.pilot-school-redesign .pilot-star-target img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(126, 231, 255, 0.28))
    drop-shadow(0 10px 18px rgba(0, 0, 0, 0.36));
}

.pilot-school-redesign .pilot-star-target span {
  position: absolute;
  left: 50%;
  bottom: -10px;
  transform: translateX(-50%);
  padding: 3px 8px;
  border: 1px solid rgba(126, 231, 255, 0.28);
  border-radius: 999px;
  background: rgba(5, 12, 23, 0.76);
  color: #d8f7ff;
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: 0;
}

.pilot-school-redesign .pilot-star-target::before,
.pilot-school-redesign .pilot-star-target::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.pilot-school-redesign .pilot-star-target::after {
  inset: 28px;
}

.pilot-school-redesign .pilot-star-target.on img {
  filter: drop-shadow(0 0 18px rgba(126, 231, 255, 0.58))
    drop-shadow(0 0 28px rgba(90, 255, 152, 0.28))
    drop-shadow(0 10px 18px rgba(0, 0, 0, 0.36));
}

@keyframes schematic-next-pulse {
  from {
    transform: translateY(-1px);
  }
  to {
    transform: translateY(-4px);
  }
}

.support-toggle-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.support-toggle-row button {
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 4px;
  background: linear-gradient(180deg, #334154, #182232);
  color: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.22);
}

.support-toggle-row button.on {
  border-color: rgba(90, 255, 152, 0.48);
  background:
    radial-gradient(circle at 50% 0, rgba(90, 255, 152, 0.24), transparent 65%),
    linear-gradient(180deg, #274e42, #162b27);
  color: #d8ffe4;
}

.support-toggle-row button span {
  font-size: 11px;
  font-weight: 900;
  opacity: 0.78;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .pilot-school-redesign {
    grid-template-rows: 29vh 1fr;
    padding: 66px 10px 10px;
  }

  .engineering-console {
    grid-template-columns: 1fr;
    overflow: auto;
    align-content: start;
  }

  .engineering-console .pilot-board-column {
    margin-bottom: 10px;
  }

  .rocket-schematic {
    grid-template-columns: 1fr 1fr;
    min-height: 0;
  }

  .rocket-schematic::before,
  .rocket-schematic-part b {
    display: none;
  }

  .rocket-schematic-part {
    min-height: 132px;
    grid-template-rows: 60px auto auto;
    padding: 10px 8px;
  }

  .rocket-schematic.pilot-board-image {
    grid-template-columns: 1fr 1fr;
  }

  .pilot-board-image .rocket-schematic-part {
    min-height: 132px;
  }

  .schematic-icon {
    width: 54px;
    height: 54px;
  }

  .pilot-school-redesign .pilot-view-readout {
    max-width: 72%;
  }

  .pilot-docking-meter {
    right: 14px;
    bottom: 10px;
    width: 132px;
    min-height: 40px;
    padding: 6px 8px;
  }

  .pilot-docking-meter span {
    font-size: 10px;
  }

  .pilot-docking-meter strong {
    font-size: 18px;
  }
}

@media (max-width: 700px) {
  .pilot-level {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .pilot-school-redesign {
    min-height: 100svh;
    height: auto;
    grid-template-rows: 200px auto;
    gap: 8px;
    padding: 66px 8px 8px;
  }

  .pilot-school-redesign .pilot-front-view {
    border-width: 7px;
    border-radius: 14px;
  }

  .pilot-school-redesign .pilot-window-monitor {
    width: 116px;
    min-height: 50px;
    padding: 7px 9px;
  }

  .pilot-school-redesign .pilot-window-monitor strong {
    font-size: 12px;
  }

  .pilot-school-redesign .pilot-window-monitor span {
    font-size: 12px;
  }

  .pilot-school-redesign .pilot-star-target {
    right: 9%;
    top: 36%;
    width: 94px;
    height: 68px;
    font-size: 11px;
  }

  .pilot-school-redesign .pilot-view-ship {
    width: 82px;
    height: 82px;
  }

  .pilot-docking-lane {
    left: 42%;
    right: 20%;
    top: 50%;
    height: 30px;
  }

  .pilot-school-redesign .pilot-view-readout {
    left: 18px;
    right: auto;
    bottom: 12px;
    max-width: 52%;
    padding: 8px 11px;
    background: rgba(5, 11, 20, 0.82);
  }

  .pilot-school-redesign .pilot-view-readout strong {
    font-size: 17px;
  }

  .pilot-school-redesign .pilot-view-readout span {
    display: none;
  }

  .engineering-console {
    display: block;
    overflow: visible;
    padding: 10px;
  }

  .engineering-console .pilot-board-column {
    display: grid;
    margin-bottom: 10px;
  }

  .engineering-brief .pilot-lesson {
    min-height: 74px;
    padding: 10px 12px;
  }

  .engineering-brief .pilot-lesson strong {
    font-size: 20px;
  }

  .engineering-brief .pilot-lesson span {
    font-size: 13px;
    line-height: 1.2;
  }

  .pilot-engine-strip {
    gap: 6px;
    padding: 6px;
  }

  .pilot-engine-strip span {
    min-height: 36px;
    grid-template-columns: 18px 1fr;
    padding: 0 6px;
    font-size: 10px;
  }

  .pilot-engine-strip i {
    width: 18px;
    height: 18px;
    font-size: 10px;
  }

  .rocket-schematic {
    gap: 8px;
    padding: 8px;
  }

  .rocket-schematic-part {
    min-height: 96px;
    gap: 4px;
    grid-template-rows: 42px auto auto;
  }

  .pilot-board-image .rocket-schematic-part {
    min-height: 104px;
    grid-template-rows: 42px auto auto;
  }

  .rocket-schematic-part strong {
    font-size: 12px;
  }

  .rocket-schematic-part em {
    font-size: 10px;
  }

  .schematic-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .schematic-icon.electricity::before {
    left: 18px;
    top: 8px;
    height: 32px;
  }

  .big-throttle {
    min-height: 64px;
  }

  .pilot-meter-row {
    min-height: 50px;
  }

  .pilot-steer-pad button,
  .support-toggle-row button {
    min-height: 52px;
    font-size: 15px;
  }
}

/* Round-3: surfaces window.__spaceErrors so kids on a broken level see
   a recovery affordance instead of staring at a blank screen. */
.space-error-toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9000;
  padding: 16px 24px;
  min-height: 56px;
  border-radius: 999px;
  background: rgba(20, 32, 48, 0.92);
  color: #fff8d8;
  border: 2px solid rgba(255, 200, 88, 0.85);
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  touch-action: manipulation;
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  animation: space-error-toast-pulse 1.6s ease-in-out infinite;
}
.space-error-toast span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.82;
}
.space-error-toast:active {
  transform: translateX(-50%) scale(0.96);
}
@keyframes space-error-toast-pulse {
  0%,
  100% {
    box-shadow:
      0 8px 22px rgba(0, 0, 0, 0.45),
      0 0 0 0 rgba(255, 200, 88, 0.4);
  }
  50% {
    box-shadow:
      0 8px 22px rgba(0, 0, 0, 0.45),
      0 0 0 10px rgba(255, 200, 88, 0);
  }
}

/* ---------- Alien Language Explorer ---------- */
.alien-language-level {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 12%, rgba(78, 220, 255, 0.16), transparent 34%),
    radial-gradient(circle at 82% 72%, rgba(255, 214, 107, 0.12), transparent 32%),
    linear-gradient(135deg, #060713 0%, #10162a 46%, #081120 100%);
  color: #eef7ff;
}

.alien-language-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100vw - 40px));
  height: min(760px, calc(100vh - 88px));
  margin: 70px auto 18px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: 16px;
}

.alien-decoder-panel,
.alien-archive-panel,
.alien-guide-card {
  border: 1px solid rgba(173, 232, 255, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(244, 250, 255, 0.1), rgba(8, 15, 31, 0.72)),
    rgba(9, 17, 34, 0.88);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
}

.alien-decoder-panel {
  padding: 24px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.alien-kicker,
.alien-guide-card header span {
  color: #8feaff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.alien-decoder-panel h1,
.alien-guide-card h2 {
  margin: 8px 0 10px;
  font-family: "Fraunces", serif;
  font-weight: 500;
  line-height: 0.96;
}

.alien-decoder-panel h1 {
  max-width: 12ch;
  font-size: clamp(2.4rem, 5.4vw, 5.6rem);
}

.alien-decoder-panel p {
  max-width: 56ch;
  color: rgba(238, 247, 255, 0.72);
  line-height: 1.55;
}
.alien-kid-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.alien-kid-steps span {
  min-height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 214, 107, 0.14);
  border: 1px solid rgba(255, 214, 107, 0.26);
  color: #fff3c7;
  font-weight: 1000;
}

.alien-decoder-stage {
  margin-top: 20px;
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(180px, 0.72fr);
  gap: 14px;
  min-height: 230px;
}

.alien-specimen {
  position: relative;
  min-height: 220px;
  border: 1px solid rgba(143, 234, 255, 0.2);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(rgba(143, 234, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(143, 234, 255, 0.06) 1px, transparent 1px),
    radial-gradient(circle at 50% 48%, rgba(124, 255, 206, 0.2), transparent 38%),
    rgba(2, 8, 18, 0.72);
  background-size: 34px 34px, 34px 34px, auto, auto;
}

.alien-orbit-ring {
  position: absolute;
  inset: 25px;
  border: 1px dashed rgba(255, 214, 107, 0.42);
  border-radius: 50%;
  animation: spin 24s linear infinite;
}

.alien-main-glyph {
  position: absolute;
  inset: 26px 18px 66px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  place-items: center;
}

.alien-main-glyph span {
  width: 100%;
  min-height: 56px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(143, 234, 255, 0.28);
  border-radius: 8px;
  color: #d9fbff;
  background: rgba(143, 234, 255, 0.08);
  box-shadow: inset 0 0 20px rgba(143, 234, 255, 0.08);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(1.35rem, 3vw, 2.25rem);
  font-weight: 800;
}

.alien-waveform {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  height: 46px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 7px;
}

.alien-waveform i {
  width: 8px;
  border-radius: 999px 999px 2px 2px;
  background: linear-gradient(180deg, #ffd66b, #62f3ff);
  box-shadow: 0 0 16px rgba(98, 243, 255, 0.38);
}

.alien-guide-card.locked .alien-specimen,
.alien-guide-card.locked .alien-guide-grid,
.alien-guide-card.locked .alien-guide-note {
  filter: saturate(0.45);
  opacity: 0.72;
}

.alien-evidence-stack {
  display: grid;
  gap: 10px;
}

.alien-evidence-stack span,
.alien-options button,
.alien-guide-grid div,
.alien-guide-note {
  border: 1px solid rgba(238, 247, 255, 0.16);
  border-radius: 8px;
  background: rgba(238, 247, 255, 0.07);
}

.alien-evidence-stack span {
  min-height: 64px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(238, 247, 255, 0.86);
  font-weight: 700;
}

.alien-evidence-stack b {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(143, 234, 255, 0.14);
  color: #8feaff;
  font-size: 0.78rem;
}

.alien-decoder-message {
  margin-top: 14px;
  min-height: 58px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 214, 107, 0.24);
  border-radius: 8px;
  background: rgba(255, 214, 107, 0.08);
  color: #fff3c7;
  display: flex;
  align-items: center;
}

.alien-decoder-message.solved {
  border-color: rgba(124, 255, 206, 0.34);
  background: rgba(124, 255, 206, 0.1);
  color: #d8fff5;
}

.alien-decoder-message.miss {
  border-color: rgba(255, 140, 140, 0.34);
  background: rgba(255, 140, 140, 0.1);
  color: #ffd6d6;
}

.alien-options {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.alien-options button {
  min-height: 128px;
  padding: 12px;
  color: #eef7ff;
  text-align: center;
  cursor: pointer;
  display: grid;
  place-items: center;
  gap: 4px;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.alien-options button:hover,
.alien-options button:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(143, 234, 255, 0.48);
  background: rgba(143, 234, 255, 0.12);
}

.alien-options button .alien-option-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  margin: 0;
  border-radius: 50%;
  background: rgba(143, 234, 255, 0.12);
  color: #fff3c7;
  font-size: 2rem;
  letter-spacing: 0;
  text-transform: none;
}

.alien-options button strong {
  color: #eef7ff;
  font-size: 1.05rem;
  line-height: 1.08;
}

.alien-options button small {
  color: rgba(238, 247, 255, 0.62);
  font-size: 0.76rem;
  font-weight: 800;
}

.alien-options button.correct {
  border-color: rgba(124, 255, 206, 0.58);
  background: rgba(124, 255, 206, 0.16);
}

.alien-options button.wrong {
  border-color: rgba(255, 140, 140, 0.46);
  animation: planet-sort-wiggle 0.36s ease-in-out;
}

.alien-options button:disabled {
  cursor: default;
}

.alien-decoder-actions {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.alien-progress {
  margin-right: auto;
  display: flex;
  gap: 8px;
}

.alien-progress span {
  width: 36px;
  height: 7px;
  border-radius: 999px;
  background: rgba(238, 247, 255, 0.18);
}

.alien-progress span.on {
  background: linear-gradient(90deg, #62f3ff, #ffd66b);
}

.alien-decoder-actions button {
  border: 0;
  border-radius: 8px;
  min-height: 54px;
  padding: 12px 18px;
  background: #ffd66b;
  color: #161106;
  font-size: 1rem;
  font-weight: 1000;
  cursor: pointer;
}

.alien-decoder-actions button + button {
  background: rgba(238, 247, 255, 0.12);
  color: #eef7ff;
}

.alien-archive-panel {
  min-height: 0;
  padding: 14px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.alien-archive-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.alien-archive-tabs button {
  height: 38px;
  border: 1px solid rgba(238, 247, 255, 0.14);
  border-radius: 8px;
  background: rgba(238, 247, 255, 0.07);
  color: #eef7ff;
  font-weight: 900;
  cursor: pointer;
}

.alien-archive-tabs button.on {
  border-color: rgba(255, 214, 107, 0.54);
  background: rgba(255, 214, 107, 0.16);
}

.alien-guide-card {
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

.alien-guide-card header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  align-items: start;
}

.alien-guide-card header span {
  grid-column: 1 / -1;
}

.alien-guide-card h2 {
  font-size: clamp(1.6rem, 3vw, 2.55rem);
}

.alien-guide-card header small {
  align-self: center;
  border: 1px solid rgba(143, 234, 255, 0.32);
  border-radius: 999px;
  padding: 7px 10px;
  color: #8feaff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 900;
}

.alien-guide-card .alien-specimen {
  margin: 12px 0;
  min-height: 190px;
}

.alien-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.alien-guide-grid div,
.alien-guide-note {
  padding: 12px;
}

.alien-guide-grid strong,
.alien-guide-note strong {
  display: block;
  margin-bottom: 7px;
  color: #8feaff;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.alien-guide-grid p,
.alien-guide-note p {
  color: rgba(238, 247, 255, 0.82);
  line-height: 1.42;
}

.alien-guide-note {
  margin-top: 10px;
}

@media (max-width: 860px) {
  .alien-language-shell {
    width: min(100vw - 22px, 620px);
    height: calc(100vh - 76px);
    margin-top: 64px;
    grid-template-columns: 1fr;
    overflow: auto;
    padding-bottom: 18px;
  }

  .alien-decoder-panel {
    min-height: auto;
    padding: 18px;
  }

  .alien-decoder-panel h1 {
    max-width: 14ch;
    font-size: clamp(2rem, 12vw, 3.2rem);
  }

  .alien-decoder-stage,
  .alien-options,
  .alien-guide-grid {
    grid-template-columns: 1fr;
  }

  .alien-specimen {
    min-height: 190px;
  }

  .alien-archive-panel {
    min-height: 620px;
  }
}

/* ---------- Phaser Moon Aliens ---------- */
.moon-aliens-level {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 12%, rgba(119, 244, 255, 0.18), transparent 30%),
    radial-gradient(circle at 80% 34%, rgba(199, 162, 255, 0.12), transparent 30%),
    linear-gradient(145deg, #050714 0%, #0d1224 58%, #11182d 100%);
  color: #eef7ff;
}

.moon-aliens-frame {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100vw - 36px));
  height: min(760px, calc(100vh - 88px));
  margin: 70px auto 18px;
  border: 1px solid rgba(143, 234, 255, 0.22);
  border-radius: 8px;
  overflow: hidden;
  background: #050714;
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.44),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.moon-aliens-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 50%, transparent 50%),
    radial-gradient(circle at 50% 50%, transparent 46%, rgba(0, 0, 0, 0.2) 100%);
  background-size: 100% 4px, auto;
  mix-blend-mode: screen;
  opacity: 0.45;
}

.moon-aliens-game {
  position: absolute;
  inset: 0;
}

.moon-aliens-game canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.moon-aliens-hud {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 16px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid rgba(238, 247, 255, 0.18);
  border-radius: 8px;
  background: rgba(7, 12, 24, 0.72);
  backdrop-filter: blur(14px);
}

.moon-aliens-hud span {
  grid-column: 1 / -1;
  color: #8feaff;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.moon-aliens-hud strong {
  color: #eef7ff;
  font-size: clamp(0.92rem, 2vw, 1.1rem);
  line-height: 1.35;
}

.moon-aliens-progress {
  display: flex;
  gap: 8px;
}

.moon-aliens-progress i {
  width: 34px;
  height: 8px;
  border-radius: 999px;
  background: rgba(238, 247, 255, 0.22);
}

.moon-aliens-progress i.on {
  background: linear-gradient(90deg, #77f4ff, #ffd66b);
  box-shadow: 0 0 16px rgba(119, 244, 255, 0.32);
}

.moon-aliens-replay {
  grid-column: 2;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: #ffd66b;
  color: #161106;
  font-family: inherit;
  font-weight: 900;
  cursor: pointer;
}

.moon-aliens-replay:hover,
.moon-aliens-replay:focus-visible {
  filter: brightness(1.06);
}

@media (max-width: 700px) {
  .moon-aliens-frame {
    width: calc(100vw - 22px);
    height: calc(100vh - 78px);
    margin-top: 64px;
  }

  .moon-aliens-hud {
    left: 10px;
    right: 10px;
    bottom: 10px;
    grid-template-columns: 1fr;
  }

  .moon-aliens-replay {
    grid-column: 1;
    justify-self: start;
  }
}

/* ---------- Phaser Moon Garden Rescue ---------- */
.moon-garden-level {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 16%, rgba(149, 255, 191, 0.16), transparent 30%),
    radial-gradient(circle at 84% 30%, rgba(116, 215, 255, 0.13), transparent 30%),
    linear-gradient(145deg, #06101c 0%, #0c1525 58%, #111c2d 100%);
  color: #f7fbff;
}

.moon-garden-frame {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100vw - 36px));
  height: min(760px, calc(100vh - 88px));
  margin: 70px auto 18px;
  border: 1px solid rgba(149, 255, 191, 0.24);
  border-radius: 8px;
  overflow: hidden;
  background: #06101c;
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.44),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.moon-garden-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.022) 50%, transparent 50%),
    radial-gradient(circle at 50% 50%, transparent 48%, rgba(0, 0, 0, 0.2) 100%);
  background-size: 100% 4px, auto;
  mix-blend-mode: screen;
  opacity: 0.38;
}

.moon-garden-game {
  position: absolute;
  inset: 0;
}

.moon-garden-game canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.moon-garden-hud {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 16px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid rgba(247, 251, 255, 0.18);
  border-radius: 8px;
  background: rgba(6, 13, 25, 0.72);
  backdrop-filter: blur(14px);
}

.moon-garden-hud span {
  grid-column: 1 / -1;
  color: #95ffbf;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.moon-garden-hud strong {
  color: #f7fbff;
  font-size: clamp(0.92rem, 2vw, 1.1rem);
  line-height: 1.35;
}

.moon-garden-progress {
  display: flex;
  gap: 8px;
}

.moon-garden-progress i {
  width: 34px;
  height: 8px;
  border-radius: 999px;
  background: rgba(247, 251, 255, 0.22);
}

.moon-garden-progress i.on {
  background: linear-gradient(90deg, #95ffbf, #74d7ff, #fff08a);
  box-shadow: 0 0 16px rgba(149, 255, 191, 0.32);
}

.moon-garden-replay {
  grid-column: 2;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: #95ffbf;
  color: #092013;
  font-family: inherit;
  font-weight: 900;
  cursor: pointer;
}

.moon-garden-replay:hover,
.moon-garden-replay:focus-visible {
  filter: brightness(1.06);
}

@media (max-width: 700px) {
  .moon-garden-frame {
    width: calc(100vw - 22px);
    height: calc(100vh - 78px);
    margin-top: 64px;
  }

  .moon-garden-hud {
    left: 10px;
    right: 10px;
    bottom: 10px;
    grid-template-columns: 1fr;
  }

  .moon-garden-replay {
    grid-column: 1;
    justify-self: start;
  }
}

/* ---------- Phaser Meteor Shield ---------- */
.meteor-shield-level {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 16%, rgba(126, 231, 255, 0.15), transparent 30%),
    radial-gradient(circle at 84% 30%, rgba(255, 179, 92, 0.11), transparent 30%),
    linear-gradient(145deg, #07101d 0%, #11182a 58%, #151b2d 100%);
  color: #f7fbff;
}

.meteor-shield-frame {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100vw - 36px));
  height: min(800px, calc(100vh - 88px));
  margin: 70px auto 18px;
  border: 1px solid rgba(126, 231, 255, 0.24);
  border-radius: 8px;
  overflow: hidden;
  background: #07101d;
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.44),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.meteor-shield-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.022) 50%, transparent 50%),
    radial-gradient(circle at 50% 50%, transparent 48%, rgba(0, 0, 0, 0.2) 100%);
  background-size: 100% 4px, auto;
  mix-blend-mode: screen;
  opacity: 0.38;
}

.meteor-shield-game {
  position: absolute;
  inset: 0;
}

.meteor-shield-game canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.meteor-shield-hud {
  position: absolute;
  left: auto;
  right: 18px;
  top: 18px;
  bottom: auto;
  z-index: 3;
  width: min(480px, calc(100% - 36px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px 16px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid rgba(247, 251, 255, 0.18);
  border-radius: 8px;
  background: rgba(6, 13, 25, 0.82);
  backdrop-filter: blur(14px);
}

.meteor-shield-hud span {
  grid-column: 1 / -1;
  color: #7ee7ff;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.meteor-shield-hud strong {
  color: #f7fbff;
  font-size: clamp(0.92rem, 2vw, 1.1rem);
  line-height: 1.35;
}

.meteor-shield-hud em {
  color: #ffdf7e;
  font-size: 0.9rem;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.meteor-shield-progress {
  display: flex;
  gap: 6px;
}

.meteor-shield-progress i {
  width: 26px;
  height: 8px;
  border-radius: 999px;
  background: rgba(247, 251, 255, 0.22);
}

.meteor-shield-progress i.on {
  background: linear-gradient(90deg, #7ee7ff, #ffb35c);
  box-shadow: 0 0 16px rgba(126, 231, 255, 0.32);
}

.meteor-shield-replay {
  border: 0;
  border-radius: 8px;
  min-height: 42px;
  padding: 10px 14px;
  background: #7ee7ff;
  color: #07101d;
  font-family: inherit;
  font-weight: 900;
  cursor: pointer;
}

.meteor-shield-replay:hover,
.meteor-shield-replay:focus-visible {
  filter: brightness(1.06);
}

@media (max-width: 700px) {
  .meteor-shield-frame {
    width: calc(100vw - 22px);
    height: calc(100vh - 78px);
    margin-top: 64px;
  }

  .meteor-shield-hud {
    left: 10px;
    right: 10px;
    top: 10px;
    width: auto;
    grid-template-columns: 1fr auto;
    padding: 12px;
  }

  .meteor-shield-hud strong {
    grid-column: 1 / -1;
  }

  .meteor-shield-replay {
    justify-self: start;
  }
}
