* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comic Sans MS', 'Comic Sans', cursive, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    overflow-x: hidden;
    position: relative;
}

.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: transparent;
    z-index: 0;
}

.stars::before,
.stars::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    box-shadow: 
        100px 200px white, 300px 100px white, 500px 300px white,
        700px 150px white, 200px 400px white, 600px 250px white,
        400px 50px white, 800px 350px white, 150px 100px white,
        450px 400px white, 750px 50px white, 250px 250px white;
    animation: twinkle 3s infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* HEADER */
.header {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 2rem;
    color: #667eea;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.nav {
    display: flex;
    gap: 10px;
}

.nav-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.nav-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.nav-btn.active {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

/* MAIN */
.main {
    position: relative;
    z-index: 1;
}

.section {
    display: none;
    min-height: calc(100vh - 200px);
    padding: 60px 20px;
}

.section.active {
    display: block;
}

.section-title {
    text-align: center;
    font-size: 3rem;
    color: white;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
    margin-bottom: 50px;
}

/* HERO */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
    margin-bottom: 80px;
}

.hero-content {
    color: white;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 20px;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.hero-image {
    position: relative;
    height: 400px;
}

.floating-emoji {
    font-size: 5rem;
    position: absolute;
    animation: float 3s ease-in-out infinite;
}

.floating-emoji:nth-child(1) { top: 0; left: 0; }
.floating-emoji:nth-child(2) { top: 0; right: 0; }
.floating-emoji:nth-child(3) { bottom: 0; left: 0; }
.floating-emoji:nth-child(4) { bottom: 0; right: 0; }

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* BUTTONS */
.btn {
    padding: 15px 40px;
    border: none;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
}

.btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 25px rgba(0,0,0,0.3);
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* FEATURES */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.feature-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    color: #667eea;
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.feature-card p {
    color: #666;
    font-size: 1.1rem;
}

/* ANIMATIONS */
.animate-bounce {
    animation: bounce 1s ease;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.animate-slide-up {
    animation: slideUp 0.6s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* STORIES */
.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.story-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.story-card:hover {
    transform: translateY(-10px) rotate(2deg);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.story-cover {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
}

.rainbow-bg { background: linear-gradient(135deg, #667eea, #764ba2, #f093fb); }
.space-bg { background: linear-gradient(135deg, #1e3c72, #2a5298, #7e22ce); }
.ocean-bg { background: linear-gradient(135deg, #0093E9, #80D0C7); }
.forest-bg { background: linear-gradient(135deg, #56ab2f, #a8e063); }

.story-card h3 {
    padding: 20px;
    color: #333;
    font-size: 1.5rem;
}

.story-card p {
    padding: 0 20px 20px;
    color: #666;
}

/* GAMES */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.game-card {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.game-card h3 {
    color: #667eea;
    font-size: 1.8rem;
    margin-bottom: 20px;
    text-align: center;
}

/* Memory Game */
.memory-game {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 20px 0;
}

.memory-card {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    transition: all 0.3s;
    color: transparent;
}

.memory-card:hover {
    transform: scale(1.05);
}

.memory-card.flipped {
    background: white;
    color: #333;
}

.memory-card.matched {
    background: #4ade80;
    color: white;
}

/* Math Game */
.math-game {
    text-align: center;
}

.math-question {
    font-size: 2.5rem;
    color: #667eea;
    margin: 30px 0;
    font-weight: bold;
}

.math-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.math-btn {
    padding: 20px;
    font-size: 1.5rem;
    border: 3px solid #667eea;
    background: white;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.math-btn:hover {
    background: #667eea;
    color: white;
    transform: scale(1.05);
}

#math-result {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 20px 0;
    min-height: 40px;
}

.score {
    font-size: 1.3rem;
    color: #667eea;
    font-weight: bold;
    margin-top: 20px;
}

/* Color Game */
.color-palette {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
}

.color-btn {
    width: 80px;
    height: 80px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.color-btn:hover {
    transform: scale(1.1);
}

.color-btn.red { background: #ef4444; }
.color-btn.blue { background: #3b82f6; }
.color-btn.yellow { background: #eab308; }

.color-result {
    height: 100px;
    border-radius: 15px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    border: 3px dashed #ccc;
    transition: all 0.3s;
}

/* Word Game */
.word-game {
    text-align: center;
}

.word-image {
    font-size: 6rem;
    margin: 20px 0;
}

.word-puzzle {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

.letter-btn {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    border: 3px solid #667eea;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.letter-btn:hover {
    background: #667eea;
    color: white;
}

.letter-btn.used {
    opacity: 0.3;
    cursor: not-allowed;
}

.word-answer {
    font-size: 2rem;
    color: #667eea;
    font-weight: bold;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
    letter-spacing: 10px;
}

/* AI CHAT */
.ai-container {
    max-width: 900px;
    margin: 0 auto;
}

.ai-chat {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 30px;
}

.chat-messages {
    height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
}

.bot-message,
.user-message {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    flex-direction: row-reverse;
}

.bot-avatar,
.user-avatar {
    font-size: 2rem;
    flex-shrink: 0;
}

.message-content {
    background: white;
    padding: 15px 20px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 70%;
}

.user-message .message-content {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.chat-input {
    display: flex;
    gap: 10px;
}

.chat-input input {
    flex: 1;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
}

.chat-input input:focus {
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.quick-questions {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.quick-questions h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.quick-btn {
    display: block;
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
}

.quick-btn:hover {
    transform: translateX(10px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s ease;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #ef4444;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.close-btn:hover {
    transform: rotate(90deg);
}

/* FOOTER */
.footer {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px 0;
    text-align: center;
    margin-top: 60px;
}

.footer p {
    color: #667eea;
    font-size: 1.1rem;
    margin: 5px 0;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .hero {
        grid-template-columns: 1fr;
    }
    
    .nav {
        flex-wrap: wrap;
    }
    
    .nav-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
}