:root {
  --ink: #302a4b;
  --muted: #706a83;
  --cream: #fffaf0;
  --paper: #ffffff;
  --yellow: #ffca3a;
  --orange: #ff8b4a;
  --pink: #ff6f91;
  --blue: #55bde9;
  --green: #66cf91;
  --purple: #8d79e8;
  --shadow: 0 18px 45px rgba(66, 49, 99, 0.12);
  --soft-shadow: 0 8px 22px rgba(66, 49, 99, 0.1);
  --radius: 28px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: "Nunito", system-ui, sans-serif;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  overscroll-behavior-x: none;
  position: relative;
}

@supports (overflow: clip) {
  html,
  body {
    overflow-x: clip;
  }
}

img,
svg,
video {
  max-width: 100%;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

input,
select,
textarea {
  font-size: 16px;
}

button {
  color: inherit;
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 4px solid rgba(85, 189, 233, 0.45);
  outline-offset: 4px;
}

.page-cloud {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(1px);
  opacity: 0.5;
}

.page-cloud--one {
  top: 130px;
  left: -80px;
  width: 250px;
  height: 250px;
  background: #ffeab5;
}

.page-cloud--two {
  top: 540px;
  right: -110px;
  width: 340px;
  height: 340px;
  background: #e5defe;
}

.site-header {
  width: min(1160px, calc(100% - 40px));
  min-height: 92px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 12;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 5px;
  border: 1px solid #ece5d9;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 5px 18px rgba(48, 42, 75, 0.06);
}

.site-nav__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 900;
  cursor: pointer;
}

.site-nav__item:hover,
.site-nav__item.is-active {
  background: #fff0c7;
}

.menu-button,
.mobile-menu,
.bottom-nav {
  display: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  font-family: "Baloo 2", cursive;
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.brand b {
  color: var(--orange);
}

.brand__mark {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 3px 4px 0 var(--ink);
  font-size: 1.15rem;
  transform: rotate(-5deg);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sound-button,
.profile-chip {
  height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #ece5d9;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 4px 12px rgba(48, 42, 75, 0.05);
  font-weight: 800;
}

.sound-button {
  padding: 0 18px;
  cursor: pointer;
}

.profile-chip {
  padding: 0 15px 0 7px;
}

.profile-chip__avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--purple);
  border-radius: 50%;
  font-family: "Baloo 2", cursive;
  font-size: 1.1rem;
}

main,
footer {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
}

.page-panel {
  display: none;
  width: 100%;
  min-width: 0;
  animation: page-in 320ms ease both;
}

.page-panel.is-active {
  display: block;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
}

.hero {
  min-height: 515px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 50px;
  padding: 35px 0 55px;
}

.learning-paths {
  padding: 30px 0 85px;
}

.path-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 15px;
}

.path-card {
  min-height: 175px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 18px;
  border: 2px solid var(--ink);
  border-radius: 24px;
  box-shadow: 5px 6px 0 var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.path-card:hover {
  transform: translateY(-5px);
  box-shadow: 7px 10px 0 var(--ink);
}

.path-card > span {
  margin-bottom: auto;
  font-size: 2.6rem;
}

.path-card b {
  font-family: "Baloo 2", cursive;
  font-size: 1.3rem;
}

.path-card small { color: #625b70; font-weight: 800; }
.path-card--games { background: #fff0a8; }
.path-card--poems { background: #ffd8e3; }
.path-card--stories { background: #dfd8ff; }
.path-card--books { background: #cceff9; }
.path-card--exercise { background: #d5f3dc; }

.content-page {
  min-height: 700px;
  padding-bottom: 85px;
}

.content-hero {
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 35px;
  margin: 30px 0 34px;
  padding: 40px 48px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 34px;
  box-shadow: 7px 8px 0 var(--ink);
}

.content-hero--games { background: linear-gradient(135deg, #fff0aa, #ffe0b9); }
.content-hero--poems { background: linear-gradient(135deg, #ffdce7, #ebe0ff); }
.content-hero--stories { background: #dcd7ff; }
.content-hero--books { background: linear-gradient(135deg, #d7f2fa, #e7f7dd); }
.content-hero--exercise { background: linear-gradient(135deg, #d8f5df, #fff0b0); }

.content-hero > div {
  position: relative;
  z-index: 2;
  max-width: 620px;
}

.content-hero__eyebrow {
  color: #dd643a;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.content-hero h1 {
  margin: 6px 0 4px;
  font-family: "Baloo 2", cursive;
  font-size: clamp(2.6rem, 6vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.content-hero p {
  max-width: 550px;
  margin: 8px 0 0;
  color: #615a72;
  font-size: 1.05rem;
  line-height: 1.55;
}

.content-hero__emoji {
  flex: 0 0 auto;
  font-size: clamp(5rem, 11vw, 8rem);
  filter: drop-shadow(7px 9px 0 rgba(48, 42, 75, 0.15));
  transform: rotate(7deg);
}

.content-hero__image {
  width: 390px;
  align-self: stretch;
  margin: -40px -48px -40px 0;
  object-fit: cover;
  border-left: 3px solid var(--ink);
}

.filter-bar {
  display: flex;
  gap: 9px;
  margin: 0 0 25px;
  padding: 5px 2px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar { display: none; }

.filter-bar button {
  flex: 0 0 auto;
  padding: 10px 16px;
  border: 2px solid #ded7ca;
  border-radius: 999px;
  background: white;
  font-size: 0.85rem;
  font-weight: 900;
  cursor: pointer;
}

.filter-bar button.is-active {
  color: #fff;
  border-color: var(--ink);
  background: var(--ink);
}

.content-grid,
.story-grid,
.book-grid,
.exercise-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.library-card {
  position: relative;
  min-height: 285px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 26px;
  background: white;
  box-shadow: 5px 6px 0 var(--ink);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.library-card:hover {
  transform: translateY(-5px);
  box-shadow: 8px 10px 0 var(--ink);
}

.library-card__image {
  width: 100%;
  height: 195px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-bottom: 2px solid var(--ink);
  background: #ece6ff;
}

.library-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.library-card__art {
  font-size: 5rem;
  filter: drop-shadow(4px 5px 0 rgba(48, 42, 75, 0.13));
}

.library-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 18px;
}

.library-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--purple);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.library-card h3 {
  margin: 7px 0 3px;
  font-family: "Baloo 2", cursive;
  font-size: 1.45rem;
  line-height: 1.1;
}

.library-card p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.library-card__button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding: 10px 13px;
  border: 2px solid var(--ink);
  border-radius: 13px;
  background: #fff9e8;
  box-shadow: 2px 3px 0 var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.poem-card:nth-child(4n+1) .library-card__image { background: #ffe1e9; }
.poem-card:nth-child(4n+2) .library-card__image { background: #dff3fb; }
.poem-card:nth-child(4n+3) .library-card__image { background: #fff0ad; }
.poem-card:nth-child(4n) .library-card__image { background: #e1f4e3; }

.book-card {
  min-height: 325px;
  border-radius: 18px 27px 27px 18px;
}

.book-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 13px;
  z-index: 3;
  border-left: 2px solid rgba(48, 42, 75, 0.28);
}

.book-card .library-card__image { height: 165px; }

.exercise-card .library-card__image { height: 155px; }

.exercise-card__duration {
  position: absolute;
  top: 13px;
  right: 13px;
  padding: 6px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: white;
  font-size: 0.72rem;
  font-weight: 900;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 50px;
  border: 2px dashed #d4ccbe;
  border-radius: 25px;
  color: var(--muted);
  text-align: center;
}

/* Reader */
.content-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  visibility: hidden;
  padding: 24px;
  background: rgba(40, 34, 64, 0.66);
  opacity: 0;
  backdrop-filter: blur(8px);
  transition: opacity 180ms ease, visibility 180ms ease;
}

.content-modal.is-open { visibility: visible; opacity: 1; }

.reader-dialog {
  position: relative;
  width: min(930px, 100%);
  max-height: calc(100vh - 40px);
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 30px;
  background: white;
  box-shadow: 10px 12px 0 rgba(25, 20, 42, 0.5);
}

.reader-dialog__close {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 5;
  background: rgba(255, 255, 255, 0.92);
}

.reader-cover {
  min-height: 590px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-right: 3px solid var(--ink);
  background: linear-gradient(150deg, #e3ddff, #d8f1fa);
  font-size: 8rem;
}

.reader-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reader-content {
  min-height: 590px;
  display: flex;
  flex-direction: column;
  padding: 42px 38px 30px;
  overflow-y: auto;
}

.reader-badge {
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  color: #c75532;
  background: #fff0d6;
  font-size: 0.69rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.reader-content h2 {
  margin: 10px 0 0;
  font-family: "Baloo 2", cursive;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1;
}

.reader-subtitle {
  margin: 4px 0 22px;
  color: var(--muted);
}

.reader-page {
  flex: 1;
  color: #4e4860;
  font-size: 1.1rem;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.lesson-box {
  padding: 18px;
  border: 2px solid #e2dce9;
  border-radius: 18px;
  background: #fffbf2;
}

.sentence-table {
  display: grid;
  gap: 9px;
}

.sentence-row {
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid #e5dfea;
  border-radius: 13px;
  background: #fffdf8;
}

.sentence-row > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: var(--purple);
  font-size: 0.72rem;
  font-weight: 900;
}

.sentence-row b,
.sentence-row small {
  display: block;
}

.sentence-row b {
  color: var(--ink);
  font-size: 0.96rem;
  line-height: 1.35;
}

.sentence-row small {
  margin-top: 4px;
  color: #5e5870;
  font-family: "Noto Nastaliq Urdu", "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  text-align: right;
}

.arabic-letter,
.arabic-lesson {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 260px;
  padding: 20px;
  text-align: center;
}

.arabic-letter strong,
.arabic-lesson strong {
  color: var(--purple);
  font-family: "Segoe UI", sans-serif;
  font-size: clamp(4.5rem, 13vw, 7rem);
  line-height: 1;
}

.arabic-lesson strong { font-size: clamp(2.4rem, 8vw, 4.3rem); }
.arabic-letter b,
.arabic-lesson b { font-size: 1.3rem; }
.arabic-letter span,
.arabic-lesson span { color: var(--muted); font-size: 1.1rem; }

.game-card,
.mini-game-card,
.library-card,
.content-hero > *,
.section-heading > *,
.reader-dialog > * {
  min-width: 0;
}

.reader-page h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-family: "Baloo 2", cursive;
  font-size: 1.6rem;
}

.reader-page--poem {
  white-space: pre-line;
  color: var(--ink);
  font-family: "Baloo 2", cursive;
  font-size: 1.35rem;
  line-height: 1.9;
  text-align: center;
}

.reader-page--urdu {
  direction: rtl;
  font-family: "Noto Nastaliq Urdu", "Segoe UI", sans-serif;
  font-size: 1.45rem;
  line-height: 2.2;
}

.reader-progress {
  display: flex;
  gap: 6px;
  margin: 18px 0;
}

.reader-progress span {
  height: 7px;
  flex: 1;
  border-radius: 999px;
  background: #e7e2eb;
}

.reader-progress span.current,
.reader-progress span.done { background: var(--purple); }

.reader-progress--pages {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
}

.reader-progress--pages small {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.reader-progress--pages > div {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7e2eb;
}

.reader-progress--pages > div span {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--purple);
}

.reader-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.reader-next {
  background: var(--purple);
  box-shadow: 0 6px 0 #5c4aaa;
}

.exercise-stage {
  text-align: center;
}

.exercise-stage__icon {
  display: block;
  margin-bottom: 12px;
  font-size: 5rem;
}

.exercise-timer {
  width: 105px;
  height: 105px;
  display: grid;
  place-items: center;
  margin: 18px auto;
  border: 6px solid #dcd5ff;
  border-top-color: var(--purple);
  border-radius: 50%;
  font-family: "Baloo 2", cursive;
  font-size: 2rem;
  font-weight: 900;
}

.eyebrow,
.section-kicker {
  color: #ec6f42;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow {
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  background: #fff0d2;
}

.hero h1 {
  margin: 18px 0 12px;
  font-family: "Baloo 2", cursive;
  font-size: clamp(3.15rem, 6vw, 5.4rem);
  line-height: 0.93;
  letter-spacing: -0.055em;
}

.hero h1 em {
  position: relative;
  color: var(--orange);
  font-style: normal;
}

.hero h1 em::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 3px;
  left: 4px;
  height: 8px;
  z-index: -1;
  border-radius: 50%;
  background: var(--yellow);
  transform: rotate(-1deg);
}

.hero__copy > p {
  max-width: 510px;
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 1.14rem;
  line-height: 1.7;
}

.primary-button,
.secondary-button,
.card-button,
.listen-button,
.icon-button {
  border: 0;
  cursor: pointer;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 14px 22px;
  border-radius: 16px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 7px 0 #1f1b33;
  font-weight: 900;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 9px 0 #1f1b33;
}

.primary-button:active {
  transform: translateY(4px);
  box-shadow: 0 3px 0 #1f1b33;
}

.hero__art {
  position: relative;
  min-height: 420px;
  isolation: isolate;
}

.hero__art::before {
  content: "";
  position: absolute;
  inset: 12px 0 0;
  z-index: -3;
  border: 2px solid #f0ddbb;
  border-radius: 46% 54% 61% 39% / 44% 41% 59% 56%;
  background: linear-gradient(145deg, #fff4ce, #ffe6bb 60%, #ffd9bd);
  transform: rotate(3deg);
}

.orbit {
  position: absolute;
  z-index: -2;
  border: 2px dashed rgba(48, 42, 75, 0.18);
  border-radius: 50%;
  transform: rotate(-21deg);
}

.orbit--one {
  inset: 63px 23px 40px;
}

.orbit--two {
  inset: 112px 78px 83px;
}

.planet {
  position: absolute;
  right: 55px;
  bottom: 35px;
  width: 155px;
  height: 155px;
  display: grid;
  place-items: center;
  border: 5px solid var(--ink);
  border-radius: 50%;
  background: var(--green);
  box-shadow: inset -18px -18px 0 rgba(48, 42, 75, 0.1), 0 14px 0 rgba(48, 42, 75, 0.12);
  transform: rotate(7deg);
}

.planet::before {
  content: "";
  position: absolute;
  width: 205px;
  height: 36px;
  z-index: -1;
  border: 5px solid var(--ink);
  border-radius: 50%;
  background: #75d9eb;
  transform: rotate(-13deg);
}

.planet__face {
  font-family: "Baloo 2", cursive;
  font-size: 1.6rem;
}

.rocket {
  position: absolute;
  top: 83px;
  left: 115px;
  width: 105px;
  height: 168px;
  display: grid;
  place-items: center;
  border: 5px solid var(--ink);
  border-radius: 55% 55% 32% 32%;
  background: #f8fbff;
  box-shadow: inset -14px -8px 0 #dceaf3;
  transform: rotate(33deg);
  animation: rocket-float 4s ease-in-out infinite;
}

.rocket::before,
.rocket::after {
  content: "";
  position: absolute;
  bottom: 14px;
  width: 33px;
  height: 65px;
  z-index: -1;
  border: 5px solid var(--ink);
  background: var(--pink);
}

.rocket::before {
  left: -26px;
  border-radius: 80% 10% 25% 60%;
  transform: rotate(-18deg);
}

.rocket::after {
  right: -26px;
  border-radius: 10% 80% 60% 25%;
  transform: rotate(18deg);
}

.rocket__window {
  width: 65px;
  height: 65px;
  display: grid;
  place-items: center;
  border: 5px solid var(--ink);
  border-radius: 50%;
  background: #9bdff2;
  font-size: 2.25rem;
  transform: rotate(-33deg);
}

.rocket__flame {
  position: absolute;
  bottom: -45px;
  width: 46px;
  height: 52px;
  z-index: -2;
  border: 5px solid var(--ink);
  border-radius: 12% 12% 60% 60%;
  background: var(--yellow);
  box-shadow: inset 0 -15px var(--orange);
}

.float-shape {
  position: absolute;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: white;
  border: 3px solid var(--ink);
  box-shadow: 4px 5px 0 rgba(48, 42, 75, 0.18);
  font-family: "Baloo 2", cursive;
  font-weight: 800;
}

.float-shape--star {
  top: 20px;
  right: 64px;
  width: 52px;
  height: 52px;
  color: #fff;
  background: var(--yellow);
  border-radius: 17px;
  transform: rotate(12deg);
}

.float-shape--sum {
  top: 153px;
  right: 19px;
  width: 65px;
  height: 48px;
  border-radius: 15px;
  transform: rotate(8deg);
}

.float-shape--abc {
  bottom: 52px;
  left: 29px;
  width: 74px;
  height: 48px;
  border-radius: 15px;
  color: #fff;
  background: var(--purple);
  transform: rotate(-8deg);
}

@keyframes rocket-float {
  0%, 100% { transform: translateY(0) rotate(33deg); }
  50% { transform: translateY(-13px) rotate(30deg); }
}

.progress-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 26px 34px;
  border: 2px solid #eee5d7;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--soft-shadow);
}

.progress-panel h2,
.section-heading h2,
.parent-note h2 {
  margin: 4px 0 0;
  font-family: "Baloo 2", cursive;
  font-size: 1.8rem;
  line-height: 1.1;
}

.star-progress {
  min-width: 420px;
  display: flex;
  align-items: center;
  gap: 17px;
}

.star-progress__jar {
  width: 65px;
  height: 65px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 19px 19px 25px 25px;
  background: #fff2b2;
  box-shadow: inset 0 8px 0 #fff, 3px 4px 0 var(--ink);
  font-size: 1.8rem;
}

.star-progress__copy {
  flex: 1;
}

.star-progress__copy strong,
.star-progress__copy small {
  display: block;
}

.star-progress__copy small {
  margin-top: 7px;
  color: var(--muted);
}

.progress-track {
  height: 11px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eee9df;
}

.progress-track span {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--yellow), var(--orange));
  transition: width 500ms ease;
}

.games-section {
  padding: 90px 0 65px;
}

.more-games-section {
  padding: 18px 0 80px;
}

.extra-game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.mini-game-card {
  --mini-card: #fff0a8;
  position: relative;
  min-height: 265px;
  display: flex;
  flex-direction: column;
  padding: 19px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 24px;
  background: var(--mini-card);
  box-shadow: 5px 6px 0 var(--ink);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.mini-game-card:hover {
  transform: translateY(-5px);
  box-shadow: 7px 10px 0 var(--ink);
}

.mini-game-card[data-color="yellow"] { --mini-card: #fff1ad; }
.mini-game-card[data-color="blue"] { --mini-card: #d7f2fa; }
.mini-game-card[data-color="green"] { --mini-card: #daf4e1; }
.mini-game-card[data-color="pink"] { --mini-card: #ffdde7; }
.mini-game-card[data-color="purple"] { --mini-card: #e4deff; }
.mini-game-card[data-color="orange"] { --mini-card: #ffe1c7; }

.mini-game-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mini-game-card__icon {
  width: 65px;
  height: 65px;
  display: grid;
  place-items: center;
  margin: 20px 0 15px;
  border: 2px solid var(--ink);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 3px 4px 0 var(--ink);
  font-family: "Baloo 2", cursive;
  font-size: 2rem;
  font-weight: 900;
  transform: rotate(-3deg);
}

.mini-game-card h3 {
  margin: 0 0 3px;
  font-family: "Baloo 2", cursive;
  font-size: 1.35rem;
  line-height: 1.1;
}

.mini-game-card p {
  margin: 0 0 16px;
  color: #5e5870;
  font-size: 0.86rem;
  line-height: 1.45;
}

.mini-game-card .card-button {
  padding: 9px 12px;
  font-size: 0.86rem;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 28px;
}

.section-heading h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.section-heading > p {
  max-width: 360px;
  margin: 0 0 6px;
  color: var(--muted);
  line-height: 1.6;
  text-align: right;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.game-card {
  position: relative;
  min-height: 385px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 20px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 6px 7px 0 var(--ink);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.game-card:hover {
  transform: translateY(-6px) rotate(-0.5deg);
  box-shadow: 9px 13px 0 var(--ink);
}

.game-card--yellow { background: #fff0a8; }
.game-card--blue { background: #cceff9; }
.game-card--pink { background: #ffd8e3; }
.game-card--green { background: #d5f3dc; }
.game-card--purple { background: #dfd8ff; }

.game-card--wide {
  min-height: 260px;
  grid-column: span 4;
}

.game-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.game-card__level {
  padding: 6px 10px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.game-card__stars {
  color: #8d6b13;
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.game-card__visual {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 12px 0 5px;
}

.number-visual span {
  width: 55px;
  height: 65px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 15px;
  background: white;
  box-shadow: 3px 4px 0 var(--ink);
  font-family: "Baloo 2", cursive;
  font-size: 2rem;
  font-weight: 800;
}

.number-visual span:nth-child(1) { transform: rotate(-8deg) translateY(7px); }
.number-visual span:nth-child(2) { color: #fff; background: var(--orange); transform: rotate(6deg) translateY(-8px); }
.number-visual span:nth-child(3) { transform: rotate(3deg) translateY(5px); }

.counting-visual span {
  font-size: 3rem;
  filter: drop-shadow(2px 4px 0 rgba(48, 42, 75, 0.18));
}

.counting-visual span:nth-child(2) { transform: translateY(-20px) rotate(7deg); }

.color-visual span {
  width: 55px;
  height: 75px;
  border: 3px solid var(--ink);
  border-radius: 50% 50% 45% 45%;
  box-shadow: inset -8px -9px 0 rgba(48, 42, 75, 0.12);
}

.color-visual span::after {
  content: "";
  width: 1px;
  height: 38px;
  display: block;
  margin: 73px auto 0;
  border-left: 2px solid var(--ink);
}

.color-visual span:nth-child(1) { background: var(--pink); transform: rotate(-8deg) translateY(-8px); }
.color-visual span:nth-child(2) { background: var(--yellow); }
.color-visual span:nth-child(3) { background: var(--blue); transform: rotate(8deg) translateY(-12px); }

.size-visual {
  align-items: end;
}

.size-visual span:first-child {
  font-size: 5.2rem;
}

.size-visual span:last-child {
  font-size: 2.6rem;
}

.game-card h3 {
  margin: 4px 0 3px;
  font-family: "Baloo 2", cursive;
  font-size: 1.55rem;
  line-height: 1.1;
}

.game-card p {
  margin: 0 0 16px;
  color: #5e5870;
  font-size: 0.92rem;
  line-height: 1.45;
}

.card-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding: 11px 14px;
  border: 2px solid var(--ink);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 3px 4px 0 var(--ink);
  font-weight: 900;
}

.card-button:hover {
  background: white;
}

.wide-card-content {
  flex: 1;
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  align-items: center;
  gap: 40px;
}

.wide-card-content .card-button {
  max-width: 220px;
}

.pattern-visual {
  min-height: 150px;
  margin: 0;
}

.pattern-visual span {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 24px;
  background: white;
  box-shadow: 4px 5px 0 var(--ink);
  font-size: 2.5rem;
}

.pattern-visual span:nth-child(odd) { color: var(--pink); }
.pattern-visual span:nth-child(even) { color: var(--blue); transform: translateY(8px); }
.pattern-visual span:last-child { color: var(--ink); background: #fff7c4; }

.parent-note {
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 15px 0 90px;
  padding: 30px 34px;
  border: 2px dashed #deccb3;
  border-radius: var(--radius);
  background: #fff7e4;
}

.parent-note__icon {
  width: 70px;
  height: 70px;
  flex: 0 0 70px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: #ffe297;
  font-size: 2rem;
}

.parent-note p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

footer {
  min-height: 155px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 25px;
  border-top: 1px solid #e9dfd0;
}

footer p {
  color: var(--orange);
  font-weight: 900;
}

footer small {
  color: var(--muted);
  text-align: right;
}

.brand--footer {
  font-size: 1.3rem;
}

.brand--footer .brand__mark {
  width: 34px;
  height: 34px;
  border-width: 2px;
  border-radius: 11px;
  box-shadow: 2px 3px 0 var(--ink);
  font-size: 0.85rem;
}

/* Game modal */
.game-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  visibility: hidden;
  padding: 24px;
  background: rgba(40, 34, 64, 0.62);
  opacity: 0;
  backdrop-filter: blur(8px);
  transition: opacity 180ms ease, visibility 180ms ease;
}

.game-modal.is-open {
  visibility: visible;
  opacity: 1;
}

.game-dialog {
  width: min(760px, 100%);
  max-height: calc(100vh - 42px);
  overflow-y: auto;
  padding: 26px;
  border: 3px solid var(--ink);
  border-radius: 30px;
  background: var(--paper);
  box-shadow: 10px 12px 0 rgba(28, 23, 48, 0.55);
  transform: translateY(20px) scale(0.97);
  transition: transform 200ms ease;
}

.game-modal.is-open .game-dialog {
  transform: translateY(0) scale(1);
}

.game-dialog__header,
.game-question-row,
.game-dialog__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.game-dialog__header h2 {
  margin: 3px 0 0;
  font-family: "Baloo 2", cursive;
  font-size: 2rem;
  line-height: 1;
}

.game-dialog__badge {
  color: var(--orange);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.icon-button {
  width: 45px;
  height: 45px;
  flex: 0 0 45px;
  display: grid;
  place-items: center;
  border: 2px solid #ded8e8;
  border-radius: 14px;
  background: #f7f4fa;
  font-size: 1.8rem;
  line-height: 1;
}

.round-progress {
  display: flex;
  gap: 7px;
  margin: 22px 0 24px;
}

.round-progress span {
  height: 8px;
  flex: 1;
  border-radius: 999px;
  background: #e9e5ee;
  transition: background 200ms ease;
}

.round-progress span.done { background: var(--green); }
.round-progress span.current { background: var(--yellow); }

.game-question-row h3 {
  margin: 2px 0 2px;
  font-family: "Baloo 2", cursive;
  font-size: clamp(1.55rem, 5vw, 2.2rem);
  line-height: 1.1;
}

.game-question-row p {
  margin: 0;
  color: var(--muted);
}

.round-label {
  color: var(--purple);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.listen-button {
  min-width: 98px;
  padding: 10px 12px;
  border: 2px solid #dcd6e7;
  border-radius: 14px;
  background: #f8f6fb;
  font-weight: 900;
}

.game-arena {
  min-height: 250px;
  display: grid;
  place-items: center;
  margin: 24px 0 12px;
  padding: 25px;
  overflow: hidden;
  border: 2px dashed #dcd5ca;
  border-radius: 24px;
  background: #fffbf3;
}

.feedback {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-weight: 900;
  text-align: center;
}

.feedback.success {
  color: #246c43;
  background: #ddf6e6;
}

.feedback.error {
  color: #a83c54;
  background: #ffe3e9;
}

.game-dialog__footer {
  margin-top: 16px;
}

.secondary-button {
  padding: 12px 17px;
  border: 2px solid #ded8e8;
  border-radius: 14px;
  background: white;
  font-weight: 900;
}

.primary-button--game {
  min-width: 165px;
  background: var(--purple);
  box-shadow: 0 6px 0 #5c4aaa;
}

.primary-button--game:hover { box-shadow: 0 8px 0 #5c4aaa; }
.primary-button--game:active { box-shadow: 0 2px 0 #5c4aaa; }
.hidden { display: none !important; }

/* Activity components */
.number-game {
  width: 100%;
}

.number-slots,
.number-options,
.answer-options,
.color-options,
.size-options,
.pattern-row,
.pattern-options {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.number-slots {
  min-height: 78px;
  margin-bottom: 27px;
}

.number-slot,
.number-tile,
.answer-button,
.pattern-option {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 17px;
  font-family: "Baloo 2", cursive;
  font-size: 1.9rem;
  font-weight: 800;
}

.extra-prompt {
  width: 100%;
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 22px;
  color: var(--ink);
  font-family: "Baloo 2", cursive;
  font-size: clamp(2.1rem, 8vw, 4rem);
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
}

.extra-prompt--small {
  font-size: clamp(1.45rem, 5vw, 2.25rem);
}

.extra-prompt__blank {
  min-width: 58px;
  display: inline-grid;
  place-items: center;
  padding: 3px 10px;
  border: 3px dashed var(--purple);
  border-radius: 14px;
  color: var(--purple);
  background: #f0ebff;
}

.extra-answer-options {
  display: flex;
  align-items: stretch;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.extra-answer {
  min-width: 82px;
  min-height: 68px;
  display: grid;
  place-items: center;
  padding: 10px 16px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: #fff;
  box-shadow: 3px 4px 0 var(--ink);
  font-family: "Baloo 2", cursive;
  font-size: 1.45rem;
  font-weight: 800;
  cursor: pointer;
}

.extra-answer.selected {
  color: #fff;
  background: var(--purple);
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}

.extra-answer__emoji {
  display: block;
  font-size: 2.5rem;
  line-height: 1.1;
}

.extra-answer__label {
  display: block;
  font-size: 0.85rem;
  line-height: 1.1;
}

.shadow-object {
  display: inline-block;
  filter: grayscale(1) brightness(0.15);
  opacity: 0.72;
  transform: scale(1.35);
}

.sound-stage {
  flex-direction: column;
}

.sound-play-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: #d9f4ff;
  box-shadow: 4px 5px 0 var(--ink);
  font-size: 1.1rem;
  font-weight: 900;
  cursor: pointer;
}

.urdu-text {
  direction: rtl;
  font-family: "Noto Nastaliq Urdu", "Segoe UI", sans-serif;
  font-size: 4.5rem;
}

.memory-board {
  width: min(430px, 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.memory-card {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 19px;
  color: transparent;
  background: var(--purple);
  box-shadow: 3px 4px 0 var(--ink);
  font-size: clamp(2rem, 8vw, 3rem);
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease;
}

.memory-card::before {
  content: "★";
  color: #fff;
}

.memory-card.flipped,
.memory-card.matched {
  color: inherit;
  background: white;
  transform: rotateY(180deg);
}

.memory-card.flipped::before,
.memory-card.matched::before {
  display: none;
}

.memory-card.matched {
  background: #dff6e7;
  opacity: 0.75;
}

.puzzle-layout {
  width: 100%;
}

.puzzle-slots,
.puzzle-pieces {
  display: grid;
  grid-template-columns: repeat(2, 84px);
  justify-content: center;
  gap: 5px;
}

.puzzle-slots {
  margin-bottom: 20px;
}

.puzzle-slot,
.puzzle-piece {
  position: relative;
  width: 84px;
  height: 84px;
  overflow: hidden;
  border: 3px solid var(--ink);
  background: white;
  cursor: pointer;
}

.puzzle-slot:nth-child(1), .puzzle-piece[data-piece="0"] { border-radius: 20px 3px 3px; }
.puzzle-slot:nth-child(2), .puzzle-piece[data-piece="1"] { border-radius: 3px 20px 3px 3px; }
.puzzle-slot:nth-child(3), .puzzle-piece[data-piece="2"] { border-radius: 3px 3px 3px 20px; }
.puzzle-slot:nth-child(4), .puzzle-piece[data-piece="3"] { border-radius: 3px 3px 20px; }

.puzzle-slot.empty {
  display: grid;
  place-items: center;
  border-style: dashed;
  color: #b9b1c3;
  font-size: 1.5rem;
}

.puzzle-piece {
  box-shadow: 2px 3px 0 var(--ink);
}

.puzzle-piece:disabled {
  visibility: hidden;
}

.puzzle-fragment {
  position: absolute;
  width: 168px;
  height: 168px;
  display: grid;
  place-items: center;
  font-size: 7rem;
  line-height: 1;
}

[data-fragment="0"] { top: 0; left: 0; }
[data-fragment="1"] { top: 0; left: -84px; }
[data-fragment="2"] { top: -84px; left: 0; }
[data-fragment="3"] { top: -84px; left: -84px; }

.maze-board {
  width: 210px;
  height: 210px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  overflow: hidden;
  border: 4px solid var(--ink);
  border-radius: 20px;
  background: #eaf7df;
}

.maze-cell {
  display: grid;
  place-items: center;
  border: 1px dashed rgba(48, 42, 75, 0.25);
  font-size: 2rem;
}

.maze-cell.wall {
  background: repeating-linear-gradient(45deg, #96ca78 0 8px, #7db763 8px 16px);
}

.clock-face {
  font-size: 6rem;
  filter: drop-shadow(3px 5px 0 rgba(48, 42, 75, 0.18));
}

.number-slot {
  color: #c3bdca;
  border-style: dashed;
  background: rgba(255, 255, 255, 0.65);
  cursor: pointer;
}

.number-slot.filled {
  color: var(--ink);
  border-style: solid;
  background: #fff0a8;
}

.number-tile {
  background: white;
  box-shadow: 3px 4px 0 var(--ink);
  cursor: pointer;
}

.number-tile:disabled {
  visibility: hidden;
}

.objects-to-count {
  max-width: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 24px;
}

.count-object {
  font-size: clamp(2.2rem, 7vw, 3.4rem);
  filter: drop-shadow(2px 3px 0 rgba(48, 42, 75, 0.12));
  animation: item-pop 300ms backwards;
}

@keyframes item-pop {
  from { opacity: 0; transform: scale(0.4) rotate(-15deg); }
}

.answer-button,
.pattern-option {
  background: white;
  box-shadow: 3px 4px 0 var(--ink);
  cursor: pointer;
}

.answer-button.selected,
.pattern-option.selected {
  color: white;
  background: var(--purple);
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}

.color-options {
  gap: 24px;
}

.color-choice {
  position: relative;
  width: 86px;
  height: 106px;
  border: 4px solid var(--ink);
  border-radius: 50% 50% 45% 45%;
  box-shadow: inset -12px -13px 0 rgba(48, 42, 75, 0.14), 4px 5px 0 var(--ink);
  cursor: pointer;
}

.color-choice::after {
  content: "";
  position: absolute;
  top: 101px;
  left: 50%;
  height: 40px;
  border-left: 2px solid var(--ink);
}

.color-choice.selected {
  outline: 7px solid rgba(141, 121, 232, 0.28);
  transform: translateY(-7px);
}

.size-options {
  width: 100%;
  gap: 35px;
}

.size-choice {
  width: min(240px, 42%);
  min-height: 175px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 24px;
  background: white;
  box-shadow: 5px 6px 0 var(--ink);
  cursor: pointer;
}

.size-choice.selected {
  background: #e6dfff;
  transform: translateY(4px);
  box-shadow: 1px 2px 0 var(--ink);
}

.size-choice span {
  display: block;
  line-height: 1;
}

.pattern-row {
  margin-bottom: 26px;
}

.pattern-item {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 16px;
  background: white;
  font-size: 2rem;
  font-weight: 900;
}

.pattern-item.missing {
  border-style: dashed;
  color: #a59fac;
  background: #fff7c9;
}

.pattern-option {
  width: 72px;
  height: 72px;
  font-size: 2.4rem;
}

.complete-card {
  text-align: center;
}

.complete-card__mascot {
  width: 115px;
  height: 115px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  border: 4px solid var(--ink);
  border-radius: 38px;
  background: #fff0a8;
  box-shadow: 6px 7px 0 var(--ink);
  font-size: 4rem;
  animation: complete-bounce 650ms ease;
}

.complete-card h3 {
  margin: 8px 0 0;
  font-family: "Baloo 2", cursive;
  font-size: 2.2rem;
}

.complete-card p {
  margin: 4px 0;
  color: var(--muted);
}

.complete-stars {
  margin: 8px 0;
  color: #e5a90b;
  font-size: 2.4rem;
  letter-spacing: 0.08em;
}

.celebration {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  overflow: hidden;
}

.confetti {
  position: absolute;
  top: -25px;
  width: 13px;
  height: 20px;
  border-radius: 3px;
  animation: confetti-fall 1.7s ease-in forwards;
}

@keyframes confetti-fall {
  to { transform: translateY(105vh) rotate(720deg); }
}

@media (max-width: 960px) {
  .site-nav { display: none; }

  .menu-button {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 2px solid var(--ink);
    border-radius: 14px;
    background: #fff0b8;
    box-shadow: 2px 3px 0 var(--ink);
    font-size: 1.25rem;
    font-weight: 900;
    cursor: pointer;
  }

  .mobile-menu {
    position: fixed;
    top: 82px;
    right: 20px;
    z-index: 40;
    width: min(330px, calc(100% - 40px));
    padding: 10px;
    border: 2px solid var(--ink);
    border-radius: 22px;
    background: white;
    box-shadow: 7px 9px 0 var(--ink);
  }

  .mobile-menu.is-open { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

  .mobile-menu button {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 13px;
    border: 0;
    border-radius: 14px;
    background: #fff8e8;
    font-weight: 900;
    cursor: pointer;
  }

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

  .content-grid,
  .story-grid,
  .book-grid,
  .exercise-grid { grid-template-columns: repeat(2, 1fr); }

  .hero {
    grid-template-columns: 1fr 0.9fr;
    gap: 20px;
  }

  .hero__art {
    min-height: 370px;
    transform: scale(0.9);
  }

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

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

  .game-card--wide {
    grid-column: span 2;
  }
}

@media (max-width: 720px) {
  body { padding-bottom: 78px; }

  .page-cloud { display: none; }

  #top,
  .page-panel,
  .hero,
  .hero__art,
  footer {
    max-width: 100%;
    overflow-x: hidden;
  }

  @supports (overflow: clip) {
    #top,
    .page-panel,
    .hero,
    .hero__art,
    footer {
      overflow-x: clip;
    }
  }

  .site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    width: 100%;
    padding: 0 14px;
    border-bottom: 1px solid #e9dfd0;
    background: rgba(255, 250, 240, 0.94);
    backdrop-filter: blur(12px);
  }

  .menu-button { display: none; }
  .mobile-menu { display: none !important; }

  .bottom-nav {
    position: fixed;
    right: 8px;
    bottom: 8px;
    left: 8px;
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 6px;
    border: 2px solid var(--ink);
    border-radius: 21px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 7px 24px rgba(48, 42, 75, 0.22);
    backdrop-filter: blur(12px);
  }

  .bottom-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 5px 2px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    font-size: 0.6rem;
    font-weight: 900;
    cursor: pointer;
  }

  .bottom-nav button span { font-size: 1.18rem; }
  .bottom-nav button.is-active { background: #fff0b5; }

  .site-header,
  main,
  footer {
    width: min(100% - 28px, 1160px);
  }

  .site-header {
    min-height: 78px;
  }

  .sound-button {
    width: 43px;
    padding: 0;
    justify-content: center;
  }

  .sound-button span:last-child,
  .profile-chip > span:last-child {
    display: none;
  }

  .profile-chip {
    width: 43px;
    padding: 4px;
  }

  .profile-chip__avatar {
    width: 33px;
  }

  .hero {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 48px;
    text-align: center;
  }

  .learning-paths { padding-bottom: 65px; }

  .path-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .path-card {
    min-height: 150px;
    padding: 15px;
    border-radius: 20px;
  }

  .path-card > span { font-size: 2.25rem; }
  .path-card b { font-size: 1.12rem; }

  .content-page { padding-bottom: 60px; }

  .content-hero {
    min-height: 205px;
    margin: 20px 0 25px;
    padding: 28px 22px;
    border-radius: 27px;
  }

  .content-hero h1 { font-size: clamp(2.4rem, 12vw, 3.5rem); }
  .content-hero p { font-size: 0.9rem; }
  .content-hero__emoji { font-size: 4.2rem; }

  .content-hero__image {
    width: 38%;
    min-width: 135px;
    margin: -28px -22px -28px 0;
  }

  .filter-bar {
    width: 100%;
    margin-left: 0;
    padding-right: 0;
    padding-left: 0;
    overflow-x: hidden;
    flex-wrap: wrap;
  }

  .content-grid,
  .story-grid,
  .book-grid,
  .exercise-grid { grid-template-columns: 1fr; gap: 16px; }

  .library-card { min-height: 0; }
  .library-card__image { height: 190px; }

  .content-modal { padding: 8px; }

  .reader-dialog {
    max-height: calc(100vh - 16px);
    display: block;
    overflow-y: auto;
    border-radius: 24px;
  }

  .reader-cover {
    min-height: 215px;
    max-height: 260px;
    border-right: 0;
    border-bottom: 3px solid var(--ink);
    font-size: 5rem;
  }

  .reader-content {
    min-height: 430px;
    padding: 27px 20px 20px;
    overflow: visible;
    width: 100%;
  }

  .reader-content h2 { padding-right: 34px; }
  .reader-page { font-size: 1rem; line-height: 1.7; }
  .reader-page--poem { font-size: 1.2rem; line-height: 1.75; }

  .reader-actions { flex-wrap: wrap; }
  .reader-actions {
    position: sticky;
    bottom: -1px;
    z-index: 3;
    margin: 12px -4px -4px;
    padding: 12px 4px 4px;
    background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 18%);
  }
  .reader-actions .listen-button { order: 3; width: 100%; }

  .sentence-reader {
    padding: 0;
  }

  .sentence-reader .reader-dialog {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .sentence-reader .reader-cover {
    display: none;
  }

  .sentence-reader .reader-content {
    min-height: 100dvh;
    padding: 24px 14px 10px;
  }

  .sentence-reader .reader-subtitle {
    margin-bottom: 12px;
  }

  .sentence-reader .reader-page {
    padding-bottom: 4px;
  }

  .sentence-row {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 8px;
    padding: 9px 8px;
  }

  .sentence-row > span { width: 27px; height: 27px; }
  .sentence-row b { font-size: 0.9rem; }
  .sentence-row small { font-size: 0.93rem; }

  main,
  footer,
  .page-panel,
  .content-page,
  .game-modal,
  .content-modal {
    max-width: 100%;
  }

  .eyebrow,
  .hero__copy > p {
    margin-right: auto;
    margin-left: auto;
  }

  .hero h1 {
    font-size: clamp(3.15rem, 14vw, 4.5rem);
  }

  .hero__art {
    width: min(100%, 430px);
    min-height: 375px;
    margin-top: 20px;
    transform: none;
    contain: paint;
  }

  .progress-panel,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .star-progress {
    width: 100%;
    min-width: 0;
  }

  .section-heading > p {
    text-align: left;
  }

  .games-section {
    padding-top: 70px;
  }

  .more-games-section {
    padding-bottom: 60px;
  }

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

  .extra-game-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 13px;
  }

  .mini-game-card {
    min-height: 250px;
    padding: 15px;
    border-radius: 21px;
  }

  .mini-game-card__icon {
    width: 57px;
    height: 57px;
    margin: 16px 0 12px;
    font-size: 1.7rem;
  }

  .mini-game-card h3 {
    font-size: 1.16rem;
  }

  .mini-game-card p {
    font-size: 0.78rem;
  }

  .game-card,
  .game-card--wide {
    min-height: 360px;
    grid-column: span 1;
  }

  .wide-card-content {
    display: flex;
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 5px;
  }

  .wide-card-content .card-button {
    max-width: none;
  }

  .pattern-visual span {
    width: 56px;
    height: 56px;
    border-radius: 17px;
    font-size: 1.8rem;
  }

  .parent-note {
    align-items: flex-start;
  }

  footer {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 35px 0;
    text-align: center;
  }

  footer small {
    text-align: center;
  }

  .brand--footer {
    margin: 0 auto;
  }

  .game-modal {
    padding: 10px;
  }

  .game-dialog {
    max-height: calc(100vh - 20px);
    padding: 20px 16px;
    border-radius: 24px;
  }

  .game-question-row {
    align-items: flex-start;
  }

  .listen-button {
    min-width: 48px;
    padding: 10px;
  }

  .listen-button span {
    display: none;
  }

  .game-arena {
    min-height: 240px;
    padding: 18px 10px;
  }

  .game-dialog__footer {
    flex-wrap: wrap;
  }

  .secondary-button {
    order: 2;
    width: 100%;
  }

  .primary-button--game {
    flex: 1;
  }

  .number-slot,
  .number-tile {
    width: 52px;
    height: 55px;
    border-width: 2px;
    border-radius: 14px;
    font-size: 1.5rem;
  }

  .color-options {
    gap: 17px;
  }

  .color-choice {
    width: 66px;
    height: 83px;
    border-width: 3px;
  }

  .color-choice::after {
    top: 79px;
    height: 28px;
  }

  .size-options {
    gap: 15px;
  }

  .size-choice {
    min-height: 145px;
  }

  .extra-answer {
    min-width: 70px;
    min-height: 61px;
    padding: 8px 12px;
    font-size: 1.22rem;
  }

  .extra-answer__emoji {
    font-size: 2.1rem;
  }
}

@media (max-width: 420px) {
  .extra-game-grid {
    grid-template-columns: 1fr;
  }

  .mini-game-card {
    min-height: 235px;
  }

  .content-hero__image { display: none; }
  .content-hero__emoji { font-size: 3.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Six focused learning games */
.painting-visual,
.memory-visual,
.shape-preview,
.shadow-preview,
.animal-sound-preview {
  gap: 12px;
  font-size: clamp(2.2rem, 7vw, 3.7rem);
}

.shape-preview span { color: var(--purple); }
.shape-preview span:nth-child(2) { color: var(--orange); }
.shape-preview span:nth-child(3) { color: var(--blue); }
.shadow-preview span:last-child { filter: grayscale(1) brightness(0.08); opacity: 0.72; }

.museum-feature-card {
  min-height: 300px;
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #ffe4c8, #fff5ce);
}

.museum-feature-card .mini-game-card__icon { margin: 18px 0 12px; }

.museum-card-samples {
  display: flex;
  gap: 10px;
  margin: 12px 0 18px;
  font-size: clamp(2rem, 5vw, 3.2rem);
}

.game-dialog { width: min(900px, 100%); }

.feedback.is-correct {
  color: #246c43;
  background: #ddf6e6;
}

.feedback.is-wrong {
  color: #a83c54;
  background: #ffe3e9;
}

.painting-game,
.memory-game,
.shape-match-game,
.shadow-match-game,
.animal-sound-game,
.museum-game {
  width: 100%;
}

.painting-game {
  display: block;
  padding: 14px;
}

.painting-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 13px;
}

.paint-swatch {
  width: 39px;
  height: 39px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--paint);
  box-shadow: 0 0 0 2px var(--ink);
  cursor: pointer;
}

.paint-swatch.is-selected {
  outline: 5px solid rgba(141, 121, 232, 0.28);
  transform: translateY(-3px) scale(1.08);
}

.paint-tool {
  min-height: 42px;
  padding: 7px 14px;
  border: 2px solid var(--ink);
  border-radius: 13px;
  background: #fff;
  font-weight: 900;
}

.painting-canvas-wrap {
  position: relative;
  width: min(720px, 100%);
  margin: 0 auto;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 20px;
  background: #fffdf7;
  box-shadow: 4px 5px 0 var(--ink);
}

.painting-canvas {
  width: 100%;
  height: auto;
  display: block;
  cursor: crosshair;
  touch-action: none;
}

.painting-name {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 5px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  font-weight: 900;
  pointer-events: none;
}

.memory-game { display: grid; place-items: center; }

.memory-game .memory-board {
  width: min(520px, 100%);
  grid-template-columns: repeat(var(--memory-columns, 3), minmax(0, 1fr));
}

.memory-game .memory-card {
  min-width: 0;
  padding: 0;
  font-size: clamp(1.9rem, 8vw, 3.1rem);
}

.memory-game .memory-card span { display: none; }
.memory-game .memory-card.flipped span,
.memory-game .memory-card.matched span { display: block; transform: rotateY(180deg); }

.match-target,
.shadow-target {
  width: min(240px, 100%);
  display: grid;
  place-items: center;
  gap: 5px;
  margin: 0 auto 20px;
  padding: 12px 18px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 3px 4px 0 var(--ink);
}

.match-target small { color: var(--muted); font-weight: 800; }
.match-target svg { width: 112px; height: 112px; }

.visual-choice-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.visual-choice {
  min-width: 0;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 10px;
  border: 3px solid var(--ink);
  border-radius: 20px;
  background: #fff;
  box-shadow: 3px 4px 0 var(--ink);
  cursor: pointer;
}

.visual-choice svg { width: 100%; max-width: 112px; }
.visual-choice.is-selected,
.animal-choice.is-selected { background: #e9e2ff; outline: 5px solid rgba(141, 121, 232, 0.28); transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }

.shadow-target span { font-size: 6rem; line-height: 1; }
.shadow-choice span {
  font-size: clamp(3rem, 9vw, 5.4rem);
  line-height: 1;
  filter: grayscale(1) brightness(0);
  opacity: 0.76;
}

.animal-sound-game { display: block; }

.real-sound-button {
  width: min(290px, 100%);
  display: grid;
  place-items: center;
  gap: 3px;
  margin: 0 auto 22px;
  padding: 16px;
  border: 3px solid var(--ink);
  border-radius: 23px;
  color: var(--ink);
  background: #d9f4ff;
  box-shadow: 4px 5px 0 var(--ink);
}

.real-sound-button span { font-size: 3.2rem; }
.real-sound-button b { font-size: 1.05rem; }
.real-sound-button small { color: var(--muted); }

.animal-choice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.animal-choice {
  min-width: 0;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 13px 8px;
  border: 3px solid var(--ink);
  border-radius: 20px;
  background: #fff;
  box-shadow: 3px 4px 0 var(--ink);
}

.animal-choice span { font-size: clamp(2.7rem, 8vw, 4.4rem); line-height: 1.1; }
.animal-choice b { font-size: 0.86rem; }

.museum-game { display: block; padding: 18px; }

.museum-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.85rem;
}

.museum-summary b { color: var(--ink); }

.museum-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.museum-item {
  min-width: 0;
  min-height: 128px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  padding: 9px 5px;
  overflow: hidden;
  border: 2px solid #ded8e8;
  border-radius: 17px;
  background: #fff;
}

.museum-item span { font-size: clamp(2.2rem, 5vw, 3.3rem); line-height: 1.15; }
.museum-item b { max-width: 100%; overflow-wrap: anywhere; font-size: 0.8rem; }
.museum-item small { color: var(--muted); font-size: 0.63rem; }
.museum-item.is-visited { border-color: var(--green); background: #e4f8ea; }

.museum-progress {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9e5ee;
}

.museum-progress span { display: block; height: 100%; border-radius: inherit; background: var(--green); }

.result-stage { display: flex; flex-direction: column; text-align: center; }
.result-stars { color: #f6b800; font-size: 3rem; letter-spacing: 4px; }
.result-emoji { font-size: 5rem; }
.result-stage h3 { margin: 5px 0; font-family: "Baloo 2", cursive; font-size: 1.7rem; }
.result-stage p { margin: 0; color: var(--muted); }

@media (max-width: 720px) {
  .game-dialog { width: 100%; }
  .game-arena { overflow-x: clip; }
  .painting-game { padding: 9px; }
  .paint-swatch { width: 34px; height: 34px; }
  .painting-canvas-wrap { border-width: 2px; box-shadow: 2px 3px 0 var(--ink); }
  .visual-choice-grid,
  .animal-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .visual-choice { aspect-ratio: auto; min-height: 105px; }
  .shadow-target span { font-size: 4.8rem; }
  .museum-game { padding: 10px 7px; }
  .museum-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .museum-item { min-height: 113px; padding: 7px 3px; }
  .museum-summary { align-items: flex-start; flex-direction: column; }
  .museum-feature-card { min-height: 280px; }
}

@media (max-width: 390px) {
  .game-dialog { padding: 16px 11px; }
  .game-question-row { gap: 8px; }
  .game-question-row h3 { font-size: 1.45rem; }
  .game-question-row p { font-size: 0.82rem; }
  .game-arena { padding: 12px 7px; }
  .painting-toolbar { gap: 7px; }
  .paint-swatch { width: 30px; height: 30px; border-width: 2px; }
  .paint-tool { min-height: 36px; padding: 5px 10px; }
  .memory-game .memory-board { gap: 8px; }
  .memory-game .memory-card { border-width: 2px; border-radius: 14px; box-shadow: 2px 3px 0 var(--ink); }
  .museum-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .museum-item { min-height: 108px; }
}

/* Bilingual narrated story library */
.story-card .library-card__image { height: 165px; }

.story-card.library-card--urdu .library-card__body {
  direction: rtl;
  text-align: right;
}

.story-card.library-card--urdu h3,
.story-card.library-card--urdu p {
  font-family: "Noto Nastaliq Urdu", "Segoe UI", sans-serif;
}

.story-card.library-card--urdu h3 {
  font-size: 1.55rem;
  line-height: 1.7;
}

.story-card.library-card--urdu p { line-height: 1.85; }
.story-card.library-card--urdu .library-card__button { direction: rtl; }

.story-lines {
  display: grid;
  gap: 8px;
}

.story-lines p {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid #e5dfea;
  border-radius: 13px;
  background: #fffdf8;
  line-height: 1.55;
}

.story-lines p > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: var(--purple);
  font-family: "Nunito", sans-serif;
  font-size: 0.72rem;
  font-weight: 900;
}

.story-lines[dir="rtl"] {
  font-family: "Noto Nastaliq Urdu", "Segoe UI", sans-serif;
  font-size: 1.14rem;
  line-height: 1.8;
}

.story-lines[dir="rtl"] p {
  grid-template-columns: minmax(0, 1fr) 30px;
  line-height: 1.9;
}

.story-lines[dir="rtl"] p > span { grid-column: 2; grid-row: 1; }

@media (max-width: 720px) {
  .story-card .library-card__image { height: 150px; }
  .story-lines { gap: 6px; }
  .story-lines p { padding: 8px; font-size: 0.93rem; }
  .story-lines[dir="rtl"] p { font-size: 1.05rem; line-height: 1.85; }
  .reader-page--urdu h3 { font-family: "Noto Nastaliq Urdu", "Segoe UI", sans-serif; line-height: 1.8; }
}
