/* Mode sombre : <html data-theme="dark" data-bs-theme="dark">, posé par le layout d'après le cookie `theme`
   (bouton du header, partials/theme_bascule.php + js/modules/theme.js). Chargé après toutes les feuilles de la page.

   Principe :
   1. la palette de variables.css est inversée (les tons clairs deviennent sombres et inversement) : tout ce qui
      utilise les variables suit sans rien écrire ;
   2. les éléments sur fond doré, rouille, bleu promo ou cuir sombre (boutons, rubans, pastilles, barres de filtres)
      et le cadre du site (menu, pied de page, bandeaux) gardent la palette d'origine : ils restent tels quels ;
   3. les couleurs écrites en dur dans les feuilles ont ici leur équivalent sombre (clarté inversée, teinte gardée ;
      ombres, voiles sombres et couleurs vives moyennes inchangés).
   Une nouvelle couleur en dur dans une feuille appelle sa ligne ici : de préférence, utiliser les variables. */

:root[data-theme='dark'] {
    color-scheme: dark;
    --brun-nuit: #f4e7c9;
    --brun-cuir: #dcc39b;
    --brun-cuir-clair: #bba07f;
    --or: #d2a243;
    --or-clair: #4a3818;
    --or-terne: #e2bf72;
    --beige: #1b130d;
    --beige-fonce: #3e2c1e;
    --beige-clair: #261a12;
    --rouille: #e8875a;
    --encre: #eadcc0;
    --white: #2c2017;
    --rouge-banni: #e46a6a;
    --promo: #5ba8dc;
    --promo-fonce: #8cc8f0;
    --promo-clair: #142b3d;

    /* Bootstrap (modales, menus, champs, alertes) dans les tons du site */
    --bs-body-bg: #1b130d;
    --bs-body-color: #eadcc0;
    --bs-emphasis-color: #fff8ea;
    --bs-secondary-color: rgba(234, 220, 192, 0.75);
    --bs-secondary-bg: #261a12;
    --bs-tertiary-bg: #2c2017;
    --bs-border-color: #4a3624;
    --bs-link-color: #e8875a;
    --bs-link-color-rgb: 232, 135, 90;
    --bs-link-hover-color: #e2bf72;
    --bs-link-hover-color-rgb: 226, 191, 114;
}

/* Cadre du site : déjà sombre, il garde ses couleurs */
:where(:root[data-theme='dark']) :is(.kros-navbar, .kros-footer, .ressources-nav, .bandeau-livraison) {
    --brun-nuit: #1c110a;
    --brun-cuir: #3d2617;
    --brun-cuir-clair: #6b4327;
    --or: #c99a3c;
    --or-clair: #f2d98a;
    --or-terne: #8a6a2c;
    --beige: #efe2c2;
    --beige-fonce: #ddc99a;
    --beige-clair: #f3ead5;
    --rouille: #a34d27;
    --encre: #2a1c12;
    --white: #ffffff;
    --rouge-banni: #b12222;
    --promo: #5ba8dc;
    --promo-fonce: #1f5f8b;
    --promo-clair: #e8f3fb;
}

/* Fonds dorés, rouille, bleus, vifs ou cuir sombre (boutons, rubans, pastilles, barres) : palette d'origine */
:where(:root[data-theme='dark'])
    :where(
        .btn-kros,
        .connexion-requise-icone,
        .ldv-outils,
        .ldv-bouton--principal,
        .des-etapes,
        .des-bouton--principal,
        .des-lancer,
        .des-segments button.is-actif,
        .des-premier.is-actif,
        .edc-btn--primaire,
        .edc-btn--ecraser,
        .edc-btn--nouvelle,
        .cartes-custom-btn--plein,
        .cartes-custom-btn--or,
        .cartes-custom-btn--vert,
        .cartes-custom-btn--danger-plein,
        .outils-carte-icone,
        img.photo-cadree--entiere,
        .actu-cat,
        .actu-cat--boutique,
        .actu-cat--collection,
        .actu-cat--communaute,
        .actu-cat--site,
        .actu-popup-ok,
        .actu-popup-ok:hover,
        .article-card .article-nom--socle-dore,
        .article-modal-header .article-nom--socle-dore,
        .article-modal-fiche-btn,
        .article-modal-fiche-btn:hover,
        .article-modal-fiche-btn:focus-visible,
        .article-categorie-ribbon,
        .article-obtention-ribbon--rare,
        .article-obtention-ribbon--tres_rare,
        .article-obtention-ribbon--edition_limitee,
        .article-card-coin-remise,
        .article-remise-badge,
        .etat-remise,
        .article-achat-numero,
        .article-achat-rappel,
        .etat-photo-icone,
        .etat-photo-icone:hover,
        .etat-photo-icone:focus-visible,
        .option-tuile:has(.option-tuile-input:checked) .option-tuile-prix,
        .article-carte-custom-ribbon,
        .article-carte-custom-cta,
        .article-carte-custom-cta:hover,
        .article-carte-custom-cta:focus-visible,
        .commande-carte-custom-btn,
        .commande-carte-custom-btn:hover,
        .commande-carte-custom-btn:focus-visible,
        .commande-carte-custom-btn--clair,
        .carte-custom-choix-connexion,
        .newsletter-bouton,
        .panier-ajout-btn:hover,
        .panier-ajout-btn:focus-visible,
        .panier-quantite-etat,
        .panier-toast,
        .photos-reelles-fond,
        .photos-reelles.is-zoom .photos-reelles-loupe,
        .photos-reelles-scene,
        .etat-photo-miniature span,
        .article-galerie-diapo--reelle .article-galerie-zoom,
        .article-galerie-badge,
        .article-galerie-etat.is-active,
        .profil-modal-contribution:hover,
        .profil-modal-contribution:focus-visible,
        .profil-modal-contribution.is-active,
        .contrib-icone,
        .profil-version-switch,
        .profil-version-tab.is-active,
        .profil-filter-bar,
        .article-remise-apercu-taux,
        .actu-pagination span[aria-current],
        .cartes-profil-help:hover,
        .cartes-profil-help:focus-visible,
        #profil-selection-enable,
        .profil-face-badge,
        .profil-status-badge--wip,
        .profil-status-badge--beta,
        .profil-modal-selection-toggle,
        .profil-modal-selection-toggle:hover,
        .profil-modal-selection-toggle:focus-visible,
        .profil-modal-selection-toggle.is-active,
        .profil-modal-selection-toggle.is-active:hover,
        .profil-modal-selection-toggle.is-active:focus-visible,
        .profil-select-toggle.is-active,
        #profil-selection-count,
        .profil-selection-face-badge,
        #profil-generate-pdf,
        #profil-generate-pdf:hover,
        #profil-generate-pdf:focus-visible,
        .profil-modal-navigation:hover,
        .profil-modal-navigation:focus-visible,
        .profil-choix-cartes,
        .profil-langue-tab.is-active,
        .profil-langue-tab.is-active.is-indisponible,
        .profil-modal-langue:hover:not(:disabled),
        .profil-modal-langue:focus-visible,
        .profil-modal-langue.is-active,
        .profil-langue-tab-statut,
        .filter-bar,
        .catalogue-mode-profils:hover,
        .catalogue-mode-profils:focus-visible,
        .catalogue-mode-profils.is-active,
        .carousel-arrow:hover:not(:disabled),
        .btn-collection-action,
        .btn-collection-action:hover,
        .share-link-block button.copied,
        .collection-help:hover,
        .collection-help:focus-visible,
        .collection-tabs,
        .collection-progress-fill,
        .collection-progress.complete .collection-progress-fill,
        .btn-toggle[aria-pressed='true'] .toggle-switch,
        .group-count.complete,
        .shelf,
        .item-quantity-badge,
        .item-copy-index,
        .item-copy-extra,
        .plaque-unique,
        .plaque-triple,
        .plaque-banni,
        .plaque-socle_rouge,
        .plaque-socle_dore,
        .item-figure .item-quantity .qty-btn,
        .progress-fill,
        .modal-close,
        .item-modal-close,
        .modal-close:hover,
        .item-modal-close:hover,
        .item-modal-quantity .qty-btn,
        .modal-quantity-toggle,
        .modal-quantity-toggle.remove,
        #item-modal.type-carte.variante-alt_art #modal-item-name,
        #item-modal.type-carte.variante-eternal .item-modal,
        #item-modal.type-carte.variante-eternal #modal-item-name,
        #item-modal.type-carte.variante-promo #modal-item-name,
        .badge-icon,
        .badge-mini-progress-fill,
        .badge-card.locked .badge-mini-progress-fill,
        .badge-filter-icon:hover,
        .badge-card.filter-active .badge-filter-icon,
        .badge-modal-icon,
        .langue-tab.active,
        .item-carte.variante-alt_art .item-plaque,
        .item-carte.variante-eternal,
        .item-carte.variante-eternal .item-image-wrap,
        .item-carte.variante-eternal .item-plaque,
        .item-carte.variante-eternal .item-serie-numero,
        .item-carte.variante-promo .item-plaque,
        .carte-state-icon.owned,
        .carte-remove-btn,
        .carte-remove-btn:hover,
        .badge-filter-clear,
        .badge-filter-clear:hover,
        .badge-filter-btn:hover,
        .btn-primary,
        .btn-danger,
        .btn-danger:hover,
        .commande-vignette--reste,
        .commande-statut--disponible,
        .commande-action,
        .commande-action:hover,
        .commande-action:focus-visible,
        .commande-etape.is-faite .commande-etape-point,
        .toggle-switch,
        .toggle-label input[type='checkbox']:checked + .toggle-switch,
        .copier-lien:hover,
        .copier-lien.is-copied,
        .btn-copy,
        .btn-copy:disabled,
        .compte-modale-icone,
        .compte-modale--succes .compte-modale-icone,
        .compte-modale--erreur .compte-modale-icone,
        .compte-suppression-bouton:hover:not(:disabled),
        .contact-icon,
        .echanges-btn--primaire,
        .echanges-btn--primaire:hover,
        .echanges-btn--primaire:focus-visible,
        .echange-badge--nouveau,
        .panier-etapes li.is-active .panier-etape-num,
        .panier-etapes li.is-fait .panier-etape-num,
        .panier-btn--primaire,
        .panier-btn--primaire:hover,
        .panier-btn--primaire:focus-visible,
        .panier-ligne-image-badge,
        .panier-socle--rouge,
        .panier-socle--dore,
        .panier-ligne-groupe.is-remisee,
        .panier-franco-jauge span,
        .relais-etat,
        .relais-etat.is-erreur,
        .relais-point.is-choisi .relais-point-numero,
        .relais-marqueur span,
        .relais-marqueur.is-choisi span,
        .panier-photos-vignette span,
        .personal-space-pastille,
        .ressources-regles-card-icon,
        .ressources-regles-download.is-principal,
        .version4-primary-link,
        .version4-illustration-placeholder
    ) {
    --brun-nuit: #1c110a;
    --brun-cuir: #3d2617;
    --brun-cuir-clair: #6b4327;
    --or: #c99a3c;
    --or-clair: #f2d98a;
    --or-terne: #8a6a2c;
    --beige: #efe2c2;
    --beige-fonce: #ddc99a;
    --beige-clair: #f3ead5;
    --rouille: #a34d27;
    --encre: #2a1c12;
    --white: #ffffff;
    --rouge-banni: #b12222;
    --promo: #5ba8dc;
    --promo-fonce: #1f5f8b;
    --promo-clair: #e8f3fb;
}
:where(:root[data-theme='dark']) .article-options-note::before,
:where(:root[data-theme='dark']) .option-tuile:has(.option-tuile-input:checked)::before,
:where(:root[data-theme='dark']) .photos-reelles-vignettes button.is-debut-groupe::before,
:where(:root[data-theme='dark']) .item-figure.figure-socle-rouge .item-image-wrap::before,
:where(:root[data-theme='dark']) .item-carte.variante-foil::before,
:where(:root[data-theme='dark']) .item-carte.variante-alt_art::before,
:where(:root[data-theme='dark']) .item-carte.variante-eternal::before,
:where(:root[data-theme='dark']) .item-carte.variante-promo::before,
:where(:root[data-theme='dark']) .commande-etape.is-faite:not(:last-child)::before,
:where(:root[data-theme='dark']) .form-error::before,
:where(:root[data-theme='dark']) .form-success::before,
:where(:root[data-theme='dark']) .compte-email-attente::before,
:where(:root[data-theme='dark']) .contact-hero h1::after,
:where(:root[data-theme='dark']) .panier-etapes li.is-fait + li::before {
    --brun-nuit: #1c110a;
    --brun-cuir: #3d2617;
    --brun-cuir-clair: #6b4327;
    --or: #c99a3c;
    --or-clair: #f2d98a;
    --or-terne: #8a6a2c;
    --beige: #efe2c2;
    --beige-fonce: #ddc99a;
    --beige-clair: #f3ead5;
    --rouille: #a34d27;
    --encre: #2a1c12;
    --white: #ffffff;
    --rouge-banni: #b12222;
    --promo: #5ba8dc;
    --promo-fonce: #1f5f8b;
    --promo-clair: #e8f3fb;
}
@supports selector(::-webkit-scrollbar) {
    :where(:root[data-theme='dark']) body *::-webkit-scrollbar-thumb,
    :where(:root[data-theme='dark']) body *::-webkit-scrollbar-thumb:hover,
    :where(:root[data-theme='dark']) body *::-webkit-scrollbar-thumb:active {
        --brun-nuit: #1c110a;
        --brun-cuir: #3d2617;
        --brun-cuir-clair: #6b4327;
        --or: #c99a3c;
        --or-clair: #f2d98a;
        --or-terne: #8a6a2c;
        --beige: #efe2c2;
        --beige-fonce: #ddc99a;
        --beige-clair: #f3ead5;
        --rouille: #a34d27;
        --encre: #2a1c12;
        --white: #ffffff;
        --rouge-banni: #b12222;
        --promo: #5ba8dc;
        --promo-fonce: #1f5f8b;
        --promo-clair: #e8f3fb;
    }
}

/* Couleurs écrites en dur, feuille par feuille */

/* --- style.css --- */
:where(:root[data-theme='dark']) .traduction-en-cours {
    border-bottom: 1px solid #2a4357;
    background: #142b3d;
    color: #94b6d3;
}

/* --- components.css --- */
:where(:root[data-theme='dark']) .login-icon-btn {
    background: #2c2017;
}
:where(:root[data-theme='dark']) .connexion-requise-bouton {
    background: #2c2017;
}

/* --- modules/article-card.css --- */
:where(:root[data-theme='dark']) .article-card.article-socle-dore {
    box-shadow:
        0 4px 0 rgba(0, 0, 0, 0.04),
        0 6px 18px rgba(155, 134, 75, 0.06);
}
:where(:root[data-theme='dark']) .article-card .article-nom--rarete-triple,
:where(:root[data-theme='dark']) .article-modal-header .article-nom--rarete-triple {
    color: #e4d8cd !important;
}
:where(:root[data-theme='dark']) .article-card .article-nom--socle-rouge,
:where(:root[data-theme='dark']) .article-modal-header .article-nom--socle-rouge {
    color: #eb8585;
    border-image: linear-gradient(90deg, #ef9e9e, #d63a2c 50%, #ef9e9e) 1;
}
:where(:root[data-theme='dark']) .article-card .article-rarete.article-nom--socle-rouge,
:where(:root[data-theme='dark']) .article-modal-header .article-rarete.article-nom--socle-rouge {
    color: #eb8585;
}
:where(:root[data-theme='dark']) .article-card-eye,
:where(:root[data-theme='dark']) .wishlist-heart {
    background: rgba(44, 32, 23, 0.85);
}
:where(:root[data-theme='dark']) .article-card:hover .article-card-eye {
    background: #2c2017;
}
:where(:root[data-theme='dark']) .wishlist-heart:hover {
    background: #2c2017;
}
:where(:root[data-theme='dark']) .info-tooltip {
    background: #2c2017;
}
:where(:root[data-theme='dark']) .article-price-detail {
    background: #2c2017;
}
:where(:root[data-theme='dark']) .qty-badge--stock {
    background: #364b26;
    color: #a0ce96;
}
:where(:root[data-theme='dark']) .qty-badge--last {
    background: #3b2d1c;
}
:where(:root[data-theme='dark']) .qty-badge--rupture {
    background: #50452c;
    color: #b8ac93;
}
:where(:root[data-theme='dark']) .qty-badge--demand {
    background: #312145;
    color: #a08abc;
    border-color: #60417c;
}
:where(:root[data-theme='dark']) .qty-badge--restock {
    background: #50452c;
    color: #b8ac93;
}
:where(:root[data-theme='dark']) .article-option-select select {
    background: #2c2017;
}
:where(:root[data-theme='dark']) .article-option-select select:focus-visible {
    box-shadow: 0 0 0 3px rgba(210, 162, 67, 0.3);
}
:where(:root[data-theme='dark']) .option-tuile {
    background: #2c2017;
}
:where(:root[data-theme='dark']) .option-tuile::before {
    background: #2c2017;
}
:where(:root[data-theme='dark']) .option-tuile:has(.option-tuile-input:checked) {
    background: linear-gradient(180deg, #3c341d, #2c2017);
    box-shadow: 0 0 0 3px rgba(210, 162, 67, 0.25);
}
:where(:root[data-theme='dark']) .commande-demande-message textarea:focus-visible {
    box-shadow: 0 0 0 3px rgba(210, 162, 67, 0.3);
}
:where(:root[data-theme='dark']) .quantite-choix {
    background: #2c2017;
}
:where(:root[data-theme='dark']) .commande-carte-custom {
    border: 1px solid #80563e;
    background: #38271b;
}
:where(:root[data-theme='dark']) .qty-badge--carte-custom {
    background: #261a12;
    border-color: #80563e;
}
:where(:root[data-theme='dark']) .carte-custom-choix-carte.is-choisie,
:where(:root[data-theme='dark']) .commande-image-jointe {
    border-color: #80563e;
    background: #38271b;
}

/* --- modules/newsletter.css --- */
:where(:root[data-theme='dark']) .newsletter-email:focus {
    box-shadow: 0 0 0 3px rgba(210, 162, 67, 0.25);
}

/* --- modules/panier.css --- */
:where(:root[data-theme='dark']) .panier-ajout-btn {
    background: #2c2017;
}

/* --- modules/photos-reelles.css --- */
:where(:root[data-theme='dark']) .photos-reelles-fleche {
    background: rgba(38, 26, 18, 0.9);
}
:where(:root[data-theme='dark']) .article-galerie-fleche {
    background: rgba(38, 26, 18, 0.92);
}

/* --- modules/profil-contribution.css --- */
:where(:root[data-theme='dark']) .profil-contribution .is-modifie {
    box-shadow: 0 0 0 2px rgba(210, 162, 67, 0.35);
}
:where(:root[data-theme='dark']) .contrib-statut.is-acceptee {
    background: #285435;
    color: #9edfb3;
}
:where(:root[data-theme='dark']) .contrib-statut.is-refusee {
    background: #523228;
}

/* --- pages/cartes-profil.css --- */
:where(:root[data-theme='dark']) .cartes-profil-intro-order {
    background: rgba(44, 32, 23, 0.3);
}
:where(:root[data-theme='dark']) .profil-card-open-tab {
    background: rgba(44, 32, 23, 0.85);
}
:where(:root[data-theme='dark']) .profil-card-open-tab:hover {
    background: #2c2017;
}
:where(:root[data-theme='dark']) .profil-select-toggle {
    background: rgba(44, 32, 23, 0.85);
}
:where(:root[data-theme='dark']) .profil-select-toggle:hover {
    background: #2c2017;
}
:where(:root[data-theme='dark']) .profil-pdf-report {
    background: #3b2e1c;
}
:where(:root[data-theme='dark']) .profil-modal-navigation:disabled {
    border-color: #6f6557;
}
:where(:root[data-theme='dark']) .profil-modal-langue.is-indisponible {
    border-color: #6f6557;
}
:where(:root[data-theme='dark']) .profil-modal-langue-statut {
    background: #261a12;
    color: #a79f96;
}

/* --- pages/collection.css --- */
:where(:root[data-theme='dark']) .collection-header {
    background: radial-gradient(circle at 100% 0%, rgba(74, 56, 24, 0.45) 0, transparent 45%), linear-gradient(135deg, var(--beige-clair) 0%, var(--beige) 100%);
}
:where(:root[data-theme='dark']) .collection-toolbar {
    background: rgba(38, 26, 18, 0.94);
}
:where(:root[data-theme='dark']) .btn-toggle[aria-pressed='true'] {
    background: rgba(74, 56, 24, 0.5);
}
:where(:root[data-theme='dark']) .item-figure {
    --spot: rgba(60, 52, 29, 0.95);
}
:where(:root[data-theme='dark']) .item-figure.figure-unique,
:where(:root[data-theme='dark']) .item-figure.figure-socle-dore {
    --spot: rgba(74, 56, 24, 0.95);
}
:where(:root[data-theme='dark']) .item-figure.figure-triple {
    --spot: rgba(44, 32, 23, 0.85);
}
:where(:root[data-theme='dark']) .item-figure.figure-banni,
:where(:root[data-theme='dark']) .item-figure.figure-socle-rouge {
    --spot: rgba(121, 65, 58, 0.8);
}
:where(:root[data-theme='dark']) .item-figure.figure-socle-dore .item-image-wrap::before,
:where(:root[data-theme='dark']) .item-figure.figure-socle-rouge .item-image-wrap::before {
    background: linear-gradient(75deg, rgba(44, 32, 23, 0) 0%, rgba(74, 56, 24, 0.9) 50%, rgba(44, 32, 23, 0) 100%);
}
:where(:root[data-theme='dark']) .quick-add-mode .item-copy .item-image-wrap::after {
    background: rgba(44, 32, 23, 0.45);
}
:where(:root[data-theme='dark']) .item-plaque {
    box-shadow:
        0 2px 3px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(44, 32, 23, 0.3);
}
:where(:root[data-theme='dark']) .item-figure .item-plaque {
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(44, 32, 23, 0.35);
}
:where(:root[data-theme='dark']) .plaque-double {
    background: #2c2017;
}
:where(:root[data-theme='dark']) .quick-add-mode .item-figure .item-quantity {
    background: rgba(44, 32, 23, 0.94);
}
:where(:root[data-theme='dark']) .item-modal-overlay.figure-unique .item-modal {
    background: linear-gradient(160deg, var(--beige-clair) 0%, #655631 100%);
}
:where(:root[data-theme='dark']) .item-modal-overlay.figure-triple .item-modal {
    background: linear-gradient(160deg, var(--beige-clair) 0%, #8b6743 100%);
}
:where(:root[data-theme='dark']) .item-modal-overlay.figure-banni .item-modal {
    background: linear-gradient(160deg, var(--beige-clair) 0%, #6a3333 100%);
}
:where(:root[data-theme='dark']) .item-modal-overlay.figure-socle-rouge .item-modal {
    background: linear-gradient(160deg, var(--beige-clair) 0%, #643d30 100%);
}
:where(:root[data-theme='dark']) .item-modal-overlay.figure-socle-rouge .item-modal::before {
    background: linear-gradient(75deg, rgba(44, 32, 23, 0) 0%, rgba(163, 77, 39, 0.6) 50%, rgba(44, 32, 23, 0) 100%);
}
:where(:root[data-theme='dark']) .item-modal-overlay.figure-socle-dore .item-modal {
    background: linear-gradient(160deg, var(--beige-clair) 0%, #655631 100%);
}
:where(:root[data-theme='dark']) .item-modal-overlay.figure-socle-dore .item-modal::before {
    background: linear-gradient(75deg, rgba(44, 32, 23, 0) 0%, rgba(74, 56, 24, 0.8) 50%, rgba(44, 32, 23, 0) 100%);
}
:where(:root[data-theme='dark']) #modal-item-name {
    box-shadow:
        0 2px 3px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(44, 32, 23, 0.3);
}
:where(:root[data-theme='dark']) .item-modal-meta .modal-item-ownership.not-owned {
    color: #b28e70;
}
:where(:root[data-theme='dark']) #item-modal.type-carte.variante-standard .item-modal {
    border-color: #e7dcd3;
    background: #2c2017;
}
:where(:root[data-theme='dark']) #item-modal.type-carte.variante-foil .item-modal {
    box-shadow:
        inset 0 0 0 2px #4a3818,
        0 10px 30px rgba(212, 175, 54, 0.35);
    background: linear-gradient(135deg, #3d361e, #4c4425);
}
:where(:root[data-theme='dark']) #item-modal.type-carte.variante-alt_art .item-modal {
    background: #142b3d;
}
:where(:root[data-theme='dark']) #item-modal.type-carte.variante-promo .item-modal {
    background: #351919;
}
:where(:root[data-theme='dark']) .badge-card {
    background: linear-gradient(135deg, #352c1a 0%, rgba(74, 56, 24, 0.55) 100%);
}
:where(:root[data-theme='dark']) .badge-card.locked .badge-icon {
    box-shadow:
        inset 0 0 0 3px rgba(44, 32, 23, 0.4),
        0 0 0 2px var(--beige-fonce);
}
:where(:root[data-theme='dark']) .badge-mini-progress {
    background: rgba(62, 44, 30, 0.8);
}
:where(:root[data-theme='dark']) .badge-filter-icon {
    background: rgba(44, 32, 23, 0.85);
}
:where(:root[data-theme='dark']) .langue-tab:hover {
    background: rgba(44, 32, 23, 0.6);
}
:where(:root[data-theme='dark']) .item-carte {
    border: 4px solid #e7dcd3;
    background: #2c2017;
}
:where(:root[data-theme='dark']) .item-carte .item-image-wrap {
    background: #142b3d;
}
:where(:root[data-theme='dark']) .item-carte .item-plaque {
    background: #2c2017;
}
:where(:root[data-theme='dark']) .item-serie-numero {
    color: #b28e70;
    background: #2c2017;
}
:where(:root[data-theme='dark']) .item-carte.variante-standard {
    border-color: #e7dcd3;
}
:where(:root[data-theme='dark']) .item-carte.variante-foil {
    box-shadow: 0 3px 10px rgba(212, 175, 54, 0.35);
}
:where(:root[data-theme='dark']) .item-carte.variante-foil .item-image-wrap {
    background: linear-gradient(135deg, #3d361e, #4c4425);
}
:where(:root[data-theme='dark']) .item-carte.variante-foil .item-image-wrap::after {
    background: linear-gradient(75deg, transparent 30%, rgba(44, 32, 23, 0.75) 50%, transparent 70%);
}
:where(:root[data-theme='dark']) .item-carte.variante-foil .item-plaque,
:where(:root[data-theme='dark']) .item-carte.variante-foil .item-serie-numero {
    background: linear-gradient(180deg, #38331b, #2c2017);
}
:where(:root[data-theme='dark']) .item-carte.variante-alt_art .item-serie-numero {
    background: #142b3d;
}
:where(:root[data-theme='dark']) .item-carte.variante-promo .item-serie-numero {
    background: #351919;
}
:where(:root[data-theme='dark']) .carte-state-icon {
    border: 2px solid rgba(44, 32, 23, 0.9);
}
:where(:root[data-theme='dark']) .badge-filter-banner {
    background: rgba(74, 56, 24, 0.35);
}
:where(:root[data-theme='dark']) .show-missing-list-btn:hover {
    color: #cfb9a6;
}
:where(:root[data-theme='dark']) .badge-modal-overlay.just-unlocked .badge-modal-icon {
    box-shadow:
        inset 0 0 0 4px rgba(44, 32, 23, 0.4),
        0 0 0 3px var(--or-terne),
        0 0 28px rgba(74, 56, 24, 0.95);
}
:where(:root[data-theme='dark']) .ie-import-detail {
    background: rgba(44, 32, 23, 0.45);
}
:where(:root[data-theme='dark']) .ie-import-summary.error {
    color: #ea8585;
}
:where(:root[data-theme='dark']) .ie-import-summary.error p {
    color: #ea8585;
}

/* --- pages/commandes.css --- */
:where(:root[data-theme='dark']) .commande-statut {
    background: #385128;
    color: #a2cea3;
}
:where(:root[data-theme='dark']) .commande-statut--en-cours,
:where(:root[data-theme='dark']) .commande-statut--expediee {
    background: #5c4f2c;
    color: #ebca88;
}
:where(:root[data-theme='dark']) .commande-statut--reservee,
:where(:root[data-theme='dark']) .commande-statut--anomalie {
    background: #543728;
    color: #e89578;
}
:where(:root[data-theme='dark']) .commande-alerte {
    background: #261a12;
}
:where(:root[data-theme='dark']) .commande-alerte p {
    color: #e89578;
}
:where(:root[data-theme='dark']) .commande-totaux-remise dd {
    color: #a2cea3;
}
:where(:root[data-theme='dark']) .commande-remettre-resultat.is-erreur {
    color: #e89578;
}

/* --- pages/compte.css --- */
:where(:root[data-theme='dark']) .form-group input[type='text'],
:where(:root[data-theme='dark']) .form-group input[type='email'] {
    background: #2c2017;
}
:where(:root[data-theme='dark']) .toggle-switch::before {
    background: #2c2017;
}
:where(:root[data-theme='dark']) .form-error {
    background: #3d231e;
}
:where(:root[data-theme='dark']) .form-success {
    color: #9ee3a3;
    background: #1e3f21;
}
:where(:root[data-theme='dark']) .compte-email-attente {
    background: #2c2017;
}
:where(:root[data-theme='dark']) .connexion {
    background: #2c2017;
}
:where(:root[data-theme='dark']) .coordonnees-champ input,
:where(:root[data-theme='dark']) .coordonnees-champ select {
    background: #2c2017;
}
:where(:root[data-theme='dark']) .compte-suppression-bouton {
    background: #2c2017;
}

/* --- pages/echanges.css --- */
:where(:root[data-theme='dark']) .echange-flash--erreur {
    background: #261a12;
}

/* --- pages/panier.css --- */
:where(:root[data-theme='dark']) .panier-alerte--erreur {
    color: #e79084;
}
:where(:root[data-theme='dark']) .panier-ligne-message textarea:focus-visible {
    box-shadow: 0 0 0 3px rgba(210, 162, 67, 0.3);
}
:where(:root[data-theme='dark']) .remise-couleur-3 {
    --remise-couleur: #a47cb5;
}
:where(:root[data-theme='dark']) .panier-option-select select:focus-visible {
    box-shadow: 0 0 0 3px rgba(210, 162, 67, 0.3);
}

/* --- pages/ressources-regles.css --- */
:where(:root[data-theme='dark']) .ressources-regles-badge--officiel {
    background: #244129;
    color: #aacdb4;
}
:where(:root[data-theme='dark']) .ressources-regles-badge--fanmade {
    background: #261a12;
    color: #e6bc8a;
}

/* --- pages/version-4x.css --- */
:where(:root[data-theme='dark']) .version4-page {
    color: #d2cac5;
}
:where(:root[data-theme='dark']) .version4-hero h1 {
    color: #d2bdb8;
}
:where(:root[data-theme='dark']) .version4-section h2,
:where(:root[data-theme='dark']) .version4-patchnotes h2,
:where(:root[data-theme='dark']) .version4-resources h2 {
    color: #d2bdb8;
}
:where(:root[data-theme='dark']) .version4-step {
    background: #2c2017;
}
:where(:root[data-theme='dark']) .version4-resources {
    background: #234037;
}

/* Outils › Ligne de vue (pages/outils.css) */
:where(:root[data-theme='dark']) .ldv-resume[data-statut='refus'] {
    color: #ff9a8f;
}

/* Outils › Lancer de dés (pages/des.css) */
:where(:root[data-theme='dark']) .des-consigne--alerte {
    color: #ffd9c7;
    background: #4a2214;
}
:where(:root[data-theme='dark']) .des-chances-legende .is-bon strong {
    color: #7fd99a;
}
:where(:root[data-theme='dark']) .des-chances-legende .is-mauvais strong {
    color: #ff9f8f;
}
:where(:root[data-theme='dark']) .des-stats-niveau.is-bon {
    color: #7fd99a;
}
:where(:root[data-theme='dark']) .des-stats-niveau.is-mauvais {
    color: #ff9f8f;
}

/* Éditeur de carte : carte enregistrée */
:where(:root[data-theme='dark']) .edc-compte-ok {
    color: #7fd99a;
}
