﻿/* WhealthSpan — Feuille de style principale */

:root {
  /* Fonds — noir profond Finary */
  --bg:        #080a0f;
  --bg2:       #0e1117;
  --bg3:       #161b26;
  --bg4:       #1c2232;

  /* Bordures */
  --border:    rgba(255,255,255,0.07);
  --border-hi: rgba(255,255,255,0.14);

  /* Texte */
  --text:      #f0f2fa;
  --text-dim:  #5a6280;
  --text-mid:  #8b93b8;

  /* Accents */
  --gold:      #f5a623;
  --gold-dim:  rgba(245,166,35,0.12);
  --green:     #22c55e;
  --red:       #ef4444;
  --cyan:      #38bdf8;
  --purple:    #a78bfa;
  --blue:      #3b82f6;
  --yellow:    #f5a623;   /* compat anciens usages */

  /* Rayons et ombres */
  --radius:    14px;
  --radius-sm: 8px;
  --shadow:    0 8px 40px rgba(0,0,0,0.6);
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.4);
  --glow-gold: 0 0 24px rgba(245,166,35,0.18);

  --font: 'Inter', system-ui, sans-serif;

  /* ── V1.1 — Échelle typographique (refonte UX) ──
     Remplacer progressivement les font-size littéraux par ces variables.
     xs labels discrets · sm texte secondaire · md body · lg sous-titres
     xl titres · 2xl chiffres patrimoine · 3xl écran fin de partie */
  --fs-xs:  11px;
  --fs-sm:  13px;
  --fs-md:  15px;
  --fs-lg:  18px;
  --fs-xl:  24px;
  --fs-2xl: 32px;
  --fs-3xl: 48px;

  /* ── V1.2 — Hiérarchie z-index (ne plus utiliser de valeurs littérales) ── */
  --z-base:              1;
  --z-header:            100;
  --z-dropdown:          500;
  --z-modal:             1000;
  --z-toast:             2000;
  --z-overlay-critical:  3000;  /* événements fiscaux, fin de partie, tutoriel */

  /* ── V1.2 — Sémantique des couleurs (documentation) ──
     --green  : gain positif, validation action, liberté financière
     --red    : perte, alerte critique, faillite, revenus passifs négatifs
     --yellow : attention, action requise, mention nuancée (⚠️)
     --gold   : marque WhealthSpan, titre principal, score maximum (🏆)
     --cyan   : information neutre, lien, focus ring, chiffre informatif
     --purple : fiscalité, impôts, IFI, PER
     --blue   : profil Débutant, info secondaire */
}

/* ═══════════════════════════════════════════════════════
   V4.1 — Thème clair (toggle 🌙/☀️)
   Objectif : confort en salle éclairée / formation / projection.
   Activation : <html data-theme="light">
   ═══════════════════════════════════════════════════════ */
[data-theme="light"] {
  /* Fonds — blanc doux, hiérarchie inversée */
  --bg:        #f8fafc;
  --bg2:       #ffffff;
  --bg3:       #f1f5f9;
  --bg4:       #e2e8f0;

  /* Bordures — gris clair visible */
  --border:    rgba(15,23,42,0.10);
  --border-hi: rgba(15,23,42,0.20);

  /* Texte — noir doux, contraste AA */
  --text:      #0f172a;
  --text-dim:  #64748b;
  --text-mid:  #475569;

  /* Accents — versions saturées pour contraste sur fond clair */
  --gold:      #b45309;
  --gold-dim:  rgba(180,83,9,0.10);
  --green:     #059669;
  --red:       #dc2626;
  --cyan:      #0891b2;
  --purple:    #7c3aed;
  --blue:      #2563eb;
  --yellow:    #b45309;

  /* Ombres — plus discrètes sur fond clair */
  --shadow:    0 6px 24px rgba(15,23,42,0.10);
  --shadow-sm: 0 2px 8px rgba(15,23,42,0.06);
  --glow-gold: 0 0 18px rgba(180,83,9,0.12);
}

/* Transition douce lors du toggle */
html, body, .card, .sidebar-bloc, .modal-panel, .marches-panel,
.btn, button, input, textarea, select, .patrimoine-item, .stat-item {
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
@media (prefers-reduced-motion: reduce) {
  html, body, .card, .sidebar-bloc, .modal-panel, .marches-panel,
  .btn, button, input, textarea, select, .patrimoine-item, .stat-item {
    transition: none;
  }
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ─── Layout ──────────────────────────────────────────── */

#app { display: flex; flex-direction: column; min-height: 100vh; }

header {
  background: rgba(8,10,15,0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}

header .logo { font-size: 18px; font-weight: 800; color: var(--gold); letter-spacing: -0.5px; flex-shrink: 0; }
header .annee-badge {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--text-dim);
  flex-shrink: 0;
}
header .annee-badge span { color: var(--gold); font-weight: 700; }

/* ─── Bouton Mode Créatif (accueil) ────────────────────── */

.btn-creatif {
  background: linear-gradient(135deg, rgba(167,139,250,.15), rgba(56,189,248,.12));
  border: 1px solid rgba(167,139,250,.4);
  border-radius: 10px;
  color: var(--purple);
  font-size: 13px;
  font-weight: 700;
  padding: 9px 20px;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn-creatif:hover {
  background: linear-gradient(135deg, rgba(167,139,250,.25), rgba(56,189,248,.2));
  border-color: var(--purple);
  transform: translateY(-1px);
}

/* ─── Formulaire Mode Créatif ───────────────────────────── */

.creatif-container {
  max-width: 840px;
  width: 100%;
}
.creatif-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 14px;
}
.creatif-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.creatif-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.creatif-field label {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 5px;
  line-height: 1.4;
}
.creatif-field input,
.creatif-field select {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  padding: 7px 10px;
  outline: none;
  font-family: var(--font);
  transition: border-color .15s;
}
.creatif-field input:focus,
.creatif-field select:focus { border-color: var(--cyan); }
.creatif-field input[type="date"] { color-scheme: dark; }
.cr-plafond {
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 400;
  font-style: italic;
}

/* ─── Fiche actif — onglets cours ─────────────────────── */

.fiche-onglets { display: flex; gap: 4px; }
.fiche-onglet {
  font-size: 12px; font-weight: 600; padding: 3px 10px;
  border-radius: 6px; border: 1px solid var(--border);
  background: none; color: var(--text-dim); cursor: pointer;
  transition: background .15s, color .15s;
}
.fiche-onglet.actif, .fiche-onglet:hover {
  background: rgba(56,189,248,.12); border-color: var(--cyan); color: var(--cyan);
}

.fiche-cours-stats {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; margin-bottom: 8px;
}
.fiche-stat-item { display: flex; flex-direction: column; align-items: center; }
.fiche-stat-label { font-size: 9px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; }
.fiche-stat-val   { font-size: 13px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

.fiche-periodes { display: flex; gap: 4px; margin-left: auto; }
.fiche-periode {
  font-size: 11px; padding: 2px 8px; border-radius: 5px;
  border: 1px solid var(--border); background: none;
  color: var(--text-dim); cursor: pointer; transition: background .15s, color .15s;
}
.fiche-periode.actif, .fiche-periode:hover {
  background: rgba(56,189,248,.12); border-color: var(--cyan); color: var(--cyan);
}

.sim-date {
  font-size: 12px;
  color: var(--text-dim);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  min-width: 110px;
  text-align: center;
}

/* Flash quand l'année change */
@keyframes flashAnnee {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.14); background: rgba(56,189,248,.18); border-color: var(--cyan); }
  100% { transform: scale(1); }
}
.flash-annee { animation: flashAnnee .4s ease-out; }

/* ─── Barre de progression simulation ──────────────────── */

.sim-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 80px;
  max-width: 260px;
}
.sim-progress-bar {
  position: relative;
  flex: 1;
  height: 6px;
  background: var(--bg3);
  border-radius: 3px;
  overflow: visible;
}
.sim-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  border-radius: 3px;
  transition: width .6s ease;
}
.sim-progress-pulse {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  left: 0;
  transition: left .6s ease;
  animation: pulseGlow 1.2s ease-in-out infinite;
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 5px var(--cyan); opacity: 1; }
  50%       { box-shadow: 0 0 14px var(--cyan); opacity: .7; }
}
.sim-progress-label {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
  min-width: 28px;
  text-align: right;
}

/* ─── Boutons de vitesse ────────────────────────────────── */

.sim-controls {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}
.btn-vitesse {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 9px;
  min-width: 36px;
  min-height: 32px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-vitesse:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-vitesse.vitesse-active {
  background: rgba(56,189,248,.15);
  border-color: var(--cyan);
  color: var(--cyan);
}

/* ─── Bouton Marchés ────────────────────────────────────── */

.btn-marches {
  background: rgba(56,189,248,.10);
  border: 1px solid rgba(56,189,248,.28);
  border-radius: 8px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
}
.btn-marches:hover { background: rgba(56,189,248,.2); border-color: var(--cyan); }

/* ─── P&L Badge (portefeuille) ──────────────────────────── */

.pnl-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255,255,255,.05);
  margin-right: 5px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ─── Actions portefeuille ──────────────────────────────── */

.portef-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.btn-danger {
  background: rgba(240,82,82,.12);
  border: 1px solid rgba(240,82,82,.35);
  border-radius: 8px;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  cursor: pointer;
  transition: background .15s;
}
.btn-danger:hover { background: rgba(240,82,82,.22); }

/* ─── Panel Marchés ─────────────────────────────────────── */

.marches-overlay {
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.marches-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1080px;
  max-height: 88vh;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.marches-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.marches-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}
.marches-sidebar {
  width: 250px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.marches-cats {
  padding: 8px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.marches-cat-btn {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text-dim);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.marches-cat-btn.actif,
.marches-cat-btn:hover {
  background: rgba(56,189,248,.12);
  border-color: var(--cyan);
  color: var(--cyan);
}
.marches-sidebar-liste {
  flex: 1;
  overflow-y: auto;
  padding: 5px;
}
.marches-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .12s;
}
.marches-row:hover  { background: rgba(255,255,255,.04); }
.marches-row.actif  { background: rgba(56,189,248,.09); }
.marches-row-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.marches-row-nom {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.marches-row-ticker { font-size: 10px; color: var(--text-dim); }
.marches-row-prix   { text-align: right; flex-shrink: 0; }
.marches-row-cours  { display: block; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.marches-row-var    { display: block; font-size: 10px; font-variant-numeric: tabular-nums; }

.marches-main {
  flex: 1;
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.marches-main-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}
.marches-stats-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  flex-shrink: 0;
}
.marches-stat         { display: flex; flex-direction: column; }
.marches-stat-lbl     { font-size: 9px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; }
.marches-stat-val     { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ─── Bouton Pause ──────────────────────────────────────── */

.btn-pause {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 18px;
  width: 38px;
  height: 38px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-pause:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-pause.pause-actif {
  background: rgba(56,189,248,.12);
  border-color: var(--cyan);
  color: var(--cyan);
}

/* ─── Barre de contrôles bas ───────────────────────────── */

.sim-barre-controles {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}


.main-layout {
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  gap: 0;
  flex: 1;
  min-height: 0;
}

/* ─── Sidebar gauche ────────────────────────────────────── */

#sidebar-left {
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

/* V2.1 — Blocs accordion sidebar */
.sidebar-bloc {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color .2s;
}
.sidebar-bloc:hover { border-color: var(--border-strong, #2a3042); }
.sidebar-bloc-headline {
  background: linear-gradient(135deg, rgba(34,211,238,0.08), rgba(34,211,238,0.02));
  border-color: rgba(34,211,238,0.25);
}
.sidebar-bloc-label {
  font-size: var(--fs-xs, 11px);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-weight: 600;
}
.sidebar-bloc-chiffre {
  font-size: var(--fs-2xl, 28px);
  font-weight: 800;
  margin-top: 4px;
  line-height: 1.1;
}
.sidebar-bloc-chiffre.cyan { color: var(--cyan); }

/* <details>/<summary> accordion */
details.sidebar-bloc > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  user-select: none;
}
details.sidebar-bloc > summary::-webkit-details-marker { display: none; }
.sidebar-bloc-chevron {
  font-size: 14px;
  color: var(--text-dim);
  transition: transform .2s;
}
details.sidebar-bloc[open] > summary .sidebar-bloc-chevron {
  transform: rotate(180deg);
}
.sidebar-bloc-detail {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  overflow-x: hidden;   /* V4.4 — évite scrollbar horizontale parasite */
  min-width: 0;
}
.sidebar-bloc-scroll {
  max-height: 420px;
  overflow-y: auto;
  overflow-x: hidden;   /* V4.4 */
}
@media (prefers-reduced-motion: reduce) {
  .sidebar-bloc-chevron { transition: none; }
}

/* ─── Zone centrale ─────────────────────────────────────── */

/* N06 FIX-itér39 : #main est le nouvel id (landmark <main>) — alias pour compat */
#main-content, #main {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

/* ─── Sidebar droite ────────────────────────────────────── */

.main-layout {
  transition: grid-template-columns 0.3s cubic-bezier(0.4,0,0.2,1);
}
.main-layout.journal-collapsed {
  grid-template-columns: 240px 1fr 20px;
}

#sidebar-right {
  background: var(--bg);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: row;
  overflow: hidden;
  min-height: 0;
}

/* Bande verticale toujours visible */
.journal-strip {
  width: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg2);
  border-right: 1px solid var(--border);
}

.btn-toggle-journal {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 13px;
  padding: 8px 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}
.btn-toggle-journal:hover { color: var(--gold); }

.btn-toggle-journal .arrow {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}
.main-layout.journal-collapsed .btn-toggle-journal .arrow {
  transform: rotate(180deg);
}

/* Contenu du journal */
.journal-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 14px 12px;
  gap: 10px;
  transition: opacity 0.15s;
  min-width: 0;
}
.main-layout.journal-collapsed .journal-content {
  opacity: 0;
  pointer-events: none;
}

.journal-header {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.journal-header .card-title { margin-bottom: 0; }

.journal-body {
  overflow-y: auto;
  flex: 1;
}

/* ─── Cards ─────────────────────────────────────────────── */

.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.card-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--text-dim);
  margin-bottom: 12px;
}

/* ─── Stat blocs — KPI tiles ────────────────────────────── */

.stat-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  transition: border-color 0.15s;
}
.stat-item:hover { border-color: var(--border-hi); }

.stat-label { font-size: 11px; color: var(--text-dim); }
.stat-value { font-size: 14px; font-weight: 700; }
.stat-value.green  { color: var(--green); }
.stat-value.red    { color: var(--red); }
.stat-value.yellow { color: var(--gold); }
.stat-value.cyan   { color: var(--cyan); }
.stat-value.blue   { color: var(--blue); }

/* ─── Patrimoine barres — Finary style ──────────────────── */

/* V4.4 — Grid layout pour empiler proprement valeur + PV latente + versements
   dans la colonne de droite, sans déborder horizontalement. */
.patrimoine-item {
  display: grid;
  grid-template-columns: 82px 1fr minmax(92px, max-content);
  column-gap: 8px;
  align-items: center;
  margin-bottom: 7px;
  min-width: 0;
}

.patri-nom {
  grid-column: 1;
  grid-row: 1;
  font-size: 11px;
  color: var(--text-mid);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.patri-barre-wrap {
  grid-column: 2;
  grid-row: 1;
  background: var(--bg3);
  border-radius: 3px;
  height: 4px;
  overflow: hidden;
  min-width: 0;
}

.patri-barre {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s cubic-bezier(.4,0,.2,1);
}

.patri-valeur {
  grid-column: 3;
  grid-row: 1;
  text-align: right;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: visible;  /* B3 UI-itér12 : ne plus clipper les grands montants */
}

/* ─── Graphique ─────────────────────────────────────────── */

#chart-wrapper {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px 10px;
}

#chart-wrapper h3 {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
}

#patrimoine-chart {
  width: 100%;
  height: 260px;
  cursor: crosshair;
}

/* ─── Décisions d'investissement ─────────────────────── */

.decisions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
/* Écran large : 3 cartes par rangée pour réduire la longueur de page */
@media (min-width: 1440px) {
  .decisions-grid { grid-template-columns: 1fr 1fr 1fr; }
}

.vehicule-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 13px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
  min-width: 0; /* FIX-itér34 : empêche le débordement dans la grille */
  overflow: hidden;
}

.vehicule-card:hover { border-color: var(--border-hi); box-shadow: var(--shadow-sm); }
.vehicule-card.actif {
  border-color: rgba(245,166,35,0.45);
  background: linear-gradient(135deg, rgba(245,166,35,0.04) 0%, var(--bg2) 100%);
}

.veh-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.veh-nom { font-weight: 700; font-size: 14px; color: var(--text); }
.veh-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.badge-green  { background: rgba(62,207,142,0.15); color: var(--green); }
.badge-yellow { background: rgba(245,166,35,0.15);  color: var(--yellow); }
.badge-blue   { background: rgba(91,141,238,0.15);  color: var(--blue); }
.badge-purple { background: rgba(167,139,250,0.15); color: var(--purple); }
.badge-red    { background: rgba(240,82,82,0.15);   color: var(--red); }

/* Description clampée à 2 lignes pour compacter la page ; texte complet au survol
   ou dès qu'on interagit avec la carte (pédagogie intacte, encombrement réduit) */
.veh-detail {
  font-size: 11px; color: var(--text-dim); margin-bottom: 6px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.vehicule-card:hover .veh-detail,
.vehicule-card:focus-within .veh-detail { -webkit-line-clamp: unset; }
.veh-solde    { font-size: 12px; color: var(--text-dim); margin-bottom: 4px; }
.veh-solde span { color: var(--text); font-weight: 600; }

.veh-input-wrap { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.veh-input {
  flex: 1;
  min-width: 70px; /* FIX : sans min-width un input ne rétrécit pas — le bouton "Investir" débordait de la carte crowdfunding */
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  padding: 7px 10px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.veh-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245,166,35,0.10); }
.veh-input:disabled { opacity: 0.4; cursor: not-allowed; }
.veh-input-eur { font-size: 12px; color: var(--text-dim); }

/* itér-feat — Boutons − / + autour des inputs véhicules (incrément rapide) */
.veh-step {
  flex-shrink: 0;
  width: 30px;
  height: 34px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text-mid);
  border-radius: var(--radius-sm);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, border-color 0.12s, color 0.12s, transform 0.08s;
  user-select: none;
}
.veh-step:hover  { border-color: var(--gold); color: var(--gold); background: var(--gold-dim); }
.veh-step:active { transform: scale(0.92); }
.veh-step-plus:hover  { border-color: var(--green); color: var(--green); background: rgba(34,197,94,0.10); }
.veh-step-moins:hover { border-color: var(--red);   color: var(--red);   background: rgba(239,68,68,0.10); }

/* ─── Barre plafond PEA ──────────────────────────────── */

.pea-plafond-wrap {
  margin: 4px 0 8px;
}
.pea-plafond-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.pea-plafond-label {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.pea-plafond-valeur {
  font-size: 10px;
  color: var(--text-mid);
  font-weight: 600;
}
.pea-plafond-bar-bg {
  height: 4px;
  background: var(--bg3);
  border-radius: 3px;
  overflow: hidden;
}
.pea-plafond-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--gold);
  transition: width 0.4s cubic-bezier(.4,0,.2,1), background 0.3s;
}
.pea-plafond-bar-fill.danger { background: var(--red); }
.pea-plafond-sature {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 4px;
  font-style: italic;
}

/* Sidebar : versements PEA */
.patri-pea-versements {
  font-size: 10px;
  color: var(--text-dim);
  grid-column: 1 / -1;
  margin-top: -4px;
  padding-left: 92px;
}

/* ─── Coût de l'inaction ────────────────────────────────── */
.inaction-cost-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 7px 10px;
  background: rgba(245, 166, 35, 0.08);
  border: 1px solid rgba(245, 166, 35, 0.25);
  border-radius: 8px;
  font-size: 11px;
  color: var(--gold);
}
.inaction-cost-icon { font-size: 13px; flex-shrink: 0; }
.inaction-cost-label { color: var(--text-dim); flex: 1; }
.inaction-cost-val { font-weight: 700; white-space: nowrap; }

/* ─── Modal décision événement ──────────────────────────── */
.modal-decision-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-mid);
  margin-bottom: 18px;
  padding: 12px;
  background: var(--bg3);
  border-radius: 8px;
  border-left: 3px solid var(--gold);
}
.modal-decision-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.modal-decision-actions .btn-decision {
  padding: 10px 14px;
  background: var(--bg3);
  border: 1px solid var(--border-hi);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.modal-decision-actions .btn-decision:hover {
  border-color: var(--gold);
  background: var(--gold-dim);
}

/* ─── Boutons ─────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 8px;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  padding: 10px 20px;
  font-size: 14px;
}
.btn:hover { opacity: 0.88; }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--gold);
  color: #000;
  font-weight: 700;
}
.btn-primary:hover { background: #f0b040; opacity: 1; }
.btn-secondary {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-danger {
  background: rgba(240,82,82,0.15);
  border: 1px solid var(--red);
  color: var(--red);
}

.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-full { width: 100%; }

/* ─── Événements ─────────────────────────────────────── */

.evenement-item {
  padding: 10px 12px;
  border-radius: 10px;
  border-left: 2px solid transparent;
  margin-bottom: 6px;
  background: var(--bg3);
  animation: fadeIn 0.3s ease;
}
.evenement-item.eco     { border-color: var(--red);   background: rgba(239,68,68,0.06); }
.evenement-item.eco-pos { border-color: var(--green); background: rgba(34,197,94,0.07); }
.evenement-item.pers    { border-color: var(--gold);  background: rgba(245,166,35,0.06); }

.evt-titre { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.evt-desc  { font-size: 11px; color: var(--text-mid); line-height: 1.5; }
.evt-annee { font-size: 10px; color: var(--text-dim); margin-top: 4px; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Écran d'accueil ────────────────────────────────── */

.accueil-root {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 20px;
  background: var(--bg);
  overflow: hidden;
}

.accueil-glow-bg {
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse at center, rgba(245,166,35,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.accueil-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 40px;
  position: relative;
}

.accueil-logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.accueil-logo-icon {
  font-size: 32px;
  color: var(--gold);
}

.accueil-logo-text {
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -1px;
}

.accueil-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin: 0 0 12px;
  line-height: 1.3;
}

.accueil-title-accent {
  color: var(--gold);
}

.accueil-subtitle {
  font-size: 14px;
  color: var(--text-mid);
  text-align: center;
  margin: 0;
}

.streak-panel {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 15;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}
.streak-panel-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-dim);
  font-weight: 700;
}
.streak-panel-count {
  font-size: 22px;
  font-weight: 800;
  color: var(--gold, #fb923c);
  margin-bottom: 4px;
}
.streak-days {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.streak-day-cell {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--bg3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  transition: background .2s, border-color .2s, color .2s;
}
.streak-day-cell.actif {
  background: rgba(251, 146, 60, .22);
  border-color: var(--gold, #fb923c);
  color: var(--gold, #fb923c);
}
.streak-day-cell.aujourdhui {
  box-shadow: 0 0 0 2px rgba(251, 146, 60, .5);
}
@media (max-width: 900px) {
  .streak-panel { display: none !important; }
}

.accueil-benefices {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 22px;
  margin: 18px 0 4px;
}
.accueil-benefices span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mid);
}

.accueil-jouer-sans-compte-hint {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  margin: 10px 0 0;
}

/* ── Mascotte Goupil — Accueil ── */
.accueil-mascotte {
  width: 130px;
  height: 130px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(245,166,35,0.45));
  animation: goupil-bounce 3s ease-in-out infinite;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.accueil-mascotte:hover {
  transform: scale(1.08) rotate(-3deg);
  filter: drop-shadow(0 0 28px rgba(245,166,35,0.7));
}
@keyframes goupil-bounce {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-8px); }
}

/* ── Auth Corner — Écran d'accueil ──────────────────────────────── */
.auth-corner {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 20;
}

/* Coin soutien — haut-gauche, même taille que le bouton "Se connecter" */
.support-corner {
  position: absolute;
  top: 16px;
  left: 20px;
  z-index: 20;
}
.btn-soutenir { text-decoration: none; box-sizing: border-box; height: 35px; line-height: 1; overflow: hidden; } /* hauteur calée sur "Se connecter" */
.btn-soutenir:hover {
  border-color: var(--red);
  color: var(--red);
  background: rgba(239,68,68,0.08);
}

.btn-auth-login {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  background: transparent;
  border: 1px solid var(--border-hi);
  border-radius: 99px;
  color: var(--text-mid);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
}
.btn-auth-login:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(56,189,248,0.08);
}

.auth-avatar-wrap {
  position: relative;
  display: flex;
}

.btn-auth-avatar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  background: var(--bg3);
  border: 1px solid var(--border-hi);
  border-radius: 99px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
}
.btn-auth-avatar:hover {
  border-color: var(--cyan);
  background: var(--bg4);
}

.auth-initials {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #c96a00);
  color: #000;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: .04em;
}

.auth-pseudo {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-chevron {
  color: var(--text-dim);
  font-size: 10px;
  transition: transform .18s;
  margin-left: 2px;
}
.auth-avatar-wrap.open .auth-chevron {
  transform: rotate(180deg);
}

.auth-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg3);
  border: 1px solid var(--border-hi);
  border-radius: 12px;
  padding: 6px;
  min-width: 180px;
  box-shadow: var(--shadow);
  z-index: 100;
}
.auth-avatar-wrap.open .auth-dropdown {
  display: block;
}

.auth-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: background .14s;
  font-family: var(--font);
  font-weight: 500;
}
.auth-dropdown-item:hover {
  background: var(--bg4);
}
.auth-dropdown-item.auth-dropdown-danger {
  color: var(--red);
}
.auth-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 2px;
}

/* ── Mascotte Goupil — Sidebar jeu ── */
.goupil-sidebar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
  background: linear-gradient(135deg, rgba(245,166,35,0.06), rgba(245,166,35,0.02));
  border: 1px solid rgba(245,166,35,0.18);
  border-radius: 12px;
  position: relative;
}
/* Conteneur images empilées pour cross-fade */
.goupil-img-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}
.goupil-sidebar-img {
  position: absolute;
  top: 0; left: 0;
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(245,166,35,0.4));
  transition: opacity 0.35s ease, transform 0.35s ease;
}
#goupil-img-active  { opacity: 1; z-index: 2; }
#goupil-img-next    { opacity: 0; z-index: 1; }
/* Hover : légère animation sur l'image active */
.goupil-img-wrap:hover #goupil-img-active {
  transform: scale(1.12) rotate(-4deg);
}
/* Animations par expression */
.goupil-expr-content      { animation: goupil-content 0.4s cubic-bezier(.17,.67,.35,1.4); }
.goupil-expr-celebration  { animation: goupil-celebration 0.5s cubic-bezier(.17,.67,.35,1.5); }
.goupil-expr-inquiet      { animation: goupil-inquiet 0.4s ease-out; }
.goupil-expr-alerte       { animation: goupil-alerte 0.35s ease-out; }
.goupil-expr-pensif       { animation: goupil-pensif 0.4s ease-out; }
.goupil-expr-pedagogue    { animation: goupil-pedagogue 0.45s cubic-bezier(.17,.67,.35,1.3); }
.goupil-expr-triste       { animation: goupil-triste 0.5s ease-out; }
.goupil-expr-proprietaire { animation: goupil-proprietaire 0.45s cubic-bezier(.17,.67,.35,1.4); }
.goupil-expr-investisseur { animation: goupil-investisseur 0.5s cubic-bezier(.17,.67,.35,1.5); }
.goupil-expr-patient      { animation: goupil-patient 0.6s ease-in-out; }
.goupil-expr-curieux      { animation: goupil-curieux 0.45s cubic-bezier(.17,.67,.35,1.3); }
.goupil-expr-expert       { animation: goupil-expert 0.4s ease-out; }
.goupil-expr-retraite     { animation: goupil-retraite 0.6s cubic-bezier(.17,.67,.35,1.4); }
@keyframes goupil-content {
  0%   { transform: scale(0.8) translateY(4px); }
  60%  { transform: scale(1.15) translateY(-3px); }
  100% { transform: scale(1) translateY(0); }
}
@keyframes goupil-celebration {
  0%   { transform: scale(0.7) translateY(8px); }
  50%  { transform: scale(1.2) translateY(-6px) rotate(3deg); }
  75%  { transform: scale(0.95) translateY(-1px) rotate(-2deg); }
  100% { transform: scale(1) translateY(0) rotate(0); }
}
@keyframes goupil-inquiet {
  0%,100% { transform: translateX(0); }
  20%  { transform: translateX(-3px) rotate(-2deg); }
  60%  { transform: translateX(3px) rotate(2deg); }
}
@keyframes goupil-alerte {
  0%,100% { transform: scale(1); }
  30%  { transform: scale(1.08) rotate(-3deg); }
  60%  { transform: scale(1.08) rotate(3deg); }
}
@keyframes goupil-pensif {
  0%   { transform: translateY(-4px); opacity: 0.4; }
  100% { transform: translateY(0);    opacity: 1; }
}
/* Expression 7 — Pédagogue : inclinaison pédagogique puis stabilisation */
@keyframes goupil-pedagogue {
  0%   { transform: rotate(0deg) translateY(0); }
  30%  { transform: rotate(-6deg) translateY(-2px); }
  65%  { transform: rotate(3deg) translateY(-1px); }
  100% { transform: rotate(0deg) translateY(0); }
}
/* Expression 8 — Triste : glissement vers le bas, ralentissement mélancolique */
@keyframes goupil-triste {
  0%   { transform: translateY(-5px) scale(0.92); opacity: 0.5; }
  55%  { transform: translateY(2px) scale(1.02); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
/* Expression 9 — Propriétaire : gonflement de fierté + petit saut */
@keyframes goupil-proprietaire {
  0%   { transform: scale(0.85) translateY(5px); }
  50%  { transform: scale(1.13) translateY(-5px); }
  75%  { transform: scale(1.05) translateY(-1px); }
  100% { transform: scale(1) translateY(0); }
}
/* Expression 10 — Investisseur : saut victorieux + légère rotation positive */
@keyframes goupil-investisseur {
  0%   { transform: scale(0.8) translateY(7px) rotate(-2deg); }
  55%  { transform: scale(1.18) translateY(-6px) rotate(2deg); }
  78%  { transform: scale(0.97) translateY(0px) rotate(-1deg); }
  100% { transform: scale(1) translateY(0) rotate(0); }
}
/* Expression 11 — Patient : balancement doux et régulier */
@keyframes goupil-patient {
  0%   { transform: translateY(0) rotate(0deg); }
  35%  { transform: translateY(3px) rotate(-2deg); }
  70%  { transform: translateY(-1px) rotate(1.5deg); }
  100% { transform: translateY(0) rotate(0deg); }
}
/* Expression 12 — Curieux : penchement en avant, regard vif */
@keyframes goupil-curieux {
  0%   { transform: scale(0.9) translateX(-4px) rotate(-4deg); }
  50%  { transform: scale(1.08) translateX(2px) rotate(2deg); }
  75%  { transform: scale(1.04) translateX(0) rotate(-1deg); }
  100% { transform: scale(1) translateX(0) rotate(0); }
}
/* Expression 13 — Expert : apparition posée, légère inclinaison savante */
@keyframes goupil-expert {
  0%   { transform: scale(0.92) translateY(-3px); opacity: 0.7; }
  55%  { transform: scale(1.05) translateY(1px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
/* Expression 14 — Retraite : soulèvement radieux + légère expansion zen */
@keyframes goupil-retraite {
  0%   { transform: scale(0.82) translateY(6px) rotate(-2deg); opacity: 0.6; }
  55%  { transform: scale(1.14) translateY(-5px) rotate(1deg); opacity: 1; }
  78%  { transform: scale(1.04) translateY(-1px) rotate(0deg); }
  100% { transform: scale(1) translateY(0) rotate(0); }
}
.goupil-bubble {
  font-size: 11px;
  color: var(--text-mid);
  font-style: italic;
  line-height: 1.4;
  flex: 1;
  transition: opacity 0.4s ease;
}

.accueil-section-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 16px;
}

.scenarios-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: 680px;
  width: 100%;
  margin-bottom: 24px;
}

.scenario-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.scenario-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(245,166,35,0.1);
}
.sc-label { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.sc-diff  { font-size: 11px; font-weight: 600; text-transform: uppercase; margin-bottom: 8px; }
.sc-desc  { font-size: 12px; color: var(--text-dim); }

.accueil-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.accueil-tags {
  color: var(--text-dim);
  font-size: 11px;
  text-align: center;
  max-width: 600px;
  line-height: 2;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-hi);
  color: var(--text-mid);
  transition: border-color 0.2s, color 0.2s;
}
.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ─── Notice ────────────────────────────────────────── */

.notice-container {
  width: 100%;
  max-width: 820px;
}

.notice-header {
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notice-titre {
  font-size: 24px;
  font-weight: 800;
  color: var(--gold);
  margin: 0;
}

.notice-intro {
  color: var(--text-dim);
  font-size: 14px;
  margin: 0;
}

/* Accordéon */
.notice-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}

.notice-section[open] {
  border-color: var(--border-hi);
}

.notice-section-titre {
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.notice-section-titre::-webkit-details-marker { display: none; }

.notice-section-titre::before {
  content: "▶";
  font-size: 10px;
  color: var(--text-dim);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.notice-section[open] > .notice-section-titre::before {
  transform: rotate(90deg);
}

.notice-section-titre:hover {
  color: var(--gold);
}

.notice-section-body {
  padding: 0 18px 18px;
  border-top: 1px solid var(--border);
}

/* Cards internes */
.notice-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.notice-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

/* F3 UI-itér12 : Glossaire des acronymes */
.glossaire-liste {
  margin: 14px 0 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0 24px;
}
.glossaire-liste dt {
  font-weight: 800;
  font-size: 13px;
  color: var(--cyan);
  margin-top: 14px;
  margin-bottom: 3px;
  padding-bottom: 3px;
  border-bottom: 1px dotted var(--border);
}
.glossaire-liste dd {
  font-size: 12px;
  color: var(--text-mid);
  margin: 0;
  line-height: 1.55;
}
.glossaire-liste dd strong {
  color: var(--text);
  font-weight: 700;
}

.notice-card-head {
  font-size: 13px;
  font-weight: 700;
  color: var(--cyan);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.notice-tag-head {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
}

.notice-card ul {
  margin: 0;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.notice-card li {
  font-size: 12px;
  color: var(--text-mid);
  line-height: 1.5;
}

.notice-card strong {
  color: var(--text);
}

.notice-tag {
  display: inline-block;
  font-size: 10px;
  background: rgba(245,166,35,0.12);
  color: var(--gold);
  border: 1px solid rgba(245,166,35,0.25);
  border-radius: 4px;
  padding: 2px 7px;
  font-weight: 600;
}

/* Paragraphe */
.notice-para {
  font-size: 13px;
  color: var(--text-dim);
  margin: 12px 0 6px;
  line-height: 1.6;
}

/* Tableau */
.notice-table-wrap {
  margin-top: 12px;
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.notice-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.notice-table thead tr {
  background: var(--bg3);
}

.notice-table th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
  color: var(--text-mid);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}

.notice-table td {
  padding: 9px 14px;
  color: var(--text-mid);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.5;
}

.notice-table td:first-child {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

.notice-table td:last-child {
  text-align: right;
  white-space: nowrap;
  color: var(--text-dim);
}

.notice-table tbody tr:last-child td { border-bottom: none; }
.notice-table tbody tr:hover td { background: var(--bg3); }

.notice-table .row-eco td:first-child { color: var(--cyan); }
.notice-table .row-pro td:first-child { color: var(--green); }
.notice-table .row-immo td:first-child { color: #fb923c; }

.notice-table code {
  font-family: monospace;
  font-size: 11px;
  background: var(--bg4);
  padding: 2px 5px;
  border-radius: 3px;
  color: var(--gold);
}

/* Légende */
.notice-legende {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 11px;
}
.legend-eco  { color: var(--cyan); }
.legend-pro  { color: var(--green); }
.legend-immo { color: #fb923c; }

/* ─── Tooltip fiscalité ──────────────────────────────── */

.tooltip {
  position: relative;
  cursor: help;
  border-bottom: 1px dashed var(--text-dim);
}
/* Tooltips CSS désactivés — remplacés par initTooltipsJS() dans ux.js
   (position: fixed, z-index: 99999, jamais clippés par les cards) */
.tooltip:hover::after { content: none; }

/* ─── Barre de progression age ────────────────────────── */

.age-progress {
  width: 100%;
  height: 6px;
  background: var(--bg2);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}
.age-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* ─── Modal score final ──────────────────────────────── */

#modal-score {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  /* V4.4 — overlay scrollable si panel dépasse */
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 20px 10px;
}
#modal-score.visible { display: flex; }

.score-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 40px;
  max-width: 560px;
  width: 100%;
  box-shadow: var(--shadow);
  text-align: center;
  /* V4.4 — centrage vertical si contenu court, top si dépasse */
  margin: auto;
}

.score-titre   { font-size: 24px; font-weight: 800; color: var(--cyan); margin-bottom: 8px; }
.score-montant { font-size: 48px; font-weight: 800; color: var(--green); margin: 16px 0; }
.score-mention { color: var(--text-dim); font-size: 14px; margin-bottom: 24px; }

/* ─── Badges composition portefeuille ───────────────────── */

.veh-composition {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 5px 0 4px;
  min-height: 0;
}

.compo-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  border: 1px solid;
  cursor: default;
  white-space: nowrap;
  transition: opacity .15s;
}
.compo-badge:hover { opacity: .8; }

.veh-rdt {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
}

.btn-actifs {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 14px;
  padding: 4px 8px;
  cursor: pointer;
  margin-left: 6px;
  flex-shrink: 0;
  transition: border-color .15s, color .15s;
}
.btn-actifs:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

/* ─── Modal Actifs ─────────────────────────────────────── */

/* Filtres catégorie */
.filtre-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.filtre-btn.actif, .filtre-btn:hover {
  background: rgba(56, 189, 248, .12);
  border-color: var(--cyan);
  color: var(--cyan);
}

/* Ligne actif disponible */
.actif-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg3);
  border: 1px solid transparent;
  transition: border-color .15s;
}
.actif-row:hover { border-color: var(--border); }
.actif-row-selectionne { border-color: var(--cyan) !important; background: rgba(56,189,248,.06); }

.actif-row-info {
  flex: 1;
  min-width: 0;
}

.actif-nom-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-bottom: 4px;
  text-align: left;
}
.actif-nom-txt {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.actif-ticker {
  font-size: 11px;
  color: var(--text-dim);
}
.actif-nom-btn:hover .actif-nom-txt { color: var(--cyan); }

.actif-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.actif-bars { display: flex; flex-direction: column; gap: 3px; }
.actif-bar-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.actif-bar {
  height: 4px;
  border-radius: 2px;
  min-width: 4px;
  border: none;
}
.actif-bar-rdt { border: 1px solid; }
.actif-bar-vol { background: rgba(251,146,60,.35); }
.actif-bar-label { font-size: 10px; font-weight: 600; white-space: nowrap; }

.btn-ajouter-actif {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 16px;
  width: 30px; height: 30px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, color .15s, border-color .15s;
  display: flex; align-items: center; justify-content: center;
}
.btn-ajouter-actif:hover {
  background: rgba(56,189,248,.12);
  border-color: var(--cyan);
  color: var(--cyan);
}
.btn-ajouter-selectionne {
  background: rgba(56,189,248,.15);
  border-color: var(--cyan);
  color: var(--cyan);
}

/* Ligne portefeuille en cours */
.portef-ligne {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg3);
  border-radius: 8px;
}
.pct-slider { cursor: pointer; }
.pct-label { font-size: 12px; }

.btn-retirer-actif {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 4px;
}
.btn-retirer-actif:hover { color: var(--red); }

/* ─── Bloc L — boutons inline, P&L latente, immo enrichi ─ */

.btn-xs {
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: background .15s;
}
.btn-xs:hover { background: var(--surface-3); }
.btn-xs:disabled { opacity: .4; cursor: default; }
.btn-xs.danger, .btn-xs-sell { border-color: var(--red); color: var(--red); }
.btn-xs.danger:hover, .btn-xs-sell:hover { background: rgba(240,82,82,.12); }
.btn-xs-buy { border-color: var(--green); color: var(--green); }
.btn-xs-buy:hover { background: rgba(62,207,142,.12); }

.veh-actions-inline {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.patri-pv {
  grid-column: 3;   /* V4.4 — se place sous .patri-valeur dans la colonne 3 */
  font-size: 10px;
  margin-top: 1px;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
  min-width: 0;
  line-height: 1.2;
}
.patri-pv.positif { color: var(--green); }
.patri-pv.negatif { color: var(--red); }
.patri-pea-versements {
  grid-column: 3;
  font-size: 10px;
  text-align: right;
  color: var(--text-dim);
  white-space: nowrap;
  min-width: 0;
  line-height: 1.2;
}

/* Immo enrichi */
.immo-vacance-alerte {
  background: rgba(240,82,82,.12);
  border: 1px solid var(--red);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--red);
  margin-top: 8px;
}
.immo-locataire-info {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Profils locataires */
.profil-locataire-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  margin-bottom: 8px;
  background: var(--surface-2);
}
.profil-locataire-card:hover { border-color: var(--accent); background: var(--surface-3); }
.profil-locataire-card.selected { border-color: var(--accent); background: rgba(139,92,246,.1); }
.profil-icone { font-size: 22px; }
.profil-infos { flex: 1; }
.profil-nom { font-weight: 700; font-size: 14px; }
.profil-detail { font-size: 11px; color: var(--text-dim); }
.profil-loyer { font-size: 13px; font-weight: 600; color: var(--green); }

/* Loyer marché affiché */
.immo-loyer-display {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  padding: 6px 10px;
  background: var(--surface-2);
  border-radius: 6px;
  margin: 4px 0 8px;
}

/* Revente grid */
.revente-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
  margin: 12px 0;
  font-size: 13px;
}
.revente-grid .label { color: var(--text-dim); }
.revente-grid .valeur { font-weight: 600; text-align: right; }
.revente-net { font-size: 18px; font-weight: 800; color: var(--green); text-align: center; margin-top: 12px; }

/* Bilan créatif */
.bilan-section { margin-bottom: 16px; }
.bilan-titre { font-size: 13px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.bilan-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; border-bottom: 1px solid var(--border); }
.bilan-total { display: flex; justify-content: space-between; padding: 8px 0; font-size: 17px; font-weight: 800; margin-top: 8px; }
.bilan-total .val { color: var(--green); }

/* Immo step */
#immo-step-2 .modal-titre { font-size: 15px; margin-bottom: 10px; }

/* ─── Responsive ─────────────────────────────────────── */

/* FIX-itér34 : breakpoint intermédiaire — la sidebar gauche (240px) + droite (280px)
   laisse ~280px au centre à 800px → les cards 2 colonnes se tronquent.
   On repasse à 1 colonne dès 1100px pour éviter les labels coupés. */
@media (max-width: 1100px) {
  .decisions-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  #sidebar-left, #sidebar-right { border: none; }
  .decisions-grid { grid-template-columns: 1fr; }
  .scenarios-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════
   FINLIFE ARENA — Multijoueur
═══════════════════════════════════════════════════════ */

/* ── Header ── */
.arena-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; height: 52px;
  background: var(--bg2); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.arena-logo { font-size: 18px; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.arena-logo-arena { color: var(--cyan); }
.arena-header-right { display: flex; align-items: center; gap: 10px; }
.arena-player-badge {
  font-size: 13px; font-weight: 600; color: var(--cyan);
  background: rgba(45,212,191,.12); padding: 4px 10px; border-radius: 20px;
}

/* ── Auth Panel ── */
.arena-auth-panel {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 16px; padding: 32px; width: 100%; max-width: 440px;
}
.arena-auth-title { font-size: 22px; font-weight: 800; color: var(--cyan); margin-bottom: 24px; }
.arena-auth-sub { font-size: 13px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px; }
.arena-auth-section { display: flex; flex-direction: column; gap: 10px; }
.arena-auth-divider {
  text-align: center; color: var(--text-dim); font-size: 12px;
  margin: 20px 0; position: relative;
}
.arena-auth-divider::before, .arena-auth-divider::after {
  content: ''; position: absolute; top: 50%; width: 42%; height: 1px;
  background: var(--border);
}
.arena-auth-divider::before { left: 0; }
.arena-auth-divider::after  { right: 0; }

/* ── Inputs ── */
.arena-input {
  width: 100%; background: var(--bg1); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 14px;
  padding: 9px 12px; outline: none; font-family: inherit;
  box-sizing: border-box;
}
.arena-input:focus { border-color: var(--cyan); }
.arena-select { cursor: pointer; }
.arena-select-sm { width: auto; padding: 6px 10px; font-size: 12px; }

/* ── Buttons ── */
.btn-arena-primary {
  width: 100%; padding: 11px; border-radius: 8px; border: none; cursor: pointer;
  background: var(--cyan); color: #000; font-size: 14px; font-weight: 700;
  font-family: inherit; transition: opacity .15s;
}
.btn-arena-primary:hover { opacity: .85; }
.btn-arena-primary:disabled { opacity: .4; cursor: not-allowed; }
.btn-arena-send {
  padding: 8px 14px; border-radius: 8px; border: none; cursor: pointer;
  background: var(--cyan); color: #000; font-size: 16px; font-weight: 700;
  font-family: inherit; flex-shrink: 0;
}

/* ── Season Cards ── */
.arena-section-title { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 16px; }
.arena-season-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px 20px; margin-bottom: 12px;
}
.arena-season-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.arena-season-name { font-size: 16px; font-weight: 700; }
.arena-season-status { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.status-waiting  { background: rgba(251,191,36,.15); color: #fbbf24; }
.status-draft    { background: rgba(139,92,246,.15);  color: #8b5cf6; }
.status-active   { background: rgba(74,222,128,.15);  color: #4ade80; }
.status-finished { background: rgba(156,163,175,.15); color: #9ca3af; }
.arena-season-meta { display: flex; gap: 16px; font-size: 12px; color: var(--text-dim); margin-bottom: 14px; }
.btn-arena-join {
  padding: 8px 18px; border-radius: 8px; border: none; cursor: pointer;
  background: var(--cyan); color: #000; font-size: 13px; font-weight: 700;
  font-family: inherit;
}
.arena-empty { color: var(--text-dim); font-size: 13px; font-style: italic; padding: 12px 0; }

/* ── Colonnes saison ── */
.arena-col {
  display: flex; flex-direction: column;
  border-right: 1px solid var(--border);
  overflow: hidden;
}
.arena-col:last-child { border-right: none; }
.arena-col-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-dim);
  padding: 10px 14px 8px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.arena-col-left  { overflow-y: auto; }
.arena-col-center { overflow: hidden; }
.arena-col-right  { overflow: hidden; }

/* ── Liste actifs ── */
.arena-asset-list { overflow-y: auto; flex: 1; }
.arena-asset-row {
  display: grid; grid-template-columns: 1fr auto auto;
  gap: 6px; align-items: center;
  padding: 8px 14px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .1s;
}
.arena-asset-row:hover, .arena-asset-row.selected { background: var(--bg2); }
.arena-asset-id { font-size: 12px; font-weight: 700; color: var(--text); }
.arena-price   { font-size: 12px; font-weight: 600; }
.arena-chg     { font-size: 11px; }
.up   { color: var(--green); }
.down { color: var(--red); }
.price-flash { animation: priceFlash .6s ease; }
@keyframes priceFlash { 0%,100%{ opacity:1 } 50%{ opacity:.3 } }

/* ── Tabs ── */
.arena-tabs {
  display: flex; border-bottom: 1px solid var(--border);
  flex-shrink: 0; background: var(--bg1);
}
.arena-tab {
  padding: 10px 16px; font-size: 12px; font-weight: 600;
  border: none; background: none; color: var(--text-dim); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.arena-tab.active { color: var(--cyan); border-bottom-color: var(--cyan); }
.arena-tab-content { display: none; }
.arena-tab-content.active { display: flex; flex-direction: column; flex: 1; }

/* ── Détail actif ── */
.arena-asset-header { flex-shrink: 0; }
.arena-asset-detail-name { font-size: 18px; font-weight: 800; }
.arena-asset-stats { display: flex; gap: 16px; font-size: 12px; color: var(--text-dim); margin-top: 4px; flex-wrap: wrap; }

/* ── Chart ── */
.arena-chart {
  width: 100%; max-height: 140px; background: var(--bg1);
  border: 1px solid var(--border); border-radius: 8px;
}

/* ── Order Book ── */
.arena-orderbook {
  background: var(--bg1); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden; flex-shrink: 0;
}
.ob-header {
  display: grid; grid-template-columns: 1fr auto 1fr;
  padding: 6px 12px; font-size: 11px; font-weight: 700;
  color: var(--text-dim); background: var(--bg2);
  text-align: center;
}
.ob-sides { display: grid; grid-template-columns: 1fr 1fr; }
.ob-col { display: flex; flex-direction: column; }
.ob-asks-col { border-right: 1px solid var(--border); }
.ob-col-header {
  display: grid; grid-template-columns: repeat(6, 1fr);
  padding: 3px 8px; font-size: 10px; color: var(--text-dim);
  background: var(--bg2); border-top: 1px solid var(--border);
}
.ob-mid {
  font-size: 14px; font-weight: 800; color: var(--cyan);
}
.ob-row {
  display: grid; grid-template-columns: 1fr auto auto;
  padding: 3px 8px; font-size: 11px; position: relative;
  overflow: hidden;
}
.ob-row::before {
  content: ''; position: absolute; top: 0; bottom: 0;
  width: var(--depth, 0%);
}
.ob-ask::before { right: 0; background: rgba(239,83,80,.12); }
.ob-bid::before { left: 0;  background: rgba(76,175,80,.12); }
.ob-row .ob-price  { font-weight: 600; }
.ob-ask .ob-price  { color: var(--red); }
.ob-bid .ob-price  { color: var(--green); }
.ob-row .ob-qty, .ob-row .ob-orders { color: var(--text-dim); font-size: 10px; }

/* ── Formulaire ordre ── */
.arena-order-form {
  background: var(--bg1); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.arena-order-type-row, .arena-order-side-row {
  display: flex; gap: 16px; font-size: 13px;
}
.arena-order-side-row .side-buy  { color: var(--green); font-weight: 600; }
.arena-order-side-row .side-sell { color: var(--red);   font-weight: 600; }
.arena-order-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.arena-order-field label { display: block; font-size: 11px; color: var(--text-dim); margin-bottom: 4px; }

/* ── Mes ordres ── */
.arena-order-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 12px; border: 1px solid var(--border);
  border-radius: 8px; margin-bottom: 6px; font-size: 12px;
}
.arena-order-row.status-partial { border-color: var(--cyan); }
.order-side.buy  { color: var(--green); font-weight: 700; }
.order-side.sell { color: var(--red);   font-weight: 700; }
.btn-cancel-order {
  margin-left: auto; background: none; border: none; color: var(--text-dim);
  cursor: pointer; font-size: 14px; padding: 2px 6px;
}
.btn-cancel-order:hover { color: var(--red); }

/* ── Leaderboard ── */
.arena-leaderboard { overflow-y: auto; max-height: 260px; }
.arena-lb-row {
  display: grid; grid-template-columns: 32px 1fr auto auto;
  gap: 8px; align-items: center;
  padding: 8px 14px; border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.arena-lb-row.me { background: rgba(45,212,191,.07); }
.lb-rank  { font-size: 16px; }
.lb-name  { font-weight: 600; }
.lb-pat   { font-weight: 700; }
.lb-delta { font-size: 11px; }

/* ── Chat ── */
.arena-chat-messages {
  flex: 1; overflow-y: auto; padding: 8px 12px;
  display: flex; flex-direction: column; gap: 6px;
  max-height: 200px;
}
.arena-chat-msg {
  font-size: 12px; line-height: 1.4;
}
.chat-user { font-weight: 700; color: var(--cyan); margin-right: 6px; }
.chat-text { color: var(--text); }
.msg-signal_bull    { background: rgba(76,175,80,.08); border-radius: 4px; padding: 3px 6px; }
.msg-signal_bear    { background: rgba(239,83,80,.08); border-radius: 4px; padding: 3px 6px; }
.msg-signal_warning { background: rgba(251,191,36,.08); border-radius: 4px; padding: 3px 6px; }
.sig-badge { font-size: 10px; font-weight: 800; padding: 1px 5px; border-radius: 3px; }
.arena-chat-form {
  display: flex; gap: 6px; padding: 8px 12px;
  border-top: 1px solid var(--border); flex-shrink: 0;
}
.arena-chat-form .arena-input { flex: 1; }

/* ── Événements ── */
.arena-event {
  padding: 10px 14px; border-left: 3px solid var(--border);
  margin-bottom: 8px; font-size: 13px; border-radius: 0 6px 6px 0;
  background: var(--bg2);
}
.event-bulletin    { border-left-color: var(--cyan); }
.event-personal    { border-left-color: #8b5cf6; }
.event-market_shock { border-left-color: var(--red); }
.event-day { font-size: 10px; color: var(--text-dim); margin-bottom: 4px; }
.event-movers { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

/* ── Badges ── */
.arena-badges-grid { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 0; }
.arena-badge {
  font-size: 28px; background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px; cursor: default;
  transition: transform .1s;
}
.arena-badge:hover { transform: scale(1.15); }

/* ── Draft ── */
.arena-draft { display: flex; flex-direction: column; gap: 14px; }
.arena-draft-subtitle { font-size: 13px; color: var(--text-dim); }
.arena-draft-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.arena-adv-card {
  background: var(--bg1); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px; cursor: pointer; transition: border-color .15s;
}
.arena-adv-card:hover   { border-color: var(--cyan); }
.arena-adv-card.selected { border-color: var(--cyan); background: rgba(45,212,191,.08); }
.arena-adv-label { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.arena-adv-desc  { font-size: 11px; color: var(--text-dim); }

/* ── Toasts ── */
.arena-toasts {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px; z-index: 2000;
}
.arena-toast {
  padding: 10px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
  opacity: 0; transform: translateX(20px); transition: opacity .25s, transform .25s;
  max-width: 320px; box-shadow: 0 4px 20px rgba(0,0,0,.4);
}
.arena-toast.visible { opacity: 1; transform: translateX(0); }
.toast-info    { background: var(--bg2); border: 1px solid var(--border); color: var(--text); }
.toast-success { background: rgba(74,222,128,.15); border: 1px solid var(--green); color: var(--green); }
.toast-error   { background: rgba(239,83,80,.15);  border: 1px solid var(--red); color: var(--red); }
.toast-warn    { background: rgba(251,191,36,.15);  border: 1px solid #fbbf24; color: #fbbf24; }
.toast-badge   { background: rgba(139,92,246,.15);  border: 1px solid #8b5cf6; color: #8b5cf6; }
.toast-bulletin { background: rgba(45,212,191,.12); border: 1px solid var(--cyan); color: var(--cyan); }

/* ── Modal Arena ── */
.arena-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.75); z-index: 3000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.arena-modal-panel {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px 32px; max-width: 560px; width: 100%;
  max-height: 85vh; overflow-y: auto; box-shadow: 0 8px 40px rgba(0,0,0,.6);
}
.arena-modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.arena-modal-title  { font-size: 18px; font-weight: 800; color: var(--cyan); }
.arena-modal-close  {
  background: none; border: none; color: var(--text-dim); font-size: 18px;
  cursor: pointer; padding: 4px 8px;
}
.arena-modal-close:hover { color: var(--text); }
.arena-modal-body { font-size: 14px; }

/* ── IA Strategy Analysis — Full-page screen ── */
#screen-ia {
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
}
.ia-screen-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.ia-screen-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--cyan);
}
.ia-screen-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px 60px;
}
.ia-disclaimer {
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 24px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

/* ── IA Strategy Analysis — Components ── */
.ia-progress-label {
  font-size: 13px;
  color: var(--text-mid);
  margin-bottom: 6px;
  text-align: center;
}
.ia-progress-track {
  height: 6px;
  background: var(--bg3);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}
.ia-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--gold));
  border-radius: 3px;
  transition: width 0.15s ease;
}

.ia-score-card {
  text-align: center;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 14px;
}
.ia-score-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.ia-score-value {
  font-size: 42px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 6px;
}
.ia-score-sub {
  font-size: 12px;
  color: var(--text-mid);
}

.ia-chart-container {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 14px;
}
.ia-chart-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-mid);
  margin-bottom: 8px;
}
.ia-chart-container canvas {
  width: 100%;
  height: auto;
  display: block;
}
.ia-chart-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-mid);
}
.ia-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}

.ia-conseil {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
}
.ia-conseil-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--cyan);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ia-conseil p {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  margin: 0;
}

.ia-section {
  margin-bottom: 14px;
}
.ia-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.ia-gap-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  margin-bottom: 4px;
}
.ia-gap-row.bad {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.ia-gap-row.good {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
}
.ia-gap-label { flex: 1; color: var(--text-mid); }
.ia-gap-delta { font-weight: 700; min-width: 50px; text-align: right; }
.ia-gap-row.bad .ia-gap-delta  { color: var(--red); }
.ia-gap-row.good .ia-gap-delta { color: var(--green); }
.ia-gap-detail { font-size: 11px; color: var(--text-dim); }

.ia-strat-table {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.ia-strat-header, .ia-strat-row {
  display: grid;
  grid-template-columns: 1fr 90px 70px 70px;
  padding: 6px 10px;
  font-size: 12px;
  gap: 4px;
}
.ia-strat-header {
  background: var(--bg4);
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: .05em;
}
.ia-strat-row {
  border-top: 1px solid var(--border);
}
.ia-strat-row.best {
  background: rgba(245, 166, 35, 0.08);
}
.ia-strat-row.omniscient {
  background: rgba(167, 139, 250, 0.06);
  border-top: 1px dashed rgba(167, 139, 250, 0.3);
}
.ia-strat-name { font-weight: 600; color: var(--text); }
.ia-strat-val  { text-align: right; color: var(--cyan); font-weight: 600; }
.ia-strat-val.dim { color: var(--text-dim); font-weight: 400; }
.ia-strat-desc {
  padding: 2px 10px 10px 10px;
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.45;
  font-style: italic;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  margin-bottom: 4px;
}

.ia-alloc-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ia-alloc-item {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  padding: 6px 10px;
  background: var(--bg3);
  border-radius: 6px;
  overflow: hidden;
}
.ia-alloc-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: rgba(56, 189, 248, 0.12);
  border-radius: 6px;
  z-index: 0;
}
.ia-alloc-label {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  position: relative;
  z-index: 1;
}
.ia-alloc-pct {
  font-size: 13px;
  font-weight: 700;
  color: var(--cyan);
  position: relative;
  z-index: 1;
}

/* ── Arena login view ── */
.arena-view-login {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 40px 20px;
  gap: 16px;
}

.arena-auth-tagline {
  font-size: 13px;
  color: var(--text-mid);
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: .04em;
}

.arena-server-banner {
  background: rgba(245, 166, 35, 0.12);
  border: 1px solid rgba(245, 166, 35, 0.4);
  color: var(--gold);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 13px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  line-height: 1.5;
}

.arena-server-banner code {
  background: rgba(0,0,0,.35);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.arena-form-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.4;
}

/* ── Player stats bar (vue saison) ── */
.arena-player-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 8px 16px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  flex-wrap: wrap;
}
.arena-player-bar-stat { display: flex; flex-direction: column; gap: 2px; }
.arena-player-bar-label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; }
.arena-player-bar-value { font-weight: 700; color: var(--text); }
.arena-player-bar-value.up   { color: var(--green); }
.arena-player-bar-value.down { color: var(--red); }

/* ── Portfolio tab ── */
.arena-portfolio-list { display: flex; flex-direction: column; gap: 8px; }
.arena-portfolio-row {
  display: grid;
  grid-template-columns: 60px 55px 1fr 88px 88px;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.arena-portfolio-row:hover { background: var(--bg4); }
.arena-portfolio-asset { font-weight: 700; color: var(--cyan); font-size: 12px; }
.arena-portfolio-vehicule {
  display: inline-block;
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  color: var(--text-mid);
  text-transform: uppercase;
}
.arena-portfolio-qty  { color: var(--text-mid); font-size: 12px; }
.arena-portfolio-val  { font-weight: 600; text-align: right; }
.arena-portfolio-pnl  { font-weight: 700; text-align: right; }
.arena-portfolio-pnl.up   { color: var(--green); }
.arena-portfolio-pnl.down { color: var(--red); }

.arena-portfolio-summary {
  display: flex; gap: 16px; flex-wrap: wrap;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.arena-portfolio-summary-item { display: flex; flex-direction: column; gap: 3px; }
.arena-portfolio-summary-label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; }
.arena-portfolio-summary-value { font-size: 15px; font-weight: 700; color: var(--text); }
.arena-portfolio-summary-value.up   { color: var(--green); }
.arena-portfolio-summary-value.down { color: var(--red); }

/* ── Arena responsive ── */
@media (max-width: 900px) {
  #arena-view-season {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto 1fr auto;
  }
  .arena-col-left  { max-height: 160px; }
  .arena-col-right { max-height: 300px; }
}

/* ═══════════════════════════════════════════════════════════════════
   REFONTE UX — VAGUE 1
   Ajouts : progress mois, table-wrapper scroll, profils colorés,
            accessibilité focus, reduced-motion.
   ═══════════════════════════════════════════════════════════════════ */


/* V1.5 — Wrapper scrollable horizontal pour tableaux */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--border-hi) transparent;
}
.table-wrapper::-webkit-scrollbar { height: 6px; }
.table-wrapper::-webkit-scrollbar-thumb {
  background: var(--border-hi);
  border-radius: 3px;
}
/* Indicateur visuel : dégradé à droite quand contenu déborde */
.table-wrapper.has-overflow {
  mask-image: linear-gradient(to right, black calc(100% - 24px), transparent);
  -webkit-mask-image: linear-gradient(to right, black calc(100% - 24px), transparent);
}

/* V1.6 — Bordure distinctive par profil (scenario-card) */
.scenario-card[data-profil="smic"]         { border-left: 4px solid var(--blue); }
.scenario-card[data-profil="cadre"]        { border-left: 4px solid var(--gold); }
.scenario-card[data-profil="freelance"]    { border-left: 4px solid var(--purple); }
.scenario-card[data-profil="fonctionnaire"]{ border-left: 4px solid var(--green); }

/* Accent hover plus marqué pour les cards */
.scenario-card {
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out, border-color 0.2s;
}
.scenario-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-sm), 0 0 24px rgba(245, 166, 35, 0.08);
}

/* V2.8 (anticipé en V1) — Focus ring universel pour accessibilité clavier */
*:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 4px;
}
/* Désactiver le focus visible sur clics souris (seulement sur clavier) */
button:focus:not(:focus-visible),
a:focus:not(:focus-visible) { outline: none; }

/* V2.8 (anticipé) — Respect du prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* V2.7 — Cards profils enrichies (icône, étoiles, stats, stratégie) */
.scenario-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sc-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sc-icone {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 6px rgba(245,166,35,0.35));
}
.sc-label {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text);
}
.sc-etoiles {
  display: flex;
  gap: 2px;
  font-size: var(--fs-sm);
  color: var(--text-dim);
}
.sc-etoiles .sc-etoile.filled { color: var(--gold); }
.sc-desc {
  font-size: var(--fs-sm);
  color: var(--text-mid);
  line-height: 1.5;
}
.sc-stats {
  list-style: none;
  margin: 4px 0;
  padding: 10px 12px;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 6px;
}
.sc-stats li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-xs);
}
.sc-stats li span { color: var(--text-dim); }
.sc-stats li strong { color: var(--text); font-weight: 600; }
.sc-strategie {
  font-size: var(--fs-xs);
  color: var(--gold);
  font-style: italic;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
  text-align: center;
}

/* V2.4 — Icône ⓘ pour termes fiscaux glossaire */
.tip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg3);
  color: var(--cyan);
  font-size: 10px;
  font-weight: 600;
  cursor: help;
  margin-left: 2px;
  vertical-align: middle;
  transition: background 0.15s, color 0.15s;
}
.tooltip:hover .tip-icon {
  background: var(--cyan);
  color: var(--bg);
}
/* Force tooltip visible si parent a data-tip (même sans .tooltip préalable) */
[data-tip] { position: relative; cursor: help; }

/* ═══════════════════════════════════════════════════════
   V2.3 — Responsive mobile complet (iPhone 16 : 393×852)
   ═══════════════════════════════════════════════════════ */
@media (max-width: 430px) {
  body, html { font-size: 15px; }

  /* Layout en colonne unique : header / main / sidebar */
  .main-layout {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto 1fr auto;
  }
  #sidebar-left {
    order: 3;
    border-right: none;
    border-top: 1px solid var(--border);
    padding: 12px 10px;
    max-height: 45vh;
  }
  #main-content, #main {
    order: 2;
    padding: 10px 10px;
    gap: 10px;
  }
  #sidebar-right { display: none; }

  /* Header plus compact */
  header {
    padding: 8px 10px !important;
    gap: 6px !important;
    flex-wrap: wrap;
  }
  header h1, header .title {
    font-size: var(--fs-lg) !important;
  }
  #sim-date {
    font-size: var(--fs-sm) !important;
  }
  /* Cards & blocs plus compacts */
  .card { padding: 10px 12px; }
  .sidebar-bloc { padding: 10px 12px; }
  .sidebar-bloc-chiffre { font-size: var(--fs-xl, 22px); }

  /* Stat-grid : 1 ligne = 2 cols au lieu de 3 */
  .stat-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }
  .stat-value { font-size: var(--fs-base, 15px) !important; }
  .stat-label { font-size: 10px !important; }

  /* Boutons plus gros (hit-target 44×44 Apple HIG) */
  .btn, button {
    min-height: 40px;
    padding: 8px 12px;
  }
  .btn-sm { min-height: 36px; }

  /* Modals en plein écran mobile */
  .modal-content, .modal {
    max-width: 100vw !important;
    max-height: 100vh !important;
    width: 100% !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }

  /* Graphique ajuste hauteur */
  #chart-wrapper { min-height: 200px; }
  #chart-wrapper canvas { max-height: 220px; }

  /* Tables scroll horizontal */
  .table-wrapper { overflow-x: auto; }
  table { min-width: 100%; font-size: var(--fs-xs, 11px); }

  /* Scenario cards en colonne unique */
  #scenarios-grid {
    grid-template-columns: 1fr !important;
  }

  /* Popovers : pas de position fixed perché, au lieu de quoi centrer */
  #popover-epargne {
    position: fixed !important;
    left: 10px !important;
    right: 10px !important;
    top: auto !important;
    bottom: 10px !important;
    max-width: none !important;
    width: auto !important;
  }

  /* Patrimoine items plus compacts */
  .patrimoine-item {
    grid-template-columns: 70px 1fr 84px !important;
    font-size: 11px;
    column-gap: 6px !important;
  }
}

/* Touch devices : désactiver :hover persistant */
@media (hover: none) {
  .btn:hover, button:hover { transform: none !important; }
}

/* ═══════════════════════════════════════════════════════
   V3.4 — Micro-animations polish
   ═══════════════════════════════════════════════════════ */
@keyframes pulseCyan {
  0%, 100% { text-shadow: none; transform: scale(1); }
  50% { text-shadow: 0 0 18px rgba(34,211,238,0.6); transform: scale(1.03); }
}
.sidebar-bloc-chiffre.pulse {
  animation: pulseCyan 0.6s ease-out;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.sidebar-bloc, .card {
  animation: fadeSlideIn 0.3s ease-out;
}

/* Bouton partage : léger shimmer */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
#btn-partager-score {
  background: linear-gradient(90deg, var(--cyan), #8b5cf6, var(--cyan));
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
  border: none;
  color: #fff;
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-bloc-chiffre.pulse,
  .sidebar-bloc, .card,
  #btn-partager-score { animation: none !important; }
}

/* ═══════════════════════════════════════════════════════
   V2.6 — Popover décomposition chiffres
   ═══════════════════════════════════════════════════════ */
.popover-detail {
  position: fixed; /* B4 UI-itér12 : fixed au lieu de absolute → plus d'overlap cash-flow */
  z-index: 9999;
  background: var(--bg3);
  border: 1px solid var(--border-hi);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.75);
  font-size: var(--fs-xs, 11px);
  animation: popoverFadeIn 0.15s ease-out;
}
.popover-detail-titre {
  font-size: var(--fs-sm, 12px);
  font-weight: 700;
  color: var(--cyan);
  margin-bottom: 8px;
}
.popover-detail-ligne {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  border-bottom: 1px dotted var(--border);
}
.popover-detail-ligne:last-child { border-bottom: none; }
.popover-detail-ligne span:first-child { color: var(--text-dim); }
.popover-detail-ligne span:last-child { color: var(--text); font-weight: 600; }
.popover-detail-total {
  display: flex;
  justify-content: space-between;
  padding-top: 6px;
  margin-top: 6px;
  border-top: 1px solid var(--border);
  font-weight: 700;
  color: var(--cyan);
}
@keyframes popoverFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .popover-detail { animation: none; }
}

/* ═══════════════════════════════════════════════════════
   V2.9 — Tabs modal marchés mobile
   ═══════════════════════════════════════════════════════ */
.marches-tabs-mobile {
  display: none;  /* caché par défaut (desktop) */
}
@media (max-width: 430px) {
  .marches-tabs-mobile {
    display: flex;
    gap: 4px;
    padding: 6px 10px;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
  }
  .marches-tab {
    flex: 1;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: var(--fs-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
  }
  .marches-tab.actif {
    background: var(--cyan);
    color: var(--bg);
    border-color: var(--cyan);
  }
  /* Bascule liste/detail via data-vue sur .marches-body */
  .marches-body[data-vue="liste"] .marches-main { display: none; }
  .marches-body[data-vue="detail"] .marches-sidebar { display: none; }
  .marches-body[data-vue="detail"] .marches-main { display: flex; flex-direction: column; }
}

/* ═══════════════════════════════════════════════════════
   V5 — Authentification (modal + dropdown)
   ═══════════════════════════════════════════════════════ */

/* Modal auth */
.auth-modal-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 10px;
  overflow-y: auto;
}
.auth-panel {
  max-width: 420px;
  width: 100%;
  padding: 32px 28px;
  text-align: center;
  position: relative;
}
.auth-close-btn {
  position: absolute;
  top: 14px; right: 16px;
  background: none; border: none;
  color: var(--text-dim); cursor: pointer;
  font-size: 16px; padding: 4px 6px;
  border-radius: 4px;
}
.auth-close-btn:hover { color: var(--text); background: var(--bg3); }
.auth-logo {
  font-size: var(--fs-xl);
  font-weight: 800;
  color: var(--cyan);
  margin-bottom: 6px;
}
.auth-subtitle {
  font-size: var(--fs-sm);
  color: var(--text-dim);
  margin-bottom: 20px;
}
.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg3);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1; padding: 7px 8px;
  background: transparent; border: none;
  border-radius: 6px;
  font-size: var(--fs-xs); font-weight: 600;
  color: var(--text-dim); cursor: pointer;
  transition: all .15s;
}
.auth-tab.actif {
  background: var(--bg2);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.auth-pane { display: none; flex-direction: column; gap: 10px; }
.auth-pane.actif { display: flex; }
.auth-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: var(--fs-sm);
  outline: none;
  transition: border-color .15s;
}
.auth-input:focus { border-color: var(--cyan); }
.auth-submit { width: 100%; margin-top: 4px; min-height: 40px; }
.auth-error {
  font-size: var(--fs-xs); color: var(--red);
  min-height: 16px; text-align: left;
}
.auth-cgu {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: var(--fs-xs); color: var(--text-dim);
  text-align: left; cursor: pointer;
}
.auth-cgu input { flex-shrink: 0; margin-top: 2px; }
.auth-invite-text {
  font-size: 11px; color: var(--text-dim);
  margin-top: 16px;
}

/* Dropdown utilisateur */
.user-dropdown {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 0;
  min-width: 200px;
  box-shadow: var(--shadow);
  animation: popoverFadeIn .15s ease-out;
}
.user-dropdown-header {
  padding: 6px 14px 2px;
  font-weight: 700;
  font-size: var(--fs-sm);
  color: var(--text);
}
.user-dropdown-email {
  padding: 0 14px 6px;
  font-size: 11px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-dropdown-sep {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}
.user-dropdown-item {
  display: block; width: 100%;
  padding: 8px 14px;
  background: none; border: none;
  text-align: left; cursor: pointer;
  font-size: var(--fs-sm); color: var(--text);
  transition: background .1s;
}
.user-dropdown-item:hover { background: var(--bg3); }
.user-dropdown-item.danger { color: var(--red); }
.user-dropdown-item.small { font-size: 11px; }

/* ── Écran Mes parties ───────────────────────────────────── */
.mp-filtres {
  display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap;
}
.mp-filtre {
  padding: 6px 14px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 20px; font-size: var(--fs-xs); font-weight: 600;
  color: var(--text-dim); cursor: pointer; transition: all .15s;
}
.mp-filtre.actif {
  background: var(--cyan); color: var(--bg);
  border-color: var(--cyan);
}
.mp-table-wrap { overflow-x: auto; }
.mp-table {
  width: 100%; border-collapse: collapse; font-size: var(--fs-sm);
}
.mp-table th {
  padding: 10px 12px; text-align: left;
  font-size: var(--fs-xs); text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
.mp-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.mp-table tr:hover td { background: var(--bg3); }
.mp-nom { font-weight: 600; color: var(--text); max-width: 180px; }
.mp-patri { font-weight: 700; color: var(--cyan); }
.mp-date { color: var(--text-dim); white-space: nowrap; }
.mp-actions { display: flex; gap: 6px; white-space: nowrap; }
.mp-badge {
  padding: 3px 8px; border-radius: 12px; font-size: 11px; font-weight: 600;
}
.mp-badge-smic         { background: rgba(59,130,246,.15); color: var(--blue); }
.mp-badge-cadre        { background: rgba(34,211,238,.15); color: var(--cyan); }
.mp-badge-freelance    { background: rgba(167,139,250,.15); color: var(--purple); }
.mp-badge-fonctionnaire{ background: rgba(34,197,94,.15);  color: var(--green); }

/* ── Écran Statistiques ──────────────────────────────────── */
.stats-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
.stats-kpi {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 14px;
  text-align: center;
}
.stats-kpi-val {
  font-size: var(--fs-xl); font-weight: 800; color: var(--cyan);
  margin-bottom: 4px; line-height: 1.1;
}
.stats-kpi-lbl {
  font-size: var(--fs-xs); color: var(--text-dim); text-transform: uppercase;
  letter-spacing: .06em;
}
.stats-section-titre {
  font-size: var(--fs-sm); font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-dim);
  margin: 20px 0 10px; padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.stats-profils-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px; margin-bottom: 20px;
}
.stats-profil-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px;
}
.stats-profil-label {
  font-size: var(--fs-sm); font-weight: 700; color: var(--text); margin-bottom: 4px;
}
.stats-profil-parties {
  font-size: 11px; color: var(--text-dim); margin-bottom: 8px;
}
.stats-profil-max { font-size: 12px; color: var(--green); }
.stats-profil-moy { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.stats-conseil {
  background: rgba(34,211,238,.08);
  border: 1px solid rgba(34,211,238,.2);
  border-radius: 8px; padding: 14px 16px;
  font-size: var(--fs-sm); color: var(--text-mid); line-height: 1.6;
  margin-top: 16px;
}

/* Responsive mobile V5 */
@media (max-width: 430px) {
  .auth-panel { padding: 24px 16px; }
  .auth-tabs  { flex-direction: column; }
  .stats-kpis { grid-template-columns: repeat(2, 1fr); }
  .mp-table th:nth-child(3),
  .mp-table td:nth-child(3) { display: none; }
}


/* ── AUDIT-itér28 ─────────────────────────────────────────────────── */

/* C1 : overlay visuel trésorerie négative — bordure rouge pulsante sur tout l'écran */
#screen-jeu.tresorerie-negative {
  outline: 3px solid var(--red);
  outline-offset: -3px;
  animation: treso-pulse 1.5s ease-in-out infinite;
}
@keyframes treso-pulse {
  0%,100% { outline-color: rgba(239,68,68,.9); }
  50%      { outline-color: rgba(239,68,68,.3); }
}

/* C2 : mode focus — bouton actif */
#btn-mode-focus.focus-actif {
  background: rgba(34,211,238,.25) !important;
  color: var(--cyan) !important;
  border-color: var(--cyan) !important;
  font-weight: 700;
}

/* C3 : filtres du journal */
.filtre-actif {
  background: rgba(34,211,238,.2) !important;
  color: var(--cyan) !important;
  border-color: var(--cyan) !important;
  font-weight: 700;
}
.evenement-item.fiscal { border-left-color: var(--purple); }
.evenement-item.invest { border-left-color: var(--green); }

/* itér31 : défi communautaire — bloc accueil */
#defi-mensuel-bloc {
  width: 100%;
  max-width: 640px;
  margin: 0 auto 14px;
  padding: 0 16px;
  box-sizing: border-box;
}
#defi-mensuel-inner {
  padding: 14px 16px;
  background: rgba(251,191,36,.07);
  border: 1px solid rgba(251,191,36,.3);
  border-radius: 12px;
}

/* itér29 : onglets graphiques */
.chart-tab {
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.05);
  color: var(--muted);
  font-size: .78rem;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.chart-tab:hover {
  background: rgba(255,255,255,.1);
  color: var(--text);
}
.chart-tab-actif {
  background: rgba(34,211,238,.2) !important;
  color: var(--cyan) !important;
  border-color: var(--cyan) !important;
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════════
   v19 — Design polish (audit UX itér6)
   Scrollbars dark, sélection dorée, élévations hover,
   micro-interactions premium. CSS pur, zéro changement HTML.
   ═══════════════════════════════════════════════════════ */

/* Scrollbars — la scrollbar système blanche cassait l'immersion dark */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--bg4) var(--bg);
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: var(--bg); }
*::-webkit-scrollbar-thumb {
  background: var(--bg4);
  border-radius: 5px;
  border: 2px solid var(--bg);
}
*::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }
*::-webkit-scrollbar-corner { background: var(--bg); }

/* Sélection de texte — détail premium cohérent avec l'accent or */
::selection { background: rgba(245,166,35,0.30); color: var(--text); }

/* Cartes véhicules — élévation subtile au hover (profondeur) */
.vehicule-card:hover {
  transform: translateY(-1px);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

/* Bouton primaire — halo doré au hover (affordance renforcée) */
.btn-primary:hover {
  box-shadow: 0 2px 16px rgba(245,166,35,0.35);
}

/* Boutons vitesse — groupe segmenté : un seul bloc visuel au lieu de 6 boutons flottants */
.sim-controls {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  display: inline-flex;
  gap: 2px;
  flex-shrink: 0; /* conserve le comportement header de la règle d'origine */
}
.sim-controls .btn-vitesse {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
}
.sim-controls .btn-vitesse.vitesse-active {
  background: rgba(56,189,248,.15);
  border-color: var(--cyan);
}

/* Journal — hiérarchie typographique des événements renforcée */
.evt-titre { letter-spacing: 0.01em; }
.evenement-item {
  transition: background 0.15s, border-color 0.15s;
}
.evenement-item:hover { background: var(--bg3); }

/* Inputs numériques — masquer les spinners (look épuré, saisie au clavier) */
.veh-input::-webkit-outer-spin-button,
.veh-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.veh-input[type=number] { -moz-appearance: textfield; }

/* Accueil — cartes scénarios : plus d'air sur grand écran */
@media (min-width: 1100px) {
  .scenarios-grid { max-width: 760px; gap: 16px; }
}

/* Modals — apparition douce (fade + scale) au lieu d'un pop sec */
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-panel { animation: modal-in 0.18s ease-out; }

/* Goupil — halo doux permanent autour de la mascotte sidebar */
.goupil-sidebar-wrap {
  transition: border-color 0.3s, box-shadow 0.3s;
}
.goupil-sidebar-wrap:hover {
  border-color: rgba(245,166,35,0.40);
  box-shadow: 0 0 16px rgba(245,166,35,0.10);
}

/* ═══════════════════════════════════════════════════════
   v21 itér8 — Nav rail gauche (maquette Claude Design)
   ═══════════════════════════════════════════════════════ */
/* Ergonomie : plus de rail vertical sur desktop (libellés illisibles à 58px de large,
   navigation déportée loin du contenu). Les mêmes entrées vivent dans la sidebar gauche
   (.sb-nav). Le rail ne sert plus que de barre d'onglets mobile (media query plus bas). */
#nav-rail {
  display: none;
  background: var(--bg);
  align-items: center;
  gap: 8px;
  z-index: 40;
}
.rail-logo {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.rail-goupil {
  width: 36px; height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(245,166,35,0.35));
}
.rail-btn {
  width: 54px; height: auto; min-height: 46px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 17px;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 5px 2px;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  filter: grayscale(0.6) opacity(0.7);
}
.rail-btn:hover {
  background: var(--bg3);
  filter: grayscale(0) opacity(1);
}
.rail-btn.rail-actif {
  background: var(--gold-dim);
  border-color: rgba(245,166,35,0.35);
  filter: grayscale(0) opacity(1);
}
#screen-jeu > header { position: relative; }

/* Navigation sidebar (desktop) — boutons lisibles, zone de clic généreuse */
.sb-nav {
  display: grid;
  grid-template-columns: 1fr; /* une colonne : libellés complets, jamais tronqués */
  gap: 6px;
}
.sb-nav-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-mid);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-nav-btn:hover { border-color: var(--gold); color: var(--text); background: var(--bg2); }
.sb-nav-ico { font-size: 15px; line-height: 1; flex-shrink: 0; }
/* Libellés sous les icônes — sans eux, 🍽️ ou 💰 seuls sont ambigus */
.rail-label {
  display: block;
  font-size: 8px; font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-dim);
  line-height: 1;
  max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rail-btn.rail-actif .rail-label { color: var(--gold); }

/* Header allégé (desktop + mobile) : Notice/Thème/Son dans le menu ⚙, Retraite/Quitter
   migrent dans la barre de contrôles en bas de page. Les boutons originaux du header
   restent dans le DOM (seuls porteurs de la logique) mais sont masqués partout — les
   boutons ci-dessous et les items du menu ⚙ leur délèguent par .click(). */
.mobile-only { display: inline-flex; }
#btn-sauter-retraite, #btn-quitter-jeu, #btn-notice-jeu,
#btn-toggle-theme, #btn-toggle-son { display: none; }
.sim-barre-controles { flex-wrap: wrap; gap: 8px; }

/* Menu ⚙ paramètres (mobile) — délègue aux boutons originaux masqués du header */
#menu-params {
  position: fixed;
  top: 52px; right: 8px;
  z-index: 700;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 6px 24px rgba(0,0,0,.5);
  min-width: 150px;
}
#menu-params button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 7px;
  cursor: pointer;
}
#menu-params button:active { background: var(--bg3); }

/* Mobile : le rail devient une barre d'onglets en bas d'écran — le masquer rendait
   Marchés/Budget/Train de vie/Achievements totalement inaccessibles sur téléphone. */
@media (max-width: 900px) {
  #nav-rail {
    display: flex; /* base desktop = none — la barre d'onglets ne vit que sur mobile */
    position: fixed;
    top: auto; bottom: 0; left: 0; right: 0;
    width: 100%; height: auto;
    flex-direction: row;
    align-items: stretch;
    border-right: none;
    border-top: 1px solid var(--border);
    padding: 4px 2px;
    /* iPhone : ne pas coller les onglets sous la home bar */
    padding-bottom: calc(4px + env(safe-area-inset-bottom, 0px));
    gap: 0;
  }
  .rail-logo { display: none; }
  .sb-nav { display: none; } /* la barre d'onglets du bas remplit ce rôle sur mobile */
  /* Zone tactile = colonne entière (≥ 48px de haut), icône + libellé empilés */
  .rail-btn {
    flex: 1 1 0;
    min-width: 0;
    width: auto; height: auto;
    min-height: 52px;
    flex-direction: column;
    gap: 2px;
    border-radius: 10px;
    font-size: 20px;
    padding: 4px 2px;
  }
  .rail-ico { line-height: 1; }
  .rail-label {
    display: block;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--text-dim);
    line-height: 1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .rail-btn.rail-actif .rail-label { color: var(--gold); }
  /* Pas d'état hover persistant sur tactile ; feedback à l'appui */
  .rail-btn:hover { background: transparent; }
  .rail-btn:active { background: var(--bg3); transform: scale(0.96); }
  .rail-btn.rail-actif { background: var(--gold-dim); }
  #screen-jeu { padding-left: 0; padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
}

/* ── v21 — Barre budget mensuel (palette tonale : ardoise + or) ── */
.budget-bar-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 7px 18px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
}
.budget-bar-label {
  color: var(--text-dim);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 10px;
  flex-shrink: 0;
}
.budget-bar {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  display: flex;
  overflow: hidden;
  background: var(--bg4);
  min-width: 120px;
}
.budget-seg { height: 100%; transition: width 0.5s ease; }
.budget-seg-loyer   { background: #6b7394; }   /* ardoise */
.budget-seg-vie     { background: #9aa3c7; }   /* ardoise claire */
.budget-seg-epargne { background: var(--gold); } /* or */
.budget-seg-reste   { background: #4ade80; }   /* vert doux */
.budget-legende {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
  color: var(--text-mid);
  white-space: nowrap;
}
.budget-legende .dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
@media (max-width: 1100px) { .budget-legende { display: none; } }

/* ── v21 — Journal concis : entrées compactes, expansion au clic ── */
.evenement-item.compact .evt-desc { display: none; }
.evenement-item.compact { padding: 7px 10px; cursor: pointer; }
.evenement-item.compact .evt-titre { font-size: 11.5px; margin-bottom: 0; }
.evenement-item.compact .evt-annee { margin-top: 2px; font-size: 9.5px; }
.evenement-item.compact.expanded .evt-desc { display: block; margin-top: 4px; }
.journal-voir-tout {
  width: calc(100% - 16px);
  margin: 6px 8px 10px;
  padding: 6px;
  font-size: 11px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-mid);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.journal-voir-tout:hover { border-color: var(--gold); color: var(--gold); }

/* ═══════════════════════════════════════════════════════
   v22 itér9 — Goupil enrichi · patrimoine header · footer status · sparklines
   ═══════════════════════════════════════════════════════ */

/* itér-feat — Modal Train de vie : grille de paliers sélectionnables */
.tdv-grille {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tdv-carte {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  background: var(--bg3);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s, background 0.15s;
}
.tdv-carte:hover { border-color: var(--gold); transform: translateY(-1px); }
.tdv-carte.tdv-courant {
  border-color: var(--gold);
  background: var(--gold-dim);
  cursor: default;
}
.tdv-carte.tdv-courant:hover { transform: none; }
.tdv-carte.tdv-verrou {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.5);
}
.tdv-carte.tdv-verrou:hover { border-color: var(--border); transform: none; }

/* v23 itér10 — Légende catégories achievements */
.ach-legende {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 8px 6px 2px;
  font-size: 10px;
  color: var(--text-mid);
}
.ach-leg-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

/* v23 itér10 — Bouton "En savoir +" sous la bulle Goupil */
.goupil-savoir-plus {
  align-self: flex-start;
  margin-top: 2px;
  padding: 2px 10px;
  font-size: 9.5px;
  font-weight: 600;
  background: var(--gold-dim);
  border: 1px solid rgba(245,166,35,0.35);
  border-radius: 10px;
  color: var(--gold);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.goupil-savoir-plus:hover { background: rgba(245,166,35,0.22); }
.goupil-savoir-plus:active { transform: scale(0.96); }

/* Goupil — colonne texte avec titre Conseiller renard */
.goupil-text-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.goupil-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.2;
}
.goupil-title span {
  display: block;
  font-size: 9px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
.goupil-kw { color: var(--gold); font-weight: 600; font-style: normal; }

/* Patrimoine dans le header */
.header-patrimoine {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
  flex-shrink: 0;
  margin-left: auto;
}
.hp-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.hp-val {
  font-size: 16px;
  font-weight: 800;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 1100px) { .header-patrimoine { display: none; } }

/* Footer status bar */
#footer-status {
  position: fixed;
  left: 58px; right: 0; bottom: 0;
  height: 26px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 18px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  font-size: 10.5px;
  font-family: ui-monospace, "Cascadia Mono", monospace;
  color: var(--text-dim);
  z-index: 30;
}
#screen-jeu { padding-bottom: 26px; }
.fs-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 6px;
  animation: fs-pulse 2s ease-in-out infinite;
}
.fs-dot.pause { background: var(--text-dim); animation: none; }
@keyframes fs-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}
@media (max-width: 900px) { #footer-status { left: 0; } }

/* Sparklines cartes véhicules */
.veh-spark {
  float: right;
  width: 80px;
  height: 24px;
  margin-top: -4px;
  opacity: 0.9;
  pointer-events: none;
}

/* v23 itér10 — Polish responsive mobile pour les éléments v21/v22 */
@media (max-width: 600px) {
  .budget-bar-label { display: none; }          /* barre seule, gain de place */
  .budget-bar-wrap  { padding: 6px 10px; }
  #footer-status    { gap: 10px; padding: 0 10px; font-size: 9.5px; }
  #fs-achievements  { display: none; }           /* le HUD achievements existe déjà */
}
@media (max-width: 900px) {
  .goupil-savoir-plus { display: none; }         /* notice accessible via header */
}

/* ── v21 — Achievements : grille de badges circulaires (maquette) ── */
.ach-grille {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 14px 8px;
  padding: 8px 4px;
}
.ach-cercle-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: default;
}
.ach-cercle {
  position: relative;
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  border: 2px solid var(--border-hi);
  background: var(--bg3);
  transition: transform 0.15s, border-color 0.2s, box-shadow 0.2s;
}
.ach-cercle-wrap.ach-done .ach-cercle {
  border-color: var(--gold);
  background: var(--gold-dim);
  box-shadow: 0 0 12px rgba(245,166,35,0.18);
}
.ach-cercle-wrap.ach-locked .ach-cercle {
  filter: grayscale(1) opacity(0.45);
}
.ach-cercle-wrap:hover .ach-cercle { transform: scale(1.08); }
.ach-coche {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--gold);
  color: #000;
  font-size: 11px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}
.ach-cercle-nom {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-mid);
  text-align: center;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ach-cercle-wrap.ach-done .ach-cercle-nom { color: var(--text); }

/* ── v20 — Header : séparateurs de groupes sémantiques (itér7) ── */
.header-sep {
  width: 1px;
  height: 22px;
  background: var(--border-hi);
  flex-shrink: 0;
  margin: 0 4px;
}
@media (max-width: 900px) { .header-sep { display: none; } }

/* ── v20 — Alerte matelas : désaturée (bordure latérale au lieu de fond plein) ── */
.alerte-matelas {
  background: rgba(245,166,35,0.08) !important;
  border: 1px solid rgba(245,166,35,0.25) !important;
  border-left: 3px solid var(--gold) !important;
  color: var(--text) !important;
  border-radius: 10px;
}
.alerte-matelas b, .alerte-matelas strong { color: var(--gold); }
