.games-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.game-card {
    background: var(--primary-color);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 6px var(--shadow-color);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px var(--shadow-color);
}

.game-icon {
    width: 80px;
    height: 80px;
    background: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.game-icon i {
    font-size: 2.5rem;
    color: white;
}

.game-card h2 {
    color: var(--accent-color);
    font-size: 1.8rem;
    margin: 0;
}

.game-card p {
    color: var(--text-color);
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 0;
}

.game-features {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin: 1rem 0;
}

.game-features span {
    background: var(--secondary-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.game-features i {
    color: var(--accent-color);
}

.play-btn {
    background: var(--accent-color);
    color: white;
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
    margin-top: auto;
}

.play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px var(--shadow-color);
}

.play-btn i {
    font-size: 1.2rem;
}

/* Chess Card Specific */
.chess-card .game-icon {
    background: linear-gradient(135deg, #2c3e50, #3498db);
}

/* Math Card Specific */
.math-card .game-icon {
    background: linear-gradient(135deg, #e74c3c, #f39c12);
}

/* Chess Game Styles */
.chess-section .game-container {
    display: flex;
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
    padding: 1rem;
}

.board-container {
    flex: 0 0 600px;
    aspect-ratio: 1;
    background: var(--secondary-color);
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

#chessboard {
    width: 100%;
    height: 100%;
    max-width: 600px;
    max-height: 600px;
}

.game-info {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.game-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-btn {
    padding: 0.8rem;
    border: none;
    border-radius: 6px;
    background: var(--accent-color);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px var(--shadow-color);
}

.control-btn i {
    font-size: 1.1rem;
}

.move-history {
    flex: 1;
    background: var(--secondary-color);
    border-radius: 8px;
    padding: 1rem;
    overflow-y: auto;
    max-height: 300px;
}

.move-history h3 {
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

#moveList {
    font-family: monospace;
    line-height: 1.5;
}

.game-status {
    background: var(--secondary-color);
    border-radius: 8px;
    padding: 1rem;
}

.game-status h3 {
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

.leaderboard {
    margin-top: 1.5rem;
    background: var(--secondary-color);
    border-radius: 8px;
    padding: 1rem;
}

.leaderboard h2 {
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

/* Math Quiz Styles */
.math-quiz-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: 0 4px 6px var(--shadow-color);
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px;
    background: var(--primary-color);
    border-radius: 10px;
    color: white;
}

.quiz-info {
    display: flex;
    gap: 20px;
    font-size: 1.2rem;
}

.quiz-info i {
    margin-right: 5px;
}

.difficulty-selector {
    display: flex;
    gap: 10px;
}

.difficulty-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    background: var(--card-bg);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s;
}

.difficulty-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px var(--shadow-color);
}

.difficulty-btn.active {
    background: var(--accent-color);
    color: white;
}

.quiz-content {
    padding: 20px;
    background: var(--card-bg);
    border-radius: 10px;
    margin-bottom: 20px;
}

.question-container {
    text-align: center;
    margin-bottom: 30px;
}

.question {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.answer-input {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.answer-input input {
    width: 150px;
    padding: 10px;
    font-size: 1.2rem;
    border: 2px solid var(--primary-color);
    border-radius: 5px;
    text-align: center;
}

.answer-input button {
    padding: 10px 20px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.answer-input button:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px var(--shadow-color);
}

.quiz-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.quiz-controls button {
    padding: 12px 25px;
    font-size: 1.1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

#startQuizBtn {
    background: var(--secondary-color);
    color: white;
}

#resetQuizBtn {
    background: var(--accent-color);
    color: white;
}

.quiz-controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px var(--shadow-color);
}

.quiz-stats {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 20px;
}

.stats-container {
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.stat-item {
    padding: 10px;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Feedback Animation */
.feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 1.5rem 3rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.5rem;
    animation: feedback 1s ease-in-out;
    z-index: 1000;
    box-shadow: 0 4px 8px var(--shadow-color);
}

.feedback.correct {
    background: #2ecc71;
    color: white;
}

.feedback.incorrect {
    background: #e74c3c;
    color: white;
}

@keyframes feedback {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .chess-section .game-container {
        flex-direction: column;
        align-items: center;
    }

    .board-container {
        flex: 0 0 auto;
        width: 100%;
        max-width: 600px;
    }

    .game-info {
        flex: 0 0 auto;
        width: 100%;
        max-width: 600px;
    }
}

@media (max-width: 768px) {
    .games-container {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .game-card {
        padding: 1.5rem;
    }

    .game-features {
        flex-direction: column;
        align-items: center;
    }

    .game-features span {
        width: 100%;
        justify-content: center;
    }

    .board-container {
        max-width: 100%;
    }

    .game-info {
        max-width: 100%;
    }

    .quiz-header {
        flex-direction: column;
        gap: 15px;
    }

    .quiz-info {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }

    .difficulty-selector {
        width: 100%;
        justify-content: center;
    }

    .question {
        font-size: 2rem;
    }

    .answer-input {
        flex-direction: column;
    }

    .answer-input input {
        width: 100%;
    }

    .stats-container {
        flex-direction: column;
        gap: 15px;
    }
} 