:root {
  color-scheme: light;
  --sky-top: #9ddcff;
  --sky-bottom: #dff6ff;
  --paper: #fffdf7;
  --ink: #243447;
  --muted: #5d6c80;
  --orange: #f97316;
  --orange-dark: #c2570c;
  --yellow: #ffce3b;
  --green: #34c76f;
  --blue: #2f80ed;
  --pink: #ff6f91;
  --purple: #7c5cff;
  --shadow: 0 18px 45px rgba(35, 61, 90, 0.16);
  --radius-lg: 30px;
  --radius-md: 20px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: "Baloo 2", "Comic Sans MS", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: linear-gradient(170deg, var(--sky-top), #f7fbff 52%, #e9fbef);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
.hotspot:focus-visible,
input:focus-visible {
  outline: 4px solid #ff9f1c;
  outline-offset: 3px;
}

#app {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
  min-height: 100dvh;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--orange-dark);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.primary,
.ghost,
.hint,
.play-recording {
  min-height: 48px;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.primary {
  padding: 14px 26px;
  color: #fff;
  background: linear-gradient(180deg, #ff9b3d, var(--orange));
  box-shadow: 0 9px 0 var(--orange-dark);
}

.ghost,
.hint,
.play-recording {
  padding: 11px 20px;
  color: var(--ink);
  background: #fff;
  box-shadow: inset 0 0 0 3px rgba(48, 84, 122, 0.13);
}

.primary:hover,
.ghost:hover,
.hint:hover,
.play-recording:hover {
  transform: translateY(-2px);
}

.primary:active,
.ghost:active,
.hint:active,
.play-recording:active {
  transform: translateY(2px);
  box-shadow: none;
}

#home.active {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 360px);
  align-items: center;
  gap: 28px;
  padding: 34px clamp(18px, 5vw, 64px) 48px;
  overflow: hidden;
}

.sky {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, #91d8ff, #e8f8ff 68%, #f5fff3);
}

.sky .sun {
  position: absolute;
  top: 38px;
  right: 10%;
  width: 122px;
  height: 122px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff4ab 18%, var(--yellow) 58%, #ffb43b);
  box-shadow: 0 0 0 20px rgba(255, 206, 59, 0.22), 0 0 75px rgba(255, 206, 59, 0.55);
  animation: sun-glow 3.5s ease-in-out infinite;
}

.sky .cloud {
  position: absolute;
  width: 154px;
  height: 48px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  filter: drop-shadow(0 12px 18px rgba(54, 93, 132, 0.1));
}

.sky .cloud::before,
.sky .cloud::after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 50%;
}

.sky .cloud::before {
  left: 24px;
  bottom: 15px;
  width: 61px;
  height: 61px;
}

.sky .cloud::after {
  right: 27px;
  bottom: 12px;
  width: 47px;
  height: 47px;
}

.cloud-a {
  top: 88px;
  left: 8%;
  animation: cloud-drift 14s ease-in-out infinite;
}

.cloud-b {
  top: 180px;
  right: 10%;
  animation: cloud-drift 18s ease-in-out infinite reverse;
}

.home-copy {
  position: relative;
  max-width: 680px;
}

.home-copy h1 {
  margin: 0;
  color: #173a5e;
  font-size: clamp(2.6rem, 7.5vw, 5.1rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.promise {
  max-width: 520px;
  margin: 20px 0 28px;
  color: var(--muted);
  font-size: clamp(1.08rem, 2.2vw, 1.42rem);
  line-height: 1.55;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.fox-preview {
  position: relative;
  width: min(100%, 360px);
  aspect-ratio: 1;
  margin-left: auto;
  filter: drop-shadow(0 24px 30px rgba(43, 75, 109, 0.18));
}

.preview-svg {
  display: block;
  width: 100%;
  height: 100%;
}

#intro.active {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.video-shell {
  width: min(960px, 100%);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 8px solid #fff;
  border-radius: var(--radius-lg);
  background: #123;
  box-shadow: var(--shadow);
}

.video-shell video {
  width: 100%;
  height: 100%;
  display: block;
}

.intro-actions {
  position: fixed;
  bottom: 30px;
  left: 50%;
  translate: -50% 0;
}

#game.active {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(430px, 0.88fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 16px clamp(12px, 3vw, 32px) 30px;
}

.hud {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.74);
  border: 3px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(44, 76, 111, 0.1);
  backdrop-filter: blur(12px);
}

.icon-button {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  font-size: 1.5rem;
  line-height: 1;
}

.progress {
  display: flex;
  flex: 1 1 auto;
  justify-content: center;
  gap: 8px;
}

.step {
  width: clamp(28px, 8vw, 54px);
  height: 12px;
  background: #d7e5f1;
  border-radius: 999px;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.step.current {
  background: var(--yellow);
  transform: scale(1.08);
}

.step.done {
  background: var(--green);
}

.badges {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.badge {
  padding: 7px 11px;
  color: #6c4a00;
  background: #fff3c8;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.interaction {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(320px, 1.2fr);
  gap: 16px;
}

.mission,
.character-card,
.speech-panel,
.success,
.retry,
.typed-fallback,
.recording {
  background: var(--paper);
  border: 4px solid #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.mission {
  padding: 20px;
}

.mission h2 {
  margin: 0 0 10px;
  color: #1d4f78;
  font-size: clamp(1.5rem, 3.7vw, 2.35rem);
}

.mission p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
}

.character {
  display: grid;
}

.character-card {
  position: relative;
  padding: 68px 20px 18px;
  overflow: hidden;
}

.speech-bubble {
  position: absolute;
  top: 15px;
  left: 18px;
  right: 18px;
  padding: 12px 16px;
  color: #17415f;
  background: #e9f5ff;
  border: 4px solid #fff;
  border-radius: 20px;
  font-weight: 800;
  text-align: center;
}

.speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -14px;
  left: 50%;
  width: 18px;
  height: 18px;
  background: #e9f5ff;
  border-right: 4px solid #fff;
  border-bottom: 4px solid #fff;
  transform: translateX(-50%) rotate(45deg);
}

.character-name {
  color: var(--orange-dark);
  font-size: 1.3rem;
  font-weight: 900;
  text-align: center;
}

.speech-panel {
  display: grid;
  justify-items: center;
  gap: 15px;
  padding: 20px;
  text-align: center;
}

.privacy-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
  text-align: center;
}

.speech-state {
  min-height: 30px;
  color: #1d4f78;
  font-weight: 800;
}

.mic-button {
  width: clamp(84px, 20vw, 112px);
  aspect-ratio: 1;
  color: #fff;
  background: radial-gradient(circle at 32% 28%, #ff9f64, var(--orange) 60%, #df5b00);
  border: 6px solid #fff;
  border-radius: 50%;
  font-size: 2.7rem;
  box-shadow: 0 14px 0 var(--orange-dark), 0 20px 32px rgba(217, 89, 9, 0.24);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mic-button:active {
  transform: translateY(8px);
  box-shadow: 0 5px 0 var(--orange-dark);
}

.mic-button.listening {
  animation: mic-pulse 0.85s ease-in-out infinite;
}

.phrase-hints {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.response {
  display: grid;
}

.success,
.retry,
.typed-fallback {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.success {
  color: #17673c;
  background: linear-gradient(150deg, #fffdf7, #eafff2);
}

.success strong,
.retry strong {
  font-size: 1.12rem;
  line-height: 1.45;
}

.retry {
  color: #8b4a00;
  background: linear-gradient(150deg, #fffdf7, #fff5e4);
}

.typed-fallback {
  color: #234;
}

.typed-fallback label {
  font-weight: 800;
}

.typed-fallback input {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  color: var(--ink);
  background: #fff;
  border: 3px solid #cddcf0;
  border-radius: var(--radius-md);
}

.typed-fallback form {
  display: grid;
  gap: 10px;
}

#celebrate.active {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
}

.celebration-copy {
  width: min(900px, 100%);
  padding: clamp(24px, 5vw, 54px);
  background: rgba(255, 253, 247, 0.92);
  border: 5px solid #fff;
  border-radius: 38px;
  box-shadow: var(--shadow);
  text-align: center;
}

.celebration-copy h1,
.review h2 {
  margin: 0 0 12px;
  color: #1d4f78;
}

.celebration-copy > p {
  margin: 0 auto 24px;
  max-width: 540px;
  color: var(--muted);
  font-size: 1.15rem;
}

.review {
  margin: 0 0 26px;
}

.recordings {
  display: grid;
  gap: 14px;
}

.recording {
  padding: 18px;
  text-align: left;
}

.recording h3 {
  margin: 0 0 8px;
  color: var(--orange-dark);
}

.recording p {
  margin: 0 0 12px;
  line-height: 1.5;
}

.recording audio {
  width: 100%;
}

.scene {
  position: relative;
  width: 100%;
  min-height: clamp(340px, 45dvh, 540px);
  display: grid;
}

.scene-caption {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 12px;
  width: min(92%, 520px);
  padding: 10px 16px;
  color: #173a5e;
  background: rgba(255, 255, 255, 0.92);
  border: 3px solid #fff;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(28, 58, 87, 0.14);
  font-weight: 900;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
}

.scene-frame {
  position: relative;
  width: 100%;
  min-height: inherit;
  overflow: hidden;
  background: linear-gradient(180deg, #a7e0ff, #dff5ff 72%, #edfff1);
  border: 6px solid #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.scene-svg {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: manipulation;
}

.scene-svg .sun {
  fill: var(--yellow);
  animation: sun-svg-pulse 3.2s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.scene-svg .sun-rays path {
  stroke: #ffd75e;
  stroke-width: 8;
  stroke-linecap: round;
}

.scene-svg .cloud ellipse {
  fill: rgba(255, 255, 255, 0.92);
}

.scene-svg .cloud {
  transform-box: fill-box;
}

.scene-svg .cloud-a {
  animation: cloud-svg-drift-a 12s ease-in-out infinite;
}

.scene-svg .cloud-b {
  animation: cloud-svg-drift-b 15s ease-in-out infinite;
}

.hill-back {
  fill: #89dd92;
}

.hill-front {
  fill: #6bd276;
}

.ground {
  fill: #8ee07b;
}

.scene-pond .ground {
  fill: #7bdc82;
}

.tree-trunk {
  fill: #9d653b;
}

.tree-leaf {
  fill: #37b95d;
}

.tree-leaf-light {
  fill: #5fd875;
}

.barn-roof {
  fill: #d2483a;
}

.barn-wall {
  fill: #e4574a;
}

.barn-door,
.barn-x {
  fill: #f9f0dc;
}

.barn-x {
  stroke: #b83b31;
  stroke-width: 4;
}

.barn-window {
  fill: #ffe38f;
}

.hay-bale {
  fill: #f4c25b;
}

.hay-line {
  stroke: #c99a35;
  stroke-width: 5;
  stroke-linecap: round;
}

.fence rect,
.gate-panel {
  fill: #b5794b;
}

.fence {
  stroke: #8d5733;
  stroke-width: 2;
}

.gate {
  overflow: visible;
}

.gate-panel {
  stroke: #8d5733;
  stroke-width: 4;
  transform-box: fill-box;
  transition: transform 0.9s cubic-bezier(.34, 1.56, .64, 1);
}

.gate-panel path {
  stroke: #8d5733;
  stroke-width: 4;
  fill: none;
}

.gate-left {
  transform-origin: left center;
}

.gate-right {
  transform-origin: right center;
}

.gate-hinge {
  fill: #684029;
}

.footprints {
  fill: #ffffff;
  opacity: 0;
  transition: opacity 0.6s ease 0.35s;
}

.pond-water {
  fill: #49b8e8;
}

.pond-edge {
  fill: none;
  stroke: #2f8ec4;
  stroke-width: 7;
}

.water-wave path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.78);
  stroke-width: 7;
  stroke-linecap: round;
}

.water-wave {
  animation: wave-slide 4.5s ease-in-out infinite;
  transform-box: fill-box;
}

.water-wave-b {
  animation-delay: -1.8s;
}

.ripple {
  fill: none;
  stroke: rgba(255, 255, 255, 0.78);
  stroke-width: 5;
  opacity: 0;
  animation: ripple 3.4s ease-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.ripple:nth-child(2) {
  animation-delay: 0.45s;
}

.ripple:nth-child(3) {
  animation-delay: 0.9s;
}

.duck-clue {
  opacity: 0;
  transform: translateY(20px);
  transform-box: fill-box;
  transition: opacity 0.5s ease, transform 0.6s ease;
}

.clue-arrow {
  fill: var(--yellow);
  stroke: #d99d00;
  stroke-width: 4;
}

.clue-sign {
  fill: #fffaf0;
  stroke: #ffb43b;
  stroke-width: 6;
}

.clue-text {
  fill: #1d4f78;
  font-size: 21px;
  font-weight: 900;
}

.bush circle {
  fill: #40ba61;
}

.bunting-line {
  fill: none;
  stroke: #7f6248;
  stroke-width: 4;
}

.bunting-flag {
  fill: var(--pink);
}

.bunting-flag:nth-of-type(even) {
  fill: var(--purple);
}

.cave-back {
  fill: #92776a;
}

.cave-mouth {
  fill: #604a43;
}

.confetti {
  opacity: 0;
  transform: translateY(-14px);
  transform-box: fill-box;
  transition: opacity 0.5s ease, transform 0.8s ease;
}

.confetti-piece {
  fill: var(--yellow);
}

.confetti-piece:nth-of-type(2) {
  fill: var(--pink);
}

.confetti-piece:nth-of-type(3) {
  fill: var(--green);
}

.confetti-piece:nth-of-type(4) {
  fill: var(--blue);
}

.fox-tail {
  fill: var(--orange);
  stroke: #c2570c;
  stroke-width: 3;
  transform-box: fill-box;
  transform-origin: 10% 70%;
  animation: tail-wag 1.7s ease-in-out infinite;
}

.fox-shadow {
  fill: rgba(39, 77, 62, 0.16);
}

.fox-ear {
  fill: #d75f14;
}

.fox-head {
  fill: var(--orange);
}

.fox-face {
  fill: #fff7e8;
}

.fox-eye {
  fill: #243447;
}

.fox-nose {
  fill: #3a2b25;
}

.fox-body-main {
  fill: var(--orange);
}

.fox-chest {
  fill: #fff7e8;
}

.fox-leg {
  fill: #d75f14;
}

.fox-breath {
  animation: character-breathe 2.8s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center bottom;
}

.pig-tail {
  fill: #f2a4b9;
  stroke: #c97087;
  stroke-width: 4;
  transform-box: fill-box;
  transform-origin: left center;
  animation: pig-tail 1.4s ease-in-out infinite;
}

.pig-main,
.pig-head {
  fill: #f6a6bb;
}

.pig-ear {
  fill: #e77f9b;
}

.pig-snout {
  fill: #f9c3d1;
}

.pig-nostril,
.pig-eye {
  fill: #7c3247;
}

.pig-leg,
.pig-eye {
  stroke: #c97087;
}

.pig-leg {
  fill: #e77f9b;
  stroke-width: 9;
  stroke-linecap: round;
}

.pig-body {
  animation: character-breathe 3.1s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center bottom;
}

.duck-main,
.duck-head {
  fill: #fff65c;
}

.duck-tail {
  fill: #ffe14d;
}

.duck-bill {
  fill: #ff8b34;
}

.duck-eye {
  fill: #243447;
}

.duck-wing {
  fill: #ffd426;
  stroke: #d4a300;
  stroke-width: 4;
  transform-box: fill-box;
  transform-origin: left center;
  transition: transform 0.45s ease;
}

.duck-body {
  animation: duck-bob 2.3s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center bottom;
}

.cub-main,
.cub-head,
.cub-ear {
  fill: #a97147;
}

.cub-ear {
  fill: #8f5c37;
}

.cub-muzzle {
  fill: #f2d0a8;
}

.cub-nose {
  fill: #423327;
}

.cub-eye {
  fill: #243447;
}

.cub-mouth {
  fill: none;
  stroke: #423327;
  stroke-width: 4;
  stroke-linecap: round;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.4s ease;
}

.cub-arm,
.cub-leg {
  fill: #8f5c37;
}

.cub-leg {
  stroke: #6e421f;
  stroke-width: 13;
  stroke-linecap: round;
}

.cub-body {
  animation: character-breathe 3.4s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center bottom;
}

.cat-body,
.cat-head,
.cat-tail {
  fill: #77707d;
}

.cat-ear {
  fill: #f6a6bb;
}

.cat-eye {
  fill: #fffaf0;
}

.cat-tail {
  stroke: #77707d;
  stroke-width: 8;
  stroke-linecap: round;
  fill: none;
}

.hen-body,
.hen-head,
.hen-wing {
  fill: #fffaf0;
}

.hen-head {
  fill: #fffaf0;
}

.hen-beak {
  fill: #ffab3b;
}

.hen-comb {
  fill: #e5484d;
}

.hen-eye {
  fill: #243447;
}

.hen-leg {
  stroke: #e5484d;
  stroke-width: 5;
  stroke-linecap: round;
}

.hen {
  animation: hen-peck 3.2s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center bottom;
}

.apple-stem {
  stroke: #7a4b27;
  stroke-width: 5;
  stroke-linecap: round;
}

.apple-leaf {
  fill: #42ba62;
}

.apple-fruit {
  fill: #ef4444;
}

.apple-shine {
  stroke: rgba(255, 255, 255, 0.75);
  stroke-width: 5;
  stroke-linecap: round;
  fill: none;
}

.fish-body {
  fill: #ff9b52;
}

.fish-tail,
.fish-fin {
  fill: #ff7b2d;
}

.fish-eye {
  fill: #fffaf0;
}

.fish {
  animation: fish-swim 2.8s ease-in-out infinite;
  transform-box: fill-box;
  transition: transform 0.6s ease;
}

.lily-pad {
  fill: #36b95d;
  stroke: #227d41;
  stroke-width: 4;
}

.lily-flower {
  fill: #ff9ec1;
}

.reed {
  stroke: #2f9d56;
  stroke-width: 7;
  stroke-linecap: round;
  fill: none;
}

.reed-head {
  fill: #7ac943;
}

.reeds {
  animation: reed-sway 3.4s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center bottom;
}

.balloon-string {
  stroke: #7f6248;
  stroke-width: 4;
  fill: none;
}

.balloon-body {
  fill: #4f9bf7;
  stroke: #2f74c5;
  stroke-width: 4;
}

.balloon-knot {
  fill: #2f74c5;
}

.balloon-shine {
  stroke: rgba(255, 255, 255, 0.8);
  stroke-width: 6;
  stroke-linecap: round;
  fill: none;
}

.balloon {
  animation: balloon-float 3.1s ease-in-out infinite;
  transform-box: fill-box;
}

.cake-plate {
  fill: #d8e6f5;
}

.cake-base {
  fill: #f4a4c0;
}

.cake-top {
  fill: #fff7e8;
}

.cake-candle {
  fill: #7c5cff;
}

.cake-flame {
  fill: var(--yellow);
  animation: candle-flame 0.75s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center bottom;
}

.lantern-top,
.lantern-base {
  fill: #7a4b27;
}

.lantern-glass {
  fill: #ffe9a8;
  stroke: #7a4b27;
  stroke-width: 5;
}

.lantern-flame {
  fill: #ff9b3d;
}

.lantern {
  animation: lantern-glow 2.7s ease-in-out infinite;
  transform-box: fill-box;
}

.hotspot {
  cursor: pointer;
  transform-box: fill-box;
}

.hotspot-ring {
  fill: rgba(255, 255, 255, 0.48);
  stroke: #fffaf0;
  stroke-width: 4;
  stroke-dasharray: 8 10;
  animation: hotspot-pulse 1.9s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
  transition: fill 0.2s ease, stroke 0.2s ease, stroke-width 0.2s ease;
}

.hotspot-label {
  fill: #fffaf0;
  stroke: rgba(33, 64, 95, 0.72);
  stroke-width: 6;
  paint-order: stroke;
  font-size: 21px;
  font-weight: 900;
  pointer-events: none;
}

.hotspot:hover .hotspot-ring,
.hotspot:focus-visible .hotspot-ring {
  fill: rgba(255, 222, 89, 0.66);
  stroke: var(--yellow);
  stroke-width: 7;
}

.hotspot.is-active .hotspot-ring {
  fill: rgba(124, 92, 255, 0.42);
  stroke: var(--purple);
  stroke-width: 7;
}

.hotspot:hover,
.hotspot:focus-visible,
.hotspot.is-active {
  filter: drop-shadow(0 6px 10px rgba(25, 53, 82, 0.24));
}

.pip,
.duck,
.cub,
.fish {
  transition: transform 0.85s cubic-bezier(.34, 1.56, .64, 1);
  transform-box: fill-box;
}

.scene[data-animation="gate-open"] .gate-left {
  transform: rotate(-75deg);
}

.scene[data-animation="gate-open"] .gate-right {
  transform: rotate(75deg);
}

.scene[data-animation="gate-open"] .pip {
  transform: translateX(78px);
}

.scene[data-animation="gate-open"] .footprints {
  opacity: 1;
}

.scene[data-animation="duck-answer"] .duck-wing {
  transform: rotate(-38deg);
}

.scene[data-animation="duck-answer"] .duck {
  transform: translateY(-15px);
}

.scene[data-animation="duck-answer"] .duck-clue {
  opacity: 1;
  transform: translateY(0);
}

.scene[data-animation="duck-answer"] .ripple {
  animation-duration: 1.2s;
}

.scene[data-animation="duck-answer"] .fish {
  transform: translate(20px, -24px) rotate(-18deg);
}

.scene[data-animation="cub-happy"] .cub {
  transform: translateY(-20px);
}

.scene[data-animation="cub-happy"] .cub-mouth {
  transform: scaleY(1.35);
}

.scene[data-animation="cub-happy"] .cub-arm-left {
  animation: cub-wave-left 0.9s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: top right;
}

.scene[data-animation="cub-happy"] .cub-arm-right {
  animation: cub-wave-right 0.9s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: top left;
}

.scene[data-animation="cub-happy"] .confetti {
  opacity: 1;
  transform: translateY(0);
}

.scene[data-animation="cub-happy"] .balloon {
  animation-duration: 1.5s;
}

.preview-glow {
  fill: rgba(255, 206, 59, 0.4);
  animation: preview-glow 3.1s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.preview-pip {
  animation: preview-wave 3.6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center bottom;
}

@keyframes sun-glow {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

@keyframes cloud-drift {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(38px);
  }
}

@keyframes sun-svg-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

@keyframes cloud-svg-drift-a {
  0%,
  100% {
    transform: translate(145px, 77px);
  }
  50% {
    transform: translate(190px, 72px);
  }
}

@keyframes cloud-svg-drift-b {
  0%,
  100% {
    transform: translate(560px, 124px);
  }
  50% {
    transform: translate(515px, 118px);
  }
}

@keyframes character-breathe {
  0%,
  100% {
    transform: scale(1, 1);
  }
  50% {
    transform: scale(1.025, 0.975);
  }
}

@keyframes tail-wag {
  0%,
  100% {
    transform: rotate(-7deg);
  }
  50% {
    transform: rotate(12deg);
  }
}

@keyframes pig-tail {
  0%,
  100% {
    transform: rotate(-8deg);
  }
  50% {
    transform: rotate(12deg);
  }
}

@keyframes duck-bob {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-6px) rotate(-1.5deg);
  }
}

@keyframes hen-peck {
  0%,
  68%,
  100% {
    transform: rotate(0deg);
  }
  78% {
    transform: rotate(10deg);
  }
  88% {
    transform: rotate(3deg);
  }
}

@keyframes fish-swim {
  0%,
  100% {
    transform: translateX(0) rotate(0deg);
  }
  50% {
    transform: translateX(12px) rotate(5deg);
  }
}

@keyframes reed-sway {
  0%,
  100% {
    transform: rotate(-2deg);
  }
  50% {
    transform: rotate(3deg);
  }
}

@keyframes balloon-float {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-11px) rotate(2deg);
  }
}

@keyframes candle-flame {
  0%,
  100% {
    transform: scale(1, 1);
  }
  50% {
    transform: scale(0.88, 1.16);
  }
}

@keyframes lantern-glow {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.04);
    opacity: 0.92;
  }
}

@keyframes hotspot-pulse {
  0%,
  100% {
    transform: scale(1);
    stroke-opacity: 0.92;
  }
  50% {
    transform: scale(1.06);
    stroke-opacity: 1;
  }
}

@keyframes wave-slide {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(18px);
  }
}

@keyframes ripple {
  0% {
    opacity: 0;
    transform: scale(0.45);
  }
  20% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
    transform: scale(1.18);
  }
}

@keyframes cub-wave-left {
  0%,
  100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(-16deg);
  }
}

@keyframes cub-wave-right {
  0%,
  100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(16deg);
  }
}

@keyframes preview-glow {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.06);
    opacity: 0.78;
  }
}

@keyframes preview-wave {
  0%,
  100% {
    transform: rotate(-1deg);
  }
  50% {
    transform: rotate(2deg) translateY(-5px);
  }
}

@keyframes mic-pulse {
  0%,
  100% {
    box-shadow: 0 14px 0 var(--orange-dark), 0 0 0 0 rgba(249, 115, 22, 0.42);
  }
  50% {
    box-shadow: 0 14px 0 var(--orange-dark), 0 0 0 18px rgba(249, 115, 22, 0);
  }
}

@media (max-width: 880px) {
  #game.active {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .scene,
  .interaction {
    grid-column: 1;
    grid-row: auto;
  }

  #home.active {
    grid-template-columns: 1fr;
    align-content: center;
    padding-top: 22px;
  }

  .fox-preview {
    order: 2;
    width: min(78vw, 310px);
    margin: 0 auto;
  }

  .home-copy {
    order: 1;
    text-align: center;
  }

  .home-actions {
    justify-content: center;
  }

  .sky .sun {
    right: 5%;
    width: 90px;
    height: 90px;
  }

  .interaction {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 16px;
  }

  #game.active {
    padding: 10px 10px 18px;
  }

  .hud {
    position: relative;
    gap: 8px;
    border-radius: var(--radius-md);
  }

  .progress {
    position: absolute;
    top: 58px;
    left: 12px;
    right: 12px;
  }

  .badges {
    margin-left: auto;
    max-width: 160px;
    overflow: hidden;
  }

  .badge {
    padding: 6px 8px;
    font-size: 0.65rem;
  }

  .scene {
    min-height: 300px;
    margin-top: 26px;
  }

  .scene-caption {
    bottom: 8px;
    font-size: 0.88rem;
  }

  .mission,
  .character-card,
  .speech-panel,
  .success,
  .retry,
  .typed-fallback,
  .recording {
    border-radius: 24px;
  }

  .mission,
  .speech-panel,
  .success,
  .retry,
  .typed-fallback,
  .recording {
    padding: 16px;
  }

  .primary,
  .ghost,
  .hint,
  .play-recording {
    width: 100%;
  }

  .home-actions,
  .phrase-hints {
    display: grid;
    width: 100%;
  }

  .speech-panel {
    gap: 12px;
  }

  .intro-actions {
    width: calc(100% - 24px);
  }

  .intro-actions .primary {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .hud {
    padding: 6px;
  }

  .icon-button {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
  }

  .badges {
    max-width: 118px;
  }

  .step {
    width: 26px;
  }

  .hotspot-label {
    font-size: 23px;
  }
}

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