* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    font-size: 18px;
}

.container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 40px;
}

.problem-container {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    position: relative;
}

.timer-container {
    position: absolute;
    top: 10px;
    right: 10px;
}

.timer {
    font-size: 24px;
    font-weight: bold;
    padding: 5px 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    display: inline-block;
    transition: background-color 0.3s;
}

.timer.warning {
    background-color: #f39c12;
}

.timer.danger {
    background-color: #e74c3c;
    animation: pulse 1s infinite;
}

.problem {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    margin: 20px 0;
    padding: 10px;
    border: 2px dashed #6c757d;
    border-radius: 5px;
    color: #34495e;
}

.work-area {
    background-color: #ffffff;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #dee2e6;
}

.steps {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    font-size: 20px;
    line-height: 1.6;
}

.steps p {
    margin: 5px 0;
}

.steps .correct {
    color: #28a745;
    font-weight: bold;
}

.steps .incorrect {
    color: #dc3545;
    font-weight: bold;
}

.steps .timeout {
    color: #ffc107;
    font-weight: bold;
}

.interaction {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

input[type="number"] {
    padding: 8px;
    font-size: 16px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    width: 100px;
}

.remainder-area {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 20px;
}

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

button {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #0069d9;
}

button:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.progress {
    margin: 20px 0;
}

.progress-text {
    margin-bottom: 5px;
    font-weight: bold;
    text-align: center;
    font-size: 20px;
}

.progress-bar {
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #28a745;
    width: 0%;
    transition: width 0.5s;
}

.stats {
    display: flex;
    justify-content: space-around;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-top: 20px;
    font-size: 20px;
}

.stats p {
    margin: 0;
    font-weight: bold;
}

.stats span {
    font-size: 1.2em;
}

.correct-answer {
    color: #27ae60;
    font-weight: bold;
}

.incorrect-answer {
    color: #e74c3c;
    font-weight: bold;
}

.highlight {
    background-color: #fef9e7;
    padding: 3px 7px;
    border-radius: 4px;
}

#correct {
    color: #28a745;
}

#incorrect {
    color: #dc3545;
}

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

@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 15px;
    }
    
    .problem {
        font-size: 48px;
    }
    
    button {
        padding: 15px 20px;
        font-size: 20px;
        min-width: 120px;
    }
    
    .interaction {
        flex-direction: column;
        align-items: flex-start;
    }
    
    input[type="number"] {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .buttons {
        flex-direction: column;
        width: 100%;
    }
    
    button {
        width: 100%;
    }
    
    .problem {
        font-size: 42px;
    }
}
