@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700;800&family=Nunito:wght@400;600;700;800;900&display=swap');

:root {
  color-scheme: light;
  --green: #235d49;
  --green-dark: #174734;
  --ink: #283e34;
  --muted: #748078;
  --paper: #fcfaf4;
  --line: #e6e9dd;
  --yellow: #f3ce69;
  --topbar-height: 68px;
  font-family: 'Nunito', sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; -webkit-user-select: none; user-select: none; }
input, textarea, [contenteditable="true"] { -webkit-user-select: text; user-select: text; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { min-width: 320px; min-height: 320px; background: radial-gradient(ellipse at 48% 25%, #fffef9 0%, #f5f3e9 63%, #edf0e5 100%); font-size: 15px; }
button, select, a { font: inherit; -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 3px solid #d18730; outline-offset: 3px; }
[hidden] { display: none !important; }

.app-shell { width: 100vw; height: 100dvh; min-height: 320px; display: flex; flex-direction: column; overflow: hidden; background: transparent; }
.topbar { z-index: 2; height: var(--topbar-height); flex: 0 0 var(--topbar-height); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 clamp(18px, 5vw, 76px); border-bottom: 1px solid #e6e9ddc9; background: #fffefaed; }
.brand { display: inline-flex; align-items: center; gap: 9px; width: max-content; text-decoration: none; color: var(--green); font-family: 'Baloo 2', sans-serif; font-size: 21px; line-height: .92; font-weight: 800; }
.brand b { display: block; font-size: 14px; font-weight: 600; }
.brand-icon { color: #e7ad51; font-size: 35px; }
.top-actions { display: flex; align-items: center; gap: 14px; }
.star-pill { display: inline-flex; align-items: center; gap: 5px; color: #785d20; font-size: 14px; }
#star-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 50px; background: #f9e8ad; color: #77581c; font-size: 12px; }
.parent { border: 1px solid #ccd8ca; border-radius: 11px; padding: 9px 14px; background: #fffefa; color: var(--green); font-size: 12px; font-weight: 900; white-space: nowrap; }

main { position: relative; width: 100%; min-height: 0; flex: 1; overflow: hidden; }
.screen { width: 100%; height: 100%; min-height: 0; overflow: hidden; }
.eyebrow { margin: 0 0 7px; color: #74896a; font-size: 10px; font-weight: 900; letter-spacing: 1.7px; }
h1, h2 { margin: 0; font-family: 'Baloo 2', sans-serif; }
h1 { color: #243f35; font-size: clamp(36px, 5.2vw, 76px); font-weight: 800; line-height: .99; letter-spacing: -1.2px; }
h1 em { color: var(--green); font-style: normal; }
.primary, .secondary { min-height: 48px; border-radius: 13px; padding: 12px 20px; font-weight: 900; }
.primary { border: 0; background: var(--green); color: #fff; box-shadow: 0 4px 0 var(--green-dark); }
.primary:hover { background: #337859; }
.primary:disabled, .secondary:disabled { cursor: not-allowed; opacity: .55; }
.secondary { border: 1px solid #d1dcc7; background: #edf1e4; color: var(--green); }

.intro-screen { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(280px, .92fr); align-items: center; gap: clamp(28px, 7vw, 110px); padding: clamp(28px, 6vh, 76px) clamp(24px, 10vw, 160px); background: #d6e2c4 url('assets/garden-meadow-cartoon.webp') center 54% / cover no-repeat; }
.intro-screen::before { position: absolute; z-index: 0; inset: 0; content: ''; pointer-events: none; background: linear-gradient(90deg, #fcfaf4f5 0%, #fcfaf4ec 28%, #fcfaf4c9 41%, #fcfaf483 53%, #fcfaf41f 72%, transparent 100%), linear-gradient(180deg, #fcfaf45c 0%, transparent 30%, #dce8d23b 100%); }
.intro-copy { position: relative; z-index: 2; max-width: 740px; }
.intro-copy h1 { position: relative; }
.intro-copy h1 > span { display: inline-block; margin-left: 10px; color: #e6ad49; font-size: .72em; transform: translateY(-8px); }
.intro-text { max-width: 520px; margin: 18px 0 18px; color: var(--muted); font-size: clamp(15px, 1.45vw, 20px); line-height: 1.5; }
.intro-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.start-button { min-height: 52px; padding-inline: 25px; border-radius: 15px; font-size: 15px; }
.start-button span { margin-left: 12px; font-size: 12px; }
.music-toggle { min-height: 42px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid #d8e1d1; border-radius: 999px; padding: 8px 14px; background: #fffdf3; color: var(--green); font-size: 12px; font-weight: 900; transition: background .2s, transform .2s, border-color .2s; }
.music-toggle:hover { transform: translateY(-2px); border-color: #b6cfad; background: #f1f6e9; }
.music-toggle[aria-pressed="true"] { background: #eaf3df; border-color: #aac89c; }
.music-note { display: inline-block; color: #d99d36; font-size: 20px; line-height: 1; }
.intro-note { margin: 20px 0 0; color: #8b927f; font-size: 12px; font-weight: 800; }
.intro-note span { margin-right: 6px; color: #e5ae49; font-size: 18px; vertical-align: -1px; }
.cache-status { min-height: 1em; margin: 5px 0 0; color: #71806e; font-size: 11px; font-weight: 700; }
.intro-art { position: relative; z-index: 1; width: min(100%, 460px); aspect-ratio: 1 / 1; justify-self: center; overflow: hidden; border: 1px solid #eee8d8; border-radius: 32% 28% 34% 27%; background: linear-gradient(145deg, #edf2df 0%, #e5efd9 52%, #f9ecc4 52%, #fff4d6 100%); box-shadow: 0 24px 70px #57684c18; }
.intro-art::before, .intro-art::after { position: absolute; content: ''; border-radius: 50%; background: #fff8dc; }
.intro-art::before { width: 39%; aspect-ratio: 1; right: 15%; top: 12%; }
.intro-art::after { width: 15%; aspect-ratio: 1; right: 57%; top: 43%; background: #f2c986; }
.art-sun, .art-flower, .art-tag, .art-ground, .art-cloud, .art-carrot { position: absolute; z-index: 1; }
.art-sun { top: 9%; right: 20%; color: #e8b64e; font-size: clamp(40px, 6vw, 84px); }
.art-flower { left: 12%; bottom: 7%; color: #d99177; font-size: clamp(54px, 7vw, 100px); }
.art-cloud { top: 18%; left: 7%; color: #fffefa; font-size: clamp(24px, 3vw, 42px); opacity: .9; }
.art-carrot { z-index: 2; right: 22%; bottom: 8%; font-size: clamp(24px, 3.2vw, 42px); }
.art-tag { right: 8%; bottom: 8%; padding: 10px 14px; border-radius: 12px; background: #fffdf2e8; color: #6e815f; font-size: clamp(11px, 1.1vw, 15px); font-weight: 900; }
.art-ground { left: -10%; right: -10%; bottom: -34%; height: 54%; border-radius: 50% 50% 0 0; background: #d6e1ca; }

.animal-scene { position: absolute; z-index: 3; inset: 0; overflow: hidden; perspective: 1150px; perspective-origin: 50% 54%; transform-style: preserve-3d; pointer-events: none; }
.scene-animal { position: absolute; top: -10000px; left: -10000px; display: block; opacity: 0; visibility: hidden; transform-origin: 50% 85%; transform-style: preserve-3d; backface-visibility: hidden; will-change: transform, opacity; }
.scene-animal img, .scene-sprite { display: block; width: 100%; height: 100%; }
.scene-animal img { object-fit: contain; }
.scene-sprite { background-repeat: no-repeat; background-size: 400% 200%; }
.scene-shadow { position: absolute; z-index: 0; top: 0; left: 0; display: block; height: 15px; border-radius: 50%; background: radial-gradient(ellipse, #30433355 0%, #30433329 42%, #30433300 74%); filter: blur(3px); opacity: 0; visibility: hidden; will-change: transform, opacity; }
.shadow-rabbit { width: clamp(42px, 5.5vw, 78px); }
.shadow-deer { width: clamp(55px, 6vw, 88px); }
.shadow-elephant { width: clamp(60px, 7vw, 100px); }
.shadow-tiger { width: clamp(58px, 6.5vw, 94px); }
.shadow-lion { width: clamp(66px, 7.5vw, 108px); }
.scene-bird { width: clamp(58px, 5vw, 82px); aspect-ratio: 3 / 2; }
.scene-bird .scene-sprite { background-image: url('assets/animals/bird-flap-8f.png'); }
.scene-butterfly { width: clamp(62px, 5.4vw, 90px); aspect-ratio: 3 / 2; }
.scene-butterfly .scene-sprite { background-image: url('assets/animals/butterfly-flap-8f.png'); }
.scene-rabbit { width: clamp(98px, 9vw, 148px); aspect-ratio: 4 / 3; }
.scene-rabbit .scene-sprite { background-image: url('assets/animals/rabbit-hop-8f.png'); }
.scene-deer { width: clamp(116px, 10vw, 164px); aspect-ratio: 656 / 599; }
.scene-deer .scene-sprite { background-image: url('assets/animals/deer-walk-8f.png'); }
.scene-tiger { width: clamp(122px, 10.6vw, 174px); aspect-ratio: 3 / 2; }
.scene-tiger .scene-sprite { background-image: url('assets/animals/tiger-walk-8f.png'); }
.scene-elephant { width: clamp(132px, 11.5vw, 190px); aspect-ratio: 3 / 2; }
.scene-elephant .scene-sprite { background-image: url('assets/animals/elephant-walk-8f.png'); }
.scene-lion { width: clamp(142px, 12vw, 202px); aspect-ratio: 360 / 250; }
.scene-lion .scene-sprite { background-image: url('assets/animals/lion-walk-8f.png'); }
.scene-lion::after { position: absolute; left: 78%; top: 43%; width: 10%; height: 13%; content: ''; border-radius: 50%; background: radial-gradient(ellipse at 50% 78%, #ee8d83 0 28%, #633b39 31% 100%); opacity: 0; transform: scaleY(.08); transform-origin: top; }
.scene-lion.is-roaring::after { animation: scene-roar 1.8s ease-in-out 1 both; }
.scene-animal.is-flapping .scene-sprite { animation: scene-8frames .68s steps(1, end) infinite, scene-wing-bob .68s ease-in-out infinite; }
.scene-animal.is-flying .scene-sprite { animation: scene-8frames .56s steps(1, end) infinite, scene-wing-bob .56s ease-in-out infinite; }
.scene-animal.is-hopping .scene-sprite { animation: scene-8frames 1.04s steps(1, end) infinite, scene-hop-bob 1.04s ease-in-out infinite; }
.scene-animal.is-walking .scene-sprite { animation: scene-8frames .78s steps(1, end) infinite, scene-walk-bob .78s ease-in-out infinite; }
.scene-lion.is-walking .scene-sprite { animation-duration: .82s, .82s; }
.scene-animal.is-grazing .scene-sprite { animation: scene-graze 1.8s ease-in-out infinite; }
.scene-animal.is-chewing .scene-sprite { animation: scene-chew .48s ease-in-out infinite; }
.scene-bush { position: absolute; z-index: 2; bottom: 5%; width: clamp(75px, 9vw, 132px); height: clamp(32px, 4vw, 54px); border-radius: 60% 48% 22% 26%; background: radial-gradient(ellipse at 25% 67%, #8ead77 0 23%, transparent 24%), radial-gradient(ellipse at 52% 38%, #6e9a63 0 29%, transparent 30%), radial-gradient(ellipse at 78% 65%, #9db884 0 25%, transparent 26%); opacity: .9; transform-style: preserve-3d; }
.bush-left { left: 8%; transform: translateZ(-80px) scale(.72); opacity: .7; }
.bush-right { right: 8%; transform: translateZ(42px) scale(1.05); }
.bush-near { left: 50%; bottom: 1%; transform: translateZ(100px) scale(1.25); opacity: .84; }
.scene-leaf, .scene-carrot { position: absolute; z-index: 1; opacity: 0; visibility: hidden; }
.scene-leaf { left: 57%; bottom: 18%; font-size: 25px; }
.scene-carrot { left: 45%; bottom: 11%; font-size: 31px; }
@keyframes scene-8frames {
  0%, 12.49% { background-position: 0 0; }
  12.5%, 24.99% { background-position: 33.3333% 0; }
  25%, 37.49% { background-position: 66.6667% 0; }
  37.5%, 49.99% { background-position: 100% 0; }
  50%, 62.49% { background-position: 0 100%; }
  62.5%, 74.99% { background-position: 33.3333% 100%; }
  75%, 87.49% { background-position: 66.6667% 100%; }
  87.5%, 100% { background-position: 100% 100%; }
}
@keyframes scene-wing-bob { 0%, 100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-2px) rotate(-1deg); } 72% { transform: translateY(1px) rotate(1deg); } }
@keyframes scene-hop-bob { 0%, 100% { transform: translateY(1px) rotate(0); } 25% { transform: translateY(-2px) rotate(-1deg); } 52% { transform: translateY(-4px) rotate(1deg); } 78% { transform: translateY(1px) rotate(0); } }
@keyframes scene-walk-bob { 0%, 100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-1px) rotate(-.6deg); } 75% { transform: translateY(1px) rotate(.6deg); } }
@keyframes scene-graze { 0%, 100% { transform: rotate(0deg) translateY(0); } 50% { transform: rotate(5deg) translateY(5px); } }
@keyframes scene-chew { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.96); } }
@keyframes scene-roar { 0%, 100% { opacity: 0; transform: scaleY(.08); } 18%, 58% { opacity: 1; transform: scaleY(1); } 38%, 78% { opacity: .2; transform: scaleY(.12); } }

.activities-screen { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 0; padding: clamp(10px, 2vh, 22px) clamp(24px, 5vw, 76px) clamp(24px, 5vh, 60px); }
.screen-topnav { z-index: 1; min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.screen-topnav .back-button { margin: 0; }
.activities-content { min-width: 0; min-height: 0; display: flex; flex-direction: column; justify-content: flex-start; gap: clamp(25px, 5vh, 55px); padding-top: clamp(20px, 3.2vh, 48px); }
.screen-heading { max-width: 850px; }
.screen-heading > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 15px; }
.screen-heading h1, .lesson-heading-copy h1 { font-size: clamp(31px, 4vw, 52px); }
.back-button { display: flex; align-items: center; gap: 8px; width: max-content; border: 0; padding: 7px 10px 7px 0; background: transparent; color: var(--green); font-size: 13px; font-weight: 900; }
.activity-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 2vw, 24px); }
.activity-card { position: relative; min-width: 0; min-height: clamp(132px, 23vh, 220px); display: grid; grid-template-columns: auto 1fr; grid-template-rows: 1fr auto; align-items: center; column-gap: 15px; padding: clamp(17px, 2.4vw, 32px); border: 1px solid #ffffffaa; border-radius: 24px; color: var(--ink); text-align: left; box-shadow: 0 12px 30px #35493b0b; transition: transform .18s ease, box-shadow .18s ease; }
.activity-card:hover { transform: translateY(-4px); box-shadow: 0 17px 32px #35493b18; }
.activity-card:disabled { opacity: .6; cursor: not-allowed; }
.activity-icon { grid-row: 1 / 3; font-size: clamp(35px, 5vw, 62px); }
.activity-copy strong, .activity-copy small { display: block; }
.activity-copy strong { font-family: 'Baloo 2', sans-serif; font-size: clamp(18px, 1.8vw, 25px); line-height: 1.08; }
.activity-copy small { margin-top: 6px; color: #7c8074; font-size: 12px; }
.activity-progress { align-self: end; color: #72816d; font-size: 11px; font-weight: 900; }
.activity-arrow { position: absolute; right: 20px; top: 17px; color: #8e9a80; font-size: 22px; }
.peach { background: #f9e7dc; }
.lilac { background: #eae6f3; }
.mint { background: #e3eddf; }
.yellow { background: #faf0cc; }

.lessons-screen { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; gap: clamp(8px, 1.5vh, 16px); padding: clamp(10px, 2vh, 22px) clamp(20px, 5vw, 80px) clamp(15px, 3vh, 32px); }
.lesson-topnav .lesson-pagination { justify-content: flex-end; }
.lesson-screen-header { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, 240px); align-items: end; gap: clamp(14px, 3vw, 40px); }
.lesson-heading-copy .eyebrow { margin-bottom: 2px; }
.progress-summary { display: flex; flex-direction: column; gap: 7px; align-self: center; color: #748078; font-size: 12px; font-weight: 800; text-align: right; }
.progress-track { height: 8px; overflow: hidden; border-radius: 8px; background: #e6e9dd; }
#progress-fill { display: block; width: 0; height: 100%; border-radius: inherit; background: #e7b653; transition: width .25s ease; }
.lesson-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); grid-auto-flow: row; gap: clamp(10px, 1.35vw, 20px); min-width: 0; min-height: 0; overflow: hidden; padding: 2px; }
.lesson-card { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding: 0; border: 1px solid #e8e9de; border-radius: 19px; background: #fff; color: var(--ink); text-align: left; box-shadow: 0 6px 18px #283e3408; transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease; }
.lesson-card:hover:not(.is-locked) { transform: translateY(-3px); box-shadow: 0 10px 24px #283e3415; }
.lesson-card.is-locked { cursor: not-allowed; }
.lesson-card.is-locked .lesson-thumb img { filter: grayscale(.58) brightness(.78); }
.lesson-thumb { position: relative; display: grid; flex: 1 1 auto; min-height: 0; place-items: center; aspect-ratio: 16 / 9; overflow: hidden; background: linear-gradient(135deg, #e9eede, #f6edcf); }
.lesson-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lesson-placeholder { display: grid; place-items: center; width: 100%; height: 100%; color: #a58b51; font-size: 54px; }
.lesson-play { position: absolute; display: grid; place-items: center; width: 43px; height: 43px; padding-left: 3px; border: 1px solid #ffffffbd; border-radius: 50%; background: #ffffffed; color: var(--green); font-size: 14px; box-shadow: 0 2px 10px #0001; }
.is-locked .lesson-play { padding: 0; color: #fff; background: #273a31c9; }
.lesson-duration { position: absolute; right: 9px; bottom: 9px; border-radius: 5px; padding: 4px 7px; background: #183e36d9; color: #fff; font-size: 10px; font-weight: 800; }
.lesson-state { position: absolute; top: 9px; left: 9px; border-radius: 20px; padding: 5px 8px; background: #fffdf0ed; color: #496b51; font-size: 10px; font-weight: 900; }
.lesson-state.locked { background: #243c34d9; color: #fff; }
.lesson-card-copy { display: flex; flex: 0 0 auto; flex-direction: column; gap: 3px; padding: 10px 12px 12px; }
.lesson-index { color: #819077; font-size: 9px; font-weight: 900; letter-spacing: .4px; }
.lesson-card-copy strong { overflow: hidden; font-family: 'Baloo 2', sans-serif; font-size: clamp(15px, 1.3vw, 19px); line-height: 1.05; text-overflow: ellipsis; white-space: nowrap; }
.lesson-card-copy small { overflow: hidden; color: #87917f; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.load-message { justify-self: center; max-width: min(600px, 90vw); margin: 0; padding: 12px 18px; border-radius: 14px; background: #f8efcd; color: #6c654f; text-align: center; }
.lesson-pagination { min-height: 42px; display: flex; align-items: center; justify-content: center; gap: clamp(10px, 2vw, 24px); }
.page-button { min-height: 40px; border: 1px solid #d7e1d0; border-radius: 14px; padding: 8px 14px; background: #fffefa; color: var(--green); font-size: 12px; font-weight: 900; transition: transform .15s ease, background .15s ease; }
.page-button:hover:not(:disabled) { transform: translateY(-1px); background: #edf3e8; }
.page-button:disabled { cursor: default; opacity: .5; }
.next-page { border-color: var(--green); background: var(--green); color: #fff; box-shadow: 0 3px 0 var(--green-dark); }
.next-page:hover:not(:disabled) { background: #337859; }
.next-page:disabled { display: none; }
.page-status { color: #7c8877; font-size: 11px; font-weight: 900; white-space: nowrap; }

.dialog { width: min(720px, calc(100vw - 28px)); max-height: min(90dvh, 860px); overflow: auto; border: 0; border-radius: 24px; padding: clamp(16px, 3vw, 28px); background: var(--paper); color: var(--ink); box-shadow: 0 30px 100px #0004; }
.dialog::backdrop { background: #172f27b8; backdrop-filter: blur(5px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.dialog-head h2 { font-size: clamp(21px, 3vw, 29px); }
.dialog-head .eyebrow { margin-bottom: 2px; }
.close { flex: 0 0 auto; width: 41px; height: 41px; border: 0; border-radius: 50%; background: #e7ecdf; color: var(--green); font-size: 18px; }
#media-slot { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 14px; background: #152a23; }
#media-slot iframe, #media-slot video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; object-fit: contain; }
#media-slot audio { width: 90%; margin: 20% 5%; }
.player-hint { color: #788472; font-size: 12px; }
.player-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
#celebration { min-height: 22px; color: #9d7a20; font-weight: 900; }
.parent-dialog { max-width: 560px; line-height: 1.7; }
.parent-dialog p { color: #6d7e6b; }
.coloring-launcher { width: 100%; min-height: 68px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; border: 1px solid #dfe8d4; border-radius: 16px; padding: 12px 16px; background: #edf3e5; color: var(--green); text-align: left; }
.coloring-launcher > span:first-child { font-size: 25px; }
.coloring-launcher strong, .coloring-launcher small { display: block; }
.coloring-launcher strong { font-family: 'Baloo 2', sans-serif; font-size: 17px; }
.coloring-launcher small { color: #71816d; font-size: 11px; }
.worksheet-links { display: flex; flex-wrap: wrap; gap: 8px; }
.worksheet-links a { border-radius: 8px; padding: 7px 10px; background: #edf1e4; color: var(--green); font-size: 12px; font-weight: 900; text-decoration: none; }
.coloring-dialog { width: min(1000px, calc(100vw - 24px)); max-height: min(94dvh, 1000px); }
.color-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.color-tile { min-width: 0; overflow: hidden; border: 1px solid #e0e6d8; border-radius: 15px; padding: 8px; background: #fff; color: var(--green); text-align: left; box-shadow: 0 5px 16px #283e3409; }
.color-tile:hover { transform: translateY(-2px); box-shadow: 0 9px 20px #283e3418; }
.color-tile canvas, .color-tile img { display: block; width: 100%; aspect-ratio: 595 / 842; border: 1px solid #f0f0e9; background: white; object-fit: contain; }
.color-tile canvas.is-landscape { aspect-ratio: 842 / 595; }
.color-tile strong { display: block; padding: 8px 3px 2px; font-family: 'Baloo 2', sans-serif; font-size: 13px; }
.color-tile small { display: block; padding: 0 3px 3px; color: var(--muted); font-size: 10px; }
.color-editor { min-width: 0; }
.color-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.color-palette { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.color-swatch { width: 30px; height: 30px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #cbd5c8; }
.color-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--green); }
.brush-control { display: inline-flex; align-items: center; gap: 6px; color: #728071; font-size: 11px; font-weight: 800; }
.brush-control input { width: 88px; accent-color: var(--green); }
.color-tools .primary { min-height: 40px; padding: 8px 13px; font-size: 12px; }
.color-tools .page-button { min-height: 38px; padding: 7px 10px; font-size: 11px; }
.color-hint { margin: 10px 0; color: #71816d; font-size: 11px; }
.color-paper { position: relative; width: min(100%, calc((94dvh - 250px) * .707)); max-height: calc(94dvh - 250px); aspect-ratio: 595 / 842; margin: 0 auto; overflow: hidden; border: 1px solid #e1e5d9; border-radius: 8px; background: white; box-shadow: 0 8px 24px #283e3418; touch-action: none; }
.color-paper.is-landscape { width: min(100%, calc((94dvh - 250px) * 1.414)); aspect-ratio: 842 / 595; }
.color-paper canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
#color-lineart { z-index: 1; mix-blend-mode: multiply; pointer-events: none; }
#color-paint { z-index: 0; cursor: crosshair; }

@media (max-width: 760px) {
  :root { --topbar-height: 58px; }
  .topbar { padding-inline: 16px; }
  .brand { gap: 6px; font-size: 19px; }
  .brand b { font-size: 12px; }
  .brand-icon { font-size: 30px; }
  .top-actions { gap: 8px; }
  .parent { padding: 8px 10px; font-size: 10px; }
  .intro-screen { grid-template-columns: minmax(0, 1.1fr) minmax(125px, .75fr); gap: 16px; padding: 22px clamp(17px, 5vw, 38px); }
  .intro-art { width: 100%; border-radius: 28% 25% 30% 24%; }
  .intro-copy h1 { font-size: clamp(30px, 7.3vw, 48px); }
  .intro-text { margin-block: 12px; font-size: clamp(12px, 2.5vw, 16px); }
  .intro-actions { gap: 8px; }
  .start-button { min-height: 45px; padding-inline: 17px; font-size: 13px; }
  .music-toggle { min-height: 38px; padding: 7px 11px; font-size: 11px; }
  .intro-note { margin-top: 12px; font-size: 10px; }
  .activities-screen { padding: 8px clamp(18px, 5vw, 40px) 20px; }
  .activities-content { gap: 22px; padding-top: clamp(16px, 3vh, 32px); }
  .activity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .activity-card { min-height: clamp(112px, 21vh, 165px); padding: 15px; border-radius: 18px; column-gap: 10px; }
  .activity-icon { font-size: clamp(30px, 8vw, 46px); }
  .activity-copy strong { font-size: clamp(16px, 3.7vw, 20px); }
  .activity-copy small { font-size: 10px; }
  .lesson-topnav { align-items: flex-start; flex-wrap: wrap; gap: 3px 10px; }
  .lesson-topnav .lesson-pagination { width: 100%; justify-content: flex-end; min-height: 36px; }
  .lesson-screen-header { grid-template-columns: minmax(0, 1fr); align-items: center; gap: 8px; }
  .lesson-heading-copy h1 { font-size: clamp(27px, 7vw, 38px); }
  .progress-summary { display: grid; grid-template-columns: auto minmax(45px, 1fr); align-items: center; gap: 9px; text-align: left; font-size: 10px; }
  .lesson-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
  .lesson-card { border-radius: 15px; }
  .lesson-card-copy { padding: 8px 9px 10px; }
  .lesson-index { font-size: 8px; }
  .lesson-card-copy strong { font-size: 15px; }
  .lesson-card-copy small { font-size: 9px; }
  .lesson-play { width: 35px; height: 35px; font-size: 12px; }
  .lesson-state { top: 6px; left: 6px; padding: 4px 6px; font-size: 8px; }
  .lesson-duration { right: 6px; bottom: 6px; font-size: 8px; }
}

@media (max-width: 440px) {
  .intro-screen { grid-template-columns: minmax(0, 1fr) 100px; gap: 10px; padding-inline: 16px; }
  .intro-copy h1 { font-size: clamp(27px, 7vw, 33px); }
  .intro-copy h1 > span { margin-left: 3px; }
  .intro-text { font-size: 11px; line-height: 1.35; }
  .intro-note { max-width: 190px; font-size: 9px; }
  .art-tag { right: 4%; bottom: 4%; padding: 3px 5px; font-size: 7px; white-space: nowrap; }
  .art-flower { left: 6%; bottom: 9%; font-size: 30px; }
  .art-carrot { font-size: 20px; }
  .music-toggle { min-height: 36px; padding: 6px 9px; font-size: 10px; }
  .activities-content { gap: 18px; }
  .screen-heading > p:last-child { font-size: 12px; }
  .screen-heading h1 { font-size: 31px; }
  .activity-grid { gap: 9px; }
  .activity-card { min-height: 112px; grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; justify-items: start; gap: 3px; padding: 10px 12px; }
  .activity-icon { grid-row: auto; font-size: 27px; }
  .activity-copy strong { font-size: 15px; }
  .activity-copy small { display: none; }
  .activity-progress { font-size: 9px; }
  .activity-arrow { top: 9px; right: 11px; font-size: 17px; }
  .lessons-screen { gap: 12px; padding: 13px 12px 10px; }
  .lesson-topnav .back-button { font-size: 12px; }
  .lesson-heading-copy .eyebrow { font-size: 8px; letter-spacing: 1px; }
  .lesson-heading-copy h1 { font-size: 26px; }
  .progress-summary { font-size: 9px; }
  .lesson-grid { gap: 7px; }
  .lesson-topnav .lesson-pagination { min-height: 34px; gap: 6px; }
  .page-button { min-height: 36px; padding: 7px 10px; font-size: 10px; }
  .page-status { font-size: 9px; }
  .color-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .color-tools { gap: 6px; }
  .color-swatch { width: 27px; height: 27px; }
  .color-paper { width: min(100%, calc((94dvh - 300px) * .707)); max-height: calc(94dvh - 300px); }
  .color-paper.is-landscape { width: min(100%, calc((94dvh - 300px) * 1.414)); }
}

@media (max-width: 1440px) {
  .lesson-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1050px) {
  .lesson-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 650px) {
  .lesson-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scene-bird { width: 45px; }
  .scene-butterfly { width: 49px; }
  .scene-rabbit { width: 78px; }
  .scene-deer { width: 88px; }
  .scene-tiger { width: 92px; }
  .scene-elephant { width: 102px; }
  .scene-lion { width: 112px; }
  .scene-bush { width: 74px; height: 34px; }
}

@media (max-width: 440px) {
  .scene-rabbit { width: 48px; }
  .scene-deer { width: 50px; }
  .scene-tiger { width: 54px; }
  .scene-elephant { width: 58px; }
  .scene-lion { width: 62px; }
  .scene-shadow { height: 8px; }
  .shadow-rabbit { width: 30px; }
  .shadow-deer { width: 34px; }
  .shadow-elephant { width: 40px; }
  .shadow-tiger { width: 38px; }
  .shadow-lion { width: 44px; }
  .bush-near { left: 50%; }
}

@media (orientation: landscape) and (max-height: 520px) {
  :root { --topbar-height: 48px; }
  .topbar { padding-inline: 24px; }
  .brand { font-size: 17px; }
  .brand b { font-size: 10px; }
  .brand-icon { font-size: 26px; }
  .parent { padding-block: 6px; }
  .intro-screen { grid-template-columns: 1.2fr .8fr; gap: 20px; padding: 12px 8vw; }
  .intro-art { width: auto; height: min(70vh, 360px); aspect-ratio: 1; }
  .intro-copy h1 { font-size: clamp(28px, 6vh, 43px); }
  .intro-text { margin-block: 8px; font-size: 12px; }
  .start-button { min-height: 38px; padding-block: 7px; }
  .intro-note { margin-top: 7px; }
  .activities-screen { gap: 10px; padding-block: 8px; }
  .back-button { margin-bottom: 5px; }
  .screen-heading .eyebrow { margin-bottom: 2px; }
  .screen-heading h1 { font-size: 28px; }
  .screen-heading > p:last-child { margin-top: 1px; font-size: 11px; }
  .activity-card { min-height: 96px; padding: 12px; }
  .activity-icon { font-size: 30px; }
  .activity-copy strong { font-size: 16px; }
  .activity-copy small { font-size: 9px; }
  .lessons-screen { gap: 8px; padding-block: 8px; }
  .lesson-heading-copy h1 { font-size: 27px; }
  .lesson-grid { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
