:root {
  --red: #a63d2f;
  --brick: #c95b42;
  --cream: #f7efdf;
  --paper: #fffaf0;
  --ink: #25201c;
  --olive: #657158;
  --gold: #d49a45;
  --line: rgba(37, 32, 28, .14);
  --shadow: 0 16px 45px rgba(53, 31, 20, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  padding-bottom: calc(78px + env(safe-area-inset-bottom));
}
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img { display: block; width: 100%; }

.hero { min-height: 92svh; position: relative; display: flex; align-items: end; overflow: hidden; background: #6f281e; }
.hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 54% center; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(25,16,11,.04) 35%, rgba(25,16,11,.84) 100%); }
.hero-copy { position: relative; z-index: 1; color: #fff9eb; padding: 0 24px 76px; max-width: 760px; }
.eyebrow { margin: 0 0 10px; font-size: .76rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.hero h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(3.9rem, 17vw, 7rem); line-height: .79; letter-spacing: -.055em; }
.hero h1 em { font-weight: 400; color: #f5bf73; }
.hero-line { margin: 23px 0 0; font-family: Georgia, serif; font-size: 1.12rem; font-style: italic; }
.scroll-cue { position: absolute; z-index: 2; right: 22px; bottom: 25px; width: 43px; height: 43px; border-radius: 50%; border: 1px solid rgba(255,255,255,.6); color: white; text-decoration: none; display: grid; place-items: center; }

.section { padding: 70px 20px; max-width: 980px; margin: auto; }
.intro { text-align: center; padding-top: 78px; padding-bottom: 62px; }
.kicker, .section-heading > span { color: var(--red); font-size: .72rem; font-weight: 900; letter-spacing: .17em; text-transform: uppercase; }
h2, h3 { font-family: Georgia, "Times New Roman", serif; }
.intro h2, .section-heading h2 { margin: 8px 0 16px; font-size: clamp(2.15rem, 9vw, 4rem); line-height: .98; letter-spacing: -.035em; }
.intro > p:not(.kicker):not(.offline-status) { max-width: 620px; margin: 0 auto 25px; font-size: 1.06rem; }
.offline-button, .next-button { border: 0; border-radius: 999px; padding: 14px 20px; font: inherit; font-weight: 800; background: var(--red); color: white; box-shadow: 0 8px 25px rgba(166,61,47,.2); }
.offline-button:active, .next-button:active { transform: translateY(1px); }
.offline-status { color: #736b63; font-size: .78rem; margin: 12px 0 0; }

.warm { max-width: none; background: var(--cream); }
.warm > * { max-width: 940px; margin-left: auto; margin-right: auto; }
.section-heading { margin-bottom: 28px; }
.section-heading h2 { font-size: clamp(2rem, 8vw, 3.25rem); }
.quick-grid { display: grid; gap: 13px; }
.quick-card { border: 1px solid var(--line); border-radius: 21px; padding: 21px; background: rgba(255,255,255,.62); }
.quick-card p { margin: 4px 0; color: #756c64; font-size: .82rem; }
.quick-card strong { display: block; font-family: Georgia, serif; font-size: 1.25rem; line-height: 1.2; }
.quick-card small { display: block; margin-top: 7px; color: #6f665e; }
.quick-icon { font-size: 1.45rem; color: var(--red); }
.accent-card { background: var(--olive); color: white; }
.accent-card p, .accent-card small { color: rgba(255,255,255,.78); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.actions a { display: inline-flex; align-items: center; min-height: 36px; padding: 8px 13px; border: 1px solid currentColor; border-radius: 999px; text-decoration: none; font-size: .78rem; font-weight: 800; }

.pool-banner { position: relative; min-height: 530px; display: flex; align-items: end; overflow: hidden; color: white; }
.pool-banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pool-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(19,28,25,.88)); }
.pool-banner > div { position: relative; z-index: 1; padding: 40px 22px; max-width: 680px; }
.pool-banner h2 { margin: 7px 0 12px; font-size: 2.5rem; line-height: 1; }
.pool-banner p:last-child { margin-bottom: 0; }

.day-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 3px 2px 10px; scrollbar-width: none; }
.day-tabs::-webkit-scrollbar { display: none; }
.day-tab { flex: 0 0 auto; border: 1px solid var(--line); background: white; border-radius: 999px; padding: 10px 16px; color: var(--ink); font: inherit; font-weight: 800; }
.day-tab.active { border-color: var(--red); background: var(--red); color: white; }
.day-panel { padding-top: 30px; }
.day-panel > h3 { margin: 0 0 15px; font-size: 2rem; }
.lead { color: #655d56; margin-top: -6px; }
.timeline { position: relative; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 11px; bottom: 9px; width: 1px; background: var(--line); }
.timeline article { position: relative; display: grid; grid-template-columns: 78px 1fr; gap: 13px; padding: 0 0 30px 20px; }
.timeline article::before { content: ""; position: absolute; left: 2px; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--brick); box-shadow: 0 0 0 4px var(--paper); }
.timeline time { color: var(--red); font-weight: 900; font-size: .76rem; line-height: 1.5; }
.timeline strong { font-family: Georgia, serif; font-size: 1.12rem; }
.timeline p { margin: 6px 0 0; color: #625a53; }
.timeline .note { padding: 10px 12px; border-radius: 12px; background: var(--cream); color: #594c43; font-size: .82rem; }
.timeline article.backup > div { padding: 16px; border-radius: 16px; background: var(--cream); }
.day-tip { padding: 20px; border-radius: 18px; background: #2f332b; color: white; }
.day-tip p { color: rgba(255,255,255,.74); }

.image-break { height: 500px; position: relative; overflow: hidden; }
.image-break img { height: 100%; object-fit: cover; }
.image-break::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(30,15,8,.05), rgba(30,15,8,.72)); }
.image-break blockquote { position: absolute; z-index: 1; left: 24px; right: 24px; bottom: 34px; margin: 0; max-width: 650px; color: white; font: italic 2.1rem/1.05 Georgia, serif; }

.game-card { margin: 20px 0; padding: 22px; border-radius: 24px; background: #f2dfbd; box-shadow: var(--shadow); }
.quiz-card { background: #dfe5d9; }
.game-head { display: flex; justify-content: space-between; gap: 15px; align-items: start; }
.game-head span { color: #7d5540; font-size: .72rem; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; }
.game-head h3 { margin: 2px 0; font-size: 1.4rem; }
.game-head b { white-space: nowrap; font-size: .78rem; }
.game-prompt { margin: 26px 0; text-align: center; font: italic 2.1rem Georgia, serif; }
.game-prompt.small { font-size: 1.35rem; min-height: 62px; }
.answer-grid { display: grid; gap: 9px; }
.answer-grid button { width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 14px; border: 1px solid rgba(37,32,28,.2); background: rgba(255,255,255,.7); color: var(--ink); font: inherit; text-align: left; }
.answer-grid button.correct { background: #d6ead1; border-color: #5d8f55; }
.answer-grid button.wrong { background: #efd2cb; border-color: #a84b3d; }
.feedback { min-height: 24px; font-size: .85rem; font-weight: 700; }
.next-button { padding: 11px 16px; font-size: .82rem; box-shadow: none; }

.academy { max-width: 1040px; }
.academy-intro { max-width: 720px; margin: -8px 0 25px; color: #655d56; font-size: 1.02rem; }
.academy-dashboard { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.academy-stat { min-width: 0; padding: 15px 8px; border: 1px solid var(--line); border-radius: 18px; background: white; text-align: center; }
.academy-stat b { display: block; color: var(--red); font: 1.65rem/1 Georgia, serif; }
.academy-stat span { display: block; margin-top: 6px; color: #756c64; font-size: .67rem; }
.academy-progress, .level-meter { height: 9px; margin: 14px 0 22px; overflow: hidden; border-radius: 999px; background: #eadfcd; }
.academy-progress span, .level-meter span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brick), var(--gold)); transition: width .3s ease; }
.academy-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.academy-primary, .academy-secondary { min-height: 45px; border-radius: 999px; padding: 10px 17px; font: inherit; font-size: .8rem; font-weight: 850; }
.academy-primary { border: 0; background: var(--red); color: white; box-shadow: 0 9px 24px rgba(166,61,47,.2); }
.academy-secondary { border: 1px solid var(--line); background: white; color: var(--ink); }
.voice-status { min-height: 22px; margin: 12px 2px 25px; color: #766c63; font-size: .76rem; }
.world-list { display: grid; gap: 15px; }
.world-card { overflow: hidden; border: 1px solid var(--line); border-radius: 23px; background: white; box-shadow: 0 8px 30px rgba(53,31,20,.06); }
.world-summary { width: 100%; display: grid; grid-template-columns: 45px 1fr auto; gap: 12px; align-items: center; padding: 18px; border: 0; background: transparent; color: inherit; text-align: left; font: inherit; }
.world-icon { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 15px; background: var(--cream); font-size: 1.3rem; }
.world-summary h3 { margin: 0; font-size: 1.2rem; }
.world-summary p { margin: 2px 0 0; color: #756c64; font-size: .73rem; }
.world-count { color: var(--red); font-size: .74rem; font-weight: 900; }
.level-grid { display: none; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 0 16px 18px; }
.world-card.open .level-grid { display: grid; }
.level-button { aspect-ratio: 1; min-width: 0; border: 1px solid var(--line); border-radius: 15px; background: #fffaf0; color: var(--ink); font: 800 .82rem/1 ui-sans-serif, sans-serif; position: relative; }
.level-button.done { border-color: #7d9a70; background: #e3ecdc; color: #35502f; }
.level-button.locked { background: #eee9e1; color: #aaa098; }
.level-button .mini-star { position: absolute; right: 4px; top: 4px; color: var(--gold); font-size: .62rem; }
.academy-player { margin-top: 24px; padding: 20px; border-radius: 25px; background: #2f332b; color: white; box-shadow: var(--shadow); scroll-margin-top: 18px; }
.player-top { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; }
.player-close { width: 39px; height: 39px; border: 1px solid rgba(255,255,255,.28); border-radius: 50%; background: transparent; color: white; font-size: 1.1rem; }
.player-top span { color: #f3c177; font-size: .68rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.player-top h3 { margin: 1px 0; color: white; font-size: 1.35rem; }
.player-top > b { font-size: .72rem; white-space: nowrap; }
.level-meter { margin: 15px 0 24px; background: rgba(255,255,255,.14); }
.lesson-label { margin: 0 0 4px; color: #f3c177; font-size: .7rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.lesson-question { margin: 8px 0 22px; font: 1.65rem/1.15 Georgia, serif; }
.lesson-sub { color: rgba(255,255,255,.7); font-size: .83rem; }
.speak-button { width: 46px; height: 46px; display: inline-grid; place-items: center; border: 1px solid rgba(255,255,255,.3); border-radius: 50%; background: rgba(255,255,255,.08); color: white; font-size: 1.15rem; }
.lesson-cards { display: grid; gap: 10px; }
.lesson-card { display: grid; grid-template-columns: 1fr 46px; gap: 10px; align-items: center; padding: 14px; border-radius: 17px; background: rgba(255,255,255,.09); }
.lesson-card strong { display: block; color: #f7d196; font: 1.15rem Georgia, serif; }
.lesson-card span, .lesson-card small { display: block; }
.lesson-card span { margin-top: 2px; }
.lesson-card small { margin-top: 5px; color: rgba(255,255,255,.65); }
.academy-answers { display: grid; gap: 9px; margin-top: 18px; }
.academy-answers button { min-height: 50px; padding: 12px 14px; border: 1px solid rgba(255,255,255,.22); border-radius: 15px; background: rgba(255,255,255,.09); color: white; font: inherit; text-align: left; }
.academy-answers button.correct { border-color: #a7d39c; background: rgba(106,163,91,.36); }
.academy-answers button.wrong { border-color: #e3a092; background: rgba(188,76,55,.35); }
.academy-answers button:disabled { opacity: .8; }
.phonetic { color: #f3c177; font-weight: 800; }
.word-bank, .sentence-line { display: flex; flex-wrap: wrap; gap: 8px; min-height: 55px; padding: 11px; border-radius: 15px; }
.sentence-line { margin: 16px 0 10px; border: 1px dashed rgba(255,255,255,.3); }
.word-bank { background: rgba(255,255,255,.06); }
.word-chip { border: 0; border-radius: 999px; padding: 9px 13px; background: #fff3da; color: #322a24; font: inherit; font-weight: 800; }
.word-chip:disabled { opacity: .25; }
.academy-feedback { color: #fff; }
.level-next { width: 100%; margin-top: 4px; background: #d49a45; color: #2f261f; box-shadow: none; }
.level-complete { padding: 25px 5px; text-align: center; }
.level-complete .big-star { font-size: 3rem; }
.level-complete h4 { margin: 8px 0 5px; font: 2rem Georgia, serif; }
.badge-row { display: flex; justify-content: center; gap: 8px; margin: 16px 0; }
.badge { padding: 7px 11px; border-radius: 999px; background: rgba(255,255,255,.1); color: #f7d196; font-size: .72rem; font-weight: 800; }

.facts { max-width: none; background: var(--red); color: white; overflow: hidden; }
.facts > * { max-width: 940px; margin-left: auto; margin-right: auto; }
.section-heading.light > span { color: #f3c177; }
.fact-scroller { display: flex; gap: 13px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 20px 16px 0; }
.fact-scroller article { flex: 0 0 min(78vw, 310px); scroll-snap-align: start; padding: 22px; border: 1px solid rgba(255,255,255,.22); border-radius: 22px; background: rgba(255,255,255,.08); }
.fact-scroller b { color: #f3c177; }
.fact-scroller h3 { margin: 16px 0 6px; font-size: 1.6rem; }
.fact-scroller p { margin: 0; color: rgba(255,255,255,.77); }

.practical details { border-top: 1px solid var(--line); }
.practical summary { padding: 17px 0; font-weight: 850; cursor: pointer; }
.practical details p { margin: -3px 0 18px; color: #655d56; }
.practical details a { color: var(--red); font-weight: 700; }
.privacy-note { margin-top: 30px; font-size: .78rem; color: #776e65; }

.closing { height: 500px; position: relative; display: grid; place-items: center; overflow: hidden; text-align: center; color: white; }
.closing img { position: absolute; inset: 0; height: 100%; object-fit: cover; }
.closing::after { content: ""; position: absolute; inset: 0; background: rgba(71,29,20,.55); }
.closing div { position: relative; z-index: 1; padding: 22px; }
.closing p { text-transform: uppercase; font-size: .72rem; letter-spacing: .18em; font-weight: 900; }
.closing h2 { margin: 8px 0; font-size: 3rem; line-height: 1; }
.credits { padding: 30px 20px; color: #7b7269; font-size: .68rem; max-width: 900px; margin: auto; }

.bottom-nav { position: fixed; z-index: 20; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); min-height: 61px; display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; border: 1px solid rgba(255,255,255,.25); border-radius: 22px; background: rgba(38,31,27,.9); backdrop-filter: blur(14px); box-shadow: 0 12px 35px rgba(0,0,0,.22); }
.bottom-nav a { color: rgba(255,255,255,.85); text-decoration: none; font-size: .65rem; font-weight: 750; text-align: center; }
.bottom-nav span { display: block; margin-bottom: 1px; font-size: 1.08rem; color: #f3c177; }

@media (min-width: 680px) {
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .timeline article { grid-template-columns: 110px 1fr; }
  .answer-grid { grid-template-columns: repeat(2, 1fr); }
  .world-list { grid-template-columns: repeat(2, 1fr); align-items: start; }
  .lesson-cards, .academy-answers { grid-template-columns: repeat(2, 1fr); }
  .hero-copy { padding-left: 7vw; }
  .pool-banner > div { padding-left: 7vw; }
}

@media (display-mode: standalone) {
  .hero { min-height: 95svh; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
