/* ════════════════════════════════════════════════════════════════
   « Le Mur des Champions » — classement, dernières parties, meilleurs
   coups, alimentés en direct par /api/live.

   Fichier séparé de styles.css À DESSEIN : la section est branchée sur
   une source distante et peut être retirée d'un bloc (un <link>, un
   <script>, une <section>) sans toucher au reste de la feuille.
   Les jetons de couleur et de fonte viennent de styles.css.
   ════════════════════════════════════════════════════════════════ */

#mur { position: relative; }
#mur[hidden] { display: none; }

.wall-inner { max-width: 1180px; margin: 0 auto; }

/* ── En-tête ─────────────────────────────────────────────────── */
.wall-head {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: 10px 18px; margin-bottom: clamp(20px, 3vw, 32px);
}
.wall-eyebrow {
  flex-basis: 100%;
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--gold);
}
/* Le point ne décore pas : il dit que la page se rafraîchit toute seule. */
.wall-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #61c98a; box-shadow: 0 0 0 0 rgba(97, 201, 138, .55);
  animation: wall-pulse 2.4s ease-out infinite;
}
@keyframes wall-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(97, 201, 138, .5); }
  70%  { box-shadow: 0 0 0 9px rgba(97, 201, 138, 0); }
  100% { box-shadow: 0 0 0 0 rgba(97, 201, 138, 0); }
}
.wall-lede { margin: 0; color: var(--muted); font-size: 15px; max-width: 46ch; flex: 1 1 320px; }
.wall-stamp {
  margin-left: auto; font-size: 12.5px; color: var(--muted);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* ── Les trois rails ─────────────────────────────────────────── */
.wall-rails { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 900px) {
  /* Le classement porte le plus de lignes, les coups le plus d'image. */
  .wall-rails { grid-template-columns: 1.15fr 1fr 1fr; }
}
.wall-rail {
  background: linear-gradient(180deg, rgba(31, 38, 46, .72), rgba(21, 25, 30, .72));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 18px 8px;
  min-width: 0;
}
.wall-rail h3 {
  font-family: var(--display); font-weight: 400;
  font-size: 22px; margin: 0 0 2px; color: var(--gold-2);
}
.wall-rail .wall-sub { margin: 0 0 14px; font-size: 12.5px; color: var(--muted); }
.wall-rows { list-style: none; margin: 0; padding: 0; }
.wall-rows > li { border-top: 1px solid rgba(57, 67, 78, .55); }
.wall-rows > li:first-child { border-top: 0; }
.wall-empty { font-size: 13px; color: var(--muted); padding: 6px 0 14px; }

/* ── Portrait + cadre ────────────────────────────────────────────
   Le cadre est un objet que le joueur a débloqué : il se pose PAR-DESSUS
   le portrait, comme dans le jeu, et déborde volontairement du disque.
   Quand le joueur n'en a pas, un mince liseré tient la place. */
.face {
  position: relative; flex: 0 0 auto;
  width: var(--size, 34px); height: var(--size, 34px);
}
/* Mêmes proportions qu'en jeu (FramedAvatar) : le portrait occupe 72 % de la
   boîte et le cadre 155 %, tous deux centrés. Le site affichait un portrait à
   100 % dans un cadre à 136 %, donc l'anneau mordait sur le visage au lieu de
   l'entourer. */
.face { display: flex; align-items: center; justify-content: center; }
.face > img.face-art {
  width: 72%; height: 72%; border-radius: 50%;
  object-fit: cover; display: block; background: #0c0f13;
  border: none;
}
.face.no-frame > img.face-art {
  width: 100%; height: 100%;
  border: 1px solid rgba(57, 67, 78, .9);
}
.face > img.face-frame {
  position: absolute; left: 50%; top: 50%;
  /* styles.css pose `img { max-width: 100% }` : sans ça le cadre est rogné à
     la taille de la boîte et retombe à 100 %, ce qui était exactement le
     défaut d'alignement. */
  max-width: none;
  width: 155%; height: 155%;
  transform: translate(-50%, -50%);
  object-fit: contain; pointer-events: none;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .5));
}
/* Sans cadre : une couronne discrète, pour que la colonne reste alignée. */
.face.no-frame > img.face-art { border-color: var(--gold-deep); }

/* Le niveau, à côté du nom. Même graisse que le tag, mais teinté par
   lvlFilter — donc la couleur seule dit la progression. */
.wall-lvl {
  font-size: .72em; font-weight: 800; letter-spacing: .04em;
  color: #ffcf33; white-space: nowrap;
}

/* Échelles du classement : Français / Québécois / English. Le Québec est un
   choix de CLASSEMENT, pas de langue — la page reste en français. */
.wall-ladders { display: flex; gap: 6px; margin: 0 0 10px; flex-wrap: wrap; }
.wall-ladder {
  font: 700 11.5px/1 var(--body, 'Plus Jakarta Sans', system-ui, sans-serif);
  letter-spacing: .04em; color: #9aa2ab;
  background: rgba(31, 38, 46, .6); border: 1px solid rgba(57, 67, 78, .9);
  border-radius: 999px; padding: 6px 12px; cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.wall-ladder:hover { color: #f0c869; border-color: rgba(212, 168, 67, .5); }
.wall-ladder.on {
  color: #10141a; background: linear-gradient(180deg, #f0c869, #d4a843);
  border-color: #d4a843;
}

/* ── Classement ──────────────────────────────────────────────── */
.rank-row {
  display: grid; grid-template-columns: 22px auto 1fr auto;
  align-items: center; gap: 10px; padding: 8px 0; min-width: 0;
}
.rank-n {
  font-family: var(--display); font-size: 19px; color: var(--muted);
  text-align: right; font-variant-numeric: tabular-nums;
}
.rank-row.is-top .rank-n { color: var(--gold-2); }
.wall-who { min-width: 0; display: flex; align-items: baseline; gap: 6px; }
.wall-name {
  font-weight: 700; font-size: 15px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wall-tag { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.wall-flag { font-size: 13px; line-height: 1; }
.wall-elo {
  text-align: right; font-variant-numeric: tabular-nums;
  font-weight: 800; font-size: 15px; color: var(--gold-2);
}
.wall-wl { display: block; font-size: 11px; font-weight: 600; color: var(--muted); }

/* ── Dernières parties ───────────────────────────────────────── */
.wall-match { padding: 10px 0; }
.wall-match-line {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 8px; min-width: 0;
}
.wall-side { min-width: 0; display: flex; align-items: center; gap: 8px; }
.wall-side.is-right { flex-direction: row-reverse; text-align: right; }
.wall-side .wall-stack { min-width: 0; }
.wall-side .wall-name { font-size: 13.5px; }
.wall-pts {
  display: block; font-variant-numeric: tabular-nums;
  font-weight: 800; font-size: 17px; color: var(--muted); line-height: 1.15;
}
/* Le gagnant est le seul en or : on lit qui a gagné sans lire les chiffres. */
.wall-side.is-win .wall-pts { color: var(--gold-2); }
.wall-vs { font-family: var(--display); font-size: 13px; color: var(--gold-deep); letter-spacing: .06em; }
.wall-ago { margin-top: 4px; font-size: 11.5px; color: var(--muted); }

/* ── Meilleurs coups ─────────────────────────────────────────── */
.wall-play { padding: 12px 0; display: flex; gap: 10px; align-items: flex-start; }
.wall-play .wall-body { min-width: 0; flex: 1; }
.wall-tiles { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 7px; }
.wall-tile {
  position: relative; width: 25px; height: 27px;
  display: grid; place-items: center; border-radius: 3px;
  background: linear-gradient(180deg, #f7e7bd 0%, #e6cd8e 52%, #c9a95f 100%);
  color: #2a2113; font-family: var(--display); font-size: 16px; line-height: 1;
  box-shadow: 0 1px 0 #8f6f2a, 0 2px 4px rgba(0, 0, 0, .45);
}
.wall-tile > b {
  position: absolute; right: 2px; bottom: 1px;
  font-family: var(--body); font-size: 8px; font-weight: 700; opacity: .75;
}
.wall-play-meta { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.wall-play-pts {
  font-variant-numeric: tabular-nums; font-weight: 800;
  font-size: 20px; color: var(--gold-2);
}
/* « Bingo » et pas l'autre mot : c'est le terme du jeu lui-même, et le mot
   auquel on pense d'abord est une marque déposée. */
.wall-bingo {
  font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: #12301f; background: #61c98a; padding: 2px 6px; border-radius: 999px;
}
/* La langue de la partie. Discrète — c'est une note de bas de page attachée à
   un chiffre, pas un drapeau : le même mot ne vaut pas la même chose dans les
   deux dictionnaires, et un score sans son barème ne veut rien dire. */
.wall-lang {
  font-size: 10px; font-weight: 800; letter-spacing: .08em;
  color: var(--gold); border: 1px solid var(--gold-deep);
  padding: 1px 5px; border-radius: 4px; white-space: nowrap;
}
.wall-ago > .wall-lang { margin-left: 6px; }

.wall-play-who { font-size: 13px; color: var(--muted); }
.wall-play-who > b { color: var(--text); font-weight: 700; }

/* ── Pied de section ─────────────────────────────────────────── */
.wall-foot {
  margin-top: 18px; display: flex; flex-wrap: wrap;
  align-items: center; gap: 10px 16px; font-size: 12.5px; color: var(--muted);
}
.wall-privacy { flex: 1 1 320px; }

@media (prefers-reduced-motion: reduce) { .wall-dot { animation: none; } }

/* CHAMPIONS fait neuf tuiles — deux de plus que le plus long titre de la page.
   Au gabarit commun il déborde sur téléphone et laisse un « S » orphelin sur
   une deuxième ligne, ce qui se lit comme une faute. Ce titre-ci rétrécit donc
   un peu plus, sans toucher aux autres. */
@media (max-width: 620px) {
  /* .wall-head est une rangée flex : le titre y partage la largeur avec le
     surtitre et le chapô, et n'obtenait que 309px des 376 disponibles — d'où
     un « S » renvoyé à la ligne. On lui donne sa propre rangée. */
  #mur .wall-head { flex-wrap: wrap; }
  #mur .tile-heading { flex: 1 0 100%; gap: 4px; }
  #mur .tile-heading .tile {
    width: clamp(28px, 8.2vw, 46px);
    height: clamp(28px, 8.2vw, 46px);
    font-size: clamp(17px, 4.9vw, 27px);
  }
  #mur .tile-heading .tile sub { font-size: 8px; right: 3px; bottom: 2px; }
}
