/* =======================================================
   BIOLOGY BRAIN
   CONTEXT VOCABULARY CHALLENGE
======================================================= */

:root {
    --brand: #1e7e34;
    --brand-dark: #17672a;
    --brand-light: #edf8f0;

    --text-main: #172019;
    --text-muted: #626d65;

    --background: #f3f7f4;
    --surface: #ffffff;

    --border: #dce5de;

    --correct: #238b45;
    --correct-bg: #eaf8ee;

    --incorrect: #c74444;
    --incorrect-bg: #fff0f0;

    --warning: #b57b12;
    --warning-bg: #fff8e5;

    --radius-large: 24px;
    --radius-medium: 16px;
    --radius-small: 10px;

    --shadow:
        0 16px 38px rgba(29, 72, 40, 0.09);
}


/* =======================================================
   RESET
======================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;

    background:
        linear-gradient(
            180deg,
            #f8faf8 0%,
            var(--background) 100%
        );

    color: var(--text-main);

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


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

.passage-page {
    width: min(1200px, calc(100% - 36px));
    margin: 0 auto;
    padding: 34px 0 70px;
}

.passage-shell {
    width: 100%;
}


/* =======================================================
   HEADER
======================================================= */

.passage-header {
    padding: 28px 32px;

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

    background:
        linear-gradient(
            120deg,
            #176d2c 0%,
            #20943e 58%,
            #55bd76 100%
        );

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

    color: white;

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

.passage-header-main {
    display: flex;
    align-items: center;
    gap: 18px;
}

.passage-header-icon {
    width: 64px;
    height: 64px;
    flex-shrink: 0;

    display: grid;
    place-items: center;

    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 16px;

    font-size: 30px;
}

.passage-eyebrow {
    margin: 0 0 4px;

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

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

.passage-header h1 {
    margin: 0;

    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.05;
}

.passage-subtitle {
    margin: 9px 0 0;

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

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

.passage-back-link {
    min-height: 44px;
    padding: 10px 18px;

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

    flex-shrink: 0;

    background: white;
    border-radius: 10px;

    color: var(--brand);

    font-size: 13px;
    font-weight: 850;
    text-decoration: none;
}


/* =======================================================
   COMMON
======================================================= */

.section-label {
    margin: 0 0 8px;

    color: var(--brand);

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


/* =======================================================
   MODE SCREEN
======================================================= */

.mode-screen {
    padding: 70px 0 20px;
}

.mode-heading {
    max-width: 720px;
    margin: 0 auto 38px;

    text-align: center;
}

.mode-heading h2 {
    margin: 0 0 12px;

    font-size: clamp(30px, 4vw, 44px);
    line-height: 1.12;
}

.mode-heading > p:last-child {
    margin: 0;

    color: var(--text-muted);

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

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

    gap: 22px;
}

.mode-card {
    padding: 30px;

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

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

.mode-icon {
    width: 54px;
    height: 54px;

    display: grid;
    place-items: center;

    background: var(--brand-light);
    border-radius: 14px;

    font-size: 25px;
}

.mode-card h3 {
    margin: 19px 0 10px;

    font-size: 25px;
}

.mode-card > p {
    margin: 0;

    color: var(--text-muted);

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

.mode-card ul {
    margin: 20px 0 26px;
    padding-left: 20px;

    color: #445047;

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

.mode-button {
    width: 100%;
    min-height: 50px;

    border-radius: 11px;

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

    cursor: pointer;
}

.mode-button.primary {
    background: var(--brand);
    border: 2px solid var(--brand);

    color: white;
}

.mode-button.secondary {
    background: white;
    border: 2px solid var(--brand);

    color: var(--brand);
}


/* =======================================================
   ACTIVITY
======================================================= */

.activity-screen {
    padding-top: 42px;
}

.activity-topbar {
    margin-bottom: 18px;

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

.activity-topbar h2 {
    margin: 0;

    font-size: 29px;
}

.mode-badge {
    padding: 9px 15px;

    background: var(--brand-light);
    border: 1px solid #cfe4d4;
    border-radius: 999px;

    color: var(--brand);

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

    cursor: pointer;

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

.mode-badge:hover {
    background: #dff2e4;
    transform: translateY(-1px);

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

.passage-card {
    padding: 40px 44px;

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

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

.passage-content {
    color: #263029;

    font-size: 19px;
    line-height: 2.05;
}

.passage-paragraph {
    margin: 0 0 24px;
}

.passage-paragraph:last-child {
    margin-bottom: 0;
}


/* =======================================================
   INLINE EASY SELECT
======================================================= */

.inline-select {
    min-width: 145px;
    max-width: 220px;

    margin: 0 4px;
    padding: 7px 30px 7px 10px;

    vertical-align: baseline;

    background: #f6faf7;
    border: 2px solid #b9d5c0;
    border-radius: 8px;

    color: #1c2a20;

    font: inherit;
    font-size: 16px;
    font-weight: 700;

    cursor: pointer;
}

.inline-select:focus {
    outline: none;

    border-color: var(--brand);

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


/* =======================================================
   INLINE HARD INPUT
======================================================= */

.inline-input {
    width: 150px;

    margin: 0 4px;
    padding: 7px 10px;

    vertical-align: baseline;

    background: #f6faf7;
    border: 2px solid #b9d5c0;
    border-radius: 8px;

    color: #1c2a20;

    font: inherit;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
}

.inline-input:focus {
    outline: none;

    border-color: var(--brand);

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


/* =======================================================
   ANSWER STATES
======================================================= */

.blank-correct {
    background: var(--correct-bg) !important;
    border-color: var(--correct) !important;

    color: var(--correct) !important;
}

.blank-incorrect {
    background: var(--incorrect-bg) !important;
    border-color: var(--incorrect) !important;

    color: var(--incorrect) !important;
}

.blank-empty {
    background: var(--warning-bg) !important;
    border-color: #d6aa48 !important;
}


/* =======================================================
   ACTIVITY MESSAGE
======================================================= */

.activity-message {
    min-height: 24px;
    margin-top: 16px;

    color: var(--incorrect);

    font-size: 14px;
    font-weight: 700;
    text-align: center;
}


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

.activity-actions,
.results-actions {
    margin-top: 22px;

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

.primary-action,
.secondary-action,
.listen-button {
    min-height: 50px;
    padding: 12px 22px;

    border-radius: 11px;

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

    cursor: pointer;

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

.primary-action {
    background: var(--brand);
    border: 2px solid var(--brand);

    color: white;
}

.secondary-action {
    background: white;
    border: 2px solid var(--brand);

    color: var(--brand);
}

.primary-action:hover,
.secondary-action:hover,
.listen-button:hover {
    transform: translateY(-2px);
}


/* =======================================================
   RESULTS
======================================================= */

.results-screen {
    padding-top: 42px;
}

.results-card {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px;

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

    box-shadow: var(--shadow);

    text-align: center;
}

.results-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 14px;

    display: grid;
    place-items: center;

    background: var(--brand-light);
    border-radius: 18px;

    font-size: 31px;
}

.results-card h2 {
    margin: 0;

    font-size: 34px;
}

.results-score {
    margin: 17px 0 10px;

    color: var(--brand);

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

.results-message {
    margin: 0;

    color: var(--text-muted);

    font-size: 15px;
}


/* =======================================================
   RESULTS REVIEW
======================================================= */

.results-review {
    margin-top: 28px;

    display: flex;
    flex-direction: column;
    gap: 10px;

    text-align: left;
}

.review-row {
    padding: 13px 16px;

    display: grid;
    grid-template-columns:
        38px
        minmax(0, 1fr)
        auto;

    gap: 12px;
    align-items: center;

    border-radius: 11px;
}

.review-row.correct {
    background: var(--correct-bg);
}

.review-row.incorrect {
    background: var(--incorrect-bg);
}

.review-number {
    font-weight: 900;
}

.review-answer {
    font-size: 14px;
    line-height: 1.5;
}

.review-answer strong {
    display: block;
}

.review-status {
    font-size: 18px;
    font-weight: 900;
}


/* =======================================================
   AUDIO UNLOCK
======================================================= */

.audio-unlock {
    margin-top: 28px;
    padding: 20px;

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

    gap: 15px;
    align-items: center;

    background:
        linear-gradient(
            120deg,
            #edf8f0,
            #f8fdf9
        );

    border: 1px solid #c9dfce;
    border-radius: 15px;

    text-align: left;
}

.audio-icon {
    width: 48px;
    height: 48px;

    display: grid;
    place-items: center;

    background: white;
    border-radius: 12px;

    font-size: 23px;
}

.audio-unlock h3 {
    margin: 0 0 4px;

    font-size: 16px;
}

.audio-unlock p {
    margin: 0;

    color: var(--text-muted);

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

.listen-button {
    background: var(--brand);
    border: 2px solid var(--brand);

    color: white;
}


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

@media (max-width: 800px) {

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

    .passage-back-link {
        width: 100%;
    }

    .mode-grid {
        grid-template-columns: 1fr;
    }

    .audio-unlock {
        grid-template-columns: 1fr;

        text-align: center;
    }

    .audio-icon {
        margin: 0 auto;
    }

}


@media (max-width: 600px) {

    .passage-page {
        width: calc(100% - 20px);
        padding-top: 10px;
    }

    .passage-header {
        padding: 22px 20px;
    }

    .passage-header-main {
        align-items: flex-start;
    }

    .passage-header-icon {
        width: 52px;
        height: 52px;

        font-size: 24px;
    }

    .passage-header h1 {
        font-size: 30px;
    }

    .mode-screen {
        padding-top: 48px;
    }

    .mode-card {
        padding: 23px 20px;
    }

    .activity-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .passage-card {
        padding: 25px 20px;
    }

    .passage-content {
        font-size: 17px;
        line-height: 2.1;
    }

    .inline-select {
        min-width: 125px;
        max-width: 175px;

        font-size: 15px;
    }

    .inline-input {
        width: 125px;

        font-size: 15px;
    }

    .activity-actions,
    .results-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .activity-actions > *,
    .results-actions > * {
        width: 100%;
    }

    .results-card {
        padding: 28px 20px;
    }

    .review-row {
        grid-template-columns:
            30px
            minmax(0, 1fr);

        align-items: start;
    }

    .review-status {
        grid-column: 2;
    }

}

.activity-actions-submit-only {
    justify-content: flex-end;
}

@media (max-width: 600px) {

    .mode-badge {
        align-self: flex-start;
    }

    .activity-actions-submit-only {
        align-items: stretch;
    }

    .activity-actions-submit-only
    .primary-action {
        width: 100%;
    }
}

/* =======================================================
   PASSAGE SECTIONS
======================================================= */

.passage-sections {
    display: flex;
    flex-direction: column;
    gap: 34px;
}

.passage-content-section {
    padding-bottom: 30px;
    border-bottom: 1px solid #e7ece9;
}

.passage-content-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.passage-section-header {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-bottom: 16px;
}

.passage-section-header h3 {
    margin: 0;

    font-size: 18px;
    font-weight: 800;
    line-height: 1.3;

    color: var(--text-main);
}

.passage-section-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.passage-paragraph {
    margin: 0;

    font-size: 17px;
    line-height: 2;

    color: var(--text-main);
}


/* =======================================================
   HL SECTION
======================================================= */

.hl-passage-section {
    padding: 24px;

    background: #f7fbf8;
    border: 1px solid #d8eadc;
    border-radius: 14px;
}

.hl-section-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 32px;
    height: 25px;

    padding: 0 8px;

    background: var(--brand);
    color: white;

    border-radius: 999px;

    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.05em;
}


/* =======================================================
   MISSING DATA DEBUGGING
======================================================= */

.missing-blank {
    color: #b42318;
    font-weight: 700;
}
/* Keep the perfect-score reward hidden until it is earned. */
.audio-unlock[hidden] { display: none; }
