/* Modern Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Base Styles */
body {
    background: linear-gradient(135deg, #8e2de2 0%, #4a00e0 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #2d3436;
    line-height: 1.6;
}

/* Game Container */
#game-container {
    width: 100%;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    position: relative;
}

/* Screen Styles */
.screen {
    padding: 2.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 500px;
}

.hidden {
    display: none !important;
}

/* Typography */
h1 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: #2d3436;
    font-weight: 700;
    background: linear-gradient(45deg, #e17055, #d63031);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #2d3436;
}

p {
    margin-bottom: 2rem;
    color: #636e72;
    font-size: 1.1rem;
    max-width: 80%;
    line-height: 1.6;
}

/* Buttons */
.btn {
    background: linear-gradient(45deg, #e17055, #d63031);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(225, 112, 85, 0.4);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(225, 112, 85, 0.6);
}

.btn:active {
    transform: translateY(1px);
}

/* Game Screen */
.score-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 2rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3436;
}

.problem {
    font-size: 2.5rem;
    margin: 2rem 0;
    font-weight: 700;
    color: #2d3436;
    min-height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    overflow: hidden;
}

.input-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 400px;
    margin: 1rem 0;
}

input[type="number"] {
    padding: 1rem;
    font-size: 1.5rem;
    border: 2px solid #dfe6e9;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s ease;
    width: 100%;
}

input[type="number"]:focus {
    outline: none;
    border-color: #e17055;
    box-shadow: 0 0 0 3px rgba(225, 112, 85, 0.3);
}

/* Feedback */
.feedback {
    margin: 1rem 0;
    min-height: 2rem;
    font-weight: 600;
    font-size: 1.1rem;
}

.correct {
    color: #27ae60;
}

.incorrect {
    color: #e74c3c;
}

/* Stats */
.stats {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin-top: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    font-weight: 600;
}

/* Result Screen */
.final-score, .final-accuracy {
    font-size: 1.5rem;
    margin: 1rem 0;
    font-weight: 600;
}

/* Timer Animation */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); color: #e74c3c; }
    100% { transform: scale(1); }
}

.time-warning {
    animation: pulse 1s infinite;
    color: #e74c3c;
}

/* Responsive Design */
@media (max-width: 600px) {
    .screen {
        padding: 1.5rem;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .problem {
        font-size: 2rem;
        padding: 1rem;
    }
    
    .stats {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}
