/*
Rendu visuel des cartes TCG — porté depuis card-tcg-lab.html (bordures de rareté animées + les 9
matériaux holo actifs). Port volontaire, pas un module partagé : le labo reste un outil de test
autonome, le site a sa propre copie adaptée (voir plan d'implémentation du 2026-09-26 et mémoire
projet card-tcg-expansion — cohérent avec le fait que ce projet a déjà plusieurs copies divergentes
du système de carte, ex. overlay-card.html/card-texture-system/showcase site).

Adaptations par rapport à la source :
- 7 des 16 matériaux du labo (Holo, Prisme, Secret Gold, Radiant, Rainbow, Amazing Rare, Gravé)
  sont volontairement absents ici (décision déjà actée : gardés en réserve, pas encore portés).
- Chemins d'assets recalculés depuis web/ (un niveau sous la racine du repo) : `../card-texture-system/
  assets/...` — À REVÉRIFIER à l'implémentation réelle du déploiement (l'arborescence uploadée sur
  l'hébergement OVH peut différer, voir docs/tcg-booster-stream-site-sync.md).
- Pas de sélecteurs manuels de rareté/matériau (harnais de test du labo) : ici, `data-rarity` et
  `data-material` sont posés par JS (web/personnage.js) depuis les VRAIES données d'une carte tirée
  (reveal.php/collection.php), jamais choisis à la main.
*/

/* Déclarations Houdini indispensables : sans elles le navigateur ne peut PAS interpoler ces
   custom properties dans les animations (pointer/rotation/anneau de bordure) — il saute
   brutalement d'une valeur de keyframe à l'autre au lieu d'une transition fluide. Oubliées lors
   du premier port, cause du "ça saute" signalé sur les effets ET les bordures animées SR/UR. */
@property --pointer-x  { syntax: '<percentage>'; inherits: true; initial-value: 50%; }
@property --pointer-y  { syntax: '<percentage>'; inherits: true; initial-value: 50%; }
@property --rotation-x { syntax: '<angle>';      inherits: true; initial-value: 0deg; }
@property --rotation-y { syntax: '<angle>';      inherits: true; initial-value: 0deg; }
@property --border-angle { syntax: '<angle>';    inherits: false; initial-value: 0deg; }

/* ═══════════════ CARTE TCG ═══════════════ */
.tcg-card {
    position: relative; width: 320px; height: 448px; border-radius: 16px;
    background: #0b0d12; overflow: hidden;
    transform: perspective(1000px) rotateX(var(--rotation-x)) rotateY(var(--rotation-y));
    animation: tcgDrift 8s ease-in-out infinite;
    --pointer-x: 50%; --pointer-y: 50%; --rotation-x: 0deg; --rotation-y: 0deg;
}
.tcg-card.manual { animation: none; }
@keyframes tcgDrift {
    0%, 8%, 92%, 100% { --pointer-x: 50%; --pointer-y: 50%; --rotation-x: 0deg; --rotation-y: 0deg; }
    30% { --pointer-x: 22%; --pointer-y: 28%; --rotation-x: 4deg; --rotation-y: -5deg; }
    54% { --pointer-x: 78%; --pointer-y: 74%; --rotation-x: -4deg; --rotation-y: 5deg; }
    76% { --pointer-x: 18%; --pointer-y: 68%; --rotation-x: -3deg; --rotation-y: -5deg; }
}

.tcg-back {
    position: absolute; inset: 0; z-index: 7; border-radius: inherit;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 50% 40%, #1c2030 0%, #0a0c14 70%);
    background-image: repeating-linear-gradient(125deg, rgba(255,255,255,0.035) 0 2px, transparent 2px 16px),
        radial-gradient(circle at 50% 40%, #1c2030 0%, #0a0c14 70%);
    opacity: 0; transition: opacity 0.3s ease;
}
.tcg-back-mark { font-family: inherit; font-weight: 900; font-size: 46px; letter-spacing: 2px; color: rgba(255,255,255,0.14); }
.tcg-card.previewing .tcg-back { opacity: 1; }
.tcg-card.previewing .tcg-artwin, .tcg-card.previewing .tcg-plate { opacity: 0; }

.tcg-wipe {
    position: absolute; inset: 0; z-index: 9; pointer-events: none; border-radius: inherit;
    background: linear-gradient(100deg, transparent 42%, rgba(255,255,255,0.95) 50%, transparent 58%);
    opacity: 0;
}
.tcg-card.wiping .tcg-wipe { animation: wipeSweep 0.5s ease-out forwards; }
.tcg-card.wiping .tcg-back { opacity: 0; }
.tcg-card.wiping .tcg-artwin, .tcg-card.wiping .tcg-plate,
.tcg-card:not(.previewing):not(.wiping) .tcg-artwin, .tcg-card:not(.previewing):not(.wiping) .tcg-plate { opacity: 1; }
@keyframes wipeSweep {
    0%   { opacity: 0; transform: translateX(-60%); }
    15%  { opacity: 1; }
    60%  { opacity: 1; }
    100% { opacity: 0; transform: translateX(60%); }
}

.tcg-artwin {
    position: absolute; top: 16px; left: 16px; right: 16px; height: 300px;
    border-radius: 10px; overflow: hidden; border: 2px solid rgba(255,255,255,0.18);
    background: #000; transition: opacity 0.35s ease, border-color 0.35s ease;   /* plus "all" : la fenetre s'animait de 300 px a pleine carte en passant a une UR (2026-11-19) */
}
.tcg-card img.tcg-img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; display: block; }
/* Recadrages par illustration (data-art posé par buildMiniCard() dans tcg-binder.js à partir du
   cardKey, ex. "boss.videur2" -> "videur2") — mêmes clés et mêmes valeurs que card-tcg-lab.html/
   cardshowoff.html, jamais portées ici avant. object-position seul ne suffit pas si le cover est
   déjà calé sur la largeur (pas de marge horizontale) : scale agrandit l'image pour créer cette
   marge, ce qui rend le décalage horizontal réellement visible. */
/* Recadrages par illustration : deplaces dans web/tcg-crops.js (outil recadrer-cartes.bat, 2026-11-10). */

.tcg-family {
    position: absolute; top: 24px; left: 24px; z-index: 7;
    font-family: 'Share Tech Mono', monospace; font-size: 8.5px; font-weight: 700; letter-spacing: 1.2px;
    color: rgba(255,255,255,0.85); background: rgba(0,0,0,0.55);
    padding: 3px 7px; border-radius: 4px; border: 1px solid rgba(255,255,255,0.15);
    pointer-events: none; text-transform: uppercase;
}
.tcg-card[data-fullart="1"] .tcg-family { top: 14px; left: 14px; }
.tcg-plate {
    position: absolute; left: 16px; right: 16px; bottom: 16px; height: 80px;
    border-radius: 8px; background: rgba(10,12,18,0.9);
    display: flex; align-items: center; justify-content: space-between; padding: 0 14px;
    border: 1px solid rgba(255,255,255,0.1); transition: opacity 0.35s ease, background-color 0.35s ease, border-color 0.35s ease; z-index: 6;
}
.tcg-name { font-weight: 900; letter-spacing: 1.5px; font-size: 15px; text-transform: uppercase; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.tcg-sub { display: block; font-size: 10px; letter-spacing: 1px; font-weight: 400; color: rgba(230,235,240,0.55); margin-top: 2px; }
/* Credit artiste (2026-10-23) : dans le cadre du bas, sous la rarete. Avant il suivait la famille dans le
   badge du haut, ou le numero de collection le recouvrait. Cadre passe de 68 a 80 px (UR : 96 a 104). */
.tcg-name { min-width: 0; }
.tcg-artist { display: block; margin-top: 4px; font-family: 'Share Tech Mono', monospace; font-size: 9px; font-weight: 400;
    letter-spacing: 1px; color: rgba(230,235,240,0.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: none; }
.tcg-artist:empty { display: none; }
.tcg-pip { font-family: 'Orbitron', monospace; font-weight: 900; font-size: 19px; line-height: 1; flex-shrink: 0; color: #9a9a9a; text-shadow: 0 0 6px rgba(0,0,0,0.5); }
.tcg-pip-group { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
/* Signature UR/Chase (card-tcg-lab.html:1053-1062, jamais porté au premier jet du site) : ◈ à
   droite du N, invisible sauf en UR — blanc sur une UR classique, doré sur une Chase. */
.tcg-chase-mark { display: none; font-size: 13px; line-height: 1; }
.tcg-card[data-rarity="ur"] .tcg-chase-mark {
    display: inline; color: #f2f5f8; text-shadow: 0 0 6px rgba(255,255,255,0.75);
}
.tcg-card[data-rarity="ur"][data-chase="1"] .tcg-chase-mark {
    color: #ffd700; text-shadow: 0 0 8px rgba(255,215,0,0.85);
}

.tcg-card[data-fullart="1"] .tcg-artwin { top: 0; left: 0; right: 0; height: 100%; border-radius: 16px; border: none; }
.tcg-card[data-fullart="1"] .tcg-plate {
    top: auto; left: 0; right: 0; bottom: 0; height: 104px; border-radius: 0;
    background: linear-gradient(180deg, transparent, rgba(4,5,8,0.55) 40%, rgba(4,5,8,0.92));
    border: none; align-items: flex-end; padding: 0 18px 12px;
}

/* ═══════════════ RARETÉ ═══════════════ */
/* Adaptation : le labo utilise la clé anglaise "common" en interne (seul le LIBELLÉ affiché est
   en français) — ici "commun" directement, pour matcher tel quel le champ `rarity` déjà renvoyé
   en français par tout notre pipeline (tcg-draw-engine.js, reveal.php, collection.php) sans
   traduction supplémentaire côté JS. */
.tcg-card[data-rarity="commun"] { border: 2px solid #8d8d8d; box-shadow: 0 18px 40px rgba(0,0,0,0.6); }
.tcg-card[data-rarity="commun"] .tcg-pip { color: #9a9a9a; text-shadow: 0 0 6px rgba(0,0,0,0.5); }

.tcg-card[data-rarity="rare"] { border: 3px solid #4fa3ff; box-shadow: 0 0 22px rgba(79,163,255,0.45), 0 18px 40px rgba(0,0,0,0.6); }
.tcg-card[data-rarity="rare"] .tcg-pip { color: #4fa3ff; text-shadow: 0 0 8px #4fa3ff; }

.tcg-card[data-rarity="sr"] { border: 3px solid #b06bff; animation: tcgDrift 8s ease-in-out infinite, srPulse 2.1s ease-in-out infinite; }
@keyframes srPulse {
    0%, 100% { box-shadow: 0 0 18px rgba(176,107,255,0.5), 0 18px 40px rgba(0,0,0,0.6); }
    50%      { box-shadow: 0 0 34px rgba(176,107,255,0.95), 0 18px 40px rgba(0,0,0,0.6); }
}
.tcg-card[data-rarity="commun"][data-fullart="0"] .tcg-artwin { top: 14px; left: 14px; right: 14px; }
.tcg-card[data-rarity="commun"][data-fullart="0"] .tcg-plate { left: 14px; right: 14px; bottom: 14px; }
.tcg-card[data-rarity="rare"][data-fullart="0"] .tcg-artwin,
.tcg-card[data-rarity="sr"][data-fullart="0"] .tcg-artwin { top: 13px; left: 13px; right: 13px; }
.tcg-card[data-rarity="rare"][data-fullart="0"] .tcg-plate,
.tcg-card[data-rarity="sr"][data-fullart="0"] .tcg-plate { left: 13px; right: 13px; bottom: 13px; }
.tcg-card[data-rarity="sr"] .tcg-pip {
    background: conic-gradient(#b06bff, #ff9df5, #b06bff);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    text-shadow: 0 0 10px #b06bff;
}
.tcg-card[data-rarity="sr"] .tcg-corner { border-color: #b06bff; }

.tcg-card[data-rarity="ssr"] { animation: tcgDrift 8s ease-in-out infinite, ssrPulse 1.8s ease-in-out infinite; }
.tcg-card[data-rarity="ssr"]::after {
    content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 4px;
    background: conic-gradient(from var(--border-angle), #7a5a1e, #fdf3c8, #d8b658, #fdf3c8, #7a5a1e);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
    animation: borderRotate 3.5s linear infinite; z-index: 9; pointer-events: none;
}
@keyframes ssrPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(216,182,88,0.55), 0 18px 40px rgba(0,0,0,0.6); }
    50%      { box-shadow: 0 0 40px rgba(253,243,200,0.95), 0 18px 40px rgba(0,0,0,0.6); }
}
.tcg-card[data-rarity="ssr"] .tcg-pip {
    background: conic-gradient(from var(--border-angle), #7a5a1e, #fdf3c8, #d8b658, #fdf3c8);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    text-shadow: 0 0 12px #d8b658;
}
@keyframes borderRotate { to { --border-angle: 360deg; } }

.tcg-card[data-rarity="ur"] { animation: tcgDrift 8s ease-in-out infinite, urPulse 1.4s ease-in-out infinite; }
.tcg-card[data-rarity="ur"]::after {
    content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 4px;
    background: conic-gradient(from var(--border-angle), #ff5f5f, #ffd15f, #7dff8a, #5fd4ff, #b45fff, #ff5f5f);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
    animation: borderRotate 2s linear infinite; z-index: 9; pointer-events: none;
}
@keyframes urPulse {
    0%, 100% { box-shadow: 0 0 24px rgba(255,120,220,0.55), 0 18px 40px rgba(0,0,0,0.6); }
    50%      { box-shadow: 0 0 50px rgba(160,220,255,0.95), 0 18px 40px rgba(0,0,0,0.6); }
}
.tcg-card[data-rarity="ur"] .tcg-pip {
    background: conic-gradient(from var(--border-angle), #ff5f5f, #ffd15f, #7dff8a, #5fd4ff, #b45fff, #ff5f5f);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    text-shadow: 0 0 14px #fff;
}
.tcg-card[data-rarity="ur"] .tcg-ursweep {
    content: ''; position: absolute; inset: 0; z-index: 8; pointer-events: none;
    background: linear-gradient(100deg, transparent 40%, rgba(255,255,255,0.5) 50%, transparent 60%);
    background-size: 250% 250%; mix-blend-mode: overlay;
    animation: urSweep 3.2s linear infinite;
}
@keyframes urSweep { 0% { background-position: 120% -20%; } 100% { background-position: -20% 120%; } }

.tcg-corner { display: none; position: absolute; width: 20px; height: 20px; border: 2px solid; z-index: 9; pointer-events: none; }
.tcg-card[data-rarity="sr"] .tcg-corner { display: block; }
.tcg-corner.tl { top: 6px; left: 6px; border-right: none; border-bottom: none; border-top-left-radius: 6px; }
.tcg-corner.tr { top: 6px; right: 6px; border-left: none; border-bottom: none; border-top-right-radius: 6px; }
.tcg-corner.bl { bottom: 6px; left: 6px; border-right: none; border-top: none; border-bottom-left-radius: 6px; }
.tcg-corner.br { bottom: 6px; right: 6px; border-left: none; border-top: none; border-bottom-right-radius: 6px; }

/* ═══════════════ MATÉRIAUX HOLO (9 actifs — 7 restent en réserve, non portés) ═══════════════ */
.tcg-shine, .tcg-glare { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; }
.tcg-chromefx { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; background: #808080; }
.tcg-confetti-canvas { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; width: 100%; height: 100%; }

.tcg-card[data-material="cosmos"] .tcg-shine {
    opacity: 0.5;
    background-image: url('../card-texture-system/assets/glitter.png'), repeating-linear-gradient(82deg, #ff0080, #ff8c00, #40e0d0, #7b68ee, #ff0080);
    background-size: cover, 250% 250%; background-position: var(--pointer-x) var(--pointer-y), var(--pointer-x) var(--pointer-y);
    background-blend-mode: soft-light; filter: brightness(1) contrast(1.15) saturate(1.2); mix-blend-mode: color-burn;
}
.tcg-card[data-material="iridescent"] .tcg-shine {
    opacity: 0.45;
    background: linear-gradient(135deg, #ff0080 0%, #ff8c00 14%, #40e0d0 28%, #7b68ee 42%, #ff0080 57%, #ff8c00 71%, #40e0d0 85%, #7b68ee 100%);
    background-size: 400% 400%; background-position: var(--pointer-x) var(--pointer-y); mix-blend-mode: color-dodge; filter: brightness(0.95) saturate(1.05);
}
.tcg-card[data-material="oklch"] .tcg-shine {
    opacity: 0.95;
    background: linear-gradient(115deg, transparent 20%, oklch(0.7 0.15 200) 45%, oklch(0.75 0.18 320) 55%, transparent 80%),
        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));
    background-size: 200% 200%, cover; background-position: var(--pointer-x) var(--pointer-y), center;
    mix-blend-mode: color-dodge; filter: brightness(0.85) contrast(1.4);
}
/* backdrop-filter retiré (rendait la carte carrément invisible dans le classeur/modal) : combiné à
   un ancêtre .tcg-card qui porte lui-même un transform 3D (perspective+rotate+scale, tilt +
   redimensionnement mini/full-wrap), le backdrop-filter sur un enfant devient instable selon le
   moteur de rendu -- il n'existait pas dans ce contexte au moment du portage depuis card-tcg-lab.html
   (carte affichée à taille native, un seul transform simple perspective+rotate, jamais chaîné à un
   scale() supplémentaire). Le look glass reste porté par .tcg-shine/.tcg-glare ci-dessous. */
.tcg-card[data-material="glass"] .tcg-artwin { background: linear-gradient(160deg, rgba(255,255,255,0.10), rgba(255,255,255,0.02)); }
.tcg-card[data-material="glass"] .tcg-shine {
    opacity: 0.85;
    background: linear-gradient(115deg, transparent 25%, rgba(180,255,255,0.4) 45%, rgba(255,255,255,0.5) 50%, rgba(255,180,255,0.4) 55%, transparent 75%);
    background-size: 220% 220%; background-position: var(--pointer-x) var(--pointer-y); mix-blend-mode: overlay;
}
.tcg-card[data-material="glass"] .tcg-glare {
    opacity: 0.5;
    background: linear-gradient(115deg, transparent 42%, rgba(255,255,255,0.7) 50%, transparent 58%);
    background-size: 320% 320%; background-position: var(--pointer-x) var(--pointer-y); mix-blend-mode: soft-light; filter: blur(2px);
}
.tcg-card[data-material="liquidchrome"] .tcg-shine {
    opacity: 0.4; background: linear-gradient(180deg, #1c1e22 0%, #4d525a 50%, #1c1e22 100%);
    mix-blend-mode: soft-light; filter: url(#liquidChrome);
}
.tcg-card[data-material="liquidchrome"] .tcg-chromefx { opacity: 0.8; mix-blend-mode: overlay; filter: url(#chromeLight) url(#liquidChrome); }
.tcg-card[data-material="cameleon"] .tcg-shine {
    opacity: 0.9;
    background-image: url('../card-texture-system/assets/glitter.png'),
        linear-gradient(100deg, hsl(0,20%,55%), hsl(60,20%,55%), hsl(120,20%,55%), hsl(200,20%,55%), hsl(280,20%,55%), hsl(340,20%,55%), hsl(0,20%,55%));
    background-size: cover, 300% 300%; background-position: center, var(--pointer-x) var(--pointer-y);
    background-blend-mode: soft-light; mix-blend-mode: overlay; filter: saturate(3) hue-rotate(calc(var(--rotation-y, 0deg) * 4));
}
.tcg-card[data-material="cameleon"] .tcg-glare {
    opacity: 1; background: radial-gradient(circle at var(--pointer-x) var(--pointer-y), rgba(255,255,255,0.08), rgba(0,0,0,0.02) 100%);
}
.tcg-card[data-material="confetti"] .tcg-glare {
    opacity: 1; background: radial-gradient(circle at var(--pointer-x) var(--pointer-y), rgba(255,255,255,0.08), rgba(0,0,0,0.02) 100%);
}
.tcg-card[data-material="confetti"] .tcg-confetti-canvas { opacity: 1; }
.tcg-card[data-material="goldultimate"] { box-shadow: inset 0 0 0 2px rgba(255,230,150,0.5), inset 0 2px 3px rgba(255,255,255,0.3), inset 0 -2px 4px rgba(0,0,0,0.5); }
.tcg-card[data-material="goldultimate"] .tcg-shine {
    opacity: 0.4;
    background: linear-gradient(135deg, #7a5a1e 0%, #d8b658 22%, #fdf3c8 40%, #b8892f 55%, #fdf3c8 70%, #8a6521 88%, #d8b658 100%);
    background-size: 260% 260%; background-position: var(--pointer-x) var(--pointer-y);
    mix-blend-mode: screen; filter: brightness(0.95) saturate(1.3) contrast(1.05);
}
.tcg-card[data-material="goldultimate"] .tcg-glare {
    opacity: 0.5; background: radial-gradient(circle at var(--pointer-x) var(--pointer-y), rgba(255,250,220,0.7), transparent 65%); mix-blend-mode: soft-light;
}
.tcg-card[data-material="shiny"] .tcg-shine {
    opacity: 0.85;
    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%);
    background-size: 220% 220%; background-position: var(--pointer-x) var(--pointer-y);
    mix-blend-mode: soft-light; filter: brightness(1.1) saturate(1.3);
}
.tcg-card[data-material="shiny"] .tcg-shine::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(100deg, transparent 40%, rgba(255,255,255,0.6) 50%, transparent 60%);
    background-size: 300% 300%; mix-blend-mode: overlay;
    animation: shinySweep 3.4s linear infinite;
}
@keyframes shinySweep { 0% { background-position: 140% -40%; } 100% { background-position: -40% 140%; } }
.tcg-card[data-material="shiny"] .tcg-glare {
    opacity: 0.5;
    background: radial-gradient(farthest-corner circle at var(--pointer-x) var(--pointer-y),
        rgba(255,255,255,0.85) 0%, rgba(255,255,255,0.2) 30%, transparent 70%);
    mix-blend-mode: overlay;
}

/* ═══════════════ STAGE PARTAGÉ (pile de cartes, payoff burst/sparks) ═══════════════ */
.pack-stage { position: relative; width: 320px; height: 448px; margin: 0 auto; }
.stack-card {
    position: absolute; left: 0; top: 0; width: 320px; height: 448px;
    transition: transform 0.5s cubic-bezier(.5,.15,.2,1), opacity 0.4s ease;
}
.stack-current  { transform: translate(0,0) rotate(-1deg) scale(1); z-index: 6; }
.stack-next     { transform: translate(16px,-14px) rotate(3deg) scale(0.965); opacity: 0.92; z-index: 4; }
.stack-out {
    transform: translate(85px,-90px) rotate(11deg) scale(0.88) !important; opacity: 0 !important;
    z-index: 8; pointer-events: none;
    transition: transform 0.5s cubic-bezier(.5,-0.25,.6,1), opacity 0.35s ease 0.18s;
}
.pack-stage.instant .stack-card { transition: none !important; }
.pack-stage.instant .fpk-flip { transition: none !important; }
.card-wrap { display: block; }

.fpk-counter {
    /* Accroche par le HAUT (avant : bottom -34px) : le texte passe sur 2 lignes et remontait sur
       le bas de la carte inclinee (retour 2026-10-07). pre-line = retour a la ligne voulu (tcg-pack.js). */
    position: absolute; left: 0; right: 0; top: calc(100% + 16px); text-align: center; z-index: 20;
    white-space: pre-line; line-height: 1.5;
    font-family: 'Share Tech Mono', monospace; font-size: 12.5px; letter-spacing: 1.5px;
    color: rgba(255,255,255,0.82); text-shadow: 0 1px 5px rgba(0,0,0,0.85);
    opacity: 0; transition: opacity 0.3s ease; pointer-events: none;
}

.burst {
    position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.95), rgba(150,200,255,0.6) 35%, transparent 70%);
    opacity: 0; pointer-events: none; z-index: 7;
}
.burst.go { animation: burstFlash 0.55s ease-out forwards; }
.burst[data-tier="sr"]  { background: radial-gradient(circle, rgba(255,255,255,0.95), rgba(176,107,255,0.65) 35%, transparent 70%); }
.burst[data-tier="ssr"] { background: radial-gradient(circle, rgba(255,250,220,0.98), rgba(216,182,88,0.75) 35%, transparent 70%); }
.burst[data-tier="ur"]  { background: radial-gradient(circle, rgba(255,255,255,1), rgba(160,220,255,0.85) 30%, rgba(255,120,220,0.5) 60%, transparent 75%); }
.burst[data-tier="chase"] { background: radial-gradient(circle, rgba(255,255,255,1), rgba(255,233,168,0.9) 25%, rgba(255,157,245,0.6) 50%, rgba(95,212,255,0.4) 68%, transparent 80%); }
.burst[data-tier="sr"].go  { animation-name: burstFlashSr; }
.burst[data-tier="ssr"].go { animation-name: burstFlashBig; }
.burst[data-tier="ur"].go  { animation-name: burstFlashBig; }
.burst[data-tier="chase"].go { animation-name: burstFlashChase; }
@keyframes burstFlash    { 0% { opacity: 0; transform: scale(0.2); } 35% { opacity: 1; } 100% { opacity: 0; transform: scale(6); } }
@keyframes burstFlashSr  { 0% { opacity: 0; transform: scale(0.2); } 35% { opacity: 1; } 100% { opacity: 0; transform: scale(8); } }
@keyframes burstFlashBig { 0% { opacity: 0; transform: scale(0.2); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(13); } }
@keyframes burstFlashChase { 0% { opacity: 0; transform: scale(0.2); } 28% { opacity: 1; } 100% { opacity: 0; transform: scale(17); } }

.spark {
    position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px;
    border-radius: 50%; pointer-events: none; z-index: 7; opacity: 0;
}
.spark.go { animation: sparkFly 0.75s cubic-bezier(.2,.7,.3,1) forwards; }
@keyframes sparkFly {
    0%   { opacity: 1; transform: translate(0,0) scale(1); }
    100% { opacity: 0; transform: translate(var(--sx), var(--sy)) scale(0.3); }
}

.stage-flash {
    position: absolute; inset: 0; z-index: 20; pointer-events: none;
    background: radial-gradient(circle at center, rgba(255,225,160,0.85) 0%, transparent 70%);
    opacity: 0;
}
.stage-flash.go { animation: cFlash 0.4s ease-out forwards; }
@keyframes cFlash { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }

.tcg-stage.punch { animation: stagePunch 0.32s ease-out; }
@keyframes stagePunch { 0% { transform: scale(1); } 45% { transform: scale(1.025); } 100% { transform: scale(1); } }

/* ═══════════════ Carte réduite (grille collection) ═══════════════ */
/* .tcg-card porte déjà son propre transform (tcgDrift/tilt) — un 2e transform de mise à l'échelle
   vit donc sur un WRAPPER séparé plutôt que sur la carte elle-même, même précaution que celle déjà
   documentée pour la fiche d'identité agent (2 transforms indépendants ne peuvent pas cohabiter
   sur un seul élément). 130×182 = 320×448 × 0.40625. */
.tcg-card-mini-wrap {
    width: 130px; height: 182px; overflow: hidden; position: relative;
    cursor: pointer;
    transition: transform 0.25s ease, filter 0.25s ease;
}
/* Le tilt (perspective/rotateX/rotateY) est volontairement EXCLU de la grille du classeur (retour
   utilisateur explicite : "il ne faut pas les mettre dans tcg-binder-root mais que dans
   tcg-binder-modal") -- neuf cartes qui dérivent chacune indépendamment dans une grille n'est pas
   le comportement voulu. Ici transform ne lit donc PAS --rotation-x/y : même si tcgDrift continue
   d'animer ces custom properties en arrière-plan (règle de base .tcg-card), elles n'ont aucun
   effet visuel puisque rien ici ne les référence. wireCardTilt() n'est d'ailleurs plus câblé sur
   ces cartes (voir buildMiniCard() dans tcg-binder.js, appelé sans fullSize). */
.tcg-card-mini-wrap .tcg-card { transform-origin: top left; transform: scale(0.40625); }
/* Survol grille collection : lift + halo teinté par rareté. filter: drop-shadow() (pas
   box-shadow) car le wrap est overflow:hidden — box-shadow serait coupé net par le clip, alors
   que drop-shadow s'applique après, autour de la forme visible réellement rendue. */
.tcg-card-mini-wrap:hover { transform: translateY(-4px) scale(1.05); z-index: 2; }
.tcg-card-mini-wrap[data-rarity="commun"]:hover { filter: drop-shadow(0 6px 16px rgba(0,0,0,0.75)); }
.tcg-card-mini-wrap[data-rarity="rare"]:hover { filter: drop-shadow(0 0 8px rgba(79,163,255,0.65)); }
.tcg-card-mini-wrap[data-rarity="sr"]:hover { filter: drop-shadow(0 0 8px rgba(176,107,255,0.7)); }
.tcg-card-mini-wrap[data-rarity="ssr"]:hover { filter: drop-shadow(0 0 8px rgba(216,182,88,0.75)); }
.tcg-card-mini-wrap[data-rarity="ur"]:hover { filter: drop-shadow(0 0 20px rgba(255,120,220,0.8)); }


/* ═══════════════ Encarts numéro + nom de l'effet holo, stries UR+ (2026-10-06) ═══════════════ */
/* Repris du labo tcg-v3-lab.html (pistes de l'analyse chatdeck.fr). Numéro = position de la carte
   dans sa famille / taille de la famille (catalogue public web/tcg-catalog.json), PAS un numéro
   d'exemplaire (aucun stock par carte côté serveur). Vide = encart masqué. */
.tcg-serial, .tcg-holochip {
    position: absolute; right: 24px; z-index: 7; pointer-events: none;
    font-family: 'Share Tech Mono', monospace; font-size: 9px; letter-spacing: 1px; line-height: 1;
    padding: 4px 7px; border-radius: 4px; white-space: nowrap; transition: opacity 0.3s ease;
}
.tcg-serial {
    top: 24px; color: #fff; font-variant-numeric: tabular-nums;
    background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.18);
}
.tcg-card[data-rarity="rare"] .tcg-serial { border-color: rgba(79,163,255,0.65); }
.tcg-card[data-rarity="sr"] .tcg-serial   { border-color: rgba(176,107,255,0.7); }
.tcg-card[data-rarity="ssr"] .tcg-serial  { border-color: rgba(216,182,88,0.75); }
.tcg-card[data-rarity="ur"] .tcg-serial   { border-color: rgba(255,120,220,0.7); }
.tcg-card[data-rarity="ur"][data-chase="1"] .tcg-serial { border-color: rgba(255,215,0,0.85); }
.tcg-holochip {
    top: 46px; display: none; font-weight: 700; letter-spacing: 1.5px; color: #06121a;
    background: linear-gradient(100deg, #9fe8ff, #fff, #ffb3e6, #fff, #9fe8ff) 0 0 / 250% 100%;
    animation: tcgChipShine 2.4s linear infinite;
}
.tcg-card:not([data-material="standard"]) .tcg-holochip { display: block; }
.tcg-serial:empty, .tcg-holochip:empty { display: none; }
.tcg-card[data-fullart="1"] .tcg-serial { top: 14px; right: 14px; }
.tcg-card[data-fullart="1"] .tcg-holochip { top: 36px; right: 14px; }
/* Dos visible pendant l'ouverture : les encarts ne doivent pas passer par-dessus. */
.tcg-card.previewing .tcg-serial, .tcg-card.previewing .tcg-holochip { opacity: 0; }
@keyframes tcgChipShine { to { background-position: 250% 0; } }

/* Stries prisme dorées, par défaut sur toutes les UR+ (UR chase). Suivent le pointeur. */
.tcg-stripes { position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit; display: none; }
.tcg-card[data-rarity="ur"][data-chase="1"] .tcg-stripes {
    display: block; mix-blend-mode: color-dodge; opacity: 0.32;
    background-image: repeating-linear-gradient(115deg,
        #6b5600 0%, #fff3bf 9%, #e6c200 18%, #fff 27%, #9fb36a 36%, #6b5600 45%);
    background-size: 300% 300%; background-position: var(--pointer-x) var(--pointer-y);
    -webkit-mask-image: repeating-linear-gradient(115deg, #000 0 18px, rgba(0,0,0,0.35) 18px 30px);
    mask-image: repeating-linear-gradient(115deg, #000 0 18px, rgba(0,0,0,0.35) 18px 30px);
}
@media (prefers-reduced-motion: reduce) { .tcg-holochip { animation: none; } }

/* ═══════════════ LR (Legend Rare, 2026-11-18) : rendu ÉCARLATE ═══════════════ */
/* Choisi par le user au labo (tcg-lr-lab.html, proposition D) : cadre cramoisi en fusion qui tourne,
   braises qui montent, badge "LR" centré en haut (un peu plus petit que la proposition E). Pas de
   liseré sombre autour du cadre ni d'ombre noire portée (retour du user). Pleine carte comme l'UR.
   Couches : ::after = anneau, ::before = badge, .tcg-lr-fx / .tcg-lr-fx2 = braises (posées par
   tcg-binder.js, personnage.html et js/alertes/31-booster-streamer.js). Couleurs partagées avec les
   pastilles et barres LR (personnage.css, tcg-binder.css) via --tcg-lr-*. */
:root { --tcg-lr-a: #ffb347; --tcg-lr-b: #ff2b2b; --tcg-lr-glow: rgba(255,70,40,0.85); }
.tcg-lr-fx, .tcg-lr-fx2 { position: absolute; inset: 0; z-index: 4; pointer-events: none; border-radius: inherit; display: none; }
.tcg-card[data-rarity="lr"] { border: none; animation: tcgDrift 8s ease-in-out infinite, lrPulse 1.6s ease-in-out infinite; }
@keyframes lrPulse {
    0%, 100% { box-shadow: 0 0 26px rgba(220,30,40,0.6); }
    50%      { box-shadow: 0 0 58px rgba(255,120,40,0.95); }
}
.tcg-card[data-rarity="lr"]::after {
    content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 5px; z-index: 9; pointer-events: none;
    background: conic-gradient(from var(--border-angle), #8a0a12, #ff2b2b, #ffb347, #fff1c2, #ffb347, #ff2b2b, #8a0a12, #8a0a12);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
    animation: borderRotate 2.4s linear infinite;
}
.tcg-card[data-rarity="lr"]::before {
    content: 'LR'; position: absolute; top: 5px; left: 50%; transform: translateX(-50%); z-index: 10; pointer-events: none;
    font-family: 'Orbitron', monospace; font-weight: 900; font-size: 14px; letter-spacing: 3px; line-height: 1;
    padding: 4px 10px 4px 13px; border-radius: 0 0 8px 8px; color: #2a0004;
    background: linear-gradient(100deg, #ff2b2b, #ffb347, #fff1c2, #ffb347, #ff2b2b) 0 0 / 250% 100%;
    box-shadow: 0 2px 10px rgba(255,60,30,0.55); animation: tcgChipShine 2.4s linear infinite;
}
.tcg-card[data-rarity="lr"] .tcg-lr-fx, .tcg-card[data-rarity="lr"] .tcg-lr-fx2 { display: block; mix-blend-mode: screen; }
.tcg-card[data-rarity="lr"] .tcg-lr-fx {
    background: radial-gradient(2px 2px at 12% 100%, #ffcf6b, transparent), radial-gradient(2px 2px at 30% 100%, #ff7a3c, transparent),
        radial-gradient(3px 3px at 52% 100%, #ffd98a, transparent), radial-gradient(2px 2px at 71% 100%, #ff5a2a, transparent),
        radial-gradient(2px 2px at 88% 100%, #ffcf6b, transparent);
    animation: lrEmbers 3.2s linear infinite;
}
.tcg-card[data-rarity="lr"] .tcg-lr-fx2 {
    background: radial-gradient(2px 2px at 20% 100%, #ffd98a, transparent), radial-gradient(3px 3px at 44% 100%, #ff7a3c, transparent),
        radial-gradient(2px 2px at 63% 100%, #ffcf6b, transparent), radial-gradient(2px 2px at 81% 100%, #ff9a4a, transparent);
    animation: lrEmbers 4.4s linear infinite 1.3s;
}
@keyframes lrEmbers { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-460px); opacity: 0; } }
.tcg-card[data-rarity="lr"] .tcg-plate { background: linear-gradient(180deg, transparent, rgba(40,0,4,0.6) 40%, rgba(25,0,2,0.94)); }
.tcg-card[data-rarity="lr"] .tcg-pip {
    background: linear-gradient(0deg, #ff2b2b, #ffb347, #fff1c2); -webkit-background-clip: text; background-clip: text; color: transparent;
    text-shadow: none; filter: drop-shadow(0 0 7px rgba(255,90,40,0.95));
}
.tcg-card[data-rarity="lr"] .tcg-chase-mark { display: inline; color: #ffb347; text-shadow: 0 0 10px #ff2b2b; }
.tcg-card[data-rarity="lr"] .tcg-serial { border-color: rgba(255,120,60,0.85); }
.tcg-card-mini-wrap[data-rarity="lr"]:hover { filter: drop-shadow(0 0 20px rgba(255,80,40,0.85)); }
.burst[data-tier="lr"] { background: radial-gradient(circle, rgba(255,255,255,1), rgba(255,241,194,0.95) 22%, rgba(255,179,71,0.75) 42%, rgba(255,43,43,0.5) 62%, transparent 80%); }
.burst[data-tier="lr"].go { animation-name: burstFlashChase; animation-duration: 0.8s; }
@media (prefers-reduced-motion: reduce) {
    .tcg-card[data-rarity="lr"]::after, .tcg-card[data-rarity="lr"]::before, .tcg-lr-fx, .tcg-lr-fx2 { animation: none; }
}
