/* Number Cruncher - Maths Puzzle Game Styles */

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.game-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.score-board {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.score-item {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px 30px;
    border-radius: 15px;
    text-align: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 120px;
}

.score-item .label {
    display: block;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.score-item .value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
}

.game-area {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 600px;
    text-align: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
}

.puzzle-container {
    margin-bottom: 30px;
}

.puzzle-equation {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    line-height: 1.2;
}

.puzzle-instruction {
    font-size: 1.2rem;
    opacity: 0.9;
}

.answer-area {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

#answerInput {
    flex: 1;
    padding: 15px 20px;
    font-size: 1.5rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
}

#answerInput:focus {
    border-color: white;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

#answerInput::placeholder {
    color: #999;
    font-weight: 400;
}

.btn {
    background: white;
    color: #667eea;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.btn:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    border: none;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: white;
    transform: translateY(-2px);
}

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

.feedback {
    min-height: 24px;
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feedback.show {
    opacity: 1;
}

.feedback.success {
    color: #4caf50;
    opacity: 1;
}

.feedback.error {
    color: #f44336;
    opacity: 1;
}

.feedback.warning {
    color: #ff9800;
    opacity: 1;
}

.feedback.info {
    color: #2196f3;
    opacity: 1;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    margin: 5% auto;
    padding: 30px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
}

.close {
    color: white;
    float: right;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.close:hover {
    opacity: 1;
}

.instructions h2 {
    font-size: 2rem;
    margin-bottom: 25px;
    text-align: center;
}

.instruction-section {
    margin-bottom: 25px;
}

.instruction-section h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.instruction-section p,
.instruction-section ul {
    line-height: 1.6;
    margin-bottom: 10px;
}

.instruction-section ul {
    list-style-type: disc;
    padding-left: 25px;
}

.instruction-section li {
    margin-bottom: 8px;
}

.instruction-section strong {
    font-weight: 700;
}

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

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

.shake {
    animation: shake 0.5s ease-in-out;
}

.pulse {
    animation: pulse 0.3s ease-in-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .score-board {
        gap: 10px;
    }
    
    .score-item {
        padding: 10px 15px;
        min-width: 80px;
    }
    
    .score-item .label {
        font-size: 0.7rem;
    }
    
    .score-item .value {
        font-size: 1.5rem;
    }
    
    .game-area {
        padding: 30px 20px;
    }
    
    .puzzle-equation {
        font-size: 2.5rem;
    }
    
    .puzzle-instruction {
        font-size: 1rem;
    }
    
    .answer-area {
        flex-direction: column;
    }
    
    #answerInput {
        font-size: 1.3rem;
    }
    
    .btn {
        font-size: 1rem;
        padding: 12px 25px;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-secondary {
        width: 100%;
        max-width: 250px;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
    }
    
    .instructions h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .puzzle-equation {
        font-size: 2rem;
    }
    
    .score-item {
        padding: 8px 10px;
        min-width: 60px;
    }
    
    .score-item .value {
        font-size: 1.2rem;
    }
    
    .game-area {
        padding: 20px 15px;
    }
}