/* Fonds de carte. --bg1, --bg2 et --motif viennent du jeu ; les effets viennent de la rareté.
   Quatre couches : le décor du jeu, le motif et les traits de vitesse, la lumière de la rareté, le sol. */

/* 1. Décor : projecteur en haut, couleur du jeu, nuit en bas */
.card {
  background:
    radial-gradient(130% 62% at 50% 30%, color-mix(in srgb, var(--bg1) 62%, #fff) 0%, var(--bg1) 34%, transparent 74%),
    radial-gradient(90% 45% at 0% 100%, color-mix(in srgb, var(--bg1) 55%, transparent), transparent 70%),
    linear-gradient(172deg, color-mix(in srgb, var(--bg1) 70%, #000) 0%, var(--bg2) 62%, color-mix(in srgb, var(--bg2) 40%, #000) 100%);
}

/* 2. Motif du jeu, en filigrane, et grandes bandes obliques façon manga */
.card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0; opacity: .3;
  background:
    linear-gradient(118deg, transparent 0 17%, #ffffff4d 17% 29%, transparent 29% 32%, #ffffff33 32% 36%, transparent 36% 71%, #0000008c 71% 84%, transparent 84% 87%, #00000066 87% 91%, transparent 91%),
    var(--motif) center / 28cqw;
  -webkit-mask-image: linear-gradient(165deg, #000, #0008 48%, #000); mask-image: linear-gradient(165deg, #000, #0008 48%, #000);
}
.card .fx { position: absolute; inset: 0; pointer-events: none; }
.card .fx::before, .card .fx::after { content: ''; position: absolute; inset: 0; pointer-events: none; }

/* 3. Lumière de la rareté : un anneau et un halo derrière le personnage */
.card .fx::before { transform: none; }

/* Commune : sobre, un halo clair */
.card.r-C .fx::before { background: radial-gradient(ellipse 60% 42% at 50% 47%, #ffffff38, transparent 72%); }

/* Peu commune : halo vert et anneau */
.card.r-U .fx::before { background:
  radial-gradient(circle at 50% 45%, transparent 0 35cqw, #7dffc566 35.4cqw 36.4cqw, transparent 37cqw),
  radial-gradient(ellipse 70% 52% at 50% 46%, #3ecf8ea8, transparent 74%); }

/* Rare : rayons bleus et double anneau */
.card.r-R .fx::before { background:
  radial-gradient(circle at 50% 45%, transparent 0 33cqw, #cfe6ff99 33.4cqw 34.4cqw, transparent 35cqw 39cqw, #7ab8ff66 39.4cqw 40cqw, transparent 40.6cqw),
  radial-gradient(ellipse 70% 52% at 50% 45%, #5aa9ffcc, #2f6fd055 55%, transparent 78%),
  repeating-conic-gradient(from 2deg at 50% 45%, #cfe6ff40 0 4deg, transparent 4deg 18deg); }

/* Épique : explosion violette en étoile */
.card.r-E .fx::before { background:
  radial-gradient(ellipse 52% 38% at 50% 44%, #f4e4ffe6, #b86bffb8 46%, transparent 76%),
  repeating-conic-gradient(from 4deg at 50% 44%, #e9ccff80 0 3deg, transparent 3deg 9deg, #8a3fe066 9deg 11deg, transparent 11deg 20deg); }

/* Légendaire : soleil d'or */
.card.r-L .fx::before { background:
  radial-gradient(circle at 50% 43%, transparent 0 36cqw, #fff6c4cc 36.4cqw 37.6cqw, transparent 38.4cqw 43cqw, #ffd35a77 43.4cqw 44cqw, transparent 44.8cqw),
  radial-gradient(ellipse 56% 42% at 50% 43%, #fffbe0f2, #ffc42ecc 42%, transparent 78%),
  repeating-conic-gradient(from 0deg at 50% 43%, #fff1a8a6 0 6deg, transparent 6deg 16deg); }

/* Mythique : embrasement rouge. Le décor est rouge quel que soit le jeu (son motif reste visible). */
.card.r-M { background:
  radial-gradient(130% 62% at 50% 30%, #ff8095 0%, #a8102f 34%, transparent 74%),
  radial-gradient(90% 45% at 0% 100%, #a8102f8c, transparent 70%),
  linear-gradient(172deg, #76081f 0%, #26030c 62%, #0e0105 100%); }
.card.r-M .fx::before { background:
  radial-gradient(circle at 50% 43%, #fff 0, #ffd3dba6 11%, transparent 36%),
  repeating-conic-gradient(from 0deg at 50% 43%, #ffd9df8c 0 2.5deg, transparent 2.5deg 11deg),
  radial-gradient(ellipse 70% 52% at 50% 43%, #ff4d6d, #d4123c 48%, #6d041c);
  -webkit-mask-image: radial-gradient(ellipse 86% 66% at 50% 43%, #000 34%, transparent 92%); mask-image: radial-gradient(ellipse 86% 66% at 50% 43%, #000 34%, transparent 92%); }

/* 4. Le sol : une lueur sous les pieds, et des éclats pour les trois plus hautes raretés */
.card .fx::after { background: radial-gradient(ellipse 46% 7% at 50% 87%, color-mix(in srgb, var(--rc) 75%, transparent), transparent 100%), linear-gradient(transparent 70%, #0000008c); }
.card.r-E .fx::after, .card.r-L .fx::after, .card.r-M .fx::after {
  background-image: linear-gradient(#fff, #fff), linear-gradient(#fff, #fff), linear-gradient(#fff, #fff), linear-gradient(#fff, #fff),
    linear-gradient(#fff, #fff), linear-gradient(#fff, #fff), linear-gradient(#fff, #fff),
    radial-gradient(ellipse 46% 7% at 50% 87%, color-mix(in srgb, var(--rc) 85%, transparent), transparent 100%), linear-gradient(transparent 70%, #0000008c);
  background-repeat: no-repeat;
  background-size: 2cqw 2cqw, 1.4cqw 1.4cqw, 2.4cqw 2.4cqw, 1.4cqw 1.4cqw, 1.8cqw 1.8cqw, 1.2cqw 1.2cqw, 1.6cqw 1.6cqw, 100% 100%, 100% 100%;
  background-position: 14% 22%, 82% 18%, 88% 54%, 10% 64%, 74% 76%, 28% 38%, 64% 12%, 0 0, 0 0;
}
