/* Classements : podium, recherche, barème. Le reste vient de style.css. */

/* ---------- Podium ---------- */

.podium {
  display: grid;
  gap: 1.4rem;
  align-items: end;
}

.podium:empty {
  min-height: 14rem;
}

@media (min-width: 800px) {
  .podium {
    grid-template-columns: 1fr 1.18fr 1fr;
    gap: 1.6rem;
  }

  /* le 1er est premier dans le HTML (mobile) et au centre sur grand écran */
  .podium-item.is-second {
    order: 1;
  }

  .podium-item.is-first {
    order: 2;
  }

  .podium-item.is-third {
    order: 3;
  }
}

.podium-card {
  display: grid;
  justify-items: center;
  gap: 0.7rem;
  padding: 1.6rem 1.2rem 1.5rem;
  text-align: center;
}

.podium-crown {
  width: 3.2rem;
  height: 2.1rem;
  color: var(--mag-hi);
  filter: drop-shadow(0 0 14px rgba(255, 43, 214, 0.7));
}

.podium-rank {
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1;
  color: var(--text);
  background: rgba(139, 43, 255, 0.16);
  border: 1px solid rgba(139, 43, 255, 0.6);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.podium-card h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.2rem;
  line-height: 1.15;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.podium-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  width: 100%;
  margin-top: 0.3rem;
}

.podium-stats li {
  padding: 0.6rem 0.4rem;
  background: rgba(255, 255, 255, 0.035);
  border-left: 2px solid rgba(139, 43, 255, 0.7);
}

.podium-stats strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.4rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.podium-stats span {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
}

.is-first .podium-card {
  border-image-source: url("../../img/ui/frame-card-on.svg");
  padding-block: 2rem 1.9rem;
}

.is-first .podium-rank {
  width: 4.2rem;
  height: 4.2rem;
  font-size: 2rem;
  color: #1a0420;
  background: linear-gradient(100deg, #ff58e0, var(--mag));
  border-color: transparent;
}

.is-first .podium-card h3 {
  font-size: clamp(1.35rem, 3vw, 1.7rem);
}

.is-first .podium-stats li {
  border-left-color: var(--mag);
}

.is-first .podium-stats strong {
  font-size: 1.8rem;
  color: var(--mag-hi);
  text-shadow: 0 0 18px rgba(255, 43, 214, 0.6);
}

/* ---------- Recherche ---------- */

.rank-search {
  width: min(100%, 20rem);
}

.rank-search-box {
  position: relative;
}

.rank-search-box .icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--mag-hi);
  pointer-events: none;
}

.rank-search-box input {
  padding-left: 2.6rem;
}

/* ---------- Tableau ---------- */

.rank-panel {
  padding: 1.2rem;
}

.rank-panel.empty .table-wrap,
.rank-panel.empty .rank-none {
  display: none;
}

.rank-table {
  min-width: 34rem;
}

.rank-table th.num {
  text-align: right;
}

.rank-table tbody th {
  padding: 0.75rem 0.9rem;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  text-align: left;
  text-transform: none;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  white-space: normal;
  overflow-wrap: anywhere;
}

.rank-table .pts {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--mag-hi);
}

.rank-table tr[data-rank="1"] {
  background: linear-gradient(90deg, rgba(255, 43, 214, 0.12), transparent 70%);
}

.rank-none {
  margin: 0.6rem;
}

/* ---------- Barème ---------- */

.rules {
  display: grid;
  gap: 1.6rem;
  justify-items: start;
  padding: clamp(1.4rem, 4vw, 2.4rem);
}

.rules .section-title {
  font-size: clamp(1.4rem, 3.6vw, 2.2rem);
}

.rules-grid {
  display: grid;
  gap: 1.2rem;
  width: 100%;
}

@media (min-width: 800px) {
  .rules-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.6rem;
  }
}

.rules-grid li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
}

.rules-grid h3 {
  margin-bottom: 0.3rem;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mag-hi);
}

.rules-grid p {
  font-size: 0.95rem;
  color: var(--dim);
}

/* Classement vide : le tableau sans ligne ne s'affiche pas, seul le message du cadre reste */
.rank-panel.empty .table-wrap,
.rank-panel.empty .rank-none {
  display: none;
}

.rank-panel.empty::before {
  content: "Le classement démarre avec le premier tournoi de la saison.";
}
