/* ========== static/pokemon_cards.css ==========
   Vraies cartes Pokémon (templates/pokemon/_card.html) : cadre selon le type,
   Énergies, finitions selon la rareté (normale, reverse, holo, full art, dorée),
   paillettes des shiny, inclinaison 3D et reflets qui suivent la souris
   (variables posées par pokemon_cards.js), verso, zoom et boîtier de gradation.
   Toutes les tailles sont en cqw : la carte se met à l'échelle de sa colonne. */

.tcg-card {
    --mx: 50%; --my: 50%; --rx: 0deg; --ry: 0deg; --hyp: 0; --o: 0;
    --tc1: #d9d6cf; --tc2: #b9b4a8; --tink: #2a2620;
    position: relative; width: 100%; aspect-ratio: 63 / 88; container-type: inline-size;
    perspective: 900px; cursor: pointer; user-select: none; -webkit-user-select: none;
    /* Coins d'une vraie carte : 4,6 % de SA largeur (3 mm sur 63). En % (largeur /
       hauteur) et pas en cqw : sur la carte elle-même, cqw vise le conteneur parent
       (souvent l'écran), d'où des coins énormes hors du boîtier de gradation. */
    border-radius: 4.6% / 3.29%; isolation: isolate;
}
.tcg-rotator {
    position: absolute; inset: 0; transform-style: preserve-3d; border-radius: inherit;
    transform: rotateY(var(--rx)) rotateX(var(--ry));
    transition: transform 0.5s cubic-bezier(.2, .8, .2, 1);
}
.tcg-card.tilting .tcg-rotator { transition: transform 0.08s linear; }
.tcg-card.flipped .tcg-rotator { transform: rotateY(calc(180deg + var(--rx))) rotateX(var(--ry)); }
.tcg-face {
    position: absolute; inset: 0; border-radius: inherit; overflow: hidden; backface-visibility: hidden;
    -webkit-backface-visibility: hidden; box-shadow: 0 1.5cqw 5cqw rgba(0, 0, 0, .45), 0 0 0 .35cqw rgba(0, 0, 0, .35);
}
.tcg-back { transform: rotateY(180deg); }
.tcg-card:hover .tcg-face { box-shadow: 0 4cqw 10cqw rgba(0, 0, 0, .55), 0 0 0 .35cqw rgba(0, 0, 0, .35); }

/* ---------- Couleurs de type (Énergie principale) ---------- */
.e-fire { --tc1: #f6a86a; --tc2: #e0533a; --tink: #3a1206; }
.e-water { --tc1: #9fd3f7; --tc2: #3a86d8; --tink: #06233f; }
.e-lightning { --tc1: #fbe57d; --tc2: #efbd19; --tink: #3a2c00; }
.e-grass { --tc1: #b9e39a; --tc2: #4fa64a; --tink: #0f2a0b; }
.e-psychic { --tc1: #dcb6ec; --tc2: #9a55c2; --tink: #2a0c3a; }
.e-fighting { --tc1: #e9b48f; --tc2: #b35f35; --tink: #33150a; }
.e-darkness { --tc1: #7b8199; --tc2: #2c3044; --tink: #f0f2f8; }
.e-metal { --tc1: #d7dde4; --tc2: #8a96a3; --tink: #1c232b; }
.e-fairy { --tc1: #f7c6df; --tc2: #db6fa9; --tink: #3d0a24; }
.e-dragon { --tc1: #e6d58e; --tc2: #a88a2c; --tink: #2f2505; }
.e-colorless { --tc1: #f1efe9; --tc2: #c7c1b3; --tink: #2a2620; }

/* ---------- Recto ---------- */
.tcg-front { background: #f3d75b; padding: 3.3cqw; }
.tcg-frame {
    position: relative; height: 100%; border-radius: 2.4cqw; overflow: hidden; color: var(--tink);
    background:
        radial-gradient(120% 60% at 20% 0%, rgba(255, 255, 255, .55), transparent 60%),
        linear-gradient(165deg, var(--tc1), var(--tc2));
    display: flex; flex-direction: column; padding: 2.4cqw 3cqw 1.8cqw;
    font-family: Inter, system-ui, sans-serif;
}
.tcg-frame::before { /* grain de carton */
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .18; mix-blend-mode: soft-light;
    background: repeating-linear-gradient(45deg, rgba(255,255,255,.5) 0 .4cqw, transparent .4cqw 1.2cqw);
}
.tcg-top { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: end; column-gap: 2cqw; line-height: 1; }
.tcg-stage { grid-column: 1 / -1; display: flex; gap: 2cqw; align-items: center; font-size: 3.1cqw; font-weight: 800; }
.tcg-stage-label {
    background: linear-gradient(180deg, #fdfdfd, #c9c9c9); color: #333; padding: .5cqw 1.8cqw; border-radius: 1cqw;
    box-shadow: inset 0 -.3cqw 0 rgba(0,0,0,.18); text-transform: uppercase; letter-spacing: .02em; font-size: 2.6cqw;
}
.tcg-evolves { font-style: italic; font-weight: 600; opacity: .85; font-size: 2.8cqw; }
.tcg-name { font-size: 7.4cqw; font-weight: 900; letter-spacing: -.02em; margin-top: 1cqw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcg-shiny-star { margin-left: 1.2cqw; color: #fff; text-shadow: 0 0 1.5cqw #ffd84a, 0 0 .5cqw #ff8a00; font-size: 5.5cqw; }
.tcg-hp { display: flex; align-items: center; gap: 1cqw; font-size: 7.4cqw; font-weight: 900; color: #c21d1d; }
.e-darkness .tcg-hp { color: #ff7b7b; }
.tcg-hp small { font-size: 3cqw; font-weight: 900; margin-right: -.4cqw; align-self: flex-end; margin-bottom: 1cqw; color: var(--tink); }

.tcg-art {
    position: relative; margin-top: 1.8cqw; height: 44%; flex: none; border-radius: .8cqw; overflow: hidden;
    border: 1.2cqw solid transparent;
    background: linear-gradient(#0000, #0000) padding-box, linear-gradient(135deg, #fff6c9, #c9a13a 40%, #fff1b0 60%, #a7822a) border-box;
    box-shadow: 0 .6cqw 1.5cqw rgba(0,0,0,.35);
}
.tcg-art-bg {
    position: absolute; inset: 0;
    background:
        radial-gradient(70% 60% at 50% 55%, rgba(255,255,255,.85), transparent 70%),
        linear-gradient(160deg, var(--tc1), var(--tc2));
}
.tcg-art img {
    position: absolute; inset: 4% 6% 0; width: 88%; height: 96%; object-fit: contain; pointer-events: none;
    filter: drop-shadow(0 1.4cqw 1.6cqw rgba(0,0,0,.35));
}
.tcg-strip {
    margin: 1.4cqw auto 0; padding: .5cqw 2.4cqw; font-size: 2.35cqw; font-weight: 700; font-style: italic;
    background: linear-gradient(90deg, #d8b650, #fff2b3, #d8b650); color: #3d3212; border-radius: .6cqw;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.tcg-attacks { flex: 1; display: flex; flex-direction: column; justify-content: space-evenly; padding: 1cqw 0; min-height: 0; }
.tcg-attack-row { display: grid; grid-template-columns: 17cqw 1fr auto; align-items: center; gap: 1.6cqw; }
.tcg-cost { display: flex; gap: .5cqw; flex-wrap: wrap; }
.tcg-attack-name { font-size: 5cqw; font-weight: 900; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcg-dmg { font-size: 6.2cqw; font-weight: 900; min-width: 8cqw; text-align: right; }
.tcg-attack-text { font-size: 2.6cqw; line-height: 1.25; font-weight: 500; margin-top: .6cqw; }
.tcg-attack + .tcg-attack { border-top: .25cqw solid rgba(0,0,0,.18); padding-top: 1cqw; }
.tcg-bottom {
    display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; gap: 1cqw; padding-top: 1.2cqw;
    border-top: .3cqw solid rgba(0,0,0,.25);
}
.tcg-stat { display: flex; flex-direction: column; align-items: center; gap: .5cqw; font-size: 3.2cqw; font-weight: 900; }
.tcg-stat small { font-size: 2.3cqw; font-weight: 700; text-transform: lowercase; opacity: .8; }
.tcg-stat-val { display: flex; align-items: center; justify-content: center; gap: .5cqw; min-height: 4.6cqw; }
.tcg-foot { display: flex; justify-content: space-between; font-size: 2.4cqw; font-weight: 800; margin-top: 1cqw; opacity: .85; }
.tcg-symbol { margin-left: .6cqw; }

/* ---------- Énergies ---------- */
.energy {
    --ec: #d6d1c4; display: inline-block; width: 4.6cqw; height: 4.6cqw; flex: none; border-radius: 50%;
    background: var(--eg) center / 72% no-repeat, radial-gradient(circle at 35% 30%, #fff8, transparent 55%), var(--ec);
    box-shadow: 0 .25cqw .5cqw rgba(0,0,0,.45), inset 0 0 0 .25cqw rgba(255,255,255,.35);
}
.energy-big { width: 6cqw; height: 6cqw; }
/* Hors carte (tableaux, combats...) : taille fixe. */
.energy.energy-inline { width: 1.1em; height: 1.1em; vertical-align: -.2em; }
.energy.e-fire { --ec: #e4542f; --eg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2c1 4-3 6-3 10a3 3 0 0 0 6 0c0-2-1-3-1-3 3 1 5 4 5 7a7 7 0 0 1-14 0c0-6 7-9 7-14z'/%3E%3C/svg%3E"); }
.energy.e-water { --ec: #2f86d6; --eg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2s7 8 7 13a7 7 0 0 1-14 0c0-5 7-13 7-13z'/%3E%3C/svg%3E"); }
.energy.e-lightning { --ec: #f1c11a; --eg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23222'%3E%3Cpath d='M14 1 4 14h6l-2 9 10-13h-6z'/%3E%3C/svg%3E"); }
.energy.e-grass { --ec: #3f9a3a; --eg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M20 3C9 3 4 9 4 16c0 2 .5 3.5 1 5 1-6 5-10 10-12-4 3-7 7-8 12 9 0 13-6 13-18z'/%3E%3C/svg%3E"); }
.energy.e-psychic { --ec: #8e4bb8; --eg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 5C6 5 2 12 2 12s4 7 10 7 10-7 10-7-4-7-10-7zm0 11a4 4 0 1 1 0-8 4 4 0 0 1 0 8z'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3C/svg%3E"); }
.energy.e-fighting { --ec: #b85a2c; --eg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M6 9h12a2 2 0 0 1 2 2v4a6 6 0 0 1-6 6h-4a6 6 0 0 1-6-6v-4a2 2 0 0 1 2-2zm1-5h3v4H7zm4-1h3v5h-3zm4 1h3v4h-3z'/%3E%3C/svg%3E"); }
.energy.e-darkness { --ec: #2d3142; --eg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M15 2a10 10 0 1 0 7 17A8 8 0 0 1 15 2z'/%3E%3C/svg%3E"); }
.energy.e-metal { --ec: #8793a0; --eg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2 21 7v10l-9 5-9-5V7z' opacity='.9'/%3E%3Cpath d='M12 7 17 10v4l-5 3-5-3v-4z' fill='%238793a0'/%3E%3C/svg%3E"); }
.energy.e-fairy { --ec: #d9669f; --eg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 1l2.5 8.5L23 12l-8.5 2.5L12 23l-2.5-8.5L1 12l8.5-2.5z'/%3E%3C/svg%3E"); }
.energy.e-dragon { --ec: #a38a2e; --eg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M3 20 12 3l9 17-9-5z'/%3E%3C/svg%3E"); }
.energy.e-colorless { --ec: #e9e5da; --eg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23555'%3E%3Cpath d='M12 2l2.9 6.2L21 9l-4.6 4.3L17.6 20 12 16.8 6.4 20l1.2-6.7L3 9l6.1-.8z'/%3E%3C/svg%3E"); }

/* ---------- Couches d'effets ---------- */
.tcg-shine, .tcg-glare, .tcg-sparkle, .tcg-art-shine { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; }
.tcg-glare {
    background: radial-gradient(farthest-corner circle at var(--mx) var(--my), rgba(255,255,255,.75) 5%, rgba(255,255,255,.25) 25%, transparent 60%);
    mix-blend-mode: overlay; opacity: calc(var(--o) * .9); transition: opacity .3s;
}
.tcg-shine, .tcg-sparkle { opacity: 0; }
.tcg-art-shine { opacity: 0; }

/* Arc-en-ciel qui défile avec la souris (holographique) : bandes pastel en
   diagonale + fine trame, en « color-dodge » (éclaircit sans délaver). */
.fin-holo .tcg-art-shine, .fin-reverse .tcg-shine, .fin-fullart .tcg-art-shine, .fin-gold .tcg-art-shine, .is-shiny .tcg-shine {
    background-image:
        repeating-linear-gradient(115deg, #ff7773 0%, #ffed5f 7%, #a8ff5f 14%, #83fff7 21%, #7894ff 28%, #d875ff 35%, #ff7773 42%),
        repeating-linear-gradient(-45deg, rgba(255,255,255,.22) 0 .45cqw, transparent .45cqw 1.4cqw);
    background-size: 400% 400%, auto;
    background-position: var(--mx) var(--my), 0 0;
    mix-blend-mode: color-dodge;
    filter: saturate(1.1);
    opacity: calc(.1 + var(--o) * .3);
}
/* Holo : l'illustration brille. */
.fin-holo .tcg-art-shine, .fin-fullart .tcg-art-shine { opacity: calc(.4 + var(--o) * .45); }
/* Le reflet brille DERRIÈRE le Pokémon (illustrations détourées) : fond en
   feuille holographique, Pokémon net, comme les vraies cartes. */
.tcg-art-bg { z-index: 0; }
.tcg-art-shine { z-index: 1; }
.tcg-art img { z-index: 2; }
/* Reverse : le cadre brille, pas l'illustration. */
.fin-reverse .tcg-shine {
    -webkit-mask: linear-gradient(#000 0 0) padding-box; mask: linear-gradient(#000 0 0);
    opacity: calc(.12 + var(--o) * .35);
}
.fin-reverse .tcg-art { z-index: 2; }
.fin-reverse .tcg-shine { z-index: 1; }
.fin-reverse .tcg-frame { z-index: 0; }

/* Full art : l'illustration couvre toute la carte, texte sur bandeaux. */
.fin-fullart .tcg-front, .fin-gold .tcg-front { padding: 2.2cqw; background: linear-gradient(135deg, #c9ccd6, #f4f6fb 40%, #9aa1b3 60%, #eef1f7); }
.fin-fullart .tcg-frame, .fin-gold .tcg-frame { background: none; color: #fff; text-shadow: 0 .3cqw .8cqw rgba(0,0,0,.7); }
.fin-fullart .tcg-frame::before, .fin-gold .tcg-frame::before { display: none; }
.fin-fullart .tcg-art, .fin-gold .tcg-art {
    position: absolute; inset: 0; height: auto; margin: 0; border: 0; border-radius: inherit; z-index: 0; box-shadow: none;
}
.fin-fullart .tcg-art-bg {
    background:
        radial-gradient(60% 45% at 50% 42%, rgba(255,255,255,.6), transparent 70%),
        repeating-conic-gradient(from 0deg at 50% 42%, rgba(255,255,255,.12) 0 6deg, transparent 6deg 12deg),
        linear-gradient(160deg, var(--tc1), var(--tc2) 55%, #1b1b2a);
}
.fin-fullart .tcg-art img, .fin-gold .tcg-art img { inset: 12% 4% 38%; width: 92%; height: 50%; }
.fin-fullart .tcg-top, .fin-fullart .tcg-strip, .fin-fullart .tcg-attacks, .fin-fullart .tcg-bottom, .fin-fullart .tcg-foot,
.fin-gold .tcg-top, .fin-gold .tcg-strip, .fin-gold .tcg-attacks, .fin-gold .tcg-bottom, .fin-gold .tcg-foot { position: relative; z-index: 2; }
.fin-fullart .tcg-attacks, .fin-gold .tcg-attacks { flex: none; background: rgba(0,0,0,.36); border-radius: 1.6cqw; padding: 1.4cqw 2cqw; }
/* Bandeau N° / taille / poids : collé au-dessus des attaques, en bas de l'illustration.
   (Avant, bandeau ET attaques avaient margin-top:auto : l'espace se partageait et
   le bandeau flottait au milieu de l'image.) */
.fin-fullart .tcg-strip, .fin-gold .tcg-strip {
    margin: auto auto 1cqw; font-size: 2cqw; background: rgba(0,0,0,.4); color: #fff;
}
.fin-fullart .tcg-hp, .fin-gold .tcg-hp { color: #fff; }
.fin-fullart .tcg-hp small, .fin-gold .tcg-hp small { color: #fff; }
.fin-fullart .tcg-bottom, .fin-gold .tcg-bottom { border-color: rgba(255,255,255,.35); }


/* Secrète : tout en or, paillettes et reflets. */
.fin-gold .tcg-front { background: linear-gradient(135deg, #7a5a12, #ffe28a 30%, #b8871d 50%, #fff0b3 70%, #8c6415); }
.fin-gold .tcg-art-bg {
    background:
        radial-gradient(60% 45% at 50% 42%, rgba(255,245,200,.9), transparent 70%),
        repeating-linear-gradient(135deg, rgba(255,255,255,.18) 0 .5cqw, transparent .5cqw 2cqw),
        linear-gradient(160deg, #f7df8a, #b8871d 55%, #4b3308);
}
/* Full art / secrète : voile sombre en haut et en bas (texte blanc lisible), au-dessus
   du reflet mais sous le Pokémon. */
.fin-fullart .tcg-art::after, .fin-gold .tcg-art::after {
    content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background: linear-gradient(180deg, rgba(0,0,0,.5), transparent 22%, transparent 50%, rgba(0,0,0,.6) 76%);
}
.fin-gold .tcg-art::after { background: linear-gradient(180deg, rgba(40,25,0,.55), transparent 22%, transparent 50%, rgba(40,25,0,.6) 76%); }
.fin-gold .tcg-frame { color: #fff7da; }
.fin-gold .tcg-strip { background: linear-gradient(90deg, #6d4e0f, #f8e08e, #6d4e0f); color: #2a1c02; text-shadow: none; }
.fin-gold .tcg-art-shine {
    background-image:
        repeating-linear-gradient(115deg, #fff6c9 0%, #e8b74a 7%, #ffffff 12%, #c98f1f 20%, #fff3b0 28%, #e8b74a 36%, #fff6c9 42%),
        repeating-linear-gradient(-45deg, rgba(255,255,255,.25) 0 .45cqw, transparent .45cqw 1.4cqw);
    mix-blend-mode: overlay; filter: none; opacity: calc(.5 + var(--o) * .45);
}
.fin-gold .tcg-sparkle, .is-shiny .tcg-sparkle {
    opacity: 1;
    background-image:
        radial-gradient(circle, #fff 0 .35cqw, transparent .6cqw), radial-gradient(circle, #fff 0 .25cqw, transparent .5cqw),
        radial-gradient(circle, #fff8d0 0 .3cqw, transparent .55cqw);
    background-size: 13cqw 17cqw, 19cqw 11cqw, 23cqw 29cqw;
    background-position: 2cqw 5cqw, 9cqw 1cqw, 14cqw 8cqw;
    mix-blend-mode: screen; animation: tcg-twinkle 2.4s ease-in-out infinite alternate;
}
@keyframes tcg-twinkle { from { opacity: .25; filter: blur(0); } to { opacity: .9; filter: blur(.3px); } }

/* Shiny : paillettes + léger arc-en-ciel sur toute la carte. */
.is-shiny .tcg-shine { opacity: calc(.08 + var(--o) * .28); }
.is-shiny .tcg-front { box-shadow: inset 0 0 0 .5cqw rgba(255,255,255,.35); }

/* Légendaire / fabuleux : liseré lumineux. */
.is-legend .tcg-face.tcg-front { box-shadow: 0 1.5cqw 5cqw rgba(0,0,0,.45), 0 0 4cqw rgba(255, 214, 90, .45); }

/* ---------- Verso ---------- */
.tcg-back { background: #1b3f96; padding: 3.3cqw; }
.tcg-back-inner {
    position: relative; height: 100%; border-radius: 2.4cqw; overflow: hidden;
    background: radial-gradient(circle at 50% 45%, #5aa2ff, #1d4fc4 35%, #0f2a73 70%, #0a1b4a);
    box-shadow: inset 0 0 0 1cqw #0d2461;
}
.tcg-back-swirl {
    position: absolute; inset: -30%;
    background: repeating-conic-gradient(from 0deg at 50% 45%, rgba(255,255,255,.08) 0 10deg, transparent 10deg 20deg);
    animation: tcg-swirl 40s linear infinite;
}
@keyframes tcg-swirl { to { transform: rotate(360deg); } }
.tcg-back-emblem {
    position: absolute; left: 50%; top: 45%; width: 46cqw; height: 46cqw; transform: translate(-50%, -50%); border-radius: 50%;
    background: linear-gradient(#e33b3b 0 46%, #111 46% 54%, #f4f4f4 54%);
    box-shadow: 0 0 0 1.6cqw #111, 0 2cqw 6cqw rgba(0,0,0,.5);
}
.tcg-back-emblem span {
    position: absolute; left: 50%; top: 50%; width: 15cqw; height: 15cqw; transform: translate(-50%, -50%); border-radius: 50%;
    background: radial-gradient(circle, #fff 0 38%, #ddd 40% 55%, #111 57%);
}
.tcg-back-word {
    position: absolute; left: 0; right: 0; bottom: 11%; text-align: center; color: #ffd84a; font-weight: 900;
    font-size: 8cqw; letter-spacing: .08em; text-shadow: 0 .6cqw 0 #1a3a8a, 0 0 3cqw rgba(0,0,0,.5);
}
.tcg-back-word small { display: block; font-size: 3.2cqw; letter-spacing: .3em; color: #cfe0ff; text-shadow: none; }

/* ---------- Grilles de cartes ---------- */
.tcg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 22px 18px; align-items: start; }
.tcg-slot { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tcg-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .8rem; color: var(--text-dim); padding: 0 2px; }
.tcg-meta b { color: var(--accent); font-variant-numeric: tabular-nums; }
.tcg-meta .qty-badge-inline { background: var(--bg-elev-2, #262b36); color: var(--text); border-radius: 999px; padding: 1px 8px; font-weight: 800; }
.tcg-slot .btn { width: 100%; }
.tcg-slot.missing .tcg-card { filter: grayscale(1) brightness(.45); opacity: .6; }
.tcg-slot.missing .tcg-card::after {
    content: "?"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 30cqw; font-weight: 900; color: rgba(255,255,255,.5);
}

/* ---------- Zoom (clic sur une carte) ---------- */
.tcg-zoom {
    position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: rgba(5, 8, 14, .82);
    backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity .25s;
}
.tcg-zoom.open { opacity: 1; pointer-events: auto; }
.tcg-zoom-stage { width: min(380px, 82vw); display: flex; flex-direction: column; align-items: center; gap: 16px; transform: scale(.9); transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.tcg-zoom.open .tcg-zoom-stage { transform: none; }
.tcg-zoom-card, .tcg-zoom-stage .tcg-card { width: 100%; }
.tcg-zoom-actions { display: flex; gap: 10px; }
.tcg-zoom-hint { color: var(--text-faint, #8a93a6); font-size: .8rem; }

/* ---------- Boîtier de gradation (PGS) ---------- */
.tcg-slab {
    position: relative; padding: 10px 10px 12px; border-radius: 14px; container-type: inline-size;
    background: linear-gradient(160deg, rgba(255,255,255,.22), rgba(255,255,255,.06) 40%, rgba(255,255,255,.14));
    box-shadow: inset 0 0 0 2px rgba(255,255,255,.35), inset 0 0 0 6px rgba(255,255,255,.06), 0 14px 34px rgba(0,0,0,.5);
}
.tcg-slab::after { /* reflet du plastique */
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.18) 42%, transparent 50%);
}
.tcg-slab-label {
    display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 8px; margin-bottom: 10px; padding: 7px 10px;
    border-radius: 8px; background: linear-gradient(180deg, #fafafa, #dcdcdc); color: #111; box-shadow: inset 0 -2px 0 #b41c1c;
}
.tcg-slab-label .slab-brand { font-weight: 900; color: #b41c1c; letter-spacing: .08em; font-size: .7rem; }
.tcg-slab-label .slab-name { font-weight: 800; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcg-slab-label .slab-grade { grid-row: 1 / span 3; grid-column: 2; font-size: 1.9rem; font-weight: 900; line-height: 1; text-align: center; }
.tcg-slab-label .slab-grade small { display: block; font-size: .55rem; letter-spacing: .06em; color: #555; }
.tcg-slab-label .slab-cert { font-size: .65rem; color: #444; font-variant-numeric: tabular-nums; }
.tcg-slab .tcg-card { width: 100%; }

@media (prefers-reduced-motion: reduce) {
    .tcg-rotator, .tcg-back-swirl, .tcg-sparkle { transition: none !important; animation: none !important; }
}

/* Carte dans la coque pendant l'animation de gradation (collection). */
.grade-slab-tcg { width: 170px; margin: 6px auto 10px; }
.grade-slab-tcg .tcg-card { pointer-events: none; }

/* ========== Ouverture de boosters (pokemon/boosters.html) ========== */
.pack-overlay {
    position: fixed; inset: 0; z-index: 1100; display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: radial-gradient(ellipse at 50% 40%, #1d2440, #070a12 70%); overflow: hidden; user-select: none;
    animation: pack-fade-in .3s ease both;
}
@keyframes pack-fade-in { from { opacity: 0; } }
.pack-overlay.fade-out { animation: pack-fade-out .3s ease forwards; }
@keyframes pack-fade-out { to { opacity: 0; } }
.pack-bar { position: absolute; top: 14px; left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: center; color: #cfd6e6; font-weight: 800; }
.pack-stage { position: relative; width: min(300px, 70vw); aspect-ratio: 63 / 88; }
.pack-hint { margin-top: 78px; color: #9aa4ba; font-weight: 700; min-height: 1.4em; text-align: center; }
.pack-caption { position: absolute; left: 50%; bottom: -54px; transform: translateX(-50%); white-space: nowrap; text-align: center; font-weight: 900; }
.pack-caption .pc-name { color: #fff; font-size: 1.05rem; }
.pack-caption .pc-rarity { font-size: .8rem; color: #aab3c7; text-transform: uppercase; letter-spacing: .06em; }
.pack-caption .pc-new { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: #3ecf6e; color: #04210e; font-size: .7rem; vertical-align: 2px; }

/* Le booster (paquet scellé) */
.booster-3d {
    position: absolute; inset: -4% -6%; cursor: pointer; filter: drop-shadow(0 30px 40px rgba(0,0,0,.6));
    animation: pack-drop .6s cubic-bezier(.2,1.3,.4,1) both;
}
@keyframes pack-drop { from { transform: translateY(-60vh) rotate(-8deg); } }
.booster-3d:hover { animation: pack-wiggle .6s ease; }
@keyframes pack-wiggle { 25% { transform: rotate(-2deg); } 75% { transform: rotate(2deg); } }
.booster-body {
    position: absolute; inset: 7% 0; border-radius: 6px; overflow: hidden;
    background:
        repeating-linear-gradient(115deg, rgba(255,255,255,.0) 0 18px, rgba(255,255,255,.12) 18px 22px),
        linear-gradient(160deg, #3a1d6e, #1b62c9 45%, #0d1f52);
    box-shadow: inset 0 0 0 3px rgba(255,255,255,.15);
}
.booster-body::after { /* feuille métallisée */
    content: ""; position: absolute; inset: 0; mix-blend-mode: color-dodge; opacity: .35;
    background: linear-gradient(115deg, transparent 20%, #ff7773 30%, #ffed5f 38%, #83fff7 46%, #d875ff 54%, transparent 64%);
    background-size: 250% 100%; animation: pack-sheen 3s linear infinite;
}
@keyframes pack-sheen { from { background-position: 150% 0; } to { background-position: -150% 0; } }
.booster-art { position: absolute; left: 8%; right: 8%; top: 22%; width: 84%; filter: drop-shadow(0 12px 20px rgba(0,0,0,.6)); }
.booster-logo { position: absolute; top: 5%; left: 0; right: 0; text-align: center; font-weight: 900; font-size: 1.5rem; letter-spacing: .08em; color: #ffd84a; text-shadow: 0 3px 0 #1a3a8a, 0 0 20px rgba(0,0,0,.6); }
.booster-sub { position: absolute; bottom: 6%; left: 0; right: 0; text-align: center; color: #e6ecff; font-weight: 800; letter-spacing: .2em; font-size: .75rem; }
.booster-crimp { position: absolute; left: 0; right: 0; height: 8%; background: repeating-linear-gradient(90deg, #c8ccd8 0 6px, #eef0f6 6px 12px); border-radius: 3px; }
.booster-crimp.top { top: 0; } .booster-crimp.bottom { bottom: 0; }
.booster-3d.torn .booster-crimp.top { animation: pack-tear .5s ease-in forwards; }
@keyframes pack-tear { to { transform: translate(40%, -120%) rotate(18deg); opacity: 0; } }
.booster-3d.torn .booster-body, .booster-3d.torn .booster-crimp.bottom { animation: pack-sink .55s .25s ease-in forwards; }
@keyframes pack-sink { to { transform: translateY(70vh) rotate(4deg); opacity: 0; } }
.god-pack .booster-body { background: repeating-linear-gradient(115deg, rgba(255,255,255,0) 0 18px, rgba(255,255,255,.2) 18px 22px), linear-gradient(160deg, #7a5a12, #ffe28a 45%, #8c6415); }

/* La pile de cartes */
.pack-stack { position: absolute; inset: 0; }
.pack-stack .stack-card { position: absolute; inset: 0; transition: transform .45s cubic-bezier(.2,.8,.2,1), opacity .45s; }
.pack-stack .stack-card .tcg-card { width: 100%; }
.pack-stack.rising .stack-card { animation: stack-rise .6s cubic-bezier(.2,1.2,.4,1) both; }
@keyframes stack-rise { from { transform: translateY(60%) scale(.9); opacity: 0; } }
.stack-card.gone { transform: translate(-130%, -10%) rotate(-22deg) !important; opacity: 0; pointer-events: none; }
.stack-card.gone.right { transform: translate(130%, -10%) rotate(22deg) !important; }
.stack-card.reveal-burst::before {
    content: ""; position: absolute; inset: -30%; z-index: -1; border-radius: 50%;
    background: radial-gradient(circle, var(--burst, #a855f7) 0%, transparent 65%); animation: burst 1.1s ease-out forwards;
}
@keyframes burst { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
.stack-card.reveal-shake { animation: reveal-shake .5s ease; }
@keyframes reveal-shake { 20% { transform: translateX(-6px) rotate(-2deg); } 40% { transform: translateX(6px) rotate(2deg); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }

/* Récapitulatif après ouverture */
.pull-summary { margin-top: 18px; }
.pull-summary .tcg-slot { animation: stack-rise .45s cubic-bezier(.2,1.2,.4,1) both; }
.pull-new { background: #3ecf6e; color: #04210e; border-radius: 999px; padding: 1px 8px; font-weight: 900; font-size: .7rem; }

/* Boîtier gradé : sous-notes et couleur de l'étiquette selon la note. */
.tcg-slab-subs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 10px; text-align: center; }
.tcg-slab-subs span { background: rgba(0,0,0,.35); border-radius: 6px; padding: 3px 0; display: flex; flex-direction: column; }
.tcg-slab-subs small { font-size: .6rem; color: var(--text-faint, #8a93a6); font-weight: 700; }
.tcg-slab-subs b { font-size: .95rem; }
.tcg-slab-subs b.is-top { color: #f2c94c; } .tcg-slab-subs b.is-good { color: #3ecf6e; } .tcg-slab-subs b.is-weak { color: #e5484d; }
.tcg-slab.grade-gem .tcg-slab-label { box-shadow: inset 0 -3px 0 #d4a017; background: linear-gradient(180deg, #fffbe6, #f1dc8a); }
.tcg-slab.grade-gem { box-shadow: inset 0 0 0 2px rgba(255,220,120,.6), 0 0 26px rgba(242,201,76,.35), 0 14px 34px rgba(0,0,0,.5); }
.tcg-slab.grade-low .tcg-slab-label { box-shadow: inset 0 -2px 0 #6b7280; }

/* ========== Classeur (collection) ========== */
.view-toggle { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(255,255,255,.05); margin: 6px 0 14px; }
.view-btn { border: 0; background: none; color: var(--text-dim, #aab3c7); font-weight: 800; padding: 7px 14px; border-radius: 9px; cursor: pointer; }
.view-btn.active { background: var(--accent, #f0b232); color: #1a1405; }
.binder-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 12px; font-weight: 800; }
.binder-book {
    max-width: 760px; margin: 0 auto; padding: 22px; border-radius: 18px; perspective: 1400px;
    background: linear-gradient(135deg, #2b1d12, #4a3222 50%, #2b1d12); box-shadow: inset 0 0 0 3px #1a1109, 0 20px 50px rgba(0,0,0,.5);
}
.binder-page {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 16px; border-radius: 10px;
    background: linear-gradient(180deg, #e9e4d8, #d8d2c3); box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
    transform-origin: left center;
}
.binder-page.turn-left { animation: page-turn-left .45s ease both; }
.binder-page.turn-right { animation: page-turn-right .45s ease both; }
@keyframes page-turn-left { from { transform: rotateY(40deg); opacity: .2; } }
@keyframes page-turn-right { from { transform: rotateY(-40deg); opacity: .2; } }
.binder-sleeve { position: relative; padding: 6px; border-radius: 8px; background: rgba(255,255,255,.35); box-shadow: inset 0 0 0 1px rgba(255,255,255,.7), inset 0 2px 6px rgba(0,0,0,.12); }
.binder-sleeve::after { /* pochette plastique */
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: linear-gradient(120deg, rgba(255,255,255,.35), transparent 30%, transparent 70%, rgba(255,255,255,.2));
}
.binder-empty {
    aspect-ratio: 63 / 88; border-radius: 10px; border: 2px dashed rgba(0,0,0,.18); display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 4px; color: rgba(0,0,0,.4); text-align: center; padding: 8px;
}
.binder-empty b { font-size: .9rem; color: rgba(0,0,0,.5); }
.binder-empty small { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; }

.tcg-actions { display: flex; gap: 6px; }
.tcg-actions > :first-child { flex: 1; }
.tcg-slot .tcg-actions .btn { width: auto; }
.pin-btn { flex: none; opacity: .55; }
.pin-btn.pinned { opacity: 1; background: color-mix(in srgb, var(--accent, #f0b232) 30%, transparent); box-shadow: inset 0 0 0 1px var(--accent, #f0b232); }

/* Vitrine du profil */
.card-showcase { margin: 18px 0; }
.card-showcase-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; align-items: end; }
.card-showcase-slot { min-width: 0; }
.card-showcase.is-empty p { margin: 0; }
