:root {
  --ink: #17313b;
  --ink-soft: #365b68;
  --paper: #fff6df;
  --paper-bright: #fffdf5;
  --teal: #087f8c;
  --teal-deep: #045964;
  --coral: #ff6b57;
  --gold: #f6b73c;
  --leaf: #4c9f58;
  --sky: #b9e7f5;
  --line: rgba(23, 49, 59, 0.14);
  --shadow: 0 18px 44px rgba(20, 54, 48, 0.2);
  --radius-lg: 18px;
  --radius-md: 8px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(255, 251, 239, 0.3), rgba(255, 246, 223, 0.92)),
    url("assets/storybook-path.png") center / cover fixed;
  color: var(--ink);
  font-family: "Trebuchet MS", "Aptos", "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 12px clamp(12px, 3vw, 32px);
  background: rgba(255, 251, 239, 0.9);
  border-bottom: 1px solid rgba(23, 49, 59, 0.1);
  backdrop-filter: blur(12px);
}

.brand,
.nav-button,
.primary-button,
.quiet-button,
.speaker-button,
.choice-button,
.step-button,
.level-button,
.listen-button,
.chip-button {
  border: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0;
  color: var(--ink);
  text-align: left;
  background: transparent;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.18rem;
}

.brand small {
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  color: #fff7d4;
  background: linear-gradient(135deg, var(--teal), #25a5a1);
  box-shadow: 0 10px 24px rgba(8, 127, 140, 0.28);
  font-weight: 800;
  font-size: 1.7rem;
}

.top-actions {
  min-width: 0;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-button,
.quiet-button,
.chip-button {
  min-width: 0;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px var(--line);
}

.nav-button:hover,
.quiet-button:hover,
.chip-button:hover {
  background: #fff;
}

.sound-toggle[aria-pressed="false"] {
  color: #fff8ea;
  background: var(--ink);
}

main {
  width: min(1280px, 100%);
  max-width: 100%;
  overflow-x: hidden;
  margin: 0 auto;
  padding: clamp(14px, 3vw, 34px);
}

.screen {
  display: grid;
  gap: clamp(14px, 2vw, 22px);
  animation: screen-in 360ms ease both;
}

.hero-band,
.play-shell,
.glossary-shell,
.research-note {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero-band {
  min-height: 320px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: clamp(16px, 3vw, 34px);
  align-items: end;
  overflow: hidden;
  padding: clamp(18px, 4vw, 44px);
  color: #14323d;
  background:
    linear-gradient(90deg, rgba(255, 248, 224, 0.98), rgba(255, 248, 224, 0.66)),
    url("assets/storybook-path.png") center / cover;
}

.hero-copy {
  display: grid;
  gap: 14px;
  align-content: end;
}

.eyebrow,
.prompt-label,
.mini-label {
  margin: 0;
  color: var(--teal-deep);
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 11ch;
  font-size: clamp(2.3rem, 6vw, 5.7rem);
  line-height: 0.94;
}

h2 {
  font-size: clamp(1.4rem, 2.6vw, 2.2rem);
}

h3 {
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
}

.hero-copy > p {
  max-width: 40rem;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.4vw, 1.22rem);
  line-height: 1.45;
}

.hero-actions,
.button-row,
.chip-row,
.word-meta,
.score-row,
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.primary-button,
.step-button,
.level-button,
.listen-button {
  border-radius: var(--radius-md);
  color: #fff9e9;
  background: var(--teal);
  box-shadow: 0 12px 24px rgba(8, 127, 140, 0.23);
}

.primary-button,
.listen-button {
  min-height: 52px;
  padding: 13px 18px;
  font-weight: 800;
}

.primary-button:hover,
.step-button:hover,
.level-button:hover,
.listen-button:hover {
  background: var(--teal-deep);
}

.hero-book,
.level-props,
.tour-guide {
  filter: drop-shadow(0 24px 18px rgba(15, 53, 40, 0.18));
}

.hero-book {
  justify-self: end;
  width: min(100%, 330px);
}

.path-grid,
.step-grid,
.stats-grid,
.glossary-grid {
  display: grid;
  gap: 14px;
}

.path-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr));
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 185px), 1fr));
}

.step-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
}

.path-card,
.stat-card,
.step-card,
.word-card,
.question-card,
.result-card,
.glossary-card {
  min-width: 0;
  border-radius: var(--radius-md);
  background: rgba(255, 253, 245, 0.94);
  box-shadow: inset 0 0 0 1px var(--line), 0 12px 30px rgba(38, 64, 49, 0.13);
}

.path-card,
.step-card,
.word-card,
.glossary-card {
  padding: 16px;
}

.path-card {
  display: grid;
  grid-template-rows: 96px auto auto auto auto 1fr;
  gap: 12px;
  min-height: 335px;
  overflow: hidden;
}

.path-scene {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 96px;
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.9), transparent 70px),
    linear-gradient(180deg, rgba(185, 231, 245, 0.92), rgba(255, 244, 194, 0.86) 56%, rgba(95, 181, 93, 0.82) 57%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45);
}

.path-scene::before {
  position: absolute;
  inset: auto -10% -35% -10%;
  z-index: -1;
  height: 64%;
  border-radius: 50% 50% 0 0;
  background: rgba(76, 159, 88, 0.72);
  content: "";
}

.path-scene-badge {
  position: absolute;
  right: 14px;
  bottom: 12px;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border: 4px solid rgba(255, 255, 255, 0.62);
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 30%, rgba(255, 255, 255, 0.96), rgba(255, 225, 118, 0.96));
  box-shadow: 0 12px 22px rgba(23, 49, 59, 0.16);
  font-size: 2rem;
}

.path-scene-trail {
  position: absolute;
  left: 7%;
  right: 32%;
  bottom: 0;
  height: 46px;
  border-radius: 60% 60% 0 0;
  background: linear-gradient(115deg, transparent 0 30%, rgba(255, 229, 150, 0.92) 31% 72%, transparent 73%);
}

.path-scene.friendly {
  background: linear-gradient(180deg, #d9f7ff, #fff0b7 57%, #9bd98a 58%);
}

.path-scene.homey {
  background: linear-gradient(180deg, #c9edff, #ffe1c7 57%, #a5d884 58%);
}

.path-scene.playful {
  background: linear-gradient(180deg, #bcefff, #ffeaa1 57%, #6fc789 58%);
}

.path-scene.nature {
  background: linear-gradient(180deg, #bfefff, #dff4b4 57%, #61b96b 58%);
}

.path-scene.feeling {
  background: linear-gradient(180deg, #ffe0ef, #fff1b9 57%, #8fd28c 58%);
}

.path-scene.story {
  background: linear-gradient(180deg, #d9e3ff, #fff0be 57%, #8ad18d 58%);
}

.path-scene.town {
  background: linear-gradient(180deg, #d4f4ff, #ffe2b6 57%, #85c983 58%);
}

.path-scene.lab {
  background: linear-gradient(180deg, #d2f7ff, #f7f2c1 57%, #77c5aa 58%);
}

.path-scene.idea {
  background: linear-gradient(180deg, #fff5b8, #d8f0ff 57%, #93ce7a 58%);
}

.path-card.locked {
  opacity: 0.72;
}

.path-head,
.screen-head,
.question-head,
.level-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.path-head h3,
.path-card p {
  overflow-wrap: anywhere;
}

.level-pill,
.status-pill,
.part-pill,
.mastery-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

.level-pill,
.part-pill {
  color: var(--teal-deep);
  background: rgba(8, 127, 140, 0.14);
}

.status-pill {
  color: #734600;
  background: rgba(246, 183, 60, 0.24);
}

.mastery-pill {
  color: #22592d;
  background: rgba(76, 159, 88, 0.18);
}

.progress-track {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(23, 49, 59, 0.1);
}

.progress-track span {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--coral), var(--gold), var(--leaf));
}

.level-button,
.step-button {
  min-height: 52px;
  width: 100%;
  padding: 13px 14px;
  text-align: left;
  font-weight: 800;
}

.level-button:disabled,
.step-button:disabled {
  color: var(--ink-soft);
  background: rgba(23, 49, 59, 0.11);
  box-shadow: none;
}

.stat-card {
  display: grid;
  gap: 7px;
  padding: 16px;
}

.stat-card strong {
  font-size: clamp(1.35rem, 2vw, 2rem);
}

.play-shell,
.glossary-shell {
  display: grid;
  gap: 18px;
  overflow: hidden;
  padding: clamp(16px, 3vw, 28px);
  background: rgba(255, 248, 227, 0.94);
}

.screen-head p,
.level-head p,
.step-card p,
.path-card p,
.glossary-card p,
.research-note p,
.feedback {
  color: var(--ink-soft);
  line-height: 1.45;
}

.level-stop {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.36fr) auto;
  gap: clamp(12px, 2vw, 20px);
  align-items: center;
  padding: clamp(14px, 2.4vw, 24px);
  border-radius: var(--radius-md);
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(255, 253, 245, 0.98), rgba(255, 246, 214, 0.82));
  box-shadow: inset 0 0 0 1px var(--line), 0 12px 28px rgba(23, 49, 59, 0.12);
}

.level-stop p {
  max-width: 48rem;
  color: var(--ink-soft);
  line-height: 1.45;
}

.level-stop-scene {
  position: relative;
  overflow: hidden;
  min-height: 136px;
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 78% 26%, rgba(255, 235, 134, 0.94), transparent 42px),
    linear-gradient(180deg, rgba(185, 231, 245, 0.9), rgba(255, 241, 179, 0.86) 54%, rgba(97, 185, 106, 0.86) 55%);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.46);
}

.level-stop-scene > span:first-child {
  position: absolute;
  right: 22px;
  bottom: 24px;
  z-index: 2;
  font-size: clamp(3.8rem, 8vw, 5.8rem);
  filter: drop-shadow(0 12px 12px rgba(23, 49, 59, 0.18));
}

.level-stop-scene > span:last-child {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -22px;
  height: 58%;
  border-radius: 50% 50% 0 0;
  background:
    linear-gradient(115deg, transparent 0 39%, rgba(255, 227, 142, 0.9) 40% 61%, transparent 62%),
    rgba(76, 159, 88, 0.7);
}

.word-tour {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 0.42fr);
  gap: 16px;
  align-items: stretch;
}

.word-card {
  min-height: 405px;
  display: grid;
  gap: 18px;
  align-content: start;
  padding: clamp(18px, 4vw, 34px);
  background:
    radial-gradient(circle at 92% 10%, rgba(246, 183, 60, 0.24), transparent 92px),
    radial-gradient(circle at 10% 90%, rgba(8, 127, 140, 0.14), transparent 110px),
    rgba(255, 253, 245, 0.96);
}

.level-word-pack {
  min-height: 0;
}

.word-pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 128px), 1fr));
  gap: 10px;
}

.pack-word {
  min-height: 82px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: var(--radius-md);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 0 0 2px rgba(23, 49, 59, 0.08), 0 10px 20px rgba(23, 49, 59, 0.08);
}

.pack-word > span {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: rgba(246, 183, 60, 0.24);
  font-size: 1.8rem;
}

.pack-word strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 1.05rem;
}

.discover-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1fr);
  gap: clamp(14px, 2vw, 24px);
  align-items: start;
}

.discover-copy {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.word-picture {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 260px;
  display: grid;
  gap: 8px;
  align-content: center;
  justify-items: center;
  padding: clamp(14px, 3vw, 24px);
  border-radius: var(--radius-md);
  text-align: center;
  background:
    linear-gradient(180deg, rgba(185, 231, 245, 0.92), rgba(255, 255, 255, 0.82) 54%, rgba(244, 219, 140, 0.72));
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.52), 0 16px 30px rgba(23, 49, 59, 0.14);
}

.word-picture::before {
  position: absolute;
  inset: auto -12% -16% -12%;
  z-index: -1;
  height: 48%;
  border-radius: 50% 50% 0 0;
  background:
    linear-gradient(180deg, rgba(76, 159, 88, 0.72), rgba(76, 159, 88, 0.2));
  content: "";
}

.word-picture.hero {
  min-height: 100%;
}

.word-picture.checkpoint {
  min-height: 230px;
}

.word-picture.match,
.word-picture.story {
  min-height: 220px;
}

.word-picture.picture-prompt p {
  max-width: 17rem;
}

.word-picture-glyph {
  min-height: 112px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 11px 12px rgba(23, 49, 59, 0.16));
  font-size: clamp(4.4rem, 8vw, 7.4rem);
  line-height: 1;
}

.word-picture-label {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--teal-deep);
  background: rgba(255, 253, 245, 0.82);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.word-picture strong {
  overflow-wrap: anywhere;
  font-size: clamp(1.45rem, 2.4vw, 2.3rem);
}

.word-picture p {
  color: var(--ink-soft);
  font-weight: 800;
  line-height: 1.38;
}

.picture-sticker {
  width: 50px;
  height: 50px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: var(--radius-md);
  background:
    linear-gradient(145deg, rgba(255, 253, 245, 0.96), rgba(246, 183, 60, 0.32));
  box-shadow: inset 0 0 0 2px rgba(246, 183, 60, 0.18), 0 8px 15px rgba(23, 49, 59, 0.1);
  font-size: 1.8rem;
}

.picture-sticker.medium {
  width: 68px;
  height: 68px;
  font-size: 2.5rem;
}

.picture-sticker.large {
  width: 92px;
  height: 92px;
  font-size: 3.8rem;
}

.word-title {
  overflow-wrap: anywhere;
  font-size: clamp(2rem, 6vw, 4.8rem);
  line-height: 1;
}

.definition {
  max-width: 34rem;
  color: var(--ink);
  font-size: clamp(1.18rem, 2.1vw, 1.7rem);
  line-height: 1.35;
}

.hint-line {
  font-weight: 800;
}

.read-token {
  border-radius: 6px;
  box-decoration-break: clone;
  padding-inline: 2px;
  transition: color 120ms ease, background 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.read-token.speaking {
  color: #123642;
  background: #ffe07a;
  box-shadow: 0 0 0 3px rgba(255, 224, 122, 0.34);
}

.word-map {
  display: grid;
  gap: 11px;
  padding: 14px;
  border-radius: var(--radius-md);
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(185, 231, 245, 0.68), rgba(255, 255, 255, 0.84)),
    rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 0 0 2px rgba(8, 127, 140, 0.11);
}

.workshop-panel {
  display: grid;
  gap: 12px;
}

.word-map-head,
.prompt-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.say-line {
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.3;
}

.reading-parts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.reading-parts button,
.build-word-tray span {
  min-width: 48px;
  min-height: 54px;
  display: grid;
  place-items: center;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--radius-md);
  color: #fff9e9;
  background: linear-gradient(145deg, var(--coral), #e84d57);
  box-shadow: 0 11px 18px rgba(232, 77, 87, 0.22);
  font-size: clamp(1.24rem, 2vw, 1.7rem);
  font-weight: 900;
}

.reading-parts button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 22px rgba(232, 77, 87, 0.28);
}

.build-word-tray {
  display: grid;
  gap: 9px;
  padding: 14px;
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, rgba(255, 247, 218, 0.94), rgba(255, 255, 255, 0.84));
  box-shadow: inset 0 0 0 2px rgba(246, 183, 60, 0.16);
}

.build-word-tray > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.build-word-tray span {
  min-width: 44px;
  background: linear-gradient(145deg, var(--teal), #24a29b);
  box-shadow: 0 11px 18px rgba(8, 127, 140, 0.2);
}

.build-word-tray strong {
  width: fit-content;
  max-width: 100%;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--teal-deep);
  background: rgba(185, 231, 245, 0.44);
  font-size: clamp(1.2rem, 2vw, 1.65rem);
  overflow-wrap: anywhere;
}

.speaker-button {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 13px;
  border-radius: var(--radius-md);
  color: var(--teal-deep);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 0 0 2px rgba(8, 127, 140, 0.18), 0 9px 18px rgba(23, 49, 59, 0.1);
  font-weight: 900;
}

.speaker-button:hover {
  background: #fff;
  box-shadow: inset 0 0 0 3px rgba(8, 127, 140, 0.34), 0 12px 22px rgba(23, 49, 59, 0.14);
}

.speaker-glyph {
  position: relative;
  width: 24px;
  height: 20px;
  display: inline-block;
  flex: 0 0 auto;
}

.speaker-glyph::before {
  position: absolute;
  inset: 4px 10px 4px 1px;
  border-radius: 4px 0 0 4px;
  background: currentColor;
  clip-path: polygon(0 24%, 38% 24%, 100% 0, 100% 100%, 38% 76%, 0 76%);
  content: "";
}

.speaker-glyph::after,
.speaker-glyph span {
  position: absolute;
  border: 2px solid currentColor;
  border-left: 0;
  border-bottom: 0;
  border-radius: 0 18px 0 0;
  transform: rotate(45deg);
  content: "";
}

.speaker-glyph::after {
  width: 8px;
  height: 8px;
  right: 5px;
  top: 6px;
}

.speaker-glyph span {
  width: 14px;
  height: 14px;
  right: 0;
  top: 3px;
}

.listen-button .speaker-glyph,
.quiet-button .speaker-glyph {
  margin-right: 7px;
  vertical-align: -4px;
}

.example-line {
  padding: 14px;
  border-left: 6px solid var(--coral);
  border-radius: var(--radius-md);
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.66);
  line-height: 1.45;
}

.tour-rail {
  display: grid;
  gap: 12px;
  align-content: start;
}

.tour-guide {
  width: min(100%, 240px);
  justify-self: center;
  margin: -36px auto -8px;
}

.tour-dots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.tour-dots button {
  min-height: 46px;
  border: 0;
  border-radius: var(--radius-md);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 0 0 1px var(--line);
  font-weight: 800;
}

.tour-dots button.active {
  color: #fff9e9;
  background: var(--coral);
}

.question-card,
.result-card {
  display: grid;
  gap: 16px;
  overflow: hidden;
  padding: clamp(16px, 3vw, 26px);
}

.question-card {
  transition: opacity 250ms ease, transform 250ms ease;
}

.question-card.answered {
  animation: answer-settle 340ms ease;
}

.question-card.leaving {
  opacity: 0;
  transform: translateX(18px);
}

.prompt-copy {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: clamp(1.18rem, 2vw, 1.75rem);
  line-height: 1.38;
}

.prompt-row .prompt-copy {
  flex: 1 1 auto;
}

.prompt-row.compact strong {
  display: block;
}

.choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
}

.choice-tile {
  position: relative;
  min-height: 88px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
  padding: 8px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 0 0 1px rgba(23, 49, 59, 0.08);
  transition: background 180ms ease, transform 180ms ease;
}

.choice-button {
  min-height: 72px;
  width: 100%;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: var(--radius-md);
  color: var(--ink);
  text-align: left;
  overflow-wrap: anywhere;
  background: #fff;
  box-shadow: inset 0 0 0 2px rgba(23, 49, 59, 0.12), 0 10px 20px rgba(23, 49, 59, 0.1);
  font-weight: 800;
}

.choice-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
  overflow-wrap: anywhere;
}

.choice-copy strong {
  font-size: clamp(1.1rem, 1.5vw, 1.35rem);
}

.game-stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  min-height: clamp(520px, 62vw, 720px);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(135, 218, 246, 0.92), rgba(255, 244, 190, 0.9) 52%, rgba(80, 161, 83, 0.94) 53%);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.5), 0 18px 36px rgba(23, 49, 59, 0.16);
  touch-action: none;
}

.game-hud {
  position: absolute;
  inset: clamp(10px, 2vw, 18px) clamp(10px, 2vw, 18px) auto;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  pointer-events: none;
}

.game-hud > * {
  pointer-events: auto;
}

.game-clue {
  min-width: 0;
  max-width: min(100%, 610px);
  display: grid;
  gap: 9px;
  padding: clamp(12px, 2vw, 18px);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: rgba(255, 253, 245, 0.94);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.52), 0 14px 24px rgba(23, 49, 59, 0.15);
}

.game-clue .prompt-copy {
  font-size: clamp(1.18rem, 2.3vw, 2.05rem);
  font-weight: 900;
}

.game-sky {
  position: absolute;
  inset: 0 0 47%;
  z-index: -1;
  background:
    radial-gradient(circle at 78% 22%, rgba(255, 237, 132, 0.95) 0 54px, transparent 55px),
    radial-gradient(circle at 26% 28%, rgba(255, 255, 255, 0.78) 0 56px, transparent 58px),
    linear-gradient(180deg, #86dbf4, #d9f6ff);
}

.game-sky span {
  position: absolute;
  left: 7%;
  top: 28%;
  width: 130px;
  height: 46px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 72px -18px 0 12px rgba(255, 255, 255, 0.56), 360px 20px 0 4px rgba(255, 255, 255, 0.48);
}

.orchard-stage {
  --rabbit-x: 50%;
  min-height: clamp(590px, 64vw, 740px);
}

.apple-tree {
  position: absolute;
  inset: 17% 4% 17%;
  z-index: 1;
  pointer-events: none;
}

.tree-trunk {
  position: absolute;
  left: 47%;
  bottom: 14%;
  width: 9%;
  height: 45%;
  border-radius: 45% 45% 14px 14px;
  background:
    linear-gradient(90deg, rgba(92, 55, 28, 0.84), rgba(149, 87, 42, 0.96), rgba(82, 50, 25, 0.88));
}

.tree-top {
  position: absolute;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(183, 237, 130, 0.96), transparent 70px),
    linear-gradient(145deg, #58b35c, #2f8149);
  box-shadow: inset -18px -20px 0 rgba(19, 89, 49, 0.16), 0 20px 28px rgba(23, 49, 59, 0.13);
}

.tree-top.one {
  left: 3%;
  top: 6%;
  width: 46%;
  height: 56%;
}

.tree-top.two {
  left: 28%;
  top: 0;
  width: 46%;
  height: 60%;
}

.tree-top.three {
  right: 2%;
  top: 7%;
  width: 44%;
  height: 55%;
}

.apple-field {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.orchard-apple {
  position: absolute;
  left: var(--apple-x);
  top: var(--apple-y);
  width: clamp(74px, 8vw, 104px);
  min-height: clamp(76px, 8vw, 106px);
  display: grid;
  place-items: center;
  gap: 2px;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 999px;
  color: #17313b;
  background:
    radial-gradient(circle at 36% 28%, #fff8dd, #ffdf83 36%, #ff6b57 37%, #d9453f 100%);
  box-shadow: inset -8px -10px 0 rgba(111, 23, 23, 0.12), 0 12px 18px rgba(23, 49, 59, 0.17);
  animation: apple-pop 420ms ease both;
  animation-delay: var(--apple-delay);
}

.orchard-apple span {
  line-height: 0.9;
  font-size: clamp(2rem, 4vw, 3rem);
}

.orchard-apple strong {
  max-width: 8ch;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 253, 245, 0.9);
  box-shadow: 0 4px 8px rgba(23, 49, 59, 0.12);
  font-size: clamp(0.9rem, 1.3vw, 1.1rem);
  overflow-wrap: anywhere;
}

.orchard-apple:hover {
  transform: translate(-50%, -50%) scale(1.06);
}

.orchard-apple.wrong {
  animation: apple-wrong 420ms ease both;
}

.orchard-apple.caught {
  animation: apple-caught 640ms ease forwards;
}

.orchard-ground {
  position: absolute;
  left: -6%;
  right: -6%;
  bottom: -12%;
  z-index: 1;
  height: 33%;
  border-radius: 50% 50% 0 0;
  background:
    linear-gradient(115deg, transparent 0 34%, rgba(255, 225, 132, 0.9) 35% 55%, transparent 56%),
    linear-gradient(180deg, #83d36d, #3d8f54);
}

.orchard-rabbit {
  position: absolute;
  left: var(--rabbit-x);
  bottom: 10%;
  z-index: 3;
  width: clamp(108px, 15vw, 160px);
  height: clamp(98px, 13vw, 138px);
  transform: translateX(-50%);
  transition: left 120ms ease-out, transform 180ms ease;
}

.rabbit-face {
  position: absolute;
  left: 18%;
  bottom: 16%;
  width: 54%;
  height: 58%;
  border-radius: 55% 55% 44% 44%;
  background: #fff7ee;
  box-shadow: inset -10px -7px 0 rgba(214, 187, 166, 0.32), 0 12px 16px rgba(23, 49, 59, 0.14);
}

.rabbit-face::before,
.rabbit-face::after {
  position: absolute;
  top: 38%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #17313b;
  content: "";
}

.rabbit-face::before {
  left: 32%;
}

.rabbit-face::after {
  right: 32%;
}

.rabbit-ears {
  position: absolute;
  left: 23%;
  top: 0;
  width: 47%;
  height: 52%;
}

.rabbit-ears::before,
.rabbit-ears::after {
  position: absolute;
  bottom: 0;
  width: 30%;
  height: 100%;
  border-radius: 999px 999px 45% 45%;
  background: #fff7ee;
  box-shadow: inset 0 -24px 0 rgba(255, 184, 187, 0.34);
  content: "";
}

.rabbit-ears::before {
  left: 18%;
  transform: rotate(-12deg);
}

.rabbit-ears::after {
  right: 18%;
  transform: rotate(14deg);
}

.rabbit-basket {
  position: absolute;
  right: 7%;
  bottom: 5%;
  width: 48%;
  height: 37%;
  border: 5px solid #9a5a29;
  border-top-width: 7px;
  border-radius: 12px 12px 24px 24px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 222, 145, 0.95) 0 10px, rgba(198, 126, 57, 0.92) 10px 18px);
  box-shadow: inset 0 9px 0 rgba(255, 248, 208, 0.4);
}

.orchard-rabbit.celebrate {
  transform: translateX(-50%) translateY(-9px) rotate(-2deg);
}

.orchard-rabbit.miss {
  animation: try-nudge 360ms ease;
}

.orchard-message {
  position: absolute;
  left: clamp(12px, 2vw, 22px);
  right: clamp(12px, 2vw, 22px);
  bottom: clamp(12px, 2vw, 20px);
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 13px 15px;
  border-radius: var(--radius-md);
  color: var(--ink);
  background: rgba(255, 253, 245, 0.94);
  box-shadow: 0 12px 24px rgba(23, 49, 59, 0.16);
}

.orchard-message.good {
  color: #16431f;
  background: rgba(229, 255, 219, 0.96);
}

.orchard-message.try {
  color: #7a2f19;
  background: rgba(255, 235, 222, 0.97);
}

.orchard-message strong {
  font-size: 1.05rem;
}

.match-board,
.story-board,
.checkpoint-board {
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(185, 231, 245, 0.42)),
    rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 0 0 2px rgba(8, 127, 140, 0.1);
}

.match-board {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  gap: clamp(18px, 2vw, 24px);
  min-height: 520px;
  align-content: stretch;
  padding: clamp(14px, 2.5vw, 26px);
  background:
    radial-gradient(circle at 13% 10%, rgba(255, 255, 255, 0.96) 0 78px, transparent 80px),
    radial-gradient(circle at 84% 14%, rgba(255, 244, 178, 0.95) 0 58px, transparent 60px),
    linear-gradient(180deg, #8eddf7 0%, #ddf7ff 34%, #fff4c8 34%, #fff4c8 49%, #95d96f 49%, #3f965e 100%);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.54), 0 18px 36px rgba(23, 49, 59, 0.18);
}

.match-board::before {
  position: absolute;
  inset: auto -8% -14% -8%;
  z-index: 0;
  height: 47%;
  border-radius: 50% 50% 0 0;
  background:
    linear-gradient(128deg, transparent 0 23%, rgba(255, 227, 143, 0.96) 23% 37%, transparent 37% 56%, rgba(255, 227, 143, 0.9) 56% 70%, transparent 70%),
    linear-gradient(180deg, #78c85f, #388351);
  content: "";
}

.match-board.dragging {
  box-shadow: inset 0 0 0 3px rgba(246, 183, 60, 0.44), 0 14px 26px rgba(23, 49, 59, 0.12);
}

.match-wire {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#match-wire-path {
  fill: none;
  stroke: #ffd65f;
  stroke-linecap: round;
  stroke-width: 11px;
  filter: drop-shadow(0 5px 5px rgba(110, 73, 4, 0.22));
}

#match-wire-path.right {
  stroke: #64c76e;
}

#match-wire-path.try {
  stroke: #ff8d6e;
}

.match-clue,
.match-options {
  position: relative;
  z-index: 2;
}

.match-mission {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(92px, 14vw, 150px);
  gap: clamp(10px, 1.8vw, 18px);
  align-items: center;
}

.match-clue {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(12px, 1.8vw, 18px);
  align-items: center;
  min-width: 0;
}

.clue-cloud {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 253, 245, 0.92);
  box-shadow: 0 12px 24px rgba(23, 49, 59, 0.12);
}

.clue-cloud {
  position: relative;
  max-width: 690px;
  padding: clamp(16px, 2.2vw, 24px);
  border: 4px solid rgba(8, 127, 140, 0.22);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 247, 219, 0.94));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.58), 0 18px 28px rgba(23, 49, 59, 0.16);
}

.clue-cloud::before,
.clue-cloud::after {
  position: absolute;
  top: -18px;
  z-index: -1;
  width: 80px;
  height: 52px;
  border: inherit;
  border-bottom: 0;
  border-radius: 72px 72px 0 0;
  background: rgba(255, 255, 255, 0.95);
  content: "";
}

.clue-cloud::before {
  left: 28px;
}

.clue-cloud::after {
  left: 96px;
  width: 112px;
  height: 68px;
  top: -34px;
}

.clue-cloud .prompt-copy {
  max-width: 19ch;
  font-size: clamp(1.5rem, 2.7vw, 2.55rem);
  font-weight: 900;
}

.match-drag-row {
  display: grid;
  gap: clamp(10px, 1.6vw, 16px);
  align-items: center;
  justify-items: center;
}

.match-arrow {
  position: relative;
  width: min(100%, 140px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  justify-self: center;
  border: 5px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  color: #245138;
  background:
    radial-gradient(circle at 34% 30%, #fff8bf, #ffd45b 58%, #f4a527);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.34), 0 16px 24px rgba(78, 80, 23, 0.2);
  font-size: clamp(0.95rem, 1.2vw, 1.15rem);
  font-weight: 1000;
  text-transform: uppercase;
}

.match-arrow::after {
  position: absolute;
  top: calc(100% - 15px);
  left: 50%;
  width: 58px;
  height: 58px;
  transform: translateX(-50%);
  background: #ffd45b;
  clip-path: polygon(50% 100%, 0 12%, 36% 12%, 36% 0, 64% 0, 64% 12%, 100% 12%);
  filter: drop-shadow(0 8px 4px rgba(78, 80, 23, 0.17));
  content: "";
}

.match-memory {
  position: relative;
  z-index: 2;
  width: 118px;
  min-height: 118px;
  display: grid;
  gap: 4px;
  place-content: center;
  justify-items: center;
  flex: 0 0 auto;
  border: 5px solid rgba(255, 248, 221, 0.78);
  border-radius: 999px;
  color: #fff8dd;
  text-align: center;
  background: rgba(18, 74, 89, 0.86);
  box-shadow: 0 18px 26px rgba(23, 49, 59, 0.2);
}

.match-memory > span:not(.picture-sticker) {
  font-size: 3.7rem;
  font-weight: 900;
  line-height: 0.8;
}

.match-memory.revealed {
  color: var(--ink);
  background: rgba(255, 248, 221, 0.94);
}

.prompt-tools {
  justify-content: start;
}

.hint-button {
  min-height: 50px;
  font-weight: 900;
}

.recall-scene {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 220px;
  display: grid;
  place-items: center;
  padding: clamp(14px, 2vw, 20px);
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.96), transparent 110px),
    linear-gradient(180deg, rgba(185, 231, 245, 0.72), rgba(255, 250, 230, 0.86));
  box-shadow: inset 0 0 0 2px rgba(8, 127, 140, 0.12), 0 12px 22px rgba(23, 49, 59, 0.1);
}

.recall-scene > img {
  position: absolute;
  right: -7%;
  bottom: -18%;
  z-index: -1;
  width: min(70%, 320px);
  opacity: 0.28;
  filter: saturate(0.92);
}

.recall-cover,
.recall-picture {
  min-width: min(100%, 220px);
  max-width: 310px;
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: clamp(14px, 2vw, 20px);
  border-radius: var(--radius-md);
  text-align: center;
  background: rgba(255, 253, 245, 0.9);
  box-shadow: 0 14px 28px rgba(23, 49, 59, 0.12);
}

.recall-cover span {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border: 4px dashed rgba(8, 127, 140, 0.32);
  border-radius: 999px;
  color: var(--teal-deep);
  background: rgba(185, 231, 245, 0.44);
  font-size: 3.2rem;
  font-weight: 900;
}

.recall-cover strong,
.recall-picture strong {
  font-size: clamp(1.2rem, 1.8vw, 1.5rem);
}

.recall-cover p {
  max-width: 16rem;
  color: var(--ink-soft);
  font-weight: 800;
  line-height: 1.35;
}

.recall-scene.revealed {
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.96), transparent 120px),
    linear-gradient(180deg, rgba(255, 230, 146, 0.8), rgba(185, 231, 245, 0.7));
}

.match-handle {
  position: relative;
  z-index: 3;
  min-height: 70px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 12px clamp(14px, 1.6vw, 20px);
  border: 4px solid rgba(255, 255, 255, 0.58);
  border-radius: var(--radius-md);
  color: #633a00;
  background:
    linear-gradient(145deg, #fff4b7, #ffd65f 54%, #f2a428);
  box-shadow: inset 0 0 0 2px rgba(151, 96, 6, 0.12), 0 13px 22px rgba(132, 92, 8, 0.2);
  font-weight: 900;
  touch-action: none;
}

.match-handle span {
  width: 42px;
  height: 42px;
  background: #fff8d7;
  clip-path: polygon(50% 0, 62% 34%, 98% 36%, 70% 57%, 80% 94%, 50% 73%, 20% 94%, 30% 57%, 2% 36%, 38% 34%);
  filter: drop-shadow(0 0 9px rgba(255, 240, 144, 0.96));
}

.match-board.answered .match-handle {
  color: var(--ink-soft);
  background: rgba(23, 49, 59, 0.12);
  box-shadow: none;
}

.match-options {
  z-index: 2;
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 24px);
  align-items: end;
  min-height: 224px;
  padding: clamp(22px, 3vw, 34px) clamp(4px, 1.5vw, 18px) 0;
  border-top: 4px dashed rgba(255, 250, 216, 0.56);
}

.match-options::before {
  position: absolute;
  top: -18px;
  left: 50%;
  padding: 7px 16px;
  transform: translateX(-50%);
  border: 3px solid rgba(49, 119, 69, 0.18);
  border-radius: 999px;
  color: #21523b;
  background: rgba(255, 250, 218, 0.92);
  box-shadow: 0 8px 14px rgba(23, 49, 59, 0.12);
  content: "Word garden";
  font-weight: 1000;
  text-transform: uppercase;
}

.match-choice {
  position: relative;
  min-height: 220px;
  width: 100%;
  grid-template-columns: 1fr;
  align-content: stretch;
  justify-items: center;
  padding: 18px 12px 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.match-choice::before {
  position: absolute;
  inset: 4px 11% 48px;
  z-index: 0;
  border: 5px solid rgba(255, 251, 223, 0.8);
  border-radius: 52% 52% 10px 10px;
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 255, 255, 0.96), transparent 44px),
    linear-gradient(145deg, #ffb9c1, #ffde7f 58%, #f28e59);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.28), 0 15px 18px rgba(27, 48, 30, 0.22);
  content: "";
}

.match-choice::after {
  position: absolute;
  bottom: 18px;
  left: 50%;
  z-index: 0;
  width: min(54%, 122px);
  height: 62px;
  transform: translateX(-50%);
  border-radius: 999px 999px 12px 12px;
  background:
    linear-gradient(90deg, transparent 0 43%, #2a8654 43% 57%, transparent 57%),
    radial-gradient(circle at 50% 100%, #2a8654 0 48%, transparent 49%);
  content: "";
}

.match-choice .choice-button {
  z-index: 2;
  grid-area: 1 / 1;
  width: min(100%, 206px);
  min-height: 98px;
  justify-content: center;
  align-self: start;
  margin-top: 27px;
  border: 4px solid rgba(73, 67, 31, 0.2);
  border-radius: 8px;
  color: #13343e;
  text-align: center;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(255, 244, 205, 0.97));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.48), 0 12px 18px rgba(23, 49, 59, 0.17);
}

.match-choice .choice-copy strong {
  font-size: clamp(1.35rem, 2vw, 2rem);
}

.match-choice .choice-speaker {
  z-index: 3;
  grid-area: 1 / 1;
  min-width: 0;
  min-height: 46px;
  align-self: end;
  margin-bottom: 8px;
  padding-inline: 10px;
}

.match-choice.correct::before {
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 255, 255, 0.96), transparent 44px),
    linear-gradient(145deg, #d9ffd5, #9de17f 58%, #4f9b51);
}

.match-choice.wrong::before {
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 255, 255, 0.96), transparent 44px),
    linear-gradient(145deg, #fff0d7, #ffb096 58%, #c56556);
}

.story-board {
  display: grid;
  align-items: stretch;
  padding: clamp(14px, 2.4vw, 22px);
}

.story-bridge-stage {
  min-height: clamp(560px, 58vw, 680px);
  background:
    radial-gradient(circle at 78% 20%, rgba(255, 235, 132, 0.92) 0 56px, transparent 57px),
    linear-gradient(180deg, #98def7 0 44%, #9ed66f 45% 100%);
}

.story-sky {
  position: absolute;
  inset: 0 0 45%;
  z-index: -1;
  background:
    radial-gradient(circle at 25% 30%, rgba(255, 255, 255, 0.78) 0 54px, transparent 55px),
    linear-gradient(180deg, #9cdef6, #def8ff);
}

.story-work,
.checkpoint-work {
  min-width: 0;
  display: grid;
  gap: 14px;
  align-content: center;
}

.story-work {
  position: relative;
  z-index: 2;
  align-content: space-between;
}

.story-prompt {
  width: min(100%, 760px);
  padding: clamp(14px, 2vw, 20px);
  border-radius: var(--radius-md);
  background:
    linear-gradient(90deg, rgba(255, 250, 230, 0.98), rgba(255, 255, 255, 0.82));
  box-shadow: inset 0 0 0 2px rgba(246, 183, 60, 0.19), 0 10px 22px rgba(23, 49, 59, 0.1);
}

.story-bridge {
  position: relative;
  min-height: clamp(170px, 22vw, 245px);
  display: grid;
  place-items: center;
}

.bridge-bank {
  position: absolute;
  bottom: 24%;
  width: 32%;
  height: 38px;
  border-radius: 999px;
  background: linear-gradient(180deg, #8c5a31, #5b321a);
  box-shadow: 0 16px 18px rgba(23, 49, 59, 0.18);
}

.bridge-bank.left {
  left: 7%;
}

.bridge-bank.right {
  right: 7%;
}

.bridge-gap {
  position: relative;
  z-index: 2;
  min-width: min(62vw, 230px);
  min-height: 74px;
  display: grid;
  place-items: center;
  padding: 12px 18px;
  border: 5px dashed rgba(8, 127, 140, 0.38);
  border-radius: var(--radius-md);
  color: var(--teal-deep);
  background:
    linear-gradient(145deg, rgba(255, 253, 245, 0.96), rgba(255, 225, 132, 0.86));
  box-shadow: 0 14px 24px rgba(23, 49, 59, 0.14);
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  font-weight: 1000;
}

.bridge-friend {
  position: absolute;
  left: 9%;
  bottom: 42%;
  z-index: 3;
  font-size: clamp(3rem, 7vw, 5rem);
  filter: drop-shadow(0 12px 10px rgba(23, 49, 59, 0.16));
}

.story-slot {
  min-width: 104px;
  min-height: 52px;
  display: inline-grid;
  place-items: center;
  margin-inline: 4px;
  padding: 6px 12px;
  border: 3px dashed rgba(8, 127, 140, 0.42);
  border-radius: var(--radius-md);
  color: var(--teal-deep);
  background: rgba(185, 231, 245, 0.48);
  font-weight: 900;
  vertical-align: middle;
}

.story-slot.right {
  border-style: solid;
  color: #15411e;
  background: rgba(127, 216, 130, 0.38);
}

.story-slot.try {
  color: #7c2419;
  background: rgba(255, 107, 87, 0.2);
}

.story-stones {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 11px;
}

.story-choice {
  min-height: 114px;
  align-content: stretch;
  background:
    linear-gradient(180deg, rgba(255, 253, 245, 0.94), rgba(214, 151, 72, 0.42));
  box-shadow: 0 12px 18px rgba(71, 43, 17, 0.15);
}

.story-choice .choice-button {
  min-height: 90px;
  border: 3px solid rgba(91, 50, 26, 0.2);
  background: linear-gradient(145deg, #fff7d9, #f4bf6c);
}

.checkpoint-board {
  display: grid;
  grid-template-columns: minmax(230px, 0.52fr) minmax(0, 1fr);
  gap: 16px;
  padding: clamp(12px, 2.2vw, 20px);
}

.trail-gate-stage {
  min-height: clamp(530px, 56vw, 650px);
  background:
    radial-gradient(circle at 76% 18%, rgba(255, 235, 132, 0.92) 0 56px, transparent 57px),
    linear-gradient(180deg, #9ee4fa 0 46%, #89cf72 47% 100%);
}

.trail-gate-scene {
  position: relative;
  z-index: 1;
  min-height: 100%;
}

.gate-post,
.gate-door {
  position: absolute;
  bottom: 18%;
}

.gate-post {
  width: 34px;
  height: 215px;
  border-radius: 12px 12px 4px 4px;
  background: linear-gradient(90deg, #9b6735, #63371c);
  box-shadow: 0 12px 18px rgba(23, 49, 59, 0.16);
}

.gate-post.left {
  left: 16%;
}

.gate-post.right {
  left: calc(16% + 220px);
}

.gate-door {
  left: calc(16% + 28px);
  width: 212px;
  height: 160px;
  border: 6px solid #744019;
  border-radius: 10px;
  background:
    repeating-linear-gradient(90deg, #d89443 0 24px, #bf7030 24px 48px);
  transform-origin: left center;
  transition: transform 340ms ease;
  box-shadow: inset 0 0 0 4px rgba(255, 244, 198, 0.18), 0 16px 24px rgba(23, 49, 59, 0.2);
}

.gate-door.open {
  transform: perspective(420px) rotateY(-44deg);
}

.checkpoint-choices {
  grid-template-columns: 1fr;
}

.choice-button:hover {
  box-shadow: inset 0 0 0 3px rgba(8, 127, 140, 0.34), 0 12px 22px rgba(23, 49, 59, 0.14);
}

.choice-tile.correct {
  background: rgba(127, 216, 130, 0.28);
  animation: right-pop 420ms ease;
}

.choice-tile.correct .choice-button {
  color: #15411e;
  background: rgba(127, 216, 130, 0.38);
}

.choice-tile.wrong {
  background: rgba(255, 107, 87, 0.16);
  animation: try-nudge 380ms ease;
}

.choice-tile.wrong .choice-button {
  color: #7c2419;
  background: rgba(255, 107, 87, 0.22);
}

.choice-speaker {
  align-self: stretch;
  min-width: 78px;
}

.feedback {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.74);
}

.feedback.good {
  color: #22592d;
}

.feedback.try {
  color: #8a3f15;
}

.arcade-wrap {
  display: grid;
  gap: 14px;
}

.arcade-stage {
  position: relative;
  overflow: hidden;
  min-height: 520px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(10, 69, 90, 0.2), rgba(8, 33, 49, 0.72)),
    url("assets/storybook-path.png") center / cover;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.32), var(--shadow);
}

#lantern-canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 520px;
  touch-action: none;
}

.arcade-hud {
  position: absolute;
  inset: 14px 14px auto 14px;
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.arcade-prompt {
  width: min(100%, 720px);
  padding: 13px 15px;
  border-radius: var(--radius-md);
  color: var(--ink);
  background: rgba(255, 251, 239, 0.92);
  box-shadow: 0 12px 22px rgba(9, 31, 38, 0.16);
}

.arcade-prompt,
.arcade-prompt .speaker-button {
  pointer-events: auto;
}

.arcade-prompt strong {
  display: block;
  margin-top: 3px;
  font-size: clamp(1rem, 1.55vw, 1.3rem);
  line-height: 1.35;
}

#arcade-prompt.swap {
  animation: clue-swap 360ms ease;
}

.arcade-feedback {
  position: absolute;
  inset: auto 16px 18px 16px;
  z-index: 2;
  width: min(640px, calc(100% - 32px));
  display: none;
  gap: 3px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  box-shadow: 0 18px 34px rgba(9, 31, 38, 0.22);
}

.arcade-feedback.visible {
  display: grid;
  animation: feedback-rise 260ms ease;
}

.arcade-feedback.good {
  color: #13431f;
  background: rgba(232, 255, 218, 0.96);
}

.arcade-feedback.try {
  color: #712c1b;
  background: rgba(255, 232, 221, 0.97);
}

.arcade-feedback strong {
  font-size: 1.24rem;
}

.score-row {
  pointer-events: none;
}

.score-chip {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 8px 11px;
  border-radius: 999px;
  color: #fff9e9;
  background: rgba(23, 49, 59, 0.88);
  font-weight: 800;
}

.glossary-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 255px), 1fr));
}

.glossary-card {
  display: grid;
  gap: 10px;
}

.glossary-card strong {
  overflow-wrap: anywhere;
  font-size: 1.35rem;
}

.glossary-card .question-head > div {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.filter-row input,
.filter-row select {
  min-height: 50px;
  border: 0;
  border-radius: var(--radius-md);
  padding: 11px 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: inset 0 0 0 2px rgba(23, 49, 59, 0.12);
}

.filter-row input {
  flex: 1 1 260px;
}

.filter-row select {
  flex: 0 1 220px;
}

.research-note {
  display: grid;
  gap: 11px;
  padding: 18px;
  background: rgba(255, 253, 245, 0.88);
}

.research-note summary {
  cursor: pointer;
  font-weight: 800;
}

.empty-state {
  padding: 18px;
  border-radius: var(--radius-md);
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.74);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(9, 27, 34, 0.52);
}

.modal-panel {
  width: min(100%, 440px);
  display: grid;
  gap: 12px;
  padding: clamp(18px, 4vw, 28px);
  border-radius: var(--radius-lg);
  color: var(--ink);
  background: var(--paper-bright);
  box-shadow: var(--shadow);
}

.modal-panel p {
  color: var(--ink-soft);
  line-height: 1.45;
}

.sparkle {
  animation: float-glow 2.5s ease-in-out infinite;
}

@keyframes float-glow {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes answer-settle {
  0% {
    transform: scale(0.99);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes clue-swap {
  0% {
    opacity: 0;
    transform: translateY(-7px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes feedback-rise {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes right-pop {
  50% {
    transform: scale(1.02);
  }
}

@keyframes try-nudge {
  35% {
    transform: translateX(-4px);
  }
  70% {
    transform: translateX(4px);
  }
}

@keyframes apple-pop {
  from {
    opacity: 0;
    transform: translate(-50%, -62%) scale(0.84);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes apple-wrong {
  35% {
    transform: translate(-58%, -50%) rotate(-7deg);
  }
  70% {
    transform: translate(-42%, -50%) rotate(7deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(0);
  }
}

@keyframes apple-caught {
  0% {
    transform: translate(-50%, -50%) scale(1);
  }
  70% {
    transform: translate(-50%, 280%) scale(0.72);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, 310%) scale(0.6);
  }
}

@media (max-width: 780px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    width: auto;
    align-self: stretch;
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .sound-toggle {
    grid-column: auto;
  }

  .nav-button {
    width: 100%;
    padding-inline: 6px;
    overflow-wrap: anywhere;
    font-size: 0.92rem;
  }

  .hero-band,
  .word-tour,
  .discover-layout,
  .level-stop,
  .match-board,
  .story-board,
  .checkpoint-board {
    grid-template-columns: 1fr;
  }

  .screen-head,
  .question-head,
  .level-head {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-band {
    min-height: 500px;
    align-items: start;
  }

  .hero-book {
    width: min(62vw, 260px);
    justify-self: center;
  }

  .level-stop {
    align-items: stretch;
  }

  .level-stop-scene {
    min-height: 132px;
  }

  .word-card {
    min-height: 0;
  }

  .word-map-head,
  .prompt-row {
    align-items: stretch;
    flex-direction: column;
  }

  .choice-tile {
    grid-template-columns: 1fr;
  }

  .choice-speaker {
    min-height: 52px;
  }

  .word-picture.hero {
    min-height: 270px;
  }

  .match-handle {
    width: 100%;
  }

  .story-stones {
    grid-template-columns: 1fr;
  }

  .game-stage {
    min-height: 620px;
  }

  .game-hud {
    align-items: stretch;
    flex-direction: column;
  }

  .game-clue {
    max-width: none;
  }

  .orchard-stage {
    min-height: 690px;
  }

  .apple-tree {
    inset: 23% 0 18%;
  }

  .orchard-apple {
    width: 74px;
    min-height: 78px;
  }

  .orchard-apple strong {
    font-size: 0.86rem;
  }

  .orchard-rabbit {
    bottom: 12%;
  }

  .orchard-message {
    align-items: flex-start;
    flex-direction: column;
  }

  .story-bridge-stage,
  .trail-gate-stage {
    min-height: 680px;
  }

  .bridge-bank {
    width: 30%;
  }

  .gate-post.left {
    left: 12%;
  }

  .gate-post.right {
    left: calc(12% + 176px);
  }

  .gate-door {
    left: calc(12% + 28px);
    width: 168px;
  }

  .match-board {
    min-height: 680px;
  }

  .match-mission {
    grid-template-columns: 1fr;
  }

  .match-clue {
    grid-template-columns: 1fr;
  }

  .match-arrow {
    width: 98px;
  }

  .match-memory {
    width: 104px;
    min-height: 104px;
  }

  .match-handle {
    width: min(100%, 290px);
  }

  .match-options {
    grid-template-columns: 1fr;
  }

  .match-choice {
    min-height: 198px;
  }

  .arcade-stage,
  #lantern-canvas {
    min-height: 470px;
  }
}

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