/*
Chrome dédié à la page COLLECTION du module TCG ("classeur/binder") — web/personnage.html.
Suit la même convention de fichiers que tcg-pack.css/tcg-pack.js pour l'Ouverture : tcg-card.css
reste le seul propriétaire du rendu carte réel (.tcg-card, .tcg-card-mini-wrap, matériaux holo),
ce fichier ne touche qu'au cadre autour (reliure, grille de pages, pips, header, modal).

Voir memoire projet tcg-collection-binder-refonte pour le contexte complet et les decisions actees
avec l'utilisateur — architecture v3 (2026-09-27, 3e tour de retours) : grille GLOBALE continue de
9 cartes/page (3×3) SANS AUCUN egard pour les frontieres de famille (aucun trou, aucune case
reservee) ; une famille n'est signalee que par une petite etiquette en overlay sur sa 1ere carte
(JAMAIS un bloc/une section avec sa propre hauteur — casserait l'alignement des pastilles de
rarete entre slots d'une meme rangee) ; page tournee par PAIRE (double-page pleine largeur) ; la
nav famille n'est qu'un raccourci de saut, jamais un mode de navigation principal.

Couleurs de rareté : dupliquées à l'identique de tcg-card.css:349-353 (glows de hover des mini-
cartes) plutôt que réutilisées via une variable partagée — aucune variable CSS n'existait déjà
côté tcg-card.css pour ces couleurs (juste des rgba() inline), donc pas de vraie source unique à
référencer sans réécrire ce fichier-là hors scope de cette passe.
*/

/* CORRECTIF DE FOND (pas un simple ajustement du binder) — trouvé en diagnostiquant "le binder
   n'occupe que 40-50% de la largeur, énorme zone vide à droite" : `.tcg-page-inner`
   (personnage.css:1533) documente vouloir seulement REPRENDRE max-width/border/background/padding
   de `.character-inner`, mais le même élément DOM porte les 2 classes ET `.character-inner` pose
   aussi `display:grid; grid-template-columns:1fr 1.15fr;` (mise en page 2 colonnes du dossier
   agent) — jamais réinitialisé côté `.tcg-page-inner`. Résultat : `#tcgBinderStage` (seul gros
   enfant du flux) atterrissait dans la colonne 1fr (~46,5% de la largeur), colonne 1.15fr laissée
   vide — et pour la même raison, sur #tcgFavoritesPanel, le nav (`.tcg-page-nav`) et le header
   (`.tcg-page-header`) se retrouvaient CÔTE À CÔTE sur la même ligne (2 items consécutifs placés
   automatiquement dans les 2 colonnes du grid) au lieu d'être empilés (retour utilisateur
   2026-09-30, captures à l'appui). Corrigé ICI, scopé à `#tcgCollectionPanel` ET `#tcgFavoritesPanel`
   (ne touche pas `#boosterPanel`, qui partage la même classe mais a déjà été validé par l'utilisateur
   avec son agencement actuel — même bug latent là-bas, signalé séparément, pas corrigé sans demande
   explicite). */
#tcgCollectionPanel .tcg-page-inner,
#tcgFavoritesPanel .tcg-page-inner {
    display: block;
}

.tcg-binder-root {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
}

/* ═══════════════ HEADER — PROGRESSION GLOBALE (toute la collection) ═══════════════ */
.tcg-binder-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 18px;
    border: 1px solid var(--c-25);
    background: linear-gradient(180deg, var(--c-04), transparent);
}
.tcg-binder-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    font-size: 12px;
    color: var(--c-60);
    letter-spacing: 0.5px;
}
.tcg-binder-stats b { color: var(--c-90); font-weight: 700; }
.tcg-binder-progress-track {
    position: relative;
    height: 6px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--c-15);
    overflow: hidden;
}
.tcg-binder-progress-fill {
    position: absolute; inset: 0 auto 0 0;
    width: 0%;
    background: var(--c-full);
    box-shadow: 0 0 10px var(--c-full);
    transition: width 0.4s ease;
}
.tcg-binder-progress-pct {
    align-self: flex-end;
    font-size: 11px;
    color: var(--c-60);
    letter-spacing: 1px;
}

/* ═══════════════ ATELIER (recycler les doublons / fabriquer, voir tcg-binder.js) ═══════════════ */
.tcg-atelier {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 18px;
    border: 1px solid var(--c-25);
    border-left: 2px solid var(--c-full);
    background: var(--c-04);
}
.tcg-atelier[hidden], .tcg-atelier-modal[hidden] { display: none; }
.tcg-atelier-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 22px;
}
.tcg-atelier-balance { display: flex; flex-direction: column; gap: 2px; min-width: 150px; }
.tcg-atelier-balance span, .tcg-atelier-modal-head span { font-size: 10px; letter-spacing: 1.5px; color: var(--c-60); }
.tcg-atelier-balance b {
    font-family: 'Orbitron', monospace;
    font-size: 22px;
    color: var(--c-full);
    letter-spacing: 1px;
    text-shadow: 0 0 10px var(--c-40);
}
.tcg-atelier-offer { flex: 1 1 220px; font-size: 12px; color: var(--c-60); letter-spacing: 0.5px; }
.tcg-atelier-offer b { color: var(--c-90); }
.tcg-atelier-gain { color: var(--c-full); font-weight: 700; white-space: nowrap; }
.tcg-atelier-actions { display: flex; gap: 8px; }
.tcg-atelier-btn {
    background: var(--c-08);
    border: 1px solid var(--c-40);
    color: var(--c-full);
    font-family: inherit;
    font-size: 11px;
    letter-spacing: 1px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.tcg-atelier-btn:hover { background: var(--c-15); border-color: var(--c-full); }
.tcg-atelier-btn:disabled { opacity: 0.35; cursor: default; }
.tcg-atelier-btn:disabled:hover { background: var(--c-08); border-color: var(--c-40); }
.tcg-atelier-btn.is-confirm { background: var(--c-25); }
.tcg-atelier-btn.is-ghost { background: transparent; border-color: var(--c-25); color: var(--c-60); }
.tcg-atelier-help-btn {
    background: transparent;
    border: 1px solid var(--c-25);
    color: var(--c-60);
    font-family: inherit;
    width: 32px;
    cursor: pointer;
}
.tcg-atelier-help-btn[aria-expanded="true"] { color: var(--c-full); border-color: var(--c-40); }
.tcg-atelier-confirm {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px dashed var(--c-40);
}
.tcg-atelier-confirm p { flex: 1 1 100%; margin: 0; font-size: 12px; line-height: 1.5; color: var(--c-90); }
.tcg-atelier-confirm b { color: var(--c-full); }
.tcg-atelier-msg {
    font-size: 11px;
    color: var(--c-90);
    background: var(--c-08);
    border: 1px solid var(--c-25);
    padding: 6px 10px;
}
.tcg-atelier-msg.is-error { color: rgba(255, 80, 80, 0.9); background: rgba(255, 80, 80, 0.06); border-color: rgba(255, 80, 80, 0.3); }
.tcg-atelier-pending { font-size: 11px; color: var(--c-60); font-style: italic; }
.tcg-atelier-help { font-size: 11px; line-height: 1.6; color: var(--c-60); border-top: 1px solid var(--c-15); padding-top: 8px; }
.tcg-atelier-help p { margin: 0 0 4px; }
.tcg-atelier-help b { color: var(--c-90); }
/* Dans la fiche carte : sous le compteur de variantes */
.tcg-atelier-modal {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--c-15);
}
.tcg-atelier-modal-head { display: flex; align-items: baseline; gap: 8px; }
.tcg-atelier-modal-head b { font-family: 'Orbitron', monospace; font-size: 14px; color: var(--c-full); }
.tcg-atelier-modal .tcg-atelier-confirm { align-self: stretch; }
.tcg-binder-modal-craft {
    margin-left: auto;
    background: transparent;
    border: 1px solid var(--c-40);
    color: var(--c-full);
    font-family: inherit;
    font-size: 10px;
    letter-spacing: 1px;
    padding: 3px 8px;
    cursor: pointer;
}
.tcg-binder-modal-craft:hover { background: var(--c-15); }
.tcg-binder-modal-craft:disabled { opacity: 0.35; cursor: not-allowed; }
.tcg-binder-modal-craft:disabled:hover { background: transparent; }
@media (max-width: 600px) {
    /* TOUTES / POSSÉDÉES / MANQUANTES / FAVORIS / DOUBLONS : 404 px de large, débordait des
       deux côtés sur un téléphone (2026-11-07). Retour à la ligne, boutons étirés. */
    .tcg-binder-segmented { flex-wrap: wrap; max-width: 100%; }
    .tcg-binder-segmented button { flex: 1 1 auto; padding: 7px 8px; border-bottom: 1px solid var(--c-15); }
    .tcg-atelier { padding: 12px; }
    .tcg-atelier-actions { flex: 1 1 100%; }
    .tcg-atelier-actions .tcg-atelier-btn { flex: 1 1 auto; }
}

/* ═══════════════ NAV = TOURNE-PAGES (mode de navigation PRINCIPAL) ═══════════════ */
.tcg-binder-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
}
.tcg-binder-nav-arrow {
    background: transparent;
    border: 1px solid var(--c-25);
    color: var(--c-90);
    font-family: inherit;
    font-size: 12px;
    letter-spacing: 1px;
    line-height: 1;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.tcg-binder-nav-arrow:hover { background: var(--c-08); border-color: var(--c-40); }
.tcg-binder-nav-arrow:disabled { opacity: 0.3; cursor: default; }
.tcg-binder-nav-arrow:disabled:hover { background: transparent; border-color: var(--c-25); }
.tcg-binder-nav-label {
    font-family: 'Orbitron', monospace;
    font-size: 13px;
    letter-spacing: 2px;
    color: var(--c-full);
    min-width: 110px;
    text-align: center;
}

/* ═══════════════ FILTRES COMPACTS (dont le raccourci famille) ═══════════════ */
.tcg-binder-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    justify-content: center;
}
.tcg-binder-segmented {
    display: flex;
    border: 1px solid var(--c-25);
}
.tcg-binder-segmented button {
    background: transparent;
    border: none;
    border-right: 1px solid var(--c-15);
    color: var(--c-60);
    font-family: inherit;
    font-size: 11px;
    letter-spacing: 1px;
    padding: 6px 12px;
    cursor: pointer;
}
.tcg-binder-segmented button:last-child { border-right: none; }
.tcg-binder-segmented button.active { background: var(--c-15); color: var(--c-full); }
.tcg-binder-filters select {
    background: #050705;
    border: 1px solid var(--c-25);
    color: var(--c-90);
    font-family: inherit;
    font-size: 11px;
    letter-spacing: 1px;
    padding: 6px 10px;
    appearance: none;
    cursor: pointer;
}
/* Raccourci "aller a la famille X" — jamais un mode de nav independant, juste un saut vers la
   premiere double-page qui contient cette famille (voir retour utilisateur : ne doit PAS
   transformer une famille en collection isolee). */
.tcg-binder-filters select[data-role="family-jump"] { min-width: 150px; }
/* Sans min-width, le select se dimensionnait trop juste pour "Toutes raretés" (appearance:none
   retire aussi la réservation d'espace native pour la flèche) : le texte apparaissait tronqué
   (retour utilisateur 2026-09-30). */
#tcgBinderRarityFilter { min-width: 140px; }

/* ═══════════════ CADRE CLASSEUR — pleine largeur ═══════════════ */
.tcg-binder-frame {
    position: relative;
    display: flex;
    align-items: stretch;
    justify-content: center;
    width: 100%;
    gap: 0;
}
/* Flèches à même hauteur que les pages, visibles UNIQUEMENT quand on peut tourner dans ce sens
   (display:none posé en JS, voir render()) — évite de remonter jusqu'au bandeau du haut pour
   tourner (retour utilisateur 2026-09-30). Les boutons ← DOUBLE PAGE PRÉCÉDENTE / SUIVANTE → du
   haut restent (portent aussi le numéro de page), ce sont juste des raccourcis en plus. */
.tcg-binder-side-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--c-25);
    background: rgba(3, 5, 3, 0.75);
    color: var(--c-90);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.tcg-binder-side-arrow:hover { background: var(--c-15); border-color: var(--c-40); }
.tcg-binder-side-arrow.prev { left: 6px; }
.tcg-binder-side-arrow.next { right: 6px; }
.tcg-binder-page {
    flex: 1 1 0;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)); /* minmax(0,..) : 1fr ne descend pas sous la carte native 130 px -> colonnes inegales sur telephone (OnePlus Nord 5, 2026-11-07) */
    grid-auto-rows: min-content;
    align-content: start;
    gap: 22px 18px;
    padding: 26px;
    background: linear-gradient(160deg, #0a0d0a, #060806 60%);
    border: 1px solid var(--c-15);
    min-height: 320px;
}
.tcg-binder-page.left { border-radius: 6px 0 0 6px; box-shadow: inset -14px 0 24px -16px rgba(0,0,0,0.85); }
.tcg-binder-page.right { border-radius: 0 6px 6px 0; box-shadow: inset 14px 0 24px -16px rgba(0,0,0,0.85); }
.tcg-binder-page.empty { display: flex; align-items: center; justify-content: center; }
.tcg-binder-page.empty::after {
    content: 'FIN DE COLLECTION';
    font-family: 'Orbitron', monospace;
    font-size: 11px;
    letter-spacing: 3px;
    color: var(--c-15);
}
.tcg-binder-spine {
    flex: 0 0 26px;
    position: relative;
    background: linear-gradient(90deg, rgba(0,0,0,0.65), rgba(0,0,0,0.18) 25%, rgba(0,0,0,0.18) 75%, rgba(0,0,0,0.65));
    box-shadow: 0 0 18px 2px rgba(0,0,0,0.75) inset;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
}
/* Petits reliefs de reliure — touche decorative bon marche pour renforcer l'effet "vrai classeur". */
.tcg-binder-spine::before,
.tcg-binder-spine::after {
    content: '';
    width: 7px; height: 7px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #2a2f2a, #050705 75%);
    border: 1px solid rgba(255,255,255,0.06);
}

/* ═══════════════ SLOT (grille fixe uniforme — jamais de bloc/section par famille) ═══════════════ */
.tcg-binder-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    isolation: isolate;
}
/* Séparation des familles sans case ni ligne en plus (2026-10-19) : une famille sur deux a un fond
   teinté qui déborde jusqu'au milieu des gouttières (inset = moitié du gap de .tcg-binder-page),
   donc les cartes voisines d'une même famille forment un seul bloc ; la 1ère carte d'une famille
   porte un trait vertical à gauche, dans le prolongement de l'étiquette. Retour arrière = retirer
   ces règles + les classes fam-alt/fam-start dans renderSlot(). */
.tcg-binder-slot.fam-alt::before,
.tcg-binder-slot.fam-start::after {
    content: '';
    position: absolute;
    pointer-events: none;
}
.tcg-binder-slot.fam-alt::before {
    inset: -11px -9px;
    z-index: -1;
    background: var(--c-08);
}
.tcg-binder-slot.fam-start::after {
    top: 0; bottom: 0; left: -9px;
    width: 2px;
    margin-left: -1px;
    background: var(--c-60);
    box-shadow: 0 0 6px var(--c-40);
}
/* .tcg-card-mini-wrap est fixé à 130×182px dans tcg-card.css (transform:scale() n'y change rien à
   l'empreinte de mise en page). "Slot fixe, carte adaptable dedans" : la boîte du slot garde une
   forme FIXE (130:182, MÊME ratio que la carte elle-même) et centre son contenu.

   PIÈGE (2 tentatives CSS pur ratées, a NE PAS refaire — voir memoire projet) : ni
   `container-type:size` + `scale(min(cqw,cqh))`, ni ensuite `container-type:inline-size` +
   `scale(calc(100cqw/130px))` seul n'ont fonctionné dans le navigateur de test (cartes possédées
   restées à leur taille NATIVE 130×182 alors que les slots "???" voisins (qui n'utilisent aucune
   container query) affichaient correctement la vraie largeur de colonne, ex. 188×264) — les
   Container Queries CSS ne sont visiblement pas fiables dans cet environnement. Le scale est donc
   calculé en JS (mesure réelle via `getBoundingClientRect()`, voir `applyCardScale()` dans
   tcg-binder.js) et posé en style inline sur `.tcg-card-mini-wrap` — aucune dépendance à `cqw`/
   `container-type` ici. */
/* Le wrap (130 px fixes) est un élément flex : dans une case plus étroite que 130 (3 colonnes sur
   téléphone, OnePlus Nord 5, 2026-11-07), il se comprimait à la largeur de la case PUIS était encore
   réduit par applyCardScale() -> carte décalée et coupée à droite. Jamais comprimé : seul le scale
   l'adapte, centré dans la case. */
.tcg-binder-slot-card > .tcg-card-mini-wrap { flex-shrink: 0; }
.tcg-binder-slot-card {
    width: 100%;
    aspect-ratio: 130 / 182;
    overflow: hidden;
    border-radius: 6px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tcg-binder-slot-placeholder {
    width: 100%;
    aspect-ratio: 130 / 182;
    border: 1px solid var(--c-25);
    background: repeating-linear-gradient(135deg, #0a0c0a 0 8px, #060706 8px 16px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}
.tcg-binder-slot-placeholder-mark { font-size: 28px; color: var(--c-25); letter-spacing: 2px; }
.tcg-binder-slot-number {
    position: absolute; top: 6px; left: 8px;
    font-size: 10px; color: var(--c-40); letter-spacing: 1px;
}

/* Étiquette de famille — overlay ABSOLU sur le slot (jamais en flux normal : ne doit JAMAIS ajouter
   de hauteur, sinon les pastilles de rareté du slot suivant se désalignent verticalement dans la
   même rangée). N'apparaît que sur la 1ère carte d'une famille, à l'endroit exact où elle commence
   (milieu de ligne, milieu de page ou à cheval gauche/droite y compris) — jamais une section, un
   bloc ou une nouvelle ligne. */
.tcg-binder-family-tag {
    position: absolute;
    top: 4px; left: 4px;
    z-index: 2;
    font-family: 'Orbitron', monospace;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--c-full);
    background: rgba(3, 5, 3, 0.82);
    border: 1px solid var(--c-25);
    padding: 2px 5px;
    pointer-events: none;
    white-space: nowrap;
}
.tcg-binder-family-tag.highlighted {
    border-color: var(--c-full);
    box-shadow: 0 0 8px var(--c-full);
}

/* Étoile "carte favorite" — overlay ABSOLU en haut à DROITE (symétrique de la famille en haut à
   gauche), uniquement sur la grille du classeur, jamais dans la modal (voir appendFavoriteStar()). */
.tcg-binder-favorite-star {
    position: absolute;
    top: 4px; right: 4px;
    z-index: 2;
    font-size: 14px;
    line-height: 1;
    color: #ffd166;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.85), 0 0 6px rgba(255, 209, 102, 0.7);
    pointer-events: none;
}

/* Pastille "+N" doublons — overlay ABSOLU en bas à droite de la carte (voir appendDupesBadge()). */
.tcg-binder-dupes-badge {
    position: absolute;
    bottom: 4px; right: 4px;
    z-index: 2;
    padding: 1px 5px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid var(--c-full);
    color: var(--c-90);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.5px;
    pointer-events: none;
}

/* ═══════════════ PIPS DE RARETÉ ═══════════════ */
.tcg-binder-pips {
    display: flex;
    align-items: center;
    gap: 5px;
}
.tcg-binder-pip {
    position: relative;
    width: 11px; height: 11px;
    border-radius: 50%;
    border: 1.5px solid var(--c-40);
    background: transparent;
    padding: 0;
    cursor: default;
}
.tcg-binder-pip.exists { cursor: pointer; }
.tcg-binder-pip.owned { background: currentColor; border-color: currentColor; box-shadow: 0 0 6px currentColor; }
.tcg-binder-pip[data-rarity="commun"] { color: #bfc7bf; }
.tcg-binder-pip[data-rarity="rare"]   { color: #4fa3ff; }
.tcg-binder-pip[data-rarity="sr"]     { color: #b06bff; }
.tcg-binder-pip[data-rarity="ssr"]    { color: #d8b658; }
.tcg-binder-pip[data-rarity="ur"]     { color: #ff78dc; }
/* UR+ (= flag "chase" existant, voir memoire) : forme losange pour se distinguer visuellement
   d'un 6e pip rond, pas de nouveau palier de rareté reel. */
.tcg-binder-pip[data-rarity="urplus"] {
    border-radius: 2px; transform: rotate(45deg); color: #ffd166;
}
.tcg-binder-pip[data-rarity="urplus"].owned { box-shadow: 0 0 7px currentColor; }
/* LR (Legend Rare, 2026-11-18) : losange plus grand, couleurs --tcg-lr-* de tcg-card.css (rendu choisi au labo). */
.tcg-binder-pip[data-rarity="lr"] {
    width: 12px; height: 12px; border-radius: 2px; transform: rotate(45deg); color: var(--tcg-lr-b, #b9a4ff);
}
.tcg-binder-pip[data-rarity="lr"].owned {
    background: linear-gradient(135deg, var(--tcg-lr-a, #fff), var(--tcg-lr-b, #b9a4ff)); border-color: var(--tcg-lr-a, #fff);
    box-shadow: 0 0 9px var(--tcg-lr-glow, rgba(185,164,255,0.9));
}

/* ═══════════════ CARTE PLEINE TAILLE (modal) — mouvement au survol de la souris ═══════════════ */
/* Même logique de wrapper que .tcg-card-mini-wrap (tcg-card.css:339), scale différente et plus
   grande (retour utilisateur : la prévisu était trop petite) : 300×420 = 320×448 × 0.9375. Vit ici
   (pas dans tcg-card.css) car propre au binder, jamais utilisée par l'Ouverture. Le tilt souris
   (--pointer-x/y/--rotation-x/y + classe .manual) est câblé en JS dans tcg-binder.js et consomme
   les custom properties déjà définies par tcg-card.css — aucun CSS de tilt à ajouter ici. */
/* 380×500 > 300×420 (taille réelle de la carte rendue) : la marge sert à laisser respirer le glow
   des pulses sr/ssr/ssr/ur (box-shadow), qui se faisait couper net par overflow:hidden quand le
   cadre collait exactement à la carte (retour utilisateur : "le glow est pas visible car il
   déborde"). Centrage en flex -- voir .tcg-card-scale-wrap ci-dessous pour l'alignement exact. */
.tcg-card-full-wrap {
    width: 420px; height: 560px; border-radius: 13px; overflow: hidden; position: relative;
    display: flex; align-items: center; justify-content: center;
}
/* PIÈGE (tilt asymétrique -- marchait à droite, presque rien à gauche) : chaîner scale() ET
   rotateX()/rotateY() sur LE MÊME transform force les deux à partager le même transform-origin.
   Ancré "top left" (nécessaire, à l'époque, pour que le scale reste aligné pile dans une boîte de
   la MÊME taille que la carte rendue), la rotation pivotait donc depuis le bord GAUCHE de la carte
   au lieu de son centre -- le bord gauche, proche du pivot, bougeait à peine ; le bord droit, loin
   du pivot, bougeait fort. Fix : un wrapper .tcg-card-scale-wrap dédié au scale, pendant que
   .tcg-card garde SON transform de base intact (perspective+rotate, tcg-card.css, origin par
   défaut = centre, comme dans le labo) -- plus aucun override de transform-origin/transform ici.
   Origin repassé à "center" (défaut) maintenant que .tcg-card-full-wrap est plus grand que la
   carte et centre son contenu en flex : un scale ancré au centre garde la carte visuellement
   centrée dans sa propre boîte de mise en page (320×448), qui est elle-même ce que le flex du
   parent centre -- avec un ancrage "top left" les deux tailles (320×448 mise en page vs 300×420
   rendu) désynchronisent le centrage réel de quelques pixels. */
.tcg-card-scale-wrap {
    width: 320px; height: 448px;
    transform: scale(1.125);
    cursor: pointer;
    flex-shrink: 0;
}
/* La carte ne doit bouger QUE sous la souris, jamais toute seule (retour utilisateur explicite) --
   la règle de base .tcg-card lance pourtant tcgDrift (dérive idle) en permanence. On la coupe ici,
   sans toucher au pulse de bordure sr/ssr/ur (effet de glow séparé, pas du mouvement) en le
   reposant seul par palier -- spécificité (classe+classe+attribut) au-dessus des règles de base
   (classe+attribut), gagne quel que soit l'ordre des règles dans la feuille. */
.tcg-card-full-wrap .tcg-card { animation: none; }
/* Pulse repris avec un rayon de glow réduit de moitié (retour utilisateur : "trop fort" dans la
   modal) -- keyframes DÉDIÉES (pas srPulse/ssrPulse/urPulse de tcg-card.css, qui restent
   inchangées pour la grille/l'Ouverture), même couleurs/opacités, seul le blur-radius du premier
   box-shadow est divisé par 2 (le 2e calque, l'ombre portée noire statique, est inchangé -- ce
   n'est pas le pulse, juste le "lift" habituel de la carte). */
.tcg-card-full-wrap .tcg-card[data-rarity="sr"] { animation: srPulseModal 2.1s ease-in-out infinite; }
.tcg-card-full-wrap .tcg-card[data-rarity="ssr"] { animation: ssrPulseModal 1.8s ease-in-out infinite; }
.tcg-card-full-wrap .tcg-card[data-rarity="ur"] { animation: urPulseModal 1.4s ease-in-out infinite; }
/* Téléphone / tablette (pas de souris) — retour viewers 2026-11-07, captures d'un Galaxy A57 : les holos
   (pilotés par --pointer-x/y) restaient figés au centre tant qu'on ne touchait pas la carte, l'effet
   paraissait absent. La CARTE reste immobile (règle ci-dessus respectée : aucune rotation) ; seul le REFLET
   balaie la carte. Dès que le doigt la touche (.tilt-touch, tcg-binder.js), le doigt reprend la main. */
@keyframes tcgHoloSweepModal {
    0%, 100% { --pointer-x: 50%; --pointer-y: 50%; }
    25% { --pointer-x: 18%; --pointer-y: 24%; }
    50% { --pointer-x: 82%; --pointer-y: 76%; }
    75% { --pointer-x: 20%; --pointer-y: 72%; }
}
@media (hover: none) {
    .tcg-card-full-wrap .tcg-card:not(.tilt-touch) { animation: tcgHoloSweepModal 7s ease-in-out infinite; }
    .tcg-card-full-wrap .tcg-card[data-rarity="sr"]:not(.tilt-touch) { animation: tcgHoloSweepModal 7s ease-in-out infinite, srPulseModal 2.1s ease-in-out infinite; }
    .tcg-card-full-wrap .tcg-card[data-rarity="ssr"]:not(.tilt-touch) { animation: tcgHoloSweepModal 7s ease-in-out infinite, ssrPulseModal 1.8s ease-in-out infinite; }
    .tcg-card-full-wrap .tcg-card[data-rarity="ur"]:not(.tilt-touch) { animation: tcgHoloSweepModal 7s ease-in-out infinite, urPulseModal 1.4s ease-in-out infinite; }
}
@keyframes srPulseModal {
    0%, 100% { box-shadow: 0 0 9px rgba(176,107,255,0.5), 0 18px 40px rgba(0,0,0,0.6); }
    50%      { box-shadow: 0 0 17px rgba(176,107,255,0.95), 0 18px 40px rgba(0,0,0,0.6); }
}
@keyframes ssrPulseModal {
    0%, 100% { box-shadow: 0 0 10px rgba(216,182,88,0.55), 0 18px 40px rgba(0,0,0,0.6); }
    50%      { box-shadow: 0 0 20px rgba(253,243,200,0.95), 0 18px 40px rgba(0,0,0,0.6); }
}
@keyframes urPulseModal {
    0%, 100% { box-shadow: 0 0 12px rgba(255,120,220,0.55), 0 18px 40px rgba(0,0,0,0.6); }
    50%      { box-shadow: 0 0 25px rgba(160,220,255,0.95), 0 18px 40px rgba(0,0,0,0.6); }
}

/* ═══════════════ MODAL DE DÉTAIL ═══════════════ */
.tcg-binder-modal-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,0.82);
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.tcg-binder-modal-overlay[hidden] { display: none; }
.tcg-binder-modal {
    display: flex; gap: 32px;
    max-width: 1040px; width: 100%;
    background: #050705;
    border: 1px solid var(--c-25);
    box-shadow: 0 0 40px rgba(0,0,0,0.7);
    padding: 28px;
    position: relative;
}
.tcg-binder-modal-close {
    position: absolute; top: 10px; right: 10px;
    background: transparent; border: 1px solid var(--c-25); color: var(--c-90);
    width: 28px; height: 28px; cursor: pointer; font-size: 14px;
}
/* padding UNIFORME sur les 4 côtés = marge de "lancée" pour le tilt souris (retour utilisateur :
   avec un padding asymétrique haut/gauche seulement, impossible de vraiment "faire le tour" de la
   carte). wireModalTilt() (tcg-binder.js) suit le rectangle de CE wrapper, padding compris, donc la
   marge fait vraiment partie de la zone réactive, pas juste un espace visuel mort. +60px de
   max-width sur .tcg-binder-modal compense le padding-right ajouté pour ne pas rogner la colonne
   d'infos. */
.tcg-binder-modal-art-wrap { flex: 0 0 auto; padding: 50px; cursor: pointer; }
/* Tactile : le doigt posé sur la carte la fait pencher au lieu de faire défiler la page (voir
   wireModalTilt() dans tcg-binder.js). La marge autour garde le défilement normal. */
.tcg-binder-modal-art-wrap .tcg-card-full-wrap { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.tcg-binder-modal-art-wrap .tcg-card.tilt-release {
    transition: --pointer-x 0.45s ease-out, --pointer-y 0.45s ease-out, --rotation-x 0.45s ease-out, --rotation-y 0.45s ease-out;
}
.tcg-binder-modal-info { flex: 1 1 auto; display: flex; flex-direction: column; gap: 10px; min-width: 220px; }
.tcg-binder-modal-number { font-size: 11px; color: var(--c-40); letter-spacing: 2px; }
.tcg-binder-modal-name-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tcg-binder-modal-name { font-size: 22px; color: var(--c-full); letter-spacing: 2px; }
.tcg-binder-modal-favorite {
    display: flex; align-items: center; gap: 5px; cursor: pointer;
    font-size: 12px; letter-spacing: 1px; color: var(--c-40); user-select: none;
}
/* Sans ceci, l'attribut `hidden` posé par renderModal() (state.isOwnFiche false, ex. on consulte la
   fiche de quelqu'un d'autre) n'a AUCUN effet : `display:flex` ci-dessus vient d'une feuille auteur,
   qui bat toujours le `[hidden]{display:none}` du user-agent, même à spécificité égale — la case à
   cocher restait visible ET cliquable sur la fiche d'un autre agent (retour utilisateur 2026-09-30,
   bug de sécurité potentiel : cocherait un favori sur SON PROPRE compte avec une rareté/matériau
   qu'on ne possède pas forcément, voir garde jumelle dans onFavoriteCheckboxChange()). */
.tcg-binder-modal-favorite[hidden] { display: none; }
.tcg-binder-modal-favorite:has(input:checked) { color: #ffd166; }
.tcg-binder-modal-favorite input { accent-color: #ffd166; cursor: pointer; }
.tcg-binder-modal-favorite-error {
    font-size: 11px; color: rgba(255, 80, 80, 0.85);
    background: rgba(255, 80, 80, 0.06); border: 1px solid rgba(255, 80, 80, 0.3);
    padding: 5px 10px;
}
.tcg-binder-modal-family { font-size: 11px; color: var(--c-60); letter-spacing: 1px; }
.tcg-binder-modal-rarities { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.tcg-binder-modal-rarity-row {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; letter-spacing: 0.5px; color: var(--c-60);
    cursor: pointer; padding: 3px 0;
}
.tcg-binder-modal-rarity-row.owned { color: var(--c-90); }
.tcg-binder-modal-rarity-row.current {
    color: var(--c-full);
    background: var(--c-25);
    border-left: 2px solid var(--c-full);
    padding-left: 6px;
    font-weight: 700;
}
.tcg-binder-modal-rarity-mark { width: 14px; text-align: center; }
.tcg-binder-modal-rarity-count { color: var(--c-40); font-size: 10px; }
.tcg-binder-modal-rarity-dupes { color: var(--c-90); font-size: 10px; }
.tcg-binder-modal-rarity-dupes.is-none { color: var(--c-40); font-style: italic; }
.tcg-binder-modal-materials { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tcg-binder-modal-material-swatch {
    width: 18px; height: 18px; border-radius: 50%;
    border: 1.5px solid var(--c-40);
    background: linear-gradient(135deg, #333, #777);
    cursor: pointer;
}
/* Identité visuelle par matériau (miniatures des vrais gradients .tcg-shine/.tcg-chromefx de
   tcg-card.css) -- avant ce fix chaque matériau retombait sur le même rond gris générique
   ci-dessus, impossible à distinguer d'un simple coup d'oeil dans la modal. */
.tcg-binder-modal-material-swatch[data-material="cosmos"] { background: repeating-linear-gradient(82deg, #ff0080, #ff8c00, #40e0d0, #7b68ee, #ff0080); }
.tcg-binder-modal-material-swatch[data-material="iridescent"] { background: linear-gradient(135deg, #ff0080 0%, #ff8c00 14%, #40e0d0 28%, #7b68ee 42%, #ff0080 57%, #ff8c00 71%, #40e0d0 85%, #7b68ee 100%); }
.tcg-binder-modal-material-swatch[data-material="oklch"] { background: conic-gradient(from 45deg, oklch(0.8 0.12 60), oklch(0.7 0.15 180), oklch(0.8 0.12 300), oklch(0.8 0.12 60)); }
.tcg-binder-modal-material-swatch[data-material="glass"] { background: linear-gradient(115deg, rgba(180,255,255,0.55), rgba(255,255,255,0.85), rgba(255,180,255,0.55)); }
.tcg-binder-modal-material-swatch[data-material="liquidchrome"] { background: linear-gradient(180deg, #1c1e22 0%, #9aa1ab 50%, #1c1e22 100%); }
.tcg-binder-modal-material-swatch[data-material="cameleon"] { background: linear-gradient(100deg, hsl(0,65%,62%), hsl(60,65%,62%), hsl(120,65%,62%), hsl(200,65%,62%), hsl(280,65%,62%), hsl(340,65%,62%)); }
.tcg-binder-modal-material-swatch[data-material="confetti"] { background: conic-gradient(from 0deg, #ff0080, #ffd400, #40e0d0, #7b68ee, #ff0080); }
.tcg-binder-modal-material-swatch[data-material="goldultimate"] { background: linear-gradient(135deg, #7a5a1e 0%, #d8b658 22%, #fdf3c8 40%, #b8892f 55%, #fdf3c8 70%, #8a6521 88%); }
.tcg-binder-modal-material-swatch[data-material="shiny"] { background: repeating-linear-gradient(115deg, hsl(2,80%,72%) 0%, hsl(53,70%,75%) 12%, hsl(93,55%,75%) 24%, hsl(176,55%,78%) 36%, hsl(228,85%,80%) 48%, hsl(283,65%,78%) 60%, hsl(2,80%,72%) 72%); }
.tcg-binder-modal-material-swatch[data-material="standard"] { background: linear-gradient(135deg, #3a3a3a, #6a6a6a); }
.tcg-binder-modal-material-swatch.active { border-color: var(--c-full); box-shadow: 0 0 6px var(--c-full); }
/* Matériau atteignable à cette rareté mais pas encore obtenu : même miroir que les autres
   (le gradient reste reconnaissable) mais désaturé/assombri et non cliquable. */
.tcg-binder-modal-material-swatch.locked {
    filter: grayscale(1) brightness(0.5); opacity: 0.55; cursor: not-allowed;
}
/* Holo au choix (atelier, sa propre fiche, 2026-10-26) : pastilles nommées à la place des ronds.
   Obtenu = ✓, manquant = prix en fragments (rouge si pas assez), clic = aperçu sur la carte. */
.tcg-holo-head { flex: 1 1 100%; display: flex; flex-direction: column; gap: 2px; margin-bottom: 2px; }
.tcg-holo-head span { font-size: 10px; letter-spacing: 1.5px; color: var(--c-60); }
.tcg-holo-head em { font-style: normal; font-size: 11px; color: var(--c-40); }
.tcg-holo-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 9px 4px 5px;
    background: transparent;
    border: 1px solid var(--c-25);
    border-radius: 999px;
    color: var(--c-90);
    font-family: inherit; font-size: 11px; letter-spacing: 0.5px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.tcg-holo-pill .tcg-binder-modal-material-swatch { width: 14px; height: 14px; flex: 0 0 auto; cursor: inherit; }
.tcg-holo-pill:hover { background: var(--c-08); border-color: var(--c-60); }
.tcg-holo-pill.active { border-color: var(--c-full); box-shadow: 0 0 6px var(--c-40); }
.tcg-holo-pill.is-missing { border-style: dashed; color: var(--c-60); }
.tcg-holo-pill.is-missing .tcg-binder-modal-material-swatch { filter: grayscale(1) brightness(0.6); opacity: 0.6; }
.tcg-holo-pill.is-missing:hover .tcg-binder-modal-material-swatch { filter: none; opacity: 1; }
.tcg-holo-pill.is-preview { border-style: solid; border-color: var(--c-full); color: var(--c-full); background: var(--c-15); box-shadow: 0 0 8px var(--c-40); }
.tcg-holo-pill.is-preview .tcg-binder-modal-material-swatch { filter: none; opacity: 1; }
.tcg-holo-pill-mark { color: var(--c-full); font-size: 10px; }
.tcg-holo-pill-cost { font-family: 'Orbitron', monospace; font-size: 10px; color: var(--c-full); }
.tcg-holo-pill.is-short .tcg-holo-pill-cost { color: rgba(255, 80, 80, 0.85); }
.tcg-holo-pill:disabled { opacity: 0.4; cursor: wait; }
.tcg-atelier-short, .tcg-atelier-after { display: block; margin-top: 4px; font-size: 11px; }
.tcg-atelier-short { color: rgba(255, 80, 80, 0.9); }
.tcg-atelier-after { color: var(--c-60); }
/* Carte de la fiche montrée avec un holo pas encore possédé (aperçu avant fabrication). */
.tcg-binder-modal-art-wrap { position: relative; }
.tcg-binder-modal-art-wrap.is-preview::before {
    content: 'APERÇU · HOLO NON POSSÉDÉ';
    position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
    z-index: 2; white-space: nowrap;
    padding: 3px 10px;
    font-size: 10px; letter-spacing: 1.5px;
    color: var(--c-full);
    background: rgba(0, 0, 0, 0.75);
    border: 1px dashed var(--c-60);
    pointer-events: none;
}
@media (max-width: 760px) { .tcg-binder-modal-art-wrap.is-preview::before { top: 2px; } }
.tcg-binder-modal-count { font-size: 11px; color: var(--c-40); margin-top: 8px; }

/* ═══════════════ RESPONSIVE ═══════════════ */
/* En dessous de 760px il n'y a plus la place pour 2 pages + reliure lisiblement -> une seule page
   a la fois (le tourne-pages avance alors page par page au lieu de double-page par double-page,
   voir isMobileSingle()/changePage() dans tcg-binder.js). Au-dessus, tout reste fluide en continu
   (aucun palier de taille de carte a gerer ici : voir .tcg-binder-slot-card ci-dessus). */
@media (max-width: 760px) {
    /* Une seule page affichée : le pager avance page par page, "DOUBLE" était faux (2026-11-07). */
    .tcg-pager-dbl { display: none; }
    /* Flèches latérales ‹ › : posées sur la page, elles recouvraient une carte (capture OnePlus Nord 5) et
       font doublon avec PAGE PRÉCÉDENTE / SUIVANTE juste au-dessus. */
    .tcg-binder-side-arrow { display: none; }
    .tcg-binder-spine { display: none; }
    .tcg-binder-page.right { display: none; }
    .tcg-binder-page.left { border-radius: 6px; box-shadow: none; }
    .tcg-binder-page { padding: 18px; }
}
@media (max-width: 420px) {
    .tcg-binder-page { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px; gap: 16px 12px; }
    .tcg-binder-slot.fam-alt::before { inset: -8px -6px; }
    .tcg-binder-slot.fam-start::after { left: -6px; }
}
/* Modal agrandi le 2026-10-23 (carte 300x420 -> 360x504, cadre 380x500 -> 420x560) : les images
   sources font 500 a 1900 px de large, la fenetre d'illustration reste bien en dessous. Ecran peu
   haut (portable 768 px) : on revient a l'ancienne taille pour que le modal tienne sans couper. */
@media (max-height: 760px) and (min-width: 601px) {
    .tcg-binder-modal { max-width: 960px; }
    .tcg-card-full-wrap { width: 380px; height: 500px; }
    .tcg-card-scale-wrap { transform: scale(0.9375); }
}
@media (max-width: 600px) {
    .tcg-binder-modal { flex-direction: column; }
    .tcg-binder-modal-art-wrap { padding: 24px; }
    .tcg-card-full-wrap { width: 268px; height: 356px; }
    .tcg-card-scale-wrap { transform: scale(0.6875); }
}

/* ═══════════════ Effet "page qui tourne" (voir flipPages() dans tcg-binder.js) ═══════════════
   Couches temporaires posées sur le cadre pendant l'animation, jamais cliquables ; supprimées ensuite. */
.tcg-binder-flip-wrap { position: absolute; inset: 0; perspective: 2400px; pointer-events: none; z-index: 3; }
.tcg-binder-flip-static, .tcg-binder-flip-leaf, .tcg-binder-flip-cast { position: absolute; pointer-events: none; }
.tcg-binder-flip-leaf { transform-style: preserve-3d; will-change: transform, opacity; }
.tcg-binder-flip-face { position: absolute; inset: 0; overflow: hidden; }
.tcg-binder-flip-face.back { transform: rotateY(180deg); }
.tcg-binder-flip-face > .tcg-binder-page, .tcg-binder-flip-static > .tcg-binder-page {
    position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; box-sizing: border-box;
}
.tcg-binder-flip-static { overflow: hidden; }
.tcg-binder-flip-shade { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.tcg-binder-flip-cast { opacity: 0; }
/* Chaque couche de l'animation est un contexte d'empilement ISOLÉ : sans ça, les éléments de page qui portent un z-index
   (étiquettes de famille DOOM, F.E.A.R...) échappaient à leur couche et se peignaient au-dessus de la feuille qui tourne,
   immobiles. */
.tcg-binder-flip-static, .tcg-binder-flip-leaf, .tcg-binder-flip-face, .tcg-binder-flip-cast { isolation: isolate; z-index: 0; }

/* Zoom seul d'une carte (Cartes favorites, TcgBinder.openFavorite) : la carte, rien d'autre. 2026-11-10 */
.tcg-binder-modal-overlay.is-card-only .tcg-binder-modal-info { display: none; }
.tcg-binder-modal-overlay.is-card-only .tcg-binder-modal { width: auto; max-width: none; padding: 0; gap: 0; background: transparent; border: none; box-shadow: none; }
.tcg-binder-modal-overlay.is-card-only .tcg-binder-modal-close { top: 18px; right: 18px; z-index: 6; background: rgba(0, 0, 0, 0.6); }
/* Zoom seul plus grand (retour user 2026-11-10 "agrandir le zoom") : la carte grandit selon la hauteur
   d'ecran disponible (le tilt suit le rectangle reel, il reste juste). Telephone inchange. */
@media (min-width: 700px) and (min-height: 760px) {
    .tcg-binder-modal-overlay.is-card-only .tcg-card-full-wrap { width: 500px; height: 680px; }
    .tcg-binder-modal-overlay.is-card-only .tcg-card-scale-wrap { transform: scale(1.38); }
    .tcg-binder-modal-overlay.is-card-only .tcg-binder-modal-art-wrap { padding: 30px; }
}
@media (min-width: 700px) and (min-height: 940px) {
    .tcg-binder-modal-overlay.is-card-only .tcg-card-full-wrap { width: 580px; height: 790px; }
    .tcg-binder-modal-overlay.is-card-only .tcg-card-scale-wrap { transform: scale(1.62); }
}

/* ── Fluidite (2026-11-25) : carte de la grille hors champ, ou grille cachee derriere la fiche d'une carte = animations en pause
   (l'effet reste visible, immobile). Pilote par buildMiniCard() / openModal() de tcg-binder.js. ── */
.tcg-card-mini-wrap.is-idle .tcg-card, .tcg-card-mini-wrap.is-idle .tcg-card::before, .tcg-card-mini-wrap.is-idle .tcg-card::after,
.tcg-card-mini-wrap.is-idle .tcg-card *, .tcg-card-mini-wrap.is-idle .tcg-card *::before, .tcg-card-mini-wrap.is-idle .tcg-card *::after,
html.tcg-modal-open .tcg-card-mini-wrap .tcg-card, html.tcg-modal-open .tcg-card-mini-wrap .tcg-card::before, html.tcg-modal-open .tcg-card-mini-wrap .tcg-card::after,
html.tcg-modal-open .tcg-card-mini-wrap .tcg-card *, html.tcg-modal-open .tcg-card-mini-wrap .tcg-card *::after { animation-play-state: paused !important; }
/* survol a la souris : la carte reprend */
@media (hover: hover) { html:not(.tcg-modal-open) .tcg-card-mini-wrap:hover .tcg-card, html:not(.tcg-modal-open) .tcg-card-mini-wrap:hover .tcg-card * { animation-play-state: running !important; } }
