/* Cartes joueur style FIFA — podium & profil */
.fifa-card-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
  max-width: 15rem;
  padding: 0.5rem 0.6rem 0.25rem;
  overflow: visible;
}

.fifa-card-wrap--first {
  max-width: 16.5rem;
  z-index: 2;
}

.fifa-card-wrap--profile {
  flex: none;
  max-width: 19rem;
  padding: 1rem 1.25rem;
}

.fifa-card-wrap--first .fifa-card {
  transform: translateY(-0.5rem) scale(1.04);
}

.fifa-card {
  position: relative;
  display: block;
  width: 100%;
  overflow: visible;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, filter 0.3s ease;
  filter:
    drop-shadow(0 0 8px var(--rank-glow, rgba(87, 176, 226, 0.5)))
    drop-shadow(0 0 24px var(--rank-glow, rgba(87, 176, 226, 0.35)));
}

.fifa-card:hover {
  transform: translateY(-5px) scale(1.02);
}

.fifa-card-wrap--first .fifa-card:hover {
  transform: translateY(-0.7rem) scale(1.06);
}

/* ——— Lueur multi-couches (couleur du rang) ——— */
.fifa-card__halo {
  position: absolute;
  inset: -28px;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(
    ellipse 75% 90% at 50% 45%,
    var(--rank-border, #57b0e2) 0%,
    var(--rank-glow, rgba(87, 176, 226, 0.5)) 25%,
    transparent 62%
  );
  opacity: 0.7;
  animation: fifaHaloBreath 3.2s ease-in-out infinite;
}

.fifa-card__aura {
  position: absolute;
  inset: -12px;
  z-index: 0;
  border-radius: 20px;
  opacity: 1;
  background: conic-gradient(
    from var(--fifa-aura-angle, 0deg),
    transparent 0deg,
    var(--rank-glow, rgba(87, 176, 226, 1)) 40deg,
    var(--rank-border, #57b0e2) 90deg,
    rgba(255, 255, 255, 0.35) 120deg,
    transparent 160deg,
    var(--rank-glow, rgba(87, 176, 226, 0.9)) 210deg,
    var(--rank-border, #57b0e2) 270deg,
    transparent 320deg
  );
  animation: fifaAuraRotate 2.8s linear infinite;
  filter: blur(14px) saturate(1.4);
  pointer-events: none;
}

.fifa-card__aura::after {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 16px;
  background: #060d1a;
}

.fifa-card__glow {
  position: absolute;
  inset: -22px;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(
    circle at 50% 55%,
    var(--rank-glow, rgba(87, 176, 226, 0.65)) 0%,
    transparent 55%
  );
  animation: fifaGlowPulse 2.4s ease-in-out infinite;
}

.fifa-card__sparkle {
  position: absolute;
  inset: -2px;
  z-index: 2;
  pointer-events: none;
  clip-path: polygon(
    50% 0%,
    86% 7%,
    100% 26%,
    97% 68%,
    84% 99%,
    50% 97%,
    16% 99%,
    3% 68%,
    0% 26%,
    14% 7%
  );
  background: linear-gradient(
    115deg,
    transparent 0%,
    transparent 38%,
    rgba(255, 255, 255, 0.22) 48%,
    rgba(255, 255, 255, 0.05) 52%,
    transparent 62%,
    transparent 100%
  );
  background-size: 220% 100%;
  animation: fifaSparkle 3.5s ease-in-out infinite;
  mix-blend-mode: overlay;
}

.fifa-card:hover .fifa-card__glow,
.fifa-card:hover .fifa-card__halo {
  opacity: 1;
  animation-duration: 1.5s;
}

.fifa-card:hover {
  filter:
    drop-shadow(0 0 12px var(--rank-border, #57b0e2))
    drop-shadow(0 0 32px var(--rank-glow, rgba(87, 176, 226, 0.7)))
    drop-shadow(0 0 48px var(--rank-glow, rgba(87, 176, 226, 0.4)));
}

@keyframes fifaAuraRotate {
  to { --fifa-aura-angle: 360deg; }
}

@keyframes fifaHaloBreath {
  0%, 100% { opacity: 0.55; transform: scale(0.94); }
  50% { opacity: 0.95; transform: scale(1.08); }
}

@keyframes fifaGlowPulse {
  0%, 100% { opacity: 0.5; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.05); }
}

@keyframes fifaSparkle {
  0%, 100% { background-position: 180% 0; opacity: 0.4; }
  50% { background-position: -40% 0; opacity: 1; }
}

@property --fifa-aura-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

.fifa-card__shell {
  position: relative;
  z-index: 1;
  clip-path: polygon(
    50% 0%,
    80% 9%,
    100% 26%,
    97% 68%,
    84% 99%,
    50% 97%,
    16% 99%,
    3% 68%,
    0% 26%,
    20% 9%
  );
  padding: 2px;
  background: linear-gradient(
    165deg,
    var(--rank-border, #57b0e2) 0%,
    rgba(255, 255, 255, 0.45) 30%,
    var(--rank-border, #57b0e2) 55%,
    rgba(0, 0, 0, 0.35) 100%
  );
  box-shadow:
    0 0 20px var(--rank-glow, rgba(87, 176, 226, 0.4)),
    0 14px 36px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.fifa-card__inner {
  position: relative;
  clip-path: polygon(
    50% 0%,
    80% 9%,
    100% 26%,
    97% 68%,
    84% 99%,
    50% 97%,
    16% 99%,
    3% 68%,
    0% 26%,
    20% 9%
  );
  min-height: 16.25rem;
  display: flex;
  flex-direction: column;
  background: linear-gradient(
    180deg,
    #0c2048 0%,
    #061228 40%,
    #020a18 100%
  );
  overflow: hidden;
}

.fifa-card-wrap--first .fifa-card__inner {
  min-height: 17.25rem;
}

.fifa-card-wrap--profile .fifa-card__inner {
  min-height: 18rem;
}

.fifa-card__inner::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 95% 55% at 50% 0%, var(--rank-glow, rgba(87, 176, 226, 0.35)), transparent 58%),
    repeating-linear-gradient(
      -18deg,
      transparent,
      transparent 12px,
      rgba(255, 255, 255, 0.025) 12px,
      rgba(255, 255, 255, 0.025) 13px
    );
  pointer-events: none;
}

/* Emblème centré au-dessus de l'avatar */
.fifa-card__rank-center {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: 0.1rem;
  position: relative;
  z-index: 3;
  flex-shrink: 0;
}

.fifa-card .fifa-card__rank-center .rank-emblem--sm .rank-emblem__shield {
  width: 1.5rem;
  height: 1.7rem;
  font-size: 0.5rem;
}

.fifa-card .fifa-card__rank-center .rank-emblem--md .rank-emblem__shield {
  width: 2.35rem;
  height: 2.6rem;
  font-size: 0.72rem;
}

.fifa-card .rank-emblem__glow {
  inset: -2px;
  filter: blur(4px);
}

.fifa-card .rank-emblem--placement .rank-emblem__icon {
  animation: none;
}

.fifa-card--static {
  cursor: default;
}

.fifa-card__avatar-zone {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.65rem 0.35rem;
  min-height: 5.25rem;
}

.fifa-card__avatar-zone .heppner-avatar.lg {
  width: 4rem;
  height: 4rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.fifa-card__avatar-zone .heppner-avatar.xl {
  width: 5rem;
  height: 5rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.fifa-card-wrap--first .fifa-card__avatar-zone .heppner-avatar.lg {
  width: 4.5rem;
  height: 4.5rem;
}

.fifa-card-wrap--profile .fifa-card__avatar-zone {
  min-height: 5.25rem;
}

.fifa-card-wrap--profile .fifa-card__avatar-zone .heppner-avatar.xl {
  width: 5.5rem;
  height: 5.5rem;
}

.fifa-card__podium-medal {
  position: absolute;
  top: -0.2rem;
  right: 0.35rem;
  font-size: 1.1rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  z-index: 2;
}

.fifa-card__name-bar {
  position: relative;
  z-index: 1;
  margin: 0 0.65rem;
  padding: 0.3rem 0.45rem;
  text-align: center;
  background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.18), transparent);
  border-top: 1px solid rgba(255, 215, 0, 0.3);
  border-bottom: 1px solid rgba(255, 215, 0, 0.3);
}

.fifa-card__name {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fef3c7;
  line-height: 1.15;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.fifa-card-wrap--first .fifa-card__name,
.fifa-card-wrap--profile .fifa-card__name {
  font-size: 0.72rem;
}

.fifa-card__stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.22rem 0.35rem;
  padding: 0.35rem 0.9rem 1.15rem;
  margin-top: auto;
}

.fifa-card__stat {
  text-align: center;
  min-width: 0;
  cursor: help;
}

.fifa-card__stat-val {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fifa-card-wrap--profile .fifa-card__stat-val {
  font-size: 0.74rem;
}

.fifa-card__stat-val--sm {
  font-size: 0.58rem;
}

.fifa-card__stat-val--xs {
  font-size: 0.52rem;
  letter-spacing: -0.03em;
}

.fifa-card__stat-lbl {
  display: block;
  font-size: 0.42rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
  color: rgba(255, 255, 255, 0.42);
  margin-top: 0.18rem;
}

.fifa-card__place-label {
  margin-top: 0.65rem;
  padding: 0.3rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.45);
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.fifa-card__place-label--gold {
  color: #ffe566;
  background: rgba(255, 215, 0, 0.18);
  border-color: rgba(255, 215, 0, 0.45);
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.35);
}

.fifa-card__place-label--silver {
  color: #e8e8e8;
  background: rgba(192, 192, 192, 0.15);
  border-color: rgba(192, 192, 192, 0.4);
  box-shadow: 0 0 12px rgba(192, 192, 192, 0.25);
}

.fifa-card__place-label--bronze {
  color: #f0b878;
  background: rgba(205, 127, 50, 0.18);
  border-color: rgba(205, 127, 50, 0.45);
  box-shadow: 0 0 12px rgba(205, 127, 50, 0.3);
}

/* ——— Page Statistiques ——— */
.fifa-stats-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1.5rem 1rem;
  border-radius: 1rem;
  background: linear-gradient(165deg, rgba(3, 48, 132, 0.35) 0%, rgba(0, 20, 60, 0.6) 100%);
  border: 1px solid rgba(87, 176, 226, 0.15);
  overflow: visible;
}

@media (min-width: 768px) {
  .fifa-stats-hero {
    grid-template-columns: auto 1fr;
    gap: 2rem;
    padding: 1.75rem 2rem;
  }
}

.fifa-stats-hero__card {
  display: flex;
  justify-content: center;
  overflow: visible;
}

.fifa-stats-hero__info {
  text-align: center;
}

@media (min-width: 768px) {
  .fifa-stats-hero__info {
    text-align: left;
  }
}

.fifa-podium-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 0.5rem 0.5rem;
  overflow: visible;
}

@media (min-width: 640px) {
  .fifa-podium-row {
    gap: 1.25rem;
  }
}

/* Mobile : podium 3 cartes côte à côte + halo léger */
@media (max-width: 639px) {
  .fifa-podium-row {
    flex-direction: row;
    align-items: flex-end;
    justify-content: center;
    gap: 0.08rem;
    padding: 0.65rem 0.1rem 0.35rem;
    width: 100%;
    max-width: 100%;
  }

  .fifa-card-wrap {
    flex: 1 1 0;
    min-width: 0;
    max-width: 34.5%;
    width: auto;
    padding: 0.08rem 0 0;
    contain: layout style;
    isolation: isolate;
  }

  .fifa-card-wrap .fifa-card {
    transform: scale(0.76);
    transform-origin: center bottom;
    transition: none;
  }

  .fifa-card-wrap--first .fifa-card {
    transform: scale(0.82);
    z-index: 1;
  }

  .fifa-card-wrap .fifa-card:hover,
  .fifa-card-wrap--first .fifa-card:hover {
    transform: scale(0.76);
    filter: drop-shadow(0 0 10px var(--rank-glow, rgba(87, 176, 226, 0.5)))
            drop-shadow(0 0 18px var(--rank-glow, rgba(87, 176, 226, 0.35)));
  }

  .fifa-card-wrap--first .fifa-card:hover {
    transform: scale(0.82);
  }

  /* Base du bouclier plus large pour les stats */
  .fifa-podium-row .fifa-card__shell,
  .fifa-podium-row .fifa-card__inner {
    clip-path: polygon(
      50% 0%,
      78% 9%,
      100% 26%,
      98% 64%,
      90% 99%,
      50% 98%,
      10% 99%,
      2% 64%,
      0% 26%,
      22% 9%
    );
  }

  .fifa-card-wrap--place-1 { order: 2; }
  .fifa-card-wrap--place-2 { order: 1; }
  .fifa-card-wrap--place-3 { order: 3; }

  .fifa-card .fifa-card__rank-center .rank-emblem--sm .rank-emblem__shield {
    width: 1.35rem;
    height: 1.5rem;
    font-size: 0.45rem;
  }

  .fifa-podium-row .fifa-card__stat-val {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
    line-height: 1.15;
    font-size: 0.48rem;
  }

  .fifa-podium-row .fifa-card__stat-val--sm,
  .fifa-podium-row .fifa-card__stat-val--xs {
    font-size: 0.45rem;
    letter-spacing: 0;
  }

  .fifa-podium-row .fifa-card__stat-lbl {
    font-size: 0.36rem;
    letter-spacing: 0.04em;
  }

  .fifa-podium-row .fifa-card__stats {
    padding: 0.3rem 0.45rem 0.65rem;
    gap: 0.16rem 0.12rem;
  }

  .fifa-card__place-label {
    font-size: 0.5rem;
    padding: 0.12rem 0.35rem;
    margin-top: 0.15rem;
    letter-spacing: 0.1em;
  }

  .fifa-podium-section {
    padding-left: 0.2rem !important;
    padding-right: 0.2rem !important;
  }

  .fifa-card {
    filter: drop-shadow(0 0 8px var(--rank-glow, rgba(87, 176, 226, 0.5)))
            drop-shadow(0 0 16px var(--rank-glow, rgba(87, 176, 226, 0.3)));
  }

  .fifa-card__sparkle {
    display: none;
  }

  .fifa-card__aura {
    display: none;
  }

  /* Halo léger statique (performant) */
  .fifa-card__halo {
    animation: none;
    opacity: 0.8;
    inset: -10px;
    filter: none;
  }

  .fifa-card__glow {
    animation: none;
    opacity: 0.65;
    inset: -12px;
  }

  .fifa-card__shell {
    box-shadow:
      0 0 14px var(--rank-glow, rgba(87, 176, 226, 0.45)),
      0 8px 20px rgba(0, 0, 0, 0.45),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }

  .fifa-podium-row .fifa-card__inner {
    min-height: 16rem;
  }

  .fifa-podium-row .fifa-card-wrap--first .fifa-card__inner {
    min-height: 16.5rem;
  }
}

/* Profil / statistiques : carte pleine largeur sur mobile */
@media (max-width: 639px) {
  .fifa-card-wrap--profile {
    max-width: 19rem;
    width: min(100%, 19rem);
    padding: 1rem;
  }

  .fifa-card-wrap--profile .fifa-card {
    transform: none;
  }

  .fifa-card-wrap--profile .fifa-card:hover {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fifa-card__halo,
  .fifa-card__aura,
  .fifa-card__glow,
  .fifa-card__sparkle {
    animation: none !important;
  }
}

.fifa-podium-section {
  overflow: visible;
}
