:root {
  font-family: ui-rounded, "SF Pro Rounded", "Trebuchet MS", system-ui,
    sans-serif;
  color: #293f36;
  background: #faf8ef;
  font-synthesis: none;
  --green: #38664f;
  --line: #e3e6d9;
  --muted: #7f8c7d;
  --orange: #f6c76d;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
}
button,
input,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  touch-action: manipulation;
}
button:disabled {
  opacity: 0.35;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid #dcaa43;
  outline-offset: 4px;
}
button {
  border: 0;
}
svg {
  width: 22px;
  height: 22px;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
header {
  height: 108px;
  max-width: 1200px;
  padding: 0 42px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}
.brand-icon {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  background: #e6edda;
  border-radius: 15px;
  color: var(--green);
  transform: rotate(-7deg);
}
.brand strong {
  display: block;
  font-size: 19px;
  letter-spacing: -0.5px;
}
.brand small {
  display: block;
  font-size: 10px;
  letter-spacing: 2px;
  color: #84917c;
  margin-top: 5px;
}
.lock,
.icon-btn {
  background: transparent;
  color: #758773;
  min-width: 48px;
  min-height: 48px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
}
.lock:hover,
.icon-btn:hover {
  background: #e8eddf;
}
.lock {
  border: 1px solid #dfe4d6;
}
.learning {
  width: min(100% - 48px, 1000px);
  margin: 30px auto 0;
  text-align: center;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 3px;
  color: #8b967f;
  font-weight: 700;
}
.intro h1 {
  font-size: clamp(24px, 3.3vw, 36px);
  font-weight: 600;
  letter-spacing: -1px;
  margin: 14px 0 10px;
}
.intro p {
  font-size: 14px;
  color: #8a9383;
  margin: 0;
}
.reading {
  position: relative;
  background: #fffef9;
  border: 1px solid var(--line);
  border-radius: 30px;
  min-height: 260px;
  margin-top: 38px;
  box-shadow: 0 12px 30px #52652f05;
  padding: 35px 40px 32px;
}
.reading-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.page-label {
  color: #8a987f;
  font-size: 12px;
  letter-spacing: 1px;
}
.listen {
  background: #edf2e5;
  color: #55704b;
  border-radius: 24px;
  padding: 11px 18px;
  font-size: 13px;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sentence {
  font-size: clamp(44px, 5.5vw, 68px);
  line-height: 1.6;
  font-weight: 600;
  letter-spacing: -1px;
  padding: 30px 0 20px;
  overflow-wrap: anywhere;
}
.word {
  font: inherit;
  background: transparent;
  color: inherit;
  border-radius: 14px;
  padding: 0 7px;
  min-height: 52px;
  transition: background 0.18s, transform 0.18s;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.word:hover {
  background: #f3f1df;
  transform: translateY(-2px);
}
.word.selected {
  background: #fae5ab;
  color: #73562a;
  box-shadow: 0 3px 0 #e8ca82;
}
.punctuation {
  white-space: pre-wrap;
}
.hint {
  font-size: 12px;
  color: #98a08e;
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  min-height: 24px;
}
.hint svg {
  width: 16px;
  height: 16px;
}
.navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 4px;
}
.nav-btn {
  color: #6a7e62;
  background: transparent;
  min-height: 48px;
  padding: 10px 8px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
}
.dots {
  display: flex;
  gap: 7px;
  align-items: center;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: #dedfce;
}
.dot.current {
  width: 25px;
  background: #6d8960;
}
.card {
  position: relative;
  width: min(100%, 610px);
  margin: 25px auto 35px;
  background: #fffef9;
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 27px 35px 30px;
  box-shadow: 0 12px 32px #54604209;
  animation: appear 0.22s ease-out;
}
.card .close {
  position: absolute;
  right: 12px;
  top: 10px;
}
.card-label {
  font-size: 11px;
  letter-spacing: 2px;
  color: #91a087;
}
.whole-word {
  font-size: 50px;
  font-weight: 650;
  background: transparent;
  color: #385a46;
  min-height: 60px;
  border-radius: 15px;
  margin: 8px 0;
}
.whole-word svg {
  width: 23px;
  margin-left: 8px;
  color: #859b73;
}
.blocks {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin: 15px 0 20px;
}
.block {
  min-width: 76px;
  min-height: 78px;
  padding: 12px 16px;
  background: #edf0e1;
  color: #4c6842;
  font-size: 40px;
  border-radius: 17px;
  border-bottom: 4px solid #dce4cd;
}
.block:nth-of-type(2n) {
  background: #fbe9bd;
  border-color: #eddaa8;
  color: #856523;
}
.block:nth-of-type(3n) {
  background: #f7ddd0;
  border-color: #e9c8b8;
  color: #976650;
}
.block.playing,
.playing {
  background: #37664e !important;
  color: white !important;
  transform: translateY(-2px);
}
.block.playing {
  border-color: #224c36;
}
.blend,
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #3c684e;
  color: white;
  min-height: 50px;
  padding: 13px 24px;
  border-radius: 15px;
  font-weight: 550;
}
.blend:hover,
.primary:hover {
  background: #2b523b;
}
.card p {
  font-size: 13px;
  color: #8c9682;
  line-height: 1.7;
}
.quiet-space {
  height: 180px;
  display: grid;
  place-items: center;
}
.sprout {
  color: #c6ceb6;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 2px;
}
.sprout svg {
  width: 28px;
  height: 28px;
}
.footer {
  color: #a4ac98;
  text-align: center;
  font-size: 10px;
  letter-spacing: 1.5px;
  margin: 28px 0 25px;
}
.spark {
  color: #dfb65d;
}
.progress-track {
  width: 110px;
  height: 3px;
  background: #e5e6d8;
  margin: 15px auto;
  border-radius: 5px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: #7c9269;
  transition: width 0.3s;
}
.parent {
  max-width: 850px;
  margin: 28px auto 70px;
  padding: 0 24px;
}
.parent h1 {
  font-size: 30px;
  letter-spacing: -1px;
  margin-bottom: 12px;
}
.sub {
  color: #86927d;
  font-size: 14px;
  line-height: 1.8;
}
.panel {
  background: #fffef9;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 30px;
  margin-top: 25px;
}
.panel label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}
.panel textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  border: 1px solid #dfe4d5;
  background: #fcfcf5;
  color: #2e483a;
  line-height: 1.8;
  padding: 18px;
  border-radius: 14px;
  font-size: 17px;
}
.counter {
  text-align: right;
  font-size: 12px;
  color: #939e86;
  margin: 8px 0;
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
}
.secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  background: #edf1e4;
  color: #4f6b45;
  padding: 12px 18px;
  border-radius: 13px;
}
.text-btn {
  background: transparent;
  color: #6c805f;
  min-height: 48px;
  padding: 10px;
}
.preview-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
}
.preview-item textarea {
  min-height: 60px;
  font-size: 16px;
  padding: 10px;
  flex: 1;
}
.preview-item .num {
  padding-top: 18px;
  font-size: 12px;
  color: #95a08a;
}
.preview-actions {
  display: flex;
  flex-direction: column;
}
.preview-actions button {
  min-width: 48px;
  min-height: 42px;
  background: transparent;
  color: #839274;
}
.preview-actions .delete {
  color: #a77761;
}
.error {
  color: #a34e36;
  font-size: 13px;
  line-height: 1.6;
  min-height: 20px;
}
.coverage {
  font-size: 12px;
  line-height: 1.8;
  color: #829074;
  padding: 14px;
  background: #f3f4e9;
  border-radius: 12px;
  margin: 15px 0;
}
.gate {
  max-width: 430px;
  text-align: center;
  margin: 55px auto;
  padding: 35px;
}
.gate .seal {
  width: 65px;
  height: 65px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: #edf0df;
  color: #6d8359;
  margin: auto;
}
.gate h1 {
  font-size: 25px;
}
.gate p {
  font-size: 13px;
  line-height: 1.9;
  color: #8c967f;
}
.pin {
  font-size: 28px;
  letter-spacing: 18px;
  text-align: center;
  width: 100%;
  height: 66px;
  padding-left: 25px;
  border: 1px solid #dae1cf;
  background: #fbfcf4;
  border-radius: 14px;
  margin: 15px 0;
}
.gate .primary {
  width: 100%;
  margin: 10px 0;
}
.completion {
  padding: 50px 15px;
}
.completion .badge {
  font-size: 55px;
}
.completion h2 {
  font-size: 34px;
}
.completion p {
  color: #8a967e;
}
.completion .primary {
  margin-top: 20px;
}
#notice {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: #304b3d;
  color: white;
  border-radius: 14px;
  padding: 14px 22px;
  font-size: 13px;
  max-width: calc(100% - 30px);
  z-index: 30;
  display: none;
}
#notice.visible {
  display: block;
}
a {
  color: #527448;
}
details {
  font-size: 12px;
  color: #7c8d72;
  line-height: 1.9;
  margin-top: 20px;
}
summary {
  cursor: pointer;
  min-height: 40px;
}
.parent .back {
  margin-top: 10px;
}
@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 600px) {
  header {
    height: 85px;
    padding: 0 22px;
  }
  .brand strong {
    font-size: 16px;
  }
  .brand small {
    font-size: 9px;
  }
  .learning {
    width: calc(100% - 28px);
    margin-top: 25px;
  }
  .intro h1 {
    font-size: 26px;
  }
  .reading {
    margin-top: 28px;
    padding: 22px 16px;
    border-radius: 24px;
    min-height: 245px;
  }
  .sentence {
    padding-top: 35px;
    font-size: 44px;
  }
  .word {
    padding: 0 4px;
  }
  .listen {
    padding: 10px 13px;
    font-size: 12px;
  }
  .card {
    padding: 27px 18px;
  }
  .block {
    min-width: 61px;
    min-height: 76px;
    font-size: 36px;
  }
  .quiet-space {
    height: 130px;
  }
  .gate {
    margin: 30px 16px;
    padding: 30px 22px;
  }
  .panel {
    padding: 22px 18px;
  }
  .parent {
    padding: 0 16px;
  }
  .preview-item {
    gap: 5px;
  }
  .preview-actions button {
    padding: 5px;
    font-size: 11px;
  }
  .footer {
    font-size: 9px;
  }
  .dots {
    gap: 5px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

.parent-entry {
  min-height: 48px;
  padding: 10px 16px;
  border-radius: 14px;
  background: #edf2e5;
  color: #55704b;
  font-size: 13px;
  white-space: nowrap;
}
@media (max-width: 600px) {
  .brand small {
    letter-spacing: 1px;
    font-size: 8px;
  }
  header {
    padding: 0 16px;
    gap: 8px;
  }
  .parent-entry {
    padding: 10px;
  }
}

.sentence-scene {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 20px 0;
}
.sentence-picture {
  width: 225px;
  height: 200px;
  object-fit: contain;
  border-radius: 22px;
  flex-shrink: 0;
}
.sentence-scene .sentence {
  min-width: 0;
  padding: 15px 0;
}
.preview-art {
  margin: 4px 0 24px 24px;
  padding: 12px;
  border-radius: 14px;
  background: #f7f7ee;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.preview-picture {
  width: 90px;
  height: 75px;
  object-fit: contain;
  border-radius: 10px;
}
.picture-empty,
.picture-status {
  font-size: 12px;
  color: #79866f;
}
.upload-picture {
  position: relative;
  background: #e8eedc;
  border-radius: 10px;
  padding: 13px;
  cursor: pointer;
  margin: 0 !important;
  font-size: 12px !important;
  overflow: hidden;
}
.upload-picture input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.upload-picture:focus-within {
  outline: 3px solid #dcaa43;
}
@media (max-width: 700px) {
  .sentence-scene {
    flex-direction: column;
    gap: 4px;
    padding: 12px 0;
  }
  .sentence-picture {
    width: 180px;
    height: 150px;
  }
  .sentence-scene .sentence {
    padding: 8px 0;
  }
  .preview-art {
    margin-left: 0;
  }
}

.whole-word {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.sentence-art {
  width: 225px;
  flex-shrink: 0;
}
.sentence-art:empty {
  display: none;
}
.sentence-art .sentence-picture {
  width: 100%;
}
@media (max-width: 700px) {
  .sentence-art {
    width: 180px;
  }
}

.block.silent { opacity: .48; box-shadow: none; cursor: default; }
.block small { display: block; font-size: 14px; margin-top: 6px; }
.phonics-hint { max-width: 680px; margin: 20px auto; line-height: 1.7; font-size: 18px; }
.blocks { flex-wrap: wrap; }

.focus-toggle { display: block; margin: 0 0 12px auto; }
.focus-mode { min-height: 100dvh; padding: 20px; box-sizing: border-box; }
.focus-mode > header, .focus-mode > .footer, .focus-mode .intro { display: none; }
.focus-mode .learning { max-width: none; margin: 0; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-rows: 1fr auto; gap: 24px; min-height: calc(100dvh - 112px); }
.focus-mode .reading { grid-column: 1; grid-row: 1; margin: 0; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.focus-mode .navigation { grid-column: 1; grid-row: 2; margin: 0; }
.focus-mode #word-area { grid-column: 2; grid-row: 1 / 3; min-width: 0; display: flex; align-items: center; }
.focus-mode .card { width: 100%; box-sizing: border-box; margin: 0; }
.focus-mode .sentence-scene { flex-direction: column; }
.focus-mode .sentence { font-size: clamp(36px, 4.5vw, 68px); text-align: center; }
.focus-mode .sentence-art { flex-basis: auto; }
.focus-mode .sentence-picture { width: 220px; height: 190px; }
.focus-mode .blocks { gap: 10px; }
.focus-mode .block { min-width: 56px; padding: 12px; }
.focus-placeholder { width: 100%; text-align: center; color: #64755e; font-size: 24px; padding: 48px 20px; border: 2px dashed #dce3d5; border-radius: 28px; box-sizing: border-box; }
@media(max-width: 700px) {
  .focus-mode { padding: 12px; }
  .focus-mode .learning { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; gap: 16px; }
  .focus-mode #word-area { grid-column: 1; grid-row: 3; }
  .focus-mode .reading { padding: 20px; }
  .focus-mode .sentence-picture { width: 130px; height: 110px; }
}

.focus-mode .learning { width: 100%; }

.focus-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.focus-toolbar .focus-toggle { margin: 0 0 0 auto; }
.focus-title { margin: 0; font-size: 28px; color: var(--ink, #304637); }

.word.reading-word { background: #f4e5ad; color: #425d3c; animation: reading-hop 420ms ease-out; }
@keyframes reading-hop { 0%, 100% { transform: translateY(0); } 45% { transform: translateY(-5px); } }
@media (prefers-reduced-motion: reduce) { .word.reading-word { animation: none; } }

.song-bridge { margin: 20px 0; padding: 16px; border-radius: 18px; background: #eff3e8; }
.song-bridge p { font-size: 15px; margin: 8px 0 12px; }
.song-cues { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.song-cue { background: #fffef9; border: 1px solid #dbe4cf; border-radius: 12px; padding: 10px 14px; color: #36543d; cursor: pointer; font-size: 19px; }
.song-cue small { display: block; margin-top: 5px; font-size: 12px; }
.song-link { display: inline-block; margin-top: 14px; font-size: 14px; color: #4e6945; }

.step-home, .alphabet-page { max-width: 1000px; margin: 60px auto; padding: 0 24px; text-align: center; }
.step-home h1, .alphabet-page h1 { font-size: clamp(28px,4vw,42px); }
.step-home > p, .alphabet-page > p { color: #71816a; font-size: 19px; }
.step-options { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 36px; }
.step-choice { display: flex; flex-direction: column; align-items: center; gap: 20px; border: 1px solid #dce4d5; border-radius: 28px; background: #fffef9; padding: 34px 20px; color: #354b38; cursor: pointer; font: inherit; box-shadow: 0 10px 30px #314a3208; }
.step-choice:hover { background: #f0f5e9; transform: translateY(-3px); }
.step-number { font-size: 14px; letter-spacing: 3px; color: #788970; }
.step-emoji { font-size: 60px; }
.step-choice strong { font-size: 30px; }
.step-action { margin-top: 12px; font-weight: 600; }
.alphabet-page > .text-btn { display: block; margin-bottom: 28px; }
.alphabet-placeholder { min-height: 280px; aspect-ratio: 16/9; border: 2px dashed #d4dfc9; border-radius: 28px; background: #f0f3e9; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 28px 0; color: #7a8a70; }
.alphabet-placeholder > span { font-size: 56px; margin-bottom: 18px; }
.alphabet-placeholder > strong { font-size: 26px; }
@media(max-width:600px) { .step-options { grid-template-columns: 1fr; } .step-home, .alphabet-page { margin-top: 28px; } .alphabet-placeholder { min-height: 200px; } }

.alphabet-video { display: block; width: 100%; aspect-ratio: 16 / 9; max-height: 70vh; margin: 28px auto; border-radius: 24px; background: #18201a; object-fit: contain; }

/* Keep large, playful sentence controls in the side gutters. */
.learning { width: min(calc(100% - 184px), 1100px); }
.navigation { justify-content: center; }
.nav-btn { position: fixed; top: 50%; transform: translateY(-50%); z-index: 20; display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; width: 78px; min-height: 104px; padding: 12px 6px; border: 2px solid #d4dfba; border-radius: 28px; background: #e8f2cf; color: #435e35; box-shadow: 0 6px 0 #c5d4a7, 0 9px 18px #435e3512; font-size: 16px; font-weight: 700; }
#prev { left: 12px; }
#next { right: 12px; background: #ffe9a6; border-color: #eed28a; box-shadow: 0 6px 0 #dfc27a, 0 9px 18px #435e3512; }
.nav-bubble { font-size: 32px; line-height: 1; }
.nav-btn:hover:not(:disabled) { transform: translateY(calc(-50% - 3px)); filter: brightness(1.03); }
.nav-btn:active:not(:disabled) { transform: translateY(calc(-50% + 3px)); box-shadow: none; }
.nav-btn:disabled { opacity: .4; cursor: default; }
.focus-mode .learning { width: calc(100% - 164px); margin: 0 auto; }
@media(max-width:600px) {
  .learning { width: calc(100% - 116px); }
  .focus-mode .learning { width: calc(100% - 100px); }
  .nav-btn { width: 48px; min-height: 86px; border-radius: 20px; font-size: 12px; padding: 8px 2px; }
  #prev { left: 4px; } #next { right: 4px; }
  .nav-bubble { font-size: 26px; }
}

.record-button { display: block; margin: 20px auto 10px; background: #6d925b; color: white; border: 0; border-radius: 22px; padding: 16px 24px; font: inherit; font-size: 21px; font-weight: 700; cursor: pointer; box-shadow: 0 5px 0 #4d703e; }
.record-button.recording { background: #be674e; animation: mic-pulse 1s infinite alternate; }
.record-note { display: block; max-width: 550px; margin: 12px auto 0; color: #78836f; font-size: 12px; line-height: 1.6; }
#game-area { margin: 24px 0; }
.focus-mode #game-area { grid-column: 1 / -1; }
.game-panel { border-radius: 24px; padding: 20px; background: #eef3df; border: 1px solid #dce4c8; text-align: center; }
.game-score { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; align-items: center; font-size: 20px; }
.game-frog { display: inline-block; font-size: 42px; }
.picnic-items { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 16px 0; }
.picnic-item { padding: 8px; border-radius: 14px; background: #fffdf4; font-size: 28px; filter: grayscale(1); opacity: .35; }
.picnic-item.earned { filter: none; opacity: 1; background: #ffe9a6; }
.game-feedback { font-size: 18px; line-height: 1.6; }
.reward-pop, .story-sticker { padding: 16px; font-size: 26px; color: #56743c; animation: reward-pop .6s ease-out; }
.story-sticker { border: 3px dashed #e2bb61; border-radius: 24px; margin-top: 16px; background: #fff2c7; }
.reward-hop { animation: reward-pop .7s ease-out; }
.word.needs-practice { background: #fff0be; border-bottom: 3px dotted #c8a658; }
@keyframes reward-pop { 0% { transform: scale(.7) translateY(10px); } 60% { transform: scale(1.1) translateY(-8px); } 100% { transform: none; } }
@keyframes mic-pulse { to { box-shadow: 0 0 0 8px #be674e30; } }
@media(prefers-reduced-motion: reduce) { .record-button.recording, .reward-pop, .story-sticker, .reward-hop { animation: none; } }
