/* Kids' world: when the learner's age path is 3-7 or 8-12, the whole app turns playful.
   It only re-tunes the shared design tokens and a few shapes, so every page follows automatically. */
body[data-mode="kids"] {
 --bg: #fffaf2; --surface: #ffffff; --ink: #15213b; --muted: #5a6479; --line: #efe4d0;
 --brand: #2f8ff0; --brand-deep: #1d6dc0;
 --lime: #2fbf5a; --lime-deep: #21943f; --lime-soft: #dcf7e7;
 --good: #1f9d55; --good-soft: #dcf7e7; --sun: #ffb020; --sun-soft: #fff3cc;
 --r-s: 14px; --r-m: 20px; --r-l: 28px;
 --shadow: 0 2px 0 rgb(21 33 59 / .06), 0 14px 32px rgb(21 33 59 / .10);
 --font: "Readex Pro", "Vazirmatn", "Noto Sans Arabic", system-ui, sans-serif;   /* the same font as the rest of the site */
 font-size: 18px;
}
body[data-mode="kids"] h1, body[data-mode="kids"] h2 { font-weight: 800; }

/* toy-like buttons that press down */
body[data-mode="kids"] .btn { border-radius: 18px; font-weight: 700; }
body[data-mode="kids"] .btn-primary { color: #fff; box-shadow: 0 5px 0 var(--lime-deep); }
body[data-mode="kids"] .btn-primary:hover { box-shadow: 0 6px 0 var(--lime-deep); filter: brightness(1.04); }
body[data-mode="kids"] .btn-primary:active { box-shadow: 0 1px 0 var(--lime-deep); transform: translateY(4px); }
body[data-mode="kids"] .btn-quiet { box-shadow: 0 4px 0 var(--line); border-color: var(--line); }

/* header and bottom tabs */
body[data-mode="kids"] .top { background: rgb(255 250 242 / .92); border-block-end-color: var(--line); }
body[data-mode="kids"] .top-nav a.is-current, body[data-mode="kids"] .tab.is-current { color: var(--brand-deep); background: #e4f1ff; }
body[data-mode="kids"] .tab.is-current .icon { color: var(--brand); }

/* today card: the place scene with Wolfi greeting the child */
body[data-mode="kids"] .today-main { position: relative; overflow: hidden; min-block-size: 300px; color: var(--ink);
 background: linear-gradient(to left, rgb(255 250 242 / .95), rgb(255 250 242 / .82) 52%, rgb(255 250 242 / 0) 78%), var(--kid-scene, none) 18% 72% / cover; padding-inline-end: 40%; }
[dir="ltr"] body[data-mode="kids"] .today-main, body[data-mode="kids"][dir="ltr"] .today-main { background: linear-gradient(to right, rgb(255 250 242 / .95), rgb(255 250 242 / .82) 52%, rgb(255 250 242 / 0) 78%), var(--kid-scene, none) 82% 72% / cover; }
body[data-mode="kids"] .today-main .kicker { color: var(--brand-deep); }
body[data-mode="kids"] .today-main p { color: var(--muted); }
body[data-mode="kids"] .today-main h1 { color: var(--ink); }
.kid-wolfi { display: none; }
body[data-mode="kids"] .kid-wolfi { display: block; position: absolute; inset-inline-end: 2%; inset-block-end: 0; inline-size: min(36%, 240px); aspect-ratio: 1; border: 0; padding: 0; background: none; cursor: pointer; }
.kid-wolfi video, .kid-wolfi img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: contain; object-position: bottom; }
.kid-wolfi-shadow { position: absolute; inset-inline-start: 25%; inline-size: 56%; inset-block-end: 2.5%; block-size: 9%; border-radius: 50%; background: radial-gradient(closest-side, rgb(20 25 10 / .42), rgb(20 25 10 / 0)); }
.kid-bubble { position: absolute; inset-block-start: -6px; inset-inline-start: 50%; translate: 50% -100%; padding: 8px 14px; border-radius: 18px; background: #fff; box-shadow: var(--shadow); font-weight: 700; font-size: .95rem; white-space: nowrap; }
[dir="ltr"] .kid-bubble { translate: -50% -100%; }
body[data-mode="kids"] .today-stats { border-radius: var(--r-l); box-shadow: var(--shadow); border: 0; }
body[data-mode="kids"] .ring-value { stroke: var(--lime); }

/* cards and the lesson path */
body[data-mode="kids"] .side-card, body[data-mode="kids"] .unit, body[data-mode="kids"] .unit-card, body[data-mode="kids"] .word-card { border: 0; box-shadow: var(--shadow); }
body[data-mode="kids"] .unit { border-block-start: 8px solid var(--tone, var(--brand)); }
body[data-mode="kids"] .unit:nth-of-type(4n+1) { --tone: #ff6b5a; } body[data-mode="kids"] .unit:nth-of-type(4n+2) { --tone: #2f8ff0; }
body[data-mode="kids"] .unit:nth-of-type(4n+3) { --tone: #22c08a; } body[data-mode="kids"] .unit:nth-of-type(4n) { --tone: #f2a516; }
body[data-mode="kids"] .lesson-row { border-radius: 18px; }
body[data-mode="kids"] .lesson-row.is-next { background: #dcf7e7; border-color: var(--lime); box-shadow: 0 4px 0 var(--lime-deep); }
body[data-mode="kids"] .node { inline-size: 48px; block-size: 48px; font-weight: 800; border-width: 3px; box-shadow: 0 3px 0 var(--line); }
body[data-mode="kids"] .lesson-row.is-done .node { background: var(--sun); border-color: var(--sun); color: #fff; box-shadow: 0 3px 0 #d98e00; }
body[data-mode="kids"] .lesson-row.is-next .node { background: var(--lime); border-color: var(--lime); color: #fff; box-shadow: 0 3px 0 var(--lime-deep); }

/* exercises: big friendly picture cards */
body[data-mode="kids"] .pick { border-radius: 26px; box-shadow: 0 5px 0 var(--line); }
body[data-mode="kids"] .pick:hover:not(:disabled) { border-color: var(--brand); }
body[data-mode="kids"] .result-burst { background: var(--sun-soft); }
body[data-mode="kids"] .result-stat { border: 0; box-shadow: var(--shadow); }
body[data-mode="kids"] .choice-card { border-radius: 22px; }
body[data-mode="kids"] .choice-card[aria-pressed="true"] { background: #e4f1ff; border-color: var(--brand); }

@media (max-width: 720px) {
 body[data-mode="kids"] .today-main { padding-inline-end: 28px; padding-block-end: 190px; background: linear-gradient(to bottom, rgb(255 250 242 / .96), rgb(255 250 242 / .85) 55%, rgb(255 250 242 / 0) 80%), var(--kid-scene, none) 18% 80% / cover; }
 body[data-mode="kids"] .kid-wolfi { inline-size: 170px; inset-inline-end: 3%; }
 /* on phones Wolfi's greeting sits beside him, not above him, so it never covers "Start the lesson" */
 .kid-bubble, [dir="ltr"] .kid-bubble { inset-block-start: 22%; inset-inline-start: auto; inset-inline-end: 84%; translate: none; white-space: normal; inline-size: max-content; max-inline-size: min(140px, 40vw); font-size: .88rem; line-height: 1.5; }
}
@media (prefers-reduced-motion: reduce) { .kid-wolfi video { display: none; } }

/* Wolfi inside lessons: bottom corner, beside the exercise; reacts to every answer */
.lesson-buddy { position: fixed; z-index: 6; inset-inline-start: max(12px, calc(50% - 520px)); inset-block-end: 104px; inline-size: 170px; aspect-ratio: 1; pointer-events: none; }
.lesson-buddy .buddy-layer { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: contain; object-position: bottom; opacity: 0; transition: opacity .2s; }
.lesson-buddy .buddy-layer.is-on { opacity: 1; }
.lesson-buddy .buddy-layer.is-hop { animation: buddy-hop .6s; }
.buddy-shadow { position: absolute; inset-inline-start: 25%; inline-size: 56%; inset-block-end: 2.5%; block-size: 9%; border-radius: 50%; background: radial-gradient(closest-side, rgb(20 25 10 / .3), rgb(20 25 10 / 0)); }
.buddy-bubble { position: absolute; inset-block-end: 96%; inset-inline-start: 50%; translate: 50% 0; padding: 6px 14px; border-radius: 16px; background: #fff; box-shadow: 0 6px 18px rgb(21 33 59 / .14); font-weight: 800; white-space: nowrap; animation: buddy-pop .3s; }
[dir="ltr"] .buddy-bubble { translate: -50% 0; }
@keyframes buddy-hop { 40% { transform: translateY(-22px) scale(1.05); } }
@keyframes buddy-pop { from { transform: scale(.6); opacity: 0; } }

/* Wolfi on the other kids' pages (map, stories, profile, pronunciation): a friendly corner guide */
.page-buddy { position: fixed; z-index: 15; inset-inline-start: 14px; inset-block-end: 14px; inline-size: 130px; aspect-ratio: 1; border: 0; padding: 0; background: none; cursor: pointer; }
.page-buddy video, .page-buddy img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: contain; object-position: bottom; }
.page-buddy .buddy-bubble { font-size: .9rem; }
.page-buddy:hover video, .page-buddy:hover img { transform: translateY(-4px); transition: transform .2s; }

@media (max-width: 720px) {
 .lesson-buddy { inline-size: 92px; inset-block-end: 112px; inset-inline-start: 6px; }
 .lesson-buddy .buddy-bubble { font-size: .8rem; padding: 4px 10px; }
 .page-buddy { inline-size: 92px; inset-block-end: 78px; inset-inline-start: 4px; }
}
@media (prefers-reduced-motion: reduce) { .lesson-buddy .buddy-layer.is-hop { animation: none; } }
/* the corner Wolfi's bubble grows inward from his side, so it is never cut off by the screen edge */
.page-buddy .buddy-bubble { inset-inline-start: 0; translate: none; }
/* on phones the lesson content can scroll clear of Wolfi, so he never hides the last card */
@media (max-width: 720px) { .player-kids .step-body { padding-block-end: 110px; } }

/* On phones Wolfi in the corner is smaller and without his speech bubble, so he never covers a button
   (he covered "Listen" on the pronunciation page). Pages get room at the bottom for him. */
@media (max-width: 720px) {
 .page-buddy { inline-size: 64px; inset-block-end: 76px; inset-inline-start: 2px; }
 .page-buddy .buddy-bubble { display: none; }
 body[data-mode="kids"] main { padding-block-end: 80px; }
}
