/* Brain Training Game Styles */

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

body {
    font-family: 'Open Sans', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

/* Screen Management */
.screen {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.screen.active {
    display: block;
}

/* Main Menu Styles */
#main-menu {
    text-align: center;
}

.menu-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.game-title {
    font-family: 'Fredoka One', cursive;
    font-size: 3.5rem;
    color: #4a5568;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    animation: titleBounce 2s ease-in-out infinite alternate;
}

.subtitle {
    font-size: 1.2rem;
    color: #718096;
    margin-bottom: 30px;
}

.difficulty-selector {
    margin-bottom: 30px;
}

.difficulty-selector label {
    font-weight: 600;
    margin-right: 10px;
    color: #4a5568;
}

.difficulty-selector select {
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.difficulty-selector select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Game Cards */
.game-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.game-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.game-card:hover::before {
    left: 100%;
}

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

.card-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.game-card h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.game-card p {
    font-size: 1rem;
    opacity: 0.9;
}

/* Stats Summary */
.stats-summary {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 5px;
}

.stat-item span:last-child {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

/* Game Screen Styles */
.game-screen {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    min-height: 600px;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.back-btn {
    background: #e2e8f0;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #cbd5e0;
    transform: translateX(-2px);
}

.game-info {
    display: flex;
    gap: 20px;
}

.score-display, .level-display, .timer-display {
    text-align: center;
    background: #f7fafc;
    padding: 10px 15px;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
}

.label {
    display: block;
    font-size: 0.8rem;
    color: #718096;
    margin-bottom: 5px;
}

.score-display span:last-child,
.level-display span:last-child,
.timer-display span:last-child {
    font-size: 1.2rem;
    font-weight: 700;
    color: #667eea;
}

.game-content {
    text-align: center;
}

.game-content h2 {
    font-size: 2.5rem;
    color: #4a5568;
    margin-bottom: 20px;
}

.instruction {
    font-size: 1.2rem;
    color: #718096;
    margin-bottom: 30px;
}

/* Number Sequence Game */
.sequence-display {
    font-size: 3rem;
    font-weight: 700;
    color: #667eea;
    margin: 30px 0;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7fafc;
    border-radius: 15px;
    border: 3px solid #e2e8f0;
    letter-spacing: 0.2em;
}

.input-section {
    margin: 30px 0;
}

.input-section input {
    font-size: 1.5rem;
    padding: 15px 20px;
    border: 3px solid #e2e8f0;
    border-radius: 10px;
    margin-right: 15px;
    text-align: center;
    letter-spacing: 0.1em;
    width: 300px;
    max-width: 100%;
}

.input-section input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Find Symbol Game */
.symbol-grid {
    display: grid;
    gap: 10px;
    margin: 30px auto;
    max-width: 600px;
    justify-content: center;
}

.symbol-grid.grid-3x3 {
    grid-template-columns: repeat(3, 1fr);
}

.symbol-grid.grid-4x4 {
    grid-template-columns: repeat(4, 1fr);
}

.symbol-grid.grid-5x5 {
    grid-template-columns: repeat(5, 1fr);
}

.symbol-item {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: #f7fafc;
    border: 3px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.symbol-item:hover {
    background: #edf2f7;
    transform: scale(1.05);
}

.symbol-item.correct {
    background: #c6f6d5;
    border-color: #38a169;
    animation: correctPulse 0.6s ease;
}

.symbol-item.incorrect {
    background: #fed7d7;
    border-color: #e53e3e;
    animation: shake 0.6s ease;
}

/* Word Recall Game */
.word-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 30px 0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.word-item {
    background: #f7fafc;
    border: 3px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    font-size: 1.3rem;
    font-weight: 600;
    color: #4a5568;
    animation: wordFadeIn 0.5s ease;
}

.question-section {
    margin: 30px 0;
}

.question {
    font-size: 1.5rem;
    color: #4a5568;
    margin-bottom: 20px;
    font-weight: 600;
}

.answer-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.answer-btn {
    padding: 15px 30px;
    font-size: 1.2rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 120px;
}

.yes-btn {
    background: #48bb78;
    color: white;
}

.yes-btn:hover {
    background: #38a169;
    transform: translateY(-2px);
}

.no-btn {
    background: #f56565;
    color: white;
}

.no-btn:hover {
    background: #e53e3e;
    transform: translateY(-2px);
}

/* Buttons */
.start-btn, .next-btn, .btn, #ns-submit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    margin: 10px;
}

.start-btn:hover, .next-btn:hover, .btn:hover, #ns-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.btn.secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn.share {
    background: #38b2ac;
}

/* Feedback */
.feedback {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 20px 0;
    min-height: 30px;
}

.feedback.correct {
    color: #38a169;
}

.feedback.incorrect {
    color: #e53e3e;
}

/* Game Over Screen */
#game-over {
    text-align: center;
}

.screen-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.final-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.achievements {
    margin: 30px 0;
}

.achievement {
    display: inline-block;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #744210;
    padding: 10px 20px;
    border-radius: 20px;
    margin: 5px;
    font-weight: 600;
    animation: badgeGlow 2s ease-in-out infinite alternate;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Progress Bar */
.progress-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    z-index: 1000;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #48bb78, #38a169);
    border-radius: 10px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShine 2s ease-in-out infinite;
}

.progress-text {
    text-align: center;
    margin-top: 5px;
    color: white;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Confetti */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #ff6b6b;
    top: -10px;
    animation: confetti-fall 3s linear forwards;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

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

@keyframes titleBounce {
    from { transform: translateY(0); }
    to { transform: translateY(-10px); }
}

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

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

@keyframes wordFadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes badgeGlow {
    from { box-shadow: 0 0 5px rgba(255, 215, 0, 0.5); }
    to { box-shadow: 0 0 20px rgba(255, 215, 0, 0.8); }
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .game-title {
        font-size: 2.5rem;
    }
    
    .game-cards {
        grid-template-columns: 1fr;
    }
    
    .game-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .game-info {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stats-summary {
        flex-direction: column;
        gap: 15px;
    }
    
    .input-section input {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .symbol-item {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .answer-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .progress-container {
        width: 90%;
    }
}