:root {
    --quiz-card-bg: rgba(7, 11, 30, 0.6);
    --quiz-border: rgba(255, 255, 255, 0.12);
    --quiz-correct: #34d399;
    --quiz-wrong: #fb7185;
}

body.quiz-page {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #111827, #312e81);
    color: #fff;
    min-height: 100vh;
}

.quiz-shell {
    max-width: 980px;
    margin: 0 auto;
    padding: 32px 20px 96px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.quiz-hero {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--quiz-border);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
}

.quiz-hero h1 {
    font-size: 42px;
    margin-bottom: 12px;
}

.quiz-hero p {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
}

.quiz-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
}

.quiz-pill {
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 14px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.quiz-stage {
    background: var(--quiz-card-bg);
    border: 1px solid var(--quiz-border);
    border-radius: 24px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}

.stage-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.stage-progress {
    flex: 1;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    overflow: hidden;
}

.stage-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(135deg, #0ea5e9, #22d3ee);
    transition: width 0.3s ease;
}

.prompt-card {
    padding: 20px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.prompt-tag {
    display: inline-block;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
}

.prompt-card h2 {
    font-size: 26px;
    margin-bottom: 8px;
}

.prompt-card p {
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.85);
}

.option-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quiz-option {
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 16px;
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    text-align: left;
    font-size: 16px;
    line-height: 1.4;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.quiz-option:hover {
    transform: translateY(-2px);
    border-color: rgba(14, 165, 233, 0.7);
}

.quiz-option.correct {
    border-color: rgba(52, 211, 153, 0.8);
    background: rgba(52, 211, 153, 0.15);
}

.quiz-option.incorrect {
    border-color: rgba(251, 113, 133, 0.8);
    background: rgba(251, 113, 133, 0.15);
}

.quiz-option[disabled] {
    opacity: 0.65;
    cursor: not-allowed;
}

.feedback-banner {
    border-radius: 18px;
    padding: 16px;
    font-weight: 600;
    display: none;
}

.feedback-banner.show { display: block; }

.feedback-banner.correct {
    border: 1px solid rgba(52, 211, 153, 0.8);
    background: rgba(52, 211, 153, 0.12);
    color: var(--quiz-correct);
}

.feedback-banner.incorrect {
    border: 1px solid rgba(251, 113, 133, 0.8);
    background: rgba(251, 113, 133, 0.12);
    color: var(--quiz-wrong);
}

.quiz-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}

.quiz-summary {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--quiz-border);
    border-radius: 24px;
    padding: 32px;
}

.scoreboard {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 12px 0 24px;
}

.score-chip {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.score-chip.correct { border-color: rgba(52, 211, 153, 0.7); color: var(--quiz-correct); }
.score-chip.incorrect { border-color: rgba(251, 113, 133, 0.7); color: var(--quiz-wrong); }

.quiz-summary h3 { margin-bottom: 12px; }

.summary-xp {
    font-weight: 600;
    color: var(--quiz-correct);
}

.summary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .quiz-hero h1 { font-size: 32px; }
    .quiz-shell { padding: 24px 16px 80px; }
    .quiz-stage { padding: 22px; }
}

@media (max-width: 600px) {
    .stage-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .quiz-option {
        padding: 14px;
        font-size: 15px;
    }

    .quiz-actions,
    .summary-actions,
    .quiz-meta {
        flex-direction: column;
        align-items: stretch;
    }

    .quiz-actions .btn,
    .summary-actions .btn,
    .quiz-actions button,
    .summary-actions button {
        width: 100%;
    }

    .prompt-card,
    .quiz-hero,
    .quiz-summary {
        padding: 20px;
    }
}

@media (max-width: 420px) {
    .quiz-hero h1 { font-size: 26px; }
    .quiz-hero p { font-size: 16px; }
    .quiz-option { font-size: 14px; }
    .quiz-stage { padding: 18px; }
    .feedback-banner { font-size: 14px; }
}
