/* NXUS — feuille de style du site public.
 *
 * Reprend le langage visuel du design : aplats durs, pas d'arrondis,
 * boutons à ombre basse, typographie display en Archivo Black et
 * chiffres en JetBrains Mono. Les styles en ligne du design d'origine
 * sont regroupés ici en classes pour que les deux pages les partagent.
 */

:root {
  --bg: #f4f3f0;
  --ink: #1d1d1d;
  --ink-soft: #2f2f2f;
  --muted: #6f6a62;
  --muted-dark: #8f8f8f;
  --line: #dcd9d2;
  --line-soft: #e8e5df;
  --line-faint: #f0eeea;
  --accent: #4c8c1e;
  --accent-hi: #579f22;
  --accent-lo: #326009;
  --card: #fff;

  --display: "Archivo Black", "Arial Black", system-ui, sans-serif;
  --body: "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  font-family: var(--body);
  color: var(--ink);
  text-wrap: pretty;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-lo); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---- En-tête ---------------------------------------------------- */

.site-header { background: var(--ink); color: #fff; }
.site-header .wrap {
  height: 64px; display: flex; align-items: center; gap: 32px;
}
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-mark {
  width: 26px; height: 26px; background: var(--accent);
  box-shadow: 6px 0 0 var(--ink-soft) inset;
}
.brand-name {
  font-family: var(--display); font-size: 17px;
  letter-spacing: .06em; text-transform: uppercase; color: #fff;
}
.site-nav {
  display: flex; gap: 26px; font-size: 13px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
}
.site-nav a { color: #fff; opacity: .6; }
.site-nav a:hover, .site-nav a.is-active { color: #fff; opacity: 1; }

.header-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.online-pill {
  display: flex; align-items: center; gap: 8px;
  background: #2b2b2b; padding: 8px 12px;
}
.online-dot { width: 7px; height: 7px; background: var(--accent); display: block; }
.online-dot.is-unknown { background: var(--muted-dark); }
.online-text { font-family: var(--mono); font-size: 12px; color: #fff; }

/* Sélecteur de langue. Un <select> natif plutôt qu'un menu maison : il
 * fonctionne au clavier, au lecteur d'écran et sur mobile sans une ligne
 * de script, ce qu'un faux menu ne fait jamais du premier coup. */
.lang-select {
  background: #2b2b2b; color: #fff; border: 0; border-bottom: 3px solid #101010;
  font-family: var(--mono); font-size: 12px; padding: 7px 10px; cursor: pointer;
}
.lang-select:focus { outline: 3px solid var(--accent); outline-offset: -3px; }

/* ---- Boutons ---------------------------------------------------- */

.btn {
  background: var(--accent); border: 0; border-bottom: 4px solid var(--accent-lo);
  color: #fff; font-family: var(--body); font-weight: 700; font-size: 13px;
  letter-spacing: .06em; text-transform: uppercase; padding: 11px 18px;
  cursor: pointer; display: inline-block;
}
.btn:hover { background: var(--accent-hi); color: #fff; }
.btn:active { border-bottom-width: 2px; transform: translateY(2px); }
.btn-dark { background: var(--ink-soft); border-bottom-color: #101010; }
.btn-dark:hover { background: #3d3d3d; }

/* ---- Bandeau joueur --------------------------------------------- */

.hero { background: var(--ink-soft); border-bottom: 6px solid var(--ink); }
.hero .wrap {
  padding: 36px 24px 40px; display: flex; gap: 32px;
  align-items: flex-start; flex-wrap: wrap;
}
.avatar {
  width: 180px; height: 180px; background: #242424; border: 4px solid #4a4a4a;
  display: flex; align-items: center; justify-content: center; flex: none;
  position: relative; overflow: hidden;
}
/* L'image est posée au-dessus du texte de repli. Si le skin n'a jamais
 * été capturé la requête renvoie 404, le script retire l'image, et le
 * texte redevient visible sans clignotement. */
.avatar img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; image-rendering: pixelated;
}
.avatar-fallback {
  font-family: var(--mono); font-size: 11px; color: #8a8a8a;
  text-align: center; line-height: 1.5; padding: 0 8px;
}
.hero-main { flex: 1; min-width: 320px; display: flex; flex-direction: column; gap: 16px; }
.hero-title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hero-title h1 {
  margin: 0; font-family: var(--display); font-size: 40px; line-height: 1;
  color: #fff; letter-spacing: .01em; word-break: break-word;
}
.rank-badge {
  color: #fff; font-family: var(--display); font-size: 15px;
  letter-spacing: .1em; text-transform: uppercase; padding: 9px 14px;
  display: inline-block;
}
.rank-global {
  border: 2px solid #565656; color: #c9c9c9;
  font-family: var(--mono); font-size: 12px; padding: 7px 10px;
}

.identity {
  display: flex; flex-wrap: wrap;
  border-top: 1px solid #464646; border-left: 1px solid #464646;
}
.identity-cell {
  min-width: 190px; padding: 12px 18px;
  border-right: 1px solid #464646; border-bottom: 1px solid #464646;
}
.identity-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted-dark);
}
.identity-value { font-size: 15px; font-weight: 700; color: #fff; margin-top: 4px; }

.xp { max-width: 640px; }
.xp-head {
  display: flex; justify-content: space-between; font-family: var(--mono);
  font-size: 12px; color: #b5b5b5; margin-bottom: 6px;
}
.xp-track { height: 14px; background: var(--ink); border: 2px solid #4a4a4a; }
.xp-fill { height: 100%; background: var(--accent); }

/* ---- Contenu ---------------------------------------------------- */

main.wrap { padding: 36px 24px 72px; display: flex; flex-direction: column; gap: 36px; }

.section-title {
  font-family: var(--display); font-size: 20px; letter-spacing: .06em;
  text-transform: uppercase; margin: 0 0 16px;
}

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi {
  background: var(--card); border: 1px solid var(--line);
  border-bottom: 4px solid var(--ink); padding: 20px;
}
.kpi-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted);
}
.kpi-value { font-family: var(--display); font-size: 30px; line-height: 1.1; margin-top: 8px; }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.mode {
  background: var(--card); border: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.mode-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.swatch { width: 14px; height: 14px; display: block; flex: none; }
.mode-name {
  font-family: var(--display); font-size: 15px;
  letter-spacing: .04em; text-transform: uppercase;
}
.mode-hours { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.mode-stats {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1px; background: var(--line-soft);
}
.mode-stat { background: var(--card); padding: 14px 12px; text-align: center; }
.mode-stat-v { font-family: var(--display); font-size: 19px; }
.mode-stat-k {
  font-family: var(--mono); font-size: 10px; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted); margin-top: 4px;
}
.mode-foot { padding: 14px 18px; display: flex; flex-direction: column; gap: 6px; }
.mode-foot-head {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
}
.bar { height: 10px; background: #eceae5; }
.bar-fill { height: 100%; }

.split { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; align-items: start; }

.panel { background: var(--card); border: 1px solid var(--line); }
.panel-title {
  font-family: var(--display); font-size: 16px; letter-spacing: .06em;
  text-transform: uppercase; margin: 0; padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.match {
  display: flex; align-items: center; gap: 16px; padding: 13px 20px;
  border-bottom: 1px solid var(--line-faint);
}
.match-stripe { width: 6px; height: 34px; display: block; flex: none; }
.match-main { flex: 1; min-width: 0; }
.match-mode { font-weight: 700; font-size: 14px; }
.match-when { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.match-detail {
  font-family: var(--mono); font-size: 12px; color: #3d3a35;
  text-align: right; min-width: 110px;
}
.match-result {
  color: #fff; font-weight: 700; font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; padding: 6px 10px; min-width: 74px; text-align: center;
}

.achievement {
  display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--line-faint);
}
.achievement:last-child { border-bottom: 0; }
.achievement-list { padding: 8px 20px 16px; }
.achievement-main { flex: 1; min-width: 0; }
.achievement-mark { width: 22px; height: 22px; display: block; flex: none; }
.side-column { display: flex; flex-direction: column; gap: 16px; }
.achievement-name { font-size: 13px; font-weight: 700; }
.achievement-date { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }

.address-card { background: var(--ink); color: #fff; padding: 20px; }
.address-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: #9a9a9a;
}
.address-value { font-family: var(--display); font-size: 22px; margin-top: 8px; word-break: break-all; }
.address-note { font-size: 12px; color: #b5b5b5; margin-top: 6px; }

/* ---- Accueil ------------------------------------------------------ */

/* La page d'accueil ne porte aucune icône : c'est la typographie, les
 * aplats et les figurines qui font le rythme. Une icône de plus à chaque
 * titre aurait rempli l'espace sans rien dire. */

/* Le fond du héros est une vraie capture du lobby, posée sous tout le
 * contenu.
 *
 * Le dégradé est empilé au-dessus dans la même déclaration plutôt que
 * dans un ::before : une seule règle, et surtout la couleur pleine reste
 * en dernière couche, donc si l'image manque ou n'a pas fini de charger
 * le bandeau est simplement sombre au lieu d'afficher du texte blanc sur
 * du blanc.
 *
 * Il est plus opaque à gauche, où se trouve le texte, et s'éclaircit
 * vers la droite : le monde reste lisible là où rien ne se superpose. */
.home-hero {
  color: #fff;
  border-bottom: 6px solid var(--ink);
  overflow: hidden;
  background:
    linear-gradient(100deg,
      rgba(22, 21, 19, .95) 0%,
      rgba(22, 21, 19, .88) 38%,
      rgba(22, 21, 19, .62) 100%),
    url("/img/hero.jpg") center / cover no-repeat,
    var(--ink-soft);
}
/* auto pour la colonne de droite : quand la figurine n'a pas encore ete
 * deposee le script retire la colonne, et le texte reprend toute la
 * largeur au lieu de laisser un vide. */
.home-hero-grid {
  display: grid; grid-template-columns: 1.15fr auto; gap: 40px;
  align-items: center; padding: 64px 24px 0;
}
.home-hero-art { width: min(32vw, 320px); }
.home-hero-text { padding-bottom: 64px; }

.eyebrow {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 18px;
}
.home-hero h1 {
  font-family: var(--display); font-size: clamp(34px, 5.2vw, 62px); line-height: 1.02;
  margin: 0 0 22px; letter-spacing: -.01em;
}
.home-hero .lead {
  font-size: 17px; line-height: 1.65; color: #c4c1bb; max-width: 46ch; margin: 0 0 32px;
}

.address-block { background: var(--ink); padding: 22px; max-width: 460px; }
.address-block .address-value {
  font-family: var(--display); font-size: 24px; margin: 8px 0 18px; word-break: break-all;
}
.address-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn.is-done { background: var(--accent-lo); }
.address-missing { color: #b5b5b5; font-size: 14px; max-width: 46ch; }

/* La figurine déborde du bloc sombre par le bas : elle donne la
 * profondeur que l'aplat seul n'a pas, et attire l'œil vers l'adresse. */
/* Pas d'image-rendering: pixelated ici. Ce sont des rendus 3D lisses,
 * avec antialiasing et ombres portées ; forcer le rendu au plus proche
 * voisin rendrait leurs contours crénelés. Le pixelated reste sur les
 * vignettes de visage, qui sont, elles, du vrai 8x8. */
.mascot { display: block; }
.mascot-hero {
  width: 100%; max-width: 320px; margin: 0 auto; display: block;
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, .45));
}

.home-live { background: var(--ink); color: #fff; }
.home-live .wrap { padding: 44px 24px 48px; }
.home-live .section-title { color: #fff; }
.live-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: #3a3a3a; }
.live { background: var(--ink); padding: 24px 20px; }
.live-value { font-family: var(--display); font-size: 40px; line-height: 1; color: var(--accent); }
.live-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: #9a9a9a; margin-top: 10px;
}
/* La promesse est tenue par le code au-dessus : ces quatre chiffres
 * viennent de /api/server, pas d'une maquette. */
.live-foot { display: flex; align-items: flex-end; gap: 24px; margin-top: 20px; }
.live-honest { font-size: 12.5px; color: #8f8f8f; margin: 0; max-width: 62ch; }
/* Steve s'aligne sur le bas de la bande et déborde vers le haut, ce qui
 * casse la rigidité de la grille de chiffres sans la gêner. */
.mascot-steve { width: 150px; margin: -70px 0 -48px auto; flex: none; }

.home-what .wrap { padding: 72px 24px; }
.what-row { display: flex; align-items: flex-end; gap: 28px; }
.what-grid {
  flex: 1; min-width: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line);
}
.what { background: var(--card); padding: 32px 28px; }
.what h3 {
  font-family: var(--display); font-size: 20px; margin: 0 0 12px; line-height: 1.2;
}
.what p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.65; }

/* Le piglin déborde vers le bas de sa colonne, à cheval sur la bande
 * suivante. C'est ce débordement qui donne la profondeur, pas une ombre
 * ni un cadre — et comme il a sa propre colonne, il ne mange plus le
 * texte de la carte voisine. */
.mascot-what { width: 150px; flex: none; margin-bottom: -104px; position: relative; z-index: 2; }

.home-how { background: #ebe9e4; border-top: 1px solid var(--line); }
.home-how-grid {
  display: grid; grid-template-columns: 1.3fr .7fr; gap: 40px;
  align-items: center; padding: 64px 24px;
}
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li {
  counter-increment: step; position: relative; padding: 18px 0 18px 62px;
  border-bottom: 1px solid var(--line); font-size: 16px; line-height: 1.55;
}
.steps li:last-child { border-bottom: 0; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 14px;
  font-family: var(--display); font-size: 26px; color: var(--accent);
}
.mascot-how { width: 100%; max-width: 300px; margin: 0 auto; }

.home-final { background: var(--ink-soft); color: #fff; border-top: 6px solid var(--ink); }
.home-final-grid {
  display: grid; grid-template-columns: .8fr 1.2fr; gap: 40px;
  align-items: center; padding: 56px 24px;
}
.home-final h2 { font-family: var(--display); font-size: clamp(26px, 3.4vw, 40px); margin: 0 0 10px; }
.home-final p { color: #b5b5b5; font-size: 16px; margin: 0 0 20px; }
.final-address { font-family: var(--display); font-size: 26px; color: var(--accent); word-break: break-all; }
.mascot-final { width: 100%; max-width: 320px; margin: 0 auto; }

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

.search-hero { background: var(--ink-soft); border-bottom: 6px solid var(--ink); color: #fff; }
.search-hero .wrap { padding: 56px 24px 64px; }
.search-hero h1 {
  font-family: var(--display); font-size: 44px; line-height: 1.05;
  margin: 0 0 10px; letter-spacing: .01em;
}
.search-hero p { margin: 0 0 28px; color: #b5b5b5; font-size: 15px; max-width: 560px; }
.search-form { display: flex; gap: 0; max-width: 560px; }
.search-input {
  flex: 1; min-width: 0; background: #fff; border: 0; border-bottom: 4px solid #101010;
  padding: 14px 16px; font-family: var(--body); font-size: 15px; color: var(--ink);
}
.search-input:focus { outline: 3px solid var(--accent); outline-offset: -3px; }
.search-form .btn { border-left: 1px solid var(--accent-lo); }

.result {
  display: flex; align-items: center; gap: 16px; padding: 14px 20px;
  border-bottom: 1px solid var(--line-faint); color: var(--ink);
}
.result:hover { background: #faf9f7; color: var(--ink); }
/* Vignette du visage dans les listes. Le carré sombre reste visible si
 * aucun skin n'a encore été capturé, ce qui garde les lignes alignées
 * plutôt que de les faire sauter quand une image manque. */
.result-face {
  position: relative; display: block; flex: none;
  width: 40px; height: 40px;
  background: #242424; border: 2px solid #4a4a4a;
}
.result-face img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; image-rendering: pixelated;
}

.result-name { font-weight: 700; font-size: 15px; }
.result-meta { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.result-rank {
  color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; padding: 5px 9px;
}
.result-pos {
  font-family: var(--display); font-size: 18px; color: var(--muted);
  min-width: 42px; text-align: right;
}

/* ---- États vides et messages ------------------------------------ */

/* Aucune donnée n'est inventée : quand le jeu n'a rien encore
 * enregistré, on le dit explicitement plutôt que d'afficher des zéros
 * qui ressembleraient à un compte réel mais inactif. */
.empty {
  padding: 28px 20px; text-align: center; color: var(--muted); font-size: 13px;
  line-height: 1.6;
}
.empty strong { display: block; color: var(--ink); font-size: 14px; margin-bottom: 4px; }
.empty code {
  font-family: var(--mono); font-size: 12px; background: var(--line-faint);
  padding: 2px 6px;
}

.notice { padding: 40px 24px; text-align: center; }
.notice h2 { font-family: var(--display); font-size: 22px; margin: 0 0 8px; }
.notice p { color: var(--muted); margin: 0 0 20px; }

.skeleton { color: var(--muted); font-family: var(--mono); font-size: 12px; }

/* ---- Pied de page ------------------------------------------------ */

.site-footer { background: var(--ink); color: var(--muted-dark); font-size: 12px; }
.site-footer .wrap {
  padding: 22px 24px; display: flex; gap: 20px; flex-wrap: wrap;
}
.site-footer .spacer { margin-left: auto; }

/* ---- Adaptatif --------------------------------------------------- */

@media (max-width: 940px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .mode-grid { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .site-nav { display: none; }

  .home-hero-grid { grid-template-columns: 1fr; padding-top: 48px; }
  .home-hero-text { padding-bottom: 0; }
  /* La figurine passe sous le texte plutôt que de le comprimer : sur
   * mobile l'appât, c'est le titre. */
  .home-hero-art { min-height: 0; }
  .mascot-hero { max-width: 260px; }
  .live-grid { grid-template-columns: repeat(2, 1fr); }
  .what-grid { grid-template-columns: 1fr; }
  .home-how-grid, .home-final-grid { grid-template-columns: 1fr; }
  .mascot-how, .mascot-final { max-width: 220px; }
  .mascot-what { display: none; }
  /* Sur une colonne, Steve à côté d'un paragraphe le comprime pour rien. */
  .live-foot { flex-direction: column; align-items: flex-start; }
  .mascot-steve { margin: 8px auto 0; width: 120px; }
}

@media (max-width: 620px) {
  .kpi-grid, .mode-grid { grid-template-columns: 1fr; }
  .hero-title h1 { font-size: 30px; }
  .search-hero h1 { font-size: 32px; }
  .avatar { width: 120px; height: 120px; }
  .identity-cell { min-width: 100%; }
  .match-detail { display: none; }
  .live-grid { grid-template-columns: 1fr; }
  .live-value { font-size: 34px; }
}
