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

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

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

.container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    animation: fadeInDown 1s;
}

.rainbow-text {
    font-size: 3em;
    background: linear-gradient(45deg, #ff6b6b, #ffd93d, #6bcf7f, #4d96ff, #b185ff);
    background-size: 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbow 3s ease infinite;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.2);
}

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

.tagline {
    color: white;
    font-size: 1.5em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.game-nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.nav-btn {
    background: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

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

.nav-btn.active {
    background: linear-gradient(45deg, #ff6b6b, #ffd93d);
    color: white;
}

.content-section {
    display: none;
    animation: fadeIn 0.5s;
}

.content-section.active {
    display: block;
}

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

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

.game-grid, .learn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.game-card, .learn-card {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

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

.game-icon {
    font-size: 4em;
    margin-bottom: 15px;
    animation: bounce 2s infinite;
}

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

.game-card h3 {
    color: #667eea;
    font-size: 1.5em;
    margin-bottom: 10px;
}

.alphabet-grid, .number-grid, .color-grid, .animal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.letter-btn, .number-btn, .color-btn, .animal-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 1.3em;
    cursor: pointer;
    transition: all 0.3s;
}

.letter-btn:hover, .number-btn:hover, .animal-btn:hover {
    transform: scale(1.2) rotate(10deg);
}

.color-btn {
    height: 60px;
    border: 3px solid white;
}

#drawingCanvas {
    width: 100%;
    height: 400px;
    background: white;
    border-radius: 20px;
    cursor: crosshair;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.drawing-tools {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.color-palette {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.color-option {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid white;
    transition: all 0.3s;
}

.color-option:hover {
    transform: scale(1.2);
}

.tool-btn {
    background: white;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
}

.piano {
    display: flex;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
}

.key {
    width: 60px;
    height: 200px;
    background: white;
    border: 2px solid #333;
    border-radius: 0 0 10px 10px;
    cursor: pointer;
    transition: all 0.1s;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 10px;
    font-weight: bold;
}

.key:active {
    background: #ddd;
    transform: scale(0.95);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    position: relative;
    animation: slideIn 0.3s;
}

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

.close {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 2em;
    cursor: pointer;
    color: #667eea;
}

@media (max-width: 768px) {
    .rainbow-text {
        font-size: 2em;
    }
    
    .nav-btn {
        padding: 10px 20px;
        font-size: 1em;
    }
    
    .game-grid, .learn-grid {
        grid-template-columns: 1fr;
    }
}