.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
    z-index: 200;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background: var(--panel-bg);
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 86vh;
    overflow-y: auto;
    padding: 26px 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.modal-box h3 {
    font-size: 1.3rem;
    margin-bottom: 16px;
}

.modal-summary {
    display: flex;
    gap: 10px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.modal-summary .stat {
    flex: 1;
    min-width: 100px;
    border-radius: 10px;
    padding: 14px 10px;
    text-align: center;
    border: 1px solid var(--card-border);
}

.modal-summary .stat .n {
    font-family: 'Lalezar', sans-serif;
    font-size: 1.8rem;
    display: block;
}

.modal-summary .stat.correct .n {
    color: var(--green);
}

.modal-summary .stat.wrong .n {
    color: var(--red);
}

.modal-summary .stat.skipped .n {
    color: var(--ink-faint);
}

.modal-summary .stat span:last-child {
    font-size: 0.78rem;
    color: var(--ink-soft);
}

.modal-section {
    margin-bottom: 18px;
}

.modal-section h4 {
    font-size: 0.92rem;
    margin-bottom: 10px;
}

.review-item {
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.review-item .q {
    font-weight: 700;
    margin-bottom: 6px;
}

.review-item .a-wrong {
    color: var(--red);
}

.review-item .a-correct {
    color: var(--green);
}

.review-item .a-skipped {
    color: var(--ink-faint);
}

.modal-close {
    margin-top: 6px;
    width: 100%;
    text-align: center;
    justify-content: center;
}
