:root {
  --ink: #26354a;
  --ink-soft: #667085;
  --paper: #fffdfa;
  --cream: #fff8e8;
  --cream-deep: #ffefc7;
  --sun: #ffc857;
  --sun-deep: #ed982c;
  --coral: #ff805d;
  --sky: #dff3ff;
  --sky-deep: #4e9fe6;
  --mint: #daf6e9;
  --mint-deep: #269f73;
  --lavender: #ece8ff;
  --danger: #d94f4f;
  --line: rgba(38, 53, 74, 0.11);
  --shadow: 0 16px 40px rgba(86, 70, 42, 0.13);
  --shadow-soft: 0 8px 24px rgba(86, 70, 42, 0.09);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --tap: 52px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 200, 87, 0.24), transparent 28%),
    radial-gradient(circle at 90% 18%, rgba(78, 159, 230, 0.14), transparent 30%),
    #f6f0e3;
  font-family: ui-rounded, "SF Pro Rounded", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
  font: inherit;
}

button:focus-visible {
  outline: 4px solid rgba(78, 159, 230, 0.34);
  outline-offset: 3px;
}

button:active:not(:disabled) {
  transform: scale(0.97);
}

button:disabled {
  cursor: default;
}

#app {
  min-height: 100vh;
}

.app-shell {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--cream);
  box-shadow: var(--shadow);
}

.app-shell.immersive {
  max-width: 900px;
  background: #f5e8ca;
}

.screen {
  min-height: 100vh;
  padding: max(18px, env(safe-area-inset-top)) 18px calc(106px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 0 0, rgba(255, 209, 104, 0.26), transparent 30%),
    linear-gradient(180deg, #fffaf0 0%, var(--cream) 100%);
}

.screen.no-nav {
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  margin-bottom: 18px;
}

.topbar-copy {
  min-width: 0;
  flex: 1;
}

.topbar-title {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-subtitle {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
}

.round-button,
.avatar-button {
  display: inline-flex;
  width: var(--tap);
  min-width: var(--tap);
  height: var(--tap);
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  font-size: 24px;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.avatar-button {
  border: 3px solid #fff;
  background: var(--cream-deep);
  font-size: 28px;
  user-select: none;
}

.home-greeting {
  margin: 2px 0 4px;
  font-size: clamp(28px, 8vw, 36px);
  font-weight: 950;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.home-prompt {
  margin: 0 0 20px;
  color: var(--ink-soft);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.55;
}

.today-card {
  position: relative;
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 16px;
  width: 100%;
  min-height: 190px;
  padding: 16px;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-xl);
  background: linear-gradient(145deg, #304b6d 0%, #24364f 100%);
  box-shadow: 0 20px 38px rgba(36, 54, 79, 0.26);
  color: #fff;
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.today-card::after {
  position: absolute;
  right: -32px;
  bottom: -46px;
  width: 150px;
  height: 150px;
  border: 24px solid rgba(255, 200, 87, 0.12);
  border-radius: 50%;
  content: "";
}

.today-card:active {
  box-shadow: 0 12px 24px rgba(36, 54, 79, 0.22);
}

.book-cover {
  position: relative;
  z-index: 1;
  min-height: 158px;
  overflow: hidden;
  border: 5px solid rgba(255, 255, 255, 0.85);
  border-radius: 18px;
  background: #bddff2;
  box-shadow: 0 10px 22px rgba(7, 22, 44, 0.3);
}

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

.today-copy {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.eyebrow {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff4c4;
  font-size: 12px;
  font-weight: 850;
}

.today-title {
  margin: 12px 0 4px;
  font-family: "Trebuchet MS", ui-rounded, sans-serif;
  font-size: 26px;
  font-weight: 900;
  line-height: 1.08;
}

.today-meta {
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 13px;
  font-weight: 700;
}

.play-pill {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 16px 10px 11px;
  border-radius: 16px;
  background: var(--sun);
  box-shadow: 0 8px 16px rgba(255, 200, 87, 0.28);
  color: #3b3220;
  font-size: 16px;
  font-weight: 900;
}

.play-dot {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 26px 2px 12px;
}

.section-title {
  margin: 0;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.level-chip {
  min-height: 42px;
  padding: 8px 13px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.story-card {
  min-width: 0;
  min-height: 164px;
  padding: 12px;
  border: 0;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  text-align: left;
}

.story-thumb {
  display: flex;
  height: 94px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 15px;
  font-size: 50px;
}

.story-thumb.blue { background: var(--sky); }
.story-thumb.mint { background: var(--mint); }

.story-name {
  display: block;
  margin-top: 10px;
  overflow: hidden;
  font-family: "Trebuchet MS", ui-rounded, sans-serif;
  font-size: 16px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-note {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.review-banner {
  display: flex;
  width: 100%;
  min-height: 70px;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 2px solid rgba(255, 128, 93, 0.2);
  border-radius: var(--radius-lg);
  background: #fff1e9;
  cursor: pointer;
  text-align: left;
}

.review-emoji {
  display: inline-flex;
  width: 46px;
  min-width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  background: #fff;
  font-size: 25px;
}

.review-copy {
  flex: 1;
  min-width: 0;
}

.review-title,
.review-note {
  display: block;
}

.review-title {
  font-size: 15px;
  font-weight: 900;
}

.review-note {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.review-arrow {
  color: var(--coral);
  font-size: 24px;
  font-weight: 900;
}

.bottom-nav {
  position: fixed;
  z-index: 30;
  right: max(0px, calc((100vw - 480px) / 2));
  bottom: 0;
  left: max(0px, calc((100vw - 480px) / 2));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  min-height: 82px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 250, 0.96);
  box-shadow: 0 -12px 30px rgba(79, 65, 43, 0.08);
  backdrop-filter: blur(18px);
}

.nav-button {
  display: flex;
  min-height: 60px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: #9a9388;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.nav-button.active {
  background: var(--cream-deep);
  color: #b96614;
}

.nav-icon {
  font-size: 24px;
  line-height: 1;
}

.reader-screen {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.38), transparent 24%),
    #f3e5c5;
}

.reader-topbar {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 54px;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  margin-bottom: 10px;
}

.reader-title {
  margin: 0;
  overflow: hidden;
  font-family: "Trebuchet MS", ui-rounded, sans-serif;
  font-size: 18px;
  font-weight: 900;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-page {
  display: flex;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  border: 5px solid #fffdf7;
  border-radius: 26px;
  background: #fffdf7;
  box-shadow: 0 18px 34px rgba(68, 54, 31, 0.18);
}

.story-art {
  position: relative;
  flex: 1;
  min-height: 330px;
  overflow: hidden;
  border-radius: 21px 21px 8px 8px;
  background: var(--sky);
}

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

.story-page-art {
  height: 100%;
}

.page-sentence {
  min-height: 108px;
  padding: 18px 16px 14px;
  font-family: "Trebuchet MS", ui-rounded, sans-serif;
  font-size: clamp(26px, 7.2vw, 35px);
  font-weight: 850;
  line-height: 1.45;
  text-align: center;
}

.word-token {
  display: inline-flex;
  min-height: 45px;
  align-items: center;
  margin: 0 2px;
  padding: 0 3px;
  border: 0;
  border-bottom: 4px solid var(--sun);
  border-radius: 6px 6px 3px 3px;
  background: #fff4cf;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.reader-tools {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) 60px;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.page-turn {
  display: inline-flex;
  width: 58px;
  min-width: 58px;
  height: 58px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  font-size: 34px;
  font-weight: 800;
}

.page-turn:disabled {
  opacity: 0.34;
}

.reader-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.audio-button {
  display: inline-flex;
  min-width: 136px;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 18px;
  border: 0;
  border-radius: 20px;
  background: var(--coral);
  box-shadow: 0 10px 20px rgba(255, 128, 93, 0.25);
  color: #fff;
  cursor: pointer;
  font-size: 17px;
  font-weight: 900;
}

.audio-button.playing {
  background: var(--mint-deep);
}

.page-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(38, 53, 74, 0.18);
}

.page-dot.active {
  width: 20px;
  border-radius: 99px;
  background: var(--ink);
}

.finish-panel {
  display: flex;
  min-height: 110px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  text-align: center;
}

.finish-panel strong {
  font-size: 22px;
  font-weight: 950;
}

.primary-button,
.secondary-button,
.ghost-button,
.choice-button {
  display: inline-flex;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 18px;
  cursor: pointer;
  font-size: 17px;
  font-weight: 900;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.primary-button {
  padding: 13px 22px;
  border: 0;
  background: linear-gradient(135deg, var(--coral), #ff9d62);
  box-shadow: 0 10px 22px rgba(255, 128, 93, 0.24);
  color: #fff;
}

.primary-button.blue {
  background: linear-gradient(135deg, #3f8fe0, #65b9ed);
  box-shadow: 0 10px 22px rgba(63, 143, 224, 0.22);
}

.primary-button.green {
  background: linear-gradient(135deg, #249e70, #59c98f);
  box-shadow: 0 10px 22px rgba(36, 158, 112, 0.22);
}

.primary-button.full,
.secondary-button.full,
.ghost-button.full {
  width: 100%;
}

.secondary-button {
  padding: 12px 20px;
  border: 2px solid rgba(78, 159, 230, 0.3);
  background: var(--sky);
  color: #276faa;
}

.ghost-button {
  padding: 12px 18px;
  border: 1.5px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-soft);
}

.bottom-sheet-backdrop,
.dialog-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(26, 36, 49, 0.44);
  backdrop-filter: blur(5px);
}

.dialog-backdrop {
  align-items: center;
}

.bottom-sheet,
.dialog-card {
  width: min(100%, 448px);
  padding: 20px;
  border-radius: 30px;
  background: var(--paper);
  box-shadow: 0 24px 60px rgba(30, 39, 52, 0.28);
}

.sheet-handle {
  width: 46px;
  height: 5px;
  margin: -4px auto 16px;
  border-radius: 99px;
  background: rgba(38, 53, 74, 0.14);
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.sheet-word {
  flex: 1;
}

.sheet-word h2 {
  margin: 0;
  font-family: "Trebuchet MS", ui-rounded, sans-serif;
  font-size: 42px;
  font-weight: 950;
  letter-spacing: -0.03em;
}

.sheet-word p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 700;
}

.close-button {
  display: inline-flex;
  width: 50px;
  min-width: 50px;
  height: 50px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 16px;
  background: #f3f0e8;
  cursor: pointer;
  font-size: 22px;
  font-weight: 900;
}

.word-visual {
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: center;
  margin: 16px 0;
  border-radius: 22px;
  background: var(--cream-deep);
  font-size: 54px;
}

.sound-parts {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.sound-part {
  display: flex;
  min-height: 58px;
  flex: 1;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(78, 159, 230, 0.25);
  border-radius: 17px;
  background: var(--sky);
  color: #285f91;
  font-family: "Trebuchet MS", ui-rounded, sans-serif;
  font-size: 25px;
  font-weight: 950;
}

.sheet-actions,
.stack-actions {
  display: grid;
  gap: 10px;
}

.task-screen {
  min-height: 100vh;
  padding: max(16px, env(safe-area-inset-top)) 16px calc(106px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 96% 2%, rgba(128, 205, 255, 0.35), transparent 28%),
    radial-gradient(circle at 0 50%, rgba(255, 205, 105, 0.22), transparent 34%),
    linear-gradient(180deg, #f9fcff 0%, #fff8ea 100%);
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 2px 20px;
}

.progress-track {
  height: 10px;
  flex: 1;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(38, 53, 74, 0.1);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sun), var(--coral));
  transition: width 240ms ease;
}

.progress-label {
  min-width: 44px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 850;
  text-align: right;
}

.task-card {
  padding: 22px 18px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  text-align: center;
}

.task-kicker {
  margin: 0;
  color: #4278a5;
  font-size: 14px;
  font-weight: 900;
}

.task-word {
  margin: 22px 0 6px;
  font-family: "Trebuchet MS", ui-rounded, sans-serif;
  font-size: clamp(52px, 17vw, 78px);
  font-weight: 950;
  letter-spacing: -0.05em;
  line-height: 1;
}

.task-hint {
  margin: 10px auto 20px;
  max-width: 310px;
  color: var(--ink-soft);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}

.hear-button {
  display: inline-flex;
  width: 78px;
  height: 78px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 27px;
  background: linear-gradient(145deg, #65b9ed, #3e8bdb);
  box-shadow: 0 12px 25px rgba(62, 139, 219, 0.28);
  color: #fff;
  cursor: pointer;
  font-size: 32px;
}

.answer-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 22px;
}

.choice-button {
  min-height: 68px;
  padding: 12px;
  border: 2px solid transparent;
  background: #f6f4ed;
}

.choice-button.know {
  border-color: rgba(38, 159, 115, 0.28);
  background: var(--mint);
  color: #177453;
}

.choice-button.unsure {
  border-color: rgba(255, 128, 93, 0.22);
  background: #fff0e8;
  color: #b75a3f;
}

.result-hero {
  padding: 24px 6px 8px;
  text-align: center;
}

.result-emoji {
  display: inline-flex;
  width: 112px;
  height: 112px;
  align-items: center;
  justify-content: center;
  border: 6px solid rgba(255, 255, 255, 0.85);
  border-radius: 38px;
  background: var(--cream-deep);
  box-shadow: var(--shadow);
  font-size: 58px;
}

.result-title {
  margin: 24px 0 8px;
  font-size: 31px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.result-copy {
  margin: 0 auto;
  max-width: 330px;
  color: var(--ink-soft);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.6;
}

.result-word-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 20px 0;
}

.result-chip {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 8px 14px;
  border-radius: 14px;
  background: #fff0e8;
  color: #a8553e;
  font-family: "Trebuchet MS", ui-rounded, sans-serif;
  font-size: 17px;
  font-weight: 900;
}

.step-bubbles {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 6px 0 18px;
}

.step-bubble {
  display: inline-flex;
  width: 31px;
  height: 31px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(38, 53, 74, 0.09);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 900;
}

.step-bubble.active {
  width: auto;
  padding: 0 12px;
  border-radius: 99px;
  background: var(--sky);
  color: #296f9f;
}

.letter-options,
.build-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.letter-tile {
  display: inline-flex;
  min-height: 72px;
  align-items: center;
  justify-content: center;
  border: 3px solid rgba(78, 159, 230, 0.22);
  border-radius: 20px;
  background: #f9fcff;
  color: #285775;
  cursor: pointer;
  font-family: "Trebuchet MS", ui-rounded, sans-serif;
  font-size: 32px;
  font-weight: 950;
}

.letter-tile.used {
  opacity: 0.28;
}

.letter-tile.wrong {
  border-color: rgba(217, 79, 79, 0.42);
  background: #fff0ed;
  color: #a84545;
}

.build-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px auto 8px;
  max-width: 280px;
}

.build-slot {
  display: inline-flex;
  min-height: 74px;
  align-items: center;
  justify-content: center;
  border: 3px dashed rgba(38, 53, 74, 0.22);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  font-family: "Trebuchet MS", ui-rounded, sans-serif;
  font-size: 34px;
  font-weight: 950;
}

.build-slot.filled {
  border-style: solid;
  border-color: rgba(38, 159, 115, 0.35);
  background: var(--mint);
  color: #17674d;
}

.inline-feedback {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 900;
}

.inline-feedback.good {
  background: var(--mint);
  color: #177453;
}

.inline-feedback.try {
  background: #fff0e8;
  color: #ac583e;
}

.quiz-options {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.quiz-option {
  display: flex;
  width: 100%;
  min-height: 68px;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 3px solid rgba(78, 159, 230, 0.18);
  border-radius: 20px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-family: "Trebuchet MS", ui-rounded, sans-serif;
  font-size: 24px;
  font-weight: 950;
}

.quiz-option.correct {
  border-color: rgba(38, 159, 115, 0.5);
  background: var(--mint);
  color: #177453;
}

.quiz-option.wrong {
  border-color: rgba(217, 79, 79, 0.36);
  background: #fff0ed;
  color: #a84545;
}

.quiz-option:disabled:not(.correct):not(.wrong) {
  opacity: 0.5;
}

.state-card {
  display: flex;
  min-height: calc(100vh - 160px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.state-icon {
  display: inline-flex;
  width: 104px;
  height: 104px;
  align-items: center;
  justify-content: center;
  border-radius: 36px;
  background: var(--cream-deep);
  font-size: 54px;
}

.state-title {
  margin: 22px 0 8px;
  font-size: 27px;
  font-weight: 950;
}

.state-copy {
  max-width: 290px;
  margin: 0 0 22px;
  color: var(--ink-soft);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.55;
}

.skeleton-stack {
  width: 100%;
  max-width: 330px;
}

.skeleton {
  position: relative;
  height: 18px;
  margin: 12px 0;
  overflow: hidden;
  border-radius: 99px;
  background: #ece8df;
}

.skeleton.big {
  height: 190px;
  border-radius: 24px;
}

.skeleton.short {
  width: 58%;
}

.skeleton::after {
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.82), transparent);
  content: "";
  animation: shimmer 1.3s infinite;
}

.toast {
  position: fixed;
  z-index: 120;
  left: 50%;
  bottom: calc(100px + env(safe-area-inset-bottom));
  max-width: min(340px, calc(100vw - 32px));
  padding: 12px 18px;
  transform: translate(-50%, 16px);
  border-radius: 16px;
  background: rgba(34, 47, 63, 0.94);
  box-shadow: 0 14px 34px rgba(19, 27, 37, 0.26);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

.dialog-card {
  text-align: center;
}

.dialog-icon {
  display: inline-flex;
  width: 76px;
  height: 76px;
  align-items: center;
  justify-content: center;
  border-radius: 25px;
  background: var(--cream-deep);
  font-size: 40px;
}

.dialog-card h2 {
  margin: 16px 0 8px;
  font-size: 25px;
  font-weight: 950;
}

.dialog-card p {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.55;
}

.hold-button {
  position: relative;
  width: 100%;
  min-height: 64px;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  background: #e9edf2;
  cursor: pointer;
  font-size: 16px;
  font-weight: 900;
  user-select: none;
}

.hold-button::before {
  position: absolute;
  inset: 0;
  width: 0;
  background: var(--mint);
  content: "";
  transition: width 0ms;
}

.hold-button.holding::before {
  width: 100%;
  transition: width 1.6s linear;
}

.hold-button span {
  position: relative;
  z-index: 1;
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

@media (min-width: 700px) {
  .app-shell {
    min-height: calc(100vh - 32px);
    margin-top: 16px;
    margin-bottom: 16px;
    border-radius: 34px;
  }

  .app-shell.immersive {
    width: min(96vw, 900px);
  }

  .bottom-nav {
    right: calc((100vw - 480px) / 2);
    bottom: 16px;
    left: calc((100vw - 480px) / 2);
    border-radius: 0 0 34px 34px;
  }

  .reader-screen {
    min-height: calc(100vh - 32px);
  }

  .reader-page {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  }

  .story-art {
    min-height: 500px;
    border-radius: 21px 8px 8px 21px;
  }

  .page-sentence {
    display: flex;
    min-height: 100%;
    align-items: center;
    justify-content: center;
    padding: 32px;
  }
}

@media (max-height: 720px) and (orientation: landscape) {
  .reader-screen {
    min-height: 100vh;
  }

  .reader-page {
    display: grid;
    grid-template-columns: 1.4fr 0.6fr;
  }

  .story-art {
    min-height: 330px;
  }

  .page-sentence {
    display: flex;
    min-height: 100%;
    align-items: center;
  }
}

@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;
  }
}
