/* ===== QUIZ DE MÍDIA ===== */

.quiz-main {
    max-width: 520px;
    margin: 80px auto 40px;
    padding: 0 16px;
}

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

.quiz-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0 0 6px;
    background: linear-gradient(135deg, #22c55e, #06b6d4, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.quiz-header h1 i { -webkit-text-fill-color: #22c55e; }

.quiz-header p {
    color: rgba(255,255,255,0.45);
    margin: 0;
    font-size: 0.9rem;
}

/* Start Screen */
.quiz-start {
    text-align: center;
    padding: 40px 20px;
}

.quiz-start-icon {
    font-size: 4rem;
    color: #22c55e;
    margin-bottom: 16px;
}

.quiz-start h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px;
}

.quiz-start p {
    color: rgba(255,255,255,0.4);
    margin: 0 0 24px;
    font-size: 0.9rem;
}

.quiz-config {
    margin-bottom: 24px;
}

.quiz-config label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.quiz-qty-btns {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.quiz-qty {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.5);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.quiz-qty:hover { background: rgba(255,255,255,0.06); }

.quiz-qty.active {
    background: linear-gradient(135deg, rgba(34,197,94,0.2), rgba(6,182,212,0.15));
    border-color: rgba(34,197,94,0.4);
    color: #22c55e;
}

.quiz-btn-start {
    padding: 14px 32px;
    background: linear-gradient(135deg, #22c55e, #06b6d4);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 20px rgba(34,197,94,0.3);
}

.quiz-btn-start:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(34,197,94,0.4);
}

.quiz-btn-start:disabled { opacity: 0.6; cursor: default; }

/* Progress */
.quiz-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.quiz-progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
}

.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #06b6d4);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.quiz-progress-text {
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255,255,255,0.4);
    min-width: 40px;
    text-align: right;
}

.quiz-score-live {
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.3);
    margin-bottom: 16px;
}

.quiz-score-live span {
    color: #22c55e;
    font-weight: 800;
}

/* Question Card */
.quiz-q-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
}

.quiz-card-in {
    animation: quizSlideIn 0.3s ease;
}

@keyframes quizSlideIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

.quiz-q-poster {
    width: 100px;
    height: 140px;
    object-fit: cover;
    border-radius: 10px;
    margin: 0 auto 16px;
    display: block;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.quiz-q-type {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(34,197,94,0.1);
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #22c55e;
    margin-bottom: 12px;
}

.quiz-q-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 20px;
    line-height: 1.4;
}

/* Options */
.quiz-q-opcoes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quiz-opcao {
    padding: 12px 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.quiz-opcao:hover:not(:disabled) {
    background: rgba(255,255,255,0.08);
    border-color: rgba(34,197,94,0.3);
}

.quiz-opcao:disabled { cursor: default; }

.quiz-opcao-correta {
    background: rgba(34,197,94,0.15) !important;
    border-color: rgba(34,197,94,0.5) !important;
    color: #22c55e !important;
}

.quiz-opcao-errada {
    background: rgba(239,68,68,0.15) !important;
    border-color: rgba(239,68,68,0.5) !important;
    color: #ef4444 !important;
}

.quiz-feedback {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 16px 0 12px;
    overflow-wrap: anywhere;
}

.quiz-feedback:empty { margin: 0; }
.quiz-feedback-correct { color: #4ade80; }
.quiz-feedback-answer { color: #a5e5f0; }
.quiz-btn-next { width: 100%; font-size: 0.9rem; padding: 12px 20px; }
.quiz-btn-next[hidden] { display: none; }

.quiz-opcao:focus-visible,
.quiz-btn-start:focus-visible,
.quiz-qty:focus-visible {
    outline: 2px solid #06b6d4;
    outline-offset: 3px;
}

/* Result */
.quiz-result {
    text-align: center;
    padding: 30px 20px;
}

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

.quiz-result h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 6px;
}

.quiz-result p {
    color: rgba(255,255,255,0.4);
    margin: 0 0 20px;
}

.quiz-result-score {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 2px;
    margin-bottom: 4px;
}

.quiz-result-num {
    font-size: 3rem;
    font-weight: 900;
    color: #22c55e;
}

.quiz-result-total {
    font-size: 1.5rem;
    font-weight: 600;
    color: rgba(255,255,255,0.3);
}

.quiz-result-pct {
    font-size: 1rem;
    font-weight: 700;
    color: rgba(255,255,255,0.4);
    margin-bottom: 24px;
}

/* Breakdown */
.quiz-result-breakdown {
    text-align: left;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.quiz-breakdown-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 0.8rem;
}

.quiz-bd-correct { background: rgba(34,197,94,0.05); }
.quiz-bd-wrong { background: rgba(239,68,68,0.05); }

.quiz-bd-icon { font-size: 0.9rem; flex-shrink: 0; margin-top: 1px; }

.quiz-bd-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.quiz-bd-q {
    color: rgba(255,255,255,0.6);
    line-height: 1.3;
}

.quiz-bd-answer {
    color: #22c55e;
    font-weight: 600;
    font-size: 0.75rem;
}

/* Loading */
.quiz-loading {
    text-align: center;
    padding: 40px;
    color: rgba(255,255,255,0.4);
}

@media (prefers-reduced-motion: reduce) {
    .quiz-card-in { animation: none; }
    .quiz-progress-fill { transition: none; }
}

/* Responsive */
@media (max-width: 480px) {
    .quiz-main { margin-top: 70px; padding: 0 10px; }
    .quiz-q-card { padding: 16px; }
    .quiz-q-poster { width: 80px; height: 115px; }
    .quiz-result-num { font-size: 2.5rem; }
}

/* Light theme: surfaces, content and interaction states. */
:is(html.light-theme-early, body.light-theme) .quiz-header p,
:is(html.light-theme-early, body.light-theme) .quiz-start p,
:is(html.light-theme-early, body.light-theme) .quiz-config label,
:is(html.light-theme-early, body.light-theme) .quiz-progress-text,
:is(html.light-theme-early, body.light-theme) .quiz-score-live,
:is(html.light-theme-early, body.light-theme) .quiz-result p,
:is(html.light-theme-early, body.light-theme) .quiz-result-total,
:is(html.light-theme-early, body.light-theme) .quiz-result-pct,
:is(html.light-theme-early, body.light-theme) .quiz-bd-q,
:is(html.light-theme-early, body.light-theme) .quiz-loading {
    color: var(--text-muted, #526070);
}

:is(html.light-theme-early, body.light-theme) .quiz-start h2,
:is(html.light-theme-early, body.light-theme) .quiz-q-text,
:is(html.light-theme-early, body.light-theme) .quiz-result h2,
:is(html.light-theme-early, body.light-theme) .quiz-feedback {
    color: var(--text, #1e293b);
}

:is(html.light-theme-early, body.light-theme) .quiz-qty,
:is(html.light-theme-early, body.light-theme) .quiz-opcao {
    background: var(--surface2, #f8f7f3); border-color: var(--border, rgba(30, 41, 59, .12)); color: var(--text, #1e293b);
}

:is(html.light-theme-early, body.light-theme) .quiz-qty:hover,
:is(html.light-theme-early, body.light-theme) .quiz-opcao:hover:not(:disabled) {
    background: #edeaf5; border-color: rgba(109, 40, 217, .22);
}

:is(html.light-theme-early, body.light-theme) .quiz-q-card {
    background: var(--surface, #fff); border-color: var(--border, rgba(30, 41, 59, .12));
}

:is(html.light-theme-early, body.light-theme) .quiz-progress-bar {
    background: #dce1e7;
}

:is(html.light-theme-early, body.light-theme) .quiz-qty.active,
:is(html.light-theme-early, body.light-theme) .quiz-score-live span,
:is(html.light-theme-early, body.light-theme) .quiz-q-type,
:is(html.light-theme-early, body.light-theme) .quiz-result-num,
:is(html.light-theme-early, body.light-theme) .quiz-bd-answer,
:is(html.light-theme-early, body.light-theme) .quiz-feedback-correct {
    color: #15803d;
}

:is(html.light-theme-early, body.light-theme) .quiz-qty.active {
    background: #e5f5eb; border-color: #72af85;
}

:is(html.light-theme-early, body.light-theme) .quiz-opcao-correta {
    color: #126b34 !important;
}

:is(html.light-theme-early, body.light-theme) .quiz-opcao-errada {
    color: #b91c1c !important;
}

:is(html.light-theme-early, body.light-theme) .quiz-feedback-answer {
    color: #0e7490;
}

:is(html.light-theme-early, body.light-theme) .quiz-btn-start {
    background: linear-gradient(135deg, #15803d, #0e7490); color: #fff; border-color: transparent;
}

:is(html.light-theme-early, body.light-theme) .quiz-header h1 { background-image: linear-gradient(135deg, #15803d, #0e7490, #6d28d9); }
:is(html.light-theme-early, body.light-theme) .quiz-header h1 i { -webkit-text-fill-color: #15803d; }
:is(html.light-theme-early, body.light-theme) .quiz-qty.active { color: #126b34; }

:is(html.light-theme-early, body.light-theme) .quiz-start-icon { color: #15803d; }
