/* Easa & Musa World — styles */
:root {
  --ink: #23264a;
  --ink-soft: #5b5f8a;
  --paper: #ffffff;
  --sky1: #6fd3ff;
  --sky2: #b9ecff;
  --grass: #63d17a;
  --pink: #ff2fa8;
  --cyan: #18d6ff;
  --yellow: #ffd23f;
  --red: #ff4d5e;
  --green: #3ccf6e;
  --blue: #3d8bff;
  --purple: #a35cff;
  --radius: 26px;
  --shadow: 0 8px 0 rgba(0, 0, 0, .12), 0 14px 30px rgba(20, 30, 80, .18);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: 'Baloo 2', 'Avenir Next', system-ui, sans-serif;
  --font-ur: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', 'Geeza Pro', serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  font-family: var(--font); color: var(--ink);
  background: #1a1446;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
  touch-action: manipulation;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
button:disabled { opacity: .35; }
img { -webkit-user-drag: none; }
.ur { font-family: var(--font-ur); direction: rtl; unicode-bidi: isolate; }
.hidden-input { display: none; }

#app {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  padding-top: var(--safe-t);
}

/* ------------------------------------------------------------ buttons */
.btn-round {
  width: 54px; height: 54px; border-radius: 50%;
  background: #fff; box-shadow: 0 5px 0 rgba(0,0,0,.15);
  font-size: 24px; font-weight: 800; display: grid; place-items: center;
  flex: none; position: relative; transition: transform .1s;
}
.btn-round.small { width: 40px; height: 40px; font-size: 16px; }
.btn-round:active, .btn-round.touching { transform: translateY(3px) scale(.96); box-shadow: 0 2px 0 rgba(0,0,0,.15); }
.btn-pill {
  padding: 10px 20px; border-radius: 999px; background: #fff; font-weight: 800; font-size: 18px;
  box-shadow: 0 5px 0 rgba(0,0,0,.14); transition: transform .1s;
}
.btn-pill.small { font-size: 14px; padding: 8px 14px; }
.btn-pill.hot { background: linear-gradient(135deg, #ff9a3c, #ff4d5e); color: #fff; }
.btn-pill.danger { background: #ffe1e4; color: #c9184a; }
.btn-pill:active, .btn-pill.touching { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.14); }
.btn-pill.dim { background: rgba(255,255,255,.12); color: #cdd3ff; box-shadow: none; }
.btn-pill.dim.on { background: rgba(255,255,255,.3); color: #fff; }
.btn-next {
  display: block; margin: 18px auto 0; padding: 14px 34px; border-radius: 999px;
  background: linear-gradient(135deg, #3ccf6e, #20a35a); color: #fff; font-size: 26px; font-weight: 800;
  box-shadow: 0 6px 0 #16793f; animation: pulse 1.4s infinite;
}
.link { color: var(--ink-soft); text-decoration: underline; font-size: 16px; padding: 10px; }

/* hold-to-exit ring for the baby */
.back.hold .hold-ring { position: absolute; inset: -5px; border-radius: 50%; border: 5px solid transparent; }
.back.hold.holding .hold-ring, .btn-round.holding { animation: holdring .9s linear forwards; }
@keyframes holdring { from { box-shadow: 0 0 0 0 rgba(255,47,168,.0); } to { box-shadow: 0 0 0 10px rgba(255,47,168,.7); } }

/* ------------------------------------------------------------ top bar */
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  position: relative; z-index: 5;
}
.tb-title { flex: 1; font-size: 24px; text-shadow: 0 2px 6px rgba(0,0,0,.35); font-weight: 800; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.18); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.star-count {
  background: #fff; border-radius: 999px; padding: 6px 16px; font-size: 20px; font-weight: 800;
  box-shadow: 0 5px 0 rgba(0,0,0,.14); white-space: nowrap;
}
.star-count.bump { animation: bump .4s; }

/* ------------------------------------------------------------ picker */
.picker {
  background: radial-gradient(ellipse at 50% 0%, #4b1d8f 0%, #1a1446 55%, #0b0a26 100%);
  color: #fff; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.stars-bg {
  position: fixed; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(2px 2px at 20% 30%, #fff, transparent), radial-gradient(2px 2px at 70% 20%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 40% 70%, #fff, transparent), radial-gradient(2px 2px at 85% 60%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 10% 85%, #fff, transparent), radial-gradient(1px 1px at 55% 45%, #fff, transparent),
    linear-gradient(transparent 70%, rgba(255,47,168,.25));
  animation: twinkleBg 4s ease-in-out infinite alternate;
}
.stars-bg::after { /* retro grid floor */
  content: ''; position: absolute; left: -50%; right: -50%; bottom: 0; height: 38%;
  background:
    repeating-linear-gradient(90deg, rgba(24,214,255,.35) 0 2px, transparent 2px 60px),
    repeating-linear-gradient(0deg, rgba(255,47,168,.35) 0 2px, transparent 2px 40px);
  transform: perspective(300px) rotateX(60deg); transform-origin: bottom;
  mask-image: linear-gradient(transparent, #000 60%);
  -webkit-mask-image: linear-gradient(transparent, #000 60%);
}
.picker-inner { position: relative; min-height: 100%; display: flex; flex-direction: column; align-items: center; padding: 28px 16px calc(28px + var(--safe-b)); gap: 10px; }
.logo { margin: 8px 0 0; text-align: center; line-height: .9; }
.logo .l1 {
  display: block; font-size: clamp(42px, 10vw, 76px); font-weight: 800; letter-spacing: -1px;
  color: #fff; text-shadow: 0 0 6px var(--cyan), 0 0 18px var(--cyan), 0 0 40px #0086ff;
  font-style: italic;
}
.logo .l2 {
  display: block; font-size: clamp(34px, 8vw, 60px); font-weight: 800; color: #fff; font-style: italic;
  text-shadow: 0 0 6px var(--pink), 0 0 18px var(--pink), 0 0 40px #ff00a0;
  transform: rotate(-4deg); margin-top: 4px;
}
.picker-q { font-size: 22px; font-weight: 700; margin: 10px 0 6px; opacity: .95; }
.picker-q .ur { font-size: 18px; margin-inline-start: 8px; }
.profile-row { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; width: 100%; max-width: 760px; }
.profile-card {
  flex: 1 1 260px; max-width: 340px; border-radius: 30px; padding: 16px 16px 18px; color: #fff;
  background: linear-gradient(160deg, rgba(255,255,255,.14), rgba(255,255,255,.04));
  border: 2px solid rgba(255,255,255,.18);
  box-shadow: 0 0 0 3px rgba(24,214,255,.0), 0 20px 50px rgba(0,0,0,.4);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: transform .2s; animation: floaty 4s ease-in-out infinite;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.profile-card.musa { animation-delay: -2s; }
.profile-card:active, .profile-card.touching { transform: scale(.96); }
.profile-card.chosen { transform: scale(1.08); transition: transform .3s cubic-bezier(.3,1.6,.5,1); }
.pc-photo {
  width: 190px; height: 190px; border-radius: 50%; overflow: hidden; padding: 6px;
  background: conic-gradient(from 0deg, var(--cyan), var(--pink), var(--yellow), var(--cyan));
  animation: spinring 6s linear infinite; position: relative;
}
.pc-photo img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; animation: spinring 6s linear infinite reverse; border: 4px solid #1a1446; }
.pc-info { display: flex; flex-direction: column; align-items: center; }
.pc-neon { font-size: 22px; font-weight: 800; font-style: italic; margin-top: 10px; color: #fff; text-shadow: 0 0 6px var(--pink), 0 0 16px var(--pink); }
.easa .pc-neon { text-shadow: 0 0 6px var(--cyan), 0 0 16px var(--cyan); }
.pc-name { font-size: 46px; font-weight: 800; line-height: 1; }
.pc-name-ur { font-size: 26px; line-height: 1.9; }
.pc-sub { font-size: 15px; opacity: .8; }
.parents-link { margin-top: 16px; color: #cfd2ff; background: rgba(255,255,255,.1); padding: 10px 20px; border-radius: 999px; font-weight: 700; }

/* ------------------------------------------------------------ home */
.home { overflow: hidden; }
.home-kid { background: linear-gradient(180deg, var(--sky1) 0%, var(--sky2) 60%, #d8f6ff 100%); }
.home-baby { background: linear-gradient(180deg, #ffd6ec 0%, #e5dcff 55%, #d6f1ff 100%); }
.scenery { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.sun { position: absolute; top: 60px; right: 8%; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, #fff6a8, #ffd23f 60%); box-shadow: 0 0 60px #ffe066; animation: sunpulse 5s ease-in-out infinite; }
.cloud { position: absolute; width: 140px; height: 46px; background: #fff; border-radius: 40px; opacity: .9; animation: drift 40s linear infinite; }
.cloud::before, .cloud::after { content: ''; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 64px; height: 64px; top: -32px; left: 20px; }
.cloud::after { width: 48px; height: 48px; top: -22px; left: 70px; }
.cloud.c1 { top: 18%; animation-duration: 55s; }
.cloud.c2 { top: 42%; animation-duration: 70s; animation-delay: -30s; transform: scale(.7); }
.cloud.c3 { top: 8%; animation-duration: 45s; animation-delay: -15s; transform: scale(.5); }
.fly-plane { position: absolute; top: 26%; font-size: 44px; animation: flyacross 18s linear infinite; }
.hills { position: absolute; bottom: 60px; left: -10%; right: -10%; height: 140px; background: radial-gradient(ellipse at 25% 100%, #7fdc8f 60%, transparent 61%), radial-gradient(ellipse at 75% 100%, #63d17a 55%, transparent 56%); }
.road { position: absolute; bottom: 0; left: 0; right: 0; height: 64px; background: #4a4f63; border-top: 6px solid #fff; padding-bottom: var(--safe-b); }
.road::after { content: ''; position: absolute; left: 0; right: 0; top: 26px; height: 6px; background: repeating-linear-gradient(90deg, #ffe066 0 40px, transparent 40px 80px); animation: roadmove 1s linear infinite; }
.drive-car { position: absolute; bottom: 8px; font-size: 42px; transform: scaleX(-1); animation: drive 12s linear infinite; z-index: 1; }
.drive-car.c2 { animation-duration: 17s; animation-delay: -8s; }
.home-baby .road, .home-baby .hills, .home-baby .fly-plane { display: none; }

.home-head { position: relative; z-index: 2; display: flex; align-items: center; gap: 14px; padding: 12px 16px 6px; }
.avatar { border-radius: 50%; padding: 4px; background: conic-gradient(var(--ring, var(--blue)), var(--pink), var(--yellow), var(--ring, var(--blue))); box-shadow: 0 6px 0 rgba(0,0,0,.12); flex: none; }
.avatar img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid #fff; }
.avatar.lg { width: 84px; height: 84px; }
.avatar.md { width: 64px; height: 64px; }
.greet { flex: 1; min-width: 0; }
.greet-hi { font-size: 30px; font-weight: 800; line-height: 1; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.15); }
.home-baby .greet-hi { color: #7a3fd0; text-shadow: none; }
.greet-ur { font-size: 16px; color: #24407a; line-height: 2; }
.home-actions { display: flex; align-items: center; gap: 8px; }
.sticker-btn { font-size: 18px; }
.home-body {
  position: relative; z-index: 2; flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 4px 16px calc(90px + var(--safe-b));
}
.home-sec h2 { margin: 14px 4px 8px; font-size: 24px; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.18); display: flex; align-items: baseline; gap: 10px; }
.home-sec h2 .ur { font-size: 16px; color: #1d3a73; text-shadow: none; opacity: .8; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.tile {
  position: relative; border-radius: var(--radius); padding: 14px 10px 12px; color: #fff; min-height: 150px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  box-shadow: var(--shadow); transition: transform .15s; overflow: hidden;
}
.tile::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 30% 15%, rgba(255,255,255,.45), transparent 50%); pointer-events: none; }
.tile.touching { transform: scale(.95); }
.tile.pressed { animation: pressed .25s; }
.tile-icon { font-size: 58px; line-height: 1.1; filter: drop-shadow(0 4px 0 rgba(0,0,0,.15)); }
.tile-icon.glyph { font-weight: 800; font-size: 50px; background: rgba(255,255,255,.25); border-radius: 18px; padding: 0 14px; }
.tile-icon.glyph.ur { font-size: 38px; line-height: 1.9; padding: 0 14px; }
.char-icon { width: 76px; height: 76px; }
.char-icon .char { width: 100%; height: 100%; }
.tile-title { font-weight: 800; font-size: 19px; line-height: 1.1; text-align: center; text-shadow: 0 2px 0 rgba(0,0,0,.18); }
.tile-ur { font-size: 13px; opacity: .95; line-height: 1.8; }
.tile-badge { position: absolute; top: 8px; right: 10px; font-size: 13px; color: #fff6a8; letter-spacing: 1px; }
.tiles .tile:nth-child(odd) { animation: tilein .5s backwards; }
.tiles .tile:nth-child(even) { animation: tilein .5s .08s backwards; }
.tile-baby { min-height: 170px; border-radius: 40px; }
.tile-baby .tile-icon { font-size: 80px; }
.tile-baby .char-icon { width: 100px; height: 100px; }
.home-baby .tiles { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px; }

/* ------------------------------------------------------------ game screen */
.game { background: linear-gradient(180deg, #7c5cff 0%, #5a8bff 100%); }
.game.baby { background: linear-gradient(180deg, #ffb6e1 0%, #b8a6ff 100%); }
.game-race, .game-sky { background: #2a2f55; }
.game-stories, .game-nightlight { background: #0b1033; }
.game-gogo { background: linear-gradient(180deg, #7ad0ff 0%, #a8e6a1 100%); }
.game-buddies { background: linear-gradient(180deg, #ffcf3f 0%, #ff9f1c 100%); }
.game-sheep { background: linear-gradient(180deg, #74c8ff 0%, #c1ecff 100%); }
.game-urdu { background: linear-gradient(180deg, #19b38a 0%, #0e8f86 100%); }
.game-phonics { background: linear-gradient(180deg, #4facfe 0%, #3f5efb 100%); }
.game-counting { background: linear-gradient(180deg, #ff9a3c 0%, #ff5e62 100%); }
.game-math { background: linear-gradient(180deg, #a35cff 0%, #6a3df0 100%); }
.game-shapes { background: linear-gradient(180deg, #ff7ac0 0%, #e83e8c 100%); }
.game-music { background: linear-gradient(180deg, #2b1a5e 0%, #5b2a86 100%); }
.game-animals { background: linear-gradient(180deg, #ffd27a 0%, #ff9f7a 100%); }
.game-vroom { background: #9fe3ff; }
.stage {
  position: relative; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  padding: 6px 16px calc(16px + var(--safe-b));
  display: flex; flex-direction: column; align-items: stretch;
}
.game-race .stage, .game-sky .stage, .game-magic .stage, .game-bubbles .stage, .game-peekaboo .stage, .game-nightlight .stage, .game-vroom .stage { padding: 0; overflow: hidden; }
.loading { flex: 1; display: grid; place-items: center; }
.spinner { width: 60px; height: 60px; border-radius: 50%; border: 8px solid rgba(255,255,255,.3); border-top-color: #fff; animation: spin 1s linear infinite; }
.error { color: #fff; text-align: center; padding: 40px; font-size: 20px; }

.game-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.tabs { display: flex; gap: 6px; background: rgba(0,0,0,.15); padding: 5px; border-radius: 999px; overflow-x: auto; max-width: 100%; }
.tab { padding: 8px 16px; border-radius: 999px; color: #fff; font-weight: 800; font-size: 17px; white-space: nowrap; }
.tab.on { background: #fff; color: var(--ink); box-shadow: 0 3px 0 rgba(0,0,0,.15); }
.lang-toggle { display: flex; gap: 4px; background: rgba(0,0,0,.15); padding: 4px; border-radius: 999px; }
.lt { padding: 4px 12px; border-radius: 999px; color: #fff; font-weight: 700; font-size: 15px; }
.lt.ur { font-size: 14px; line-height: 2; padding: 0 12px; }
.lt.on { background: #fff; color: var(--ink); }

.prompt {
  align-self: center; background: #fff; border-radius: 22px; padding: 10px 24px; font-size: 26px; font-weight: 800;
  box-shadow: 0 6px 0 rgba(0,0,0,.14); margin: 6px auto 12px; text-align: center; max-width: 100%;
}
.prompt .ur { font-size: 22px; line-height: 2.1; }
.prompt.clickable:active { transform: scale(.97); }
.hint { color: #fff; text-align: center; font-weight: 700; opacity: .85; }

.answers { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.answers.locked { pointer-events: none; }
.answer {
  min-width: 110px; min-height: 110px; border-radius: 28px; background: #fff; box-shadow: 0 8px 0 rgba(0,0,0,.15);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 14px;
  transition: transform .12s;
}
.answer:active { transform: translateY(4px); box-shadow: 0 4px 0 rgba(0,0,0,.15); }
.answer.num b { font-size: 54px; line-height: 1; color: var(--ink); }
.answer.num .ur { font-size: 22px; line-height: 1.6; color: var(--ink-soft); }
.answer.num small { font-size: 15px; color: var(--ink-soft); }
.answer.right { background: #d9ffe6; box-shadow: 0 0 0 6px var(--green), 0 8px 0 rgba(0,0,0,.15); animation: bump .4s; }
.big-letters .answer { font-size: 64px; min-width: 120px; min-height: 130px; line-height: 1.6; }
.answers.pics .answer { min-width: 130px; }
.answer.pic .emo { font-size: 72px; line-height: 1.1; }
.answer.pic small { font-size: 18px; font-weight: 700; }

/* ------------------------------------------------------------ counting */
.count-body, .qaida-body, .math-body, .shapes-body, .buddies-body, .music-body, .animals-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.count-big { text-align: center; font-size: 96px; font-weight: 800; color: #fff; line-height: 1; min-height: 100px; text-shadow: 0 6px 0 rgba(0,0,0,.18); }
.count-big small { font-size: 36px; margin: 0 6px; }
.count-big .ur { font-size: 48px; }
.count-big.bump { animation: bump .35s; }
.count-field { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; align-content: center; padding: 10px; flex: 1; }
.count-obj {
  position: relative; width: 96px; height: 96px; font-size: 62px; border-radius: 26px; background: rgba(255,255,255,.9);
  display: grid; place-items: center; box-shadow: 0 6px 0 rgba(0,0,0,.14);
}
.count-field.small .count-obj { width: 76px; height: 76px; font-size: 48px; }
.count-obj.done { background: #fff6c2; transform: scale(1.06); animation: bump .3s; }
.count-badge { position: absolute; top: -10px; right: -10px; width: 38px; height: 38px; border-radius: 50%; background: var(--red); color: #fff; font-size: 22px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 3px 0 rgba(0,0,0,.2); }
.num-show { background: #fff; border-radius: 28px; padding: 12px; text-align: center; min-height: 170px; box-shadow: var(--shadow); margin-bottom: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ns-hint { font-size: 24px; font-weight: 700; color: var(--ink-soft); }
.ns-num { font-size: 84px; font-weight: 800; line-height: 1; animation: bump .35s; }
.ns-row { display: flex; gap: 22px; align-items: baseline; font-size: 28px; font-weight: 700; }
.ns-ur { font-size: 26px; line-height: 2; }
.ns-dots { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 320px; }
.ns-dots i { width: 18px; height: 18px; border-radius: 50%; background: var(--yellow); box-shadow: inset 0 -3px 0 rgba(0,0,0,.15); }
.num-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; }
.num-card { aspect-ratio: 1; border-radius: 22px; background: hsl(var(--hue) 85% 62%); color: #fff; box-shadow: 0 6px 0 hsl(var(--hue) 60% 42%); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.num-card b { font-size: 38px; }
.num-card .ur { font-size: 18px; line-height: 1.6; }
.num-card:active { transform: translateY(4px); box-shadow: 0 2px 0 hsl(var(--hue) 60% 42%); }

/* ------------------------------------------------------------ letters */
.letter-card {
  background: #fff; border-radius: 30px; box-shadow: var(--shadow); padding: 12px; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 260px;
}
.arrow { width: 50px; height: 80px; border-radius: 18px; background: #eef1ff; font-size: 22px; flex: none; }
.lc-main { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.lc-glyph { font-size: 120px; line-height: 1.5; font-weight: 800; color: var(--ink); animation: popin .4s; }
.lc-glyph.ur { font-size: 100px; line-height: 1.6; color: #0e8f86; }
.lc-glyph.en { line-height: 1.1; color: #3f5efb; }
.lc-glyph .lower { font-size: 90px; margin-left: 12px; color: #ff6fb5; }
.lc-name { font-size: 28px; line-height: 2; color: var(--ink-soft); }
.lc-pic { display: flex; align-items: center; gap: 14px; background: #fff6d6; padding: 6px 20px; border-radius: 20px; }
.lc-emoji { font-size: 54px; }
.lc-word { font-size: 34px; font-weight: 800; }
.lc-word.ur { line-height: 2; font-weight: 400; }
.lc-pic small { color: var(--ink-soft); font-size: 15px; }
.hl { color: var(--red); }
.sound-chip { background: #e7ecff; color: #3f5efb; font-weight: 800; font-size: 22px; padding: 4px 16px; border-radius: 999px; }
.letter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 8px; }
.lg-cell {
  aspect-ratio: 1; border-radius: 18px; background: hsl(var(--hue) 80% 96%); color: hsl(var(--hue) 60% 38%);
  font-size: 32px; font-weight: 800; box-shadow: 0 4px 0 hsl(var(--hue) 50% 80%);
}
.lg-cell.ur { font-size: 28px; line-height: 1; padding-bottom: 10px; }
.lg-cell.on { background: var(--yellow); color: var(--ink); box-shadow: 0 0 0 4px #fff, 0 4px 0 #d4a600; }
.tracer { position: relative; flex: 1; min-height: 300px; background: rgba(255,255,255,.18); border-radius: 30px; border: 4px dashed rgba(255,255,255,.5); }
.tracer canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.row-btns { display: flex; gap: 10px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.row-btns.left { justify-content: flex-start; }

/* ------------------------------------------------------------ math */
.m-eq { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; background: rgba(255,255,255,.18); border-radius: 30px; padding: 16px; }
.m-group { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; max-width: 220px; background: #fff; border-radius: 22px; padding: 10px; font-size: 44px; box-shadow: 0 6px 0 rgba(0,0,0,.12); min-height: 70px; }
.m-op { font-size: 54px; font-weight: 800; color: #fff; text-shadow: 0 4px 0 rgba(0,0,0,.2); }
.m-q { width: 90px; height: 90px; border-radius: 24px; background: var(--yellow); display: grid; place-items: center; font-size: 56px; font-weight: 800; box-shadow: 0 6px 0 #c9a100; }
.away-group { max-width: 420px; margin: 0 auto; font-size: 56px; }
.fly-away { animation: flyaway 1s forwards; }
.m-vs { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; flex: 1; }
.m-choice { border-radius: 30px; padding: 6px; transition: transform .15s; }
.m-choice .m-group { min-width: 140px; min-height: 140px; align-content: center; }
.m-choice.right { box-shadow: 0 0 0 6px var(--green); animation: bump .4s; }

/* ------------------------------------------------------------ shapes */
.shape-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 520px; width: 100%; margin: 0 auto; }
.shape-grid.locked { pointer-events: none; }
.shape-btn, .color-btn { aspect-ratio: 1.2; border-radius: 30px; background: #fff; box-shadow: var(--shadow); display: grid; place-items: center; padding: 14px; }
.shape-svg { width: 80%; height: 80%; }
.shape-btn.right, .color-btn.right { box-shadow: 0 0 0 6px var(--green), var(--shadow); animation: bump .4s; }
.color-btn { background: var(--c); }
.color-thing { font-size: 64px; filter: drop-shadow(0 4px 0 rgba(0,0,0,.2)); }
.paint-canvas { background: #fff; border-radius: 30px; box-shadow: var(--shadow); padding: 10px; max-width: 640px; width: 100%; margin: 0 auto; }
.paint-svg { width: 100%; height: auto; display: block; }
.paint-svg [data-fill] { transition: fill .25s; cursor: pointer; }
.palette { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 16px 0; }
.crayon { width: 56px; height: 56px; border-radius: 50%; background: var(--c); box-shadow: 0 5px 0 rgba(0,0,0,.2); border: 4px solid #fff; transition: transform .15s; }
.crayon.on { transform: scale(1.25) translateY(-6px); box-shadow: 0 0 0 4px var(--ink), 0 5px 0 rgba(0,0,0,.2); }
.shapes-body > .btn-pill { align-self: center; }

/* ------------------------------------------------------------ canvas games */
.game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
.race-hud { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background: #fff; border-radius: 24px; padding: 6px 18px; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow); pointer-events: none; }
.rh-label { font-weight: 800; font-size: 18px; color: var(--ink-soft); }
.rh-num { font-size: 42px; font-weight: 800; line-height: 1; color: var(--red); min-width: 40px; text-align: center; }
.rh-progress { display: flex; gap: 3px; }
.rh-progress i { width: 10px; height: 10px; border-radius: 50%; background: #dde1f4; }
.rh-progress i.on { background: var(--green); }
.race-hint { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.55); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 700; white-space: nowrap; pointer-events: none; transition: opacity .5s; }
.race-hint.hide { opacity: 0; }
.sky-hud { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
.sky-hud > * { pointer-events: auto; }
.sky-sets { display: flex; gap: 6px; background: rgba(255,255,255,.4); padding: 4px; border-radius: 999px; }
.chip { padding: 6px 14px; border-radius: 999px; font-weight: 800; color: var(--ink); }
.chip.ur { line-height: 1.8; padding: 0 14px; }
.chip.on { background: #fff; box-shadow: 0 3px 0 rgba(0,0,0,.12); }
.sky-target { background: #fff; border-radius: 22px; padding: 4px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; line-height: 1; }
.sky-target small { font-weight: 700; color: var(--ink-soft); }
.sky-target b { font-size: 44px; color: var(--red); }
.sky-target.ur b { font-weight: 400; line-height: 1.8; font-size: 36px; }

/* ------------------------------------------------------------ gogo */
.gogo-scene { position: relative; flex: 1; min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.swamp { position: absolute; bottom: 0; left: -16px; right: -16px; height: 35%; background: radial-gradient(ellipse at 50% 0%, #6aa84f, #3e7a2c); border-radius: 50% 50% 0 0 / 30% 30% 0 0; }
.gogo { position: relative; width: min(300px, 60vw); z-index: 1; margin-bottom: 10px; }
.gogo .char { width: 100%; height: auto; display: block; transform-origin: 50% 90%; }
.gogo.hungry .char { animation: sway 2s ease-in-out infinite; }
.gogo.chomp .mouth { animation: chomp .4s; transform-origin: 110px 150px; }
.gogo.happy .char { animation: dance .5s ease-in-out 4; }
.gogo.full .char { animation: wobble .6s 2; }
.speech-bubble { position: relative; z-index: 2; background: #fff; border-radius: 24px; padding: 10px 20px; font-size: 24px; font-weight: 800; box-shadow: var(--shadow); margin-bottom: 8px; text-align: center; }
.speech-bubble::after { content: ''; position: absolute; bottom: -14px; left: 50%; margin-left: -12px; border: 12px solid transparent; border-top-color: #fff; border-bottom: 0; }
.speech-bubble .ur { font-size: 22px; line-height: 2; }
.want-num { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--red); color: #fff; font-size: 28px; vertical-align: middle; }
.gogo-count { position: absolute; z-index: 2; right: 6%; top: 30%; font-size: 80px; font-weight: 800; color: #fff; text-shadow: 0 6px 0 rgba(0,0,0,.2); }
.gogo-count.bump { animation: bump .35s; }
.gogo-plate { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; background: #fff; border-radius: 40px; padding: 14px; box-shadow: var(--shadow); margin-top: 10px; min-height: 100px; }
.food { width: 74px; height: 74px; font-size: 54px; display: grid; place-items: center; cursor: grab; position: relative; z-index: 3; }
.food .char { width: 64px; height: 64px; }
.food.dragging { z-index: 10; filter: drop-shadow(0 10px 10px rgba(0,0,0,.3)); }
.food.eaten { pointer-events: none; }

/* ------------------------------------------------------------ buddies */
.holes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 10px; max-width: 560px; width: 100%; margin: 10px auto; flex: 1; align-content: center; }
.hole { position: relative; height: 160px; overflow: hidden; }
.hole::before { content: ''; position: absolute; bottom: 4px; left: 6%; right: 6%; height: 38px; border-radius: 50%; background: #7a4a12; box-shadow: inset 0 8px 0 #4d2c06; }
.buddy-slot { position: absolute; left: 50%; bottom: -130px; width: 92px; margin-left: -46px; transition: bottom .25s cubic-bezier(.3,1.5,.6,1); }
.buddy-slot .char { width: 100%; height: auto; display: block; }
.hole.up .buddy-slot { bottom: 14px; }
.hole.bonk .buddy-slot { animation: squash .35s; }
.hole.nope .buddy-slot { animation: wobble .4s; }
.hole-front { position: absolute; bottom: 0; left: 0; right: 0; height: 26px; background: linear-gradient(#9c6420, #7a4a12); border-radius: 0 0 50% 50% / 0 0 100% 100%; z-index: 2; pointer-events: none; }
.hat-dot { display: inline-block; width: 26px; height: 26px; border-radius: 50%; background: var(--c); vertical-align: middle; margin: 0 6px; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--c); }
.mini-stars { text-align: center; font-size: 34px; letter-spacing: 4px; color: #fff; }
.dance-floor { flex: 1; display: flex; justify-content: center; align-items: flex-end; gap: 10px; padding-bottom: 20px; position: relative; z-index: 1; min-height: 260px; }
.dancer { width: 22%; max-width: 130px; }
.dancer .char { width: 100%; height: auto; display: block; }
.party .dancer { animation: dance .5s ease-in-out infinite alternate; }
.party .dancer:nth-child(even) { animation-direction: alternate-reverse; }
.dancer.jump { animation: bigjump .6s !important; }
.disco-lights { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 20% 20%, hsla(var(--h, 0), 100%, 70%, .5), transparent 40%), radial-gradient(circle at 80% 30%, hsla(calc(var(--h, 0) + 120), 100%, 70%, .5), transparent 40%); transition: background .3s; }

/* ------------------------------------------------------------ sheep */
.sheep-field { position: relative; flex: 1; min-height: 360px; border-radius: 30px; overflow: hidden; background: linear-gradient(180deg, #8ad3ff 0 55%, #6fd27f 55%); box-shadow: var(--shadow); cursor: pointer; }
.sheep-sun { position: absolute; top: 20px; right: 30px; width: 70px; height: 70px; border-radius: 50%; background: #ffe066; box-shadow: 0 0 40px #ffe066; }
.fence { position: absolute; left: 50%; bottom: 30%; transform: translateX(-50%); display: flex; gap: 14px; }
.fence::before, .fence::after { content: ''; position: absolute; left: -10px; right: -10px; height: 12px; background: #b07636; border-radius: 6px; }
.fence::before { top: 20px; } .fence::after { top: 50px; }
.fence i { width: 14px; height: 90px; background: #c88a44; border-radius: 6px 6px 0 0; }
.sheep-count { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); font-size: 90px; font-weight: 800; color: #fff; text-shadow: 0 6px 0 rgba(0,0,0,.2); }
.sheep-count.bump { animation: bumpx .35s; }
.sheep-actor { position: absolute; left: 12%; bottom: 22%; width: 150px; }
.sheep-actor .char, .flock-sheep .char, .nl-sheep .char { width: 100%; height: auto; display: block; }
.sheep-actor.jumping { animation: sheepjump .9s ease-in-out; }
.flock { position: absolute; right: 8px; bottom: 6px; left: 55%; display: flex; flex-wrap: wrap-reverse; gap: 2px; justify-content: flex-end; }
.flock-sheep { width: 54px; }

/* ------------------------------------------------------------ music */
.xylo { display: flex; gap: 8px; justify-content: center; align-items: center; flex: 1; min-height: 280px; padding: 10px 0; }
.xkey {
  flex: 1; max-width: 90px; height: calc(min(320px, 52vh) - var(--i) * 12px); border-radius: 20px; background: var(--c);
  box-shadow: inset 0 -10px 0 rgba(0,0,0,.18), 0 8px 0 rgba(0,0,0,.25); display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: 14px 0; color: #fff; font-weight: 800; position: relative;
}
.xkey::before, .xkey::after { content: ''; width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,.7); position: absolute; left: 50%; margin-left: -6px; }
.xkey::before { top: 8px; } .xkey::after { bottom: 14px; }
.xa { font-size: 32px; margin-top: 14px; }
.xn { font-size: 22px; margin-bottom: 22px; }
.xkey.hit { animation: keyhit .3s; }
.xkey.next { box-shadow: 0 0 0 5px #fff, 0 0 30px 10px #fff, inset 0 -10px 0 rgba(0,0,0,.18); animation: glow 0.8s infinite alternate; }
.pads { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 520px; width: 100%; margin: auto; }
.pad { aspect-ratio: 1; border-radius: 28px; background: var(--c); font-size: 54px; box-shadow: inset 0 -10px 0 rgba(0,0,0,.2), 0 0 24px var(--c); }
.pad.hit { animation: padhit .25s; }
.song-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.song-card { background: #fff; border-radius: 26px; padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; box-shadow: var(--shadow); }
.song-emoji { font-size: 54px; }
.song-title { font-weight: 800; font-size: 20px; text-align: center; }
.song-btns { display: flex; gap: 8px; }
.song-progress { height: 14px; background: rgba(255,255,255,.2); border-radius: 999px; overflow: hidden; margin: 0 10px; }
.song-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--yellow), var(--pink)); transition: width .2s; }
.music-body > .btn-pill { align-self: center; }

/* ------------------------------------------------------------ animals & vroom */
.animal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
.animal-grid.baby { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.animal-grid.quiz { grid-template-columns: repeat(2, 1fr); max-width: 480px; margin: 0 auto; width: 100%; }
.animal-grid.locked { pointer-events: none; }
.animal-card { background: hsl(var(--hue, 40) 90% 96%); border-radius: 28px; padding: 12px; display: flex; flex-direction: column; align-items: center; box-shadow: var(--shadow); }
.ac-emoji { font-size: 76px; line-height: 1.15; }
.animal-grid.baby .ac-emoji { font-size: 96px; }
.ac-name { font-weight: 800; font-size: 20px; text-transform: capitalize; }
.ac-ur { font-size: 18px; line-height: 1.9; color: var(--ink-soft); }
.animal-card.jump .ac-emoji { animation: bigjump .6s; }
.animal-card.right { box-shadow: 0 0 0 6px var(--green), var(--shadow); }
.vroom-track { position: relative; flex: 1; overflow: hidden; min-height: 220px; }
.vroom-sky { position: absolute; inset: 0 0 35% 0; background: linear-gradient(#7fd3ff, #c9f0ff); }
.vroom-road { position: absolute; left: 0; right: 0; bottom: 0; height: 35%; background: #4a4f63; border-top: 8px solid #6fd27f; }
.vroom-road::after { content: ''; position: absolute; left: 0; right: 0; top: 45%; height: 8px; background: repeating-linear-gradient(90deg, #ffe066 0 50px, transparent 50px 100px); }
.zoomer { position: absolute; font-size: 110px; left: 0; transform: translateX(-140px) scaleX(-1); z-index: 2; }
.zoomer.ground { bottom: 8%; animation: zoomacross 2.6s ease-in forwards; }
.zoomer.air { top: 14%; animation: zoomacross 3s ease-in-out forwards, bob 1s ease-in-out infinite; }
.zoomer.up { left: 50%; top: auto; bottom: 30%; transform: none; animation: rocketup 2.6s ease-in forwards; }
.garage { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 12px 12px calc(12px + var(--safe-b)); background: rgba(255,255,255,.6); }
.garage-btn { background: #fff; border-radius: 22px; padding: 8px 4px; box-shadow: 0 5px 0 rgba(0,0,0,.12); display: flex; flex-direction: column; align-items: center; }
.garage-btn span { font-size: 50px; line-height: 1.1; }
.garage.baby .garage-btn span { font-size: 64px; }
.garage-btn small { font-weight: 700; font-size: 13px; text-transform: capitalize; }

/* ------------------------------------------------------------ stories */
.night-sky { position: absolute; inset: 0; background: radial-gradient(ellipse at 70% 10%, #2b3a8c, #0b1033 70%); overflow: hidden; }
.twinkle { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #fff; animation: twinkle 3s ease-in-out infinite; box-shadow: 0 0 6px #fff; }
.moon { position: absolute; bottom: 40px; right: 24px; width: 70px; height: 70px; border-radius: 50%; background: #fff6c8; box-shadow: 0 0 50px #fff3a0, inset -16px -6px 0 #f0e2a0; }
.story-body { position: relative; z-index: 1; display: flex; flex-direction: column; flex: 1; color: #fff; }
.story-hero { display: flex; align-items: center; gap: 14px; margin: 6px 0 14px; }
.story-hero h2 { margin: 0; font-size: 28px; }
.story-hero p { margin: 0; font-size: 20px; line-height: 2; opacity: .85; }
.story-monkey { width: 90px; flex: none; animation: floaty 3s ease-in-out infinite; }
.story-monkey .char, .story-end .char { width: 100%; height: auto; display: block; }
.story-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.story-cover { border-radius: 26px; padding: 16px 12px; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 4px; box-shadow: 0 0 0 2px rgba(255,255,255,.15), 0 14px 30px rgba(0,0,0,.4); position: relative; }
.sc-emoji { font-size: 56px; }
.sc-faces { display: flex; }
.sc-faces img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; }
.sc-faces img + img { margin-left: -14px; }
.sc-title { font-weight: 800; font-size: 19px; text-align: center; line-height: 1.15; }
.sc-ur { font-size: 16px; line-height: 2; opacity: .85; }
.sc-badge { position: absolute; top: -8px; right: -6px; background: var(--pink); color: #fff; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.story-scene { display: flex; justify-content: center; align-items: center; gap: 14px; min-height: 180px; flex: 1; }
.scene-item { font-size: clamp(70px, 16vw, 130px); animation: floaty 3.5s ease-in-out infinite; filter: drop-shadow(0 10px 20px rgba(0,0,0,.4)); }
.story-scene.page-in { animation: pagein .6s; }
.story-end { width: 160px; }
.story-texts { background: rgba(255,255,255,.1); border-radius: 26px; padding: 12px 18px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.story-text { margin: 0; font-size: 22px; line-height: 1.45; opacity: .5; transition: opacity .3s; }
.story-text.ur { font-size: 22px; line-height: 2.3; margin-top: 6px; }
.story-text.active { opacity: 1; }
.story-dots { display: flex; justify-content: center; gap: 6px; margin: 10px 0; }
.story-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.3); }
.story-dots i.on { background: var(--yellow); width: 26px; border-radius: 6px; }
.story-controls { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; padding-bottom: 6px; }
.story-controls .btn-pill { background: rgba(255,255,255,.15); color: #fff; box-shadow: none; font-size: 16px; }
.story-controls .btn-pill.ur { line-height: 1.8; padding: 4px 18px; }
.story-controls .btn-round { background: rgba(255,255,255,.2); color: #fff; box-shadow: none; }

/* ------------------------------------------------------------ baby games */
.bubble-pond { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(180deg, #a0e9ff, #6fb7ff 70%, #5a8bff); touch-action: none; }
.bubble { position: absolute; bottom: -160px; border-radius: 50%; display: grid; place-items: center; font-size: 40px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.95) 0 8%, color-mix(in srgb, var(--c) 35%, transparent) 30%, color-mix(in srgb, var(--c) 65%, transparent) 70%, var(--c));
  box-shadow: inset 0 0 20px rgba(255,255,255,.6), 0 6px 16px rgba(0,0,0,.15);
  animation: rise linear forwards; }
.bubble.popped { animation: popout .3s forwards !important; }
.ripple { position: absolute; width: 20px; height: 20px; margin: -10px; border-radius: 50%; border: 4px solid #fff; animation: ripple .8s forwards; pointer-events: none; }
.peek-stage { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle, #fff3fb, #ffc6e8); touch-action: none; }
.peek-hider { position: absolute; display: grid; place-items: center; }
.peek-emoji { font-size: min(260px, 50vw); }
.peek-face { width: min(300px, 62vw); height: min(300px, 62vw); border-radius: 50%; object-fit: cover; border: 10px solid #fff; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.peek-blanket { position: absolute; width: min(420px, 86vw); height: min(420px, 86vw); border-radius: 40px; transition: transform .45s cubic-bezier(.5,-0.3,.4,1.3);
  background: repeating-linear-gradient(45deg, #ff8cc6 0 30px, #ffb3d9 30px 60px); box-shadow: 0 20px 50px rgba(160,40,110,.35); display: grid; place-items: center; }
.peek-blanket.lift { transform: translateY(-120%) rotate(-12deg); }
.peek-eyes { font-size: 80px; animation: peek 2s ease-in-out infinite; }
.magic-canvas { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--bg, #a35cff) 30%, #1a1446), #0b0a26); transition: background .6s; touch-action: none; }
.magic-hint { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 34px; font-weight: 800; animation: pulse 1.4s infinite; pointer-events: none; }
.magic-shape { position: absolute; width: 140px; height: 140px; margin: -70px; animation: magicpop 1.6s forwards; pointer-events: none; filter: drop-shadow(0 0 18px rgba(255,255,255,.7)); }
.magic-shape.small { width: 60px; height: 60px; margin: -30px; }
.magic-shape .shape-svg { width: 100%; height: 100%; }
.baby-piano { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 6px 0; }
.bkey { border-radius: 40px; background: var(--c); display: grid; place-items: center; font-size: clamp(60px, 14vw, 110px); box-shadow: inset 0 -14px 0 rgba(0,0,0,.18), 0 10px 0 rgba(0,0,0,.15); touch-action: none; }
.bkey.hit { animation: padhit .3s; }
.nightlight { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(ellipse at 50% 0%, #2a2f7a, #0b0b2b 70%); transition: filter 3s; }
.nightlight.off { filter: brightness(.15); }
.nightlight .twinkle { animation-duration: 4s; }
.nl-moon { position: absolute; top: 12%; left: 50%; width: 150px; height: 150px; margin-left: -75px; border-radius: 50%; background: #fff6c8; box-shadow: 0 0 80px 20px rgba(255,243,160,.5), inset -26px -10px 0 #efe0a0; animation: floaty 6s ease-in-out infinite; }
.nl-sheep { position: absolute; width: 110px; bottom: 18%; opacity: .9; animation: drift 30s linear infinite; }
.nl-sheep.s2 { bottom: 8%; animation-duration: 42s; animation-delay: -20s; width: 80px; }
.nl-monkey { position: absolute; width: 130px; bottom: 26%; right: 10%; animation: floaty 5s ease-in-out infinite; }
.nl-controls { position: absolute; bottom: calc(14px + var(--safe-b)); left: 0; right: 0; display: flex; gap: 8px; justify-content: center; align-items: center; color: #cdd3ff; font-weight: 700; }
.char.sleepy circle[fill="#2b1b12"], .char.sleepy ellipse[fill="#2b1b12"] { transform: scaleY(.15); transform-box: fill-box; transform-origin: center; }
.char.sleepy circle[fill="#fff"] { display: none; }

/* ------------------------------------------------------------ stickers */
.stickers { background: linear-gradient(180deg, #ffb347, #ffcc33); }
.sticker-stage { align-items: center; }
.sticker-head { text-align: center; color: #fff; font-weight: 800; font-size: 24px; text-shadow: 0 3px 0 rgba(0,0,0,.15); margin-bottom: 12px; }
.sticker-next { font-size: 17px; }
.sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px; width: 100%; max-width: 760px; }
.sticker { aspect-ratio: 1; border-radius: 24px; font-size: 52px; background: #fff; box-shadow: var(--shadow); }
.sticker.locked { background: rgba(255,255,255,.35); color: rgba(0,0,0,.2); font-weight: 800; font-size: 40px; box-shadow: none; border: 3px dashed rgba(255,255,255,.7); }
.sticker.have { transform: rotate(calc((var(--r, 0) * 1deg))); }
.sticker-pop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(20,10,60,.55); animation: fadein .3s; }
.sticker-pop.out { animation: fadeout .4s forwards; }
.sticker-pop-card { background: #fff; border-radius: 36px; padding: 24px 40px; text-align: center; animation: popin .5s cubic-bezier(.3,1.6,.5,1); }
.sp-title { font-size: 32px; font-weight: 800; color: var(--pink); }
.sp-sticker { font-size: 130px; line-height: 1.2; animation: wobble 1s infinite; }
.sp-sub { font-family: var(--font-ur); font-size: 22px; line-height: 2; }

/* ------------------------------------------------------------ fx */
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.confetti { position: absolute; width: 12px; height: 16px; border-radius: 3px; animation: confetti 1.8s cubic-bezier(.2,.7,.4,1) forwards; }
.burst { position: absolute; font-size: 30px; margin: -15px; animation: burst .8s ease-out forwards; }
.fly-star { position: fixed; z-index: 95; font-size: 54px; margin: -27px; transition: transform .7s cubic-bezier(.5,-0.3,.6,1), opacity .7s; pointer-events: none; }
.shake { animation: shake .45s; }
.wiggle { animation: wobble .6s; }
.pop-in { animation: popin .4s cubic-bezier(.3,1.6,.5,1) backwards; }

/* ------------------------------------------------------------ modal / rest */
.modal { position: fixed; inset: 0; z-index: 200; background: rgba(15,10,50,.6); display: grid; place-items: center; padding: 16px; animation: fadein .2s; }
.modal-card { background: #fff; border-radius: 30px; padding: 24px; width: min(380px, 100%); text-align: center; animation: popin .35s; }
.modal-card h3 { margin: 0; font-size: 26px; }
.modal-card p { font-size: 22px; font-weight: 700; margin: 10px 0 16px; }
.gate-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gate-opts .btn-pill { background: #eef1ff; font-size: 24px; }
.rest-screen { position: fixed; inset: 0; z-index: 150; background: radial-gradient(ellipse at 50% 20%, #2b3a8c, #0b1033); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.rest-char { width: 170px; animation: floaty 3s ease-in-out infinite; }
.rest-char .char { width: 100%; height: auto; }
.rest-screen h2 { font-size: 40px; margin: 10px 0 0; }
.rest-screen .ur { font-size: 26px; line-height: 2.2; margin: 0; }
.rest-sub { opacity: .8; font-size: 18px; }
.rest-screen .link { color: #9aa3ff; margin-top: 30px; }

/* ------------------------------------------------------------ parents */
.parents { background: #f3f4fb; }
.parents .tb-title { color: var(--ink); text-shadow: none; }
.parent-stage { gap: 16px; max-width: 900px; width: 100%; margin: 0 auto; }
.p-sec { background: #fff; border-radius: 24px; padding: 16px; box-shadow: 0 4px 20px rgba(30,40,90,.08); }
.p-sec h3 { margin: 0 0 12px; font-size: 22px; }
.child-card { border: 2px solid #eef0fa; border-radius: 20px; padding: 14px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 12px; }
.cc-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cc-names { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 140px; }
.cc-stats { display: flex; gap: 8px; }
.stat { background: #f6f7ff; border-radius: 14px; padding: 6px 12px; text-align: center; display: flex; flex-direction: column; }
.stat b { font-size: 18px; }
.stat small { color: var(--ink-soft); font-size: 12px; }
.cc-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; }
@media (max-width: 560px) { .cc-row { grid-template-columns: 1fr; } }
.cc-label { font-weight: 700; color: var(--ink-soft); font-size: 14px; margin-bottom: 6px; }
.bars { display: flex; gap: 6px; height: 110px; align-items: flex-end; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 4px; }
.bar { width: 100%; min-height: 4px; border-radius: 8px 8px 3px 3px; background: linear-gradient(var(--blue), var(--purple)); position: relative; }
.bar span { position: absolute; top: -18px; left: 0; right: 0; text-align: center; font-size: 11px; font-weight: 700; }
.bar-col small { font-size: 11px; color: var(--ink-soft); }
.top-g { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid #f0f1f8; }
.muted { color: var(--ink-soft); font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.chips.ur { direction: rtl; }
.mchip { display: inline-grid; place-items: center; min-width: 34px; height: 34px; border-radius: 10px; background: #f0f1f8; color: #b4b8d4; font-weight: 800; font-style: normal; }
.chips.ur .mchip { font-weight: 400; line-height: 1; padding-bottom: 6px; }
.legend .mchip { min-width: 16px; height: 16px; vertical-align: middle; }
.mchip.seen { background: #fff2c2; color: #a07a00; }
.mchip.ok { background: #c9f5d8; color: #138a43; }
.cc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.p-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f0f1f8; font-weight: 600; }
.p-row b.warn { color: #c9184a; }
.p-input { font: inherit; font-size: 16px; padding: 8px 12px; border: 2px solid #e3e6f5; border-radius: 12px; background: #fff; color: var(--ink); -webkit-user-select: text; user-select: text; }
.p-input.ur { line-height: 1.9; padding: 0 12px; }
.switch { position: relative; width: 52px; height: 30px; flex: none; }
.switch input { opacity: 0; position: absolute; inset: 0; margin: 0; z-index: 1; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: #d6d9ea; transition: background .2s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 2px 4px rgba(0,0,0,.2); }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(22px); }
input[type=range] { width: 160px; accent-color: var(--purple); }
.tip { background: #fff8e1; border-radius: 14px; padding: 12px; font-size: 14px; line-height: 1.6; margin-top: 10px; }
.rec-list { max-height: 360px; overflow-y: auto; margin-top: 10px; border: 2px solid #f0f1f8; border-radius: 14px; }
.rec-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid #f0f1f8; }
.rec-label { flex: 1; font-weight: 600; }
.rec-label.ur { text-align: right; line-height: 2; }
.rec-ok { color: var(--green); font-weight: 800; }
.rec-btn { width: 40px; height: 40px; border-radius: 50%; background: #ffe1e4; color: #e5384a; font-size: 18px; }
.rec-btn.live { background: #e5384a; color: #fff; animation: pulse 1s infinite; }
.install-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.install-grid ol { margin: 6px 0; padding-left: 20px; line-height: 1.7; }
.credits { text-align: center; color: var(--ink-soft); font-size: 13px; }

/* ------------------------------------------------------------ animations */
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes bumpx { 0% { transform: translateX(-50%) scale(1); } 40% { transform: translateX(-50%) scale(1.3); } 100% { transform: translateX(-50%) scale(1); } }
@keyframes popin { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spinring { to { transform: rotate(360deg); } }
@keyframes twinkleBg { from { opacity: .7; } to { opacity: 1; } }
@keyframes twinkle { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
@keyframes drift { from { left: -200px; } to { left: 110%; } }
@keyframes flyacross { from { left: -80px; transform: translateY(0); } 50% { transform: translateY(-30px); } to { left: 110%; transform: translateY(0); } }
@keyframes drive { from { left: 110%; } to { left: -80px; } }
@keyframes roadmove { from { background-position: 0 0; } to { background-position: -80px 0; } }
@keyframes sunpulse { 0%, 100% { box-shadow: 0 0 40px #ffe066; } 50% { box-shadow: 0 0 80px #ffe066; } }
@keyframes tilein { from { transform: translateY(30px) scale(.9); opacity: 0; } }
@keyframes pressed { 50% { transform: scale(.9); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
@keyframes confetti { to { transform: translate(var(--dx), calc(var(--dy) + 400px)) rotate(var(--r)); opacity: 0; } }
@keyframes burst { to { transform: translate(var(--dx), var(--dy)) scale(.4); opacity: 0; } }
@keyframes flyaway { to { transform: translate(300px, -400px) rotate(-20deg); opacity: 0; } }
@keyframes sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes chomp { 50% { transform: scaleY(1.6); } }
@keyframes dance { 0% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-20px) rotate(6deg); } 100% { transform: translateY(0) rotate(-6deg); } }
@keyframes squash { 50% { transform: scale(1.2, .7); } }
@keyframes bigjump { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-60px) rotate(-10deg); } 70% { transform: translateY(-20px) rotate(10deg); } }
@keyframes sheepjump { 0% { transform: translate(0, 0); } 50% { transform: translate(120%, -110%) rotate(-12deg); } 100% { transform: translate(230%, 0); opacity: 0; } }
@keyframes keyhit { 50% { transform: scale(.92) translateY(6px); filter: brightness(1.3); } }
@keyframes padhit { 50% { transform: scale(.9); filter: brightness(1.4); } }
@keyframes glow { to { filter: brightness(1.3); } }
@keyframes zoomacross { from { left: 0; } to { left: calc(100% + 280px); } }
@keyframes rocketup { from { transform: translate(-50%, 0); } to { transform: translate(-50%, -150vh); } }
@keyframes bob { 50% { margin-top: -20px; } }
@keyframes pagein { from { opacity: 0; transform: translateX(40px); } }
@keyframes rise { 0% { transform: translateY(0) translateX(0); } 50% { transform: translateY(-60vh) translateX(30px); } 100% { transform: translateY(-125vh) translateX(-20px); } }
@keyframes popout { to { transform: scale(1.6); opacity: 0; } }
@keyframes ripple { to { transform: scale(8); opacity: 0; } }
@keyframes peek { 0%, 100% { transform: translateX(-20px); } 50% { transform: translateX(20px); } }
@keyframes magicpop { 0% { transform: scale(0) rotate(0); opacity: 1; } 30% { transform: scale(1.2) rotate(40deg); } 100% { transform: scale(.8) rotate(120deg) translateY(-60px); opacity: 0; } }
@keyframes fadein { from { opacity: 0; } }
@keyframes fadeout { to { opacity: 0; } }

@media (min-width: 900px) {
  .tiles { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .tile { min-height: 180px; }
}
@media (max-height: 700px) {
  .letter-card { min-height: 200px; }
  .lc-glyph { font-size: 90px; }
  .lc-glyph.ur { font-size: 80px; }
}

/* ------------------------------------------------------------ phone tuning */
@media (max-width: 600px) {
  .profile-row { gap: 14px; }
  .profile-card { flex-direction: row; flex-wrap: wrap; justify-content: center; column-gap: 16px; padding: 14px; max-width: none; text-align: left; }
  .pc-photo { width: 120px; height: 120px; padding: 5px; }
  .pc-info { display: flex; flex-direction: column; align-items: flex-start; }
  .pc-neon { margin-top: 0; font-size: 18px; }
  .pc-name { font-size: 40px; }
  .pc-name-ur { font-size: 22px; line-height: 1.8; }
  .pc-sub { font-size: 13px; }
  .home-head { flex-wrap: wrap; gap: 10px; padding: 10px 14px 4px; }
  .avatar.lg { width: 64px; height: 64px; }
  .greet-hi { font-size: 26px; white-space: nowrap; }
  .greet-ur { font-size: 14px; white-space: nowrap; }
  .home-actions { gap: 6px; }
  .home-actions .star-count, .home-actions .btn-pill { font-size: 16px; padding: 5px 12px; }
  .home-actions .btn-round.small { width: 38px; height: 38px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .tile { min-height: 136px; }
  .tile-icon { font-size: 50px; }
  .tile-title { font-size: 17px; }
  .home-baby .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tb-title { font-size: 20px; }
  .btn-round { width: 48px; height: 48px; font-size: 22px; }
}

/* Game panels keep their natural height; the stage scrolls instead of squashing them. */
.count-body > *, .qaida-body > *, .math-body > *, .shapes-body > *, .buddies-body > *,
.music-body > *, .animals-body > *, .story-body > * { flex-shrink: 0; }
