/* Sky Garden shell: the living sky behind every page, the frosted header with its dropdown menus, the language and
   tool buttons, the phone menu and tab bar, the cloud curtain between pages, reward bursts and the footer. */

/* ================= The living sky ================= */
.sg-sky {
    position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
    background:
        radial-gradient(60% 45% at 82% 6%, rgba(255, 244, 217, .95) 0%, rgba(255, 244, 217, 0) 62%),
        linear-gradient(180deg, #8FCBF6 0%, #BFE3FB 24%, #F2E8F6 58%, #FFF1EA 82%, #FDE9F0 100%);
    transition: background 1.2s ease;
}
.sg-sun {
    position: absolute; inset-inline-end: 8%; top: 6%; width: 150px; height: 150px; border-radius: 50%;
    background: radial-gradient(circle at 45% 40%, #FFF9E0 0%, #FFE7A3 45%, rgba(255, 220, 140, 0) 70%);
    opacity: .85; transition: opacity 1.2s, transform 1.2s;
}
.sg-stars {
    position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s;
    background-image:
        radial-gradient(1.6px 1.6px at 12% 18%, #fff 60%, transparent 62%),
        radial-gradient(1.2px 1.2px at 28% 8%, #fff 60%, transparent 62%),
        radial-gradient(1.8px 1.8px at 44% 22%, #FFF3C4 60%, transparent 62%),
        radial-gradient(1.2px 1.2px at 63% 12%, #fff 60%, transparent 62%),
        radial-gradient(1.6px 1.6px at 77% 26%, #fff 60%, transparent 62%),
        radial-gradient(1.2px 1.2px at 88% 9%, #FFF3C4 60%, transparent 62%),
        radial-gradient(1.4px 1.4px at 6% 40%, #fff 60%, transparent 62%),
        radial-gradient(1.2px 1.2px at 36% 44%, #fff 60%, transparent 62%),
        radial-gradient(1.6px 1.6px at 70% 48%, #fff 60%, transparent 62%),
        radial-gradient(1.2px 1.2px at 94% 38%, #fff 60%, transparent 62%);
    animation: sg-twinkle 4s ease-in-out infinite alternate;
}
@keyframes sg-twinkle { to { filter: brightness(1.5); opacity: .8; } }

.sg-cloud { position: absolute; width: 380px; height: 133px; filter: drop-shadow(0 18px 20px rgba(120, 90, 200, .14)); opacity: .95; animation: sg-drift 46s ease-in-out infinite alternate; }
.sg-cloud--1 { inset-inline-start: -90px; top: 14%; }
.sg-cloud--2 { inset-inline-end: -120px; top: 34%; width: 440px; height: 154px; animation-duration: 58s; animation-delay: -12s; }
.sg-cloud--3 { inset-inline-start: 22%; bottom: -40px; width: 520px; height: 182px; opacity: .9; animation-duration: 64s; animation-delay: -24s; }
.sg-cloud--4 { inset-inline-end: 12%; top: 72%; width: 300px; height: 105px; opacity: .8; animation-duration: 52s; animation-delay: -6s; }
@keyframes sg-drift { to { transform: translateX(60px); } }

.sg-drift { position: absolute; }
.sg-drift--balloon { inset-inline-start: 6%; top: 46%; width: 64px; height: 96px; animation: sg-float 9s ease-in-out infinite; --a: #7FD6C2; --b: #C7B5FF; }
.sg-balloon { width: 100%; height: 100%; filter: drop-shadow(0 14px 14px rgba(91, 63, 208, .2)); }
.sg-drift--kite { inset-inline-end: 4%; top: 18%; width: 54px; height: 108px; transform-origin: 50% 0; animation: sg-kite 6s ease-in-out infinite; }
.sg-kite { width: 100%; height: 100%; filter: drop-shadow(0 10px 10px rgba(91, 63, 208, .2)); }
@keyframes sg-float { 50% { transform: translateY(-22px) rotate(2deg); } }
@keyframes sg-kite { 0%, 100% { transform: rotate(-6deg) translateY(0); } 50% { transform: rotate(7deg) translateY(-14px); } }

.sg-lanterns { position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s; }
.sg-lanterns i {
    position: absolute; bottom: -60px; width: 18px; height: 26px; border-radius: 8px 8px 10px 10px;
    background: linear-gradient(180deg, #FFF3C2, #FFA34A);
    box-shadow: 0 0 18px 6px rgba(255, 190, 100, .55);
    animation: sg-rise 22s linear infinite;
}
.sg-lanterns i:nth-child(1) { inset-inline-start: 8%; animation-delay: -2s; }
.sg-lanterns i:nth-child(2) { inset-inline-start: 22%; animation-delay: -9s; transform: scale(.7); }
.sg-lanterns i:nth-child(3) { inset-inline-start: 37%; animation-delay: -15s; }
.sg-lanterns i:nth-child(4) { inset-inline-start: 55%; animation-delay: -5s; animation-duration: 26s; }
.sg-lanterns i:nth-child(5) { inset-inline-start: 68%; animation-delay: -18s; }
.sg-lanterns i:nth-child(6) { inset-inline-start: 82%; animation-delay: -11s; animation-duration: 28s; }
.sg-lanterns i:nth-child(7) { inset-inline-start: 93%; animation-delay: -21s; }
@keyframes sg-rise {
    0% { transform: translate(0, 0); opacity: 0; }
    10% { opacity: 1; }
    50% { transform: translate(18px, -55vh); }
    90% { opacity: 1; }
    100% { transform: translate(-6px, -112vh); opacity: 0; }
}

/* Lantern time: a Maghrib dusk with stars and rising sky lanterns. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .sg-sky { background: radial-gradient(55% 40% at 80% 100%, rgba(255, 156, 132, .55) 0%, rgba(255, 156, 132, 0) 70%), linear-gradient(180deg, #1C1A52 0%, #2C2B6E 34%, #5B3FA8 70%, #9A6BBE 100%); }
    :root:not([data-theme="light"]) .sg-sun { opacity: .9; transform: scale(.55); background: radial-gradient(circle at 60% 40%, #FFF8E1 0 38%, rgba(255, 224, 138, .5) 46%, rgba(255, 224, 138, 0) 70%); }
    :root:not([data-theme="light"]) .sg-stars, :root:not([data-theme="light"]) .sg-lanterns { opacity: 1; }
    :root:not([data-theme="light"]) .sg-cloud { opacity: .28; filter: none; }
}
:root[data-theme="dark"] .sg-sky { background: radial-gradient(55% 40% at 80% 100%, rgba(255, 156, 132, .55) 0%, rgba(255, 156, 132, 0) 70%), linear-gradient(180deg, #1C1A52 0%, #2C2B6E 34%, #5B3FA8 70%, #9A6BBE 100%); }
:root[data-theme="dark"] .sg-sun { opacity: .9; transform: scale(.55); background: radial-gradient(circle at 60% 40%, #FFF8E1 0 38%, rgba(255, 224, 138, .5) 46%, rgba(255, 224, 138, 0) 70%); }
:root[data-theme="dark"] .sg-stars, :root[data-theme="dark"] .sg-lanterns { opacity: 1; }
:root[data-theme="dark"] .sg-cloud { opacity: .28; filter: none; }
/* On a phone the moon sits right behind the breadcrumb's white words: dim it there so they stay readable. */
@media (max-width: 640px) and (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .sg-sun { opacity: .3; }
}
@media (max-width: 640px) {
    :root[data-theme="dark"] .sg-sun { opacity: .3; }
}

/* ================= Header ================= */
.sg-top {
    position: sticky; top: 0; z-index: 60;
    display: flex; align-items: center; gap: 14px;
    min-height: var(--top-h);
    padding: 8px var(--gutter);
    transition: background .35s, box-shadow .35s, min-height .35s;
}
.sg-top.is-solid {
    background: color-mix(in srgb, var(--paper) 80%, transparent);
    backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
    box-shadow: 0 1px 0 var(--line), 0 10px 30px -20px rgba(76, 52, 150, .45);
}
:root[data-theme="dark"] .sg-top.is-solid { background: rgba(30, 26, 78, .78); }
body.page-world .sg-top { position: fixed; inset-inline: 0; top: 0; }
/* Discovery World's header floats over the sky: the back-to-main-site strip floats above it and scrolls away. */
body.page-world .sg-mainsite { position: absolute; inset-inline: 0; top: 0; }
body.page-world .sg-top:not(.is-solid) { top: 34px; }
body.page-world .sg-top { transition: top .3s, background .35s, box-shadow .35s, min-height .35s; }

.k-brand { display: flex; align-items: center; gap: 11px; flex: none; text-decoration: none; color: var(--ink); }
.sg-brand-em {
    display: grid; place-items: center; width: 50px; height: 50px; border-radius: 17px;
    background: linear-gradient(160deg, #FFFFFF 0%, #EFE6FF 100%);
    box-shadow: inset 0 -3px 0 rgba(141, 114, 240, .22), 0 6px 14px -6px rgba(76, 52, 150, .5);
    transition: transform .4s var(--ease-bounce);
}
.k-brand:hover .sg-brand-em { transform: rotate(-8deg) scale(1.06); }
.sg-brand-em .k-mascot-svg { width: 32px; height: 40px; }
.k-brand-word { display: flex; flex-direction: column; line-height: 1; }
.k-brand-word b { display: flex; align-items: center; font-family: "Fredoka", "Baloo 2", sans-serif; font-weight: 700; font-size: 21px; letter-spacing: -.01em; white-space: nowrap; }
.k-brand-word b i {
    font-style: normal; display: inline-block; margin-inline-start: 5px; padding: 2px 9px 3px; border-radius: 999px;
    background: linear-gradient(180deg, #FFA796, #FF7462); color: #fff; font-size: 15px;
    transform: rotate(-4deg) translateY(-1px); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12);
}
.k-brand-word small { display: block; margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--ink-faint); letter-spacing: .02em; }

/* ---------- The top menu with its dropdowns ---------- */
.sg-nav { margin-inline: auto; }
.sg-nav-list {
    position: relative;
    display: flex; gap: 4px; margin: 0; padding: 5px; list-style: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, .55);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .75), 0 8px 24px -14px rgba(76, 52, 150, .55);
}
:root[data-theme="dark"] .sg-nav-list { background: rgba(46, 40, 108, .55); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), 0 8px 24px -14px rgba(0, 0, 0, .6); }
.sg-nav-item { position: static; }
.sg-nav-btn {
    display: flex; align-items: center; gap: 7px; height: 46px; padding-inline: 10px 14px;
    border: 0; border-radius: 999px; background: none; cursor: pointer;
    font-family: var(--font-display); font-weight: 600; font-size: 17.5px; color: var(--ink-soft);
    transition: background .2s, color .2s, transform .25s var(--ease-bounce);
}
.sg-nav-ico { flex: none; width: 28px; height: 28px; transition: transform .45s var(--ease-bounce); }
/* A menu word never breaks over two lines ("Grown-ups" stays whole). */
.sg-nav-btn { white-space: nowrap; }
.sg-chev { width: 15px; height: 15px; opacity: .6; transition: transform .3s var(--ease-bounce); }
.sg-nav-btn:hover { background: rgba(255, 255, 255, .8); color: var(--ink); transform: translateY(-1px); }
.sg-nav-btn:hover .sg-nav-ico { transform: rotate(-10deg) scale(1.12); }
.sg-nav-item.is-current > .sg-nav-btn, .sg-nav-item.is-open > .sg-nav-btn {
    background: #fff; color: var(--ink);
    box-shadow: 0 4px 12px -4px rgba(76, 52, 150, .35), inset 0 -2px 0 rgba(141, 114, 240, .15);
}
:root[data-theme="dark"] .sg-nav-btn:hover, :root[data-theme="dark"] .sg-nav-item.is-current > .sg-nav-btn, :root[data-theme="dark"] .sg-nav-item.is-open > .sg-nav-btn { background: rgba(255, 255, 255, .14); color: #fff; }
.sg-nav-item.is-open > .sg-nav-btn .sg-chev { transform: rotate(180deg); opacity: 1; }

.sg-drop {
    position: absolute; z-index: 70; top: calc(100% + 12px);
    inset-inline: -260px; margin-inline: auto; width: min(800px, calc(100vw - 32px));
    padding: 10px; border-radius: 30px;
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(22px) saturate(1.5); -webkit-backdrop-filter: blur(22px) saturate(1.5);
    box-shadow: inset 0 0 0 1.5px #fff, var(--shadow-l);
    visibility: hidden; opacity: 0; transform: translateY(-10px) scale(.98); transform-origin: 50% 0;
    transition: opacity .22s ease, transform .35s var(--ease-bounce), visibility 0s linear .22s;
}
:root[data-theme="dark"] .sg-drop { background: rgba(38, 33, 94, .94); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .12), var(--shadow-l); }
/* A bridge so moving the pointer from the button to the panel keeps it open. */
.sg-drop::before { content: ""; position: absolute; inset-inline: 0; top: -16px; height: 16px; }
.sg-nav-item.is-open > .sg-drop,
:root:not(.js) .sg-nav-item:hover > .sg-drop,
:root:not(.js) .sg-nav-item:focus-within > .sg-drop {
    visibility: visible; opacity: 1; transform: none;
    transition: opacity .22s ease, transform .35s var(--ease-bounce), visibility 0s;
}
.sg-drop-grid { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 10px; }
.sg-drop-lead { display: flex; flex-direction: column; gap: 8px; }
.sg-drop-feature {
    position: relative; display: flex; flex-direction: column; gap: 4px; flex: 1;
    min-height: 200px; padding: 18px; border-radius: 24px; overflow: hidden; isolation: isolate;
    text-decoration: none; color: var(--ink);
    background: radial-gradient(140px 120px at 85% 0%, color-mix(in srgb, var(--t) 45%, transparent), transparent 70%), linear-gradient(165deg, #fff 20%, var(--ts));
    box-shadow: inset 0 -4px 0 color-mix(in srgb, var(--t) 18%, transparent), inset 0 0 0 1px rgba(255, 255, 255, .8);
    transition: transform .35s var(--ease-bounce);
}
:root[data-theme="dark"] .sg-drop-feature { background: radial-gradient(140px 120px at 85% 0%, color-mix(in srgb, var(--t) 45%, transparent), transparent 70%), linear-gradient(165deg, rgba(255, 255, 255, .06), var(--ts)); }
.sg-drop-feature:hover { transform: translateY(-3px); }
.sg-drop-feature-art { width: 74px; height: 74px; margin-bottom: auto; transition: transform .5s var(--ease-bounce); }
.sg-drop-feature-art .sg-ico { width: 100%; height: 100%; }
.sg-drop-feature:hover .sg-drop-feature-art { transform: rotate(-10deg) scale(1.1); }
.sg-drop-feature b { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; line-height: 1.05; margin-top: 10px; }
.sg-drop-feature small { font-size: .9rem; font-weight: 600; color: var(--ink-soft); line-height: 1.25; }
.sg-drop-go { margin-top: 10px; align-self: flex-start; padding: 6px 14px; border-radius: 999px; background: var(--td); color: #fff; font-family: var(--font-display); font-weight: 600; font-size: .9rem; }
.sg-drop-feature--night { color: #fff; background: radial-gradient(120px 100px at 85% 10%, rgba(255, 216, 107, .45), transparent 70%), linear-gradient(160deg, #2B2350, #4A3D8F); }
.sg-drop-feature--night small { color: rgba(255, 255, 255, .8); }
.sg-drop-feature--night .sg-drop-go { background: #FFD45C; color: #2B2350; }
.sg-drop-books { display: flex; gap: 6px; margin-bottom: auto; }
.sg-drop-books img { width: 58px; height: 74px; object-fit: cover; border-radius: 6px 12px 12px 6px; box-shadow: 0 8px 14px -6px rgba(30, 10, 80, .5); transition: transform .4s var(--ease-bounce); }
.sg-drop-books img:nth-child(1) { transform: rotate(-6deg); }
.sg-drop-books img:nth-child(3) { transform: rotate(6deg); }
.sg-drop-feature:hover .sg-drop-books img { transform: translateY(-4px) rotate(0); }
.sg-drop-mini {
    display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 14px 6px 8px; border-radius: 18px;
    text-decoration: none; color: var(--ink); font-family: var(--font-display); font-weight: 600; font-size: .98rem;
    background: rgba(255, 255, 255, .7); box-shadow: inset 0 0 0 1px rgba(141, 114, 240, .14);
    transition: background .2s, transform .25s var(--ease-bounce);
}
:root[data-theme="dark"] .sg-drop-mini { background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.sg-drop-mini .k-ico { width: 30px; height: 30px; }
.sg-drop-mini:hover, .sg-drop-mini[aria-current="page"] { background: var(--grape-soft); transform: translateX(3px); }
:root[dir="rtl"] .sg-drop-mini:hover { transform: translateX(-3px); }
.sg-drop-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin: 0; padding: 0; list-style: none; align-content: start; }
.sg-drop-list--games { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sg-drop-link {
    position: relative; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 12px 8px 8px; border-radius: 20px;
    text-decoration: none; color: var(--ink);
    transition: background .2s, transform .25s var(--ease-bounce);
}
.sg-drop-link:hover, .sg-drop-link:focus-visible, .sg-drop-link[aria-current="page"] { background: var(--ts); }
.sg-drop-link:hover { transform: translateY(-2px); }
.sg-drop-ico {
    flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px;
    background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--t) 25%, #fff));
    box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--t) 25%, transparent), 0 8px 14px -8px color-mix(in srgb, var(--td) 70%, transparent);
    transition: transform .45s var(--ease-bounce);
}
.sg-drop-link:hover .sg-drop-ico { transform: rotate(-10deg) scale(1.08); }
.sg-drop-ico .k-ico { width: 34px; height: 34px; }
.sg-drop-ico--clay { background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--t) 18%, #fff)); }
.sg-drop-ico .sg-ico { width: 38px; height: 38px; }
.sg-drop-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.sg-drop-text b { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; }
.sg-drop-text small { margin-top: 3px; font-size: .84rem; font-weight: 600; color: var(--ink-faint); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sg-drop-link--game { min-height: 58px; }
.sg-drop-link--game .sg-drop-ico { width: 44px; height: 44px; }
.sg-drop-link--game .sg-drop-text b { font-size: .95rem; }

/* A lantern beside each place: lit once a child has finished something there. */
.sg-lantern-dot {
    flex: none; margin-inline-start: auto; width: 12px; height: 16px; border-radius: 5px 5px 6px 6px;
    background: transparent; opacity: 0;
    transition: background .4s, box-shadow .4s, opacity .4s;
}
.is-lit > .sg-lantern-dot { opacity: 1; }
.sg-drop-feature--map { background: linear-gradient(180deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, .95) 70%), var(--map) center 30% / cover no-repeat; }
:root[data-theme="dark"] .sg-drop-feature--map { background: linear-gradient(180deg, rgba(38, 33, 94, 0) 30%, rgba(38, 33, 94, .96) 72%), var(--map) center 30% / cover no-repeat; }
.sg-drop-feature--map .sg-drop-feature-art { visibility: hidden; }
.is-lit > .sg-lantern-dot, .sg-lantern-dot.is-lit { background: linear-gradient(180deg, #FFF3C2, #FFA34A); box-shadow: 0 0 12px 3px rgba(255, 190, 100, .7); }

/* ---------- Tools ---------- */
.k-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.sg-round { width: 48px; height: 48px; }
.sg-round svg { width: 24px; height: 24px; }
.sg-lantern-btn .sg-sw {
    position: relative; display: block; width: 30px; height: 30px; border-radius: 50%; overflow: hidden;
    background: linear-gradient(180deg, #9ED8FF, #D7EEFF); box-shadow: inset 0 2px 5px rgba(0, 60, 120, .25);
}
.sg-lantern-btn .sg-sw i {
    position: absolute; inset: 5px; border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #FFF6C8, #FFC23A); box-shadow: 0 0 10px #FFD45C;
    transition: transform .8s var(--ease-bounce), background .8s, box-shadow .8s;
}
:root[data-theme="dark"] .sg-lantern-btn .sg-sw { background: linear-gradient(180deg, #2C2B6E, #8A64C4 80%, #FF9C84); }
:root[data-theme="dark"] .sg-lantern-btn .sg-sw i { transform: rotate(-20deg); background: radial-gradient(circle at 60% 40%, #FFF8E1, #FFE08A); box-shadow: inset -7px -2px 0 0 #3A3585, 0 0 12px rgba(255, 224, 138, .8); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .sg-lantern-btn .sg-sw { background: linear-gradient(180deg, #2C2B6E, #8A64C4 80%, #FF9C84); }
    :root:not([data-theme="light"]) .sg-lantern-btn .sg-sw i { transform: rotate(-20deg); background: radial-gradient(circle at 60% 40%, #FFF8E1, #FFE08A); box-shadow: inset -7px -2px 0 0 #3A3585, 0 0 12px rgba(255, 224, 138, .8); }
}

.sg-pop { position: relative; }
.sg-pill-btn {
    display: flex; align-items: center; gap: 7px; height: 48px; padding-inline: 12px 14px;
    border: 0; border-radius: 999px; cursor: pointer;
    font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--grape-deep);
    background: var(--glass); 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;
}
:root[data-theme="dark"] .sg-pill-btn { color: var(--ink); }
.sg-pill-btn:hover { transform: translateY(-2px); background: var(--glass-strong); }
.sg-globe { width: 22px; height: 22px; }
.sg-pop-panel {
    position: absolute; z-index: 70; inset-inline-end: 0; top: calc(100% + 10px); min-width: 200px; padding: 8px;
    border-radius: 22px; background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: inset 0 0 0 1.5px #fff, var(--shadow-l);
    visibility: hidden; opacity: 0; transform: translateY(-6px) scale(.97); transform-origin: top right;
    transition: opacity .2s, transform .3s var(--ease-bounce), visibility 0s linear .2s;
}
:root[dir="rtl"] .sg-pop-panel { transform-origin: top left; }
:root[data-theme="dark"] .sg-pop-panel { background: rgba(38, 33, 94, .96); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .12), var(--shadow-l); }
.sg-pop.is-open > .sg-pop-panel, :root:not(.js) .sg-pop:focus-within > .sg-pop-panel { visibility: visible; opacity: 1; transform: none; transition: opacity .2s, transform .3s var(--ease-bounce), visibility 0s; }
.sg-pop-title { margin: 4px 10px 6px; font-family: var(--font-display); font-weight: 600; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.sg-pop-row {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 8px 12px; border-radius: 14px;
    text-decoration: none; color: var(--ink); font-family: var(--font-display); font-weight: 500; font-size: 1rem;
}
.sg-pop-row:hover { background: var(--grape-soft); }
.sg-pop-row[aria-current="true"] { background: var(--grape-soft); color: var(--grape-deep); font-weight: 600; }
:root[data-theme="dark"] .sg-pop-row[aria-current="true"] { color: #fff; }
.sg-pop-row[aria-current="true"]::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #8D72F0; }

.sg-who { height: 52px; }
.sg-nav-langs { display: none; }
.sg-burger { display: none; }
.sg-burger svg path { fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; transition: transform .3s var(--ease-bounce), opacity .2s; transform-origin: 12px 12px; }
.sg-burger[aria-expanded="true"] .sg-burger-a { transform: translateY(5px) rotate(45deg); }
.sg-burger[aria-expanded="true"] .sg-burger-b { opacity: 0; }
.sg-burger[aria-expanded="true"] .sg-burger-c { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 1180px) {
    .k-brand-word small { display: none; }
    .sg-nav-btn { padding-inline: 8px 10px; font-size: 16px; }
    .sg-nav-ico { width: 24px; height: 24px; }
}
@media (max-width: 1100px) and (min-width: 901px) {
    .k-brand-word { display: none; }
}
/* With a child picked, the "who's playing" chip takes room from the menu: on laptop widths the brand drops its
   address line and the menu tightens, so every menu word stays on one line. */
@media (max-width: 1380px) and (min-width: 901px) {
    .sg-top:has(.sg-who) .k-brand-word small { display: none; }
    .sg-top:has(.sg-who) .sg-nav-btn { gap: 5px; padding-inline: 8px 10px; font-size: 16px; }
    .sg-top:has(.sg-who) .sg-nav-ico { width: 24px; height: 24px; }
    .sg-top:has(.sg-who) .k-tools { gap: 6px; }
}
@media (max-width: 1180px) and (min-width: 901px) {
    .sg-top:has(.sg-who) .sg-who span { display: none; }
    .sg-top:has(.sg-who) .sg-who { padding-inline-end: 4px; }
    .sg-top:has(.sg-who) .k-brand-word { display: none; }
}
/* A narrow phone with a child picked: the "who's playing" button needs the room, so the brand keeps only Noor. */
@media (max-width: 440px) {
    .sg-top:has(.sg-who) .k-brand-word { display: none; }
}


/* ---------- Phones and small tablets: the menu becomes a friendly sheet ---------- */
@media (max-width: 900px) {
    .sg-top { gap: 8px; padding: 8px 12px; }
    .sg-burger { display: inline-grid; }
    .sg-lang { display: none; }
    .sg-who span { display: none; }
    .sg-who { height: 48px; padding-inline-end: 4px; }
    .k-tools { margin-inline-start: auto; gap: 6px; }
    .sg-round { width: 44px; height: 44px; }
    .sg-brand-em { width: 44px; height: 44px; border-radius: 15px; }
    .k-brand-word b { font-size: 18px; }
    .k-brand-word b i { font-size: 13px; }
    .sg-nav {
        position: fixed; z-index: 65; inset-inline: 10px; top: calc(var(--top-h) + 4px);
        max-height: calc(100dvh - var(--top-h) - 104px); overflow: auto; overscroll-behavior: contain;
        margin: 0; padding: 10px; border-radius: 30px;
        background: rgba(255, 255, 255, .95); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
        box-shadow: inset 0 0 0 1.5px #fff, var(--shadow-l);
        visibility: hidden; opacity: 0; transform: translateY(-12px) scale(.98);
        transition: opacity .22s, transform .35s var(--ease-bounce), visibility 0s linear .22s;
    }
    :root[data-theme="dark"] .sg-nav { background: rgba(38, 33, 94, .97); }
    body.sg-nav-open .sg-nav { visibility: visible; opacity: 1; transform: none; transition: opacity .22s, transform .35s var(--ease-bounce), visibility 0s; }
    .sg-nav-list { flex-direction: column; gap: 6px; padding: 0; background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
    .sg-nav-btn { width: 100%; height: 60px; padding-inline: 10px 16px; font-size: 1.2rem; border-radius: 22px; background: rgba(141, 114, 240, .07); }
    .sg-nav-btn .sg-chev { margin-inline-start: auto; width: 18px; height: 18px; }
    .sg-nav-ico { width: 36px; height: 36px; }
    .sg-drop {
        position: static; width: auto; margin: 6px 0 4px; padding: 0; border-radius: 0; background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
        display: none; visibility: visible; opacity: 1; transform: none;
    }
    .sg-nav-item.is-open > .sg-drop { display: block; animation: k-pop .3s var(--ease-bounce); }
    .sg-drop-grid { grid-template-columns: 1fr; }
    .sg-drop-feature { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 12px; }
    .sg-drop-feature-art, .sg-drop-books { display: none; }
    .sg-drop-feature b { margin: 0; font-size: 1.1rem; }
    .sg-drop-feature small { flex-basis: 100%; }
    .sg-drop-go { margin: 4px 0 0; }
    .sg-drop-list, .sg-drop-list--games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sg-drop-text small { display: none; }
    .sg-drop-link { min-height: 56px; padding: 6px; gap: 8px; }
    .sg-drop-ico { width: 42px; height: 42px; border-radius: 14px; }
    .sg-drop-ico .k-ico { width: 28px; height: 28px; }
    .sg-drop-ico .sg-ico { width: 32px; height: 32px; }
    .sg-drop-text b { font-size: .95rem; }
    .sg-nav-langs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; padding: 5px; border-radius: 22px; background: var(--grape-soft); }
    .sg-nav-langs a { flex: 1 1 auto; min-height: 44px; display: grid; place-items: center; padding: 0 10px; border-radius: 16px; text-decoration: none; font-family: var(--font-display); font-weight: 600; font-size: .95rem; color: var(--ink-soft); }
    .sg-nav-langs a[aria-current="true"] { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-s); }
    body.sg-nav-open::after { content: ""; position: fixed; inset: 0; z-index: 55; background: rgba(43, 35, 80, .25); backdrop-filter: blur(2px); }
}
/* A phone (about 390 px): the wordmark stacks ("Kids" under the name) and the round tools tighten a little, so the
   search, sound, night and menu buttons all stay on screen with no sideways scroll. */
@media (max-width: 440px) {
    .sg-top { gap: 6px; padding-inline: 10px; }
    .k-brand { gap: 7px; }
    .k-tools { gap: 4px; }
    .sg-top .sg-round { width: 42px; height: 42px; }
    .sg-top .sg-brand-em { width: 42px; height: 42px; border-radius: 14px; }
    .k-brand-word b { flex-direction: column; align-items: flex-start; gap: 3px; font-size: 16px; }
    .k-brand-word b i { margin-inline-start: 0; padding: 1px 8px 2px; font-size: 11px; }
}
@media (max-width: 380px) {
    .sg-drop-list, .sg-drop-list--games { grid-template-columns: 1fr; }
    .k-brand-word { display: none; }
}

/* ================= Phone tab bar ================= */
@media (max-width: 760px) {
    .k-tabbar {
        position: fixed; z-index: 50; inset-inline: 10px; bottom: 10px;
        display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
        padding: 6px; border-radius: 30px;
        background: rgba(255, 255, 255, .86);
        backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
        box-shadow: inset 0 0 0 1.5px #fff, var(--shadow-l);
        padding-bottom: calc(6px + env(safe-area-inset-bottom));
    }
    :root[data-theme="dark"] .k-tabbar { background: rgba(38, 33, 94, .9); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .12), var(--shadow-l); }
    .k-tabbar a {
        display: flex; flex-direction: column; align-items: center; gap: 1px;
        padding: 6px 2px 5px; border-radius: 22px; text-decoration: none;
        font-family: var(--font-display); font-weight: 600; font-size: .78rem; color: var(--ink-soft);
        transition: transform .25s var(--ease-bounce), background .2s;
    }
    .k-tabbar a .k-ico { width: 34px; height: 34px; transition: transform .4s var(--ease-bounce); }
    .k-tabbar a:active .k-ico { transform: scale(.88); }
    .k-tabbar a[aria-current="page"] { background: var(--grape-soft); color: var(--ink); }
    .k-tabbar a[aria-current="page"] .k-ico { transform: translateY(-3px) scale(1.08); }
}

/* ================= Footer ================= */
.sg-foot {
    position: relative; z-index: 1; margin-top: 70px; padding: 110px var(--gutter) 30px; text-align: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .92) 42%);
}
:root[data-theme="dark"] .sg-foot { background: linear-gradient(180deg, rgba(30, 26, 78, 0) 0%, rgba(30, 26, 78, .92) 42%); }
.sg-foot-clouds { position: absolute; inset-inline: 0; top: -10px; height: 150px; pointer-events: none; overflow: hidden; }
.sg-foot-cloud { position: absolute; top: 0; width: 34%; height: 140px; filter: drop-shadow(0 18px 18px rgba(120, 90, 200, .14)); }
.sg-foot-cloud:nth-child(1) { inset-inline-start: -4%; width: 30%; }
.sg-foot-cloud:nth-child(2) { inset-inline-start: 20%; }
.sg-foot-cloud:nth-child(3) { inset-inline-start: 48%; width: 30%; }
.sg-foot-cloud:nth-child(4) { inset-inline-end: -4%; width: 32%; }
:root[data-theme="dark"] .sg-foot-cloud { opacity: .18; }
.sg-foot-clouds::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 70px; background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 85%); }
:root[data-theme="dark"] .sg-foot-clouds::after { background: linear-gradient(180deg, rgba(30, 26, 78, 0), rgba(30, 26, 78, .95) 85%); }
.sg-foot-promise { position: relative; max-width: 860px; margin: 0 auto; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.15rem, 2.4vw, 1.5rem); line-height: 1.35; color: var(--ink); }
.sg-foot-links { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; margin: 18px 0 0; font-family: var(--font-display); font-weight: 500; }
.sg-foot-links a { color: var(--ink-soft); text-decoration: none; padding: 4px 2px; }
.sg-foot-links a:hover { color: var(--grape-deep); text-decoration: underline; text-underline-offset: 4px; }
.sg-foot-langs { position: relative; display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 16px; padding: 5px; border-radius: 999px; background: var(--grape-soft); }
.sg-foot-langs a { min-height: 36px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 999px; text-decoration: none; font-family: var(--font-display); font-weight: 600; font-size: .9rem; color: var(--ink-soft); }
.sg-foot-langs a[aria-current="true"] { background: var(--paper); color: var(--grape-deep); box-shadow: 0 6px 12px -6px rgba(76, 52, 150, .5); }
:root[data-theme="dark"] .sg-foot-langs a[aria-current="true"] { color: var(--ink); }
/* The last line: the copyright at the start, the credit (who designed and developed the site) at the bottom right. */
.sg-foot-fine { position: relative; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 20px; margin: 14px 0 0; font-size: .85rem; color: var(--ink-faint); }
.sg-foot-madeby a { color: var(--ink-soft); font-weight: 600; text-decoration: none; }
.sg-foot-madeby a:hover { color: var(--grape-deep); text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 760px) {
    .sg-foot { padding-bottom: 110px; }
    .sg-foot-fine { justify-content: center; }
}

/* ================= The cloud curtain between pages ================= */
.sg-curtain { position: fixed; inset: 0; z-index: 200; pointer-events: none; overflow: hidden; visibility: hidden; }
.sg-curtain::before {
    content: ""; position: absolute; inset: 0; opacity: 0;
    background: radial-gradient(70% 60% at 50% 50%, #FFFFFF 0%, #F6EEFF 60%, #DDEEFF 100%);
    transition: opacity .3s ease;
}
:root[data-theme="dark"] .sg-curtain::before { background: radial-gradient(70% 60% at 50% 50%, #5B3FA8 0%, #2C2B6E 70%, #1C1A52 100%); }
.sg-curtain-cloud { position: absolute; width: 70vw; height: 25vw; min-width: 520px; min-height: 182px; filter: drop-shadow(0 22px 26px rgba(120, 90, 200, .2)); transition: transform .5s cubic-bezier(.5, 0, .3, 1); }
.sg-curtain-cloud--1 { left: -10vw; top: -6vh; transform: translateX(-90vw); }
.sg-curtain-cloud--2 { right: -12vw; top: 14vh; transform: translateX(90vw); }
.sg-curtain-cloud--3 { left: -18vw; top: 36vh; transform: translateX(-90vw); }
.sg-curtain-cloud--4 { right: -16vw; top: 54vh; transform: translateX(90vw); }
.sg-curtain-cloud--5 { left: -8vw; top: 74vh; transform: translateX(-90vw); }
.sg-curtain-cloud--6 { right: -6vw; top: 86vh; transform: translateX(90vw); }
.sg-curtain-noor { position: absolute; left: 50%; top: 50%; width: 120px; height: 200px; margin: -100px 0 0 -60px; opacity: 0; transform: translateY(60px) scale(.8); transition: opacity .3s, transform .6s var(--ease-bounce); --a: #FF8A7A; --b: #FFD45C; }
.sg-curtain-balloon { position: absolute; inset: 0 0 auto 0; width: 120px; height: 180px; }
.sg-curtain-noor .k-mascot-svg { position: absolute; left: 44px; top: 128px; width: 32px; height: 40px; }
.sg-flying .sg-curtain, .sg-landing .sg-curtain { visibility: visible; }
.sg-flying .sg-curtain::before { opacity: 1; transition-delay: .18s; }
.sg-flying .sg-curtain-cloud { transform: none; }
.sg-flying .sg-curtain-noor { opacity: 1; transform: none; transition-delay: .2s; }
.sg-flying .sg-curtain-noor { animation: sg-float 1.6s ease-in-out .6s infinite; }
/* Arriving: the curtain starts closed and parts. */
.sg-landing .sg-curtain::before { animation: sg-veil-out .55s ease .1s both; }
.sg-landing .sg-curtain-cloud { animation: sg-part-left .8s cubic-bezier(.5, 0, .2, 1) .05s both; }
.sg-landing .sg-curtain-cloud--2, .sg-landing .sg-curtain-cloud--4, .sg-landing .sg-curtain-cloud--6 { animation-name: sg-part-right; }
.sg-landing .sg-curtain-noor { animation: sg-noor-up .7s ease both; }
@keyframes sg-veil-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes sg-part-left { from { transform: none; } to { transform: translateX(-95vw); } }
@keyframes sg-part-right { from { transform: none; } to { transform: translateX(95vw); } }
@keyframes sg-noor-up { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-50vh) scale(.7); } }
/* Arriving pages rise gently into place. */
.sg-landing .k-main > * { animation: sg-rise-in .7s var(--ease-soft) both; }
.sg-landing .k-main > *:nth-child(2) { animation-delay: .06s; }
.sg-landing .k-main > *:nth-child(3) { animation-delay: .12s; }
.sg-landing .k-main > *:nth-child(n+4) { animation-delay: .18s; }
@keyframes sg-rise-in { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

/* ================= Reward burst ================= */
.sg-burst { position: fixed; inset: 0; z-index: 95; pointer-events: none; display: grid; place-items: center; }
.sg-burst-core { position: relative; width: 240px; height: 240px; display: grid; place-items: center; animation: sg-burst-out 1.9s ease forwards; }
.sg-burst-rays { position: absolute; inset: -60px; border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(255, 216, 107, .55) 0deg 8deg, rgba(255, 216, 107, 0) 8deg 22deg); -webkit-mask: radial-gradient(closest-side, #000 30%, transparent 100%); mask: radial-gradient(closest-side, #000 30%, transparent 100%); animation: sg-spin 3s linear infinite; }
.sg-burst-star { position: relative; width: 150px; height: 150px; filter: drop-shadow(0 12px 22px rgba(240, 160, 30, .6)); animation: sg-star-pop .8s var(--ease-bounce) both; }
.sg-burst-star .sg-ico { width: 100%; height: 100%; }
.sg-burst-noor { position: absolute; inset-inline-end: -10px; bottom: 6px; width: 70px; height: 88px; animation: sg-noor-hop .8s var(--ease-bounce) .15s both; }
.sg-burst-word {
    position: absolute; top: calc(100% - 6px); width: max-content; max-width: min(90vw, 560px); text-align: center; padding: 10px 22px; border-radius: 28px;
    font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; color: #fff;
    background: linear-gradient(180deg, #A58CFF, #7A5CF0); box-shadow: inset 0 -3px 0 rgba(40, 10, 120, .25), 0 16px 28px -12px rgba(91, 63, 208, .9);
    animation: sg-star-pop .6s var(--ease-bounce) .2s both;
}
.sg-burst-bit { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px; animation: sg-bit 1.2s cubic-bezier(.15, .8, .3, 1) forwards; }
.sg-burst-bit .sg-ico { width: 100%; height: 100%; }
@keyframes sg-burst-out { 0%, 75% { opacity: 1; } 100% { opacity: 0; transform: scale(.9) translateY(-30px); } }
@keyframes sg-spin { to { transform: rotate(360deg); } }
@keyframes sg-star-pop { 0% { transform: scale(0) rotate(-60deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes sg-noor-hop { 0% { transform: translateY(40px) scale(.4); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes sg-bit { 0% { transform: translate(0, 0) scale(.3) rotate(0); opacity: 1; } 100% { transform: translate(var(--bx), var(--by)) scale(1) rotate(var(--br)); opacity: 0; } }

/* Little floating stars where a child tapped something good. */
.sg-pop-star { position: fixed; z-index: 96; width: 28px; height: 28px; pointer-events: none; animation: sg-pop-star .9s ease-out forwards; }
.sg-pop-star .sg-ico { width: 100%; height: 100%; }
@keyframes sg-pop-star { 0% { transform: translate(-50%, -50%) scale(.4); opacity: 1; } 100% { transform: translate(calc(-50% + var(--dx)), calc(-50% - 70px)) scale(1.1) rotate(25deg); opacity: 0; } }

/* ================= Noor's helper pill (inner pages) ================= */
.sg-noor-tip {
    position: fixed; z-index: 45; inset-inline-end: 18px; bottom: 18px;
    display: flex; align-items: center; gap: 10px; max-width: min(360px, calc(100vw - 36px));
    padding: 8px 14px 8px 8px; border-radius: 26px;
    background: var(--glass-strong); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    box-shadow: inset 0 0 0 1.5px var(--glass-edge), var(--shadow-l);
    font-weight: 600; font-size: .98rem; line-height: 1.3; color: var(--ink);
    transform: translateY(140%); transition: transform .5s var(--ease-bounce);
}
.sg-noor-tip.is-on { transform: none; }
.sg-noor-tip .sg-noor-face { flex: none; width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center; background: radial-gradient(circle at 50% 55%, #FFF3C8, #FFD07A); box-shadow: inset 0 -3px 0 rgba(200, 120, 0, .18); }
.sg-noor-tip .k-mascot-svg { width: 34px; height: 42px; }
.sg-noor-tip button { flex: none; width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--grape-soft); color: var(--ink); cursor: pointer; font-size: 1rem; line-height: 1; }
@media (max-width: 760px) { .sg-noor-tip { bottom: calc(96px + env(safe-area-inset-bottom)); inset-inline-end: 12px; } }


/* ================= Sky pages: a title column with the page's island, and a frosted main panel ================= */
.sg-page { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 28px; align-items: start; padding-top: 6px; }
.sg-page-side { position: sticky; top: calc(var(--top-h) + 10px); display: flex; flex-direction: column; gap: 14px; }
.sg-page-main { min-width: 0; padding: 20px; border-radius: 40px; background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: inset 0 0 0 1.5px var(--glass-edge), 0 40px 70px -40px rgba(91, 63, 208, .45); }
.sg-page-title {
    margin: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(2.4rem, 4.4vw, 3.5rem); line-height: 1; letter-spacing: -.035em;
    text-shadow: 0 2px 0 #fff, 0 3px 0 rgba(214, 200, 255, .9), 0 14px 28px rgba(91, 63, 208, .2);
}
.sg-page-title span { color: #FF6F5E; }
:root[data-theme="dark"] .sg-page-title { text-shadow: 0 0 30px rgba(255, 210, 140, .4); }
:root[data-theme="dark"] .sg-page-title span { color: #FFD45C; }
:root[lang="ar"] .sg-page-title, :root[lang="ur"] .sg-page-title { line-height: 1.4; letter-spacing: 0; }
.sg-page-intro { margin: 8px 0 0; font-size: 1.15rem; font-weight: 600; color: var(--ink-soft); }
.sg-window {
    --t: var(--coral);
    position: relative; display: grid; place-items: center; aspect-ratio: 1 / .8; overflow: hidden; border-radius: 34px; text-decoration: none;
    background: radial-gradient(60% 50% at 70% 20%, rgba(255, 244, 217, .9), transparent 70%), linear-gradient(180deg, #8CCBF6, #F8E6F0);
    box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .8), 0 30px 50px -30px rgba(76, 52, 150, .6);
    transition: transform .35s var(--ease-bounce);
}
:root[data-theme="dark"] .sg-window { background: radial-gradient(60% 50% at 70% 90%, rgba(255, 156, 132, .5), transparent 70%), linear-gradient(180deg, #2C2B6E, #8A64C4); }
.sg-window:hover { transform: translateY(-4px) rotate(-.5deg); }
.sg-window img { width: 86%; height: auto; filter: drop-shadow(0 20px 20px rgba(91, 63, 208, .25)); animation: sg-isle-bob 6s ease-in-out infinite; }
@keyframes sg-isle-bob { 50% { transform: translateY(-10px); } }
.sg-window-cloud { position: absolute; inset-inline-end: -40px; top: 16px; width: 200px; height: 70px; opacity: .9; animation: sg-drift 20s ease-in-out infinite alternate; }
.sg-window-tag {
    position: absolute; inset-inline-start: 14px; bottom: 14px; display: flex; align-items: center; gap: 8px; height: 38px; padding-inline: 6px 14px; border-radius: 999px;
    background: rgba(255, 255, 255, .9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #2B2350;
    font-family: var(--font-display); font-weight: 600; font-size: 15px; box-shadow: 0 10px 20px -10px rgba(76, 52, 150, .5);
}
.sg-window-tag i { position: relative; width: 26px; height: 26px; border-radius: 50%; background: var(--t); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .14); }
.sg-window-tag i::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #fff; }
.sg-noor-tip-card {
    display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; border-radius: 26px;
    background: var(--glass-strong); box-shadow: inset 0 0 0 1.5px var(--glass-edge), var(--shadow);
}
.sg-noor-tip-card .k-mascot-svg { width: 54px; height: 66px; flex: none; }
.sg-noor-tip-card p { margin: 0; font-size: 1rem; font-weight: 600; line-height: 1.35; color: var(--ink-soft); }
.sg-noor-tip-card b { color: var(--ink); font-family: var(--font-display); }


/* ================= Page heroes across the site: one frosted cloud band, one rounded title style ================= */
:is(.k-today-hero, .ec-hero, .k-parents-hero, .k-plan-hero, .k-qn-hero, .k-cw-intro, .k-cls-hero) {
    position: relative; padding: 18px 24px; border-radius: 34px;
    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);
}
:is(.k-salah-hero, .k-outline-hero, .ws-hero) { border: 0 !important; border-radius: 38px !important; box-shadow: inset 0 0 0 1.5px var(--glass-edge), var(--shadow-l) !important; }
:is(.k-salah-hero, .k-today-hero, .k-qn-hero, .ec-hero, .k-parents-hero, .k-plan-hero, .k-outline-hero, .k-cls-hero, .ws-hero, .k-cw-title, .k-reader-title) h1,
:is(.k-cw-title, .k-reader-title) {
    font-weight: 700; letter-spacing: -.03em;
    text-shadow: 0 2px 0 rgba(255, 255, 255, .85), 0 12px 24px rgba(91, 63, 208, .18);
}
:root[data-theme="dark"] :is(.k-salah-hero, .k-today-hero, .k-qn-hero, .ec-hero, .k-parents-hero, .k-plan-hero, .k-outline-hero, .k-cls-hero, .ws-hero) h1,
:root[data-theme="dark"] :is(.k-cw-title, .k-reader-title) { text-shadow: 0 0 26px rgba(255, 210, 140, .35); }
:root[lang="ar"] :is(.k-salah-hero, .k-today-hero, .k-qn-hero, .ec-hero, .k-parents-hero, .k-plan-hero, .k-outline-hero, .k-cls-hero, .ws-hero) h1,
:root[lang="ur"] :is(.k-salah-hero, .k-today-hero, .k-qn-hero, .ec-hero, .k-parents-hero, .k-plan-hero, .k-outline-hero, .k-cls-hero, .ws-hero) h1 { letter-spacing: 0; }
/* Cards and panels made for the old paper look pick up the cloud-panel finish. */
:is(.k-quiz, .k-story-card, .k-family-setup, .k-result-card, .k-trace-info, .k-cw-card, .k-today-card, .k-child-card) { border: 0; box-shadow: inset 0 0 0 1.5px var(--glass-edge), var(--shadow); }

/* ================= Reveal on scroll ================= */
.js .sg-rv { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .9s var(--ease-soft); }
.js .sg-rv.is-in { opacity: 1; transform: none; }

@media (max-width: 1100px) {
    .sg-page { grid-template-columns: 1fr; }
    .sg-page-side { position: static; display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
    .sg-side-head { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
    .sg-page-side { grid-template-columns: 1fr; }
    .sg-page-side .sg-window { display: none; }
    .sg-page-main { padding: 12px; border-radius: 30px; }
}

@media (prefers-reduced-motion: reduce) {
    .sg-window img,
    .sg-cloud, .sg-drift, .sg-lanterns i, .sg-stars { animation: none !important; }
    .sg-lanterns i { bottom: auto; top: 30%; }
    .sg-curtain { display: none; }
    .js .sg-rv { opacity: 1; transform: none; }
    .sg-burst { display: none; }
}
@media print { .sg-noor-tip, .sg-burst { display: none !important; } }

/* Island stills fade out softly into their clouds at the bottom edge. */
.sg-isle-fade, .sg-isle-img, .sg-window img, .sg-game-isle img, .sg-next-isle img { -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 47%, #000 74%, transparent 100%); mask-image: radial-gradient(ellipse 50% 50% at 50% 47%, #000 74%, transparent 100%); }

/* Lantern time: words drawn in a deep colour for daylight read in soft lilac on the dusk panels instead. */
:root[data-theme="dark"] :is(.k-child-add, .k-auth-links a, .k-eyebrow, .k-link-button, .k-child-plan > span:last-child, .k-join-note a, .k-worksheet, .k-plan-choice em, .k-answered, .k-reveal-line.is-right, .k-result-row small, .k-journey-ar, .ec-tool--warn, .k-trail-extra) { color: #E9E0FF; }
:root[data-theme="dark"] .k-child-add { border-color: rgba(233, 224, 255, .4); background: rgba(255, 255, 255, .05); }

/* The grown-ups' "this is part of a plan" card, on whichever page shows it (quiz rooms, learning plans). */
.k-qn-lock { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding: 22px; margin-bottom: 22px; background: linear-gradient(135deg, var(--grape-soft), var(--paper)); }
.k-qn-lock > div { flex: 1 1 260px; }
.k-qn-lock h2 { margin: 0 0 4px; }
.k-qn-lock p { margin: 0 0 10px; font-family: var(--font-read); color: var(--ink-soft); }
.k-qn-lock .k-lock-big { display: grid; place-items: center; width: 64px; height: 64px; flex: none; border-radius: 22px; background: var(--paper); color: var(--grape-deep); box-shadow: var(--shadow-s); }

/* On a phone the games and stories come first: Noor's side tip steps aside. */
@media (max-width: 760px) {
    .sg-arcade-side .sg-noor-tip-card, .sg-page-side .sg-noor-tip-card { display: none; }
    .sg-stars-card { padding: 10px 14px; }
    .sg-stars-row .sg-ico { width: 24px; height: 24px; }
}

/* ---------- The way back into the Discovery World (an activity opened from a spot in the world) ---------- */
.sg-worldback {
    position: fixed; z-index: 60; inset-inline-start: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); display: inline-flex; align-items: center; gap: 8px;
    max-width: calc(100vw - 32px); min-height: 48px; padding: 6px 16px 6px 8px; border-radius: 999px; text-decoration: none;
    font-family: var(--font-display); font-weight: 600; font-size: 15px; color: #fff; background: linear-gradient(180deg, #8B6CEB, #5B3FD0);
    box-shadow: 0 16px 30px -14px rgba(76, 52, 150, .8), inset 0 -3px 0 rgba(30, 10, 90, .25); animation: k-pop .55s var(--ease-bounce);
}
.sg-worldback svg { flex: none; width: 20px; height: 20px; }
.sg-worldback-lamp { flex: none; width: 12px; height: 18px; border-radius: 5px 5px 6px 6px; background: linear-gradient(180deg, #FFF3C2, #FFA34A); box-shadow: 0 0 12px 3px rgba(255, 190, 100, .75); }
.sg-worldback-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-worldback:hover, .sg-worldback:focus-visible { transform: translateY(-2px); }
.sg-worldback.is-done { background: linear-gradient(180deg, #FFD45C, #F5A31E); color: #4A2E00; animation: k-pop .55s var(--ease-bounce), sg-worldback-glow 2.2s ease-in-out infinite; }
@keyframes sg-worldback-glow { 50% { box-shadow: 0 0 0 8px rgba(255, 200, 74, .3), 0 16px 30px -14px rgba(160, 90, 0, .7); } }
@media (max-width: 760px) { .sg-worldback { bottom: calc(92px + env(safe-area-inset-bottom)); font-size: 14px; } }
@media (prefers-reduced-motion: reduce) { .sg-worldback, .sg-worldback.is-done { animation: none; } }
