/* ---------- Overview ---------- */
body.scene-transition-active::before,
body.scene-transition-active::after {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  pointer-events: none;
  content: "";
}

body.scene-transition-active::before {
  background:
    linear-gradient(90deg, transparent 0 18%, rgba(126, 231, 255, 0.26) 46%, transparent 78%),
    linear-gradient(180deg, rgba(5, 10, 30, 0.18), rgba(5, 10, 30, 0.72), rgba(5, 10, 30, 0.18));
  animation: scene-transition-warp 340ms ease-out both;
}

body.scene-transition-active::after {
  background:
    repeating-linear-gradient(
      105deg,
      transparent 0 26px,
      rgba(255, 226, 121, 0.26) 27px 29px,
      transparent 30px 72px
    );
  mix-blend-mode: screen;
  animation: scene-transition-streaks 340ms ease-out both;
}

body.scene-transition-launch::before {
  background:
    linear-gradient(90deg, transparent 0 16%, rgba(255, 226, 121, 0.24) 42%, rgba(126, 231, 255, 0.28) 58%, transparent 82%),
    linear-gradient(180deg, rgba(5, 10, 30, 0.2), rgba(5, 10, 30, 0.7), rgba(5, 10, 30, 0.2));
}

body.scene-transition-return::before,
body.scene-transition-return::after {
  animation-direction: reverse;
}

@keyframes scene-transition-warp {
  0% {
    opacity: 0;
    transform: scaleX(0.15);
  }
  38% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scaleX(1);
  }
}

@keyframes scene-transition-streaks {
  0% {
    opacity: 0;
    transform: translateX(-18%) skewX(-8deg);
  }
  44% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translateX(18%) skewX(-8deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.scene-transition-active::before {
    animation: scene-transition-soft-fade 180ms ease-out both;
  }

  body.scene-transition-active::after {
    display: none;
  }
}

@keyframes scene-transition-soft-fade {
  0% {
    opacity: 0;
  }
  45% {
    opacity: 0.58;
  }
  100% {
    opacity: 0;
  }
}

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

.hub-ambient-comet {
  position: fixed;
  z-index: 620;
  left: -170px;
  top: var(--ambient-comet-top);
  width: clamp(82px, 15vw, 154px);
  min-height: 64px;
  border: 0;
  padding: 0;
  background: transparent;
  pointer-events: auto;
  cursor: pointer;
  opacity: 0;
  transform: translate3d(0, 0, 0) scale(var(--ambient-comet-scale));
  animation: hub-ambient-comet-fly 5.4s linear both;
  touch-action: manipulation;
}
.hub-ambient-comet.reverse {
  left: auto;
  right: -170px;
  animation-name: hub-ambient-comet-fly-reverse;
}
.hub-ambient-comet:focus-visible {
  outline: 4px solid rgba(126, 231, 255, 0.82);
  outline-offset: 5px;
}
.hub-ambient-comet.caught {
  pointer-events: none;
  animation-play-state: paused;
}
.hub-ambient-comet-img {
  width: 100%;
  height: auto;
  filter:
    drop-shadow(0 0 18px rgba(255, 214, 107, 0.56))
    drop-shadow(0 8px 20px rgba(0, 0, 0, 0.26));
}
.hub-ambient-comet.reverse .hub-ambient-comet-img {
  transform: scaleX(-1);
}
.hub-ambient-comet.caught .hub-ambient-comet-img {
  animation: hub-ambient-comet-pop 0.85s ease-out both;
}
.hub-ambient-comet-caught {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  min-width: 118px;
  border: 1px solid rgba(255, 214, 107, 0.4);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(13, 12, 32, 0.84);
  color: #fff7d8;
  font-size: 15px;
  font-weight: 1000;
  line-height: 1;
  transform: translate(-50%, -50%);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  animation: hub-ambient-wish-pop 0.9s ease-out both;
}
.hub-ambient-comet-sparkles {
  position: absolute;
  inset: -22%;
  z-index: 2;
  pointer-events: none;
}
.hub-ambient-comet-sparkle {
  position: absolute;
  width: 32%;
  height: auto;
  opacity: 0;
  animation: hub-ambient-sparkle-pop 0.9s ease-out both;
}
.hub-ambient-comet-sparkle.sparkle-1 {
  left: 4%;
  top: 8%;
}
.hub-ambient-comet-sparkle.sparkle-2 {
  right: 1%;
  top: 22%;
  animation-delay: 0.08s;
}
.hub-ambient-comet-sparkle.sparkle-3 {
  left: 16%;
  bottom: 2%;
  animation-delay: 0.14s;
}
.hub-ambient-comet-sparkle.sparkle-4 {
  right: 18%;
  bottom: 6%;
  animation-delay: 0.2s;
}
@keyframes hub-ambient-comet-fly {
  0% {
    opacity: 0;
    transform: translate3d(0, 18px, 0) scale(var(--ambient-comet-scale))
      rotate(-9deg);
  }
  12%,
  78% {
    opacity: 0.92;
  }
  100% {
    opacity: 0;
    transform: translate3d(calc(100vw + 340px), -44px, 0)
      scale(var(--ambient-comet-scale)) rotate(-9deg);
  }
}
@keyframes hub-ambient-comet-fly-reverse {
  0% {
    opacity: 0;
    transform: translate3d(0, 18px, 0) scale(var(--ambient-comet-scale))
      rotate(9deg);
  }
  12%,
  78% {
    opacity: 0.92;
  }
  100% {
    opacity: 0;
    transform: translate3d(calc(-100vw - 340px), -44px, 0)
      scale(var(--ambient-comet-scale)) rotate(9deg);
  }
}
@keyframes hub-ambient-comet-pop {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  35% {
    opacity: 1;
    transform: scale(1.22) rotate(-5deg);
  }
  100% {
    opacity: 0;
    transform: scale(0.58) rotate(10deg);
  }
}
@keyframes hub-ambient-wish-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -35%) scale(0.72);
  }
  20%,
  72% {
    opacity: 1;
    transform: translate(-50%, -62%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -96%) scale(0.84);
  }
}
@keyframes hub-ambient-sparkle-pop {
  0% {
    opacity: 0;
    transform: scale(0.38) rotate(-16deg);
  }
  28%,
  70% {
    opacity: 1;
    transform: scale(1) rotate(8deg);
  }
  100% {
    opacity: 0;
    transform: scale(1.28) rotate(24deg);
  }
}

.mission-badge-alien-cameo {
  position: fixed;
  right: clamp(16px, 5vw, 42px);
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 2200;
  display: grid;
  grid-template-columns: 74px auto;
  align-items: center;
  gap: 10px;
  max-width: min(320px, calc(100vw - 32px));
  padding: 10px 14px 10px 10px;
  border: 1px solid rgba(255, 214, 107, 0.36);
  border-radius: 999px;
  background: rgba(13, 18, 36, 0.9);
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.34),
    0 0 22px rgba(255, 214, 107, 0.14);
  pointer-events: none;
  animation: mission-badge-alien-pop 3.4s ease-in-out both;
}
.mission-badge-alien-cameo.helper-1 {
  right: auto;
  left: clamp(16px, 5vw, 42px);
}
.mission-badge-alien-cameo.helper-2 {
  bottom: max(104px, calc(env(safe-area-inset-bottom) + 82px));
}
.mission-badge-alien-img {
  width: 74px;
  height: auto;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.34));
}
.mission-badge-alien-cameo span {
  min-width: 0;
  color: #fff7d8;
  font-size: 16px;
  font-weight: 1000;
  line-height: 1.05;
}
@keyframes mission-badge-alien-pop {
  0% {
    opacity: 0;
    transform: translate3d(42px, 16px, 0) scale(0.72) rotate(8deg);
  }
  16% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1.05) rotate(-5deg);
  }
  30%,
  62% {
    opacity: 1;
    transform: translate3d(0, -5px, 0) scale(1) rotate(3deg);
  }
  48% {
    transform: translate3d(0, 0, 0) scale(1.05) rotate(-4deg);
  }
  100% {
    opacity: 0;
    transform: translate3d(36px, 12px, 0) scale(0.82) rotate(8deg);
  }
}

.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-sprite img:not(.solar-rocket-fire) {
  filter: var(--solar-rocket-part-filter);
}
.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;
}
.menu-map-heading em {
  grid-column: 1 / -1;
  color: rgba(237, 246, 255, 0.82);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.25;
}
.menu-map-heading small {
  color: rgba(237, 246, 255, 0.68);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}
.menu-map-heading p {
  grid-column: 1 / -1;
  margin: -6px 0 0;
  color: #c9f6ff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.25;
}
.game-map-jumps {
  position: sticky;
  top: -12px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 6px 0;
  background: linear-gradient(180deg, rgba(6, 7, 18, 0.98), rgba(6, 7, 18, 0.84));
}
.mission-route-ribbon {
  position: relative;
  flex: 1 1 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(126, 231, 255, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(126, 231, 255, 0.16), transparent 34%, rgba(255, 214, 107, 0.12) 66%, transparent),
    rgba(8, 14, 34, 0.72);
}
.mission-route-ribbon::before {
  position: absolute;
  left: 34px;
  right: 34px;
  top: 50%;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, rgba(126, 231, 255, 0.22), rgba(255, 214, 107, 0.48), rgba(126, 231, 255, 0.22));
  transform: translateY(-50%);
}
.mission-route-ribbon button {
  position: relative;
  z-index: 1;
  min-height: 60px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(237, 246, 255, 0.18);
  border-radius: 8px;
  background: rgba(7, 12, 30, 0.82);
  color: #edf6ff;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.mission-route-ribbon button.on {
  border-color: rgba(255, 214, 107, 0.72);
  background: rgba(255, 214, 107, 0.16);
  box-shadow: 0 0 24px rgba(255, 214, 107, 0.22);
}
.mission-route-number {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(126, 231, 255, 0.18);
  color: #c9f6ff;
  font-size: 15px;
  font-weight: 1000;
}
.mission-route-ribbon button.on .mission-route-number {
  background: #ffd66b;
  color: #211043;
}
.mission-route-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.mission-route-copy strong {
  overflow: hidden;
  color: #fff7d8;
  font-size: 14px;
  font-weight: 1000;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mission-route-copy small {
  overflow: hidden;
  color: rgba(237, 246, 255, 0.72);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.16;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.game-map-jumps > button {
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(237, 246, 255, 0.78);
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  padding: 9px 14px;
  cursor: pointer;
}
.game-map-jumps > button span {
  min-width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  margin-left: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  font-size: 11px;
}
.game-map-jumps > button:hover,
.game-map-jumps > button:focus-visible,
.game-map-jumps > button.on {
  border-color: rgba(255, 214, 107, 0.48);
  background: rgba(255, 214, 107, 0.16);
  color: #fff7d8;
}
.game-map-jumps > button:focus-visible,
.mission-route-ribbon button:focus-visible {
  outline: 2px solid rgba(126, 231, 255, 0.82);
  outline-offset: 3px;
}
.game-map-window {
  position: relative;
  display: grid;
  gap: 14px;
  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;
}
.game-map-group {
  display: grid;
  gap: 8px;
}
.game-map-group-heading {
  display: grid;
  gap: 2px;
}
.game-map-group-heading strong {
  color: #fff7d8;
  font-size: 13px;
  font-weight: 1000;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.game-map-group-heading small {
  color: rgba(237, 246, 255, 0.66);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}
.game-map-group-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.game-map-empty {
  min-height: 160px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(5, 8, 22, 0.34);
  color: rgba(237, 246, 255, 0.72);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  padding: 18px;
}
.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 {
  position: relative;
  min-height: 96px;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  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);
}
.game-map-tile:disabled {
  cursor: not-allowed;
  border-color: rgba(255, 214, 107, 0.22);
  opacity: 0.62;
  transform: none;
}
.menu-item span {
  width: 42px;
  height: 42px;
  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: 18px;
  font-weight: 1000;
}
.menu-item strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.game-map-tile strong {
  color: #fff7d8;
  font-size: 15px;
  line-height: 1.08;
}
.game-map-tile-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.game-map-tile-copy small {
  color: rgba(237, 246, 255, 0.72);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.24;
}
.game-map-tile-cue {
  width: fit-content;
  border: 1px solid rgba(126, 231, 255, 0.34);
  border-radius: 999px;
  background: rgba(126, 231, 255, 0.12);
  color: #c9f6ff !important;
  font-size: 13px !important;
  padding: 4px 8px;
}
.game-map-tile-unavailable {
  color: rgba(255, 214, 107, 0.78) !important;
}
.game-map-tile-start {
  align-self: center;
  border-radius: 999px;
  background: rgba(255, 214, 107, 0.16);
  color: #fff7d8;
  font-size: 11px;
  font-weight: 1000;
  padding: 6px 9px;
  text-transform: uppercase;
}
.game-map-tile-start.is-unavailable {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(237, 246, 255, 0.62);
}
.mission-launch-plan {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255, 214, 107, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(7, 10, 28, 0.94), rgba(18, 34, 60, 0.9)),
    rgba(7, 10, 28, 0.94);
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: mission-launch-plan-in 360ms cubic-bezier(0.2, 0.72, 0.22, 1) both;
  pointer-events: none;
}
.mission-launch-plan-route {
  min-height: 58px;
  display: grid;
  grid-template-columns: auto 1fr 54px 1fr auto;
  align-items: center;
  gap: 8px;
}
.mission-launch-plan-route span {
  width: auto;
  height: auto;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(237, 246, 255, 0.84);
  font-size: 11px;
  font-weight: 1000;
  padding: 7px 10px;
  text-transform: uppercase;
}
.mission-launch-plan-route i {
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(126, 231, 255, 0), rgba(126, 231, 255, 0.92));
  box-shadow: 0 0 18px rgba(126, 231, 255, 0.32);
}
.mission-launch-plan-route i:last-of-type {
  background: linear-gradient(90deg, rgba(255, 214, 107, 0.92), rgba(255, 214, 107, 0));
  box-shadow: 0 0 18px rgba(255, 214, 107, 0.28);
}
.mission-launch-plan-route strong {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 235, 173, 0.44);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.28), transparent 38%),
    rgba(255, 214, 107, 0.18);
  color: #fff7d8;
  font-size: 24px;
  box-shadow: 0 0 28px rgba(255, 214, 107, 0.22);
  animation: mission-launch-destination 680ms ease-in-out infinite alternate;
}
.mission-launch-plan-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.mission-launch-plan-copy span {
  width: fit-content;
  height: auto;
  border: 1px solid rgba(126, 231, 255, 0.34);
  border-radius: 999px;
  background: rgba(126, 231, 255, 0.12);
  color: #c9f6ff;
  font-size: 11px;
  font-weight: 1000;
  padding: 4px 8px;
  text-transform: uppercase;
}
.mission-launch-plan-copy strong {
  color: #fff7d8;
  font-size: 19px;
  font-weight: 1000;
  line-height: 1.1;
}
.mission-launch-plan-copy small {
  color: rgba(237, 246, 255, 0.78);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}
@keyframes mission-launch-plan-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes mission-launch-destination {
  from {
    transform: scale(0.94);
  }
  to {
    transform: scale(1.05);
  }
}
.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;
  }
  .mission-route-ribbon {
    grid-template-columns: 1fr;
  }
  .mission-route-ribbon::before {
    left: 24px;
    right: auto;
    top: 18px;
    bottom: 18px;
    width: 2px;
    height: auto;
    background: linear-gradient(180deg, rgba(126, 231, 255, 0.22), rgba(255, 214, 107, 0.48), rgba(126, 231, 255, 0.22));
    transform: none;
  }
  .game-map-window {
    grid-template-columns: 1fr;
    min-height: 0;
    max-height: min(56vh, 520px);
    gap: 8px;
    padding: 12px;
    overflow-y: auto;
    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-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .game-map-tile {
    min-height: 108px;
    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;
  }
  .game-map-tile-start {
    grid-column: 1 / -1;
    justify-self: start;
    margin-left: 44px;
    padding: 5px 8px;
  }
  .mission-launch-plan {
    left: 12px;
    right: 12px;
    bottom: 12px;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }
  .mission-launch-plan-route {
    min-height: 48px;
    grid-template-columns: 1fr 36px 1fr;
  }
  .mission-launch-plan-route i {
    display: none;
  }
  .mission-launch-plan-route span {
    justify-self: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mission-launch-plan-route strong {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }
  .mission-launch-plan-copy strong {
    font-size: 16px;
  }
  .mission-launch-plan-copy small {
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mission-launch-plan,
  .mission-launch-plan-route strong {
    animation: none !important;
  }
}

/* ---------- 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;
}
.mission-badge-thread {
  position: absolute;
  right: 28px;
  bottom: 24px;
  z-index: 42;
  width: min(360px, calc(100vw - 56px));
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(255, 214, 107, 0.32);
  border-radius: 8px;
  background: rgba(12, 13, 34, 0.84);
  color: var(--ink);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.42);
}
.mission-badge-thread-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.mission-badge-thread-copy span {
  color: #9ad7ff;
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.mission-badge-thread-copy strong {
  color: #fff7d8;
  font-size: 17px;
  font-weight: 1000;
  line-height: 1.1;
}
.mission-badge-thread-copy small {
  color: rgba(237, 246, 255, 0.72);
  font-size: 12px;
  font-weight: 800;
}
.mission-badge-row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.mission-badge-chip {
  position: relative;
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 214, 107, 0.42);
  border-radius: 50%;
  background: rgba(255, 214, 107, 0.12);
  box-shadow: 0 0 20px rgba(255, 214, 107, 0.16);
}
.mission-badge-chip img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}
.mission-badge-chip b {
  position: absolute;
  right: -4px;
  bottom: -5px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(9, 9, 24, 0.94);
  color: #fff7d8;
  font-size: 12px;
  line-height: 1;
}
.mission-badge-thread button {
  min-width: 112px;
  min-height: 60px;
  border: 1px solid rgba(255, 214, 107, 0.44);
  border-radius: 8px;
  background: rgba(255, 214, 107, 0.16);
  color: #fff7d8;
  font-family: inherit;
  font-size: 13px;
  font-weight: 1000;
  cursor: pointer;
}
.mission-badge-thread .mission-badge-milestone {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
}
.mission-badge-milestone > span:first-child {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(126, 231, 255, 0.18);
  font-size: 22px;
}
.mission-badge-milestone > span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.mission-badge-milestone strong,
.mission-badge-milestone small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mission-badge-milestone small {
  color: rgba(237, 246, 255, 0.76);
  font-size: 12px;
}
.mission-badge-thread button:hover,
.mission-badge-thread button:focus-visible {
  background: rgba(255, 214, 107, 0.24);
  outline: 2px solid rgba(126, 231, 255, 0.82);
  outline-offset: 3px;
}
@media (max-width: 760px) {
  .mission-badge-thread {
    left: 14px;
    right: 14px;
    bottom: 16px;
    width: auto;
    grid-template-columns: 1fr;
  }
  .mission-badge-thread button {
    justify-self: stretch;
  }
}
.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-v2-atlas.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;
}

.game-finish-fireworks {
  position: fixed;
  inset: 0;
  z-index: 1600;
  pointer-events: none;
  overflow: hidden;
}

.game-finish-fireworks-sky {
  position: absolute;
  inset: 0;
}

.game-finish-fireworks-sky span {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--spark);
  box-shadow:
    0 -28px 0 -2px var(--spark),
    0 28px 0 -2px var(--spark),
    -28px 0 0 -2px var(--spark),
    28px 0 0 -2px var(--spark),
    -20px -20px 0 -3px var(--spark),
    20px -20px 0 -3px var(--spark),
    -20px 20px 0 -3px var(--spark),
    20px 20px 0 -3px var(--spark);
  opacity: 0;
  transform: scale(0.2);
  animation: game-finish-firework-pop 1.25s ease-out both;
}

.game-finish-card {
  position: absolute;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(560px, calc(100vw - 32px));
  min-height: 96px;
  display: grid;
  grid-template-columns: 72px 1fr;
  column-gap: 12px;
  row-gap: 10px;
  align-items: center;
  padding: 14px 18px;
  border: 3px solid #ffe16f;
  border-radius: 8px;
  color: #16213a;
  background: #fff8cf;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
  pointer-events: auto;
  animation: game-finish-card-pop 2.6s ease-out both;
}

.game-finish-emoji {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #ffffff;
  font-size: 2.35rem;
  box-shadow: inset 0 -6px 0 rgba(255, 225, 111, 0.35);
}

.game-finish-copy {
  display: grid;
  gap: 4px;
}

.game-finish-card strong {
  font-size: 1.55rem;
  line-height: 1;
}

.game-finish-card small {
  font-size: 1rem;
  font-weight: 800;
}

.game-finish-videos {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.game-finish-video,
.game-finish-dismiss {
  min-height: 44px;
  border-radius: 8px;
  border: 2px solid rgba(22, 33, 58, 0.16);
  font-family: "Inter", system-ui, sans-serif;
  cursor: pointer;
}

.game-finish-video {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  color: #16213a;
  background: #ffffff;
  text-align: left;
  box-shadow: inset 0 -4px 0 rgba(255, 225, 111, 0.2);
}

.game-finish-video:hover,
.game-finish-video:focus-visible {
  border-color: #2f7cf6;
  outline: none;
}

.game-finish-video-emoji {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ecf5ff;
  font-size: 1.15rem;
}

.game-finish-video-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.game-finish-video strong {
  overflow: hidden;
  font-size: 0.9rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-finish-video small {
  overflow: hidden;
  color: rgba(22, 33, 58, 0.78);
  font-size: 0.72rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-finish-dismiss {
  grid-column: 1 / -1;
  justify-self: center;
  padding: 6px 16px;
  color: rgba(22, 33, 58, 0.82);
  background: rgba(255, 255, 255, 0.64);
  font-size: 0.82rem;
  font-weight: 800;
}

.game-finish-dismiss:hover,
.game-finish-dismiss:focus-visible {
  border-color: rgba(22, 33, 58, 0.42);
  outline: none;
}

@keyframes game-finish-firework-pop {
  0% {
    opacity: 0;
    transform: scale(0.2);
  }
  18% {
    opacity: 1;
  }
  72% {
    opacity: 0.9;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.18);
  }
}

@keyframes game-finish-card-pop {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(24px) scale(0.92);
  }
  12%,
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@media (max-width: 560px) {
  .game-finish-card {
    min-height: 82px;
    grid-template-columns: 56px 1fr;
    padding: 10px 12px;
  }

  .game-finish-emoji {
    width: 50px;
    height: 50px;
    font-size: 1.85rem;
  }

  .game-finish-card strong {
    font-size: 1.2rem;
  }

  .game-finish-card small {
    font-size: 0.86rem;
  }

  .game-finish-videos {
    grid-template-columns: 1fr;
  }
}

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