/* Les Cartes des Potes : cartes de collection et scène d'ouverture du booster.
   Effets légers : dégradés, transform et opacity (composités par le GPU), pas de filtres lourds ni de flou animé. */

/* ---------- Carte ---------- */
/* Commune → Ultra Rare : cadre classique de plus en plus fin. Épique : cadre épique, fond du texte en fondu.
   Légendaire et Secrète : Full Art, sans cadre ni fond de texte. */
.tc {
  --frame-a: #8e8aa6; --frame-b: #4d4963; --ink: #f6f4ff; --accent-r: #c9c6d8; --pad: 4.2cqw;
  position: relative; width: 100%; aspect-ratio: 5 / 7; container-type: inline-size;
  border-radius: 5.5% / 3.93%; overflow: hidden; color: var(--ink);
  background: linear-gradient(155deg, var(--frame-a), var(--frame-b));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 0 0 1px rgba(0, 0, 0, .35), 0 10px 26px rgba(0, 0, 0, .45);
  font-size: 12px;
}
.tc-in {
  position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr auto auto;
  gap: 2.4cqw; padding: var(--pad) var(--pad) 2.2cqw;
}
.tc.r-C { --frame-a: #e2e1ea; --frame-b: #8f8c9f; --accent-r: #f1f0f5; --pad: 5.6cqw; }
.tc.r-PCm { --frame-a: #7b788a; --frame-b: #33313d; --accent-r: #c9c7d4; --pad: 4.5cqw; }
.tc.r-R { --frame-a: #d99a5b; --frame-b: #7a4516; --accent-r: #ecc08f; --pad: 3.4cqw; }
.tc.r-UR { --frame-a: #6fb2ff; --frame-b: #1a4aa3; --accent-r: #c3e0ff; --pad: 2.3cqw; }

.tc-title {
  display: flex; align-items: baseline; justify-content: space-between; gap: 2cqw;
  padding: 1.8cqw 3cqw; border-radius: 2.6cqw; background: rgba(12, 10, 24, .72);
}
.tc-name { font-weight: 800; font-size: 13px; font-size: 6.3cqw; line-height: 1.1; overflow-wrap: normal; }
.tc-no { font-size: 9px; font-size: 3.6cqw; opacity: .75; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tc-art { position: relative; min-height: 0; border-radius: 3cqw; overflow: hidden; box-shadow: 0 0 0 .8cqw rgba(0, 0, 0, .35); }
.art-svg { display: block; width: 100%; height: 100%; }
.art-img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; user-select: none; -webkit-user-drag: none; }
.tc-text { display: grid; gap: 1.6cqw; padding: 2.4cqw 3cqw; border-radius: 2.6cqw; background: rgba(12, 10, 24, .78); }
.tc-desc { margin: 0; font-size: 11px; font-size: 4.6cqw; line-height: 1.3; }
.tc-personne { margin: 0; font-size: 10px; font-size: 4.2cqw; font-weight: 800; letter-spacing: .02em; color: #ffd36b; }
.tc-slogan {
  margin: 0; padding-top: 1.6cqw; border-top: 1px solid color-mix(in srgb, var(--accent-r) 45%, transparent);
  font-size: 10px; font-size: 4.2cqw; font-style: italic; font-weight: 700; color: var(--accent-r);
}
.tc-finish { position: absolute; left: 5cqw; bottom: 1.2cqw; font-size: 7px; font-size: 2.8cqw; letter-spacing: .04em; opacity: .7; text-transform: uppercase; }
.tc-uid { position: absolute; right: 5cqw; bottom: 1.2cqw; font: 7px ui-monospace, monospace; font-size: 2.8cqw; opacity: .55; }
.tc-count { position: absolute; right: 2cqw; top: 2cqw; z-index: 3; padding: 1.2cqw 3.4cqw; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-weight: 900; font-size: 14px; font-size: clamp(12px, 11cqw, 20px); line-height: 1; text-align: center; border: 2px solid #15121f; box-shadow: 0 2px 0 #15121f; }
.tc-full .tc-text, .tc-full .tc-title { position: relative; z-index: 2; }

/* Épique : cadre épique (double filet lumineux) et fond du texte en fondu sur l'illustration. */
.tc.r-E {
  --frame-a: #c995ff; --frame-b: #4f2385; --accent-r: #ead6ff; --pad: 3cqw;
  background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, .35), transparent 45%), linear-gradient(155deg, #d7b0ff, #7a3cc4 45%, #3c1670);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .4), 0 0 22px rgba(170, 110, 240, .45), 0 10px 26px rgba(0, 0, 0, .45);
}
.tc.r-E .tc-in { box-shadow: 0 0 0 .7cqw rgba(240, 220, 255, .55) inset, 0 0 0 1.6cqw rgba(90, 40, 150, .65) inset; }
.tc-full.r-E .tc-art, .tc-full.r-E .tc-text { grid-column: 1; }
.tc-full.r-E .tc-art { grid-row: 2 / 4; }
.tc.r-E .tc-text {
  grid-row: 3; align-self: end; position: relative; z-index: 2; border-radius: 0 0 3cqw 3cqw;
  background: linear-gradient(to top, rgba(26, 10, 46, .94) 0%, rgba(26, 10, 46, .82) 55%, rgba(26, 10, 46, 0) 100%);
  padding-top: 7cqw;
}

/* Finitions.
   Reverse Holo (Commune → Ultra Rare) : seul le CADRE brille ; la photo et les zones de texte restent intactes
   (le reflet est un fond de la carte, recouvert par l'illustration et les textes).
   Holo (Commune → Épique) : le reflet est sur la PHOTO uniquement. */
.tc.f-reverse:not(.r-E):not(.tc-fullart) {
  background:
    repeating-linear-gradient(120deg, rgba(255, 255, 255, 0) 0 6cqw, rgba(255, 255, 255, .45) 7cqw, rgba(255, 255, 255, 0) 9cqw),
    linear-gradient(calc(120deg + var(--mx, .5) * 60deg), rgba(255, 154, 213, .55), rgba(154, 216, 255, .55), rgba(198, 255, 154, .55), rgba(255, 226, 154, .55)),
    linear-gradient(155deg, var(--frame-a), var(--frame-b));
}
.tc-sheen { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.tc.f-holo .tc-sheen, .tc.r-E .tc-sheen {
  opacity: .55; mix-blend-mode: color-dodge;
  background: linear-gradient(115deg, transparent 20%, #ff6bd5 32%, #ffe66b 42%, #6bffb8 52%, #6bc8ff 62%, transparent 75%);
  background-size: 260% 260%;
  background-position: calc(var(--mx, .5) * 100%) calc(var(--my, .5) * 100%);
}
.tc-full.f-holo .tc-sheen, .tc-full.r-E .tc-sheen { animation: holo-drift 5s ease-in-out infinite alternate; }
@keyframes holo-drift { from { background-position: 0% 30%; } to { background-position: 100% 70%; } }

/* Full Art : Légendaire (or) et Secrète (prismatique). La photo recouvre toute la carte ;
   ni cadre, ni fond derrière les textes : lisibilité assurée par une ombre portée sur le texte. */
.tc-fullart { background: #120f1e; }
.tc-fullart .tc-in { padding: 0; gap: 0; }
.tc-fullart .tc-art { position: absolute; inset: 0; border-radius: 0; box-shadow: none; }
.tc-fullart .tc-title { margin: 4cqw 4cqw 0; padding: 0; background: none; }
.tc-fullart .tc-text { grid-row: 3; margin: 0 5cqw 1cqw; padding: 0; background: none; }
.tc-fullart .tc-title, .tc-fullart .tc-text { position: relative; z-index: 2; text-shadow: 0 1px 2px rgba(0, 0, 0, .95), 0 0 10px rgba(0, 0, 0, .8); }
.tc-fullart .tc-finish, .tc-fullart .tc-uid { z-index: 2; text-shadow: 0 1px 2px #000; }
.tc.r-L { --accent-r: #ffe08a; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5), 0 10px 26px rgba(0, 0, 0, .5); }
.tc-full.r-L { animation: gold-glow 3s ease-in-out infinite; }
@keyframes gold-glow { 50% { box-shadow: 0 0 0 1px rgba(0, 0, 0, .5), 0 0 30px rgba(255, 200, 70, .7), 0 10px 26px rgba(0, 0, 0, .5); } }
.tc.r-L .tc-sheen {
  opacity: 1; mix-blend-mode: soft-light;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 236, 150, .95) 48%, rgba(255, 255, 255, .9) 50%, rgba(255, 210, 90, .9) 52%, transparent 65%);
  background-size: 300% 100%; animation: gold-sweep 4.5s ease-in-out infinite;
}
@keyframes gold-sweep { 0%, 35% { background-position: 120% 0; } 75%, 100% { background-position: -40% 0; } }
.tc.r-S { --accent-r: #c8f4ff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5), 0 10px 26px rgba(0, 0, 0, .5); }
.tc-full.r-S { animation: prism-glow 6s linear infinite; }
@keyframes prism-glow {
  0%, 100% { box-shadow: 0 0 26px rgba(255, 107, 154, .55), 0 10px 26px rgba(0, 0, 0, .5); }
  33% { box-shadow: 0 0 26px rgba(125, 255, 178, .55), 0 10px 26px rgba(0, 0, 0, .5); }
  66% { box-shadow: 0 0 26px rgba(107, 208, 255, .55), 0 10px 26px rgba(0, 0, 0, .5); }
}
.tc.r-S::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; mix-blend-mode: color-dodge; opacity: .55;
  background: conic-gradient(from calc(var(--mx, .5) * 360deg) at calc(var(--mx, .5) * 100%) calc(var(--my, .5) * 100%),
    #ff6b9a, #ffd36b, #7dffb2, #6bd0ff, #b48bff, #ff6b9a);
  animation: prism-breathe 6s ease-in-out infinite alternate;
}
.tc.r-S .tc-sheen {
  opacity: .7; mix-blend-mode: overlay;
  background: repeating-linear-gradient(60deg, rgba(255, 255, 255, 0) 0 4cqw, rgba(255, 255, 255, .5) 5cqw, rgba(255, 255, 255, 0) 7cqw);
}
@keyframes prism-breathe { from { opacity: .35; } to { opacity: .65; } }

/* Variante miniature (collection, récapitulatifs) : titre + illustration, sans texte ni animation continue. */
.tc-mini .tc-in { gap: 3cqw; grid-template-rows: auto 1fr auto; }
.tc-mini .tc-name { font-size: 7.5cqw; }
.tc-mini .tc-no { display: none; }
.tc-mini .tc-finish { left: 4cqw; bottom: 1.4cqw; font-size: 6px; font-size: 5.2cqw; opacity: .8; }
.tc-retiree { position: absolute; left: 50%; bottom: 22%; transform: translateX(-50%); white-space: nowrap; z-index: 3; padding: .5cqw 2.4cqw; border-radius: 99px; background: #15121f; color: #ffd3a1; font-weight: 800; font-size: 9px; font-size: 4.5cqw; }
.tc-mini.tc-fullart .tc-title { margin: 3cqw; }
.tc-mini .tc-sheen, .tc-mini.r-S::after, .tc-mini.r-L, .tc-mini.r-S { animation: none; }

/* Symbole de rareté : sous la carte, centré. */
.tc-sym { position: relative; z-index: 2; display: grid; place-items: center; min-height: 6cqw; }
.tc-fullart .tc-sym { grid-row: 4; padding-bottom: 2cqw; }
.tc-sym .rsym { width: 9cqw; height: 9cqw; min-width: 14px; min-height: 14px; }
.tc-mini .tc-sym .rsym { width: 12cqw; height: 12cqw; }
.tc-full .rsym-L { filter: drop-shadow(0 0 6px rgba(255, 200, 70, .9)); animation: sym-shine 2.4s ease-in-out infinite; }
.tc-full .rsym-S { animation: sym-prism 4s linear infinite; }
@keyframes sym-shine { 50% { filter: drop-shadow(0 0 12px rgba(255, 220, 110, 1)); } }
@keyframes sym-prism { to { filter: hue-rotate(360deg) drop-shadow(0 0 8px rgba(190, 150, 255, .9)); } }

/* ---------- Scène d'ouverture ---------- */
.scene {
  /* --scene-reserve : hauteur hors scène (en-tête, « Tout révéler » + options, barre du bas) ; tout tient sans défiler. */
  --cw: min(78vw, 320px, max(118px, calc((100vh - var(--scene-reserve, 392px)) * .62)));
  --cw: min(78vw, 320px, max(118px, calc((100svh - var(--scene-reserve, 392px) - var(--safe-b)) * .62)));
  /* --top : place réservée au-dessus de la pile pour que la carte levée reste entièrement visible à l'arrêt. */
  --top: calc(var(--cw) * .15 + 10px);
  position: relative; margin: 0 auto; width: 100%; max-width: 520px;
  /* Sous la pile : le bas du booster fermé (+20 px) puis la ligne d'indication. */
  height: calc(var(--cw) * 1.4 + var(--top) + 40px); min-height: 220px;
  touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  cursor: pointer; outline: none; overflow: hidden;
  isolation: isolate; /* les plans de la pile restent sous l'en-tête collant de la page */
}
.scene:focus-visible { box-shadow: 0 0 0 3px var(--accent) inset; border-radius: var(--radius); }
.scene-hint {
  position: absolute; left: 0; right: 0; bottom: 2px; margin: 0; text-align: center; font-size: .9rem; color: var(--muted);
  pointer-events: none;
}
.scene[data-waiting="true"] .scene-hint { color: var(--text); animation: hint-pulse 1.6s ease-in-out infinite; }
@keyframes hint-pulse { 50% { opacity: .55; } }
.scene-badge { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); z-index: 300; margin: 0; padding: 6px 14px; font-size: 1rem; white-space: nowrap; }
.scene-glow {
  position: absolute; left: 50%; top: calc(var(--top) - 10px); width: calc(var(--cw) * 1.6); height: calc(var(--cw) * 1.6); margin-left: calc(var(--cw) * -.8);
  border-radius: 50%; opacity: 0; pointer-events: none; will-change: transform, opacity;
  background: radial-gradient(circle, rgba(255, 246, 214, .95) 0%, rgba(255, 214, 120, .45) 28%, rgba(255, 180, 80, 0) 62%);
}
.scene.is-dore .scene-glow { background: radial-gradient(circle, #fff6c8 0%, rgba(255, 196, 64, .6) 30%, rgba(255, 170, 40, 0) 64%); }
.scene.is-diamant .scene-glow { background: radial-gradient(circle, #f0fdff 0%, rgba(120, 225, 255, .6) 30%, rgba(80, 180, 255, 0) 64%); }

/* Booster physique : feuille métallisée, haut détachable le long d'une ligne dentelée. */
.pack3d {
  position: absolute; z-index: 200; left: 50%; top: var(--top);
  width: calc(var(--cw) * 1.02); height: calc(var(--cw) * 1.4 + 20px); margin-left: calc(var(--cw) * -.51);
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, .5));
  will-change: transform, opacity; /* animé pendant l'ouverture : calque GPU, pas de recalcul sur iPhone */
}
.pack3d-top, .pack3d-body {
  position: absolute; left: 0; right: 0;
  background-image: var(--pack-image);
  background-repeat: no-repeat;
  background-size: 100% calc(var(--cw) * 1.4 + 20px);
}
.pack3d-top {
  top: 0; height: 15%; background-position: top; transform-origin: 0 100%; will-change: transform, opacity;
  clip-path: polygon(0 0, 100% 0, 100% 78%, 95% 100%, 90% 80%, 85% 100%, 80% 80%, 75% 100%, 70% 80%, 65% 100%, 60% 80%, 55% 100%, 50% 80%, 45% 100%, 40% 80%, 35% 100%, 30% 80%, 25% 100%, 20% 80%, 15% 100%, 10% 80%, 5% 100%, 0 78%);
  border-radius: 10px 10px 0 0;
}
.pack3d-body {
  top: 12%; bottom: 0; background-position: bottom; border-radius: 0 0 10px 10px;
  clip-path: polygon(0 3%, 5% 0, 10% 3%, 15% 0, 20% 3%, 25% 0, 30% 3%, 35% 0, 40% 3%, 45% 0, 50% 3%, 55% 0, 60% 3%, 65% 0, 70% 3%, 75% 0, 80% 3%, 85% 0, 90% 3%, 95% 0, 100% 3%, 100% 100%, 0 100%);
}
.scene.is-busy .pack3d { animation: pack-shake .5s ease-in-out infinite; }
@keyframes pack-shake { 25% { transform: rotate(-1.2deg); } 75% { transform: rotate(1.2deg); } }

/* Pile de cartes : la carte affichée au premier plan, les suivantes légèrement relevées derrière. */
.stack { position: absolute; left: 50%; top: var(--top); width: var(--cw); margin-left: calc(var(--cw) * -.5); height: calc(var(--cw) * 1.4 + 40px); will-change: transform, opacity; }
.sc { position: absolute; left: 0; top: 0; width: 100%; will-change: transform, opacity; transform-origin: 50% 60%; }
.stack-depth { position: absolute; left: 0; right: 0; top: 0; aspect-ratio: 5 / 7; pointer-events: none; }
.stack-depth::before, .stack-depth::after {
  content: ""; position: absolute; left: 3%; right: 3%; height: 100%; border-radius: calc(var(--cw) * .055);
  background: linear-gradient(180deg, #3a3358, #221d36); box-shadow: 0 0 0 1px rgba(0, 0, 0, .4);
}
.stack-depth::before { top: 7px; left: 4%; right: 4%; }
.stack-depth::after { top: 13px; left: 7%; right: 7%; opacity: .7; }
/* Carte Épique, Légendaire ou Secrète en attente : seul son bas (avec son logo) dépasse sous la carte précédente.
   L'effet de rareté entoure la partie découverte (la carte précédente recouvre le reste). */
.sc.is-teasing .tc { animation: tease-pulse 1.4s ease-in-out infinite; }
.sc.tease-E .tc { --tease: rgba(165, 100, 235, .95); }
.sc.tease-L .tc { --tease: rgba(255, 200, 60, 1); }
.sc.tease-S .tc { --tease: rgba(180, 140, 255, 1); }
.sc.tease-L .tc-sym .rsym { filter: drop-shadow(0 0 12px rgba(255, 210, 80, 1)); }
.sc.tease-S .tc-sym .rsym { animation: sym-prism 2.5s linear infinite; }
.sc.tease-E .tc-sym .rsym { filter: drop-shadow(0 0 10px rgba(180, 120, 245, 1)); }
.best-badge { background: var(--surface-2); color: var(--text); border-radius: 99px; font-weight: 800; font-size: .85rem; border: 1px solid var(--accent); }
.sc-best .tc { box-shadow: 0 0 0 2px var(--accent), 0 0 30px rgba(255, 201, 74, .45), 0 14px 30px rgba(0, 0, 0, .5); }
@keyframes tease-pulse { 0%, 100% { box-shadow: 0 0 0 2px var(--tease), 0 0 18px var(--tease); } 50% { box-shadow: 0 0 0 3px var(--tease), 0 0 38px var(--tease); } }

/* Lueurs propres à la rareté pendant la révélation (étape « symbole »). */
.scene.glow-E .scene-glow { opacity: 1 !important; background: radial-gradient(circle, rgba(225, 190, 255, .9), rgba(155, 85, 220, .45) 35%, transparent 64%); animation: glow-pulse 1.4s ease-in-out infinite; }
.scene.glow-L .scene-glow {
  opacity: 1 !important; animation: rays-spin 9s linear infinite;
  background: radial-gradient(circle, rgba(255, 244, 200, .95) 0 12%, transparent 40%), repeating-conic-gradient(rgba(255, 205, 80, .45) 0 9deg, transparent 9deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 30%, transparent 66%); mask: radial-gradient(circle, #000 30%, transparent 66%);
}
.scene.glow-S .scene-glow {
  opacity: 1 !important; animation: rays-spin 6s linear infinite;
  background: conic-gradient(#ff6b9a, #ffd36b, #7dffb2, #6bd0ff, #b48bff, #ff6b9a);
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 62%); mask: radial-gradient(circle, #000 20%, transparent 62%);
}
@keyframes glow-pulse { 50% { transform: scale(1.08); } }
@keyframes rays-spin { to { transform: rotate(360deg); } }
.sc-flash { position: absolute; inset: 0; z-index: 250; pointer-events: none; opacity: 0; }
.fl-E { background: radial-gradient(circle at 50% 40%, rgba(255, 220, 245, .95), rgba(255, 120, 210, .4) 40%, transparent 70%); }
.fl-L { background: radial-gradient(circle at 50% 40%, #fffbe8, rgba(255, 210, 90, .7) 40%, transparent 72%); }
.fl-S { background: radial-gradient(circle at 50% 40%, #ffffff, rgba(200, 170, 255, .6) 35%, transparent 70%), conic-gradient(rgba(255, 107, 154, .5), rgba(255, 211, 107, .5), rgba(125, 255, 178, .5), rgba(107, 208, 255, .5), rgba(180, 139, 255, .5), rgba(255, 107, 154, .5)); }

/* Miniature du récapitulatif : bouton sans habillage ; carte en grand par-dessus la page. */
.recap-btn { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; border-radius: 6px; }
.recap-btn:hover .tc { transform: translateY(-3px); }
.recap-btn .tc { transition: transform .15s ease; }
.card-viewer {
  position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px));
  background: rgba(8, 6, 16, .86); animation: viewer-in .2s ease-out;
}
.card-viewer-boutons { display: flex; gap: 10px; justify-content: center; }
.card-viewer-card { width: min(86vw, 380px, calc((100vh - 140px) * .71)); width: min(86vw, 380px, calc((100svh - 140px) * .71)); }
.card-viewer:has(.carte-vente) .card-viewer-card { width: min(80vw, 350px, calc((100svh - 226px) * .71)); }
.carte-vente { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: min(90vw, 360px); text-align: center; }
.carte-vente > span { flex-basis: 100%; }
.carte-origines { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; flex-basis: 100%; }
.carte-origines .carte-origine { min-height: 44px; margin: 0; border: 1px solid transparent; cursor: pointer; }
.carte-origines .carte-origine[aria-pressed="true"] { border-color: currentColor; }
.carte-origines .carte-origine:focus-visible { outline-offset: 2px; }
.card-viewer:has(.carte-origines) .card-viewer-card { width: min(80vw, 350px, calc((100svh - 250px) * .71)); }
.carte-sorties { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.carte-sorties .btn { padding-inline: 12px; }
.carte-origine { display: inline-block; max-width: 100%; margin-top: 4px; padding: 3px 6px; border-radius: 6px; font-size: .7rem; font-weight: 650; line-height: 1.2; overflow-wrap: anywhere; }
.origine-standard { background: #343140; color: #e2dcea; }
.origine-fidelite { background: #382b4a; color: #ecdcff; }
.origine-recyclage { background: #243c39; color: #c9f1e6; }
.carte-vente > .carte-origine { flex-basis: auto; }
@keyframes viewer-in { from { opacity: 0; } }

/* Collection : grille de miniatures. */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 12px 10px; list-style: none; margin: 0; padding: 0; }
@media (min-width: 700px) { .card-grid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); } }

/* Récapitulatif d'un booster ouvert. */
.recap { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; width: min(100%, 270px); margin: 4px auto; padding: 4px; list-style: none; }
.opening-end > p { margin-block: 6px; }
.opening-end > .actions { margin-block: 8px 0; gap: 6px; }
.scene[data-step="done"]:has(+ .opening-end) { --cw: clamp(54px, 9dvh, 94px); --top: 4px; height: calc(var(--cw) * 1.4 + 32px); min-height: 0; margin-block: 0; }
.scene[data-step="done"]:has(+ .opening-end) .scene-badge { top: auto; bottom: 1px; padding: 2px 9px; font-size: .74rem; }
@media (max-height: 680px) {
  .recap { grid-template-columns: repeat(8, minmax(0, 1fr)); width: min(100%, 440px); gap: 4px; }
}
@media (min-width: 700px) { .recap { grid-template-columns: repeat(8, minmax(0, 1fr)); width: min(100%, 580px); } }
@media (orientation: landscape) and (max-height: 600px) and (min-width: 600px) {
  .opening-finished { display: grid; grid-template-columns: minmax(134px, .3fr) minmax(0, 1fr); align-items: center; }
  .opening-finished .recap { width: min(100%, 420px); }
}

@media (prefers-reduced-motion: reduce) {
  .tc .tc-sheen, .tc::after, .rsym, .pack3d, .sc.is-teasing .tc, .scene-glow { animation: none !important; }
}

/* ---------- Style cartoon ----------
   Traits d'encre épais, ombre dure décalée (sans flou), couleurs franches, reflets en aplats nets. */
/* Sur .tc elle-même, cqw se rapporte à l'écran (pas à la carte) : épaisseurs bornées, plus fines sur les miniatures. */
.tc { --ink-line: #15121f; outline: clamp(1.5px, 1.1cqw, 3px) solid var(--ink-line); outline-offset: -1px; filter: drop-shadow(clamp(2px, 1.8cqw, 6px) clamp(2px, 1.8cqw, 6px) 0 var(--ink-line)); }
.tc-mini { outline-width: 1.5px; filter: drop-shadow(2px 2px 0 var(--ink-line)); }
.tc-title, .tc-text:not(.tc-fullart .tc-text):not(.r-E .tc-text) { border: max(1px, .6cqw) solid var(--ink-line); }
.tc-art { box-shadow: 0 0 0 max(1.5px, .8cqw) var(--ink-line); }
.tc-fullart .tc-art { box-shadow: none; }
.tc-name { font-weight: 900; letter-spacing: .01em; -webkit-text-stroke: max(1px, .5cqw) var(--ink-line); paint-order: stroke fill; }
.art-svg { filter: saturate(1.3) contrast(1.08); }
/* Holo : bandes de couleur nettes (aplats) au lieu d'un dégradé doux. */
.tc.f-holo .tc-sheen, .tc.r-E .tc-sheen {
  background: linear-gradient(115deg, transparent 0 30%, #ff6bd5 30% 38%, #ffe66b 38% 46%, #6bffb8 46% 54%, #6bc8ff 54% 62%, transparent 62%);
  background-size: 260% 260%;
}
/* Reverse : trame de points façon bande dessinée sur le cadre. */
.tc.f-reverse:not(.r-E):not(.tc-fullart) {
  background:
    radial-gradient(circle, rgba(255, 255, 255, .55) 28%, transparent 30%) 0 0 / 4cqw 4cqw,
    linear-gradient(calc(120deg + var(--mx, .5) * 60deg), #ff9ad5, #9ad8ff, #c6ff9a, #ffe29a);
}
/* Légendaire : éclat doré en bande nette. Secrète : prisme en secteurs francs. */
.tc.r-L .tc-sheen { background: linear-gradient(105deg, transparent 0 44%, rgba(255, 236, 150, .95) 44% 49%, #fff 49% 51%, rgba(255, 210, 90, .95) 51% 56%, transparent 56%); background-size: 300% 100%; }
.tc.r-S::after { background: conic-gradient(from calc(var(--mx, .5) * 360deg), #ff6b9a 0 16%, #ffd36b 0 33%, #7dffb2 0 50%, #6bd0ff 0 66%, #b48bff 0 83%, #ff6b9a 0); }

/* Normale et Holo (Commune → Ultra Rare) : cadre noir, seul le logo de rareté garde sa couleur (demande de Simon du 06/11).
   Holo : le logo de rareté est lui aussi holographique. Le cadre Reverse reste inchangé. */
.tc.tc.f-normale, .tc.tc.f-holo { --frame-a: #24212e; --frame-b: #050409; }
.tc.f-holo .tc-sym .rsym { animation: sym-holo 4s linear infinite; }
@keyframes sym-holo {
  0% { filter: hue-rotate(0deg) saturate(1.6) brightness(1.15) drop-shadow(0 0 2px rgba(255, 255, 255, .9)); }
  100% { filter: hue-rotate(360deg) saturate(1.6) brightness(1.15) drop-shadow(0 0 2px rgba(255, 255, 255, .9)); }
}
.tc-mini.f-holo .tc-sym .rsym { animation-duration: 6s; }
.reduce-motion .tc.f-holo .tc-sym .rsym { animation: none; filter: saturate(1.6) brightness(1.15) drop-shadow(0 0 2px rgba(255, 255, 255, .9)); }
@media (prefers-reduced-motion: reduce) { .tc.f-holo .tc-sym .rsym { animation: none; } }

/* ---------- Mise en page unifiée (demande de Simon du 06/11) ----------
   Même cadre d'image pour toutes les cartes (titre d'une ligne | image | logo), texte posé en fondu sur le bas de l'image
   (3 lignes au plus), slogan sur une ligne dans une police distincte. Légendaire : titre en bas, sans cadre. */
.tc.tc { --pad: 4cqw; }
.tc .tc-in { grid-template-rows: auto minmax(0, 1fr) auto; gap: 2.4cqw; }
.tc .tc-title { grid-row: 1; grid-column: 1; min-width: 0; }
.tc .tc-sym { grid-row: 3; grid-column: 1; }
.tc .tc-art { grid-row: 2; grid-column: 1; }
.tc-name {
  display: block; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: min(6.2cqw, calc(150cqw / var(--len, 20)));
}
.tc-mini .tc-name { font-size: min(7.5cqw, calc(160cqw / var(--len, 20))); }
.tc.tc-full:not(.tc-fullart) .tc-text {
  grid-row: 2; grid-column: 1; align-self: end; position: relative; z-index: 2; margin: 0; border: 0;
  border-radius: 0 0 3cqw 3cqw; padding: 9cqw 3.4cqw 2.6cqw;
  background: linear-gradient(to top, rgba(10, 8, 20, .9) 0%, rgba(10, 8, 20, .78) 55%, rgba(10, 8, 20, 0) 100%);
}
.tc-desc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; font-size: 4.4cqw; line-height: 1.28; }
.tc-slogan {
  border: 0; padding: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-family: "Comic Sans MS", "Chalkboard SE", "Marker Felt", "Segoe Print", cursive; font-style: normal; font-weight: 700;
  color: #ffd36b; letter-spacing: .02em; text-shadow: 0 1px 0 #15121f;
  font-size: min(4.6cqw, calc(140cqw / var(--len, 26)));
}
.tc-slogan::before { content: "« "; } .tc-slogan::after { content: " »"; }
.tc-uid { opacity: .7; }
/* Full Art : l'image couvre la carte ; titre et textes sans cadre ni fond, lisibles grâce à l'ombre portée. */
.tc-fullart .tc-in { grid-template-rows: minmax(0, 1fr) auto auto auto; }
.tc-fullart .tc-title { border: 0; background: none; }
.tc-fullart .tc-text { grid-row: 3; }
.tc-fullart .tc-sym { grid-row: 4; }
.tc-fullart.r-L .tc-title { grid-row: 2; margin: 0 5cqw 1.5cqw; padding: 0; }
.tc-fullart.r-S .tc-title { grid-row: 1; }
.tc-mini.tc-fullart.r-L .tc-title { margin: 0 3cqw 2cqw; }
/* Photo entière visible (contain) sur un fond flou de la même photo ; Full Art : photo plein cadre. */
.art-photo { position: absolute; inset: 0; overflow: hidden; background: #0c0a16; }
.art-photo .art-fond { position: absolute; inset: -10%; width: 120%; height: 120%; object-fit: cover; filter: blur(8px) brightness(.55) saturate(1.2); }
.art-photo .art-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center; }
.tc-fullart .art-photo .art-img { object-fit: cover; object-position: center 30%; }
.tc-fullart .art-photo .art-fond { display: none; }
.tc.tc-fullart .tc-art { grid-area: auto; } /* image absolue : toute la carte, pas une ligne de la grille */
.tc-fullart.r-S .tc-title { align-self: start; }
/* Aucun texte coupé (06/11) : la taille s'adapte à la longueur (titre et slogan : 1 ligne ; texte : 3 lignes). */
.tc .tc-name { overflow: visible; text-overflow: clip; font-size: min(6.2cqw, calc(132cqw / var(--len, 20))); }
.tc-mini .tc-name { font-size: min(7.5cqw, calc(140cqw / var(--len, 20))); }
.tc .tc-desc { display: block; -webkit-line-clamp: unset; line-clamp: none; overflow: visible; font-size: min(4.4cqw, calc(460cqw / var(--len, 110))); }
.tc .tc-slogan { overflow: visible; text-overflow: clip; font-size: min(4.6cqw, calc(128cqw / var(--len, 26))); }
/* Fondu opaque derrière les textes : plein en bas, transparent en haut (lisibilité), aussi sur les Full Art. */
.tc-fullart .tc-in::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 48%; z-index: 1; pointer-events: none;
  background: linear-gradient(to top, rgba(10, 8, 20, .92) 0%, rgba(10, 8, 20, .75) 45%, rgba(10, 8, 20, 0) 100%);
}
.tc-fullart.r-S:not(:has(.tc-text)) .tc-in::before { display: none; }
.tc-fullart .tc-title, .tc-fullart .tc-text, .tc-fullart .tc-sym { position: relative; z-index: 2; }
.card-viewer-rouage { position: fixed; right: max(12px, env(safe-area-inset-right)); top: max(12px, env(safe-area-inset-top)); z-index: 2;
  display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border-radius: 50%; border: 2px solid #15121f; background: var(--accent); color: var(--accent-ink); cursor: pointer; }
.card-viewer-rouage .ico { width: 26px; height: 26px; }
/* Polices (06/11) : slogan plus petit, police à empattements en italique ; titres un peu plus grands. */
.tc .tc-slogan { font-family: Georgia, "Times New Roman", "Palatino Linotype", serif; font-style: italic; font-weight: 700; letter-spacing: .01em;
  font-size: min(3.8cqw, calc(112cqw / var(--len, 26))); }
.tc .tc-name { font-size: min(6.9cqw, calc(132cqw / var(--len, 20))); }
.tc-mini .tc-name { font-size: min(8.2cqw, calc(122cqw / var(--len, 20))); }
/* Slogan (06/11, 2e réglage) : petites capitales espacées, police sans empattements étroite, plus petit. */
.tc .tc-slogan { font-family: "Arial Narrow", "Roboto Condensed", "Segoe UI", "Helvetica Neue", Arial, sans-serif; font-style: normal; font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em; font-size: min(3.1cqw, calc(96cqw / var(--len, 26))); }
.tc .tc-slogan::before, .tc .tc-slogan::after { content: none; }
/* Slogan (06/11, 3e réglage) : petite police élégante, italique à empattements fins, casse normale, sans espacement. */
.tc .tc-slogan { font-family: "Palatino Linotype", "Book Antiqua", Palatino, Garamond, "Hoefler Text", Georgia, serif; font-style: italic; font-weight: 500;
  text-transform: none; letter-spacing: 0; font-size: min(3.4cqw, calc(100cqw / var(--len, 26))); }
/* Slogan (06/11, 4e réglage) : guillemets « » obligatoires ; police humaniste élégante (Optima / Candara), italique. */
.tc .tc-slogan { font-family: Optima, Candara, "Gill Sans", "Gill Sans MT", "Segoe UI", sans-serif; font-style: italic; font-weight: 600; letter-spacing: .01em; }
.tc .tc-slogan::before { content: "«\00a0"; }
.tc .tc-slogan::after { content: "\00a0»"; }
/* Secrète (06/11) : même balayage que la Légendaire, mais en bande prismatique (arc-en-ciel) au lieu de dorée. */
.tc.r-S::after { display: none; }
.tc.r-S .tc-sheen {
  opacity: 1; mix-blend-mode: color-dodge;
  background: linear-gradient(105deg, transparent 0 38%, rgba(255, 107, 154, .85) 41%, rgba(255, 211, 107, .9) 44%, rgba(125, 255, 178, .9) 47%,
    rgba(255, 255, 255, .95) 50%, rgba(107, 208, 255, .9) 53%, rgba(180, 139, 255, .85) 56%, transparent 59%);
  background-size: 300% 100%; animation: gold-sweep 4.5s ease-in-out infinite;
}
.tc-mini.r-S .tc-sheen { animation: none; background-position: 60% 0; opacity: .55; }
.tc.r-S .tc-sheen { mix-blend-mode: screen;
  background: linear-gradient(105deg, transparent 0 34%, rgba(255, 107, 154, .55) 38%, rgba(255, 211, 107, .65) 42%, rgba(125, 255, 178, .65) 46%,
    rgba(255, 255, 255, .8) 50%, rgba(107, 208, 255, .65) 54%, rgba(180, 139, 255, .6) 58%, rgba(255, 107, 154, .45) 62%, transparent 66%);
  background-size: 300% 100%; }

/* ---------- Holo et Reverse revus (06/11) ----------
   Holo (photo) : film irisé en fines bandes + reflet blanc qui glisse ; la photo reste lisible.
   Reverse (cadre seulement) : arc-en-ciel qui défile lentement et paillettes ; la photo reste intacte. */
.tc.f-holo .tc-sheen, .tc.r-E .tc-sheen {
  opacity: .85; mix-blend-mode: overlay;
  background:
    linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .7) 48%, rgba(255, 255, 255, .85) 50%, rgba(255, 255, 255, .7) 52%, transparent 62%) 0 0 / 300% 100%,
    repeating-linear-gradient(118deg, rgba(255, 107, 213, .45) 0 4%, rgba(255, 230, 107, .45) 4% 8%, rgba(107, 255, 184, .45) 8% 12%, rgba(107, 200, 255, .45) 12% 16%, rgba(180, 139, 255, .45) 16% 20%) 0 0 / 250% 250%;
  animation: holo-foil 6s ease-in-out infinite;
}
@keyframes holo-foil {
  0% { background-position: 130% 0, 0% 0%; }
  50% { background-position: -30% 0, 100% 100%; }
  100% { background-position: 130% 0, 0% 0%; }
}
.tc-mini.f-holo .tc-sheen, .tc-mini.r-E .tc-sheen { animation: none; background-position: 40% 0, 30% 30%; }

.tc.f-reverse:not(.r-E):not(.tc-fullart) {
  background:
    radial-gradient(circle, rgba(255, 255, 255, .9) 0 1.5%, transparent 2.5%) 0 0 / 9cqw 9cqw,
    radial-gradient(circle, rgba(255, 255, 255, .6) 0 1%, transparent 2%) 4.5cqw 4.5cqw / 9cqw 9cqw,
    linear-gradient(120deg, #ff9ad5, #ffe29a, #c6ff9a, #9ad8ff, #c5a8ff, #ff9ad5) 0 0 / 300% 300%;
  animation: reverse-shine 8s linear infinite;
}
@keyframes reverse-shine {
  from { background-position: 0 0, 4.5cqw 4.5cqw, 0% 0%; }
  to { background-position: 9cqw 9cqw, 13.5cqw 13.5cqw, 100% 100%; }
}
.tc-mini.f-reverse { animation: none; }
.reduce-motion .tc .tc-sheen, .reduce-motion .tc.f-reverse { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .tc.f-reverse { animation: none !important; } }

/* ---------- Effet « pétrole » (06/11) : reflets irisés en taches qui ondulent, comme une flaque d'huile ; pas de bandes. ----------
   Holo / Épique : sur la photo. Reverse : sur le cadre seulement (photo intacte). */
.tc.f-holo .tc-sheen, .tc.r-E .tc-sheen {
  opacity: .75; mix-blend-mode: overlay;
  background:
    radial-gradient(ellipse 45% 35% at 22% 28%, rgba(255, 60, 172, .75), transparent 70%),
    radial-gradient(ellipse 40% 45% at 78% 22%, rgba(43, 210, 255, .75), transparent 70%),
    radial-gradient(ellipse 50% 40% at 64% 76%, rgba(249, 212, 35, .7), transparent 70%),
    radial-gradient(ellipse 45% 40% at 24% 78%, rgba(43, 255, 160, .7), transparent 70%),
    conic-gradient(from 30deg at 50% 50%, rgba(120, 75, 160, .6), rgba(43, 134, 197, .6), rgba(43, 210, 160, .6), rgba(249, 212, 35, .6), rgba(255, 60, 172, .6), rgba(120, 75, 160, .6));
  background-size: 160% 160%, 170% 170%, 150% 150%, 165% 165%, 100% 100%;
  animation: petrole 9s ease-in-out infinite alternate, petrole-teinte 12s linear infinite;
}
@keyframes petrole {
  0% { background-position: 0% 0%, 100% 0%, 50% 100%, 0% 100%, 0 0; }
  50% { background-position: 60% 40%, 30% 60%, 0% 30%, 80% 20%, 0 0; }
  100% { background-position: 100% 100%, 0% 100%, 100% 0%, 40% 0%, 0 0; }
}
@keyframes petrole-teinte { to { filter: hue-rotate(360deg); } }
.tc-mini.f-holo .tc-sheen, .tc-mini.r-E .tc-sheen { animation: none; background-position: 30% 30%, 70% 20%, 50% 80%, 20% 70%, 0 0; }

.tc.f-reverse:not(.r-E):not(.tc-fullart) {
  background:
    radial-gradient(ellipse 40% 30% at 20% 20%, #ff3cac, transparent 70%),
    radial-gradient(ellipse 35% 40% at 85% 30%, #2bd2ff, transparent 70%),
    radial-gradient(ellipse 45% 35% at 70% 85%, #f9d423, transparent 70%),
    radial-gradient(ellipse 40% 40% at 15% 80%, #2bffa0, transparent 70%),
    conic-gradient(from 0deg at 50% 50%, #784ba0, #2b86c5, #2bd2a0, #f9d423, #ff3cac, #784ba0);
  background-size: 170% 170%, 160% 160%, 180% 180%, 165% 165%, 100% 100%;
  animation: petrole 10s ease-in-out infinite alternate;
}
.tc-mini.f-reverse { animation: none; }
.reduce-motion .tc .tc-sheen, .reduce-motion .tc.f-reverse { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .tc .tc-sheen, .tc.f-reverse { animation: none !important; } }
/* Sans cadre noir autour du titre, du texte et du slogan (06/11) : le fondu derrière le texte reste. */
.tc .tc-title { border: 0; background: none; padding-left: 0; padding-right: 0; }
.tc .tc-text { border: 0; }
.tc .tc-slogan { border: 0; }
/* Aucun cadre ni contour noir sur le titre, le texte et le slogan (06/11, bis). */
.tc .tc-text, .tc .tc-title { border: 0 !important; }
.tc .tc-name { -webkit-text-stroke: 0; paint-order: normal; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.tc .tc-slogan { text-shadow: none; }

/* ---------- Photo en grand, titre au-dessus du texte (06/11) ----------
   La photo occupe toute la hauteur de la carte (au-dessus du logo) ; titre puis texte et slogan sont posés en bas,
   sur un fondu opaque en bas et transparent en haut. Même disposition pour toutes les raretés. */
.tc .tc-in { grid-template-rows: minmax(0, 1fr) auto; }
.tc .tc-art { grid-row: 1; grid-column: 1; }
.tc .tc-sym { grid-row: 2; grid-column: 1; }
.tc .tc-bas {
  grid-row: 1; grid-column: 1; align-self: end; position: relative; z-index: 2; display: grid; gap: 1.6cqw; min-width: 0;
  padding: 12cqw 3.4cqw 2.6cqw; border-radius: 0 0 3cqw 3cqw;
  background: linear-gradient(to top, rgba(10, 8, 20, .92) 0%, rgba(10, 8, 20, .8) 50%, rgba(10, 8, 20, 0) 100%);
}
.tc .tc-bas .tc-title { grid-row: auto; margin: 0; padding: 0; }
.tc .tc-bas .tc-text, .tc.tc-full:not(.tc-fullart) .tc-bas .tc-text { grid-row: auto; margin: 0; padding: 0; background: none; border-radius: 0; position: static; }
.tc-mini .tc-bas { padding: 10cqw 3cqw 2cqw; }
/* Full Art : la photo couvre toute la carte ; le fondu existant suffit derrière le titre et les textes. */
.tc-fullart .tc-bas { background: none; padding: 0 5cqw 1.5cqw; border-radius: 0; }
.tc-fullart .tc-in::before { height: 55%; }
/* Reverse (06/11, atténué) : même effet pétrole sur le cadre, mais à environ 20 % (voile noir à 80 % par-dessus). */
.tc.f-reverse:not(.r-E):not(.tc-fullart) {
  background:
    linear-gradient(rgba(5, 4, 9, .8), rgba(5, 4, 9, .8)),
    radial-gradient(ellipse 40% 30% at 20% 20%, #ff3cac, transparent 70%),
    radial-gradient(ellipse 35% 40% at 85% 30%, #2bd2ff, transparent 70%),
    radial-gradient(ellipse 45% 35% at 70% 85%, #f9d423, transparent 70%),
    radial-gradient(ellipse 40% 40% at 15% 80%, #2bffa0, transparent 70%),
    conic-gradient(from 0deg at 50% 50%, #784ba0, #2b86c5, #2bd2a0, #f9d423, #ff3cac, #784ba0);
  background-size: 100% 100%, 170% 170%, 160% 160%, 180% 180%, 165% 165%, 100% 100%;
  animation: petrole-reverse 10s ease-in-out infinite alternate;
}
@keyframes petrole-reverse {
  0% { background-position: 0 0, 0% 0%, 100% 0%, 50% 100%, 0% 100%, 0 0; }
  50% { background-position: 0 0, 60% 40%, 30% 60%, 0% 30%, 80% 20%, 0 0; }
  100% { background-position: 0 0, 100% 100%, 0% 100%, 100% 0%, 40% 0%, 0 0; }
}
.tc-mini.f-reverse { animation: none; }
/* Secrète (06/11, refaite) : même principe que le Holo (reflets qui ondulent sur l'image), en prismatique :
   spectre complet plus vif, fines facettes de prisme, teinte qui tourne. Remplace le balayage. */
.tc.r-S .tc-sheen {
  opacity: .8; mix-blend-mode: overlay;
  background:
    repeating-conic-gradient(from 0deg at 50% 50%, rgba(255, 255, 255, .22) 0deg 4deg, transparent 4deg 12deg),
    radial-gradient(ellipse 42% 32% at 20% 25%, rgba(255, 0, 128, .8), transparent 70%),
    radial-gradient(ellipse 38% 42% at 80% 22%, rgba(0, 200, 255, .8), transparent 70%),
    radial-gradient(ellipse 46% 36% at 66% 78%, rgba(255, 230, 0, .75), transparent 70%),
    radial-gradient(ellipse 42% 40% at 22% 78%, rgba(0, 255, 140, .75), transparent 70%),
    conic-gradient(from 0deg at 50% 50%, #ff0080, #ff8c00, #ffe600, #00ff8c, #00c8ff, #8c00ff, #ff0080);
  background-size: 100% 100%, 160% 160%, 170% 170%, 150% 150%, 165% 165%, 100% 100%;
  animation: prisme 8s ease-in-out infinite alternate, petrole-teinte 8s linear infinite;
}
@keyframes prisme {
  0% { background-position: 0 0, 0% 0%, 100% 0%, 50% 100%, 0% 100%, 0 0; }
  50% { background-position: 0 0, 60% 40%, 30% 60%, 0% 30%, 80% 20%, 0 0; }
  100% { background-position: 0 0, 100% 100%, 0% 100%, 100% 0%, 40% 0%, 0 0; }
}
.tc-mini.r-S .tc-sheen { animation: none; opacity: .6; }
.tc.tc.r-S .tc-sheen { opacity: .55; } /* intensité proche du Holo, photo lisible */
/* Secrète (06/11, ajustement) : sans les rayons « soleil », effet à 25 %. */
.tc.tc.r-S .tc-sheen {
  opacity: .25;
  background:
    radial-gradient(ellipse 42% 32% at 20% 25%, rgba(255, 0, 128, .8), transparent 70%),
    radial-gradient(ellipse 38% 42% at 80% 22%, rgba(0, 200, 255, .8), transparent 70%),
    radial-gradient(ellipse 46% 36% at 66% 78%, rgba(255, 230, 0, .75), transparent 70%),
    radial-gradient(ellipse 42% 40% at 22% 78%, rgba(0, 255, 140, .75), transparent 70%),
    conic-gradient(from 0deg at 50% 50%, #ff0080, #ff8c00, #ffe600, #00ff8c, #00c8ff, #8c00ff, #ff0080);
  background-size: 160% 160%, 170% 170%, 150% 150%, 165% 165%, 100% 100%;
  animation: petrole 8s ease-in-out infinite alternate, petrole-teinte 8s linear infinite;
}
.tc-mini.tc.r-S .tc-sheen { animation: none; }
.tc.tc.tc.r-S .tc-sheen { opacity: .45; } /* Secrète : 25 % + 20 points */
/* Épique : les anciennes règles de placement (image sur les lignes 2 à 4, texte en ligne 3) cassaient la nouvelle
   disposition ; l'Épique suit maintenant la même grille que les autres (photo | logo), titre et texte en bas sur la photo. */
.tc.tc.r-E .tc-art { grid-row: 1; grid-column: 1; }
.tc.tc.r-E .tc-sym { grid-row: 2; }
.tc.tc.r-E .tc-bas .tc-text { grid-row: auto; background: none; padding: 0; border-radius: 0; }

/* ---------- Mise en page du 07/11/2026 (Simon) : cadre noir, bandeau de titre aux couleurs de la rareté ----------
   Commune → Épique : photo en haut, bandeau du titre, encadré clair pour le texte et le slogan (lisibilité).
   Légendaire : photo pleine carte avec fondu en bas, titre dans un bandeau doré posé sur la photo. Secrète : inchangée. */
.tc.r-C { --band: linear-gradient(90deg, #e4e3ec, #bdbbcb); --band-ink: #1d1830; }
.tc.r-PCm { --band: linear-gradient(90deg, #7a768c, #4a4758); --band-ink: #fff; }
.tc.r-R { --band: linear-gradient(90deg, #c98846, #96571f); --band-ink: #fff; }
.tc.r-UR { --band: linear-gradient(90deg, #4c92f0, #1f56b8); --band-ink: #fff; }
.tc.r-E { --band: linear-gradient(90deg, #9b55e6, #5e24a8); --band-ink: #fff; }
.tc.r-L { --band: linear-gradient(90deg, #ffe08a, #d9a521 55%, #a8740c); --band-ink: #1d1830; }
.tc.tc .tc-bas .tc-title { padding: 1.3cqw 3cqw; border-radius: 1.6cqw; background: var(--band); color: var(--band-ink);
  box-shadow: 0 0 0 max(1px, .5cqw) #0a0812; }
.tc.tc .tc-bas .tc-name { color: inherit; }
.tc.r-C .tc-name, .tc.r-L .tc-name { text-shadow: none; }

/* Structure (hors Full Art) : photo, puis bandeau et encadré de texte sous la photo, puis logo de rareté. */
.tc:not(.tc-fullart) .tc-in { grid-template-rows: minmax(0, 1fr) auto auto; gap: 2cqw; }
.tc:not(.tc-fullart) .tc-art { grid-row: 1; grid-column: 1; }
.tc.tc:not(.tc-fullart) .tc-bas { grid-row: 2; grid-column: 1; align-self: stretch; padding: 0; background: none; border-radius: 0; gap: 1.6cqw; }
.tc:not(.tc-fullart) .tc-sym { grid-row: 3; grid-column: 1; }
.tc.tc.tc-full:not(.tc-fullart) .tc-bas .tc-text { padding: 2.2cqw 3cqw; border-radius: 1.6cqw; background: #f3eee2; color: #1d1830;
  box-shadow: 0 0 0 max(1px, .5cqw) #0a0812; }
.tc:not(.tc-fullart) .tc-personne { color: #8a4b00; }
.tc:not(.tc-fullart) .tc-slogan { color: #4e4864; border-top-color: rgba(29, 24, 48, .18); }

/* Légendaire : bandeau doré au-dessus du texte, sur le fondu de la photo. */
.tc-fullart.r-L .tc-bas .tc-title { margin-bottom: .6cqw; }
.tc.tc.r-E .tc-sym { grid-row: 3; } /* l'Épique suivait une ancienne grille à 2 lignes : logo sous l'encadré, comme les autres */

/* ---------- 07/11/2026 (Simon, suite) ---------- */
/* Commune → Épique : bord de carte noir pour toutes les finitions (Reverse et Épique compris). */
.tc.tc.tc.tc:not(.tc-fullart):not(.f-reverse) { background: #0a0812; animation: none; } /* Reverse : bord pétrole d'avant (Simon, 07/11) */
.tc.tc.r-E .tc-in { box-shadow: none; }
/* Légendaire et Secrète : aucun bord (ni trait noir, ni liseré) ; seul le halo lumineux reste. */
.tc.tc.tc-fullart { outline: none; filter: none; box-shadow: 0 10px 26px rgba(0, 0, 0, .5); }
.tc-full.tc.r-L { animation: gold-glow-sans-bord 3s ease-in-out infinite; }
@keyframes gold-glow-sans-bord { 50% { box-shadow: 0 0 30px rgba(255, 200, 70, .7), 0 10px 26px rgba(0, 0, 0, .5); } }
.tc-mini.tc.r-L { animation: none; }
/* Légendaire et Secrète : bandeau du titre collé au bord gauche, qui s'arrête juste après le titre ; texte à gauche. */
.tc.r-S { --band: linear-gradient(90deg, #ff8ab0, #ffd36b 30%, #7dffb2 55%, #6bd0ff 80%, #b48bff); --band-ink: #1d1830; }
.tc.r-S .tc-name { text-shadow: none; }
.tc-fullart .tc-bas { text-align: left; justify-items: start; }
.tc.tc.tc-fullart .tc-bas .tc-title { justify-self: start; width: max-content; max-width: calc(100% + 5cqw);
  margin-left: -5cqw; padding-left: 5cqw; border-radius: 0 1.6cqw 1.6cqw 0; box-shadow: none; }
.tc-fullart .tc-bas .tc-text { justify-self: stretch; }

/* Légendaire (07/11/2026, Simon, référence « Jinx ») : bandeau du titre plein et net, collé au bord gauche ;
   sa fin se désagrège en poussière de pixels de plus en plus rare (::after, longueur fixe après le titre). */
.tc.r-L { --band: linear-gradient(90deg, #ffe08a, #e2b236 45%, #d9a521); --band-fin: #d9a521; }
.tc.tc.tc-fullart.r-L .tc-bas .tc-title { position: relative; box-sizing: border-box; border-radius: 0; padding: 1.8cqw 2cqw 1.8cqw 5cqw; box-shadow: none; }
.tc.tc.tc-fullart.r-L .tc-bas .tc-title::after { content: ""; position: absolute; top: 0; bottom: 0; left: calc(100% - 1px); width: 42cqw;
  background: var(--band-fin); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 40' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='g'%3E%3Cstop offset='0' stop-color='%23fff'/%3E%3Cstop offset='.18' stop-color='%23fff'/%3E%3Cstop offset='1' stop-color='%23000'/%3E%3C/linearGradient%3E%3Cfilter id='f' x='0' y='0' width='100%' height='100%'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.55 .28' numOctaves='2' seed='11' result='n'/%3E%3CfeColorMatrix in='n' type='luminanceToAlpha' result='na'/%3E%3CfeComponentTransfer in='na' result='nc'%3E%3CfeFuncA type='linear' slope='3.2' intercept='-1.1'/%3E%3C/feComponentTransfer%3E%3CfeColorMatrix in='SourceGraphic' type='luminanceToAlpha' result='ga'/%3E%3CfeComposite in='ga' in2='nc' operator='arithmetic' k2='1.7' k3='-1' k4='-.15'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='discrete' tableValues='0 1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3C/defs%3E%3Crect width='160' height='40' fill='url(%23g)' filter='url(%23f)'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 40' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='g'%3E%3Cstop offset='0' stop-color='%23fff'/%3E%3Cstop offset='.18' stop-color='%23fff'/%3E%3Cstop offset='1' stop-color='%23000'/%3E%3C/linearGradient%3E%3Cfilter id='f' x='0' y='0' width='100%' height='100%'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.55 .28' numOctaves='2' seed='11' result='n'/%3E%3CfeColorMatrix in='n' type='luminanceToAlpha' result='na'/%3E%3CfeComponentTransfer in='na' result='nc'%3E%3CfeFuncA type='linear' slope='3.2' intercept='-1.1'/%3E%3C/feComponentTransfer%3E%3CfeColorMatrix in='SourceGraphic' type='luminanceToAlpha' result='ga'/%3E%3CfeComposite in='ga' in2='nc' operator='arithmetic' k2='1.7' k3='-1' k4='-.15'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='discrete' tableValues='0 1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3C/defs%3E%3Crect width='160' height='40' fill='url(%23g)' filter='url(%23f)'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat; }

/* Commune → Épique (07/11/2026, Simon) : photo arrondie seulement en haut, qui continue derrière le bandeau du titre et
   l'encadré du texte ; photo, bandeau et encadré forment un seul bloc continu, seul le bas du bloc est arrondi. */
.tc.tc.tc:not(.tc-fullart) .tc-art { grid-row: 1 / 3; grid-column: 1; border-radius: 3cqw 3cqw 2.6cqw 2.6cqw; }
.tc.tc.tc:not(.tc-fullart) .tc-bas { grid-row: 2; grid-column: 1; align-self: end; position: relative; z-index: 2; gap: 0; }
/* Fonds du bandeau et de l'encadré à 90 % d'opacité (réglage final de Simon) : la photo se voit derrière, les lettres restent opaques. */
.tc.tc.tc:not(.tc-fullart) .tc-bas .tc-title { position: relative; isolation: isolate; border-radius: 0; box-shadow: none; background: none; }
.tc.tc.tc:not(.tc-fullart) .tc-bas .tc-title::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--band); opacity: .9; border-radius: inherit; }
.tc.tc.tc.tc-full:not(.tc-fullart) .tc-bas .tc-text { border-radius: 0 0 2.6cqw 2.6cqw; box-shadow: none; background: rgba(243, 238, 226, .9); }
.tc.tc.tc.tc-mini:not(.tc-fullart) .tc-bas .tc-title { border-radius: 0 0 2.6cqw 2.6cqw; } /* miniature : pas d'encadré, le bandeau ferme le bloc */

/* Commune → Épique (07/11/2026) : photo plein cadre, sans fond flou sur les côtés (cadrage par défaut, réglable dans l'admin). */
.tc:not(.tc-fullart) .art-photo .art-img { object-fit: cover; }
.tc:not(.tc-fullart) .art-photo .art-fond { display: none; }
/* Photo dézoomée (zoom < 100 %, réglage admin) : la même photo floutée comble le vide autour, sur toutes les raretés. */
.tc.tc .art-photo.art-dezoom .art-fond { display: block; }

/* Reverse (07/11/2026, Simon) : carte « reverse holo » — bord pétrole d'avant (contour noir de base conservé), bandeau du
   titre et encadré du texte holographiques ; la photo reste sans effet. Le reflet est sous les lettres (::after en z -1). */
.tc.tc.tc.f-reverse:not(.tc-fullart) .tc-bas .tc-text { position: relative; isolation: isolate; }
.tc.tc.tc.f-reverse:not(.tc-fullart) .tc-bas .tc-title::after, .tc.tc.tc.f-reverse:not(.tc-fullart) .tc-bas .tc-text::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; mix-blend-mode: soft-light; opacity: .9;
  background: linear-gradient(115deg, #ff3cac 0%, #f9d423 18%, #2bffa0 36%, #2bd2ff 54%, #784ba0 72%, #ff3cac 90%);
  background-size: 260% 100%; animation: reverse-texte 6s ease-in-out infinite alternate; }
@keyframes reverse-texte { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
.tc-mini.f-reverse .tc-bas .tc-title::after { animation: none; }
.reduce-motion .tc.f-reverse .tc-bas ::after { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .tc.f-reverse .tc-bas .tc-title::after, .tc.f-reverse .tc-bas .tc-text::after { animation: none !important; } }
/* Bloc continu (07/11/2026) : pas de contour propre à la photo, sinon il dépasse sur les côtés du bandeau et de l'encadré. */
.tc.tc.tc:not(.tc-fullart) .tc-art { box-shadow: none; }

/* Grand format, Commune → Épique (10/11/2026, Simon) : la photo reste dans son cadre, au-dessus du titre (plus rien
   derrière le bandeau ni l'encadré) ; le cadre rejoint le bandeau sans espace. Miniatures inchangées. */
.tc.tc.tc.tc-full:not(.tc-fullart) .tc-art { grid-row: 1; margin-bottom: -2cqw; border-radius: 3cqw 3cqw 0 0; }
.tc.tc.tc.tc-full:not(.tc-fullart) .tc-bas .tc-title::before { opacity: 1; }
.tc.tc.tc.tc-full:not(.tc-fullart) .tc-bas .tc-text { background: #f3eee2; }

/* 10/11/2026 (Simon) : bandeau du titre et encadré du texte opaques à 100 % partout (miniatures comprises) ;
   libellé de rareté en bas à gauche réduit de 1 px. */
.tc.tc.tc:not(.tc-fullart) .tc-bas .tc-title::before { opacity: 1; }
.tc-finish { font-size: calc(2.8cqw - 1px); }
.tc-mini .tc-finish { font-size: calc(5.2cqw - 1px); }
