* {
    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;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    padding: 30px;
}

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

.header h1 {
    color: #667eea;
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.stats {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.value {
    font-size: 2rem;
    font-weight: bold;
}

.value.correct {
    color: #10b981;
}

.value.incorrect {
    color: #ef4444;
}

.value.streak {
    color: #f59e0b;
}

.game-area {
    background: #f9fafb;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
}

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

.timer {
    text-align: center;
    font-size: 3rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
}

.timer.warning {
    color: #f59e0b;
    animation: pulse 0.5s infinite;
}

.timer.danger {
    color: #ef4444;
    animation: pulse 0.3s infinite;
}

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

.timer-bar {
    height: 10px;
    background: #e5e7eb;
    border-radius: 5px;
    overflow: hidden;
}

.timer-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #667eea);
    width: 100%;
    transition: width 0.1s linear, background 0.3s;
}

.timer-fill.warning {
    background: linear-gradient(90deg, #f59e0b, #f97316);
}

.timer-fill.danger {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

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

.question {
    font-size: 3rem;
    font-weight: bold;
    color: #1f2937;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.answer-input {
    flex: 1;
    padding: 15px 20px;
    font-size: 1.5rem;
    border: 3px solid #e5e7eb;
    border-radius: 10px;
    text-align: center;
    transition: border-color 0.3s;
}

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

.answer-input:disabled {
    background: #f3f4f6;
    cursor: not-allowed;
}

.progress-container {
    margin-bottom: 20px;
}

.progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

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

.progress-text {
    text-align: center;
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
}

.btn {
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-submit {
    background: #667eea;
    color: white;
}

.btn-submit:hover:not(:disabled) {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-start {
    background: #10b981;
    color: white;
    width: 100%;
    font-size: 1.5rem;
    padding: 20px;
}

.btn-start:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    background: #6b7280;
    color: white;
    width: 100%;
}

.btn-secondary:hover {
    background: #4b5563;
}

.feedback {
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    min-height: 40px;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.feedback.correct {
    color: #10b981;
    background: #d1fae5;
    animation: slideIn 0.3s;
}

.feedback.incorrect {
    color: #ef4444;
    background: #fee2e2;
    animation: shake 0.5s;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.start-container {
    text-align: center;
}

.question-count-selector {
    text-align: center;
}

.question-count-selector h3 {
    color: #1f2937;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

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

.btn-count {
    padding: 20px 40px;
    font-size: 1.3rem;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    background: #10b981;
    color: white;
    min-width: 140px;
}

.btn-count:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

.end-screen {
    text-align: center;
    padding: 20px;
}

.end-screen h2 {
    color: #667eea;
    font-size: 2.5rem;
    margin-bottom: 30px;
}

.final-stats {
    margin-bottom: 30px;
}

.final-score {
    font-size: 1.5rem;
    color: #1f2937;
    margin-bottom: 15px;
}

.final-score span {
    font-weight: bold;
    color: #667eea;
}

.final-percentage {
    font-size: 4rem;
    font-weight: bold;
    color: #10b981;
    margin-bottom: 15px;
}

.final-message {
    font-size: 1.8rem;
    color: #1f2937;
    font-weight: bold;
}

.footer {
    text-align: center;
}

@media (max-width: 600px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .question {
        font-size: 1.5rem;
    }
    
    .answer-input {
        font-size: 1.2rem;
    }
    
    .count-options {
        flex-direction: column;
    }
    
    .btn-count {
        width: 100%;
    }
    
    .end-screen h2 {
        font-size: 2rem;
    }
    
    .final-percentage {
        font-size: 3rem;
    }
    
    .final-message {
        font-size: 1.3rem;
    }
}
