html,
body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  width: 100%;
  height: 100%;
  background: #ffd6ec;
  font-family: "Georgia", serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

#app {
  position: fixed;
  inset: 0;
}

.hud {
  position: fixed;
  top: 16px;
  left: 16px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.88);
  border: 2px solid #ff8ac0;
  border-radius: 14px;
  color: #6b2247;
  font-size: 16px;
  line-height: 1.4;
  box-shadow: 0 6px 18px rgba(255, 138, 192, 0.35);
  pointer-events: none;
  max-width: 280px;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.6);
}

.hud h1 {
  margin: 0 0 4px;
  font-size: 16px;
  letter-spacing: 0.5px;
  color: #b03579;
}
.hud-toggle {
  position: absolute;
  top: 7px;
  right: 7px;
  min-width: 56px;
  min-height: 44px;
  padding: 0 10px;
  border: 2px solid rgba(176, 53, 121, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #8a2f64;
  font:
    900 13px/1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  cursor: pointer;
  touch-action: manipulation;
  pointer-events: auto;
}
.hud.compact {
  width: auto;
  min-width: 132px;
  max-width: calc(100vw - 48px);
  padding-right: 64px;
}
.hud.compact .hud-controls,
.hud.compact .quest-line,
.hud.compact .challenge-line,
.hud.compact .key-line,
.hud.compact .clue-line,
.hud.compact .helper-quest,
.hud.compact .adventure-line,
.hud.compact .game-center-open,
.hud.compact .portrait-gallery,
.hud.compact .score,
.hud.compact .room-hint {
  display: none;
}

.hud span {
  font-weight: bold;
  color: #b03579;
}

.credit {
  position: fixed;
  bottom: 12px;
  right: 14px;
  color: #b03579;
  font-size: 12px;
  opacity: 0.7;
  pointer-events: none;
}

.hud .score {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(176, 53, 121, 0.25);
  font-size: 13px;
  color: #6b2247;
  opacity: 0.78;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hud .score .score-num,
.hud .score .score-pts {
  color: #b03579;
  font-weight: 700;
}
.room-hint {
  display: none;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(176, 53, 121, 0.22);
  color: #6b2247;
  font-size: 12px;
  font-weight: 700;
}
.room-hint.show {
  display: block;
}
.station-hint {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 16px);
  z-index: 145;
  max-width: min(82vw, 420px);
  padding: 7px 12px;
  border: 2px solid rgba(176, 53, 121, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #6b2247;
  font-family: "Georgia", serif;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.55);
  box-shadow: 0 6px 16px rgba(176, 53, 121, 0.18);
  transition:
    opacity 0.22s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.22s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.station-hint.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Storybook modal ---------- */
.book-modal {
  position: fixed;
  inset: 0;
  z-index: 650;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: "Georgia", serif;
}
.book-modal.open {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: story-fade 0.22s ease;
}
.book-modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 50% 42%,
      rgba(255, 214, 136, 0.28),
      transparent 34%
    ),
    radial-gradient(
      circle at 22% 18%,
      rgba(130, 210, 255, 0.18),
      transparent 22%
    ),
    linear-gradient(180deg, rgba(17, 20, 52, 0.9), rgba(36, 20, 48, 0.9)),
    #151831;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.book-modal-backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 18% 22%,
      rgba(255, 238, 178, 0.85) 0 1px,
      transparent 2px
    ),
    radial-gradient(
      circle at 78% 18%,
      rgba(255, 238, 178, 0.7) 0 1px,
      transparent 2px
    ),
    radial-gradient(
      circle at 66% 72%,
      rgba(148, 219, 255, 0.65) 0 1px,
      transparent 2px
    ),
    radial-gradient(
      circle at 34% 76%,
      rgba(255, 238, 178, 0.55) 0 1px,
      transparent 2px
    );
  pointer-events: none;
}
.book-card {
  position: relative;
  width: min(1120px, 94vw);
  aspect-ratio: 2.25 / 1;
  max-height: min(72vh, 560px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  padding: clamp(22px, 3vw, 38px);
  border: 0;
  border-radius: 28px;
  background:
    radial-gradient(
      circle at 50% 44%,
      rgba(255, 220, 140, 0.32),
      transparent 30%
    ),
    linear-gradient(180deg, #7a4d2f 0%, #3b2230 100%);
  box-shadow:
    0 38px 95px rgba(0, 0, 0, 0.55),
    0 8px 0 rgba(31, 14, 23, 0.34);
}
.book-card::before {
  content: "";
  position: absolute;
  inset: clamp(18px, 2.4vw, 31px);
  border-radius: 24px;
  background:
    radial-gradient(
      circle at 26% 22%,
      rgba(255, 255, 255, 0.58),
      transparent 22%
    ),
    linear-gradient(
      90deg,
      #f6dfb4 0%,
      #fff0c9 47%,
      #d7b987 49.2%,
      #8d5b38 50%,
      #d7b987 50.8%,
      #fff0c9 53%,
      #f3d9a8 100%
    );
  box-shadow:
    inset 0 0 0 1px rgba(119, 75, 44, 0.16),
    inset 18px 0 32px rgba(111, 65, 38, 0.1),
    inset -18px 0 32px rgba(111, 65, 38, 0.12),
    0 18px 34px rgba(17, 10, 16, 0.36);
  pointer-events: none;
}
.book-card::after {
  content: "";
  position: absolute;
  top: clamp(24px, 3vw, 42px);
  bottom: clamp(24px, 3vw, 42px);
  left: 50%;
  width: 34px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(83, 48, 31, 0.28),
    rgba(55, 30, 22, 0.34),
    rgba(255, 244, 215, 0.2),
    transparent
  );
  box-shadow:
    inset 0 0 18px rgba(67, 37, 24, 0.28),
    0 0 18px rgba(67, 37, 24, 0.16);
  pointer-events: none;
}
.book-close {
  display: none;
}
.book-frame {
  position: relative;
  z-index: 1;
  overflow: hidden;
  align-self: stretch;
  margin: clamp(16px, 2.5vw, 28px) clamp(18px, 3vw, 34px)
    clamp(18px, 2.5vw, 30px) clamp(14px, 2.4vw, 28px);
  border-radius: 16px;
  background: #f5dfb8;
  isolation: isolate;
  box-shadow:
    0 0 0 9px rgba(255, 236, 190, 0.72),
    0 0 0 10px rgba(109, 67, 41, 0.16),
    0 12px 24px rgba(88, 52, 30, 0.18);
}
.book-frame::after {
  display: none;
}
.book-frame::before {
  content: "";
  position: absolute;
  inset: 0 50% 0 0;
  z-index: 2;
  transform-origin: 100% 50%;
  border-right: 2px solid rgba(107, 34, 71, 0.14);
  background:
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.95),
      rgba(255, 247, 221, 0.96)
    ),
    linear-gradient(180deg, transparent 0 94%, rgba(107, 34, 71, 0.08) 94% 100%);
  box-shadow: 10px 0 20px rgba(92, 45, 21, 0.16);
  opacity: 0;
  pointer-events: none;
}
.book-frame.opening-pages::before {
  animation: book-open-pages 0.74s cubic-bezier(0.18, 0.82, 0.24, 1) both;
}
.book-frame.turn-next::before,
.book-frame.turn-prev::before {
  animation: book-page-flip 0.62s cubic-bezier(0.2, 0.72, 0.2, 1) both;
}
.book-frame.turn-prev::before {
  transform-origin: 0% 50%;
  inset: 0 0 0 50%;
  border-right: 0;
  border-left: 2px solid rgba(107, 34, 71, 0.14);
  box-shadow: -10px 0 20px rgba(92, 45, 21, 0.16);
  animation-name: book-page-flip-back;
}
@keyframes book-open-pages {
  0% {
    opacity: 0.96;
    transform: perspective(900px) rotateY(0deg) scaleX(1);
  }
  58% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: perspective(900px) rotateY(-118deg) scaleX(0.96);
  }
}
@keyframes book-page-flip {
  0% {
    opacity: 0;
    transform: perspective(760px) rotateY(0deg);
  }
  12% {
    opacity: 0.94;
  }
  100% {
    opacity: 0;
    transform: perspective(760px) rotateY(-132deg);
  }
}
@keyframes book-page-flip-back {
  0% {
    opacity: 0;
    transform: perspective(760px) rotateY(0deg);
  }
  12% {
    opacity: 0.94;
  }
  100% {
    opacity: 0;
    transform: perspective(760px) rotateY(132deg);
  }
}
.book-page-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #f5dfb8;
}
.book-reading {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  align-self: stretch;
  margin: clamp(16px, 2.5vw, 28px) clamp(16px, 2.4vw, 28px)
    clamp(18px, 2.5vw, 30px) clamp(32px, 3.5vw, 52px);
  padding: clamp(20px, 4vw, 54px);
  border-radius: 16px;
  background:
    radial-gradient(
      circle at 50% 24%,
      rgba(255, 255, 255, 0.48),
      transparent 34%
    ),
    linear-gradient(180deg, rgba(255, 247, 221, 0.36), rgba(244, 218, 174, 0.1));
  color: #55331f;
  text-align: center;
}
.book-page-title {
  display: none;
}
.book-page-line {
  margin: 0;
  max-width: 440px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 5.4vw, 64px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0;
  text-wrap: balance;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}
.book-learn-line {
  display: none;
}
.book-learn-line[hidden] {
  display: none;
}
.book-word-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.book-word {
  min-width: 88px;
  min-height: 48px;
  padding: 10px 14px;
  border: 2px solid rgba(183, 87, 143, 0.32);
  border-radius: 999px;
  background: #fff;
  color: #9b2d6a;
  font:
    800 18px/1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  cursor: pointer;
  touch-action: manipulation;
}
.book-word:focus-visible,
.book-word:hover,
.book-back-shelf:focus-visible,
.book-back-shelf:hover,
.book-read:focus-visible,
.book-read:hover {
  outline: 3px solid rgba(255, 204, 72, 0.75);
  outline-offset: 2px;
}
.book-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 0;
}
.book-learning-tray {
  position: relative;
  z-index: 1;
  width: min(880px, 92vw);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 3px solid rgba(255, 216, 107, 0.5);
  border-radius: 18px;
  background:
    radial-gradient(
      circle at 18% 20%,
      rgba(255, 255, 255, 0.58),
      transparent 28%
    ),
    linear-gradient(
      180deg,
      rgba(255, 241, 199, 0.96),
      rgba(238, 202, 145, 0.92)
    );
  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.3),
    inset 0 0 0 2px rgba(255, 255, 255, 0.28);
}
.book-page-hotspot {
  position: absolute;
  z-index: 2;
  top: clamp(26px, 3.2vw, 46px);
  bottom: clamp(26px, 3.2vw, 46px);
  width: calc(50% - 24px);
  border: 0;
  background: transparent;
  cursor: pointer;
}
.book-page-hotspot-left {
  left: clamp(24px, 3vw, 44px);
}
.book-page-hotspot-right {
  right: clamp(24px, 3vw, 44px);
}
.book-page-hotspot:focus-visible {
  outline: 3px solid rgba(255, 216, 107, 0.9);
  outline-offset: -10px;
  border-radius: 18px;
}
.book-nav {
  width: 56px;
  height: 48px;
  border: 3px solid rgba(107, 34, 71, 0.28);
  border-radius: 999px;
  background: #fff;
  color: #6b2247;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}
.book-back-shelf {
  min-width: 112px;
  min-height: 48px;
  padding: 0 18px;
  border: 3px solid rgba(107, 34, 71, 0.24);
  border-radius: 999px;
  background: #fff8ee;
  color: #6b2247;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 3px 0 rgba(107, 34, 71, 0.12);
}
.book-read {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 104px;
  min-height: 48px;
  padding: 0 18px;
  border: 3px solid rgba(107, 34, 71, 0.24);
  border-radius: 999px;
  background: #fff6cf;
  color: #6b2247;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    background 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}
.book-read-icon {
  font-size: 18px;
  line-height: 1;
}
.book-read.speaking,
.book-word.speaking {
  background: #ffe28a;
  box-shadow: 0 0 0 4px rgba(255, 211, 122, 0.55);
  animation: book-read-pulse 1.1s ease-in-out infinite;
}
@keyframes book-read-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}
.book-page-count {
  min-width: 58px;
  text-align: center;
  color: #6b2247;
  font-weight: 700;
}
.book-voice-note {
  display: none;
}

.book-modal[data-book="candyCrown"] .book-modal-backdrop {
  background:
    radial-gradient(
      circle at 50% 42%,
      rgba(255, 214, 136, 0.28),
      transparent 34%
    ),
    radial-gradient(
      circle at 22% 18%,
      rgba(130, 210, 255, 0.18),
      transparent 22%
    ),
    linear-gradient(180deg, rgba(17, 20, 52, 0.9), rgba(36, 20, 48, 0.9)),
    #151831;
}
.book-modal[data-book="candyCrown"] .book-card {
  background:
    radial-gradient(
      circle at 50% 44%,
      rgba(255, 220, 140, 0.32),
      transparent 30%
    ),
    linear-gradient(180deg, #7a4d2f 0%, #3b2230 100%);
}
.book-modal[data-book="candyCrown"] .book-frame {
  background: #f5dfb8;
  box-shadow:
    0 0 0 9px rgba(255, 236, 190, 0.72),
    0 0 0 10px rgba(109, 67, 41, 0.16),
    0 12px 24px rgba(88, 52, 30, 0.18);
}
.book-modal[data-book="candyCrown"] .book-reading {
  background:
    radial-gradient(
      circle at 50% 24%,
      rgba(255, 255, 255, 0.48),
      transparent 34%
    ),
    linear-gradient(180deg, rgba(255, 247, 221, 0.36), rgba(244, 218, 174, 0.1));
}
.book-modal[data-book="candyCrown"] .book-word,
.book-modal[data-book="candyCrown"] .book-nav {
  border-color: rgba(255, 107, 61, 0.48);
}
.book-modal[data-book="candyCrown"] .book-read {
  border-color: rgba(255, 107, 61, 0.45);
  background: #fff1a6;
}

.book-modal[data-book="snowStar"] .book-modal-backdrop {
  background:
    radial-gradient(
      circle at 50% 42%,
      rgba(255, 214, 136, 0.28),
      transparent 34%
    ),
    radial-gradient(
      circle at 22% 18%,
      rgba(130, 210, 255, 0.18),
      transparent 22%
    ),
    linear-gradient(180deg, rgba(17, 20, 52, 0.9), rgba(36, 20, 48, 0.9)),
    #151831;
}
.book-modal[data-book="snowStar"] .book-card {
  background:
    radial-gradient(
      circle at 50% 44%,
      rgba(255, 220, 140, 0.32),
      transparent 30%
    ),
    linear-gradient(180deg, #7a4d2f 0%, #3b2230 100%);
}
.book-modal[data-book="snowStar"] .book-frame {
  background: #f5dfb8;
  box-shadow:
    0 0 0 9px rgba(255, 236, 190, 0.72),
    0 0 0 10px rgba(109, 67, 41, 0.16),
    0 12px 24px rgba(88, 52, 30, 0.18);
}
.book-modal[data-book="snowStar"] .book-reading {
  background:
    radial-gradient(
      circle at 50% 24%,
      rgba(255, 255, 255, 0.48),
      transparent 34%
    ),
    linear-gradient(180deg, rgba(255, 247, 221, 0.36), rgba(244, 218, 174, 0.1));
}
.book-modal[data-book="snowStar"] .book-word,
.book-modal[data-book="snowStar"] .book-nav,
.book-modal[data-book="snowStar"] .book-read {
  border-color: rgba(78, 176, 231, 0.46);
}

@media (max-width: 680px) {
  .book-modal.open {
    gap: 10px;
  }
  .book-card {
    width: min(96vw, 900px);
    aspect-ratio: 1.55 / 1;
    padding: 20px;
    max-height: 64vh;
  }
  .book-frame {
    margin: 18px 18px 18px 10px;
  }
  .book-page-img {
    width: 100%;
    height: 100%;
  }
  .book-reading {
    margin: 18px 12px 18px 26px;
    padding: 14px;
  }
  .book-page-line {
    font-size: clamp(24px, 6.6vw, 42px);
  }
  .book-learning-tray {
    grid-template-columns: 1fr;
    gap: 9px;
    width: min(94vw, 560px);
    padding: 9px 10px;
  }
  .book-word {
    min-width: 72px;
    min-height: 34px;
    font-size: 16px;
  }
  .book-controls {
    gap: 8px;
  }
  .book-read {
    min-width: 76px;
  }
}

/* ---------- Story modal ---------- */
.story-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: "Georgia", serif;
}
.story-modal.open {
  display: flex;
  animation: story-fade 0.35s ease;
}
@keyframes story-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.story-modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 50% 40%,
      rgba(255, 214, 236, 0.55) 0%,
      rgba(120, 30, 90, 0.55) 70%
    ),
    rgba(60, 10, 50, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}
.story-modal-card {
  position: relative;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  align-items: center;
  width: min(680px, 92vw);
  padding: 28px 32px;
  background: linear-gradient(180deg, #fff7fb 0%, #ffe6f2 100%);
  border: 4px solid #ff8ac0;
  border-radius: 26px;
  color: #5a1c3a;
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.35),
    0 0 80px rgba(255, 138, 192, 0.5);
  animation: story-pop 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes story-pop {
  0% {
    opacity: 0;
    transform: scale(0.72) translateY(20px);
  }
  60% {
    opacity: 1;
    transform: scale(1.05) translateY(-4px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.story-modal-portrait {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(
    circle at 50% 45%,
    #fff 0%,
    #ffd6ec 60%,
    #ff9ed1 100%
  );
  border-radius: 18px;
  padding: 14px;
  border: 2px solid rgba(255, 138, 192, 0.55);
  min-height: 220px;
}
.story-modal-img {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
  filter: drop-shadow(0 6px 18px rgba(120, 40, 90, 0.35));
  animation: story-img-bob 3.4s ease-in-out infinite;
}
@keyframes story-img-bob {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-8px) rotate(2deg);
  }
}
.story-modal-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.story-modal-found {
  font-family: "Inter", "Georgia", sans-serif;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #b03579;
  opacity: 0.75;
}
.story-modal-name {
  margin: 0;
  font-family: "Georgia", serif;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #b03579;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.6);
  line-height: 1.1;
}
.story-modal-text {
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
  color: #5a1c3a;
}
.story-modal-points {
  display: inline-block;
  align-self: flex-start;
  margin-top: 4px;
  padding: 4px 14px;
  background: #ffd86b;
  color: #6b2247;
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 14px;
  border-radius: 999px;
  border: 2px solid #f5b800;
  letter-spacing: 0.04em;
}
.story-modal-close {
  margin-top: 10px;
  padding: 14px 24px;
  min-height: 48px;
  background: linear-gradient(180deg, #ff8ac0 0%, #d44e8f 100%);
  color: #fff;
  font-family: "Georgia", serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow:
    0 6px 18px rgba(212, 78, 143, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition:
    transform 0.12s,
    box-shadow 0.12s;
  align-self: flex-start;
}
.story-modal-close:hover {
  transform: translateY(-1px);
  box-shadow:
    0 10px 22px rgba(212, 78, 143, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.story-modal-close:active {
  transform: translateY(0);
}

@media (max-width: 700px) {
  .story-modal-card {
    grid-template-columns: 1fr;
    padding: 22px 20px;
    gap: 16px;
    width: 92vw;
  }
  .story-modal-portrait {
    min-height: 180px;
  }
  .story-modal-name {
    font-size: 24px;
  }
  .story-modal-text {
    font-size: 15px;
  }
}

/* ---------- Loading screen ---------- */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 40%, #ffe6f2 0%, #f78fc4 100%);
  font-family: "Georgia", serif;
  transition: opacity 0.6s ease;
}
#loading-screen.gone {
  opacity: 0;
  pointer-events: none;
}
.loading-card {
  text-align: center;
  color: #6b2247;
  padding: 32px 48px;
}
.loading-crown {
  font-size: 64px;
  color: #ffd86b;
  text-shadow: 0 4px 12px rgba(176, 53, 121, 0.45);
  animation: crown-spin 3s ease-in-out infinite;
}
@keyframes crown-spin {
  0%,
  100% {
    transform: rotate(-8deg) scale(1);
  }
  50% {
    transform: rotate(8deg) scale(1.1);
  }
}
.loading-card h1 {
  margin: 8px 0 24px;
  font-size: 36px;
  color: #b03579;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.6);
}
.loading-bar-track {
  width: 300px;
  height: 14px;
  background: rgba(255, 255, 255, 0.55);
  border: 2px solid #b03579;
  border-radius: 999px;
  overflow: hidden;
  margin: 0 auto;
}
.loading-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffd86b 0%, #ff8ac0 100%);
  border-radius: 999px;
  transition: width 0.3s ease;
}
.loading-pct {
  margin-top: 14px;
  font-size: 14px;
  color: #6b2247;
  letter-spacing: 0.05em;
}

/* ---------- Quest tracker + portrait gallery ---------- */
.hud-controls {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.4;
}
.quest-line {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(176, 53, 121, 0.4);
  font-size: 13px;
  color: #6b2247;
  display: flex;
  align-items: center;
  gap: 6px;
}
.quest-icon {
  font-size: 16px;
  filter: drop-shadow(0 1px 2px rgba(176, 53, 121, 0.5));
}
.quest-line.complete .quest-text {
  color: #2a8a4a;
  font-weight: 700;
}
.challenge-line {
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 216, 107, 0.24);
  color: #6b2247;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}
.challenge-line.complete {
  background: rgba(123, 224, 200, 0.28);
  color: #237c5f;
}
.key-line {
  margin-top: 6px;
  padding: 6px 8px;
  border: 2px solid rgba(112, 91, 219, 0.18);
  border-radius: 8px;
  background:
    radial-gradient(
      circle at 12% 18%,
      rgba(255, 255, 255, 0.82),
      transparent 20%
    ),
    linear-gradient(
      180deg,
      rgba(236, 231, 255, 0.82),
      rgba(255, 239, 170, 0.42)
    );
  color: #4f2c7a;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.5);
}
.key-line.complete {
  border-color: rgba(255, 216, 107, 0.62);
  background:
    radial-gradient(
      circle at 16% 20%,
      rgba(255, 255, 255, 0.95),
      transparent 22%
    ),
    linear-gradient(180deg, #fff7c8, #dff9ff);
  color: #7a3f00;
}
.key-icon {
  color: #755bdb;
  font-size: 15px;
  text-shadow: 0 1px 3px rgba(255, 216, 107, 0.9);
}
.clue-line {
  margin-top: 6px;
  padding: 6px 8px;
  border: 2px solid rgba(35, 124, 95, 0.18);
  border-radius: 8px;
  background:
    radial-gradient(
      circle at 86% 18%,
      rgba(255, 255, 255, 0.82),
      transparent 20%
    ),
    linear-gradient(
      180deg,
      rgba(224, 255, 243, 0.82),
      rgba(255, 239, 170, 0.32)
    );
  color: #235c51;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
}
.clue-line.complete {
  border-color: rgba(123, 224, 200, 0.6);
  background: linear-gradient(180deg, #effff7, #fff7c8);
  color: #237c5f;
}
.clue-icon {
  color: #1a9f86;
  font-size: 15px;
  text-shadow: 0 1px 3px rgba(123, 224, 200, 0.8);
}
.challenge-icon {
  color: #b03579;
  font-size: 15px;
  text-shadow: 0 1px 2px rgba(255, 216, 107, 0.8);
}
.helper-quest {
  margin-top: 7px;
  padding: 8px;
  border: 2px solid rgba(176, 53, 121, 0.2);
  border-radius: 10px;
  background:
    radial-gradient(
      circle at 12% 16%,
      rgba(255, 255, 255, 0.92),
      transparent 26%
    ),
    linear-gradient(180deg, rgba(255, 248, 225, 0.9), rgba(226, 255, 245, 0.72));
  box-shadow: inset 0 0 14px rgba(255, 255, 255, 0.55);
}
.helper-quest.complete {
  border-color: rgba(255, 216, 107, 0.76);
  background:
    radial-gradient(
      circle at 82% 18%,
      rgba(255, 255, 255, 0.95),
      transparent 24%
    ),
    linear-gradient(180deg, #fff7c8, #e2fff5);
}
.helper-quest-head {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
}
.helper-quest-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #ffd86b, #ff8ac0);
  color: #6b2247;
  font-size: 16px;
  box-shadow: 0 2px 6px rgba(176, 53, 121, 0.28);
}
.helper-quest-title {
  color: #7a2a60;
  font:
    900 13px/1.1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
}
.helper-quest-subtitle {
  margin-top: 2px;
  color: #5b6f55;
  font:
    800 11px/1.1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
}
.helper-quest-count {
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #237c5f;
  font:
    900 12px/1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
}
.helper-quest-steps {
  margin-top: 7px;
  display: grid;
  gap: 4px;
}
.helper-step {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 5px 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
  color: #6b2247;
}
.helper-step.done {
  background: rgba(123, 224, 200, 0.24);
  color: #237c5f;
}
.helper-step-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 216, 107, 0.34);
  font-size: 13px;
  font-weight: 900;
}
.helper-step-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}
.helper-step-copy strong,
.helper-step-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.helper-step-copy strong {
  font:
    900 12px/1.05 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
}
.helper-step-copy small {
  color: inherit;
  font:
    800 10px/1.05 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  opacity: 0.76;
}
.helper-quest-reward {
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px dashed rgba(176, 53, 121, 0.22);
  color: #7a3f00;
  font:
    900 11px/1.1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  text-align: center;
}
.adventure-line {
  width: 100%;
  min-height: 44px;
  margin-top: 7px;
  padding: 10px 12px;
  border: 2px solid rgba(112, 91, 219, 0.18);
  border-radius: 10px;
  background:
    radial-gradient(
      circle at 14% 22%,
      rgba(255, 255, 255, 0.86),
      transparent 23%
    ),
    linear-gradient(180deg, #f4f0ff, #fff7c8);
  color: #4f2c7a;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font:
    900 14px/1.15 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  cursor: pointer;
  touch-action: manipulation;
  pointer-events: auto;
  box-shadow: 0 4px 0 rgba(112, 91, 219, 0.12);
}
.adventure-line:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(112, 91, 219, 0.12);
}
.adventure-icon {
  color: #755bdb;
  font-size: 15px;
}
.adventure-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.game-center-open {
  width: 100%;
  min-height: 48px;
  margin-top: 7px;
  padding: 8px 12px;
  border: 2px solid rgba(176, 53, 121, 0.32);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff8ee, #ffe1f0);
  color: #8a2f64;
  font:
    800 15px/1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  cursor: pointer;
  touch-action: manipulation;
  pointer-events: auto;
  box-shadow: 0 4px 0 rgba(176, 53, 121, 0.14);
}
.game-center-open:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(176, 53, 121, 0.14);
}
.portrait-gallery {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}
.portrait-slot {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
  border: 2px solid rgba(176, 53, 121, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  transition: all 0.4s ease;
}
.portrait-slot.collected {
  border-color: #ffd86b;
  background: linear-gradient(135deg, #fff7e0 0%, #ffe0a0 100%);
  box-shadow: 0 0 14px rgba(255, 216, 107, 0.7);
  animation: portrait-pop 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}
@keyframes portrait-pop {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  60% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
.portrait-slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: grayscale(1) brightness(0.4);
  transition: filter 0.4s ease;
}
.portrait-slot.collected img {
  filter: none;
}
.portrait-slot::after {
  content: "?";
  position: absolute;
  font-size: 18px;
  font-weight: bold;
  color: #b03579;
  opacity: 0.6;
}
.portrait-slot.collected::after {
  display: none;
}
.portrait-slot.collected.flash {
  animation: slot-flash 0.8s ease;
}

/* ---------- Game Center ---------- */
.game-center {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: "Georgia", serif;
}
.game-center.open {
  display: flex;
  animation: story-fade 0.2s ease;
}
.game-center-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 50% 30%,
      rgba(255, 216, 107, 0.4),
      transparent 34%
    ),
    repeating-linear-gradient(
      135deg,
      rgba(255, 111, 168, 0.18) 0 18px,
      rgba(123, 224, 200, 0.14) 18px 36px,
      rgba(201, 123, 255, 0.14) 36px 54px
    ),
    rgba(42, 18, 62, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.game-center-card {
  position: relative;
  box-sizing: border-box;
  width: min(780px, 94vw);
  max-height: calc(100dvh - 22px);
  overflow-y: auto;
  padding: 22px;
  border: 5px solid #ffd86b;
  border-radius: 22px;
  background:
    radial-gradient(
      circle at 12% 8%,
      rgba(123, 224, 200, 0.34),
      transparent 25%
    ),
    linear-gradient(180deg, #fff7fb, #ffe6f2);
  color: #5a1c3a;
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.46),
    0 0 70px rgba(255, 216, 107, 0.46);
}
.game-center-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: #6b2247;
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}
.game-center-kicker {
  color: #9b315f;
  font-family: "Inter", "Georgia", sans-serif;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.game-center-card h2 {
  margin: 3px 52px 8px 0;
  color: #b03579;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1;
}
.game-center-stats {
  margin-bottom: 12px;
  color: #6b2247;
  font-weight: 800;
  line-height: 1.25;
}
.game-center-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.game-center-tabs button {
  flex: 1;
  min-width: 118px;
  min-height: 48px;
  padding: 6px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 2px solid rgba(176, 53, 121, 0.28);
  border-radius: 999px;
  background: #fff;
  color: #8a2f64;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}
.tab-count {
  min-width: 34px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(176, 53, 121, 0.1);
  color: #6b2247;
  font:
    900 11px/1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
}
.game-center-tabs button.active {
  background: linear-gradient(180deg, #ff8ac0, #d84b90);
  color: #fff;
}
.game-center-tabs button.active .tab-count {
  background: rgba(255, 255, 255, 0.26);
  color: #fff;
}
.game-center-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.game-center.bookshelf-mode {
  align-items: stretch;
  padding: 12px;
}
.game-center.bookshelf-mode .game-center-backdrop {
  background:
    radial-gradient(
      circle at 50% 26%,
      rgba(255, 216, 107, 0.42),
      transparent 34%
    ),
    rgba(34, 15, 48, 0.88);
}
.game-center.bookshelf-mode .game-center-card {
  width: min(1180px, 100%);
  max-height: none;
  min-height: calc(100dvh - 24px);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  overflow: hidden;
  padding: 14px;
  background:
    linear-gradient(
      180deg,
      rgba(255, 247, 251, 0.92),
      rgba(255, 230, 242, 0.82)
    ),
    #ffe6f2;
}
.game-center.bookshelf-mode .game-center-kicker,
.game-center.bookshelf-mode .game-center-card > h2,
.game-center.bookshelf-mode .game-center-stats {
  display: none;
}
.game-center.bookshelf-mode .game-center-tabs {
  width: calc(100% - 54px);
  margin: 0;
  padding-right: 4px;
}
.game-center.bookshelf-mode .game-center-tabs button {
  min-width: 88px;
  min-height: 38px;
}
.game-center.bookshelf-mode #game-center-panel-books {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 0;
}
.mini-world-atlas {
  position: relative;
  min-height: 132px;
  grid-column: 1 / -1;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  border: 3px solid rgba(255, 216, 107, 0.56);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(90, 28, 58, 0.58)),
    url("data/mini_game_worlds/world_atlas_banner.png") center / cover no-repeat;
  color: #fff;
  box-shadow: 0 10px 24px rgba(107, 34, 71, 0.16);
}
.mini-world-atlas h3,
.mini-world-atlas p {
  position: relative;
  z-index: 1;
  margin: 0;
  text-shadow: 0 2px 8px rgba(70, 22, 48, 0.5);
}
.mini-world-atlas h3 {
  font-size: 24px;
  line-height: 1;
}
.mini-world-atlas p {
  margin-top: 4px;
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", Arial, sans-serif;
  font-size: 13px;
  font-weight: 800;
}
.game-center-list.hidden {
  display: none;
}
.adventure-pass-list {
  grid-template-columns: 1fr;
}
.journal-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.journal-recent {
  grid-column: 1 / -1;
  padding: 12px;
  border: 2px solid rgba(112, 91, 219, 0.18);
  border-radius: 12px;
  background:
    radial-gradient(
      circle at 10% 12%,
      rgba(255, 255, 255, 0.92),
      transparent 24%
    ),
    linear-gradient(180deg, #f4f0ff, #e8fff7);
  box-shadow: 0 8px 18px rgba(80, 65, 140, 0.11);
}
.journal-recent-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.journal-recent-head h3,
.journal-recent-head p {
  margin: 0;
}
.journal-recent-head h3 {
  color: #4f2c7a;
  font-size: 18px;
  line-height: 1.05;
}
.journal-recent-head p {
  margin-top: 3px;
  color: #235c51;
  font:
    900 12px/1.1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
}
.journal-recent-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}
.journal-recent-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.68);
}
.journal-recent-row.has-action {
  grid-template-columns: 24px minmax(0, 1fr) auto auto;
}
.journal-recent-row span {
  display: grid;
  place-items: center;
}
.journal-recent-row strong {
  overflow: hidden;
  color: #74214f;
  font-size: 13px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.journal-recent-row small,
.journal-recent-empty {
  color: #6b2247;
  font:
    900 11px/1.1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  opacity: 0.72;
}
.journal-recent-row button {
  min-width: 64px;
  min-height: 44px;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #7be0c8, #42c39d);
  color: #174f46;
  font:
    900 13px/1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  cursor: pointer;
  touch-action: manipulation;
}
.journal-recent-empty {
  padding: 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.58);
  text-align: center;
}
.journal-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 12px;
  border: 2px solid rgba(176, 53, 121, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 7px 16px rgba(107, 34, 71, 0.1);
}
.journal-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #fff1a6, #ff8ac0);
  color: #6b2247;
  font-size: 22px;
  font-weight: 900;
}
.journal-card h3 {
  margin: 0;
  overflow: hidden;
  color: #8a2f64;
  font-size: 16px;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.journal-card p {
  margin: 4px 0 0;
  color: #237c5f;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}
.adventure-surprise {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 2px solid rgba(112, 91, 219, 0.2);
  border-radius: 14px;
  background:
    radial-gradient(
      circle at 12% 20%,
      rgba(255, 255, 255, 0.92),
      transparent 22%
    ),
    linear-gradient(180deg, #f4f0ff, #e8fff7);
  box-shadow: 0 8px 20px rgba(80, 65, 140, 0.12);
}
.adventure-surprise h3 {
  margin: 0;
  color: #4f2c7a;
  font-size: 20px;
  line-height: 1.05;
}
.adventure-surprise p {
  margin: 3px 0 0;
  overflow: hidden;
  color: #235c51;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.18;
  text-overflow: ellipsis;
}
.adventure-surprise button {
  min-width: 96px;
  min-height: 48px;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffd86b, #ff8ac0);
  color: #6b2247;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 4px 0 rgba(176, 53, 121, 0.16);
}
.adventure-pass {
  min-height: 0;
  padding: 14px;
  border: 2px solid rgba(176, 53, 121, 0.18);
  border-radius: 12px;
  background:
    radial-gradient(
      circle at 8% 12%,
      rgba(255, 255, 255, 0.88),
      transparent 26%
    ),
    linear-gradient(180deg, #fffaf0, #ffe6f2);
  box-shadow: 0 8px 20px rgba(176, 53, 121, 0.12);
}
.adventure-pass.complete {
  border-color: rgba(255, 216, 107, 0.78);
  background:
    radial-gradient(
      circle at 90% 10%,
      rgba(255, 255, 255, 0.92),
      transparent 24%
    ),
    linear-gradient(180deg, #fff7c8, #e8fff7);
}
.adventure-pass-top {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.adventure-pass-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #ffd86b, #ff8ac0);
  color: #6b2247;
  font-size: 26px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.56);
}
.adventure-pass-copy h3 {
  margin: 0;
  color: #8a2f64;
  font-size: 21px;
  line-height: 1.05;
}
.adventure-pass-copy p {
  margin: 3px 0 0;
  color: #6b2247;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}
.adventure-pass-progress {
  min-width: 46px;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #237c5f;
  font:
    900 13px/1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  text-align: center;
}
.adventure-pass-bar {
  height: 9px;
  margin: 10px 0 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(176, 53, 121, 0.12);
}
.adventure-pass-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff8ac0, #ffd86b, #7be0c8);
  transition: width 0.24s ease;
}
.adventure-pass-steps {
  display: grid;
  gap: 7px;
}
.adventure-pass-step {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.68);
}
.adventure-pass-step.done {
  background: rgba(123, 224, 200, 0.22);
}
.adventure-pass-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 216, 107, 0.34);
  color: #8a2f64;
  font-weight: 900;
}
.adventure-pass-step-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.adventure-pass-step-copy strong {
  overflow: hidden;
  color: #74214f;
  font-size: 14px;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.adventure-pass-step-copy small {
  overflow: hidden;
  color: #6b2247;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  opacity: 0.78;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.adventure-pass-step button {
  min-width: 80px;
  min-height: 44px;
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #7be0c8, #42c39d);
  color: #174f46;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 3px 0 rgba(24, 122, 94, 0.18);
}
.adventure-pass-step button:disabled {
  cursor: default;
  opacity: 0.58;
}
.adventure-pass-reward {
  margin-top: 10px;
  padding: 7px 9px;
  border-radius: 9px;
  background: rgba(255, 216, 107, 0.22);
  color: #7a3f00;
  font:
    900 12px/1.15 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  text-align: center;
}
.adventure-reward {
  position: fixed;
  inset: 0;
  z-index: 720;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: "Georgia", serif;
}
.adventure-reward.open {
  display: flex;
  animation: story-fade 0.22s ease;
}
.adventure-reward-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 50% 34%,
      rgba(255, 216, 107, 0.42),
      transparent 34%
    ),
    rgba(42, 18, 62, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.adventure-reward-card {
  position: relative;
  width: min(420px, calc(100vw - 28px));
  padding: 24px;
  border: 5px solid #ffd86b;
  border-radius: 20px;
  background:
    radial-gradient(
      circle at 18% 12%,
      rgba(255, 255, 255, 0.9),
      transparent 25%
    ),
    linear-gradient(180deg, #fff7c8, #ffe6f2);
  color: #6b2247;
  text-align: center;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.44),
    0 0 56px rgba(255, 216, 107, 0.52);
}
.adventure-reward-icon {
  width: 82px;
  height: 82px;
  margin: 0 auto 10px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #ffd86b, #ff8ac0);
  color: #6b2247;
  font-size: 42px;
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.62),
    0 10px 24px rgba(176, 53, 121, 0.26);
}
.adventure-reward-kicker {
  color: #8a2f64;
  font:
    900 12px/1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.adventure-reward-card h2 {
  margin: 8px 0 6px;
  color: #b03579;
  font-size: 34px;
  line-height: 1;
}
.adventure-reward-card p {
  margin: 0 auto 16px;
  max-width: 320px;
  color: #6b2247;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
}
.adventure-reward-card button {
  min-width: 150px;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #7be0c8, #42c39d);
  color: #174f46;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(24, 122, 94, 0.2);
}
.hud-toggle:focus-visible,
.adventure-line:focus-visible,
.game-center-tabs button:focus-visible,
.game-center-item button:focus-visible,
.journal-recent-row button:focus-visible,
.adventure-surprise button:focus-visible,
.adventure-pass-step button:focus-visible,
.adventure-reward-card button:focus-visible {
  outline: 3px solid #7be0c8;
  outline-offset: 3px;
}
.game-center-item {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 78px;
  padding: 10px;
  border: 2px solid rgba(176, 53, 121, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 7px 16px rgba(107, 34, 71, 0.1);
}
.game-center-item.complete {
  background: linear-gradient(
    180deg,
    rgba(232, 255, 242, 0.92),
    rgba(255, 255, 255, 0.8)
  );
  border-color: rgba(35, 130, 74, 0.28);
}
.game-center-item.world-card {
  min-height: 104px;
  overflow: hidden;
  background:
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.9) 0 54%,
      rgba(255, 255, 255, 0.64)
    ),
    var(--world-thumb) center / cover no-repeat;
  border-color: rgba(255, 216, 107, 0.42);
}
.game-center-item.world-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0),
    rgba(255, 216, 107, 0.14)
  );
  pointer-events: none;
}
.game-center-item.complete::after {
  content: "✓";
  position: absolute;
  top: -8px;
  left: -8px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #7be0c8;
  color: #173f35;
  font-weight: 900;
  box-shadow: 0 3px 8px rgba(23, 63, 53, 0.22);
}
.game-center-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff1a6, #ff8ac0);
  color: #fff;
  font-size: 26px;
  text-shadow: 0 2px 0 rgba(107, 34, 71, 0.24);
}
.game-center-item.book .game-center-icon {
  background: linear-gradient(180deg, #fff8ee, #ffd86b);
}
.bookshelf-selector {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  min-height: 360px;
}
.game-center.bookshelf-mode .bookshelf-selector {
  min-height: 0;
  height: 100%;
}
.game-center.bookshelf-mode .bookshelf-scene,
.game-center.bookshelf-mode .bookshelf-scene img {
  min-height: 0;
  height: 100%;
}
.bookshelf-scene {
  position: relative;
  min-height: 320px;
  overflow: hidden;
  border: 4px solid rgba(255, 216, 107, 0.62);
  border-radius: 12px;
  background: #311b3f;
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.22),
    0 18px 34px rgba(74, 28, 82, 0.22);
}
.bookshelf-scene img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
}
.bookshelf-hotspots {
  position: absolute;
  inset: 0;
}
.bookshelf-book {
  position: absolute;
  top: 47%;
  width: 8.8%;
  height: 29%;
  border: 0;
  border-radius: 10px 10px 7px 7px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transform: translate3d(0, 0, 0) scale(1);
  transform-origin: 50% 100%;
  transition:
    transform 0.28s cubic-bezier(0.18, 0.82, 0.24, 1),
    filter 0.18s ease,
    box-shadow 0.18s ease;
}
.bookshelf-book.shelf-slot-1 {
  left: 27.9%;
}
.bookshelf-book.shelf-slot-2 {
  left: 40.7%;
}
.bookshelf-book.shelf-slot-3 {
  left: 53.7%;
}
.bookshelf-book.shelf-slot-4 {
  left: 66.8%;
}
.bookshelf-book.selected,
.bookshelf-book:focus-visible,
.bookshelf-book:hover {
  outline: 3px solid rgba(255, 216, 107, 0.92);
  outline-offset: 3px;
  filter: saturate(1.14) brightness(1.06);
}
.bookshelf-book.selected {
  z-index: 2;
}
.bookshelf-book.pulled {
  z-index: 2;
  transform: translate3d(0, -22px, 0) scale(1.1) rotate(-2deg);
  animation: bookshelf-pull 0.62s cubic-bezier(0.16, 0.84, 0.24, 1);
}
.bookshelf-book.read::after {
  content: "✓";
  position: absolute;
  right: 10%;
  bottom: 3%;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #7be0c8;
  color: #173f35;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 3px 8px rgba(23, 63, 53, 0.22);
}
.bookshelf-book-label {
  position: absolute;
  left: 50%;
  bottom: -24px;
  max-width: 130px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 248, 238, 0.94);
  color: #6b2247;
  font:
    900 12px/1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  opacity: 0;
  transform: translateX(-50%) translateY(4px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
  white-space: nowrap;
  pointer-events: none;
}
.bookshelf-book.selected .bookshelf-book-label,
.bookshelf-book:focus-visible .bookshelf-book-label,
.bookshelf-book:hover .bookshelf-book-label {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
@keyframes bookshelf-pull {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  62% {
    transform: translate3d(0, -30px, 0) scale(1.13) rotate(-3deg);
  }
  100% {
    transform: translate3d(0, -22px, 0) scale(1.1) rotate(-2deg);
  }
}
@media (max-width: 760px) {
  .bookshelf-selector {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .bookshelf-scene,
  .bookshelf-scene img {
    min-height: 250px;
  }
  .bookshelf-book {
    top: 47%;
    height: 29%;
    width: 8.8%;
  }
  .bookshelf-book.shelf-slot-1 {
    left: 27.9%;
  }
  .bookshelf-book.shelf-slot-2 {
    left: 40.7%;
  }
  .bookshelf-book.shelf-slot-3 {
    left: 53.7%;
  }
  .bookshelf-book.shelf-slot-4 {
    left: 66.8%;
  }
}
.game-center-copy h3 {
  margin: 0 0 3px;
  color: #8a2f64;
  font-size: 17px;
  line-height: 1.08;
}
.game-center-copy p {
  margin: 0;
  color: #6b2247;
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", Arial, sans-serif;
  font-size: 12px;
  line-height: 1.2;
}
.game-center-copy small,
.game-center-brain {
  display: block;
  margin-top: 5px;
  color: #235c51;
  font:
    800 11px/1.22 "Trebuchet MS",
    Arial,
    sans-serif;
}
.game-center-empty {
  min-height: 78px;
  display: grid;
  place-items: center;
  padding: 16px;
  border: 2px dashed rgba(176, 53, 121, 0.22);
  border-radius: 12px;
  background: rgba(255, 248, 238, 0.72);
  color: #6b2247;
  font:
    800 14px/1.3 "Trebuchet MS",
    Arial,
    sans-serif;
  text-align: center;
}
.game-center-item button {
  min-width: 82px;
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #7be0c8, #37b995);
  color: #173f35;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(23, 63, 53, 0.22);
}
.game-center-item button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(23, 63, 53, 0.22);
}
@keyframes slot-flash {
  0% {
    box-shadow: 0 0 14px rgba(255, 216, 107, 0.7);
  }
  50% {
    box-shadow: 0 0 40px rgba(255, 216, 107, 1);
    transform: scale(1.15);
  }
  100% {
    box-shadow: 0 0 14px rgba(255, 216, 107, 0.7);
  }
}

/* ---------- Mobile touch controls ---------- */
#touch-controls {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
}
.touch-hidden {
  display: none;
}
.joystick {
  position: absolute;
  bottom: max(30px, calc(env(safe-area-inset-bottom) + 18px));
  left: max(30px, calc(env(safe-area-inset-left) + 18px));
  width: 130px;
  height: 130px;
  background: rgba(255, 255, 255, 0.35);
  border: 3px solid rgba(176, 53, 121, 0.6);
  border-radius: 50%;
  pointer-events: auto;
  touch-action: none;
}
.joystick-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  background: linear-gradient(180deg, #ff8fc4 0%, #ff5b8d 100%);
  border: 3px solid #c0367a;
  border-radius: 50%;
  box-shadow:
    0 4px 0 #c0367a,
    0 6px 14px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  transition: none;
}
.touch-btn {
  position: absolute;
  bottom: max(50px, calc(env(safe-area-inset-bottom) + 28px));
  right: max(40px, calc(env(safe-area-inset-right) + 24px));
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffd86b 0%, #f5b800 100%);
  border: 3px solid #b08000;
  color: #5a3800;
  font-family: "Georgia", serif;
  font-size: 36px;
  font-weight: bold;
  pointer-events: auto;
  box-shadow:
    0 4px 0 #b08000,
    0 6px 14px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  user-select: none;
  touch-action: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
  transition:
    transform 0.08s cubic-bezier(0.22, 0.61, 0.36, 1),
    box-shadow 0.08s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.touch-btn:active {
  transform: translateY(3px) scale(0.94);
  box-shadow:
    0 1px 0 #b08000,
    0 2px 6px rgba(0, 0, 0, 0.18);
}

/* ---------- Pause menu ---------- */
#pause-menu {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: "Georgia", serif;
}
#pause-menu.open {
  display: flex;
}
.pause-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(60, 10, 50, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.pause-card {
  position: relative;
  width: min(440px, 92vw);
  max-height: 88vh;
  overflow-y: auto;
  padding: 28px 32px;
  background: linear-gradient(180deg, #fff7fb 0%, #ffe6f2 100%);
  border: 4px solid #ff8ac0;
  border-radius: 26px;
  color: #5a1c3a;
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.45),
    0 0 80px rgba(255, 138, 192, 0.5);
}
.pause-card h2 {
  margin: 0 0 16px;
  font-size: 28px;
  color: #b03579;
  text-align: center;
}
.pause-section {
  margin: 20px 0 8px;
  font-size: 16px;
  color: #b03579;
  text-align: center;
}
.pause-btn {
  display: block;
  width: 100%;
  margin: 10px 0;
  padding: 16px 20px;
  min-height: 56px;
  background: linear-gradient(180deg, #fff 0%, #ffe6f2 100%);
  color: #b03579;
  font-family: "Georgia", serif;
  font-size: 17px;
  font-weight: 700;
  border: 2px solid #ff8ac0;
  border-radius: 14px;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 3px 0 rgba(176, 53, 121, 0.18);
  transition:
    transform 0.16s cubic-bezier(0.22, 0.61, 0.36, 1),
    box-shadow 0.16s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.pause-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 5px 0 rgba(176, 53, 121, 0.18),
    0 6px 14px rgba(255, 138, 192, 0.42);
}
.pause-btn:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 1px 0 rgba(176, 53, 121, 0.18);
}
.pause-btn:focus-visible {
  outline: 3px solid rgba(123, 224, 200, 0.85);
  outline-offset: 3px;
}
.pause-btn.primary {
  background: linear-gradient(180deg, #ff8ac0 0%, #d44e8f 100%);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow:
    0 3px 0 rgba(120, 30, 80, 0.32),
    0 4px 14px rgba(212, 78, 143, 0.4);
}
.pause-btn.primary:hover {
  box-shadow:
    0 5px 0 rgba(120, 30, 80, 0.32),
    0 6px 16px rgba(212, 78, 143, 0.5);
}
.pause-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0;
  font-size: 14px;
}
.pause-row label {
  font-weight: 700;
  color: #6b2247;
}
.pause-row input[type="range"] {
  flex: 1;
  height: 32px;
  accent-color: #ff5b8d;
  touch-action: manipulation;
}
.pause-row select {
  padding: 10px 14px;
  min-height: 44px;
  border: 2px solid #ff8ac0;
  border-radius: 8px;
  background: #fff;
  color: #5a1c3a;
  font-family: "Georgia", serif;
  font-size: 15px;
  touch-action: manipulation;
}
.pause-controls-help {
  margin: 12px 0;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: #6b2247;
}
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}
.achievement {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.4);
  border: 2px solid rgba(176, 53, 121, 0.25);
  font-size: 22px;
  color: #b03579;
  filter: grayscale(1) opacity(0.4);
  position: relative;
  cursor: help;
}
.achievement.unlocked {
  filter: none;
  background: linear-gradient(135deg, #fff7e0 0%, #ffe0a0 100%);
  border-color: #ffd86b;
  box-shadow: 0 0 8px rgba(255, 216, 107, 0.5);
}
.achievement[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: #5a1c3a;
  color: #fff;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-family: "Inter", sans-serif;
  z-index: 10;
}

/* ---------- Victory screen ---------- */
#victory-screen {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: "Georgia", serif;
  background: radial-gradient(
    circle at 50% 40%,
    rgba(255, 230, 242, 0.85) 0%,
    rgba(120, 30, 90, 0.7) 100%
  );
}
#victory-screen.open {
  display: flex;
  animation: story-fade 0.6s ease;
}
#confetti-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.victory-card {
  position: relative;
  text-align: center;
  width: min(540px, 92vw);
  padding: 36px 40px;
  background: linear-gradient(180deg, #fff7fb 0%, #ffe6f2 100%);
  border: 5px solid #ffd86b;
  border-radius: 30px;
  color: #5a1c3a;
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.4),
    0 0 120px rgba(255, 216, 107, 0.7);
  animation: story-pop 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.victory-crown {
  font-size: 80px;
  margin-bottom: 8px;
  filter: drop-shadow(0 6px 14px rgba(255, 216, 107, 0.7));
  animation: crown-spin 2s ease-in-out infinite;
}
.victory-card h1 {
  margin: 0 0 12px;
  font-size: 36px;
  color: #b03579;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.6);
}
.victory-text {
  font-size: 17px;
  line-height: 1.55;
  margin: 0 0 20px;
}
.victory-text em {
  color: #b03579;
  font-style: italic;
  font-weight: 700;
}
.victory-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 24px;
  padding: 14px;
  background: rgba(255, 216, 107, 0.25);
  border-radius: 14px;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  color: #6b2247;
}
.victory-stats span {
  color: #b03579;
}

/* ---------- Fairy dust pickup toast ---------- */
.dust-toast {
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  background: linear-gradient(135deg, #ffe6f2 0%, #ffd86b 100%);
  border: 3px solid #ff8ac0;
  border-radius: 999px;
  color: #b03579;
  font-family: "Georgia", serif;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(255, 138, 192, 0.5);
  z-index: 710;
  pointer-events: none;
  animation: dust-toast 1.6s cubic-bezier(0.16, 0.84, 0.24, 1) forwards;
}
.dust-toast.key-toast {
  max-width: min(86vw, 560px);
  white-space: normal;
  text-align: center;
  background: linear-gradient(135deg, #f1edff 0%, #fff2a8 55%, #ddf8ff 100%);
  border-color: #8b68ff;
  color: #4f2c7a;
}
.dust-toast.reward-toast {
  border-color: #ffd86b;
  color: #7a3f00;
}
.dust-toast.clue-toast {
  max-width: min(86vw, 560px);
  white-space: normal;
  text-align: center;
  background: linear-gradient(135deg, #e8fff7 0%, #fff7c8 100%);
  border-color: #7be0c8;
  color: #235c51;
}
.dust-toast.helper-toast {
  max-width: min(88vw, 620px);
  white-space: normal;
  text-align: center;
  background: linear-gradient(135deg, #fff7c8 0%, #e2fff5 52%, #ffe1f0 100%);
  border-color: #ffd86b;
  color: #6b2247;
}
.dust-toast.pass-toast {
  max-width: min(88vw, 620px);
  white-space: normal;
  text-align: center;
  background: linear-gradient(135deg, #fff7c8 0%, #ffe6f2 48%, #e8fff7 100%);
  border-color: #ffd86b;
  color: #6b2247;
}
.dust-toast.mini-toast {
  max-width: min(88vw, 560px);
  white-space: normal;
  text-align: center;
  background: linear-gradient(135deg, #e8fff7 0%, #f4f0ff 52%, #fff7c8 100%);
  border-color: #7be0c8;
  color: #235c51;
}
.dust-toast.word-toast {
  max-width: min(82vw, 420px);
  white-space: normal;
  text-align: center;
  background: linear-gradient(135deg, #f4f0ff 0%, #fff7c8 100%);
  border-color: #c89bff;
  color: #4f2c7a;
}
@keyframes dust-toast {
  0% {
    opacity: 0;
    transform: translate(-50%, 20px) scale(0.8);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1.1);
  }
  80% {
    opacity: 1;
    transform: translate(-50%, -10px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -40px) scale(0.95);
  }
}

/* ---------- Screen shake ---------- */
@keyframes screen-shake {
  0%,
  100% {
    transform: translate(0, 0);
  }
  20% {
    transform: translate(-6px, 4px);
  }
  40% {
    transform: translate(5px, -5px);
  }
  60% {
    transform: translate(-4px, -3px);
  }
  80% {
    transform: translate(3px, 5px);
  }
}
body.shake #app {
  animation: screen-shake 0.4s ease;
}

/* ---------- Outdoor castle clues ---------- */
.clue-modal {
  position: fixed;
  inset: 0;
  z-index: 245;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: "Georgia", serif;
}
.clue-modal.open {
  display: flex;
  animation: story-fade 0.22s ease;
}
.clue-modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 50% 36%,
      rgba(255, 248, 225, 0.52),
      transparent 38%
    ),
    rgba(30, 23, 60, 0.62);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
.clue-card {
  position: relative;
  width: min(560px, 92vw);
  box-sizing: border-box;
  padding: 24px;
  border: 5px solid #7be0c8;
  border-radius: 18px;
  background:
    radial-gradient(
      circle at 15% 18%,
      rgba(255, 216, 107, 0.35),
      transparent 32%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.98),
      rgba(235, 255, 247, 0.98)
    );
  color: #235c51;
  text-align: center;
  box-shadow:
    0 26px 80px rgba(0, 0, 0, 0.38),
    0 0 70px rgba(123, 224, 200, 0.42);
}
.clue-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: #235c51;
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}
.clue-kicker {
  margin-bottom: 6px;
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", Arial, sans-serif;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #1a9f86;
}
.clue-title {
  margin: 0 42px 10px;
  color: #6b2247;
  font-size: clamp(24px, 5vw, 34px);
  line-height: 1.08;
}
.clue-prompt {
  margin: 0 auto 18px;
  max-width: 440px;
  color: #4a1834;
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", Arial, sans-serif;
  font-size: clamp(18px, 4vw, 23px);
  line-height: 1.35;
}
.clue-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.clue-choice {
  min-height: 56px;
  border: 3px solid rgba(35, 124, 95, 0.24);
  border-radius: 12px;
  background: linear-gradient(180deg, #fffefa, #fff1c6);
  color: #7a3f00;
  font:
    900 18px/1.1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(35, 124, 95, 0.18);
}
.clue-choice:hover,
.clue-choice:focus-visible {
  outline: 3px solid rgba(255, 216, 107, 0.72);
  transform: translateY(-1px);
}
.clue-choice:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(35, 124, 95, 0.18);
}
.clue-feedback {
  min-height: 28px;
  margin-top: 16px;
  color: #8a2f64;
  font:
    800 16px/1.3 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
}
.clue-feedback.good {
  color: #237c5f;
}
@media (max-width: 560px) {
  .clue-card {
    width: min(94vw, 420px);
    max-height: 88dvh;
    padding: 20px 16px 18px;
    overflow-y: auto;
  }
  .clue-title {
    margin-right: 44px;
    margin-left: 8px;
    font-size: 25px;
  }
  .clue-prompt {
    font-size: 18px;
  }
  .clue-choices {
    grid-template-columns: 1fr;
  }
  .clue-choice {
    min-height: 50px;
    font-size: 18px;
  }
}

/* ---------- Room mini games ---------- */
.mini-game-modal {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: none;
  font-family: "Georgia", serif;
  background:
    linear-gradient(
      180deg,
      rgba(255, 252, 241, 0.98),
      rgba(255, 236, 246, 0.98)
    ),
    url("data/mini_game_worlds/world_atlas_banner.png") center / cover no-repeat;
}
.mini-game-modal.open {
  display: block;
  animation: story-fade 0.18s ease;
}
body.mini-game-page-open {
  overflow: hidden;
}
.mini-game-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 50% 38%,
      rgba(255, 248, 225, 0.5),
      transparent 38%
    ),
    rgba(255, 248, 225, 0.38);
  pointer-events: none;
}
.mini-game-card {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  max-height: 100dvh;
  box-sizing: border-box;
  padding: 22px clamp(14px, 3vw, 34px) 20px;
  color: #4a1834;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.84),
      rgba(255, 236, 246, 0.8)
    ),
    radial-gradient(
      circle at 20% 20%,
      rgba(255, 216, 107, 0.35),
      transparent 35%
    );
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.mini-game-card::before {
  content: "";
  position: fixed;
  inset: 10px;
  border: 2px dashed rgba(176, 53, 121, 0.18);
  border-radius: 18px;
  pointer-events: none;
}
.mini-game-close {
  position: relative;
  z-index: 3;
  width: auto;
  min-width: 104px;
  height: 48px;
  margin: 0 0 8px;
  padding: 0 20px;
  border: 3px solid rgba(255, 216, 107, 0.85);
  border-radius: 999px;
  background: linear-gradient(180deg, #8c2b61, #6b2247);
  color: #fff;
  font:
    900 16px "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 8px 18px rgba(107, 34, 71, 0.22);
}
.mini-game-kicker {
  position: relative;
  z-index: 1;
  font-family: "Inter", "Georgia", sans-serif;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #9b315f;
}
.mini-game-title {
  position: relative;
  z-index: 1;
  margin: 4px 52px 8px 0;
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.05;
  color: #b03579;
}
.mini-game-prompt,
.mini-game-brain,
.mini-game-progress,
.mini-game-feedback {
  position: relative;
  z-index: 1;
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.35;
}
.mini-game-brain {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 10px;
  max-width: min(760px, calc(100vw - 34px));
  padding: 10px 14px;
  border: 2px solid rgba(123, 224, 200, 0.72);
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    rgba(232, 255, 247, 0.94),
    rgba(255, 247, 200, 0.9)
  );
  color: #235c51;
  box-shadow: 0 7px 18px rgba(35, 92, 81, 0.1);
}
.mini-game-brain[hidden] {
  display: none;
}
.mini-game-brain strong {
  grid-row: span 2;
  align-self: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #8c2b61;
  font:
    900 12px/1.1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  text-transform: uppercase;
}
.mini-game-brain span {
  font-weight: 800;
}
.mini-game-brain em {
  color: #4a6a33;
  font:
    700 13px/1.25 "Trebuchet MS",
    Arial,
    sans-serif;
}
.mini-game-progress {
  min-height: 26px;
  color: #69401a;
  font-weight: 700;
}
.mini-game-feedback {
  min-height: 28px;
  color: #a33a4e;
  font-weight: 700;
}
.mini-game-feedback.good {
  color: #23824a;
}
.mini-game-board {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  min-height: clamp(380px, 56vh, 520px);
  margin-top: 12px;
  border-radius: 18px;
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.62),
      rgba(255, 247, 224, 0.55)
    ),
    repeating-linear-gradient(
      45deg,
      rgba(255, 138, 192, 0.1) 0 12px,
      rgba(255, 216, 107, 0.1) 12px 24px
    );
  border: 3px solid rgba(176, 53, 121, 0.22);
  overflow: hidden;
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 18px;
}
.mini-prop {
  position: absolute;
  z-index: 2;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  pointer-events: none;
  filter: drop-shadow(0 10px 12px rgba(107, 34, 71, 0.18));
}
.mini-prop-wish-crystal {
  width: 172px;
  height: 236px;
  background-image: url("data/mini_game_art/prop_wish_crystal.png");
}
.mini-prop-paintbrush {
  width: 148px;
  height: 198px;
  background-image: url("data/mini_game_art/prop_paintbrush.png");
}
.mini-prop-watering-can {
  width: 190px;
  height: 170px;
  background-image: url("data/mini_game_art/prop_watering_can.png");
}
.mini-prop-butterfly-net {
  width: 178px;
  height: 178px;
  background-image: url("data/mini_game_art/prop_butterfly_net.png");
}
.mini-prop-snow-crystal {
  width: 186px;
  height: 188px;
  background-image: url("data/mini_game_art/prop_snow_crystal.png");
}
.mini-prop-kind-crown {
  width: 194px;
  height: 146px;
  background-image: url("data/mini_game_art/prop_kind_crown.png");
}
.mini-game-board::after {
  content: attr(data-world);
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 8;
  max-width: min(280px, calc(100% - 28px));
  padding: 6px 11px;
  border: 2px solid rgba(107, 34, 71, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #6b2247;
  font:
    800 12px/1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  box-shadow: 0 5px 14px rgba(107, 34, 71, 0.12);
  pointer-events: none;
}
.mini-game-board::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 7;
  background:
    radial-gradient(
      circle at 18% 24%,
      rgba(255, 255, 255, 0.72) 0 2px,
      transparent 3px
    ),
    radial-gradient(
      circle at 42% 16%,
      rgba(255, 216, 107, 0.68) 0 2px,
      transparent 3px
    ),
    radial-gradient(
      circle at 76% 30%,
      rgba(255, 255, 255, 0.72) 0 2px,
      transparent 3px
    ),
    radial-gradient(
      circle at 86% 68%,
      rgba(123, 224, 200, 0.62) 0 2px,
      transparent 3px
    ),
    radial-gradient(
      circle at 28% 78%,
      rgba(255, 138, 192, 0.58) 0 2px,
      transparent 3px
    );
  background-size: 100% 100%;
  opacity: 0.74;
  mix-blend-mode: screen;
  pointer-events: none;
  animation: mini-world-twinkle 2.8s ease-in-out infinite alternate;
}
@keyframes mini-world-twinkle {
  from {
    opacity: 0.38;
    transform: translateY(0);
  }
  to {
    opacity: 0.78;
    transform: translateY(-3px);
  }
}
.mini-game-board.complete {
  animation: slot-flash 0.8s ease;
}
.mini-world-complete {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 20;
  min-width: min(360px, calc(100% - 40px));
  padding: 18px 20px;
  display: grid;
  gap: 4px;
  place-items: center;
  border: 4px solid rgba(255, 216, 107, 0.86);
  border-radius: 18px;
  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(255, 255, 255, 0.96),
      rgba(255, 246, 223, 0.94)
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.94),
      rgba(255, 232, 246, 0.94)
    );
  color: #8a2f64;
  text-align: center;
  transform: translate(-50%, -50%);
  box-shadow:
    0 18px 48px rgba(107, 34, 71, 0.28),
    0 0 40px rgba(255, 216, 107, 0.6);
  animation: world-complete-pop 0.42s ease both;
  pointer-events: none;
}
.mini-world-complete strong {
  font-size: clamp(22px, 4vw, 36px);
  line-height: 1;
}
.mini-world-complete span {
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", Arial, sans-serif;
  font-weight: 900;
}
.mini-world-intro {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 30;
  min-width: min(390px, calc(100% - 44px));
  padding: 20px 22px;
  display: grid;
  gap: 5px;
  place-items: center;
  border: 4px solid rgba(255, 216, 107, 0.88);
  border-radius: 20px;
  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(255, 255, 255, 0.98),
      rgba(255, 246, 223, 0.94)
    ),
    rgba(255, 255, 255, 0.94);
  color: #8a2f64;
  text-align: center;
  transform: translate(-50%, -50%);
  box-shadow:
    0 18px 48px rgba(107, 34, 71, 0.26),
    0 0 40px rgba(255, 216, 107, 0.58);
  animation: world-intro-pop 1.02s ease both;
  pointer-events: none;
}
.mini-world-intro strong {
  font-size: clamp(24px, 4.4vw, 42px);
  line-height: 1;
}
.mini-world-intro span {
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", Arial, sans-serif;
  font-weight: 900;
}
@keyframes world-intro-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.72);
  }
  18%,
  76% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.05);
  }
}
@keyframes world-complete-pop {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.72);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}
.mini-choice,
.mini-pad,
.mini-dance {
  min-width: 120px;
  min-height: 72px;
  padding: 12px 18px;
  border: 3px solid rgba(107, 34, 71, 0.28);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff 0%, #ffe5f0 100%);
  color: #6b2247;
  font:
    700 20px "Georgia",
    serif;
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(107, 34, 71, 0.18);
}
.mini-choice:active,
.mini-pad:active,
.mini-dance:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(107, 34, 71, 0.18);
}
.mini-game-board.memory,
.mini-game-board.dance,
.mini-game-board.sprout {
  grid-template-columns: repeat(2, minmax(120px, 1fr));
}
.mini-game-board.sprout {
  display: block;
  min-height: clamp(410px, 58vh, 540px);
  padding: 0;
  background: #dbf7e0;
}
.mini-game-board.sprout .mini-prop-watering-can {
  right: 3%;
  top: 11%;
  transform: rotate(8deg);
  opacity: 0.92;
}
.mini-game-board.chase {
  display: block;
  min-height: clamp(390px, 56vh, 520px);
  background:
    radial-gradient(
      circle at 50% 20%,
      rgba(255, 255, 255, 0.9),
      transparent 16%
    ),
    linear-gradient(180deg, #8edcff 0%, #d9f8ff 52%, #9ef0b2 100%);
}
.mini-chase-sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 18% 22%,
      rgba(255, 255, 255, 0.92) 0 18px,
      transparent 19px
    ),
    radial-gradient(
      circle at 72% 30%,
      rgba(255, 255, 255, 0.86) 0 24px,
      transparent 25px
    ),
    radial-gradient(
      circle at 42% 16%,
      rgba(255, 216, 107, 0.72) 0 14px,
      transparent 15px
    );
  pointer-events: none;
}
.mini-chase-star {
  position: absolute;
  width: 52px;
  height: 52px;
  margin-left: -26px;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fffbe0, #ffd86b 58%, #ffad33);
  color: #fff;
  font-size: 34px;
  line-height: 52px;
  text-shadow: 0 2px 4px rgba(120, 60, 0, 0.28);
  box-shadow:
    0 8px 16px rgba(255, 173, 51, 0.28),
    0 0 22px rgba(255, 216, 107, 0.68);
  cursor: pointer;
  z-index: 2;
}
.mini-chase-star.caught {
  opacity: 0;
  transform: scale(1.8) rotate(28deg);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}
.mini-chase-cart {
  position: absolute;
  left: 50%;
  bottom: 58px;
  width: 92px;
  height: 52px;
  margin-left: -46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px 18px 26px 26px;
  background: linear-gradient(180deg, #ff8ac0 0%, #d84b90 100%);
  border: 4px solid #7a1f4d;
  color: #ffd86b;
  font-size: 34px;
  box-shadow: 0 8px 0 rgba(122, 31, 77, 0.22);
  z-index: 3;
}
.mini-chase-cart::before,
.mini-chase-cart::after {
  content: "";
  position: absolute;
  bottom: -14px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #6b2247;
  border: 4px solid #ffd86b;
}
.mini-chase-cart::before {
  left: 14px;
}
.mini-chase-cart::after {
  right: 14px;
}
.mini-chase-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px;
  display: flex;
  justify-content: center;
  gap: 14px;
  z-index: 4;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.72)
  );
}
.mini-chase-controls button {
  width: 78px;
  height: 44px;
  border: 3px solid rgba(107, 34, 71, 0.35);
  border-radius: 999px;
  background: #fff;
  color: #6b2247;
  font:
    700 26px "Georgia",
    serif;
  cursor: pointer;
}
.mini-game-board.paint-stars,
.mini-game-board.ribbon-dance,
.mini-game-board.sprout,
.mini-game-board.cupcake-map {
  display: block;
  min-height: clamp(430px, 62vh, 590px);
  padding: 0;
  background: #fff7df;
}
.ribbon-dance-world {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  background: #efe5ff;
}
.ribbon-dance-layer {
  position: absolute;
  left: 0;
  top: 0;
  width: 1500px;
  height: 900px;
  background:
    radial-gradient(
      circle at 18% 18%,
      rgba(255, 255, 255, 0.42) 0 100px,
      transparent 104px
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.12),
      rgba(200, 155, 255, 0.16)
    ),
    url("data/mini_game_worlds/ribbon_direction_dance_world.png") center / cover
      no-repeat;
  transition: transform 0.06s linear;
  will-change: transform;
}
.ribbon-dance-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      circle at 12% 80%,
      rgba(255, 255, 255, 0.38),
      transparent 17%
    ),
    radial-gradient(
      circle at 82% 14%,
      rgba(255, 216, 107, 0.24),
      transparent 14%
    );
}
.ribbon-dance-path {
  position: absolute;
  left: 180px;
  top: 190px;
  width: 1160px;
  height: 540px;
  border-radius: 48% 44% 50% 42%;
  background: repeating-linear-gradient(
    115deg,
    rgba(255, 138, 192, 0.2) 0 54px,
    rgba(255, 216, 107, 0.2) 54px 108px,
    rgba(200, 155, 255, 0.22) 108px 162px,
    rgba(123, 224, 200, 0.18) 162px 216px
  );
  border: 6px solid rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 0 42px rgba(122, 42, 96, 0.1);
  transform: rotate(-3deg);
}
.ribbon-dance-card {
  position: absolute;
  left: 180px;
  top: 104px;
  z-index: 5;
  width: 330px;
  padding: 11px 14px;
  border: 3px solid rgba(107, 34, 71, 0.18);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  color: #5b2142;
  box-shadow: 0 12px 22px rgba(107, 34, 71, 0.14);
}
.ribbon-dance-card b,
.ribbon-dance-card span {
  display: block;
}
.ribbon-dance-card b {
  margin-bottom: 4px;
  color: #8a2f64;
  font:
    900 12px "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ribbon-dance-card span {
  font:
    900 17px/1.18 "Georgia",
    serif;
}
.ribbon-dance-avatar {
  position: absolute;
  left: 170px;
  top: 690px;
  z-index: 6;
  width: 72px;
  height: 96px;
  transform: translate(-50%, -78%);
  background: url("data/princess4.png") 0 0 / 400% 400% no-repeat;
  filter: drop-shadow(0 11px 12px rgba(91, 33, 66, 0.22));
  pointer-events: none;
}
.ribbon-dance-avatar.moving {
  animation: ruby-maze-step 0.22s ease-in-out infinite;
  background-position: 66.666% 0;
}
.ribbon-dance-avatar.facing-left {
  scale: -1 1;
}
.ribbon-dance-step {
  position: absolute;
  z-index: 5;
  width: 76px;
  height: 76px;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  border: 4px solid rgba(255, 255, 255, 0.76);
  border-radius: 50%;
  background:
    radial-gradient(
      circle at 34% 24%,
      rgba(255, 255, 255, 0.95),
      transparent 30%
    ),
    conic-gradient(from 20deg, #c89bff, #ff8ac0, #ffd86b, #7be0c8, #c89bff);
  color: #6b2247;
  box-shadow: 0 12px 20px rgba(91, 33, 66, 0.2);
  cursor: pointer;
  animation: unicorn-map-wish 1.25s ease-in-out infinite alternate;
}
.ribbon-dance-step strong {
  font:
    900 32px "Georgia",
    serif;
}
.ribbon-dance-step em {
  position: absolute;
  left: 50%;
  top: 70px;
  min-width: 68px;
  padding: 3px 8px;
  transform: translateX(-50%);
  border: 2px solid rgba(107, 34, 71, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #6b2247;
  font:
    900 13px "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  font-style: normal;
  line-height: 1.05;
}
.ribbon-dance-step.next {
  border-color: rgba(255, 216, 107, 0.95);
  box-shadow:
    0 12px 20px rgba(91, 33, 66, 0.2),
    0 0 0 9px rgba(255, 255, 255, 0.48),
    0 0 28px rgba(255, 216, 107, 0.78);
  animation:
    unicorn-map-wish 1s ease-in-out infinite alternate,
    recipe-target-pulse 0.78s ease-in-out infinite alternate;
}
.ribbon-dance-step.waiting {
  opacity: 0.54;
  filter: saturate(0.78);
}
.ribbon-dance-step.bumped {
  animation: unicorn-wait-nudge 0.22s ease;
}
.ribbon-dance-step.collected {
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.55) rotate(12deg);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}
.ribbon-dance-crown {
  position: absolute;
  z-index: 5;
  width: 84px;
  height: 100px;
  transform: translate(-50%, -50%);
  border: 4px solid rgba(255, 255, 255, 0.74);
  border-radius: 999px 999px 18px 18px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.9),
    rgba(255, 216, 107, 0.84)
  );
  color: #8a2f64;
  font-size: 48px;
  cursor: pointer;
  opacity: 0.62;
  box-shadow: 0 10px 28px rgba(107, 34, 71, 0.18);
}
.ribbon-dance-crown.ready {
  opacity: 1;
  animation: goal-ready 0.7s ease-in-out infinite alternate;
}
.mini-map-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  background: #eafaff;
}
.mini-map-layer {
  position: absolute;
  left: 0;
  top: 0;
  width: 1500px;
  height: 900px;
  transform: translate(0, 0);
  transition: transform 0.06s linear;
  will-change: transform;
}
.library-map-layer {
  background:
    radial-gradient(
      circle at 18% 20%,
      rgba(255, 255, 255, 0.32) 0 90px,
      transparent 94px
    ),
    radial-gradient(
      circle at 72% 18%,
      rgba(255, 216, 107, 0.22) 0 120px,
      transparent 124px
    ),
    url("data/mini_game_worlds/moon_star_library.png") center / cover no-repeat;
}
.greenhouse-map-layer {
  background:
    radial-gradient(
      circle at 18% 18%,
      rgba(255, 255, 255, 0.34) 0 120px,
      transparent 124px
    ),
    linear-gradient(
      180deg,
      rgba(236, 255, 245, 0.15),
      rgba(115, 214, 151, 0.12)
    ),
    url("data/mini_game_worlds/mint_greenhouse_world.png") center / cover
      no-repeat;
}
.cupcake-map-layer {
  background:
    radial-gradient(
      circle at 16% 18%,
      rgba(255, 255, 255, 0.34) 0 118px,
      transparent 122px
    ),
    radial-gradient(
      circle at 82% 14%,
      rgba(255, 216, 107, 0.24) 0 116px,
      transparent 120px
    ),
    url("data/mini_game_worlds/cupcake_kitchen_world.png") center / cover
      no-repeat;
}
.library-map-layer::before,
.greenhouse-map-layer::before,
.cupcake-map-layer::before {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 1;
}
.library-map-layer::before {
  left: 130px;
  top: 135px;
  width: 1260px;
  height: 620px;
  border-radius: 42% 48% 38% 44%;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.08) 0 44px,
      rgba(255, 216, 107, 0.08) 44px 88px,
      rgba(136, 216, 245, 0.08) 88px 132px
    ),
    rgba(34, 38, 92, 0.08);
  border: 5px dashed rgba(255, 255, 255, 0.42);
  box-shadow:
    inset 0 0 45px rgba(56, 56, 145, 0.16),
    0 0 34px rgba(255, 255, 255, 0.2);
}
.greenhouse-map-layer::before {
  left: 110px;
  top: 220px;
  width: 1300px;
  height: 560px;
  border-radius: 46% 42% 44% 40%;
  background:
    repeating-linear-gradient(
      -18deg,
      rgba(35, 124, 66, 0.18) 0 52px,
      rgba(255, 255, 255, 0.12) 52px 82px,
      rgba(255, 216, 107, 0.12) 82px 118px
    ),
    rgba(224, 255, 232, 0.22);
  border: 5px solid rgba(255, 255, 255, 0.52);
  box-shadow:
    inset 0 0 54px rgba(30, 119, 65, 0.16),
    0 0 36px rgba(126, 237, 176, 0.28);
}
.cupcake-map-layer::before {
  left: 120px;
  top: 245px;
  width: 1280px;
  height: 520px;
  border-radius: 36% 44% 34% 42%;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 138, 192, 0.14) 0 58px,
      rgba(255, 216, 107, 0.16) 58px 116px,
      rgba(255, 255, 255, 0.12) 116px 160px
    ),
    rgba(255, 245, 225, 0.2);
  border: 5px solid rgba(255, 255, 255, 0.54);
  box-shadow:
    inset 0 0 54px rgba(214, 94, 134, 0.14),
    0 0 34px rgba(255, 216, 107, 0.28);
}
.mini-map-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(
      circle at 12% 88%,
      rgba(255, 255, 255, 0.35),
      transparent 16%
    ),
    radial-gradient(
      circle at 88% 12%,
      rgba(255, 216, 107, 0.22),
      transparent 14%
    );
}
.map-window {
  position: absolute;
  left: 1080px;
  top: 115px;
  z-index: 2;
  transform: scale(1.25);
}
.map-moon {
  position: absolute;
  left: 1210px;
  top: 70px;
  z-index: 3;
  font-size: 68px;
  color: #fff6a8;
  text-shadow:
    0 0 16px rgba(255, 246, 168, 0.9),
    0 4px 10px rgba(76, 44, 130, 0.24);
}
.map-shelf {
  position: absolute;
  left: 220px;
  top: 185px;
  z-index: 2;
  width: 360px;
  height: 170px;
  transform: rotate(-2deg);
}
.moon-pattern-card {
  position: absolute;
  left: 600px;
  top: 86px;
  z-index: 5;
  width: 420px;
  padding: 10px 13px;
  border: 3px solid rgba(51, 31, 84, 0.18);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.84);
  color: #5b2142;
  box-shadow: 0 12px 22px rgba(51, 31, 84, 0.14);
  pointer-events: none;
}
.moon-pattern-card b {
  display: block;
  margin-bottom: 6px;
  color: #8a2f64;
  font:
    900 12px "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.moon-pattern-card span {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.moon-pattern-card i {
  min-width: 0;
  padding: 5px 6px;
  border: 2px solid rgba(91, 33, 66, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  font:
    900 12px "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  font-style: normal;
  text-align: center;
  text-transform: lowercase;
}
.moon-pattern-card i.pink {
  color: #9f2362;
  background: rgba(255, 158, 199, 0.25);
}
.moon-pattern-card i.gold {
  color: #7a5514;
  background: rgba(255, 216, 107, 0.28);
}
.moon-pattern-card i.blue {
  color: #17688c;
  background: rgba(136, 216, 245, 0.3);
}
.moon-pattern-card i.mint {
  color: #237c42;
  background: rgba(156, 240, 177, 0.28);
}
.moon-pattern-card i.grape {
  color: #6540a7;
  background: rgba(200, 155, 255, 0.28);
}
.moon-pattern-card i.current {
  border-color: rgba(255, 216, 107, 0.92);
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.46),
    0 0 16px rgba(255, 216, 107, 0.68);
}
.greenhouse-map-bed {
  position: absolute;
  left: 170px;
  top: 515px;
  z-index: 2;
  width: 1160px;
  height: 220px;
  border-radius: 999px 999px 38px 38px;
  background:
    radial-gradient(
      circle at 14% 45%,
      rgba(255, 216, 107, 0.28) 0 36px,
      transparent 38px
    ),
    radial-gradient(
      circle at 72% 42%,
      rgba(255, 138, 192, 0.22) 0 42px,
      transparent 44px
    ),
    linear-gradient(180deg, rgba(91, 176, 91, 0.34), rgba(29, 119, 61, 0.46));
  border: 5px solid rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 -22px 0 rgba(35, 124, 66, 0.16);
}
.greenhouse-map-can {
  position: absolute;
  left: 1165px;
  top: 285px;
  z-index: 3;
  transform: scale(1.22) rotate(5deg);
}
.plant-story-card {
  position: absolute;
  left: 510px;
  top: 94px;
  z-index: 5;
  width: 500px;
  padding: 10px 13px;
  border: 3px solid rgba(35, 124, 66, 0.18);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
  color: #1f6e3b;
  box-shadow: 0 12px 22px rgba(20, 96, 43, 0.14);
  pointer-events: none;
}
.plant-story-card b {
  display: block;
  margin-bottom: 6px;
  color: #237c42;
  font:
    900 12px "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.plant-story-card span {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.plant-story-card i {
  min-width: 0;
  padding: 5px 6px;
  border: 2px solid rgba(35, 124, 66, 0.14);
  border-radius: 999px;
  background: rgba(241, 255, 249, 0.88);
  color: #237c42;
  font:
    900 12px "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  font-style: normal;
  text-align: center;
  text-transform: lowercase;
}
.plant-story-card i.current {
  border-color: rgba(255, 216, 107, 0.92);
  background: rgba(255, 250, 225, 0.92);
  color: #7a5514;
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.46),
    0 0 16px rgba(255, 216, 107, 0.68);
}
.plant-story-card i.done {
  border-color: rgba(123, 224, 200, 0.78);
  background: rgba(220, 255, 241, 0.9);
  color: #237c42;
}
.plant-story-card i.done::before {
  content: "✓ ";
}
.cupcake-map-counter {
  position: absolute;
  left: 150px;
  top: 595px;
  z-index: 2;
  width: 1210px;
  height: 150px;
  border-radius: 34px;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.68),
      rgba(255, 230, 195, 0.72)
    ),
    repeating-linear-gradient(
      90deg,
      rgba(176, 53, 121, 0.12) 0 80px,
      rgba(255, 216, 107, 0.18) 80px 160px
    );
  border: 5px solid rgba(255, 255, 255, 0.64);
  box-shadow: 0 18px 28px rgba(107, 34, 71, 0.16);
}
.cupcake-map-oven {
  position: absolute;
  left: 1120px;
  top: 245px;
  z-index: 3;
  width: 160px;
  height: 145px;
  border: 6px solid rgba(107, 34, 71, 0.42);
  border-radius: 26px;
  background: linear-gradient(180deg, #fff5cf, #ffb86c);
  box-shadow:
    inset 0 -18px 0 rgba(176, 53, 121, 0.16),
    0 0 24px rgba(255, 216, 107, 0.48);
  cursor: pointer;
  transition:
    filter 0.18s ease,
    transform 0.18s ease;
}
.cupcake-map-oven.ready {
  filter: drop-shadow(0 0 16px rgba(255, 255, 255, 0.9))
    drop-shadow(0 0 22px rgba(255, 216, 107, 0.82));
  animation: cupcake-oven-ready 0.72s ease-in-out infinite alternate;
}
.cupcake-map-oven.baking {
  animation: cupcake-oven-bake 0.42s ease-in-out 2;
}
.cupcake-map-oven span {
  position: absolute;
  bottom: 22px;
  width: 26px;
  height: 38px;
  border-radius: 999px 999px 18px 18px;
  background: #fff6a8;
  box-shadow: 0 0 16px rgba(255, 216, 107, 0.9);
}
.cupcake-map-oven span:nth-child(1) {
  left: 36px;
}
.cupcake-map-oven span:nth-child(2) {
  left: 68px;
  height: 52px;
}
.cupcake-map-oven span:nth-child(3) {
  left: 100px;
}
.cupcake-map-pantry {
  position: absolute;
  left: 220px;
  top: 185px;
  z-index: 3;
  width: 330px;
  height: 155px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 18% 45%, #ff8ac0 0 22px, transparent 24px),
    radial-gradient(circle at 45% 36%, #ffd86b 0 20px, transparent 22px),
    radial-gradient(circle at 72% 46%, #7be0c8 0 22px, transparent 24px),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.78),
      rgba(255, 230, 245, 0.62)
    );
  border: 5px solid rgba(255, 255, 255, 0.64);
  box-shadow: 0 14px 24px rgba(107, 34, 71, 0.16);
  display: none;
}
.cupcake-map-recipe-board {
  position: absolute;
  left: 50%;
  top: clamp(76px, 10vh, 92px);
  z-index: 9;
  width: min(400px, calc(100% - 148px));
  aspect-ratio: 3 / 2;
  transform: translateX(-50%);
  background: url("data/mini_game_art/cupcake_recipe_board_generated.png")
    center / contain no-repeat;
  filter: drop-shadow(0 18px 20px rgba(107, 34, 71, 0.18)) saturate(1.05);
  pointer-events: none;
}
.cupcake-map-recipe-board.show-placement {
  animation: recipe-board-placed-glow 0.78s ease both;
}
.recipe-board-confirmation {
  position: absolute;
  left: 50%;
  top: 44%;
  z-index: 6;
  min-width: 176px;
  padding: 10px 15px 11px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "icon word"
    "icon step";
  column-gap: 11px;
  align-items: center;
  border: 4px solid rgba(255, 216, 107, 0.9);
  border-radius: 24px;
  background:
    radial-gradient(
      circle at 24% 22%,
      rgba(255, 255, 255, 0.96),
      transparent 30%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.96),
      rgba(255, 243, 190, 0.94)
    );
  box-shadow:
    0 12px 20px rgba(107, 34, 71, 0.2),
    0 0 0 8px rgba(255, 255, 255, 0.38),
    0 0 26px rgba(255, 216, 107, 0.72);
  color: #8a2f64;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.72);
}
.cupcake-map-recipe-board.show-placement .recipe-board-confirmation {
  animation: recipe-placement-pop 0.78s ease both;
}
.recipe-board-confirmation span {
  grid-area: icon;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #fff;
  font-size: 34px;
  box-shadow: inset 0 0 0 3px rgba(255, 216, 107, 0.36);
}
.recipe-board-confirmation strong {
  grid-area: word;
  font:
    900 19px "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
}
.recipe-board-confirmation small {
  grid-area: step;
  font:
    900 12px "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #b03579;
}
.recipe-board-status {
  position: absolute;
  left: 50%;
  top: 72px;
  transform: translateX(-50%);
  min-width: 124px;
  padding: 5px 14px;
  border: 3px solid rgba(255, 216, 107, 0.78);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #8a2f64;
  font:
    900 17px "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  text-align: center;
  box-shadow: 0 7px 14px rgba(107, 34, 71, 0.14);
}
.recipe-board-slots {
  position: absolute;
  left: 42px;
  right: 42px;
  bottom: 40px;
  height: 91px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 37px;
  align-items: center;
}
.recipe-board-slots b {
  position: relative;
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  justify-self: center;
  border: 4px solid rgba(255, 216, 107, 0.62);
  border-radius: 24px;
  background:
    radial-gradient(
      circle at 34% 24%,
      rgba(255, 255, 255, 0.96),
      transparent 28%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.88),
      rgba(255, 242, 188, 0.86)
    );
  color: #7a2a60;
  font-size: 44px;
  font-style: normal;
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.46),
    0 9px 16px rgba(107, 34, 71, 0.14);
}
.recipe-board-slots b::after {
  content: attr(data-step);
  position: absolute;
  right: -10px;
  top: -10px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 3px solid rgba(107, 34, 71, 0.28);
  border-radius: 50%;
  background: #fff;
  color: #8a2f64;
  font:
    900 14px "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  box-shadow: 0 5px 10px rgba(107, 34, 71, 0.16);
}
.recipe-board-slots b.current {
  border-color: rgba(255, 138, 192, 0.95);
  box-shadow:
    0 0 0 8px rgba(255, 255, 255, 0.46),
    0 0 28px rgba(255, 216, 107, 0.86);
  animation: recipe-target-pulse 0.78s ease-in-out infinite alternate;
}
.recipe-board-slots b.done {
  border-color: rgba(123, 224, 200, 0.95);
  background:
    radial-gradient(
      circle at 34% 24%,
      rgba(255, 255, 255, 0.98),
      transparent 30%
    ),
    linear-gradient(180deg, #eafff7, #7be0c8);
  transform: scale(0.92);
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.56),
    0 0 0 7px rgba(123, 224, 200, 0.24),
    0 12px 18px rgba(35, 124, 66, 0.16);
}
.recipe-board-slots b.done::before {
  content: "✓";
  position: absolute;
  left: -9px;
  top: -9px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #7be0c8;
  color: #fff;
  font:
    900 15px "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  box-shadow: 0 5px 10px rgba(35, 124, 66, 0.18);
}
.recipe-board-slots b.done::after {
  content: "on board";
  right: 50%;
  top: auto;
  bottom: -16px;
  width: auto;
  min-width: 62px;
  height: 22px;
  padding: 0 8px;
  transform: translateX(50%);
  border-color: rgba(35, 124, 66, 0.2);
  border-radius: 999px;
  background: #f1fff9;
  color: #237c42;
  font-size: 10px;
  text-transform: uppercase;
}
.paint-map-avatar,
.mini-water-princess.map-avatar,
.cupcake-map-avatar {
  position: absolute;
  z-index: 6;
  pointer-events: none;
  transform: translate(-50%, -50%);
}
.paint-map-avatar {
  width: 72px;
  height: 72px;
  filter: drop-shadow(0 10px 14px rgba(51, 31, 84, 0.22));
}
.mini-paint-range,
.mini-water-range {
  position: absolute;
  z-index: 4;
  width: 184px;
  height: 184px;
  margin-left: -92px;
  margin-top: -92px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.28;
  transform: scale(0.78);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}
.mini-paint-range {
  border: 4px dashed rgba(255, 216, 107, 0.62);
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.16),
    rgba(136, 216, 245, 0.08) 58%,
    transparent 60%
  );
}
.mini-water-range {
  border: 4px dashed rgba(90, 211, 134, 0.66);
  background: radial-gradient(
    circle,
    rgba(210, 255, 232, 0.18),
    rgba(123, 224, 200, 0.08) 58%,
    transparent 60%
  );
}
.mini-paint-range.active,
.mini-water-range.active {
  opacity: 0.72;
  transform: scale(1);
}
.mini-water-princess.map-avatar {
  --mint-scale-x: 1;
  width: 150px;
  height: 150px;
  z-index: 7;
  background-image: url("data/mint_bloom/princess_watering_4x3_alpha.png?v=1");
  background-repeat: no-repeat;
  background-size: 400% 300%;
  background-position: 0 0;
  filter: drop-shadow(0 14px 14px rgba(20, 96, 43, 0.22))
    drop-shadow(0 0 12px rgba(187, 255, 224, 0.38));
  transform: translate(-50%, -66%) scaleX(var(--mint-scale-x));
  transform-origin: 50% 88%;
  image-rendering: auto;
}
.mini-water-princess.map-avatar.facing-left {
  --mint-scale-x: -1;
}
.mini-water-princess.map-avatar.facing-up {
  filter: drop-shadow(0 14px 14px rgba(20, 96, 43, 0.22))
    drop-shadow(0 0 12px rgba(187, 255, 224, 0.38)) brightness(1.03);
}
.mini-water-princess.map-avatar.facing-down {
  translate: 0 2px;
}
.mini-water-princess.map-avatar.moving {
  filter: drop-shadow(0 16px 14px rgba(20, 96, 43, 0.24))
    drop-shadow(0 0 14px rgba(187, 255, 224, 0.5));
}
.mini-water-princess.map-avatar.watering {
  animation: mint-princess-water 0.36s ease-in-out;
  filter: drop-shadow(0 14px 14px rgba(20, 96, 43, 0.22))
    drop-shadow(0 0 18px rgba(187, 255, 224, 0.92))
    drop-shadow(0 0 20px rgba(255, 216, 107, 0.42));
}
.mini-water-princess.map-avatar.celebrating {
  background-position: 100% 50%;
}
.cupcake-map-avatar {
  left: 165px;
  top: 650px;
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border: 4px solid rgba(107, 34, 71, 0.35);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 24%, #fff, #ffe2f0 42%, #ff8ac0);
  box-shadow:
    0 12px 18px rgba(107, 34, 71, 0.22),
    0 0 18px rgba(255, 216, 107, 0.52);
  font-size: 38px;
}
.cupcake-map-avatar.scooping {
  transform: translate(-50%, -58%) scale(1.08);
  filter: drop-shadow(0 0 14px rgba(255, 216, 107, 0.95));
}
.mini-water-princess.map-avatar.watering {
  transform: translate(-50%, -68%) scaleX(var(--mint-scale-x)) scale(1.06);
}
.mini-water-spray {
  position: absolute;
  z-index: 6;
  width: 150px;
  height: 94px;
  margin-left: 22px;
  margin-top: -94px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-14deg) scale(0.7);
  transform-origin: 12% 82%;
}
.mini-water-spray::before,
.mini-water-spray::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(
      circle at 78% 24%,
      rgba(255, 255, 255, 0.95) 0 5px,
      transparent 6px
    ),
    radial-gradient(
      circle at 64% 42%,
      rgba(141, 235, 255, 0.88) 0 5px,
      transparent 6px
    ),
    radial-gradient(
      circle at 84% 62%,
      rgba(187, 255, 224, 0.9) 0 4px,
      transparent 5px
    ),
    radial-gradient(
      circle at 54% 70%,
      rgba(255, 255, 255, 0.86) 0 3px,
      transparent 4px
    );
  border-top: 8px dotted rgba(141, 235, 255, 0.78);
  filter: drop-shadow(0 0 10px rgba(187, 255, 224, 0.74));
}
.mini-water-spray::after {
  inset: 16px 8px 0 20px;
  opacity: 0.72;
  transform: rotate(12deg);
}
.mini-water-spray.active {
  opacity: 1;
  animation: mint-water-spray 0.28s ease-out both;
}
@keyframes mint-princess-water {
  0% {
    background-position: 66.667% 50%;
    rotate: -2deg;
  }
  50% {
    background-position: 66.667% 50%;
    rotate: 3deg;
  }
  100% {
    background-position: 66.667% 50%;
    rotate: 0deg;
  }
}
@keyframes mint-water-spray {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-18deg) scale(0.48);
  }
  35% {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-8deg) scale(1.12);
  }
}
.library-map-layer .mini-paint-star,
.greenhouse-map-layer .mini-pop-sprout,
.cupcake-map-layer .cupcake-map-pickup {
  z-index: 5;
}
.library-map-layer .mini-paint-star {
  width: 66px;
  height: 66px;
  margin-left: -33px;
  margin-top: -33px;
  font-size: 36px;
}
.greenhouse-map-layer .mini-pop-sprout {
  width: 70px;
  height: 70px;
  margin-left: -35px;
  margin-top: -35px;
}
.greenhouse-map-layer .mini-pop-sprout span {
  display: block;
  line-height: 1;
}
.greenhouse-map-layer .mini-pop-sprout.growing {
  width: 118px;
  height: 118px;
  margin-left: -59px;
  margin-top: -94px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  opacity: 1;
  transform: none;
  transition: none;
  z-index: 7;
}
.greenhouse-map-layer .mini-pop-sprout.growing::after,
.greenhouse-map-layer .mini-pop-sprout.growing::before {
  display: none;
}
.greenhouse-map-layer .mini-pop-sprout.growing span {
  width: 118px;
  height: 118px;
  color: transparent;
  background: url("data/mint_bloom/flower_growth_structured_alpha.png?v=1") 0
    0 / 400% 200% no-repeat;
  filter: drop-shadow(0 12px 14px rgba(20, 96, 43, 0.18))
    drop-shadow(0 0 16px rgba(187, 255, 224, 0.7));
  animation: mint-flower-grow 1.05s steps(1, end) both;
}
.greenhouse-map-layer .mini-pop-sprout.growing.grown span {
  animation: none;
  background-position: 100% 100%;
}
.greenhouse-map-layer .mini-pop-sprout.growing em {
  top: -14px;
  bottom: auto;
  border-color: rgba(35, 124, 66, 0.36);
  background: rgba(255, 255, 255, 0.94);
  box-shadow:
    0 8px 14px rgba(20, 96, 43, 0.14),
    0 0 12px rgba(187, 255, 224, 0.48);
  z-index: 2;
}
.greenhouse-map-layer .mini-pop-sprout em {
  position: absolute;
  left: 50%;
  bottom: -22px;
  min-width: 70px;
  padding: 3px 8px;
  transform: translateX(-50%);
  border: 2px solid rgba(35, 124, 66, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #237c42;
  font:
    900 12px "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  font-style: normal;
  line-height: 1.05;
  text-transform: lowercase;
  box-shadow: 0 7px 14px rgba(20, 96, 43, 0.14);
}
.greenhouse-map-layer .mini-pop-sprout.not-next {
  opacity: 0.54;
  filter: saturate(0.8);
}
.greenhouse-map-layer .mini-pop-sprout.next-word {
  opacity: 1;
  border-color: rgba(255, 216, 107, 0.96);
  box-shadow:
    0 12px 18px rgba(20, 96, 43, 0.22),
    0 0 0 9px rgba(255, 255, 255, 0.52),
    0 0 26px rgba(255, 216, 107, 0.82);
  animation:
    sprout-pop 0.24s ease both,
    recipe-target-pulse 0.82s ease-in-out infinite alternate;
}
.greenhouse-map-layer .mini-pop-sprout.next-word em {
  border-color: rgba(255, 216, 107, 0.7);
  color: #7a5514;
  box-shadow:
    0 7px 14px rgba(20, 96, 43, 0.14),
    0 0 16px rgba(255, 216, 107, 0.58);
}
.cupcake-map-layer .cupcake-map-pickup {
  width: 66px;
  height: 66px;
  margin-left: -33px;
  margin-top: -33px;
  border: 4px solid rgba(107, 34, 71, 0.32);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 24%, #fff, #fff1cf 42%, #ffd86b);
  box-shadow:
    0 12px 18px rgba(107, 34, 71, 0.2),
    0 0 16px rgba(255, 216, 107, 0.5);
  animation: topping-float 1.8s ease-in-out infinite alternate;
}
.cupcake-map-layer .cupcake-map-pickup.not-next {
  opacity: 0.48;
  filter: grayscale(0.28) saturate(0.82);
}
.cupcake-map-layer .cupcake-map-pickup.recipe-target {
  opacity: 1;
  filter: none;
  transform: scale(1.08);
  border-color: rgba(255, 216, 107, 0.92);
  box-shadow:
    0 12px 18px rgba(107, 34, 71, 0.2),
    0 0 22px rgba(255, 216, 107, 0.86),
    0 0 0 8px rgba(255, 255, 255, 0.56),
    0 0 0 15px rgba(255, 216, 107, 0.22);
  animation:
    topping-float 1.8s ease-in-out infinite alternate,
    recipe-target-pulse 0.78s ease-in-out infinite alternate;
}
.cupcake-map-layer .cupcake-map-pickup.recipe-target::after {
  content: attr(data-step);
  position: absolute;
  right: -8px;
  top: -10px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 3px solid rgba(107, 34, 71, 0.32);
  border-radius: 50%;
  background: #fff;
  color: #8a2f64;
  font:
    900 15px "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  box-shadow: 0 6px 12px rgba(107, 34, 71, 0.18);
}
.library-map-layer .mini-paint-star.nearby,
.greenhouse-map-layer .mini-pop-sprout.nearby {
  outline: 5px solid rgba(255, 255, 255, 0.72);
  box-shadow:
    0 12px 18px rgba(107, 34, 71, 0.18),
    0 0 0 9px rgba(255, 216, 107, 0.28),
    0 0 24px rgba(255, 216, 107, 0.72);
  animation:
    topping-float 1.2s ease-in-out infinite alternate,
    recipe-target-pulse 0.72s ease-in-out infinite alternate;
}
.library-map-layer .mini-paint-star.pattern-waiting {
  opacity: 0.52;
  filter: grayscale(0.18) saturate(0.84);
}
.library-map-layer .mini-paint-star.pattern-next {
  opacity: 1;
  border-color: rgba(255, 216, 107, 0.9);
  box-shadow:
    0 12px 18px rgba(107, 34, 71, 0.2),
    0 0 0 9px rgba(255, 255, 255, 0.58),
    0 0 24px rgba(255, 216, 107, 0.82);
  animation:
    topping-float 1.2s ease-in-out infinite alternate,
    recipe-target-pulse 0.72s ease-in-out infinite alternate;
}
.library-map-layer .mini-paint-star::before {
  content: attr(data-color);
  position: absolute;
  left: 50%;
  bottom: -21px;
  min-width: 58px;
  padding: 2px 7px;
  transform: translateX(-50%);
  border: 2px solid rgba(91, 33, 66, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #5b2142;
  font:
    900 11px "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  line-height: 1.05;
  text-transform: lowercase;
  box-shadow: 0 6px 12px rgba(51, 31, 84, 0.12);
}
.library-map-layer .mini-paint-star.painted::before {
  opacity: 0;
}
.cupcake-map-layer .cupcake-map-pickup.caught {
  pointer-events: none;
  animation: cupcake-pickup 0.26s ease both;
}
.mini-paint-hint,
.mini-splash-hint,
.mini-cupcake-hint {
  left: 14px;
  right: 14px;
  bottom: 82px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 18px rgba(107, 34, 71, 0.14);
}
@keyframes topping-float {
  from {
    transform: translateY(-5px) rotate(-3deg);
  }
  to {
    transform: translateY(6px) rotate(4deg);
  }
}
@keyframes recipe-target-pulse {
  from {
    scale: 1;
  }
  to {
    scale: 1.14;
  }
}
@keyframes recipe-board-placed-glow {
  35% {
    filter: drop-shadow(0 20px 22px rgba(107, 34, 71, 0.2))
      drop-shadow(0 0 24px rgba(255, 216, 107, 0.78)) saturate(1.12);
  }
}
@keyframes recipe-placement-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -42%) scale(0.68);
  }
  22%,
  68% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -58%) scale(0.9);
  }
}
@keyframes cupcake-oven-ready {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-5px);
  }
}
@keyframes cupcake-oven-bake {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08) rotate(2deg);
  }
}
@keyframes cupcake-pickup {
  to {
    opacity: 0;
    transform: translateY(-18px) scale(1.35);
  }
}
.mini-map-controls {
  gap: 10px;
  padding: 10px 12px 12px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.88)
  );
}
.mini-map-controls button {
  min-width: 58px;
  width: auto;
  padding: 0 14px;
}
.mini-game-board.royal-run {
  display: block;
  min-height: clamp(410px, 58vh, 540px);
  padding: 0;
  background: linear-gradient(180deg, #78d8ff 0%, #c6f7ff 46%, #b8f5a8 100%);
}
.mini-game-board.tower-climb {
  display: block;
  min-height: clamp(430px, 62vh, 560px);
  padding: 0;
  overflow: hidden;
  background: #7cc8f5;
}
.tower-climb-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #163b87, #8fd8ff 48%, #bde7a4);
}
.tower-climb-map {
  position: absolute;
  left: 50%;
  top: 0;
  width: min(100vw, 760px);
  height: 1960px;
  transform: translate(-50%, 0);
  transform-origin: 50% 0;
  transition: transform 0.12s linear;
  background:
    linear-gradient(180deg, rgba(6, 24, 68, 0.04), rgba(255, 255, 255, 0.08)),
    url("data/prince_rescue/tower_heist_map.png") center top / cover no-repeat;
}
.tower-climb-intro {
  position: absolute;
  z-index: 30;
  left: 50%;
  top: 1380px;
  width: min(390px, calc(100vw - 28px));
  min-height: 188px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 8px;
  padding: 18px 18px 16px;
  border: 4px solid rgba(255, 216, 107, 0.92);
  border-radius: 18px;
  background: rgba(255, 250, 228, 0.94);
  box-shadow: 0 18px 40px rgba(54, 32, 69, 0.28);
  translate: -50% 0;
  cursor: pointer;
  transition:
    opacity 0.25s ease,
    scale 0.25s ease;
}
.mini-game-board.tower-climb:not(.kidnap-complete) .tower-climb-intro {
  opacity: 0;
  pointer-events: none;
  scale: 0.96;
}
.tower-climb-intro.hide {
  opacity: 0;
  pointer-events: none;
  scale: 0.92;
}
.tower-climb-intro strong,
.tower-climb-intro span {
  grid-column: 1 / -1;
  display: block;
  text-align: center;
}
.tower-climb-intro strong {
  color: #9b2d6a;
  font:
    900 28px/1 "Georgia",
    serif;
}
.tower-climb-intro span {
  color: #5b2142;
  font:
    800 15px/1.2 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
}
.tower-intro-ape,
.tower-intro-princess,
.tower-kidnap-ape,
.tower-kidnap-princess,
.tower-prince-vine,
.tower-climb-prince,
.tower-climb-princess,
.tower-climb-ape {
  position: absolute;
  z-index: 12;
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: contain;
  filter: drop-shadow(0 9px 10px rgba(39, 29, 58, 0.28));
  pointer-events: none;
}
.tower-prince-vine {
  z-index: 10;
  width: 38px;
  margin-left: -19px;
  transform-origin: 50% 0;
  opacity: 0;
  transition:
    opacity 0.18s ease,
    height 0.08s linear,
    left 0.08s linear,
    top 0.08s linear;
}
.tower-prince-vine.active {
  opacity: 0.96;
}
.tower-prince-vine::before,
.tower-prince-vine::after,
.tower-prince-vine span {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 7px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(72, 78, 33, 0.52), transparent 55%),
    repeating-linear-gradient(
      180deg,
      #517532 0 12px,
      #6aa33c 12px 22px,
      #3f642a 22px 32px
    );
  box-shadow:
    0 0 0 2px rgba(255, 243, 176, 0.18),
    0 7px 10px rgba(37, 41, 22, 0.25);
}
.tower-prince-vine::before {
  left: 10px;
}
.tower-prince-vine::after {
  left: 22px;
  opacity: 0.78;
}
.tower-prince-vine span {
  left: 16px;
  width: 5px;
  opacity: 0.7;
  rotate: 5deg;
}
.tower-prince-vine span::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -15px;
  width: 44px;
  height: 21px;
  border: 6px solid rgba(70, 104, 45, 0.98);
  border-top: 0;
  border-radius: 0 0 24px 24px;
  translate: -50% 0;
  opacity: 0.98;
  box-shadow:
    inset 0 -3px 0 rgba(255, 238, 150, 0.22),
    0 5px 8px rgba(35, 41, 24, 0.24);
}
.tower-prince-vine.active::before {
  animation: tower-vine-twist 0.6s ease-in-out infinite alternate;
}
.tower-prince-vine.active::after {
  animation: tower-vine-twist 0.6s ease-in-out infinite alternate-reverse;
}
@keyframes tower-vine-twist {
  to {
    translate: 2px 0;
  }
}
.tower-swing-trail {
  position: absolute;
  z-index: 8;
  width: 230px;
  height: 128px;
  margin-left: -115px;
  margin-top: -64px;
  border-bottom: 8px solid rgba(255, 225, 94, 0.74);
  border-radius: 50%;
  translate: 0 0;
  filter: drop-shadow(0 0 10px rgba(255, 232, 115, 0.7))
    drop-shadow(0 8px 12px rgba(61, 42, 73, 0.18));
  opacity: 0;
  pointer-events: none;
  transition:
    left 0.08s linear,
    top 0.08s linear,
    opacity 0.08s linear,
    scale 0.08s linear,
    rotate 0.08s linear;
}
.tower-swing-trail::before,
.tower-swing-trail::after {
  content: "";
  position: absolute;
  bottom: -12px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 246, 176, 0.84);
  box-shadow: 0 0 14px rgba(255, 236, 123, 0.74);
}
.tower-swing-trail::before {
  left: 22px;
}
.tower-swing-trail::after {
  right: 22px;
}
.tower-swing-trail.boost {
  border-bottom-color: rgba(119, 236, 147, 0.78);
  filter: drop-shadow(0 0 12px rgba(119, 236, 147, 0.82))
    drop-shadow(0 10px 14px rgba(61, 42, 73, 0.2));
}
.tower-kidnap-trail {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 260px;
  width: 116px;
  height: 1320px;
  border-left: 7px dotted rgba(255, 216, 107, 0.56);
  border-radius: 50%;
  translate: -2px 0;
  filter: drop-shadow(0 0 10px rgba(255, 237, 143, 0.48));
  opacity: 0.9;
}
.tower-kidnap-bundle {
  position: absolute;
  z-index: 28;
  width: 164px;
  height: 148px;
  margin-left: -82px;
  margin-top: -122px;
  pointer-events: none;
  filter: drop-shadow(0 14px 14px rgba(39, 29, 58, 0.32));
  animation: tower-kidnap-bob 0.52s ease-in-out infinite alternate;
}
.tower-kidnap-bundle.done {
  opacity: 0;
  scale: 0.82;
  transition:
    opacity 0.22s ease,
    scale 0.22s ease;
}
.tower-kidnap-ape {
  left: -2px;
  bottom: -6px;
  width: 176px;
  height: 176px;
  background-image: url("data/prince_rescue/ape_action_sheet_v2.png");
  background-size: 400% 300%;
  background-position: 0 0;
  animation: tower-ape-alert 0.34s ease-in-out infinite alternate;
}
.tower-kidnap-princess {
  left: 10px;
  bottom: 2px;
  width: 118px;
  height: 118px;
  background-image: url("data/prince_rescue/princess_rescue_sheet_v2.png");
  background-size: 400% 300%;
  background-position: 0 0;
  opacity: 1;
  rotate: -7deg;
  animation: tower-princess-worry 0.46s ease-in-out infinite alternate;
}
.mini-game-board.tower-climb:not(.kidnap-complete) .tower-climb-princess,
.mini-game-board.tower-climb:not(.kidnap-complete) .tower-climb-ape {
  opacity: 0;
}
.mini-game-board.tower-climb.kidnap-complete .tower-kidnap-trail {
  opacity: 0;
  transition: opacity 0.28s ease;
}
@keyframes tower-kidnap-bob {
  to {
    translate: 0 -9px;
    rotate: 2deg;
  }
}
.tower-intro-ape {
  position: relative;
  width: 144px;
  height: 144px;
  justify-self: end;
  background-image: url("data/prince_rescue/ape_action_sheet_v2.png");
  background-size: 400% 300%;
  background-position: 0 0;
}
.tower-intro-princess {
  position: relative;
  width: 118px;
  height: 118px;
  justify-self: start;
  background-image: url("data/prince_rescue/princess_rescue_sheet_v2.png");
  background-size: 400% 300%;
  background-position: 0 0;
  animation: tower-princess-worry 0.6s ease-in-out infinite alternate;
}
@keyframes tower-princess-worry {
  to {
    translate: 0 -5px;
  }
}
.tower-climb-prince {
  width: 224px;
  height: 224px;
  margin-left: -112px;
  margin-top: -188px;
  background-image: url("data/prince_rescue/prince_vine_swing_sheet_v2.png");
  background-size: 400% 300%;
  background-position: 0 0;
  transform-origin: 50% 8%;
  filter: drop-shadow(0 9px 10px rgba(39, 29, 58, 0.28))
    drop-shadow(0 0 8px rgba(255, 238, 157, 0.24));
  transition:
    left 0.08s linear,
    top 0.08s linear,
    rotate 0.08s linear;
}
.tower-climb-prince.swinging {
  animation: prince-dangle 0.5s ease-in-out infinite alternate;
}
.tower-climb-prince.hit {
  animation: prince-hit 0.42s ease;
}
.tower-climb-prince.rescued {
  z-index: 16;
  scale: 1.08;
  transition:
    left 0.22s ease,
    top 0.22s ease,
    scale 0.22s ease;
}
@keyframes prince-hit {
  30% {
    translate: -10px 0;
    rotate: -8deg;
  }
  62% {
    translate: 10px 0;
    rotate: 8deg;
  }
}
@keyframes prince-dangle {
  to {
    translate: 0 5px;
  }
}
.tower-climb-princess {
  width: 128px;
  height: 128px;
  margin-left: -64px;
  margin-top: -104px;
  background-image: url("data/prince_rescue/princess_rescue_sheet_v2.png");
  background-size: 400% 300%;
  background-position: 0 0;
  transition: background-position 0.08s steps(1);
}
.tower-climb-ape {
  width: 152px;
  height: 152px;
  margin-left: -76px;
  margin-top: -118px;
  background-image: url("data/prince_rescue/ape_action_sheet_v2.png");
  background-size: 400% 300%;
  background-position: 0 0;
  z-index: 11;
  animation: tower-ape-alert 0.42s ease-in-out infinite alternate;
}
.tower-climb-ape.defeated {
  opacity: 0;
  translate: 0 80px;
  transition:
    opacity 0.24s ease,
    translate 0.24s ease;
}
.tower-climb-goal {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 196px;
  width: 152px;
  height: 118px;
  border: 4px solid rgba(255, 216, 107, 0.9);
  border-radius: 24px;
  background: radial-gradient(
    circle,
    rgba(255, 248, 190, 0.5),
    transparent 70%
  );
  box-shadow: 0 0 36px rgba(255, 216, 107, 0.8);
  translate: -50% 0;
}
.tower-climb-key {
  position: absolute;
  z-index: 9;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin: -27px 0 0 -27px;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, #fff, transparent 24%),
    linear-gradient(180deg, #fff3a4, #ffbd39);
  color: #8a3d62;
  font-size: 24px;
  box-shadow:
    0 7px 0 rgba(69, 44, 72, 0.18),
    0 0 20px rgba(255, 216, 107, 0.78);
  animation: tower-anchor-ready 0.82s ease-in-out infinite alternate;
}
.tower-climb-key.got {
  opacity: 0.22;
  scale: 0.72;
  transition:
    opacity 0.18s ease,
    scale 0.18s ease;
}
.tower-banana-layer {
  position: absolute;
  inset: 0;
  z-index: 13;
  pointer-events: none;
}
.tower-banana {
  position: absolute;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin: -21px 0 0 -21px;
  border-radius: 50%;
  background: rgba(255, 247, 184, 0.82);
  color: #744421;
  font-size: 30px;
  line-height: 1;
  rotate: -18deg;
  box-shadow:
    0 5px 0 rgba(69, 44, 72, 0.14),
    0 0 16px rgba(255, 216, 107, 0.58);
}
.tower-banana.hit {
  opacity: 0;
  scale: 1.7;
  transition:
    opacity 0.2s ease,
    scale 0.2s ease;
}
.tower-climb-controls {
  position: absolute;
  z-index: 24;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 58px);
  justify-content: center;
  gap: 10px;
  padding: 12px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.8)
  );
  pointer-events: none;
}
.tower-climb-controls button {
  width: 58px;
  height: 50px;
  border: 3px solid rgba(107, 34, 71, 0.32);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  color: #6b2247;
  font:
    900 22px/1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  box-shadow: 0 5px 0 rgba(107, 34, 71, 0.15);
  cursor: pointer;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
}
.tower-climb-controls button:active {
  transform: translateY(2px);
  box-shadow: 0 3px 0 rgba(107, 34, 71, 0.15);
}
.mini-game-board.royal-run.theme-prince-rescue {
  background: linear-gradient(180deg, #88d8f5 0%, #c9f0da 50%, #f6d486 100%);
}
.mini-game-board.royal-run.theme-prince-rescue .royal-run-bg {
  background:
    radial-gradient(
      circle at 124px 58px,
      rgba(255, 255, 255, 0.92) 0 26px,
      transparent 27px
    ),
    radial-gradient(
      circle at 690px 48px,
      rgba(255, 245, 176, 0.92) 0 34px,
      transparent 35px
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 54%),
    linear-gradient(180deg, #77c8ff 0%, #b7e8c6 62%, #f2c772 100%);
}
.mini-game-board.royal-run.theme-prince-rescue .royal-run-bg::before {
  left: 48px;
  bottom: 68px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.26), transparent 40%), #6abf6f;
  box-shadow:
    28px -34px 0 -18px #ffd86b,
    60px -10px 0 -34px #2b8c5a,
    98px -42px 0 -22px #ff8b56;
}
.mini-game-board.royal-run.theme-prince-rescue .royal-run-bg::after {
  left: 1040px;
  bottom: 62px;
  width: 150px;
  height: 190px;
  border-radius: 28px 28px 8px 8px;
  background:
    linear-gradient(
      90deg,
      transparent 0 36%,
      rgba(255, 255, 255, 0.3) 37% 43%,
      transparent 44%
    ),
    linear-gradient(180deg, #cfd0da 0%, #8b8fa6 100%);
  box-shadow:
    0 -42px 0 -16px #6d6f85,
    52px -8px 0 -28px #a5a8bc,
    -48px 8px 0 -28px #a5a8bc;
}
.mini-game-board.royal-run.theme-prince-rescue .royal-run-ground {
  background:
    radial-gradient(circle at 22px 10px, #ffe68a 0 8px, transparent 9px) 0 0 /
      76px 28px,
    linear-gradient(180deg, #69cf71 0%, #43a957 58%, #297941 100%);
  border-top-color: #f7d56b;
}
.mini-game-board.royal-run.theme-prince-rescue .royal-run-platform {
  background: linear-gradient(180deg, #fff6df 0%, #d9d1bd 48%, #9a8f80 100%);
  border-color: rgba(68, 60, 78, 0.28);
}
.mini-game-board.royal-run.theme-prince-rescue .royal-route-prop {
  display: block;
  right: 4px;
  bottom: 92px;
  width: 220px;
  height: 220px;
  background-image: url("data/prince_rescue/princess_runtime.png");
  background-size: contain;
  background-position: center;
  transform: scale(0.56);
  opacity: 0.96;
  filter: drop-shadow(0 10px 14px rgba(57, 42, 70, 0.22));
}
.mini-game-board.royal-run.theme-prince-rescue .royal-run-princess {
  width: 68px;
  height: 80px;
  background-image: url("data/prince_rescue/chimp_hero_runtime.png");
  background-size: contain;
  background-position: center bottom;
  background-repeat: no-repeat;
}
.mini-game-board.royal-run.theme-prince-rescue .royal-run-princess::before {
  left: 46px;
  top: 22px;
  width: 22px;
  height: 12px;
  border-radius: 999px;
  background: #3bb9a4;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.65);
}
.mini-game-board.royal-run.theme-prince-rescue .royal-run-gem {
  background: radial-gradient(
    circle at 34% 30%,
    #fff9c9 0 13%,
    #ffd65b 14% 50%,
    #f0a12e 51% 100%
  );
  color: #6c4c13;
}
.mini-game-board.royal-run.theme-prince-rescue .royal-run-enemy {
  width: 56px;
  height: 46px;
  border-radius: 45% 45% 42% 42%;
  background:
    radial-gradient(circle at 34% 28%, #d5a06e 0 18%, transparent 19%),
    linear-gradient(180deg, #6b3f2c 0%, #3d241b 100%);
  color: #ffd86b;
}
.mini-game-board.royal-run.theme-prince-rescue .royal-run-crown {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 38%),
    linear-gradient(180deg, #cfd0da, #8b8fa6);
  color: #ffe68a;
  border-color: #ffe68a;
}
.prince-rescue-boss,
.prince-rescue-princess,
.prince-rescue-ally {
  display: none;
}
.mini-game-board.royal-run.theme-prince-rescue .prince-rescue-boss,
.mini-game-board.royal-run.theme-prince-rescue .prince-rescue-princess,
.mini-game-board.royal-run.theme-prince-rescue .prince-rescue-ally {
  display: block;
  position: absolute;
  z-index: 3;
  background-repeat: no-repeat;
  filter: drop-shadow(0 10px 13px rgba(57, 42, 70, 0.24));
  pointer-events: none;
}
.mini-game-board.royal-run.theme-prince-rescue .prince-rescue-boss {
  left: 890px;
  bottom: 72px;
  width: 138px;
  height: 138px;
  background-image: url("data/prince_rescue/villain_ape_runtime.png");
  background-size: contain;
  background-position: center bottom;
}
.mini-game-board.royal-run.theme-prince-rescue .prince-rescue-princess {
  left: 1214px;
  bottom: 296px;
  width: 70px;
  height: 96px;
  background-image: url("data/prince_rescue/princess_runtime.png");
  background-size: contain;
  background-position: center bottom;
}
.mini-game-board.royal-run.theme-prince-rescue .prince-rescue-ally {
  left: 1132px;
  bottom: 70px;
  width: 72px;
  height: 96px;
  background-image: url("data/prince_rescue/human_prince_runtime.png");
  background-size: contain;
  background-position: center bottom;
}
.mini-game-board.royal-run.theme-caramel {
  background: linear-gradient(180deg, #ffd9b8 0%, #fff1cf 48%, #ffc48a 100%);
}
.mini-game-board.royal-run.theme-caramel .royal-run-bg {
  background:
    radial-gradient(
      circle at 116px 70px,
      rgba(255, 255, 255, 0.86) 0 28px,
      transparent 29px
    ),
    radial-gradient(
      circle at 520px 52px,
      rgba(255, 216, 107, 0.8) 0 34px,
      transparent 35px
    ),
    radial-gradient(
      circle at 880px 82px,
      rgba(255, 255, 255, 0.78) 0 25px,
      transparent 26px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(139, 74, 36, 0.08) 0 22px,
      transparent 22px 54px
    );
}
.mini-game-board.royal-run.theme-caramel .royal-run-ground {
  background:
    radial-gradient(circle at 22px 10px, #fff1a6 0 8px, transparent 9px) 0 0 /
      76px 28px,
    linear-gradient(180deg, #ffb36b 0%, #d98242 58%, #9a552b 100%);
  border-top-color: #fff1a6;
}
.mini-game-board.royal-run.theme-caramel .royal-run-platform {
  background: linear-gradient(180deg, #fff1a6 0%, #d98242 54%, #8a4a24 100%);
  border-color: rgba(92, 45, 21, 0.26);
}
.mini-game-board.royal-run.theme-caramel .royal-run-crown {
  background: linear-gradient(180deg, #fff6df 0%, #ffb36b 100%);
  color: #8a4a24;
}
.mini-game-board.royal-run.theme-strawberry {
  background: linear-gradient(180deg, #ffecf5 0%, #ffe6cc 62%, #ffd166 100%);
}
.mini-game-board.royal-run.theme-strawberry .royal-run-bg {
  background:
    radial-gradient(
      circle at 14% 24%,
      rgba(255, 77, 109, 0.42) 0 48px,
      transparent 50px
    ),
    radial-gradient(
      circle at 78% 18%,
      rgba(255, 216, 107, 0.5) 0 72px,
      transparent 75px
    ),
    linear-gradient(180deg, #ffd6e0, #fff1a6);
}
.mini-game-board.royal-run.theme-strawberry .royal-run-ground {
  background:
    repeating-linear-gradient(90deg, #ff4d6d 0 38px, #ff8fb8 38px 76px), #ff4d6d;
  border-top-color: #fff8ee;
}
.mini-game-board.royal-run.theme-strawberry .royal-run-platform {
  background: linear-gradient(180deg, #fff8ee, #ff8fb8);
  border-color: #ff4d6d;
}
.mini-game-board.royal-run.theme-strawberry .royal-run-gem {
  background: radial-gradient(
    circle at 35% 25%,
    #ffffff 0 12%,
    #ff4d6d 32%,
    #c02457 100%
  );
}
.mini-game-board.royal-run.theme-strawberry .royal-run-crown {
  background: linear-gradient(180deg, #ffffff, #ff4d6d);
  color: #fff8ee;
  text-shadow: 0 2px 0 rgba(107, 34, 71, 0.45);
}
.mini-game-board.royal-run.theme-mint {
  background: linear-gradient(180deg, #d8f5dc 0%, #f0fff4 52%, #c4f0a0 100%);
}
.mini-game-board.royal-run.theme-mint .royal-run-bg {
  background:
    radial-gradient(
      circle at 130px 72px,
      rgba(255, 255, 255, 0.86) 0 32px,
      transparent 33px
    ),
    radial-gradient(
      circle at 520px 64px,
      rgba(123, 224, 200, 0.48) 0 42px,
      transparent 43px
    ),
    radial-gradient(
      circle at 880px 86px,
      rgba(196, 240, 160, 0.58) 0 48px,
      transparent 49px
    ),
    linear-gradient(180deg, #d8f5dc, #e9fff0);
}
.mini-game-board.royal-run.theme-mint .royal-run-bg::before,
.mini-game-board.royal-run.theme-mint .royal-run-bg::after {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.36), transparent 40%), #7be0c8;
  box-shadow:
    26px -32px 0 -22px #c4f0a0,
    60px -4px 0 -34px #88d8f5,
    104px -38px 0 -28px #6be07b;
}
.mini-game-board.royal-run.theme-mint .royal-run-ground {
  background:
    radial-gradient(circle at 22px 10px, #fff8ee 0 7px, transparent 8px) 0 0 /
      68px 28px,
    linear-gradient(180deg, #7be0c8 0%, #45c887 58%, #2f9d65 100%);
  border-top-color: #f0fff4;
}
.mini-game-board.royal-run.theme-mint .royal-run-platform {
  background: linear-gradient(180deg, #f0fff4 0%, #c4f0a0 50%, #6be07b 100%);
  border-color: rgba(47, 157, 101, 0.3);
}
.mini-game-board.royal-run.theme-mint .royal-run-gem {
  background: radial-gradient(
    circle at 35% 28%,
    #fff,
    #c4f0a0 45%,
    #6be07b 100%
  );
  color: #2f7c56;
}
.mini-game-board.royal-run.theme-mint .royal-run-crown {
  background: linear-gradient(180deg, #ffffff, #c4f0a0);
  color: #2f7c56;
  border-color: #7be0c8;
}
.mini-game-board.royal-run.theme-blueberry {
  background: linear-gradient(180deg, #cfe9ff 0%, #eaf6ff 50%, #88d8f5 100%);
}
.mini-game-board.royal-run.theme-blueberry .royal-run-bg {
  background:
    radial-gradient(
      circle at 122px 70px,
      rgba(255, 255, 255, 0.88) 0 32px,
      transparent 33px
    ),
    radial-gradient(
      circle at 520px 58px,
      rgba(136, 216, 245, 0.62) 0 40px,
      transparent 41px
    ),
    radial-gradient(
      circle at 870px 88px,
      rgba(123, 224, 200, 0.42) 0 46px,
      transparent 47px
    ),
    linear-gradient(180deg, #cfe9ff, #eefaff);
}
.mini-game-board.royal-run.theme-blueberry .royal-run-bg::before,
.mini-game-board.royal-run.theme-blueberry .royal-run-bg::after {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), transparent 40%), #88d8f5;
  box-shadow:
    30px -30px 0 -22px #4dc3ff,
    66px -8px 0 -34px #c89bff,
    108px -40px 0 -28px #7be0c8;
}
.mini-game-board.royal-run.theme-blueberry .royal-run-ground {
  background:
    radial-gradient(circle at 22px 10px, #eaf6ff 0 7px, transparent 8px) 0 0 /
      70px 28px,
    linear-gradient(180deg, #88d8f5 0%, #4dc3ff 58%, #2d8ed0 100%);
  border-top-color: #ffffff;
}
.mini-game-board.royal-run.theme-blueberry .royal-run-platform {
  background: linear-gradient(180deg, #ffffff 0%, #c8e6ff 52%, #88d8f5 100%);
  border-color: rgba(45, 142, 208, 0.28);
}
.mini-game-board.royal-run.theme-blueberry .royal-run-gem {
  background: radial-gradient(
    circle at 35% 28%,
    #fff,
    #88d8f5 45%,
    #4dc3ff 100%
  );
  color: #ffffff;
}
.mini-game-board.royal-run.theme-blueberry .royal-run-crown {
  background: linear-gradient(180deg, #ffffff, #88d8f5);
  color: #2d6fab;
  border-color: #4dc3ff;
}
.mini-game-board.royal-run.theme-grape {
  background: linear-gradient(180deg, #e8d4ff 0%, #f5ebff 45%, #c89bff 100%);
}
.mini-game-board.royal-run.theme-grape .royal-run-bg {
  background:
    radial-gradient(
      circle at 118px 64px,
      rgba(255, 255, 255, 0.86) 0 30px,
      transparent 31px
    ),
    radial-gradient(
      circle at 540px 62px,
      rgba(201, 123, 255, 0.54) 0 42px,
      transparent 43px
    ),
    radial-gradient(
      circle at 900px 88px,
      rgba(255, 216, 107, 0.4) 0 38px,
      transparent 39px
    ),
    linear-gradient(180deg, #e8d4ff, #f5ebff);
}
.mini-game-board.royal-run.theme-grape .royal-run-bg::before,
.mini-game-board.royal-run.theme-grape .royal-run-bg::after {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), transparent 40%), #c97bff;
  box-shadow:
    28px -34px 0 -22px #e0b8ff,
    64px -7px 0 -34px #ffd86b,
    106px -42px 0 -30px #a78cff;
}
.mini-game-board.royal-run.theme-grape .royal-run-ground {
  background:
    repeating-linear-gradient(90deg, #c97bff 0 36px, #e0b8ff 36px 72px), #c97bff;
  border-top-color: #ffffff;
}
.mini-game-board.royal-run.theme-grape .royal-run-platform {
  background: linear-gradient(180deg, #ffffff 0%, #e0b8ff 52%, #c97bff 100%);
  border-color: rgba(138, 92, 255, 0.28);
}
.mini-game-board.royal-run.theme-grape .royal-run-gem {
  background: radial-gradient(
    circle at 35% 28%,
    #fff,
    #e0b8ff 45%,
    #8a5cff 100%
  );
  color: #ffffff;
}
.mini-game-board.royal-run.theme-grape .royal-run-crown {
  background: linear-gradient(180deg, #ffffff, #e0b8ff);
  color: #7a3cd8;
  border-color: #c97bff;
}
.mini-game-board.royal-run.theme-bubblegum {
  background: linear-gradient(180deg, #ffd6ec 0%, #fff0f8 46%, #ffb3d6 100%);
}
.mini-game-board.royal-run.theme-bubblegum .royal-run-bg {
  background:
    radial-gradient(
      circle at 100px 70px,
      rgba(255, 255, 255, 0.76) 0 28px,
      transparent 29px
    ),
    radial-gradient(
      circle at 460px 56px,
      rgba(255, 255, 255, 0.58) 0 42px,
      transparent 43px
    ),
    radial-gradient(
      circle at 790px 96px,
      rgba(255, 255, 255, 0.68) 0 34px,
      transparent 35px
    ),
    radial-gradient(
      circle at 980px 46px,
      rgba(255, 216, 235, 0.86) 0 28px,
      transparent 29px
    );
}
.mini-game-board.royal-run.theme-bubblegum .royal-run-bg::before,
.mini-game-board.royal-run.theme-bubblegum .royal-run-bg::after {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), transparent 40%), #ff8ac0;
  border-radius: 999px;
  box-shadow:
    35px -28px 0 -24px #fff,
    70px -4px 0 -34px #ffb3d6,
    104px -36px 0 -30px #c89bff;
}
.mini-game-board.royal-run.theme-bubblegum .royal-run-ground {
  background:
    radial-gradient(
        circle at 22px 10px,
        rgba(255, 255, 255, 0.75) 0 9px,
        transparent 10px
      )
      0 0 / 72px 28px,
    linear-gradient(180deg, #ff9ec7 0%, #ff6fa8 58%, #c0367a 100%);
  border-top-color: #fff;
}
.mini-game-board.royal-run.theme-bubblegum .royal-run-platform {
  background: linear-gradient(180deg, #fff 0%, #ffb3d6 54%, #ff6fa8 100%);
  border-color: rgba(176, 53, 121, 0.25);
}
.mini-game-board.royal-run.theme-bubblegum .royal-run-gem {
  background: radial-gradient(
    circle at 35% 28%,
    #fff,
    #ffc4dc 52%,
    #c89bff 100%
  );
  color: #fff;
  border-radius: 50%;
}
.mini-game-board.royal-run.theme-bubblegum .royal-run-crown {
  background: linear-gradient(180deg, #fff 0%, #ffc4dc 100%);
  color: #b03579;
  border-color: #ff8ac0;
}
.mini-game-board.royal-run.theme-rainbow {
  background: linear-gradient(180deg, #e8d4ff 0%, #d9f7ff 48%, #fff1a6 100%);
}
.mini-game-board.royal-run.theme-rainbow .royal-run-bg {
  background:
    radial-gradient(
      circle at 110px 70px,
      rgba(255, 255, 255, 0.9) 0 30px,
      transparent 31px
    ),
    radial-gradient(
      circle at 510px 48px,
      rgba(255, 111, 168, 0.42) 0 36px,
      transparent 37px
    ),
    radial-gradient(
      circle at 760px 82px,
      rgba(123, 224, 200, 0.46) 0 42px,
      transparent 43px
    ),
    linear-gradient(
      115deg,
      transparent 0 36%,
      rgba(255, 216, 107, 0.42) 36% 42%,
      rgba(255, 111, 168, 0.36) 42% 48%,
      rgba(136, 216, 245, 0.36) 48% 54%,
      transparent 54%
    ),
    linear-gradient(180deg, #e8d4ff, #d9f7ff);
}
.mini-game-board.royal-run.theme-rainbow .royal-run-bg::before,
.mini-game-board.royal-run.theme-rainbow .royal-run-bg::after {
  background:
    radial-gradient(
      circle at 50% 30%,
      rgba(255, 255, 255, 0.65),
      transparent 34%
    ),
    linear-gradient(180deg, #c4a8ff, #88d8f5);
  box-shadow:
    30px -32px 0 -22px #ff6fa8,
    64px -8px 0 -34px #ffd86b,
    102px -38px 0 -30px #7be0c8;
}
.mini-game-board.royal-run.theme-rainbow .royal-run-ground {
  background:
    repeating-linear-gradient(
      90deg,
      #8a5cff 0 34px,
      #ff6fa8 34px 68px,
      #88d8f5 68px 102px,
      #ffd86b 102px 136px
    ),
    #8a5cff;
  border-top-color: #ffffff;
}
.mini-game-board.royal-run.theme-rainbow .royal-run-platform {
  background: linear-gradient(
    90deg,
    #ff6fa8,
    #ffd86b,
    #7be0c8,
    #88d8f5,
    #c4a8ff
  );
  border-color: rgba(138, 92, 255, 0.34);
}
.mini-game-board.royal-run.theme-rainbow .royal-run-gem {
  background: radial-gradient(
    circle at 35% 28%,
    #fff,
    #ffd86b 36%,
    #ff6fa8 62%,
    #8a5cff 100%
  );
  color: #ffffff;
}
.mini-game-board.royal-run.theme-rainbow .royal-run-crown {
  background: linear-gradient(180deg, #ffffff, #c4a8ff);
  color: #8a2fd8;
  border-color: #ffd86b;
}
.royal-run-world {
  position: absolute;
  left: 0;
  bottom: 0;
  width: max(1180px, 100vw);
  height: 100%;
  transform: translateX(0);
  transition: transform 0.08s linear;
}
.royal-run-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 90px 64px,
      rgba(255, 255, 255, 0.95) 0 22px,
      transparent 23px
    ),
    radial-gradient(
      circle at 136px 72px,
      rgba(255, 255, 255, 0.85) 0 30px,
      transparent 31px
    ),
    radial-gradient(
      circle at 570px 54px,
      rgba(255, 245, 176, 0.92) 0 32px,
      transparent 33px
    ),
    radial-gradient(
      circle at 850px 90px,
      rgba(255, 255, 255, 0.88) 0 26px,
      transparent 27px
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 50%);
}
.mini-world-depth {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0),
      rgba(255, 255, 255, 0.12) 58%,
      rgba(67, 126, 76, 0.16)
    ),
    radial-gradient(
      ellipse at 50% 78%,
      rgba(255, 255, 255, 0.34),
      transparent 38%
    );
  pointer-events: none;
}
.mini-world-depth.snow {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0),
      rgba(255, 255, 255, 0.18) 58%,
      rgba(120, 200, 240, 0.18)
    ),
    radial-gradient(
      ellipse at 50% 80%,
      rgba(255, 255, 255, 0.38),
      transparent 36%
    );
}
.royal-route-prop {
  right: 26px;
  bottom: 82px;
  z-index: 2;
  opacity: 0.9;
  transform: scale(0.82);
}
.royal-route-prop.theme-strawberry,
.royal-route-prop.theme-default {
  width: 204px;
  height: 198px;
  background-image: url("data/mini_game_art/prop_ruby_gate.png");
}
.royal-route-prop.theme-grape,
.royal-route-prop.theme-rainbow,
.royal-route-prop.theme-blueberry {
  width: 194px;
  height: 146px;
  background-image: url("data/mini_game_art/prop_kind_crown.png");
}
.royal-route-prop.theme-bubblegum {
  width: 172px;
  height: 236px;
  background-image: url("data/mini_game_art/prop_wish_crystal.png");
  transform: scale(0.58);
  right: 48px;
  bottom: 54px;
}
.royal-run-bg::before,
.royal-run-bg::after {
  content: "";
  position: absolute;
  bottom: 72px;
  width: 170px;
  height: 145px;
  border-radius: 90px 90px 12px 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 40%), #ff9bce;
  box-shadow:
    28px -36px 0 -18px #ffd86b,
    58px -8px 0 -34px #7b4ad8,
    88px -44px 0 -22px #ff6fa8;
}
.royal-run-bg::before {
  left: 42px;
}
.royal-run-bg::after {
  left: 920px;
  transform: scale(0.9);
}
.royal-run-ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 64px;
  background:
    radial-gradient(circle at 22px 10px, #fff1a6 0 8px, transparent 9px) 0 0 /
      76px 28px,
    linear-gradient(180deg, #64d970 0%, #38b85a 58%, #2f8848 100%);
  border-top: 5px solid #fff1a6;
}
.adventure-goal {
  position: absolute;
  top: 12px;
  left: 14px;
  z-index: 7;
  max-width: calc(100vw - 96px);
  padding: 7px 12px;
  border: 2px solid rgba(107, 34, 71, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: #6b2247;
  font:
    800 14px/1.1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  box-shadow: 0 5px 12px rgba(107, 34, 71, 0.12);
  pointer-events: none;
}
.adventure-goal.snow {
  border-color: rgba(46, 122, 172, 0.26);
  color: #285c86;
}
.royal-run-platform {
  position: absolute;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff6df 0%, #ffd86b 48%, #ff9b6b 100%);
  border: 3px solid rgba(107, 34, 71, 0.22);
  box-shadow: 0 7px 0 rgba(107, 34, 71, 0.12);
}
.royal-run-princess {
  position: absolute;
  width: 58px;
  height: 82px;
  z-index: 5;
  background: url("data/princess4.png") 66.666% 0 / 400% 400% no-repeat;
  filter: drop-shadow(0 8px 7px rgba(107, 34, 71, 0.22));
}
.royal-run-princess::before {
  content: "";
  position: absolute;
  left: 21px;
  top: -10px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    #fff 0 20%,
    #ffd86b 24% 62%,
    transparent 66%
  );
  box-shadow:
    -13px 8px 0 -5px #fff1a6,
    16px 11px 0 -6px #fff1a6;
}
.royal-run-princess::after {
  content: "";
  position: absolute;
  left: 11px;
  bottom: -5px;
  width: 38px;
  height: 10px;
  border-radius: 50%;
  background: rgba(107, 34, 71, 0.22);
}
.royal-run-princess.run-left {
  transform: scaleX(-1);
}
.royal-run-princess.is-jumping {
  animation: royal-jump 0.28s ease-in-out infinite alternate;
}
.royal-run-gem {
  position: absolute;
  z-index: 4;
  width: 42px;
  height: 42px;
  margin-left: -14px;
  margin-bottom: -12px;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 28%,
    #fff,
    #ffd86b 52%,
    #ff8ac0 100%
  );
  color: #fff;
  font-size: 24px;
  line-height: 42px;
  text-shadow: 0 2px 4px rgba(107, 34, 71, 0.28);
  box-shadow:
    0 0 20px rgba(255, 216, 107, 0.85),
    0 6px 0 rgba(107, 34, 71, 0.14);
  cursor: pointer;
  animation: royal-gem 1.4s ease-in-out infinite alternate;
}
.royal-run-gem.collected {
  opacity: 0;
  transform: scale(1.8) rotate(24deg);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}
.royal-run-gem::after {
  content: attr(data-count);
  position: absolute;
  right: -7px;
  top: -9px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(107, 34, 71, 0.24);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #7a2a60;
  font:
    900 12px "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  text-shadow: none;
  box-shadow: 0 5px 9px rgba(107, 34, 71, 0.14);
}
.royal-run-word-charm {
  position: absolute;
  z-index: 5;
  min-width: 78px;
  height: 34px;
  padding: 0 10px;
  border: 3px solid rgba(107, 34, 71, 0.24);
  border-radius: 999px;
  background:
    radial-gradient(
      circle at 20% 30%,
      rgba(255, 255, 255, 0.9),
      transparent 28%
    ),
    linear-gradient(180deg, #fffaf0, #ffd86b);
  color: #6b2247;
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", Arial, sans-serif;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow:
    0 8px 0 rgba(107, 34, 71, 0.12),
    0 0 18px rgba(255, 216, 107, 0.62);
  cursor: pointer;
  animation: royal-word-charm 1.65s ease-in-out infinite alternate;
}
.royal-run-word-charm.next {
  border-color: rgba(255, 216, 107, 0.94);
  box-shadow:
    0 8px 0 rgba(107, 34, 71, 0.12),
    0 0 0 8px rgba(255, 255, 255, 0.34),
    0 0 24px rgba(255, 216, 107, 0.82);
}
.royal-run-word-charm::before {
  content: "✦";
  margin-right: 4px;
  color: #b03579;
}
.royal-run-word-charm.collected {
  opacity: 0;
  transform: translateY(-18px) scale(1.2);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}
.royal-run-moment {
  position: absolute;
  z-index: 8;
  min-width: 62px;
  padding: 5px 10px;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #6b2247;
  font:
    900 13px/1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  text-align: center;
  pointer-events: none;
  transform: translate(-50%, 0);
  animation: royal-run-moment 0.76s ease-out both;
  box-shadow: 0 8px 16px rgba(107, 34, 71, 0.16);
}
.royal-run-moment.good {
  color: #8a5a00;
}
.royal-run-moment.word {
  color: #7a2a60;
}
.royal-run-moment.spring {
  color: #256c52;
}
.royal-run-moment.bump {
  color: #8a264a;
}
@keyframes royal-run-moment {
  from {
    opacity: 0;
    translate: 0 -4px;
    scale: 0.88;
  }
  22% {
    opacity: 1;
    scale: 1.04;
  }
  to {
    opacity: 0;
    translate: 0 -30px;
    scale: 1;
  }
}
@keyframes royal-word-charm {
  from {
    transform: translateY(-4px);
  }
  to {
    transform: translateY(5px);
  }
}
.royal-run-enemy {
  position: absolute;
  z-index: 4;
  width: 42px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50% 50% 42% 42%;
  background: linear-gradient(180deg, #8a5cff 0%, #5b2fb2 100%);
  color: #fff1a6;
  font-size: 24px;
  border: 3px solid rgba(255, 255, 255, 0.42);
  box-shadow: 0 6px 0 rgba(107, 34, 71, 0.18);
}
.royal-run-spring {
  position: absolute;
  z-index: 4;
  width: 54px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 16px 16px 10px 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.85), transparent 45%),
    repeating-linear-gradient(90deg, #ffd86b 0 8px, #ff8ac0 8px 16px);
  border: 3px solid rgba(107, 34, 71, 0.28);
  color: #6b2247;
  font-size: 20px;
  font-weight: 900;
  box-shadow:
    0 7px 0 rgba(107, 34, 71, 0.16),
    0 0 18px rgba(255, 216, 107, 0.62);
}
.royal-run-spring.boing {
  animation: spring-boing 0.26s ease;
}
@keyframes spring-boing {
  0%,
  100% {
    transform: scaleY(1);
  }
  45% {
    transform: translateY(6px) scaleY(0.62);
  }
  70% {
    transform: translateY(-7px) scaleY(1.2);
  }
}
.royal-run-crown {
  position: absolute;
  z-index: 3;
  width: 70px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 36px 36px 10px 10px;
  background: linear-gradient(180deg, #fff6df 0%, #ffb3d6 100%);
  border: 4px solid #ffd86b;
  color: #9b2d6a;
  font-size: 48px;
  box-shadow:
    0 0 28px rgba(255, 216, 107, 0.8),
    0 8px 0 rgba(107, 34, 71, 0.14);
  cursor: pointer;
}
.royal-run-crown.ready {
  animation: goal-ready 0.7s ease-in-out infinite alternate;
}
.royal-run-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.72)
  );
  pointer-events: none;
}
.royal-run-controls button {
  min-width: 76px;
  height: 44px;
  padding: 0 16px;
  border: 3px solid rgba(107, 34, 71, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #6b2247;
  font:
    800 18px "Georgia",
    serif;
  cursor: pointer;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  box-shadow: 0 4px 0 rgba(107, 34, 71, 0.16);
}
.royal-run-controls button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(107, 34, 71, 0.16);
}
@keyframes royal-gem {
  from {
    transform: translateY(-4px) rotate(-5deg);
  }
  to {
    transform: translateY(5px) rotate(6deg);
  }
}
@keyframes royal-jump {
  from {
    filter: brightness(1);
  }
  to {
    filter: brightness(1.12);
  }
}
.mini-game-board.ruby-maze {
  display: block;
  min-height: clamp(410px, 58vh, 540px);
  padding: 0;
  background:
    linear-gradient(
      180deg,
      rgba(255, 236, 245, 0.2),
      rgba(255, 209, 102, 0.18)
    ),
    url("data/mini_game_worlds/ruby_rescue_courtyard.png") center / cover
      no-repeat;
}
.ruby-maze-world {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  touch-action: none;
}
.ruby-maze-world::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 18% 18%,
      rgba(255, 255, 255, 0.56) 0 2px,
      transparent 3px
    ),
    radial-gradient(
      circle at 76% 22%,
      rgba(255, 216, 107, 0.46) 0 3px,
      transparent 4px
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(107, 34, 71, 0.18));
  pointer-events: none;
}
.ruby-maze-grid {
  --cell: min(
    56px,
    calc((100vw - 34px) / var(--cols)),
    calc((100dvh - 168px) / var(--rows))
  );
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(var(--cols), var(--cell));
  grid-template-rows: repeat(var(--rows), var(--cell));
  padding: 10px;
  border: 4px solid rgba(107, 34, 71, 0.26);
  border-radius: 22px;
  background: rgba(255, 247, 252, 0.82);
  box-shadow:
    0 18px 28px rgba(107, 34, 71, 0.18),
    inset 0 0 0 8px rgba(255, 255, 255, 0.38);
}
.ruby-maze-cell {
  position: relative;
  border-radius: 12px;
  background:
    radial-gradient(
      circle at 55% 35%,
      rgba(255, 255, 255, 0.56),
      transparent 38%
    ),
    rgba(255, 235, 244, 0.46);
}
.ruby-maze-cell.wall {
  background:
    radial-gradient(
      circle at 30% 24%,
      rgba(255, 255, 255, 0.42),
      transparent 32%
    ),
    linear-gradient(180deg, #ff8fb8, #c02457);
  border: 2px solid rgba(107, 34, 71, 0.24);
  box-shadow: inset 0 -5px 0 rgba(107, 34, 71, 0.14);
}
.ruby-maze-cell.gate {
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.72), transparent 38%),
    linear-gradient(180deg, #ffd86b, #ff4d6d);
  border: 3px solid rgba(107, 34, 71, 0.34);
  box-shadow: 0 0 24px rgba(255, 77, 109, 0.58);
}
.ruby-maze-grid.gate-ready .ruby-maze-cell.gate {
  animation: ruby-gate-ready 0.8s ease-in-out infinite alternate;
}
.ruby-maze-player,
.ruby-maze-thief,
.ruby-maze-pickup,
.ruby-maze-word {
  z-index: 4;
  align-self: center;
  justify-self: center;
}
.ruby-maze-player {
  --maze-x: 1.5;
  --maze-y: 1.5;
  position: absolute;
  left: calc(var(--maze-x) * var(--cell, 52px));
  top: calc(var(--maze-y) * var(--cell, 52px));
  width: calc(var(--cell, 52px) * 0.58);
  height: calc(var(--cell, 52px) * 0.82);
  transform: translate(-50%, -50%);
  background: url("data/princess4.png") 66.666% 0 / 400% 400% no-repeat;
  filter: drop-shadow(0 8px 8px rgba(107, 34, 71, 0.22));
  transform-origin: 50% 82%;
  will-change: left, top, background-position, scale;
  pointer-events: none;
}
.ruby-maze-thief {
  --maze-x: 13.5;
  --maze-y: 1.5;
  position: absolute;
  left: calc(var(--maze-x) * var(--cell, 52px));
  top: calc(var(--maze-y) * var(--cell, 52px));
  z-index: 5;
  width: calc(var(--cell, 52px) * 0.68);
  height: calc(var(--cell, 52px) * 0.8);
  transform: translate(-50%, -50%);
  background: url("data/thief_walk.png") 0 0 / 400% 100% no-repeat;
  filter: drop-shadow(0 8px 8px rgba(57, 28, 74, 0.24)) saturate(1.05);
  pointer-events: none;
  will-change: left, top, background-position, scale;
}
.ruby-maze-thief::after {
  content: "";
  position: absolute;
  right: 6%;
  top: 10%;
  width: 30%;
  aspect-ratio: 1;
  background: url("data/mini_game_art/ruby_collectible_generated.png") center /
    contain no-repeat;
  filter: drop-shadow(0 0 8px rgba(255, 216, 107, 0.88));
}
.ruby-maze-thief.tagged {
  animation: ruby-thief-tagged 0.28s ease-in-out infinite alternate;
  filter: drop-shadow(0 10px 10px rgba(57, 28, 74, 0.22))
    drop-shadow(0 0 16px rgba(255, 216, 107, 0.82));
}
.ruby-maze-player.walking {
  animation: ruby-maze-step 0.21s ease-in-out infinite;
}
.ruby-maze-player.is-moving {
  filter: drop-shadow(0 10px 10px rgba(107, 34, 71, 0.24)) brightness(1.05);
}
.ruby-maze-player.blocked {
  animation: ruby-maze-blocked 0.18s ease;
}
.ruby-maze-pickup {
  width: calc(var(--cell, 52px) * 0.72);
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(
      circle at 50% 50%,
      rgba(255, 255, 255, 0.74),
      transparent 58%
    ),
    url("data/mini_game_art/ruby_collectible_generated.png") center / 118% 118%
      no-repeat;
  color: transparent;
  font-size: 0;
  line-height: 1;
  box-shadow:
    0 0 16px rgba(255, 77, 109, 0.78),
    0 6px 0 rgba(107, 34, 71, 0.16);
  cursor: pointer;
  animation: ruby-maze-gem 1.2s ease-in-out infinite alternate;
}
.ruby-maze-word {
  min-width: calc(var(--cell, 52px) * 1.25);
  height: calc(var(--cell, 52px) * 0.56);
  border: 2px solid rgba(107, 34, 71, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #8f1d4f;
  font:
    900 clamp(11px, 2vw, 15px) "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  box-shadow: 0 7px 14px rgba(107, 34, 71, 0.14);
  cursor: pointer;
}
.ruby-maze-word.next {
  border-color: rgba(255, 216, 107, 0.94);
  background: rgba(255, 250, 225, 0.96);
  box-shadow:
    0 7px 14px rgba(107, 34, 71, 0.14),
    0 0 0 6px rgba(255, 255, 255, 0.48),
    0 0 20px rgba(255, 216, 107, 0.72);
}
.ruby-maze-word.waiting {
  opacity: 0.58;
  filter: saturate(0.82);
}
.ruby-maze-pickup.collected,
.ruby-maze-word.collected {
  opacity: 0;
  scale: 1.45;
  transition:
    opacity 0.18s ease,
    scale 0.18s ease;
}
.ruby-maze-goal {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 5;
  max-width: min(360px, calc(100% - 28px));
  padding: 8px 13px;
  border: 2px solid rgba(107, 34, 71, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #7a2a60;
  font:
    900 13px "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  box-shadow: 0 8px 18px rgba(107, 34, 71, 0.14);
}
.ruby-maze-clue-board {
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 6;
  width: min(310px, calc(100% - 28px));
  display: grid;
  gap: 6px;
  padding: 9px;
  border: 3px solid rgba(107, 34, 71, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  color: #6b2247;
  font:
    900 12px "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  box-shadow: 0 12px 22px rgba(107, 34, 71, 0.14);
}
.ruby-maze-clue-board span {
  min-height: 26px;
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 7px;
  padding: 4px 8px 4px 4px;
  border: 2px solid rgba(176, 53, 121, 0.14);
  border-radius: 999px;
  background: rgba(255, 244, 249, 0.78);
  opacity: 0.7;
}
.ruby-maze-clue-board b {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #b03579;
  font:
    900 12px "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  box-shadow: inset 0 0 0 2px rgba(255, 216, 107, 0.34);
}
.ruby-maze-clue-board span.current {
  opacity: 1;
  border-color: rgba(255, 216, 107, 0.72);
  background: rgba(255, 250, 225, 0.94);
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.42),
    0 0 18px rgba(255, 216, 107, 0.46);
}
.ruby-maze-clue-board span.done {
  opacity: 1;
  border-color: rgba(123, 224, 200, 0.7);
  background: rgba(235, 255, 247, 0.94);
  color: #237c42;
}
.ruby-maze-clue-board span.done b {
  color: #237c42;
  font-size: 0;
}
.ruby-maze-clue-board span.done b::before {
  content: "✓";
  font-size: 14px;
}
.ruby-maze-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0),
    rgba(255, 238, 247, 0.78)
  );
}
.ruby-maze-controls button {
  min-width: 48px;
  height: 44px;
  border: 3px solid rgba(176, 53, 121, 0.32);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #7a2a60;
  font:
    900 20px "Georgia",
    serif;
  box-shadow: 0 5px 0 rgba(107, 34, 71, 0.14);
  cursor: pointer;
}
@keyframes ruby-maze-gem {
  from {
    transform: translateY(-4px);
  }
  to {
    transform: translateY(5px);
  }
}
@keyframes ruby-maze-step {
  50% {
    scale: 1.04 0.98;
  }
}
@keyframes ruby-maze-blocked {
  35% {
    rotate: -5deg;
  }
  70% {
    rotate: 5deg;
  }
}
@keyframes ruby-thief-tagged {
  from {
    scale: 1;
    rotate: -3deg;
  }
  to {
    scale: 1.08;
    rotate: 3deg;
  }
}
@keyframes ruby-gate-ready {
  to {
    box-shadow:
      0 0 0 7px rgba(255, 216, 107, 0.32),
      0 0 30px rgba(255, 77, 109, 0.84);
  }
}
.mini-game-board.snow-run {
  display: block;
  min-height: clamp(520px, 70vh, 680px);
  padding: 0;
  background: linear-gradient(180deg, #a8e8ff 0%, #e9fbff 50%, #ffffff 100%);
}
.mini-game-board.unicorn-trail {
  display: block;
  min-height: clamp(430px, 60vh, 560px);
  padding: 0;
  background: #dff9ff;
}
.unicorn-world {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
}
.unicorn-map-viewport {
  background: #dff9ff;
}
.unicorn-map-layer {
  position: absolute;
  left: 0;
  top: 0;
  width: 1800px;
  height: 1050px;
  background:
    radial-gradient(
      circle at 14% 18%,
      rgba(255, 255, 255, 0.38) 0 80px,
      transparent 82px
    ),
    radial-gradient(
      circle at 76% 16%,
      rgba(255, 216, 107, 0.25) 0 100px,
      transparent 104px
    ),
    url("data/mini_game_art/unicorn_rainbow_meadow.png") center / cover
      no-repeat;
  transition: transform 0.06s linear;
  will-change: transform;
}
.unicorn-map-layer::before {
  content: "";
  position: absolute;
  left: 110px;
  top: 210px;
  width: 1560px;
  height: 650px;
  border-radius: 50% 46% 42% 48%;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 138, 192, 0.1) 0 54px,
      rgba(255, 216, 107, 0.1) 54px 108px,
      rgba(123, 224, 200, 0.1) 108px 162px,
      rgba(136, 216, 245, 0.1) 162px 216px
    ),
    rgba(255, 255, 255, 0.04);
  border: 0;
  box-shadow: none;
  opacity: 0.5;
  pointer-events: none;
}
.unicorn-map-path {
  position: absolute;
  left: 120px;
  top: 300px;
  width: 1500px;
  height: 430px;
  border-radius: 46% 54% 48% 42%;
  background: linear-gradient(
    90deg,
    rgba(255, 138, 192, 0.28),
    rgba(255, 216, 107, 0.26),
    rgba(123, 224, 200, 0.26),
    rgba(136, 216, 245, 0.26),
    rgba(200, 155, 255, 0.28)
  );
  transform: rotate(-4deg);
  pointer-events: none;
}
.unicorn-map-vignette {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse at 50% 46%,
      rgba(255, 255, 255, 0),
      rgba(93, 37, 77, 0.1) 74%,
      rgba(93, 37, 77, 0.22)
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.02),
      rgba(255, 255, 255, 0.16)
    );
}
.unicorn-map-crystal {
  left: 130px;
  top: 720px;
  width: 118px;
  height: 162px;
  opacity: 0.96;
}
.unicorn-map-crown-prop {
  left: 1515px;
  top: 365px;
  width: 142px;
  height: 108px;
  opacity: 0.96;
}
.unicorn-map-sign {
  position: absolute;
  left: 1455px;
  top: 320px;
  z-index: 4;
  padding: 7px 12px;
  border: 2px solid rgba(176, 53, 121, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #6b2247;
  font:
    900 15px "Georgia",
    serif;
  box-shadow: 0 6px 16px rgba(107, 34, 71, 0.14);
}
.unicorn-kindness-card {
  position: absolute;
  left: 455px;
  top: 112px;
  z-index: 5;
  width: 330px;
  padding: 11px 14px;
  border: 3px solid rgba(107, 34, 71, 0.18);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  color: #6b2247;
  box-shadow:
    0 12px 22px rgba(107, 34, 71, 0.14),
    0 0 22px rgba(255, 216, 107, 0.28);
  pointer-events: none;
}
.unicorn-kindness-card b,
.unicorn-kindness-card span {
  display: block;
}
.unicorn-kindness-card b {
  margin-bottom: 4px;
  color: #b03579;
  font:
    900 12px "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.unicorn-kindness-card span {
  font:
    900 17px/1.18 "Georgia",
    serif;
}
.unicorn-goal {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  max-width: min(560px, calc(100% - 132px));
  padding: 7px 12px;
  border: 2px solid rgba(176, 53, 121, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #6b2247;
  font:
    900 13px "Georgia",
    serif;
  pointer-events: none;
}
.unicorn-runner {
  position: absolute;
  left: 180px;
  top: 610px;
  z-index: 5;
  width: 142px;
  height: 142px;
  transform: translate(-50%, -62%);
  background-image: url("data/unicorn_game/unicorn_walk_sheet_runtime.png");
  background-size: 400% 400%;
  background-position: 0 0;
  background-repeat: no-repeat;
  filter: drop-shadow(0 10px 12px rgba(107, 34, 71, 0.22));
  pointer-events: none;
  transition:
    filter 0.16s ease,
    scale 0.12s ease;
  image-rendering: auto;
}
.unicorn-runner.run-left {
  scale: -1 1;
}
.unicorn-runner.is-moving {
  animation: unicorn-bob 0.42s ease-in-out infinite alternate;
}
.unicorn-runner.run-down {
  animation: unicorn-down-prance 0.32s ease-in-out infinite;
}
.unicorn-runner.run-up {
  animation-duration: 0.38s;
}
.unicorn-runner.is-coasting {
  animation-duration: 0.56s;
}
.unicorn-runner.is-turning {
  animation:
    unicorn-bob 0.42s ease-in-out infinite alternate,
    unicorn-turn-settle 0.18s ease-out;
}
.unicorn-runner.glowing {
  filter: drop-shadow(0 10px 12px rgba(107, 34, 71, 0.22))
    drop-shadow(0 0 20px rgba(255, 255, 255, 0.95))
    drop-shadow(0 0 24px rgba(255, 216, 107, 0.72));
}
@keyframes unicorn-bob {
  from {
    translate: 0 -1px;
  }
  to {
    translate: 0 3px;
  }
}
@keyframes unicorn-down-prance {
  0%,
  100% {
    translate: 0 2px;
    rotate: -1deg;
  }
  50% {
    translate: 0 -9px;
    rotate: 1deg;
  }
}
@keyframes unicorn-turn-settle {
  0% {
    rotate: 0deg;
  }
  45% {
    rotate: -3deg;
  }
  100% {
    rotate: 0deg;
  }
}
.unicorn-wish {
  position: absolute;
  z-index: 4;
  width: 62px;
  height: 62px;
  transform: translate(-50%, -50%);
  border: 3px solid rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 24%, #fff 0 14%, transparent 15%),
    conic-gradient(from 15deg, #ffd86b, #ff8ac0, #c89bff, #7be0c8, #ffd86b);
  color: #7a2a60;
  font-size: 0;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(176, 53, 121, 0.2);
  animation: unicorn-map-wish 1.2s ease-in-out infinite alternate;
}
.unicorn-wish.next {
  border-color: rgba(255, 216, 107, 0.94);
  box-shadow:
    0 10px 20px rgba(176, 53, 121, 0.18),
    0 0 0 9px rgba(255, 255, 255, 0.34),
    0 0 26px rgba(255, 216, 107, 0.78);
  animation:
    unicorn-map-wish 1s ease-in-out infinite alternate,
    recipe-target-pulse 0.8s ease-in-out infinite alternate;
}
.unicorn-wish.waiting {
  opacity: 0.54;
  filter: saturate(0.8);
}
.unicorn-wish.kindness-wait {
  animation: unicorn-wait-nudge 0.22s ease;
}
.unicorn-wish span {
  position: absolute;
  right: -4px;
  bottom: -6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #8a2f64;
  font-size: 17px;
  line-height: 28px;
}
.unicorn-wish em {
  position: absolute;
  left: 50%;
  top: 58px;
  min-width: 76px;
  transform: translateX(-50%);
  padding: 3px 8px;
  border: 2px solid rgba(122, 42, 96, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #7a2a60;
  font:
    900 13px "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  font-style: normal;
  line-height: 1.1;
  text-align: center;
  box-shadow: 0 8px 14px rgba(122, 42, 96, 0.14);
}
.unicorn-finish {
  position: absolute;
  left: 1605px;
  top: 520px;
  z-index: 5;
  width: 86px;
  height: 104px;
  transform: translate(-50%, -50%);
  border: 4px solid rgba(255, 255, 255, 0.74);
  border-radius: 999px 999px 18px 18px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.9),
    rgba(255, 216, 107, 0.84)
  );
  color: #b03579;
  font-size: 48px;
  cursor: pointer;
  opacity: 0.65;
  box-shadow: 0 10px 28px rgba(107, 34, 71, 0.18);
}
.unicorn-finish::after {
  content: "";
  position: absolute;
  inset: -22px;
  border-radius: 50%;
  border: 3px dashed rgba(255, 216, 107, 0.64);
  opacity: 0;
  pointer-events: none;
}
.unicorn-finish.ready {
  opacity: 1;
  animation: goal-ready 0.7s ease-in-out infinite alternate;
}
.unicorn-finish.ready::after {
  opacity: 1;
}
.unicorn-wish.collected {
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.6) rotate(18deg);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
}
.unicorn-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.72)
  );
  pointer-events: none;
}
.unicorn-controls button {
  min-width: 86px;
  height: 44px;
  border: 3px solid rgba(107, 34, 71, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #6b2247;
  font:
    900 16px "Georgia",
    serif;
  cursor: pointer;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  box-shadow: 0 4px 0 rgba(107, 34, 71, 0.16);
}
.unicorn-controls button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(107, 34, 71, 0.16);
}
@keyframes unicorn-map-wish {
  from {
    translate: 0 -5px;
  }
  to {
    translate: 0 7px;
  }
}
@keyframes unicorn-wait-nudge {
  25% {
    rotate: -8deg;
  }
  65% {
    rotate: 8deg;
  }
}
.mini-game-board.butterfly-net {
  display: block;
  min-height: clamp(410px, 58vh, 540px);
  padding: 0;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.08),
      rgba(229, 255, 232, 0.16)
    ),
    url("data/mini_game_worlds/butterfly_meadow_world_v2.png") center / cover
      no-repeat;
}
.butterfly-net-prop {
  display: none;
}
.butterfly-meadow {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
}
.butterfly-meadow::before,
.butterfly-meadow::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.butterfly-meadow::before {
  background:
    radial-gradient(
      circle at 18% 20%,
      rgba(255, 255, 255, 0.56) 0 2px,
      transparent 3px
    ),
    radial-gradient(
      circle at 42% 16%,
      rgba(255, 216, 107, 0.5) 0 2px,
      transparent 3px
    ),
    radial-gradient(
      circle at 74% 28%,
      rgba(255, 255, 255, 0.52) 0 2px,
      transparent 3px
    ),
    radial-gradient(
      circle at 86% 66%,
      rgba(200, 155, 255, 0.42) 0 3px,
      transparent 4px
    );
  animation: mini-world-twinkle 2.8s ease-in-out infinite alternate;
}
.butterfly-meadow::after {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0),
    rgba(255, 246, 251, 0.34)
  );
}
.butterfly-three-wrap {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
}
.butterfly-three-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.butterfly-sprite-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
.butterfly-player-sprite {
  position: absolute;
  left: 12%;
  top: 72%;
  width: clamp(118px, 18vw, 172px);
  aspect-ratio: 220 / 240;
  transform: translate(-50%, -78%);
  background: url("data/butterfly_net/princess_net_swing_runtime.png") 0 0 /
    600% 100% no-repeat;
  filter: drop-shadow(0 12px 12px rgba(67, 76, 43, 0.22));
  image-rendering: auto;
}
.butterfly-catch-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(116px, 18vw, 168px);
  aspect-ratio: 1;
  border: 4px solid rgba(255, 255, 255, 0.74);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 216, 107, 0.2),
    rgba(255, 255, 255, 0.06) 54%,
    transparent 62%
  );
  box-shadow:
    0 0 22px rgba(255, 216, 107, 0.58),
    inset 0 0 24px rgba(255, 255, 255, 0.32);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.5);
  transition:
    opacity 0.12s ease,
    transform 0.16s ease;
}
.butterfly-catch-ring.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  animation: butterfly-catch-ring 0.44s ease-out both;
}
.butterfly-player-sprite.walking {
  animation: butterfly-princess-walk 0.34s ease-in-out infinite alternate;
}
.butterfly-player-sprite.swinging {
  animation: butterfly-princess-swing 0.2s ease-in-out infinite alternate;
  filter: drop-shadow(0 12px 12px rgba(67, 76, 43, 0.22))
    drop-shadow(0 0 14px rgba(255, 216, 107, 0.72));
}
.butterfly-player-sprite.facing-left {
  scale: -1 1;
}
.butterfly-dom-sprite {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(54px, 9vw, 88px);
  aspect-ratio: 128 / 96;
  transform: translate(-50%, -50%);
  background: url("data/butterfly_net/butterfly_sheet_runtime.png") 0 0 / 400%
    100% no-repeat;
  filter: drop-shadow(0 6px 8px rgba(88, 53, 119, 0.2)) saturate(1.14);
  animation: butterfly-float 0.62s ease-in-out infinite alternate;
}
.butterfly-dom-sprite.target {
  animation:
    butterfly-float 0.62s ease-in-out infinite alternate,
    butterfly-target-glow 0.9s ease-in-out infinite alternate;
}
.butterfly-dom-sprite.target::after {
  content: attr(data-word);
  position: absolute;
  left: 50%;
  top: -18px;
  transform: translateX(-50%);
  padding: 2px 7px;
  border: 2px solid rgba(107, 34, 71, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #7a2a60;
  font:
    900 11px "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  text-transform: capitalize;
  white-space: nowrap;
  box-shadow: 0 5px 10px rgba(88, 53, 119, 0.16);
}
.butterfly-dom-sprite.gold {
  filter: drop-shadow(0 6px 8px rgba(88, 53, 119, 0.2)) hue-rotate(35deg)
    saturate(1.1);
}
.butterfly-dom-sprite.blue {
  filter: drop-shadow(0 6px 8px rgba(88, 53, 119, 0.2)) hue-rotate(145deg)
    saturate(1.04);
}
.butterfly-dom-sprite.lavender {
  filter: drop-shadow(0 6px 8px rgba(88, 53, 119, 0.2)) hue-rotate(250deg)
    saturate(1.05);
}
.butterfly-dom-sprite.mint {
  filter: drop-shadow(0 6px 8px rgba(88, 53, 119, 0.2)) hue-rotate(104deg)
    saturate(1.08);
}
.butterfly-dom-sprite.caught {
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.6) rotate(18deg);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}
.butterfly-jar-celebration {
  position: absolute;
  left: 50%;
  bottom: clamp(70px, 13vh, 118px);
  z-index: 8;
  width: min(560px, calc(100% - 28px));
  height: clamp(250px, 40vh, 330px);
  transform: translateX(-50%);
  pointer-events: none;
  animation: butterfly-celebration-pop 0.34s ease both;
}
.butterfly-celebration-princess {
  position: absolute;
  left: 10%;
  bottom: 0;
  width: clamp(126px, 23vw, 178px);
  aspect-ratio: 220 / 240;
  background: url("data/butterfly_net/princess_net_swing_runtime.png") 0 0 /
    600% 100% no-repeat;
  filter: drop-shadow(0 14px 14px rgba(67, 76, 43, 0.24));
  animation: butterfly-princess-happy 0.58s ease-in-out infinite alternate;
}
.butterfly-joy-jar {
  position: absolute;
  right: 4%;
  bottom: 6px;
  width: clamp(190px, 38vw, 270px);
  height: clamp(220px, 36vh, 300px);
  background: url("data/butterfly_net/butterfly_jar_generated.png") center /
    contain no-repeat;
  filter: drop-shadow(0 18px 24px rgba(98, 74, 128, 0.24))
    drop-shadow(0 0 30px rgba(255, 216, 107, 0.34));
}
.butterfly-joy-jar::before {
  content: "";
  position: absolute;
  left: 16%;
  right: 16%;
  top: 31%;
  bottom: 13%;
  border-radius: 42%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.18),
    rgba(150, 238, 255, 0.08)
  );
  box-shadow: inset 0 0 28px rgba(255, 255, 255, 0.22);
}
.jar-shine {
  position: absolute;
  left: 28%;
  top: 34%;
  width: 18px;
  height: 42%;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.56),
    rgba(255, 255, 255, 0)
  );
  transform: rotate(12deg);
}
.butterfly-jar-orbit {
  position: absolute;
  left: 18%;
  right: 18%;
  top: 33%;
  bottom: 13%;
  overflow: hidden;
  border-radius: 42%;
}
.butterfly-jar-flutter {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  aspect-ratio: 128 / 96;
  margin-left: -29px;
  margin-top: -22px;
  background: url("data/butterfly_net/butterfly_sheet_runtime.png") 0 0 / 400%
    100% no-repeat;
  animation:
    butterfly-jar-orbit 2.4s linear infinite,
    butterfly-jar-flap 0.42s steps(4) infinite;
  animation-delay: var(--delay), var(--delay);
  filter: drop-shadow(0 5px 6px rgba(88, 53, 119, 0.2));
}
.butterfly-jar-flutter.gold {
  filter: hue-rotate(35deg) saturate(1.1)
    drop-shadow(0 5px 6px rgba(88, 53, 119, 0.2));
}
.butterfly-jar-flutter.blue {
  filter: hue-rotate(145deg) saturate(1.04)
    drop-shadow(0 5px 6px rgba(88, 53, 119, 0.2));
}
.butterfly-jar-flutter.lavender {
  filter: hue-rotate(250deg) saturate(1.05)
    drop-shadow(0 5px 6px rgba(88, 53, 119, 0.2));
}
.butterfly-jar-flutter.mint {
  filter: hue-rotate(104deg) saturate(1.08)
    drop-shadow(0 5px 6px rgba(88, 53, 119, 0.2));
}
.butterfly-catch-sparkle {
  position: absolute;
  z-index: 7;
  transform: translate(-50%, -50%);
  padding: 4px 9px;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #6b2247;
  font:
    900 12px/1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  text-transform: capitalize;
  pointer-events: none;
  animation: butterfly-catch-sparkle 0.72s ease-out both;
  box-shadow: 0 7px 14px rgba(88, 53, 119, 0.16);
}
.butterfly-catch-sparkle.pink {
  color: #a22268;
}
.butterfly-catch-sparkle.gold {
  color: #7a5514;
}
.butterfly-catch-sparkle.blue {
  color: #18688c;
}
.butterfly-catch-sparkle.lavender {
  color: #6540a7;
}
.butterfly-catch-sparkle.mint {
  color: #1f6e3b;
}
.butterfly-celebration-label {
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  min-width: min(360px, 80%);
  padding: 8px 14px;
  border: 3px solid rgba(176, 53, 121, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #6b2247;
  font:
    900 15px/1.05 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  text-align: center;
  box-shadow: 0 9px 18px rgba(107, 34, 71, 0.14);
}
@keyframes butterfly-celebration-pop {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(18px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}
@keyframes butterfly-princess-happy {
  from {
    translate: 0 -2px;
  }
  to {
    translate: 0 6px;
  }
}
@keyframes butterfly-jar-orbit {
  from {
    transform: rotate(var(--angle)) translateX(64px) rotate(var(--angle-neg));
  }
  to {
    transform: rotate(calc(var(--angle) + 360deg)) translateX(64px)
      rotate(calc(var(--angle-neg) - 360deg));
  }
}
@keyframes butterfly-jar-flap {
  to {
    background-position: 100% 0;
  }
}
@keyframes butterfly-princess-walk {
  from {
    translate: 0 -2px;
  }
  to {
    translate: 0 5px;
  }
}
@keyframes butterfly-princess-swing {
  from {
    rotate: -3deg;
  }
  to {
    rotate: 4deg;
  }
}
@keyframes butterfly-float {
  from {
    translate: 0 -5px;
  }
  to {
    translate: 0 6px;
  }
}
@keyframes butterfly-catch-ring {
  from {
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(0.38);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.2);
  }
}
@keyframes butterfly-catch-sparkle {
  from {
    opacity: 0;
    translate: 0 10px;
    scale: 0.82;
  }
  24% {
    opacity: 1;
    scale: 1.08;
  }
  to {
    opacity: 0;
    translate: 0 -26px;
    scale: 1;
  }
}
@keyframes butterfly-target-glow {
  from {
    scale: 1;
  }
  to {
    scale: 1.16;
  }
}
.butterfly-space-hint {
  position: absolute;
  top: 10px;
  left: 50%;
  z-index: 7;
  transform: translateX(-50%);
  padding: 6px 12px;
  border: 2px solid rgba(107, 34, 71, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #6b2247;
  font:
    800 13px "Georgia",
    serif;
  pointer-events: none;
}
.butterfly-mission-chip {
  position: absolute;
  top: 46px;
  left: 50%;
  z-index: 7;
  transform: translateX(-50%);
  min-width: min(340px, calc(100% - 32px));
  padding: 7px 14px;
  border: 2px solid rgba(35, 124, 66, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #1f6e3b;
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", Arial, sans-serif;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  box-shadow: 0 8px 18px rgba(35, 124, 66, 0.14);
  pointer-events: none;
}
.butterfly-mission-chip span {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: capitalize;
}
.butterfly-mission-chip strong {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #6b2247;
}
.butterfly-mission-chip .pink {
  background: rgba(255, 127, 176, 0.18);
  color: #a22268;
}
.butterfly-mission-chip .gold {
  background: rgba(255, 216, 107, 0.24);
  color: #7a5514;
}
.butterfly-mission-chip .blue {
  background: rgba(118, 215, 255, 0.22);
  color: #18688c;
}
.butterfly-mission-chip .lavender {
  background: rgba(200, 155, 255, 0.22);
  color: #6540a7;
}
.butterfly-mission-chip .mint {
  background: rgba(123, 224, 200, 0.24);
  color: #1f6e3b;
}
.butterfly-mission-chip .current {
  outline: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 3px rgba(255, 216, 107, 0.48);
}
.butterfly-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.72)
  );
  pointer-events: none;
}
.butterfly-controls button {
  min-width: 46px;
  height: 42px;
  padding: 0 12px;
  border: 3px solid rgba(138, 92, 255, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #6b2247;
  font:
    800 18px "Georgia",
    serif;
  cursor: pointer;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  box-shadow: 0 4px 0 rgba(107, 34, 71, 0.16);
}
.butterfly-controls button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(107, 34, 71, 0.16);
}
.snow-run-world {
  position: absolute;
  left: 0;
  top: 0;
  width: max(980px, 128vw);
  height: 5760px;
  transform: translate(0, 0);
  transition: transform 0.03s linear;
  will-change: transform;
}
.snow-run-sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 135px 64px,
      rgba(255, 255, 255, 0.96) 0 30px,
      transparent 31px
    ),
    radial-gradient(
      circle at 192px 72px,
      rgba(255, 255, 255, 0.8) 0 38px,
      transparent 39px
    ),
    radial-gradient(
      circle at 560px 46px,
      rgba(244, 252, 255, 0.96) 0 28px,
      transparent 29px
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.42),
      rgba(197, 235, 255, 0.16)
    );
}
.snow-run-sky::before,
.snow-run-sky::after {
  content: none;
  position: absolute;
  bottom: 220px;
  width: 420px;
  height: 560px;
  background: linear-gradient(
    135deg,
    transparent 46%,
    #d9f5ff 47% 58%,
    #fff 59%
  );
  clip-path: polygon(0 100%, 50% 0, 100% 100%);
  filter: drop-shadow(0 8px 0 rgba(60, 120, 170, 0.1));
}
.snow-run-sky::before {
  left: -60px;
}
.snow-run-sky::after {
  right: -90px;
  transform: scale(1.28);
}
.snow-run-drift {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 210px;
  background:
    radial-gradient(circle at 38px 9px, #d9f5ff 0 8px, transparent 9px) 0 0 /
      82px 28px,
    linear-gradient(180deg, #fff 0%, #dcf6ff 62%, #a7d9f6 100%);
  border-top: 5px solid #ffffff;
  box-shadow: inset 0 12px 20px rgba(114, 181, 218, 0.16);
}
.mini-game-board.ice-skate-run .snow-run-drift {
  display: none;
}
.snow-run-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 5500px;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
}
.snow-run-lesson-card {
  position: absolute;
  left: 270px;
  top: 22px;
  z-index: 7;
  width: 430px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 10px;
  border: 3px solid rgba(46, 122, 172, 0.2);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.84);
  color: #17688c;
  box-shadow: 0 12px 22px rgba(46, 122, 172, 0.14);
  pointer-events: none;
}
.snow-run-lesson-card b {
  grid-column: 1 / -1;
  color: #17688c;
  font:
    900 12px "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.snow-run-lesson-card span {
  min-height: 28px;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 4px;
  border: 2px solid rgba(46, 122, 172, 0.14);
  border-radius: 999px;
  background: rgba(235, 250, 255, 0.82);
  font:
    900 12px "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
}
.snow-run-lesson-card i {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  font-style: normal;
}
.snow-run-lesson-card span.done {
  border-color: rgba(123, 224, 200, 0.76);
  background: rgba(235, 255, 247, 0.9);
  color: #237c42;
}
.snow-run-lesson-card span.done i {
  font-size: 0;
}
.snow-run-lesson-card span.done i::before {
  content: "✓";
  font-size: 13px;
}
.snow-run-track::before,
.snow-run-track::after {
  content: none;
  position: absolute;
  top: 0;
  bottom: 0;
  width: 44%;
  border-radius: 50%;
  border-left: 8px dashed rgba(255, 255, 255, 0.86);
  filter: drop-shadow(0 3px 0 rgba(74, 159, 214, 0.14));
}
.snow-run-track::before {
  left: 13%;
  transform: skewX(-13deg);
}
.snow-run-track::after {
  right: 13%;
  transform: skewX(13deg);
}
.snow-world-crystal {
  right: 42px;
  bottom: 82px;
  z-index: 2;
  opacity: 0;
  transform: scale(0.76) rotate(4deg);
}
.snow-run-princess {
  position: absolute;
  width: 106px;
  height: 106px;
  z-index: 6;
  background: url("data/mini_game_art/skiing_princess_sheet_v2_square.png?v=2")
    0 0 / 400% 400% no-repeat;
  filter: drop-shadow(0 10px 8px rgba(46, 122, 172, 0.26))
    drop-shadow(0 0 8px rgba(217, 245, 255, 0.45));
  transform: rotate(7deg);
  transform-origin: 50% 90%;
  transition: transform 0.12s ease;
}
.snow-run-princess.ice-skating {
  width: 150px;
  height: 150px;
  background-image: url("data/mini_game_art/ice_skating_princess_sheet_5row.png?v=1");
  background-size: 400% 500%;
  transform: rotate(2deg);
  transition: transform 0.18s ease;
}
.snow-run-princess::before {
  content: "";
  display: none;
}
.snow-run-princess::after {
  content: "";
  position: absolute;
  left: 24px;
  bottom: -8px;
  width: 68px;
  height: 13px;
  border-radius: 999px;
  background: rgba(88, 165, 210, 0.26);
}
.snow-run-princess.carving-up {
  transform: rotate(-16deg) translate(-4px, 2px);
}
.snow-run-princess.carving-down {
  transform: rotate(18deg) translate(4px, 2px);
}
.snow-run-princess.ice-skating.carving-up {
  transform: rotate(-9deg) translate(-6px, 1px);
}
.snow-run-princess.ice-skating.carving-down {
  transform: rotate(10deg) translate(6px, 1px);
}
.snow-run-princess.is-sliding {
  animation: snow-ski-bob 0.28s ease-in-out infinite alternate;
}
.snow-run-princess.ice-skating.is-sliding {
  animation: ice-skate-glide 0.72s ease-in-out infinite alternate;
}
.snow-run-princess.ice-skating.is-twirling {
  animation: ice-skate-twirl 0.38s ease-in-out infinite alternate;
  transform: rotate(0deg) translateY(-8px);
}
.ice-twirl-score-burst {
  position: absolute;
  z-index: 8;
  min-width: 46px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 3px solid rgba(255, 216, 107, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #b03579;
  font:
    900 18px "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  pointer-events: none;
  filter: drop-shadow(0 6px 10px rgba(176, 53, 121, 0.18));
  animation: ice-twirl-score-pop 2.2s ease-out forwards;
}
.ice-twirl-score-burst::before,
.ice-twirl-score-burst::after {
  content: "✦";
  position: absolute;
  color: #7ddfff;
  text-shadow: 0 0 9px rgba(255, 255, 255, 0.95);
}
.ice-twirl-score-burst::before {
  left: -15px;
  top: -8px;
}
.ice-twirl-score-burst::after {
  right: -13px;
  bottom: -6px;
  color: #ffd86b;
}
.snow-run-princess.is-sliding::after {
  background: rgba(78, 176, 231, 0.44);
  box-shadow: 0 0 10px rgba(78, 176, 231, 0.35);
}
.snow-run-princess.run-left {
  transform: rotate(7deg);
}
.snow-run-princess.is-jumping {
  animation: snow-ski-bob 0.28s ease-in-out infinite alternate;
}
@keyframes snow-ski-bob {
  from {
    translate: 0 -2px;
  }
  to {
    translate: 0 3px;
  }
}
@keyframes ice-skate-glide {
  from {
    translate: -2px -1px;
  }
  to {
    translate: 2px 1px;
  }
}
@keyframes ice-skate-twirl {
  from {
    translate: 0 -5px;
  }
  to {
    translate: 0 -11px;
  }
}
@keyframes ice-twirl-score-pop {
  0% {
    opacity: 0;
    transform: translateY(4px) scale(0.72);
  }
  18% {
    opacity: 1;
    transform: translateY(-8px) scale(1.08);
  }
  72% {
    opacity: 1;
    transform: translateY(-34px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-48px) scale(0.92);
  }
}
.snow-run-crystal {
  position: absolute;
  z-index: 5;
  width: 44px;
  height: 44px;
  margin-left: -14px;
  margin-bottom: -12px;
  border: 0;
  border-radius: 14px;
  background: radial-gradient(
    circle at 36% 28%,
    #fff,
    #baf2ff 48%,
    #5ac8ff 100%
  );
  color: #fff;
  font-size: 24px;
  line-height: 44px;
  text-shadow: 0 2px 4px rgba(31, 91, 132, 0.36);
  box-shadow:
    0 0 22px rgba(120, 222, 255, 0.9),
    0 6px 0 rgba(31, 91, 132, 0.14);
  cursor: pointer;
  animation: snow-crystal 1.25s ease-in-out infinite alternate;
}
.snow-run-crystal::after {
  content: attr(data-count);
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  background: #2f5d91;
  color: #fff;
  font-size: 12px;
  line-height: 18px;
  box-shadow: 0 3px 0 rgba(31, 91, 132, 0.18);
}
.snow-run-crystal.collected {
  opacity: 0;
  transform: scale(1.9) rotate(30deg);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}
.snow-run-word-charm {
  position: absolute;
  z-index: 6;
  min-width: 70px;
  height: 34px;
  padding: 0 10px;
  border: 3px solid rgba(46, 122, 172, 0.28);
  border-radius: 999px;
  background:
    radial-gradient(
      circle at 20% 30%,
      rgba(255, 255, 255, 0.95),
      transparent 28%
    ),
    linear-gradient(180deg, #ffffff, #baf2ff);
  color: #2f5d91;
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", Arial, sans-serif;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow:
    0 8px 0 rgba(46, 122, 172, 0.13),
    0 0 18px rgba(132, 235, 255, 0.72);
  cursor: pointer;
  animation: snow-word-charm 1.55s ease-in-out infinite alternate;
}
.snow-run-word-charm::before {
  content: "❄";
  margin-right: 4px;
  color: #7b77d8;
}
.snow-run-word-charm.next {
  border-color: rgba(255, 215, 92, 0.96);
  box-shadow:
    0 8px 0 rgba(46, 122, 172, 0.13),
    0 0 0 6px rgba(255, 236, 139, 0.42),
    0 0 28px rgba(255, 236, 139, 0.9);
}
.snow-run-word-charm.collected {
  opacity: 0;
  transform: translateY(-18px) scale(1.18);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}
@keyframes snow-word-charm {
  from {
    transform: translateY(-4px);
  }
  to {
    transform: translateY(5px);
  }
}
.snow-run-gate {
  position: absolute;
  z-index: 4;
  width: 118px;
  height: 92px;
  pointer-events: none;
}
.snow-run-gate span {
  position: absolute;
  bottom: 0;
  width: 7px;
  height: 82px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff, var(--gate-hue));
  box-shadow: 0 4px 0 rgba(46, 122, 172, 0.16);
}
.snow-run-gate span:first-child {
  left: 14px;
  transform: rotate(-5deg);
}
.snow-run-gate span:nth-child(2) {
  right: 14px;
  transform: rotate(5deg);
}
.snow-run-gate strong {
  position: absolute;
  left: 50%;
  bottom: 62px;
  transform: translateX(-50%);
  min-width: 72px;
  padding: 4px 9px;
  border: 2px solid rgba(46, 122, 172, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #285c86;
  font:
    900 13px "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  text-align: center;
}
.snow-run-gate.cleared {
  opacity: 0.38;
}
.snow-run-gate.cleared strong {
  color: #23824a;
}
.snow-run-gate.missed {
  opacity: 0.58;
  filter: saturate(0.72);
}
.snow-run-gate.missed strong {
  border-color: rgba(138, 38, 74, 0.24);
  color: #8a264a;
}
.snow-run-igloo {
  position: absolute;
  z-index: 4;
  width: 228px;
  height: 172px;
  margin-left: -34px;
  margin-top: -58px;
  background: url("data/mini_game_art/snow_igloo_goal.png?v=1") center / contain
    no-repeat;
  filter: drop-shadow(0 0 24px rgba(139, 226, 255, 0.82))
    drop-shadow(0 10px 0 rgba(46, 122, 172, 0.14));
  cursor: pointer;
}
.snow-run-igloo.ready {
  animation: goal-ready 0.7s ease-in-out infinite alternate;
}
.snow-storybook {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 16px;
  background:
    radial-gradient(
      circle at 50% 40%,
      rgba(255, 255, 255, 0.16),
      transparent 46%
    ),
    rgba(19, 54, 86, 0.46);
  backdrop-filter: blur(4px);
}
.snow-story-card {
  width: min(620px, 94vw);
  max-height: min(620px, 92vh);
  display: grid;
  grid-template-rows: minmax(250px, 1fr) auto auto;
  gap: 10px;
  padding: 12px;
  border: 4px solid rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  background: linear-gradient(180deg, #f5fcff, #d9f5ff);
  color: #285c86;
  box-shadow: 0 26px 70px rgba(20, 82, 122, 0.36);
}
.snow-story-scene {
  position: relative;
  min-height: 270px;
  overflow: hidden;
  border-radius: 12px;
  background:
    radial-gradient(
      circle at 50% 28%,
      rgba(255, 255, 255, 0.9) 0 56px,
      transparent 58px
    ),
    url("data/mini_game_worlds/snowflake_ski_course_strip_v11_generated_fullcourse.png")
      center 88% / cover no-repeat;
}
.snow-story-character {
  position: absolute;
  border: 0;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: contain;
  cursor: pointer;
  transform-origin: 50% 88%;
}
.snow-story-character span {
  position: absolute;
  left: 50%;
  bottom: -4px;
  transform: translateX(-50%);
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #285c86;
  font:
    900 12px "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  box-shadow: 0 8px 14px rgba(20, 82, 122, 0.16);
}
.snow-story-princess {
  left: 16%;
  bottom: 12px;
  width: 148px;
  height: 148px;
  background-image: url("data/mini_game_art/skiing_princess_sheet_v2_square.png?v=2");
  background-size: 400% 400%;
  background-position: 0 0;
}
.snow-story-princess.ice-skating {
  background-image: url("data/mini_game_art/ice_skating_princess_sheet_5row.png?v=1");
  background-size: 400% 500%;
}
.snow-story-yeti {
  right: 12%;
  bottom: 4px;
  width: 190px;
  height: 210px;
  background-image: url("data/mini_game_art/snow_yeti_skier.png?v=1");
}
.snow-story-character.wiggle {
  animation: snow-story-wiggle 0.58s ease;
}
.snow-story-copy {
  min-height: 92px;
  padding: 10px 12px;
  border: 2px solid rgba(46, 122, 172, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.84);
  font:
    900 0.95rem "Trebuchet MS",
    Arial,
    sans-serif;
}
.snow-story-copy b {
  display: block;
  margin-bottom: 4px;
  color: #b23d82;
  font-size: 1.08rem;
}
.snow-story-copy p {
  margin: 3px 0;
}
.snow-story-finish {
  justify-self: center;
  min-height: 46px;
  padding: 0 18px;
  border: 3px solid rgba(46, 122, 172, 0.24);
  border-radius: 999px;
  background: linear-gradient(180deg, #fff, #ffd86b);
  color: #285c86;
  font:
    900 1rem "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  cursor: pointer;
}
@keyframes snow-story-wiggle {
  0%,
  100% {
    transform: rotate(0deg) translateY(0);
  }
  35% {
    transform: rotate(-7deg) translateY(-10px);
  }
  70% {
    transform: rotate(6deg) translateY(-4px);
  }
}
.snow-run-flake {
  position: absolute;
  z-index: 2;
  color: rgba(255, 255, 255, 0.92);
  font-size: 20px;
  text-shadow: 0 0 7px rgba(83, 174, 224, 0.5);
  animation: snow-fall 2.8s ease-in-out infinite alternate;
}
.snow-run-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9;
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0),
    rgba(245, 253, 255, 0.76)
  );
  pointer-events: none;
}
.snow-run-controls button {
  min-width: 76px;
  height: 44px;
  padding: 0 16px;
  border: 3px solid rgba(46, 122, 172, 0.36);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: #285c86;
  font:
    800 18px "Georgia",
    serif;
  cursor: pointer;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  box-shadow: 0 4px 0 rgba(46, 122, 172, 0.16);
}
.snow-run-controls button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(46, 122, 172, 0.16);
}
.snow-run-controls.ice-skate-controls {
  gap: 8px;
  background: none;
}
.snow-run-controls.ice-skate-controls button {
  min-width: 58px;
  padding: 0 12px;
}
.snow-run-controls.ice-skate-controls [data-snow-slow] {
  min-width: 92px;
}
@keyframes snow-crystal {
  from {
    transform: translateY(-5px) rotate(-7deg);
  }
  to {
    transform: translateY(5px) rotate(7deg);
  }
}
@keyframes snow-fall {
  from {
    transform: translateY(-8px);
    opacity: 0.55;
  }
  to {
    transform: translateY(14px);
    opacity: 1;
  }
}
@keyframes goal-ready {
  from {
    transform: scale(1);
    filter: brightness(1);
  }
  to {
    transform: scale(1.08);
    filter: brightness(1.16);
  }
}
.mini-game-board.sprout {
  display: block;
  min-height: clamp(410px, 58vh, 540px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0)),
    radial-gradient(
      circle at 20% 24%,
      rgba(255, 255, 255, 0.58),
      transparent 18%
    ),
    radial-gradient(
      circle at 78% 20%,
      rgba(255, 249, 170, 0.72),
      transparent 13%
    ),
    linear-gradient(180deg, #bff8ca 0%, #a8efc0 44%, #74d978 100%);
  overflow: hidden;
}
.mini-splash-hint {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 128px;
  color: #1f6e3b;
  font-size: 0.88rem;
  font-weight: 800;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
  z-index: 3;
}
.mini-pop-sprout,
.mini-paint-star {
  position: absolute;
  z-index: 2;
  cursor: pointer;
}
.mini-pop-sprout {
  width: 62px;
  height: 62px;
  margin-left: -31px;
  margin-top: -31px;
  border: 3px solid #237c42;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 24%, #fff, #88f28f 42%, #24a85a);
  color: #fff7b8;
  font-size: 34px;
  box-shadow: 0 10px 18px rgba(20, 96, 43, 0.28);
  animation: sprout-pop 0.24s ease both;
}
.mini-pop-sprout.rainbow {
  border-color: #ffd86b;
  background:
    radial-gradient(circle at 35% 24%, #fff 0 18%, transparent 19%),
    conic-gradient(#ff8ac0, #ffd86b, #7be0c8, #88d8f5, #c89bff, #ff8ac0);
  color: #fff;
  text-shadow: 0 2px 5px rgba(107, 34, 71, 0.32);
  box-shadow:
    0 10px 22px rgba(20, 96, 43, 0.22),
    0 0 24px rgba(255, 216, 107, 0.72);
}
.mini-pop-sprout.rainbow::before {
  content: "+2";
  position: absolute;
  right: -10px;
  top: -12px;
  width: 34px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(35, 124, 66, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #237c42;
  font:
    900 13px "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  box-shadow: 0 6px 10px rgba(20, 96, 43, 0.16);
}
.mini-pop-sprout::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -16px;
  width: 8px;
  height: 24px;
  border-radius: 999px;
  background: #237c42;
  transform: translateX(-50%);
  z-index: -1;
}
.mini-pop-sprout.watered {
  transform: scale(1.55);
  opacity: 0;
  transition:
    opacity 0.28s ease,
    transform 0.28s ease;
}
.mini-pop-sprout.watered.growing {
  opacity: 1;
  transform: none;
}
.mini-pop-sprout.missed {
  transform: scale(0.5);
  opacity: 0;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
}
@keyframes sprout-pop {
  from {
    transform: translateY(20px) scale(0.4);
  }
  to {
    transform: translateY(0) scale(1);
  }
}
@keyframes mint-flower-grow {
  0% {
    background-position: 0 0;
  }
  14% {
    background-position: 33.333% 0;
  }
  28% {
    background-position: 66.666% 0;
  }
  42% {
    background-position: 100% 0;
  }
  56% {
    background-position: 0 100%;
  }
  70% {
    background-position: 33.333% 100%;
  }
  84% {
    background-position: 66.666% 100%;
  }
  100% {
    background-position: 100% 100%;
  }
}
.mini-game-board.cupcake {
  display: block;
  min-height: clamp(410px, 58vh, 540px);
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.1),
      rgba(255, 235, 210, 0.32)
    ),
    url("data/mini_game_worlds/cupcake_kitchen_world.png") center / cover
      no-repeat;
  overflow: hidden;
}
.mini-cupcake-basket {
  position: absolute;
  left: 50%;
  bottom: 54px;
  width: 92px;
  height: 66px;
  margin-left: -46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  background: #fff;
  border: 4px solid #9d4f20;
  font-size: 46px;
  box-shadow: 0 8px 0 rgba(157, 79, 32, 0.22);
  z-index: 3;
  transition:
    filter 0.16s ease,
    transform 0.16s ease;
}
.mini-cupcake-basket.scooping {
  transform: translateY(-10px) scale(1.08);
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.95));
}
.mini-cupcake-basket.bumped {
  animation: cupcake-bump 0.16s ease 2;
}
.mini-cupcake-hint {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 126px;
  color: #7b351b;
  font-size: 0.86rem;
  font-weight: 800;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
  z-index: 2;
}
@keyframes cupcake-bump {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(8px) rotate(4deg);
  }
}
.mini-game-board.paint-stars {
  display: block;
  min-height: clamp(410px, 58vh, 540px);
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.1),
      rgba(224, 216, 255, 0.24)
    ),
    url("data/mini_game_worlds/moon_star_library.png") center / cover no-repeat;
  overflow: hidden;
}
.mini-game-board.paint-stars .mini-prop-paintbrush {
  left: 4%;
  top: 18%;
  opacity: 0.94;
  transform: rotate(-18deg);
}
.mini-library-window {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 28px;
  height: 118px;
  border: 5px solid rgba(80, 86, 158, 0.25);
  border-radius: 24px 24px 12px 12px;
  background:
    radial-gradient(circle at 18% 28%, #fff8b8 0 8px, transparent 9px),
    radial-gradient(circle at 64% 42%, #fff 0 5px, transparent 6px),
    linear-gradient(180deg, #778ee8, #c9edff);
  box-shadow: inset 0 -16px 0 rgba(255, 255, 255, 0.26);
}
.mini-library-window span {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
  background: rgba(255, 255, 255, 0.72);
}
.mini-library-window span:nth-child(1) {
  left: 33%;
}
.mini-library-window span:nth-child(2) {
  left: 66%;
}
.mini-library-window span:nth-child(3) {
  left: 50%;
  top: 50%;
  width: auto;
  right: 0;
  height: 4px;
}
.mini-library-moon {
  position: absolute;
  right: 16%;
  top: 38px;
  color: #fff7a8;
  font-size: 52px;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.9);
}
.mini-library-shelf {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 20px;
  height: 78px;
  border-radius: 20px;
  background: repeating-linear-gradient(
    90deg,
    #6fa3ff 0 20px,
    #ff82b8 20px 38px,
    #ffd96d 38px 58px,
    #9ee6c4 58px 76px
  );
  border: 4px solid rgba(82, 65, 135, 0.18);
  box-shadow: inset 0 12px 0 rgba(255, 255, 255, 0.25);
}
.mini-paint-hint {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 110px;
  color: #4c3b8e;
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
  z-index: 2;
}
.mini-paint-star {
  position: absolute;
  width: 64px;
  height: 64px;
  margin-left: -32px;
  margin-top: -32px;
  display: grid;
  place-items: center;
  border: 3px dashed rgba(107, 34, 71, 0.42);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  color: #a56a8a;
  font-size: 40px;
  line-height: 1;
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", Arial, sans-serif;
  cursor: pointer;
  z-index: 3;
  box-shadow: 0 10px 22px rgba(87, 65, 147, 0.18);
  transition:
    transform 0.18s ease,
    opacity 0.18s ease,
    background 0.18s ease;
}
.mini-paint-star.painted {
  border-style: solid;
  color: #fff;
  text-shadow: 0 2px 5px rgba(80, 30, 70, 0.24);
  transform: rotate(8deg) scale(1.06);
}
.mini-paint-star.nearby::after,
.mini-paint-star.painted::after {
  position: absolute;
  left: 50%;
  bottom: -16px;
  transform: translateX(-50%);
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #7a2a60;
  font:
    900 11px "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  line-height: 1;
  box-shadow: 0 5px 10px rgba(87, 65, 147, 0.14);
}
.mini-paint-star.nearby::after {
  content: "paint";
}
.mini-paint-star.painted::after {
  content: attr(data-count);
}
.mini-paint-star.comet {
  border-style: solid;
  border-color: rgba(255, 216, 107, 0.8);
  background: radial-gradient(circle at 34% 28%, #fff, #ffe78f 48%, #c89bff);
  color: #8a2f64;
  box-shadow:
    0 10px 22px rgba(87, 65, 147, 0.18),
    0 0 24px rgba(255, 216, 107, 0.68);
}
.mini-game-board.paint-stars.constellation-glow .mini-library-window {
  filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.9))
    drop-shadow(0 0 20px rgba(255, 216, 107, 0.54));
}
.mini-paint-star.pink {
  background: #ff75b6;
}
.mini-paint-star.gold {
  background: #ffd86b;
}
.mini-paint-star.blue {
  background: #72cfff;
}
.mini-paint-star.mint {
  background: #7be0a0;
}
.mini-paint-star.grape {
  background: #b57cff;
}
.mini-pad.lit,
.mini-choice:hover,
.mini-dance:hover {
  background: linear-gradient(180deg, #fff6c9 0%, #ffd86b 100%);
  border-color: #ffb400;
}
.mini-dance {
  font-size: 42px;
}
.mini-floating-token,
.mini-bubble {
  position: absolute;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.78);
  background: radial-gradient(circle at 34% 28%, #fff, #ff6f9f 52%, #b03579);
  color: #fff;
  font-size: 34px;
  font-weight: 700;
  cursor: pointer;
  box-shadow:
    0 12px 26px rgba(176, 53, 121, 0.34),
    inset 0 0 18px rgba(255, 255, 255, 0.56);
  animation: mini-float 1.8s ease-in-out infinite alternate;
}
.mini-floating-token:nth-child(2n),
.mini-bubble:nth-child(2n) {
  animation-delay: -0.8s;
}
.mini-floating-token.caught,
.mini-bubble.popped {
  transform: scale(1.8);
  opacity: 0;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}
.mini-bubble {
  background: radial-gradient(circle at 28% 25%, #fff, #bff7ff 48%, #6ab3ff);
  color: #4f2a6f;
}
@keyframes mini-float {
  from {
    translate: 0 -8px;
  }
  to {
    translate: 0 10px;
  }
}

/* Image Gen world maps: each room challenge should feel like a place. */
.mini-game-board.royal-run.theme-strawberry .royal-run-bg {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.08),
      rgba(255, 210, 224, 0.18)
    ),
    url("data/mini_game_worlds/ruby_rescue_courtyard.png") center / cover
      no-repeat;
}
.mini-game-board.royal-run.theme-grape .royal-run-bg {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.08),
      rgba(220, 200, 255, 0.2)
    ),
    url("data/mini_game_worlds/ribbon_cloud_world.png") center / cover no-repeat;
}
.mini-game-board.royal-run.theme-bubblegum .royal-run-bg {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 214, 236, 0.2)),
    url("data/mini_game_worlds/bubble_bounce_room.png") center / cover no-repeat;
}
.mini-game-board.royal-run.theme-rainbow .royal-run-bg {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.08),
      rgba(220, 245, 255, 0.2)
    ),
    url("data/mini_game_worlds/unicorn_rainbow_meadow.png") center / cover
      no-repeat;
}
.mini-game-board.royal-run.theme-blueberry .royal-run-bg {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.08),
      rgba(220, 245, 255, 0.22)
    ),
    url("data/mini_game_worlds/moon_star_library.png") center / cover no-repeat;
}
.snow-run-sky {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.1),
      rgba(210, 245, 255, 0.18)
    ),
    url("data/mini_game_worlds/snowflake_ski_course_strip_v11_generated_fullcourse.png")
      center top / 100% 100% no-repeat;
  background-repeat: no-repeat, no-repeat;
  background-position:
    center top,
    center top;
  background-size:
    100% 100%,
    100% 100%;
}
.mini-game-board.ice-skate-run .snow-run-sky {
  background:
    linear-gradient(
      180deg,
      rgba(247, 253, 255, 0.06),
      rgba(197, 238, 255, 0.08)
    ),
    url("data/mini_game_worlds/crystal_ice_oval_rink.png") center top / 100%
      100% no-repeat;
}
.ice-rink-image-props {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.ice-rink-image-prop {
  position: absolute;
  width: 176px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 12px rgba(32, 96, 145, 0.18));
}
.ice-rink-image-prop.trophy-stand {
  left: 58px;
  bottom: 342px;
  width: 142px;
  transform: rotate(-5deg);
  opacity: 0.92;
}
.ice-rink-image-prop.medal-corner {
  right: 82px;
  bottom: 228px;
  width: 148px;
  transform: rotate(5deg) scaleX(-1);
  opacity: 0.92;
}
.ice-trophy-finale {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 18;
  display: grid;
  justify-items: center;
  gap: 2px;
  width: min(320px, calc(100% - 36px));
  padding: 10px 14px 14px;
  transform: translate(-50%, -52%);
  pointer-events: none;
  color: #6b2247;
  text-align: center;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.94);
  animation: ice-trophy-finale-pop 1.55s ease both;
}
.ice-trophy-finale::before {
  content: "";
  position: absolute;
  inset: 18% 4% 5%;
  z-index: -1;
  border-radius: 999px;
  background:
    radial-gradient(
      circle at 50% 24%,
      rgba(255, 255, 255, 0.82),
      transparent 34%
    ),
    radial-gradient(circle, rgba(107, 205, 255, 0.26), transparent 72%);
  filter: blur(2px);
}
.ice-trophy-finale img {
  width: min(240px, 76%);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 16px rgba(50, 105, 150, 0.22));
}
.ice-trophy-finale strong {
  font:
    900 30px/1 "Georgia",
    serif;
}
.ice-trophy-finale span {
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  font:
    800 15px/1.1 "Nunito",
    sans-serif;
  color: #24709b;
}
@keyframes ice-trophy-finale-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -44%) scale(0.72) rotate(-4deg);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -53%) scale(1.08) rotate(2deg);
  }
  54% {
    transform: translate(-50%, -52%) scale(1) rotate(0);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -55%) scale(1.02) rotate(0);
  }
}
.mini-game-board.ice-skate-run .snow-run-track {
  opacity: 0.12;
}
.mini-game-board.ice-skate-run .snow-run-princess::after {
  background: rgba(64, 173, 220, 0.2);
  box-shadow: 0 0 14px rgba(103, 208, 255, 0.3);
}
.royal-run-bg,
.snow-run-sky {
  image-rendering: auto;
}

@media (max-width: 640px) {
  .hud {
    max-width: calc(100vw - 48px);
    padding: 8px 10px;
    font-size: 12px;
  }
  .hud h1 {
    font-size: 14px;
  }
  .hud-controls {
    display: none;
  }
  .portrait-gallery {
    grid-template-columns: repeat(6, 30px);
  }
  .helper-quest {
    padding: 7px;
  }
  .helper-quest-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .helper-step {
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 4px;
    padding: 4px;
  }
  .helper-step-icon {
    width: 18px;
    height: 18px;
    font-size: 11px;
  }
  .helper-step-copy strong {
    font-size: 10px;
  }
  .helper-step-copy small {
    display: none;
  }
  .game-center-card {
    width: calc(100vw - 14px);
    padding: 16px;
  }
  .game-center.bookshelf-mode {
    padding: 7px;
  }
  .game-center.bookshelf-mode .game-center-card {
    min-height: calc(100dvh - 14px);
    padding: 10px;
  }
  .game-center.bookshelf-mode .game-center-tabs {
    width: calc(100% - 50px);
  }
  .game-center.bookshelf-mode .game-center-tabs button {
    min-width: calc(50% - 3px);
  }
  .game-center-card h2 {
    font-size: 30px;
  }
  .game-center-tabs {
    gap: 6px;
  }
  .game-center-tabs button {
    min-width: calc(50% - 3px);
    min-height: 38px;
  }
  .game-center-list {
    grid-template-columns: 1fr;
  }
  .journal-list {
    grid-template-columns: 1fr;
  }
  .journal-card {
    min-height: 62px;
    padding: 9px;
  }
  .journal-card h3 {
    font-size: 14px;
  }
  .journal-card p {
    font-size: 16px;
  }
  .journal-recent-row.has-action {
    grid-template-columns: 24px minmax(0, 1fr) auto;
  }
  .journal-recent-row.has-action button {
    grid-column: 2 / -1;
    justify-self: start;
  }
  .journal-recent-row strong {
    white-space: normal;
  }
  .adventure-pass {
    padding: 10px;
  }
  .adventure-surprise {
    grid-template-columns: minmax(0, 1fr) 62px;
    gap: 8px;
    padding: 10px;
  }
  .adventure-surprise h3 {
    font-size: 17px;
  }
  .adventure-surprise p {
    font-size: 12px;
  }
  .adventure-surprise button {
    min-width: 60px;
    min-height: 34px;
  }
  .adventure-pass-top {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 8px;
  }
  .adventure-pass-icon {
    width: 42px;
    height: 42px;
    font-size: 22px;
  }
  .adventure-pass-copy h3 {
    font-size: 17px;
  }
  .adventure-pass-copy p {
    font-size: 12px;
  }
  .adventure-pass-step {
    grid-template-columns: 22px minmax(0, 1fr) 62px;
    gap: 6px;
    padding: 7px;
  }
  .adventure-pass-check {
    width: 20px;
    height: 20px;
    font-size: 12px;
  }
  .adventure-pass-step-copy strong {
    font-size: 12px;
  }
  .adventure-pass-step-copy small {
    font-size: 11px;
  }
  .adventure-pass-step button {
    min-width: 60px;
    min-height: 32px;
    font-size: 12px;
  }
  .game-center-item {
    grid-template-columns: 46px minmax(0, 1fr) 88px;
    min-height: 68px;
    padding: 8px;
  }
  .game-center-icon {
    width: 42px;
    height: 42px;
    font-size: 22px;
  }
  .game-center-copy h3 {
    font-size: 15px;
  }
  .game-center-item button {
    min-width: 82px;
    padding: 0 8px;
    font-size: 12px;
    white-space: normal;
    line-height: 1.05;
  }
  .station-hint {
    width: max-content;
    max-width: calc(100vw - 42px);
    font-size: 13px;
    text-align: center;
  }
  .clue-card {
    width: calc(100vw - 18px);
    padding: 18px;
  }
  .clue-title {
    margin-right: 44px;
  }
  .clue-choices {
    grid-template-columns: 1fr;
  }
  .clue-choice {
    min-height: 52px;
  }
  .mini-game-card {
    padding: 14px 10px 16px;
    min-height: 100dvh;
    max-height: 100dvh;
  }
  .mini-game-title {
    margin-right: 0;
    font-size: 30px;
  }
  .mini-game-prompt,
  .mini-game-progress,
  .mini-game-feedback {
    font-size: 16px;
  }
  .mini-game-board {
    min-height: 340px;
    padding: 12px;
  }
  .mini-game-board::after {
    top: auto;
    right: 10px;
    bottom: 58px;
    max-width: 190px;
    font-size: 11px;
  }
  .mini-game-board.royal-run,
  .mini-game-board.unicorn-trail,
  .mini-game-board.ribbon-dance,
  .mini-game-board.ruby-maze {
    min-height: clamp(280px, 48dvh, 398px);
  }
  .mini-game-board.snow-run {
    min-height: clamp(460px, 62dvh, 560px);
  }
  .ice-rink-image-prop.trophy-stand {
    left: 28px;
    bottom: 300px;
    width: 88px;
  }
  .ice-rink-image-prop.medal-corner {
    right: 44px;
    bottom: 210px;
    width: 96px;
  }
  .ice-trophy-finale {
    width: min(260px, calc(100% - 28px));
    transform: translate(-50%, -56%);
  }
  .ice-trophy-finale img {
    width: min(190px, 72%);
  }
  .ice-trophy-finale strong {
    font-size: 24px;
  }
  .unicorn-runner {
    width: 104px;
    height: 104px;
  }
  .unicorn-goal {
    top: 10px;
    left: 10px;
    max-width: 230px;
    font-size: 12px;
  }
  .unicorn-kindness-card {
    left: 190px;
    top: 92px;
    width: 190px;
    padding: 8px 10px;
  }
  .unicorn-kindness-card span {
    font-size: 14px;
  }
  .ribbon-dance-card {
    left: 160px;
    top: 86px;
    width: 220px;
    padding: 8px 10px;
  }
  .ribbon-dance-card span {
    font-size: 14px;
  }
  .ribbon-dance-step {
    width: 58px;
    height: 58px;
  }
  .ribbon-dance-step strong {
    font-size: 25px;
  }
  .ribbon-dance-step em {
    top: 54px;
    min-width: 58px;
    font-size: 11px;
  }
  .moon-pattern-card {
    left: 190px;
    top: 82px;
    width: 210px;
    padding: 8px 10px;
  }
  .moon-pattern-card span {
    gap: 4px;
  }
  .moon-pattern-card i {
    padding: 4px;
    font-size: 10px;
  }
  .plant-story-card {
    left: 210px;
    top: 84px;
    width: 240px;
    padding: 8px 10px;
  }
  .plant-story-card span {
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
  }
  .plant-story-card i {
    padding: 4px;
    font-size: 10px;
  }
  .unicorn-wish {
    width: 46px;
    height: 46px;
    font-size: 23px;
  }
  .unicorn-wish em {
    top: 42px;
    min-width: 58px;
    font-size: 11px;
    padding: 2px 6px;
  }
  .unicorn-controls button {
    min-width: 54px;
    height: 40px;
    padding: 0 8px;
    font-size: 13px;
  }
  .adventure-goal {
    top: 10px;
    left: 10px;
    max-width: 230px;
    font-size: 12px;
  }
  .ruby-maze-goal {
    top: 10px;
    left: 10px;
    max-width: 210px;
    font-size: 11px;
  }
  .ruby-maze-clue-board {
    top: 48px;
    left: 10px;
    right: auto;
    width: min(270px, calc(100% - 20px));
    padding: 7px;
    gap: 4px;
    font-size: 10px;
  }
  .ruby-maze-clue-board span {
    min-height: 23px;
    grid-template-columns: 26px 1fr;
    gap: 5px;
  }
  .ruby-maze-clue-board b {
    width: 22px;
    height: 22px;
  }
  .snow-run-lesson-card {
    left: 210px;
    top: 62px;
    width: 260px;
    padding: 7px;
    gap: 4px;
  }
  .mini-game-board.ice-skate-run .snow-run-lesson-card {
    display: none;
  }
  .snow-run-lesson-card span {
    min-height: 24px;
    grid-template-columns: 24px 1fr;
    font-size: 10px;
  }
  .snow-run-lesson-card i {
    width: 20px;
    height: 20px;
  }
  .mini-choice,
  .mini-pad,
  .mini-dance,
  .mini-sprout,
  .mini-swatch {
    min-width: 0;
    width: 100%;
    font-size: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
  .dust-toast {
    animation: none;
    opacity: 1;
  }
}

/* ---------- Immersive adventure pages ---------- */
body.mini-game-page-open .mini-game-modal.open {
  display: block;
  background: #fff7df;
}
body.mini-game-page-open .mini-game-backdrop,
body.mini-game-page-open .mini-game-card::before {
  display: none;
}
body.mini-game-page-open .mini-game-card {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  max-height: 100dvh;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body.mini-game-page-open .mini-game-close {
  position: fixed;
  left: max(14px, env(safe-area-inset-left));
  top: max(12px, env(safe-area-inset-top));
  z-index: 280;
  margin: 0;
}
body.mini-game-page-open .mini-game-kicker,
body.mini-game-page-open .mini-game-title,
body.mini-game-page-open .mini-game-prompt,
body.mini-game-page-open .mini-game-brain,
body.mini-game-page-open .mini-game-progress {
  position: fixed;
  z-index: 270;
  left: max(14px, env(safe-area-inset-left));
  max-width: min(520px, calc(100vw - 28px));
  margin: 0;
  padding: 0;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.82);
}
body.mini-game-page-open .mini-game-kicker {
  top: calc(max(12px, env(safe-area-inset-top)) + 54px);
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: #8a2457;
  letter-spacing: 0.12em;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
body.mini-game-page-open .mini-game-title {
  top: calc(max(12px, env(safe-area-inset-top)) + 90px);
  width: fit-content;
  padding: 7px 12px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: #9b2d6a;
  font-size: clamp(24px, 3.4vw, 38px);
  line-height: 1;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
body.mini-game-page-open .mini-game-prompt {
  top: calc(max(12px, env(safe-area-inset-top)) + 140px);
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #5b2142;
  font-size: clamp(13px, 1.6vw, 16px);
  line-height: 1.2;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
body.mini-game-page-open .mini-game-brain {
  top: calc(max(12px, env(safe-area-inset-top)) + 190px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  max-width: min(560px, calc(100vw - 28px));
  padding: 8px 11px;
  border-width: 2px;
  border-color: rgba(123, 224, 200, 0.7);
  background: rgba(232, 255, 247, 0.76);
  font-size: clamp(12px, 1.3vw, 14px);
  line-height: 1.2;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  pointer-events: none;
}
body.mini-game-page-open .mini-game-brain strong {
  padding: 5px 8px;
  font-size: 10px;
}
body.mini-game-page-open .mini-game-brain em {
  font-size: 11px;
}
body.mini-game-page-open .mini-game-progress {
  right: max(14px, env(safe-area-inset-right));
  left: auto;
  top: max(14px, env(safe-area-inset-top));
  max-width: min(360px, calc(100vw - 148px));
  min-height: 0;
  padding: 9px 13px;
  border: 2px solid rgba(107, 34, 71, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #5b2142;
  font-size: clamp(13px, 1.4vw, 16px);
  line-height: 1.15;
  text-align: right;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
body.mini-game-page-open .mini-game-feedback {
  position: fixed;
  z-index: 275;
  left: max(14px, env(safe-area-inset-left));
  bottom: calc(max(82px, env(safe-area-inset-bottom)) + 8px);
  max-width: min(520px, calc(100vw - 28px));
  min-height: 0;
  margin: 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  font-size: clamp(13px, 1.5vw, 16px);
  line-height: 1.2;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  pointer-events: none;
}
body.ice-skate-page-open .mini-game-feedback {
  display: none;
}
@media (max-width: 520px) {
  body.mini-game-page-open .mini-game-kicker,
  body.mini-game-page-open .mini-game-prompt,
  body.mini-game-page-open .mini-game-brain em {
    display: none;
  }
  body.mini-game-page-open .mini-game-brain {
    top: calc(max(12px, env(safe-area-inset-top)) + 152px);
    max-width: calc(100vw - 28px);
    grid-template-columns: 1fr;
  }
  body.mini-game-page-open .mini-game-title {
    top: calc(max(12px, env(safe-area-inset-top)) + 106px);
    max-width: calc(100vw - 28px);
    font-size: 26px;
  }
  body.mini-game-page-open .mini-game-progress {
    top: calc(max(12px, env(safe-area-inset-top)) + 52px);
    max-width: calc(100vw - 28px);
  }
}
body.mini-game-page-open .mini-game-board {
  position: fixed;
  inset: 0;
  z-index: 245;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  min-height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
body.mini-game-page-open .mini-game-board::after {
  top: auto;
  right: max(14px, env(safe-area-inset-right));
  bottom: calc(max(76px, env(safe-area-inset-bottom)) + 8px);
  max-width: min(260px, calc(100vw - 28px));
}
body.mini-game-page-open .adventure-goal {
  left: max(150px, env(safe-area-inset-left));
  max-width: calc(100vw - 170px);
}
body.mini-game-page-open .mini-game-board.royal-run,
body.mini-game-page-open .mini-game-board.snow-run,
body.mini-game-page-open .mini-game-board.tower-heist,
body.mini-game-page-open .mini-game-board.tower-climb,
body.mini-game-page-open .mini-game-board.unicorn-trail,
body.mini-game-page-open .mini-game-board.ribbon-dance,
body.mini-game-page-open .mini-game-board.paint-stars,
body.mini-game-page-open .mini-game-board.sprout,
body.mini-game-page-open .mini-game-board.cupcake-map,
body.mini-game-page-open .mini-game-board.chase,
body.mini-game-page-open .mini-game-board.catch,
body.mini-game-page-open .mini-game-board.memory,
body.mini-game-page-open .mini-game-board.dance,
body.mini-game-page-open .mini-game-board.pop,
body.mini-game-page-open .mini-game-board.ruby-maze,
body.mini-game-page-open .mini-game-board.butterfly-net {
  min-height: 100dvh;
}
body.mini-game-page-open .royal-run-world,
body.mini-game-page-open .snow-run-world,
body.mini-game-page-open .tower-heist-viewport,
body.mini-game-page-open .tower-climb-viewport,
body.mini-game-page-open .unicorn-world,
body.mini-game-page-open .ribbon-dance-world,
body.mini-game-page-open .mini-map-viewport,
body.mini-game-page-open .ruby-maze-world,
body.mini-game-page-open .butterfly-meadow {
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
}
body.mini-game-page-open .mini-map-layer,
body.mini-game-page-open .unicorn-map-layer,
body.mini-game-page-open .ribbon-dance-layer,
body.mini-game-page-open .royal-run-world,
body.mini-game-page-open .snow-run-world,
body.mini-game-page-open .tower-heist-map,
body.mini-game-page-open .tower-climb-map {
  min-width: 100vw;
  min-height: 100dvh;
}
body.mini-game-page-open .mini-chase-sky,
body.mini-game-page-open .mini-scene-backdrop {
  inset: 0;
  width: 100%;
  height: 100%;
}
body.mini-game-page-open .mini-game-board.chase,
body.mini-game-page-open .mini-game-board.catch,
body.mini-game-page-open .mini-game-board.memory,
body.mini-game-page-open .mini-game-board.dance,
body.mini-game-page-open .mini-game-board.pop {
  padding: clamp(96px, 18dvh, 138px) clamp(14px, 4vw, 42px)
    clamp(82px, 14dvh, 118px);
  background-size: cover;
}
@media (max-width: 720px) {
  body.mini-game-page-open .mini-game-kicker {
    display: none;
  }
  body.mini-game-page-open .mini-game-title {
    top: calc(max(12px, env(safe-area-inset-top)) + 106px);
    font-size: 24px;
  }
  body.mini-game-page-open .mini-game-prompt {
    display: none;
  }
  body.ice-skate-page-open .mini-game-kicker {
    display: none;
  }
  body.ice-skate-page-open .mini-game-title {
    top: calc(max(12px, env(safe-area-inset-top)) + 104px);
  }
  body.mini-game-page-open .mini-game-progress {
    top: calc(max(12px, env(safe-area-inset-top)) + 52px);
    max-width: calc(100vw - 28px);
    text-align: left;
  }
  body.mini-game-page-open .mini-game-feedback {
    bottom: calc(max(72px, env(safe-area-inset-bottom)) + 4px);
  }
}
