/* Quiz pages. Uses the site's CSS variables (variables.css) so each site keeps its own look. */
.quiz-page { max-width: 760px; margin: 0 auto; padding: 16px; }
.quiz-wrap { display: block; }
.quiz-title { font-size: clamp(1.5rem, 4vw, 2.2rem); line-height: 1.2; margin: 8px 0 12px; }
.quiz-intro { font-size: 1.05rem; line-height: 1.6; color: var(--color-dark, #1a1a2e); }
.quiz-kicker { text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; color: var(--color-muted, #718096); margin: 0; }
.quiz-preview-banner { background: #fff6e0; color: #8a5a00; padding: 8px 12px; border-radius: 6px; font-size: 14px; margin-bottom: 8px; }

/* Images always reserve a 3:2 box (generated at 1536x1024) so the page never jumps while they load. */
.quiz-img { position: relative; width: 100%; aspect-ratio: 3 / 2; background: var(--bg-gray-100, #f1f5f9); border-radius: 10px; overflow: hidden; margin: 12px 0 4px; }
.quiz-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.quiz-credit { font-size: 12px; color: var(--color-muted, #718096); margin-bottom: 12px; }

.quiz-app { margin: 12px 0; }
.quiz-progress { font-size: 14px; color: var(--color-muted, #718096); margin-bottom: 6px; }
.quiz-bar { height: 6px; background: var(--bg-gray-200, #e2e8f0); border-radius: 3px; overflow: hidden; margin-bottom: 14px; }
.quiz-bar > i { display: block; height: 100%; background: var(--color-primary, #E38200); width: 0; transition: width .2s; }
.quiz-q { font-size: 1.3rem; line-height: 1.3; margin: 0 0 12px; }
.quiz-q:focus { outline: none; }
.quiz-answers { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; padding: 0; list-style: none; }

/* Large tap targets (min 52px) */
.quiz-btn { display: inline-block; font: inherit; font-size: 1rem; min-height: 52px; padding: 12px 18px; border-radius: 10px; border: 2px solid var(--border-gray-200, #e2e8f0); background: #fff; color: var(--color-dark, #1a1a2e); text-align: left; cursor: pointer; text-decoration: none; }
.quiz-btn:hover { border-color: var(--color-primary, #E38200); }
.quiz-btn:focus-visible { outline: 3px solid var(--color-secondary, #204c88); outline-offset: 2px; }
.quiz-btn-primary { background: var(--color-primary, #E38200); border-color: var(--color-primary, #E38200); color: #fff; text-align: center; font-weight: 600; }
.quiz-btn-primary:hover { background: var(--color-primary-hover, #c97200); }
.quiz-btn-ghost { text-align: center; }
.quiz-btn:disabled { cursor: default; }
.quiz-right { background: #e3f4e8; border-color: #1a6b38; }
.quiz-wrong { background: #fdecec; border-color: #a33; }
.quiz-feedback { padding: 10px 12px; border-radius: 8px; background: var(--bg-gray-50, #f8fafc); margin: 10px 0; line-height: 1.5; }
.quiz-nav { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

.quiz-result-title { font-size: 1.6rem; margin: 6px 0; }
.quiz-result p { line-height: 1.6; }
.quiz-links { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.quiz-aff { font-size: 12px; color: var(--color-muted, #718096); }
.quiz-ai-note { font-size: 12px; color: var(--color-muted, #718096); margin-top: 24px; }

.quiz-email { border: 1px solid var(--border-gray-200, #e2e8f0); border-radius: 10px; padding: 14px; margin: 18px 0; background: var(--bg-gray-50, #f8fafc); }
.quiz-email label { display: block; font-size: 14px; }
.quiz-email input[type="email"] { width: 100%; min-height: 48px; padding: 10px 12px; font-size: 16px; border: 1px solid #cbd5e0; border-radius: 8px; margin: 6px 0 10px; }
.quiz-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.4; margin-bottom: 10px; }
.quiz-consent input { margin-top: 3px; width: 20px; height: 20px; flex: none; }
.quiz-hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.quiz-msg { font-size: 14px; margin: 6px 0; }
.quiz-err { color: #a33; }
.quiz-shared { margin: 8px 0 16px; }

/* ── Play mode: ONE card at a time, filling the viewport. The intro/cover block is hidden once the quiz starts. ── */
.quiz-playing .quiz-title { font-size: 1.05rem; line-height: 1.25; margin: 2px 0 6px; color: var(--color-muted, #718096); font-weight: 600; }
.quiz-playing .quiz-ai-note { margin-top: 10px; }

.quiz-stage {
    display: flex; flex-direction: column;
    /* the card fills the screen (minus a little breathing room) but never grows past a comfortable size on big monitors */
    min-height: min(calc(100vh - 24px), 780px);
    min-height: min(calc(100dvh - 24px), 780px);
}
/* images are sized by the viewport height (not their own ratio) so every question's card is the same height */
.quiz-stage .quiz-img { flex: none; height: clamp(96px, 28vh, 320px); aspect-ratio: auto; margin: 6px 0 2px; }
.quiz-stage .quiz-credit { flex: none; margin: 0 0 6px; font-size: 11px; }
.quiz-stage .quiz-progress { flex: none; margin-bottom: 4px; }
.quiz-stage .quiz-bar { flex: none; margin-bottom: 8px; }
.quiz-stage .quiz-q { flex: none; margin: 4px 0 8px; }
.quiz-stage .quiz-answers { flex: none; margin: 8px 0; }
/* feedback and buttons keep their space even when empty, so nothing shifts when an answer is picked */
.quiz-feedback-slot { flex: none; min-height: 4.6em; }
.quiz-nav-fixed { margin-top: auto; min-height: 52px; padding-top: 6px; }
.quiz-stage .quiz-result { flex: 1 1 auto; }

@media (max-height: 720px) {
    .quiz-stage .quiz-img { height: clamp(72px, 22vh, 220px); }
    .quiz-btn { min-height: 46px; padding: 8px 14px; font-size: .95rem; }
    .quiz-q { font-size: 1.12rem; }
    .quiz-answers { gap: 8px; }
    .quiz-feedback-slot { min-height: 3.8em; font-size: .92rem; }
}
@media (max-height: 580px) {
    .quiz-stage .quiz-img { display: none; }
}

/* ── Answers span the full width of the card (mobile and desktop) ── */
.quiz-answers { width: 100%; }
.quiz-answers li { width: 100%; }
.quiz-answers .quiz-btn { display: block; width: 100%; box-sizing: border-box; }
@media (max-width: 600px) {
    .quiz-page { padding: 10px; }
}

/* ── Desktop: a taller picture (the card has room) ── */
@media (min-width: 900px) and (min-height: 721px) {
    .quiz-stage .quiz-img { height: clamp(220px, 36vh, 420px); }
}

/* ── Ad slots: fixed sizes (reserved, so nothing jumps). Never beside the answer buttons. ── */
.quiz-ad { margin: 10px auto; text-align: center; overflow: hidden; }
.quiz-ad-bottom { margin-top: 56px; }          /* well below the card's Next button */
.quiz-has-side { max-width: 1140px; }
.quiz-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; }
.quiz-main { min-width: 0; }
.quiz-side { position: sticky; top: 16px; }
@media (max-width: 899px) { .quiz-layout { display: block; } .quiz-side { display: none; } }
