/* =======================================================
   QUIZ PAGE RESET
======================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --quiz-green: #1e7e34;
    --quiz-green-dark: #17672a;
    --quiz-green-light: #eaf7ee;

    --quiz-surface: #ffffff;
    --quiz-background: #f3f6f4;

    --quiz-text: #171917;
    --quiz-muted: #66706a;

    --quiz-border: #dde6df;
    --quiz-border-dark: #c9d6cc;

    --quiz-correct: #18864b;
    --quiz-correct-soft: #e9f8ef;

    --quiz-incorrect: #c53838;
    --quiz-incorrect-soft: #fff0f0;

    --quiz-radius-large: 24px;
    --quiz-radius-medium: 16px;
    --quiz-radius-small: 11px;

    --quiz-shadow:
        0 12px 34px rgba(22, 58, 31, 0.09);
}

body {
    min-height: 100vh;

    background: var(--quiz-background);
    color: var(--quiz-text);

    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

/* =======================================================
   PAGE LAYOUT
======================================================= */

.quiz-page {
    width: 100%;
    min-height: 100vh;

    padding: 28px;
}

.quiz-shell {
    width: 100%;
    max-width: 1180px;

    margin: 0 auto;
}

/* =======================================================
   BRANDED QUIZ BANNER
======================================================= */

.quiz-header {
    position: relative;
    overflow: hidden;

    min-height: 170px;
    margin-bottom: 24px;
    padding: 30px 34px;

    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;

    color: white;

    background:
        radial-gradient(
            circle at 85% 20%,
            rgba(255, 255, 255, 0.2),
            transparent 28%
        ),
        linear-gradient(
            135deg,
            #17672a 0%,
            #21883f 52%,
            #48b96d 100%
        );

    border-radius: var(--quiz-radius-large);

    box-shadow:
        0 14px 34px rgba(30, 126, 52, 0.18);
}

.quiz-header::after {
    content: "📝";

    position: absolute;
    right: 22%;
    bottom: -76px;

    font-size: 180px;
    line-height: 1;

    opacity: 0.08;

    transform: rotate(-13deg);

    pointer-events: none;
}

.quiz-header-main {
    position: relative;
    z-index: 1;

    display: flex;
    align-items: center;
    gap: 22px;

    min-width: 0;
}

.quiz-header-icon {
    flex: 0 0 auto;

    width: 84px;
    height: 84px;

    display: grid;
    place-items: center;

    background: white;

    border: 5px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;

    font-size: 39px;

    box-shadow:
        0 10px 26px rgba(0, 0, 0, 0.15);
}

.quiz-header-copy {
    min-width: 0;
}

.quiz-eyebrow {
    margin: 0 0 7px;

    color: rgba(255, 255, 255, 0.8);

    font-size: 13px;
    font-weight: 850;

    text-transform: uppercase;
    letter-spacing: 0.11em;
}

.quiz-header h1 {
    margin: 0 0 8px;

    color: white;

    font-size: clamp(29px, 4vw, 43px);
    line-height: 1.08;
}

.quiz-meta {
    margin: 0;

    color: rgba(255, 255, 255, 0.9);

    font-size: 15px;
    font-weight: 650;
    line-height: 1.5;
}

.quiz-header-stat {
    position: relative;
    z-index: 1;

    flex: 0 0 auto;

    min-width: 122px;
    padding: 18px 20px;

    background: rgba(255, 255, 255, 0.14);

    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 16px;

    text-align: center;

    backdrop-filter: blur(8px);
}

.quiz-header-stat strong {
    display: block;

    color: white;

    font-size: 28px;
    line-height: 1;
}

.quiz-header-stat span {
    display: block;

    margin-top: 7px;

    color: rgba(255, 255, 255, 0.84);

    font-size: 12px;
    font-weight: 750;
}

/* =======================================================
   QUIZ PROGRESS
======================================================= */

.quiz-progress-panel {
    margin-bottom: 22px;
    padding: 18px 22px;

    background: white;

    border: 1px solid var(--quiz-border);
    border-radius: var(--quiz-radius-medium);

    box-shadow:
        0 5px 16px rgba(0, 0, 0, 0.045);
}

.quiz-progress-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;

    margin-bottom: 12px;
}

.quiz-progress {
    margin: 0;

    color: var(--quiz-green);

    font-size: 15px;
    font-weight: 850;
}

.quiz-timer {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 82px;
    padding: 7px 12px;

    background: var(--quiz-green-light);
    color: var(--quiz-green);

    border-radius: 999px;

    font-size: 14px;
    font-weight: 850;
}

.quiz-timer::before {
    content: "⏱";
    margin-right: 6px;
}

.progress-bar {
    width: 100%;
    height: 10px;

    overflow: hidden;

    background: #e7ece8;

    border-radius: 999px;
}

.progress {
    height: 100%;

    background:
        linear-gradient(
            90deg,
            #1e7e34,
            #47b972
        );

    border-radius: 999px;

    transition: width 0.3s ease;
}

.timer-warning {
    background: #fff5d9;
    color: #9a6700;
}

.timer-danger {
    background: #fff0f0;
    color: var(--quiz-incorrect);

    animation: timerPulse 0.8s infinite alternate;
}

@keyframes timerPulse {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.04);
    }
}

/* =======================================================
   QUESTION CARD
======================================================= */

.quiz-question-card {
    padding: 30px 32px;

    background: var(--quiz-surface);

    border: 1px solid var(--quiz-border);
    border-radius: var(--quiz-radius-large);

    box-shadow: var(--quiz-shadow);
}

.quiz-question-wrap {
    transition:
        background-color 0.25s ease,
        border-color 0.25s ease;
}

.quiz-question {
    margin-bottom: 22px;

    color: var(--quiz-text);

    font-size: clamp(21px, 2.2vw, 29px);
    font-weight: 700;
    line-height: 1.42;
}

/* =======================================================
   QUESTION IMAGE
======================================================= */

.quiz-image-wrap {
    margin: 22px 0 28px;
    padding: 18px;

    background: #f8faf8;

    border: 1px solid var(--quiz-border);
    border-radius: var(--quiz-radius-medium);

    text-align: center;
}

.quiz-question-image {
    display: block;

    width: auto;
    max-width: 100%;
    max-height: 480px;

    margin: 0 auto;

    background: white;

    border-radius: 10px;

    object-fit: contain;
}

/* =======================================================
   DATA TABLE
======================================================= */

.quiz-data-table {
    width: 100%;

    margin: 24px 0 28px;

    overflow: hidden;

    background: white;

    border-collapse: separate;
    border-spacing: 0;

    border: 1px solid var(--quiz-border);
    border-radius: 14px;
}

.quiz-data-table th,
.quiz-data-table td {
    padding: 13px 15px;

    border-right: 1px solid var(--quiz-border);
    border-bottom: 1px solid var(--quiz-border);

    text-align: center;
}

.quiz-data-table th:last-child,
.quiz-data-table td:last-child {
    border-right: none;
}

.quiz-data-table tbody tr:last-child td {
    border-bottom: none;
}

.quiz-data-table th {
    background: #edf6ef;
    color: #194f29;

    font-size: 14px;
    font-weight: 800;
}

.quiz-data-table td {
    color: #3d433f;

    font-size: 14px;
}

/* =======================================================
   ANSWER OPTIONS
======================================================= */

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 13px;

    margin: 26px 0 22px;
}

.quiz-option-btn {
    width: 100%;
    min-height: 66px;

    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 14px;

    padding: 11px 18px;

    background: white;
    color: var(--quiz-text);

    border: 2px solid var(--quiz-border);
    border-radius: 14px;

    font: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.45;

    text-align: left;

    cursor: pointer;

    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        background-color 0.18s ease,
        box-shadow 0.18s ease;
}

.quiz-option-btn:hover:not(:disabled) {
    transform: translateY(-2px);

    background: #f7fbf8;

    border-color: #97c6a3;

    box-shadow:
        0 7px 18px rgba(30, 126, 52, 0.08);
}

.quiz-option-letter {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    background: #edf2ee;
    color: #4b554e;

    border-radius: 10px;

    font-size: 14px;
    font-weight: 850;

    transition:
        background-color 0.18s ease,
        color 0.18s ease;
}

.quiz-option-btn.selected {
    background: var(--quiz-green-light);

    border-color: var(--quiz-green);

    box-shadow:
        0 0 0 3px rgba(30, 126, 52, 0.09);
}

.quiz-option-btn.selected .quiz-option-letter {
    background: var(--quiz-green);
    color: white;
}

.quiz-option-btn.correct {
    background: var(--quiz-correct-soft);
    color: #155c35;

    border-color: var(--quiz-correct);
}

.quiz-option-btn.correct .quiz-option-letter {
    background: var(--quiz-correct);
    color: white;
}

.quiz-option-btn.incorrect {
    background: var(--quiz-incorrect-soft);
    color: #8d2525;

    border-color: var(--quiz-incorrect);
}

.quiz-option-btn.incorrect .quiz-option-letter {
    background: var(--quiz-incorrect);
    color: white;
}

.quiz-option-btn:disabled {
    cursor: default;
}

/* =======================================================
   FEEDBACK
======================================================= */

.quiz-feedback {
    margin: 20px 0 4px;
    padding: 18px 20px;

    border-radius: 14px;

    text-align: left;
}

.quiz-feedback strong {
    display: block;

    margin-bottom: 6px;

    font-size: 16px;
}

.quiz-feedback p {
    margin: 0;

    font-size: 14px;
    line-height: 1.6;
}

.feedback-correct {
    background: var(--quiz-correct-soft);
    color: #155c35;

    border: 1px solid #a8dfbd;
}

.feedback-incorrect {
    background: var(--quiz-incorrect-soft);
    color: #8d2525;

    border: 1px solid #efb4b4;
}

/* =======================================================
   BUTTONS
======================================================= */

.quiz-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;

    margin-top: 26px;
    padding-top: 22px;

    border-top: 1px solid var(--quiz-border);
}

.continue-button,
.profile-link-btn {
    min-height: 48px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 12px 24px;

    border-radius: 11px;

    font: inherit;
    font-size: 15px;
    font-weight: 800;

    text-decoration: none;

    cursor: pointer;

    transition:
        transform 0.18s ease,
        background-color 0.18s ease,
        box-shadow 0.18s ease;
}

.continue-button {
    background: var(--quiz-green);
    color: white;

    border: 2px solid var(--quiz-green);
}

.continue-button:hover {
    background: var(--quiz-green-dark);

    transform: translateY(-2px);

    box-shadow:
        0 8px 18px rgba(30, 126, 52, 0.2);
}

.profile-link-btn {
    background: white;
    color: #555d58;

    border: 2px solid #cfd8d1;
}

.profile-link-btn:hover {
    background: #f3f6f4;
    color: #252925;

    transform: translateY(-2px);
}

/* =======================================================
   FLASH RESULT EFFECT
======================================================= */

.flash-correct {
    animation: correctFlash 0.65s ease;
}

.flash-incorrect {
    animation: incorrectFlash 0.65s ease;
}

@keyframes correctFlash {
    0% {
        background: transparent;
    }

    45% {
        background: var(--quiz-correct-soft);
    }

    100% {
        background: transparent;
    }
}

@keyframes incorrectFlash {
    0% {
        background: transparent;
    }

    45% {
        background: var(--quiz-incorrect-soft);
    }

    100% {
        background: transparent;
    }
}

/* =======================================================
   SUMMARY SCREEN
======================================================= */

.quiz-summary {
    max-width: 980px;

    margin: 40px auto;
    padding: 34px;

    background: white;

    border: 1px solid var(--quiz-border);
    border-radius: var(--quiz-radius-large);

    box-shadow: var(--quiz-shadow);

    text-align: center;
}

.summary-icon {
    width: 82px;
    height: 82px;

    display: grid;
    place-items: center;

    margin: 0 auto 18px;

    background: var(--quiz-green-light);

    border-radius: 50%;

    font-size: 39px;
}

.quiz-summary h2 {
    margin: 0 0 12px;

    color: var(--quiz-text);

    font-size: 32px;
}

.summary-score {
    margin: 18px 0;

    color: var(--quiz-green);

    font-size: 42px;
    font-weight: 850;
}

.summary-text {
    max-width: 650px;
    margin: 0 auto 22px;

    color: var(--quiz-muted);

    font-size: 16px;
    line-height: 1.6;
}

.missed-review {
    margin-top: 30px;

    text-align: left;
}

.missed-review h3 {
    margin-bottom: 16px;

    font-size: 22px;
}

.missed-card {
    margin: 15px 0;
    padding: 20px;

    background: #f7faf8;

    border: 1px solid var(--quiz-border);
    border-radius: 14px;
}

.missed-card p {
    margin: 8px 0;

    color: #4e5550;

    font-size: 14px;
    line-height: 1.55;
}

/* =======================================================
   RESPONSIVE QUIZ
======================================================= */

@media (max-width: 800px) {
    .quiz-page {
        padding: 16px;
    }

    .quiz-header {
        align-items: flex-start;
        flex-direction: column;

        padding: 26px;
    }

    .quiz-header-main {
        align-items: flex-start;
        flex-direction: column;
    }

    .quiz-header-icon {
        width: 70px;
        height: 70px;

        font-size: 32px;
    }

    .quiz-header-stat {
        width: 100%;
    }

    .quiz-question-card {
        padding: 23px;
    }
}

@media (max-width: 560px) {
    .quiz-page {
        padding: 10px;
    }

    .quiz-header {
        border-radius: 18px;
    }

    .quiz-progress-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 9px;
    }

    .quiz-question-card {
        padding: 18px;

        border-radius: 18px;
    }

    .quiz-image-wrap {
        padding: 8px;
    }

    .quiz-option-btn {
        grid-template-columns: 36px minmax(0, 1fr);

        padding: 10px 12px;

        font-size: 14px;
    }

    .quiz-option-letter {
        width: 34px;
        height: 34px;
    }

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

    .continue-button,
    .profile-link-btn {
        width: 100%;
    }

    .quiz-summary {
        margin: 15px auto;
        padding: 23px;
    }
}


/* =======================================================
   TABLE-STYLE ANSWER OPTIONS
======================================================= */

.quiz-choice-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.quiz-choice-table {
    min-width: 640px;

    display: flex;
    flex-direction: column;

    border: 1px solid #dfe6e1;
    border-radius: 14px;

    overflow: hidden;
}

.quiz-choice-table-header,
.quiz-table-option {
    display: grid;

    grid-template-columns:
        76px
        repeat(
            var(--choice-columns),
            minmax(0, 1fr)
        );

    align-items: stretch;
}

.quiz-choice-table-header {
    background: #f1f7f3;
    border-bottom: 1px solid #dce5df;

    color: #344039;

    font-size: 13px;
    font-weight: 800;
}

.quiz-choice-table-header span,
.quiz-table-option > span {
    padding: 13px 15px;

    display: flex;
    align-items: center;

    border-right: 1px solid #e0e6e2;
}

.quiz-choice-table-header span:last-child,
.quiz-table-option > span:last-child {
    border-right: none;
}

.choice-letter-heading {
    justify-content: center;
}

.quiz-table-option {
    width: 100%;
    padding: 0;

    background: white;
    border: none;
    border-bottom: 1px solid #e4e9e6;
    border-radius: 0;

    color: #263029;

    text-align: left;
}

.quiz-table-option:last-child {
    border-bottom: none;
}

.quiz-table-option:hover {
    background: #f3f9f5;
}

.quiz-table-option.selected {
    background: #edf8f0;

    box-shadow:
        inset 4px 0 0 #1e7e34;
}

.quiz-table-option.correct {
    background: #eaf8ed;

    box-shadow:
        inset 4px 0 0 #2b9a49;
}

.quiz-table-option.incorrect {
    background: #fff0f0;

    box-shadow:
        inset 4px 0 0 #c94a4a;
}

.quiz-option-letter {
    justify-content: center;

    color: #1e7e34;

    font-weight: 900;
}

.quiz-table-cell {
    line-height: 1.4;
}

@media (max-width: 700px) {

    .quiz-choice-table-wrap {
        margin-right: -4px;
        padding-bottom: 6px;
    }

}

.quiz-stimulus-text {
    margin: 0 0 12px;

    color: #657069;

    font-size: 14px;
    line-height: 1.5;
}

/* =======================================================
   IB-STYLE QUESTION PRESENTATION
======================================================= */

.quiz-question-wrap {
    width: 100%;
}


/* Stimulus introduction */

.quiz-stimulus-text {
    margin: 0 0 18px;

    color: #4f5953;

    font-size: 17px;
    font-weight: 400;
    line-height: 1.55;
}


/* Image now sits between the introduction and stem */

.quiz-image-wrap {
    width: 100%;
    margin: 0 0 28px;

    display: flex;
    justify-content: center;
}

.quiz-question-image {
    width: auto;
    max-width: min(100%, 760px);
    max-height: 520px;
    height: auto;

    display: block;
    object-fit: contain;

    background: white;
    border: 1px solid #dce3de;
    border-radius: 12px;
}


/* Main question stem */

.quiz-question-content {
    max-width: 1050px;
    margin: 0;
}

.quiz-question-text {
    margin: 0;

    color: #1c211e;

    font-size: 20px;
    font-weight: 400;
    line-height: 1.55;
}


/*
   Override the old large/bold quiz-question style
   in case the class is still used elsewhere.
*/

.quiz-question {
    color: #1c211e;

    font-size: 20px;
    font-weight: 400;
    line-height: 1.55;
}


/* Roman-numeral statements */

.quiz-roman-list {
    max-width: 1000px;
    margin: 22px 0 0;
}

.quiz-roman-statement {
    margin: 10px 0;

    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 10px;
    align-items: start;

    color: #1c211e;

    font-size: 19px;
    font-weight: 400;
    line-height: 1.55;
}

.quiz-roman-number {
    text-align: right;
    white-space: nowrap;
}

.quiz-roman-text {
    min-width: 0;
}

.quiz-question-extra {
    margin: 10px 0 10px 68px;

    color: #1c211e;

    font-size: 19px;
    font-weight: 400;
    line-height: 1.55;
}


/* Tables appearing as question stimuli */

.quiz-data-table-wrap {
    width: 100%;
    margin: 0 0 28px;
    overflow-x: auto;
}


/* Mobile adjustments */

@media (max-width: 700px) {

    .quiz-stimulus-text {
        margin-bottom: 15px;
        font-size: 15px;
    }

    .quiz-image-wrap {
        margin-bottom: 22px;
    }

    .quiz-question-text,
    .quiz-question {
        font-size: 17px;
        line-height: 1.55;
    }

    .quiz-roman-list {
        margin-top: 17px;
    }

    .quiz-roman-statement {
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 8px;

        font-size: 16px;
        line-height: 1.55;
    }

    .quiz-question-extra {
        margin-left: 50px;
        font-size: 16px;
    }

}

.quiz-question-card {
    padding: 34px 38px;
}

.quiz-question-wrap,
.quiz-options,
#quiz-feedback-area,
.quiz-actions {
    width: min(100%, 1120px);
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 700px) {

    .quiz-question-card {
        padding: 24px 18px;
    }

}

/* =======================================================
   IMAGE LIGHTBOX — TRUE FULL-SCREEN OVERLAY
======================================================= */

body.quiz-modal-open {
    overflow: hidden;
}

.quiz-image-modal {
    display: none;

    position: fixed;
    inset: 0;
    z-index: 99999;

    width: 100vw;
    height: 100vh;

    padding: 32px;

    align-items: center;
    justify-content: center;

    background: rgba(8, 15, 10, 0.92);

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.quiz-image-modal.show {
    display: flex;
}

.quiz-image-modal-content {
    width: auto;
    max-width: min(1100px, calc(100vw - 100px));

    height: auto;
    max-height: calc(100vh - 100px);

    margin: 0;
    padding: 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    background: #ffffff;
    border-radius: 18px;

    box-shadow:
        0 28px 80px rgba(0, 0, 0, 0.5);
}

.quiz-image-modal-content img {
    display: block;

    width: auto;
    max-width: 100%;

    height: auto;
    max-height: calc(100vh - 136px);

    object-fit: contain;
}

.quiz-image-modal-close {
    width: 48px;
    height: 48px;

    position: fixed;
    top: 22px;
    right: 28px;
    z-index: 100000;

    display: grid;
    place-items: center;

    padding: 0;

    background: #ffffff;
    border: none;
    border-radius: 50%;

    color: #172019;

    font-size: 32px;
    line-height: 1;

    cursor: pointer;

    box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.32);
}

.quiz-image-modal-close:hover {
    background: #edf8f0;
    color: #1e7e34;
}

/* =======================================================
   IB-STYLE ROMAN-NUMERAL QUESTIONS
======================================================= */

.roman-question-card
.quiz-question-layout {
    width: min(100%, 1080px);
    margin: 0 auto;

    display: block;
}

.roman-question-card
.quiz-question-wrap {
    width: 100%;
    max-width: 100%;
}

.roman-question-card
.quiz-question-content {
    max-width: 100%;
}

.roman-question-card
.quiz-question-text {
    margin-bottom: 25px;

    font-size: 21px;
    font-weight: 400;
    line-height: 1.5;
}

.roman-question-card
.quiz-roman-list {
    max-width: 100%;
    margin: 0 0 34px 54px;
}

.roman-question-card
.quiz-roman-statement {
    margin: 14px 0;

    grid-template-columns: 64px minmax(0, 1fr);
    gap: 18px;

    font-size: 19px;
    font-weight: 400;
    line-height: 1.5;
}

.roman-question-card
.quiz-roman-number {
    text-align: left;
}

.roman-question-card
.quiz-answer-panel {
    width: 100%;
    margin-top: 8px;
    padding: 0;

    position: static;

    background: transparent;
    border: none;
}

.roman-question-card
.quiz-options {
    width: min(100%, 850px);
    margin: 0;
    gap: 12px;
}

.roman-question-card
.quiz-option-btn {
    min-height: 58px;
}

.roman-question-card
.quiz-actions {
    width: 100%;
    margin-top: 28px;
}


/* Mobile */

@media (max-width: 700px) {

    .roman-question-card
    .quiz-question-text {
        font-size: 18px;
    }

    .roman-question-card
    .quiz-roman-list {
        margin-left: 10px;
    }

    .roman-question-card
    .quiz-roman-statement {
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 8px;

        font-size: 16px;
    }

}

/* =======================================================
   GENERATED SCORE CARD PREVIEW
======================================================= */

.quiz-score-card-section {
    width: 100%;
    max-width: 620px;

    margin: 30px auto 0;

    text-align: center;
}

.quiz-score-card-eyebrow {
    margin: 0 0 5px;

    color: #1e7e34;

    font-size: 12px;
    font-weight: 850;

    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.quiz-score-card-title {
    margin: 0 0 6px;

    color: #1c211e;

    font-size: 20px;
    font-weight: 850;
}

.quiz-score-card-description {
    margin: 0 0 18px;

    color: #68736c;

    font-size: 14px;
    line-height: 1.5;
}


/* -------------------------------------------------------
   SCORE CARD IMAGE
------------------------------------------------------- */

.quiz-score-card-preview {
    width: min(100%, 500px);

    margin: 0 auto;

    overflow: hidden;

    background: #f4f9f5;

    border: 1px solid #dce6df;
    border-radius: 18px;

    box-shadow:
        0 10px 28px rgba(30, 126, 52, 0.08);
}

.quiz-score-card-preview canvas,
.quiz-score-card-preview img {
    display: block;

    width: 100%;
    height: auto;

    margin: 0 auto;
}


/* -------------------------------------------------------
   SCORE CARD BUTTONS
------------------------------------------------------- */

.quiz-score-card-actions {
    margin-top: 15px;

    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;

    gap: 10px;
}

.score-card-action-button {
    min-height: 42px;

    padding: 9px 16px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: white;
    color: #1e7e34;

    border: 1px solid #1e7e34;
    border-radius: 9px;

    font: inherit;
    font-size: 13px;
    font-weight: 800;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.score-card-action-button:hover {
    background: #edf8f0;

    transform: translateY(-2px);

    box-shadow:
        0 6px 14px rgba(30, 126, 52, 0.1);
}


/* -------------------------------------------------------
   MOBILE
------------------------------------------------------- */

@media (max-width: 600px) {

    .quiz-score-card-section {
        margin-top: 24px;
    }

    .quiz-score-card-preview {
        width: min(100%, 420px);
    }

    .quiz-score-card-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .score-card-action-button {
        width: 100%;
    }

}


/* =======================================================
   SHARE SCORE
======================================================= */

.quiz-summary-actions {
    margin-top: 28px;

    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;

    gap: 12px;
}

.share-score-button {
    min-height: 50px;
    padding: 13px 24px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    background: white;
    border: 2px solid #1e7e34;
    border-radius: 11px;

    color: #1e7e34;

    font: inherit;
    font-size: 15px;
    font-weight: 800;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.share-score-button:hover {
    background: #edf8f0;
    transform: translateY(-2px);
}

.share-score-button span {
    font-size: 19px;
    line-height: 1;
}

.share-score-message {
    min-height: 22px;
    margin: 16px 0 0;

    color: #1e7e34;

    font-size: 14px;
    font-weight: 700;

    opacity: 0;

    transition: opacity 0.2s ease;
}

.share-score-message.show {
    opacity: 1;
}

@media (max-width: 600px) {

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

    .quiz-summary-actions > * {
        width: 100%;
        box-sizing: border-box;
    }

}

/* =======================================================
   CUSTOM SCORE SHARING MENU
======================================================= */

body.share-modal-open {
    overflow: hidden;
}

.score-share-modal {
    display: none;

    position: fixed;
    inset: 0;
    z-index: 100000;

    padding: 24px;

    align-items: center;
    justify-content: center;

    background: rgba(12, 22, 15, 0.72);
    backdrop-filter: blur(5px);
}

.score-share-modal.show {
    display: flex;
}

.score-share-dialog {
    width: min(620px, 100%);
    padding: 32px;

    position: relative;

    background: white;
    border: 1px solid #dce6df;
    border-radius: 22px;

    text-align: center;

    box-shadow:
        0 28px 80px rgba(0, 0, 0, 0.32);
}

.score-share-close {
    width: 40px;
    height: 40px;

    position: absolute;
    top: 14px;
    right: 14px;

    display: grid;
    place-items: center;

    padding: 0;

    background: #f0f5f1;
    border: none;
    border-radius: 50%;

    font-size: 25px;
    cursor: pointer;
}

.score-share-eyebrow {
    margin: 0 0 7px;

    color: #1e7e34;

    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.score-share-dialog h3 {
    margin: 0 0 12px;

    font-size: 28px;
}

.score-share-preview {
    margin: 0 0 24px;

    color: #5f6962;

    font-size: 15px;
    line-height: 1.55;
}

/* =======================================================
   SCORE-SHARING ICON GRID
======================================================= */

.score-share-grid {
    width: min(100%, 520px);
    margin: 28px auto 0;

    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 16px;
}

.social-share-button {
    min-width: 0;
    min-height: 132px;
    padding: 18px 12px 15px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;

    background: #ffffff;
    border: 1px solid #cfddd2;
    border-radius: 18px;

    color: #253129;

    font: inherit;
    cursor: pointer;

    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

.social-share-button:hover {
    background: #f5faf6;
    border-color: #1e7e34;

    transform: translateY(-4px);

    box-shadow:
        0 10px 22px rgba(30, 126, 52, 0.11);
}

.social-share-button:focus-visible {
    outline: 3px solid rgba(30, 126, 52, 0.25);
    outline-offset: 3px;
}

.social-share-icon-wrap {
    width: 58px;
    height: 58px;

    display: grid;
    place-items: center;

    background: #f2f7f3;
    border-radius: 16px;

    transition:
        transform 0.2s ease,
        background-color 0.2s ease;
}

.social-share-button:hover
.social-share-icon-wrap {
    background: #e8f5eb;
    transform: scale(1.05);
}

.social-share-icon {
    width: 34px;
    height: 34px;

    display: block;
    object-fit: contain;
}

.utility-icon-wrap {
    background: #edf3ef;
}

.utility-share-icon {
    width: 30px;
    height: 30px;
}

.social-share-label {
    color: #253129;

    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
}


/* Tablet */

@media (max-width: 650px) {

    .score-share-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 12px;
    }

    .social-share-button {
        min-height: 112px;
        padding: 14px 10px;
    }

    .social-share-icon-wrap {
        width: 52px;
        height: 52px;
    }

    .social-share-icon {
        width: 31px;
        height: 31px;
    }

}


/* Small phones */

@media (max-width: 380px) {

    .score-share-grid {
        gap: 9px;
    }

    .social-share-button {
        min-height: 102px;
    }

    .social-share-label {
        font-size: 13px;
    }

}

.score-share-preview strong {
    color: #1e7e34;
    font-size: 20px;
    font-weight: 900;
}

.score-share-preview span {
    display: inline-block;
    margin-top: 7px;

    color: #68736c;

    font-size: 14px;
}

/* =======================================================
   GENERATED SCORE CARD PREVIEW
======================================================= */

.quiz-score-card-section {
    width: 100%;
    max-width: 620px;

    margin: 32px auto 0;

    text-align: center;
}


.quiz-score-card-eyebrow {
    margin: 0 0 5px;

    color: #1e7e34;

    font-size: 12px;
    font-weight: 850;

    letter-spacing: 0.09em;
    text-transform: uppercase;
}


.quiz-score-card-title {
    margin: 0 0 5px;

    color: #1c211e;

    font-size: 21px;
    font-weight: 850;
}


.quiz-score-card-description {
    margin: 0 0 18px;

    color: #68736c;

    font-size: 14px;
    line-height: 1.5;
}


/* =======================================================
   SCORE CARD PREVIEW IMAGE
======================================================= */

.quiz-score-card-preview {
    width: min(100%, 500px);

    margin: 0 auto;

    overflow: hidden;

    background: #f4f9f5;

    border: 1px solid #dce6df;
    border-radius: 18px;

    box-shadow:
        0 10px 28px
        rgba(30, 126, 52, 0.08);
}


.quiz-score-card-preview canvas,
.quiz-score-card-preview img {
    display: block;

    width: 100% !important;
    max-width: 500px !important;

    height: auto !important;
    max-height: 500px;

    margin: 0 auto;

    object-fit: contain;
}


/* =======================================================
   SCORE CARD ACTION BUTTONS
======================================================= */

.quiz-score-card-actions {
    margin-top: 16px;

    display: flex;

    align-items: center;
    justify-content: center;

    flex-wrap: wrap;

    gap: 10px;
}


.score-card-action-button {
    min-height: 44px;

    padding: 10px 18px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 7px;

    background: white;

    color: #1e7e34;

    border: 2px solid #1e7e34;
    border-radius: 10px;

    font: inherit;

    font-size: 14px;
    font-weight: 800;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}


.score-card-action-button:hover {
    background: #edf8f0;

    transform: translateY(-2px);

    box-shadow:
        0 7px 17px
        rgba(30, 126, 52, 0.12);
}


/* =======================================================
   SCORE CARD MOBILE
======================================================= */

@media (max-width: 600px) {

    .quiz-score-card-section {
        max-width: 100%;
        margin-top: 24px;
    }


    .quiz-score-card-preview {
        width: min(100%, 390px);
    }


    .quiz-score-card-preview canvas,
    .quiz-score-card-preview img {
        max-width: 390px !important;
        max-height: 390px;
    }


    .quiz-score-card-actions {
        align-items: stretch;
        flex-direction: column;
    }


    .score-card-action-button {
        width: 100%;
    }

}
/* =======================================================
   IMAGE ANSWER CHOICES
======================================================= */

.quiz-image-choice-grid {

    display:
        grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap:
        18px;

    width:
        100%;

}


/* =======================================================
   INDIVIDUAL IMAGE CHOICE
======================================================= */

.quiz-image-option {

    position:
        relative;

    width:
        100%;

    height:
        285px;

    min-height:
        285px;

    max-height:
        285px;

    padding:
        14px;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    border:
        1px solid #d8e2dc;

    border-radius:
        14px;

    background:
        #ffffff;

    cursor:
        pointer;

    overflow:
        hidden;

    box-sizing:
        border-box;

    transition:
        border-color .18s ease,
        box-shadow .18s ease,
        transform .18s ease;

}


.quiz-image-option:hover {

    border-color:
        #8fbea0;

    box-shadow:
        0 8px 20px rgba(30, 126, 52, .08);

    transform:
        translateY(-2px);

}


/* =======================================================
   A / B / C / D LETTER
======================================================= */

.quiz-image-option .quiz-option-letter {

    position:
        absolute;

    top:
        12px;

    left:
        12px;

    z-index:
        2;

    width:
        34px;

    height:
        34px;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    border:
        1px solid #d7e1db;

    border-radius:
        9px;

    background:
        #f4f8f5;

    color:
        #26342c;

    font-size:
        13px;

    font-weight:
        850;

}


/* =======================================================
   DIAGRAM AREA
======================================================= */

.quiz-image-choice-frame {

    width:
        100%;

    height:
        100%;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    border:
        none;

    background:
        transparent;

    overflow:
        visible;

}


/* =======================================================
   ACTUAL SVG
======================================================= */

.quiz-image-choice-frame img {

    display:
        block;

    width:
        92%;

    height:
        92%;

    max-width:
        none;

    max-height:
        none;

    object-fit:
        contain;

}


/* =======================================================
   SELECTED
======================================================= */

.quiz-image-option.selected {

    border-color:
        #1e7e34;

    box-shadow:
        0 0 0 3px rgba(30, 126, 52, .10);

}


/* =======================================================
   CORRECT / INCORRECT
======================================================= */

.quiz-image-option.correct {

    border-color:
        #1e7e34;

    background:
        #f2faf4;

}


.quiz-image-option.incorrect {

    border-color:
        #d59b97;

    background:
        #fff6f5;

}


/* =======================================================
   MOBILE
======================================================= */

@media (max-width: 700px) {

    .quiz-image-choice-grid {

        grid-template-columns:
            1fr;

    }


    .quiz-image-option {

        height:
            250px;

        min-height:
            250px;

        max-height:
            250px;

    }

}

/* =======================================================
   QUIZ MOBILE POLISH
   Compact hero + stronger stimulus text
======================================================= */

@media (max-width: 560px) {

    /* ---------------------------------------------------
       COMPACT GREEN QUIZ HEADER
    --------------------------------------------------- */

    .quiz-header {
        min-height: 0;

        margin-bottom: 16px;
        padding: 18px;

        gap: 14px;

        border-radius: 18px;
    }


    /* Put icon beside the title instead of above it */

    .quiz-header-main {
        width: 100%;

        flex-direction: row;
        align-items: center;

        gap: 14px;
    }


    .quiz-header-icon {
        width: 56px;
        height: 56px;

        flex: 0 0 56px;

        border-width: 3px;

        font-size: 25px;

        box-shadow:
            0 6px 18px rgba(0, 0, 0, 0.13);
    }


    .quiz-header-copy {
        flex: 1;
        min-width: 0;
    }


    .quiz-eyebrow {
        margin-bottom: 4px;

        font-size: 10px;
        letter-spacing: 0.1em;
    }


    .quiz-header h1 {
        margin-bottom: 5px;

        font-size: 27px;
        line-height: 1.08;
    }


    .quiz-meta {
        font-size: 13px;
        line-height: 1.4;
    }


    /* Turn the large 1/5 box into a compact strip */

    .quiz-header-stat {
        width: 100%;
        min-width: 0;

        padding: 10px 14px;

        display: flex;
        align-items: center;
        justify-content: center;

        gap: 8px;

        border-radius: 13px;
    }


    .quiz-header-stat strong {
        font-size: 23px;
    }


    .quiz-header-stat span {
        margin-top: 0;

        font-size: 12px;
    }


    /* Reduce oversized background emoji */

    .quiz-header::after {
        right: 8%;
        bottom: -50px;

        font-size: 125px;
    }


    /* ---------------------------------------------------
       PROGRESS PANEL
    --------------------------------------------------- */

    .quiz-progress-panel {
        margin-bottom: 16px;
        padding: 15px 18px;
    }


    /* ---------------------------------------------------
       QUESTION/STIMULUS INTRODUCTION
    --------------------------------------------------- */

    .quiz-stimulus-text {
        margin-bottom: 17px;

        color: #3f4943;

        font-size: 18px;
        font-weight: 500;
        line-height: 1.55;
    }


    /* ---------------------------------------------------
       QUESTION IMAGE
    --------------------------------------------------- */

    .quiz-image-wrap {
        margin-bottom: 24px;
        padding: 10px 10px 14px;

        flex-direction: column;
        align-items: center;

        gap: 10px;
    }


    .quiz-question-image {
        width: auto;
        max-width: 100%;
        height: auto;

        margin: 0 auto;
    }


    /* Main actual question remains visually strongest */

    .quiz-question-text,
    .quiz-question {
        font-size: 18px;
        line-height: 1.55;
    }

}