:root {
  --ink: #34483e;
  --muted: #74806f;
  --green: #476e52;
  --green-dark: #365c40;
  --green-soft: #e8efdc;
  --paper: #f8f7f0;
  --card: #fffef9;
  --line: #e3e7d8;
  --gold: #e0a92e;
  --warm: #fff4dc;
  --shadow: 0 8px 26px #40513a0d;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  line-height: 1.5;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: 0;
  background: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button:disabled {
  cursor: default;
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #467c94;
  outline-offset: 4px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  line-height: 1.2;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: 20px;
  top: -100px;
  z-index: 100;
  background: white;
  padding: 10px;
}
.skip-link:focus {
  top: 10px;
}

/* ---------- Header ---------- */
.site-header {
  width: min(1100px, 100% - 32px);
  margin: 0 auto;
  padding: 18px 0;
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: inherit;
}
.brand-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--green-soft);
  font-size: 1.5rem;
}
.brand-green {
  color: #6c9b62;
}
.main-nav {
  display: flex;
  gap: 6px;
  margin: 0 auto;
}
.nav-button {
  position: relative;
  padding: 10px 18px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 1.05rem;
  min-height: 48px;
}
.nav-button.active {
  background: var(--green-soft);
}
.nav-button:hover {
  background: #eef2e5;
}
.nav-alert {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e07a5f;
  color: white;
  font-size: 0.75rem;
  animation: bob 0.8s ease-in-out infinite alternate;
}
.star-counter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 99px;
  background: #fff3cf;
  border: 1px solid #f1dfa8;
  font-weight: 800;
  font-size: 1.15rem;
  white-space: nowrap;
}
.icon-button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #eef0e6;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.icon-button:hover {
  background: #e3e8d8;
}

/* ---------- Layout & buttons ---------- */
main {
  width: min(1100px, 100% - 32px);
  margin: 0 auto;
  flex: 1;
}
.view {
  animation: appear 0.3s ease;
  padding-bottom: 40px;
}
.button {
  border-radius: 18px;
  padding: 14px 26px;
  min-height: 56px;
  font-weight: 800;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition:
    background 0.15s,
    transform 0.15s;
}
.button:hover:not(:disabled) {
  transform: translateY(-2px);
}
.button:active:not(:disabled) {
  transform: translateY(1px);
}
.primary {
  color: #fffef5;
  background: var(--green);
  box-shadow: 0 4px 0 #36573f;
}
.primary:hover {
  background: var(--green-dark);
}
.secondary {
  background: #f0f2e8;
  border: 1px solid #d9e0cf;
  color: #486345;
}
.secondary:hover {
  background: #e7eddc;
}
.small {
  font-size: 0.9rem;
  padding: 10px 16px;
  min-height: 46px;
}
.text-button {
  font-weight: 700;
  color: #5d7650;
  padding: 10px 12px;
  border-radius: 10px;
  min-height: 44px;
}
.text-button:hover {
  background: #eef2e5;
}

/* ---------- Home ---------- */
.home-hero {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 36px;
  align-items: center;
  background: #e9efdf;
  border: 1px solid #e0e8d3;
  border-radius: 32px;
  padding: 30px 40px;
}
.home-momo {
  width: 210px;
  height: 250px;
  justify-self: center;
}
.home-momo .momo-body {
  width: 100%;
  height: 100%;
  animation: idle 3s ease-in-out infinite alternate;
}
.momo-says {
  position: relative;
  display: inline-block;
  background: white;
  border-radius: 22px;
  padding: 16px 22px;
  font-size: 1.35rem;
  font-weight: 700;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.momo-says:before {
  content: "";
  position: absolute;
  left: -12px;
  top: 22px;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-right: 13px solid white;
}
.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}
.button.big {
  font-size: 1.5rem;
  min-height: 72px;
  padding: 12px 34px;
  border-radius: 22px;
  flex-direction: row;
}
.button.big small {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.9;
  margin-left: 6px;
}
.needs {
  display: grid;
  gap: 8px;
  max-width: 380px;
}
.need {
  display: grid;
  grid-template-columns: 28px 90px 1fr;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 1rem;
}
.need-icon {
  font-size: 1.3rem;
}
.need-bar {
  height: 16px;
  border-radius: 99px;
  background: #ffffffb0;
  border: 1px solid #d8e0cc;
  overflow: hidden;
}
.need-bar span {
  display: block;
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s ease;
}
.need-full .need-bar span {
  background: #f0a35e;
}
.need-joy .need-bar span {
  background: #e9c44f;
}
.grid-title {
  font-size: 1.35rem;
  margin: 34px 0 16px;
}
.activity-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.activity-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 22px 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform 0.15s;
}
.activity-card:hover {
  transform: translateY(-3px);
}
.activity-card:active {
  transform: translateY(1px);
}
.activity-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 22px;
  font-size: 2.4rem;
}
.peach .activity-icon {
  background: #fde6d6;
}
.lavender .activity-icon {
  background: #ece3f6;
}
.mint .activity-icon {
  background: #dcf0e4;
}
.yellow .activity-icon {
  background: #fdf0c8;
}
.sky .activity-icon {
  background: #dcecf7;
}
.rose .activity-icon {
  background: #f8dfe4;
}
.activity-title {
  font-weight: 800;
  font-size: 1.1rem;
  line-height: 1.25;
}
.together-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #f3efe3;
  color: #7c7258;
  padding: 3px 8px;
  border-radius: 99px;
}
.activity-level {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 700;
}
.level-bar {
  width: 60px;
  height: 8px;
  border-radius: 99px;
  background: #ebeee2;
  overflow: hidden;
}
.level-bar span {
  display: block;
  height: 100%;
  background: #8db07a;
}
/* ---------- Subjects and menu ---------- */
.subject-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.subject-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 18px;
  padding: 22px 26px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  text-align: left;
  transition: transform 0.15s;
}
.subject-card:hover {
  transform: translateY(-3px);
}
.subject-card:active {
  transform: translateY(1px);
}
.subject-icon {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: 26px;
  font-size: 3rem;
}
.subject-card.mint .subject-icon {
  background: #dcf0e4;
}
.subject-card.sky .subject-icon {
  background: #dcecf7;
}
.subject-title {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.1;
}
.subject-icons {
  font-size: 1.3rem;
  letter-spacing: 0.1em;
}
.menu-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 10px;
}
.back-button {
  min-height: 44px;
  font-weight: 800;
  font-size: 1.05rem;
}
.menu-path {
  color: var(--muted);
  font-weight: 700;
}
.menu-title {
  font-size: 2rem;
  margin: 4px 0 20px;
}
.category-games {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 700;
}

footer {
  text-align: center;
  padding: 10px 0 24px;
}
footer .text-button {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- Game ---------- */
.game-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px auto 14px;
  max-width: 760px;
}
.round-stars {
  display: flex;
  gap: 10px;
  font-size: 2.3rem;
  line-height: 1;
}
.round-stars .earned {
  color: var(--gold);
  text-shadow: 0 2px 0 #c58f1c40;
}
.round-stars .empty {
  color: #dcdfd2;
}
.round-stars .pop {
  animation: star-pop 0.6s ease;
}
.game-card {
  max-width: 760px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 26px 30px 22px;
  box-shadow: var(--shadow);
  text-align: center;
}
.game-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.game-icon {
  font-size: 1.8rem;
}
.game-head h1 {
  font-size: 1.7rem;
  letter-spacing: -0.5px;
}
.level-chip {
  font-size: 0.85rem;
  font-weight: 800;
  color: #5f7a52;
  background: var(--green-soft);
  padding: 4px 11px;
  border-radius: 99px;
  white-space: nowrap;
}
.instruction-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 16px 0 6px;
}
.game-instruction {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.35;
}
.listen-button {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--green-soft);
  font-size: 1.45rem;
}
.listen-button:hover,
.big-listen:hover {
  background: #dfe8cd;
}
.speaking {
  animation: bob 0.6s ease infinite alternate;
}
.speech-notice {
  font-size: 0.9rem;
  color: #88713e;
  background: var(--warm);
  border-radius: 12px;
  margin: 10px auto 0;
  padding: 10px 14px;
  max-width: 460px;
}
.adult-cue {
  margin: 8px auto 0;
  max-width: 460px;
  font-size: 0.85rem;
  color: var(--muted);
}
.adult-cue summary {
  cursor: pointer;
  padding: 6px;
}
.adult-cue .cue-text {
  background: #f4f5ee;
  border-radius: 10px;
  padding: 10px;
  color: var(--ink);
  font-size: 1rem;
}
.task-area {
  min-height: 270px;
  padding-top: 14px;
}
.big-listen {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 12px 28px;
  border-radius: 20px;
  background: var(--green-soft);
  border: 1px solid #d9e3cd;
  color: #4b6940;
  font-weight: 800;
  font-size: 1.15rem;
  margin: 6px 0 18px;
}
.big-listen span {
  font-size: 1.5rem;
}
.letter-keyboard {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 620px;
  margin: 0 auto;
}
.letter-keyboard .letter-button {
  width: 72px;
  height: 72px;
  font-size: 2.1rem;
}
.letter-keyboard.full .letter-button {
  width: 58px;
  height: 60px;
  font-size: 1.7rem;
}
.letter-button {
  font-weight: 800;
  border: 2px solid #dce3d1;
  box-shadow: 0 4px 0 #dce3d1;
  border-radius: 16px;
  background: #f8faef;
  color: #45603e;
  display: inline-grid;
  place-items: center;
  transition:
    transform 0.1s,
    background 0.15s;
}
.letter-button:hover:not(:disabled) {
  background: #e9f0dd;
  transform: translateY(-2px);
}
.letter-button:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: none;
}
.letter-button:disabled {
  box-shadow: none;
}
.letter-button.wrong {
  opacity: 0.3;
}
.letter-button.chosen {
  background: #dcedc6;
  border-color: #8fb575;
  box-shadow: 0 4px 0 #8fb575;
  opacity: 1;
}
.letter-button.hint {
  animation: hint-glow 0.9s ease-in-out infinite alternate;
  border-color: var(--gold);
}
.letter-button.shake {
  animation: shake 0.4s ease;
}
.answer-choices {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin: 22px 0 10px;
}
.answer-choices .letter-button {
  width: 92px;
  height: 92px;
  font-size: 2.8rem;
  border-radius: 22px;
}
.merk-word {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #3e5a36;
  margin: 6px 0 4px;
}
.merk-gap {
  display: inline-block;
  min-width: 1.3em;
  padding: 0 4px;
  margin: 0 2px;
  border: 3px dashed #b9cba6;
  border-radius: 12px;
  color: #9caf87;
  line-height: 1.2;
}
.merk-gap.found {
  border: 3px solid #8fb575;
  background: #dcedc6;
  color: #3f6235;
  animation: star-pop 0.4s ease;
}
.merk-choice {
  width: auto !important;
  min-width: 92px;
  padding: 0 18px;
}
.merk-tip {
  max-width: 480px;
  margin: 6px auto 0;
  padding: 10px 14px;
  border-radius: 14px;
  background: #fff8e3;
  border: 1px solid #f0e2b6;
  color: #6f6036;
  font-weight: 700;
}
.picture-choices {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin: 18px 0 10px;
}
.picture-button {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  width: 112px;
  min-height: 112px;
  border-radius: 24px;
  border: 2px solid #dce3d1;
  box-shadow: 0 4px 0 #dce3d1;
  background: #f8faef;
  transition:
    transform 0.1s,
    background 0.15s;
}
.picture-button:hover:not(:disabled) {
  background: #e9f0dd;
  transform: translateY(-2px);
}
.picture-button:disabled {
  box-shadow: none;
}
.picture-button.wrong {
  opacity: 0.3;
}
.picture-button.chosen {
  background: #dcedc6;
  border-color: #8fb575;
  box-shadow: 0 4px 0 #8fb575;
  opacity: 1;
}
.choice-icon {
  font-size: 3.6rem;
  line-height: 1.1;
}
/* Captions would give the answer away; they appear only as help. */
.choice-caption {
  display: none;
  font-weight: 800;
  font-size: 1rem;
}
.picture-choices.labeled .choice-caption {
  display: block;
}
.picture-choices.written .picture-button {
  width: auto;
  min-width: 132px;
  min-height: 84px;
  padding: 10px 20px;
}
.choice-word {
  font-size: 1.8rem;
  font-weight: 800;
  color: #45603e;
}
.sounding {
  outline: 4px solid var(--gold);
  outline-offset: 3px;
  transform: scale(1.08);
}
.blend-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 96px;
}
.blend-wand {
  font-size: 3.6rem;
}
.sound-dots {
  display: flex;
  gap: 12px;
}
.sound-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e3e7d8;
  transition:
    background 0.15s,
    transform 0.15s;
}
.sound-dot.sounding {
  background: var(--gold);
  outline: none;
  transform: scale(1.35);
}
.blend-result {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 2.4rem;
  font-weight: 800;
  color: #3f6235;
  animation: star-pop 0.5s ease;
}
.blend-result span {
  font-size: 3.6rem;
}
.word-picture {
  font-size: 6rem;
  line-height: 1.2;
  margin: 0 auto 6px;
}
.word-picture.no-picture {
  font-size: 4rem;
  opacity: 0.6;
}
.letter-row,
.neighbor-question {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 10px 0 18px;
  flex-wrap: wrap;
}
.letter-tile {
  min-width: 64px;
  height: 74px;
  display: inline-grid;
  place-items: center;
  font-size: 2.3rem;
  background: #f0f3e4;
  border: 2px solid #dfe6d3;
  border-radius: 16px;
  color: #4f6d43;
  font-weight: 800;
}
.letter-tile.hole {
  border: 3px dashed #b9cba6;
  background: #fafbf5;
  color: #9caf87;
}
.letter-tile.found {
  background: #dcedc6;
  border-color: #8fb575;
  animation: star-pop 0.4s ease;
}
.letter-tile.large {
  font-size: 3.4rem;
  height: 104px;
  min-width: 100px;
}
.abc-help {
  display: flex;
  justify-content: center;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: #fff8e3;
  border: 1px solid #f0e2b6;
  border-radius: 14px;
  margin: 14px auto 0;
  max-width: 560px;
  animation: appear 0.3s ease;
}
.abc-help-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #8b7642;
  margin-right: 6px;
}
.abc-help-letter {
  font-size: 1.5rem;
  font-weight: 800;
  color: #6f6036;
  padding: 0 4px;
}
.order-slots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 10px 0 22px;
}
.order-slot {
  height: 78px;
  width: 70px;
  border: 3px dashed #ced8bf;
  border-radius: 16px;
  background: #fafbf5;
  display: grid;
  place-items: center;
  font-size: 2.3rem;
  font-weight: 800;
  color: #4f6d43;
}
.order-slot.filled {
  background: #dcedc6;
  border: 3px solid #8fb575;
}
.order-slot:not(.filled) span {
  font-size: 0.9rem;
  font-weight: 400;
  color: #9aa58c;
}
.order-cards {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}
.order-cards .letter-button {
  width: 78px;
  height: 78px;
  font-size: 2.3rem;
}
.order-cards .letter-button:disabled {
  visibility: hidden;
}
.echo-symbol {
  font-size: 5rem;
  line-height: 1.2;
}
.together-note {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 14px;
}
.self-check {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}
.self-check + .text-button {
  margin-top: 10px;
  font-size: 0.9rem;
}
.sequence-cards {
  display: flex;
  gap: 9px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 12px 0;
}
.sequence-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: #f2f4e8;
  border-radius: 16px;
  min-width: 80px;
  font-size: 1.1rem;
  font-weight: 700;
}
.move-icon {
  font-size: 2rem;
}
.sequence-number {
  font-size: 0.75rem;
  color: #99a289;
}
/* ---------- Math: tens and ones ---------- */
.blocks {
  --unit: 15px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 18px 26px;
  min-height: calc(var(--unit) * 10 + 34px);
  padding: 22px 0 8px;
}
.rods {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}
/* A rod is ten cubes stacked; the stripes show the ten single units. */
.rod {
  position: relative;
  width: calc(var(--unit) + 3px);
  height: calc(var(--unit) * 10 + 18px);
  border-radius: 4px;
  background: repeating-linear-gradient(
    to top,
    #6fa3cf 0 var(--unit),
    #4f84b2 var(--unit) calc(var(--unit) + 2px)
  );
  box-shadow: inset 0 0 0 1px #3f6f99;
}
.rod-label {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 4px;
  font-size: 0.8rem;
  font-weight: 800;
  color: #3f6f99;
}
.blocks.counting .rod-label {
  display: block;
}
.cubes {
  display: grid;
  grid-template-columns: repeat(5, var(--unit));
  gap: 4px;
  align-content: end;
}
.cube {
  width: var(--unit);
  height: var(--unit);
  border-radius: 3px;
  background: #f0a35e;
  box-shadow: inset 0 0 0 1px #c97a35;
}
.cube-ten {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, var(--unit));
  gap: 4px;
  padding: 4px;
  margin: -6px -6px 2px;
  border: 2px dashed #4f84b2;
  border-radius: 8px;
}
.number-button {
  min-width: 92px;
  padding: 0 10px;
}
.answer-choices .number-button {
  width: auto;
  font-size: 2.4rem;
}
.math-help {
  margin: 4px auto 8px;
  width: fit-content;
  max-width: 100%;
  padding: 8px 16px;
  background: var(--warm);
  border-radius: 16px;
  font-weight: 800;
  font-size: 1.15rem;
  text-align: center;
}
div.math-help .blocks {
  padding-top: 8px;
  min-height: 0;
}
.place-number {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 6px 0 4px;
}
.place-digit {
  display: grid;
  justify-items: center;
  min-width: 84px;
  padding: 4px 10px;
  font-size: 4.2rem;
  font-weight: 800;
  line-height: 1.1;
  background: #f0f3e4;
  border: 2px solid #dfe6d3;
  border-radius: 18px;
  color: #45603e;
}
.place-label {
  font-size: 1rem;
  line-height: 1.2;
}
.place-number.marked .tens {
  background: #dcecf7;
  border-color: #6fa3cf;
}
.place-number.marked .ones {
  background: #fde6d6;
  border-color: #f0a35e;
}
.place-sum {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 6px;
  font-size: 1.5rem;
  font-weight: 800;
}
.place-chip {
  padding: 8px 18px;
  border-radius: 18px;
  border: 2px solid;
}
.place-chip strong {
  font-size: 2.2rem;
}
.place-chip.tens {
  background: #dcecf7;
  border-color: #6fa3cf;
}
.place-chip.ones {
  background: #fde6d6;
  border-color: #f0a35e;
}
.place-and {
  color: var(--muted);
  font-size: 1.15rem;
}
.number-target {
  font-size: 4.2rem;
  font-weight: 800;
  line-height: 1.1;
  color: #45603e;
  margin: 0 auto 4px;
}
.number-target.no-picture {
  opacity: 0.6;
}
/* Place-value house: one room for the tens, one for the ones. */
.place-house {
  display: grid;
  /* Nine rods need more room than nine cubes in rows of five. */
  grid-template-columns: 1.4fr 1fr;
  max-width: 560px;
  margin: 8px auto 14px;
  border: 2px solid #dfe6d3;
  border-radius: 22px;
  overflow: hidden;
  background: #fafbf5;
}
.place-column {
  --unit: 15px;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  justify-items: center;
  gap: 8px;
  padding: 0 8px 12px;
}
.place-column + .place-column {
  border-left: 2px solid #dfe6d3;
}
.place-head {
  width: calc(100% + 16px);
  margin: 0;
  padding: 6px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 800;
}
.place-column.tens .place-head {
  background: #dcecf7;
}
.place-column.ones .place-head {
  background: #fde6d6;
}
.place-blocks {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: calc(var(--unit) * 10 + 22px);
  padding-top: 4px;
}
.place-blocks .rods {
  gap: 3px;
}
.place-count {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
}
.place-buttons {
  display: flex;
  gap: 10px;
}
.step-button {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  font-size: 2rem;
  font-weight: 800;
  border: 2px solid #dce3d1;
  box-shadow: 0 4px 0 #dce3d1;
  background: #f8faef;
  color: #45603e;
}
.step-button:hover:not(:disabled) {
  background: #e9f0dd;
}
.step-button:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: none;
}
.step-button:disabled {
  opacity: 0.35;
  box-shadow: none;
}
.build-done {
  display: flex;
  margin: 0 auto 6px;
  min-width: 180px;
}
.build-done.shake {
  animation: shake 0.4s ease;
}
/* Number line */
.number-line {
  display: block;
  width: 100%;
  max-width: 620px;
  margin: 4px auto 6px;
  overflow: visible;
}
.number-line .axis,
.number-line .tick {
  stroke: #6f8a63;
  stroke-width: 2;
  stroke-linecap: round;
}
.number-line .tick.ten {
  stroke-width: 3;
}
.number-line text {
  font-size: 17px;
  font-weight: 800;
  text-anchor: middle;
  fill: var(--ink);
}
.number-line .help-label {
  display: none;
  fill: #7a5a12;
}
.number-line.helping .help-label {
  display: inline;
}
.number-line .base {
  fill: #b5560f;
  text-decoration: underline;
}
.balloon line {
  stroke: #9a6fb0;
  stroke-width: 2;
}
.balloon circle {
  fill: #e7d4f2;
  stroke: #9a6fb0;
  stroke-width: 2;
}
.number-line .balloon-text {
  font-size: 15px;
}
/* Equations, tiles and gaps */
.equation {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 6px;
  font-size: 2.6rem;
  font-weight: 800;
  color: #45603e;
}
.math-gap,
.number-tile.hole {
  display: inline-grid;
  place-items: center;
  min-width: 72px;
  min-height: 64px;
  padding: 0 8px;
  border: 3px dashed #b9cba6;
  border-radius: 16px;
  background: #fafbf5;
  color: #9caf87;
}
.math-gap.found,
.number-tile.found {
  border-style: solid;
  border-color: #8fb575;
  background: #dcedc6;
  color: #45603e;
  animation: star-pop 0.4s ease;
}
.number-row,
.compare-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 8px;
}
.number-slot,
.compare-side {
  display: grid;
  justify-items: center;
  gap: 4px;
}
.number-tile {
  display: inline-grid;
  place-items: center;
  min-width: 64px;
  min-height: 64px;
  padding: 0 8px;
  font-size: 2rem;
  font-weight: 800;
  background: #f0f3e4;
  border: 2px solid #dfe6d3;
  border-radius: 16px;
  color: #4f6d43;
}
.number-tile.wide {
  min-width: 96px;
  font-size: 2.2rem;
}
.compare-gap {
  min-width: 72px;
  font-size: 2.4rem;
}
.tile-caption {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--muted);
}
.step-arrow {
  align-self: center;
  font-weight: 800;
  color: #b5560f;
}
.compare-help {
  display: flex;
  gap: 4px;
  font-size: 0.95rem;
}
.compare-help .place-chip {
  padding: 2px 8px;
  border-radius: 10px;
}
.compare-help .place-chip strong {
  font-size: 1.1rem;
}
/* Hundred chart */
.hundred-piece {
  display: grid;
  grid-template-columns: repeat(var(--cols), 64px);
  gap: 4px;
  justify-content: center;
  margin: 10px 0 6px;
}
.hundred-cell {
  display: grid;
  place-items: center;
  height: 56px;
  font-size: 1.6rem;
  font-weight: 800;
  background: #f0f3e4;
  border: 2px solid #dfe6d3;
  border-radius: 10px;
  color: #4f6d43;
}
.hundred-cell.empty {
  background: transparent;
  border-style: dotted;
}
.hundred-cell.gap {
  border: 3px dashed #b9cba6;
  background: #fafbf5;
  color: #9caf87;
}
.hundred-cell.found {
  border-style: solid;
  border-color: #8fb575;
  background: #dcedc6;
  color: #45603e;
}
.hundred-chart {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
  width: min(100%, 360px);
  margin: 0 auto;
  font-size: 0.8rem;
  font-weight: 700;
}
.hundred-chart span {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  background: #fffef9;
  border-radius: 4px;
}
.hundred-chart .marked {
  background: #dcecf7;
  outline: 2px solid #6fa3cf;
}
div.math-help {
  font-size: 1rem;
}
/* Ordering numbers */
.number-card {
  grid-auto-flow: column;
  justify-content: center;
  gap: 0;
}
.order-cards .number-card {
  width: auto;
  min-width: 78px;
  font-size: 2rem;
}
.order-cards.marked .digit-tens {
  color: #3f6f99;
  text-decoration: underline;
}
.sort-direction {
  margin: -12px 0 10px;
  text-align: center;
  font-weight: 800;
  color: var(--muted);
}
.number-slots {
  flex-wrap: wrap;
}
.number-slots .order-slot {
  font-size: 1.9rem;
}
/* Ten frame: two rows of five */
.ten-frame {
  display: grid;
  grid-template-columns: repeat(5, 32px);
  gap: 4px;
  justify-content: center;
  margin: 4px auto;
}
.ten-frame span {
  height: 32px;
  border: 2px solid #c97a35;
  border-radius: 6px;
  background: #fffef9;
}
.ten-frame .full {
  background: #f0a35e;
}
/* Bar charts: one box per child */
.chart-title {
  text-align: center;
  font-weight: 800;
  font-size: 1.1rem;
  margin-top: 4px;
}
.bar-chart {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 14px;
  margin: 8px 0 4px;
}
.bar-col {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 64px;
}
.bar-value {
  font-weight: 800;
  font-size: 1.2rem;
}
.bar-stack {
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
  padding: 2px;
  border-bottom: 2px solid #6f8a63;
}
.bar-box {
  display: grid;
  place-items: center;
  width: 34px;
  height: 20px;
  border: 1px solid #e3e7d8;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 800;
}
.bar-box.full {
  background: #6fa3cf;
  border-color: #4f84b2;
  color: white;
}
.bar-box.extra {
  background: #f6d27a;
  border-color: #c99b2a;
  color: #5b4307;
}
.bar-icon {
  font-size: 1.8rem;
  line-height: 1;
}
.bar-word {
  font-size: 0.85rem;
  font-weight: 800;
}
/* Sets: ten frames, dice, tally marks, scattered things */
.frames {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px 22px;
  margin: 10px 0 6px;
}
.frame {
  display: grid;
  grid-template-columns: repeat(5, 34px) 28px;
  gap: 4px;
  align-items: center;
}
.frame .cell {
  height: 34px;
  border: 2px solid #c8d3b8;
  border-radius: 6px;
  background: #fffef9;
  display: grid;
  place-items: center;
}
.frame .cell.full::after {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #d9534f;
}
.row-label {
  visibility: hidden;
  font-weight: 800;
  color: #b5560f;
}
.frames.helping .row-label {
  visibility: visible;
}
.frames.lit .cell:not(.full) {
  background: #fdf0c8;
  border-color: #e0a92e;
}
.dice {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin: 12px 0 6px;
}
.die-wrap {
  display: grid;
  justify-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 1.3rem;
}
.die {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  width: 96px;
  height: 96px;
  padding: 12px;
  background: #fff;
  border: 3px solid #6f8a63;
  border-radius: 18px;
}
.die .pip {
  border-radius: 50%;
  background: #34483e;
}
.tally-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 12px 0 6px;
}
.tally-group {
  display: grid;
  justify-items: center;
  gap: 2px;
  font-weight: 800;
  color: #b5560f;
}
.tally {
  width: 44px;
  height: 52px;
  stroke: #34483e;
  stroke-width: 3;
  stroke-linecap: round;
}
.scatter {
  position: relative;
  width: min(100%, 360px);
  aspect-ratio: 3 / 2;
  margin: 10px auto 6px;
  background: #fafbf5;
  border: 2px solid #dfe6d3;
  border-radius: 18px;
}
.scatter-item {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 1.8rem;
  line-height: 1;
}
.item-n {
  position: absolute;
  right: -10px;
  top: -8px;
  font-size: 0.75rem;
  font-weight: 800;
  background: #fdf0c8;
  border-radius: 99px;
  padding: 0 4px;
}
/* Comparing two sets */
.set-compare {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  max-width: 520px;
  margin: 8px auto 6px;
}
.set-box {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 6px;
  padding: 8px;
  background: #fafbf5;
  border: 2px solid #dfe6d3;
  border-radius: 18px;
}
.set-head,
.set-count {
  font-weight: 800;
  color: var(--muted);
}
.set-count {
  font-size: 1.4rem;
  color: var(--ink);
}
.set-items {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px 4px;
  font-size: clamp(1rem, 5vw, 1.4rem);
  line-height: 1.1;
}
.set-box.big .set-items {
  grid-template-columns: repeat(3, 1fr);
  font-size: clamp(1.7rem, 7vw, 2.4rem);
}
.set-item {
  border-radius: 10px;
  text-align: center;
}
.set-item.extra {
  background: #fdf0c8;
  box-shadow: 0 0 0 2px #e0a92e;
}
/* Higher specificity than the big letter keys, also on small screens. */
.answer-choices .letter-button.side-button {
  width: auto;
  min-width: 88px;
  height: 64px;
  padding: 0 14px;
  font-size: 1.15rem;
  white-space: nowrap;
}
/* Set diagram: rings in a frame, the band below is "outside" */
.venn-target {
  font-size: 3.6rem;
  line-height: 1.1;
  text-align: center;
}
.venn-target.placed {
  visibility: hidden;
}
.venn {
  position: relative;
  width: min(100%, 360px);
  aspect-ratio: 6 / 5;
  margin: 6px auto 10px;
  border: 2px dashed #b9cba6;
  border-radius: 18px;
  background: #fffef9;
}
.venn-ring {
  position: absolute;
  top: 9%;
  width: 58%;
  height: 69.6%;
  border-radius: 50%;
  border: 3px solid;
  pointer-events: none;
}
.ring-0 {
  left: 4%;
  border-color: #4f84b2;
  background: #6fa3cf1f;
}
.ring-1 {
  left: 38%;
  border-color: #c97a35;
  background: #f0a35e1f;
}
.venn.one .ring-0 {
  left: 21%;
}
.venn-label {
  position: absolute;
  top: 1%;
  padding: 0 8px;
  border-radius: 99px;
  font-weight: 800;
  font-size: 0.95rem;
  background: #fffef9;
}
.label-0 {
  left: 8%;
  color: #3f6f99;
}
.label-1 {
  right: 8%;
  color: #a35f22;
}
.venn.one .label-0 {
  left: 50%;
  transform: translateX(-50%);
}
.venn-zone {
  position: absolute;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  border-radius: 18px;
  background: transparent;
}
button.venn-zone:hover:not(:disabled) {
  background: #e9f0dd99;
}
.venn-zone.wrong {
  opacity: 0.45;
}
.venn-zone.lit {
  background: #fdf0c8cc;
}
.zone-a,
.zone-b,
.zone-both {
  top: 20%;
  height: 48%;
}
.zone-a {
  left: 7%;
  width: 29%;
}
.zone-both {
  left: 39%;
  width: 22%;
}
.zone-b {
  left: 64%;
  width: 29%;
}
.venn.one .zone-a {
  left: 26%;
  width: 48%;
}
.zone-none {
  left: 2%;
  bottom: 2%;
  width: 96%;
  height: 17%;
  grid-auto-flow: column;
  border: 2px dashed transparent;
}
.zone-items {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  font-size: 1.5rem;
  line-height: 1.1;
}
.venn-thing.found {
  animation: star-pop 0.4s ease;
}
.zone-caption {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--muted);
}
/* Times tables: dot fields with a gap after five */
.dot-field {
  display: grid;
  justify-content: center;
  gap: 6px;
  margin: 10px 0 6px;
}
.dot-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #4f84b2;
}
.dot:nth-child(5) {
  margin-right: 8px;
}
.row-sum {
  margin-left: 8px;
  font-weight: 800;
  color: #b5560f;
}
.equation.known {
  font-size: 1.6rem;
  color: var(--muted);
  margin-bottom: 0;
}
/* Answers with units or signs stay on one line. */
.answer-choices .number-button.expression,
.answer-choices .number-button.money-answer {
  width: auto;
  min-width: 92px;
  padding: 0 12px;
  font-size: 1.7rem;
  white-space: nowrap;
}
.answer-choices .letter-button.word-answer {
  width: auto;
  min-width: 120px;
  height: 64px;
  padding: 0 14px;
  font-size: 1.25rem;
  white-space: nowrap;
}
/* Money: coins and notes */
.purse,
.coin-set,
.money-help {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.purse {
  margin: 10px 0 6px;
}
.coin {
  display: inline-grid;
  place-items: center;
  align-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1;
  background: #e2b04a;
  border: 3px solid #b8862a;
  color: #4a3510;
}
.coin small {
  font-size: 0.7rem;
}
.coin.c1,
.coin.c2,
.coin.c5 {
  background: #d08a5a;
  border-color: #9c5f35;
  width: 46px;
  height: 46px;
}
.coin.euro {
  background: radial-gradient(circle, #e2b04a 52%, #c9cbc4 54%);
  border-color: #8f938a;
  width: 58px;
  height: 58px;
}
.note {
  display: inline-grid;
  place-items: center;
  width: 84px;
  height: 46px;
  border-radius: 6px;
  font-weight: 800;
  border: 2px solid #6f8a63;
  background: #dcedc6;
}
.note.n10 {
  background: #f8dfe4;
  border-color: #b5687a;
}
.note.n20 {
  background: #dcecf7;
  border-color: #4f84b2;
}
.note.n50 {
  background: #fde6d6;
  border-color: #c97a35;
}
.money-step {
  display: grid;
  justify-items: center;
  gap: 2px;
  font-weight: 800;
  color: #b5560f;
}
.shop-item {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 6px 0;
}
.shop-icon {
  font-size: 3rem;
}
.price-tag {
  padding: 4px 12px;
  border-radius: 10px;
  background: var(--warm);
  border: 2px dashed #e0a92e;
  font-weight: 800;
  font-size: 1.4rem;
}
.purse.paid {
  margin-top: 0;
}
.coin-sets {
  display: grid;
  gap: 10px;
  max-width: 460px;
  margin: 10px auto;
}
.coin-set {
  min-height: 64px;
  padding: 8px;
  border-radius: 18px;
  border: 2px solid #dce3d1;
  box-shadow: 0 4px 0 #dce3d1;
  background: #f8faef;
}
.coin-set:hover:not(:disabled) {
  background: #e9f0dd;
}
.coin-set.wrong {
  opacity: 0.35;
}
.coin-set.chosen {
  background: #dcedc6;
  border-color: #8fb575;
}
.set-total {
  font-weight: 800;
  font-size: 1.2rem;
}
/* Clock */
.clock {
  display: block;
  width: min(100%, 250px);
  margin: 4px auto;
}
.clock-face {
  fill: #fffef9;
  stroke: #6f8a63;
  stroke-width: 5;
}
.hour-mark,
.minute-mark {
  stroke: #6f8a63;
  stroke-width: 3;
}
.minute-mark {
  stroke-width: 1.5;
}
.clock text {
  text-anchor: middle;
  dominant-baseline: central;
  font-weight: 800;
}
.clock-number {
  font-size: 19px;
  fill: var(--ink);
}
.clock-minute {
  display: none;
  font-size: 12px;
  fill: #b5560f;
}
.clock.helping .clock-minute {
  display: inline;
}
.hand {
  stroke-linecap: round;
}
.hour-hand {
  stroke: #3f6f99;
  stroke-width: 9;
}
.minute-hand {
  stroke: #c97a35;
  stroke-width: 5;
}
.clock-pin {
  fill: var(--ink);
}
.clock-legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-weight: 800;
  font-size: 0.95rem;
}
.hour-key {
  color: #3f6f99;
}
.minute-key {
  color: #a35f22;
}
/* Syllables with arcs underneath */
.syllable-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
  font-size: 2.2rem;
  font-weight: 800;
  color: #45603e;
}
.syllable.arc {
  padding: 0 6px 8px;
  border-bottom: 4px solid #e0a92e;
  border-radius: 0 0 50% 50%;
}
.syllable.gap {
  min-width: 64px;
  text-align: center;
  color: #9caf87;
  border-bottom-style: dashed;
}
.syllable.found {
  color: #45603e;
  background: #dcedc6;
  border-radius: 10px 10px 50% 50%;
}
.answer-choices .letter-button.syllable-button {
  width: auto;
  min-width: 92px;
  padding: 0 12px;
  font-size: 2rem;
}
.level-group {
  margin: 10px 0 2px;
  font-size: 0.95rem;
}

.momo-feedback {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 80px;
  margin-top: 16px;
}
.mini-momo {
  width: 58px;
  height: 74px;
  flex-shrink: 0;
}
.mini-momo .momo-body {
  width: 100%;
  height: 100%;
}
.feedback {
  font-size: 1.2rem;
  font-weight: 700;
  padding: 12px 18px;
  border-radius: 18px;
  text-align: left;
  max-width: 520px;
}
.feedback:empty {
  display: none;
}
.feedback.correct {
  background: #e3f0d5;
  color: #3f6235;
}
.feedback.try-again {
  background: var(--warm);
  color: #7d6230;
}
.feedback-pop {
  animation: appear 0.25s ease;
}

/* ---------- Result ---------- */
.result-card {
  max-width: 640px;
  margin: 10px auto 30px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 32px;
  padding: 26px 30px 32px;
  box-shadow: var(--shadow);
}
.result-momo {
  width: 130px;
  height: 160px;
  margin: 0 auto;
}
.result-momo .momo-body {
  width: 100%;
  height: 100%;
  animation: momo-cheer 0.7s ease-in-out 3;
}
.result-card h1 {
  font-size: 2.3rem;
  margin: 6px 0;
}
.result-stars {
  font-size: 3.2rem;
  letter-spacing: 8px;
  line-height: 1.2;
}
.result-stars .earned {
  color: var(--gold);
}
.result-stars .empty {
  color: #dcdfd2;
}
.result-card > p {
  font-size: 1.2rem;
  margin: 10px 0 16px;
}
.new-reward {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #fff6d8;
  border: 1px solid #f0dfa6;
  border-radius: 18px;
  padding: 10px 18px;
  margin: 4px;
  font-size: 1.05rem;
}
.new-reward > span {
  font-size: 2rem;
}
.result-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

/* ---------- Pause & storage ---------- */
.pause-banner {
  position: sticky;
  bottom: 15px;
  z-index: 10;
  max-width: 760px;
  margin: 10px auto;
  background: #fff6d9;
  border: 1px solid #e6d5a6;
  box-shadow: 0 6px 35px #77663d19;
  padding: 14px 18px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #6f5e33;
  font-size: 1rem;
  font-weight: 700;
}
.pause-banner > span {
  font-size: 1.8rem;
}
.pause-banner .button {
  margin-left: auto;
  white-space: nowrap;
}
.storage-warning {
  background: #fff0d2;
  padding: 14px;
  text-align: center;
  color: #7c652f;
  font-size: 0.9rem;
}

/* ---------- Settings dialog ---------- */
dialog {
  border: 1px solid #e2e5d7;
  background: var(--card);
  color: var(--ink);
  border-radius: 25px;
  width: min(640px, calc(100% - 28px));
  max-height: 88dvh;
  padding: 26px;
  box-shadow: 0 20px 100px #25342125;
}
dialog::backdrop {
  background: #25342150;
  backdrop-filter: blur(4px);
}
body:has(dialog[open]) {
  overflow: hidden;
}
.dialog-header {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
}
.dialog-intro {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 12px 0;
}
.settings-section {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 18px;
}
.settings-section h3 {
  margin-bottom: 10px;
}
.settings-section p,
.parent-tips {
  font-size: 0.85rem;
  line-height: 1.7;
  color: #6f7a65;
}
.settings-section select {
  max-width: 100%;
  border: 1px solid #d5dfc9;
  background: #f4f6eb;
  border-radius: 10px;
  padding: 8px 10px;
  margin: 6px 0;
  min-height: 44px;
}
#voice-select {
  display: block;
  width: 100%;
}
.field-note {
  font-size: 0.8rem;
  margin: 4px 0 10px;
}
.level-settings {
  display: grid;
  gap: 4px;
}
.level-row {
  display: grid;
  grid-template-columns: 190px 1fr;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 700;
}
.level-row select {
  width: 100%;
  font-weight: 400;
}
.laute-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 6px;
}
.laut-button {
  min-height: 44px;
  border-radius: 10px;
  background: #f4f6eb;
  border: 1px solid #d5dfc9;
  font-weight: 800;
  font-size: 1.1rem;
}
.laut-button:hover {
  background: #e7eddc;
}
.laut-button.ambiguous {
  color: var(--muted);
  border-style: dashed;
}
.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.switch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  font-weight: 800;
}
/* A real switch look for the on/off checkbox. */
.switch-row input {
  appearance: none;
  flex: none;
  width: 52px;
  height: 30px;
  margin: 0;
  border-radius: 99px;
  background: #c9cfbf;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}
.switch-row input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px #0003;
  transition: transform 0.2s;
}
.switch-row input:checked {
  background: var(--green);
}
.switch-row input:checked::after {
  transform: translateX(22px);
}
.speech-options {
  border: 0;
  margin: 10px 0 0;
  padding: 0;
  min-width: 0;
}
.speech-options:disabled {
  opacity: 0.45;
}
/* Speech switched off: no listen buttons that would do nothing. */
.speech-off #listen-button,
.speech-off .big-listen {
  display: none;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}
.check-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--green);
  flex-shrink: 0;
}
.parent-tips {
  padding-left: 20px;
}
.parent-tips li + li {
  margin-top: 8px;
}
.danger {
  color: #a66c5c;
  margin-top: 12px;
}
.danger-button {
  background: #a66c5c;
  color: white;
}
.reset-confirm {
  background: #f8eae1;
  padding: 15px;
  border-radius: 15px;
  margin-top: 10px;
}
.reset-confirm p {
  margin-bottom: 12px;
}
.reset-confirm .button {
  margin: 4px;
}

/* ---------- Momo moods (shared by home, game and garden) ---------- */
.momo-body .mouth {
  display: none;
}
.mood-ok .m-ok,
.mood-happy .m-happy,
.mood-sad .m-sad,
.mood-hungry .m-hungry {
  display: inline;
}
.mood-sad .momo-ears {
  transform: translateY(8px) scaleY(0.85);
  transform-origin: 50% 60%;
}
.momo-eyes {
  transform-origin: 50% 50%;
  animation: momo-blink 7s infinite;
}

@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes bob {
  to {
    transform: scale(1.15);
  }
}
@keyframes idle {
  to {
    transform: translateY(-6px) rotate(1.5deg);
  }
}
@keyframes momo-cheer {
  50% {
    transform: translateY(-14px);
  }
}
@keyframes momo-blink {
  0%,
  46%,
  50%,
  100% {
    transform: scaleY(1);
  }
  48% {
    transform: scaleY(0.1);
  }
}
@keyframes star-pop {
  0% {
    transform: scale(0.4);
  }
  60% {
    transform: scale(1.35);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes shake {
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}
@keyframes hint-glow {
  to {
    background: #fff1c2;
    transform: translateY(-3px);
  }
}

/* ---------- Parents' report ---------- */
#report-view {
  --data: #3d8b4f;
  --data-track: #dcebd9;
  --grid: #e6e9dd;
  max-width: 980px;
  margin: 0 auto;
}
.report-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4px 0 8px;
}
#report-view h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}
.report-intro {
  color: var(--muted);
  max-width: 720px;
  margin-bottom: 16px;
}
.report-notice {
  background: var(--warm);
  color: #6f5a2a;
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 16px;
}
.muted {
  color: var(--muted);
}
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.stat-tile,
.report-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px 18px;
}
.stat-tile {
  display: grid;
  gap: 2px;
}
.stat-label {
  font-size: 0.85rem;
  color: var(--muted);
}
.stat-value {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.2;
}
.stat-delta {
  font-size: 0.8rem;
  color: var(--muted);
}
.report-card {
  margin-bottom: 16px;
}
.report-card h2 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}
.report-card h3 {
  font-size: 0.95rem;
  margin: 14px 0 6px;
}
.report-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.report-columns > .report-card {
  margin-bottom: 16px;
}
.report-list {
  margin: 0;
  padding-left: 20px;
  line-height: 1.6;
}
.report-list li + li {
  margin-top: 4px;
}
/* Activity: one series, columns <= 24px, 4px rounded tops, hairline baseline. */
.chart-columns {
  position: relative;
  display: flex;
  gap: 2px;
  margin-top: 10px;
}
.chart-column {
  flex: 1;
  display: grid;
  justify-items: center;
  gap: 4px;
  border-radius: 6px;
  outline-offset: 2px;
}
.chart-plot {
  position: relative;
  width: 100%;
  height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  border-bottom: 1px solid var(--grid);
}
.chart-bar {
  display: block;
  width: min(24px, 70%);
  min-height: 0;
  background: var(--data);
  border-radius: 4px 4px 0 0;
}
.chart-column.active .chart-bar {
  filter: brightness(1.15);
}
.chart-value {
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 2px;
}
.chart-day {
  font-size: 0.75rem;
  color: var(--muted);
}
.chart-tooltip {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: grid;
  gap: 1px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.8rem;
  box-shadow: 0 6px 18px #2e3d2a1f;
  pointer-events: none;
  white-space: nowrap;
  z-index: 2;
}
.chart-tooltip strong {
  font-size: 0.95rem;
}
.chart-table,
.chart-table summary {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
}
.chart-table table,
.game-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
}
.chart-table th,
.chart-table td,
.game-table th,
.game-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--grid);
  vertical-align: middle;
}
.game-table thead th {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 700;
}
.game-table tbody th {
  font-weight: 700;
  white-space: nowrap;
}
.num,
.chart-table td {
  font-variant-numeric: tabular-nums;
}
.table-scroll {
  overflow-x: auto;
}
.trend {
  white-space: nowrap;
}
.level-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.level-label {
  display: block;
  font-size: 0.75rem;
}
/* Meter: fill and track are steps of the same green. */
.meter {
  display: inline-block;
  width: 80px;
  height: 8px;
  border-radius: 99px;
  background: var(--data-track);
  overflow: hidden;
  flex-shrink: 0;
}
.meter-fill {
  display: block;
  height: 100%;
  background: var(--data);
  border-radius: 99px;
}
.sparkline {
  display: block;
  overflow: visible;
}
.sparkline-base {
  stroke: var(--grid);
  stroke-width: 1;
}
.sparkline-line {
  fill: none;
  stroke: var(--data);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.sparkline-dot {
  fill: var(--data);
  stroke: var(--card);
  stroke-width: 2;
}
.area-rows {
  display: grid;
  gap: 10px;
}
.area-row {
  display: grid;
  grid-template-columns: 200px 1fr 1fr;
  gap: 14px;
  align-items: center;
}
.area-metric {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}
.area-metric .meter {
  width: 100%;
}
.letter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.letter-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  background: #f2f4ea;
  border-radius: 10px;
  padding: 4px 10px;
  font-size: 0.8rem;
  color: var(--muted);
}
.letter-chip strong {
  font-size: 1.1rem;
  color: var(--ink);
}
@media (max-width: 760px) {
  .stat-row {
    grid-template-columns: 1fr 1fr;
  }
  .report-columns {
    grid-template-columns: 1fr;
  }
  .area-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .stat-value {
    font-size: 1.5rem;
  }
  /* Games table becomes one card per game. */
  .game-table thead {
    display: none;
  }
  .game-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--grid);
  }
  .game-table tbody th {
    grid-column: 1 / -1;
    white-space: normal;
  }
  .game-table th,
  .game-table td {
    border: 0;
    padding: 2px 0;
  }
  .game-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
  }
}
@media print {
  .site-header,
  footer,
  .report-top,
  .chart-table,
  .pause-banner,
  .storage-warning {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .report-card,
  .stat-tile {
    break-inside: avoid;
  }
}

@media (max-width: 900px) {
  .activity-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .home-hero {
    grid-template-columns: 170px 1fr;
    gap: 20px;
    padding: 24px;
  }
  .home-momo {
    width: 160px;
    height: 200px;
  }
}
@media (max-width: 640px) {
  .site-header {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 0;
  }
  .brand {
    font-size: 1.2rem;
  }
  .brand-icon {
    width: 40px;
    height: 40px;
  }
  .main-nav {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  .star-counter {
    margin-left: auto;
  }
  .home-hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 18px;
  }
  .home-momo {
    width: 120px;
    height: 150px;
  }
  .momo-says {
    font-size: 1.15rem;
  }
  .momo-says:before {
    display: none;
  }
  .needs {
    margin: 0 auto;
  }
  .home-actions {
    justify-content: center;
  }
  .button.big {
    width: 100%;
  }
  .activity-grid {
    gap: 10px;
  }
  .activity-card {
    padding: 18px 8px 12px;
  }
  .activity-icon {
    width: 58px;
    height: 58px;
    font-size: 2rem;
  }
  .activity-title {
    font-size: 1rem;
  }
  .together-badge {
    position: static;
  }
  .game-card {
    padding: 18px 14px;
    border-radius: 24px;
  }
  .game-head h1 {
    font-size: 1.3rem;
  }
  .game-instruction {
    font-size: 1.15rem;
  }
  .answer-choices {
    gap: 10px;
  }
  .answer-choices .letter-button {
    width: 72px;
    height: 72px;
    font-size: 2.2rem;
  }
  .letter-keyboard {
    gap: 7px;
  }
  .picture-choices {
    gap: 10px;
  }
  .picture-button {
    width: 74px;
    min-height: 80px;
    border-radius: 18px;
  }
  .choice-icon {
    font-size: 2.5rem;
  }
  .picture-choices.written .picture-button {
    min-width: 0;
    padding: 8px 14px;
  }
  .choice-word {
    font-size: 1.4rem;
  }
  .sound-dot {
    width: 22px;
    height: 22px;
  }
  .letter-keyboard .letter-button {
    width: 58px;
    height: 58px;
    font-size: 1.7rem;
  }
  .letter-keyboard.full .letter-button {
    width: 44px;
    height: 50px;
    font-size: 1.35rem;
    border-radius: 11px;
  }
  .letter-tile {
    min-width: 44px;
    height: 56px;
    font-size: 1.7rem;
  }
  .letter-tile.large {
    min-width: 76px;
    height: 84px;
    font-size: 2.6rem;
  }
  .letter-row {
    gap: 4px;
    flex-wrap: nowrap;
  }
  /* An ABC row must stay on one line to be read as a sequence. */
  .letter-row .letter-tile {
    min-width: 0;
    flex: 1 1 0;
    max-width: 52px;
  }
  .order-slots,
  .order-cards {
    gap: 7px;
  }
  .order-slot {
    width: 54px;
    height: 64px;
    font-size: 1.8rem;
  }
  .order-cards .letter-button {
    width: 60px;
    height: 64px;
    font-size: 1.8rem;
  }
  .feedback {
    font-size: 1.05rem;
  }
  .level-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .pause-banner {
    flex-wrap: wrap;
  }
  .subject-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .subject-card {
    padding: 16px 18px;
  }
  .subject-icon {
    width: 68px;
    height: 68px;
    font-size: 2.4rem;
  }
  .subject-title {
    font-size: 1.5rem;
  }
  .menu-title {
    font-size: 1.6rem;
  }
  .blocks {
    --unit: 12px;
  }
  .place-column {
    --unit: 10px;
    padding: 0 4px 10px;
  }
  .place-head {
    width: calc(100% + 8px);
    font-size: 1rem;
  }
  .blocks {
    gap: 14px 18px;
  }
  .rods {
    gap: 4px;
  }
  .cubes,
  .cube-ten {
    gap: 3px;
  }
  .answer-choices .number-button {
    min-width: 72px;
    font-size: 1.9rem;
  }
  .place-digit,
  .number-target {
    font-size: 3.2rem;
  }
  .place-digit {
    min-width: 66px;
  }
  .place-sum {
    font-size: 1.2rem;
  }
  .place-chip strong {
    font-size: 1.8rem;
  }
  .step-button {
    width: 48px;
    height: 48px;
  }
  .equation {
    font-size: 2rem;
    gap: 6px;
  }
  .math-gap,
  .number-tile.hole {
    min-width: 56px;
    min-height: 52px;
  }
  .number-tile {
    min-width: 52px;
    min-height: 52px;
    font-size: 1.6rem;
  }
  .number-tile.wide {
    min-width: 80px;
    font-size: 1.7rem;
  }
  .number-row {
    gap: 4px;
  }
  .hundred-piece {
    grid-template-columns: repeat(var(--cols), 56px);
  }
  .hundred-cell {
    height: 48px;
    font-size: 1.3rem;
  }
  .order-cards .number-card {
    min-width: 64px;
    font-size: 1.6rem;
  }
  .bar-chart {
    gap: 6px;
  }
  .bar-col {
    min-width: 56px;
  }
  .bar-box {
    width: 28px;
    height: 17px;
  }
  .bar-word {
    font-size: 0.75rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
