:root {
  --ink: #0b1e38;
  --navy: #081a33;
  --navy-soft: #102c4c;
  --cream: #fff9e8;
  --paper: #fffdf5;
  --lime: #a8eb43;
  --lime-dark: #4e7c14;
  --gold: #ffd66b;
  --coral: #ff806b;
  --aqua: #62dedc;
  --muted: #607089;
  --line: #d7e0e8;
  --shadow: 0 18px 55px rgba(4, 18, 36, 0.18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: #eef4f1;
  color: var(--ink);
  font-family: "Atkinson Hyperlegible", system-ui, sans-serif;
  font-size: 1.05rem;
  line-height: 1.55;
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.5rem;
  left: 0.5rem;
  transform: translateY(-150%);
  padding: 0.7rem 1rem;
  border-radius: 0.6rem;
  background: white;
  color: var(--ink);
}

.skip-link:focus { transform: translateY(0); }

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem clamp(1rem, 4vw, 4rem);
  background: rgba(8, 26, 51, 0.96);
  color: white;
  box-shadow: 0 8px 30px rgba(3, 14, 29, 0.2);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.65rem;
  border: 0;
  background: transparent;
  color: white;
  font-family: "Fredoka", sans-serif;
  font-size: 1.08rem;
  font-weight: 700;
}

.brand-mark {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  border: 2px solid var(--gold);
  border-radius: 0.8rem;
  background: #122f4b;
  color: var(--lime);
}

.main-nav { display: flex; gap: 0.35rem; }

.nav-btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.55rem 0.85rem;
  background: transparent;
  color: #dce8f2;
  font-weight: 700;
}

.nav-btn:hover, .nav-btn:focus-visible { background: #183957; }
.nav-btn.is-active { background: var(--lime); color: #173307; }

.hero {
  min-height: 31rem;
  display: grid;
  align-items: center;
  padding: clamp(2rem, 7vw, 5.5rem) clamp(1rem, 7vw, 6.5rem);
  background:
    linear-gradient(90deg, rgba(4, 17, 36, 0.97) 0%, rgba(4, 17, 36, 0.88) 38%, rgba(4, 17, 36, 0.12) 72%),
    url("assets/laboratoire-magique.webp") center / cover;
  color: white;
}

.hero-card { max-width: 37rem; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.8rem;
  color: var(--aqua);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1, h2, h3 {
  margin-top: 0;
  font-family: "Fredoka", sans-serif;
  line-height: 1.08;
}

h1 { margin-bottom: 1rem; font-size: clamp(2.5rem, 7vw, 5.25rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.75rem); }
h3 { font-size: 1.3rem; }

.hero p { max-width: 32rem; margin: 0 0 1.5rem; color: #eaf2f5; font-size: 1.18rem; }

.primary-btn, .secondary-btn, .chapter-card, .answer-btn, .chip-btn {
  min-height: 3rem;
  border-radius: 0.9rem;
  font-weight: 700;
}

.primary-btn {
  border: 0;
  padding: 0.75rem 1.25rem;
  background: var(--lime);
  color: #173307;
  box-shadow: 0 8px 0 #4d7c13;
}

.primary-btn:hover { transform: translateY(-1px); }
.primary-btn:active { transform: translateY(3px); box-shadow: 0 5px 0 #4d7c13; }

.secondary-btn {
  border: 2px solid var(--ink);
  padding: 0.65rem 1rem;
  background: white;
  color: var(--ink);
}

.section { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: 3.5rem 0; }

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-head p { max-width: 34rem; margin: 0; color: var(--muted); }

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.chapter-card {
  position: relative;
  min-height: 12rem;
  overflow: hidden;
  border: 1px solid #ccd9e2;
  padding: 1.25rem;
  text-align: left;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 6px 0 #ced8de;
  transition: 160ms ease;
}

.chapter-card:hover, .chapter-card:focus-visible {
  transform: translateY(-4px) rotate(-0.3deg);
  border-color: var(--aqua);
  box-shadow: 0 10px 0 #a8c7cb;
}

.chapter-number {
  display: inline-grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold);
  font-family: "Fredoka", sans-serif;
}

.chapter-card h3 { margin-bottom: 0.5rem; }
.chapter-card p { margin: 0; color: var(--muted); }

.page-shell { min-height: calc(100vh - 4rem); padding: clamp(1.5rem, 4vw, 4rem) 1rem; }
.content-wrap { width: min(980px, 100%); margin: 0 auto; }

.toast {
  position: fixed;
  z-index: 60;
  right: 1rem;
  bottom: 1rem;
  max-width: 22rem;
  transform: translateY(160%);
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow);
  transition: transform 220ms ease;
}

.toast.is-visible { transform: translateY(0); }

:focus-visible { outline: 4px solid var(--gold); outline-offset: 3px; }

@media (max-width: 850px) {
  .chapter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { background-position: 60% center; }
}

@media (max-width: 620px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .brand { width: 100%; }
  .main-nav { width: 100%; overflow-x: auto; }
  .nav-btn { flex: 1 0 auto; }
  .hero { min-height: 36rem; align-items: end; background-position: 68% center; }
  .hero-card { padding: 1rem; border-radius: 1.25rem; background: rgba(4, 17, 36, 0.78); }
  .chapter-grid { grid-template-columns: 1fr; }
  .section-head { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

.dark { color: #38655f; }
.lead { max-width: 44rem; color: var(--muted); font-size: 1.2rem; }
.wide-wrap { width: min(1180px, 100%); margin: 0 auto; }

.hero-actions, .result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
}

.ghost-btn {
  min-height: 3rem;
  border: 2px solid rgba(255,255,255,0.65);
  border-radius: 0.9rem;
  padding: 0.65rem 1rem;
  background: rgba(3, 15, 31, 0.45);
  color: white;
  font-weight: 700;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.6rem;
}

.hero-stats span {
  border: 1px solid rgba(255,255,255,0.24);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  background: rgba(3, 15, 31, 0.55);
  color: #edf6f6;
}

.card-meta {
  display: block;
  margin-top: 1.2rem;
  color: #38655f;
  font-size: 0.93rem;
  font-weight: 700;
}

.chapter-card.is-complete { border-color: #86be37; }
.score-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border-radius: 999px;
  padding: 0.35rem 0.6rem;
  background: #e5f9bd;
  color: #2f5b08;
  font-size: 0.9rem;
  font-weight: 700;
}

.back-btn, .text-btn {
  min-height: 2.75rem;
  border: 0;
  padding: 0.35rem 0;
  background: transparent;
  color: #365970;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}

.back-btn.inverse { color: #dbeaf4; }

.chapter-page {
  background:
    radial-gradient(circle at 85% 8%, rgba(98, 222, 220, 0.24), transparent 22rem),
    linear-gradient(180deg, #f7fbf8, #eaf2ee);
}

.chapter-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(19rem, 0.95fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
  margin-top: 2.5rem;
}

.chapter-intro h1, .lexicon-page h1 { margin-bottom: 0.8rem; font-size: clamp(2.5rem, 6vw, 4.7rem); }

.mission-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1.5rem 0 2rem;
}

.mission-facts span {
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  background: #dfece7;
  color: #34584d;
  font-weight: 700;
}

.saved-score { color: #456275; }

.word-preview {
  position: relative;
  overflow: hidden;
  border: 2px solid #d7e5de;
  border-radius: 1.5rem;
  padding: clamp(1.25rem, 4vw, 2rem);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.flask-icon {
  position: absolute;
  top: -1.2rem;
  right: 0.6rem;
  color: #d7edb8;
  font-size: 7rem;
  transform: rotate(12deg);
}

.word-preview h2, .word-preview p, .word-chips { position: relative; }
.word-preview p { color: var(--muted); }
.word-chips { display: flex; flex-wrap: wrap; gap: 0.55rem; }

.word-chip {
  min-height: 2.75rem;
  border: 2px solid #aed3ce;
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  background: #ecfbf6;
  color: #174e49;
  font-weight: 700;
}

.word-chip:hover, .word-chip:focus-visible { background: var(--aqua); border-color: #287c7a; }

.quiz-shell {
  min-height: calc(100vh - 4rem);
  padding: clamp(1rem, 4vw, 3rem);
  background:
    radial-gradient(circle at 15% 15%, rgba(98, 222, 220, 0.15), transparent 22rem),
    radial-gradient(circle at 85% 80%, rgba(168, 235, 67, 0.15), transparent 24rem),
    var(--navy);
  color: white;
}

.quiz-topline, .quiz-progress, .quiz-card { width: min(780px, 100%); margin-inline: auto; }
.quiz-topline { display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: #dce8f2; font-weight: 700; }

.quiz-progress {
  height: 0.75rem;
  overflow: hidden;
  margin-top: 1.1rem;
  border-radius: 999px;
  background: #26445e;
}

.quiz-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--aqua), var(--lime)); transition: width 250ms ease; }

.quiz-card {
  margin-top: 1.4rem;
  border: 2px solid rgba(255,255,255,0.12);
  border-radius: 1.6rem;
  padding: clamp(1.25rem, 5vw, 3rem);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(0,0,0,0.32);
}

.question-meta { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; color: #486577; font-weight: 700; }
.question-meta span { border-radius: 999px; padding: 0.3rem 0.65rem; background: #e9f3ef; }
.quiz-card h1 { font-size: clamp(1.75rem, 4.5vw, 3rem); }
.answers { display: grid; gap: 0.75rem; margin-top: 1.75rem; }

.answer-btn {
  display: grid;
  grid-template-columns: 2.6rem 1fr;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  min-height: 4rem;
  border: 2px solid #cbd8e0;
  padding: 0.6rem 0.8rem;
  text-align: left;
  background: white;
  color: var(--ink);
}

.answer-btn span { display: grid; width: 2.4rem; height: 2.4rem; place-items: center; border-radius: 0.7rem; background: #e9eff3; }
.answer-btn:hover:not(:disabled) { border-color: #479d9b; background: #effcf9; }
.answer-btn.is-correct { border-color: #5a9418; background: #e7f8c8; }
.answer-btn.is-wrong { border-color: #c4483b; background: #ffe3dd; }
.answer-btn:disabled { cursor: default; opacity: 1; }

.feedback { margin-top: 1.5rem; border-top: 2px dashed #cbd8e0; padding-top: 1.25rem; }
.feedback:empty { display: none; }
.feedback-title { color: #315e18; font-family: "Fredoka", sans-serif; font-size: 1.5rem; font-weight: 700; }
.feedback p { margin: 0.4rem 0 1.1rem; }

.result-shell, .word-focus-shell, .practice-hero {
  min-height: calc(100vh - 4rem);
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    linear-gradient(110deg, rgba(4,17,36,0.94), rgba(4,17,36,0.62)),
    url("assets/laboratoire-magique.webp") center / cover;
}

.result-card, .practice-card, .word-focus-card {
  position: relative;
  width: min(620px, 100%);
  overflow: hidden;
  border: 3px solid var(--gold);
  border-radius: 1.75rem;
  padding: clamp(1.5rem, 6vw, 3.5rem);
  text-align: center;
  background: rgba(255,253,245,0.97);
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(0,0,0,0.4);
}

.result-icon, .practice-icon { display: inline-grid; width: 5rem; height: 5rem; place-items: center; border-radius: 50%; background: var(--navy); color: var(--lime); font-size: 2.8rem; }
.big-score { margin: 0.5rem 0; color: #4c7f11; font-family: "Fredoka", sans-serif; font-size: clamp(4.5rem, 13vw, 7rem); font-weight: 700; line-height: 1; }
.big-score small { font-size: 0.4em; }
.result-card > p:not(.eyebrow) { max-width: 31rem; margin: 1rem auto 1.7rem; }
.result-actions { justify-content: center; }

.result-bubbles i { position: absolute; border: 3px solid #7db72b; border-radius: 50%; opacity: 0.45; }
.result-bubbles i:nth-child(1) { width: 1.4rem; height: 1.4rem; top: 1rem; left: 1.5rem; }
.result-bubbles i:nth-child(2) { width: 2.5rem; height: 2.5rem; top: 3rem; right: 2rem; }
.result-bubbles i:nth-child(3) { width: 1rem; height: 1rem; bottom: 2rem; left: 3rem; }

.lexicon-page { background: #f3f7f4; }
.lexicon-intro { max-width: 44rem; }
.lexicon-toolbar {
  margin: 2rem 0 1.25rem;
  border: 1px solid #d4e1df;
  border-radius: 1.35rem;
  padding: 1rem;
  background: rgba(255,255,255,0.88);
  box-shadow: 0 8px 24px rgba(22, 53, 66, 0.08);
}
.search-field { display: block; margin-bottom: 0.35rem; color: #365970; font-weight: 700; }
.search-control { position: relative; }
.search-control input {
  min-height: 3.6rem;
  width: 100%;
  border: 2px solid #aebfc9;
  border-radius: 1rem;
  padding: 0.65rem 3.2rem 0.65rem 3rem;
  background: white;
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
}
.search-control input:focus { border-color: #397d7b; box-shadow: 0 0 0 4px rgba(98,222,220,0.18); outline: 0; }
.search-control input::-webkit-search-cancel-button { display: none; }
.search-icon {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 1rem;
  color: #3e6f72;
  font-size: 1.55rem;
  font-weight: 700;
  transform: translateY(-52%);
  pointer-events: none;
}
.clear-search {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  width: 2.7rem;
  height: 2.7rem;
  border: 0;
  border-radius: 50%;
  background: #e7efed;
  color: #234e59;
  font-size: 1.6rem;
  line-height: 1;
  transform: translateY(-50%);
}
.lexicon-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 1rem 0 0.6rem;
  color: #365970;
  font-weight: 700;
}
.review-filter {
  min-height: 2.6rem;
  border: 1px solid #a8c2bf;
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  background: white;
  color: #28565c;
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
}
.review-filter.is-active { border-color: #6f9c29; background: #e8f7c9; color: #315c0c; }
.chapter-scroller {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.15rem 0.05rem 0.45rem;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  overscroll-behavior-inline: contain;
}
.filter-chip {
  display: inline-flex;
  min-height: 2.8rem;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid #b7c9ce;
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  scroll-snap-align: center;
  background: white;
  color: #315264;
  font-size: 0.92rem;
  font-weight: 700;
}
.filter-chip span {
  display: inline-grid;
  width: 1.65rem;
  height: 1.65rem;
  place-items: center;
  border-radius: 50%;
  background: #e8efef;
}
.filter-chip.is-active { border-color: var(--navy); background: var(--navy); color: white; }
.filter-chip.is-active span { background: var(--lime); color: #173307; }
.lexicon-index {
  position: sticky;
  z-index: 12;
  top: 4.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  border: 1px solid #d3e0de;
  border-radius: 1rem;
  padding: 0.65rem 0.75rem;
  background: rgba(243,247,244,0.96);
  box-shadow: 0 6px 16px rgba(22,53,66,0.08);
  backdrop-filter: blur(10px);
}
.result-count { flex: 0 0 auto; margin: 0; color: #52687a; font-weight: 700; }
.letter-nav { display: flex; gap: 0.25rem; overflow-x: auto; padding: 0.1rem; }
.letter-nav button {
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 0.65rem;
  background: white;
  color: #244c5b;
  font-weight: 700;
}
.letter-nav button:hover, .letter-nav button:focus-visible { background: var(--aqua); color: #113e3d; }
.lexicon-results { display: grid; gap: 2rem; }
.lexicon-group { scroll-margin-top: 9rem; }
.lexicon-group-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.7rem;
  color: #284c56;
  font-size: 1rem;
}
.lexicon-group-title span {
  display: grid;
  width: 2.65rem;
  height: 2.65rem;
  place-items: center;
  border-radius: 0.85rem;
  background: var(--navy);
  color: var(--lime);
  font-size: 1.35rem;
}
.lexicon-group-title small { color: #677887; font-family: "Atkinson Hyperlegible", system-ui, sans-serif; font-size: 0.92rem; }
.word-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.word-entry {
  overflow: hidden;
  border: 1px solid #cedcda;
  border-radius: 1rem;
  background: white;
  box-shadow: 0 3px 0 #d9e3e1;
}
.word-entry summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.7rem;
  min-height: 5.2rem;
  padding: 0.8rem 0.85rem 0.8rem 1rem;
  list-style: none;
  cursor: pointer;
}
.word-entry summary::-webkit-details-marker { display: none; }
.word-summary-text { min-width: 0; }
.word-term { display: block; margin-bottom: 0.1rem; color: var(--ink); font-family: "Fredoka", sans-serif; font-size: 1.3rem; line-height: 1.2; }
.word-definition {
  display: -webkit-box;
  overflow: hidden;
  color: #4c6070;
  font-size: 0.98rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}
.word-entry[open] .word-definition { display: block; overflow: visible; }
.word-entry-meta {
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  background: #e8f0ed;
  color: #42675f;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}
.word-entry-chevron { color: #38655f; font-size: 1.4rem; font-weight: 700; transition: transform 160ms ease; }
.word-entry[open] .word-entry-chevron { transform: rotate(180deg); }
.word-entry[open] { border-color: #77a8a2; box-shadow: 0 5px 0 #bad3cf; }
.word-entry-actions { display: flex; justify-content: flex-end; border-top: 1px solid #e3ebea; padding: 0.65rem 0.85rem 0.8rem; }
.review-btn { min-height: 2.8rem; margin-top: auto; border: 2px solid #315e69; border-radius: 0.8rem; padding: 0.45rem 0.7rem; background: white; color: #234e59; font-weight: 700; }
.review-btn.is-saved { border-color: #679429; background: #eaf7cf; color: #315c0c; }
.empty-state { padding: 4rem 1rem; text-align: center; }
.empty-state span { font-size: 3rem; }

.practice-card .eyebrow { margin-top: 1rem; color: #38655f; }
.practice-card > p:not(.eyebrow) { max-width: 34rem; margin: 0 auto 1.5rem; color: #41576a; }
.practice-card .text-btn { display: block; margin: 1rem auto 0; }

.word-focus-card { text-align: left; }
.word-focus-card h1 { overflow-wrap: anywhere; font-size: clamp(2.7rem, 8vw, 5rem); }
.word-focus-card > p:not(.eyebrow) { margin: 1rem 0 2rem; font-size: 1.35rem; }

@media (max-width: 900px) {
  .chapter-intro { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  body { padding-bottom: 4.75rem; }
  .topbar { position: sticky; display: block; min-height: 4rem; padding: 0.65rem 1rem; backdrop-filter: none; }
  .brand span:last-child { font-size: 1rem; }
  .main-nav {
    position: fixed;
    z-index: 50;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    width: 100%;
    overflow: visible;
    border-top: 1px solid #2b4760;
    padding: 0.45rem max(0.35rem, env(safe-area-inset-right)) calc(0.45rem + env(safe-area-inset-bottom)) max(0.35rem, env(safe-area-inset-left));
    background: #081a33;
    box-shadow: 0 -8px 28px rgba(4,18,36,0.25);
  }
  .nav-btn { min-height: 3.45rem; border-radius: 0.75rem; padding: 0.45rem 0.25rem; font-size: 0.88rem; }
  .hero { min-height: calc(100svh - 8.75rem); padding: 1rem; background-position: 67% center; }
  .hero-card { width: 100%; padding: 1.1rem; }
  .hero h1 { font-size: clamp(2.45rem, 12vw, 3.7rem); }
  .hero p { font-size: 1.06rem; }
  .hero-actions, .result-actions { align-items: stretch; flex-direction: column; }
  .hero-actions button, .result-actions button { width: 100%; }
  .hero-stats { display: grid; grid-template-columns: 1fr 1fr; }
  .hero-stats span { border-radius: 0.8rem; text-align: center; }
  .section, .page-shell { width: 100%; padding: 2rem 1rem; }
  .chapter-card { min-height: 10.5rem; }
  .chapter-intro { margin-top: 1.5rem; }
  .chapter-intro h1, .lexicon-page h1 { overflow-wrap: anywhere; font-size: clamp(2.3rem, 11vw, 3.5rem); }
  .mission-facts { gap: 0.4rem; }
  .mission-facts span { flex: 1 1 auto; text-align: center; }
  .word-preview { border-radius: 1.15rem; }
  .word-chip { min-height: 3rem; }
  .quiz-shell { min-height: calc(100svh - 8.75rem); padding: 0.8rem; }
  .quiz-topline { font-size: 0.95rem; }
  .quiz-card { margin-top: 1rem; border-radius: 1.2rem; padding: 1.15rem; }
  .quiz-card h1 { font-size: clamp(1.65rem, 7vw, 2.2rem); }
  .answer-btn { min-height: 4.25rem; }
  .feedback .primary-btn { width: 100%; }
  .result-shell, .word-focus-shell, .practice-hero { min-height: calc(100svh - 8.75rem); padding: 0.75rem; }
  .result-card, .practice-card, .word-focus-card { border-width: 2px; border-radius: 1.25rem; padding: 1.3rem; }
  .lexicon-page { padding-top: 1.35rem; }
  .lexicon-page h1 { margin-bottom: 0.45rem; font-size: 2.65rem; }
  .lexicon-page .lead { margin: 0; font-size: 1.05rem; }
  .lexicon-toolbar { margin: 1.25rem 0 1rem; border-radius: 1.1rem; padding: 0.8rem; }
  .lexicon-filter-head { align-items: flex-end; }
  .lexicon-filter-head > span { font-size: 0.92rem; }
  .chapter-scroller { margin-right: -0.8rem; padding-right: 0.8rem; }
  .filter-chip { min-height: 2.9rem; }
  .lexicon-index {
    top: 4rem;
    display: block;
    margin-right: -1rem;
    margin-left: -1rem;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    padding: 0.55rem 1rem;
  }
  .result-count { margin-bottom: 0.4rem; font-size: 0.92rem; }
  .letter-nav { margin-right: -1rem; padding-right: 1rem; }
  .letter-nav button { width: 2.55rem; height: 2.55rem; }
  .word-list { grid-template-columns: 1fr; }
  .word-entry summary { min-height: 5.5rem; grid-template-columns: minmax(0, 1fr) auto auto; }
  .word-term { font-size: 1.35rem; }
  .word-definition { -webkit-line-clamp: 2; }
  .main-nav { transition: transform 180ms ease; }
  body.is-typing, body.has-virtual-keyboard { padding-bottom: 0; }
  body.is-typing .main-nav,
  body.has-virtual-keyboard .main-nav,
  body.is-lexicon-scrolling .main-nav { transform: translateY(120%); pointer-events: none; }
  body.is-typing .lexicon-index,
  body.has-virtual-keyboard .lexicon-index { position: static; }
}
