/* Legacy rarity primitives; approved atlas rules below replace their rendering. */
.tcg-face[data-rarity]::after { content:''; position:absolute; z-index:9; inset:0; border:1.1cqw solid var(--rarity); box-shadow:inset 0 0 2cqw color-mix(in srgb,var(--rarity) 40%,transparent); pointer-events:none; clip-path:polygon(4% 0,96% 0,100% 3%,100% 96%,96% 100%,3% 100%,0 97%,0 4%); }
.tcg-face[data-rarity] .tcg-edition { color:var(--rarity); font-size:2.5cqw; letter-spacing:.02em; }
.tcg-face[data-rarity="commune"]::after { border-width:.6cqw; box-shadow:none; opacity:.75; }
.tcg-face[data-rarity="rare"]::after { box-shadow:inset 0 0 3cqw #12d9f466; }
.tcg-face[data-rarity="epique"]::after { border-width:1.3cqw; box-shadow:inset 0 0 4cqw #a767ff88; animation:epic-edge 3s ease-in-out infinite; }
.tcg-face[data-rarity="legendaire"]::after { border-width:1.6cqw; box-shadow:inset 0 0 4cqw #ffd31a99; animation:legend-edge 3.5s ease-in-out infinite; }
.tcg-face[data-rarity="legendaire"]::before { content:''; position:absolute; z-index:8; inset:1%; pointer-events:none; background:linear-gradient(115deg,transparent 35%,#fff5bcbb 48%,transparent 61%); background-size:300% 100%; animation:legend-foil 5s ease-in-out infinite; clip-path:polygon(0 0,100% 0,100% 100%,0 100%,0 3%,3% 3%,3% 97%,97% 97%,97% 3%,0 3%); }
.tcg-face[data-rarity="epique"] .tcg-edition::before { content:'◆ '; }
.tcg-face[data-rarity="legendaire"] .tcg-edition::before { content:'✦ '; }
.tcg-face[data-rarity="rare"] .tcg-edition::before { content:'◇ '; }
@keyframes epic-edge { 50% { box-shadow:inset 0 0 5cqw #a767ffbb; border-color:#d6b8ff; } }
@keyframes legend-edge { 50% { border-color:#fff0a0; box-shadow:inset 0 0 5cqw #ffd31acc; } }
@keyframes legend-foil { 0%,20% { background-position:150% 0; } 80%,100% { background-position:-150% 0; } }
/* Les miniatures du plateau restent calmes pour ne pas distraire du jeu. */
.board-card .tcg-face::after,.board-card .tcg-face::before { animation:none; }
@media(prefers-reduced-motion:reduce) { .tcg-face[data-rarity]::before,.tcg-face[data-rarity]::after { animation:none; } }

/* Exact approved materials, one cached atlas with its center cut out. */
.tcg-face[data-rarity] { --frame-x:1.3265%; }
.tcg-face[data-rarity="rare"] { --frame-x:33.5298%; }
.tcg-face[data-rarity="epique"] { --frame-x:66.1017%; }
.tcg-face[data-rarity="legendaire"] { --frame-x:98.4525%; }
.tcg-face[data-rarity] .tcg-inner { position:absolute; inset:3.5% 4.5% 9%; }
.tcg-face[data-rarity] .tcg-frame { display:none; }
.tcg-face[data-rarity]::after {
  content:''; position:absolute; inset:0; z-index:9; pointer-events:none;
  background-image:url('assets/rarity-frames-approved.png');
  background-size:425.4197% 140.7937%;
  background-position:var(--frame-x) 61.4786%; background-repeat:no-repeat;
  clip-path:polygon(evenodd,0 0,100% 0,100% 100%,0 100%,0 0,
    4.5% 3.5%,4.5% 95.5%,36% 95.5%,36% 88.5%,64% 88.5%,64% 95.5%,95.5% 95.5%,95.5% 3.5%,4.5% 3.5%);
  animation:none; border:0; box-shadow:none; opacity:1;
}
.tcg-face[data-rarity]::before { content:none; }
.tcg-face[data-rarity="commune"] .tcg-edition::before { content:'━ '; }
.tcg-face[data-rarity="epique"] .tcg-edition::before { content:'◇◇ '; }
