/* EchelonCenter — DA « mot-symbole » (verrouillee le 02/09/2026).
   Source : public/logo.svg, le blason ECHELON CENTER. Deux couleurs relevees
   dans le fichier meme, pas approchees :

       #1B1A22   le fond du blason — un noir CHAUD, tirant sur le violet.
                 Ce n'est pas un bleu nuit : toute la gamme sombre en decoule.
       #4AA5FC   le bleu du lettrage — clair, franc, tres sature.

   La version precedente etait bleu nuit (#0A142B) : elle jurait avec le logo,
   qui est neutre-chaud. Tout le gris de l'interface a donc ete redescendu sur
   la teinte du blason (~255 deg) au lieu du bleu (~220 deg). C'est invisible
   ligne a ligne et evident a l'ecran.

   Un seul accent : le bleu. L'ambre = avertissement, le rouge = service a
   l'arret. Un seul ornement : la grille de tuiles en fond, a peine visible.
   Ne PAS re-complexifier. */
:root {
  color-scheme: dark;
  --bg: #16151C;          /* le noir du blason, un cran plus sombre */
  --card: #211F2A;
  --card-2: #2B2936;
  --hover: #363343;
  --line: rgba(74, 165, 252, 0.12);
  --ink: #EFF1F6;
  --ink-2: #B4B2C2;
  --muted: #7E7B8E;       /* gris CHAUD : un gris bleute jurerait avec le fond */
  --acc: #4AA5FC;
  --acc-deep: #2B7FD4;
  --acc-light: #9BD0FE;
  --gold: #F5A623;
  --good: #35C98A;
  --bad: #E5484D;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  --display: "Arial Black", "Segoe UI", Inter, system-ui, sans-serif;
}

/* Un `display:` pose sur une classe ecrase la regle par defaut de [hidden].
   Sans celle-ci, un element masque par `el.hidden = true` reste affiche — c'est
   ce qui montrait le bandeau MOCK en production, puis un bandeau ambre vide.
   `!important` gagne quel que soit l'ordre dans le fichier : ne PAS la deplacer
   « a la fin », c'est ce qui l'a fait disparaitre deux fois. */

/* La grille de tuiles, en fond, a peine visible. Seul ornement de la DA. */
body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(74, 165, 252, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 165, 252, 0.05) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(80vw 70vh at 50% 0%, #000 10%, transparent 85%);
  -webkit-mask-image: radial-gradient(80vw 70vh at 50% 0%, #000 10%, transparent 85%);
}
#app, #gate { position: relative; z-index: 1; }

* { box-sizing: border-box; margin: 0; }
body {
  background: var(--bg); color: var(--ink); min-height: 100vh;
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------- porte d'entrée ---------- */
#gate { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
#gate[hidden], #app[hidden] { display: none; }
.gate-card {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding: 48px 52px; background: var(--card); border-radius: 28px;
}
.gate-card img { width: 190px; height: auto; }
.gate-card input {
  width: 280px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 999px;
  font: inherit; background: var(--bg); color: var(--ink);
}
.gate-card input:focus { outline: 2px solid var(--acc); outline-offset: 1px; }
.gate-card button, .btn-primary {
  background: var(--acc-deep); color: #fff; border: 0; border-radius: 999px;
  padding: 13px 30px; font: inherit; font-weight: 700; cursor: pointer;
}
.gate-card button:hover, .btn-primary:hover { background: var(--acc); }
.err { color: var(--bad); font-size: 14px; }

/* ---------- charpente ---------- */
#app { max-width: 1180px; margin: 0 auto; padding: 26px 22px 60px; }
/* Le blason est centre en haut, seul : il contient deja le mot-symbole, donc
   on ne redit pas « ECHELONCENTER » a cote. Le titre reste dans le HTML pour
   les lecteurs d'ecran et l'onglet du navigateur. */
header { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 12px; }
header img { height: 92px; width: auto; display: block; }
header .lock, header .spacer { display: none; }
/* Le drapeau MOCK se glisse sous le blason plutot que de casser le centrage. */
#mock-flag { align-items: center; text-align: center; gap: 0; }

.lock { display: flex; flex-direction: column; line-height: 0.95; }
.lock h1 { font-family: var(--display); font-size: 24px; letter-spacing: -0.02em; }
.lock span {
  font-family: var(--display); font-size: 11px; font-weight: 900;
  letter-spacing: 0.03em; color: var(--acc); text-transform: uppercase;
}
.spacer { flex: 1; }

/* ---------- bandeau machine ----------
   Chaque mesure porte une jauge. Un chiffre seul ne dit pas s'il est bon ;
   la barre repond avant qu'on ait fini de lire le nombre. */
#host {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 4px; margin: 16px 0 20px; padding: 4px;
  background: var(--card); border-radius: 18px;
}
.hs {
  display: flex; flex-direction: column; gap: 5px;
  padding: 15px 18px; border-radius: 15px;
  transition: background 140ms ease;
}
.hs:hover { background: var(--card-2); }
.hs b {
  font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums;
  line-height: 1.1; display: flex; align-items: baseline; gap: 6px;
}
.hs b u { font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none; }
.hs i {
  font-style: normal; font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.07em;
}
.hs.warn b { color: var(--gold); }
.hs.bad  b { color: var(--bad); }

/* la jauge, partagee par la machine et les services */
.g { display: block; height: 4px; border-radius: 99px; background: var(--card-2); overflow: hidden; }
.hs .g { margin-top: 3px; }
.g i { display: block; height: 100%; border-radius: 99px; background: var(--acc);
       transition: width 400ms cubic-bezier(.4,0,.2,1); }
.g.warn i { background: var(--gold); }
.g.bad  i { background: var(--bad); }

/* ---------- bandeau de sante ----------
   La seule ligne a lire de loin : verte on peut partir, rouge elle nomme ce
   qui est tombe et propose de le relancer. Rien entre les deux. */
.health {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 20px; border-radius: 16px; margin-bottom: 14px;
  font-size: 15px;
}
.health .hd { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.health b { font-weight: 700; }
.health .hsub { color: var(--muted); font-size: 14px; }
.health.ok  { background: color-mix(in srgb, var(--good) 12%, var(--card)); }
.health.ok .hd { background: var(--good); }
.health.bad { background: color-mix(in srgb, var(--bad) 16%, var(--card)); }
.health.bad .hd { background: var(--bad); animation: pulse 1.8s ease-in-out infinite; }
.health.bad b { color: var(--bad); }
.health .btn-primary { padding: 9px 18px; font-size: 14px; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .3 } }
@media (prefers-reduced-motion: reduce) { .health.bad .hd { animation: none } }

/* ---------- services ----------
   Un service a l'arret ne doit pas ressembler a un service qui tourne : rail
   rouge a gauche, fond teinte, et son bouton principal devient « Demarrer ».
   C'est la seule difference de traitement, mais elle se voit du premier coup. */
#list { display: grid; gap: 10px; }
.svc {
  display: grid; grid-template-columns: 3px 1fr 150px 320px; align-items: center; gap: 18px;
  padding: 16px 20px 16px 0; background: var(--card); border-radius: 16px;
  overflow: hidden; transition: background 140ms ease;
}
.svc:hover { background: var(--card-2); }
.svc .rail { width: 3px; height: 46px; border-radius: 0 99px 99px 0; background: var(--good); }
.svc.down { background: color-mix(in srgb, var(--bad) 9%, var(--card)); }
.svc.down:hover { background: color-mix(in srgb, var(--bad) 14%, var(--card)); }
.svc.down .rail { background: var(--bad); }
.svc-id { min-width: 0; }
.svc h2 { font-size: 17px; font-weight: 700; }
.svc h2 a { color: var(--ink); text-decoration: none; }
.svc h2 a:hover { color: var(--acc-light); }
.svc .meta {
  color: var(--muted); font-size: 13px; margin-top: 3px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.svc .meta b { color: var(--ink-2); font-weight: 600; }
.svc .meta b.off { color: var(--bad); }
.svc .kind {
  font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--acc-light); background: color-mix(in srgb, var(--acc) 16%, transparent);
  padding: 3px 9px; border-radius: 99px; font-weight: 600;
}
/* charge du service : la memoire rapportee a ce qui lui est alloue.
   Les colonnes sont fixes (150px puis 320px) pour que les jauges et les
   boutons s'alignent d'une ligne a l'autre : une colonne `auto` se
   redimensionne par ligne et donne un escalier. */
.svc-load { display: flex; flex-direction: column; gap: 5px; }
.svc-load .lv { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.svc-load .lv u { font-size: 11px; font-weight: 500; color: var(--muted); text-decoration: none; }
@media (max-width: 760px) { .svc-load { display: none } }

.acts { display: flex; gap: 8px; justify-content: flex-end; }

@media (max-width: 900px) {
  .svc { grid-template-columns: 3px 1fr auto; }
  .acts { grid-column: 2 / -1; }
}

/* ---------- etat vide ----------
   Un ecran vide doit dire quoi faire, pas seulement qu'il n'y a rien. */
.empty {
  background: var(--card); border-radius: 18px; padding: 40px 32px;
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.empty b { font-size: 17px; font-weight: 700; }
.empty p { color: var(--muted); font-size: 14px; max-width: 52ch; line-height: 1.6; }
.empty code { font: 13px var(--mono); color: var(--acc-light); }
.empty .btn-primary { margin-top: 8px; }
.acts button {
  border: 1px solid var(--line); background: var(--card-2); color: var(--ink-2);
  border-radius: 999px; padding: 9px 16px; font: inherit; font-size: 14px;
  font-weight: 600; cursor: pointer;
}
.acts button:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.acts button:disabled { opacity: 0.35; cursor: not-allowed; }
.acts button.danger:hover:not(:disabled) { background: var(--bad); border-color: var(--bad); color: #fff; }

/* ---------- console ---------- */
#console-wrap { margin-top: 22px; background: var(--card); border-radius: 18px; padding: 18px 20px; }
#console-wrap[hidden] { display: none; }
.cw-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cw-top h2 { font-size: 17px; font-weight: 700; }
.cw-top button { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; }
#log {
  height: 380px; overflow-y: auto; padding: 14px 16px; border-radius: 12px;
  background: #100F15; font: 13px/1.6 var(--mono); white-space: pre-wrap;
  word-break: break-word; color: var(--ink-2);
}
#log .warn { color: var(--gold); }
#log .bad { color: var(--bad); }
#log .me { color: var(--acc-light); }
#cmd-form { display: flex; gap: 10px; margin-top: 12px; }
#cmd-form input {
  flex: 1; padding: 12px 16px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg); color: var(--ink); font: 14px var(--mono);
}
#cmd-form input:focus { outline: 2px solid var(--acc); outline-offset: 1px; }
#cmd-form[hidden] { display: none; }

#toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--card-2); border: 1px solid var(--line); color: var(--ink);
  padding: 12px 20px; border-radius: 999px; font-size: 14px;
}
#toast[hidden] { display: none; }
footer { margin-top: 26px; color: var(--muted); font-size: 13px; }

/* ---------- onglets ---------- */
#tabs { display: flex; gap: 4px; margin: 20px 0 4px; padding: 5px; background: var(--card); border-radius: 999px; width: fit-content; }
#tabs button {
  border: 0; background: transparent; color: var(--muted); font: inherit;
  font-weight: 600; padding: 10px 22px; border-radius: 999px; cursor: pointer;
}
#tabs button:hover { color: var(--ink); }
#tabs button.on { background: var(--acc-deep); color: #fff; }
[id^="tab-"][hidden] { display: none; }

/* ---------- cartes de gestion ---------- */
.card { background: var(--card); border-radius: 18px; padding: 22px 24px; margin-bottom: 14px; }
.card h2 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.card .hint { color: var(--muted); font-size: 14px; margin-bottom: 18px; max-width: 66ch; }
.card code { font: 13px var(--mono); color: var(--acc-light); }

#new-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
#new-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
#new-form input {
  padding: 11px 15px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg); color: var(--ink); font: inherit; font-size: 15px; width: 190px;
}
#new-form input[name="ram"] { width: 120px; }
#new-form input:focus { outline: 2px solid var(--acc); outline-offset: 1px; }
#new-form button { height: 44px; }

#build-log {
  margin-top: 16px; max-height: 300px; overflow-y: auto; padding: 14px 16px;
  border-radius: 12px; background: #100F15; font: 13px/1.6 var(--mono);
  white-space: pre-wrap; color: var(--ink-2);
}
#build-log[hidden] { display: none; }
#build-log .ok { color: var(--good); }
#build-log .bad { color: var(--bad); }
#build-log .step { color: var(--acc-light); }

/* ---------- table des ports ---------- */
.alloc { display: grid; grid-template-columns: 1fr auto auto auto; gap: 12px 20px; align-items: center; }
.alloc > * { padding: 11px 0; border-bottom: 1px solid var(--line); }
.alloc .h { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.alloc b { font-weight: 600; }
.alloc .p { font: 14px var(--mono); font-variant-numeric: tabular-nums; }
.alloc .p.local { color: var(--muted); }
.alloc .free { color: var(--good); font-size: 14px; }

/* ---------- page d'un serveur ----------
   L'en-tete doit repondre a « il va bien ? » sans changer d'onglet : le nom,
   son etat, et la rangee de chiffres qui comptent. */
.link-back { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 14px 0 8px; }
.link-back:hover { color: var(--acc-light); }
.srv-head { padding: 0; overflow: hidden; }
.sh-top { display: flex; align-items: center; gap: 16px; padding: 20px 22px 20px 0; }
.sh-top .rail { width: 3px; height: 44px; border-radius: 0 99px 99px 0; background: var(--good); flex: none; }
.srv-head.down .sh-top .rail { background: var(--bad); }
.srv-head.down { background: color-mix(in srgb, var(--bad) 8%, var(--card)); }
.sh-name h2 { font-size: 23px; font-weight: 800; letter-spacing: -0.01em; }
.sh-name .meta { display: flex; align-items: center; gap: 9px; margin-top: 5px; }
.sh-name code { font: 12px var(--mono); color: var(--muted); }
.sh-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 1px; background: var(--line);
}
.sh-stats .st {
  display: flex; flex-direction: column; gap: 3px;
  padding: 15px 18px 16px; background: var(--card);
  transition: background 140ms ease;
}
.srv-head.down .sh-stats .st { background: color-mix(in srgb, var(--bad) 8%, var(--card)); }
.sh-stats .st b {
  font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.15;
}
.sh-stats .st b em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.sh-stats .st i {
  font-style: normal; font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.07em;
}
.sh-stats .st u { font-size: 11px; color: var(--muted); text-decoration: none; }
.sh-stats .st.ok b { color: var(--good); }
.sh-stats .st.bad b { color: var(--bad); }
.sh-stats .st.warn b { color: var(--gold); }
.sh-stats .g { margin-top: 4px; }
#subtabs { display: flex; gap: 4px; margin: 4px 0 14px; padding: 5px; background: var(--card); border-radius: 999px; width: fit-content; }
#subtabs button { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; padding: 9px 20px; border-radius: 999px; cursor: pointer; }
#subtabs button:hover { color: var(--ink); }
#subtabs button.on { background: var(--acc-deep); color: #fff; }
[id^="sub-"][hidden] { display: none; }

/* ---------- fichiers ---------- */
#crumbs { color: var(--muted); font: 14px var(--mono); margin-bottom: 14px; }
#crumbs a { color: var(--acc-light); text-decoration: none; cursor: pointer; }
#crumbs a:hover { text-decoration: underline; }
.frow { display: grid; grid-template-columns: 1fr 110px 170px 90px; gap: 16px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.frow.h { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.frow .n { display: flex; align-items: center; gap: 9px; }
.frow .n span.i { color: var(--acc); }
.frow a { color: var(--ink); text-decoration: none; cursor: pointer; }
.frow a:hover { color: var(--acc-light); }
.frow .s, .frow .m { font: 13px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.frow button { border: 1px solid var(--line); background: var(--card-2); color: var(--ink-2); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13px; cursor: pointer; }
.frow button:hover { background: var(--hover); color: var(--ink); }

#editor { margin-top: 18px; }
.ed-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ed-top button { border: 1px solid var(--line); background: var(--card-2); color: var(--ink-2); border-radius: 999px; padding: 9px 18px; font: inherit; font-size: 14px; cursor: pointer; }
.ed-top .btn-primary { border: 0; background: var(--acc-deep); color: #fff; font-weight: 700; }
#ed-text { width: 100%; height: 420px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #100F15; color: var(--ink-2); font: 13px/1.6 var(--mono); resize: vertical; }
#ed-text:focus { outline: 2px solid var(--acc); outline-offset: 1px; }

/* ---------- console dans la page serveur ---------- */
#sub-console #log2 { height: 420px; overflow-y: auto; padding: 14px 16px; border-radius: 12px; background: #100F15; font: 13px/1.6 var(--mono); white-space: pre-wrap; word-break: break-word; color: var(--ink-2); }
#sub-console #log2 .warn { color: var(--gold); }
#sub-console #log2 .bad { color: var(--bad); }
#sub-console #log2 .me { color: var(--acc-light); }

/* ---------- formulaires de gestion ---------- */
.flds { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 18px; }
.fld { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.fld input, .fld select {
  padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg); color: var(--ink); font: inherit; font-size: 15px;
}
.fld input:focus, .fld select:focus { outline: 2px solid var(--acc); outline-offset: 1px; }
.row-end { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.row-end button { border: 1px solid var(--line); background: var(--card-2); color: var(--ink-2); border-radius: 999px; padding: 11px 22px; font: inherit; font-weight: 600; cursor: pointer; }
.row-end button:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.row-end .btn-primary { border: 0; background: var(--acc-deep); color: #fff; }
.row-end .btn-primary:hover:not(:disabled) { background: var(--acc); }
.row-end button:disabled { opacity: 0.4; cursor: not-allowed; }
.card h2 .count { color: var(--muted); font-weight: 600; font-size: 14px; margin-left: 6px; }
.frow button.danger:hover { background: var(--bad); border-color: var(--bad); color: #fff; }


/* champ de commande de la console dans la page d'un serveur */
#cmd2 { display: flex; gap: 10px; margin-top: 12px; }
#cmd2 input {
  flex: 1; padding: 12px 16px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg); color: var(--ink); font: 14px var(--mono);
}
#cmd2 input:focus { outline: 2px solid var(--acc); outline-offset: 1px; }
#cmd2 button { border: 0; background: var(--acc-deep); color: #fff; border-radius: 999px; padding: 12px 26px; font: inherit; font-weight: 700; cursor: pointer; }
#cmd2 button:hover { background: var(--acc); }


/* ---------- finitions ----------
   Des transitions courtes (140 ms) : assez pour que l'oeil suive un changement
   d'etat, assez breves pour ne jamais donner l'impression d'attendre. */
#tabs button, #subtabs button, .acts button, .row-end button, .frow button {
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.card { transition: background 140ms ease; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 8px;
}
#toast { animation: toast-in 180ms cubic-bezier(.2,.8,.3,1); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px) } to { opacity: 1; transform: translate(-50%, 0) } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important } }

.svc-load .lv.idle { color: var(--muted); font-weight: 600; }



/* ---------- barre collante ----------
   Une console fait 800 lignes et une liste de fichiers peut etre longue :
   sans ca, changer d'onglet demande de remonter tout l'ecran. */
/* Le blason fait 92 px : un en-tete collant de cette taille mange l'ecran et
   recouvre le contenu. Il defile donc normalement. Seuls les onglets restent
   accroches en haut — c'est eux qu'on cherche en scrollant une console de
   800 lignes, pas le logo. */
#topbar { margin: -26px -22px 0; padding: 20px 22px 12px; }
#tabs, #subtabs {
  position: sticky; top: 8px; z-index: 20;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--card) 92%, transparent);
}

/* ---------- rappel de redemarrage ----------
   Minecraft ne relit rien a chaud. Sans ce rappel, on modifie un reglage, on
   ne voit aucun effet en jeu, et on croit que le panel n'a pas marche. */
.pending {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 13px 20px; border-radius: 14px; margin: 0 0 12px;
  background: color-mix(in srgb, var(--gold) 15%, var(--card));
  font-size: 14px;
}
.pending .pd { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: none; }
.pending b { color: var(--gold); font-weight: 700; }
.pending .psub { color: var(--ink-2); }
.pending .btn-primary { padding: 8px 16px; font-size: 13px; }



/* ---------- analyse ----------
   Les courbes sont dessinees au canvas (public/chart.js) : la hauteur vient
   d'ici, la largeur suit le conteneur. Si tu changes ces hauteurs, rien ne
   casse — le traceur relit clientWidth/clientHeight a chaque dessin. */
.an-head { margin: 18px 0 12px; }
.an-head .big { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.h-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 4px; }
.h-row h2 a { color: var(--ink); text-decoration: none; }
.h-row h2 a:hover { color: var(--acc-light); }
.h-row .hint { margin: 0; }
.h-row .bad { color: var(--bad); }

.spans { display: flex; gap: 3px; padding: 4px; background: var(--bg); border-radius: 99px; }
.spans button {
  border: 0; background: transparent; color: var(--muted); font: inherit;
  font-size: 13px; font-weight: 600; padding: 7px 15px; border-radius: 99px; cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.spans button:hover { color: var(--ink); }
.spans button.on { background: var(--acc-deep); color: #fff; }

.an-tiles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px; background: var(--line); border-radius: 12px; overflow: hidden;
  margin: 16px 0 18px;
}
.an-tiles .st { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; background: var(--card); }
.an-tiles .st b { font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; }
.an-tiles .st i { font-style: normal; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.an-tiles .st.bad b { color: var(--bad); }
.an-tiles .st.warn b { color: var(--gold); }

.chart-wrap { height: 190px; margin: 6px 0 4px; }
.chart-wrap.sm { height: 130px; }
.chart-wrap canvas { width: 100%; height: 100%; display: block; }
.upt { height: 26px; border-radius: 6px; overflow: hidden; margin: 10px 0 4px; }
.upt.sm { height: 18px; margin: 0; }
.upt canvas { width: 100%; height: 100%; display: block; }

/* comptes d'evenements */
.kinds { display: flex; flex-wrap: wrap; gap: 8px; }
.kc {
  font-size: 13px; color: var(--ink-2); background: var(--card-2);
  padding: 7px 14px; border-radius: 99px;
}
.kc b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.kc.bad  { background: color-mix(in srgb, var(--bad) 18%, var(--card)); }
.kc.bad b { color: var(--bad); }
.kc.warn { background: color-mix(in srgb, var(--gold) 18%, var(--card)); }
.kc.warn b { color: var(--gold); }
.kc.ok b { color: var(--good); }

/* temps de jeu */
.bars { display: grid; gap: 9px; }
.bar { display: grid; grid-template-columns: 130px 1fr 78px; align-items: center; gap: 12px; }
.bar .bn { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .bt { height: 8px; border-radius: 99px; background: var(--card-2); overflow: hidden; }
.bar .bt i { display: block; height: 100%; border-radius: 99px; background: var(--acc); }
.bar .bv { font: 13px var(--mono); color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* journal des faits */
.feed { max-height: 420px; overflow-y: auto; }
.fe {
  display: grid; grid-template-columns: 150px 110px 120px 1fr; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px;
}
.fe .ft { font: 12px var(--mono); color: var(--muted); }
.fe .fk { color: var(--acc-light); font-weight: 600; }
.fe .fa { font-weight: 600; }
.fe .fd { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.fe.bad .fk  { color: var(--bad); }
.fe.warn .fk { color: var(--gold); }
.fe.ok .fk   { color: var(--good); }
@media (max-width: 800px) { .fe { grid-template-columns: 1fr 1fr; } }

/* sites */
.site-row { display: grid; grid-template-columns: 1fr 80px; gap: 10px 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.site-row .dispo { font-size: 17px; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.site-row .dispo.ok { color: var(--good); }
.site-row .dispo.warn { color: var(--gold); }
.site-row .dispo.bad { color: var(--bad); }
.site-row .upt { grid-column: 1 / -1; }

/* Les onglets suivent le blason : centres eux aussi.
   A GARDER APRES le bloc #tabs — pose plus haut, il etait ecrase par la marge
   du bloc d'origine. */
#tabs { margin: 0 auto 4px; }
#topbar { text-align: center; }
#topbar > * { text-align: left; }

/* ---------- joueurs ---------- */
.ptab { display: grid; }
.pr {
  display: grid; grid-template-columns: 1.6fr .9fr .8fr .7fr .8fr .8fr 1fr;
  gap: 12px; align-items: center; padding: 11px 10px; border-radius: 10px;
  border-bottom: 1px solid var(--line); font-size: 14px; cursor: pointer;
  transition: background 140ms ease;
}
.pr:hover:not(.h) { background: var(--card-2); }
.pr.h {
  cursor: default; border-bottom: 1px solid var(--line);
  color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
}
.pr.h:hover { background: none; }
.pn { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.pdot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.pr.on .pdot { background: var(--good); }
.pr.on .pn { color: var(--good); }
.pv { font: 13px var(--mono); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.pq { font-size: 13px; color: var(--muted); }
@media (max-width: 820px) {
  .pr { grid-template-columns: 1.4fr 1fr 1fr; }
  .pr > *:nth-child(n+4) { display: none; }
  .pr.h > *:nth-child(n+4) { display: none; }
}

/* ---------- heures d'activite ----------
   24 barres, une par heure. La plus haute est mise en avant : c'est la seule
   information qu'on cherche vraiment en regardant ce graphe. */
.hours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; height: 96px; align-items: end; margin: 4px 0 2px; }
.hh { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: 4px; }
.hh i { display: block; background: var(--acc-deep); border-radius: 3px 3px 0 0; transition: height 300ms cubic-bezier(.4,0,.2,1); }
.hh.top i { background: var(--acc); }
.hh u { font-size: 10px; color: var(--muted); text-align: center; text-decoration: none; height: 12px; }


/* ---------- carte 7x24 ----------
   Une case par heure et par jour de semaine. L'intensite dit le temps joue.
   Se lit en une seconde, contrairement a 168 nombres. */
.carte {
  display: grid; grid-template-columns: 34px repeat(24, 1fr); gap: 2px;
  margin: 6px 0 4px;
}
.carte .cx { font-size: 10px; color: var(--muted); text-align: left; padding-bottom: 3px; }
.carte .cy { font-size: 11px; color: var(--muted); display: flex; align-items: center; }
.carte .cc {
  aspect-ratio: 1; border-radius: 3px; min-height: 14px;
  background: color-mix(in srgb, var(--acc) calc(var(--v) * 100%), var(--card-2));
  transition: transform 120ms ease;
}
.carte .cc:hover { transform: scale(1.35); z-index: 2; }

/* ---------- tableau de retention ---------- */
.rtab { display: grid; margin-top: 14px; }
.rr {
  display: grid; grid-template-columns: 1.2fr .8fr 1fr 1fr 1fr; gap: 12px;
  padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 14px;
}
.rr.h { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.rr .pv { font: 13px var(--mono); font-variant-numeric: tabular-nums; }
.rr .pv.ok { color: var(--good); }
.rr .pv.bad { color: var(--bad); }
.rr .pv.na { color: var(--muted); }

/* nuances des tuiles */
.an-tiles .st.acc b { color: var(--acc); }
.an-tiles .st u { font-size: 11px; color: var(--muted); text-decoration: none; }
.bars .bv u { font-size: 11px; color: var(--muted); text-decoration: none; }
.kc.acc { background: color-mix(in srgb, var(--acc) 18%, var(--card)); }
.kc.acc b { color: var(--acc); }

/* ---------- departs ----------
   La derniere colonne (ce qui s'est passe avant) n'est pas decorative : c'est
   ce qui permet de contredire la raison proposee. Ne pas la masquer. */
.dtab { display: grid; }
.dr {
  display: grid; grid-template-columns: 1.1fr 1fr .8fr 1.4fr 2.6fr;
  gap: 12px; align-items: center; padding: 11px 8px;
  border-bottom: 1px solid var(--line); font-size: 14px;
}
.dr.sans-nom { grid-template-columns: 1fr .8fr 1.4fr 2.6fr; }
.dr.h { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.dr .kc { font-size: 12px; padding: 5px 11px; cursor: help; }
.dlast { display: flex; flex-wrap: wrap; gap: 6px; }
.df {
  font-size: 12px; color: var(--ink-2); background: var(--card-2);
  padding: 4px 9px; border-radius: 8px; white-space: nowrap;
}
.df em { font-style: normal; color: var(--muted); }
.df u { color: var(--muted); text-decoration: none; font-size: 11px; }
.df.bad { background: color-mix(in srgb, var(--bad) 16%, var(--card)); color: var(--bad); }
.df.warn { background: color-mix(in srgb, var(--gold) 16%, var(--card)); color: var(--gold); }
.df.ok { background: color-mix(in srgb, var(--good) 16%, var(--card)); color: var(--good); }
@media (max-width: 900px) {
  .dr { grid-template-columns: 1fr 1fr; }
  .dr > *:nth-child(n+3) { grid-column: 1 / -1; }
  .dr.h { display: none; }
}

/* ---------- la cloche ----------
   Posee sur la rangee des onglets pour rester visible quand celle-ci se colle
   en haut. Elle ne prend de la couleur que s'il y a vraiment quelque chose :
   une cloche toujours rouge ne se regarde plus. */
.tabs-row {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  position: relative; width: fit-content; margin: 0 auto;
}
/* Dans la rangee, les onglets ne se centrent plus tout seuls : c'est la rangee
   entiere (onglets + cloche) qui est centree. Sans ca, la marge auto des
   onglets repoussait la cloche contre le bord droit. */
.tabs-row #tabs { margin: 0; }
.cloche {
  position: relative; display: grid; place-items: center;
  width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: var(--card); color: var(--muted); cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.cloche:hover { background: var(--card-2); color: var(--ink); }
.cloche.a-attention { color: var(--gold); }
.cloche.a-grave { color: var(--bad); }
.cloche.a-grave svg { animation: sonne 2.4s ease-in-out infinite; transform-origin: 50% 20%; }
@keyframes sonne {
  0%, 82%, 100% { transform: rotate(0) }
  86% { transform: rotate(11deg) }
  90% { transform: rotate(-9deg) }
  94% { transform: rotate(5deg) }
}
@media (prefers-reduced-motion: reduce) { .cloche.a-grave svg { animation: none } }
.cloche-n {
  position: absolute; top: 1px; right: 0;
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px;
  background: var(--bad); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--bg);
}
.cloche.a-attention .cloche-n { background: var(--gold); color: #1B1A22; }

.alertes {
  /* Ancre sur la rangee d'onglets, pas sur la page : sinon le panneau
     s'ouvrait par-dessus le logo. */
  position: absolute; z-index: 40; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  width: min(560px, calc(100vw - 32px));
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 6px; box-shadow: 0 18px 48px rgba(0, 0, 0, .5);
  max-height: 70vh; overflow-y: auto;
}
.al {
  display: grid; grid-template-columns: 8px 1fr auto; gap: 12px;
  padding: 14px 16px; border-radius: 13px; text-align: left;
  transition: background 140ms ease;
}
.al[data-open] { cursor: pointer; }
.al[data-open]:hover { background: var(--card-2); }
.al + .al { border-top: 1px solid var(--line); }
.al .ad { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--muted); }
.al.grave .ad { background: var(--bad); }
.al.attention .ad { background: var(--gold); }
.al.vide .ad { background: var(--good); }
.al .at { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.al .at b { font-size: 15px; font-weight: 700; }
.al.grave .at b { color: var(--bad); }
.al.attention .at b { color: var(--gold); }
.al.vide .at b { color: var(--good); }
.al .ao { font-size: 12px; color: var(--acc-light); }
.al .aq { color: var(--ink-2); font-size: 13px; line-height: 1.55; margin-top: 4px; max-width: 56ch; }
.al .au { font-size: 12px; color: var(--muted); white-space: nowrap; }

[hidden] { display: none !important; }
