/* =========================================================
   VARIABLES DE COULEURS
   Change une valeur ici pour changer la couleur partout.
   ========================================================= */
:root {
  --page: #0b0f19;
  --surface: #111724;
  --surface-2: #151e2f;
  --line: #202b40;
  --line-soft: rgba(255,255,255,.06);
  --text: #ecf0fa;
  --muted: #73809a;
  --blue: #83a9ff;
  --cyan: #54d2ef;
  --green: #1ed39b;
}

/* Thème clair : activé en ajoutant data-theme="light" sur <body> */
body[data-theme="light"] {
  --page: #eef2f8; --surface: #fff; --surface-2: #f5f7fb;
  --line: #d8e0ed; --line-soft: rgba(20,30,50,.08); --text: #202a3c; --muted: #71809a;
}

/* =========================================================
   BASE
   ========================================================= */
* { box-sizing: border-box; }
html {
  background: var(--page);
}
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; margin: 0; min-width: 320px; max-width: 100vw; overflow-x: hidden; color: var(--text); background: var(--page); font-family: "Outfit", Arial, sans-serif; }
body.modal-open { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--blue); outline-offset: 2px;
}

/* Règle de sécurité : un élément avec l'attribut "hidden" doit TOUJOURS
   être invisible, même si une autre règle CSS lui donne un "display".
   Sans ça, la modale (display: grid) ignore l'attribut hidden et reste
   affichée à l'écran même après avoir cliqué sur "Fermer". */
[hidden] { display: none !important; }

/* =========================================================
   HEADER / NAVIGATION
   ========================================================= */
.top-header { height: 78px; border-bottom: 1px solid var(--line-soft); background: #0c111d; }
body[data-theme="light"] .top-header { background: #fff; border-color: var(--line); }

.header-inner {
  width: min(calc(100% - 30px), 1010px);
  height: 100%; margin: 0 auto;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px;
}

.brand { color: var(--blue); font-size: 25px; font-weight: 800; letter-spacing: -.05em; }
.brand span { color: #fff; }

.top-nav { display: flex; align-items: center; gap: 3px; padding: 4px; border: 1px solid var(--line-soft); border-radius: 8px; background: rgba(17,23,36,.7); }
.top-nav .nav-link, .top-nav a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; color: var(--muted); border-radius: 6px; font-size: 12px; }
.top-nav .nav-link:hover, .top-nav a:hover, .top-nav .nav-link.active { color: var(--text); background: var(--surface-2); }
.discord-icon { width: 15px; height: 15px; flex: 0 0 auto; }

.header-tools { display: flex; align-items: center; justify-content: end; gap: 9px; }

.header-search-wrap { position: relative; }
.header-search { display: flex; align-items: center; gap: 8px; width: 166px; padding: 0 10px; height: 32px; border: 1px solid var(--line); border-radius: 18px; color: var(--muted); background: #131b2b; transition: border-color .15s ease; }
body[data-theme="light"] .header-search { background: var(--surface-2); }
.header-search:focus-within { border-color: var(--blue); }
.search-icon { width: 15px; height: 15px; flex: 0 0 auto; color: var(--muted); }
.header-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 12px; }

/* Liste déroulante de suggestions sous la barre de recherche : apparaît
   dès la 1re lettre tapée, avec les pseudos qui COMMENCENT par le texte.
   Cliquer dessus ouvre direct la fiche du joueur. N'affecte jamais le
   classement / les catégories en dessous. */
.search-dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 30;
  display: flex; flex-direction: column; padding: 6px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  box-shadow: 0 16px 32px rgba(0,0,0,.35);
  opacity: 0; transform: translateY(-6px); pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}
.search-dropdown.open { opacity: 1; transform: translateY(0); pointer-events: auto; }

.search-result {
  display: flex; align-items: center; gap: 10px; padding: 7px 8px;
  border: none; border-radius: 8px; background: none; color: var(--text); text-align: left;
  transition: background .12s ease;
}
.search-result:hover, .search-result:focus-visible { background: var(--surface-2); }
.search-result-avatar { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 5px; overflow: hidden; }
.search-result-avatar img { width: 100%; height: 100%; object-fit: cover; image-rendering: auto; /* lissé : "pixelated" donnait un rendu crénelé quand l'image est réduite */ }
.search-result-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.search-result-points { flex: 0 0 auto; font: 700 11px "DM Mono", monospace; color: var(--muted); }

@media (max-width: 640px) {
  .search-dropdown { left: 0; right: 0; }
}

.mobile-toggle { display: none; width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }

/* =========================================================
   PAGE CLASSEMENT
   ========================================================= */
.ranking-page { min-height: calc(100vh - 78px); padding: 24px 0 50px; }
.ranking-container { width: min(calc(100% - 30px), 1010px); margin: 0 auto; }

/* Onglets des modes de jeu : une seule barre arrondie qui défile
   horizontalement, avec des pilules icône + libellé côte à côte
   (l'onglet actif devient une pilule claire). */
.mode-tabs-wrap { position: relative; }

.mode-tabs {
  display: flex; align-items: center; gap: 4px;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity;
  padding: 6px;
  border: 1px solid var(--line-soft); border-radius: 999px;
  background: rgba(17,23,36,.78);
  scrollbar-width: none;
  cursor: grab;
  scroll-behavior: smooth;
}
.mode-tabs.dragging { cursor: grabbing; scroll-behavior: auto; user-select: none; }
.mode-tabs::-webkit-scrollbar { display: none; }
body[data-theme="light"] .mode-tabs { background: var(--surface); border-color: var(--line); }

/* Flèches de défilement : visibles seulement quand il y a plus de
   catégories que la largeur ne peut en montrer (ajouté/retiré en JS). */
.tabs-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 50%;
  display: none; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text); box-shadow: 0 4px 12px rgba(0,0,0,.35);
  font-size: 16px; line-height: 1; padding: 0;
  z-index: 2;
}
.tabs-arrow:hover { background: var(--surface-2); }
.tabs-arrow.show { display: flex; }
.tabs-arrow.left { left: -14px; }
.tabs-arrow.right { right: -14px; }
@media (max-width: 600px) { .tabs-arrow { display: none !important; } }

.mode-tab {
  display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 9px;
  flex: 0 0 auto; scroll-snap-align: start;
  padding: 11px 20px; border-radius: 999px; border: 1px solid transparent;
  background: transparent; color: #8b98ad; font-size: 13px; font-weight: 700; white-space: nowrap;
  letter-spacing: .02em; transition: color .15s ease, background .15s ease, border-color .15s ease, transform .12s ease;
}
.mode-tab:hover { color: var(--text); background: var(--surface-2); }
.mode-tab:active { transform: scale(.96); }
.mode-tab.active {
  color: #17131f;
  background: #c6adde; /* repli si color-mix() n'est pas supporté */
  background: color-mix(in srgb, var(--tab-color, #b78cc8) 58%, white 42%);
  box-shadow: 0 3px 14px rgba(0,0,0,.25);
  box-shadow: 0 3px 14px color-mix(in srgb, var(--tab-color, #b78cc8) 45%, transparent 55%);
}
.mode-tab.active:hover { background: color-mix(in srgb, var(--tab-color, #b78cc8) 58%, white 42%); }
.mode-tab.active .mode-symbol { filter: drop-shadow(0 0 3px color-mix(in srgb, var(--tab-color, #b78cc8) 70%, transparent 30%)); }

.mode-symbol { width: 20px; height: 20px; object-fit: contain; flex: 0 0 auto; }
.mode-label { line-height: 1; }

/* Tableau de tiers */
.tier-board-wrap { position: relative; margin-top: 13px; padding: 18px 12px; border: 1px solid var(--line-soft); border-radius: 13px; background: rgba(17,23,36,.76); overflow-x: auto; -webkit-overflow-scrolling: touch; cursor: grab; }
.tier-board-wrap.dragging { cursor: grabbing; user-select: none; }
body[data-theme="light"] .tier-board-wrap { background: var(--surface); border-color: var(--line); }

.tier-board { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 10px; overflow-x: auto; }

/* Barre de défilement horizontale du tableau des tiers : fine, sombre,
   aux couleurs du site (au lieu de la barre blanche par défaut). */
.tier-board-wrap, .tier-board {
  scrollbar-width: thin;
  scrollbar-color: rgba(131,169,255,.4) transparent;
}
.tier-board-wrap::-webkit-scrollbar, .tier-board::-webkit-scrollbar { height: 8px; }
.tier-board-wrap::-webkit-scrollbar-track, .tier-board::-webkit-scrollbar-track { background: rgba(255,255,255,.04); border-radius: 10px; }
.tier-board-wrap::-webkit-scrollbar-thumb, .tier-board::-webkit-scrollbar-thumb { background: rgba(131,169,255,.4); border-radius: 10px; }
.tier-board-wrap::-webkit-scrollbar-thumb:hover, .tier-board::-webkit-scrollbar-thumb:hover { background: rgba(131,169,255,.65); }
.tier-board-wrap::-webkit-scrollbar-button, .tier-board::-webkit-scrollbar-button { display: none; }
.tier-column { min-width: 0; border-radius: 13px 13px 7px 7px; overflow: hidden; background: rgba(24,34,52,.86); }
body[data-theme="light"] .tier-column { background: #f2f5fa; }
.tier-column-head { height: 43px; display: flex; align-items: center; padding: 0 12px; color: #e5ebf6; font-size: 16px; font-weight: 700; background: #3e485b; }
.tier-column:nth-child(1) .tier-column-head { color: #ffe083; background: #67531b; }
.tier-column:nth-child(2) .tier-column-head { background: #465268; }
.tier-column:nth-child(3) .tier-column-head { color: #f3be98; background: #68422f; }
.tier-column:nth-child(4) .tier-column-head, .tier-column:nth-child(5) .tier-column-head { background: #2c3b53; }
.tier-column-body {
  min-height: 260px;
  /* Si beaucoup de joueurs sont ajoutés dans un même tier (ex: 500 joueurs
     dans Tier 5), la colonne ne s'étire pas à l'infini : elle défile
     verticalement à l'intérieur, en gardant les colonnes bien alignées. */
  max-height: min(60vh, 560px);
  overflow-y: auto;
  padding: 2px 0 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(131,169,255,.35) transparent;
}
.tier-column-body::-webkit-scrollbar { width: 6px; }
.tier-column-body::-webkit-scrollbar-thumb { background: rgba(131,169,255,.35); border-radius: 10px; }
.tier-column-body::-webkit-scrollbar-thumb:hover { background: rgba(131,169,255,.55); }

.player-line { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 4px 10px; border-bottom: 1px solid var(--line-soft); color: #dce4f4; text-align: left; transition: background .12s ease; }
.player-line:hover { background: rgba(119,155,214,.12); }
.player-line:active { background: rgba(119,155,214,.2); }
.player-line span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.empty-tier { display: block; padding: 18px 10px; color: var(--muted); font-size: 10px; }

/* Avatar (tête de skin Minecraft) */
.skin-avatar { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 3px; overflow: hidden; background: linear-gradient(135deg, #7048b6, #2f9fd0); }
.skin-avatar img { width: 100%; height: 100%; object-fit: cover; image-rendering: auto; /* lissé : "pixelated" donnait un rendu crénelé quand l'image est réduite */ }
.skin-avatar b { color: #fff; font: 700 8px "DM Mono", monospace; }
.skin-avatar-large { width: auto; height: 150px; border: none; border-radius: 0; background: none; }
.skin-avatar-large img { width: auto; height: 100%; object-fit: contain; }
.skin-avatar-large b { font-size: 20px; }

/* Avatar du tableau des tiers : rendu 3D du skin (skinrender.dev, pose
   "cheer"), recadré pour ne garder que la moitié haute du corps. Le
   principe : l'image affiche sa hauteur réelle x2, seule la moitié
   supérieure reste visible grâce à overflow: hidden sur le conteneur. */
.tier-avatar {
  position: relative; display: grid; place-items: center;
  flex: 0 0 auto; width: 26px; height: 32px;
  overflow: hidden; background: none; border: none; border-radius: 0;
}
.tier-avatar img {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: auto; height: 200%;
}
.tier-avatar b { color: #fff; font: 700 8px "DM Mono", monospace; }

.mini-tier { font: 700 9px "DM Mono", monospace; white-space: nowrap; }
.tier-gold { color: #f4d05a; } .tier-slate { color: #b0c4e9; } .tier-bronze { color: #f0b79a; } .tier-blue { color: #89b4ff; }

/* Pastille tier avec logo du mode + label (utilisée sur les cartes du classement général) */
.tier-badge {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  flex: 0 0 auto; width: 40px; padding: 6px 3px 5px; border-radius: 10px;
  border: 1px solid #3a3350; /* repli si color-mix() n'est pas supporté */
  border-color: color-mix(in srgb, var(--badge-color, #8b98ad) 45%, transparent 55%);
  background: #1c2033;
  background: color-mix(in srgb, var(--badge-color, #8b98ad) 16%, #12182a 84%);
}
.tier-badge img { width: 15px; height: 15px; object-fit: contain; }
.tier-badge span {
  font: 700 9px "DM Mono", monospace; white-space: nowrap;
  color: color-mix(in srgb, var(--badge-color, #8b98ad) 78%, white 22%);
}

/* =========================================================
   MODALE PROFIL JOUEUR
   ---------------------------------------------------------
   En-tête : skin en grand (buste, sans les jambes, pose "wave"
   via skinrender.dev) à gauche + pseudo, position Overall et
   points à droite. En dessous : grille 3 colonnes des tiers,
   une case par gamemode (icône + tier + points).
   ========================================================= */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 18px;
  background: rgba(4,7,13,.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; transition: opacity .2s ease;
}
.modal-backdrop.open { opacity: 1; }
.player-modal {
  position: relative; width: min(100%, 320px); padding: 22px 16px 18px; border: 1px solid #26354f; border-radius: 12px; background: #101725;
  transform: scale(.94) translateY(8px); transition: transform .22s cubic-bezier(.2,.9,.3,1.2);
}
.modal-backdrop.open .player-modal { transform: scale(1) translateY(0); }
.modal-close { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #9aa9c2; background: #1c2a41; transition: background .12s ease, transform .12s ease; }
.modal-close:hover { color: #fff; background: #2b3c5b; transform: rotate(90deg); }

.modal-top { display: flex; align-items: center; gap: 14px; }

/* Skin en grand, recadré sur le buste : comme .tier-avatar, l'image
   garde sa hauteur réelle (agrandie x2.1), seule la moitié haute
   reste visible dans le cadre donc les jambes disparaissent. */
.modal-skin {
  position: relative; flex: 0 0 auto; display: grid; place-items: center;
  width: 108px; height: 170px; border: none; border-radius: 0; background: none;
  filter: drop-shadow(0 8px 10px rgba(0,0,0,.45));
}
.modal-skin img {
  width: 100%; height: 100%; object-fit: contain;
}
.modal-skin b { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font: 700 24px "DM Mono", monospace; }

.modal-top-info { flex: 1 1 auto; min-width: 0; }
.modal-top-info h2 {
  margin: 0 0 9px; font-size: 18px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: #fff;
}
.modal-overall-line { display: flex; align-items: center; gap: 6px; }
.modal-overall-line b { color: #f2be1f; font: 800 15px "Outfit", sans-serif; }
.modal-overall-icon { width: 15px; height: 15px; object-fit: contain; }
.modal-overall-line span { color: #ced8e9; font-size: 12px; font-weight: 700; }
.modal-points { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.modal-points b { color: var(--text); font: 800 16px "Outfit", sans-serif; }

.modal-tiers { margin-top: 19px; }
.modal-tiers > p { margin: 0 0 8px; color: #ced8e9; font-size: 10px; font-weight: 800; letter-spacing: .04em; }

.modal-tiers-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.modal-tier-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 11px 4px 9px; border-radius: 10px;
  border: 1px solid #3a3350; /* repli si color-mix() n'est pas supporté */
  border-color: color-mix(in srgb, var(--card-color, #8b98ad) 40%, transparent 60%);
  background: #1c2033;
  background: color-mix(in srgb, var(--card-color, #8b98ad) 14%, #12182a 86%);
}
.modal-tier-icon { width: 20px; height: 20px; object-fit: contain; }
.modal-tier-mode { font-size: 10px; font-weight: 700; color: #dce4f4; text-align: center; line-height: 1.15; }
.modal-tier-value { font: 800 13px "DM Mono", monospace; }
.modal-tier-pts { font: 700 9px "DM Mono", monospace; color: var(--muted); }

@media (max-width: 360px) {
  .modal-skin { width: 90px; height: 150px; }
  .modal-top-info h2 { font-size: 16px; }
}

/* =========================================================
   GRANDS ÉCRANS (desktop / large tablette)
   ---------------------------------------------------------
   Le conteneur s'élargit un peu, le podium grandit, et le
   classement général passe en 2 colonnes pour ne pas laisser
   une simple liste étroite noyée dans tout l'espace dispo.
   ========================================================= */
@media (min-width: 1024px) {
  .ranking-container, .header-inner { width: min(calc(100% - 60px), 1240px); }

  .podium { gap: 40px; margin-top: 40px; }
  .podium-item { width: 190px; --e: 56px; }
  .podium-name { max-width: 190px; font-size: 18px; }
  .podium-item-1 .podium-name { font-size: 20px; }
  .podium-item-1 { --h: 170px; }
  .podium-item-2 { --h: 122px; }
  .podium-item-3 { --h: 96px; }
  .podium-stage { height: 230px; }


  .overall-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }

  .tier-board { gap: 14px; }
}

/* =========================================================
   PODIUM DES 3 PREMIERS (mode Overall) — style "cylindres"
   ---------------------------------------------------------
   Chaque marche est une pile de disques (ellipses) empilés en
   hauteur, générée par renderPodium() dans script.js.
   --h = hauteur du cylindre, --e = hauteur de l'ellipse (effet 3D).
   Ordre visuel de gauche à droite : 3e - 1er - 2e.
   TAILLE DES SKINS : variable --sk (largeur du skin des 2e/3e),
   qui grandit avec l'écran. Le 1er fait 1,15 x --sk.
   Réglage : clamp(MINI, BASE + x vw, MAXI).
   Les skins n'influencent PAS la position des cylindres.
   ========================================================= */
.podium {
  --pz: 1; /* TAILLE DU PODIUM + SKINS : 1 = 100 %. Sur PC (>= 1024 px) : voir plus bas, réglage --pz. */
  --sk: calc(clamp(104px, 60px + 12vw, 215px) * var(--pz));
  position: relative; display: flex; align-items: flex-end; justify-content: center;
  gap: calc(18px * var(--pz)); margin: 28px auto 8px; padding: 0 0 calc(70px * var(--pz));
}
.podium-stage {
  position: absolute; left: 0; bottom: 0; width: 100%; height: calc(190px * var(--pz));
  z-index: 0; pointer-events: none; overflow: visible;
}
.podium-stage polygon {
  fill: var(--surface); stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
}
.podium-item {
  --e: calc(44px * var(--pz));
  display: flex; flex-direction: column; align-items: center;
  position: relative; z-index: 1;
  width: calc(150px * var(--pz)); padding: 0; border: none; background: none; text-align: center;
}
.podium-item { --skw: var(--sk); }
.podium-item-1 { --h: calc(140px * var(--pz)); --skw: calc(var(--sk) * 1.15); }
.podium-item-2 { --h: calc(100px * var(--pz)); }
.podium-item-3 { --h: calc(78px * var(--pz)); }

.podium-name {
  max-width: calc(150px * var(--pz)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 800 16px "Outfit", sans-serif; color: var(--text);
}
.podium-points {
  font: 700 12px "DM Mono", monospace; color: var(--muted);
  letter-spacing: .04em; margin-top: 2px; margin-bottom: 10px;
}
.podium-skin {
  position: relative; z-index: 3; display: block;
  width: var(--skw); aspect-ratio: 130 / 190; flex: none;
  filter: drop-shadow(0 10px 12px rgba(0,0,0,.45));
}
/* Seul le skin est cliquable (ouvre le profil du joueur) */
button.podium-skin { padding: 0; border: none; background: none; cursor: pointer; transition: transform .15s ease; }
button.podium-skin:hover { transform: translateY(-3px); }
.podium-skin img { width: 100% !important; height: 100% !important; object-fit: contain; display: block; }
.podium-skin > b {
  display: grid; place-items: center; width: 100%; height: 100%;
  border-radius: 8px; background: #24334c; color: #fff; font: 700 22px "DM Mono", monospace; font-style: normal;
}
.podium-item-2 .podium-skin img { transform: scaleX(-1); } /* 2e en miroir */

/* Le cylindre : les pieds du joueur tombent au centre du disque du dessus */
.podium-disc {
  position: relative; width: 100%; height: calc(var(--h) + var(--e));
  /* -e/2 : le bas du skin arrive au centre du disque. --pad (mesuré par
     fitSkinFeet) = part de vide sous les pieds dans l'image : on la retire. */
  margin-top: calc(var(--e) / -2 - var(--pad, 0) * var(--skw) * var(--ar, 1.4615)); z-index: 2;
}
.disc-shadow {
  position: absolute; left: 8%; bottom: calc(var(--e) * -.2); width: 100%; height: var(--e);
  border-radius: 50%; background: rgba(0,0,0,.55); filter: blur(10px);
}
.disc-layer {
  position: absolute; left: 0; width: 100%; height: var(--e); border-radius: 50%;
  bottom: calc(var(--h) * var(--k));
}
.disc-layer:nth-last-child(2) { border-right: .5px solid rgba(255,255,255,.4); }
.disc-num {
  position: absolute; left: 0; width: 100%; bottom: calc(var(--h) * .18); z-index: 60;
  text-align: center; font: 800 calc(38px * var(--pz)) "DM Mono", monospace; color: rgba(0,0,0,.28);
  text-shadow: 0 1px 0 rgba(255,255,255,.25);
}

.podium-item-1 .podium-name { color: #f0b83c; font-size: 18px; }
.podium-item-3 .podium-name { color: #dd6f45; }

@media (max-width: 640px) {
  .podium { gap: 8px; padding-bottom: 56px; }
  .podium-stage { height: 150px; }
  .podium-item { width: 100px; --e: 32px; }
  .podium-item-1 { --h: 100px; }
  .podium-item-2 { --h: 74px; }
  .podium-item-3 { --h: 56px; }
  .podium-name, .podium-item-1 .podium-name { font-size: 12px; max-width: 100px; }
  .podium-points { font-size: 10px; }
  .disc-num { font-size: 24px; }
}

/* =========================================================
   RÉGLAGE PC : taille du podium et des skins sur grand écran
   ---------------------------------------------------------
   Change UNIQUEMENT ce nombre :
     1    = taille d'origine
     0.85 = un peu plus petit
     0.64 = encore 25 % plus petit (actuel)
   ========================================================= */
@media (min-width: 1024px) {
  .podium { --pz: 0.64; }
}

/* =========================================================
   CLASSEMENT GÉNÉRAL (mode Overall)
   ========================================================= */
.overall-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.overall-card { width: 100%; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 10px; background: rgba(24,34,52,.86); text-align: left; transition: transform .12s ease, border-color .12s ease, background .12s ease; }
body[data-theme="light"] .overall-card { background: #f2f5fa; }
.overall-card:hover { border-color: var(--blue); transform: translateY(-1px); }

/* Une seule ligne : numéro, avatar, pseudo/titre, tiers à droite.
   Sur mobile, les tiers restent sur la même ligne mais deviennent
   scrollables horizontalement (pas de retour à la ligne, pour que
   chaque carte garde une hauteur compacte). */
.overall-card { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }

/* Le vrai 1er de la liste (position réelle, pas la 1ère ligne affichée :
   les 3 premiers sont déjà sur le podium au-dessus, donc ceci ne
   s'applique jamais tant que le podium est affiché — la 4e position
   et les suivantes gardent une couleur normale comme les autres). */
.overall-card[data-position="1"] { border-color: #a9791b; background: linear-gradient(90deg, rgba(169,121,27,.28), rgba(24,34,52,.86) 55%); }

.overall-rank-num {
  flex: 0 0 auto; display: grid; place-items: center; min-width: 22px;
  color: #7c88a0; font: 800 17px "Outfit", sans-serif; font-style: normal;
}
.overall-card[data-position="1"] .overall-rank-num { color: #f2c94c; }
.overall-card[data-position="2"] .overall-rank-num { color: #cfd6e4; }
.overall-card[data-position="3"] .overall-rank-num { color: #c88a52; }

.overall-rank-avatar { position: relative; flex: 0 0 auto; width: 40px; height: 56px; display: grid; place-items: center; }
.overall-rank-avatar img { max-width: 100%; max-height: 100%; object-fit: contain; image-rendering: auto; /* lissé : "pixelated" donnait un rendu crénelé quand l'image est réduite */ }
.overall-rank-avatar > b { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font: 700 14px "DM Mono", monospace; font-style: normal; }

.overall-info { flex: 1 1 130px; min-width: 0; }
.overall-info h3 { margin: 0 0 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 800; }
.overall-points-line { margin: 0; display: flex; align-items: baseline; gap: 4px; }
.overall-points-line b { font: 800 15px "Outfit", sans-serif; color: var(--text); }
.overall-points-line span { color: var(--muted); font-size: 11px; font-weight: 600; }

/* Les tiers d'une carte joueur restent TOUJOURS sur une seule ligne
   (mobile comme desktop) : ils ne passent jamais à la ligne, et
   défilent horizontalement si la carte est trop étroite pour tous
   les afficher. */
.overall-tiers-grid {
  flex: 1 1 100%; width: 100%; display: flex; flex-wrap: nowrap;
  gap: 7px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.overall-tiers-grid::-webkit-scrollbar { display: none; }
.overall-tiers-grid .tier-badge { flex: 0 0 auto; }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer { display: flex; justify-content: space-between; gap: 16px; width: min(100% - 30px, 1010px); margin: 0 auto; padding: 24px 0; border-top: 1px solid var(--line-soft); color: var(--muted); font: 9px "DM Mono", monospace; }
.site-footer a { color: var(--blue); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
  .tier-board { min-width: 850px; }
}
@media (max-width: 600px) {
  .top-header { height: auto; padding: 10px 0; }
  .header-inner {
    position: relative;
    grid-template-columns: auto 1fr;
    gap: 12px;
  }
  .brand { grid-column: 1; grid-row: 1; align-self: center; }
  /* Plus de bouton ☰ : la barre de recherche est sur la même ligne que
     le logo, à sa place. (Le lien Discord reste dans le pied de page.) */
  .top-nav { display: none; }
  .header-tools { display: flex; grid-column: 2; grid-row: 1; min-width: 0; justify-content: flex-end; }
  /* Barre de recherche compacte, calée à droite : de l'espace libre
     reste entre le logo et elle. La liste de suggestions, elle, reprend
     toute la largeur du header. */
  .header-search-wrap { position: static; }
  .header-search { width: 140px; height: 30px; }
  .site-footer { display: block; line-height: 2; }
}

