:root {
  --ink: #24313d;
  --muted: #667785;
  --line: #d9e4e8;
  --paper: #fffdf8;
  --sun: #ffd86b;
  --mint: #7ddfc3;
  --coral: #ff8b78;
  --sky: #78b9ff;
  --plum: #8d7ae6;
  --leaf: #a9d96c;
  --shadow: 0 18px 44px rgba(49, 64, 76, .14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 12%, rgba(255, 216, 107, .45), transparent 22rem),
    radial-gradient(circle at 92% 8%, rgba(120, 185, 255, .32), transparent 20rem),
    linear-gradient(145deg, #f7fbff 0%, #fff8ec 58%, #effaf6 100%);
  font-family: Arial, Helvetica, sans-serif;
}

button, input, select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.screen {
  min-height: 100vh;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1180px;
  margin: 0 auto 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--sun);
  box-shadow: var(--shadow);
  font-size: 25px;
}

.nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.icon-btn,
.nav-btn,
.primary,
.secondary,
.chip {
  min-height: 44px;
  border-radius: 14px;
  padding: 10px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 8px 22px rgba(49, 64, 76, .08);
}

.nav-btn.active,
.primary {
  background: var(--ink);
  color: white;
}

.secondary {
  background: white;
  border: 1px solid var(--line);
}

.chip {
  min-height: 36px;
  border: 1px solid var(--line);
  box-shadow: none;
}

.chip.active {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.hero {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(290px, 430px);
  gap: 20px;
  align-items: stretch;
}

.hero-main,
.panel,
.lesson-stage,
.parent-panel,
.paywall {
  background: rgba(255, 255, 255, .86);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero-main {
  padding: clamp(22px, 4vw, 42px);
  position: relative;
  overflow: hidden;
}

.hero-main h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(38px, 7vw, 78px);
  line-height: .98;
  letter-spacing: 0;
}

.hero-main p {
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.45;
}

.mascot {
  display: grid;
  place-items: center;
  width: min(38vw, 220px);
  aspect-ratio: 1;
  margin-top: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #a9d96c 58%, #73bf74);
  font-size: clamp(80px, 18vw, 150px);
  box-shadow: inset 0 -16px 30px rgba(36, 49, 61, .08), var(--shadow);
}

.hero-side {
  display: grid;
  gap: 14px;
}

.panel {
  padding: 18px;
}

.panel h2,
.panel h3 {
  margin: 0 0 10px;
  font-size: 22px;
}

.age-grid,
.module-grid,
.lesson-grid,
.stats-grid,
.plans-grid {
  display: grid;
  gap: 12px;
}

.age-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.module-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.lesson-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.card {
  min-height: 112px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: white;
  text-align: left;
  transition: transform .18s ease, box-shadow .18s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(49, 64, 76, .12);
}

.card.locked {
  opacity: .66;
}

.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-weight: 800;
  font-size: 18px;
}

.card small,
.muted {
  color: var(--muted);
}

.progress-line {
  width: 100%;
  height: 10px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf3f5;
}

.progress-line span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--sky));
}

.workspace {
  max-width: 1180px;
  margin: 0 auto;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.toolbar h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 48px);
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.lesson-stage {
  min-height: calc(100vh - 36px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px;
}

.lesson-head,
.lesson-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.timer {
  min-width: 94px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #f1f7fa;
  text-align: center;
  font-weight: 800;
}

.lesson-body {
  display: grid;
  place-items: center;
  padding: 18px 0;
  text-align: center;
}

.prompt {
  max-width: 760px;
}

.prompt h2 {
  margin: 8px 0 10px;
  font-size: clamp(30px, 7vw, 64px);
  line-height: 1;
}

.big-visual {
  display: grid;
  place-items: center;
  width: min(58vw, 340px);
  aspect-ratio: 1;
  margin: 0 auto 16px;
  border-radius: 34px;
  background: linear-gradient(145deg, #fff, #e9f7ff);
  box-shadow: inset 0 -12px 34px rgba(36, 49, 61, .08), var(--shadow);
  font-size: clamp(86px, 22vw, 190px);
}

.answers {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 12px;
  width: min(760px, 100%);
  margin: 20px auto 0;
}

.answer {
  min-height: 86px;
  border-radius: 20px;
  background: white;
  border: 2px solid var(--line);
  font-weight: 800;
  font-size: clamp(18px, 4vw, 28px);
}

.answer.correct {
  border-color: #44b786;
  background: #eafff5;
}

.answer.wrong {
  border-color: var(--coral);
  background: #fff0ed;
}

.reward {
  font-size: clamp(54px, 15vw, 120px);
}

.parent-panel {
  padding: 18px;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.stat {
  min-height: 108px;
  padding: 16px;
  border-radius: 18px;
  background: #f7fbfd;
  border: 1px solid var(--line);
}

.stat strong {
  display: block;
  font-size: 30px;
}

.plans-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.plan {
  padding: 16px;
  border-radius: 18px;
  background: white;
  border: 1px solid var(--line);
}

.plan strong {
  display: block;
  font-size: 26px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(36, 49, 61, .35);
}

.paywall {
  width: min(760px, 100%);
  padding: 22px;
}

.settings-row {
  display: grid;
  grid-template-columns: 1fr minmax(160px, 240px);
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.settings-row:last-child {
  border-bottom: 0;
}

.gate-form {
  display: grid;
  gap: 12px;
}

.gate-form input {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: #f7fbfd;
}

select,
input[type="range"] {
  width: 100%;
}

/* ===================== PUBLIC SITE + DEMO GATE ===================== */
.public-site {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255,255,255,.86), rgba(255,255,255,.55)),
    linear-gradient(145deg, #f5fbff 0%, #fff7df 48%, #effaf4 100%);
}

.public-nav {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 18px;
  backdrop-filter: blur(16px);
}

.public-brand {
  min-width: max-content;
}

.brand-slogan {
  display: block;
  margin-left: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.public-links,
.public-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.lang-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.72);
}

.lang-btn {
  display: inline-grid;
  place-items: center;
  min-height: 32px;
  padding: 5px 9px;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.lang-btn.active {
  background: #1D9E75;
  color: white;
}

.public-link {
  min-height: 42px;
  padding: 8px 10px;
  color: var(--ink);
  background: transparent;
  font-weight: 800;
}

.public-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, .72fr);
  align-items: center;
  gap: clamp(24px, 5vw, 64px);
  max-width: 1180px;
  min-height: min(720px, calc(100vh - 72px));
  margin: 0 auto;
  padding: clamp(34px, 6vw, 76px) 18px 44px;
}

.public-hero-copy h1 {
  margin: 0;
  font-size: clamp(56px, 9vw, 112px);
  line-height: .92;
  letter-spacing: 0;
}

.public-hero-copy p:not(.public-kicker) {
  max-width: 680px;
  margin: 18px 0 0;
  color: #475968;
  font-size: clamp(18px, 2.2vw, 25px);
  line-height: 1.45;
}

.public-hero-copy .hero-slogan {
  color: #1D9E75;
  font-weight: 900;
}

.public-kicker {
  margin: 0 0 10px;
  color: #28705d;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.public-actions {
  justify-content: flex-start;
  margin-top: 26px;
}

.public-cta {
  min-height: 52px;
  padding-inline: 20px;
}

.demo-preview {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,.95);
  border-radius: 30px;
  background: rgba(255,255,255,.88);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.public-mascot-image {
  width: min(52vw, 240px);
  aspect-ratio: 1;
  object-fit: contain;
  justify-self: center;
  filter: drop-shadow(0 16px 22px rgba(49,64,76,.14));
}

.demo-phone-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #f5fafb;
  border: 1px solid var(--line);
}

.demo-lesson-card {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-height: 190px;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(145deg, #fff9e3, #e9fff6);
  text-align: center;
}

.demo-lesson-visual {
  display: grid;
  place-items: center;
  width: 96px;
  aspect-ratio: 1;
  border-radius: 24px;
  background: white;
  font-size: 58px;
  box-shadow: 0 12px 24px rgba(49,64,76,.1);
}

.demo-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.demo-mini-grid span {
  display: grid;
  place-items: center;
  min-height: 64px;
  border-radius: 18px;
  background: #f7fbfd;
  border: 1px solid var(--line);
  font-size: 28px;
}

.public-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 18px 48px;
}

.public-stat {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(255,255,255,.94);
  box-shadow: 0 10px 28px rgba(49,64,76,.08);
}

.public-stat strong,
.public-stat span {
  display: block;
}

.public-stat strong {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
}

.public-stat span {
  margin-top: 6px;
  font-weight: 900;
}

.public-stat small,
.public-feature p,
.public-program-item p,
.public-parent-strip p {
  color: var(--muted);
  line-height: 1.45;
}

.public-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 54px 18px;
}

.public-band {
  max-width: none;
  padding-inline: max(18px, calc((100vw - 1180px) / 2));
  background: rgba(255,255,255,.58);
  border-top: 1px solid rgba(255,255,255,.8);
  border-bottom: 1px solid rgba(255,255,255,.8);
}

.section-heading {
  max-width: 700px;
  margin-bottom: 22px;
}

.section-heading h2,
.public-parent-strip h2 {
  margin: 0;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1;
}

.public-program-grid,
.public-feature-grid {
  display: grid;
  gap: 14px;
}

.public-program-grid {
  grid-template-columns: repeat(4, 1fr);
}

.public-feature-grid {
  grid-template-columns: repeat(3, 1fr);
}

.reach-section {
  max-width: none;
  padding: 66px max(18px, calc((100vw - 1180px) / 2));
  background: #ffffff;
}

.public-program-item,
.public-feature {
  min-height: 210px;
  padding: 20px;
  border-radius: 18px;
  background: white;
  border: 1px solid var(--line);
}

.program-emoji,
.feature-icon {
  display: block;
  font-size: 42px;
  line-height: 1;
}

.public-program-item h3,
.public-feature h3 {
  margin: 14px 0 8px;
}

.public-program-item small {
  font-weight: 900;
  color: #28705d;
}

.reach-section .section-heading {
  margin: 0 auto 46px;
  text-align: center;
}

.reach-section .public-kicker {
  color: #009b72;
  letter-spacing: .16em;
}

.market-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  max-width: 680px;
  margin: 0 auto;
}

.market-card {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 126px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  text-align: center;
}

.market-code {
  font-size: 21px;
  line-height: 1;
  letter-spacing: .02em;
}

.market-country {
  margin-top: 18px;
  font-size: 14px;
  font-weight: 900;
}

.market-population {
  margin-top: 7px;
  color: var(--muted);
}

.language-strip {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 680px;
  margin: 24px auto 0;
  color: var(--muted);
}

.language-strip strong {
  display: grid;
  place-items: center;
  min-width: 46px;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f7fbfd;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
}

.public-parent-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
}

.public-parent-strip > div {
  max-width: 760px;
}

.public-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 18px 36px;
  color: var(--muted);
}

.footer-mail {
  color: #1D9E75;
  font-weight: 900;
  text-decoration: none;
}

.demo-gate {
  position: relative;
  width: min(460px, 100%);
  padding: 24px;
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.demo-gate h2 {
  margin: 0 36px 8px 0;
  font-size: 30px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 38px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #f2f6f7;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.demo-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 16px;
}

.demo-password {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: white;
}

.demo-error {
  margin: 10px 0 0;
  color: #bd3428;
  font-weight: 800;
}

.demo-exit {
  white-space: nowrap;
}

@media (max-width: 760px) {
  .screen {
    padding: 12px;
  }

  .topbar {
    align-items: flex-start;
  }

  .nav {
    width: 100%;
    justify-content: flex-start;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .age-grid,
  .answers {
    grid-template-columns: 1fr;
  }

  .lesson-stage {
    min-height: calc(100vh - 24px);
  }

  .settings-row {
    grid-template-columns: 1fr;
  }

  .public-nav,
  .public-parent-strip,
  .public-footer {
    align-items: flex-start;
  }

  .public-nav,
  .public-parent-strip {
    grid-template-columns: 1fr;
  }

  .public-nav,
  .public-parent-strip,
  .public-footer {
    flex-direction: column;
  }

  .public-hero,
  .public-stats,
  .public-program-grid,
  .public-feature-grid,
  .market-grid {
    grid-template-columns: 1fr;
  }

  .public-hero {
    min-height: auto;
    padding-top: 28px;
  }

  .public-links,
  .public-actions {
    justify-content: flex-start;
  }

  .demo-form {
    grid-template-columns: 1fr;
  }
}

.shape-visual {
  font-size: clamp(110px, 24vw, 190px);
  line-height: 1;
  font-weight: 900;
  text-shadow: 0 10px 0 rgba(36, 49, 61, .10), 0 18px 28px rgba(36, 49, 61, .12);
}
.picture-answer {
  display: grid;
  place-items: center;
  min-height: 180px;
  aspect-ratio: 1.35;
  padding: 8px;
  overflow: hidden;
}

.answer-visual {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: clamp(58px, 11vw, 104px);
  line-height: 1;
}

.answer-shape {
  font-size: clamp(72px, 13vw, 118px);
  text-shadow: 0 7px 0 rgba(36, 49, 61, .08);
}
.lesson-image {
  display: block;
  width: min(58vw, 340px);
  height: min(58vw, 340px);
  object-fit: contain;
  margin: 0 auto 16px;
  border-radius: 34px;
  background: linear-gradient(145deg, #fff, #e9f7ff);
  box-shadow: inset 0 -12px 34px rgba(36, 49, 61, .08), var(--shadow);
}

.answer-image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  border-radius: 16px;
}
.count-visual {
  display: grid;
  grid-template-columns: repeat(3, minmax(44px, 1fr));
  align-items: center;
  justify-items: center;
  gap: 10px;
  padding: 20px;
}

.count-answer {
  grid-template-columns: repeat(3, minmax(34px, 1fr));
  gap: 6px;
  padding: 8px;
}

.count-item {
  display: grid;
  place-items: center;
  font-size: clamp(42px, 8vw, 74px);
  line-height: 1;
  filter: drop-shadow(0 7px 0 rgba(36, 49, 61, .08));
}

.count-answer .count-item {
  font-size: clamp(30px, 6vw, 52px);
}
.emotion-visual {
  display: grid;
  place-items: center;
  border-radius: 34px;
  color: #24313d;
}

.emotion-answer {
  display: grid;
  place-items: center;
  min-height: 100%;
  border-radius: 16px;
}

.emotion-face {
  font-size: clamp(78px, 15vw, 148px);
  line-height: 1;
  filter: drop-shadow(0 8px 0 rgba(36, 49, 61, .08));
}

.emotion-answer .emotion-face {
  font-size: clamp(58px, 10vw, 96px);
}
.concept-visual {
  display: grid;
  place-items: center;
  border-radius: 34px;
}

.concept-answer {
  display: grid;
  place-items: center;
  min-height: 100%;
  border-radius: 16px;
}

.concept-icon {
  font-size: clamp(82px, 16vw, 150px);
  line-height: 1;
  filter: drop-shadow(0 8px 0 rgba(36, 49, 61, .08));
}

.concept-answer .concept-icon {
  font-size: clamp(58px, 10vw, 98px);
}
.lesson-feedback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 14px;
  padding: 10px 18px;
  border-radius: 14px;
  font-size: 22px;
  font-weight: 900;
}

.lesson-feedback.ok {
  color: #116530;
  background: #e8f8ee;
}

.lesson-feedback.retry {
  color: #8a4a00;
  background: #fff2d7;
}
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.achievement {
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
}

.achievement.unlocked {
  border-color: rgba(125, 223, 195, .72);
  background: linear-gradient(180deg, #ffffff, #effcf7);
}

.achievement.locked {
  opacity: .62;
  background: #f7fbfd;
}

.achievement-icon {
  font-size: 30px;
  line-height: 1;
}

.achievement strong {
  font-size: 15px;
}

.achievement small {
  font-size: 13px;
}
.daily-plan .progress-line {
  margin-bottom: 14px;
}

.daily-next {
  display: grid;
  gap: 3px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f7fbfd;
}

.daily-next strong {
  font-size: 18px;
}
.week-activity {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.week-day {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.week-dot {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #edf3f5;
  color: var(--ink);
  font-weight: 900;
}

.week-day.active .week-dot {
  background: linear-gradient(180deg, var(--sun), #ffb95f);
  box-shadow: 0 8px 18px rgba(255, 184, 95, .28);
}
.reward-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.child-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.child-avatar {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: #fff3ca;
  font-size: 34px;
}

.child-info {
  display: grid;
  gap: 4px;
}
.picture-answer > * {
  pointer-events: none;
}

.recognize-choice {
  grid-template-columns: repeat(2, minmax(190px, 260px));
  justify-content: center;
  max-width: 620px;
}

.recognize-choice .picture-answer {
  aspect-ratio: 1;
  min-height: 220px;
}

.answer-image, .lesson-image {
  user-select: none;
  -webkit-user-drag: none;
}

.legal-page {
  min-height: 100vh;
  margin: 0;
  padding: 24px;
  background:
    radial-gradient(circle at 16% 10%, rgba(255, 216, 107, .28), transparent 28%),
    radial-gradient(circle at 90% 4%, rgba(125, 223, 195, .22), transparent 25%),
    #fffdf8;
  color: var(--ink);
}

.legal-document {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, .88);
  box-shadow: var(--shadow);
}

.legal-document h1 {
  margin: 18px 0 20px;
  font-size: clamp(34px, 7vw, 58px);
  line-height: 1.02;
}

.legal-document h2 {
  margin: 28px 0 8px;
  font-size: clamp(21px, 4vw, 28px);
}

.legal-document p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.legal-back {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.legal-updated {
  margin-top: 30px;
  font-size: 15px;
}

@media (max-width: 560px) {
  .legal-page {
    padding: 12px;
  }

  .legal-document {
    border-radius: 16px;
  }

  .legal-document p {
    font-size: 16px;
  }
}

/* === Tap-to-learn mode (age 1.5-2) === */

.tap-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  margin: 0 auto;
  border: none;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.tap-card:active {
  transform: scale(0.91);
}

@keyframes tapBounce {
  0%   { transform: scale(1); }
  28%  { transform: scale(1.22); }
  62%  { transform: scale(0.91); }
  82%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.tap-bounce {
  animation: tapBounce 0.52s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.tap-progress {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 24px;
}

.tap-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #dde6ea;
  transition: background 0.25s, transform 0.25s, box-shadow 0.25s;
}

.tap-dot.filled {
  background: var(--sun);
  transform: scale(1.25);
  box-shadow: 0 4px 12px rgba(255, 184, 60, 0.45);
}

@keyframes tapHintBob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%       { transform: translateY(-14px) rotate(-15deg); }
}

.tap-hint {
  display: block;
  margin-top: 10px;
  font-size: 38px;
  animation: tapHintBob 1.3s ease-in-out infinite;
  user-select: none;
}

/* === Mini games === */

.mini-game {
  width: min(620px, 100%);
  margin: 0 auto;
  display: grid;
  justify-items: center;
  gap: 16px;
}

.pairs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 12px;
  width: min(460px, 100%);
  perspective: 900px;
}

.pair-card {
  position: relative;
  min-height: 160px;
  border: none;
  border-radius: 18px;
  background: transparent;
  transform-style: preserve-3d;
  transition: transform .32s ease, filter .2s ease;
  cursor: pointer;
}

.pair-card.open,
.pair-card.matched {
  transform: rotateY(180deg);
}

.pair-card.matched {
  filter: drop-shadow(0 10px 20px rgba(61, 178, 118, .24));
  pointer-events: none;
}

.pair-back,
.pair-front {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  backface-visibility: hidden;
  box-shadow: 0 10px 22px rgba(36, 49, 61, .08);
}

.pair-back {
  background: linear-gradient(180deg, #fff3ca, #ffe2a8);
  color: #9b6a00;
  font-size: 42px;
}

.pair-front {
  padding: 8px;
  background: #ffffff;
  transform: rotateY(180deg);
}

.pair-card.matched .pair-front {
  border-color: rgba(62, 190, 116, .62);
  background: #effcf7;
}

.pair-front .answer-image,
.pair-front .answer-visual {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  border-radius: 14px;
}

.dots-field {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 280px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.dot-item {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: #fff3ca;
  color: var(--coral);
  font-size: 52px;
  line-height: 1;
}

.number-answers {
  display: grid;
  grid-template-columns: repeat(4, minmax(54px, 1fr));
  gap: 10px;
  width: min(340px, 100%);
}

.number-answer {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  color: var(--ink);
  font-size: 26px;
  font-weight: 900;
  cursor: pointer;
}

.number-answer.wrong {
  border-color: rgba(255, 112, 112, .7);
  background: #fff0ef;
  color: #a82b2b;
}

.missing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 12px;
  width: min(480px, 100%);
}

.missing-cell {
  display: grid;
  place-items: center;
  min-height: 170px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(36, 49, 61, .08);
}

.missing-cell .answer-image,
.missing-cell .answer-visual {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  border-radius: 14px;
}

.missing-question {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 999px;
  background: #f7fbfd;
  color: var(--ink);
  font-size: 54px;
  font-weight: 900;
}

.missing-answers {
  margin-top: 4px;
}

.built-word {
  display: grid;
  place-items: center;
  min-width: min(360px, 100%);
  min-height: 76px;
  padding: 12px 18px;
  border: 2px dashed var(--line);
  border-radius: 20px;
  background: #ffffff;
  color: var(--ink);
  font-size: clamp(28px, 7vw, 44px);
  font-weight: 900;
  letter-spacing: 0;
}

.built-word.wrong {
  border-color: rgba(255, 112, 112, .7);
  background: #fff0ef;
}

.syllable-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.syllable-button {
  min-width: 82px;
  min-height: 62px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f7fbfd);
  color: var(--ink);
  font-size: 26px;
  font-weight: 900;
  cursor: pointer;
}

.syllable-button.used {
  opacity: .45;
  pointer-events: none;
}

@media (max-width: 560px) {
  .pairs-grid,
  .missing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pair-card,
  .missing-cell {
    min-height: 112px;
  }

  .number-answers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ===================== COUNT PICTURE GAME ===================== */
.count-question {
  text-align: center;
  margin-bottom: 20px;
}
.count-question-num {
  font-size: 100px;
  font-weight: 900;
  line-height: 1;
  color: var(--ink);
  display: block;
}
.count-picture-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  max-width: 480px;
  margin: 0 auto;
}
.count-picture-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 10px 10px;
  min-height: 130px;
  border-radius: 22px;
  border: 3px solid var(--line);
  background: var(--paper);
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.14s, border-color 0.14s, box-shadow 0.14s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.count-picture-card:hover {
  transform: scale(1.04);
  box-shadow: 0 8px 24px rgba(49,64,76,.12);
}
.count-picture-card.correct {
  border-color: #3ebe74;
  background: #effcf7;
  box-shadow: 0 0 0 4px rgba(62,190,116,.25);
}
.count-picture-card.wrong {
  border-color: #ff7070;
  background: #fff0ef;
}
.count-items {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px;
  flex: 1;
  width: 100%;
  padding: 4px 0;
}
.count-obj {
  font-size: 30px;
  line-height: 1.1;
}
.count-num-label {
  font-size: 20px;
  font-weight: 900;
  margin-top: 6px;
  color: var(--muted);
}

/* ===================== COIN COUNTER (topbar) ===================== */
.coin-counter {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 20px;
  background: #fff8e0;
  border: 1.5px solid var(--sun);
  font-weight: 800;
  font-size: 15px;
  margin-right: 8px;
  white-space: nowrap;
}
.coin-count {
  min-width: 20px;
  text-align: right;
}

/* ===================== COIN EARNED (reward screen) ===================== */
.coin-earned {
  display: inline-block;
  margin: 2px 0 10px;
  padding: 8px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd86b 0%, #ffb83c 100%);
  color: #6b4a00;
  font-size: 22px;
  font-weight: 900;
  box-shadow: 0 4px 14px rgba(255,184,60,.4);
  letter-spacing: 0.5px;
  animation: coinPop 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
@keyframes coinPop {
  0%   { transform: scale(0.4); opacity: 0; }
  70%  { transform: scale(1.12); }
  100% { transform: scale(1);   opacity: 1; }
}
.pet-reward-tip {
  font-size: 17px;
  font-weight: 700;
}

/* ===================== ONBOARDING ===================== */
.onboarding {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 16px 48px;
  text-align: center;
}
.onb-hero {
  margin-bottom: 32px;
}
.onb-egg {
  font-size: 84px;
  display: block;
  margin-bottom: 12px;
  animation: petBreath 2s ease-in-out infinite;
}
.onb-title {
  font-size: clamp(24px, 5vw, 44px);
  margin: 0 0 8px;
}
.pet-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
  text-align: center;
}
.pet-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 10px 16px;
  border-radius: 22px;
  border: 2px solid var(--line);
  background: var(--paper);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.pet-choice:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(49,64,76,.1);
}
.pet-choice.selected {
  border-color: var(--sun);
  background: #fffae8;
  box-shadow: 0 0 0 3px rgba(255,216,107,.4);
  transform: scale(1.05);
}
.pet-choice-emoji {
  font-size: 54px;
  line-height: 1;
}
.pet-choice-name {
  font-size: 15px;
  font-weight: 800;
}
.pet-choice-desc {
  font-size: 12px;
  color: var(--muted);
}
.onb-confirm {
  font-size: 19px;
  padding: 16px 36px;
  min-height: 58px;
}
.onb-confirm:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

/* ===================== PET SCREEN ===================== */
.pet-screen {
  max-width: 540px;
  margin: 0 auto;
  padding: 28px 24px 32px;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(255,255,255,.95);
  border-radius: 26px;
  box-shadow: var(--shadow);
  text-align: center;
}
.pet-coin-row {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.coin-big {
  font-size: 21px;
  font-weight: 900;
  padding: 9px 22px;
  background: #fff8e0;
  border-radius: 999px;
  border: 2px solid var(--sun);
}
.pet-avatar-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 20px;
}
.pet-avatar {
  font-size: 108px;
  line-height: 1;
  display: block;
  animation: petBreath 2.6s ease-in-out infinite;
  filter: drop-shadow(0 12px 20px rgba(49,64,76,.14));
}
.pet-stage-badge {
  position: absolute;
  bottom: -10px;
  right: -12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--ink);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.pet-info {
  margin-bottom: 18px;
}
.pet-info h2 {
  margin: 0 0 6px;
  font-size: 28px;
}
.pet-happy-section {
  margin-bottom: 22px;
  text-align: left;
}
.pet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
.pet-action-btn {
  min-height: 58px;
  border-radius: 18px;
  background: var(--paper);
  border: 2px solid var(--line);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s, border-color 0.15s;
}
.pet-action-btn:hover {
  transform: translateY(-2px);
  border-color: var(--sun);
}
.pet-tip {
  font-size: 14px;
}

/* ===================== PET ANIMATIONS ===================== */
@keyframes petBreath {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.07); }
}
@keyframes petHappy {
  0%,100% { transform: scale(1) translateY(0) rotate(0deg); }
  20%     { transform: scale(1.18) translateY(-22px) rotate(-10deg); }
  45%     { transform: scale(1.08) translateY(-8px) rotate(6deg); }
  65%     { transform: scale(1.14) translateY(-16px) rotate(-6deg); }
  85%     { transform: scale(1.04) translateY(-4px) rotate(3deg); }
}
@keyframes petBounce {
  0%,100% { transform: translateY(0) rotate(0deg); }
  30%     { transform: translateY(-28px) rotate(-12deg); }
  60%     { transform: translateY(-12px) rotate(10deg); }
  80%     { transform: translateY(-20px) rotate(-6deg); }
}
.pet-happy-anim {
  animation: petHappy 0.9s ease both !important;
}
.pet-bounce-anim {
  animation: petBounce 0.75s ease both !important;
}

@media (max-width: 480px) {
  .pet-choice-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .pet-actions {
    grid-template-columns: 1fr;
  }
}
