/* ==========================================================================
   Cartes à collectionner — de vraies cartes, comme celles qu'on sort d'un
   paquet : carton aux coins arrondis, cadre métallisé à la couleur de la
   rareté, photo coupée en biais par une bande de livrée, numéro de série,
   vernis holographique et bord chromé pour les plus rares.
   Toutes les tailles sont en cqw (pourcentage de la largeur de la carte) :
   la même carte reste nette en miniature comme en grand.
   ========================================================================== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 26px 20px;
}
.card-grid.sm {
  grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
  gap: 18px 14px;
}
.card-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  animation: cardIn 0.45s var(--ease-out) backwards;
}
.grid-more {
  height: 1px;
}
@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

.card {
  --rc: var(--r1);
  --rx: 0deg;
  --ry: 0deg;
  --mx: 50%;
  --my: 50%;
  --hover: 0;
  /* cadre métallisé : la couleur de rareté, éclaircie puis assombrie */
  --frame: linear-gradient(
    135deg,
    color-mix(in srgb, var(--rc) 55%, #000) 0%,
    color-mix(in srgb, var(--rc) 55%, #fff) 22%,
    color-mix(in srgb, var(--rc) 80%, #000) 42%,
    color-mix(in srgb, var(--rc) 35%, #fff) 58%,
    color-mix(in srgb, var(--rc) 60%, #000) 78%,
    color-mix(in srgb, var(--rc) 70%, #fff) 100%
  );
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 5 / 7;
  container-type: inline-size;
  perspective: 900px;
  user-select: none;
  -webkit-user-select: none;
  color: var(--text);
}

/* couleur de rareté (doit suivre .card pour l’emporter sur sa valeur par défaut) */
.card.r-1 {
  --rc: var(--r1);
}
.card.r-2 {
  --rc: var(--r2);
}
.card.r-3 {
  --rc: var(--r3);
}
.card.r-4 {
  --rc: var(--r4);
}
.card.r-5 {
  --rc: var(--r5);
}
.card.r-6 {
  --rc: var(--r6);
}
/* Le carton : coins arrondis comme une vraie carte, cadre métal */
.card .body {
  position: absolute;
  inset: 0;
  padding: 2.6cqw;
  border-radius: 4.6cqw;
  background: var(--frame);
  box-shadow: 0 0 0 0.4cqw rgba(0, 0, 0, 0.6), 0 3cqw 6cqw rgba(0, 0, 0, 0.55);
  transition: transform 0.5s var(--ease-out), box-shadow 0.3s;
  overflow: hidden;
  isolation: isolate;
}
/* la carte ne passe en 3D que pendant qu'on l'incline (180 cartes en 3D permanente ralentissent tout) */
.card.tilting .body {
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.08s linear, box-shadow 0.3s;
}
.card:hover .body {
  box-shadow: 0 0 0 0.4cqw rgba(0, 0, 0, 0.6), 0 6cqw 12cqw rgba(0, 0, 0, 0.6), 0 0 9cqw color-mix(in srgb, var(--rc) 30%, transparent);
}
/* La face intérieure : carbone sombre */
.card .inner {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 2.6cqw;
  overflow: hidden;
  background: var(--carbon), #111114;
  box-shadow: inset 0 0 0 0.35cqw rgba(0, 0, 0, 0.7);
}

/* ---------- Photo coupée en biais, bande de livrée dessous ---------- */
.card .photo {
  position: relative;
  flex: none;
  height: 56%;
  background: var(--rc);
  clip-path: polygon(0 0, 100% 0, 100% 84%, 0 100%);
}
.card .photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  clip-path: polygon(0 0, 100% 0, 100% calc(84% - 5cqw), 0 calc(100% - 5cqw));
  transition: transform 0.6s var(--ease-out);
}
.card:hover .photo img {
  transform: scale(1.05);
}
/* filet blanc entre la photo et la bande de couleur */
.card .photo::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #fff;
  clip-path: polygon(0 calc(100% - 5cqw), 100% calc(84% - 5cqw), 100% calc(84% - 3.9cqw), 0 calc(100% - 3.9cqw));
}
/* ombre en bas de la photo pour faire ressortir le numéro et le texte */
.card .photo::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, transparent 28%, transparent 60%, rgba(0, 0, 0, 0.35) 100%);
  clip-path: polygon(0 0, 100% 0, 100% calc(84% - 5cqw), 0 calc(100% - 5cqw));
  pointer-events: none;
}
/* gros numéro de série en italique, comme un numéro de course */
.card .photo .num {
  position: absolute;
  top: 2.4cqw;
  right: 4cqw;
  z-index: 2;
  font: 900 italic 17cqw/1 var(--font-display);
  letter-spacing: -0.04em;
  color: #fff;
  text-shadow: 0 0.6cqw 2.4cqw rgba(0, 0, 0, 0.7);
}
.card .photo .num.first {
  color: var(--gold);
}
.foil-tag {
  position: absolute;
  top: 3.4cqw;
  left: 0;
  z-index: 2;
  padding: 0.6cqw 4cqw 0.6cqw 3.4cqw;
  font: 900 italic 3.8cqw/1.2 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #000;
  background: var(--chrome);
  background-size: 220% 100%;
  clip-path: polygon(0 0, 100% 0, calc(100% - 2.4cqw) 100%, 0 100%);
}
.card.r-5 .foil-tag {
  background: linear-gradient(115deg, #a86f00, #ffe08a 25%, #c98f00 45%, #fff3c4 55%, #b07a00 75%, #ffd24d);
  background-size: 220% 100%;
}

/* ---------- Nom et chiffres ---------- */
.card .info {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 5cqw;
  margin-top: -1.5cqw;
}
.card .brand {
  font: 700 4.4cqw/1.2 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .title {
  font: 900 italic 13.5cqw/0.95 var(--font-display);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0.6cqw 0 auto;
  padding-bottom: 1cqw;
  overflow: hidden;
}
.card .title span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding-right: 1cqw;
}
.card .title.t-l {
  font-size: 9.6cqw;
}
.card .title.t-xl {
  font-size: 7.4cqw;
  line-height: 1;
}
.card .stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.4cqw;
  margin-bottom: 2.6cqw;
}
.card .stat {
  min-width: 0;
  padding: 1.6cqw 2.6cqw 1.8cqw;
  background: #09090b;
  clip-path: polygon(1.6cqw 0, 100% 0, calc(100% - 1.6cqw) 100%, 0 100%);
}
.card .stat small {
  display: block;
  font: 700 3.1cqw/1.2 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .stat b {
  display: block;
  font: 900 4.8cqw/1.15 var(--font-display);
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

/* ---------- Pied : rareté, losanges, numéro ---------- */
.card .foot {
  display: flex;
  align-items: center;
  gap: 2cqw;
  padding: 0 4cqw 3.6cqw 0;
}
.card .foot .rar {
  padding: 0.8cqw 4.4cqw 0.8cqw 5cqw;
  font: 900 italic 3.8cqw/1.2 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #000;
  background: var(--rc);
  clip-path: polygon(0 0, 100% 0, calc(100% - 2.4cqw) 100%, 0 100%);
  white-space: nowrap;
}
.card.r-4 .foot .rar,
.card.r-6 .foot .rar {
  color: #fff;
}
.card .foot .pips {
  display: flex;
  gap: 0.9cqw;
}
.card .foot .pips i {
  width: 2cqw;
  height: 2cqw;
  background: var(--rc);
  transform: rotate(45deg);
}
.card .foot .serial {
  margin-left: auto;
  font: 700 3.3cqw/1 var(--font-display);
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.card .foot .serial i {
  font-style: normal;
  color: var(--gold);
}

/* ---------- Reflets ---------- */
/* reflet de lumière qui suit la souris */
.card .glare {
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, 0.28), transparent 45%);
  opacity: calc(var(--hover) * 0.9);
  mix-blend-mode: overlay;
  transition: opacity 0.3s;
  display: none;
}
.card.tilting .glare {
  display: block;
}
/* vernis holographique : visible à partir de Rare, surtout sur la photo,
   discret au repos et qui s'allume quand on incline la carte */
.card .holo {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: color-dodge;
  background: linear-gradient(
    115deg,
    transparent 20%,
    rgba(255, 0, 90, 0.55) 32%,
    rgba(255, 210, 0, 0.55) 40%,
    rgba(0, 255, 170, 0.55) 48%,
    rgba(0, 170, 255, 0.55) 56%,
    rgba(190, 0, 255, 0.55) 64%,
    transparent 76%
  );
  background-size: 260% 260%;
  background-position: var(--mx) var(--my);
  -webkit-mask: linear-gradient(180deg, #000 0 52%, rgba(0, 0, 0, 0.25) 62%, rgba(0, 0, 0, 0.25));
  mask: linear-gradient(180deg, #000 0 52%, rgba(0, 0, 0, 0.25) 62%, rgba(0, 0, 0, 0.25));
  transition: opacity 0.3s;
}
/* Commune, Peu commune, et Rare au repos : pas de vernis du tout (rien à calculer) */
.card.r-1 .holo,
.card.r-2 .holo,
.card.r-3:not(.tilting):not(.shiny) .holo {
  display: none;
}
.card.r-3 .holo {
  opacity: calc(var(--hover) * 0.4);
}
.card.r-4 .holo {
  opacity: calc(0.08 + var(--hover) * 0.45);
}
.card.r-5 .holo,
.card.r-6 .holo {
  opacity: calc(0.14 + var(--hover) * 0.5);
}

/* Commune : cadre acier brossé */
.card.r-1 {
  --frame: linear-gradient(135deg, #2b2b31 0%, #6c6c76 22%, #34343b 42%, #8a8a94 58%, #2e2e35 78%, #575760 100%);
}
/* Légendaire : cadre or poli */
.card.r-5 {
  --frame: linear-gradient(135deg, #7a4f00 0%, #ffd76a 20%, #a86f00 40%, #fff1b8 54%, #9c6a00 74%, #ffcc4d 100%);
}
/* Légendaire et Mythique : bord réfracteur qui tourne (arc-en-ciel chromé) */
.card.r-5 .body::before,
.card.r-6 .body::before,
.card.shiny .body::before {
  content: '';
  position: absolute;
  inset: -40%;
  z-index: -1;
  background: conic-gradient(#ff2a1f, #ffb800, #3ddc84, #2f9bff, #b34cff, #ff2a1f);
  opacity: 0.32;
  animation: refractor 7s linear infinite;
  will-change: transform;
}
@keyframes refractor {
  to {
    transform: rotate(360deg);
  }
}
/* Mythique : cadre rouge course chromé et éclats */
.card.r-6 {
  --frame: linear-gradient(135deg, #5c0200 0%, #ff4a3d 20%, #a80400 40%, #ffd0cc 54%, #8a0300 74%, #ff2a1f 100%);
}
.card.r-6 .body::before {
  opacity: 0.45;
}
.card.r-6 .inner::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(circle at 18% 22%, #fff 0 0.35cqw, transparent 0.6cqw),
    radial-gradient(circle at 72% 12%, #fff 0 0.3cqw, transparent 0.55cqw),
    radial-gradient(circle at 86% 46%, #fff 0 0.4cqw, transparent 0.7cqw),
    radial-gradient(circle at 32% 64%, #fff 0 0.3cqw, transparent 0.55cqw),
    radial-gradient(circle at 60% 88%, #fff 0 0.35cqw, transparent 0.6cqw);
  animation: twinkle 2.4s ease-in-out infinite;
}
@keyframes twinkle {
  50% {
    opacity: 0.2;
  }
}

/* ---------- Chromée : cadre argent miroir et vernis arc-en-ciel ---------- */
.card.shiny {
  --frame: linear-gradient(135deg, #8d9099 0%, #ffffff 18%, #9a9ea8 36%, #f4f5f7 50%, #7c8089 68%, #ffffff 84%, #b9bcc4 100%);
}
.card.shiny .body::before {
  opacity: 0.5;
}
.card.shiny .holo {
  opacity: calc(0.3 + var(--hover) * 0.45);
  -webkit-mask: none;
  mask: none;
}
.shiny-badge,
.variant-badge {
  position: absolute;
  top: 12.6cqw;
  left: 2.6cqw;
  z-index: 5;
  padding: 0.6cqw 4cqw 0.6cqw 3.4cqw;
  font: 900 italic 3.6cqw/1.2 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #000;
  background: var(--chrome);
  clip-path: polygon(0 0, 100% 0, calc(100% - 2.4cqw) 100%, 0 100%);
}
.card:not(.r-5):not(.r-6) .shiny-badge {
  top: 6cqw;
}
.variant-badge {
  top: 19.4cqw;
  color: #fff;
  background: #2a2a30;
}
.variant-badge.v-or {
  color: #000;
  background: linear-gradient(115deg, #a86f00, #ffe08a 40%, #c98f00);
}
.variant-badge.v-negatif {
  color: #000;
  background: #fff;
}
.variant-badge.v-erreur {
  background: var(--red);
}

/* ---------- Variantes rares ---------- */
.card.v-carbone .inner {
  background: repeating-linear-gradient(45deg, #1a1a1e 0 3cqw, #0c0c0e 3cqw 6cqw), #111114;
}
.card.v-carbone {
  --frame: linear-gradient(135deg, #111 0%, #3a3a3a 25%, #0a0a0a 50%, #2e2e2e 75%, #111 100%);
}
.card.v-or {
  --frame: linear-gradient(135deg, #7a4f00 0%, #ffe9a3 22%, #b07a00 44%, #fff6d1 56%, #9c6a00 78%, #ffd24d 100%);
}
.card.v-or .inner {
  background: linear-gradient(160deg, #2a1f05, #0e0a02);
}
.card.v-or .title,
.card.v-or .stat b {
  color: #ffd76a;
}
.card.v-negatif .photo img {
  filter: invert(1) hue-rotate(180deg);
}
.card.v-negatif .inner {
  background: #e9e9ec;
}
.card.v-negatif .title,
.card.v-negatif .stat b {
  color: #0b0b0d;
}
.card.v-negatif .stat {
  background: #fff;
}
.card.v-erreur .photo img {
  transform: scaleX(-1);
  filter: saturate(1.6) hue-rotate(25deg);
}
.card.v-erreur .title span {
  text-shadow: 1cqw 0 rgba(225, 6, 0, 0.8), -1cqw 0 rgba(47, 155, 255, 0.8);
}

/* ---------- Badges autour de la carte ---------- */
.count-badge {
  position: absolute;
  top: -9px;
  right: -8px;
  z-index: 5;
  min-width: 34px;
  height: 26px;
  padding: 0 10px;
  display: grid;
  place-items: center;
  background: var(--red);
  color: #fff;
  font: 900 italic 0.95rem var(--font-display);
  clip-path: var(--slant-sm);
}
.new-badge {
  position: absolute;
  top: -11px;
  left: 50%;
  translate: -50% 0;
  z-index: 6;
  padding: 2px 14px;
  background: #fff;
  color: #000;
  font: 900 italic 0.75rem var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  clip-path: var(--slant-sm);
  animation: popIn 0.4s var(--ease-spring) backwards;
}
@keyframes popIn {
  from {
    transform: scale(0);
  }
}
.lock-badge,
.fav-badge {
  position: absolute;
  bottom: 40px;
  z-index: 5;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #000;
  border: 1px solid var(--line-2);
  color: var(--text-2);
}
.lock-badge {
  right: -6px;
}
.fav-badge {
  left: -6px;
  color: var(--gold);
}
.lock-badge svg,
.fav-badge svg {
  width: 14px;
  height: 14px;
}
.fav-badge svg {
  fill: currentColor;
}
.card-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.86rem;
  color: var(--muted);
  min-height: 22px;
}
.card-caption b {
  color: var(--text);
  font-weight: 900;
}
.variant-count {
  color: var(--gold) !important;
}
.chrome-count svg {
  width: 13px;
  height: 13px;
}

/* ---------- Carte manquante (album) : emplacement vide ---------- */
.card.missing .body {
  background: transparent;
  box-shadow: none;
  border: 0.6cqw dashed var(--line-2);
}
.card.missing .inner {
  background: rgba(255, 255, 255, 0.02);
  box-shadow: none;
}
.card.missing .photo {
  background: transparent;
}
.card.missing .photo::before,
.card.missing .photo::after {
  display: none;
}
.card.missing .photo img {
  filter: grayscale(1) brightness(0.8) contrast(1.1);
  opacity: 0.5;
}
.card.missing:hover .photo img {
  opacity: 0.75;
}
.card.missing .photo .num,
.card.missing .foil-tag {
  display: none;
}
.card.missing .info::before {
  content: '?';
  position: absolute;
  top: 12%;
  left: 0;
  right: 0;
  text-align: center;
  font: 900 italic 24cqw/1 var(--font-display);
  color: rgba(255, 255, 255, 0.55);
  text-shadow: 0 2cqw 6cqw rgba(0, 0, 0, 0.6);
}
.card.missing .title,
.card.missing .brand {
  color: var(--dim);
}
.card.missing .stats,
.card.missing .foot {
  opacity: 0.45;
}
.card.missing .glare,
.card.missing .holo,
.card.missing .body::before,
.card.missing .inner::after {
  display: none;
}

/* ---------- Sélection ---------- */
.card.selected .body {
  outline: 1.2cqw solid #fff;
  outline-offset: 1.6cqw;
}
.card.selected::after {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  z-index: 6;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 16px no-repeat;
  box-shadow: 0 0 0 3px #000;
}
.selectable .card {
  cursor: pointer;
}

/* ---------- Dos de carte : livrée rouge et blanche ---------- */
.card-back {
  position: absolute;
  inset: 0;
  padding: 2.6cqw;
  border-radius: 4.6cqw;
  background: linear-gradient(135deg, #2b2b31 0%, #6c6c76 22%, #34343b 42%, #8a8a94 58%, #2e2e35 78%, #575760 100%);
  box-shadow: 0 0 0 0.4cqw rgba(0, 0, 0, 0.6), 0 3cqw 6cqw rgba(0, 0, 0, 0.55);
  container-type: inline-size;
  overflow: hidden;
}
.card-back .inner {
  position: relative;
  height: 100%;
  border-radius: 2.6cqw;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--carbon), #0b0b0d;
}
/* deux bandes inclinées, rouge puis blanche, qui traversent le dos */
.card-back .inner::before {
  content: '';
  position: absolute;
  inset: -10%;
  background: linear-gradient(115deg, transparent 0 40%, var(--red) 40% 54%, #fff 54% 58%, transparent 58%);
}
.card-back .inner::after {
  content: '';
  position: absolute;
  inset: 0 -60%;
  background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, 0.14) 50%, transparent 58%);
  animation: backSheen 4.5s ease-in-out infinite;
  will-change: transform;
}
@keyframes backSheen {
  0%,
  40% {
    transform: translateX(-60%);
  }
  100% {
    transform: translateX(60%);
  }
}
.card-back .emblem {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 1cqw;
}
.card-back .emblem b {
  font: 900 italic 46cqw/0.8 var(--font-display);
  color: transparent;
  -webkit-text-stroke: 0.8cqw #fff;
  text-shadow: 0 0 6cqw rgba(0, 0, 0, 0.6);
}
.card-back .emblem span {
  padding: 1cqw 4cqw;
  font: 900 italic 6cqw/1 var(--font-display);
  letter-spacing: 0.02em;
  color: #fff;
  background: #000;
  clip-path: polygon(2cqw 0, 100% 0, calc(100% - 2cqw) 100%, 0 100%);
}
.card-back .emblem span i {
  color: var(--red);
}
/* dos de collection (objets de décoration) */
.card-back.back-carbone .inner {
  background: repeating-linear-gradient(45deg, #1d1d21 0 3cqw, #0b0b0d 3cqw 6cqw);
}
.card-back.back-carbone .inner::before {
  background: linear-gradient(115deg, transparent 0 46%, #8e8e98 46% 50%, transparent 50%);
}
.card-back.back-damier .inner {
  background: repeating-conic-gradient(#f4f4f5 0 25%, #0b0b0d 0 50%) 0 0 / 14cqw 14cqw;
}
.card-back.back-damier .inner::before {
  background: linear-gradient(115deg, transparent 0 38%, rgba(0, 0, 0, 0.85) 38% 62%, transparent 62%);
}
.card-back.back-neon .inner {
  background: radial-gradient(circle at 50% 40%, #2a0a4a, #0b0b0d 70%);
}
.card-back.back-neon .inner::before {
  background: linear-gradient(115deg, transparent 0 42%, #b34cff 42% 52%, #2f9bff 52% 56%, transparent 56%);
}
.card-back.back-retro .inner {
  background: #0d2b45;
}
.card-back.back-retro .inner::before {
  background: linear-gradient(115deg, transparent 0 36%, #79b5df 36% 46%, #ee7d1e 46% 54%, #79b5df 54% 58%, transparent 58%);
}
.card-back.back-or {
  background: linear-gradient(135deg, #7a4f00 0%, #ffd76a 20%, #a86f00 40%, #fff1b8 54%, #9c6a00 74%, #ffcc4d 100%);
}
.card-back.back-or .inner::before {
  background: linear-gradient(115deg, transparent 0 40%, var(--gold) 40% 54%, #fff 54% 58%, transparent 58%);
}
.card-back.back-plus {
  background: conic-gradient(from 200deg, #ff2a1f, #ffb800, #3ddc84, #2f9bff, #b34cff, #ff2a1f);
}

/* ---------- Retournement (ouverture des boosters) ---------- */
.flip {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 7;
  container-type: inline-size;
  perspective: 1200px;
  cursor: pointer;
}
.flip .flipper {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.75s var(--ease-out);
  will-change: transform;
}
.flip.revealed .flipper {
  transform: rotateY(180deg);
}
.flip .face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.flip .face.front {
  transform: rotateY(180deg);
}
.flip:not(.revealed):hover .flipper {
  transform: translateY(-10px);
}
/* Indice de rareté avant de retourner : un halo de la couleur de la carte */
.flip .aura {
  position: absolute;
  inset: -4%;
  border-radius: 6cqw;
  background: var(--rc);
  filter: blur(5cqw);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
  will-change: transform, opacity;
}
.flip:not(.revealed).hint-4 .aura,
.flip:not(.revealed).hint-5 .aura,
.flip:not(.revealed).hint-6 .aura {
  opacity: 0.75;
  animation: hintPulse 0.9s ease-in-out infinite;
}
.flip:not(.revealed).hint-6 .aura,
.flip:not(.revealed).hint-shiny .aura {
  opacity: 0.85;
  background: conic-gradient(#ff2a1f, #ffb800, #3ddc84, #2f9bff, #b34cff, #ff2a1f);
  animation: hintPulse 0.9s ease-in-out infinite;
}
@keyframes hintPulse {
  50% {
    transform: scale(1.05);
    opacity: 0.45;
  }
}
.flip.shake .flipper {
  animation: cardShake 0.5s ease-in-out infinite;
}
@keyframes cardShake {
  25% {
    transform: rotate(-2.5deg) translateY(-3px);
  }
  75% {
    transform: rotate(2.5deg);
  }
}
/* Faisceaux derrière une Légendaire : lignes de vitesse qui tournent */
.rays {
  position: absolute;
  inset: -45%;
  z-index: -1;
  background: repeating-conic-gradient(from 0deg, var(--rc) 0 4deg, transparent 4deg 18deg);
  border-radius: 50%;
  -webkit-mask: radial-gradient(circle, #000 22%, transparent 66%);
  mask: radial-gradient(circle, #000 22%, transparent 66%);
  opacity: 0.5;
  animation: raysIn 0.8s var(--ease-out) backwards, raysSpin 14s linear infinite;
  pointer-events: none;
}
@keyframes raysIn {
  from {
    opacity: 0;
    transform: scale(0.4);
  }
}
@keyframes raysSpin {
  to {
    rotate: 360deg;
  }
}
