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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #fff;
}

.container {
    max-width: 800px;
    width: 100%;
}

.screen {
    display: none;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    color: #333;
}

.screen.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

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

.title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 30px;
}

.setup-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-group label {
    font-weight: 600;
    color: #555;
}

.difficulty-select {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.difficulty-select:hover,
.difficulty-select:focus {
    border-color: #667eea;
    outline: none;
}

.btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
    margin-bottom: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    width: 100%;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-hint {
    background: #ffd700;
    color: #333;
    padding: 10px 20px;
    font-size: 0.9rem;
}

.btn-hint:hover {
    background: #ffed4e;
}

/* Game Screen */
.game-header {
    margin-bottom: 30px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 600;
    color: #555;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    width: 0%;
}

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

.problem-display {
    margin: 40px 0;
}

.problem-text {
    font-size: 2.5rem;
    color: #333;
    font-weight: 700;
}

.answer-input-section {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.answer-input {
    flex: 1;
    min-width: 200px;
    padding: 15px;
    font-size: 1.5rem;
    border: 3px solid #ddd;
    border-radius: 10px;
    text-align: center;
}

.answer-input:focus {
    outline: none;
    border-color: #667eea;
}

.answer-input-section .btn-primary {
    flex: 0 0 auto;
    width: auto;
    min-width: 150px;
}

.feedback {
    min-height: 60px;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 1.1rem;
    font-weight: 600;
}

.feedback.correct {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.feedback.incorrect {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

.hint-section {
    margin-top: 20px;
}

.hint-content {
    margin-top: 15px;
    padding: 15px;
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 10px;
    display: none;
    text-align: left;
    color: #856404;
}

.hint-content.show {
    display: block;
}

/* Results Screen */
.results-content {
    margin: 30px 0;
}

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

.score-summary h2 {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 10px;
}

.score-summary p {
    font-size: 1.5rem;
    color: #666;
}

.result-message {
    font-size: 1.3rem;
    font-weight: 600;
    margin-top: 20px;
    color: #333;
}

.missed-problems {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.missed-problems h3 {
    color: #555;
    margin-bottom: 15px;
}

.missed-problem {
    padding: 10px;
    background: white;
    margin-bottom: 10px;
    border-radius: 5px;
    border-left: 4px solid #dc3545;
}

.results-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Responsive */
@media (max-width: 600px) {
    .screen {
        padding: 20px;
    }

    .title {
        font-size: 2rem;
    }

    .problem-text {
        font-size: 2rem;
    }

    .answer-input-section {
        flex-direction: column;
    }

    .answer-input-section .btn-primary {
        width: 100%;
    }

    .score-summary h2 {
        font-size: 2rem;
    }
}
