:root {
    --bleu: #1a4d99;
    --bleu-clair: #2c76dd;
    --bleu-fonce: #0b2855;
    --bleu-peu-fonce: #0f3875;
    --bleu-background: #d7e6fc;
    --rouge: rgb(235, 16, 0);
    --vert-true: #058f71;
    --rouge-false: #a72e25;
}

#lives {
    margin: 0;
    color: var(--bleu-fonce);
    font-family: "IBM Plex Sans", Arial, sans-serif;
    font-size: 15px;
    font-weight: 600;
    transition: color 0.2s ease;
}

.lives-damage {
    color: var(--rouge);
}

.statement-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-sizing: border-box;
    width: min(950px, calc(100vw - 32px));
    margin-top: 16px;
}

.statement-head .daily-category {
    margin: 0;
}

.quiz-selected-category {
    box-sizing: border-box;
    width: min(950px, calc(100vw - 32px));
    margin: 22px 0 0;
    font-family: "IBM Plex Sans", Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
}

.score-bar {
    box-sizing: border-box;
    width: min(950px, calc(100vw - 32px));
    margin-top: 28px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 16px;
    color: var(--bleu-fonce);
    font-family: "IBM Plex Sans", Arial, sans-serif;
    font-weight: 700;
}

.score-bar p {
    width: 260px;
    margin: 0;
    font-size: 15px;
}

#highestScore {
    display: flex;
    justify-content: flex-end;
}

.game-display {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.quiz-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    filter: blur(10px);
    opacity: 0.45;
    pointer-events: none;
    user-select: none;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

.quiz-content.quiz-started {
    filter: none;
    opacity: 1;
    pointer-events: auto;
    user-select: auto;
}

.correct-spree {
    text-align: center;
}

.daily-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-sizing: border-box;
    width: min(950px, calc(100vw - 32px));
    margin-top: 24px;
}

/* "3 / 10" pill, same shape as .daily-category but filled blue */
#dailyProgress {
    margin: 0;
    padding: 5px 14px;
    border-radius: 999px;
    background: var(--bleu);
    color: white;
    font-family: "IBM Plex Sans", Arial, sans-serif;
    font-size: 15px;
    font-weight: 700;
}



.daily-category {
    margin: 0 0 8px;
    padding: 5px 14px;
    border-radius: 999px;
    background: white;
    color: var(--bleu);
    font-family: "IBM Plex Sans", Arial, sans-serif;
    font-size: 15px;
    font-weight: 700;
}

.daily-meta .daily-category {
    margin: 0;
}

.statement {
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    margin-top: 10px;
    width: min(950px, calc(100vw - 32px));
    min-height: 85px;
    padding: 14px 18px;
    border: 1px black solid;
    border-radius: 10px;
    color: rgb(0, 0, 0);
    background-color: white;
    font-size: 20px;
    font-weight: 500;
    font-family: "IBM Plex Sans", 'Segoe UI', Tahoma, sans-serif;
    text-align: center;
}

.answer-display {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    font-size: 20px;
}

/* Explanation panel: tinted, left-aligned, with a green / red border for the result
   (like the daily review cards), so it never looks like the white statement box */
.detail-display {
    --result: var(--vert-true);
    box-sizing: border-box;
    width: min(760px, calc(100vw - 32px));
    margin: 18px 0 30px;
    border: 3px solid var(--result);
    border-radius: 10px;
    background: rgb(255 255 255 / 55%);
    font-family: "IBM Plex Sans", Arial, sans-serif;
}

.detail-display.is-wrong {
    --result: var(--rouge-false);
}

/* Nothing to explain yet (before answering, after quitting...) */
.detail-display:has(#detail:empty) {
    display: none;
}

.detail-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 16px;
    border: none;
    border-radius: 7px;
    background: none;
    color: var(--bleu-fonce);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.detail-toggle:hover {
    background: rgb(from var(--bleu-clair) r g b / 8%);
}

.detail-toggle .fa-lightbulb {
    margin-right: 6px;
    color: #c8960c;
}

.detail-toggle-label {
    color: var(--bleu);
    font-size: 13px;
}

#detail {
    margin: 0;
    padding: 0 16px 14px;
    color: #333;
    font-size: 16px;
    line-height: 1.6;
    text-align: left;
}

.detail-display.is-collapsed #detail {
    display: none;
}

/* ---------- End-of-daily review cards ---------- */
.daily-review {
    list-style: none;
    box-sizing: border-box;
    width: min(700px, calc(100vw - 32px));
    margin: 30px auto;
    padding: 0;
    font-family: "IBM Plex Sans", Arial, sans-serif;
}

.daily-review li {
    --result: var(--vert-true);
    margin-bottom: 32px;
    padding: 16px 20px;
    border: 3px solid var(--result);
    border-radius: 10px;
    background: white;
    box-shadow: 0 2px 8px rgba(11, 40, 85, 0.08);
}

.daily-review .review-wrong {
    --result: var(--rouge-false);
}

.review-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.review-number {
    color: rgb(from var(--bleu-fonce) r g b / 55%);
    font-size: 13px;
    font-weight: 700;
}

.review-category {
    padding: 2px 10px;
    border-radius: 999px;
    background: rgb(from var(--bleu-clair) r g b / 12%);
    color: var(--bleu);
    font-size: 12px;
    font-weight: 700;
}

.review-result {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    color: var(--result);
    font-size: 13px;
    font-weight: 700;
}

.review-question {
    margin: 0 0 10px;
    color: var(--bleu-fonce);
    font-size: 17px;
    font-weight: 600;
}

.review-answers {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 20px;
    margin: 0 0 10px;
    color: #555;
    font-size: 14px;
}

.review-answers .answer-true {
    color: var(--vert-true);
}

.review-answers .answer-false {
    color: var(--rouge-false);
}

.review-details {
    margin: 0;
    padding-top: 10px;
    border-top: 1px solid #e6ecf5;
    color: #555;
    font-size: 14px;
    line-height: 1.5;
}

.guess-bar-label {
    margin: 12px 0 4px;
    font-size: 12px;
    color: #888;
}

.guess-bar {
    display: flex;
    height: 20px;
    max-width: 320px;
    margin: 0 0 8px;
    border-radius: 4px;
    overflow: hidden;
    font-size: 0.75em;
    color: #fff;
}

.guess-bar-true,
.guess-bar-false {
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.guess-bar-true  { background: var(--vert-true); }  /* or your neutral picks */
.guess-bar-false { background: var(--rouge-false); }

#dailySummary.hidden,
#summaryHistory.hidden,
#guestPrompt.hidden,
#displayStatement.hidden,
#dailyButtons.hidden {
    display: none;
}

#dailySummary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    width: 550px;
    max-width: 100%;
    margin-top: 20px;
}

.summary-badge {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgb(99, 166, 255), var(--bleu));
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

#scoreValue {
    font-size: 2em;
    font-weight: bold;
    line-height: 1;
}

.badge-label {
    font-size: 0.65em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.summary-divider {
    align-self: stretch;
    width: 2px;
    flex-shrink: 0;
    background: rgb(from var(--bleu) r g b / 20%);
}

.summary-history {
    flex: 0 1 300px;
}

.guest-prompt {
    flex: 0 1 300px;
    margin: 0;
    color: var(--bleu);
    font-size: 1.1em;
    line-height: 1.4;
}

.guest-prompt a {
    color: var(--bleu);
    font-weight: bold;
}

.history-average {
    margin: 0 0 8px;
    color: var(--bleu);
    font-size: 1.25em;
    font-weight: bold;
}

.history-distribution {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.distribution-row {
    display: grid;
    grid-template-columns: 16px 1fr;
    align-items: center;
    gap: 6px;
}

.distribution-score {
    color: var(--bleu);
    font-weight: bold;
    text-align: right;
}

.distribution-bar {
    box-sizing: border-box;
    height: 14px;
    padding: 0 4px;
    background: var(--bleu-clair);
    color: #fff;
    font-size: 0.7em;
    font-weight: bold;
    line-height: 14px;
    text-align: right;
}

.distribution-row.is-today .distribution-bar {
    background: var(--bleu);
}

/* ---------- Daily leaderboard sidebar ---------- */
.leaderboard-backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(11, 40, 85, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.leaderboard-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.leaderboard {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: min(400px, 100%);
    height: 100%;
    padding: 22px 20px 28px;
    background: #fff;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.18);
    transform: translateX(100%);
    pointer-events: none;
    transition: transform 0.25s ease;
    font-family: "IBM Plex Sans", Arial, sans-serif;
}

.leaderboard.is-open {
    transform: translateX(0);
    pointer-events: auto;
}

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

.leaderboard-head h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: var(--bleu-fonce);
    font-size: 22px;
}

.leaderboard-head h2 i {
    color: var(--bleu-clair);
}

.leaderboard-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: none;
    color: var(--bleu);
    font-size: 18px;
    cursor: pointer;
}

.leaderboard-close:hover {
    background: rgb(from var(--bleu-clair) r g b / 15%);
}

.leaderboard-meta {
    margin: 6px 0 16px;
    color: #666;
    font-size: 14px;
}

.leaderboard-list {
    flex: 1;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
}

.leaderboard-row {
    position: relative;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 8px;
}

/* Hairline between rows. Not a border, so it stays clear of the highlight. */
.leaderboard-row:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 0;
    height: 1px;
    background: #d7d7d7;
}

.leaderboard-row.is-me {
    margin: 3px 0;
    background: rgb(from var(--bleu-clair) r g b / 16%);
    outline: 1px solid var(--bleu-clair);
}

.leaderboard-row.is-me::after,
.leaderboard-row:has(+ .is-me)::after {
    display: none;
}

.leaderboard-rank {
    color: var(--bleu);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.leaderboard-row.rank-1 .leaderboard-rank { color: #c8960c; }
.leaderboard-row.rank-2 .leaderboard-rank { color: #6e7c8a; }
.leaderboard-row.rank-3 .leaderboard-rank { color: #b86a32; }

.leaderboard-user {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--bleu-fonce);
    font-weight: 700;
}

.leaderboard-user span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-you {
    flex-shrink: 0;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--bleu-clair);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.leaderboard-score {
    color: var(--bleu);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.leaderboard-status,
.leaderboard-note {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.leaderboard-note {
    margin-top: 16px;
}



/* ---------- Free play results window (uses the .help-dialog base from main_elements.css) ---------- */
.result-dialog {
    width: min(400px, calc(100% - 32px));
    text-align: center;
}

.result-category {
    display: inline-block;
    margin: 0 0 18px;
    padding: 3px 12px;
    border-radius: 999px;
    background: rgb(from var(--bleu-clair) r g b / 12%);
    color: var(--bleu);
    font-size: 13px;
    font-weight: 700;
}

.result-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--bleu-fonce);
}

#resultScore {
    font-size: 56px;
    font-weight: 700;
    line-height: 1;
}

.result-score-label {
    margin-top: 4px;
    color: #666;
    font-size: 14px;
}

.result-record {
    margin: 12px 0 0;
    color: #c8960c;
    font-size: 15px;
    font-weight: 700;
}

.result-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
}

.result-stats > div {
    display: flex;
    flex-direction: column;
    padding: 10px;
    border-radius: 8px;
    background: rgb(from var(--bleu-clair) r g b / 8%);
}

.result-stat-value {
    color: var(--bleu);
    font-size: 22px;
    font-weight: 700;
}

.result-stat-label {
    color: #666;
    font-size: 13px;
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 22px;
}

.result-replay,
.result-review {
    padding: 10px 16px;
    border-radius: 8px;
    font-family: "IBM Plex Sans", sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.result-replay {
    border: none;
    background: var(--bleu);
    color: white;
}

.result-replay:hover {
    background: var(--bleu-peu-fonce);
}

.result-review {
    border: 1px solid var(--bleu-clair);
    background: white;
    color: var(--bleu);
}

.result-review:hover {
    background: rgb(from var(--bleu-clair) r g b / 15%);
}

/* ---------- Phone ---------- */
@media (max-width: 600px) {
    .quiz-selected-category {
        margin-top: 8px;
        text-align: center;
    }

    /* Score / streak / highest score as three small centered columns */
    .score-bar {
        align-items: center;
        margin-top: 12px;
        gap: 8px;
        padding: 8px 4px;
        border-radius: 10px;
        background: rgb(255 255 255 / 60%);
    }

    /* Three equal columns: min-width 0 stops the longest text from widening its column */
    .score-bar p {
        flex: 1 1 0;
        min-width: 0;
        width: auto;
        font-size: 13px;
        text-align: center;
    }

    #highestScore {
        justify-content: center;
    }

    .statement-head,
    .daily-meta {
        margin-top: 14px;
    }

    .statement {
        min-height: 110px;
        font-size: 18px;
    }

    .answer-display {
        margin-top: 20px;
        font-size: 18px;
    }

    #detail {
        font-size: 15px;
        line-height: 1.5;
    }

    /* Daily results: score circle on top, history underneath */
    #dailySummary {
        flex-direction: column;
        gap: 16px;
        box-sizing: border-box;
        padding: 0 16px;
    }

    .summary-divider {
        align-self: center;
        width: 60%;
        height: 2px;
    }

    .summary-history {
        flex: none;
        width: 100%;
    }

    .guest-prompt {
        flex: none;
        text-align: center;
    }

    .daily-review li {
        margin-bottom: 20px;
        padding: 14px 16px;
    }

    .review-question {
        font-size: 16px;
    }
}
