/* Full-format HSK practice exam — /hsk/practice-test/{1..4} (growth plan D33).
   Colour comes from Bootstrap variables so the page follows [data-bs-theme="dark"] without a
   second palette; nothing here hard-codes a hex that only works in one theme. */

.ex-timer {
    font-variant-numeric: tabular-nums;
    font-size: 1.15rem;
}

.ex-timer-low {
    color: var(--bs-danger);
}

.ex-item {
    min-height: 16rem;
}

.ex-prompt {
    font-weight: 600;
    margin-bottom: 1rem;
}

/* ── Stems ─────────────────────────────────────────────────────────────────── */

.ex-stem {
    text-align: center;
    margin-bottom: 1.25rem;
}

/* A single word is the object of the question, so it gets display size. A sentence is read
   rather than recognised, and at 4rem a ten-character sentence wraps into a wall. */
.ex-stem-word {
    font-size: clamp(2.75rem, 14vw, 4.5rem);
    line-height: 1.2;
    margin: 0;
}

.ex-stem-sentence {
    font-size: clamp(1.35rem, 5.5vw, 1.9rem);
    line-height: 1.7;
    margin: 0;
}

.ex-stem-pinyin {
    color: var(--bs-primary);
    margin: 0.35rem 0 0;
}

.ex-stem-english {
    text-align: center;
    font-size: 1.05rem;
    margin-bottom: 1.25rem;
}

/* ── Passages ──────────────────────────────────────────────────────────────── */

.ex-passage {
    background-color: var(--bs-secondary-bg);
    border-radius: 0.5rem;
    padding: 1rem 1.15rem;
    margin-bottom: 1.25rem;
}

.ex-passage-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bs-secondary-color);
    margin-bottom: 0.5rem;
}

.ex-passage-body {
    font-size: 1.15rem;
    line-height: 2;
    margin: 0;
}

/* ── Audio ─────────────────────────────────────────────────────────────────── */

.ex-audio {
    text-align: center;
    margin-bottom: 1.5rem;
}

.ex-audio-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--bs-secondary-color);
    margin-top: 0.5rem;
}

/* ── Options ───────────────────────────────────────────────────────────────── */

.ex-options {
    display: grid;
    gap: 0.6rem;
}

.ex-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    text-align: left;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    background-color: transparent;
    color: inherit;
    transition: border-color 0.15s, background-color 0.15s;
}

.ex-option:hover {
    border-color: var(--bs-primary);
}

.ex-option-picked {
    border-color: var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), 0.1);
}

.ex-option-letter {
    flex: 0 0 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background-color: var(--bs-secondary-bg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
}

.ex-option-picked .ex-option-letter {
    background-color: var(--bs-primary);
    color: #fff;
}

.ex-option-text {
    flex: 1 1 auto;
}

.ex-option-sub {
    display: block;
    font-size: 0.8rem;
    color: var(--bs-primary);
}

/* ── Word-order tiles ──────────────────────────────────────────────────────── */

.ex-tile-strip {
    min-height: 4.25rem;
    border: 2px dashed var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    margin-bottom: 1rem;
}

.ex-tile-strip-empty {
    justify-content: center;
    color: var(--bs-secondary-color);
    font-size: 0.9rem;
}

.ex-tile-bank {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
}

.ex-tile {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.4rem;
    background-color: var(--bs-body-bg);
    color: inherit;
    padding: 0.35rem 0.7rem;
    line-height: 1.3;
}

.ex-tile:hover {
    border-color: var(--bs-primary);
}

.ex-tile-hanzi {
    display: block;
    font-size: 1.3rem;
}

.ex-tile-pinyin {
    display: block;
    font-size: 0.72rem;
    color: var(--bs-primary);
}

/* ── Palette ───────────────────────────────────────────────────────────────── */

.ex-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.ex-pip {
    width: 2rem;
    height: 2rem;
    border-radius: 0.3rem;
    border: 1px solid var(--bs-border-color);
    background-color: transparent;
    color: var(--bs-secondary-color);
    font-size: 0.75rem;
    padding: 0;
}

.ex-pip-done {
    background-color: rgba(var(--bs-primary-rgb), 0.15);
    border-color: var(--bs-primary);
    color: var(--bs-primary);
    font-weight: 600;
}

.ex-pip-current {
    outline: 2px solid var(--bs-primary);
    outline-offset: 1px;
}

/* ── Result ────────────────────────────────────────────────────────────────── */

.ex-score {
    font-size: clamp(3rem, 14vw, 5rem);
    font-weight: 700;
    line-height: 1;
}

.ex-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: 0.75rem;
}

.ex-section-score {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.ex-section-name {
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
}

.ex-section-marks {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
}

.ex-section-detail {
    font-size: 0.78rem;
    color: var(--bs-secondary-color);
}

/* ── Review ────────────────────────────────────────────────────────────────── */

.ex-review-row {
    border-left: 3px solid var(--bs-border-color);
    padding: 0.6rem 0 0.6rem 0.85rem;
    margin-bottom: 0.75rem;
}

.ex-review-right {
    border-left-color: var(--bs-success);
}

.ex-review-wrong {
    border-left-color: var(--bs-danger);
}

.ex-review-head {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
    font-size: 0.9rem;
}

.ex-review-num {
    font-weight: 700;
    min-width: 1.75rem;
}

.ex-review-right .ex-review-mark {
    color: var(--bs-success);
}

.ex-review-wrong .ex-review-mark {
    color: var(--bs-danger);
}

.ex-review-prompt {
    color: var(--bs-secondary-color);
}

.ex-review-detail {
    margin: 0;
    font-size: 0.92rem;
}

.ex-review-note {
    margin: 0.15rem 0 0;
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
}

/* ── Missed words ──────────────────────────────────────────────────────────── */

.ex-missed-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--bs-border-color);
    flex-wrap: wrap;
}

.ex-missed-word {
    font-size: 1.35rem;
    font-weight: 500;
    min-width: 4.5rem;
}

.ex-missed-gloss {
    flex: 1 1 12rem;
    font-size: 0.9rem;
}

@media (max-width: 575.98px) {
    .ex-pip {
        width: 1.75rem;
        height: 1.75rem;
    }

    .ex-item {
        min-height: 14rem;
    }
}
