:root {
  --bg: #FFF6E9;
  --card: #FFFFFF;
  --ink: #3B2416;
  --ink-soft: #7A5B47;
  --line: #F1DEC6;
  --brand: #FF8A5B;
  --brand-dark: #E8673A;
  --sun: #FFD25E;
  --mint: #6FD3B5;
  --sky: #6CB8FF;
  --grape: #A98BFF;
  --rose: #FF8FA3;
  --ok: #3DBE7A;
  --bad: #FF6B6B;
  --accent: var(--brand);
  --accent-soft: #FFE3D6;
  --radius: 22px;
  --shadow: 0 6px 0 rgba(59, 36, 22, .08), 0 10px 24px rgba(59, 36, 22, .08);
  --font: "Baloo 2", "Segoe UI Rounded", "Nunito", system-ui, -apple-system, sans-serif, "Noto Color Emoji";
  --emoji: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  --font-ur: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Urdu Typesetting", "Noto Naskh Arabic", serif, "Noto Color Emoji";
  color-scheme: light;
}

[data-group="tots"]   { --accent: #FF8FA3; --accent-soft: #FFE1E7; --bg: #FFF3F5; }
[data-group="little"] { --accent: #FF8A5B; --accent-soft: #FFE3D6; --bg: #FFF6E9; }
[data-group="stars"]  { --accent: #3FA9F5; --accent-soft: #DCEFFF; --bg: #F1F8FF; }
[data-group="brainy"] { --accent: #7C5CFF; --accent-soft: #E8E1FF; --bg: #F5F2FF; }
[data-mode="bedtime"] { --bg: #1E2148; --card: #2B2F63; --ink: #F3F0FF; --ink-soft: #B9B5E6; --line: #3A3F7A; --accent: #FFD25E; --accent-soft: #3A3F7A; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.4;
  overscroll-behavior: none;
  -webkit-user-select: none; user-select: none;
  transition: background .3s;
}
html[lang="ur"] body { font-family: var(--font-ur), var(--font); line-height: 2.1; font-size: 17px; }
.en { font-family: var(--font); line-height: 1.3; direction: ltr; unicode-bidi: isolate; }
.ur { font-family: var(--font-ur); line-height: 2.1; direction: rtl; unicode-bidi: isolate; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; touch-action: manipulation; }
input, select { font: inherit; color: inherit; }
img, svg { display: block; }
:focus-visible { outline: 4px solid var(--sky); outline-offset: 3px; border-radius: 12px; }

#app { min-height: 100%; max-width: 980px; margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom)); }
.boot { min-height: 80vh; display: grid; place-content: center; text-align: center; font-weight: 800; font-size: 28px; }
.boot img { margin: 0 auto; animation: bob 1.6s ease-in-out infinite; }

/* ---------- generic ---------- */
.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.center { text-align: center; }
.muted { color: var(--ink-soft); }
.small { font-size: .85em; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
html[lang="ur"] h1, html[lang="ur"] h2, html[lang="ur"] h3 { line-height: 1.9; }
h1 { font-size: 30px; font-weight: 800; }
h2 { font-size: 23px; font-weight: 800; }
h3 { font-size: 19px; font-weight: 700; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; padding: 8px 22px; border-radius: 999px;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 19px;
  box-shadow: 0 5px 0 rgba(0,0,0,.15);
  transition: transform .08s, box-shadow .08s, filter .15s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0,0,0,.15); }
.btn.ghost { background: var(--card); color: var(--ink); box-shadow: 0 5px 0 var(--line); border: 2px solid var(--line); }
.btn.big { min-height: 66px; font-size: 22px; padding: 10px 30px; }
.btn.ok { background: var(--ok); }
.btn.danger { background: var(--bad); }
.btn:disabled { filter: grayscale(.8); opacity: .6; }
.icon-btn {
  width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center; flex: none;
  background: var(--card); box-shadow: var(--shadow); font-size: 24px; line-height: 1;
}
.icon-btn:active { transform: scale(.94); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); font-weight: 800; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.topbar .title { font-weight: 800; font-size: 22px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang-toggle { width: auto; padding: 0 14px; font-size: 16px; font-weight: 800; gap: 6px; display: inline-flex; align-items: center; }
.lang-toggle .flag { font-size: 22px; }

/* ---------- welcome ---------- */
.welcome { min-height: 88vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 18px; }
.welcome .logo { font-size: 54px; font-weight: 800; color: var(--brand); letter-spacing: .5px; line-height: 1; font-family: var(--font); }
.welcome .tag { font-size: 20px; color: var(--ink-soft); max-width: 420px; }
.lang-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: min(440px, 100%); }
.lang-choice button { background: var(--card); border-radius: 26px; padding: 20px 10px; box-shadow: var(--shadow); font-size: 24px; font-weight: 800; border: 3px solid transparent; }
.lang-choice button[aria-pressed="true"] { border-color: var(--brand); background: #FFF0E8; }
.lang-choice .flag { font-size: 44px; display: block; line-height: 1.2; }
.promise { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 520px; }
.promise span { background: var(--card); padding: 4px 12px; border-radius: 999px; font-size: 15px; font-weight: 700; box-shadow: var(--shadow); }

/* ---------- mascot ---------- */
.mascot { width: 140px; height: 140px; flex: none; }
.mascot.bob { animation: bob 2.2s ease-in-out infinite; }
.mascot.small { width: 78px; height: 78px; }
.mascot.tiny { width: 54px; height: 54px; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }
.speech { position: relative; background: var(--card); padding: 12px 18px; border-radius: 22px; box-shadow: var(--shadow); font-weight: 700; font-size: 19px; }

/* ---------- profiles ---------- */
.profiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; margin-top: 18px; }
.profile { background: var(--card); border-radius: 28px; padding: 18px 10px; box-shadow: var(--shadow); text-align: center; font-weight: 800; font-size: 21px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.profile:active { transform: scale(.96); }
.profile .av { font-size: 64px; width: 100px; height: 100px; border-radius: 50%; display: grid; place-items: center; line-height: 1; }
.profile .grp { font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.profile.add .av { background: var(--line); font-size: 50px; color: var(--ink-soft); }

/* ---------- home ---------- */
.hello { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.hello .speech { flex: 1; }
.cats { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 12px; scrollbar-width: none; margin: 0 -16px; padding-inline: 16px; }
.cats::-webkit-scrollbar { display: none; }
.cat { flex: none; display: flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); font-weight: 800; font-size: 17px; white-space: nowrap; }
.cat[aria-pressed="true"] { background: var(--accent); color: #fff; }
.cat .e { font-size: 22px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.tile {
  position: relative; background: var(--card); border-radius: 26px; padding: 14px 10px 12px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-height: 160px; justify-content: center;
  transition: transform .1s;
}
.tile:active { transform: scale(.95); }
.tile .e { font-size: 62px; line-height: 1.05; width: 92px; height: 92px; display: grid; place-items: center; border-radius: 26px; background: var(--accent-soft); }
.tile .n { font-weight: 800; font-size: 17px; line-height: 1.25; }
html[lang="ur"] .tile .n { line-height: 1.9; font-size: 16px; }
.tile .done { position: absolute; top: 8px; inset-inline-end: 10px; font-size: 15px; font-weight: 800; color: #C98A00; }
.tile.locked { opacity: .55; }
.tile.locked::after { content: "🔒"; position: absolute; top: 8px; inset-inline-start: 10px; font-size: 20px; }
.section-title { margin: 22px 4px 10px; font-size: 20px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.notice { background: var(--accent-soft); border-radius: 18px; padding: 10px 14px; font-weight: 700; margin-bottom: 12px; display: flex; gap: 10px; align-items: center; }

/* ---------- activity shell ---------- */
.stage { min-height: 70vh; display: flex; flex-direction: column; gap: 14px; }
.progress { height: 14px; background: var(--card); border-radius: 999px; overflow: hidden; box-shadow: inset 0 2px 4px rgba(0,0,0,.06); flex: 1; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s; }

/* cards engine */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.learn-card {
  background: var(--card); border-radius: 26px; box-shadow: var(--shadow); padding: 14px 8px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 170px; justify-content: center;
}
.learn-card .e { font-size: 70px; line-height: 1.1; }
.learn-card .big { font-size: 54px; font-weight: 800; line-height: 1.1; }
.learn-card .w { font-weight: 800; font-size: 20px; }
.learn-card .w2 { font-size: 15px; color: var(--ink-soft); font-weight: 700; }
.learn-card.seen { outline: 4px solid var(--accent-soft); }
.learn-card.pop { animation: pop .45s; }
.swatch { width: 92px; height: 92px; border-radius: 50%; border: 4px solid rgba(0,0,0,.08); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.12) rotate(-3deg); } 100% { transform: scale(1); } }

/* flip cards */
.flip { perspective: 900px; min-height: 230px; }
.flip-inner { position: relative; width: 100%; height: 100%; min-height: 230px; transition: transform .5s; transform-style: preserve-3d; }
.flip.on .flip-inner { transform: rotateY(180deg); }
.flip-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 26px; box-shadow: var(--shadow); background: var(--card); padding: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; }
.flip-face.back { transform: rotateY(180deg); background: var(--accent-soft); font-weight: 700; }
.flip-face .e { font-size: 56px; }

/* quiz */
.q-box { text-align: center; padding: 22px 16px; }
.q-emoji { font-size: 64px; line-height: 1.2; letter-spacing: 4px; word-break: break-word; }
.q-text { font-size: 24px; font-weight: 800; margin-top: 6px; }
.answers { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.answer { background: var(--card); border-radius: 22px; min-height: 76px; padding: 10px 14px; font-size: 22px; font-weight: 800; box-shadow: 0 5px 0 var(--line); border: 3px solid var(--line); }
.answer:active { transform: translateY(3px); }
.answer.right { background: #D8F7E6; border-color: var(--ok); }
.answer.wrong { background: #FFE2E2; border-color: var(--bad); animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.timer { font-weight: 800; font-size: 20px; }

/* memory */
.mem-grid { display: grid; gap: 10px; grid-template-columns: repeat(var(--cols, 4), 1fr); max-width: 560px; margin: 0 auto; width: 100%; }
.mem { aspect-ratio: 1; border-radius: 18px; background: var(--accent); box-shadow: 0 5px 0 rgba(0,0,0,.15); font-size: clamp(30px, 9vw, 54px); display: grid; place-items: center; color: transparent; transition: transform .25s, background .2s; }
.mem::before { content: "?"; color: rgba(255,255,255,.85); font-weight: 800; font-family: var(--font); }
.mem.open, .mem.matched { background: var(--card); color: inherit; animation: pop .3s; }
.mem.open::before, .mem.matched::before { content: none; }
.mem.matched { box-shadow: 0 0 0 4px var(--ok); }

/* bubbles */
.pond { position: relative; flex: 1; min-height: 62vh; border-radius: 30px; background: linear-gradient(#C9EBFF, #EAF7FF); overflow: hidden; box-shadow: inset 0 0 0 4px rgba(255,255,255,.6); touch-action: none; }
.bubble { position: absolute; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.95), rgba(255,255,255,.35) 40%, rgba(108,184,255,.35)); border: 2px solid rgba(255,255,255,.9); box-shadow: inset -6px -8px 14px rgba(108,184,255,.4); }
.bubble.burst { animation: burst .25s forwards; }
@keyframes burst { to { transform: scale(1.6); opacity: 0; } }
.score-float { position: absolute; top: 12px; inset-inline-start: 14px; }

/* piano */
.piano { display: flex; gap: 6px; height: 56vh; min-height: 300px; }
.key { flex: 1; border-radius: 0 0 22px 22px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding-bottom: 16px; font-weight: 800; font-size: 20px; color: #fff; box-shadow: 0 8px 0 rgba(0,0,0,.18); transition: transform .06s; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.key.on { transform: translateY(6px); box-shadow: 0 2px 0 rgba(0,0,0,.18); filter: brightness(1.1); }
.key .ke { font-size: 30px; }
.song-bar { display: flex; flex-wrap: wrap; gap: 8px; }

/* draw */
.draw-wrap { position: relative; background: #fff; border-radius: 26px; box-shadow: var(--shadow); overflow: hidden; flex: 1; min-height: 52vh; touch-action: none; }
.draw-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.palette { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dot { width: 40px; height: 40px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 0 0 2px var(--line); }
.dot[aria-pressed="true"] { box-shadow: 0 0 0 4px var(--ink); }
.tool[aria-pressed="true"] { background: var(--accent); color: #fff; }
.trace-letters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.trace-letters button { flex: none; width: 48px; height: 48px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); font-weight: 800; font-size: 24px; }
.trace-letters button[aria-pressed="true"] { background: var(--accent); color: #fff; }

/* story */
.story-page { text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; padding: 20px 16px; min-height: 52vh; justify-content: center; }
.story-scene { font-size: 84px; line-height: 1.15; letter-spacing: 6px; }
.story-text { font-size: 24px; font-weight: 700; max-width: 640px; }
html[lang="ur"] .story-text { font-size: 23px; line-height: 2.3; }
.story-text .w { border-radius: 8px; padding: 0 2px; transition: background .1s; }
.story-text .w.hl { background: var(--sun); color: #3B2416; }
.story-nav { display: flex; gap: 12px; justify-content: center; align-items: center; }

/* code game */
.code-grid { display: grid; gap: 6px; width: min(100%, 420px); margin: 0 auto; grid-template-columns: repeat(var(--n), 1fr); }
.cell { aspect-ratio: 1; border-radius: 12px; background: #E3F4D7; display: grid; place-items: center; font-size: clamp(22px, 7vw, 38px); }
.cell.rock { background: #D9CFC4; }
.cell.trail { background: #FFF1B8; }
.cmds { display: flex; flex-wrap: wrap; gap: 6px; min-height: 58px; background: var(--card); border-radius: 18px; padding: 8px; box-shadow: var(--shadow); align-items: center; direction: ltr; }
.cmd { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); font-size: 24px; display: grid; place-items: center; }
.cmd.run { background: var(--sun); }
.arrows { display: grid; grid-template-columns: repeat(4, 64px); gap: 10px; justify-content: center; direction: ltr; }
.arrows button { height: 64px; border-radius: 18px; background: var(--accent); color: #fff; font-size: 30px; box-shadow: 0 5px 0 rgba(0,0,0,.15); }

/* spell + typing */
.slots { display: flex; gap: 8px; justify-content: center; direction: ltr; flex-wrap: wrap; }
.slot { width: 56px; height: 64px; border-radius: 16px; background: var(--card); border: 3px dashed var(--line); display: grid; place-items: center; font-size: 32px; font-weight: 800; font-family: var(--font); }
.slot.filled { border-style: solid; border-color: var(--accent); }
.tiles { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; direction: ltr; }
.ltile { width: 62px; height: 62px; border-radius: 16px; background: var(--accent); color: #fff; font-size: 32px; font-weight: 800; box-shadow: 0 5px 0 rgba(0,0,0,.15); font-family: var(--font); }
.ltile:disabled { visibility: hidden; }
.type-target { font-family: var(--font); font-size: 40px; font-weight: 800; letter-spacing: 3px; direction: ltr; text-align: center; }
.type-target .ok { color: var(--ok); }
.type-target .cur { text-decoration: underline; text-decoration-thickness: 4px; text-underline-offset: 8px; color: var(--accent); }
.type-input { width: 100%; font-size: 28px; padding: 14px 18px; border-radius: 18px; border: 3px solid var(--line); background: var(--card); text-align: center; direction: ltr; font-family: var(--font); -webkit-user-select: text; user-select: text; }
.type-input:focus { border-color: var(--accent); outline: none; }

/* stickers */
.stickers { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
.sticker { background: var(--card); border-radius: 24px; padding: 14px 10px; text-align: center; box-shadow: var(--shadow); }
.sticker .e { font-size: 54px; line-height: 1.2; }
.sticker.off { filter: grayscale(1); opacity: .45; }
.sticker .n { font-weight: 800; font-size: 16px; }

/* ---------- overlay / modals ---------- */
#overlay:empty { display: none; }
.modal-back { position: fixed; inset: 0; background: rgba(40, 24, 14, .45); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .2s; }
.modal { background: var(--card); color: var(--ink); border-radius: 30px; padding: 22px 18px; width: min(440px, 100%); max-height: 92vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); animation: rise .25s; text-align: center; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(30px) scale(.96); opacity: 0; } }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; direction: ltr; }
.keypad button { height: 58px; border-radius: 18px; background: var(--bg); font-size: 26px; font-weight: 800; font-family: var(--font); box-shadow: 0 4px 0 var(--line); }
.gate-display { font-family: var(--font); font-size: 34px; font-weight: 800; min-height: 52px; letter-spacing: 4px; background: var(--bg); border-radius: 16px; margin-top: 10px; display: grid; place-items: center; direction: ltr; }
.gate-q { font-family: var(--font); font-size: 34px; font-weight: 800; direction: ltr; }
.celebrate .stars-row { font-size: 54px; letter-spacing: 6px; }
.celebrate .stars-row span { display: inline-block; animation: starpop .5s both; }
.celebrate .stars-row span:nth-child(2) { animation-delay: .15s; }
.celebrate .stars-row span:nth-child(3) { animation-delay: .3s; }
@keyframes starpop { from { transform: scale(0) rotate(-90deg); } 70% { transform: scale(1.3); } to { transform: scale(1); } }
.confetti { position: fixed; top: -20px; width: 12px; height: 18px; border-radius: 3px; z-index: 60; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- forms (parent) ---------- */
.form { display: flex; flex-direction: column; gap: 14px; text-align: start; }
.field label { display: block; font-weight: 800; margin-bottom: 4px; }
.field input[type="text"], .field input[type="time"], .field select {
  width: 100%; padding: 12px 14px; border-radius: 16px; border: 2px solid var(--line); background: var(--bg); font-size: 18px; -webkit-user-select: text; user-select: text;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 14px; border-radius: 999px; background: var(--bg); border: 2px solid var(--line); font-weight: 800; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.avatars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.avatars button { font-size: 32px; aspect-ratio: 1; border-radius: 16px; background: var(--bg); border: 3px solid transparent; }
.avatars button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }

.parent { --accent: #FF8A5B; --accent-soft: #FFE3D6; }
.p-section { margin-top: 16px; }
.p-section > h3 { margin: 0 4px 8px; }
.setting { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.setting:last-child { border-bottom: 0; }
.setting .lbl { flex: 1; min-width: 180px; }
.setting .lbl b { display: block; }
.setting .lbl span { font-size: 15px; color: var(--ink-soft); }
.switch { width: 62px; height: 36px; border-radius: 999px; background: var(--line); position: relative; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 4px; inset-inline-start: 4px; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: inset-inline-start .2s; }
.switch[aria-checked="true"] { background: var(--ok); }
.switch[aria-checked="true"]::after { inset-inline-start: 30px; }
.kid-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.kid-row:last-child { border-bottom: 0; }
.kid-row .av { font-size: 40px; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding-top: 10px; direction: ltr; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; font-size: 13px; color: var(--ink-soft); font-weight: 700; }
.bars .b i { display: block; width: 100%; max-width: 34px; border-radius: 8px 8px 4px 4px; background: var(--accent); min-height: 3px; }
.bars .b small { font-size: 12px; color: var(--ink); }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--bg); border-radius: 16px; padding: 10px; text-align: center; }
.stat b { display: block; font-size: 24px; font-family: var(--font); }
.stat span { font-size: 14px; color: var(--ink-soft); font-weight: 700; }

/* sleep screen */
.sleep { min-height: 86vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 16px; }
.sleep .zzz { font-size: 40px; animation: bob 2s infinite; }

@media (min-width: 700px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .tile .e { width: 104px; height: 104px; font-size: 70px; }
}
@media (max-width: 440px) {
  .topbar .lang-toggle > span:not(.flag) { display: none; }
  .topbar .lang-toggle { padding: 0; width: 52px; justify-content: center; }
}
@media (max-width: 380px) {
  .grid, .cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tile { min-height: 140px; }
  .tile .e { width: 76px; height: 76px; font-size: 50px; }
  .arrows { grid-template-columns: repeat(4, 56px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.lang-choice .flag { display: flex; justify-content: center; margin-bottom: 8px; }
.lang-toggle .flag { display: inline-flex; }

/* ===== v1.1: emoji, tiles, levels, games, wardrobe ===== */
.tile .e, .learn-card .e, .q-emoji, .story-scene, .sticker .e, .shop-item .e, .fe, .mem, .bubble, .peek-pop, .simon-pad, .cell, .mz, .acc, .cat .e { font-family: var(--emoji); }
.tile .e { box-shadow: inset 0 -6px 0 rgba(0,0,0,.05); }
.tile .e.urtile { font-family: var(--font-ur); font-size: 40px; color: var(--ink); line-height: 1.6; }
.tile .lvtag { font-size: 12px; background: var(--accent); color: #fff; padding: 0 8px; border-radius: 999px; top: 8px; line-height: 1.8; }
html[lang="ur"] .tile .lvtag { font-family: var(--font-ur); line-height: 2; }
.pre { white-space: pre-line; }
.story-text { white-space: pre-line; }
.story-sub { font-size: 16px; max-width: 600px; }

/* level map */
.level-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 12px; margin-top: 16px; }
.lvl { aspect-ratio: 1; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--font); font-weight: 800; font-size: 22px; border: 3px solid transparent; line-height: 1; }
.lvl.won { background: var(--accent-soft); }
.lvl.current { border-color: var(--accent); animation: pulse 1.4s infinite; }
.lvl.locked { opacity: .45; font-size: 18px; }
.lvl .lst { font-size: 11px; letter-spacing: -1px; margin-top: 3px; }
.lvl .lst i { font-style: normal; color: #D9C9B5; }
.lvl .lst i.on { color: #F5B400; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,138,91,.5); } 50% { box-shadow: 0 0 0 10px rgba(255,138,91,0); } }

/* features row */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 8px; }
.feature { display: flex; align-items: center; gap: 12px; text-align: start; padding: 12px 14px; border-radius: 22px; box-shadow: var(--shadow); color: #fff; }
.feature.daily { background: linear-gradient(135deg, #FF8A5B, #FFB347); }
.feature.daily.done { background: linear-gradient(135deg, #3DBE7A, #6FD3B5); }
.feature.wardrobe { background: linear-gradient(135deg, #7C5CFF, #B48CFF); }
.feature .fe { font-size: 40px; width: 60px; height: 60px; border-radius: 18px; background: rgba(255,255,255,.25); display: grid; place-items: center; flex: none; }
.feature b { font-size: 18px; }
.feature .bonus { font-weight: 800; opacity: .95; }
.mascot-btn { flex: none; border-radius: 26px; }

/* dressed mascot */
.dressed { position: relative; border-radius: 26%; flex: none; }
.dressed .mascot { width: 100%; height: 100%; }
.dressed .acc { position: absolute; line-height: 1; pointer-events: none; }
.dressed .hat { font-size: .38em; top: -.12em; left: 50%; transform: translateX(-50%); }
.dressed .hat.face { font-size: .3em; top: -.02em; left: auto; right: 0; transform: none; }
.dressed .glasses { font-size: .36em; top: .36em; left: 50%; transform: translateX(-50%); }
.dressed .friend { font-size: .3em; bottom: -.04em; right: -.06em; }
.wardrobe-stage { display: grid; place-items: center; padding: 16px 0 6px; }
.shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; margin-top: 6px; }
.shop-item { background: var(--card); border-radius: 22px; padding: 12px 8px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 6px; border: 3px solid transparent; }
.shop-item .e { font-size: 46px; width: 74px; height: 74px; border-radius: 20px; display: grid; place-items: center; background: var(--accent-soft); }
.shop-item .price { font-weight: 800; font-size: 15px; }
.shop-item.on { border-color: var(--ok); }
.shop-item.poor { opacity: .55; }

/* maze */
.maze { display: grid; grid-template-columns: repeat(var(--n), 1fr); width: min(100%, 520px); margin: 0 auto; background: #FFFDF7; border: 4px solid #7A5B47; border-radius: 12px; touch-action: none; overflow: hidden; }
.mz { aspect-ratio: 1; border: 0 solid #7A5B47; display: grid; place-items: center; line-height: 1; }
.mz.me { background: var(--accent-soft); }
.dpad { display: grid; grid-template-columns: repeat(3, 64px); gap: 8px; justify-content: center; direction: ltr; }
.dpad button { height: 60px; border-radius: 18px; background: var(--accent); color: #fff; font-size: 28px; box-shadow: 0 5px 0 rgba(0,0,0,.15); font-family: var(--emoji); }
.dpad button:active { transform: translateY(3px); }

/* catch */
.arena { position: relative; height: 60vh; min-height: 340px; border-radius: 26px; overflow: hidden; background: linear-gradient(#CFEFFF, #F1FAFF 70%, #CDEBB6 70%, #B5DE97); box-shadow: var(--shadow); touch-action: none; cursor: grab; }
.arena canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* word search */
.ws-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; direction: ltr; }
.ws-word { padding: 4px 12px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); font-weight: 800; font-family: var(--font); letter-spacing: 1px; }
.ws-word.found { text-decoration: line-through; opacity: .5; }
.ws-grid { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 3px; width: min(100%, 520px); margin: 0 auto; touch-action: none; direction: ltr; background: var(--card); padding: 8px; border-radius: 18px; box-shadow: var(--shadow); }
.ws-cell { aspect-ratio: 1; display: grid; place-items: center; font-family: var(--font); font-weight: 800; font-size: clamp(14px, 4.6vw, 26px); border-radius: 8px; background: var(--bg); transition: background .1s; }
.ws-cell.sel { background: var(--sun) !important; transform: scale(1.06); }
.ws-cell.found { color: #3B2416; }

/* peekaboo */
.peek-grid { display: grid; gap: 14px; max-width: 520px; width: 100%; margin: 10px auto 0; }
.peek-hole { aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 50% 70%, #6B4A33 0 38%, #8C6446 39% 52%, #9BD77A 53%); position: relative; overflow: hidden; box-shadow: var(--shadow); }
.peek-pop { position: absolute; left: 10%; right: 10%; bottom: -80%; height: 80%; font-size: clamp(40px, 13vw, 72px); transition: bottom .18s ease-out; display: grid; place-items: center; }
.peek-hole.up .peek-pop { bottom: 18%; }

/* simon */
.simon { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 440px; width: 100%; margin: 0 auto; }
.simon-pad { aspect-ratio: 1; border-radius: 30px; font-size: clamp(48px, 15vw, 80px); box-shadow: 0 8px 0 rgba(0,0,0,.18); opacity: .78; transition: transform .08s, opacity .1s, filter .1s; }
.simon-pad.lit { opacity: 1; filter: brightness(1.25) saturate(1.2); transform: scale(1.05); box-shadow: 0 0 0 6px #fff, 0 0 30px rgba(255,255,255,.9); }
.simon-dots { display: flex; gap: 5px; flex-wrap: wrap; }
.simon-dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--line); }
.simon-dots i.on { background: var(--ok); }

/* sudoku */
.sdk { display: grid; grid-template-columns: repeat(var(--n), 1fr); width: min(100%, 420px); margin: 0 auto; border: 4px solid var(--ink); border-radius: 14px; overflow: hidden; background: var(--card); direction: ltr; }
.sdk-c { aspect-ratio: 1; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: clamp(20px, 7vw, 36px); font-family: var(--font), var(--emoji); font-weight: 800; color: var(--accent); }
.sdk-c.given { color: var(--ink); background: #FBF5EC; }
.sdk-c.br { border-right: 3px solid var(--ink); }
.sdk-c.bb { border-bottom: 3px solid var(--ink); }
.sdk-c.sel { background: var(--accent-soft); box-shadow: inset 0 0 0 3px var(--accent); }
.sdk-c.bad { background: #FFE2E2; color: var(--bad); }
.sdk-pad { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; direction: ltr; }
.sdk-pad button { width: 58px; height: 58px; border-radius: 16px; background: var(--card); box-shadow: 0 5px 0 var(--line); font-size: 28px; font-weight: 800; font-family: var(--font), var(--emoji); }

/* urdu build */
.build-joined { font-size: 46px; min-height: 80px; color: var(--accent); margin: 4px 0 10px; }
.build-joined.done { color: var(--ok); animation: pop .5s; }
.slot.ur, .ltile.ur { font-family: var(--font-ur); line-height: 1.9; }
.ltile.ur { font-size: 30px; }
.type-target { word-break: break-word; }
.type-target { font-size: clamp(22px, 6.5vw, 40px); }
.voice-sel { flex: 1; min-width: 180px; padding: 10px 12px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg); font-size: 15px; }
