* {
    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: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 800px;
    width: 100%;
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #2d3436 0%, #636e72 100%);
    color: white;
    padding: 35px 30px;
    text-align: center;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.subtitle {
    opacity: 0.85;
    font-size: 0.95rem;
    margin-bottom: 15px;
}

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

.tag {
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.tag-1 { background: #fdcb6e; color: #2d3436; }
.tag-2 { background: #74b9ff; color: #2d3436; }
.tag-3 { background: #55efc4; color: #2d3436; }
.tag-4 { background: #fab1a0; color: #2d3436; }
.tag-5 { background: #a29bfe; color: #2d3436; }
.tag-6 { background: #81ecec; color: #2d3436; }

.screen {
    display: none;
    padding: 40px;
}

.screen.active {
    display: block;
}

.start-content, .results-content {
    text-align: center;
}

.start-content h2, .results-content h2 {
    color: #2d3436;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.start-content p, .score-summary p {
    color: #636e72;
    margin-bottom: 15px;
    line-height: 1.6;
}

.material-list {
    list-style: none;
    padding: 0;
    margin: 15px 0;
    text-align: left;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.material-list li {
    padding: 8px 12px;
    margin: 6px 0;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    font-size: 0.9rem;
    color: #2d3436;
}

.quiz-meta {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.quiz-meta span {
    background: #f8f9fa;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #636e72;
    font-weight: 500;
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

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

.btn:disabled {
    background: #b2bec3;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: linear-gradient(135deg, #636e72 0%, #2d3436 100%);
    box-shadow: 0 4px 15px rgba(99, 110, 114, 0.4);
}

.btn-secondary:hover {
    box-shadow: 0 6px 20px rgba(99, 110, 114, 0.6);
}

.quiz-header {
    margin-bottom: 25px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    color: #636e72;
    font-size: 0.9rem;
    font-weight: 500;
}

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

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

.topic-indicator {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.topic-1 { background: #ffeaa7; color: #d68910; }
.topic-2 { background: #74b9ff; color: #2d3436; }
.topic-3 { background: #55efc4; color: #00b894; }
.topic-4 { background: #fab1a0; color: #d63031; }
.topic-5 { background: #a29bfe; color: #6c5ce7; }
.topic-6 { background: #81ecec; color: #00cec9; }

.question-text {
    color: #2d3436;
    font-size: 1.35rem;
    margin-bottom: 25px;
    line-height: 1.6;
    text-align: left;
    font-weight: 500;
}

.answers-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
    text-align: left;
}

.answer-btn {
    background: #f8f9fa;
    border: 2px solid #dfe6e9;
    padding: 16px 20px;
    font-size: 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    color: #2d3436;
    font-weight: 400;
    line-height: 1.5;
}

.answer-btn:hover {
    background: #eef1f3;
    border-color: #b2bec3;
    transform: translateX(4px);
}

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

.answer-btn.correct {
    background: #00b894;
    color: white;
    border-color: #00b894;
}

.answer-btn.incorrect {
    background: #d63031;
    color: white;
    border-color: #d63031;
}

.answer-btn.reveal-correct {
    background: #ffeaa7;
    border-color: #fdcb6e;
    color: #d68910;
    font-weight: 500;
}

.quiz-footer {
    display: flex;
    justify-content: center;
}

.score-summary {
    margin: 30px 0;
}

.score-summary p {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

#final-score {
    font-size: 3rem;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#score-message {
    color: #636e72;
    font-size: 1.1rem;
}

.result-icon {
    font-size: 4rem;
    margin-bottom: 10px;
}

.review-section {
    margin-top: 25px;
    text-align: left;
    max-height: 400px;
    overflow-y: auto;
}

.review-section h3 {
    color: #2d3436;
    margin-bottom: 15px;
    text-align: center;
}

.review-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 10px;
    border-left: 4px solid #667eea;
}

.review-item .review-q {
    font-weight: 600;
    color: #2d3436;
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.review-item .review-a {
    color: #00b894;
    font-size: 0.85rem;
}

.review-item .review-wrong {
    color: #d63031;
    font-size: 0.85rem;
    text-decoration: line-through;
    opacity: 0.7;
}

.button-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

@media (max-width: 600px) {
    .container {
        border-radius: 12px;
    }

    header {
        padding: 20px 15px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .screen {
        padding: 20px 15px;
    }

    .question-text {
        font-size: 1.15rem;
    }

    .answer-btn {
        padding: 12px 14px;
        font-size: 0.9rem;
    }

    .quiz-meta {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .topic-tags {
        gap: 6px;
    }

    .tag {
        font-size: 0.65rem;
        padding: 3px 10px;
    }

    #final-score {
        font-size: 2.2rem;
    }

    .review-section {
        max-height: 300px;
    }
}