:root {
  --ink: #14233c;
  --muted: #60708a;
  --cream: #fffaf0;
  --paper: #ffffff;
  --teal: #10b8a6;
  --navy: #223b73;
  --yellow: #ffc83d;
  --orange: #ff8a3d;
  --pink: #ff5f8f;
  --purple: #7656e8;
  --sky: #68d8ff;
  --green: #53c56a;
  --shadow: 0 24px 70px rgba(29, 49, 91, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 10%, rgba(104, 216, 255, 0.28), transparent 24rem),
    radial-gradient(circle at 88% 12%, rgba(255, 95, 143, 0.17), transparent 22rem),
    linear-gradient(180deg, #f7fcff 0%, #fff9ed 52%, #f8fbff 100%);
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 14px 0 28px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 44px rgba(33, 58, 111, 0.13);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  color: white;
  font-size: 25px;
  font-weight: 900;
  background: linear-gradient(145deg, var(--teal), var(--navy));
  box-shadow: 0 8px 20px rgba(34, 59, 115, 0.24);
}

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

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-actions a {
  color: var(--navy);
  font-weight: 800;
  text-decoration: none;
}

.topbar-actions button,
.fullscreen-button,
.player-controls button {
  border: 0;
  border-radius: 13px;
  color: white;
  font-weight: 900;
  background: linear-gradient(135deg, var(--navy), var(--purple));
  box-shadow: 0 10px 20px rgba(51, 63, 151, 0.2);
}

.topbar-actions button {
  padding: 11px 16px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(520px, 1.15fr);
  align-items: center;
  gap: 38px;
  min-height: 520px;
  padding: 42px;
  overflow: hidden;
  border-radius: 38px;
  color: white;
  background:
    linear-gradient(125deg, rgba(19, 43, 85, 0.97), rgba(38, 82, 147, 0.91)),
    #203f76;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #8df8ea;
}

.hero h1,
.section-heading h2,
.change-summary h2 {
  margin: 0;
  line-height: 1;
}

.hero h1 {
  max-width: 620px;
  font-size: clamp(52px, 7vw, 96px);
  letter-spacing: -0.06em;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 590px;
  margin: 24px 0;
  color: #dbe7ff;
  font-size: 20px;
  line-height: 1.65;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-badges span {
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #f8fbff;
  font-size: 13px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
}

.hero-scene {
  position: relative;
  min-height: 430px;
}

.hero-cast {
  position: absolute;
  inset: 28px 0 0;
  overflow: hidden;
  border-radius: 44px;
  background:
    radial-gradient(circle at 14% 16%, rgba(255, 200, 61, 0.9) 0 42px, transparent 43px),
    radial-gradient(circle at 86% 82%, rgba(255, 95, 143, 0.56) 0 70px, transparent 71px),
    rgba(255, 255, 255, 0.1);
}

.hero-person,
.hero-animal {
  position: absolute;
  bottom: 18px;
  filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.2));
}

.hero-person img {
  display: block;
  width: 150px;
  height: 210px;
  object-fit: contain;
}

.hero-person.mika { left: 21%; bottom: 10px; }
.hero-person.bibo { left: 2%; bottom: 4px; }
.hero-person.momo { left: 52%; bottom: 5px; }
.hero-person.pako { right: 3%; bottom: 8px; }

.hero-person.mika img { width: 180px; height: 300px; }
.hero-person.bibo img { width: 150px; height: 180px; }
.hero-person.momo img { width: 160px; height: 205px; }
.hero-person.pako img { width: 170px; height: 215px; }

.hero-animal .animal-art {
  display: block;
  width: 108px;
  height: 100px;
  object-fit: contain;
}

.hero-animal.ant {
  bottom: 2px;
  left: 1%;
}

.hero-animal.bear {
  right: 1%;
  bottom: 0;
}

.lesson-section,
.cast-section,
.change-summary {
  padding: 86px 0 0;
}

.lesson-section {
  scroll-margin-top: 82px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.section-heading h2,
.change-summary h2 {
  font-size: clamp(34px, 5vw, 58px);
  letter-spacing: -0.045em;
}

.fullscreen-button {
  padding: 12px 18px;
}

.lesson-workspace {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px;
  min-height: 760px;
}

.lesson-workspace.is-focus {
  position: fixed;
  inset: 0;
  z-index: 100;
  grid-template-columns: 220px minmax(0, 1fr);
  padding: 18px;
  background: #eaf6ff;
}

.page-rail,
.stage-card {
  border: 1px solid rgba(36, 61, 109, 0.08);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.page-rail {
  padding: 16px 10px 16px 16px;
  overflow: hidden;
}

.rail-heading {
  padding: 4px 8px 13px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-buttons {
  display: grid;
  gap: 8px;
  max-height: 690px;
  padding-right: 6px;
  overflow-y: auto;
}

.page-buttons button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px;
  border: 0;
  border-radius: 13px;
  color: var(--ink);
  text-align: left;
  background: transparent;
}

.page-buttons button strong {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: var(--navy);
  background: #edf3ff;
}

.page-buttons button span {
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-buttons button:hover,
.page-buttons button.is-active {
  background: #e7fbf7;
}

.page-buttons button.is-active strong {
  color: white;
  background: var(--teal);
}

.stage-card {
  display: flex;
  min-width: 0;
  padding: 18px;
  flex-direction: column;
}

.stage-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px 12px;
}

.stage-meta span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.slide-canvas {
  position: relative;
  display: grid;
  min-height: 560px;
  place-items: center;
  overflow: hidden;
  border-radius: 22px;
  background: #dff7ff;
  isolation: isolate;
}

.slide-canvas::before,
.slide-canvas::after {
  position: absolute;
  z-index: -2;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  content: "";
  filter: blur(10px);
}

.slide-canvas::before {
  top: -90px;
  left: -70px;
  background: rgba(255, 200, 61, 0.5);
}

.slide-canvas::after {
  right: -90px;
  bottom: -110px;
  background: rgba(255, 95, 143, 0.42);
}

.scene {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 34px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.75), transparent 20rem),
    linear-gradient(145deg, #dff9ff, #fff6db);
}

.scene::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.38;
  content: "";
  background-image:
    linear-gradient(30deg, transparent 94%, rgba(34, 59, 115, 0.12) 95%),
    linear-gradient(-30deg, transparent 94%, rgba(16, 184, 166, 0.15) 95%);
  background-size: 54px 54px;
}

.scene-board {
  position: relative;
  display: grid;
  width: min(100%, 980px);
  min-height: 460px;
  place-items: center;
  padding: 38px;
  overflow: hidden;
  border: 12px solid #2c8e88;
  border-radius: 30px;
  background: var(--paper);
  box-shadow:
    0 18px 0 rgba(34, 59, 115, 0.11),
    0 28px 48px rgba(29, 49, 91, 0.19);
}

.scene-board.board-dark {
  border-color: #f1b94d;
  color: white;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.05), transparent 14rem),
    #172b4d;
}

.scene-board.board-paper {
  border-color: #ff9b66;
  background:
    repeating-linear-gradient(#fff 0 34px, #d9edff 35px 36px);
}

.scene-board.board-game {
  border-color: #6649ce;
  color: white;
  background: linear-gradient(135deg, #273d83, #6f49d7 60%, #a64ee1);
}

.scene.theme-doodle {
  background:
    radial-gradient(circle at 12% 18%, #fff 0 34px, transparent 36px),
    radial-gradient(circle at 88% 78%, #fff 0 44px, transparent 46px),
    linear-gradient(145deg, #fff0e6 0%, #f9e9ff 50%, #eaf8ff 100%);
}

.scene.theme-doodle::before {
  opacity: 0.85;
  background:
    radial-gradient(circle at 8% 72%, #ff8e9e 0 8px, transparent 9px),
    radial-gradient(circle at 91% 24%, #ffd34f 0 10px, transparent 11px),
    repeating-linear-gradient(18deg, transparent 0 36px, rgba(118, 86, 232, 0.08) 37px 39px);
  background-size: auto, auto, 90px 90px;
}

.scene-board.theme-doodle {
  border: 9px solid #ffb95f;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 10%, #ffe7ee 0 32px, transparent 33px),
    radial-gradient(circle at 93% 88%, #e5f8ff 0 42px, transparent 43px),
    #fffefb;
  box-shadow:
    0 0 0 6px rgba(255, 255, 255, 0.86),
    0 20px 0 rgba(118, 86, 232, 0.1),
    0 32px 52px rgba(73, 58, 120, 0.18);
}

.scene-board.theme-doodle::before,
.scene-board.theme-doodle::after {
  position: absolute;
  z-index: 0;
  color: #ff7f50;
  font-size: 48px;
  font-weight: 900;
  content: "A";
  transform: rotate(-13deg);
}

.scene-board.theme-doodle::before {
  top: 16px;
  left: 24px;
}

.scene-board.theme-doodle::after {
  right: 24px;
  bottom: 12px;
  color: #4dc9bb;
  content: "B";
  transform: rotate(11deg);
}

.scene.theme-stationery {
  background:
    radial-gradient(circle at 10% 14%, rgba(255, 207, 88, 0.45) 0 42px, transparent 44px),
    radial-gradient(circle at 92% 80%, rgba(86, 210, 197, 0.35) 0 58px, transparent 60px),
    linear-gradient(145deg, #fff9e9, #edfdf9);
}

.scene.theme-stationery::before {
  opacity: 0.5;
  background-image:
    linear-gradient(30deg, transparent 94%, rgba(255, 132, 102, 0.2) 95%),
    linear-gradient(-30deg, transparent 94%, rgba(255, 197, 62, 0.2) 95%);
  background-size: 48px 48px;
}

.scene-board.theme-stationery {
  border: 8px solid #ff9a7c;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent 0 52px, rgba(255, 126, 126, 0.18) 53px 55px, transparent 56px),
    repeating-linear-gradient(#fffefc 0 37px, #dcefff 38px 39px);
  box-shadow:
    0 0 0 6px #ffd881,
    0 21px 0 rgba(255, 154, 124, 0.13),
    0 32px 48px rgba(68, 80, 115, 0.16);
}

.scene-board.theme-stationery.board-dark,
.scene-board.theme-stationery.board-paper,
.scene-board.theme-stationery.board-game {
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent 0 52px, rgba(255, 126, 126, 0.18) 53px 55px, transparent 56px),
    repeating-linear-gradient(#fffefc 0 37px, #dcefff 38px 39px);
}

.scene-board.theme-stationery .slide-kicker {
  color: #e8744c !important;
}

.scene-board.theme-stationery .alphabet-board span {
  text-shadow: 0 3px 0 rgba(34, 59, 115, 0.08);
}

.scene.theme-notebook {
  background:
    radial-gradient(circle at 16% 20%, rgba(255, 255, 255, 0.95) 0 34px, transparent 36px),
    radial-gradient(circle at 88% 75%, rgba(255, 255, 255, 0.9) 0 46px, transparent 48px),
    #dff4ff;
}

.scene.theme-notebook::before {
  opacity: 0.55;
  background:
    repeating-radial-gradient(circle at 18px 18px, transparent 0 12px, rgba(61, 116, 165, 0.16) 13px 15px, transparent 16px 34px);
  background-size: 70px 70px;
}

.scene-board.theme-notebook {
  border: 8px solid #294c72;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent 0 54px, rgba(255, 108, 120, 0.2) 55px 57px, transparent 58px),
    repeating-linear-gradient(#fff 0 35px, #dcefff 36px 38px);
  box-shadow:
    0 0 0 5px #8bcde7,
    0 20px 0 rgba(41, 76, 114, 0.13),
    0 32px 48px rgba(41, 76, 114, 0.2);
}

.scene-board.theme-notebook.board-dark,
.scene-board.theme-notebook.board-paper,
.scene-board.theme-notebook.board-game {
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent 0 54px, rgba(255, 108, 120, 0.2) 55px 57px, transparent 58px),
    repeating-linear-gradient(#fff 0 35px, #dcefff 36px 38px);
}

.scene-board.theme-notebook::before {
  position: absolute;
  top: 28px;
  bottom: 28px;
  left: 18px;
  z-index: 1;
  width: 18px;
  content: "";
  background: radial-gradient(circle, #294c72 0 5px, transparent 6px) center top / 18px 36px repeat-y;
}

.scene.theme-animal {
  background:
    radial-gradient(ellipse at 12% 17%, #fff 0 58px, transparent 60px),
    radial-gradient(ellipse at 86% 24%, #fff 0 72px, transparent 74px),
    linear-gradient(180deg, #dff4ff 0 58%, #ffe6c8 59% 100%);
}

.scene.theme-animal::before {
  opacity: 0.42;
  background:
    radial-gradient(circle at 12% 78%, #8b5a3c 0 25px, transparent 26px),
    radial-gradient(circle at 88% 78%, #b47850 0 25px, transparent 26px),
    linear-gradient(transparent 88%, rgba(255, 255, 255, 0.62) 89%);
}

.scene-board.theme-animal {
  border: 8px solid #e5a16f;
  color: var(--ink);
  background:
    radial-gradient(circle at 4% 10%, #f5c18f 0 16px, transparent 17px),
    radial-gradient(circle at 96% 10%, #f5c18f 0 16px, transparent 17px),
    #fff;
  box-shadow:
    0 0 0 6px #fff1df,
    0 20px 0 rgba(123, 77, 50, 0.12),
    0 32px 50px rgba(76, 75, 100, 0.18);
}

.scene-board.theme-animal.board-dark,
.scene-board.theme-animal.board-paper,
.scene-board.theme-animal.board-game {
  color: var(--ink);
  background:
    radial-gradient(circle at 4% 10%, #f5c18f 0 16px, transparent 17px),
    radial-gradient(circle at 96% 10%, #f5c18f 0 16px, transparent 17px),
    #fff;
}

.scene-board > * {
  position: relative;
  z-index: 2;
}

.slide-heading {
  position: relative;
  z-index: 4;
  margin: 0;
  max-width: 780px;
  color: inherit;
  font-size: clamp(50px, 6.5vw, 88px);
  line-height: 0.95;
  text-align: center;
  letter-spacing: -0.055em;
}

.slide-heading.small {
  font-size: clamp(38px, 5vw, 64px);
}

.slide-kicker {
  margin: 0 0 14px;
  color: var(--teal);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
}

.slide-copy {
  position: relative;
  z-index: 4;
  max-width: 720px;
  margin: 18px auto 0;
  color: inherit;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
}

.letter-pair {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 16px;
}

.letter-pair strong {
  color: var(--orange);
  font-size: clamp(118px, 16vw, 200px);
  line-height: 0.8;
  text-shadow: 0 8px 0 rgba(255, 138, 61, 0.15);
}

.letter-pair strong:last-child {
  color: var(--teal);
}

.alphabet-board {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px 12px;
  width: 100%;
}

.alphabet-board span {
  color: #f9fbff;
  font-size: clamp(27px, 3.2vw, 45px);
  font-weight: 900;
  text-align: center;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
}

.alphabet-board span:nth-child(5n + 1) { color: #83f29d; }
.alphabet-board span:nth-child(5n + 2) { color: #78dfff; }
.alphabet-board span:nth-child(5n + 3) { color: #ffd86b; }
.alphabet-board span:nth-child(5n + 4) { color: #ff8aad; }
.alphabet-board span:nth-child(5n) { color: #d3b2ff; }

.character-row,
.animal-row,
.action-row {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.character-label {
  position: absolute;
  right: 8px;
  bottom: 8px;
  left: 8px;
  padding: 8px;
  border-radius: 12px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  text-align: center;
  background: rgba(255, 255, 255, 0.9);
}

.character-card,
.animal-card,
.word-card,
.action-card {
  position: relative;
  display: grid;
  min-width: 140px;
  min-height: 170px;
  place-items: center;
  padding: 12px 12px 42px;
  border: 3px solid rgba(34, 59, 115, 0.1);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 24px rgba(29, 49, 91, 0.14);
}

.character-card img,
.animal-card .animal-art,
.action-card img {
  width: 135px;
  height: 135px;
  overflow: visible;
  object-fit: contain;
}

.animal-card .animal-art,
.reveal-content .animal-art {
  filter: drop-shadow(0 12px 10px rgba(42, 52, 82, 0.16));
  animation: animalFloat 2.6s ease-in-out infinite;
}

.animal-card .animal-alligator {
  width: 155px;
}

.character-card img.character-mika,
.action-card img.character-mika {
  width: 145px;
  height: 145px;
}

.action-card img.action-run {
  animation: characterRun 0.8s ease-in-out infinite alternate;
}

.action-card img.action-jump {
  animation: characterJump 0.9s ease-in-out infinite;
}

.action-card img.action-clap {
  animation: characterClap 0.65s ease-in-out infinite alternate;
}

.word-card {
  min-height: 120px;
  padding: 18px;
  color: var(--navy);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 900;
}

.word-card.is-a {
  border-color: rgba(255, 138, 61, 0.55);
}

.word-card.is-b {
  border-color: rgba(16, 184, 166, 0.55);
}

.reveal-grid {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  width: min(100%, 720px);
}

.sound-item {
  display: grid;
  min-width: 0;
  place-items: center;
  gap: 9px;
}

.animal-row > .sound-item {
  align-self: stretch;
}

.sound-item .animal-card,
.sound-item .reveal-card {
  width: 100%;
}

.audio-button {
  position: relative;
  z-index: 8;
  display: inline-flex;
  min-width: 112px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 15px;
  border: 0;
  border-radius: 999px;
  color: white;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #7357e8, #2b91d4);
  box-shadow: 0 9px 18px rgba(53, 72, 157, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.audio-button:hover,
.audio-button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 22px rgba(53, 72, 157, 0.32);
}

.audio-button.is-playing {
  background: linear-gradient(135deg, #ff7c54, #ff4f8a);
  animation: audioPulse 0.75s ease-in-out infinite alternate;
}

.speaker-icon {
  position: relative;
  display: block;
  width: 19px;
  height: 18px;
}

.speaker-icon::before {
  position: absolute;
  top: 5px;
  left: 0;
  width: 7px;
  height: 8px;
  border-radius: 2px;
  background: currentColor;
  content: "";
  box-shadow: 5px 0 0 -1px currentColor;
}

.speaker-icon::after {
  position: absolute;
  top: 2px;
  right: 0;
  width: 9px;
  height: 13px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-bottom-color: transparent;
  border-left: 0;
  border-radius: 0 50% 50% 0;
  content: "";
}

.sentence-audio {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.reveal-card {
  position: relative;
  min-height: 220px;
  border: 0;
  border-radius: 28px;
  color: white;
  background: linear-gradient(145deg, #167cca, #2457aa);
  box-shadow:
    inset 0 -12px 20px rgba(4, 47, 112, 0.25),
    0 18px 30px rgba(32, 78, 154, 0.28);
  perspective: 900px;
}

.reveal-card::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 26px;
  border: 5px solid white;
  border-top: 0;
  border-radius: 5px;
  content: "";
  transform: translate(-50%, -32%);
}

.reveal-card::after {
  position: absolute;
  top: calc(50% - 19px);
  left: 50%;
  width: 21px;
  height: 22px;
  border: 5px solid white;
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
  content: "";
  transform: translateX(-50%);
  transform-origin: left bottom;
  transition: transform 0.5s cubic-bezier(0.2, 0.9, 0.2, 1.35);
}

.reveal-card .reveal-content {
  position: absolute;
  inset: 10px;
  display: grid;
  place-items: center;
  padding: 12px;
  border-radius: 20px;
  color: var(--ink);
  font-size: 28px;
  font-weight: 900;
  background: white;
  opacity: 0;
  transform: rotateX(-86deg) scale(0.75);
  transform-origin: center top;
  transition:
    opacity 0.25s ease,
    transform 0.55s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.reveal-card .animal-art {
  width: 150px;
  height: 130px;
  object-fit: contain;
}

.reveal-card.is-open {
  background: linear-gradient(145deg, #0cae9d, #168a7e);
}

.reveal-card.is-open::before,
.reveal-card.is-open::after {
  opacity: 0;
}

.reveal-card.is-open::after {
  transform: translateX(-50%) rotate(-48deg);
}

.reveal-card.is-open .reveal-content {
  opacity: 1;
  transform: rotateX(0deg) scale(1);
}

.photo-frame {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(220px, 0.7fr);
  gap: 24px;
  width: min(100%, 850px);
  align-items: center;
}

.photo-frame img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border: 10px solid white;
  border-radius: 22px;
  box-shadow: 0 16px 30px rgba(29, 49, 91, 0.22);
}

.photo-frame strong {
  color: var(--navy);
  font-size: clamp(36px, 5vw, 68px);
  line-height: 1;
}

.sentence-panel {
  display: grid;
  place-items: start;
  gap: 20px;
}

.banner-rainbow {
  position: relative;
  z-index: 4;
  width: min(100%, 860px);
  padding: 36px;
  border-radius: 30px;
  color: white;
  font-size: clamp(42px, 6vw, 82px);
  font-weight: 900;
  line-height: 1;
  text-align: center;
  animation: bannerColors 4s linear infinite, bannerFloat 1.8s ease-in-out infinite;
}

.match-grid {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  width: min(100%, 820px);
}

.match-tile {
  display: grid;
  min-height: 116px;
  place-items: center;
  border: 4px solid transparent;
  border-radius: 22px;
  color: var(--navy);
  font-size: 32px;
  font-weight: 900;
  background: white;
  box-shadow: 0 12px 20px rgba(29, 49, 91, 0.14);
}

button.match-tile.is-picked {
  border-color: var(--yellow);
  transform: translateY(-4px);
}

button.match-tile.is-correct {
  border-color: var(--green);
  color: #176b2a;
  background: #eaffed;
}

.teacher-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-top: 14px;
}

.teacher-strip > div {
  padding: 13px 15px;
  border-radius: 15px;
  background: #f3f7fc;
}

.teacher-strip span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.teacher-strip p {
  margin: 5px 0 0;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
}

.player-controls {
  display: grid;
  grid-template-columns: auto minmax(90px, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding-top: 14px;
}

.player-controls button {
  min-width: 92px;
  padding: 11px 16px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce7f5;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--sky), var(--purple));
  transition: width 0.35s ease;
}

.cast-grid,
.change-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.cast-grid article,
.change-grid article {
  padding: 22px;
  border: 1px solid rgba(36, 61, 109, 0.08);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.91);
  box-shadow: 0 18px 44px rgba(29, 49, 91, 0.1);
}

.cast-grid img {
  display: block;
  width: 180px;
  max-width: 100%;
  height: 180px;
  margin: 0 auto 12px;
  object-fit: contain;
}

.cast-grid h3,
.change-grid strong {
  display: block;
  margin: 0 0 8px;
  font-size: 21px;
}

.cast-grid p,
.change-grid p,
.photo-credit {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.change-summary {
  padding-bottom: 100px;
}

.change-summary h2 {
  max-width: 900px;
  margin-bottom: 26px;
}

.photo-credit {
  margin-top: 18px;
  font-size: 12px;
}

.transition-23 { animation: slideRise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1); }
.transition-54 { animation: slideSweep 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.transition-90 { animation: sectionZoom 0.65s cubic-bezier(0.16, 1, 0.3, 1); }
.transition-17 { animation: colorPop 0.7s cubic-bezier(0.16, 1, 0.3, 1); }

.character-card,
.animal-card,
.word-card,
.action-card {
  animation: cardIn 0.55s both;
}

.character-row > :nth-child(2),
.animal-row > :nth-child(2),
.action-row > :nth-child(2) { animation-delay: 0.08s; }
.character-row > :nth-child(3),
.animal-row > :nth-child(3),
.action-row > :nth-child(3) { animation-delay: 0.16s; }
.character-row > :nth-child(4),
.animal-row > :nth-child(4),
.action-row > :nth-child(4) { animation-delay: 0.24s; }

@keyframes slideRise {
  from { opacity: 0; transform: translateY(36px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes slideSweep {
  from { opacity: 0; transform: translateX(42px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes sectionZoom {
  from { opacity: 0; transform: scale(0.82) rotate(-1deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes colorPop {
  0% { opacity: 0; filter: hue-rotate(80deg); transform: scale(0.75); }
  70% { transform: scale(1.04); }
  100% { opacity: 1; filter: hue-rotate(0); transform: scale(1); }
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(28px) rotate(-2deg); }
  to { opacity: 1; transform: translateY(0) rotate(0); }
}

@keyframes animalFloat {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-7px) rotate(1deg); }
}

@keyframes audioPulse {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

@keyframes characterRun {
  from { transform: translateX(-7px) rotate(-5deg); }
  to { transform: translateX(7px) rotate(5deg); }
}

@keyframes characterJump {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

@keyframes characterClap {
  from { transform: scale(0.96); }
  to { transform: scale(1.04); }
}

@keyframes bannerColors {
  0% { background: #ff5f8f; }
  25% { background: #7656e8; }
  50% { background: #10b8a6; }
  75% { background: #ff8a3d; }
  100% { background: #ff5f8f; }
}

@keyframes bannerFloat {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-12px) rotate(1deg); }
}

@media (max-width: 1050px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-scene {
    min-height: 360px;
  }

  .lesson-workspace {
    grid-template-columns: 1fr;
  }

  .page-rail {
    padding: 12px;
  }

  .page-buttons {
    grid-auto-flow: column;
    grid-auto-columns: 150px;
    max-height: none;
    overflow-x: auto;
  }

  .page-buttons button {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .cast-grid,
  .change-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 18px, 1480px);
  }

  .topbar-actions a,
  .fullscreen-button {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 28px 20px;
    border-radius: 28px;
  }

  .hero h1 {
    font-size: 56px;
  }

  .hero-scene {
    min-height: 270px;
  }

  .hero-person img {
    width: 84px;
    height: 118px;
  }

  .hero-person.mika { left: 19%; }
  .hero-person.bibo { left: 0; }
  .hero-person.momo { left: 52%; }
  .hero-person.pako { right: 0; }

  .hero-person.mika img { width: 104px; height: 176px; }
  .hero-person.bibo img { width: 85px; height: 104px; }
  .hero-person.momo img { width: 90px; height: 116px; }
  .hero-person.pako img { width: 96px; height: 120px; }

  .hero-animal .animal-art {
    width: 74px;
    height: 66px;
  }

  .section-heading {
    align-items: start;
  }

  .stage-card {
    padding: 10px;
  }

  .lesson-workspace.is-focus {
    grid-template-columns: 1fr;
    padding: 8px;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .lesson-workspace.is-focus .page-rail {
    display: none;
  }

  .lesson-workspace.is-focus .stage-card,
  .lesson-workspace.is-focus .slide-canvas,
  .lesson-workspace.is-focus .scene,
  .lesson-workspace.is-focus .scene-board,
  .lesson-workspace.is-focus .reveal-grid {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .lesson-workspace.is-focus .stage-meta span {
    max-width: 48%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .slide-canvas {
    min-height: 570px;
  }

  .scene {
    padding: 12px;
  }

  .scene-board {
    min-height: 520px;
    padding: 22px 14px;
    border-width: 7px;
  }

  .character-row,
  .animal-row,
  .action-row {
    flex-wrap: wrap;
  }

  .character-card,
  .animal-card,
  .action-card {
    min-width: 120px;
  }

  .character-card img,
  .animal-card .animal-art,
  .action-card img {
    width: 106px;
    height: 106px;
  }

  .animal-card .animal-alligator {
    width: 118px;
  }

  .reveal-grid,
  .photo-frame,
  .teacher-strip {
    grid-template-columns: 1fr;
  }

  .sentence-panel {
    place-items: center;
    text-align: center;
  }

  .reveal-card {
    min-height: 150px;
  }

  .match-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cast-grid,
  .change-grid {
    grid-template-columns: 1fr;
  }
}
