/* ---------- 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-jump-shell.full .gravity-target-card {
  width: min(410px, 100%);
  border: 1px solid rgba(126, 231, 255, 0.24);
  border-radius: 16px;
  background: rgba(7, 7, 20, 0.58);
  color: #d8f5ff;
  padding: 11px 13px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.gravity-jump-shell.full .gravity-target-card strong {
  color: #ffffff;
}
.gravity-jump-shell.full .gravity-target-card span {
  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-landing-target {
  position: absolute;
  left: var(--gravity-target-x);
  bottom: clamp(88px, 12.8vh, 122px);
  z-index: 3;
  width: clamp(112px, 12vw, 164px);
  height: clamp(54px, 6vw, 76px);
  display: grid;
  place-items: center;
  transform: translateX(-50%);
  border: 2px solid rgba(126, 231, 255, 0.9);
  border-radius: 50%;
  background:
    radial-gradient(
      ellipse at center,
      rgba(255, 246, 168, 0.42) 0%,
      rgba(126, 231, 255, 0.22) 46%,
      rgba(7, 7, 20, 0.1) 72%
    ),
    rgba(7, 7, 20, 0.24);
  box-shadow:
    0 0 0 8px rgba(126, 231, 255, 0.08),
    0 0 28px rgba(126, 231, 255, 0.38),
    inset 0 0 20px rgba(255, 246, 168, 0.28);
  pointer-events: none;
}
.gravity-jump-stage.full .gravity-landing-target::before {
  content: "";
  position: absolute;
  inset: -18px 18px auto;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 246, 168, 0.46),
    transparent 70%
  );
}
.gravity-jump-stage.full .gravity-landing-target span {
  position: relative;
  z-index: 1;
  border-radius: 999px;
  background: rgba(7, 7, 20, 0.76);
  color: #fff7d8;
  font-size: 13px;
  font-weight: 1000;
  padding: 7px 10px;
  white-space: nowrap;
}
.gravity-jump-stage.full .gravity-landing-target.waiting {
  animation: gravity-target-watch var(--gravity-time) ease-in-out both;
}
.gravity-jump-stage.full .gravity-landing-target.hit {
  border-color: rgba(255, 246, 168, 0.98);
  box-shadow:
    0 0 0 11px rgba(255, 246, 168, 0.12),
    0 0 36px rgba(255, 246, 168, 0.56),
    inset 0 0 22px rgba(126, 231, 255, 0.3);
}
.gravity-jump-stage.full .gravity-landing-target.miss {
  border-color: rgba(255, 143, 112, 0.86);
  box-shadow:
    0 0 0 8px rgba(255, 143, 112, 0.1),
    0 0 24px rgba(255, 143, 112, 0.34);
}
.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(360px, calc(100vw - 36px));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.gravity-world-picker button {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 60px;
  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;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  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);
  }
}
@keyframes gravity-target-watch {
  0%,
  100% {
    transform: translateX(-50%) scale(1);
  }
  46% {
    transform: translateX(-50%) scale(1.08);
  }
}
@media (max-width: 840px) {
  .gravity-jump-shell.full .gravity-jump-copy {
    top: calc(max(74px, env(safe-area-inset-top)) + 134px);
    left: 14px;
    right: 14px;
    justify-items: start;
    text-align: left;
    max-width: calc(100vw - 28px);
    gap: 8px;
  }
  .gravity-jump-shell.full .gravity-jump-copy h1 {
    display: none;
  }
  .gravity-jump-shell.full .gravity-jump-copy p {
    display: none;
  }
  .gravity-jump-shell.full .gravity-jump-message {
    width: min(360px, 100%);
    min-height: 48px;
    font-size: 15px;
    padding: 11px 13px;
  }
  .gravity-best-jump {
    font-size: 13px;
    padding: 8px 11px;
  }
  .gravity-jump-shell.full .gravity-target-card {
    width: min(360px, 100%);
    padding: 9px 11px;
  }
  .gravity-jump-shell.full .gravity-target-card strong,
  .gravity-jump-shell.full .gravity-target-card span {
    font-size: 13px;
  }
  .gravity-jump-stage.full .gravity-world-picker {
    top: max(74px, env(safe-area-inset-top));
    left: 50%;
    right: auto;
    bottom: auto;
    width: min(360px, calc(100vw - 28px));
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    transform: translateX(-50%);
  }
  .gravity-world-picker button {
    min-height: 60px;
    padding: 0 10px;
    font-size: 15px;
  }
  .gravity-jump-stage.full .gravity-world-label {
    display: none;
  }
  .gravity-jump-stage.full .gravity-landing-target {
    bottom: 144px;
    width: 104px;
    height: 52px;
  }
  .gravity-jump-stage.full .gravity-landing-target span {
    font-size: 12px;
    padding: 6px 8px;
  }
  .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;
  }
}
@media (max-width: 840px) and (max-height: 520px) {
  .gravity-jump-shell.full .gravity-jump-copy {
    top: 78px;
    left: 14px;
    right: auto;
    max-width: 170px;
  }
  .gravity-jump-shell.full .gravity-jump-copy h1,
  .gravity-jump-shell.full .gravity-jump-copy p,
  .gravity-jump-shell.full .gravity-jump-message,
  .gravity-best-jump,
  .gravity-target-card,
  .gravity-pull-meter,
  .gravity-jump-progress {
    display: none;
  }
  .gravity-jump-stage.full .gravity-world-picker {
    top: 76px;
    left: auto;
    right: 12px;
    width: min(284px, calc(100vw - 174px));
    min-width: 236px;
    transform: none;
  }
  .gravity-world-picker button {
    min-height: 60px;
    font-size: 14px;
  }
  .gravity-jump-stage.full .gravity-astronaut {
    bottom: 118px;
    width: 88px;
  }
  .gravity-jump-stage.full .gravity-landing-target {
    bottom: 112px;
    width: 86px;
    height: 44px;
  }
  .gravity-jump-stage.full .gravity-landing-target span {
    display: none;
  }
  .gravity-jump-stage.full .gravity-jump-controls {
    bottom: 12px;
  }
  .gravity-key-hint {
    display: none;
  }
}

.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;
  width: 14.2%;
  height: 18.6%;
  min-width: 60px;
  min-height: 60px;
  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: 20.8%;
  top: 8%;
}
.story-shelf-hotspot.moon-seed {
  left: 39.5%;
  top: 8%;
}
.story-shelf-hotspot.comet-hat {
  left: 58.2%;
  top: 8%;
}
.story-shelf-hotspot.rocket-pajamas {
  left: 76.9%;
  top: 8%;
}
.story-shelf-hotspot.saturn-ring {
  left: 20.8%;
  top: 30.7%;
}
.story-shelf-hotspot.black-hole-peekaboo {
  left: 39.5%;
  top: 30.7%;
}
.story-shelf-hotspot.moon-mailbox {
  left: 58.2%;
  top: 30.7%;
}
.story-shelf-hotspot.jupiter-storm {
  left: 76.9%;
  top: 30.7%;
}
.story-shelf-hotspot.neptune-night-light {
  left: 20.8%;
  top: 53.5%;
}
.story-shelf-hotspot.mars-kite-day {
  left: 39.5%;
  top: 53.5%;
}
.story-shelf-hotspot.venus-umbrella-parade {
  left: 58.2%;
  top: 53.5%;
}
.story-shelf-hotspot.mercury-shadow-tag {
  left: 76.9%;
  top: 53.5%;
}
.story-shelf-hotspot.uranus-tilted-tea {
  left: 20.8%;
  top: 76.1%;
}
.story-shelf-hotspot.pluto-snow-parade {
  left: 39.5%;
  top: 76.1%;
}
.story-shelf-hotspot.moon-word-walk {
  left: 58.2%;
  top: 76.1%;
}
.story-shelf-hotspot.rocket-word-ride {
  left: 76.9%;
  top: 76.1%;
}
.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;
}
.story-shelf-panel.has-book-grid .story-shelf-fallback {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}
.story-shelf-panel.has-book-grid .story-shelf-book {
  min-height: 320px;
}
.story-shelf-panel.has-book-grid .story-shelf-book img {
  max-height: 170px;
}
.story-shelf-panel.has-book-grid .story-shelf-book strong {
  font-size: clamp(22px, 2.4vw, 30px);
}
@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: 60px;
  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-shelf-link {
  min-height: 48px;
  border: 1px solid rgba(126, 231, 255, 0.38);
  border-radius: 999px;
  background: rgba(13, 12, 32, 0.76);
  color: #9df3ff;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 900;
  padding: 12px 20px;
  touch-action: manipulation;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.storybook-shelf-top {
  position: fixed;
  left: 24px;
  top: 86px;
  z-index: 44;
}
.storybook-recovery-note {
  width: min(420px, 100%);
  margin: 0 auto 10px;
  border: 1px solid rgba(126, 231, 255, 0.32);
  border-radius: 999px;
  background: rgba(13, 12, 32, 0.74);
  color: #9df3ff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
  padding: 9px 14px;
  text-align: center;
}
.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-word-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: min(640px, 92%);
  margin: 0 auto;
}
.storybook-word-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255, 214, 107, 0.42);
  border-radius: 999px;
  background: rgba(255, 247, 216, 0.92);
  color: #2a1a0d;
  font-family: inherit;
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  padding: 12px 16px;
  text-transform: lowercase;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  touch-action: manipulation;
}
.storybook-word-button:hover {
  background: #fff7d8;
  transform: translateY(-1px);
}
.storybook-word-button:disabled {
  opacity: 0.52;
  cursor: default;
  transform: none;
}
.storybook-complete {
  position: fixed;
  left: 50%;
  bottom: max(82px, calc(env(safe-area-inset-bottom) + 82px));
  z-index: 46;
  width: min(430px, calc(100vw - 28px));
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 18px 18px 16px;
  border: 2px solid rgba(255, 255, 255, 0.54);
  border-radius: 18px;
  color: #18203a;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.76), transparent 22%),
    linear-gradient(135deg, #fff6a8, #8ef5ff);
  text-align: center;
  box-shadow:
    0 18px 54px rgba(0, 0, 0, 0.32),
    0 0 34px rgba(255, 246, 168, 0.28);
  transform: translateX(-50%);
  animation: storybook-finish-pop 560ms cubic-bezier(0.2, 0.82, 0.2, 1) both;
}
.storybook-complete strong,
.storybook-complete span {
  line-height: 1.1;
}
.storybook-complete strong {
  font-size: 22px;
}
.storybook-complete-stars {
  color: #664d00;
  font-size: 24px;
  letter-spacing: 0;
  animation: storybook-stars-sparkle 1.4s ease-in-out infinite;
}
.storybook-complete-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}
.storybook-complete-actions button {
  min-width: 44px;
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  background: rgba(24, 32, 58, 0.94);
  color: #fff7d8;
  font-family: inherit;
  font-size: 15px;
  font-weight: 1000;
  padding: 10px 16px;
  cursor: pointer;
  touch-action: manipulation;
}
.storybook-close:focus-visible,
.storybook-shelf-link:focus-visible,
.storybook-card:focus-visible,
.storybook-big-next:focus-visible,
.storybook-nav:focus-visible,
.storybook-replay:focus-visible,
.storybook-word-button:focus-visible,
.storybook-dots button:focus-visible {
  outline: 3px solid rgba(255, 214, 107, 0.96);
  outline-offset: 4px;
}
@keyframes storybook-finish-pop {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(18px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}
@keyframes storybook-stars-sparkle {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-3px) scale(1.08);
  }
}
.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: auto;
  height: auto;
  max-width: 100%;
  max-height: min(58svh, 580px);
  border-radius: 12px;
  object-fit: contain;
  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 planet-secret-giggle {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1, 1) rotate(0deg);
    filter: none;
  }
  18% {
    transform: translate(-50%, -50%) scale(1.1, 0.9) rotate(-4deg);
    filter: brightness(1.22) drop-shadow(0 0 30px rgba(255, 214, 107, 0.52));
  }
  42% {
    transform: translate(-50%, -50%) scale(0.94, 1.12) rotate(4deg);
  }
  68% {
    transform: translate(-50%, -50%) scale(1.05, 0.97) rotate(-2deg);
  }
}
@keyframes planet-secret-sparkle-pop {
  0% {
    opacity: 0;
    transform: translate3d(-50%, -50%, 0) scale(0.45) rotate(-18deg);
  }
  28% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--sparkle-x), var(--sparkle-y), 0) scale(1.2)
      rotate(18deg);
  }
}
@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-wrap.secret-giggle {
  animation: planet-secret-giggle 0.72s cubic-bezier(0.2, 1.2, 0.28, 1);
}
.planet-secret-sparkles {
  position: absolute;
  inset: 20%;
  z-index: 8;
  pointer-events: none;
}
.planet-secret-sparkle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(22px, 5vw, 48px);
  height: auto;
  filter:
    drop-shadow(0 0 14px rgba(255, 214, 107, 0.84))
    drop-shadow(0 8px 16px rgba(0, 0, 0, 0.22));
  animation: planet-secret-sparkle-pop 1.15s ease-out both;
}
.planet-secret-sparkle.sparkle-0 {
  --sparkle-x: -118%;
  --sparkle-y: -92%;
}
.planet-secret-sparkle.sparkle-1 {
  --sparkle-x: 64%;
  --sparkle-y: -122%;
  animation-delay: 0.06s;
}
.planet-secret-sparkle.sparkle-2 {
  --sparkle-x: 124%;
  --sparkle-y: -18%;
  animation-delay: 0.12s;
}
.planet-secret-sparkle.sparkle-3 {
  --sparkle-x: 78%;
  --sparkle-y: 102%;
  animation-delay: 0.18s;
}
.planet-secret-sparkle.sparkle-4 {
  --sparkle-x: -92%;
  --sparkle-y: 92%;
  animation-delay: 0.24s;
}
.planet-secret-sparkle.sparkle-5 {
  --sparkle-x: -132%;
  --sparkle-y: 2%;
  animation-delay: 0.3s;
}
.planet-detail-flag {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 0 14px color-mix(in srgb, var(--flag-color) 55%, transparent);
  transform-origin: 50% 100%;
  pointer-events: none;
  z-index: 4;
}
.planet-detail-flag::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 2px;
  width: 24px;
  height: 17px;
  border-radius: 4px 8px 8px 4px;
  background: var(--flag-color);
  clip-path: polygon(0 0, 100% 18%, 72% 50%, 100% 82%, 0 100%);
}
.planet-detail-flag.flag-0 {
  transform: translate(-50%, -50%) rotate(-32deg) translateY(-42%);
}
.planet-detail-flag.flag-1 {
  transform: translate(-50%, -50%) rotate(28deg) translateY(-45%);
}
.planet-detail-flag.flag-2 {
  transform: translate(-50%, -50%) rotate(84deg) translateY(-43%);
}
.planet-detail-flag.flag-3 {
  transform: translate(-50%, -50%) rotate(-92deg) translateY(-41%);
}
.planet-detail-flag.flag-4 {
  transform: translate(-50%, -50%) rotate(148deg) translateY(-40%);
}
.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;
}
.detail-passport-card {
  display: grid;
  gap: 8px;
  max-width: 390px;
  margin: 0 0 20px;
  padding: 14px;
  border: 1px solid rgba(255, 214, 107, 0.24);
  border-radius: 8px;
  background: rgba(255, 214, 107, 0.1);
}
.detail-passport-card span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.detail-passport-card strong {
  color: #fff7d8;
}
.detail-passport-card p {
  margin: 0;
  color: rgba(237, 246, 255, 0.78);
  font-size: 13px;
  font-weight: 800;
}
.detail-passport-card .btn-tour {
  position: relative;
  width: fit-content;
}
.mission-arrow {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  color: #ff3b30;
  font-size: 30px;
  font-weight: 1000;
  line-height: 1;
  text-shadow:
    0 0 8px rgba(255, 59, 48, 0.7),
    0 2px 8px rgba(0, 0, 0, 0.45);
  transform: translateY(-50%);
  pointer-events: none;
}
.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;
}
