* {
    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 {
    width: 100%;
    max-width: 800px;
    position: relative;
}

.screen {
    display: none;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.5s ease;
}

.screen.active {
    display: block;
}

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


.welcome-content {
    padding: 60px 40px;
    text-align: center;
}

.welcome-content h1 {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.quiz-setup {
    max-width: 400px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 25px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}


.btn {
    padding: 15px 40px;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin: 5px;
}

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

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

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

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

.quiz-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 40px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.user-name {
    font-size: 1.2rem;
    font-weight: 600;
}

.quiz-stats {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
}

.timer {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 10px;
}

.progress-bar {
    height: 8px;
    background: #e0e0e0;
}

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

.quiz-content {
    padding: 40px;
}

.question-container {
    margin-bottom: 40px;
}

.question-container h2 {
    font-size: 1.5rem;
    color: #333;
    line-height: 1.6;
}

.options-container {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

.option {
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
    text-align: left;
    font-size: 1rem;
}

.option:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateX(5px);
}

.option.selected {
    border-color: #667eea;
    background: #f0f4ff;
}

.option.correct {
    border-color: #10b981;
    background: #d1fae5;
    animation: correctAnswer 0.5s ease;
}

.option.wrong {
    border-color: #ef4444;
    background: #fee2e2;
    animation: wrongAnswer 0.5s ease;
}

.option.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

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

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


.results-content {
    padding: 60px 40px;
    text-align: center;
}

.results-icon {
    font-size: 5rem;
    margin-bottom: 20px;
}

.results-content h1 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 10px;
}

.results-name {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 30px;
}

.score-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 20px;
    margin-bottom: 30px;
}

.final-score {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
}

.score-total {
    font-size: 2rem;
    opacity: 0.8;
}

.score-percentage {
    font-size: 1.5rem;
    margin-top: 10px;
    opacity: 0.9;
}

.results-details {
    background: #f8f9ff;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid #e0e0e0;
}

.result-item:last-child {
    border-bottom: none;
}

.result-label {
    font-weight: 600;
    color: #666;
}

.result-value {
    font-weight: 700;
    font-size: 1.1rem;
}

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

.result-value.wrong {
    color: #ef4444;
}

.performance-message {
    font-size: 1.2rem;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 30px;
    padding: 20px;
    background: #f0f4ff;
    border-radius: 10px;
}

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


.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1000;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    color: white;
    margin-top: 20px;
    font-size: 1.2rem;
}


@media (max-width: 768px) {
    .welcome-content {
        padding: 40px 20px;
    }
    
    .welcome-content h1 {
        font-size: 2rem;
    }
    
    .quiz-header {
        padding: 20px;
        flex-direction: column;
        gap: 15px;
    }
    
    .quiz-stats {
        gap: 15px;
    }
    
    .quiz-content {
        padding: 20px;
    }
    
    .question-container h2 {
        font-size: 1.2rem;
    }
    
    .results-content {
        padding: 40px 20px;
    }
    
    .final-score {
        font-size: 3rem;
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}