:root,
[data-theme="sunny-play"] {
    /* === Brand palette === */
    --cream: #fff8ea;
    --cream-deep: #fff2d8;
    --paper: rgba(255, 255, 255, 0.92);
    --ink: #23324a;
    --muted: #6f7f95;
    --sun: #ffd84d;
    --orange: #ff9f43;
    --pink: #ff6fa5;
    --purple: #8e68ff;
    --sky: #59c9ff;
    --teal: #4ce0d2;
    --leaf: #99d84f;
    --coral: #ff7e67;
    --line: rgba(166, 189, 212, 0.5);

    /* === Theme tokens === */
    --bg-page-base: #fff6df;
    --bg-page-mid: #fffdf7;
    --bg-page-end: #fff7ee;
    --bg-surface: rgba(255, 255, 255, 0.92);
    --bg-surface-raised: rgba(255, 255, 255, 0.95);
    --bg-header: rgba(255, 247, 233, 0.84);
    --bg-footer-start: rgba(255, 255, 255, 0.96);
    --bg-footer-end: rgba(255, 245, 236, 0.92);
    --bg-filter: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(255, 248, 238, 0.94));
    --bg-prose: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 250, 242, 0.95));
    --bg-hero-panel: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(255, 244, 228, 0.98));
    --bg-card-playful: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 250, 244, 0.92));
    --bg-input: rgba(255, 255, 255, 0.92);
    --bg-chip: rgba(255, 216, 77, 0.22);
    --bg-chip-soft: rgba(89, 201, 255, 0.15);
    --bg-kicker: rgba(35, 50, 74, 0.06);
    --bg-empty: rgba(255, 248, 231, 0.5);
    --bg-example: rgba(255, 248, 231, 0.8);
    --bg-faq: rgba(255, 248, 231, 0.74);
    --bg-quiz-option: rgba(255, 255, 255, 0.96);
    --bg-quiz-result: rgba(142, 104, 255, 0.1);
    --bg-nav-pill: rgba(255, 255, 255, 0.65);
    --bg-selection: rgba(255, 159, 67, 0.3);
    --bg-scrolltrack: rgba(255, 248, 231, 0.5);
    --text-chip: #7d5700;
    --text-chip-soft: #15516e;
    --border-input: rgba(255, 159, 67, 0.18);
    --border-header: rgba(255, 255, 255, 0.55);
    --border-quiz: rgba(166, 189, 212, 0.4);
    --border-empty: rgba(255, 159, 67, 0.3);
    --border-video: rgba(255, 255, 255, 0.72);
    --border-footer-fun: rgba(255, 159, 67, 0.3);

    /* Mist overlays for section backgrounds */
    --mist-pink: rgba(255, 111, 165, 0.14);
    --mist-sky: rgba(89, 201, 255, 0.14);
    --mist-sun: rgba(255, 216, 77, 0.18);
    --mist-mint: rgba(76, 224, 210, 0.14);

    /* Section block tinting */
    --section-tint-1: linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(255, 244, 229, 0.38));
    --section-tint-2: linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(239, 249, 255, 0.38));
    --section-tint-3: linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(240, 253, 246, 0.38));
    --section-tint-4: linear-gradient(180deg, rgba(255, 255, 255, 0.46), rgba(255, 242, 247, 0.36));
    --section-first-bg: linear-gradient(180deg, rgba(255, 248, 231, 0.84), rgba(255, 240, 228, 0.6));
    --section-soft-bg: linear-gradient(180deg, rgba(89, 201, 255, 0.08), rgba(255, 255, 255, 0));

    /* Page hero theme tints */
    --hero-learning-bg: linear-gradient(180deg, rgba(255, 248, 231, 0.96), rgba(255, 236, 218, 0.94));
    --hero-rhymes-bg: linear-gradient(180deg, rgba(255, 243, 232, 0.97), rgba(255, 231, 239, 0.94));
    --hero-worksheets-bg: linear-gradient(180deg, rgba(247, 251, 255, 0.97), rgba(236, 249, 247, 0.94));
    --hero-stories-bg: linear-gradient(135deg, rgba(255, 241, 196, 0.9), rgba(255, 224, 201, 0.92), rgba(216, 248, 237, 0.92));
    --story-placeholder-bg: linear-gradient(135deg, rgba(255, 214, 102, 0.38), rgba(110, 193, 228, 0.32));
    --hero-logic-bg: linear-gradient(180deg, rgba(238, 248, 255, 0.97), rgba(244, 239, 255, 0.95));
    --hero-skill-labs-bg: linear-gradient(135deg, rgba(255, 240, 189, 0.88), rgba(205, 243, 255, 0.92), rgba(255, 225, 233, 0.92));
    --skill-card-media-bg: linear-gradient(135deg, rgba(255, 241, 202, 0.95), rgba(208, 245, 255, 0.95), rgba(255, 228, 236, 0.95));
    --hero-contact-bg: linear-gradient(135deg, rgba(224, 242, 255, 0.96), rgba(255, 236, 248, 0.94), rgba(236, 252, 240, 0.94));
    --hero-parents-bg: linear-gradient(135deg, rgba(255, 248, 210, 0.94), rgba(210, 242, 255, 0.92));
    --hero-support-bg: linear-gradient(135deg, rgba(255, 214, 232, 0.78), rgba(219, 244, 255, 0.9));
    --hero-illustration-bg: rgba(255, 255, 255, 0.82);

    /* Accent backgrounds for cards */
    --accent-sun: linear-gradient(160deg, rgba(255, 216, 77, 0.32), rgba(255, 255, 255, 0.94));
    --accent-sky: linear-gradient(160deg, rgba(89, 201, 255, 0.26), rgba(255, 255, 255, 0.94));
    --accent-leaf: linear-gradient(160deg, rgba(153, 216, 79, 0.24), rgba(255, 255, 255, 0.94));
    --accent-coral: linear-gradient(160deg, rgba(255, 126, 103, 0.24), rgba(255, 255, 255, 0.94));

    /* Mini-card backgrounds */
    --mini-a: linear-gradient(145deg, rgba(255, 216, 77, 0.34), rgba(255, 159, 67, 0.22));
    --mini-b: linear-gradient(145deg, rgba(89, 201, 255, 0.26), rgba(142, 104, 255, 0.18));
    --mini-c: linear-gradient(145deg, rgba(76, 224, 210, 0.3), rgba(153, 216, 79, 0.18));
    --mini-d: linear-gradient(145deg, rgba(255, 126, 103, 0.25), rgba(255, 111, 165, 0.2));

    /* Nav pill tints */
    --nav-1: rgba(255, 216, 77, 0.2);
    --nav-2: rgba(89, 201, 255, 0.16);
    --nav-3: rgba(153, 216, 79, 0.18);
    --nav-4: rgba(255, 126, 103, 0.17);
    --nav-5: rgba(142, 104, 255, 0.14);
    --nav-6: rgba(255, 111, 165, 0.14);

    /* Hero badge tints */
    --badge-sun: rgba(255, 216, 77, 0.28);
    --badge-sky: rgba(89, 201, 255, 0.22);
    --badge-leaf: rgba(153, 216, 79, 0.22);
    --badge-coral: rgba(255, 126, 103, 0.2);

    /* Icon cloud tints */
    --cloud-1: rgba(255, 216, 77, 0.46);
    --cloud-2: rgba(89, 201, 255, 0.34);
    --cloud-3: rgba(153, 216, 79, 0.3);
    --cloud-4: rgba(255, 126, 103, 0.28);

    /* Card media backgrounds */
    --media-learning: linear-gradient(135deg, rgba(255, 216, 77, 0.28), rgba(255, 111, 165, 0.2));
    --media-rhyme: linear-gradient(145deg, rgba(255, 111, 165, 0.22), rgba(255, 216, 77, 0.2), rgba(89, 201, 255, 0.18));
    --media-worksheet: linear-gradient(145deg, rgba(89, 201, 255, 0.18), rgba(76, 224, 210, 0.18), rgba(255, 216, 77, 0.22));

    /* Shadows */
    --shadow-soft: 0 16px 40px rgba(69, 56, 115, 0.12);
    --shadow-bold: 0 18px 44px rgba(255, 111, 165, 0.18);
    --shadow-bounce: 0 20px 50px rgba(255, 111, 165, 0.25);
    --shadow-header: 0 4px 20px rgba(255, 159, 67, 0.1);
    --shadow-card-hover: 0 25px 50px rgba(69, 56, 115, 0.2);

    /* Radii */
    --radius-xl: 30px;
    --radius-lg: 24px;
    --radius-md: 18px;

    /* Gradients */
    --gradient-rainbow: linear-gradient(135deg, #ff6fa5 0%, #ff9f43 28%, #ffd84d 52%, #99d84f 76%, #59c9ff 100%);
    --gradient-sunset: linear-gradient(135deg, #ff9f43 0%, #ff6fa5 52%, #8e68ff 100%);
    --gradient-learning: linear-gradient(135deg, rgba(255, 216, 77, 0.28), rgba(255, 111, 165, 0.2));
    --gradient-logic: linear-gradient(135deg, rgba(89, 201, 255, 0.22), rgba(142, 104, 255, 0.18));
    --gradient-worksheet: linear-gradient(135deg, rgba(255, 126, 103, 0.2), rgba(255, 216, 77, 0.2));
    --gradient-magic: linear-gradient(135deg, #ff6fa5, #ffd84d, #59c9ff, #99d84f, #ff6fa5);

    /* Body blobs */
    --blob-tr: radial-gradient(circle, rgba(255, 216, 77, 0.58), transparent 66%);
    --blob-bl: radial-gradient(circle, rgba(76, 224, 210, 0.54), transparent 66%);
    --bg-body-spots:
        radial-gradient(circle at 9% 14%, rgba(255, 111, 165, 0.24), transparent 18rem),
        radial-gradient(circle at 88% 12%, rgba(89, 201, 255, 0.26), transparent 17rem),
        radial-gradient(circle at 20% 84%, rgba(255, 216, 77, 0.24), transparent 21rem),
        radial-gradient(circle at 78% 76%, rgba(76, 224, 210, 0.2), transparent 18rem);

    /* Decorative star opacity for page-shell */
    --deco-star-opacity: 0.4;
    --deco-dot-opacity: 0.55;
    --deco-line-opacity: 0.38;
    --deco-blob-opacity: 0.35;

    /* Focus */
    --focus-color: var(--orange);

    /* Theme-color meta */
    --theme-color: #f4a81f;
}

/* =========================================================
   CALM-SKY THEME
   ========================================================= */
[data-theme="calm-sky"] {
    --cream: #eef6fc;
    --cream-deep: #dceef8;
    --paper: rgba(240, 248, 255, 0.92);
    --ink: #1e3a50;
    --muted: #5e8299;
    --sun: #f0d96b;
    --orange: #e8a550;
    --pink: #e88aad;
    --purple: #7b8dd8;
    --sky: #58b8e8;
    --teal: #54c4b8;
    --leaf: #7cc04a;
    --coral: #e89080;
    --line: rgba(130, 170, 200, 0.4);

    --bg-page-base: #e8f1f8;
    --bg-page-mid: #f0f6fb;
    --bg-page-end: #eaf3f9;
    --bg-surface: rgba(240, 248, 255, 0.92);
    --bg-surface-raised: rgba(245, 250, 255, 0.95);
    --bg-header: rgba(232, 244, 252, 0.88);
    --bg-footer-start: rgba(240, 248, 255, 0.96);
    --bg-footer-end: rgba(228, 240, 250, 0.92);
    --bg-filter: linear-gradient(180deg, rgba(240, 248, 255, 0.97), rgba(228, 240, 250, 0.94));
    --bg-prose: linear-gradient(180deg, rgba(240, 248, 255, 0.94), rgba(235, 245, 252, 0.95));
    --bg-hero-panel: linear-gradient(145deg, rgba(240, 248, 255, 0.94), rgba(228, 240, 250, 0.98));
    --bg-card-playful: linear-gradient(180deg, rgba(240, 248, 255, 0.95), rgba(235, 245, 252, 0.92));
    --bg-input: rgba(245, 250, 255, 0.92);
    --bg-chip: rgba(88, 184, 232, 0.18);
    --bg-chip-soft: rgba(84, 196, 184, 0.15);
    --bg-kicker: rgba(30, 58, 80, 0.06);
    --bg-empty: rgba(232, 244, 252, 0.5);
    --bg-example: rgba(232, 244, 252, 0.8);
    --bg-faq: rgba(232, 244, 252, 0.74);
    --bg-quiz-option: rgba(245, 250, 255, 0.96);
    --bg-quiz-result: rgba(123, 141, 216, 0.1);
    --bg-nav-pill: rgba(240, 248, 255, 0.65);
    --bg-selection: rgba(88, 184, 232, 0.3);
    --bg-scrolltrack: rgba(232, 244, 252, 0.5);
    --text-chip: #2a6080;
    --text-chip-soft: #1a5a64;
    --border-input: rgba(88, 184, 232, 0.22);
    --border-header: rgba(200, 225, 245, 0.55);
    --border-quiz: rgba(130, 170, 200, 0.4);
    --border-empty: rgba(88, 184, 232, 0.3);
    --border-video: rgba(240, 248, 255, 0.72);
    --border-footer-fun: rgba(88, 184, 232, 0.3);

    --mist-pink: rgba(232, 138, 173, 0.1);
    --mist-sky: rgba(88, 184, 232, 0.12);
    --mist-sun: rgba(240, 217, 107, 0.12);
    --mist-mint: rgba(84, 196, 184, 0.12);

    --section-tint-1: linear-gradient(180deg, rgba(240, 248, 255, 0.48), rgba(228, 240, 250, 0.38));
    --section-tint-2: linear-gradient(180deg, rgba(240, 248, 255, 0.48), rgba(220, 238, 248, 0.38));
    --section-tint-3: linear-gradient(180deg, rgba(240, 248, 255, 0.48), rgba(225, 245, 240, 0.38));
    --section-tint-4: linear-gradient(180deg, rgba(240, 248, 255, 0.46), rgba(240, 235, 248, 0.36));
    --section-first-bg: linear-gradient(180deg, rgba(232, 244, 252, 0.84), rgba(220, 238, 248, 0.6));
    --section-soft-bg: linear-gradient(180deg, rgba(88, 184, 232, 0.06), rgba(240, 248, 255, 0));

    --hero-learning-bg: linear-gradient(180deg, rgba(240, 248, 255, 0.96), rgba(228, 240, 250, 0.94));
    --hero-rhymes-bg: linear-gradient(180deg, rgba(245, 240, 250, 0.97), rgba(235, 235, 250, 0.94));
    --hero-worksheets-bg: linear-gradient(180deg, rgba(235, 248, 245, 0.97), rgba(225, 245, 240, 0.94));
    --hero-stories-bg: linear-gradient(135deg, rgba(240, 230, 195, 0.9), rgba(240, 218, 200, 0.92), rgba(210, 240, 232, 0.92));
    --story-placeholder-bg: linear-gradient(135deg, rgba(230, 200, 80, 0.3), rgba(90, 175, 210, 0.26));
    --hero-logic-bg: linear-gradient(180deg, rgba(228, 242, 252, 0.97), rgba(236, 230, 252, 0.95));
    --hero-skill-labs-bg: linear-gradient(135deg, rgba(240, 228, 186, 0.88), rgba(196, 234, 248, 0.92), rgba(242, 216, 226, 0.92));
    --skill-card-media-bg: linear-gradient(135deg, rgba(238, 232, 196, 0.95), rgba(200, 236, 248, 0.95), rgba(240, 218, 228, 0.95));
    --hero-contact-bg: linear-gradient(135deg, rgba(210, 232, 248, 0.96), rgba(242, 222, 240, 0.94), rgba(220, 244, 228, 0.94));
    --hero-parents-bg: linear-gradient(135deg, rgba(240, 232, 196, 0.94), rgba(196, 232, 248, 0.92));
    --hero-support-bg: linear-gradient(135deg, rgba(244, 204, 224, 0.78), rgba(204, 232, 248, 0.9));
    --hero-illustration-bg: rgba(245, 250, 255, 0.82);

    --accent-sun: linear-gradient(160deg, rgba(240, 217, 107, 0.22), rgba(240, 248, 255, 0.94));
    --accent-sky: linear-gradient(160deg, rgba(88, 184, 232, 0.2), rgba(240, 248, 255, 0.94));
    --accent-leaf: linear-gradient(160deg, rgba(124, 192, 74, 0.18), rgba(240, 248, 255, 0.94));
    --accent-coral: linear-gradient(160deg, rgba(232, 144, 128, 0.18), rgba(240, 248, 255, 0.94));

    --mini-a: linear-gradient(145deg, rgba(240, 217, 107, 0.26), rgba(232, 165, 80, 0.16));
    --mini-b: linear-gradient(145deg, rgba(88, 184, 232, 0.2), rgba(123, 141, 216, 0.14));
    --mini-c: linear-gradient(145deg, rgba(84, 196, 184, 0.22), rgba(124, 192, 74, 0.14));
    --mini-d: linear-gradient(145deg, rgba(232, 144, 128, 0.18), rgba(232, 138, 173, 0.14));

    --nav-1: rgba(240, 217, 107, 0.16);
    --nav-2: rgba(88, 184, 232, 0.12);
    --nav-3: rgba(124, 192, 74, 0.14);
    --nav-4: rgba(232, 144, 128, 0.13);
    --nav-5: rgba(123, 141, 216, 0.12);
    --nav-6: rgba(232, 138, 173, 0.11);

    --badge-sun: rgba(240, 217, 107, 0.22);
    --badge-sky: rgba(88, 184, 232, 0.18);
    --badge-leaf: rgba(124, 192, 74, 0.18);
    --badge-coral: rgba(232, 144, 128, 0.16);

    --cloud-1: rgba(240, 217, 107, 0.32);
    --cloud-2: rgba(88, 184, 232, 0.26);
    --cloud-3: rgba(124, 192, 74, 0.22);
    --cloud-4: rgba(232, 144, 128, 0.2);

    --media-learning: linear-gradient(135deg, rgba(88, 184, 232, 0.2), rgba(84, 196, 184, 0.16));
    --media-rhyme: linear-gradient(145deg, rgba(123, 141, 216, 0.18), rgba(88, 184, 232, 0.16), rgba(84, 196, 184, 0.14));
    --media-worksheet: linear-gradient(145deg, rgba(84, 196, 184, 0.16), rgba(88, 184, 232, 0.14), rgba(240, 217, 107, 0.16));

    --shadow-soft: 0 16px 40px rgba(30, 58, 80, 0.1);
    --shadow-bold: 0 18px 44px rgba(88, 184, 232, 0.16);
    --shadow-bounce: 0 20px 50px rgba(88, 184, 232, 0.22);
    --shadow-header: 0 4px 20px rgba(88, 184, 232, 0.08);
    --shadow-card-hover: 0 25px 50px rgba(30, 58, 80, 0.16);

    --gradient-rainbow: linear-gradient(135deg, #58b8e8 0%, #7b8dd8 28%, #54c4b8 52%, #7cc04a 76%, #58b8e8 100%);
    --gradient-sunset: linear-gradient(135deg, #58b8e8 0%, #7b8dd8 52%, #54c4b8 100%);

    --blob-tr: radial-gradient(circle, rgba(88, 184, 232, 0.4), transparent 66%);
    --blob-bl: radial-gradient(circle, rgba(84, 196, 184, 0.36), transparent 66%);
    --bg-body-spots:
        radial-gradient(circle at 9% 14%, rgba(123, 141, 216, 0.16), transparent 18rem),
        radial-gradient(circle at 88% 12%, rgba(88, 184, 232, 0.18), transparent 17rem),
        radial-gradient(circle at 20% 84%, rgba(84, 196, 184, 0.16), transparent 21rem),
        radial-gradient(circle at 78% 76%, rgba(124, 192, 74, 0.12), transparent 18rem);

    --deco-star-opacity: 0.3;
    --deco-dot-opacity: 0.4;
    --deco-line-opacity: 0.25;
    --deco-blob-opacity: 0.28;

    --focus-color: var(--sky);
    --theme-color: #58b8e8;
}

/* =========================================================
   STORY-NIGHT THEME
   ========================================================= */
[data-theme="story-night"] {
    --cream: #1a1a2e;
    --cream-deep: #16162a;
    --paper: rgba(28, 28, 52, 0.92);
    --ink: #e8e4f0;
    --muted: #9a94b0;
    --sun: #f5d565;
    --orange: #f0a050;
    --pink: #e87aaa;
    --purple: #a78bfa;
    --sky: #60b0e8;
    --teal: #4ec8b4;
    --leaf: #88c84a;
    --coral: #e8887a;
    --line: rgba(160, 150, 190, 0.3);

    --bg-page-base: #0f0f1e;
    --bg-page-mid: #141428;
    --bg-page-end: #121224;
    --bg-surface: rgba(28, 28, 52, 0.92);
    --bg-surface-raised: rgba(34, 34, 62, 0.95);
    --bg-header: rgba(18, 18, 36, 0.9);
    --bg-footer-start: rgba(28, 28, 52, 0.96);
    --bg-footer-end: rgba(22, 22, 42, 0.92);
    --bg-filter: linear-gradient(180deg, rgba(28, 28, 52, 0.97), rgba(22, 22, 42, 0.94));
    --bg-prose: linear-gradient(180deg, rgba(28, 28, 52, 0.94), rgba(24, 24, 46, 0.95));
    --bg-hero-panel: linear-gradient(145deg, rgba(30, 30, 56, 0.94), rgba(24, 24, 46, 0.98));
    --bg-card-playful: linear-gradient(180deg, rgba(28, 28, 52, 0.95), rgba(24, 24, 46, 0.92));
    --bg-input: rgba(34, 34, 62, 0.92);
    --bg-chip: rgba(167, 139, 250, 0.2);
    --bg-chip-soft: rgba(96, 176, 232, 0.18);
    --bg-kicker: rgba(232, 228, 240, 0.08);
    --bg-empty: rgba(28, 28, 52, 0.5);
    --bg-example: rgba(34, 34, 62, 0.8);
    --bg-faq: rgba(28, 28, 52, 0.74);
    --bg-quiz-option: rgba(34, 34, 62, 0.96);
    --bg-quiz-result: rgba(167, 139, 250, 0.15);
    --bg-nav-pill: rgba(34, 34, 62, 0.65);
    --bg-selection: rgba(167, 139, 250, 0.35);
    --bg-scrolltrack: rgba(22, 22, 42, 0.5);
    --text-chip: #c8b8f0;
    --text-chip-soft: #80c0e0;
    --border-input: rgba(167, 139, 250, 0.22);
    --border-header: rgba(60, 55, 90, 0.55);
    --border-quiz: rgba(100, 95, 140, 0.4);
    --border-empty: rgba(167, 139, 250, 0.25);
    --border-video: rgba(40, 38, 70, 0.72);
    --border-footer-fun: rgba(167, 139, 250, 0.25);

    --mist-pink: rgba(232, 122, 170, 0.1);
    --mist-sky: rgba(96, 176, 232, 0.1);
    --mist-sun: rgba(245, 213, 101, 0.1);
    --mist-mint: rgba(78, 200, 180, 0.1);

    --section-tint-1: linear-gradient(180deg, rgba(28, 28, 52, 0.5), rgba(34, 30, 52, 0.4));
    --section-tint-2: linear-gradient(180deg, rgba(28, 28, 52, 0.5), rgba(24, 30, 52, 0.4));
    --section-tint-3: linear-gradient(180deg, rgba(28, 28, 52, 0.5), rgba(22, 34, 40, 0.4));
    --section-tint-4: linear-gradient(180deg, rgba(28, 28, 52, 0.48), rgba(36, 24, 48, 0.38));
    --section-first-bg: linear-gradient(180deg, rgba(22, 22, 42, 0.84), rgba(18, 18, 36, 0.6));
    --section-soft-bg: linear-gradient(180deg, rgba(96, 176, 232, 0.05), rgba(15, 15, 30, 0));

    --hero-learning-bg: linear-gradient(180deg, rgba(30, 28, 52, 0.96), rgba(34, 30, 56, 0.94));
    --hero-rhymes-bg: linear-gradient(180deg, rgba(34, 24, 48, 0.97), rgba(30, 22, 46, 0.94));
    --hero-worksheets-bg: linear-gradient(180deg, rgba(22, 30, 44, 0.97), rgba(20, 32, 42, 0.94));
    --hero-stories-bg: linear-gradient(135deg, rgba(38, 30, 20, 0.96), rgba(40, 28, 18, 0.97), rgba(18, 34, 28, 0.96));
    --story-placeholder-bg: linear-gradient(135deg, rgba(245, 213, 101, 0.14), rgba(96, 176, 232, 0.12));
    --hero-logic-bg: linear-gradient(180deg, rgba(20, 28, 52, 0.97), rgba(26, 22, 50, 0.95));
    --hero-skill-labs-bg: linear-gradient(135deg, rgba(32, 28, 18, 0.96), rgba(18, 30, 40, 0.97), rgba(34, 20, 28, 0.96));
    --skill-card-media-bg: linear-gradient(135deg, rgba(245, 213, 101, 0.1), rgba(96, 176, 232, 0.1), rgba(232, 122, 170, 0.08));
    --hero-contact-bg: linear-gradient(135deg, rgba(18, 28, 44, 0.97), rgba(32, 18, 40, 0.96), rgba(18, 36, 26, 0.97));
    --hero-parents-bg: linear-gradient(135deg, rgba(34, 30, 18, 0.96), rgba(18, 28, 44, 0.95));
    --hero-support-bg: linear-gradient(135deg, rgba(38, 18, 30, 0.96), rgba(18, 28, 44, 0.95));
    --hero-illustration-bg: rgba(34, 34, 62, 0.82);

    --accent-sun: linear-gradient(160deg, rgba(245, 213, 101, 0.18), rgba(28, 28, 52, 0.94));
    --accent-sky: linear-gradient(160deg, rgba(96, 176, 232, 0.16), rgba(28, 28, 52, 0.94));
    --accent-leaf: linear-gradient(160deg, rgba(136, 200, 74, 0.14), rgba(28, 28, 52, 0.94));
    --accent-coral: linear-gradient(160deg, rgba(232, 136, 122, 0.14), rgba(28, 28, 52, 0.94));

    --mini-a: linear-gradient(145deg, rgba(245, 213, 101, 0.2), rgba(240, 160, 80, 0.14));
    --mini-b: linear-gradient(145deg, rgba(96, 176, 232, 0.18), rgba(167, 139, 250, 0.14));
    --mini-c: linear-gradient(145deg, rgba(78, 200, 180, 0.18), rgba(136, 200, 74, 0.12));
    --mini-d: linear-gradient(145deg, rgba(232, 136, 122, 0.16), rgba(232, 122, 170, 0.12));

    --nav-1: rgba(245, 213, 101, 0.12);
    --nav-2: rgba(96, 176, 232, 0.1);
    --nav-3: rgba(136, 200, 74, 0.1);
    --nav-4: rgba(232, 136, 122, 0.1);
    --nav-5: rgba(167, 139, 250, 0.12);
    --nav-6: rgba(232, 122, 170, 0.1);

    --badge-sun: rgba(245, 213, 101, 0.2);
    --badge-sky: rgba(96, 176, 232, 0.18);
    --badge-leaf: rgba(136, 200, 74, 0.16);
    --badge-coral: rgba(232, 136, 122, 0.16);

    --cloud-1: rgba(245, 213, 101, 0.28);
    --cloud-2: rgba(96, 176, 232, 0.24);
    --cloud-3: rgba(136, 200, 74, 0.2);
    --cloud-4: rgba(232, 136, 122, 0.18);

    --media-learning: linear-gradient(135deg, rgba(167, 139, 250, 0.18), rgba(96, 176, 232, 0.14));
    --media-rhyme: linear-gradient(145deg, rgba(232, 122, 170, 0.16), rgba(167, 139, 250, 0.14), rgba(96, 176, 232, 0.12));
    --media-worksheet: linear-gradient(145deg, rgba(78, 200, 180, 0.14), rgba(96, 176, 232, 0.12), rgba(245, 213, 101, 0.14));

    --shadow-soft: 0 16px 40px rgba(0, 0, 0, 0.3);
    --shadow-bold: 0 18px 44px rgba(167, 139, 250, 0.2);
    --shadow-bounce: 0 20px 50px rgba(167, 139, 250, 0.28);
    --shadow-header: 0 4px 20px rgba(0, 0, 0, 0.25);
    --shadow-card-hover: 0 25px 50px rgba(0, 0, 0, 0.35);

    --gradient-rainbow: linear-gradient(135deg, #e87aaa 0%, #a78bfa 28%, #60b0e8 52%, #4ec8b4 76%, #f5d565 100%);
    --gradient-sunset: linear-gradient(135deg, #a78bfa 0%, #e87aaa 52%, #60b0e8 100%);

    --blob-tr: radial-gradient(circle, rgba(167, 139, 250, 0.3), transparent 66%);
    --blob-bl: radial-gradient(circle, rgba(78, 200, 180, 0.24), transparent 66%);
    --bg-body-spots:
        radial-gradient(circle at 9% 14%, rgba(232, 122, 170, 0.12), transparent 18rem),
        radial-gradient(circle at 88% 12%, rgba(96, 176, 232, 0.14), transparent 17rem),
        radial-gradient(circle at 20% 84%, rgba(167, 139, 250, 0.12), transparent 21rem),
        radial-gradient(circle at 78% 76%, rgba(78, 200, 180, 0.1), transparent 18rem);

    --deco-star-opacity: 0.6;
    --deco-dot-opacity: 0.35;
    --deco-line-opacity: 0.15;
    --deco-blob-opacity: 0.22;

    --focus-color: var(--purple);
    --theme-color: #a78bfa;
}

/* ========== FUN ANIMATIONS FOR KIDS ========== */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-3deg); }
    75% { transform: rotate(3deg); }
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(3deg); }
}

@keyframes sparkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

@keyframes rainbow-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 159, 67, 0.4); }
    50% { box-shadow: 0 0 20px 10px rgba(255, 159, 67, 0.2); }
}

@keyframes slide-up {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes jelly {
    0% { transform: scale(1, 1); }
    30% { transform: scale(1.1, 0.9); }
    40% { transform: scale(0.95, 1.05); }
    50% { transform: scale(1.05, 0.95); }
    65% { transform: scale(0.98, 1.02); }
    75% { transform: scale(1.02, 0.98); }
    100% { transform: scale(1, 1); }
}

@keyframes confetti-fall {
    0% { transform: translateY(-100%) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Trebuchet MS", "Gill Sans", sans-serif;
    color: var(--ink);
    background:
        var(--bg-body-spots),
        linear-gradient(180deg, var(--bg-page-base) 0%, var(--bg-page-mid) 52%, var(--bg-page-end) 100%);
    transition: background-color 0.4s ease, color 0.4s ease;
}

body::before,
body::after {
    content: "";
    position: fixed;
    z-index: -1;
    border-radius: 999px;
    filter: blur(2px);
    opacity: var(--deco-blob-opacity);
}

body::before {
    width: 19rem;
    height: 19rem;
    top: 6rem;
    right: -4rem;
    background:
        radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.6), transparent 16%),
        var(--blob-tr);
}

body::after {
    width: 15rem;
    height: 15rem;
    bottom: 4rem;
    left: -3rem;
    background:
        radial-gradient(circle at 34% 36%, rgba(255, 255, 255, 0.6), transparent 16%),
        var(--blob-bl);
}

.page-shell {
    position: relative;
    overflow: clip;
}

.page-shell::before,
.page-shell::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -2;
}

.page-shell::before {
    opacity: var(--deco-dot-opacity);
    background-image:
        radial-gradient(circle at 5% 14%, rgba(255, 255, 255, 0.9) 0 0.22rem, transparent 0.26rem),
        radial-gradient(circle at 82% 24%, rgba(255, 255, 255, 0.88) 0 0.18rem, transparent 0.22rem),
        radial-gradient(circle at 26% 74%, rgba(255, 255, 255, 0.88) 0 0.2rem, transparent 0.24rem),
        radial-gradient(circle at 70% 82%, rgba(255, 255, 255, 0.86) 0 0.16rem, transparent 0.21rem);
}

.page-shell::after {
    opacity: var(--deco-line-opacity);
    background-image:
        linear-gradient(115deg, transparent 0 48%, rgba(255, 255, 255, 0.14) 48% 52%, transparent 52%),
        linear-gradient(65deg, transparent 0 46%, rgba(255, 255, 255, 0.12) 46% 50%, transparent 50%);
    background-size: 13rem 13rem, 16rem 16rem;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(18px);
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-header);
    box-shadow: var(--shadow-header);
    transition: background 0.4s ease, box-shadow 0.4s ease;
}

.nav-icon {
    display: inline-block;
    margin-right: 0.2rem;
    transition: transform 0.3s ease;
}

.site-nav a:hover .nav-icon {
    animation: bounce 0.5s ease;
}

.nav-wrap,
.site-nav,
.nav-actions,
.hero-actions,
.meta-row,
.filter-bar,
.pagination,
.hero-badges {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    flex-wrap: wrap;
}

.nav-wrap {
    justify-content: space-between;
    padding: 1rem 0;
}

.brand {
    display: flex;
    gap: 0.9rem;
    align-items: center;
}

.brand strong,
.hero-section h1,
.section-heading h1,
.section-heading h2,
.content-card h2,
.content-card h3,
.stack-card h3,
.quiz-card h2,
.prose-card h1,
.prose-card h2 {
    font-family: "Cooper Black", "Georgia", serif;
    letter-spacing: -0.02em;
}

.brand small,
.muted,
.nav-placeholder,
.hero-copy,
.section-heading p,
.content-card p,
.stack-card p {
    color: var(--muted);
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 1.15rem;
    background: var(--gradient-sunset);
    color: white;
    font-weight: 800;
    box-shadow: var(--shadow-bold);
    transform: rotate(-6deg);
    animation: float 3s ease-in-out infinite;
    transition: transform 0.3s ease;
}

.brand-mark:hover {
    animation: wiggle 0.5s ease-in-out;
    transform: rotate(0deg) scale(1.1);
}

.brand {
    display: flex;
    gap: 0.9rem;
    align-items: center;
    transition: transform 0.3s ease;
}

.brand:hover {
    transform: scale(1.02);
}

.site-nav a {
    padding: 0.72rem 1rem;
    border-radius: 999px;
    font-weight: 700;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.site-nav a::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.site-nav a:hover::before {
    width: 200%;
    height: 200%;
}

.site-nav a:nth-child(1) { background: var(--nav-1); }
.site-nav a:nth-child(2) { background: var(--nav-2); }
.site-nav a:nth-child(3) { background: var(--nav-3); }
.site-nav a:nth-child(4) { background: var(--nav-4); }
.site-nav a:nth-child(5) { background: var(--nav-5); }
.site-nav a:nth-child(6) { background: var(--nav-6); }
.site-nav a:nth-child(7) { background: var(--nav-2); }
.site-nav a:nth-child(8) { background: var(--nav-4); }

.site-nav a:hover,
.site-nav a:focus-visible {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 25px rgba(35, 50, 74, 0.12);
    animation: bounce 0.4s ease;
}

.language-switcher select,
.filter-bar select,
.filter-bar input[type="search"] {
    border: 2px solid var(--border-input);
    border-radius: 18px;
    padding: 0.78rem 1rem;
    background: var(--bg-input);
    min-width: 10rem;
    color: var(--ink);
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.filter-bar input[type="search"] {
    flex: 1 1 16rem;
    width: 100%;
    min-height: 3rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    padding: 0.88rem 1.38rem;
    background: var(--gradient-sunset);
    background-size: 200% 200%;
    color: white;
    cursor: pointer;
    font-weight: 800;
    font-size: 1rem;
    box-shadow: 0 12px 26px rgba(255, 111, 165, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-position 0.4s ease;
    position: relative;
    overflow: hidden;
}

.button::before {
    content: "✨";
    position: absolute;
    right: -30px;
    opacity: 0;
    transition: all 0.3s ease;
}

.button:hover::before {
    right: 10px;
    opacity: 1;
}

.button:hover,
.button:focus-visible {
    transform: translateY(-4px) scale(1.05);
    box-shadow: var(--shadow-bounce);
    animation: jelly 0.5s ease;
    background-position: 100% 50%;
}

.button:active {
    transform: translateY(-2px) scale(0.98);
}

.button-small {
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
}

.button-light {
    background: var(--bg-surface-raised);
    color: var(--ink);
    border: 2px solid var(--border-input);
    box-shadow: 0 12px 22px rgba(35, 50, 74, 0.08);
}

.nav-auth {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-auth .button {
    border-radius: 999px;
}

.child-switcher {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.child-switcher select {
    min-height: 2.9rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--bg-surface-raised);
    padding: 0.55rem 0.9rem;
    color: var(--ink);
    font-weight: 700;
}

.nav-user-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    background: var(--bg-nav-pill);
    border: 1px solid var(--line);
    font-weight: 700;
    color: var(--ink);
}

.nav-user-chip-soft {
    background: rgba(89, 201, 255, 0.16);
    color: var(--ink);
}

.site-messages {
    padding-top: 0.8rem;
}

.message-banner {
    margin: 0 auto 0.8rem;
    padding: 0.95rem 1.15rem;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--bg-surface-raised);
    box-shadow: var(--shadow-soft);
    font-weight: 700;
}

.message-success {
    background: linear-gradient(180deg, rgba(240, 255, 244, 0.96), rgba(232, 252, 239, 0.94));
}

.message-error {
    background: linear-gradient(180deg, rgba(255, 242, 242, 0.96), rgba(255, 232, 232, 0.94));
}

.message-warning {
    background: linear-gradient(180deg, rgba(255, 250, 232, 0.98), rgba(255, 243, 214, 0.95));
}

.auth-shell {
    padding-top: 2rem;
}

.auth-grid {
    display: grid;
    grid-template-columns: 0.95fr 1.05fr;
    gap: 1.5rem;
    align-items: start;
}

.auth-intro {
    display: grid;
    gap: 1rem;
    padding: 1rem 0.35rem;
}

.auth-intro h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.08;
}

.auth-intro-card {
    max-width: 30rem;
    padding: 1rem 1.1rem;
    border-radius: 24px;
    background: var(--bg-hero-panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
}

.auth-intro-card p {
    margin: 0.4rem 0 0;
}

.auth-card {
    display: grid;
    gap: 1rem;
}

.auth-card-header h2 {
    margin: 0.45rem 0 0.5rem;
}

.auth-card-header p {
    margin: 0;
}

.form-stack {
    display: grid;
    gap: 1rem;
}

.form-field {
    display: grid;
    gap: 0.45rem;
}

.form-field label {
    font-weight: 700;
}

.form-field-inline {
    gap: 0.65rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-weight: 700;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    border: 2px solid var(--border-input);
    border-radius: 18px;
    padding: 0.88rem 1rem;
    background: var(--bg-input);
    color: var(--ink);
    font: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form-field input[type="checkbox"] {
    width: auto;
    min-width: 1.1rem;
    min-height: 1.1rem;
    padding: 0;
    border-radius: 0.4rem;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--focus-color);
    box-shadow: 0 0 0 4px rgba(255, 159, 67, 0.16);
}

.form-field.has-error input,
.form-field.has-error select,
.form-field.has-error textarea {
    border-color: #d95555;
}

.form-hint {
    color: var(--muted);
}

.form-errors {
    padding: 0.8rem 0.95rem;
    border-radius: 18px;
    background: rgba(217, 85, 85, 0.08);
    color: #8d2b2b;
    border: 1px solid rgba(217, 85, 85, 0.14);
}

.form-errors p {
    margin: 0;
}

.auth-submit {
    width: 100%;
}

.auth-links {
    margin: 0;
    color: var(--muted);
}

.auth-links a {
    font-weight: 700;
}

.logic-start-card,
.logic-history-card {
    display: grid;
    gap: 1rem;
}

.logic-child-summary-card {
    padding: 0.9rem 1rem;
    border-radius: 20px;
    background: rgba(89, 201, 255, 0.12);
    border: 1px solid rgba(89, 201, 255, 0.28);
}

.logic-child-summary-card strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.logic-child-summary-card p {
    margin: 0;
}

.page-hero-stories {
    background: var(--hero-stories-bg);
}

.hero-icon-cloud-story span:nth-child(1) {
    background: rgba(255, 214, 102, 0.9);
}

.hero-icon-cloud-story span:nth-child(2) {
    background: rgba(255, 153, 153, 0.9);
}

.hero-icon-cloud-story span:nth-child(3) {
    background: rgba(131, 197, 190, 0.92);
}

.hero-icon-cloud-story span:nth-child(4) {
    background: rgba(123, 178, 247, 0.9);
}

.story-filter-form {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    align-items: center;
    margin: 1.5rem 0 1rem;
}

.story-filter-form input,
.story-filter-form select {
    width: 100%;
    min-height: 3rem;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--bg-surface-raised);
    padding: 0.8rem 1rem;
}

.story-category-strip {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.story-card {
    overflow: hidden;
    padding: 0;
}

.story-card-media {
    aspect-ratio: 4 / 3;
    background: var(--story-placeholder-bg);
    border-bottom: 1px solid var(--line);
    overflow: hidden;
}

.story-card-media img,
.story-detail-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.story-card-placeholder,
.story-detail-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 1rem;
    color: var(--ink);
    font-family: "Cooper Black", "Georgia", serif;
    background: var(--story-placeholder-bg);
}

.story-card-placeholder img,
.story-category-hero-art img,
.story-hero-illustration img,
.story-detail-cover-fallback {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.story-category-hero-art,
.story-hero-illustration {
    min-height: 220px;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.story-hero-illustration-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 0.9rem;
    width: min(100%, 420px);
}

.story-hero-illustration-grid .story-hero-illustration:first-child {
    grid-column: 1 / -1;
    min-height: 180px;
}

.story-card-body {
    display: grid;
    gap: 0.8rem;
    padding: 1rem 1rem 1.1rem;
}

.story-card-meta {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.story-detail-layout {
    align-items: start;
}

.story-reading-card {
    display: grid;
    gap: 1rem;
}

.story-audio-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    align-items: center;
}

.story-audio-card {
    width: min(100%, 38rem);
    display: grid;
    gap: 0.9rem;
    padding: 1rem 1rem 1.05rem;
    border-radius: 24px;
    border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--brand) 10%, var(--bg-surface-raised)) 0%, var(--bg-surface-raised) 48%, color-mix(in srgb, var(--brand-soft) 22%, var(--bg-surface)) 100%);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.08);
}

.story-audio-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.story-audio-card-head strong {
    font-size: 1rem;
    color: var(--text);
}

.story-audio-player {
    width: 100%;
    border-radius: 18px;
}

.story-audio-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.story-audio-actions .button {
    min-height: 46px;
    border-radius: 999px;
}

.story-note-card,
.story-rights-card {
    padding: 1rem 1.1rem;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--bg-surface-raised);
}

.story-moral-card {
    background: rgba(255, 214, 102, 0.16);
}

.story-highlighted-words {
    display: grid;
    gap: 0.6rem;
}

.story-body {
    font-size: 1.03rem;
    line-height: 1.8;
}

.story-fact-list p,
.story-rights-card p {
    margin-bottom: 0.75rem;
}

.story-question-list {
    display: grid;
    gap: 1rem;
}

.story-question-card {
    display: grid;
    gap: 0.8rem;
}

.story-option-list {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.story-option-button.is-correct {
    background: rgba(76, 175, 80, 0.14);
    border-color: rgba(76, 175, 80, 0.6);
}

.story-option-button.is-wrong {
    background: rgba(242, 95, 92, 0.14);
    border-color: rgba(242, 95, 92, 0.65);
}

.story-question-feedback {
    min-height: 1.4rem;
    font-weight: 700;
    color: var(--muted);
}

.story-question-feedback.is-correct {
    color: #2e7d32;
}

.story-question-feedback.is-wrong {
    color: #c62828;
}

.dashboard-settings-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.dashboard-settings-grid .checkbox-label {
    margin-bottom: 0.7rem;
}

body.is-larger-touch-targets .button,
body.is-larger-touch-targets .puzzle-option,
body.is-larger-touch-targets .story-option-button,
body.is-larger-touch-targets .content-card a {
    min-height: 3rem;
}

body.is-less-animation *,
body.is-less-animation *::before,
body.is-less-animation *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}

body.is-reduced-distractions .hero-badges,
body.is-reduced-distractions .hero-icon-cloud,
body.is-reduced-distractions .section-heading p {
    opacity: 0.8;
}

@media (max-width: 680px) {
    .story-filter-form {
        grid-template-columns: 1fr;
    }
}

.logic-activity-card-strong {
    border-width: 2px;
    box-shadow: var(--shadow-card-hover);
}

.logic-login-callout {
    display: grid;
    gap: 1rem;
}

.logic-attempt-list,
.logic-review-list {
    display: grid;
    gap: 0.9rem;
}

.logic-attempt-item,
.logic-review-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.1rem;
    border-radius: 20px;
    background: var(--bg-surface-raised);
    border: 1px solid var(--line);
}

.logic-review-item {
    align-items: flex-start;
}

.logic-review-item.is-correct {
    border-color: rgba(76, 175, 80, 0.3);
    background: rgba(76, 175, 80, 0.08);
}

.logic-review-item.is-wrong {
    border-color: rgba(232, 144, 128, 0.3);
    background: rgba(232, 144, 128, 0.08);
}

.logic-attempt-item p,
.logic-review-item p {
    margin: 0.3rem 0 0;
}

.logic-attempt-actions {
    display: flex;
    gap: 0.6rem;
}

.logic-card-button {
    margin-top: 0.4rem;
    align-self: start;
}

.logic-score-badge {
    width: 10rem;
    height: 10rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--gradient-rainbow);
    color: #fff;
    font-family: "Cooper Black", "Georgia", serif;
    font-size: clamp(2.4rem, 6vw, 3.6rem);
    box-shadow: var(--shadow-bounce);
}

.logic-chip-correct {
    background: rgba(76, 175, 80, 0.16);
    color: #226b25;
}

.logic-chip-wrong {
    background: rgba(232, 144, 128, 0.18);
    color: #8b3d31;
}

.page-main {
    padding-bottom: 4rem;
}

.hero-section,
.section-block {
    position: relative;
    isolation: isolate;
    padding: 3.25rem 0;
}

.section-block::after {
    content: "";
    position: absolute;
    z-index: -1;
    left: 50%;
    top: 0.8rem;
    transform: translateX(-50%);
    width: min(1180px, calc(100% - 1rem));
    height: calc(100% - 1.2rem);
    border-radius: 38px;
    opacity: 0.82;
}

.page-main > .section-block:nth-of-type(4n + 1)::after {
    background:
        radial-gradient(circle at 10% 18%, var(--mist-sun), transparent 24%),
        var(--section-tint-1);
}

.page-main > .section-block:nth-of-type(4n + 2)::after {
    background:
        radial-gradient(circle at 86% 18%, var(--mist-sky), transparent 24%),
        var(--section-tint-2);
}

.page-main > .section-block:nth-of-type(4n + 3)::after {
    background:
        radial-gradient(circle at 15% 72%, var(--mist-mint), transparent 24%),
        var(--section-tint-3);
}

.page-main > .section-block:nth-of-type(4n)::after {
    background:
        radial-gradient(circle at 84% 78%, var(--mist-pink), transparent 24%),
        var(--section-tint-4);
}

.hero-section {
    position: relative;
    overflow: hidden;
}

.hero-section::before,
.hero-section::after,
.page-main > .section-block:first-child::before,
.page-main > .section-block:first-child::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

.hero-section::before {
    width: 24rem;
    height: 24rem;
    top: -6rem;
    left: -5rem;
    background: radial-gradient(circle, rgba(255, 216, 77, 0.34), transparent 68%);
}

.hero-section::after {
    width: 22rem;
    height: 22rem;
    bottom: -8rem;
    right: -4rem;
    background: radial-gradient(circle, rgba(89, 201, 255, 0.24), transparent 68%);
}

.hero-grid,
.section-split,
.footer-grid {
    display: grid;
    gap: 1.5rem;
}

.hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    position: relative;
}

.hero-copy-column {
    position: relative;
    z-index: 2;
}

.hero-skill-callout {
    display: grid;
    grid-template-columns: minmax(0, 132px) minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    margin-top: 1.15rem;
    padding: 1rem 1.05rem;
    border-radius: 26px;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.2) 42%),
        linear-gradient(135deg, rgba(255, 243, 201, 0.95), rgba(208, 244, 255, 0.96), rgba(255, 228, 238, 0.96));
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 16px 34px rgba(35, 50, 74, 0.1);
    text-decoration: none;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.hero-skill-callout:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 42px rgba(35, 50, 74, 0.14);
}

.hero-skill-callout-media {
    display: grid;
    place-items: center;
    min-height: 108px;
    padding: 0.4rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.5);
}

.hero-skill-callout-media img {
    width: 100%;
    max-width: 120px;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    filter: drop-shadow(0 14px 22px rgba(50, 70, 92, 0.14));
}

.hero-skill-callout-copy {
    display: grid;
    gap: 0.35rem;
}

.hero-skill-callout-copy strong {
    font-size: 1.08rem;
    line-height: 1.35;
}

.hero-skill-callout-copy span:last-child {
    color: var(--muted);
}

.hero-panel,
.prose-card,
.content-card,
.stack-card,
.quiz-card,
.site-footer,
.filter-bar {
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.hero-panel,
.prose-card,
.quiz-card,
.filter-bar {
    padding: 1.35rem;
}

.hero-panel-playful {
    background: var(--bg-hero-panel);
}

.page-hero {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 1.25rem;
    align-items: center;
    position: relative;
    padding: 2rem;
    margin-bottom: 1.5rem;
    border-radius: 32px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.page-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.42), transparent 28%),
        radial-gradient(circle at 88% 20%, rgba(255, 255, 255, 0.32), transparent 26%);
}

.page-hero-learning {
    background: var(--hero-learning-bg);
}

.page-hero-rhymes {
    background: var(--hero-rhymes-bg);
}

.page-hero-worksheets {
    background: var(--hero-worksheets-bg);
}

.page-hero-support {
    background: var(--hero-support-bg);
}

.page-hero-parents {
    background: var(--hero-parents-bg);
}

.page-hero-copy,
.page-hero-art {
    position: relative;
    z-index: 1;
}

.page-hero-copy h1 {
    margin: 0.9rem 0 0.8rem;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.08;
}

.page-hero-copy p {
    max-width: 36rem;
    line-height: 1.8;
}

.page-hero-art {
    display: grid;
    justify-items: center;
}

.page-hero-illustration {
    width: min(100%, 22rem);
    min-height: 16rem;
    padding: 1rem;
    border-radius: 28px;
    background: var(--hero-illustration-bg);
    box-shadow: 0 16px 32px rgba(35, 50, 74, 0.12);
    display: grid;
    place-items: center;
}

.page-hero-illustration img {
    width: 100%;
    height: 100%;
    max-height: 18rem;
    object-fit: contain;
}

.page-hero-illustration-poster img {
    object-fit: cover;
    border-radius: 22px;
}

.hero-icon-cloud {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    width: min(100%, 20rem);
}

.hero-icon-cloud span {
    display: grid;
    place-items: center;
    min-height: 5.8rem;
    padding: 0.9rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 12px 24px rgba(35, 50, 74, 0.08);
    font-weight: 800;
}

.hero-icon-cloud span:nth-child(1) { background: var(--cloud-1); }
.hero-icon-cloud span:nth-child(2) { background: var(--cloud-2); }
.hero-icon-cloud span:nth-child(3) { background: var(--cloud-3); }
.hero-icon-cloud span:nth-child(4) { background: var(--cloud-4); }

.hero-icon-cloud-music span:nth-child(1),
.hero-icon-cloud-music span:nth-child(2) {
    font-size: 2rem;
}

.hero-icon-cloud-paper span:nth-child(1),
.hero-icon-cloud-paper span:nth-child(2) {
    font-size: 1.8rem;
}

.hero-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.hero-mini-card {
    padding: 1rem;
    border-radius: 22px;
    min-height: 110px;
    display: grid;
    align-content: center;
    gap: 0.3rem;
    color: var(--ink);
    box-shadow: 0 10px 22px rgba(35, 50, 74, 0.08);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    cursor: pointer;
}

.hero-mini-card:hover {
    transform: translateY(-6px) rotate(2deg) scale(1.05);
    box-shadow: 0 20px 40px rgba(35, 50, 74, 0.15);
}

.hero-mini-card strong {
    font-size: 1.45rem;
    transition: transform 0.3s ease;
}

.hero-mini-card:hover strong {
    animation: bounce 0.5s ease;
}

.hero-mini-card-a { background: var(--mini-a); }
.hero-mini-card-b { background: var(--mini-b); }
.hero-mini-card-c { background: var(--mini-c); }
.hero-mini-card-d { background: var(--mini-d); }

.hero-stat + .hero-stat {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(166, 189, 212, 0.65);
}

.hero-stat-highlight strong {
    font-size: 2rem;
    color: var(--purple);
}

.eyebrow,
.chip,
.hero-badge,
.card-kicker {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.42rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.eyebrow {
    background: var(--gradient-sunset);
    background-size: 200% 200%;
    color: white;
    box-shadow: 0 10px 20px rgba(255, 111, 165, 0.22);
    animation: rainbow-shift 3s ease infinite;
}

.chip {
    background: var(--bg-chip);
    color: var(--text-chip);
}

.chip:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 216, 77, 0.3);
}

.hero-badge {
    color: var(--ink);
    box-shadow: 0 10px 18px rgba(35, 50, 74, 0.08);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero-badge:hover {
    transform: scale(1.1) rotate(-3deg);
}

.hero-badge-sun { background: var(--badge-sun); }
.hero-badge-sky { background: var(--badge-sky); }
.hero-badge-leaf { background: var(--badge-leaf); }
.hero-badge-coral { background: var(--badge-coral); }

.hero-section h1 {
    margin: 0.8rem 0 1rem;
    font-size: clamp(2.2rem, 4.6vw, 4.1rem);
    line-height: 1.08;
    animation: slide-up 0.6s ease backwards;
}

.hero-section h1,
.section-heading h1 {
    background: var(--gradient-rainbow);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbow-shift 6s ease infinite;
}

.hero-copy {
    max-width: 40rem;
    font-size: 1.12rem;
    line-height: 1.8;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.6rem;
}

.section-heading h1,
.section-heading h2 {
    margin: 0;
}

.section-heading a {
    font-weight: 800;
    color: var(--purple);
}

.section-heading a.button {
    color: white;
}

.page-main > .section-block:first-child {
    position: relative;
    overflow: hidden;
    background: var(--section-first-bg);
}

.page-main > .section-block:first-child::before {
    width: 20rem;
    height: 20rem;
    top: -5rem;
    right: -3rem;
    background: radial-gradient(circle, rgba(255, 111, 165, 0.2), transparent 70%);
}

.page-main > .section-block:first-child::after {
    width: 16rem;
    height: 16rem;
    bottom: -4rem;
    left: -3rem;
    background: radial-gradient(circle, rgba(89, 201, 255, 0.18), transparent 70%);
}

.section-soft {
    background: var(--section-soft-bg);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.15rem;
}

.card-grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
}

.content-card,
.stack-card {
    position: relative;
    overflow: hidden;
    padding: 1.25rem;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    animation: slide-up 0.5s ease backwards;
}

.card-grid > *:nth-child(1) { animation-delay: 0.1s; }
.card-grid > *:nth-child(2) { animation-delay: 0.15s; }
.card-grid > *:nth-child(3) { animation-delay: 0.2s; }
.card-grid > *:nth-child(4) { animation-delay: 0.25s; }
.card-grid > *:nth-child(5) { animation-delay: 0.3s; }
.card-grid > *:nth-child(6) { animation-delay: 0.35s; }

.content-card::before,
.stack-card::before,
.quiz-card::before,
.prose-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 8px;
    background: var(--gradient-rainbow);
    background-size: 300% 100%;
    animation: rainbow-shift 4s ease infinite;
}

.content-card::after,
.stack-card::after {
    content: "🌟";
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.2rem;
    opacity: 0;
    transform: scale(0) rotate(-20deg);
    transition: all 0.3s ease;
}

.content-card:hover::after,
.stack-card:hover::after {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    animation: sparkle 1s ease infinite;
}

.content-card:hover,
.stack-card:hover,
.quiz-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-card-hover);
}

.content-card h2,
.content-card h3,
.stack-card h3,
.quiz-card h2 {
    margin: 0.4rem 0 0.7rem;
}

.content-card-playful {
    background: var(--bg-card-playful);
}

.card-kicker {
    margin-bottom: 0.75rem;
    background: var(--bg-kicker);
    color: var(--ink);
}

.story-link {
    display: inline-flex;
    margin-top: 0.7rem;
    font-weight: 800;
    color: var(--purple);
    transition: transform 0.2s ease, color 0.2s ease;
    position: relative;
}

.story-link::after {
    content: " →";
    transition: transform 0.2s ease;
}

.story-link:hover {
    color: var(--pink);
    transform: translateX(3px);
}

.story-link:hover::after {
    transform: translateX(5px);
}

/* Empty state styling */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    font-size: 1.2rem;
    color: var(--muted);
    background: var(--bg-empty);
    border-radius: var(--radius-xl);
    border: 2px dashed var(--border-empty);
    grid-column: 1 / -1;
}

.accent-sun { background: var(--accent-sun); }
.accent-sky { background: var(--accent-sky); }
.accent-leaf { background: var(--accent-leaf); }
.accent-coral { background: var(--accent-coral); }

.stack-list,
.quiz-stack {
    display: grid;
    gap: 1rem;
}

.meta-row {
    justify-content: space-between;
    color: var(--muted);
    font-weight: 700;
    font-size: 0.92rem;
}

.card-media {
    min-height: 8rem;
    border-radius: 1.25rem;
    display: grid;
    place-items: center;
    margin-bottom: 1rem;
    background: var(--gradient-learning);
    text-align: center;
    color: var(--ink);
    padding: 1rem;
    font-weight: 700;
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.4), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.content-card:hover .card-media::after {
    opacity: 1;
}

.content-card:hover .card-media {
    transform: scale(1.02);
}

.card-media-image {
    width: 100%;
    height: 100%;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.55);
}

.card-media-image-contain {
    max-height: 8rem;
    object-fit: contain;
}

.card-media-image-cover {
    min-height: 8rem;
    object-fit: cover;
}

.card-media-playful {
    min-height: 9.5rem;
}

.card-media-rhyme {
    background: var(--media-rhyme);
}

.card-media-worksheet {
    background: var(--media-worksheet);
}

.card-media-glyph {
    display: block;
    font-size: 2.8rem;
    line-height: 1;
    margin-bottom: 0.35rem;
    animation: float 3s ease-in-out infinite;
    text-shadow: 2px 2px 0 rgba(255, 159, 67, 0.3);
}

.card-media-glyph-full {
    font-size: 2rem;
    line-height: 1.2;
    letter-spacing: 0.01em;
}

.meta-pills {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin-bottom: 0.2rem;
}

.chip-soft {
    background: var(--bg-chip-soft);
    color: var(--text-chip-soft);
}

.example-pill {
    padding: 0.75rem 0.9rem;
    border-radius: 16px;
    background: var(--bg-example);
}

.button-audio {
    width: 100%;
    margin-top: 0.4rem;
    background: linear-gradient(135deg, rgba(89, 201, 255, 0.9), rgba(142, 104, 255, 0.9));
}

.button-audio:hover {
    background: linear-gradient(135deg, rgba(89, 201, 255, 1), rgba(142, 104, 255, 1));
}

.button-audio::before {
    content: "🎵";
}

.lesson-story-card {
    margin-bottom: 1.2rem;
}

.learning-card-grid .content-card {
    min-height: 100%;
}

.worksheet-detail-grid {
    align-items: start;
}

.support-category-stack,
.support-mini-links {
    display: grid;
    gap: 0.85rem;
}

.parent-hub-section {
    margin-bottom: 1.35rem;
}

.parent-category-card {
    min-height: 100%;
}

.parent-featured-grid {
    margin-bottom: 1.5rem;
}

.parent-filter-actions {
    margin-bottom: 1rem;
}

.parent-mini-links {
    margin-top: 1rem;
}

.parent-article-layout {
    align-items: start;
}

.parent-article-hero {
    margin-bottom: 1.2rem;
}

.parent-article-cloud span {
    min-height: 4.9rem;
    font-size: 1rem;
}

.support-category-card,
.support-note-card,
.support-tip-card {
    background: var(--bg-prose);
}

.support-category-head {
    align-items: start;
}

.support-category-grid {
    align-items: start;
}

.support-path-card {
    min-height: 100%;
}

.support-mini-links a {
    display: inline-flex;
    align-items: center;
    padding: 0.8rem 0.95rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--ink);
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(35, 50, 74, 0.08);
}

.support-mini-links a:hover {
    transform: translateY(-2px);
}

.support-detail-grid {
    align-items: start;
}

.support-step-list {
    display: grid;
    gap: 0.75rem;
    padding-left: 1.25rem;
}

.support-step-list li {
    padding-left: 0.2rem;
    line-height: 1.8;
}

.worksheet-download-card {
    text-align: center;
    position: sticky;
    top: 6rem;
}

.prose-card,
.quiz-card {
    position: relative;
}

.prose-card {
    background: var(--bg-prose);
}

.prose-card p,
.quiz-card p {
    line-height: 1.8;
}

.filter-bar {
    gap: 0.9rem;
    padding: 1rem;
    background: var(--bg-filter);
}

.quiz-options {
    display: grid;
    gap: 0.8rem;
    margin-top: 1rem;
}

.quiz-option {
    width: 100%;
    text-align: left;
    border: 2px solid var(--border-quiz);
    border-radius: 18px;
    padding: 0.95rem 1rem;
    background: var(--bg-quiz-option);
    cursor: pointer;
    font-weight: 700;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.quiz-option::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-sunset);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.quiz-option:hover::before {
    transform: scaleY(1);
}

.quiz-option:hover,
.quiz-option:focus-visible {
    transform: translateY(-3px) scale(1.02);
    border-color: rgba(255, 159, 67, 0.55);
    box-shadow: 0 10px 25px rgba(255, 159, 67, 0.15);
}

.quiz-option.is-correct {
    border-color: #5da23f;
    background: rgba(153, 216, 79, 0.24);
    animation: pop 0.4s ease;
}

.quiz-option.is-correct::after {
    content: "🎉";
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.4rem;
    animation: bounce 0.5s ease infinite;
}

.quiz-option.is-wrong {
    border-color: #dc725d;
    background: rgba(255, 126, 103, 0.22);
    animation: wiggle 0.4s ease;
}

.quiz-result {
    font-weight: 800;
    color: var(--purple);
    font-size: 1.1rem;
    margin-top: 1rem;
    padding: 0.8rem;
    border-radius: 12px;
    background: var(--bg-quiz-result);
}

.quiz-encouragement {
    margin-top: 2rem;
    padding: 1.5rem;
    text-align: center;
    background: var(--gradient-rainbow);
    background-size: 300% 100%;
    border-radius: var(--radius-xl);
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    animation: rainbow-shift 4s ease infinite;
    box-shadow: var(--shadow-bold);
}

.quiz-encouragement p {
    margin: 0;
}

.page-hero-logic {
    background: var(--hero-logic-bg);
}

.hero-icon-cloud-logic span:nth-child(1) { background: rgba(89, 201, 255, 0.3); }
.hero-icon-cloud-logic span:nth-child(2) { background: rgba(255, 216, 77, 0.34); }
.hero-icon-cloud-logic span:nth-child(3) { background: rgba(153, 216, 79, 0.28); }
.hero-icon-cloud-logic span:nth-child(4) { background: rgba(255, 111, 165, 0.26); }

.card-media-logic {
    background: linear-gradient(145deg, rgba(89, 201, 255, 0.22), rgba(142, 104, 255, 0.16), rgba(255, 216, 77, 0.18));
}

.logic-category-card,
.logic-activity-card {
    min-height: 100%;
}

.logic-activity-layout {
    align-items: start;
}

.logic-support-card {
    position: sticky;
    top: 6rem;
}

.logic-support-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin: 1rem 0;
}

.logic-support-chip {
    background: rgba(89, 201, 255, 0.14);
    color: #18516c;
}

.logic-guardrail {
    margin-top: 1rem;
}

.logic-progress {
    height: 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    overflow: hidden;
    margin-bottom: 1rem;
    border: 1px solid rgba(166, 189, 212, 0.4);
}

.logic-progress-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--gradient-rainbow);
    transition: width 0.35s ease;
}

.logic-question-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.logic-visual-hint {
    padding: 0.75rem 0.9rem;
    border-radius: 16px;
    border-left: 4px solid var(--sky);
    background: var(--bg-surface-raised);
    color: var(--ink);
    font-weight: 700;
}

.logic-option-card {
    display: grid;
    gap: 0.25rem;
}

.logic-option-label {
    font-size: 1.02rem;
}

.logic-option-detail {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.9rem;
}

.quiz-options-large .quiz-option {
    min-height: 4.2rem;
    padding: 1.1rem 1.1rem;
    font-size: 1.04rem;
}

.quiz-options-picture-cues .quiz-option {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.85rem;
}

.logic-option-cue {
    width: 2.4rem;
    height: 2.4rem;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 216, 77, 0.34);
    color: var(--ink);
    font-weight: 800;
}

.logic-finish-card {
    margin-top: 1.2rem;
}

.logic-icon-stack {
    display: grid;
    place-items: center;
    gap: 0.5rem;
    width: min(100%, 15rem);
    min-height: 12rem;
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(236, 248, 255, 0.78));
    box-shadow: 0 16px 30px rgba(35, 50, 74, 0.1);
}

.logic-icon-stack span {
    width: 4rem;
    height: 4rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--gradient-rainbow);
    color: white;
    font-size: 1.6rem;
    font-weight: 800;
}

.is-step-hidden {
    display: none;
}

[data-support-less-animation="true"] .quiz-option,
[data-support-less-animation="true"] .logic-progress-fill,
[data-support-less-animation="true"] .quiz-card,
[data-support-less-animation="true"] .quiz-encouragement {
    animation: none !important;
    transition: none !important;
}

.video-frame {
    position: relative;
    padding-top: 56.25%;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    border: 6px solid var(--border-video);
}

.video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.pagination {
    justify-content: center;
    margin-top: 1.4rem;
}

.site-footer {
    padding: 2rem 0;
    margin: 0 1rem 1rem;
    background:
        radial-gradient(circle at top left, rgba(255, 216, 77, 0.18), transparent 24%),
        linear-gradient(180deg, var(--bg-footer-start), var(--bg-footer-end));
}

.footer-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.footer-grid a {
    display: block;
    margin-top: 0.55rem;
}

.faq-item {
    border-radius: 18px;
    background: var(--bg-faq);
    padding: 0.9rem 1rem;
}

.faq-item + .faq-item {
    margin-top: 0.8rem;
}

.nav-placeholder {
    font-weight: 700;
    padding: 0.6rem 0.95rem;
    border-radius: 999px;
    background: var(--bg-nav-pill);
}

/* ========== THEME SWITCHER ========== */
.theme-switcher {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.25rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transition: background 0.4s ease, border-color 0.4s ease;
}

.theme-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
    border-radius: 999px;
    padding: 0.42rem 0.72rem;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    background: transparent;
    color: var(--muted);
    transition: all 0.25s ease;
    white-space: nowrap;
    line-height: 1;
}

.theme-btn:hover {
    background: var(--bg-surface-raised);
    color: var(--ink);
    transform: scale(1.06);
}

.theme-btn.is-active {
    background: var(--gradient-sunset);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(255, 111, 165, 0.25);
    pointer-events: none;
}

.theme-btn span.theme-icon {
    margin-right: 0.3rem;
    font-size: 1rem;
    line-height: 1;
}

@media (max-width: 700px) {
    .theme-switcher {
        order: -1;
        width: 100%;
        justify-content: center;
    }
    .theme-btn span.theme-label {
        display: none;
    }
}

/* ========== THEME TRANSITIONS ========== */
.hero-panel,
.prose-card,
.content-card,
.stack-card,
.quiz-card,
.site-footer,
.filter-bar,
.quiz-option,
.faq-item,
.nav-placeholder,
.empty-state,
.chip,
.chip-soft,
.hero-badge,
.card-kicker,
.example-pill,
.quiz-result,
.video-frame,
.page-hero,
.story-card-placeholder,
.story-detail-placeholder,
.hero-mini-card,
.hero-icon-cloud span {
    transition: background 0.4s ease, border-color 0.4s ease, color 0.4s ease, box-shadow 0.4s ease;
}

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

@media (max-width: 900px) {
    .hero-grid,
    .section-split,
    .page-hero,
    .auth-grid {
        grid-template-columns: 1fr;
    }

    .section-heading {
        align-items: start;
        flex-direction: column;
    }

    .hero-section h1 {
        font-size: clamp(2rem, 10vw, 3rem);
    }
}

@media (max-width: 700px) {
    .site-nav {
        justify-content: center;
    }

    .nav-auth {
        width: 100%;
        justify-content: center;
    }

    .child-switcher {
        width: 100%;
        justify-content: center;
    }

    .auth-shell {
        padding-top: 1rem;
    }

    .hero-mini-grid,
    .hero-icon-cloud {
        grid-template-columns: 1fr 1fr;
    }

    .hero-skill-callout {
        grid-template-columns: 1fr;
    }

    .hero-skill-callout-media {
        min-height: 92px;
    }

    .content-card,
    .stack-card,
    .prose-card,
    .quiz-card {
        border-radius: 24px;
    }
}

/* ========== EXTRA KID-FRIENDLY ENHANCEMENTS ========== */

/* Floating decorative elements */
.page-shell::before {
    content: "⭐";
    position: fixed;
    top: 20%;
    left: 3%;
    font-size: 1.5rem;
    opacity: 0.4;
    animation: float 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

/* Fun hover states for all interactive elements */
.page-shell::before,
.page-shell::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -2;
}

.page-shell::before {
    opacity: 0.55;
    background-image:
        radial-gradient(circle at 5% 14%, rgba(255, 255, 255, 0.9) 0 0.22rem, transparent 0.26rem),
        radial-gradient(circle at 82% 24%, rgba(255, 255, 255, 0.88) 0 0.18rem, transparent 0.22rem),
        radial-gradient(circle at 26% 74%, rgba(255, 255, 255, 0.88) 0 0.2rem, transparent 0.24rem),
        radial-gradient(circle at 70% 82%, rgba(255, 255, 255, 0.86) 0 0.16rem, transparent 0.21rem);
}

.page-shell::after {
    opacity: 0.38;
    background-image:
        linear-gradient(115deg, transparent 0 48%, rgba(255, 255, 255, 0.14) 48% 52%, transparent 52%),
        linear-gradient(65deg, transparent 0 46%, rgba(255, 255, 255, 0.12) 46% 50%, transparent 50%);
    background-size: 13rem 13rem, 16rem 16rem;
}

a:not(.button):hover {
    text-decoration: none;
}

/* Playful selection color */
::selection {
    background: var(--bg-selection);
    color: var(--ink);
}

/* Smooth scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-scrolltrack);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-sunset);
    border-radius: 10px;
    border: 3px solid var(--bg-scrolltrack);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gradient-rainbow);
}

/* Enhanced focus states for accessibility */
*:focus-visible {
    outline: 3px solid var(--focus-color);
    outline-offset: 3px;
    border-radius: 8px;
}

/* Fun loading animation for images */
img {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

img:hover {
    transform: scale(1.02);
}

/* Enhanced footer with playful hover */
.site-footer a {
    transition: color 0.2s ease, transform 0.2s ease;
    display: inline-block;
}

.site-footer a:hover {
    color: var(--purple);
    transform: translateX(5px);
}

.footer-fun {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px dashed var(--border-footer-fun);
    text-align: center;
}

.footer-tagline {
    font-size: 1.1rem;
    font-weight: 700;
    background: var(--gradient-rainbow);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbow-shift 4s ease infinite;
}

/* Playful section transitions */
.section-block {
    transition: background 0.3s ease;
}

/* Enhanced filter bar */
.filter-bar select,
.filter-bar input[type="search"] {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.filter-bar select:hover,
.filter-bar input[type="search"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 159, 67, 0.15);
}

.filter-bar select:focus,
.filter-bar input[type="search"]:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(255, 159, 67, 0.2);
}

.learning-step-grid,
.learning-subject-grid {
    margin-bottom: 1.75rem;
}

.learning-step-card {
    border: 1px solid var(--line);
}

.learning-step-card-active {
    border-color: var(--orange);
    box-shadow: 0 18px 42px rgba(255, 159, 67, 0.18);
    transform: translateY(-4px);
}

.learning-step-card-active::before {
    height: 10px;
}

.learning-shelf-search {
    margin-bottom: 1.4rem;
    align-items: stretch;
}

.learning-shelf-search .button {
    min-height: 3rem;
}

.learning-guided-empty {
    text-align: center;
    margin-top: 1rem;
}

/* Playful pagination */
.pagination .button {
    min-width: 44px;
    min-height: 44px;
}

.pagination .button:hover {
    animation: bounce 0.4s ease;
}

/* Hero icon cloud enhancements */
.hero-icon-cloud span {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    cursor: default;
}

.hero-icon-cloud span:hover {
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 15px 35px rgba(35, 50, 74, 0.15);
}

/* Confetti effect container (used by JS) */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    animation: confetti-fall 3s linear forwards;
}

/* Audio card pulse effect when playing */
.js-audio-card.is-playing {
    animation: pulse-glow 1s ease infinite;
}

.js-audio-card.is-playing .card-media {
    animation: pop 0.5s ease;
}

/* Success celebration styles */
.celebration-active {
    animation: jelly 0.6s ease;
}

/* Accessible motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles - remove animations and decorations */
@media print {
    .page-shell::before,
    .page-shell::after,
    body::before,
    body::after {
        display: none;
    }
    
    * {
        animation: none !important;
        transition: none !important;
    }
}

.chip-premium {
    background: linear-gradient(135deg, #ffcf5c, #ff8f5c);
    color: #5a2b00;
}

.billing-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.billing-plan-card {
    background: var(--bg-surface-raised);
    border: 2px solid rgba(255, 184, 76, 0.28);
    border-radius: 28px;
    padding: 1.5rem;
    box-shadow: 0 20px 45px rgba(30, 58, 95, 0.08);
}

.billing-plan-card-featured {
    border-color: rgba(255, 143, 92, 0.52);
    box-shadow: 0 26px 56px rgba(255, 143, 92, 0.18);
}

.billing-price-row {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin: 1rem 0 0.25rem;
}

.billing-price-row strong {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    color: var(--ink);
}

.billing-original-price {
    color: var(--muted);
    text-decoration: line-through;
}

.billing-feature-list {
    margin: 1rem 0;
    padding-left: 1.1rem;
}

.billing-feature-list li + li {
    margin-top: 0.45rem;
}

.billing-card-actions,
.promo-strip {
    display: flex;
    gap: 0.85rem;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.promo-strip {
    background: var(--bg-surface-raised);
    border-radius: 28px;
    padding: 1.5rem;
    box-shadow: 0 18px 42px rgba(37, 64, 92, 0.08);
}

.billing-checkout-card,
.billing-result-card,
.billing-status-card,
.billing-free-note,
.premium-lock-card {
    border-radius: 28px;
    box-shadow: 0 18px 42px rgba(37, 64, 92, 0.08);
}

.billing-result-card-success {
    background: var(--accent-leaf);
}

.premium-lock-card {
    background: var(--accent-sun);
    border: 2px solid rgba(255, 181, 118, 0.36);
    padding: 1.25rem;
}

@media (max-width: 767px) {
    .billing-card-actions,
    .promo-strip {
        align-items: stretch;
    }

    .billing-card-actions .button,
    .promo-strip .button {
        width: 100%;
        text-align: center;
    }
}

/* ========== CONTACT PAGE ========== */
.contact-hero {
    background: var(--hero-contact-bg);
}

.contact-hero-orb {
    position: relative;
    width: 200px;
    height: 200px;
    display: grid;
    place-items: center;
    margin: 0 auto;
}

.contact-orb-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--sky);
    opacity: 0.3;
    animation: pulse-ring 3s ease-in-out infinite;
}

.contact-orb-ring-2 {
    inset: -20px;
    border-color: var(--pink);
    opacity: 0.18;
    animation-delay: 1.2s;
}

.contact-orb-emoji {
    font-size: 4.5rem;
    filter: drop-shadow(0 8px 18px rgba(0,0,0,0.12));
    animation: float 4s ease-in-out infinite;
}

@keyframes pulse-ring {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50%       { transform: scale(1.08); opacity: 0.5; }
}

.contact-page-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.3fr);
    gap: 1.75rem;
    align-items: start;
    margin-top: 2rem;
}

.contact-section-label {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sky);
    margin-bottom: 0.5rem;
}

/* ── Side card ── */
.contact-side-card {
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 2rem;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.contact-side-card::before,
.contact-form-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 5px;
    background: var(--gradient-rainbow);
    opacity: 0.95;
}

.contact-info-list {
    display: grid;
    gap: 0.75rem;
    margin: 1.1rem 0 1.5rem;
}

.contact-info-item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 1.05rem;
    border-radius: 18px;
    background: var(--bg-surface-raised);
    border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.04);
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.contact-info-item-link {
    text-decoration: none;
    color: var(--ink);
}

.contact-info-item-link:hover {
    border-color: var(--sky);
    transform: translateX(3px);
    box-shadow: 0 14px 24px rgba(0, 0, 0, 0.06);
    color: var(--ink);
}

.contact-info-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
    width: 2.6rem;
    height: 2.6rem;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--bg-chip), var(--bg-chip-soft));
    border: 1px solid color-mix(in srgb, var(--border-input) 60%, transparent);
}

.contact-info-item strong {
    display: block;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-bottom: 0.18rem;
}

.contact-info-item span {
    display: block;
    font-weight: 600;
    color: var(--ink);
}

.contact-response-note {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    margin-top: 1.25rem;
    padding: 0.85rem 1rem;
    border-radius: 16px;
    background: var(--bg-chip-soft);
    border: 1px solid color-mix(in srgb, var(--border-input) 55%, transparent);
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.6;
}

.contact-response-note span {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 0.05rem;
}

.contact-response-note p {
    margin: 0;
}

/* ── WhatsApp CTA ── */
.whatsapp-cta {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    margin-top: 1.1rem;
    padding: 1rem 1.1rem;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.92), rgba(18, 160, 74, 0.95));
    color: white;
    text-decoration: none;
    box-shadow: 0 12px 28px rgba(37, 211, 102, 0.25);
    transition: transform 0.2s, box-shadow 0.2s;
}

.whatsapp-cta:hover,
.whatsapp-cta:focus-visible {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(37, 211, 102, 0.32);
}

.whatsapp-cta > span:not(.whatsapp-cta-icon) {
    display: block;
}

.whatsapp-cta small {
    display: block;
    margin-top: 0.15rem;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.84rem;
}

.whatsapp-cta-icon {
    width: 3rem;
    height: 3rem;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    font-size: 1.4rem;
    flex-shrink: 0;
}

/* ── Footer WhatsApp link ── */
.footer-whatsapp-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: rgba(37, 211, 102, 0.14);
    color: var(--leaf);
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s;
}

.footer-whatsapp-link:hover {
    background: rgba(37, 211, 102, 0.22);
    color: var(--leaf);
}

/* ── Form card ── */
.contact-form-card {
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 2rem;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.contact-form-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
}

.contact-form-header h2 {
    margin: 0.3rem 0 0.5rem;
}

.contact-form-header p {
    color: var(--muted);
    margin: 0;
}

.contact-form-stack {
    display: grid;
    gap: 1.1rem;
}

.contact-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.contact-form-field {
    display: grid;
    gap: 0.45rem;
}

.contact-form-field label {
    font-weight: 800;
    font-size: 0.88rem;
    letter-spacing: 0.01em;
    color: var(--ink);
}

.contact-required {
    color: var(--coral);
    margin-left: 0.15rem;
}

.contact-input-shell {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
}

.contact-form-control {
    width: 100%;
    min-height: 3.45rem;
    border-radius: 24px;
    border: 1px solid color-mix(in srgb, var(--border-input) 92%, transparent);
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--bg-input) 88%, transparent), color-mix(in srgb, var(--bg-surface-raised) 95%, transparent));
    color: var(--ink);
    padding: 0.92rem 1rem;
    font: inherit;
    font-size: 0.98rem;
    line-height: 1.5;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s, transform 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.contact-form-control::placeholder {
    color: var(--muted);
    opacity: 0.82;
}

.contact-form-control:hover {
    border-color: color-mix(in srgb, var(--focus-color) 34%, var(--border-input));
    background: var(--bg-surface-raised);
}

.contact-form-control:focus {
    border-color: var(--focus-color);
    box-shadow:
        0 0 0 0.22rem color-mix(in srgb, var(--focus-color) 22%, transparent),
        0 10px 24px rgba(15, 23, 42, 0.08);
    outline: none;
    background: var(--bg-surface-raised);
    transform: translateY(-1px);
}

textarea.contact-form-control {
    resize: vertical;
    min-height: 154px;
    padding-top: 0.95rem;
}

.contact-form-field.has-error .contact-form-control {
    border-color: color-mix(in srgb, var(--coral) 75%, transparent);
    background: color-mix(in srgb, var(--bg-input) 85%, var(--coral) 4%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 0 0 0.18rem color-mix(in srgb, var(--coral) 16%, transparent);
}

.contact-form-field.has-error .contact-form-control:focus {
    border-color: var(--coral);
    box-shadow:
        0 0 0 0.22rem color-mix(in srgb, var(--coral) 18%, transparent),
        0 10px 24px rgba(15, 23, 42, 0.08);
}

.contact-form-field.has-error label {
    color: var(--coral);
}

.contact-form-alert {
    padding: 0.9rem 1rem;
    border-radius: 16px;
    border: 1px solid color-mix(in srgb, var(--coral) 45%, transparent);
    background: color-mix(in srgb, var(--bg-surface-raised) 85%, var(--coral) 7%);
    color: var(--ink);
    font-weight: 700;
}

.contact-form-footer {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.contact-submit-btn {
    flex-shrink: 0;
    min-width: 12rem;
}

.contact-privacy-note {
    margin: 0;
    font-size: 0.84rem;
    color: var(--muted);
    line-height: 1.5;
    max-width: 28rem;
}

.field-error {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    width: fit-content;
    max-width: 100%;
    color: var(--coral);
    font-weight: 700;
    font-size: 0.84rem;
    padding: 0.38rem 0.65rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg-surface-raised) 82%, var(--coral) 8%);
    border: 1px solid color-mix(in srgb, var(--coral) 24%, transparent);
}

.contact-toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 18px;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: var(--accent-leaf);
    color: var(--ink);
    border: 1px solid var(--line);
}

.contact-toast-error {
    background: var(--accent-coral);
}

.contact-form-control:-webkit-autofill,
.contact-form-control:-webkit-autofill:hover,
.contact-form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--ink);
    box-shadow:
        0 0 0 1000px var(--bg-surface-raised) inset,
        0 0 0 0.22rem color-mix(in srgb, var(--focus-color) 14%, transparent);
    transition: background-color 9999s ease-in-out 0s;
}

@media (max-width: 900px) {
    .contact-page-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .contact-form-row {
        grid-template-columns: 1fr;
    }

    .contact-form-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .contact-submit-btn {
        width: 100%;
        text-align: center;
    }
}

.quiz-club-hero,
.quiz-result-hero {
    background: var(--hero-logic-bg);
}

.quiz-pack-card {
    border-radius: 28px;
    background: var(--bg-surface-raised);
    border: 1px solid var(--line);
}

.quiz-pack-card-daily {
    border-color: color-mix(in srgb, var(--sun) 34%, var(--line));
}

.quiz-pack-card-weekly_challenge {
    border-color: color-mix(in srgb, var(--leaf) 36%, var(--line));
}

.quiz-pack-card-current_affairs {
    border-color: color-mix(in srgb, var(--sky) 40%, var(--line));
}

.quiz-play-shell {
    max-width: 840px;
}

.quiz-progress-card {
    margin-bottom: 1rem;
    padding: 1rem 1.2rem;
    border-radius: 22px;
    background: var(--bg-surface-raised);
    border: 1px solid var(--line);
}

.quiz-progress-bar {
    height: 12px;
    background: var(--bg-chip-soft);
    border-radius: 999px;
    overflow: hidden;
}

.quiz-progress-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--sun), var(--sky));
}

.quiz-question-card {
    padding: clamp(1.4rem, 2vw, 2rem);
    border-radius: 30px;
    background: var(--bg-surface-raised);
    border: 1px solid var(--line);
    box-shadow: 0 18px 36px rgba(16, 24, 40, 0.08);
}

.quiz-option-grid {
    display: grid;
    gap: 0.9rem;
    margin-top: 1.4rem;
}

.quiz-option-button {
    width: 100%;
    text-align: left;
    padding: 1rem 1.1rem;
    border-radius: 24px;
    border: 1px solid var(--border-input);
    background: var(--bg-input);
    color: inherit;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.quiz-option-button:hover,
.quiz-option-button:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(16, 24, 40, 0.12);
    border-color: var(--focus-color);
}

.nav-inline-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.35rem;
    padding: 0.08rem 0.45rem;
    border-radius: 999px;
    background: var(--bg-chip);
    color: var(--text-chip);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.button-quiz-club {
    border-color: var(--border-input);
}

.home-quiz-spotlight {
    position: relative;
}

.quiz-start-name {
    min-width: min(100%, 260px);
    padding: 0.92rem 1.05rem;
    border-radius: 999px;
    border: 1px solid var(--border-input);
    background: var(--bg-input);
    color: inherit;
    font: inherit;
    line-height: 1.2;
    box-shadow: 0 10px 20px rgba(16, 24, 40, 0.06);
}

.quiz-start-name:focus {
    outline: none;
    border-color: var(--focus-color);
    box-shadow:
        0 0 0 0.22rem color-mix(in srgb, var(--focus-color) 18%, transparent),
        0 12px 24px rgba(16, 24, 40, 0.1);
}

.quiz-start-name::placeholder {
    color: color-mix(in srgb, currentColor 54%, transparent);
}

.progress-metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.9rem;
    margin-bottom: 1.15rem;
}

.progress-metric-card {
    display: grid;
    gap: 0.2rem;
    padding: 1rem 1.05rem;
    border-radius: 20px;
    background: var(--bg-card-playful);
    border: 1px solid var(--line);
}

.progress-metric-card strong {
    font-size: clamp(1.3rem, 2.4vw, 1.8rem);
    line-height: 1;
}

.progress-metric-card span {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.weekly-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
}

.weekly-plan-day {
    padding: 1rem 1.05rem;
    border-radius: 22px;
    background: var(--bg-card-playful);
    border: 1px solid var(--line);
    box-shadow: 0 10px 26px rgba(16, 24, 40, 0.06);
}

.weekly-plan-day-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background: var(--bg-chip);
    color: var(--text-chip);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.weekly-plan-day h3 {
    margin: 0 0 0.55rem;
    font-size: 1.02rem;
}

.weekly-plan-activity-list {
    margin: 0 0 0.7rem;
    padding-left: 1.1rem;
}

.weekly-plan-activity-list li + li {
    margin-top: 0.35rem;
}

.weekly-summary-note {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    background: var(--bg-chip-soft);
    border: 1px solid var(--line);
    line-height: 1.65;
}

.parent-progress-shell {
    margin-bottom: 1.5rem;
}

.ai-summary-panel {
    display: grid;
    gap: 0.8rem;
    margin: 1rem 0 1.2rem;
    padding: 1rem 1.05rem;
    border-radius: 20px;
    background: var(--bg-chip-soft);
    border: 1px solid var(--line);
}

.ai-summary-panel p {
    margin: 0.35rem 0 0;
}

.ai-summary-form {
    margin: 0;
}

.ai-summary-form .button[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.error-page-body {
    min-height: 100vh;
    margin: 0;
    padding: clamp(1rem, 2vw, 1.75rem);
    box-sizing: border-box;
    background:
        radial-gradient(circle at 12% 18%, var(--mist-sun), transparent 18rem),
        radial-gradient(circle at 86% 14%, var(--mist-sky), transparent 16rem),
        radial-gradient(circle at 22% 84%, var(--mist-pink), transparent 18rem),
        linear-gradient(180deg, var(--bg-page-base), var(--bg-page-mid) 48%, var(--bg-page-end));
    color: var(--ink);
}

.error-page-shell {
    min-height: calc(100vh - (2 * clamp(1rem, 2vw, 1.75rem)));
    display: grid;
    place-items: center;
    width: 100%;
    padding: 0;
}

.error-page-card {
    width: min(100%, 760px);
    padding: clamp(1.75rem, 4vw, 3rem);
    text-align: center;
    border-radius: 34px;
    background: var(--bg-surface-raised);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.error-page-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 6px;
    background: var(--gradient-rainbow);
}

.error-page-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 5rem;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    background: var(--bg-chip);
    color: var(--text-chip);
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.error-page-illustration {
    margin: 1rem auto 0.75rem;
    font-size: clamp(3rem, 7vw, 5rem);
    line-height: 1;
}

.error-page-title {
    margin: 0.5rem 0 0.8rem;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.08;
}

.error-page-text {
    max-width: 42rem;
    margin: 0 auto;
    color: var(--muted);
    font-size: 1.02rem;
    line-height: 1.75;
}

.error-page-actions {
    display: flex;
    gap: 0.9rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.6rem;
}

.error-page-links {
    display: flex;
    gap: 1rem 1.4rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.25rem;
    font-weight: 700;
}

.error-page-links a {
    color: var(--ink);
    text-decoration: none;
}

.error-page-links a:hover {
    color: var(--purple);
}

@media (max-width: 640px) {
    .error-page-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .error-page-actions .button {
        width: 100%;
        text-align: center;
    }
}
