@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@500;600;700&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ============================================================
   ACIER — thème CLAIR (défaut)
   ============================================================ */
:root,
[data-theme="light"] {
  /* Surfaces (du fond le plus profond au plus clair) */
  --bg:        #e7e9ed;   /* fond de page */
  --bg-2:      #dadde2;   /* fond enfoncé : sidebar, inputs, zones creuses */
  --panel:     #f5f6f8;   /* cartes, panneaux, header */
  --panel-2:   #e9ebee;   /* survol / état actif d'une carte */

  /* Bordures */
  --line:      #d2d6dc;   /* séparateurs discrets */
  --line-2:    #bcc2cb;   /* bordures de contrôles (boutons, inputs, cartes) */

  /* Texte */
  --txt:       #1c2127;   /* titres, texte fort */
  --txt-2:     #576069;   /* texte secondaire, descriptions */
  --txt-3:     #88909a;   /* labels, méta, placeholders */
  --read:      #2a3038;   /* corps de lecture long (règles, missions) */

  /* Accent (bleu acier) */
  --accent:    #2f6f8f;
  --accent-b:  #235870;   /* variante foncée : survol, focus */
  --accent-rgb:47,111,143;/* pour les rgba() de halo/teinte */
  --on-accent: #ffffff;   /* texte/icône POSÉ sur un aplat d'accent */

  /* Sémantique */
  --success:   #2f885f;   /* « Disponible », validé */
  --danger:    #bf463b;   /* erreur, suppression, disposition ADVERSE */
  --badge-new: #b5851f;   /* pastille « NEW » — ambre, identique aux 2 thèmes */

  /* Ambiance (effets décoratifs, optionnels) */
  --bar:       rgba(245,246,248,.9);  /* fond du header sticky (avec blur) */
  --scanline:  0;                     /* 0 = pas de scanlines en clair */
  --glow:      rgba(47,111,143,.06);  /* halo radial discret en haut */

  /* --- Alias de compatibilité (anciens noms du site) --- */
  --panel2: var(--panel-2);
  --text:   var(--txt);
  --muted:  var(--txt-2);
  --muted2: var(--txt-3);
  --accent2: var(--accent-b);
  --gold:     var(--badge-new);
  --gold-dim: var(--badge-new);

  /* Tokens structurels (inchangés) */
  --radius:  12px;
  --radius2: 8px;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  --font: 'IBM Plex Sans', 'Noto Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --font-display: 'Chakra Petch', 'Space Grotesk', 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* ============================================================
   COGITATOR AMBRE — thème SOMBRE
   ============================================================ */
[data-theme="dark"] {
  --bg:        #0c0b08;
  --bg-2:      #141109;
  --panel:     #17140e;
  --panel-2:   #1f1a12;

  --line:      #2b2519;
  --line-2:    #3c3322;

  --txt:       #ece5d4;
  --txt-2:     #bcb19a;
  --txt-3:     #857a66;
  --read:      #ddd6c6;

  --accent:    #e3a83a;
  --accent-b:  #f6c659;
  --accent-rgb:227,168,58;
  --on-accent: #1a1408;   /* texte SOMBRE sur l'ambre clair */

  --success:   #5bbf8f;
  --danger:    #d2554a;
  --badge-new: #e3a83a;

  --bar:       rgba(12,11,8,.86);
  --scanline:  .45;        /* léger effet CRT en sombre (optionnel) */
  --glow:      rgba(227,168,58,.06);

  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 0;
}

/* Effet « cogitator » optionnel : scanlines pilotées par --scanline
   (0 en clair, .45 en sombre — un seul overlay, aucune duplication). */
.crt-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: overlay;
  opacity: var(--scanline);
  background: repeating-linear-gradient(0deg,
    transparent, transparent 2px, rgba(0, 0, 0, .16) 3px, transparent 4px);
}

.container {
  width: 100%;
  margin: 0 auto;
}

h1 {
  text-align: center;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 2.2em;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.subtitle {
  text-align: center;
  margin-bottom: 20px;
  color: var(--muted2);
  font-size: 12px;
}

.subtitle a {
  color: var(--muted2);
  text-decoration: none;
}

.subtitle a:hover {
  color: var(--accent);
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* évite tout débordement horizontal dû au full-bleed du header (100vw) */
  overflow-x: clip;
}

.page > .container {
  flex: 1;
}

/* ══════════════════════════════════════════════════════════════
   TOP BAR — barre fine sticky « cogitator », inspirée de la maquette
   ══════════════════════════════════════════════════════════════ */
.shared-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bar);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  /* Full-bleed : la barre s'étend bord à bord et ignore le padding du
     wrapper .page (qui varie selon l'app : index, dominatus, datasheet…).
     Le contenu reste borné à 1180px et centré via .shared-header__inner,
     donc identique à l'index sur toutes les pages. */
  width: 100vw;
  margin-left: calc(50% - 50vw);
}

.shared-header__inner {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 11px 22px;
  max-width: 1180px;
  margin: 0 auto;
}

/* ── Marque (logo bracketé + wordmark + kicker) ── */
.sh-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--txt);
}

.sh-brand__mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.sh-brand__mark-txt {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  line-height: 1;
  color: var(--accent);
}
.sh-brand__tick {
  position: absolute;
  width: 6px;
  height: 6px;
}
.sh-brand__tick--tl { top: -1px; left: -1px; border-top: 1px solid var(--accent-b); border-left: 1px solid var(--accent-b); }
.sh-brand__tick--br { bottom: -1px; right: -1px; border-bottom: 1px solid var(--accent-b); border-right: 1px solid var(--accent-b); }

.sh-brand__word {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
}
.sh-brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.5px;
}
.sh-brand__accent { color: var(--accent); }
.sh-brand__kicker {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--txt-3);
  text-transform: uppercase;
}

/* ── Fil d'Ariane ── */
.sh-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--txt-3);
}
.sh-crumb__chev { color: var(--accent); }
.sh-crumb__txt { color: var(--txt-2); }

/* Sous-titre retiré de la barre : redondant avec le fil d'Ariane et le
   titre/hero de chaque page. Le retirer libère la place pour garder les
   actions sur une seule ligne → hauteur de header identique partout. */
.shared-header__subtitle { display: none; }

/* ── Actions (liens + toggle + auth) ──
   margin-left:auto pousse le bloc à droite et l'y maintient même quand
   il passe à la ligne (wrap) sur les pages chargées (liens + auth). */
.shared-header__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.shared-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  justify-content: flex-end;
}

.shared-header__auth {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shared-header__auth-user {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-2);
  padding: 5px 10px;
  border: 1px solid var(--line-2);
}

.shared-header__auth-user[hidden] { display: none; }
.shared-header__auth-link[hidden] { display: none; }

.shared-header__auth-name {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--txt);
}

.shared-header__links a,
.shared-header__auth-link {
  color: var(--txt-2);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.3px;
  padding: 7px 11px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.shared-header__auth-link:hover,
.shared-header__links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--panel-2);
}

.shared-header__auth-button { font: inherit; }

.header-theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--txt-2);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}
.header-theme-btn:hover {
  background: var(--panel-2);
  border-color: var(--accent);
  color: var(--accent);
}
.header-theme-btn .material-symbols-outlined {
  font-size: 19px;
}
