/* =========================================================
   LEADERBOARD - FIFA PODIUM STYLE FINAL
========================================================= */

.cpl-leaderboard-wrapper {
  max-width: 1100px;
  margin: 24px auto;
  color: #fff;
  font-family: Arial, sans-serif;
  direction: ltr;
  text-align: left;
}

.cpl-leaderboard-header {
  margin-bottom: 22px;
}

.cpl-leaderboard-header h2 {
  margin: 0;
  font-size: 34px;
  font-weight: 900;
  color: #ffd700;
}

.cpl-leaderboard-header p {
  margin: 8px 0 0;
  color: #aab4c6;
  font-size: 15px;
}

/* ================= EMPTY ================= */
.cpl-lb-empty {
  background: #101727;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 28px;
  text-align: center;
}

.cpl-lb-empty h3 {
  margin: 0 0 10px;
  color: #fff;
}

.cpl-lb-empty p {
  margin: 0;
  color: #c0c8d9;
}

/* ================= PODIUM ================= */

.cpl-podium {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  overflow-x: auto; /* يخلي فيه scroll بدل ما يكسر */
  flex-wrap: nowrap; /* يمنع اللخبطة */
}

@media (max-width: 720px) {

  .cpl-podium {
    padding-bottom: 10px;
  }

  .cpl-podium-card {
    min-width: 200px; /* يخلي الكروت ثابتة */
  }

}


.cpl-podium-card {
  position: relative;
  width: 240px;
  background: linear-gradient(180deg, #101727, #0f1422);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 18px 18px 0;
  text-align: center;
  box-shadow: 0 10px 28px rgba(0,0,0,0.25);
  animation: cplPodiumUp .7s ease both;
  overflow: hidden;
}

.cpl-podium-first {
  transform: translateY(-12px);
  border-color: rgba(255,215,0,0.6);

  box-shadow:
    0 0 30px rgba(255,215,0,0.35),
    0 10px 28px rgba(0,0,0,0.25);
}

.cpl-podium-second {
  border-color: rgba(207,207,207,0.30);
}

.cpl-podium-third {
  border-color: rgba(205,127,50,0.40);
}

.cpl-crown {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 28px;
  z-index: 3;
}

.cpl-medal {
  font-size: 26px;
  margin-bottom: 6px;
}

.cpl-medal-gold,
.cpl-medal-silver,
.cpl-medal-bronze {
  display: inline-block;
}

.cpl-podium-rank {
  font-size: 28px;
  font-weight: 900;
  color: #ffd700;
  margin-bottom: 10px;
}

.cpl-podium-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 12px;
  border: 3px solid rgba(255,255,255,0.12);
  box-shadow: 0 0 0 6px rgba(255,255,255,0.03);
}

.cpl-podium-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cpl-podium-name {
  font-size: 18px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 8px;
  word-break: break-word;
}

.cpl-podium-total-label {
  font-size: 12px;
  color: #b9c4d9;
  font-weight: 800;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .6px;
}

.cpl-podium-points {
  font-size: 22px;
  font-weight: 900;
  color: #4cc9ff;
  margin-bottom: 14px;
}

.cpl-podium-base {
  width: 100%;
  border-radius: 16px 16px 0 0;
}

/* ================= FIFA 2026 PODIUM COLORS ================= */

/* 🥇 المركز الأول */
.cpl-base-first {
  height: 95px;
  background: linear-gradient(180deg, #FFD700, #F5B700, #C99700);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.25),
    0 0 18px rgba(255,215,0,0.45);
}

/* 🥈 المركز الثاني */
.cpl-base-second {
  height: 72px;
  background: linear-gradient(180deg, #E0E0E0, #B5B5B5, #8C8C8C);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.25),
    0 0 14px rgba(200,200,200,0.35);
}

/* 🥉 المركز الثالث */
.cpl-base-third {
  height: 58px;
  background: linear-gradient(180deg, #CD7F32, #A85C1F, #6E3D18);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.2),
    0 0 12px rgba(205,127,50,0.3);
}

/* ================= CURRENT USER IN PODIUM ================= */

.cpl-my-podium {
  border: 2px solid #4cc9ff !important;

  box-shadow:
    0 0 0 3px rgba(76,201,255,0.2),
    0 0 25px rgba(76,201,255,0.35),
    0 10px 28px rgba(0,0,0,0.25) !important;
}


.cpl-my-podium::after {
  content: "YOUR POSITION";
  position: absolute;
  top: 12px;
  right: 12px;
  background: #4cc9ff;
  color: #08111f;
  font-size: 10px;
  font-weight: 900;
  padding: 5px 8px;
  border-radius: 999px;
  letter-spacing: .4px;
}

/* ================= TABLE ================= */
.cpl-leaderboard-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cpl-leaderboard-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: #111827;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 14px 18px;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
  animation: cplFadeRank .45s ease both;
}

.cpl-leaderboard-row:hover {
  background: #172031;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.22);
}

.cpl-rank {
  width: 68px;
  font-size: 22px;
  font-weight: 900;
  color: #ffd700;
  flex: 0 0 68px;
}

.cpl-user-block {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.cpl-user-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 46px;
  border: 2px solid rgba(255,255,255,0.12);
}

.cpl-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cpl-user-name {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cpl-points {
  font-size: 18px;
  font-weight: 900;
  color: #4cc9ff;
  white-space: nowrap;
}

/* ================= CURRENT USER ROW ================= */
.cpl-my-position {
  background: linear-gradient(135deg, #0f2a4d, #133a6c) !important;
  border-color: #4cc9ff !important;
  box-shadow: 0 0 14px rgba(0,140,255,0.28);
}

.cpl-me-badge {
  display: inline-block;
  margin-left: 8px;
  background: #4cc9ff;
  color: #000;
  font-size: 11px;
  font-weight: 900;
  padding: 4px 8px;
  border-radius: 999px;
  vertical-align: middle;
}

/* ================= ANIMATIONS ================= */
@keyframes cplPodiumUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
  }
}

@keyframes cplFadeRank {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
  }
}

.cpl-leaderboard-row:nth-child(1) { animation-delay: .03s; }
.cpl-leaderboard-row:nth-child(2) { animation-delay: .06s; }
.cpl-leaderboard-row:nth-child(3) { animation-delay: .09s; }
.cpl-leaderboard-row:nth-child(4) { animation-delay: .12s; }
.cpl-leaderboard-row:nth-child(5) { animation-delay: .15s; }
.cpl-leaderboard-row:nth-child(6) { animation-delay: .18s; }
.cpl-leaderboard-row:nth-child(7) { animation-delay: .21s; }
.cpl-leaderboard-row:nth-child(8) { animation-delay: .24s; }
.cpl-leaderboard-row:nth-child(9) { animation-delay: .27s; }
.cpl-leaderboard-row:nth-child(10) { animation-delay: .30s; }

/* ================= RESPONSIVE ================= */
@media (max-width: 900px) {
  .cpl-podium {
    gap: 14px;
  }

  .cpl-podium-card {
    width: 220px;
  }
}

@media (max-width: 720px) {
  .cpl-podium {
    flex-direction: row !important;   /* تثبيت الاتجاه */
    flex-wrap: nowrap !important;     /* يمنع اللخبطة */
    overflow-x: auto;                /* scroll */
  }
}

  .cpl-podium-card {
    width: 100%;
  }

  .cpl-podium-first {
    transform: none;
  }

  .cpl-leaderboard-row {
    padding: 12px 14px;
  }

  .cpl-rank {
    width: 54px;
    flex: 0 0 54px;
    font-size: 18px;
  }

  .cpl-user-name {
    font-size: 14px;
  }

  .cpl-points {
    font-size: 15px;
  }
}
@media (max-width: 768px) {

    .cpl-leaderboard-top {
        display: flex !important;
        flex-direction: column !important; /* يخليهم فوق بعض */
        align-items: center;
        gap: 15px;
    }

    /* ترتيب ثابت */
    .cpl-leaderboard-top > *:nth-child(1) {
        order: 2;
    }

    .cpl-leaderboard-top > *:nth-child(2) {
        order: 1; /* الأول يطلع فوق */
    }

    .cpl-leaderboard-top > *:nth-child(3) {
        order: 3;
    }

    /* تصغير الكروت */
    .cpl-leaderboard-card {
        width: 100%;
        max-width: 300px;
    }

}