@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap');

:root {
    --brand-dark: #1E1B4B;
    --brand-indigo: #4F46E5;
    --font-heading: 'Fredoka', cursive, sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    
    /* Playful Theme Palette */
    --color-lemon: #FEF08A;
    --color-bubblegum: #FBCFE8;
    --color-mint: #A7F3D0;
    --color-sky: #BAE6FD;
    --color-lavender: #E9D5FF;
    --color-peach: #FED7AA;
    
    --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    --shadow-toy: 0 6px 0 rgba(0, 0, 0, 0.12);
}

/* Global Reset & Overflow Guard */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
}

body {
    background-color: #F8FAFC;
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.10) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(244, 63, 94, 0.08) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(16, 185, 129, 0.08) 0px, transparent 50%);
    font-family: var(--font-body);
    color: var(--brand-dark);
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
}

/* Mouse Sparkle Trail Canvas */
#trail-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* Floating Background Letters & Animals Container */
.floating-creatures-zone {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.floating-bg-item {
    position: absolute;
    opacity: 0.3;
    user-select: none;
    will-change: transform;
    animation: driftBubble infinite ease-in-out alternate;
}

@keyframes driftBubble {
    0% { transform: translateY(0px) rotate(-6deg) scale(0.95); }
    50% { transform: translateY(-20px) translateX(10px) rotate(6deg) scale(1.05); }
    100% { transform: translateY(-35px) translateX(-6px) rotate(-3deg) scale(1); }
}

/* Background Atmosphere */
.sky-scenery {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.sky-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.35;
}
.orb-1 { width: clamp(200px, 30vw, 360px); height: clamp(200px, 30vw, 360px); background: #FEF08A; top: -50px; left: -50px; }
.orb-2 { width: clamp(250px, 35vw, 440px); height: clamp(250px, 35vw, 440px); background: #C7D2FE; bottom: -80px; right: -80px; }

/* Sticky Navbar Island */
.navbar-island {
    position: sticky;
    top: 10px;
    z-index: 100;
    max-width: 1120px;
    margin: 10px auto 0;
    padding: clamp(8px, 1.5vw, 12px) clamp(12px, 2.5vw, 24px);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: var(--shadow-soft);
    width: calc(100% - clamp(16px, 4vw, 32px));
}

.nav-brand {
    display: flex;
    align-items: center;
    max-width: 60%;
}

.nav-brand a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.site-logo {
    width: 100%;
    max-width: clamp(160px, 38vw, 320px);
    height: auto;
    display: block;
    aspect-ratio: 480 / 98;
}

.nav-badges {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.pill-badge {
    font-size: clamp(0.7rem, 1.5vw, 0.82rem);
    font-weight: 800;
    padding: 5px clamp(8px, 1.8vw, 14px);
    border-radius: 30px;
    white-space: nowrap;
}
.free-pill { background: #ECFDF5; color: #059669; }
.no-login-pill { background: #EEF2FF; color: #4F46E5; }

/* Layout Shell */
.app-layout {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: clamp(16px, 3vw, 24px) clamp(12px, 3vw, 20px) 60px;
    position: relative;
    z-index: 2;
}

/* Ad Panels */
.ad-glass-panel {
    width: 100%;
    background: rgba(255, 255, 255, 0.7);
    border: 1px dashed #CBD5E1;
    border-radius: 18px;
    padding: 8px;
    margin-bottom: 20px;
    text-align: center;
    overflow: hidden;
}

/* Hero Section */
.hero-stage {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border-radius: clamp(20px, 4vw, 36px);
    padding: clamp(20px, 4vw, 36px) clamp(16px, 4vw, 40px);
    margin-bottom: 24px;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.hero-copy {
    flex: 1;
    min-width: 0;
}

.badge-bubble {
    display: inline-block;
    background: #4F46E5;
    color: #FFF;
    font-weight: 800;
    font-size: clamp(0.75rem, 1.6vw, 0.85rem);
    padding: 5px 12px;
    border-radius: 20px;
    margin-bottom: 8px;
}

.hero-headline {
    font-family: var(--font-heading);
    font-size: clamp(1.45rem, 4.2vw, 2.5rem);
    font-weight: 700;
    line-height: 1.18;
    color: var(--brand-dark);
    margin-bottom: 8px;
    word-break: break-word;
}

.hero-subline {
    font-size: clamp(0.88rem, 2vw, 1.1rem);
    color: #475569;
    font-weight: 600;
    line-height: 1.45;
}

.hero-mascot-pod {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mascot-circle {
    width: clamp(75px, 14vw, 110px);
    height: clamp(75px, 14vw, 110px);
    background: #FFF;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.18);
    position: relative;
}
.mascot-avatar { font-size: clamp(2.2rem, 5vw, 3.8rem); line-height: 1; }
.sparkle-tag {
    position: absolute;
    bottom: -6px;
    background: #10B981;
    color: #FFF;
    font-size: clamp(0.6rem, 1.2vw, 0.68rem);
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 12px;
    white-space: nowrap;
}

/* Stage Navigation Dock */
.world-filter-dock {
    margin-bottom: 24px;
    width: 100%;
}

.filter-dock-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: clamp(8px, 1.5vw, 14px);
    width: 100%;
}

.stage-dock-pill {
    appearance: none;
    border: 2px solid transparent;
    background: #FFF;
    padding: clamp(10px, 2vw, 14px) clamp(6px, 1.5vw, 12px);
    border-radius: clamp(14px, 2vw, 20px);
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    width: 100%;
}

.stage-dock-pill.active {
    border-color: #4F46E5;
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.15);
    background: #FFFFFF;
}

.dock-icon { font-size: clamp(1.4rem, 3vw, 2rem); margin-bottom: 3px; }
.dock-title {
    font-family: var(--font-heading);
    font-size: clamp(0.85rem, 1.8vw, 1.05rem);
    color: var(--brand-dark);
    line-height: 1.2;
}
.dock-count {
    font-size: clamp(0.7rem, 1.4vw, 0.78rem);
    font-weight: 700;
    color: #64748B;
    margin-top: 2px;
}

/* Responsive Arcade Grid */
.arcade-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(clamp(140px, 42vw, 255px), 1fr));
    gap: clamp(12px, 2vw, 20px);
    margin-bottom: 40px;
    width: 100%;
}

.game-pod-wrapper {
    position: relative;
    width: 100%;
    min-width: 0;
}

.game-pod {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: clamp(14px, 2.5vw, 20px) clamp(10px, 2vw, 16px);
    border-radius: clamp(18px, 3vw, 28px);
    text-decoration: none;
    color: var(--brand-dark);
    position: relative;
    box-shadow: var(--shadow-toy);
    border: 2px solid rgba(255, 255, 255, 0.85);
    overflow: hidden;
    width: 100%;
}

/* Gradients */
.pod-lemon      { background: linear-gradient(145deg, #FEF08A, #FDE047); }
.pod-bubblegum  { background: linear-gradient(145deg, #FCE7F3, #F472B6); }
.pod-mint       { background: linear-gradient(145deg, #D1FAE5, #34D399); }
.pod-sky        { background: linear-gradient(145deg, #E0F2FE, #38BDF8); }
.pod-lavender   { background: linear-gradient(145deg, #EDE9FE, #A78BFA); }
.pod-peach      { background: linear-gradient(145deg, #FFEDD5, #FB923C); }

.pod-sponsor {
    background: #FFF;
    border: 2px dashed #94A3B8;
    box-shadow: none;
}

.pod-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    width: 100%;
    margin-bottom: 8px;
}

.pod-grade {
    font-size: clamp(0.65rem, 1.3vw, 0.74rem);
    font-weight: 800;
    background: rgba(255, 255, 255, 0.88);
    padding: 3px 7px;
    border-radius: 12px;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pod-badge, .pod-highlight {
    font-size: clamp(0.62rem, 1.2vw, 0.7rem);
    font-weight: 800;
    padding: 3px 7px;
    border-radius: 12px;
    color: #FFF;
    white-space: nowrap;
    flex-shrink: 0;
}
.pod-badge { background: #10B981; }
.pod-highlight { background: #F43F5E; }

.pod-hero-icon {
    font-size: clamp(2.6rem, 7vw, 3.8rem);
    line-height: 1;
    margin: 6px 0 10px;
    align-self: center;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.08));
}

.pod-name {
    font-family: var(--font-heading);
    font-size: clamp(1.02rem, 2.3vw, 1.28rem);
    font-weight: 700;
    margin-bottom: 4px;
    text-align: center;
    color: var(--brand-dark);
    line-height: 1.25;
}

.pod-blurb {
    font-size: clamp(0.78rem, 1.6vw, 0.86rem);
    line-height: 1.38;
    color: #334155;
    font-weight: 600;
    text-align: center;
    margin-bottom: 14px;
    flex-grow: 1;
}

.pod-action {
    display: flex;
    justify-content: center;
    width: 100%;
}

.bubble-play-btn {
    background: #FFFFFF;
    color: var(--brand-dark);
    font-family: var(--font-heading);
    font-size: clamp(0.85rem, 1.8vw, 0.98rem);
    font-weight: 700;
    padding: 8px clamp(14px, 3vw, 20px);
    border-radius: 30px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.15s ease;
    white-space: nowrap;
}

/* Animations */
.float-element { animation: floatIcon 3s ease-in-out infinite alternate; }
.pulse-element { animation: pulseIcon 2s ease-in-out infinite alternate; }
.wiggle-element { animation: wiggleIcon 2.5s ease-in-out infinite alternate; }
.bounce-element { animation: bounceIcon 2s ease-in-out infinite alternate; }

@keyframes floatIcon { 0% { transform: translateY(0); } 100% { transform: translateY(-6px); } }
@keyframes pulseIcon { 0% { transform: scale(1); } 100% { transform: scale(1.08); } }
@keyframes wiggleIcon { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes bounceIcon { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* Collapsible Parents & Teachers Guide */
.learning-guide-card {
    background: #FFFFFF;
    border-radius: clamp(18px, 3vw, 28px);
    box-shadow: var(--shadow-soft);
    padding: clamp(12px, 2.5vw, 18px) clamp(14px, 3vw, 24px);
    margin-bottom: 25px;
    width: 100%;
}

.guide-summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-heading);
    font-size: clamp(1rem, 2.4vw, 1.25rem);
    font-weight: 700;
    color: var(--brand-dark);
    padding: 6px 0;
}
.guide-summary::-webkit-details-marker { display: none; }
.accordion-arrow { font-size: 1.3rem; color: #94A3B8; }

.guide-body { padding-top: 14px; border-top: 1px solid #F1F5F9; }
.guide-intro { font-size: clamp(0.85rem, 1.8vw, 0.95rem); line-height: 1.55; color: #475569; margin-bottom: 16px; }

.curriculum-trio {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.curriculum-box {
    padding: 14px;
    border-radius: 16px;
}
.curriculum-box h4 { font-family: var(--font-heading); margin-bottom: 5px; font-size: clamp(0.92rem, 2vw, 1.02rem); }
.curriculum-box p { font-size: clamp(0.8rem, 1.6vw, 0.86rem); color: #475569; line-height: 1.4; }

.stage-1 { background: #FEF9C3; color: #854D0E; }
.stage-2 { background: #E0E7FF; color: #3730A3; }
.stage-3 { background: #DCFCE7; color: #166534; }

.faq-clean-stack details {
    background: #F8FAFC;
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 8px;
    cursor: pointer;
}
.faq-clean-stack summary { font-weight: 700; color: #1E293B; font-size: clamp(0.85rem, 1.8vw, 0.92rem); }
.faq-clean-stack p { margin-top: 6px; font-size: clamp(0.8rem, 1.6vw, 0.88rem); color: #64748B; line-height: 1.45; }

/* Modern Footer */
.app-footer {
    text-align: center;
    padding-top: 16px;
    color: #64748B;
    font-size: clamp(0.8rem, 1.6vw, 0.9rem);
    width: 100%;
}
.footer-tagline { font-weight: 700; margin-bottom: 8px; }
.footer-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(8px, 2vw, 14px);
    flex-wrap: wrap;
}
.footer-nav a {
    color: var(--brand-indigo);
    font-weight: 700;
    text-decoration: none;
    font-size: clamp(0.8rem, 1.6vw, 0.88rem);
}
.footer-nav a:hover { text-decoration: underline; }
.dot { color: #CBD5E1; }

/* In-Feed Native Ad Full Span on Small Mobiles */
@media (max-width: 480px) {
    .card-span-ad {
        grid-column: 1 / -1;
    }
    .hero-stage {
        flex-direction: column;
        text-align: center;
    }
    .navbar-island {
        border-radius: 30px;
    }
}

/* Hover-Only States (Disabled on Touch Devices to Prevent Sticking) */
@media (hover: hover) and (pointer: fine) {
    .stage-dock-pill:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    }
    .game-pod-wrapper:hover {
        transform: translateY(-6px);
    }
    .game-pod:hover .bubble-play-btn {
        background: var(--brand-dark);
        color: #FFF;
        transform: scale(1.04);
    }
    .site-logo:hover {
        transform: scale(1.03) rotate(-1deg);
    }
}