/* =============================================================
   style.css — Front joueur JeuxRSE
   Design system : Rezilans (thème clair)
   - Canvas bleu clair, cartes blanches arrondies, ombres indigo douces
   - CTA pilule lime, secondaire indigo, accent cyan
   - Couleurs des piliers RSE : fournies par le backend (verrouillées)
   - La carte (map.css) n'est PAS concernée par ce thème
   ============================================================= */

:root {
  /* Surfaces */
  --rz-canvas: #E8F4FC;
  --rz-card: #FFFFFF;
  --rz-card-tint: #F6FAFE;
  --rz-line: #D6E4F0;
  --rz-track: #E4EDF5;

  /* Encre */
  --rz-ink: #1A1D2A;
  --rz-ink-600: #5B6070;
  --rz-ink-400: #9EA3B5;

  /* Marque */
  --rz-brand-blue: #496AB1;
  --rz-indigo: #4A4E9C;
  --rz-indigo-dark: #3B3F80;
  --rz-cyan: #29ABE2;
  --rz-cyan-tint: #EAF6FE;
  --rz-lime: #C8D82E;
  --rz-lime-dark: #AEBC1F;
  --rz-lime-tint: #F2F7D9;
  --rz-magenta: #EC2B8F;

  /* Échelle qualité (AQI) réutilisée pour les états */
  --rz-sky: #89D2F6;
  --rz-green: #63BBA2;
  --rz-green-dark: #2F8F76;
  --rz-yellow: #FFE000;
  --rz-red: #EA5352;
  --rz-bordeaux: #961637;
  --rz-purple: #7A2581;

  /* Géométrie & ombres */
  --rz-radius: 16px;
  --rz-radius-lg: 22px;
  --rz-pill: 999px;
  --rz-shadow: 0 6px 18px rgba(74, 78, 156, 0.14);
  --rz-shadow-lg: 0 18px 48px rgba(74, 78, 156, 0.22);
  --rz-scrim: rgba(26, 29, 42, 0.48);

  --rz-font: 'Roboto', system-ui, 'Segoe UI', Arial, sans-serif;
}

html, body {
  height: 100%;
  margin: 0;
  font-family: var(--rz-font);
  background: var(--rz-canvas);
  color: var(--rz-ink);
}

/* ── Barre supérieure (bleu marque, logo/texte blancs) ───────── */
#topbar {
  background: var(--rz-brand-blue);
  color: #fff;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(74, 78, 156, 0.25);
  position: relative;
  z-index: 20;
}
#topbar h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
#game-area { background: var(--rz-canvas); padding: 10px; display: flex; align-items: stretch; }

/* ── HUD bas de page : rangée de cartes blanches ─────────────── */
#hud {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 10px 12px 14px;
  background: var(--rz-canvas);
}
.hud-item {
  padding: 8px 12px;
  background: var(--rz-card);
  border-radius: var(--rz-radius);
  box-shadow: var(--rz-shadow);
  box-sizing: border-box;
  color: var(--rz-ink);
}
#group-info { color: var(--rz-ink-600); font-weight: 500; display: flex; align-items: center; }
#actions { display: flex; align-items: center; gap: 8px; }
#actions button {
  background: var(--rz-indigo);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--rz-pill);
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
  font-size: 0.85rem;
}
#actions button:hover { background: var(--rz-indigo-dark); }

#user-icon {
  width: 48px; height: 48px;
  background-color: #fff;
  color: var(--rz-ink);
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--rz-line);
  overflow: visible; flex-shrink: 0; position: relative;
}

/* Badge coefficient soft skills sur l'avatar */
.softskills-badge{position:absolute;top:-4px;right:-4px;width:24px;height:24px;background-image:url(/svg/icon/etoile.svg);background-size:cover;background-position:center;background-repeat:no-repeat;display:flex;align-items:center;justify-content:center;color:#000;font-weight:700;font-size:10px;text-shadow:0 0 2px rgba(255,255,255,0.8)}

/* Bloc "mon profil" du HUD */
#user-menu {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: var(--rz-card);
  border-radius: var(--rz-radius);
  min-width: 180px;
  position: relative;
}
.user-info { display: flex; flex-direction: column; justify-content: center; }
.user-info .username { font-weight: 700; color: var(--rz-ink); font-size: 14px; }
.user-info .profile-score { font-size: 12px; color: var(--rz-ink-600); }
#user-menu > .profile-score { font-size: 12px; color: var(--rz-ink-600); }

#status {
  position: fixed; right: 8px; top: 8px;
  background: var(--rz-card);
  color: var(--rz-ink);
  padding: 8px 12px;
  border-radius: var(--rz-radius);
  box-shadow: var(--rz-shadow-lg);
  z-index: 100;
  font-size: 0.85rem;
}

/* ── Zone utilisateur de la barre supérieure ─────────────────── */
#topbar-user { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
#topbar-username { color: #fff; font-weight: 700; font-size: 0.95rem; }
#topbar-session {
  display: none;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 0.85rem; font-weight: 600;
  padding: 3px 12px;
  border-radius: var(--rz-pill);
  margin-left: 8px;
  letter-spacing: 0.01em;
}
#btn-logout {
  background: var(--rz-red);
  color: #fff;
  border: none;
  padding: 7px 16px;
  border-radius: var(--rz-pill);
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
}
#btn-logout:hover { background: #d84443; }
#btn-admin {
  background: #fff;
  color: var(--rz-indigo);
  border: none;
  padding: 7px 16px;
  border-radius: var(--rz-pill);
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
}
#btn-admin:hover { background: var(--rz-cyan-tint); }

/* ── Mode Maître du Jeu (contrôles GM dans la vue joueur) ────── */
.gm-controls {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--rz-radius);
}
.gm-controls { max-width: min(980px, 94vw); flex-wrap: wrap; row-gap: 6px; }
.gm-field { display: flex; align-items: center; gap: 6px; color: #fff; font-size: 0.78rem; font-weight: 700; }
.gm-field span { white-space: nowrap; }
#gm-event-select {
  min-width: 220px; max-width: 320px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--rz-line);
  background: #fff;
  color: var(--rz-ink);
  font-size: 0.84rem;
  font-family: inherit;
}
#gm-event-select:focus { outline: none; border-color: var(--rz-cyan); box-shadow: 0 0 0 3px rgba(41, 171, 226, 0.25); }

/* Actions principales GM : pilule lime (CTA primaire Rezilans) */
#btn-gm-start, #btn-gm-advance, #btn-gm-resolve {
  background: var(--rz-lime);
  color: var(--rz-ink);
  border: none;
  padding: 7px 14px;
  border-radius: var(--rz-pill);
  cursor: pointer;
  font-weight: 800;
  font-size: 0.8rem;
  font-family: inherit;
}
#btn-gm-start:hover, #btn-gm-advance:hover, #btn-gm-resolve:hover { background: var(--rz-lime-dark); }

/* Actions utilitaires GM : pilule blanche, texte indigo */
#btn-gm-refresh-events, #btn-gm-pause, #btn-gm-step-back, #btn-gm-step-forward,
#btn-gm-next-point, #btn-gm-prev-phase, #btn-gm-next-phase, #btn-gm-restart-phase {
  background: #fff;
  color: var(--rz-indigo);
  border: none;
  padding: 7px 12px;
  border-radius: var(--rz-pill);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.8rem;
  font-family: inherit;
}
#btn-gm-refresh-events:hover, #btn-gm-pause:hover, #btn-gm-step-back:hover, #btn-gm-step-forward:hover,
#btn-gm-next-point:hover, #btn-gm-prev-phase:hover, #btn-gm-next-phase:hover, #btn-gm-restart-phase:hover {
  background: var(--rz-cyan-tint);
}
#btn-gm-pause[data-state="paused"] { background: var(--rz-yellow); color: var(--rz-ink); }
#btn-gm-pause[data-state="paused"]:hover { background: #eed100; }

.gm-timeline-controls {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
}
.gm-indicators { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 280px; }
.gm-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px;
  background: rgba(255, 255, 255, 0.92);
  border: none;
  border-radius: var(--rz-pill);
  color: var(--rz-ink-600);
  font-size: 0.74rem;
  line-height: 1.3;
  font-weight: 600;
}
.gm-chip b { color: var(--rz-ink); font-size: 0.78rem; }
#gm-status { color: rgba(255, 255, 255, 0.92); font-size: 0.76rem; white-space: nowrap; min-width: 0; font-weight: 600; }

@media (max-width: 980px) {
  .gm-controls { justify-content: flex-start; width: 100%; }
  #gm-event-select { max-width: 100%; min-width: 180px; }
  .gm-timeline-controls { width: 100%; }
  .gm-indicators { width: 100%; }
  #gm-status { width: 100%; white-space: normal; }
}

/* ── Écran d'authentification ────────────────────────────────── */
#auth-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; box-sizing: border-box;
  background: var(--rz-canvas);
  background-image: radial-gradient(ellipse at 50% -10%, #FFFFFF 0%, var(--rz-canvas) 62%);
}
#auth-screen.hidden { display: none !important; }

/* ── Écran de jeu ────────────────────────────────────────────── */
#game-screen { display: flex; flex-direction: column; height: 100vh; }
#game-screen.hidden { display: none !important; }
#game-screen #game-area { flex: 1; overflow: hidden; }

/* Carte deux panneaux : gauche cyan (formulaires), droite image */
.auth-card {
  display: flex;
  background: var(--rz-cyan);
  border: none;
  border-radius: var(--rz-radius-lg);
  padding: 0;
  width: 900px; max-width: 94vw;
  min-height: 580px;
  overflow: hidden;
  box-shadow: var(--rz-shadow-lg);
  animation: modal-in 0.25s ease;
}
.auth-pane {
  flex: 1 1 50%;
  min-width: 0;
  display: flex; flex-direction: column;
  padding: 32px 40px 28px;
  box-sizing: border-box;
  color: #fff;
}
.auth-step { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.auth-step.hidden { display: none; }
.auth-head { text-align: center; margin-bottom: 20px; }
.auth-logo {
  font-size: 2.1rem;
  font-weight: 900;
  color: #fff;
  text-align: center;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.auth-logo .logo-accent { color: var(--rz-lime); }
.auth-title { margin: 6px 0 2px; font-size: 1.45rem; font-weight: 900; color: #fff; }
.auth-subtitle { font-size: 0.875rem; color: rgba(255, 255, 255, 0.88); text-align: center; margin: 0; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form.hidden { display: none; }
.auth-form input {
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: #fff;
  color: var(--rz-ink);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-form input:focus { border-color: var(--rz-indigo); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35); }

/* Navigation séquentielle (chevron bas de panneau) */
.auth-next {
  margin-top: auto;
  align-self: flex-end;
  display: flex; align-items: center; gap: 8px;
  background: none; border: none;
  padding: 10px 4px 0;
  color: #fff;
  font-size: 0.85rem; font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  opacity: 0.92;
}
.auth-next:hover { opacity: 1; text-decoration: underline; }
.auth-chevron { font-size: 1.9rem; line-height: 1; font-weight: 400; }

/* Panneau image aléatoire */
.auth-hero { flex: 1 1 50%; min-width: 0; }
.auth-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Révélation du persona (post-inscription, affichée une seule fois) */
#persona-reveal { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.pr-head { display: flex; align-items: center; gap: 12px; }
.pr-avatar {
  width: 64px; height: 64px; flex-shrink: 0;
  background: #fff; border-radius: 14px;
  object-fit: contain; padding: 4px; box-sizing: border-box;
}
.pr-name { font-size: 1.15rem; font-weight: 900; }
.pr-row { font-size: 0.83rem; line-height: 1.45; color: rgba(255, 255, 255, 0.94); }
.pr-row strong { color: #fff; }
.pr-pillars { display: flex; align-items: flex-end; justify-content: center; gap: 12px; margin-top: 6px; }
.pr-pillar { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.pr-gauge {
  width: 18px; height: 84px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 9px; overflow: hidden;
  display: flex; align-items: flex-end;
}
.pr-fill { width: 100%; border-radius: 0; }
.pr-pillar-label { font-size: 0.62rem; font-weight: 700; text-align: center; max-width: 58px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Responsive : panneau image masqué sur petits écrans */
@media (max-width: 760px) {
  .auth-card { min-height: 0; width: 440px; }
  .auth-hero { display: none; }
}

/* Bouton primaire générique (auth + modales) : pilule lime */
.auth-submit {
  padding: 12px 20px;
  border-radius: var(--rz-pill);
  border: none;
  background: var(--rz-lime);
  color: var(--rz-ink);
  font-size: 1rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  margin-top: 4px;
}
.auth-submit:hover { background: var(--rz-lime-dark); }
.auth-submit:active { transform: translateY(1px); }
.auth-submit:disabled { background: var(--rz-track); color: var(--rz-ink-400); cursor: not-allowed; }
/* Erreur : texte rouge affiché au-dessus du hero (fond blanc translucide
   pour rester lisible sur le panneau cyan) */
.auth-error {
  color: var(--rz-red);
  font-size: 0.82rem; font-weight: 700;
  min-height: 20px;
  text-align: center;
  margin-bottom: 6px;
}
.auth-error:not(:empty) {
  background: rgba(255, 255, 255, 0.88);
  border-radius: var(--rz-pill);
  padding: 4px 12px;
}

/* Panneau de debug (outil de dev, volontairement sombre/discret) */
#debug-panel{position:fixed;right:12px;bottom:12px;width:300px;max-height:50vh;overflow:auto;background:rgba(26,29,42,0.85);color:#fff;padding:10px;border-radius:12px;font-size:12px}
#debug-panel h3{margin:0 0 6px 0;font-size:14px}
#debug-stats{font-size:12px;margin-bottom:6px}
#debug-content{background:#011;color:#9f9;padding:8px;border-radius:8px;max-height:40vh;overflow:auto}
#btn-debug-clear,#btn-debug-refresh{padding:4px 6px;border-radius:8px;border:0;background:#444;color:#fff}

/* ── Vignettes joueurs dans le HUD ───────────────────────────── */
#players-list { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.player-tile {
  width: 80px;
  min-height: 95px;
  background: var(--rz-card-tint);
  border: 1px solid var(--rz-line);
  border-radius: var(--rz-radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--rz-ink);
  font-size: 11px;
  padding: 8px 4px 14px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(74, 78, 156, 0.10);
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s;
}
.player-tile .name {
  font-weight: 700;
  text-align: center;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 4px;
  font-size: 11px;
}
.player-tile:hover { transform: translateY(-2px); box-shadow: var(--rz-shadow); }
.player-avatar { width: 44px; height: 44px; border-radius: 10px; margin: 0; background: #fff; object-fit: cover; flex-shrink: 0; }
.player-tile-pillars { display: flex; align-items: flex-end; gap: 2px; width: 100%; height: 34px; padding: 0 4px; box-sizing: border-box; }
.player-tile-pillar { flex: 1; height: 100%; background: var(--rz-track); border-radius: 999px; display: flex; align-items: flex-end; overflow: hidden; }
.player-tile-pillar-fill { width: 100%; border-radius: 999px; transition: height 0.35s ease; }
.status-dot { position: absolute; bottom: 5px; right: 5px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff; background: var(--rz-ink-400); box-shadow: 0 1px 3px rgba(26, 29, 42, 0.25); }
.status-dot.online { background: var(--rz-green); }
.status-dot.offline { background: var(--rz-ink-400); }

/* ── Carte de survol persona ─────────────────────────────────── */
.persona-hover-card {
  position: absolute; left: 0; bottom: calc(100% + 10px);
  width: 300px; max-width: min(300px, 70vw);
  padding: 14px 16px;
  border-radius: var(--rz-radius);
  background: var(--rz-card);
  border: 1px solid var(--rz-line);
  box-shadow: var(--rz-shadow-lg);
  color: var(--rz-ink);
  display: none;
  z-index: 15;
}
#user-menu:hover .persona-hover-card, #user-menu:focus-within .persona-hover-card,
.player-tile:hover .persona-hover-card, .player-tile:focus-within .persona-hover-card { display: block; }
.persona-hover-title { font-size: 14px; font-weight: 900; color: var(--rz-ink); margin-bottom: 8px; }
.persona-hover-content { display: flex; align-items: flex-start; gap: 12px; }
.persona-hover-media { width: 92px; flex: 0 0 92px; display: flex; flex-direction: column; gap: 6px; }
.persona-hover-svg { width: 92px; height: 92px; object-fit: contain; border-radius: 12px; background: var(--rz-canvas); border: 1px solid var(--rz-line); padding: 6px; box-sizing: border-box; }
.persona-hover-media-label { font-size: 10px; line-height: 1.25; color: var(--rz-ink-600); word-break: break-word; }
.persona-hover-company { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.persona-hover-company-icon { width: 18px; height: 18px; flex: 0 0 18px; object-fit: contain; border-radius: 4px; background: var(--rz-canvas); }
.persona-hover-company-name { font-size: 11px; font-weight: 700; line-height: 1.2; color: var(--rz-ink); word-break: break-word; }
.persona-hover-position { font-size: 10px; line-height: 1.25; color: var(--rz-ink-600); word-break: break-word; }
.persona-hover-media-fallback { width: 92px; min-height: 92px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 11px; color: var(--rz-ink-600); background: var(--rz-canvas); border: 1px dashed var(--rz-line); border-radius: 12px; padding: 8px; box-sizing: border-box; }
.persona-hover-body { flex: 1; min-width: 0; }
.persona-hover-row { display: flex; flex-direction: column; gap: 3px; font-size: 12px; line-height: 1.35; margin-bottom: 8px; }
.persona-hover-row strong { color: var(--rz-indigo); font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; }
.persona-hover-row span { color: var(--rz-ink); }
.persona-hover-stack { margin-bottom: 10px; }

@media (max-width: 900px) {
  .persona-hover-card { left: auto; right: 0; max-width: min(300px, 85vw); }
  .persona-hover-content { flex-direction: column; }
  .persona-hover-media { width: 100%; flex-basis: auto; }
  .persona-hover-svg, .persona-hover-media-fallback { width: 100%; max-width: 120px; height: 120px; }
}

/* ── Piliers RSE dans le HUD ─────────────────────────────────── */
#rse-pillars { --pillar-gauge-height: 100px; display: flex; flex-direction: column; gap: 6px; padding: 10px 14px; background: var(--rz-card); border-radius: var(--rz-radius); min-width: 0; }
.rse-pillars-title { font-weight: 800; color: var(--rz-ink-600); font-size: 12px; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.rse-pillars-grid { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 6px; overflow: visible; }
.rse-pillar { display: flex; flex-direction: row; align-items: flex-end; padding: 6px 4px; background: var(--rz-card-tint); border: 1px solid transparent; border-radius: 10px; cursor: pointer; transition: all 0.2s ease; gap: 4px; flex-shrink: 0; }
.rse-pillar:hover { background: var(--rz-cyan-tint); border-color: var(--rz-line); }
.rse-pillar-left { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.rse-pillar-name { font-size: 9px; font-weight: 700; color: var(--rz-ink-600); line-height: 1.2; writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; align-self: flex-end; }
.rse-pillar-gauge { width: 20px; height: var(--pillar-gauge-height); background: var(--rz-track); border-radius: 999px; display: flex; align-items: flex-end; overflow: hidden; flex-shrink: 0; }
.rse-pillar-gauge-fill { width: 100%; transition: height 0.5s ease; border-radius: 999px; }
.rse-pillar-score { font-size: 11px; font-weight: 700; color: var(--rz-ink); }
/* Option : masquer la valeur numérique des jauges — décommenter pour activer */
.rse-pillar-score { display: none; }

/* Sélecteur d'avatar (auth) */
#avatar-picker { max-width: 420px; flex-wrap: wrap; }
.avatar-choice { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; cursor: pointer; opacity: 0.9; border: 2px solid transparent; }
.avatar-choice.selected { border-color: var(--rz-cyan); opacity: 1; }

/* ── Modale de session (statique) ────────────────────────────── */
.session-modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--rz-scrim);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.session-modal-overlay.hidden { display: none !important; }
.session-modal-box {
  background: var(--rz-card);
  border: none;
  border-radius: var(--rz-radius-lg);
  padding: 40px 36px;
  width: 440px;
  max-width: 92vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--rz-shadow-lg);
  animation: modal-in 0.2s ease;
}
@keyframes modal-in { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.session-modal-box h2 { color: var(--rz-ink); margin: 0 0 8px; font-size: 1.3rem; font-weight: 900; }
.session-modal-box p { color: var(--rz-ink-600); font-size: 0.875rem; margin: 0 0 22px; line-height: 1.5; }
.session-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  background: var(--rz-card-tint);
  border: 1px solid var(--rz-line);
  border-radius: var(--rz-radius);
  cursor: pointer; margin-bottom: 12px; transition: all 0.15s;
}
.session-card:last-child { margin-bottom: 0; }
.session-card:hover { border-color: var(--rz-cyan); background: var(--rz-cyan-tint); transform: translateY(-2px); box-shadow: var(--rz-shadow); }
.session-card:active { transform: translateY(0); }
.session-card .sc-name { font-weight: 700; color: var(--rz-ink); font-size: 1rem; margin-bottom: 3px; }
.session-card .sc-master { color: var(--rz-ink-600); font-size: 0.8rem; }
.session-card .sc-badge { background: var(--rz-lime-tint); color: #6f7a10; border: 1px solid var(--rz-lime); padding: 4px 14px; border-radius: var(--rz-pill); font-size: 0.75rem; font-weight: 700; white-space: nowrap; margin-left: 14px; flex-shrink: 0; }
.session-waiting { text-align: center; padding: 12px 0 4px; }
.sw-icon { font-size: 3.5rem; margin-bottom: 16px; display: block; animation: pulse-icon 2s ease-in-out infinite; }
.sw-title { font-size: 1.05rem; font-weight: 700; color: var(--rz-ink); margin-bottom: 10px; }
.sw-desc { color: var(--rz-ink-600); font-size: 0.85rem; line-height: 1.7; }
.sw-spinner { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--rz-cyan); margin: 16px auto 0; animation: sw-pulse 1.2s ease-in-out infinite alternate; }
@keyframes pulse-icon { 0%, 100% { transform: scale(1); opacity: 0.9; } 50% { transform: scale(1.12); opacity: 1; } }
@keyframes sw-pulse { from { opacity: 0.2; transform: scale(0.8); } to { opacity: 1; transform: scale(1.2); } }

/* ── Timeline du scénario (sur fond bleu marque) ─────────────── */
.scenario-timeline {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 340px;
  max-width: 500px;
  flex: 1 1 340px;
  padding: 0 4px;
}

.timeline-track {
  position: relative;
  height: 14px;
  border-radius: 7px;
  overflow: visible;
  background: rgba(255, 255, 255, 0.14);
}

.timeline-area-labels {
  position: relative;
  height: 12px;
}

.tl-area-label {
  position: absolute;
  font-size: 9px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transform: translateX(-50%);
  white-space: nowrap;
  pointer-events: none;
}

.timeline-phase {
  position: absolute;
  height: 100%;
  top: 0;
  border-radius: 0;
  opacity: 0.85;
}
.timeline-phase:first-child { border-radius: 7px 0 0 7px; }
.timeline-phase:last-of-type { border-radius: 0 7px 7px 0; }

.tp-onboarding { background: rgba(255, 255, 255, 0.35); }
.tp-scenario   { background: var(--rz-cyan); }
.tp-bilan      { background: var(--rz-lime); }

.timeline-cursor {
  position: absolute;
  top: -3px;
  width: 4px;
  height: 20px;
  background: #fff;
  border-radius: 2px;
  transform: translateX(-50%);
  transition: left 0.6s ease;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
  z-index: 10;
}

.timeline-steps {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.timeline-step-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  pointer-events: all;
  cursor: pointer;
  z-index: 8;
  transition: transform 0.2s;
}
.timeline-step-dot:hover { transform: translate(-50%, -50%) scale(1.6); }
.timeline-step-dot.is-current-week {
  transform: translate(-50%, -50%) scale(1.55);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25), 0 0 10px rgba(255, 255, 255, 0.9);
}
/* Points de la timeline : échelle qualité de l'air Rezilans */
.timeline-step-dot[data-type="softskill"]  { background: var(--rz-purple); }
.timeline-step-dot[data-type="evenement"]  { background: var(--rz-red); }
.timeline-step-dot[data-type="rse_action"] { background: var(--rz-green); }

.timeline-labels {
  position: relative;
  height: 12px;
}
.tl-label {
  position: absolute;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.6);
  transform: translateX(-50%);
  white-space: nowrap;
}

.timeline-week-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  letter-spacing: 0.05em;
}

@media (max-width: 980px) {
  .tl-area-label { font-size: 8px; }
}

/* ════════════════════════════════════════════════════════════════════════
   ENTRAIDE P2P — chat à deux (helpchat.js) : panneau partenaires, invitation,
   chat ancré bas droite, chip événement minimisé. Tokens --rz-*.
   ════════════════════════════════════════════════════════════════════════ */

/* ── Chip « événement minimisé » (haut gauche, sous la topbar) ─────────── */
#ce-minichip {
  position: fixed; top: 64px; left: 12px; z-index: 820;
  background: var(--rz-card); color: var(--rz-ink);
  border: 1px solid var(--rz-line); border-radius: var(--rz-pill);
  box-shadow: var(--rz-shadow); padding: 8px 14px;
  font-family: var(--rz-font); font-size: 13px; font-weight: 700;
  cursor: pointer;
}
#ce-minichip:hover { border-color: var(--rz-brand-blue); }
#ce-minichip.hidden { display: none; }

/* Mode minimisé de l'overlay événement collectif (la carte reste jouable) */
#ce-overlay.ce-overlay--minimized { display: none; }

/* ── Bannière score faible + bouton partenaire (panneau proposition) ───── */
#ce-help-banner {
  background: var(--rz-cyan-tint, #e3f4fc); color: var(--rz-ink);
  border-left: 4px solid var(--rz-cyan);
  border-radius: var(--rz-radius); padding: 10px 14px;
  font-size: 13.5px; line-height: 1.5; margin-bottom: 12px;
}
.ce-find-partner-btn {
  display: inline-block; margin-bottom: 14px;
  background: var(--rz-brand-blue); color: #fff; border: none;
  border-radius: var(--rz-pill); padding: 9px 18px;
  font-family: var(--rz-font); font-size: 13.5px; font-weight: 700;
  cursor: pointer;
}
.ce-find-partner-btn:hover { background: var(--rz-indigo, #3b5698); }

/* ── Panneau partenaires (bas gauche) ──────────────────────────────────── */
#help-partners {
  position: fixed; left: 12px; bottom: 132px; z-index: 830;
  width: min(340px, calc(100vw - 24px));
  background: var(--rz-card); color: var(--rz-ink);
  border: 1px solid var(--rz-line); border-radius: var(--rz-radius-lg);
  box-shadow: var(--rz-shadow-lg); padding: 14px 16px;
  font-family: var(--rz-font);
}
#help-partners.hidden { display: none; }
.hp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.hp-title { font-weight: 800; font-size: 14px; flex: 1; }
#hp-refresh, #hp-close {
  border: 1px solid var(--rz-line); background: var(--rz-card-tint, #f4f8fb);
  color: var(--rz-ink-600); width: 28px; height: 28px; border-radius: 8px;
  cursor: pointer; font-size: 14px; line-height: 1;
}
#hp-refresh:hover, #hp-close:hover { border-color: var(--rz-brand-blue); }
#hp-required {
  background: #fdeef5; border-left: 4px solid var(--rz-magenta);
  border-radius: 8px; padding: 8px 12px; font-size: 12.5px; margin-bottom: 8px;
}
.hp-hint { font-size: 12px; color: var(--rz-ink-600); margin-bottom: 10px; }
#hp-list { display: flex; flex-direction: column; gap: 8px; max-height: 40vh; overflow-y: auto; }
.hp-row {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--rz-line); border-radius: var(--rz-radius);
  padding: 8px 10px; background: var(--rz-card);
}
.hp-info { flex: 1; min-width: 0; }
.hp-name { font-size: 13px; font-weight: 700; }
.hp-strong { color: var(--rz-green-dark, #1e7a46); font-weight: 600; font-size: 11.5px; }
.hp-meta { font-size: 11.5px; color: var(--rz-ink-600); }
.hp-btn {
  border: none; border-radius: var(--rz-pill); padding: 6px 10px;
  font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap;
  font-family: var(--rz-font);
}
.hp-btn-go { background: var(--rz-track); color: var(--rz-ink-600); }
.hp-btn-go:hover { background: var(--rz-line); }
.hp-btn-invite { background: var(--rz-brand-blue); color: #fff; }
.hp-btn-invite:hover { background: var(--rz-indigo, #3b5698); }
.hp-empty, .hp-waiting { font-size: 13px; color: var(--rz-ink-600); padding: 8px 2px; }

/* ── Invitation reçue (toast haut droite) ──────────────────────────────── */
#help-invite {
  position: fixed; top: 64px; right: 12px; z-index: 860;
  width: min(330px, calc(100vw - 24px));
  background: var(--rz-card); color: var(--rz-ink);
  border: 1px solid var(--rz-brand-blue); border-radius: var(--rz-radius-lg);
  box-shadow: var(--rz-shadow-lg); padding: 14px 16px;
  font-family: var(--rz-font);
}
#help-invite.hidden { display: none; }
.hi-title { font-weight: 800; font-size: 14px; margin-bottom: 6px; }
.hi-body { font-size: 13px; line-height: 1.5; }
.hi-persona { color: var(--rz-ink-600); font-size: 12px; }
.hi-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.hi-timer { flex: 1; font-size: 12px; color: var(--rz-ink-600); }
#hi-decline {
  background: var(--rz-track); color: var(--rz-ink-600); border: none;
  border-radius: var(--rz-pill); padding: 7px 14px; font-weight: 700;
  font-size: 12.5px; cursor: pointer; font-family: var(--rz-font);
}
#hi-accept {
  background: var(--rz-green, #2eae5e); color: #fff; border: none;
  border-radius: var(--rz-pill); padding: 7px 16px; font-weight: 700;
  font-size: 12.5px; cursor: pointer; font-family: var(--rz-font);
}
#hi-accept:hover { background: var(--rz-green-dark, #1e7a46); }

/* ── Chat ancré bas droite (non modal) ─────────────────────────────────── */
#help-chat {
  position: fixed; right: 12px; bottom: 132px; z-index: 850;
  width: min(360px, calc(100vw - 24px));
  display: flex; flex-direction: column;
  background: var(--rz-card); color: var(--rz-ink);
  border: 1px solid var(--rz-line); border-radius: var(--rz-radius-lg);
  box-shadow: var(--rz-shadow-lg); font-family: var(--rz-font);
  max-height: min(560px, calc(100vh - 160px));
}
#help-chat.hidden { display: none; }
.hc-head {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 12px 14px 8px; border-bottom: 1px solid var(--rz-line);
}
.hc-head-info { flex: 1; min-width: 0; }
.hc-event { font-weight: 800; font-size: 13.5px; }
#hc-participants { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.hc-chip {
  background: var(--rz-track); color: var(--rz-ink-600);
  border-radius: var(--rz-pill); padding: 2px 8px; font-size: 11px; font-weight: 600;
}
.hc-chip-me { background: var(--rz-cyan-tint, #e3f4fc); color: var(--rz-brand-blue); }
.hc-head-timer { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
#hc-timer {
  font-variant-numeric: tabular-nums; font-weight: 800; font-size: 16px;
  color: var(--rz-ink);
}
#hc-timer.hc-timer-low { color: var(--rz-red); }
#hc-cancel {
  background: none; border: 1px solid var(--rz-line); color: var(--rz-ink-600);
  border-radius: var(--rz-pill); padding: 3px 10px; font-size: 11.5px;
  cursor: pointer; font-family: var(--rz-font);
}
#hc-cancel:hover { border-color: var(--rz-red); color: var(--rz-red); }
.hc-question {
  padding: 8px 14px; font-size: 12px; color: var(--rz-ink-600);
  border-bottom: 1px solid var(--rz-line); line-height: 1.45;
}
#hc-body { display: flex; flex-direction: column; min-height: 0; }
#hc-thread {
  overflow-y: auto; padding: 10px 14px; display: flex; flex-direction: column;
  gap: 8px; min-height: 120px; max-height: 260px;
}
.hc-msg { max-width: 85%; }
.hc-msg-me { align-self: flex-end; }
.hc-msg-peer { align-self: flex-start; }
.hc-msg-text {
  padding: 7px 11px; border-radius: 14px; font-size: 13px; line-height: 1.45;
  white-space: pre-wrap; word-break: break-word;
}
.hc-msg-me .hc-msg-text { background: var(--rz-brand-blue); color: #fff; border-bottom-right-radius: 4px; }
.hc-msg-peer .hc-msg-text { background: var(--rz-track); color: var(--rz-ink); border-bottom-left-radius: 4px; }
.hc-msg-meta { font-size: 10.5px; color: var(--rz-ink-400, #8a90a3); margin-top: 2px; }
.hc-msg-me .hc-msg-meta { text-align: right; }
#hc-typing { min-height: 16px; padding: 0 14px; font-size: 11.5px; color: var(--rz-ink-600); font-style: italic; }
.hc-input-row { display: flex; gap: 6px; padding: 8px 14px 4px; }
#hc-input {
  flex: 1; resize: none; border: 1px solid var(--rz-line);
  border-radius: var(--rz-radius); padding: 8px 10px; font-size: 13px;
  font-family: var(--rz-font); color: var(--rz-ink); background: var(--rz-card);
}
#hc-input:focus { outline: 2px solid var(--rz-cyan); outline-offset: -1px; }
#hc-send {
  background: var(--rz-brand-blue); color: #fff; border: none;
  border-radius: var(--rz-radius); width: 40px; cursor: pointer; font-size: 15px;
}
.hc-propose-btn {
  margin: 6px 14px 12px; background: var(--rz-lime, #b8d94e); color: var(--rz-ink);
  border: none; border-radius: var(--rz-pill); padding: 9px 14px;
  font-weight: 800; font-size: 13px; cursor: pointer; font-family: var(--rz-font);
}
.hc-propose-btn:hover { background: var(--rz-lime-dark, #9fbf35); }
#hc-compose { padding: 10px 14px 12px; }
.hc-compose-title { font-weight: 800; font-size: 13px; margin-bottom: 8px; }
#hc-choices { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.hc-choice {
  text-align: left; border: 1px solid var(--rz-line); border-radius: var(--rz-radius);
  background: var(--rz-card); padding: 8px 12px; font-size: 12.5px;
  cursor: pointer; font-family: var(--rz-font); line-height: 1.4;
}
.hc-choice:hover { border-color: var(--rz-cyan); }
.hc-choice.selected {
  border-color: var(--rz-brand-blue); background: var(--rz-cyan-tint, #e3f4fc);
  font-weight: 700;
}
#hc-freetext {
  width: 100%; box-sizing: border-box; border: 1px solid var(--rz-line);
  border-radius: var(--rz-radius); padding: 8px 10px; font-size: 12.5px;
  font-family: var(--rz-font); resize: vertical; background: var(--rz-card);
  color: var(--rz-ink);
}
.hc-compose-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; }
#hc-back-chat {
  background: var(--rz-track); color: var(--rz-ink-600); border: none;
  border-radius: var(--rz-pill); padding: 8px 14px; font-size: 12.5px;
  font-weight: 700; cursor: pointer; font-family: var(--rz-font);
}
#hc-send-proposal {
  background: var(--rz-magenta); color: #fff; border: none;
  border-radius: var(--rz-pill); padding: 8px 16px; font-size: 12.5px;
  font-weight: 800; cursor: pointer; font-family: var(--rz-font);
}
#hc-send-proposal:disabled { background: var(--rz-line); color: var(--rz-ink-400, #8a90a3); cursor: default; }
#hc-waiting { padding: 18px 16px; font-size: 13.5px; line-height: 1.5; }
.hc-privacy {
  padding: 6px 14px 10px; font-size: 10.5px; color: var(--rz-ink-400, #8a90a3);
  border-top: 1px solid var(--rz-line);
}

@media (max-width: 700px) {
  #help-chat { bottom: 96px; }
  #help-partners { bottom: 96px; }
}

/* ── Vote : auteurs des propositions (dont paires d'entraide) ──────────── */
.ce-prop-authors { font-size: 11.5px; color: var(--rz-ink-600); margin-top: 3px; font-weight: 600; }
.ce-vote-btn:disabled { opacity: .55; cursor: default; }

/* ── Panneau GM entraide (topbar, sous les votes live) ─────────────────── */
#gm-help-panel .gm-help-row {
  border: 1px solid var(--rz-line); border-radius: var(--rz-radius);
  padding: 6px 10px; margin-bottom: 6px; background: var(--rz-card);
  font-size: 12px;
}
.gm-help-row-head { font-weight: 700; }
.gm-help-msg { color: var(--rz-ink-600); padding: 1px 0 1px 10px; }
#gm-help-panel details summary { cursor: pointer; color: var(--rz-brand-blue); font-size: 11.5px; }
.gm-help-edit {
  width: 100%; box-sizing: border-box; margin-top: 6px;
  border: 1px solid var(--rz-line); border-radius: 8px; padding: 6px 8px;
  font-size: 12px; font-family: var(--rz-font); resize: vertical;
}
.gm-help-actions { display: flex; gap: 8px; margin-top: 6px; }
.gm-help-actions button {
  border: none; border-radius: var(--rz-pill); padding: 5px 12px;
  font-size: 11.5px; font-weight: 700; cursor: pointer; font-family: var(--rz-font);
}
.gm-help-actions button:first-child { background: var(--rz-green, #2eae5e); color: #fff; }
.gm-help-actions button:last-child { background: var(--rz-red); color: #fff; }
