/* Islamic Portal Kids — Sky Garden design system.
   A pastel daytime sky, clay-soft colours and frosted cloud panels; Lantern time (the dark theme) turns the sky to
   a Maghrib dusk. Big friendly controls, logical properties throughout so Arabic and Urdu mirror correctly.
   The shell (header, dropdowns, living sky, cloud curtain, footer) is in sky.css. */

/* Urdu is set in Jameel Noori Nastaleeq, the owner's choice (licence accepted 15 October 2026; source in
   docs/portal-2.0/LICENSING.md): an installed copy first, then the bundled 5.4 MB subset. unicode-range keeps
   it to Arabic-script letters and only Urdu text names it, so the other languages' pages never download it.
   Noto Nastaliq Urdu (Google Fonts, loaded on the Urdu pages) is the fallback. */
@font-face {
    font-family: "Jameel Noori Nastaleeq";
    src: local("Jameel Noori Nastaleeq"), local("JameelNooriNastaleeq"), url("../fonts/jameel-noori-nastaleeq.woff2") format("woff2");
    font-display: swap;
    unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF;
    /* Jameel draws small on its em; this brings it to the size of the other faces. */
    size-adjust: 125%;
}

:root {
    /* Ink is the colour of Noor's eyes. */
    --ink: #2B2350;
    --ink-soft: #554B86;
    --ink-faint: #6B6396;
    --paper: #FFFFFF;
    --cream: #FFF8F0;
    --page: #FFF4F1;
    --page-2: #CFEAFD;
    --line: rgba(120, 96, 200, .16);

    /* Sky Garden palette: sky, peach, mint, lilac, sunshine, coral, rose and leaf. */
    --grape: #8D72F0; --grape-deep: #5B3FD0; --grape-soft: #EFE8FF;
    --mint: #3FBF9B; --mint-deep: #147559; --mint-soft: #DDF8EE;
    --sun: #FFC84A; --sun-deep: #E39E00; --sun-soft: #FFF3CF;
    /* The deep shades carry text on white and white text on them, so each keeps at least 4.5:1 (WCAG AA). */
    --coral: #FF7F6E; --coral-deep: #CF4232; --coral-soft: #FFE8E4;
    --rose: #FF8FB8; --rose-deep: #C4436F; --rose-soft: #FFE9F2;
    --sky: #4FA8EE; --sky-deep: #1A6FB3; --sky-soft: #E2F3FF;
    --leaf: #5DBF73; --leaf-deep: #28803F; --leaf-soft: #E3F6E6;
    --peach: #FFC9A8; --lilac: #BCA8FF;
    --night: #2C2B6E;
    /* Clay button shades (owner, 2026-10-17): each colour's own hue, deepened until a white label passes 4.5:1 across
       the whole button, its lighter top included. The sun button keeps its colour and dark ink. */
    --grape-clay: #7051CC; --mint-clay: #05755B; --coral-clay: #B93F33;
    --rose-clay: #AB436E; --sky-clay: #006CAC; --leaf-clay: #027932;

    --accent: var(--grape);
    --accent-deep: var(--grape-deep);
    --accent-soft: var(--grape-soft);
    --accent-ink: #FFFFFF;
    --accent-clay: var(--grape-clay);

    /* Frosted glass for the cloud panels. */
    --glass: rgba(255, 255, 255, .72);
    --glass-strong: rgba(255, 255, 255, .9);
    --glass-edge: rgba(255, 255, 255, .9);

    --radius-s: 16px;
    --radius: 24px;
    --radius-l: 34px;
    --shadow-s: 0 6px 16px -8px rgba(76, 52, 150, .45), 0 1px 3px rgba(76, 52, 150, .08);
    --shadow: 0 18px 34px -18px rgba(76, 52, 150, .55), 0 2px 6px rgba(76, 52, 150, .07);
    --shadow-l: 0 34px 64px -28px rgba(76, 52, 150, .6), 0 8px 18px -8px rgba(76, 52, 150, .18);

    --font-display: "Fredoka", "Baloo 2", "Baloo Bhaijaan 2", "Segoe UI Rounded", system-ui, sans-serif;
    --font-body: "Baloo 2", "Fredoka", system-ui, sans-serif;
    --font-read: "Andika", "Baloo 2", system-ui, sans-serif;
    --font-arabic: "Noto Naskh Arabic", "Amiri", "Traditional Arabic", serif;
    --font-quran: "Amiri", "Noto Naskh Arabic", serif;

    --top-h: 80px;
    --gutter: clamp(16px, 4vw, 40px);
    --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
    --ease-soft: cubic-bezier(.2, 1, .3, 1);

    color-scheme: light;
}

:root[dir="rtl"] {
    --font-display: "Baloo Bhaijaan 2", "Fredoka", "Segoe UI", system-ui, sans-serif;
    --font-body: "Baloo Bhaijaan 2", "Baloo 2", system-ui, sans-serif;
    --font-read: "Baloo Bhaijaan 2", "Noto Naskh Arabic", system-ui, sans-serif;
}

/* Urdu reads in Nastaliq. The Latin faces come first and have no Arabic-script letters, so names and
   numbers keep the rounded face while every Urdu letter falls through to Jameel Noori Nastaleeq. */
:root[lang="ur"] {
    --font-urdu: "Jameel Noori Nastaleeq", "Noto Nastaliq Urdu", "Baloo Bhaijaan 2", serif;
    --font-display: "Fredoka", var(--font-urdu);
    --font-body: "Baloo 2", var(--font-urdu);
    --font-read: "Andika", "Baloo 2", var(--font-urdu);
}

.theme-ocean, .theme-sky { --accent: var(--sky); --accent-deep: var(--sky-deep); --accent-soft: var(--sky-soft); --accent-clay: var(--sky-clay); }
.theme-garden, .theme-meadow, .theme-leaf { --accent: var(--leaf); --accent-deep: var(--leaf-deep); --accent-soft: var(--leaf-soft); --accent-clay: var(--leaf-clay); }
/* The sun pages' plain button keeps the sun button's dark ink: --ink turns light in Lantern time, which was white on yellow. */
.theme-sunrise, .theme-desert, .theme-sun { --accent: var(--sun); --accent-deep: var(--sun-deep); --accent-soft: var(--sun-soft); --accent-ink: #2B2350; --accent-clay: var(--sun); }
.theme-night, .theme-grape { --accent: var(--grape); --accent-deep: var(--grape-deep); --accent-soft: var(--grape-soft); --accent-clay: var(--grape-clay); }
.theme-rose { --accent: var(--rose); --accent-deep: var(--rose-deep); --accent-soft: var(--rose-soft); --accent-clay: var(--rose-clay); }
.theme-coral { --accent: var(--coral); --accent-deep: var(--coral-deep); --accent-soft: var(--coral-soft); --accent-clay: var(--coral-clay); }
.theme-mint { --accent: var(--mint); --accent-deep: var(--mint-deep); --accent-soft: var(--mint-soft); --accent-clay: var(--mint-clay); }

/* Lantern time: the sky turns to a Maghrib dusk and every panel glows softly. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --ink: #FFF7EE; --ink-soft: #E3D8FF; --ink-faint: #BDB1EA;
        --paper: #2F2A6E; --cream: #29245F; --page: #1E1A4E; --page-2: #2C2B6E; --line: rgba(255, 255, 255, .14);
        --grape-soft: #3E3489; --mint-soft: #1F4E5E; --sun-soft: #4C3F55; --coral-soft: #533157;
        --rose-soft: #522F63; --sky-soft: #233F7A; --leaf-soft: #244E54;
        --glass: rgba(46, 40, 108, .72); --glass-strong: rgba(46, 40, 108, .9); --glass-edge: rgba(255, 255, 255, .14);
        --shadow-s: 0 6px 16px -8px rgba(0, 0, 0, .55); --shadow: 0 18px 34px -18px rgba(0, 0, 0, .65); --shadow-l: 0 34px 64px -28px rgba(0, 0, 0, .7);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --ink: #FFF7EE; --ink-soft: #E3D8FF; --ink-faint: #BDB1EA;
    --paper: #2F2A6E; --cream: #29245F; --page: #1E1A4E; --page-2: #2C2B6E; --line: rgba(255, 255, 255, .14);
    --grape-soft: #3E3489; --mint-soft: #1F4E5E; --sun-soft: #4C3F55; --coral-soft: #533157;
    --rose-soft: #522F63; --sky-soft: #233F7A; --leaf-soft: #244E54;
    --glass: rgba(46, 40, 108, .72); --glass-strong: rgba(46, 40, 108, .9); --glass-edge: rgba(255, 255, 255, .14);
    --shadow-s: 0 6px 16px -8px rgba(0, 0, 0, .55); --shadow: 0 18px 34px -18px rgba(0, 0, 0, .65); --shadow-l: 0 34px 64px -28px rgba(0, 0, 0, .7);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.5;
    color: var(--ink);
    /* The sky itself lives in .sg-sky (sky.css); this is the colour under it while it paints. */
    background: linear-gradient(180deg, var(--page-2) 0%, var(--page) 70%);
    background-attachment: fixed;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.1; margin: 0 0 .4em; letter-spacing: -.015em; }
p { margin: 0 0 1em; }

:focus-visible {
    outline: 4px solid #8D72F0;
    outline-offset: 3px;
    border-radius: 14px;
}

.k-sr-only {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.k-skip {
    position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100;
    background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 999px; text-decoration: none;
    transition: top .2s;
}
.k-skip:focus { top: 12px; }

.k-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Icons and avatars ---------- */
.k-ico { width: 1.6em; height: 1.6em; flex: none; vertical-align: middle; }
.sg-ico { width: 1.6em; height: 1.6em; flex: none; display: block; }
.k-avatar { width: 48px; height: 48px; flex: none; border-radius: 50%; }

/* ---------- Round tool buttons (the header's are refined in sky.css) ---------- */
.k-round {
    display: inline-grid; place-items: center;
    width: 50px; height: 50px; border-radius: 50%;
    border: 0; cursor: pointer;
    background: var(--glass); color: var(--grape-deep);
    box-shadow: inset 0 0 0 1px var(--glass-edge), var(--shadow-s);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    transition: transform .25s var(--ease-bounce), background .2s;
}
.k-round:hover { transform: translateY(-2px) scale(1.04); background: var(--glass-strong); }
.k-round:active { transform: scale(.94); }
.k-round svg { width: 25px; height: 25px; }
.k-round .k-sound-off { display: none; }
.k-round[aria-pressed="true"] .k-sound-on { display: none; }
.k-round[aria-pressed="true"] .k-sound-off { display: block; }

.k-who {
    display: inline-flex; align-items: center; gap: 10px;
    padding-block: 4px; padding-inline: 4px 16px;
    border-radius: 999px; border: 0; cursor: pointer;
    font-family: var(--font-display); font-weight: 600; font-size: 1rem; color: #fff;
    background: linear-gradient(180deg, #A58CFF, #7A5CF0);
    box-shadow: inset 0 -3px 0 rgba(40, 10, 120, .2), inset 0 1px 0 rgba(255, 255, 255, .35), 0 10px 20px -10px rgba(91, 63, 208, .8);
    transition: transform .25s var(--ease-bounce);
}
.k-who:hover { transform: translateY(-2px); }
.k-who .k-avatar { width: 42px; height: 42px; background: #fff; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .06); }

/* ---------- Buttons: clay pills ---------- */
.k-btn {
    --b: var(--accent-clay); --bd: var(--accent-deep); --bi: var(--accent-ink);
    position: relative;
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 56px; padding: 12px 26px;
    border: 0; border-radius: 999px; cursor: pointer;
    font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; letter-spacing: .005em;
    text-decoration: none; color: var(--bi);
    /* The top stays 90% shade (10% white) so a white label keeps 4.5:1 all the way up; the sun button keeps more sheen. */
    background: linear-gradient(180deg, color-mix(in srgb, var(--b) var(--b-sheen, 90%), #fff) 0%, var(--b) 55%, color-mix(in srgb, var(--b) 82%, var(--bd)) 100%);
    box-shadow:
        inset 0 -4px 0 color-mix(in srgb, var(--bd) 45%, transparent),
        inset 0 1.5px 0 rgba(255, 255, 255, .45),
        0 14px 24px -12px color-mix(in srgb, var(--bd) 80%, transparent);
    transform: translateY(0);
    transition: transform .2s var(--ease-bounce), box-shadow .2s ease, filter .2s;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.k-btn:hover { filter: brightness(1.04) saturate(1.06); transform: translateY(-3px); box-shadow: inset 0 -4px 0 color-mix(in srgb, var(--bd) 45%, transparent), inset 0 1.5px 0 rgba(255, 255, 255, .45), 0 20px 30px -14px color-mix(in srgb, var(--bd) 85%, transparent); }
.k-btn:active { transform: translateY(2px) scale(.98); box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--bd) 45%, transparent), 0 6px 12px -8px color-mix(in srgb, var(--bd) 80%, transparent); }
.k-btn[disabled], .k-btn[aria-disabled="true"] { filter: grayscale(.7) opacity(.6); cursor: not-allowed; transform: none; }
.k-btn .k-ico { width: 28px; height: 28px; }
.k-btn--grape { --b: var(--grape-clay); --bd: var(--grape-deep); --bi: #fff; }
.k-btn--mint { --b: var(--mint-clay); --bd: var(--mint-deep); --bi: #fff; }
.k-btn--sun { --b: var(--sun); --bd: var(--sun-deep); --bi: #2B2350; --b-sheen: 62%; }
.k-btn--coral { --b: var(--coral-clay); --bd: var(--coral-deep); --bi: #fff; }
.k-btn--sky { --b: var(--sky-clay); --bd: var(--sky-deep); --bi: #fff; }
.k-btn--leaf { --b: var(--leaf-clay); --bd: var(--leaf-deep); --bi: #fff; }
.k-btn--rose { --b: var(--rose-clay); --bd: var(--rose-deep); --bi: #fff; }
.k-btn--ghost {
    --b: #fff; --bd: #B8A8F0; --bi: #3D2E8F;
    background: var(--glass-strong);
    box-shadow: inset 0 0 0 1.5px var(--glass-edge), inset 0 -3px 0 rgba(141, 114, 240, .14), 0 12px 22px -14px rgba(76, 52, 150, .6);
}
:root[data-theme="dark"] .k-btn--ghost { --bi: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .k-btn--ghost { --bi: var(--ink); } }
.k-btn--small { min-height: 46px; padding: 8px 18px; font-size: 1rem; }
.k-btn--big { min-height: 70px; padding: 16px 36px; font-size: 1.4rem; }

.k-link { color: var(--accent-deep); font-weight: 700; text-underline-offset: 4px; }
/* Part 48: the sunshine accent is too light for link text on white (2.3:1). */
.theme-sunrise .k-link, .theme-desert .k-link, .theme-sun .k-link { color: color-mix(in srgb, var(--sun-deep) 55%, var(--ink)); }
:root[data-theme="dark"] .k-link { color: var(--ink); }

/* ---------- Layout ---------- */
.k-main { position: relative; z-index: 1; padding: 22px var(--gutter) 120px; max-width: 1320px; margin: 0 auto; }
.k-main--wide { max-width: none; padding-inline: 0; }

/* A page's title band: Noor beside a big rounded title, sitting on a soft cloud. */
.k-hero {
    position: relative;
    display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
    margin: 6px 0 28px; padding: 18px 26px;
    border-radius: var(--radius-l);
    background: var(--glass);
    backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
    box-shadow: inset 0 0 0 1.5px var(--glass-edge), var(--shadow);
    isolation: isolate;
}
.k-hero::after {
    content: ""; position: absolute; z-index: -1; inset-inline: 6% 6%; bottom: -26px; height: 54px; pointer-events: none;
    background: radial-gradient(closest-side, rgba(255, 255, 255, .85), rgba(255, 255, 255, 0));
    filter: blur(2px);
}
.k-hero h1 {
    font-size: clamp(2.1rem, 4.8vw, 3.4rem); font-weight: 700; margin: 0; letter-spacing: -.03em;
    text-shadow: 0 2px 0 rgba(255, 255, 255, .9), 0 3px 0 rgba(214, 200, 255, .9), 0 14px 28px rgba(91, 63, 208, .22);
}
:root[data-theme="dark"] .k-hero h1 { text-shadow: 0 2px 0 rgba(70, 50, 150, .6), 0 0 30px rgba(255, 210, 140, .4); }
.k-hero p { margin: 4px 0 0; color: var(--ink-soft); font-size: 1.15rem; font-weight: 600; }
.k-hero-mascot { width: 92px; flex: none; filter: drop-shadow(0 0 18px rgba(255, 210, 110, .6)); }

.k-card {
    position: relative;
    background: var(--glass-strong);
    border-radius: var(--radius-l);
    box-shadow: inset 0 0 0 1.5px var(--glass-edge), var(--shadow);
    border: 0;
}

.k-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }

.k-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 12px; border-radius: 999px;
    font-family: var(--font-display); font-size: .85rem; font-weight: 600;
    background: var(--accent-soft); color: var(--ink);
}

.k-reviewed {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px;
    font-size: .8rem; font-weight: 700; background: var(--leaf-soft); color: var(--ink);
}

.k-stars { display: inline-flex; gap: 3px; }
.k-stars i {
    width: 22px; height: 22px; display: inline-block;
    background: color-mix(in srgb, var(--ink) 14%, transparent);
    clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.k-stars i.is-on { background: linear-gradient(180deg, #FFE69A, #F7AE24); filter: drop-shadow(0 1px 0 rgba(200, 120, 0, .4)); }

/* ---------- Activity tiles: soft clay cards with their own colour wash ---------- */
.k-tile {
    --t: var(--grape); --td: var(--grape-deep); --ts: var(--grape-soft);
    position: relative; display: flex; flex-direction: column; gap: 8px; border: 0; font: inherit; text-align: start;
    min-height: 200px; padding: 20px;
    border-radius: 30px;
    text-decoration: none; color: var(--ink);
    background:
        radial-gradient(160px 130px at 100% 0%, color-mix(in srgb, var(--t) 34%, transparent) 0%, transparent 70%),
        linear-gradient(165deg, color-mix(in srgb, var(--paper) 92%, var(--ts)) 30%, var(--ts));
    box-shadow:
        inset 0 -5px 0 color-mix(in srgb, var(--t) 16%, transparent),
        inset 0 1.5px 0 rgba(255, 255, 255, .7),
        0 20px 32px -22px color-mix(in srgb, var(--td) 70%, rgba(76, 52, 150, .6));
    overflow: hidden; isolation: isolate;
    transition: transform .35s var(--ease-bounce), box-shadow .3s;
}
.k-tile::before {
    content: ""; position: absolute; z-index: -1; width: 170px; height: 170px; inset-inline-end: -56px; top: -64px;
    border-radius: 50%; background: rgba(255, 255, 255, .35);
}
:root[data-theme="dark"] .k-tile::before { background: rgba(255, 255, 255, .06); }
.k-tile:hover { transform: translateY(-6px) rotate(-.5deg); box-shadow: inset 0 -5px 0 color-mix(in srgb, var(--t) 16%, transparent), inset 0 1.5px 0 rgba(255, 255, 255, .7), 0 30px 40px -22px color-mix(in srgb, var(--td) 75%, rgba(76, 52, 150, .6)); }
.k-tile:active { transform: translateY(2px) scale(.99); }
.k-tile-icon {
    display: grid; place-items: center;
    width: 74px; height: 74px; border-radius: 24px;
    background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--t) 22%, #fff));
    box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--t) 22%, transparent), 0 10px 18px -10px color-mix(in srgb, var(--td) 70%, transparent);
    transition: transform .45s var(--ease-bounce);
}
.k-tile:hover .k-tile-icon { transform: rotate(-8deg) scale(1.08); }
.k-tile-icon .k-ico, .k-tile-icon .sg-ico { width: 52px; height: 52px; }
.k-tile h2, .k-tile h3 { font-size: 1.4rem; font-weight: 700; margin: 6px 0 0; letter-spacing: -.01em; }
.k-tile p { margin: 0; color: var(--ink-soft); font-size: 1rem; font-weight: 600; line-height: 1.3; }
.k-tile .k-stars { margin-top: auto; }
.k-tile-go {
    position: absolute; inset-inline-end: 16px; top: 18px;
    display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
    background: #fff; color: var(--td); font-size: 1.6rem; font-weight: 700; line-height: 1;
    box-shadow: 0 8px 16px -8px color-mix(in srgb, var(--td) 80%, transparent);
    transition: transform .35s var(--ease-bounce);
}
:root[dir="rtl"] .k-tile-go { transform: scaleX(-1); }
.k-tile:hover .k-tile-go { transform: translateX(4px); }
:root[dir="rtl"] .k-tile:hover .k-tile-go { transform: scaleX(-1) translateX(4px); }

.c-grape { --t: var(--grape); --td: var(--grape-deep); --ts: var(--grape-soft); --tc: var(--grape-clay); }
.c-mint { --t: var(--mint); --td: var(--mint-deep); --ts: var(--mint-soft); --tc: var(--mint-clay); }
.c-sun { --t: var(--sun); --td: var(--sun-deep); --ts: var(--sun-soft); --tc: var(--sun); }
.c-coral { --t: var(--coral); --td: var(--coral-deep); --ts: var(--coral-soft); --tc: var(--coral-clay); }
.c-sky, .c-ocean { --t: var(--sky); --td: var(--sky-deep); --ts: var(--sky-soft); --tc: var(--sky-clay); }
.c-leaf, .c-garden, .c-meadow { --t: var(--leaf); --td: var(--leaf-deep); --ts: var(--leaf-soft); --tc: var(--leaf-clay); }
.c-rose { --t: var(--rose); --td: var(--rose-deep); --ts: var(--rose-soft); --tc: var(--rose-clay); }
.c-sunrise, .c-desert { --t: var(--sun); --td: var(--sun-deep); --ts: var(--sun-soft); --tc: var(--sun); }
.c-night { --t: var(--grape); --td: var(--grape-deep); --ts: var(--grape-soft); --tc: var(--grape-clay); }

/* ---------- Mascot ---------- */
.k-mascot-svg { overflow: visible; }
.k-mascot-svg .noor-body { transform-origin: 60px 90px; animation: noor-bob 3.2s ease-in-out infinite; }
.k-mascot-svg .noor-glow { transform-origin: 60px 84px; animation: noor-glow 2.6s ease-in-out infinite; }
/* Noor is faceless: the flame carries the mood. Calm flicker; brighter and taller for wow; a quick flutter when talking. */
.k-mascot-svg .noor-flame { transform-origin: 60px 104px; animation: noor-flicker 2.2s ease-in-out infinite; }
.k-mascot-svg .noor-flame-in { transform-origin: 60px 100px; animation: noor-core 1.6s ease-in-out infinite; }
.k-mascot-svg .noor-spark { animation: noor-spark 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.k-mascot-svg .noor-spark:nth-of-type(2) { animation-delay: .8s; }
.k-mascot-svg .noor-spark:nth-of-type(3) { animation-delay: 1.6s; }
.is-wow .k-mascot-svg .noor-flame { animation: noor-flare .5s ease-out forwards; }
.is-talk .k-mascot-svg .noor-flame { animation: noor-flutter .22s infinite alternate; }
.is-cheer .k-mascot-svg .noor-body { animation: noor-cheer .6s var(--ease-bounce) 2; }
.is-look .k-mascot-svg .noor-body { animation: noor-tilt .8s ease; }

@keyframes noor-bob { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-6px) rotate(1.5deg); } }
@keyframes noor-glow { 0%, 100% { opacity: .55; transform: scale(.94); } 50% { opacity: .9; transform: scale(1.06); } }
@keyframes noor-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes noor-flicker { 0%, 100% { transform: scale(1, 1) rotate(0); } 30% { transform: scale(.97, 1.04) rotate(-2deg); } 65% { transform: scale(1.02, .97) rotate(1.5deg); } }
@keyframes noor-core { 0%, 100% { opacity: 1; } 50% { opacity: .82; } }
@keyframes noor-flare { to { transform: scale(1.18, 1.22); } }
@keyframes noor-flutter { from { transform: scale(1, 1); } to { transform: scale(1.06, 1.12); } }
@keyframes noor-spark { 0%, 100% { opacity: 0; transform: scale(.3); } 50% { opacity: 1; transform: scale(1); } }
@keyframes noor-cheer { 0% { transform: translateY(0) scale(1); } 40% { transform: translateY(-18px) scale(1.08) rotate(-6deg); } 100% { transform: translateY(0) scale(1); } }
@keyframes noor-tilt { 40% { transform: rotate(-10deg); } 75% { transform: rotate(6deg); } }
@keyframes noor-talk { to { transform: scaleY(.35); } }

.k-guide {
    display: flex; align-items: flex-end; gap: 12px;
}
.k-guide .k-mascot-svg { width: 84px; height: 104px; flex: none; filter: drop-shadow(0 0 16px rgba(255, 210, 110, .55)); }
.k-bubble {
    position: relative;
    padding: 14px 18px; border-radius: 26px; border-end-start-radius: 8px;
    background: var(--glass-strong); box-shadow: inset 0 0 0 1.5px var(--glass-edge), var(--shadow);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    font-family: var(--font-body); font-weight: 600; font-size: 1.1rem; line-height: 1.4;
    max-width: 560px;
}
.k-bubble strong { font-family: var(--font-display); font-weight: 600; }
.k-bubble [data-bubble-text] { color: var(--grape-deep); }
:root[data-theme="dark"] .k-bubble [data-bubble-text] { color: #FFE3A0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .k-bubble [data-bubble-text] { color: #FFE3A0; } }
.k-say {
    display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
    color: #fff; vertical-align: middle; margin-inline-start: 6px;
    background: linear-gradient(180deg, #FF9D8C, #FF6B59);
    box-shadow: inset 0 -3px 0 rgba(150, 30, 10, .18), 0 10px 18px -10px rgba(240, 90, 70, .8);
    transition: transform .25s var(--ease-bounce);
}
.k-say:hover { transform: scale(1.08); }
.k-say svg { width: 22px; height: 22px; }

/* ---------- Phone tab bar (styled in sky.css) ---------- */
.k-tabbar { display: none; }

/* ---------- Dialogs: a cloud card ---------- */
.k-dialog {
    border: 0; padding: 0; border-radius: 36px;
    width: min(560px, calc(100vw - 32px));
    background: var(--glass-strong); color: var(--ink);
    backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
    box-shadow: inset 0 0 0 1.5px var(--glass-edge), var(--shadow-l);
}
:root:not([data-theme="dark"]) .k-dialog { background: linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(246, 241, 255, .96)); }
.k-dialog::backdrop { background: radial-gradient(80% 60% at 50% 40%, rgba(120, 90, 220, .35), rgba(28, 24, 70, .6)); backdrop-filter: blur(6px); }
.k-dialog[open] { animation: k-pop .45s var(--ease-bounce); }
.k-dialog-body { padding: 30px; text-align: center; }
.k-dialog { max-height: calc(100vh - 32px); overflow: auto; }
.k-dialog .k-mascot-svg { width: 96px; height: 120px; display: block; margin: 0 auto 4px; filter: drop-shadow(0 0 18px rgba(255, 210, 110, .6)); }
.k-dialog h2 { font-size: 1.9rem; font-weight: 700; }
.k-dialog-close {
    position: absolute; inset-inline-end: 14px; top: 14px;
}

.k-who-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 14px; margin: 18px 0; }
.k-who-list form { margin: 0; }
.k-who-pick {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    width: 100%; padding: 16px 8px; border-radius: 28px; border: 0; cursor: pointer;
    background: var(--paper); font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; color: var(--ink);
    box-shadow: inset 0 -4px 0 rgba(141, 114, 240, .12), var(--shadow-s);
    transition: transform .3s var(--ease-bounce), background .2s;
}
.k-who-pick:hover { transform: translateY(-5px) scale(1.03); background: var(--accent-soft); }
.k-who-pick .k-avatar { width: 88px; height: 88px; box-shadow: 0 8px 16px -8px rgba(76, 52, 150, .5); }
.k-who-pick[aria-current="true"] { outline: 4px solid var(--sun); }


/* ---------- Toast ---------- */
.k-toast {
    position: fixed; inset-inline: 0; bottom: 104px; z-index: 80;
    display: flex; justify-content: center; pointer-events: none;
}
.k-toast > div {
    padding: 12px 22px; border-radius: 999px; background: var(--ink); color: var(--paper);
    font-family: var(--font-display); font-weight: 600; box-shadow: var(--shadow-l); animation: k-pop .35s var(--ease-bounce);
}

/* Confetti pieces (stars, crescents and bits of paper; the burst itself is in sky.css). */
.k-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.k-confetti i {
    position: absolute; top: -20px; width: 12px; height: 16px; border-radius: 3px;
    animation: k-fall var(--d, 2.4s) cubic-bezier(.2, .6, .4, 1) forwards;
}
.k-confetti i.is-star { width: 18px; height: 18px; border-radius: 0; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.k-confetti i.is-moon { width: 16px; height: 16px; border-radius: 50%; background: transparent !important; box-shadow: inset -5px -2px 0 0 var(--c, #FFC84A); }
@keyframes k-fall {
    0% { transform: translate3d(0, 0, 0) rotate(0); opacity: 1; }
    100% { transform: translate3d(var(--x, 0), 105vh, 0) rotate(var(--r, 540deg)); opacity: .9; }
}
@keyframes k-pop { 0% { transform: scale(.85); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* ---------- States ---------- */
.k-state {
    display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
    padding: 40px 20px; color: var(--ink-soft); font-weight: 600;
}
.k-state .k-mascot-svg { width: 110px; height: 136px; filter: drop-shadow(0 0 22px rgba(255, 210, 110, .7)); }
.k-state h1, .k-state h2 { color: var(--ink); font-family: var(--font-display); }
.k-state h1 { font-size: clamp(2rem, 5vw, 3rem); }

.k-loading-dots { display: inline-flex; gap: 6px; }
.k-loading-dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); animation: k-dot 1s infinite ease-in-out; }
.k-loading-dots i:nth-child(2) { animation-delay: .15s; }
.k-loading-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes k-dot { 0%, 100% { transform: translateY(0); opacity: .5; } 50% { transform: translateY(-8px); opacity: 1; } }

/* ---------- Forms (grown-ups) ---------- */
.k-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; text-align: start; }
.k-field label { font-family: var(--font-display); font-weight: 600; }
.k-field small { color: var(--ink-soft); font-family: var(--font-read); }
.k-input {
    width: 100%; min-height: 54px; padding: 12px 18px;
    border-radius: 18px; border: 0;
    background: var(--paper); font-family: var(--font-read); font-size: 1.05rem;
    box-shadow: inset 0 0 0 2px var(--line), inset 0 3px 6px rgba(76, 52, 150, .06);
    transition: box-shadow .2s;
}
.k-input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 5px color-mix(in srgb, var(--accent) 22%, transparent); }
.k-check { display: flex; gap: 12px; align-items: flex-start; font-family: var(--font-read); text-align: start; margin-bottom: 16px; }
.k-check input { width: 24px; height: 24px; flex: none; margin-top: 2px; accent-color: var(--grape); }
.k-alert {
    padding: 12px 18px; border-radius: 20px; margin-bottom: 16px; font-family: var(--font-read);
    background: var(--coral-soft); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--coral) 35%, transparent);
}
.k-alert--ok { background: var(--leaf-soft); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--leaf) 35%, transparent); }

.k-section-title { font-size: clamp(1.5rem, 2.8vw, 2.1rem); font-weight: 700; margin: 10px 0 18px; letter-spacing: -.02em; }
.k-about-note { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; color: var(--ink-soft); font-family: var(--font-read); font-size: .95rem; }

/* ---------- Pills, filters, breadcrumbs ---------- */
.k-filters { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-bottom: 26px; }
.k-filter-group { display: flex; flex-wrap: wrap; gap: 8px; }
.k-pill {
    min-height: 46px; padding: 8px 18px; border-radius: 999px; border: 0; cursor: pointer;
    font-family: var(--font-display); font-weight: 600; color: var(--ink-soft);
    background: var(--glass);
    box-shadow: inset 0 0 0 1px var(--glass-edge), 0 6px 14px -8px rgba(76, 52, 150, .45);
    transition: transform .25s var(--ease-bounce), background .2s;
}
.k-pill:hover { transform: translateY(-2px); background: var(--glass-strong); }
.k-pill[aria-pressed="true"] {
    color: #fff; background: linear-gradient(180deg, #7356E8, #5236C4);
    box-shadow: inset 0 -3px 0 rgba(40, 10, 120, .2), 0 10px 18px -10px rgba(91, 63, 208, .8);
}

/* ---------- Breadcrumbs: Discovery World › … › this page ---------- */
.k-crumbs { margin: 0 0 14px; font-family: var(--font-display); font-weight: 600; font-size: .92rem; line-height: 1.2; }
.k-crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; margin: 0; padding: 0; list-style: none; }
.k-crumbs li { display: inline-flex; align-items: center; min-width: 0; }
.k-crumbs li + li::before {
    content: ""; flex: none; width: 16px; height: 16px; margin-inline: 4px; background: var(--ink-faint);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6l6 6-6 6' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6l6 6-6 6' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
:root[dir="rtl"] .k-crumbs li + li::before { transform: scaleX(-1); }
.k-crumbs a {
    display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 2px 8px; border-radius: 999px;
    color: var(--ink-soft); text-decoration: none; transition: background .2s, color .2s;
}
.k-crumbs li:first-child a { padding-inline-start: 4px; }
.k-crumbs a:hover { color: var(--ink); background: var(--glass); }
.k-crumbs a:focus-visible { outline: 3px solid var(--grape); outline-offset: 1px; }
.k-crumbs-home { flex: none; width: 22px; height: 22px; }
.k-crumbs [aria-current="page"] {
    padding: 2px 8px; color: var(--ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: min(60vw, 420px);
}
@media print { .k-crumbs, .sg-mainsite { display: none !important; } }

/* ---------- Back to the main website: a slim strip above the header ---------- */
.sg-mainsite { position: relative; z-index: 61; display: flex; padding: 6px var(--gutter) 0; }
.sg-mainsite a {
    display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 2px 12px 2px 8px; border-radius: 999px;
    font-family: var(--font-display); font-weight: 600; font-size: .82rem; color: var(--ink-soft); text-decoration: none;
    background: rgba(255, 255, 255, .5); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7);
    transition: background .2s, color .2s;
}
.sg-mainsite a:hover { color: var(--ink); background: rgba(255, 255, 255, .85); }
.sg-mainsite a:focus-visible { outline: 3px solid var(--grape); outline-offset: 2px; }
.sg-mainsite svg { flex: none; width: 16px; height: 16px; }
:root[dir="rtl"] .sg-mainsite svg { transform: scaleX(-1); }
.sg-mainsite small { font-size: inherit; font-weight: 500; color: var(--ink-faint); }
.sg-mainsite small::before { content: "·"; margin-inline-end: 6px; }
:root[data-theme="dark"] .sg-mainsite a { background: rgba(46, 40, 108, .55); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .sg-mainsite a { background: rgba(46, 40, 108, .55); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
}
@media (max-width: 560px) { .sg-mainsite small { display: none; } }
/* The Teen Academy: a grown-up midnight pill beside the main-site link, for older children. */
.sg-mainsite { gap: 8px; flex-wrap: wrap; }
.sg-mainsite a.sg-teens { color: #7cf3c8; background: linear-gradient(135deg, #0a1226, #14204a); box-shadow: inset 0 0 0 1px rgba(124, 243, 200, .35); }
.sg-mainsite a.sg-teens:hover { color: #fff; background: linear-gradient(135deg, #0d1630, #1b2a60); }
.sg-mainsite a.sg-teens small { color: rgba(237, 242, 253, .7); }
.sg-ptools a.is-teens { color: #edf2fd; background: radial-gradient(80% 120% at 100% 0%, rgba(47, 211, 155, .3), transparent 60%), linear-gradient(150deg, #0a1226, #060b18); }
.sg-ptools a.is-teens small { color: rgba(237, 242, 253, .72); }
.sg-ptools a.is-teens .sg-ptools-star { display: grid; place-items: center; color: #f2c46d; background: rgba(255, 255, 255, .1); }
.sg-ptools a.is-teens .sg-ptools-arr { color: #7cf3c8; }
.sg-ptools a.is-teens .sg-ptools-star svg { width: 70%; height: 70%; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
    :root { --top-h: 68px; }
    body { font-size: 17px; }
    .k-main { padding-top: 14px; }
    .k-hero { padding: 14px 16px; gap: 12px; }
    .k-hero-mascot { width: 64px; }
    .k-tile { min-height: 160px; }
}

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

@media print {
    .k-top, .k-tabbar, .k-foot, .k-toast, .k-noprint, .sg-sky, .sg-curtain { display: none !important; }
    body { background: #fff; }
    .k-hero { box-shadow: none; background: none; backdrop-filter: none; }
}


/* "Today's lessons" ribbon on the world map for a child with a learning plan. */
.k-today-ribbon {
    display: flex; align-items: center; gap: 14px; max-width: 560px; margin: 0 auto 18px; padding: 10px 14px 10px 10px;
    border-radius: 999px; text-decoration: none; color: #2B2350; --t: var(--grape); --td: var(--grape-deep);
    background: linear-gradient(180deg, #FFE69A, #FFC84A);
    box-shadow: inset 0 -4px 0 rgba(200, 120, 0, .25), inset 0 1.5px 0 rgba(255, 255, 255, .6), 0 16px 28px -14px rgba(227, 158, 0, .8);
    transition: transform .3s var(--ease-bounce);
}
.k-today-ribbon:hover { transform: translateY(-3px); }
.k-today-ribbon-icon { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 50%; background: rgba(255, 255, 255, .7); }
.k-today-ribbon-icon .k-ico { width: 34px; height: 34px; }
.k-today-ribbon b, .k-today-ribbon small { display: block; }
.k-today-ribbon b { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; }
.k-today-ribbon small { font-weight: 600; font-size: .95rem; }
.k-today-ribbon .k-tile-go { position: static; margin-inline-start: auto; }

/* Content written in English (lessons, quiz questions) keeps its own direction on Arabic and Urdu pages, aligned with the page. */
:root[dir="rtl"] [dir="auto"] { text-align: right; }

/* ---------- Urdu: Nastaliq has tall ascenders and deep descenders, so Urdu pages give every line more room. ---------- */
:root[lang="ur"] body { line-height: 2; }
:root[lang="ur"] :is(h1, h2, h3, h4) { line-height: 1.75; letter-spacing: 0; }
