/* ============================
   VARIABLES
============================ */
:root {
  --bg: #0a0a0f;
  --bg-2: #141421;
  --text: #f5f5ff;
  --muted: #9d9db8;

  --violet: #7c3aed;
  --violet-2: #5b21b6;
  --violet-glow: #a78bfa;

  --line: #2a2a3d;
  --ok: #22d3ee;
  --warn: #fde047;

  --shadow: 0 12px 36px rgba(0,0,0,.65);
  --radius: 16px;
}

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

html, body { height: 100%; }

body {
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(124,58,237,.12), transparent 60%),
    radial-gradient(800px 500px at 80% -20%, rgba(91,33,182,.15), transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}

/* ============================
   HEADER HERO
============================ */
.hero {
  max-width: 1000px;
  margin: 0 auto 40px;
  padding: 0 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding-top: 12rem;
  padding-bottom: 5rem;
}

.kicker {
  color: var(--violet-glow);
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  font-size: .75rem;
  opacity: .9;
}

h1.title {
  font-size: clamp(2rem, 2.5vw + 1rem, 3.5rem);
  font-weight: 900;
  background: linear-gradient(90deg, var(--violet-glow) 0%, #fff 40%, var(--violet) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 10px 40px rgba(124,58,237,.35);
}

.subtitle {
  color: var(--muted);
  font-size: .95rem;
  margin-top: -2px;
}

/* ============================
   TOGGLE BUTTONS
============================ */
.toggle {
  display: flex;
  gap: 14px;
  margin-top: 18px;
  flex-wrap: wrap;
  justify-content: center;
}

.pill {
  background: #161627;
  border: 1px solid #26263a;
  color: #eaeaff;
  padding: 10px 22px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  font-size: .95rem;
  transition: all .25s ease;
}
.pill:hover { background: #20203a; }
.pill.active {
  background: linear-gradient(135deg, var(--violet), var(--violet-2));
  border-color: #4c1d95;
  color: #fff;
  box-shadow: 0 6px 22px rgba(124,58,237,.45);
}

/* ============================
   LISTE TOP 10
============================ */
.list {
  max-width: 1200px;
  margin: 0 auto 80px;
  padding: 0 20px;
  display: grid;
  gap: 20px;
  padding-bottom: 2rem;
}

.row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px;
  border-radius: var(--radius);
  border: 1px solid #26263a;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(8px);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  min-height: 120px;
}
.row::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(0deg, rgba(10,10,12,.72), rgba(10,10,12,.72)), var(--bg-img) center/cover no-repeat;
  filter: saturate(.9) contrast(.95);
}
.row:hover {
  transform: translateY(-3px);
  border-color: #3a2a5a;
  box-shadow: 0 14px 36px rgba(0,0,0,.55);
}
.row > * { position: relative; z-index: 1; }

/* ============================
   ÉLÉMENTS DANS LES ROWS
============================ */
.rank {
  min-width: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rank .num {
  font-weight: 900;
  font-size: clamp(2rem, 4.6vw, 3rem);
  color: #fff;
  text-shadow: 0 3px 10px rgba(0,0,0,0.8), 0 0 4px rgba(0,0,0,0.5);
}

.meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.meta .title {
  font-weight: 900;
  font-size: clamp(1.2rem, 1.5vw, 1.6rem);
  color: #fff;
  line-height: 1.2;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8), 0 0 6px rgba(0,0,0,0.4);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: .8rem;
  font-weight: 700;
  background: rgba(255,255,255,0.12);
  color: #f1f1f8;
  border: 1px solid rgba(255,255,255,0.25);
  padding: 6px 12px;
  border-radius: 12px;
  backdrop-filter: blur(6px);
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
}

.stats {
  display: flex;
  gap: 16px;
  align-items: center;
}
.stats .box {
  height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 130px;
  text-align: center;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.06);
  padding: 12px 16px;
  border-radius: 14px;
}
.stats .val {
  font-weight: 900;
  font-size: 1.3rem;
  color: var(--violet);
  text-shadow: 0 2px 6px rgba(0,0,0,0.85);
}
.stats .lab {
  font-size: .8rem;
  font-weight: 600;
  color: var(--violet-glow);
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ============================
   ÉTATS & SKELETON
============================ */
.skeleton {
  background: linear-gradient(90deg,#1c1c2a 25%,#24243a 37%,#1c1c2a 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s infinite linear;
}
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.s-row {
  height: 146px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.state {
  max-width: 1000px;
  margin: 40px auto;
  padding: 0 20px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 14px;
}
.state .badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #221133;
  border: 1px solid #3a2359;
  color: #d8b4fe;
}

/* ============================
   RESPONSIVE
============================ */

/* CENTRAGE STRICT EN RESPONSIVE (mobile) */
@media (max-width: 720px) {
  .row{
    display: grid !important;
    grid-template-columns: 1fr;
    justify-items: center;       /* centre tous les enfants */
    align-content: center;
    text-align: center !important;
    gap: 14px;
  }

  .rank{
    align-self: center !important;
    margin: 0 !important;
  }

  .meta{
    display: flex;
    flex-direction: column;
    align-items: center !important;
    justify-content: center;
    width: 100%;
    text-align: center !important;
    margin: 0 !important;
  }

  .chips{
    display: flex;
    flex-wrap: wrap;
    justify-content: center !important;
    width: 100%;
    gap: 8px;
  }

  .stats{
    display: grid !important;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    justify-content: center;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin: 0 !important;
  }

  .stats .box{
    justify-self: center;
    width: 100%;
    min-width: 0;
  }
}

/* très petit écran : une seule colonne pour les stats */
@media (max-width: 420px){
  .stats{
    grid-template-columns: 1fr;
  }
}
