* {
    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: 700px;
}

.quiz-wrapper {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* Start Screen */
.start-screen,
.quiz-screen,
.result-screen {
    display: none;
    padding: 40px;
    animation: fadeIn 0.5s ease;
}

.start-screen.active,
.quiz-screen.active,
.result-screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.start-screen h1 {
    color: #667eea;
    font-size: 2.5rem;
    margin-bottom: 15px;
    text-align: center;
}

.start-screen p {
    color: #666;
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 40px;
}

.quiz-info {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-bottom: 40px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    background: #f8f9fa;
    border-radius: 10px;
    font-size: 1rem;
    color: #333;
}

.icon {
    font-size: 1.5rem;
}

.quiz-topics {
    margin-bottom: 30px;
    text-align: center;
}

.topics-title {
    font-size: 1rem;
    color: #666;
    margin-bottom: 15px;
    font-weight: 500;
}

.topic-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.topic-tag {
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.random-note {
    margin-top: 15px;
    font-size: 0.95rem;
    color: #764ba2;
    font-weight: 500;
    text-align: center;
}

.btn-start,
.btn-next,
.btn-restart {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-start:hover,
.btn-next:hover,
.btn-restart:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-next:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Quiz Screen */
.quiz-header {
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    width: 0%;
}

.quiz-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.question-number {
    font-size: 1rem;
    color: #666;
}

.timer {
    font-size: 1.2rem;
    font-weight: 700;
    color: #667eea;
    padding: 8px 20px;
    background: #f0f3ff;
    border-radius: 20px;
}

.timer.warning {
    color: #ff6b6b;
    background: #ffe0e0;
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.quiz-body {
    margin-bottom: 30px;
}

.question {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 30px;
    line-height: 1.6;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.option {
    padding: 18px 20px;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    color: #333;
}

.option:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.option.selected {
    background: #e7eaff;
    border-color: #667eea;
}

.option.correct {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.option.wrong {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.option.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Result Screen */
.result-icon {
    font-size: 5rem;
    text-align: center;
    margin-bottom: 20px;
}

.result-title {
    font-size: 2rem;
    color: #333;
    text-align: center;
    margin-bottom: 30px;
}

.score-display {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.score-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.score-text {
    font-size: 3rem;
    font-weight: 700;
    color: white;
}

.result-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.detail-item {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.detail-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
}

.detail-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
}

.detail-item.correct .detail-value {
    color: #28a745;
}

.detail-item.wrong .detail-value {
    color: #dc3545;
}

.detail-item.percentage .detail-value {
    color: #667eea;
}

/* Responsive Design */
@media (max-width: 768px) {
    .start-screen,
    .quiz-screen,
    .result-screen {
        padding: 30px 20px;
    }

    .start-screen h1 {
        font-size: 2rem;
    }

    .question {
        font-size: 1.2rem;
    }

    .score-circle {
        width: 150px;
        height: 150px;
    }

    .score-text {
        font-size: 2.5rem;
    }

    .result-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .start-screen h1 {
        font-size: 1.5rem;
    }

    .info-item {
        font-size: 0.9rem;
        padding: 12px 20px;
    }

    .quiz-info {
        gap: 10px;
    }

    .question {
        font-size: 1.1rem;
    }

    .option {
        padding: 15px;
        font-size: 0.95rem;
    }

    .result-details {
        grid-template-columns: 1fr;
    }
}