/* Games Page Specific Styles */

.games-hero {
    min-height: 60vh;
}

/* Games Grid */
.games-section {
    background: var(--bg-dark);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.game-card {
    padding: 2.5rem 2rem;
    text-align: center;
    transition: var(--transition-normal);
    cursor: pointer;
}

.game-card:hover {
    transform: translateY(-10px) scale(1.03);
}

.game-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    position: relative;
}

.math-game {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.memory-game {
    background: linear-gradient(135deg, #ec4899, #f97316);
}

.typing-game {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.word-game {
    background: linear-gradient(135deg, #10b981, #059669);
}

.pattern-game {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.reaction-game {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
}

.game-icon::after {
    content: '';
    position: absolute;
    inset: -4px;
    background: inherit;
    border-radius: 50%;
    opacity: 0.4;
    filter: blur(15px);
    z-index: -1;
}

.game-card h3 {
    font-size: 1.8rem;
    color: white;
    margin-bottom: 1rem;
    font-weight: 800;
}

.game-card p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.game-stats {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.game-stats span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.6);
}

.game-btn {
    width: 100%;
    background: var(--gradient-ai);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    cursor: pointer;
    transition: var(--transition-normal);
}

.game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.5);
}

/* Game Modal */
.large-modal {
    max-width: 800px;
    min-height: 500px;
}

.game-container {
    width: 100%;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.game-header h2 {
    color: white;
    font-size: 2rem;
    font-weight: 900;
    font-family: var(--font-heading);
}

.game-score {
    display: flex;
    gap: 2rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 700;
}

/* Math Quiz Styles */
.question-container {
    margin-bottom: 3rem;
}

.question {
    font-size: 2rem;
    color: white;
    text-align: center;
    margin-bottom: 3rem;
    font-weight: 800;
    font-family: var(--font-tech);
}

.answer-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.answer-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-normal);
}

.answer-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-light);
    transform: scale(1.05);
}

.answer-btn.correct {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    animation: correctPulse 0.5s ease;
}

.answer-btn.wrong {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    animation: shake 0.5s ease;
}

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

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

.game-progress {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-ai);
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* Memory Game Styles */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.memory-card {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    cursor: pointer;
    transition: var(--transition-normal);
}

.memory-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.memory-card.flipped {
    background: var(--gradient-ai);
    transform: rotateY(180deg);
}

.memory-card.matched {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    cursor: default;
}

/* Typing Test Styles */
.typing-container {
    margin-bottom: 2rem;
}

.typing-text {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    line-height: 2;
    margin-bottom: 1.5rem;
    font-family: 'Courier New', monospace;
}

#typingInput {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    font-size: 1.2rem;
    font-family: 'Courier New', monospace;
    resize: none;
    min-height: 150px;
}

#typingInput:focus {
    outline: none;
    border-color: var(--primary-light);
    background: rgba(255, 255, 255, 0.08);
}

.typing-results {
    text-align: center;
    padding: 2rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 12px;
}

.typing-results h3 {
    color: #10b981;
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.typing-results p {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

/* Word Scramble Styles */
.word-container {
    text-align: center;
}

.scrambled-word {
    font-size: 3rem;
    color: white;
    font-weight: 900;
    margin-bottom: 2rem;
    font-family: var(--font-tech);
    letter-spacing: 0.5rem;
}

#wordInput {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

#wordInput:focus {
    outline: none;
    border-color: var(--primary-light);
    background: rgba(255, 255, 255, 0.08);
}

.game-submit-btn,
.game-hint-btn {
    background: var(--gradient-ai);
    border: none;
    color: white;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    margin: 0.5rem;
    transition: var(--transition-normal);
}

.game-hint-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.game-submit-btn:hover,
.game-hint-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}

.word-hint {
    background: rgba(245, 158, 11, 0.1);
    border: 2px solid rgba(245, 158, 11, 0.3);
    color: #f59e0b;
    padding: 1rem;
    border-radius: 12px;
    margin-top: 1.5rem;
}

.word-category {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
    margin-top: 2rem;
}

/* Pattern Game Styles */
.pattern-container {
    text-align: center;
}

.pattern-instruction {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.pattern-display {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 3rem;
}

.pattern-shape {
    width: 80px;
    height: 80px;
    background: var(--gradient-ai);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.pattern-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1.5rem;
    max-width: 500px;
    margin: 0 auto;
}

.pattern-option {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    cursor: pointer;
    transition: var(--transition-normal);
}

.pattern-option:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

/* Reaction Game Styles */
.reaction-container {
    text-align: center;
}

.reaction-display {
    min-height: 300px;
    background: rgba(255, 68, 68, 0.2);
    border: 3px solid rgba(255, 68, 68, 0.5);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    transition: var(--transition-fast);
    cursor: pointer;
}

.reaction-display.waiting {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.5);
}

.reaction-display.ready {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.8);
}

.reaction-display p {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
}

.game-start-btn {
    background: var(--gradient-ai);
    border: none;
    color: white;
    padding: 1.2rem 3rem;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-normal);
}

.game-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.5);
}

.reaction-attempts {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.reaction-attempt {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.8rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
}

/* Common Game Buttons */
.game-reset-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    margin-top: 1rem;
}

.game-reset-btn:hover {
    background: var(--gradient-ai);
    border-color: transparent;
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
    .games-grid {
        grid-template-columns: 1fr;
    }

    .large-modal {
        max-width: 95%;
        padding: 2rem 1.5rem;
    }

    .answer-options {
        grid-template-columns: 1fr;
    }

    .memory-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.8rem;
    }

    .memory-card {
        font-size: 2rem;
    }

    .game-header {
        flex-direction: column;
        gap: 1rem;
    }

    .game-score {
        flex-direction: column;
        gap: 0.5rem;
    }

    .question {
        font-size: 1.5rem;
    }

    .scrambled-word {
        font-size: 2rem;
        letter-spacing: 0.3rem;
    }

    .pattern-display {
        flex-wrap: wrap;
    }

    .pattern-shape {
        width: 60px;
        height: 60px;
    }
}
