/* Baseline learning controls and book reader come verbatim from Kids-flashcards.
   This file adds the new path, course integration, image slots and responsive safety. */
:root {
  --path-green: #58aa89;
  --muted: #777183;
  --line: #d3e2d9;
  --paper: #fffdf6;
}
body {
  overflow: auto;
  min-height: 100dvh;
}
button,
input {
  touch-action: manipulation;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #5e79c9;
  outline-offset: 5px;
}
button:disabled {
  cursor: default;
}
button[aria-disabled="true"] {
  cursor: default;
}
img {
  max-width: 100%;
  -webkit-user-drag: none;
}
#app {
  min-height: 100dvh;
}
.boot {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 20px;
}
.boot span {
  font-size: 70px;
}
.boot p {
  color: var(--sub);
}
/* Path */
.path-screen {
  min-height: 100dvh;
  position: relative;
  background: linear-gradient(160deg, #eaf6ff 0%, #fff8ee 50%, #f1f9ef 100%);
  padding-bottom: 115px;
}
.path-header {
  max-width: 660px;
  margin: auto;
  padding: calc(22px + env(safe-area-inset-top)) 24px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  font-size: 37px;
  line-height: 1;
}
.brand-title {
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 0.03em;
}
.brand-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.parent-open {
  margin-left: auto;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: white;
  box-shadow: var(--shadow);
  font-size: 22px;
}
.unit-hero {
  position: relative;
  max-width: 600px;
  margin: 4px auto 0;
  padding: 24px 28px 22px;
  background: var(--path-green);
  color: #fff;
  border-radius: 28px;
  box-shadow: 0 7px 0 #43876b;
  overflow: hidden;
}
.unit-eyebrow {
  font-size: 12px;
  letter-spacing: 0.14em;
  font-weight: 900;
  color: #e5f6ed;
}
.unit-hero h1 {
  font-size: 30px;
  line-height: 1.45;
  margin: 5px 0 2px;
}
.unit-hero p {
  font-family: "Baloo 2", sans-serif;
  font-size: 17px;
  color: #e3f3e9;
}
.hero-art {
  position: absolute;
  right: 12px;
  top: 9px;
  width: 115px;
  height: 115px;
  object-fit: contain;
  border-radius: 50%;
  mix-blend-mode: screen;
  opacity: 0.85;
}
.unit-progress {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  margin-top: 18px;
  max-width: 220px;
}
.progress-track {
  height: 7px;
  background: #ffffff38;
  border-radius: 30px;
  flex: 1;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: #ffe397;
  border-radius: inherit;
  min-width: 0;
}
.preview-pill {
  margin: 20px auto 0;
  width: max-content;
  max-width: 90vw;
  padding: 7px 14px;
  border-radius: 999px;
  background: #fff5d9;
  color: #887041;
  font-size: 12px;
  display: flex;
  gap: 7px;
  align-items: center;
}
.trail {
  position: relative;
  max-width: 510px;
  margin: 0 auto;
  padding: 30px 0 10px;
  isolation: isolate;
}
.trail-line {
  position: absolute;
  left: 50%;
  top: 52px;
  bottom: 98px;
  width: 290px;
  transform: translateX(-50%);
  z-index: -1;
  overflow: visible;
}
.trail-stop {
  height: 132px;
  position: relative;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: flex-start;
  --shift: 0px;
  transform: translateX(var(--shift));
}
.trail-stop:nth-of-type(4n + 1) {
  --shift: 0px;
}
.trail-stop:nth-of-type(4n + 2) {
  --shift: 78px;
}
.trail-stop:nth-of-type(4n + 3) {
  --shift: 0px;
}
.trail-stop:nth-of-type(4n) {
  --shift: -78px;
}
.lesson-node {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 74px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 7px 0 #d7dfd9,
    0 9px 16px #59686113;
  border: 5px solid #fff;
  transition:
    transform 0.16s,
    box-shadow 0.16s;
}
.lesson-node:active {
  transform: translateY(5px);
  box-shadow: 0 2px 0 #d7dfd9;
}
.lesson-node img {
  height: 56px;
  width: 56px;
  object-fit: contain;
  border-radius: 50%;
}
.lesson-node.current {
  background: var(--sun);
  border-color: #ffe391;
  box-shadow:
    0 7px 0 #dca435,
    0 0 0 7px #ffe8a975;
}
.lesson-node.current:active {
  box-shadow:
    0 2px 0 #dca435,
    0 0 0 7px #ffe8a975;
}
.lesson-node.current::before {
  content: "▶";
  position: absolute;
  right: -3px;
  bottom: -3px;
  display: grid;
  place-items: center;
  background: white;
  color: #b68926;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 11px;
  box-shadow: 0 2px 6px #0001;
}
.lesson-node.done {
  border-color: #c8ead8;
  background: #effbf3;
  box-shadow: 0 7px 0 #9cccb3;
}
.lesson-node.done::after {
  content: "✓";
  position: absolute;
  right: -3px;
  bottom: -3px;
  background: #58aa89;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 16px;
}
.lesson-node.book {
  border-radius: 24px;
  background: #e7dbf9;
  box-shadow: 0 7px 0 #b9a1d3;
}
.lesson-node.game {
  background: #e4f3ff;
  box-shadow: 0 7px 0 #a2cce8;
}
.node-icon {
  font-size: 35px;
}
.lesson-label {
  margin-top: 14px;
  font-size: 14px;
  font-weight: 900;
  background: #ffffffb3;
  padding: 2px 10px;
  border-radius: 10px;
  color: #555160;
  white-space: nowrap;
}
.lesson-meta {
  font-size: 10px;
  color: #8c8694;
  margin-top: 3px;
}
.unit-end {
  text-align: center;
  color: #8d9c90;
  font-size: 12px;
  padding: 14px 0 30px;
}
.unit-end::before {
  content: "";
  display: block;
  height: 1px;
  width: 100px;
  background: #d0dfd2;
  margin: 0 auto 15px;
}
.path-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 12px 20px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, #fffaf3 70%, #fffaf300);
  display: flex;
  justify-content: center;
}
.continue-btn {
  width: min(100%, 430px);
  min-height: 58px;
  background: var(--sun);
  box-shadow: 0 5px 0 #dfad38;
  border-radius: 20px;
  font-size: 19px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.continue-btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #dfad38;
}
.continue-btn small {
  font-size: 12px;
  font-weight: 700;
  color: #8a6b26;
}
.path-decoration {
  position: absolute;
  pointer-events: none;
  z-index: -1;
  font-size: 28px;
  opacity: 0.55;
}
.path-decoration.a {
  left: 12%;
  top: 240px;
}
.path-decoration.b {
  right: 12%;
  top: 630px;
}
.path-decoration.c {
  left: 13%;
  top: 1015px;
}
/* Original learning views retain their original ids/classes/layout. */
.lesson-screen {
  height: 100dvh;
  overflow: hidden;
  position: relative;
}
.lesson-screen #topbar {
  position: absolute;
}
.lesson-screen #stage,
.lesson-screen #quizStage,
.lesson-screen #speakStage {
  height: 100dvh;
}
.lesson-home {
  font-size: 22px;
  background: white;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
}
.lesson-progress {
  position: absolute;
  z-index: 21;
  top: 73px;
  left: 50%;
  transform: translateX(-50%);
  height: 5px;
  border-radius: 5px;
  background: #dcd8e35c;
  width: min(70%, 410px);
  overflow: hidden;
}
.lesson-progress i {
  display: block;
  height: 100%;
  background: var(--mint);
  border-radius: inherit;
  transition: width 0.25s;
}
.session-count {
  position: absolute;
  bottom: calc(12px + env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11px;
  color: var(--sub);
  pointer-events: none;
}
.word-art {
  width: clamp(140px, 31vmin, 240px);
  aspect-ratio: 1;
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: white;
}
.word-art img {
  display: block;
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-width: none;
  left: 0;
  top: 0;
}
.word-art.frames img {
  width: 200%;
  object-fit: fill;
  animation: frames 2.5s steps(1, end) infinite;
}
.paused .word-art.frames img {
  animation-play-state: paused;
}
@keyframes frames {
  0%,
  49% {
    transform: translateX(0);
  }
  50%,
  100% {
    transform: translateX(-50%);
  }
}
.qCard .word-art {
  width: 88%;
  max-width: 180px;
  border-radius: 12px;
}
.qCard .word-art img {
  mix-blend-mode: multiply;
}
#spkCard .word-art {
  width: 88%;
  max-width: 280px;
}
.asset-loading {
  background: linear-gradient(110deg, #f4f2ee 25%, #fff 50%, #f4f2ee 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.asset-loading::after {
  content: "…";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #aaa;
  font-size: 26px;
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}
.asset-failed::after {
  content: "图片暂时未加载";
  font-size: 12px;
}
.audio-note {
  font-size: 12px;
  color: #918370;
  min-height: 18px;
  text-align: center;
  padding: 0 15px;
}
.audio-note:empty {
  display: none;
}
.missing-audio {
  position: relative;
}
.missing-audio::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c5beca;
  border: 2px solid white;
}
.preview-target {
  font-size: 22px;
  font-weight: 900;
  text-align: center;
  min-height: 30px;
}
.choice-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.qCard.ready {
  border-color: #f9d77b;
  animation: invite 2.4s ease-in-out infinite;
}
.qCard.ready:nth-child(2) {
  animation-delay: 0.12s;
}
.qCard.ready:nth-child(3) {
  animation-delay: 0.24s;
}
@keyframes invite {
  0%,
  80%,
  100% {
    transform: translateY(0);
  }
  90% {
    transform: translateY(-4px);
  }
}
#quizGrid.three {
  grid-template-columns: repeat(3, 1fr);
  width: min(92vw, 620px);
}
#quizGrid.three .qCard {
  border-radius: 22px;
}
#spkManual {
  display: block;
  margin-top: 0;
  font-size: 14px;
  padding: 10px 20px;
  min-height: 44px;
}
.speak-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.small-action {
  padding: 10px 16px;
  background: white;
  box-shadow: var(--shadow);
  border-radius: 999px;
  min-height: 44px;
  font-size: 13px;
}
.stage-title {
  font-size: 16px;
  color: var(--sub);
  text-align: center;
}
.example {
  font-size: 16px;
  color: var(--muted);
  margin-top: 10px;
  text-align: center;
}
.example button {
  font-size: 16px;
  padding: 4px 6px;
  min-width: 36px;
  min-height: 36px;
}
.study-footer {
  display: flex;
  align-items: center;
  gap: 12px;
}
.word-caption {
  font-size: 12px;
  color: var(--sub);
  max-width: 300px;
  text-align: center;
}
.session-paused {
  position: absolute;
  inset: 85px 0 0;
  z-index: 25;
  background: #f9f6f0eb;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
  backdrop-filter: blur(5px);
}
.session-paused h2 {
  font-size: 28px;
}
.session-paused button {
  padding: 15px 40px;
  border-radius: 25px;
  background: var(--sun);
  font-size: 22px;
  font-weight: 900;
}
/* Games share the original quiz cards, replay control and feedback. */
.game-screen {
  height: 100dvh;
  overflow: auto;
  padding: 95px 20px 90px;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 20px;
}
.game-screen h2 {
  font-size: 20px;
}
.game-progress {
  display: flex;
  gap: 8px;
}
.game-progress span {
  width: 10px;
  height: 10px;
  background: #e0dde5;
  border-radius: 50%;
}
.game-progress .filled {
  background: var(--mint);
}
.packing-bag {
  width: 140px;
  height: 108px;
  border: 4px dashed #b4cfbb;
  border-radius: 25px;
  background: #e9f7ed;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  transition: transform 0.2s;
}
.packing-bag.filled {
  transform: scale(1.1);
  background: #d8f3e3;
  border-style: solid;
}
.game-hint {
  font-size: 13px;
  color: var(--sub);
  text-align: center;
}
.match-board {
  width: min(92vw, 500px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.match-audio {
  font-size: 30px;
  background: var(--sun);
  border-radius: 24px;
  min-height: 105px;
  box-shadow: var(--shadow);
  border: 4px solid transparent;
}
.match-audio.selected {
  border-color: #a88335;
  transform: scale(1.03);
}
.match-audio.matched,
.match-picture.matched {
  visibility: hidden;
}
.match-picture {
  aspect-ratio: auto;
  min-height: 105px;
}
.match-picture .word-art {
  width: 90px;
}
.match-audio small {
  font-size: 14px;
  display: block;
  margin-top: 5px;
}
/* Reader uses the exact original styles. Portrait availability is the sole layout addition. */
#pictureBooksApp {
  position: fixed;
  inset: 0;
  display: block !important;
}
.book-reader {
  height: 100dvh;
}
.book-mode .mode-panel {
  max-width: 540px;
}
.book-preview-label {
  position: absolute;
  z-index: 5;
  top: calc(50px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: #fff9;
  padding: 3px 10px;
  border-radius: 10px;
  background: #173b3a99;
  white-space: nowrap;
}
.page-arrow.finish {
  font-size: 22px;
  background: var(--mint);
}
.reader-complete {
  position: absolute;
  z-index: 20;
  inset: 0;
  background: #183f3fee;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  text-align: center;
  color: white;
}
.reader-complete button {
  background: var(--sun);
  color: var(--ink);
  border-radius: 24px;
  padding: 15px 35px;
  font-size: 20px;
  font-weight: 900;
}
.reader-complete .huge {
  font-size: 70px;
}
.reader-complete p {
  font-size: 14px;
  color: #d0ddd8;
}
.reader-status {
  color: white;
}
.reader-status.show {
  pointer-events: none;
}
.page-art {
  object-fit: contain;
}
.page-stars {
  font-size: 16px;
  min-width: 0;
}
.book-mode-title {
  font-size: 28px;
}
/* Parent dialogs */
#modal {
  border: 0;
  border-radius: 28px;
  padding: 0;
  width: min(92vw, 580px);
  max-height: 88dvh;
  color: var(--ink);
  background: #fffdf8;
  box-shadow: 0 24px 80px #3a384544;
  margin: auto;
}
#modal::backdrop {
  background: #3a384566;
  backdrop-filter: blur(3px);
}
.modal-body {
  padding: 24px;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.modal-head h2 {
  font-size: 21px;
}
.modal-head button {
  border-radius: 50%;
  width: 42px;
  height: 42px;
  background: #f0edf2;
  font-size: 20px;
}
.modal-body p {
  font-size: 14px;
  line-height: 1.8;
  color: #77707d;
  margin: 12px 0;
}
.modal-body .action {
  display: block;
  width: 100%;
  border-radius: 16px;
  padding: 14px 18px;
  background: var(--sun);
  font-size: 16px;
  font-weight: 900;
  margin-top: 12px;
  min-height: 50px;
}
.modal-body .secondary {
  background: #f0f3ef;
}
.modal-body .danger {
  background: #fff0ed;
  color: #aa5146;
}
.parent-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0;
}
.parent-stat {
  padding: 16px 8px;
  background: #f0f5ee;
  border-radius: 18px;
  text-align: center;
}
.parent-stat strong {
  display: block;
  font-size: 27px;
  color: #5b8d75;
}
.parent-stat span {
  font-size: 11px;
  color: #7d817a;
}
.parent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  font-size: 14px;
  padding: 13px 0;
  border-bottom: 1px solid #e9e5df;
}
.parent-row input {
  width: 22px;
  height: 22px;
  accent-color: #58aa89;
}
.details-list {
  max-height: 38dvh;
  overflow: auto;
}
.word-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}
.word-row .word-art {
  width: 56px;
  flex-shrink: 0;
}
.word-row strong {
  font-size: 16px;
}
.word-row small {
  display: block;
  color: var(--sub);
  font-size: 11px;
  margin-top: 2px;
}
.word-row .word-meta {
  margin-left: auto;
  color: #8d8475;
  font-size: 11px;
}
.modal-kicker {
  color: #7e9d88;
  font-size: 11px;
  letter-spacing: 0.1em;
  font-weight: 900;
}
.lesson-preview-head {
  display: flex;
  gap: 16px;
  align-items: center;
}
.lesson-preview-head .word-art {
  width: 90px;
  flex-shrink: 0;
}
.lesson-preview-head h2 {
  font-size: 24px;
}
.preview-words {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 18px 0;
}
.preview-words span {
  background: #f0f5ee;
  padding: 7px 12px;
  border-radius: 12px;
  font-size: 14px;
}
.lesson-types {
  color: var(--sub);
  font-size: 12px;
}
.completion {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 20px;
  padding: 30px;
}
.completion .huge {
  font-size: 76px;
}
.completion h1 {
  font-size: 28px;
}
.completion p {
  max-width: 340px;
  color: var(--sub);
  font-size: 14px;
  line-height: 1.8;
}
.completion .continue-btn {
  margin-top: 14px;
}
.error-screen {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 20px;
  padding: 25px;
}
.error-screen button {
  padding: 15px;
  border-radius: 20px;
  background: var(--sun);
  font-size: 20px;
}
.storage-warning {
  background: #fff0d3;
  color: #94723e;
  font-size: 12px;
  padding: 9px;
  text-align: center;
}
.review-reason {
  font-size: 10px;
  color: var(--sub);
  max-width: 280px;
  text-align: center;
}
.offline-badge {
  position: fixed;
  left: 50%;
  top: 5px;
  transform: translateX(-50%);
  background: #fff4db;
  color: #8b7040;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  z-index: 60;
}
#toast {
  position: fixed;
  z-index: 100;
  bottom: calc(100px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translate(-50%, 20px);
  background: #3a3845ed;
  color: white;
  padding: 12px 20px;
  border-radius: 18px;
  max-width: min(88vw, 470px);
  width: max-content;
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
#reward {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  overflow: hidden;
}
.reward-star {
  position: absolute;
  font-size: 28px;
  animation: star-fly 900ms ease-out forwards;
}
@keyframes star-fly {
  from {
    opacity: 1;
    transform: translate(0, 0) scale(0.3);
  }
  to {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) rotate(150deg) scale(1.2);
  }
}
@media (min-width: 760px) {
  .path-header {
    padding-top: 28px;
  }
  .path-screen {
    background-attachment: fixed;
  }
  .unit-hero {
    margin-top: 15px;
    padding: 26px 34px;
  }
  .trail {
    padding-top: 35px;
  }
  .trail-stop {
    height: 140px;
  }
  .lesson-label {
    font-size: 15px;
  }
  .hero-art {
    width: 130px;
    height: 130px;
    right: 28px;
  }
  .unit-hero h1 {
    font-size: 34px;
  }
  .path-decoration {
    font-size: 36px;
  }
  .lesson-node {
    width: 86px;
    height: 80px;
  }
  .lesson-node img {
    width: 60px;
    height: 60px;
  }
}
@media (max-width: 660px) {
  .unit-hero {
    margin-left: 20px;
    margin-right: 20px;
  }
  .hero-art {
    width: 100px;
    height: 100px;
    right: 10px;
    top: 20px;
  }
  .unit-hero h1 {
    font-size: 28px;
  }
  .path-header {
    padding-left: 22px;
    padding-right: 22px;
  }
}
@media (max-width: 430px) {
  .lesson-home {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }
  .lesson-progress {
    top: 58px;
  }
  .brand-title {
    font-size: 19px;
  }
  .brand-sub {
    font-size: 11px;
  }
  .trail-stop {
    height: 128px;
  }
  .trail-stop:nth-of-type(4n + 2) {
    --shift: 65px;
  }
  .trail-stop:nth-of-type(4n) {
    --shift: -65px;
  }
  .trail-line {
    width: 250px;
  }
  .hero-art {
    width: 85px;
    height: 85px;
    top: 25px;
  }
  .unit-hero {
    padding: 22px;
  }
  .unit-hero h1 {
    font-size: 26px;
  }
  .unit-hero p {
    font-size: 15px;
  }
  .unit-progress {
    max-width: 180px;
  }
  .path-header {
    padding-top: 18px;
  }
  .unit-hero {
    border-radius: 24px;
  }
  .parent-open {
    width: 42px;
    height: 42px;
  }
  .game-screen {
    padding-top: 85px;
    gap: 15px;
  }
  #quizGrid.three .qCard {
    border-radius: 18px;
    border-width: 3px;
  }
  .match-audio,
  .match-picture {
    min-height: 90px;
  }
  .match-picture .word-art {
    width: 75px;
  }
}
@media (orientation: portrait) {
  .book-reader .reader-stage,
  .book-reader > .reader-back,
  .book-reader > .reader-sound,
  .book-reader > .page-arrow,
  .book-reader > .reader-bottom,
  .book-reader > .page-count,
  .book-reader > .reader-status {
    display: flex;
  }
  .book-reader .rotate-notice {
    display: none;
  }
  .reader-stage {
    padding: 0;
  }
  .page-frame {
    height: 100%;
    width: 100%;
    max-width: none;
  }
  .page-art {
    object-fit: contain;
    padding: 65px 0 150px;
    background: #173b3a;
  }
  .story-line {
    left: 25px;
    right: 25px;
    bottom: 135px;
    padding: 14px 18px;
    font-size: 24px;
    max-width: none;
  }
  .page-arrow {
    top: 50%;
    width: 48px;
    height: 48px;
    font-size: 35px;
  }
  .page-arrow.prev {
    left: 8px;
  }
  .page-arrow.next {
    right: 8px;
  }
  .reader-bottom {
    bottom: 25px;
  }
  .reader-sound {
    bottom: 25px;
  }
  .page-dots {
    left: 90px;
    right: 90px;
  }
  .book-mode .mode-panel {
    padding: 30px 22px;
  }
  .book-mode-title {
    font-size: 26px;
  }
}
@media (max-height: 650px) {
  #stage {
    padding-top: 80px;
    gap: 10px;
  }
  #card {
    padding: 18px;
  }
  .word-art {
    width: min(25vh, 180px);
  }
  #jp {
    font-size: 30px;
  }
  .example {
    font-size: 14px;
    margin-top: 4px;
  }
  .audio-note {
    font-size: 11px;
  }
  .word-caption {
    display: none;
  }
  .lesson-screen #speakStage {
    padding-top: 73px;
    gap: 10px;
  }
  .lesson-screen #spkCard {
    width: min(32vh, 230px);
  }
  .lesson-screen #spkWord {
    font-size: 22px;
    min-height: 26px;
  }
  .lesson-screen #spkStatus {
    font-size: 12px;
  }
  .speak-actions {
    gap: 5px;
  }
  .small-action {
    padding: 7px 12px;
  }
  .lesson-screen #quizStage {
    gap: 13px;
    padding-top: 80px;
  }
  .lesson-screen #quizGrid {
    max-width: min(84vw, 48vh);
  }
  .lesson-screen #quizGrid.three {
    max-width: min(92vw, 90vh);
  }
  .lesson-screen #qReplay {
    width: 60px;
    height: 60px;
    font-size: 28px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .word-art.frames img {
    transform: translateX(-50%);
  }
}
body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation: none !important;
  transition: none !important;
}
body.reduce-motion .word-art.frames img {
  transform: translateX(-50%);
}
.trail-stop {
  width: max-content;
  min-width: 180px;
  margin-inline: auto;
}
.trail-stop:nth-of-type(4n + 1) {
  --shift: 0px;
}
.trail-line {
  height: calc(100% - 130px);
}
.path-screen {
  overflow-x: clip;
}
.word-art.frames {
  clip-path: inset(2px round 16px);
}
.reader-sound.missing-audio {
  position: absolute;
}
@media (orientation: portrait) {
  .book-mode::after {
    display: none;
  }
  .book-mode .mode-layout {
    display: flex;
    flex-direction: column;
    padding: 80px 28px 30px;
    gap: 20px;
  }
  .book-mode > .mode-back {
    display: flex;
  }
  .mode-cover-column {
    flex: 0 1 35%;
    min-height: 0;
  }
  .mode-cover {
    height: 100%;
    width: auto;
    max-height: 30vh;
    aspect-ratio: 1.5;
    object-fit: cover;
  }
  .mode-info {
    flex: 1;
    align-items: center;
    padding: 0;
  }
  .mode-title {
    font-size: 27px;
    text-align: center;
  }
  .mode-age {
    margin-top: 8px;
    font-size: 13px;
    padding: 6px 12px;
  }
  .mode-hint {
    font-size: 13px;
    text-align: center;
    margin-top: 10px;
  }
  .mode-actions {
    margin: 22px 0 0;
    gap: 15px;
  }
  .mode-button {
    height: 82px;
    font-size: 22px;
  }
  .mode-button-icon {
    width: 50px;
    height: 50px;
  }
}
