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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
}

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

.hero-title {
    font-size: 3rem;
    color: #3498db;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.hero-subtitle {
    font-size: 1.5rem;
    color: #7f8c8d;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.game-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

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

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

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

.game-card h2 {
    color: #3498db;
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.game-card p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

.back-btn {
    display: inline-block;
    background: white;
    color: #3498db;
    padding: 12px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 1.2rem;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.back-btn:hover {
    transform: scale(1.05);
}

h1 {
    font-size: 2.5rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.score {
    background: white;
    display: inline-block;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 1.3rem;
    font-weight: bold;
    color: #3498db;
    margin-top: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Memory Game */
.memory-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    max-width: 600px;
    margin: 0 auto;
}

.memory-card {
    aspect-ratio: 1;
    background: white;
    border-radius: 15px;
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

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

.memory-card.flipped {
    transform: rotateY(180deg);
}

.memory-card.matched {
    opacity: 0.6;
    pointer-events: none;
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    backface-visibility: hidden;
    border-radius: 15px;
}

.card-front {
    background: #3498db;
    color: white;
    font-weight: bold;
}

.card-back {
    background: white;
    transform: rotateY(180deg);
}

/* Tic-Tac-Toe */
.tictactoe-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    max-width: 450px;
    margin: 0 auto;
}

.ttt-cell {
    aspect-ratio: 1;
    background: white;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.ttt-cell:hover:not(.filled) {
    background: #ecf0f1;
    transform: scale(1.05);
}

.ttt-cell.filled {
    cursor: default;
}

/* Coloring Book */
.coloring-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

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

.color-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid white;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.color-btn:hover, .color-btn.active {
    transform: scale(1.2);
    border-color: #f1c40f;
}

.coloring-templates {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.template-btn {
    background: white;
    color: #3498db;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.template-btn:hover {
    background: #3498db;
    color: white;
    transform: translateY(-3px);
}

.coloring-canvas {
    display: block;
    background: white;
    border-radius: 20px;
    margin: 0 auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    cursor: crosshair;
    touch-action: none;
}

/* Quiz */
.quiz-container {
    max-width: 600px;
    margin: 0 auto;
}

.question-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.question-emoji {
    font-size: 8rem;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

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

.question-card h2 {
    color: #3498db;
    font-size: 2rem;
    margin-bottom: 30px;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.quiz-option {
    background: #ecf0f1;
    border: none;
    padding: 20px;
    border-radius: 12px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    color: #2c3e50;
    font-weight: bold;
}

.quiz-option:hover {
    background: #3498db;
    color: white;
    transform: scale(1.05);
}

.feedback {
    text-align: center;
    font-size: 1.8rem;
    font-weight: bold;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    animation: slideIn 0.3s;
}

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

.feedback.correct {
    background: #2ecc71;
    color: white;
}

.feedback.wrong {
    background: #e74c3c;
    color: white;
}

/* Simon Says */
.simon-container {
    max-width: 500px;
    margin: 0 auto;
}

.simon-board {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.simon-btn {
    aspect-ratio: 1;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0.7;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.simon-btn:hover {
    opacity: 0.9;
}

.simon-btn.active {
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 12px 24px rgba(0,0,0,0.4);
}

.simon-btn.red { background: #e74c3c; }
.simon-btn.blue { background: #3498db; }
.simon-btn.green { background: #2ecc71; }
.simon-btn.yellow { background: #f1c40f; }

.simon-controls {
    text-align: center;
}

.simon-message {
    margin-top: 20px;
    font-size: 1.5rem;
    color: white;
    font-weight: bold;
    min-height: 40px;
}

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

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #2980b9;
    transform: translateY(-3px);
}

.btn-primary:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

.btn-secondary {
    background: white;
    color: #3498db;
}

.btn-secondary:hover {
    background: #ecf0f1;
    transform: translateY(-3px);
}

/* Win Message */
.win-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    z-index: 1000;
    animation: popIn 0.5s;
}

@keyframes popIn {
    from { transform: translate(-50%, -50%) scale(0); }
    to { transform: translate(-50%, -50%) scale(1); }
}

.win-message h2 {
    color: #3498db;
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.win-message p {
    font-size: 1.5rem;
    color: #7f8c8d;
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

footer {
    text-align: center;
    color: white;
    font-size: 1.2rem;
    margin-top: 40px;
    padding: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .game-icon {
        font-size: 3rem;
    }
    
    .game-card h2 {
        font-size: 1.5rem;
    }
    
    .memory-board {
        gap: 10px;
    }
    
    .card-front, .card-back {
        font-size: 2rem;
    }
    
    .ttt-cell {
        font-size: 3rem;
    }
    
    .question-emoji {
        font-size: 5rem;
    }
    
    .coloring-canvas {
        max-width: 100%;
    }
}

@media print {
    body {
        background: white;
    }
    
    .coloring-controls, .coloring-templates, header, .back-btn {
        display: none;
    }
    
    .coloring-canvas {
        box-shadow: none;
    }
}