/* === Quiz + listes déroulantes thématisées + panneau flottant === */
        /* ---- Quiz ---- */
        .quiz-start,
        .quiz-end {
            text-align: center;
            padding: 0.5rem 0.25rem 0.25rem;
        }

        .quiz-emoji { font-size: 2.6rem; }

        .quiz-intro {
            color: var(--text-secondary, var(--text-tertiary));
            font-size: 0.95rem;
            margin: 0.5rem auto 1rem;
            max-width: 460px;
            line-height: 1.5;
        }

        .quiz-scope {
            display: flex;
            gap: 0.75rem;
            justify-content: center;
            align-items: flex-start;
            flex-wrap: wrap;
            margin-bottom: 0.8rem;
        }

        .quiz-scope label {
            display: flex;
            flex-direction: column;
            gap: 0.25rem;
            font-size: 0.75rem;
            font-weight: 700;
            color: var(--text-secondary);
            text-align: left;
            flex: 1 1 170px;
            max-width: 220px;
        }

        @media (max-width: 480px) {
            .quiz-scope {
                flex-direction: column;
                align-items: stretch;
            }

            .quiz-scope label {
                max-width: none;
                width: 100%;
            }
        }

        /* ---- Listes déroulantes thématisées (remplace le <select> natif,
           dont le panneau d'options ne peut pas être stylé aux couleurs
           de l'application) ---- */
        .theme-select {
            position: relative;
        }

        .theme-select-trigger {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.5rem;
            padding: 0.5rem 0.6rem;
            border-radius: 0.55rem;
            border: 1px solid var(--border-color);
            background: var(--bg-card);
            color: var(--text-primary);
            font-family: inherit;
            font-size: 0.9rem;
            font-weight: 600;
            cursor: pointer;
            transition: border-color 0.15s ease, box-shadow 0.15s ease;
        }

        .theme-select-trigger:hover {
            border-color: var(--accent);
        }

        .theme-select-trigger:focus-visible {
            outline: 2px solid var(--accent);
            outline-offset: 2px;
        }

        .theme-select-trigger .chev {
            width: 13px;
            height: 13px;
            flex-shrink: 0;
            color: var(--text-tertiary);
            transition: transform 0.2s ease;
        }

        .theme-select.is-open .theme-select-trigger {
            border-color: var(--accent);
        }

        .theme-select.is-open .theme-select-trigger .chev {
            transform: rotate(180deg);
        }

        /* Panneau flottant : sorti du flux de la modale hôte (ajouté à <body>
           puis positionné en fixed par JS) pour ne jamais être rogné par le
           overflow/scroll de la modale, et toujours passer au-dessus d'elle. */
        .theme-select-panel {
            position: fixed;
            z-index: 10050;
            overflow-y: auto;
            border: 1px solid var(--border-color);
            border-radius: 0.75rem;
            background: var(--bg-card);
            backdrop-filter: var(--glass-blur);
            -webkit-backdrop-filter: var(--glass-blur);
            box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.08);
            padding: 0.35rem;
            opacity: 0;
            transform: translateY(-6px) scale(0.98);
            pointer-events: none;
            transition: opacity 0.16s ease, transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1);
            /* Scrollbar fine, aux couleurs du thème (Firefox) */
            scrollbar-width: thin;
            scrollbar-color: var(--accent-scroll) transparent;
        }

        .theme-select-panel::-webkit-scrollbar {
            width: 6px;
        }

        .theme-select-panel::-webkit-scrollbar-track {
            background: transparent;
            margin: 4px 0;
        }

        .theme-select-panel::-webkit-scrollbar-thumb {
            background: var(--accent-scroll);
            border-radius: 999px;
        }

        .theme-select-panel::-webkit-scrollbar-thumb:hover {
            background: var(--accent-scroll-hover);
        }

        [data-theme="dark"] .theme-select-panel {
            box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.2);
        }

        .theme-select-panel.is-open {
            opacity: 1;
            transform: translateY(0) scale(1);
            pointer-events: auto;
        }

        .theme-select-panel.opens-up {
            transform: translateY(6px) scale(0.98);
        }

        .theme-select-panel.opens-up.is-open {
            transform: translateY(0) scale(1);
        }

        .theme-select-option {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.5rem;
            width: 100%;
            padding: 0.45rem 0.55rem;
            border: none;
            border-radius: 0.45rem;
            background: transparent;
            font-family: inherit;
            font-size: 0.82rem;
            font-weight: 600;
            color: var(--text-secondary);
            text-align: left;
            cursor: pointer;
            transition: background-color 0.12s ease, color 0.12s ease;
        }

        .theme-select-option:hover,
        .theme-select-option:focus-visible {
            background: var(--bg-filter);
            color: var(--text-primary);
        }

        .theme-select-option.is-selected {
            color: var(--accent);
            font-weight: 800;
        }

        .theme-select-option .chk {
            width: 13px;
            height: 13px;
            flex-shrink: 0;
            opacity: 0;
            color: var(--accent);
        }

        .theme-select-option.is-selected .chk {
            opacity: 1;
        }

        .visually-hidden-select {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }

        .quiz-poolinfo { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 0.8rem; }
        .quiz-warn { color: #e11d48; font-weight: 600; }

        .quiz-btn-primary {
            padding: 0.7rem 1.6rem;
            border: none;
            border-radius: 0.8rem;
            background: var(--accent);
            color: #fff;
            font-weight: 800;
            font-size: 1rem;
            cursor: pointer;
            transition: filter 0.15s ease, transform 0.15s ease;
        }

        .quiz-btn-primary:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); }
        .quiz-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

        .quiz-btn-secondary {
            padding: 0.7rem 1.2rem;
            border: 1px solid var(--border-color);
            border-radius: 0.8rem;
            background: transparent;
            color: var(--text-primary);
            font-weight: 700;
            cursor: pointer;
        }

        .quiz-best { margin-top: 1rem; font-size: 0.85rem; color: var(--text-secondary); }

        .quiz-hud {
            display: flex;
            justify-content: space-between;
            font-weight: 700;
            font-size: 0.9rem;
            margin-bottom: 0.5rem;
        }

        .quiz-score { color: var(--accent); }

        .quiz-progress {
            height: 8px;
            border-radius: 5px;
            background: rgba(127, 127, 127, 0.18);
            overflow: hidden;
            margin-bottom: 1rem;
        }

        .quiz-progress-bar {
            height: 100%;
            background: var(--accent);
            transition: width 0.3s ease;
        }

        .quiz-question { text-align: center; margin-bottom: 1rem; }

        .quiz-q-label {
            font-size: 0.85rem;
            color: var(--text-secondary);
            font-weight: 700;
            margin-bottom: 0.6rem;
        }

        .quiz-combo {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 0.35rem;
            flex-wrap: wrap;
            font-size: 1.3rem;
        }

        .quiz-action {
            font-size: 1.15rem;
            font-weight: 800;
            color: var(--text-primary);
        }

        .quiz-choices {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.6rem;
        }

        .quiz-choice {
            padding: 0.75rem 0.85rem;
            border: 1.5px solid var(--border-color);
            border-radius: 0.7rem;
            background: var(--bg-card);
            color: var(--text-primary);
            font-size: 0.9rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.12s ease;
            min-height: 52px;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            flex-wrap: wrap;
            gap: 0.25rem;
        }

        .quiz-choice:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-1px); }
        .quiz-choice.is-correct { border-color: #16a34a; background: #16a34a20; color: #16a34a; }
        .quiz-choice.is-wrong { border-color: #e11d48; background: #e11d4820; color: #e11d48; }
        .quiz-choice:disabled { cursor: default; }

        .quiz-feedback {
            margin-top: 1rem;
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.7rem;
        }

        .quiz-ok { color: #16a34a; font-weight: 800; }
        .quiz-ko { color: #e11d48; font-weight: 800; }

        .quiz-score-big {
            font-size: 2.6rem;
            font-weight: 900;
            color: var(--accent);
            margin: 0.3rem 0;
        }

        .quiz-record { color: #f5a623; font-weight: 800; margin-bottom: 0.3rem; }
        .quiz-endmsg { color: var(--text-secondary); margin-bottom: 1rem; }

        .quiz-end-actions {
            display: flex;
            gap: 0.6rem;
            justify-content: center;
            flex-wrap: wrap;
        }

        @media (max-width: 560px) {
            .quiz-choices { grid-template-columns: 1fr; }
        }

