:root {
  --fond: #15121c;
  --carte: #1f1a29;
  --bord: #342b45;
  --texte: #eee8f7;
  --doux: #a99cc0;
  --violet: #b38cff;
  --violet-fort: #8e5cf0;
  --rouge: #ff6b81;
  --vert: #5fd39a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--violet); }
h1 { font-size: 1.6rem; margin: 0.4em 0 0.8em; }
h2 { font-size: 1.15rem; margin: 0 0 0.2em; }

.barre {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.8rem 1.4rem; border-bottom: 1px solid var(--bord); background: #1a1623;
}
.marque { color: var(--texte); font-weight: 700; text-decoration: none; font-size: 1.1rem; }
.moi { display: flex; align-items: center; gap: 0.6rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--bord); }
.nom { font-weight: 600; }

.page { max-width: 860px; margin: 0 auto; padding: 1.4rem; }
.chargement { color: var(--doux); }

.carte {
  background: var(--carte); border: 1px solid var(--bord); border-radius: 14px;
  padding: 1.2rem 1.4rem; margin-bottom: 1.2rem;
}
.accueil { text-align: center; padding: 2.4rem 1.4rem; margin-top: 2rem; }
.sous-titre { color: var(--doux); margin: 0 0 1rem; }
.aide { color: var(--doux); font-size: 0.88rem; }
.info { background: #2a2140; border-left: 4px solid var(--violet); padding: 0.8rem 1rem; border-radius: 8px; }
.alerte { background: #3a1d27; border-left: 4px solid var(--rouge); padding: 0.8rem 1rem; border-radius: 8px; }

.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.serveur {
  display: flex; align-items: center; gap: 0.8rem; padding: 1rem;
  background: var(--carte); border: 1px solid var(--bord); border-radius: 14px;
  color: var(--texte); text-decoration: none;
}
.serveur:hover, .serveur:focus-visible { border-color: var(--violet); }
.icone { width: 44px; height: 44px; border-radius: 50%; flex: none; display: inline-grid; place-items: center; background: var(--bord); font-weight: 700; }
.nom-serveur { font-weight: 600; flex: 1; }
.badge { font-size: 0.75rem; color: var(--doux); border: 1px solid var(--bord); border-radius: 999px; padding: 0.1rem 0.5rem; }
.titre-serveur { display: flex; align-items: center; gap: 0.7rem; }
.retour { display: inline-block; margin-bottom: 0.4rem; text-decoration: none; }

.champs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.9rem 1.2rem; margin-bottom: 0.9rem; }
.champ { display: flex; flex-direction: column; gap: 0.3rem; }
.etiquette { font-weight: 600; font-size: 0.92rem; }
input[type="text"], input[type="number"], select, textarea {
  width: 100%; padding: 0.55rem 0.7rem; border-radius: 8px;
  border: 1px solid var(--bord); background: #15121c; color: var(--texte); font: inherit;
}
textarea { resize: vertical; min-height: 5rem; }
input[type="text"]:focus, input[type="number"]:focus, select:focus, textarea:focus { outline: 2px solid var(--violet); outline-offset: 1px; }
.carte > .champ { margin-bottom: 0.9rem; }
.carte h3 { font-size: 1rem; margin: 0.4rem 0 0.5rem; }
.actions + .aide { margin-top: 0.6rem; }
.aide + .actions, .actions + .actions { margin-top: 0.6rem; }
.case { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.9rem; }
.case input { width: 18px; height: 18px; accent-color: var(--violet-fort); }

.actions { display: flex; gap: 0.7rem; flex-wrap: wrap; }
button, .bouton {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 8px;
  padding: 0.55rem 1.1rem; border: 1px solid transparent; text-decoration: none; display: inline-block;
}
.principal { background: var(--violet-fort); color: #fff; }
.principal:hover { background: #7a48dd; }
.secondaire { background: transparent; color: var(--texte); border-color: var(--bord); }
.secondaire:hover { border-color: var(--rouge); color: var(--rouge); }
.petit { padding: 0.25rem 0.7rem; font-size: 0.85rem; }
.lien { background: none; border: none; color: var(--doux); padding: 0.3rem; font-weight: 400; text-decoration: underline; }
button:disabled { opacity: 0.6; cursor: wait; }
.accueil .bouton { margin: 1rem 0; font-size: 1.05rem; padding: 0.75rem 1.5rem; }

.liste { margin: 0 0 1rem; padding-left: 1.2rem; }
.liste li { margin: 0.25rem 0; }
.amis { list-style: none; padding: 0; }
.amis li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.4rem 0; border-bottom: 1px solid var(--bord); }

.toast {
  position: fixed; left: 50%; bottom: 1.4rem; transform: translate(-50%, 150%);
  background: #2a3b31; border: 1px solid var(--vert); color: var(--texte);
  padding: 0.7rem 1.2rem; border-radius: 10px; transition: transform 0.25s, visibility 0.25s; max-width: 90vw;
  visibility: hidden;
}
.toast.visible { transform: translate(-50%, 0); visibility: visible; }
.toast.erreur { background: #3a1d27; border-color: var(--rouge); }

@media (max-width: 560px) {
  .barre { padding: 0.7rem 1rem; }
  .nom { display: none; }
  .page { padding: 1rem; }
}
