/* L'admin Nerysia : la charte des maquettes (docs/maquettes/charte.css), en classes. */

:root {
  --fond: #110E17;
  --fond-menu: #0C0A11;
  --panneau: #1A1622;
  --panneau-creux: #15121D;
  --actif: #241E31;
  --bouton-actif: #2B2147;
  --bord: #2B2536;
  --separateur: #221D2D;
  --texte: #EEEAF5;
  --texte-2: #CFC9DB;
  --texte-doux: #A9A2B8;
  --texte-faible: #8A8399;
  --lien: #C7B2FF;
  --rouge: #E0342B;   --rouge-texte: #FF8A80;   --rouge-fond: rgba(224,52,43,.16);
  --jaune: #F2C230;   --jaune-fond: rgba(242,194,48,.14);
  --vert: #3FBF5A;    --vert-texte: #6EE08A;    --vert-fond: rgba(63,191,90,.12);
  --violet: #9B6CF0;  --violet-texte: #B79BFF;  --violet-fond: rgba(155,108,240,.16);
  --violet-bouton: #6E43C9;
  --police-titre: "Space Grotesk", system-ui, sans-serif;
  --police: Inter, system-ui, sans-serif;
  --police-code: "JetBrains Mono", ui-monospace, monospace;
  --rayon-carte: 14px;
  --rayon-bouton: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--fond); color: var(--texte); font-family: var(--police); font-size: 14px; line-height: 1.5; }
a { color: var(--lien); }
a:hover { color: #E2D6FF; }
*:focus-visible { outline: 2px solid var(--violet-texte); outline-offset: 2px; }
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-weight: 500; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--texte-doux); padding: 10px 12px; border-bottom: 1px solid var(--bord); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--separateur); font-size: 14px; vertical-align: top; }
th.droite, td.droite { text-align: right; }
h1, h2, h3 { margin: 0; font-family: var(--police-titre); font-weight: 600; }
h1 { font-size: 28px; }
h2 { font-size: 18px; }
p { margin: 0; }
dl, dd { margin: 0; }
button { font: inherit; }
[hidden] { display: none !important; }
.invisible { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Texte */
.mono { font-family: var(--police-code); }
.doux { color: var(--texte-doux); }
.faible { color: var(--texte-faible); }
.texte-2 { color: var(--texte-2); }
.petit { font-size: 12px; }
.moyen { font-size: 13px; }
.fort { font-weight: 500; }
.vert { color: var(--vert-texte); }
.rouge { color: var(--rouge-texte); }
.jaune { color: var(--jaune); }
.violet { color: var(--violet-texte); }
.nowrap { white-space: nowrap; }
.coupe { overflow-wrap: anywhere; }
.gros-chiffre { font-family: var(--police-titre); font-size: 26px; font-weight: 600; line-height: 1.2; }
.gros-chiffre .sur { font-size: 16px; color: var(--texte-doux); }

/* ------------------------------------------------------------------ squelette */
.app { display: flex; flex-wrap: wrap; min-height: 100vh; }
.nav { flex: 1 1 248px; background: var(--fond-menu); border-right: 1px solid var(--separateur); padding: 24px 16px; display: flex; flex-direction: column; gap: 28px; }
.nav-logo { display: flex; align-items: center; gap: 10px; padding: 0 8px; text-decoration: none; color: var(--texte); }
.nav-logo .marque { font-family: var(--police-titre); font-weight: 700; font-size: 18px; letter-spacing: .06em; display: block; }
.nav-logo .domaine { font-size: 12px; color: var(--texte-doux); display: block; }
.nav-groupe { display: flex; flex-direction: column; gap: 4px; }
.nav-lien { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--texte-2); text-decoration: none; }
.nav-lien:hover { background: #18141F; color: var(--texte); }
.nav-lien[aria-current="page"] { color: var(--texte); background: var(--actif); font-weight: 500; }
.nav-lien[aria-current="page"] svg { stroke: var(--violet-texte); }
.nav-lien .pastille { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--rouge-texte); background: var(--rouge-fond); padding: 2px 8px; border-radius: 999px; }
.nav-lien .cadenas { margin-left: auto; }
.nav-titre { padding: 0 12px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--texte-faible); }
.nav-plus-tard { display: flex; align-items: center; min-height: 36px; padding: 0 12px; color: var(--texte-faible); }
.nav-compte { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 10px; background: var(--panneau-creux); border: 1px solid var(--separateur); }
.nav-compte .infos { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.nav-compte form { margin: 0; }
.avatar { width: 36px; height: 36px; border-radius: 8px; background: var(--bouton-actif); display: flex; align-items: center; justify-content: center; font-family: var(--police-titre); font-weight: 700; color: var(--lien); flex: none; }
.avatar-joueur { background: #3A2F52; border-radius: 6px; font-family: var(--police); font-weight: 600; }
.avatar-grand { width: 80px; height: 80px; border-radius: 12px; font-size: 34px; font-family: var(--police-titre); font-weight: 700; }
.bouton-icone { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--bord); background: transparent; color: var(--texte-doux); cursor: pointer; }
.bouton-icone:hover { color: var(--texte); border-color: #3A3150; }

.main { flex: 999 1 560px; min-width: 0; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 24px; }
@media (max-width: 700px) { .main { padding: 20px 16px 40px; } .nav { padding: 16px; gap: 16px; } }

.entete { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.entete .titres { display: flex; flex-direction: column; gap: 2px; margin-right: auto; }
.retour { font-size: 13px; color: var(--texte-doux); text-decoration: none; display: flex; align-items: center; gap: 6px; min-height: 44px; }

/* ------------------------------------------------------------------ éléments */
.recherche { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 10px; background: var(--panneau); border: 1px solid var(--bord); flex: 0 1 320px; color: var(--texte-doux); margin: 0; }
.recherche.creuse { background: var(--fond); }
.recherche.large { flex: 1 1 260px; }
.recherche input, .recherche select { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--texte); font: inherit; outline: none; }
.recherche select { flex: none; }
.recherche select option { background: var(--panneau); }
.recherche:focus-within { border-color: var(--violet); }

.etat-envoi { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; border-radius: 10px; background: var(--vert-fond); border: 1px solid rgba(63,191,90,.35); }
.etat-envoi .point { width: 8px; height: 8px; border-radius: 50%; background: var(--vert); }
.etat-envoi strong { font-weight: 600; color: var(--vert-texte); }
.etat-envoi.ko { background: var(--rouge-fond); border-color: rgba(224,52,43,.45); }
.etat-envoi.ko .point { background: var(--rouge); }
.etat-envoi.ko strong { color: var(--rouge-texte); }

.carte { background: var(--panneau); border: 1px solid var(--bord); border-radius: var(--rayon-carte); padding: 20px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.carte.serre { gap: 12px; }
.carte.tres-serre { gap: 8px; }
.carte.creuse { background: var(--panneau-creux); border-style: dashed; gap: 12px; }
.carte.alerte-rouge { border-color: rgba(224,52,43,.4); }
.carte-titre { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.carte-titre h2 { margin-right: auto; }
.carte-titre.centre { align-items: center; gap: 12px; }

.grille { display: grid; gap: 16px; }
.g-serveurs { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.g-460 { grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr)); }
.g-440 { grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr)); }
.g-520 { grid-template-columns: repeat(auto-fit, minmax(min(520px, 100%), 1fr)); align-items: start; }
.g-stats { grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); }
.g-stats-200 { grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
.g-stats-220 { grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.g-mini { grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 12px; }
.colonne { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.stat { background: var(--panneau); border: 1px solid var(--bord); border-radius: var(--rayon-carte); padding: 18px; display: flex; flex-direction: column; gap: 4px; }
.stat.rouge-bord { border-color: rgba(224,52,43,.4); }
.stat .libelle { font-size: 12px; color: var(--texte-doux); }
.stat .valeur { font-family: var(--police-titre); font-size: 30px; font-weight: 600; line-height: 1.25; }
.stat .valeur.moyenne { font-size: 26px; }
.stat .note { font-size: 12px; color: var(--texte-doux); }

.bloc { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 10px; background: var(--panneau-creux); min-width: 0; }
.bloc .valeur { font-family: var(--police-titre); font-size: 24px; font-weight: 600; }
.bloc-ligne { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--panneau-creux); }

/* Serveurs */
.serveur-tete { display: flex; align-items: center; gap: 10px; }
.serveur-tete .meta { margin-left: auto; font-size: 12px; color: var(--texte-doux); }
.voyant { width: 10px; height: 10px; border-radius: 50%; background: var(--vert); flex: none; }
.voyant.eteint { background: transparent; border: 2px solid var(--texte-faible); }
.voyant.orange { background: var(--jaune); }
.joueurs-ligne { display: flex; align-items: baseline; gap: 8px; }
.joueurs-ligne .nb { font-family: var(--police-titre); font-size: 40px; font-weight: 600; line-height: 1; }
.joueurs-ligne .tps { margin-left: auto; font-family: var(--police-code); font-size: 13px; }
.jauges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.jauge { display: flex; flex-direction: column; gap: 6px; }
.jauge .libelle { font-size: 12px; color: var(--texte-doux); }
.piste { height: 6px; border-radius: 3px; background: var(--bord); overflow: hidden; }
.piste.epaisse { height: 8px; border-radius: 4px; }
.piste.large { height: 10px; border-radius: 3px; background: var(--separateur); }
.piste > div { height: 100%; border-radius: inherit; background: var(--violet); }
.piste > div.vert { background: var(--vert); }
.piste > div.jaune { background: var(--jaune); }
.chiffres { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; font-size: 12px; color: var(--texte-doux); }
.chiffres dd, .chiffres .v { color: var(--texte); font-family: var(--police-code); font-size: 14px; }
.chiffres.trois { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.chiffres.trois .v { font-size: 15px; }
.avertissement { margin: 0; font-size: 12px; color: var(--jaune); display: flex; gap: 6px; align-items: flex-start; }
.avertissement svg { flex: none; margin-top: 2px; }

/* Plages min / moyenne / max */
.plages { display: flex; flex-direction: column; gap: 14px; }
.plage { display: grid; grid-template-columns: 96px minmax(0, 1fr) 150px; align-items: center; gap: 14px; }
.plage .rail { position: relative; height: 16px; }
.plage .rail::before { content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 2px; background: var(--bord); }
.plage .trait { position: absolute; top: 6px; height: 4px; border-radius: 2px; background: var(--violet-bouton); }
.plage .point { position: absolute; top: 2px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--texte); border: 2px solid var(--violet); }
.plage .texte { font-family: var(--police-code); font-size: 12px; color: var(--texte-doux); text-align: right; }
@media (max-width: 560px) { .plage { grid-template-columns: 70px minmax(0, 1fr); } .plage .texte { grid-column: 1 / -1; text-align: left; } }

/* Onglets (liens qui se comportent comme les boutons des maquettes) */
.onglets { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--fond); border-radius: 10px; }
.onglets.cadre { background: var(--panneau); border: 1px solid var(--bord); border-radius: 12px; }
.onglet { display: flex; align-items: center; min-height: 36px; padding: 0 14px; border: 0; border-radius: 7px; font-size: 13px; cursor: pointer; background: transparent; color: var(--texte-doux); text-decoration: none; }
.onglets.cadre .onglet { min-height: 40px; padding: 0 16px; font-size: 14px; border-radius: 8px; }
.onglet:hover { color: var(--texte); }
.onglet[aria-current="true"] { background: var(--bouton-actif); color: var(--texte); font-weight: 500; }

/* Badges */
.badge { justify-self: start; display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; background: var(--violet-fond); color: var(--lien); }
.badge.rouge { background: var(--rouge-fond); color: var(--rouge-texte); }
.badge.jaune { background: var(--jaune-fond); color: var(--jaune); }
.badge.vert { background: var(--vert-fond); color: var(--vert-texte); }
.badge.gris { background: var(--panneau-creux); color: var(--texte-2); }
.badge.fin { font-weight: 500; font-size: 13px; }
.badge-en-ligne { display: inline-flex; align-items: center; gap: 6px; }
.badge-en-ligne::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--vert); }
.puce { font-family: var(--police-code); font-size: 12px; padding: 3px 8px; border-radius: 6px; background: var(--panneau-creux); color: var(--texte-2); display: inline-block; }

/* Listes et lignes */
.alertes .ligne { display: grid; grid-template-columns: 120px 140px minmax(0, 1fr) auto; align-items: center; gap: 16px; min-height: 52px; padding: 6px 0; border-bottom: 1px solid var(--separateur); }
.alertes .ligne:last-child { border-bottom: 0; }
@media (max-width: 760px) { .alertes .ligne { grid-template-columns: 1fr auto; gap: 6px 12px; } .alertes .ligne .texte { grid-column: 1 / -1; } }
.joueur-lien { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 12px; border-radius: 10px; background: var(--panneau-creux); text-decoration: none; color: var(--texte); }
.joueur-lien:hover { background: #1C1726; color: var(--texte); }
.joueur-lien .infos { display: flex; flex-direction: column; margin-right: auto; min-width: 0; }
.ligne-simple { display: flex; align-items: center; gap: 12px; min-height: 40px; border-bottom: 1px solid var(--separateur); }
.ligne-simple:last-child { border-bottom: 0; }
.ligne-simple > :first-child { margin-right: auto; }
.defile { overflow-x: auto; }
.vide { color: var(--texte-doux); }
.vide-graphe { min-height: 220px; border-radius: 10px; border: 1px dashed var(--bord); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 24px; flex: 1; }
.vide-graphe span { color: var(--texte-doux); max-width: 380px; }

/* Barres de répartition */
.repartition { display: grid; grid-template-columns: 150px minmax(0, 1fr) 70px; align-items: center; gap: 12px; }
.repartition .nom { color: var(--texte-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.repartition .val { font-family: var(--police-code); font-size: 12px; color: var(--texte-doux); text-align: right; }
.repartition.source { grid-template-columns: 130px minmax(0, 1fr) 60px; }
.repartition.source .nom { font-family: var(--police-code); font-size: 12px; }
.repartition.source .val { font-size: 13px; color: var(--texte); }

/* IV */
.ivs { display: flex; align-items: flex-end; gap: 4px; height: 32px; }
.ivs span { width: 10px; border-radius: 2px; background: #7C5BC4; display: block; }
.ivs span.haut { background: var(--vert); }
.ivs span.bas { background: var(--rouge); }

/* Frise des sessions */
.frise-axe { display: flex; justify-content: space-between; font-family: var(--police-code); font-size: 12px; color: var(--texte-faible); }
.frise { position: relative; height: 28px; border-radius: 6px; background: var(--panneau-creux); overflow: hidden; }
.frise span { position: absolute; top: 4px; bottom: 4px; min-width: 4px; border-radius: 4px; background: var(--violet); }
.frise span.ouverte { background: var(--vert); }

/* Boutons */
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--bord); background: transparent; color: var(--texte); text-decoration: none; cursor: pointer; font: inherit; }
.bouton:hover { border-color: #3A3150; color: var(--texte); }
.bouton.principal { border: 0; background: var(--violet-bouton); color: #FFFFFF; font-weight: 500; }
.bouton.principal:hover { background: #7C51D6; }
.bouton.ok { border: 1px solid rgba(63,191,90,.4); background: var(--vert-fond); color: var(--vert-texte); }
.bouton.danger { border-color: rgba(224,52,43,.45); color: var(--rouge-texte); }
.bouton.petit { min-height: 28px; padding: 0 10px; font-size: 12px; border-radius: 6px; color: var(--lien); }
.bouton.grand { min-height: 48px; padding: 0 22px; font-size: 15px; }
.motif { min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid #3A3150; background: #1F1A2B; color: var(--texte); cursor: pointer; }
.motif:hover { border-color: var(--violet); }
.boutons { display: flex; flex-wrap: wrap; gap: 8px; }
form.en-ligne { display: inline; margin: 0; }

/* Encadrés */
.encadre { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; background: rgba(242,194,48,.08); border: 1px solid rgba(242,194,48,.3); }
.encadre.rouge { background: rgba(224,52,43,.08); border-color: rgba(224,52,43,.35); }
.encadre span { flex: 1 1 400px; }
.note-site { margin: 0; max-width: 300px; font-size: 13px; color: var(--texte-doux); padding: 12px 14px; border-radius: 10px; background: var(--panneau-creux); }
.demande-motif { display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: 12px; background: var(--panneau-creux); border: 1px dashed #3A3150; }

/* Fiche joueur */
.fiche-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; background: var(--panneau); border: 1px solid var(--bord); border-radius: 16px; padding: 24px; }
.fiche-tete .infos { display: flex; flex-direction: column; gap: 6px; margin-right: auto; min-width: 0; }
.fiche-tete h1 { font-size: 30px; }
.ligne-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.trophee { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 10px; background: var(--panneau-creux); }
.trophee.porte { background: rgba(242,194,48,.10); border: 1px solid rgba(242,194,48,.3); }
.trophees { display: flex; flex-wrap: wrap; gap: 10px; }
.mods { display: flex; flex-wrap: wrap; gap: 6px; }
details.plus summary { list-style: none; cursor: pointer; display: inline-flex; }
details.plus summary::-webkit-details-marker { display: none; }
details.plus[open] summary { display: none; }
details.plus { display: contents; }

/* Messages (chat) */
.message { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--separateur); }
.message .meta { display: flex; flex-direction: column; font-family: var(--police-code); font-size: 12px; color: var(--texte-doux); }
.message .auteur { font-weight: 500; color: var(--lien); }
.message .auteur a { color: inherit; text-decoration: none; }

/* Graphiques */
.graphe { width: 100%; height: auto; display: block; overflow: visible; }
.graphe text { font-family: var(--police-code); font-size: 12px; fill: var(--texte-faible); }
.graphe .grille-ligne { stroke: var(--separateur); stroke-width: 1; }
.graphe .grille-ligne.verticale { stroke-dasharray: 2 4; }
.graphe .courbe { fill: none; stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.graphe .aire { opacity: .14; }
.graphe .repere { stroke-width: 1.25; stroke-dasharray: 6 5; opacity: .8; }
.graphe .repere-texte { font-size: 11px; }
.graphe .trou { fill: rgba(138,131,153,.08); stroke: rgba(138,131,153,.25); stroke-dasharray: 3 3; }
.graphe .survol rect { fill: transparent; }
.graphe .survol circle { opacity: 0; pointer-events: none; }
.graphe .survol:hover rect { fill: rgba(238,234,245,.05); }
.graphe .survol:hover circle { opacity: 1; }

/* Évolution des serveurs : tuiles (maintenant) et graphiques (24 h, 7 jours) */
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 12px; }
.tuile { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 12px; background: var(--panneau-creux); min-width: 0; }
.tuile .libelle { font-size: 12px; color: var(--texte-doux); }
.tuile .valeur { font-family: var(--police-titre); font-size: 26px; font-weight: 600; line-height: 1.15; }
.tuile .valeur .sur { font-size: 15px; color: var(--texte-doux); font-weight: 500; }
.tuile .note { font-size: 12px; color: var(--texte-doux); }
.piste > div.rouge { background: var(--rouge); }
.graphes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr)); gap: 14px; }
.bloc-graphe { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 10px; border-radius: 12px; background: var(--panneau-creux); min-width: 0; }
.bloc-graphe-tete { display: flex; align-items: baseline; gap: 10px; }
.bloc-graphe-tete .fort { margin-right: auto; font-size: 15px; }
.bloc-graphe-tete .actuel { font-family: var(--police-code); font-size: 14px; color: var(--texte); }
.legende { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--texte-doux); }
.legende i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* Pages d'accueil (connexion, 2FA) */
.page-seule { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.boite { width: 100%; max-width: 440px; background: var(--panneau); border: 1px solid var(--bord); border-radius: 16px; padding: 32px 28px; display: flex; flex-direction: column; gap: 18px; }
.boite .logo { display: flex; align-items: center; gap: 10px; }
.boite input[type="text"] { min-height: 52px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--bord); background: var(--fond); color: var(--texte); font-family: var(--police-code); font-size: 24px; letter-spacing: .3em; text-align: center; width: 100%; }
.boite input[type="text"]:focus { border-color: var(--violet); outline: none; }
.boite form { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.qr { background: #FFFFFF; border-radius: 12px; padding: 12px; width: 200px; align-self: center; }
.qr svg { display: block; width: 100%; height: auto; }
.secret { font-family: var(--police-code); font-size: 13px; padding: 10px 12px; border-radius: 8px; background: var(--panneau-creux); color: var(--texte-2); overflow-wrap: anywhere; user-select: all; }
.message-erreur { color: var(--rouge-texte); }

select.role { background: var(--fond); color: var(--texte); border: 1px solid var(--bord); border-radius: 8px; min-height: 36px; padding: 0 8px; font: inherit; }

/* News du launcher */
.news-ligne { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 16px; padding: 14px 0; border-bottom: 1px solid var(--separateur); }
.news-ligne:last-child { border-bottom: 0; }
.news-ligne details summary { cursor: pointer; color: var(--lien); width: fit-content; }
.champ { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--texte-doux); }
.champ input, .champ textarea { min-height: 44px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--bord); background: var(--fond); color: var(--texte); font: inherit; font-size: 14px; width: 100%; }
.champ input:focus, .champ textarea:focus { border-color: var(--violet); outline: none; }
.champ input[type="datetime-local"] { color-scheme: dark; }
textarea.editeur { font-family: var(--police-code); font-size: 13px; line-height: 1.55; resize: vertical; min-height: 360px; tab-size: 2; }
.apercu-tete { display: flex; flex-direction: column; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid var(--separateur); }
.apercu-news { padding: 4px 2px; color: var(--texte-2); overflow-wrap: anywhere; }
.apercu-news h1, .apercu-news h2, .apercu-news h3, .apercu-news h4 { color: var(--texte); margin: 14px 0 6px; }
.apercu-news h2 { font-size: 20px; }
.apercu-news h3 { font-size: 16px; }
.apercu-news p { margin: 0 0 10px; }
.apercu-news ul, .apercu-news ol { margin: 0 0 10px; padding-left: 22px; }
.apercu-news li { margin: 3px 0; }
.apercu-news strong, .apercu-news b { color: var(--texte); }
.apercu-news code { font-family: var(--police-code); font-size: 12px; background: var(--panneau-creux); padding: 1px 5px; border-radius: 4px; }
.apercu-news img { max-width: 100%; border-radius: 8px; }
.apercu-news blockquote { margin: 0 0 10px; padding-left: 12px; border-left: 3px solid var(--violet); }

/* Éditeur de news */
.g-news { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(520px, 100%), 1fr)); align-items: start; }
.colle { position: sticky; top: 16px; }
.ed { display: flex; flex-direction: column; border: 1px solid var(--bord); border-radius: 12px; background: var(--fond); overflow: visible; }
.ed:focus-within { border-color: var(--violet); }
.ed-barre { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border-bottom: 1px solid var(--bord); background: var(--panneau-creux); border-radius: 12px 12px 0 0; position: sticky; top: 0; z-index: 2; }
.ed-groupe { display: flex; gap: 2px; padding-right: 6px; margin-right: 0; border-right: 1px solid var(--bord); align-items: center; }
.ed-groupe:last-child, .ed-groupe.ed-droite { border-right: 0; }
.ed-droite { margin-left: auto; }
.ed-bouton { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; min-width: 32px; padding: 0 9px; border: 0; border-radius: 7px; background: transparent; color: var(--texte-2); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; list-style: none; }
.ed-bouton::-webkit-details-marker { display: none; }
.ed-bouton:hover { background: var(--actif); color: var(--texte); }
.ed-bouton[aria-pressed="true"] { background: var(--bouton-actif); color: var(--texte); }
.ed-bouton[disabled] { opacity: .35; pointer-events: none; }
.ed-gras { font-weight: 700; }
.ed-italique { font-style: italic; font-family: Georgia, serif; }
.ed-bloc-h2 { font-family: var(--police-titre); font-weight: 600; }
.ed-bouton.large { justify-content: flex-start; width: 100%; }
.ed-menu { position: relative; }
.ed-menu[open] > summary { background: var(--bouton-actif); color: var(--texte); }
.ed-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 5; min-width: 180px; padding: 6px; border-radius: 10px; background: var(--panneau); border: 1px solid var(--bord); box-shadow: 0 12px 30px rgba(0,0,0,.45); display: flex; flex-direction: column; gap: 2px; }
.ed-pop.ed-emojis { display: grid; grid-template-columns: repeat(5, 36px); min-width: 0; }
.ed-pop.ed-emojis .ed-bouton { font-size: 18px; padding: 0; }
.ed-zone { min-height: 380px; max-height: 70vh; overflow-y: auto; padding: 16px 20px; outline: none; cursor: text; }
.ed-zone:empty::before { content: "Écris ta news ici… (ou pars d'un modèle)"; color: var(--texte-faible); }
.ed-zone img { cursor: default; }
.ed + textarea.editeur { border-radius: 12px; }
textarea.editeur[hidden] { display: none; }
.ed-pied { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--texte-faible); }

/* Aperçu au style du launcher (panneau « verre fumé », titres blancs, puces rouges, liens rose) */
.apercu-launcher { border-radius: 14px; overflow: hidden; background: linear-gradient(160deg, rgba(40, 24, 30, .92), rgba(12, 10, 16, .96)); border: 1px solid rgba(255,255,255,.08); font-family: "Segoe UI", "Avenir", system-ui, sans-serif; }
.al-tete { padding: 18px 26px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.al-titre { font-size: 20px; font-weight: 700; line-height: 1.25; color: #fff; overflow-wrap: anywhere; }
.al-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.al-chip { font-size: 10px; padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,.10); color: rgba(255,255,255,.85); }
.al-chip:empty { display: none; }
.al-chip.auteur { background: rgba(229,72,77,.22); color: #ffb3b5; }
.al-contenu { font-size: 13px; line-height: 1.6; color: rgba(255,255,255,.88); overflow-wrap: anywhere; }
.apercu-launcher .al-contenu { padding: 4px 26px 20px; max-height: 70vh; overflow-y: auto; }
.al-contenu h1, .al-contenu h2 { font-size: 17px; color: #fff; margin: 16px 0 8px; font-family: inherit; }
.al-contenu h3 { font-size: 14.5px; color: #fff; margin: 20px 0 6px; font-family: inherit; }
.al-contenu p { margin: 0 0 10px; }
.al-contenu ul, .al-contenu ol { margin: 0 0 12px; padding-left: 20px; }
.al-contenu li { margin: 4px 0; }
.al-contenu li::marker { color: #e5484d; }
.al-contenu strong { color: #fff; }
.al-contenu hr { border: none; border-top: 1px solid rgba(255,255,255,.12); margin: 18px 0; }
.al-contenu img { max-width: 100%; display: block; margin: 12px auto; border-radius: 8px; }
.al-contenu a { color: #ff9a9d; }
.al-contenu code { font-family: var(--police-code); font-size: 12px; background: rgba(255,255,255,.08); padding: 1px 5px; border-radius: 4px; }
.al-contenu blockquote { margin: 0 0 10px; padding-left: 12px; border-left: 3px solid #e5484d; }
.ed-zone.al-contenu { background: linear-gradient(160deg, rgba(40, 24, 30, .55), rgba(12, 10, 16, .7)); border-radius: 0 0 12px 12px; font-size: 14px; }
@media (max-width: 1100px) { .colle { position: static; } }

/* Factions : données reçues sans format fixé */
dl.paires { display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); gap: 6px 16px; margin: 0; font-size: 13px; }
dl.paires dt { color: var(--texte-doux); font-family: var(--police-code); font-size: 12px; }
dl.paires dd { margin: 0; overflow-wrap: anywhere; }
pre.json { margin: 10px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--fond); border: 1px solid var(--bord); font-family: var(--police-code); font-size: 12px; color: var(--texte-2); max-height: 480px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.bouton[disabled] { opacity: .45; cursor: not-allowed; pointer-events: none; }
