:root {
    --primary-color: #2196F3;
    --secondary-color: #1976D2;
    --text-color: #333;
    --background-color: #f5f5f5;
}

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

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

header {
    background-color: white;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    max-width: 200px;
}

.logo {
    width: 100%;
    height: auto;
}

nav button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    margin-left: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

nav button:hover {
    background-color: var(--secondary-color);
}

.hero {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.hero > p {
    margin-bottom: 2rem;
}

.hero button {
    background-color: white;
    color: var(--primary-color);
    border: none;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 2rem;
    transition: transform 0.3s;
}

.hero button:hover {
    transform: scale(1.05);
}

.features {
    padding: 4rem 2rem;
    background-color: white;
}

.features h2 {
    text-align: center;
    margin-bottom: 3rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.feature-card h3 {
    margin-bottom: 1rem;
}

.game-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.game-choice {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    border: none;
    border-radius: 12px;
    padding: 2rem;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}

.game-choice:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.choice-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.game-choice p {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #666;
}

footer {
    text-align: center;
    padding: 2rem;
    background-color: #333;
    color: white;
}

.game-page {
    min-height: calc(100vh - 140px);
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.game-page #gameContent {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    max-width: 800px;
    width: 90%;
    margin-top: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

#gameContainer {
    display: none;
}

#gameTitle {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

#gameDescription {
    font-size: 1rem;
    margin-bottom: 2rem;
    color: #666;
}

#levelIndicator {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    margin: 1rem 0;
    display: inline-block;
    font-size: 1.2rem;
    color: var(--text-color);
}

#levelIndicator.hidden {
    display: none;
}

#problem {
    font-size: 2rem;
    margin: 2rem 0;
    transition: opacity 0.3s ease;
}

#answer {
    padding: 0.5rem;
    font-size: 1.5rem;
    width: 150px;
    margin-bottom: 1rem;
    text-align: center;
}

#answer:disabled {
    background-color: #f0f0f0;
    cursor: not-allowed;
}

#submitAnswer, #closeGame {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    margin: 0.5rem;
}

#score {
    font-size: 1.2rem;
    margin: 1rem 0;
}

.wrong {
    animation: shake 0.5s;
    background-color: #ffebee;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
}