/* FiveNext — thème des logos de Simon (17/11/2026) : noir profond, argent, bleu lumineux,
   lignes diagonales. Couleurs relevées dans la planche des logos : bleu #3581DC, argent #E5E6E8. */
:root {
  --fond: #040507;
  --fond-2: #0a0c11;
  --fond-3: #10131a;
  --bord: #1a1f2b;
  --bord-fort: #2a3142;
  --texte: #e5e6e8;
  --texte-2: #9ba1ad;
  --texte-3: #646b78;
  --bleu: #3581dc;
  --bleu-vif: #4d97f0;
  --bleu-halo: rgba(53, 129, 220, 0.35);
  --argent: linear-gradient(180deg, #f4f5f7 0%, #c9ccd2 55%, #9ea3ab 100%);
  --vert: #3ecf6a;
  --rouge: #e5484d;
  --orange: #e5a83e;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--texte);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background-color: var(--fond);
}

/* Fond : halo bleu en bas à gauche et fines diagonales, comme sur les visuels. */
body {
  background:
    radial-gradient(900px 520px at -8% 108%, rgba(53, 129, 220, 0.20), transparent 62%),
    radial-gradient(700px 420px at 108% -10%, rgba(53, 129, 220, 0.08), transparent 60%),
    repeating-linear-gradient(118deg, transparent 0 140px, rgba(255, 255, 255, 0.018) 140px 141px),
    var(--fond);
  background-attachment: fixed;
}

/* ─── Boutons ─── */
.bouton {
  display: inline-block;
  border: 1px solid var(--bord-fort);
  border-radius: 8px;
  padding: 10px 18px;
  background: rgba(16, 19, 26, 0.85);
  color: var(--texte);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.bouton:hover { border-color: #3a4357; }
.bouton:focus-visible { outline: 2px solid var(--bleu-vif); outline-offset: 2px; }
.bouton:disabled { opacity: 0.5; cursor: not-allowed; }
.bouton-cfx {
  background: linear-gradient(180deg, var(--bleu-vif), var(--bleu));
  border-color: var(--bleu);
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 24px -8px var(--bleu-halo), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.bouton-cfx:hover { box-shadow: 0 8px 30px -6px rgba(77, 151, 240, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.bouton-discret { padding: 6px 12px; font-size: 13px; color: var(--texte-2); }
.bouton-petit { padding: 6px 12px; font-size: 13px; }
.bouton-vert { border-color: rgba(62, 207, 106, 0.5); color: var(--vert); }
.bouton-vert:hover:not(:disabled) { background: rgba(62, 207, 106, 0.1); border-color: var(--vert); }
.bouton-danger { border-color: rgba(229, 72, 77, 0.5); color: var(--rouge); }
.bouton-danger:hover:not(:disabled) { background: rgba(229, 72, 77, 0.1); border-color: var(--rouge); }

/* ─── Connexion ─── */
.connexion {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}
.carte-connexion {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, rgba(16, 19, 26, 0.92), rgba(8, 10, 14, 0.92));
  border: 1px solid var(--bord);
  border-radius: 16px;
  padding: 40px 30px 32px;
  text-align: center;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  overflow: hidden;
}
.carte-connexion::before {
  /* fine ligne bleue en haut de la carte, comme le trait de vitesse du logo */
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--bleu), transparent);
  opacity: 0.8;
}
.logo-grand { display: block; width: 100%; max-width: 320px; height: auto; margin: 0 auto; }
.sous-titre {
  color: var(--texte-2);
  margin: 14px 0 28px;
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}
.message {
  margin: 18px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(229, 72, 77, 0.12);
  color: #f4a3a6;
  font-size: 14px;
}
.aide { color: var(--texte-3); font-size: 12.5px; margin: 22px 0 0; }

/* ─── Application ─── */
.entete {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(6, 8, 11, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bord);
  box-shadow: 0 1px 0 rgba(53, 129, 220, 0.12);
}
.logo-entete { display: block; height: 26px; width: auto; }
.entete-droite { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 28px; height: 28px; border-radius: 50%; box-shadow: 0 0 0 1px var(--bord-fort); }
.moi { color: var(--texte-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.contenu { max-width: 1100px; margin: 0 auto; padding: 28px 20px 48px; }
.titre-ligne { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.titre-ligne h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--texte);
}
.maj { color: var(--texte-3); font-size: 13px; margin-left: auto; }

.machine { margin-top: 26px; }
.machine-titre {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--texte-2);
  text-transform: uppercase;
  letter-spacing: 0.22em;
}
.pastille-agent {
  font-size: 11px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  padding: 2px 8px;
  border-radius: 999px;
}
.pastille-agent.en-ligne { background: rgba(62, 207, 106, 0.12); color: var(--vert); }
.pastille-agent.hors-ligne { background: rgba(229, 72, 77, 0.12); color: var(--rouge); }

.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.carte {
  position: relative;
  background: linear-gradient(180deg, rgba(16, 19, 26, 0.95), rgba(10, 12, 17, 0.95));
  border: 1px solid var(--bord);
  border-radius: 12px;
  padding: 18px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.carte::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--bleu), transparent 70%);
  opacity: 0.55;
}
.carte:hover { border-color: #283044; box-shadow: 0 10px 34px -18px var(--bleu-halo); }
.carte-nom { margin: 0; font-size: 16px; font-weight: 600; }
.carte-jeu { color: var(--texte-3); font-size: 12px; margin-top: 2px; letter-spacing: 0.12em; text-transform: uppercase; }
.carte-etat { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 14px; }
.point { width: 9px; height: 9px; border-radius: 50%; background: var(--texte-3); flex: none; }
.etat-actif .point { background: var(--vert); box-shadow: 0 0 0 3px rgba(62, 207, 106, 0.15), 0 0 10px rgba(62, 207, 106, 0.5); }
.etat-arrete .point, .etat-echec .point { background: var(--rouge); }
.etat-demarrage .point, .etat-arret .point { background: var(--orange); }
.carte-erreur { margin-top: 8px; color: var(--texte-3); font-size: 12.5px; }
.vide { color: var(--texte-3); }

/* ─── Actions sur une carte ─── */
.carte-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.carte-occupe { color: var(--orange); font-size: 12.5px; }

/* ─── Avis (résultat d'une action) ─── */
.avis {
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid var(--bord);
  border-left: 3px solid var(--bleu);
  border-radius: 10px;
  background: var(--fond-2);
}
.avis-succes { border-left-color: var(--vert); }
.avis-erreur { border-left-color: var(--rouge); }
.avis-ligne { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.avis-sortie,
.journaux-texte {
  margin: 10px 0 0;
  overflow: auto;
  padding: 10px 12px;
  background: #020304;
  border: 1px solid var(--bord);
  border-radius: 8px;
  font: 12.5px/1.45 ui-monospace, "Cascadia Mono", Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}
.avis-sortie { max-height: 220px; color: var(--texte-2); }

/* ─── Journaux en direct ─── */
.panneau-journaux {
  margin-top: 28px;
  background: var(--fond-2);
  border: 1px solid var(--bord);
  border-radius: 12px;
  padding: 14px;
}
.panneau-entete { display: flex; align-items: center; gap: 12px; }
.panneau-entete h3 { margin: 0; font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; }
.journaux-texte { height: 420px; color: var(--texte); }
.journaux-texte:focus-visible { outline: 2px solid var(--bleu-vif); outline-offset: 2px; }

/* ─── Fenêtre de confirmation ─── */
.confirmation {
  max-width: 420px;
  width: calc(100% - 32px);
  padding: 22px;
  border: 1px solid var(--bord-fort);
  border-radius: 14px;
  background: var(--fond-2);
  color: var(--texte);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.9);
}
.confirmation::backdrop { background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(2px); }
.confirmation h3 { margin: 0 0 8px; font-size: 17px; }
.confirmation-avertissement { margin: 0; color: var(--texte-2); }
.confirmation-boutons { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

@media (max-width: 520px) {
  .entete { padding: 10px 16px; }
  .logo-entete { height: 22px; }
  .contenu { padding: 18px 16px 40px; }
  .moi { display: none; }
  .carte-connexion { padding: 32px 20px 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .bouton, .carte { transition: none; }
}
