/* ========== MATHS GAME SPECIFIC STYLES ========== */

.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

.game-header {
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    gap: 20px;
}

.header-left, .header-right {
    flex: 1;
}

.header-center {
    flex: 2;
    text-align: center;
}

.header-center h1 {
    color: #667eea;
    font-size: 2em;
}

.score-info {
    display: flex;
    gap: 20px;
    justify-content: center;
    font-size: 1.1em;
    color: #666;
}

.score-info span strong {
    color: #667eea;
    font-size: 1.2em;
}

/* ========== GAME CONTENT ========== */
.game-content {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========== OPERATION SELECTION ========== */
.operation-selection {
    text-align: center;
    width: 100%;
}

.operation-selection h2 {
    color: #667eea;
    font-size: 2em;
    margin-bottom: 40px;
}

.operation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.operation-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 30px;
    border-radius: 15px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.operation-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.op-icon {
    font-size: 2.5em;
}

.op-name {
    font-weight: 600;
    font-size: 1.1em;
}

/* ========== GAME AREA ========== */
.game-area {
    width: 100%;
}

.question-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.question-text {
    color: white;
    font-size: 3em;
    font-weight: bold;
    letter-spacing: 2px;
}

.answer-input-box {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    justify-content: center;
}

#answerInput {
    padding: 15px 20px;
    font-size: 1.5em;
    border: 3px solid #667eea;
    border-radius: 8px;
    width: 150px;
    text-align: center;
    transition: all 0.3s ease;
}

#answerInput:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

#answerInput.correct {
    border-color: #28a745;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.3);
    background: #f0fff4;
}

#answerInput.incorrect {
    border-color: #dc3545;
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.3);
    background: #fff5f5;
}

/* ========== PROGRESS BAR ========== */
.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 10px;
}

/* ========== CONTROL BUTTONS ========== */
.control-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.control-buttons .btn {
    flex: 1;
    min-width: 150px;
}

/* ========== LEVEL COMPLETE ========== */
.level-complete, .game-over {
    text-align: center;
    animation: popIn 0.5s ease;
}

.level-complete h2, .game-over h2 {
    color: #667eea;
    font-size: 2.5em;
    margin-bottom: 20px;
    animation: bounce 0.5s ease;
}

.level-complete p, .game-over p {
    font-size: 1.3em;
    color: #666;
    margin-bottom: 30px;
}

.level-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.level-buttons .btn {
    min-width: 150px;
}

/* ========== ANIMATIONS ========== */
@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes celebration {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(0deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) rotate(360deg) scale(0.5);
    }
}

/* ========== CELEBRATION GIF/EMOJI ========== */
#celebrationContainer {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1000;
}

.celebration-emoji {
    position: absolute;
    font-size: 4em;
    pointer-events: none;
    animation: celebration 1s ease-out forwards;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .game-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .header-left, .header-center, .header-right {
        flex: 1;
        width: 100%;
    }

    .game-content {
        padding: 20px;
        min-height: 400px;
    }

    .question-text {
        font-size: 2em;
    }

    .answer-input-box {
        flex-direction: column;
    }

    #answerInput {
        width: 100%;
    }

    .operation-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .control-buttons .btn {
        min-width: 120px;
        flex: 0 1 calc(50% - 8px);
    }
}

@media (max-width: 480px) {
    .game-header {
        padding: 15px;
    }

    .header-center h1 {
        font-size: 1.5em;
    }

    .score-info {
        flex-direction: column;
        gap: 10px;
        font-size: 0.9em;
    }

    .game-content {
        padding: 15px;
    }

    .question-text {
        font-size: 1.8em;
    }

    .question-box {
        padding: 25px;
        margin-bottom: 20px;
    }

    .operation-btn {
        padding: 20px;
    }

    .op-icon {
        font-size: 2em;
    }

    .control-buttons .btn {
        flex: 0 1 calc(50% - 8px);
        min-width: 100px;
        font-size: 0.9em;
    }
}
