/* ============================================
   RESET & BASE
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", "Arial Narrow", Arial, Helvetica, sans-serif;

  padding: 20px;
}
.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #ffed00;
  max-width: 1200px;
  margin: 0 auto;
}
/* ============================================
   TITRE H1
   ============================================ */
h1 {
  background: #be1622;
  color: #ffffff;
  padding: 18px 50px;
  border-radius: 14px;
  text-align: center;
  letter-spacing: 6px;
  font-size: 28px;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 30px;
  box-shadow: 0 6px 25px rgba(190, 22, 34, 0.5);
}

/* ============================================
   LISTE UL
   ============================================ */
ul {
  list-style: none;
  width: 100%;
  max-width: 900px;
  /* display: flex; */
  flex-direction: column;
  align-items: center;
}

/* ============================================
   ANIMATION APPARITION PROGRESSIVE
   ============================================ */
@keyframes fadeSlideIn {
  0% {
    opacity: 0;
    transform: translateX(-60px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ============================================
   LI — Ligne générale
   ============================================ */
li {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  border: 2px solid #000000;
  border-radius: 18px;
  overflow: hidden;
  background: #ffffff;
  opacity: 0;
  animation: fadeSlideIn 0.6s ease-out forwards;
  margin-bottom: 10px;
}

/* Largeurs dégressives + délais d'animation */
li:nth-child(1) {
  width: 100%;
  animation-delay: 0.1s;
}
li:nth-child(2) {
  width: 92%;
  animation-delay: 0.25s;
}
li:nth-child(3) {
  width: 84%;
  animation-delay: 0.4s;
}
li:nth-child(4) {
  width: 76%;
  animation-delay: 0.55s;
}
li:nth-child(5) {
  width: 68%;
  animation-delay: 0.7s;
}
li:nth-child(6) {
  width: 60%;
  animation-delay: 0.85s;
}
li:nth-child(7) {
  width: 52%;
  animation-delay: 1s;
}
li:nth-child(8) {
  width: 44%;
  animation-delay: 1.15s;
}

/* ============================================
   COLONNE 1 — RANG (h2) — width adaptable
   ============================================ */
li h2 {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.04);
  border-right: 1px solid rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
  /* Pas de width fixe : le contenu dicte la largeur */
}

/* Couleurs par rang */
li:nth-child(1) h2 {
  color: #009fe3;
}
li:nth-child(2) h2 {
  color: #3aaa35;
}
li:nth-child(3) h2 {
  color: #e6007e;
}
li:nth-child(4) h2 {
  color: #e6332a;
}
li:nth-child(5) h2 {
  color: #f39200;
}
li:nth-child(6) h2 {
  color: #36a9e1;
}
li:nth-child(7) h2 {
  color: #951b81;
}
li:nth-child(8) h2 {
  color: #7d4e24;
}

/* ============================================
   COLONNE 2 — BOULES (div.balls) — prend tout l'espace restant
   ============================================ */
.balls {
  flex: 1;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  /* justify-content: center; */
  gap: 5px;
  padding: 6px 8px;
  min-width: 0;
}

.ball {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 1;
  min-width: 20px;
  min-height: 20px;
  aspect-ratio: 1 / 1;
  box-shadow:
    inset 0 -3px 5px rgba(0, 0, 0, 0.25),
    0 2px 4px rgba(0, 0, 0, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Couleurs des boules par data-num */
.ball[data-num="1"] {
  background: #e6332a;
}
.ball[data-num="2"] {
  background: #3aaa35;
}
.ball[data-num="3"] {
  background: #009fe3;
}
.ball[data-num="4"] {
  background: #f39200;
}
.ball[data-num="5"] {
  background: #951b81;
}
.ball[data-num="6"] {
  background: #ffd700;
  color: #333;
  text-shadow: none;
}
.ball[data-num="7"] {
  background: #e6007e;
}
.ball[data-num="8"] {
  background: #1b5e20;
}
.ball[data-num="9"] {
  background: #4a148c;
}
.ball[data-num="10"] {
  background: #d84315;
}

/* ============================================
   COLONNE 3 — BADGE GAIN (span)
   Utilise ::before skewX pour la diagonale oblique.
   Le background couvre TOUT le span sans vide résiduel.
   ============================================ */
li span {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px 8px 28px;
  color: #ffffff;
  font-weight: 800;
  font-family: "Arial Narrow", "Segoe UI Semibold", Arial, sans-serif;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  z-index: 1;
  overflow: visible;
  /* Pas de width fixe ni de clip-path sur le span lui-même */
}

/* Fond coloré diagonal via ::before — couvre tout le span + déborde à gauche */
li span::before {
  content: "";
  position: absolute;
  top: 0;
  left: -20px;
  right: 0;
  bottom: 0;
  z-index: -1;
  border-radius: 0 7px 7px 0;
  transform: skewX(-12deg);
  transform-origin: bottom left;
}

/* Couleurs badge ::before par rang */
li:nth-child(1) span::before {
  background: #009fe3;
}
li:nth-child(2) span::before {
  background: #3aaa35;
}
li:nth-child(3) span::before {
  background: #e6007e;
}
li:nth-child(4) span::before {
  background: #e6332a;
}
li:nth-child(5) span::before {
  background: #f39200;
}
li:nth-child(6) span::before {
  background: #36a9e1;
}
li:nth-child(7) span::before {
  background: #951b81;
}
li:nth-child(8) span::before {
  background: #7d4e24;
}

/* ============================================
   RESPONSIVE — TABLETTE (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
  body {
    padding: 14px;
  }

  h1 {
    font-size: 22px;
    padding: 14px 30px;
    letter-spacing: 4px;
    border-radius: 12px;
  }

  li h2 {
    font-size: 12px;
    padding: 6px 10px;
  }

  .ball {
    width: 28px;
    height: 28px;
    font-size: 11px;
    min-width: 18px;
    min-height: 18px;
  }

  .balls {
    gap: 4px;
    padding: 5px 6px;
  }

  li span {
    font-size: 12px;
    padding: 6px 12px 6px 24px;
  }

  li span::before {
    left: -16px;
  }
  li:nth-child(1) {
    width: 100%;
  }
  li:nth-child(2) {
    width: 100%;
  }
  li:nth-child(3) {
    width: 100%;
  }
  li:nth-child(4) {
    width: 100%;
  }
  li:nth-child(5) {
    width: 100%;
  }
  li:nth-child(6) {
    width: 100%;
  }
  li:nth-child(7) {
    width: 100%;
  }
  li:nth-child(8) {
    width: 100%;
  }
}

/* ============================================
   RESPONSIVE — MOBILE (max-width: 480px)
   ============================================ */
@media (max-width: 480px) {
  body {
    padding: 8px;
  }

  h1 {
    font-size: 16px;
    padding: 12px 18px;
    letter-spacing: 3px;
    border-radius: 10px;
    margin-bottom: 18px;
  }

  li {
    margin-bottom: 7px;
    border-radius: 6px;
    border-radius: 18px;
    width: 100%;
  }

  li h2 {
    font-size: 9px;
    padding: 4px 6px;
    letter-spacing: 0.3px;
  }

  .ball {
    width: 22px;
    height: 22px;
    font-size: 9px;
    min-width: 14px;
    min-height: 14px;
  }

  .balls {
    gap: 2px;
    padding: 4px 4px;
  }

  li span {
    font-size: 9px;
    padding: 4px 8px 4px 18px;
  }

  li span::before {
    left: -12px;
    transform: skewX(-10deg);
    border-radius: 0 5px 5px 0;
  }
  li:nth-child(1) {
    width: 100%;
  }
  li:nth-child(2) {
    width: 100%;
  }
  li:nth-child(3) {
    width: 100%;
  }
  li:nth-child(4) {
    width: 100%;
  }
  li:nth-child(5) {
    width: 100%;
  }
  li:nth-child(6) {
    width: 100%;
  }
  li:nth-child(7) {
    width: 100%;
  }
  li:nth-child(8) {
    width: 100%;
  }
}

/* ============================================
   RESPONSIVE — TRÈS PETIT MOBILE (max-width: 360px)
   ============================================ */
@media (max-width: 360px) {
  body {
    padding: 4px;
  }

  h1 {
    font-size: 13px;
    padding: 10px 12px;
    letter-spacing: 2px;
    border-radius: 8px;
    margin-bottom: 12px;
  }

  li {
    margin-bottom: 5px;
    border-radius: 5px;
    border-radius: 18px;
  }

  li h2 {
    font-size: 7px;
    padding: 3px 4px;
    letter-spacing: 0;
  }

  .ball {
    width: 16px;
    height: 16px;
    font-size: 7px;
    min-width: 12px;
    min-height: 12px;
  }

  .balls {
    gap: 1.5px;
    padding: 3px 2px;
  }

  li span {
    font-size: 7px;
    padding: 3px 5px 3px 14px;
  }

  li span::before {
    left: -10px;
    transform: skewX(-8deg);
    border-radius: 0 4px 4px 0;
  }
}
