:root {
  color-scheme: light;
  --ink: #26322f;
  --paper: #fff6df;
  --paper-deep: #f4dfab;
  --forest: #265b49;
  --blue: #2f80ed;
  --gold: #f2b84b;
  --red: #d95045;
  --shadow: rgba(42, 33, 20, 0.2);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background:
    linear-gradient(180deg, rgba(5, 12, 22, 0.14), rgba(5, 12, 22, 0.38)),
    url("./assets/images/web game bg.png") center / cover fixed no-repeat,
    #07111c;
  color: var(--ink);
  font-family: ui-rounded, "Trebuchet MS", Arial, sans-serif;
}

button {
  font: inherit;
}

.game-shell {
  min-height: 100svh;
  display: grid;
  place-items: stretch center;
  padding: clamp(0.35rem, 1.6vw, 0.8rem);
}

.game-root {
  width: min(100%, 520px);
  min-height: calc(100svh - clamp(0.7rem, 3.2vw, 1.6rem));
  margin: 0 auto;
  display: grid;
}

.intro-screen,
.video-screen,
.sparkle-screen,
.quest-screen,
.feedback-screen,
.complete-screen {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: center;
  gap: clamp(1rem, 3vw, 1.6rem);
  width: 100%;
  min-height: 100%;
  padding: clamp(1.1rem, 4vw, 2.4rem);
  border: 1px solid rgba(255, 218, 150, 0.34);
  border-radius: 24px;
  background:
    radial-gradient(circle at 22% 12%, rgba(255, 220, 158, 0.2), transparent 40%),
    linear-gradient(180deg, rgba(88, 63, 35, 0.22), rgba(31, 22, 15, 0.2));
  box-shadow:
    inset 0 1px 0 rgba(255, 229, 184, 0.22),
    0 22px 60px rgba(2, 8, 18, 0.5);
  backdrop-filter: blur(10px) saturate(1.05);
  -webkit-backdrop-filter: blur(10px) saturate(1.05);
}

.intro-screen,
.video-screen,
.feedback-screen,
.complete-screen {
  text-align: center;
  justify-items: center;
}

.question-enter {
  animation: question-enter-zoom 700ms ease-in-out both;
}

.intro-screen {
  align-content: start;
  gap: clamp(0.25rem, 0.9svh, 0.65rem);
  padding: clamp(0.45rem, 1.8vw, 0.85rem);
  justify-items: center;
  text-align: center;
  padding-top: clamp(2.3rem, 3svh, 2rem);
}

.intro-header {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 0.05rem;
  margin-top: 0;
  opacity: 0;
  animation: intro-fade-up 1400ms cubic-bezier(0.16, 1, 0.3, 1) 180ms both;
}

.intro-title {
  width: 100%;
  max-width: 100%;
  color: #fff5df;
  font-family: "Pirata One", Georgia, "Times New Roman", serif;
  font-size: clamp(2.65rem, 12.2vw, 5.7rem);
  font-weight: 400;
  line-height: 0.82;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
  text-shadow:
    0 2px 0 rgba(84, 58, 35, 0.86),
    0 0 18px rgba(255, 242, 200, 0.28),
    0 10px 28px rgba(0, 0, 0, 0.72);
}

.intro-brand {
  width: 100%;
  color: #f8d77c;
  font-size: clamp(0.78rem, 3vw, 1.15rem);
  font-weight: 950;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.72);
}

.intro-shield {
  justify-self: center;
  display: block;
  width: min(92vw, 25rem);
  max-width: 100%;
  max-height: 34svh;
  margin: clamp(0.7rem, 1.6svh, 1.1rem) auto clamp(0.85rem, 1.8svh, 1.25rem);
  object-fit: contain;
  object-position: center;
  transform: scale(1.58);
  transform-origin: center;
  filter:
    drop-shadow(0 0 18px rgba(121, 214, 255, 0.44))
    drop-shadow(0 16px 24px rgba(0, 0, 0, 0.44));
  opacity: 0;
  animation: intro-shield-zoom 2450ms cubic-bezier(0.18, 1.08, 0.24, 1) 650ms both;
}

.intro-instructions {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: clamp(0.2rem, 0.8svh, 0.65rem);
}

.intro-instruction {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 0.06rem;
  opacity: 0;
  transform-origin: center;
  animation: intro-soft-zoom 1500ms cubic-bezier(0.18, 1.16, 0.3, 1) both;
}

.intro-instruction:nth-child(1) {
  animation-delay: 1800ms;
}

.intro-instruction:nth-child(2) {
  animation-delay: 2400ms;
}

.instruction-en,
.instruction-ja {
  max-width: 100%;
  color: #fffaf0;
  font-family: "Chewy", ui-rounded, "Trebuchet MS", Arial, sans-serif;
  line-height: 1;
  letter-spacing: 0;
  text-shadow:
    0 2px 0 rgba(55, 37, 23, 0.95),
    0 8px 20px rgba(0, 0, 0, 0.72);
}

.instruction-en {
  font-size: clamp(1.75rem, 7.1vw, 3rem);
}

.instruction-ja {
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  font-size: clamp(1.32rem, 5.8vw, 2.25rem);
  font-weight: 950;
}

.intro-icon {
  display: block;
  width: min(36vw, 8rem);
  height: clamp(3.1rem, 14vw, 5rem);
  margin-inline: auto;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.62));
}

.volume-icon {
  width: min(40vw, 9rem);
  margin: 0 auto;
}

.tap-icon {
  width: min(34vw, 7.4rem);
  margin: 0 auto;
}

.intro-actions {
  margin-top: clamp(-0.1rem, -0.2svh, 0rem);
}

.hero-mark {
  width: 5.5rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(from 20deg, var(--gold), #fff0aa, #78b883, #7eb7f0, var(--gold));
  color: #ffffff;
  font-size: 3rem;
  font-weight: 900;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

.kicker,
.question-count,
.merlin-name {
  margin: 0;
  color: #f4d58a;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
p {
  margin: 0;
}

h1 {
  max-width: 13ch;
  color: #fff6df;
  font-size: clamp(2.3rem, 12vw, 5.2rem);
  line-height: 0.96;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
}

.quest-screen h1 {
  max-width: 18ch;
  font-size: clamp(1.25rem, 5vw, 2.2rem);
  line-height: 1.05;
}

.intro-text,
.complete-screen > p,
.feedback-screen > p {
  max-width: 42rem;
  color: rgba(255, 246, 223, 0.92);
  font-size: clamp(1rem, 3vw, 1.25rem);
  line-height: 1.45;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}

.intro-actions,
.code-panel {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.dev-note {
  max-width: 38rem;
  color: rgba(255, 246, 223, 0.76);
  font-size: 0.82rem;
  font-weight: 800;
}

.primary-action,
.secondary-action,
.icon-text-button {
  min-height: 3.25rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 900;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-action {
  padding: 0.95rem 1.45rem;
  background: var(--forest);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(38, 91, 73, 0.26);
}

.intro-play {
  min-height: 3.65rem;
  padding: 0.68rem 1.65rem 0.78rem;
  background: linear-gradient(180deg, #7587ff, #5870f4);
  color: #ffffff;
  font-family: "Chewy", ui-rounded, "Trebuchet MS", Arial, sans-serif;
  font-size: clamp(1.75rem, 6.6vw, 2.55rem);
  letter-spacing: 0.03em;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(47, 55, 151, 0.62);
  box-shadow: 0 12px 26px rgba(55, 71, 210, 0.34);
  opacity: 0;
  transform-origin: center;
  animation:
    intro-play-pop 1200ms cubic-bezier(0.18, 1.35, 0.3, 1) 3100ms both,
    intro-play-pulse 1700ms ease-in-out 4300ms infinite;
}

.video-screen {
  align-content: stretch;
  justify-items: stretch;
  padding: clamp(0.6rem, 2vw, 1rem);
}

.story-video {
  width: 100%;
  height: 100%;
  min-height: calc(100svh - clamp(2rem, 7vw, 3.5rem));
  border-radius: 18px;
  object-fit: cover;
  background: rgba(5, 12, 22, 0.7);
  box-shadow: inset 0 0 0 1px rgba(255, 218, 150, 0.2);
}

.video-actions {
  position: absolute;
  left: 50%;
  bottom: clamp(1.2rem, 5svh, 3rem);
  display: grid;
  place-items: center;
  transform: translateX(-50%);
  z-index: 2;
}

.outro-actions {
  width: min(92%, 28rem);
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.video-skip {
  position: absolute;
  top: clamp(0.85rem, 3vw, 1.2rem);
  left: clamp(0.85rem, 3vw, 1.2rem);
  z-index: 3;
  min-height: 2.35rem;
  padding: 0.42rem 0.82rem;
  border: 1px solid rgba(255, 246, 223, 0.74);
  border-radius: 999px;
  background: rgba(8, 8, 10, 0.24);
  color: #fff6df;
  font-weight: 950;
  cursor: pointer;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.video-yes {
  min-width: min(60vw, 12rem);
  min-height: 4rem;
  padding-inline: 2rem;
  border: 2px solid rgba(255, 246, 223, 0.92);
  background: rgba(12, 10, 8, 0.12);
  color: #fff6df;
  font-family: "Chewy", ui-rounded, "Trebuchet MS", Arial, sans-serif;
  font-size: clamp(1.7rem, 7vw, 2.6rem);
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 14px 30px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: intro-play-pop 560ms cubic-bezier(0.18, 1.45, 0.3, 1) both;
}

.video-book,
.video-rank {
  position: relative;
  min-width: min(42vw, 12rem);
  min-height: 4rem;
  padding-inline: 1.25rem;
  color: #fff6df;
  font-family: "Chewy", ui-rounded, "Trebuchet MS", Arial, sans-serif;
  font-size: clamp(1.25rem, 5vw, 2.1rem);
  line-height: 1;
  overflow: hidden;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 14px 30px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation:
    intro-play-pop 560ms cubic-bezier(0.18, 1.45, 0.3, 1) 80ms both,
    outro-button-pulse 1700ms ease-in-out 900ms infinite;
}

.video-book {
  border: 2px solid rgba(255, 244, 169, 0.95);
  background: linear-gradient(180deg, #ffd86a, #d89419 58%, #8f5a08);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.34),
    0 0 22px rgba(255, 204, 76, 0.46),
    0 16px 32px rgba(0, 0, 0, 0.34);
}

.video-rank {
  border: 2px solid rgba(188, 236, 255, 0.95);
  background: linear-gradient(180deg, #68d6ff, #277fe6 58%, #1845a9);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.34),
    0 0 22px rgba(76, 184, 255, 0.46),
    0 16px 32px rgba(0, 0, 0, 0.34);
}

.video-book::before,
.video-rank::before,
.video-book::after,
.video-rank::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.video-book::before,
.video-rank::before {
  inset: -40% -65%;
  background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, 0.58) 48%, transparent 61%);
  animation: button-shimmer 2100ms ease-in-out infinite;
}

.video-book::after,
.video-rank::after {
  width: 0.5rem;
  height: 0.5rem;
  right: 16%;
  top: 20%;
  border-radius: 50%;
  background: #ffffff;
  box-shadow:
    -2.4rem 1.8rem 0 rgba(255, 255, 255, 0.72),
    1.7rem 2rem 0 rgba(255, 255, 255, 0.62),
    -0.7rem -1rem 0 rgba(255, 255, 255, 0.82);
  animation: button-sparkles 1500ms ease-in-out infinite;
}

.outro-actions .video-yes {
  min-width: 0;
  font-size: clamp(1.2rem, 4.8vw, 2rem);
}

.outro-actions .video-book {
  min-width: 0;
  font-size: clamp(1.2rem, 4.8vw, 2rem);
}

@keyframes intro-fade-up {
  0% {
    opacity: 0;
    transform: translateY(0.9rem) scale(0.9);
  }
  68% {
    opacity: 1;
    transform: translateY(-0.12rem) scale(1.05);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes intro-shield-zoom {
  0% {
    opacity: 0;
    transform: scale(0.72);
  }
  42% {
    opacity: 1;
    transform: scale(1.82);
  }
  58% {
    opacity: 1;
    transform: scale(1.47);
  }
  73% {
    opacity: 1;
    transform: scale(1.68);
  }
  86% {
    opacity: 1;
    transform: scale(1.53);
  }
  100% {
    opacity: 1;
    transform: scale(1.58);
  }
}

@keyframes intro-soft-zoom {
  0% {
    opacity: 0;
    transform: translateY(0.55rem) scale(0.62);
  }
  62% {
    opacity: 1;
    transform: translateY(-0.08rem) scale(1.12);
  }
  82% {
    opacity: 1;
    transform: translateY(0.02rem) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes intro-play-pop {
  0% {
    opacity: 0;
    transform: scale(0.42);
  }
  55% {
    opacity: 1;
    transform: scale(1.22);
  }
  76% {
    opacity: 1;
    transform: scale(0.92);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes intro-play-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.secondary-action,
.icon-text-button {
  padding: 0.85rem 1.15rem;
  background: rgba(255, 246, 223, 0.22);
  color: #fff6df;
  border: 1px solid rgba(255, 218, 150, 0.34);
}

.primary-action:hover,
.secondary-action:hover,
.icon-text-button:hover {
  transform: translateY(-2px);
}

.game-hud {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.diamond-counter {
  min-width: 5.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.72rem 1rem;
  border-radius: 999px;
  background: rgba(31, 22, 15, 0.24);
  color: #61d9ff;
  font-size: 1.18rem;
  font-weight: 950;
  text-shadow:
    0 0 10px rgba(97, 217, 255, 0.62),
    0 2px 8px rgba(0, 0, 0, 0.46);
  box-shadow: 0 8px 18px rgba(46, 126, 255, 0.2);
}

.diamond-counter span,
.diamond-large {
  width: 1.1rem;
  aspect-ratio: 1;
  display: inline-block;
  position: relative;
  background: url("./assets/images/blue_diamond.png") center / contain no-repeat;
  filter:
    drop-shadow(0 0 10px rgba(73, 184, 255, 0.72))
    drop-shadow(0 6px 10px rgba(0, 0, 0, 0.28));
  transform-origin: center;
  animation: diamond-breathe 1900ms ease-in-out infinite;
}

.diamond-large {
  width: 4.8rem;
  aspect-ratio: 1.18 / 1;
}

.merlin-panel {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem;
  border: 1px solid rgba(255, 218, 150, 0.26);
  border-radius: 18px;
  background: rgba(31, 22, 15, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.merlin-orb {
  width: 4.35rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #ffffff, #bcdfff 42%, #5376c9);
}

.merlin-orb span {
  width: 2rem;
  height: 2.35rem;
  border-radius: 48% 48% 42% 42%;
  background: #ffffff;
  box-shadow: 0 -1.25rem 0 -0.6rem #ffffff;
}

.merlin-copy {
  min-width: 0;
  color: rgba(255, 246, 223, 0.92);
}

.merlin-copy p:last-child {
  margin-top: 0.2rem;
  font-size: clamp(1.2rem, 5vw, 2rem);
  font-weight: 950;
}

.merlin-panel .icon-text-button {
  grid-column: 1 / -1;
  justify-self: start;
  min-height: 2.7rem;
}

.merlin-panel.is-replaying {
  animation: pulse-panel 680ms ease;
}

.choice-field {
  position: relative;
  z-index: 1;
  min-height: min(54svh, 30rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  align-items: center;
  gap: clamp(0.9rem, 4vw, 1.6rem);
  padding: clamp(0.5rem, 2vw, 1rem);
}

.quest-choice {
  min-height: clamp(9.5rem, 34vw, 15rem);
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 22px;
  background: rgba(31, 22, 15, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 218, 150, 0.22), 0 18px 28px rgba(5, 12, 22, 0.22);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  cursor: pointer;
}

.quest-choice.has-choice-image {
  min-height: min(58svh, 31rem);
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.choice-field:has(.quest-choice:nth-child(2)) .quest-choice.has-choice-image {
  min-height: min(44svh, 22rem);
}

.quest-choice:hover {
  transform: translateY(-3px);
}

.drift-a .choice-symbol {
  animation-name: drift-a;
}

.drift-b .choice-symbol {
  animation-name: drift-b;
}

.drift-c .choice-symbol {
  animation-name: drift-c;
}

.choice-symbol {
  position: relative;
  width: clamp(5.6rem, 22vw, 9.5rem);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: var(--choice-color);
  box-shadow: inset 0 0 0 0.5rem color-mix(in srgb, var(--choice-accent), transparent 42%), 0 12px 24px rgba(0, 0, 0, 0.16);
  animation-duration: 4.8s;
  animation-delay: var(--delay);
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
}

.choice-image {
  width: clamp(12rem, 52vw, 24rem);
  max-width: 82vw;
  height: auto;
  object-fit: contain;
  filter:
    drop-shadow(0 0 28px rgba(59, 168, 255, 0.55))
    drop-shadow(0 24px 30px rgba(0, 0, 0, 0.34));
  animation: stone-drift 6.8s ease-in-out infinite;
}

.choice-field:has(.quest-choice:nth-child(2)) .choice-image {
  width: clamp(8.5rem, 34vw, 15rem);
  max-width: 38vw;
  animation: heart-drift 5.8s ease-in-out infinite;
}

.choice-field[data-question-id="q3-red-shield"] {
  position: relative;
  min-height: min(58svh, 32rem);
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 7vw, 4rem);
}

.choice-field[data-question-id="q3-red-shield"] .quest-choice.has-choice-image {
  min-height: min(52svh, 28rem);
}

.choice-field[data-question-id="q3-red-shield"] .choice-image {
  width: clamp(10rem, 38vw, 18rem);
  max-width: 42vw;
  animation-duration: 4.9s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.choice-field[data-question-id="q3-red-shield"] .quest-choice:nth-child(1) .choice-image {
  animation-name: shield-orbit-red;
}

.choice-field[data-question-id="q3-red-shield"] .quest-choice:nth-child(2) .choice-image {
  animation-name: shield-orbit-yellow;
}

.choice-field[data-question-id="q4-happy-star"] {
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 9vw, 5.4rem);
  min-height: min(58svh, 32rem);
}

.choice-field[data-question-id="q4-happy-star"] .choice-image {
  width: clamp(14rem, 52vw, 24.5rem);
  max-width: 52vw;
  animation: star-breathe 2.35s ease-in-out infinite;
  transform-origin: center;
}

.choice-field[data-question-id="q4-happy-star"] .quest-choice:nth-child(2) .choice-image {
  animation-delay: 0.28s;
}

.choice-field[data-question-id="q5-green-leaf"] {
  min-height: min(52svh, 28rem);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto auto;
  gap: clamp(0rem, 0.6vw, 0.25rem) clamp(1rem, 6vw, 3rem);
  align-items: center;
  transform: translateY(-20%);
}

.choice-field[data-question-id="q5-green-leaf"] .quest-choice.has-choice-image {
  min-height: clamp(7.5rem, 21svh, 11rem);
}

.choice-field[data-question-id="q5-green-leaf"] .choice-image {
  width: clamp(6.8rem, 27vw, 11.5rem);
  max-width: 34vw;
  animation-duration: 4.4s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.choice-field[data-question-id="q5-green-leaf"] .quest-choice:nth-child(1) {
  grid-column: 1 / -1;
  grid-row: 2;
  margin-top: clamp(-3rem, -7svh, -1.8rem);
}

.choice-field[data-question-id="q5-green-leaf"] .quest-choice:nth-child(2) {
  grid-column: 1;
  grid-row: 1;
  transform: translateY(clamp(5rem, 24svh, 9rem));
  z-index: 1;
}

.choice-field[data-question-id="q5-green-leaf"] .quest-choice:nth-child(3) {
  grid-column: 2;
  grid-row: 1;
}

.choice-field[data-question-id="q5-green-leaf"] .quest-choice:nth-child(1) .choice-image {
  animation-name: leaf-dance-green;
}

.choice-field[data-question-id="q5-green-leaf"] .quest-choice:nth-child(2) .choice-image {
  animation-name: leaf-dance-pink;
  animation-delay: 0.18s;
}

.choice-field[data-question-id="q5-green-leaf"] .quest-choice:nth-child(3) .choice-image {
  animation-name: leaf-dance-blue;
  animation-delay: 0.34s;
}

.shape-gem {
  border-radius: 1.1rem;
  transform: rotate(45deg);
}

.shape-heart {
  width: clamp(5rem, 20vw, 8.5rem);
  transform: rotate(-45deg);
  border-radius: 0 0 1.5rem 0;
}

.shape-heart::before,
.shape-heart::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: inherit;
}

.shape-heart::before {
  top: -50%;
  left: 0;
}

.shape-heart::after {
  top: 0;
  left: 50%;
}

.shape-shield {
  border-radius: 42% 42% 52% 52%;
  clip-path: polygon(50% 0, 90% 16%, 82% 72%, 50% 100%, 18% 72%, 10% 16%);
}

.shape-star {
  clip-path: polygon(50% 0, 62% 34%, 98% 35%, 69% 56%, 79% 91%, 50% 70%, 21% 91%, 31% 56%, 2% 35%, 38% 34%);
}

.shape-leaf {
  border-radius: 92% 0 92% 0;
  transform: rotate(-22deg);
}

.shape-moon {
  border-radius: 50%;
  background: transparent;
  box-shadow: -1.45rem 0 0 0 var(--choice-color), inset 0 0 0 0.4rem var(--choice-accent);
}

.shape-sun {
  border-radius: 50%;
  background: radial-gradient(circle, var(--choice-accent) 0 34%, var(--choice-color) 35% 70%, transparent 72%);
  box-shadow: 0 0 0 0.5rem color-mix(in srgb, var(--choice-color), transparent 54%);
}

.choice-face {
  position: relative;
  z-index: 2;
  width: 42%;
  height: 30%;
  border-bottom: 0.35rem solid rgba(80, 55, 15, 0.75);
  border-radius: 0 0 999px 999px;
}

.choice-face::before,
.choice-face::after {
  content: "";
  position: absolute;
  top: -0.55rem;
  width: 0.45rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(80, 55, 15, 0.78);
}

.choice-face::before {
  left: 12%;
}

.choice-face::after {
  right: 12%;
}

.choice-face-sleepy {
  border-bottom: 0;
  border-top: 0.35rem solid rgba(80, 55, 15, 0.75);
  border-radius: 999px 999px 0 0;
}

.reward-row,
.final-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
}

.reward-collect-screen {
  place-items: center;
}

.diamond-reward-button {
  width: min(82vw, 22rem);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  gap: 0.25rem;
  border: 2px solid rgba(129, 221, 255, 0.62);
  border-radius: 24px;
  background:
    radial-gradient(circle at 40% 25%, rgba(130, 225, 255, 0.34), transparent 38%),
    rgba(31, 22, 15, 0.26);
  color: #fff6df;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 223, 0.32),
    0 22px 46px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: intro-play-pulse 1500ms ease-in-out infinite;
}

.diamond-reward-button .diamond-large {
  width: min(48vw, 10rem);
}

.diamond-reward-button strong {
  color: #61d9ff;
  font-family: "Chewy", ui-rounded, "Trebuchet MS", Arial, sans-serif;
  font-size: clamp(3.4rem, 18vw, 6.6rem);
  line-height: 0.9;
  text-shadow:
    0 0 16px rgba(97, 217, 255, 0.68),
    0 3px 14px rgba(0, 0, 0, 0.58);
}

.diamond-reward-button span:last-child {
  color: rgba(255, 246, 223, 0.9);
  font-size: clamp(1rem, 4.6vw, 1.45rem);
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reward-row strong {
  color: #61d9ff;
  font-size: 3.8rem;
  text-shadow:
    0 0 16px rgba(97, 217, 255, 0.58),
    0 3px 12px rgba(0, 0, 0, 0.5);
}

.final-stats {
  flex-wrap: wrap;
}

.final-stats div {
  min-width: 8.5rem;
  padding: 1rem;
  border-radius: 18px;
  background: rgba(31, 22, 15, 0.22);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.final-stats span {
  display: block;
  color: #f4d58a;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.final-stats strong {
  display: block;
  margin-top: 0.2rem;
  color: #61d9ff;
  font-size: 1.55rem;
  text-shadow: 0 0 12px rgba(97, 217, 255, 0.48);
}

.booking-code {
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 0.8rem 1rem;
  border: 2px dashed rgba(38, 91, 73, 0.5);
  border-radius: 14px;
  background: rgba(31, 22, 15, 0.34);
  color: #fff6df;
  font-family: "Courier New", monospace;
  font-size: clamp(1.25rem, 7vw, 2.25rem);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.book-trial-action {
  min-width: min(80vw, 16rem);
  background: linear-gradient(180deg, #ffd86a, #d89419 58%, #8f5a08);
  color: #fff6df;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.32),
    0 14px 30px rgba(141, 89, 8, 0.34);
}

.feedback-spark {
  width: 5rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 42%, rgba(255, 255, 255, 0.75) 43% 57%, transparent 58%),
    linear-gradient(0deg, transparent 42%, rgba(255, 255, 255, 0.75) 43% 57%, transparent 58%),
    radial-gradient(circle, #d6f6ff 0 35%, #3ca4ff 36% 70%, transparent 72%);
  animation: pop-in 420ms ease both;
}

.feedback-screen.is-gentle {
  animation: gentle-feedback-enter 560ms cubic-bezier(0.18, 1.16, 0.3, 1) both;
}

.feedback-screen.is-gentle .feedback-spark {
  background:
    linear-gradient(90deg, transparent 42%, rgba(255, 255, 255, 0.78) 43% 57%, transparent 58%),
    linear-gradient(0deg, transparent 42%, rgba(255, 255, 255, 0.78) 43% 57%, transparent 58%),
    radial-gradient(circle, #e4fbff 0 34%, #58b8ff 35% 64%, transparent 66%);
  animation: gentle-spark-breathe 1500ms ease-in-out infinite;
}

.feedback-screen.is-gentle .primary-action {
  min-height: 4.15rem;
  padding: 1rem 2.25rem;
  background: linear-gradient(180deg, #72dcff 0%, #268df0 56%, #1662c7 100%);
  color: #ffffff;
  font-size: clamp(1.25rem, 5vw, 1.9rem);
  box-shadow:
    0 16px 34px rgba(22, 98, 199, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.46);
  animation: retry-button-breathe 1500ms ease-in-out infinite;
}

.sparkle-screen {
  place-items: center;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 224, 113, 0.42), transparent 22%),
    radial-gradient(circle at 50% 46%, rgba(255, 185, 35, 0.28), transparent 38%),
    radial-gradient(circle at 50% 46%, rgba(108, 208, 132, 0.26), transparent 48%),
    linear-gradient(180deg, rgba(88, 63, 35, 0.22), rgba(31, 22, 15, 0.2));
}

.sparkle-burst {
  position: relative;
  width: min(86vw, 30rem);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.sparkle-burst::before {
  content: "";
  width: min(68vw, 22rem);
  aspect-ratio: 1;
  background: url("./assets/images/green_checkmark.png") center / contain no-repeat;
  filter:
    drop-shadow(0 0 10px rgba(255, 247, 187, 0.95))
    drop-shadow(0 0 24px rgba(255, 221, 88, 0.9))
    drop-shadow(0 0 48px rgba(255, 183, 35, 0.72))
    drop-shadow(0 0 72px rgba(72, 216, 112, 0.38))
    drop-shadow(0 24px 34px rgba(0, 0, 0, 0.34));
  animation: checkmark-zoom-in 2600ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.sparkle-burst::after {
  content: "";
  position: absolute;
  width: min(78vw, 25rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    conic-gradient(from 0deg, transparent 0 9%, rgba(255, 222, 88, 0.88) 10% 12%, transparent 13% 24%, rgba(255, 246, 183, 0.72) 25% 27%, transparent 28% 100%),
    radial-gradient(circle, transparent 0 42%, rgba(255, 206, 64, 0.22) 43% 46%, transparent 47%);
  opacity: 0;
  mix-blend-mode: screen;
  animation: golden-glow-ring 2600ms ease-out both;
}

.sparkle-burst span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(0.65rem, 2.6vw, 1.2rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ffe071;
  box-shadow:
    0 0 12px rgba(255, 240, 155, 0.95),
    0 0 24px rgba(255, 190, 43, 0.68);
  transform: translate(-50%, -50%);
  animation: sparkle-ray 2600ms ease-out both;
}

.sparkle-burst span:nth-child(1) { --x: 0; --y: -7rem; background: #fff3a4; }
.sparkle-burst span:nth-child(2) { --x: 5.2rem; --y: -5rem; background: #ffd45e; }
.sparkle-burst span:nth-child(3) { --x: 7rem; --y: 0.2rem; background: #ffffff; }
.sparkle-burst span:nth-child(4) { --x: 4.8rem; --y: 5rem; background: #ffe38a; }
.sparkle-burst span:nth-child(5) { --x: 0; --y: 7rem; background: #ffd45e; }
.sparkle-burst span:nth-child(6) { --x: -5.1rem; --y: 4.8rem; background: #ffffff; }
.sparkle-burst span:nth-child(7) { --x: -7rem; --y: 0; background: #fff0a0; }
.sparkle-burst span:nth-child(8) { --x: -4.9rem; --y: -5rem; background: #ffd45e; }
.sparkle-burst span:nth-child(9) { --x: 2.4rem; --y: -7.4rem; background: #ffffff; }
.sparkle-burst span:nth-child(10) { --x: -2.4rem; --y: 7.2rem; background: #ffe071; }
.sparkle-burst span:nth-child(11) { --x: 8.7rem; --y: -2.8rem; background: #fff8c8; }
.sparkle-burst span:nth-child(12) { --x: -8.5rem; --y: 2.9rem; background: #ffd45e; }
.sparkle-burst span:nth-child(13) { --x: 7.6rem; --y: 6.8rem; background: #ffffff; }
.sparkle-burst span:nth-child(14) { --x: -7.5rem; --y: -6.7rem; background: #ffe071; }

@keyframes drift-a {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -1rem;
  }
}

@keyframes drift-b {
  0%,
  100% {
    translate: 0.3rem 0.3rem;
  }
  50% {
    translate: -0.4rem -1.1rem;
  }
}

@keyframes drift-c {
  0%,
  100% {
    translate: -0.2rem 0;
  }
  50% {
    translate: 0.5rem -0.8rem;
  }
}

@keyframes stone-drift {
  0%,
  100% {
    transform: translate(-12vw, 3svh) rotate(-8deg) scale(0.98);
  }
  25% {
    transform: translate(13vw, -7svh) rotate(7deg) scale(1.08);
  }
  50% {
    transform: translate(9vw, 8svh) rotate(-4deg) scale(1.02);
  }
  75% {
    transform: translate(-14vw, -5svh) rotate(6deg) scale(1.1);
  }
}

@keyframes heart-drift {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(0, -1.3rem) scale(1.05);
  }
}

@keyframes shield-orbit-red {
  0% {
    transform: translate(-15%, -12%) rotate(0deg) scale(1.34);
  }
  25% {
    transform: translate(5%, -2%) rotate(90deg) scale(1.42);
  }
  50% {
    transform: translate(16%, 14%) rotate(180deg) scale(1.34);
  }
  75% {
    transform: translate(-4%, 4%) rotate(270deg) scale(1.42);
  }
  100% {
    transform: translate(-15%, -12%) rotate(360deg) scale(1.34);
  }
}

@keyframes shield-orbit-yellow {
  0% {
    transform: translate(15%, 14%) rotate(180deg) scale(1.34);
  }
  25% {
    transform: translate(-5%, 4%) rotate(270deg) scale(1.42);
  }
  50% {
    transform: translate(-16%, -12%) rotate(360deg) scale(1.34);
  }
  75% {
    transform: translate(4%, -2%) rotate(450deg) scale(1.42);
  }
  100% {
    transform: translate(15%, 14%) rotate(540deg) scale(1.34);
  }
}

@keyframes star-breathe {
  0% {
    transform: translate(-0.35rem, 0.25rem) scale(0.9) rotate(-4deg);
  }
  35% {
    transform: translate(0.45rem, -0.85rem) scale(1.32) rotate(5deg);
  }
  70% {
    transform: translate(-0.2rem, 0.55rem) scale(1.04) rotate(-2deg);
  }
  100% {
    transform: translate(-0.35rem, 0.25rem) scale(0.9) rotate(-4deg);
  }
}

@keyframes leaf-dance-green {
  0%,
  100% {
    transform: translate(-0.5rem, -0.3rem) rotate(-7deg) scale(1);
  }
  33% {
    transform: translate(0.75rem, -1rem) rotate(7deg) scale(1.1);
  }
  66% {
    transform: translate(-0.75rem, -0.8rem) rotate(-3deg) scale(1.04);
  }
}

@keyframes leaf-dance-pink {
  0%,
  100% {
    transform: translate(0.35rem, -0.45rem) rotate(6deg) scale(1.01);
  }
  33% {
    transform: translate(-0.85rem, 0.5rem) rotate(-8deg) scale(1.08);
  }
  66% {
    transform: translate(0.75rem, -0.75rem) rotate(3deg) scale(0.98);
  }
}

@keyframes leaf-dance-blue {
  0%,
  100% {
    transform: translate(0.55rem, 0.3rem) rotate(-5deg) scale(1);
  }
  33% {
    transform: translate(-0.8rem, -0.85rem) rotate(8deg) scale(1.08);
  }
  66% {
    transform: translate(0.8rem, 0.2rem) rotate(-7deg) scale(1.03);
  }
}

@keyframes gentle-feedback-enter {
  0% {
    opacity: 0;
    transform: translateY(1rem) scale(0.94);
  }
  58% {
    opacity: 1;
    transform: translateY(-0.18rem) scale(1.025);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes gentle-spark-breathe {
  0%,
  100% {
    transform: scale(0.96) rotate(0deg);
  }
  50% {
    transform: scale(1.16) rotate(12deg);
  }
}

@keyframes retry-button-breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.055);
  }
}

@keyframes pulse-panel {
  0%,
  100% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.025);
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
}

@keyframes diamond-breathe {
  0%,
  100% {
    transform: scale(1);
    filter:
      drop-shadow(0 0 10px rgba(73, 184, 255, 0.72))
      drop-shadow(0 6px 10px rgba(0, 0, 0, 0.28));
  }
  50% {
    transform: scale(1.09);
    filter:
      drop-shadow(0 0 18px rgba(97, 217, 255, 0.96))
      drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3));
  }
}

@keyframes question-enter-zoom {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes checkmark-zoom-in {
  0% {
    opacity: 0;
    transform: scale(0.22);
  }
  58% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes golden-glow-ring {
  0% {
    opacity: 0;
    transform: scale(0.42) rotate(-18deg);
  }
  38% {
    opacity: 0.68;
    transform: scale(0.92) rotate(7deg);
  }
  64% {
    opacity: 0.98;
    transform: scale(1.14) rotate(18deg);
  }
  100% {
    opacity: 0;
    transform: scale(1.52) rotate(46deg);
  }
}

@keyframes sparkle-ray {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2);
  }
  28% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.28);
  }
  54% {
    opacity: 1;
  }
  78% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1.1);
  }
}

@keyframes button-shimmer {
  0%,
  38% {
    transform: translateX(-42%);
    opacity: 0;
  }
  55% {
    opacity: 1;
  }
  82%,
  100% {
    transform: translateX(42%);
    opacity: 0;
  }
}

@keyframes button-sparkles {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1.25);
  }
}

@keyframes outro-button-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.045);
  }
}

@media (min-width: 720px) {
  .game-shell {
    place-items: center;
  }

  .game-root {
    width: min(100%, 500px);
    min-height: auto;
    height: min(96svh, 900px);
  }

  .merlin-panel {
    grid-template-columns: auto 1fr auto;
  }

  .merlin-panel .icon-text-button {
    grid-column: auto;
    justify-self: end;
  }
}

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