:root {
  --nuit: #0b1020;
  --nuit-2: #121a33;
  --nuit-3: #1a2547;
  --bord: #26345f;
  --texte: #e8ecf8;
  --doux: #9aa8cf;
  --lune: #8fb4ff;
  --or: #ffc94d;
  --rouge: #e5484d;
  --vert: #3dd68c;
  --rayon: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, #1b2a5a 0%, var(--nuit) 60%) fixed, var(--nuit);
  color: var(--texte);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
h1, h2 { margin: 0 0 .6em; line-height: 1.2; }
h2 { font-size: 1.05rem; }
a { color: var(--lune); }
[hidden] { display: none !important; }

/* Connexion */
.ecran-connexion { display: grid; place-items: center; padding: 16px; }
.carte-connexion {
  background: var(--nuit-2); border: 1px solid var(--bord); border-radius: 20px;
  max-width: 420px; width: 100%; padding: 32px 24px; text-align: center;
}
.carte-connexion .lune { width: 84px; height: 84px; }
.carte-connexion p { color: var(--doux); }
.petit { font-size: .82rem; }

/* En-tête */
.entete {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--bord); background: rgba(11, 16, 32, .8);
  position: sticky; top: 0; z-index: 5; backdrop-filter: blur(8px);
}
.marque { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.marque img { width: 30px; height: 30px; }
.moi { display: flex; align-items: center; gap: 10px; font-size: .9rem; min-width: 0; }
.moi img { width: 30px; height: 30px; border-radius: 50%; }
.moi .nom { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30vw; }
.badge { font-size: .72rem; padding: 2px 8px; border-radius: 99px; background: var(--nuit-3); color: var(--lune); white-space: nowrap; }
.badge.alpha { color: var(--or); }

/* Onglets */
.onglets { display: flex; gap: 6px; overflow-x: auto; padding: 12px 16px 0; scrollbar-width: none; }
.onglets button {
  border: 1px solid var(--bord); background: var(--nuit-2); color: var(--doux);
  padding: 8px 14px; border-radius: 99px; font: inherit; cursor: pointer; white-space: nowrap;
}
.onglets button[aria-selected="true"] { background: var(--lune); color: var(--nuit); border-color: var(--lune); font-weight: 600; }

main#contenu { padding: 16px; max-width: 1100px; margin: 0 auto; }
.bloc { background: var(--nuit-2); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 16px; margin-bottom: 16px; min-width: 0; }
.deux-colonnes { display: grid; gap: 16px; grid-template-columns: 1fr; }
.deux-colonnes > .bloc { margin-bottom: 0; }
@media (min-width: 800px) { .deux-colonnes { grid-template-columns: 1fr 1fr; } }
section > .deux-colonnes { margin-bottom: 16px; }
.aide { color: var(--doux); font-size: .88rem; margin: -.3em 0 .8em; }
.vide { color: var(--doux); }

/* Statistiques */
.grille-stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 16px; }
.stat { background: var(--nuit-2); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 14px; }
.stat .valeur { font-size: 1.6rem; font-weight: 700; }
.stat .libelle { color: var(--doux); font-size: .85rem; }
.point { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; background: var(--doux); }
.point.vert { background: var(--vert); }
.point.rouge { background: var(--rouge); }

/* Listes de membres */
.liste-membres { list-style: none; margin: 0; padding: 0; }
.liste-membres li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--bord); flex-wrap: wrap; }
.liste-membres li:first-child { border-top: 0; }
.liste-membres img { width: 36px; height: 36px; border-radius: 50%; flex: none; }
.infos { flex: 1 1 160px; min-width: 0; }
.infos .nom { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.infos .sous { color: var(--doux); font-size: .82rem; }
.etiquette { font-size: .75rem; padding: 2px 8px; border-radius: 99px; background: var(--nuit-3); }
.etiquette.rouge { color: #ffb3b5; background: rgba(229, 72, 77, .18); }
.etiquette.or { color: var(--or); background: rgba(255, 201, 77, .14); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Formulaires */
input, textarea, select {
  width: 100%; background: var(--nuit); color: var(--texte); border: 1px solid var(--bord);
  border-radius: 10px; padding: 10px 12px; font: inherit; margin-bottom: 10px;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--lune); outline-offset: 1px; }
label { display: block; color: var(--doux); font-size: .88rem; }
.bouton {
  display: inline-block; border: 0; border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 600;
  background: var(--lune); color: var(--nuit); cursor: pointer; text-decoration: none;
}
.bouton:disabled { opacity: .5; cursor: wait; }
.bouton.petit-bouton { padding: 6px 12px; font-size: .85rem; }
.bouton.secondaire { background: var(--nuit-3); color: var(--texte); }
.bouton.danger { background: var(--rouge); color: #fff; }
.bouton.discord { background: #5865f2; color: #fff; margin: 8px 0 4px; }

.texte-discord { white-space: pre-wrap; margin: 0; font: inherit; color: var(--texte); }
.logs { white-space: pre-wrap; word-break: break-word; background: var(--nuit); border: 1px solid var(--bord); border-radius: 10px; padding: 12px; font-size: .78rem; max-height: 60vh; overflow: auto; margin-top: 12px; }

.journal { list-style: none; margin: 0; padding: 0; }
.journal li { padding: 10px 0; border-top: 1px solid var(--bord); }
.journal li:first-child { border-top: 0; }
.journal .quand { color: var(--doux); font-size: .8rem; }
.journal .details { color: var(--doux); font-size: .88rem; white-space: pre-wrap; word-break: break-word; }

dialog { background: var(--nuit-2); color: var(--texte); border: 1px solid var(--bord); border-radius: 16px; padding: 20px; width: min(420px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0, 0, 0, .6); }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); max-width: calc(100vw - 32px);
  background: var(--nuit-3); border: 1px solid var(--bord); padding: 10px 16px; border-radius: 12px; z-index: 20;
}
.toast.erreur { border-color: var(--rouge); }
