body {
  margin: 0;
  background: url("../img/parchment.webp") repeat;
  font-family: "Handlee", cursive;
  font-size: 18px;
  line-height: 1.6em;
  color: #2b1b10;
}

p {
  font-size: 16px;
}

.journal-layout {
  display: flex;
  max-width: 1533px;
  margin: 0 auto;
  padding: 20px;
  gap: 20px;
}

/* Carte */
.map-section {
  flex: 2;
  border: 3px solid #5c2d0c;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
  height: 688px;
}
#map {
  width: 100%;
  height: 688px;
}

 /* --- Navbar --- */
.navbar {
  top: 0;
  left: 0;
  margin-left: -20px;
  margin-right: -20px;
  margin-bottom: 50px;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  background: url('../img/leather.webp');
  background-color: #3a1e0b;
  color: #fdf6e3;
  display: flex;
  justify-content: center;
  padding: 12px 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  z-index: 1000;
}

.navbar .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'IM Fell English SC', serif;
  font-size: 24px;
  font-weight: bold;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.6);
}

.navbar .logo img {
  height: 32px;
  width: 32px;
}

.navbar .nav-links {
  display: flex;
  gap: 20px;
}

.navbar .nav-links a {
  text-decoration: none;
  color: #fdf6e3;
  font-weight: bold;
  font-size: 16px;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.3s;
}

.navbar .nav-links a:hover {
  background: rgba(255,255,255,0.1);
}

/* Visuel et position du bouton */
html {
  scroll-behavior: smooth; /* scroll fluide (sera ignoré si reduced motion) */
}

/* Bouton back-to-top */
.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid rgba(160,121,75,0.95); /* bord cuivre */
  background: linear-gradient(180deg, rgba(60,30,10,0.95), rgba(30,12,6,0.95));
  color: #f7edd6; /* beige parchemin */
  display: grid;
  place-items: center;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity 240ms ease, transform 240ms ease;
  z-index: 2000;
}

.back-to-top:hover {
  box-shadow: 0 8px 16px rgba(0,0,0,0.55);
}

/* État visible */
.back-to-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Respecte les préférences d’accessibilité */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .back-to-top {
    transition: none;
  }
}



/* Journal */
.journal-section {
  flex: 1;
  background: rgba(250, 240, 220, 0.9);
  border: 2px solid #a0794b;
  border-radius: 12px;
  padding: 20px;
  line-height: 1.6em;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.4);
}
.journal-section h1 {
  font-family: "Handlee", cursive;
  font-size: 32px;
  text-align: center;
  margin-bottom: 1em;
  color: #4a2e12;
}
.players-section h2, .players-section-chapitre h2, .player-card .info h3, .journal-section h2 {
  font-family: "Handlee", cursive;
}
#itineraireInfos, #descriptionInfos, #stormInfos {
  margin-bottom: 20px;
  padding: 12px;
  border-left: 4px solid #4a2e12;
  background: rgba(255, 250, 240, 0.9);
}

select {
  width: 100%;
  padding: 6px;
  font-size: 16px;
  margin-bottom: 20px;
  border-radius: 8px;
  border: 1px solid #7a5a3f;
  background: #fdf8f2;
}

/* Portraits en bas */
.players-section, .players-section-chapitre {
  max-width: 1533px;
  margin: 30px auto;
  padding-left: 20px;
  padding-right: 20px;
  padding-bottom: 20px;
  background: rgba(250, 240, 220, 0.95);
  border: 2px solid #a0794b;
  border-radius: 12px;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.4);
}

.players-section h2, .players-section-chapitre h2, .journal-section h2 {
  font-family: "Handlee", cursive;
  font-size: 24px;
  margin-bottom: 20px;
  text-align: center;
  color: #4a2e12;
}

/* Grille à 3 colonnes */
.players-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* Carte joueur */
.player-card {
  position: relative;
  display: inline-block;
  overflow: hidden;
  border-radius: 16px;
  /*box-shadow: 0 4px 10px rgba(0,0,0,0.4);*/
  margin: 10px;
  background: linear-gradient(rgba(245,235,210,0.95), rgba(227,210,174,0.95));/* #f8f4e6;*/
  border: 3px solid #7a5a2c;
  padding-bottom: 8px;
  text-align: center;
  box-shadow:
    0 8px 20px rgba(0,0,0,0.3),
    inset 0 0 20px rgba(255,255,255,0.15);
  transition: all 0.3s ease;
}

.player-card:hover {
  transform: translateY(-6px);
}

.player-card img {
  /*width: 100px;
  height: 100px;
  border-radius: 8px;
  margin-bottom: 8px;
  object-fit: cover;
  border: 2px solid #4a2e12;
  cursor: pointer;
  transition: transform 0.2s;*/

  display: block;
  width: 140px;
  height: 140px;
  margin: 25px auto 15px auto;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #7a5a2c;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  cursor: pointer;
}

/* Contenu */

.player-card .info {
  padding: 20px;
  text-align: center;
  color: #332313;
  font-family: Georgia, serif;
}

.player-card .info h3 {
  margin: 10px 0;
  font-size: 22px;
}

.player-card .info p {
  /*min-height: 60px;*/
  line-height: 1.5;
  font-size: 14px;
}

.player-card .info h5 {
  font-style: italic;
  color: #5c4328;
  margin-top: 10px;
}

/* Ruban diagonal */
.player-card .ribbon {
  background: linear-gradient(to right, #4b3621, #2f2113);
  color: #f3e3c2;
  text-align: center;
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: bold;
  padding: 12px;
  letter-spacing: 1px;
}

.player-card .mort {
  position: absolute;
  top: 0px;
  right: 0px;
  transform: none;
  background: darkred;
  color: white;
  font-size: 14px;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: bold;
  z-index: 10;
  letter-spacing: 1px;
}

.sexe,
.nb_part {
  display: inline-block;
  margin: 10px 6px 0 6px;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: bold;
  background: rgba(75,54,33,0.12);
  position: relative;
}

.sexe {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  font-weight: bold;
  font-family: 'Caveat', cursive;
  font-size: 18px;
  letter-spacing: 0.5px;
  border: 1px solid rgba(0,0,0,0.15);
}

.sexe.homme {
  background: linear-gradient(to bottom, #d7e6f5, #a9c4e3);
  color: #1f3b5c;
  box-shadow: inset 0 0 8px rgba(255,255,255,0.4);
}

.sexe.femme {
  background: linear-gradient(to bottom, #f5d7e6, #e3a9c4);
  color: #5c1f3b;
  box-shadow: inset 0 0 8px rgba(255,255,255,0.4);
}

.sexe.hommefemme {
  background:
    linear-gradient(to bottom, #d7e6f5, #a9c4e3) 0 0 / 50% 100% no-repeat,
    linear-gradient(to bottom, #f5d7e6, #e3a9c4) 100% 0 / 50% 100% no-repeat;
  color: #5c1f3b;
  box-shadow: inset 0 0 8px rgba(255,255,255,0.4);
}

.sexe.autre {
  background: linear-gradient(to bottom, #c3efbb, #abcfac);
  color: #6600cc;
  box-shadow: inset 0 0 8px rgba(255,255,255,0.4);
}

/* Tooltip stylisé */
.tooltip {
  position: absolute;
  bottom: 10%;
  left: 0%;
  transform: translateX(-50%) translateY(-37%); /*translateX(-105%);*/
  background-color: #e7d7a1;
  color: #2a1d0d;
  font-family: "Handlee", cursive;
  font-size: 14px;
  padding: 14px 18px;
  border-radius: 6px;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  box-shadow: 0 6px 12px rgba(0,0,0,0.5);
  z-index: 20;
  width: max-content;
  max-width: 240px;
  text-align: left;

  /* Effet de bord vieilli */
  border: 2px solid #5c3b1e;
  outline: 2px dashed rgba(60,30,10,0.5);
  outline-offset: -6px;
}
/* Apparition au survol */
.player-card .nb_part:hover .tooltip {
  opacity: 1;
}

/* Lightbox */
.lightbox {
  display: none; /* masquée par défaut */
  position: fixed;
  z-index: 1000;
  padding-top: 5%;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background: rgba(0,0,0,0.85);
  text-align: center;
}

.lightbox img {
  max-width: 90%;
  max-height: 80vh;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(255,255,255,0.3);
}

.lightbox .close {
  position: absolute;
  top: 20px;
  right: 40px;
  color: #fff;
  font-size: 36px;
  font-weight: bold;
  cursor: pointer;
}

#cntrl-wrap {
	position: absolute;
	top: 0px;
	width: 100%;
	display: flex;
	justify-content: flex-start;;
	align-items: center;
	padding: .5rem 0;
	z-index: 999999;
}

#cntrl-wrap .cntrl {
	width: 870px;/*25rem;*/
	display: flex;
	flex-direction: row;
	justify-content: start;
	align-items: center;
	padding: .5rem;
	background-color: #fff;
	border-radius: .5rem;
	border: 2px solid #b7b7b7b3;
	overflow: auto;
}

#cntrl-wrap .cntrl .btn {
	color: #1f77a2;
	cursor: pointer;
	border-radius: 5px;
	padding: .25rem .25rem;
	background-color: #5d71db2e;
}

#cntrl-wrap .cntrl .prog-bar-wrap {
	display: flex;
	height: 5px;
	width: 0%;
	padding: 0 .5rem;
	overflow: auto;
}
#prog-bar {
	background-color: #5197e8;
	width: 0%;
	border-radius: 5px;
}

#cntrl-wrap .cntrl .point-info {
	color: #4d4d4d;
	white-space: nowrap;
	background-color: #4d7f9726;
	padding: .25rem;
	border-radius: .5rem;
  width: 100%;
  text-align: center;
}

#region-tooltip {
  position: absolute;
  z-index: 1000; /* CRUCIAL */
  pointer-events: none;
  max-width: 260px;
  background: rgba(20, 15, 15, 0.95);
  color: #e6dccf;
  padding: 12px;
  border-radius: 6px;
  font-family: serif;
}

.hidden {
  display: none;
}

.region-label {
  color: rgba(30, 90, 70, 0.85);
  font-family: "EB Garamond", serif;
  font-size: 20px;
  letter-spacing: 1px;
  pointer-events: none;
}

.storm-btn {
  margin-top: 12px;
  background: linear-gradient(to bottom, #7a5a2c, #4b3621);
  color: #f3e3c2;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  cursor: pointer;
  font-family: Georgia, serif;
  transition: all 0.25s ease;
}

.storm-btn:hover {
  transform: scale(1.05);
}

.figcaption {
  font-size: small;
}


.lexique-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 380px));
  justify-content: center;
  gap: 25px;
}

.lexique-card {
  background: linear-gradient(#f3e4c0, #dbc89c);
  border: 3px solid #7a5a2c;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  transition: all 0.25s ease;
}

.lexique-card:hover {
  transform: translateY(-4px);
}

.lexique-header {
  background: linear-gradient(to right, #4b3621, #2f2113);
  color: #f3e3c2;
  font-family: Georgia, serif;
  font-size: 22px;
  padding: 14px;
  text-align: center;
}

.lexique-content {
  padding: 18px;
  font-family: Georgia, serif;
  color: #332313;
}

.lexique-category {
  display: inline-block;
  background: rgba(122,90,44,0.12);
  padding: 6px 10px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: bold;
}

.lexique-meta {
  margin-top: 8px;
  font-size: 13px;
  font-style: italic;
  color: #5c4328;
}

.lexique-image img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-bottom: 2px solid #7a5a2c;
}

.lexique-infos {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.lexique-genre {
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: bold;
}

/* Masculin */
.lexique-genre.m {
  background: #d7e6f5;
  color: #1f3b5c;
}

/* Féminin */
.lexique-genre.f {
  background: #f5d7e6;
  color: #5c1f3b;
}

/* Neutre / ancien */
.lexique-genre.n {
  background: #e5e5e5;
  color: #333;
}

.lexique-search-container {
  text-align: center;
  margin: 50px 0;
}

.lexique-search {
  width: 100%;
  max-width: 600px;

  padding: 16px 22px;

  border: 3px solid #7a5a2c;
  border-radius: 14px;

  background: linear-gradient(#f3e4c0, #e6d3a5);

  font-family: Georgia, serif;
  font-size: 18px;

  color: #332313;

  box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

.lexique-search:focus {
  outline: none;
  transform: scale(1.02);
}

.codex-toolbar {
  margin: 50px auto;
  text-align: center;
}

.codex-search {
  width: 100%;
  max-width: 500px;
  padding: 14px 20px;
  border: 3px solid #7a5a2c;
  border-radius: 12px;
  background: linear-gradient(#f3e4c0, #dbc89c);
  font-family: Georgia, serif;
  font-size: 16px;
  margin-bottom: 20px;
}

.codex-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.codex-filter,
.codex-filter-2,
.codex-filter-3 {
  background: linear-gradient(#7a5a2c, #4b3621);
  color: #f3e3c2;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-family: Georgia, serif;
  transition: all 0.25s ease;
}

.codex-filter.active,
.codex-filter-2.active,
.codex-filter-3.active {
  transform: scale(1.05);
  color: #4b3621;
  background: linear-gradient(#f3e3c2, #f3e3c2);
  border: 1px solid #4b3621;
}

.codex-title, .codex-title-index {
  position: relative;
  text-align: center;
  margin: 20px 0 40px 0;
  font-family: Georgia, serif;
  font-size: 42px;
  font-weight: bold;
  color: #f3e3c2;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow:
    0 2px 4px rgba(0,0,0,0.3),
    0 0 12px rgba(122,90,44,0.4);
}

.codex-icon {
  display: block;
  font-size: 34px;
  margin-bottom: 10px;
}

.codex-divider {
  display: block;
  margin-top: 12px;
  font-size: 14px;
  color: #9d7741;
  letter-spacing: 8px;
}

.codex-title::before,
.codex-title::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 18%;
  height: 2px;
  background:
    linear-gradient(
      to right,
      transparent,
      #9d7741,
      transparent
    );
}

.codex-title::before {
  left: 5%;
}

.codex-title::after {
  right: 5%;
}

.codex-title-index::before,
.codex-title-index::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 10%;
  height: 2px;
  background:
    linear-gradient(
      to right,
      transparent,
      #9d7741,
      transparent
    );
}

.codex-title-index::before {
  left: 0%;
}

.codex-title-index::after {
  right: 0%;
}

.campaign-stats {
  max-width: 1200px;
  margin: 0px auto;
  /*padding: 30px;*/
}

.stats-title {
  text-align: center;
  font-family: Georgia, serif;
  font-size: 22px;
  /*color: #f1dfb0;*/
  margin-bottom: 30px;
  /*text-shadow: 0 2px 6px rgba(0,0,0,0.4);*/
}

.stats-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.stat-card {
  width: 80px;
  background: linear-gradient(#f3e4c0, #dbc89c);
  border: 3px solid #7a5a2c;
  border-radius: 16px;
  text-align: center;
  padding: 20px;
  box-shadow: 0 8px 15px rgba(0,0,0,0.2);
  transition: all 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.stat-number {
  font-size: 36px;
  font-weight: bold;
  color: #4b3621;
}

.stat-label {
  font-size: 16px;
  margin-top: 8px;
  color: #5c4328;
}

/******************************/
/****** INFOS CHAPITRE ********/
/******************************/

/* ============================================================
   PANNEAU CHAPITRE — #itineraireInfos
   ============================================================ */

/* Réinitialisation du conteneur */
#itineraireInfos {
  padding: 0;
  border-left: none;
  background: none;
  margin-bottom: 0;
}

/* Carte article globale */
.chap-card {
  border-radius: 10px;
  overflow: hidden;
  background: rgba(252, 246, 230, 0.97);
  border: 1px solid rgba(160, 121, 75, 0.5);
  box-shadow: 0 4px 20px rgba(0,0,0,0.18);
}



/* -- Bandeau hero pleine largeur -- */
.chap-hero {
  width: 100%;
  height: 170px;
  background-size: cover;
  background-position: center 20%;
  background-repeat: no-repeat;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border-radius: 10px 10px 0 0;
  transition: filter 0.3s ease;
}
.chap-hero:hover { filter: brightness(1.08); }

/* Bandeau sans image : fond texture cuir + motif */
.chap-hero--no-img {
  background-image:
    repeating-linear-gradient(
      135deg,
      rgba(255,255,255,0.018) 0px,
      rgba(255,255,255,0.018) 1px,
      transparent 1px,
      transparent 8px
    ),
    linear-gradient(160deg, #2e1a0e 0%, #3d2410 40%, #2a160a 70%, #1e0f06 100%);
  cursor: default;
}
.chap-hero--no-img:hover { filter: none; }
 
/* Sur le bandeau sans image : texte un peu plus grand et centré */
.chap-hero--no-img .chap-hero__overlay {
  align-items: center;
  text-align: center;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.0)  0%,
    rgba(0,0,0,0.25) 100%
  );
}

/* Dégradé bas → titre lisible */
.chap-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.55) 0%,
    rgba(0,0,0,0.40) 30%,
    rgba(0,0,0,0.60) 58%,
    rgba(0,0,0,0.82) 80%,
    rgba(0,0,0,0.92) 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px 14px 10px;
  gap: 2px;
  align-items: center;
  text-align: center;
}

.chap-hero__date {
  /*font-family: 'EB Garamond', Georgia, serif;*/
  font-size: 12px;
  color: #ffeec0;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.chap-hero__titre {
  color: #ffeec0 !important;
  margin: 0;
  line-height: 1.2;
  text-shadow:
    0 0 8px rgba(0,0,0,1),
    0 0 16px rgba(0,0,0,1),
    0 2px 4px rgba(0,0,0,1),
    1px 1px 0 rgba(0,0,0,0.9),
    -1px -1px 0 rgba(0,0,0,0.9);
}

.chap-hero__scenario {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 14px;
  font-style: italic;
  color: rgba(180,230,180,0.95);
  text-shadow:
    0 0 6px rgba(0,0,0,1),
    0 1px 3px rgba(0,0,0,1);
  margin-top: 2px;
}

/* -- Corps principal -- */
.chap-card__body {
  padding: 12px 16px 12px;
  min-width: 0;
}

/* -- En-tête -- */
.chap-header { margin-bottom: 6px; }

.chap-date {
  display: block;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 12px;
  color: #8a6640;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.chap-scenario {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 14px;
  font-style: italic;
  color: #5a3a1a;
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(160,121,75,0.1);
  border-left: 3px solid rgba(160,121,75,0.55);
  margin-bottom: 2px;
}
.chap-scenario--clickable {
  cursor: pointer;
  color: #2e7d32;
  transition: background 0.2s;
}
.chap-scenario--clickable:hover { background: rgba(46,125,50,0.1); }
.chap-scenario__picto { font-size: 13px; flex-shrink: 0; }

/* -- Ornement -- */
.chap-ornement {
  text-align: center;
  margin: 8px 0;
  opacity: 0.8;
}

/* -- Corps texte -- */
.chap-detail {
  font-size: 14px;
  line-height: 1.65;
  color: #3a2510;
  margin-bottom: 15px;
  text-align: justify;
}
.chap-detail p { margin: 0; }

/* -- Illustration du chapitre -- */
.chap-illustration {
  text-align: center;
  margin: 20px 0 12px;
}
.chap-illustration img {
  max-width: 100%;
  max-height: 220px;
  width: auto;
  border-radius: 8px;
  border: 2px solid rgba(160,121,75,0.45);
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.chap-illustration img:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

/* -- Événement notable -- */
.chap-evenement {
  background: linear-gradient(135deg, rgba(180,140,60,0.12), rgba(180,140,60,0.05));
  border: 1px solid rgba(160,121,75,0.4);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 15px;
}
.chap-evenement__header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  justify-content: center;
}
.chap-evenement__icon { font-size: 14px; }
.chap-evenement__label {
  font-family: 'IM Fell English SC', Georgia, serif;
  font-size: 12px;
  color: #7a5010;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-decoration: underline;
  text-decoration-color: rgba(120,80,16,0.4);
}
.chap-evenement__texte {
  font-size: 16px;
  color: #3a1a00;
  font-weight: 500;
  text-align: center;
}

/* -- Résumés PDF -- */
.chap-resumes {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 15px;
  justify-content: center;
}
.chap-resume-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 6px;
  background: rgba(178,34,34,0.07);
  border: 1px solid rgba(178,34,34,0.3);
  border-radius: 20px;
  text-decoration: none;
  color: #7a0000;
  font-size: 13px;
  font-family: "Handlee", cursive;
  transition: background 0.2s, box-shadow 0.2s;
}
.chap-resume-btn:hover {
  background: rgba(178,34,34,0.14);
  box-shadow: 0 2px 8px rgba(178,34,34,0.2);
}
.chap-resume-btn__icon { flex-shrink: 0; }

/* -- Étapes du voyage -- */
.chap-etapes { margin-top: 8px; }
 
.chap-etapes__btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(160,121,75,0.35);
  padding: 6px 0;
  font-family: "Handlee", cursive;
  font-size: 15px;
  color: #4a2e12;
  cursor: pointer;
  text-align: left;
  transition: color 0.2s;
}
.chap-etapes__btn:hover { color: var(--rouge-sang); }
 
.chap-etapes__btn-arrow {
  font-size: 10px;
  color: var(--cuivre);
  transition: transform 0.25s;
  display: inline-block;
}
 
.chap-etapes__badge {
  margin-left: auto;
  background: var(--rouge-sang);
  color: #fff;
  font-size: 11px;
  font-family: Georgia, serif;
  border-radius: 10px;
  padding: 1px 7px;
  font-weight: bold;
}
 
.chap-etapes__body {
  margin-top: 10px;
  padding: 0 4px;
}
.chap-etapes__body[hidden] { display: none; }
 
.chap-etapes__hint {
  font-size: 13px;
  color: #8a6a40;
  font-style: italic;
  margin: 0 0 10px;
  font-family: Georgia, serif;
  display: flex;
  align-items: center;
  gap: 5px;
}
.etape-hint-img { font-style: normal; }
 
/* Timeline */
.chap-etapes__list {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}
 
/* Ligne verticale */
.chap-etapes__list::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(to bottom,
    rgba(160,121,75,0.8),
    rgba(160,121,75,0.2)
  );
  border-radius: 2px;
}
 
.etape-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 6px 5px 0;
  border-radius: 6px;
  font-size: 14px;
  position: relative;
  transition: background 0.15s;
  cursor: default;
}
.etape-item:hover { background: rgba(160,121,75,0.07); }
 
/* Numéro bulle */
.etape-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5c2d0c, #3a1a06);
  border: 2px solid rgba(160,121,75,0.6);
  color: #e8d4a0;
  font-family: Georgia, serif;
  font-size: 15px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  position: relative;
  z-index: 1;
  transition: background 0.2s, border-color 0.2s;
}
 
.etape-content {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}
 
.etape-lieu {
  font-weight: 600;
  color: #3a2510;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
 
.etape-region {
  font-size: 12px;
  color: #8a6a40;
  font-style: italic;
  font-family: Georgia, serif;
}
 
.etape-img-icon {
  font-size: 15px;
  opacity: 0.7;
  flex-shrink: 0;
}
 
/* Étape avec illustration */
.etape-has-img {
  cursor: pointer;
}
.etape-has-img .etape-num {
  background: linear-gradient(135deg, #2e6b35, #1a4020);
  border-color: rgba(80,160,80,0.7);
  color: #c8f0c8;
}
.etape-has-img .etape-lieu {
  color: #2e6b35;
  text-decoration: underline dotted rgba(46,107,53,0.5);
}
.etape-has-img:hover .etape-num {
  background: linear-gradient(135deg, #3a8a44, #235228);
  border-color: rgba(100,200,100,0.8);
}
.etape-has-img:hover { background: rgba(46,107,53,0.07); }
 
/* -- Sans image : affiche juste le titre -- */
.chap-card--no-cover .chap-cover { display: none; }

/* -- Sans image : affiche juste le titre -- */
.chap-card--no-cover .chap-cover { display: none; }

/* Intégration du sélecteur au thème Parchemin */
.select2-container--default .select2-selection--single {
  background: #fdf8f2;
  border: 2px solid #7a5a3f;
  border-radius: 8px;
  height: 40px;
  display: flex;
  align-items: center;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #4a2e12;
  font-family: "Handlee", cursive;
  font-size: 18px;
}

/* Menu déroulant et zone de recherche */
.select2-dropdown {
  background: #fdf8f2;
  border: 2px solid #7a5a3f;
  border-radius: 8px;
  font-family: "Handlee", cursive;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  border: 1px solid #a0794b;
  background: #fffdfa;
  border-radius: 4px;
  color: #2b1b10;
}

/* Styles des groupes et options */
.select2-container--default .select2-results__group {
  background-color: rgba(160, 121, 75, 0.15);
  color: #5c2d0c;
  font-weight: bold;
  padding: 6px 10px;
  border-bottom: 1px dashed rgba(122, 90, 44, 0.3);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background: linear-gradient(to right, #7a5a2c, #4b3621) !important;
  color: #f3e3c2 !important;
}

.select2-results__option {
  padding: 8px 12px;
  color: #2b1b10;
}

.select2 {
    margin-bottom: 20px;
}

.chapitres-quick-filters {
  margin-bottom: 12px;
  font-family: "Handlee", cursive;
}

.chapitres-quick-filters .filters-label {
  font-size: 14px;
  color: #5c2d0c;
  font-weight: bold;
  display: block;
  margin-bottom: 5px;
}

/* Conteneur scrollable horizontalement sur mobile pour éviter de casser le layout */
.filters-buttons-container {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: #7a5a3f transparent;
  flex-wrap: wrap;
}

/* Style style "bouton de cuir / parchemin" */
.btn-filter-chap {
  background: #fdf8f2;
  border: 1px solid #7a5a3f;
  color: #4a2e12;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-family: "Handlee", cursive;
  transition: all 0.2s ease;
  white-space: nowrap; /* Évite que le texte passe à la ligne */
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.btn-filter-chap:hover {
  background: #7a5a3f;
  color: #fdf8f2;
}

.btn-filter-chap:active {
  transform: scale(0.95);
}

/* Empêche Select2 de déformer le layout Flexbox sur ordinateur */
.journal-section {
  flex: 1; /* Garde sa proportion d'origine face à la carte */
  min-width: 0; /* TRÈS IMPORTANT : permet aux éléments enfants comme Select2 de rétrécir si nécessaire sans pousser les murs */
}

.map-section {
  flex: 2; /* Garantit que la carte garde ses 2/3 de l'écran sur ordi */
}

/* On force le conteneur Select2 à ne jamais dépasser la largeur de la colonne */
.select2-container {
  max-width: 100% !important;
}

/* Style pour le label des filtres */
.filters-label {
  font-size: 14px;
  color: #5c2d0c;
  font-weight: bold;
  display: block;
  margin-bottom: 5px;
  font-family: "Handlee", cursive;
}

/* On applique le style parchemin au select des scénarios également */
#scenarioSelect + .select2-container .select2-selection--single {
  background: #fbf3eb; /* Teinte légèrement différente pour différencier les menus */
  border: 2px solid #9e734b;
  border-radius: 8px;
  height: 40px;
  display: flex;
  align-items: center;
}

#scenarioSelect + .select2-container .select2-selection--single .select2-selection__rendered {
  color: #5c3a1a;
  font-family: "Handlee", cursive;
  font-size: 16px;
}

/* Version mobile pour le filtre scénario */
@media (max-width: 1024px) {
  #scenarioSelect + .select2-container .select2-selection--single {
    height: 55px;
  }
  #scenarioSelect + .select2-container .select2-selection--single .select2-selection__rendered {
    font-size: 24px;
  }
  .filters-label {
    font-size: 22px;
  }
}

/* Optimisation de la taille des boutons sur Mobile */
@media (max-width: 1024px) {
  .btn-filter-chap {
    padding: 10px 16px;
    font-size: 30px;
    border-radius: 6px;
  }
  .chapitres-quick-filters .filters-label {
    font-size: 25px;
  }

  .select2-container--default .select2-selection--single {
    height: 55px;
  }
  .select2-container--default .select2-selection--single .select2-selection__rendered,
  .select2-dropdown {
    font-size: 26px;
  }
  .select2-container--default .select2-results__group {
    font-size: 24px;
  }

  .chap-hero { height: 200px; }
  .chap-hero__date { font-size: 20px; }
  .chap-hero__titre { font-size: 40px; margin-bottom: 0px; }
  .chap-hero__scenario { font-size: 25px; }
  .chap-detail p { font-size: 25px; }
  .chap-illustration { margin-top: 20px; }
  .chap-etapes__btn { font-size: 30px; margin-bottom: 30px; }
  .chap-resume-btn { font-size: 25px; }
  .etape-item { font-size: 25px; }
  .chap-etapes__hint { font-size: 25px; margin-top: 30px; margin-bottom: 30px; }
  .chap-evenement__icon { font-size: 25px; }
  .chap-evenement__label { font-size: 25px; }
  .chap-evenement__texte { font-size: 25px; }

  .stat-card { width: 90px; }
  .stat-icon { font-size: 35px; margin-bottom: 15px; }
  .stat-number { font-size: 36px; }
  .stat-label { font-size: 21px; margin-top: 10px; }

  .stats-title { font-size: 30px; }

  .players-section, .players-section-chapitre {
    margin: 0px auto;
    padding-top: 30px;
  }

  .journal-section>label {
    font-size: 30px;
  }

  .back-to-top {
    right: 12px;
    bottom: 12px;
    width: 60px;
    height: 60px;
    line-height: 36px;
    font-size: 18px;
  }

  #itineraireSelect {
    font-size: 30px;
  }

  #itineraireInfos p {
    font-size: 30px;
    text-align: left;
  }

  #itineraireInfos h3 {
    font-size: 35px;
  }

  #itineraireInfos h4 {
    font-size: 35px;
  }

  #itineraireInfos h5 {
    font-size: 30px;
  }

  #liste_etapes {
    font-size: 35px;
    line-height: normal;
  }

  #stormInfos {
    font-size: 30px;
    line-height: normal;
  }

  .navbar .nav-links a {
    font-size: 25px;
    letter-spacing: 4px;
    text-align: center;
  }

  .players-card-empty {
    display: none;
  }

  .players-grid {
    grid-template-columns: repeat(1, 1fr);
  }

  .players-section h2, .players-section-chapitre h2, .journal-section h2 {
    font-size: 40px;
    margin-bottom: 40px;
  }

  .player-card .info h3 {
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: 45px;
  }

  .player-card .info p {
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: 30px;
  }

  .player-card .info h5 {
    font-size: 25px;
    margin-bottom: 20px !important;
  }
  
  .player-card .ribbon {
    top: 40px;
    left: -40px;
    font-size: 32px;
    letter-spacing: 1px;
    padding: 22px;
  }

  .player-card .mort {
    top: 0px;
    left: 2px;
    width: 127px;
    line-height: 29px;
    font-size: 19px;
    letter-spacing: 1px;
  }
  .sexe, .nb_part {
    padding: 10px 10px;
    font-size: 40px;
  }

  .figcaption {
    font-size: x-large;
    line-height: 50px;
  }

  .storm-btn{
      font-size: x-large;
      margin-bottom: 20px;
  }

  .tooltip {
      font-size: 30px;
      max-width: 300px;
  }

  .codex-icon {
    margin-bottom: 40px;
  }

  .codex-divider {
    margin-top: 30px;
  }

  .codex-search {
    font-size: 40px;
    margin-bottom: 40px;
  }

  .codex-filter, .codex-filter-2, .codex-filter-3 {
      font-size: 30px;
  }

  .codex-title, .codex-title-index {
    font-size: 28px;
  }

  .codex-title::before,
  .codex-title::after,
  .codex-title-index::before,
  .codex-title-index::after {
    display: none;
  }

  .etape-num {
    width: 35px;
    height: 35px;
    font-size: 30px;
  }

  .etape-lieu {
      font-size: 35px;
  }

  .etape-region {
    font-size: 30px;
  }

  .etape-img-icon {
    font-size: 40px;
  }
}

/* --- SYNERGIE DU CODEX (VERSION FINALE ET CORRIGÉE) --- */

/* 1. Si le filtre "Maître" est actif -> On affiche le Maître, on cache le reste */
.filter-active-master .players-section-chapitre .player-card[data-category="heros"],
.filter-active-master .players-section-chapitre h2:not([data-category="master"]),
.filter-active-master .players-section-chapitre #liste_pnj,
.filter-active-master .players-section-chapitre #liste_lieux {
    display: none !important;
}

/* 2. Si le filtre "Héros" est actif -> On cache le Maître, les Rencontres et les Lieux */
.filter-active-heros .players-section-chapitre .player-card[data-category="master"],
.filter-active-heros .players-section-chapitre h2:not([data-category="heros"]),
.filter-active-heros .players-section-chapitre #liste_pnj,
.filter-active-heros .players-section-chapitre #liste_lieux {
    display: none !important;
}

/* 3. Si le filtre "Rencontres" (PNJ) est actif -> On cache le Maître, les Héros et les Lieux */
.filter-active-rencontres .players-section-chapitre .player-card[data-category="master"],
.filter-active-rencontres .players-section-chapitre .player-card[data-category="heros"],
.filter-active-rencontres .players-section-chapitre h2:not([data-category="rencontres"]),
.filter-active-rencontres .players-section-chapitre #liste_lieux {
    display: none !important;
}

/* 4. Si le filtre "Lieux" est actif -> On cache le Maître, les Héros et les Rencontres */
.filter-active-lieux .players-section-chapitre .player-card[data-category="master"],
.filter-active-lieux .players-section-chapitre .player-card[data-category="heros"],
.filter-active-lieux .players-section-chapitre h2:not([data-category="lieux"]),
.filter-active-lieux .players-section-chapitre #liste_pnj {
    display: none !important;
}

/* --- AJUSTEMENT DES MARGES (MARGIN-TOP) LORSQU'UN FILTRE EST ACTIF --- */

/* Si un filtre spécifique est activé, on passe le margin-top des titres du chapitre à 0 */
.filter-active-master .players-section-chapitre h2,
.filter-active-heros .players-section-chapitre h2,
.filter-active-rencontres .players-section-chapitre h2,
.filter-active-lieux .players-section-chapitre h2 {
    margin-top: 0px !important;
}


/* ── Carte bestiaire enrichie ──────────────────────────── */
.player-card .bestiaire-meta {
  width: 100%;
  padding: 6px 0px 6px;
  text-align: center;
}

.bestiaire-chapitres {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0;
  justify-content: center;
}

.bestiaire-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-family: Georgia, serif;
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bestiaire-badge--chap {
  background: rgba(128,0,0,0.1);
  color: #800000;
  border: 1px solid rgba(128,0,0,0.25);
  cursor: default;
}
.bestiaire-badge--pj {
  background: rgba(46,107,53,0.1);
  color: #2e5a35;
  border: 1px solid rgba(46,107,53,0.25);
}

.bestiaire-toggle {
  background: none;
  border: none;
  font-family: Georgia, serif;
  font-size: 11px;
  color: #7a5a2c;
  cursor: pointer;
  padding: 2px 4px;
  text-decoration: underline dotted;
}
.bestiaire-toggle:hover { color: var(--rouge-sang); }

.bestiaire-pj-list {
  display: none;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.bestiaire-pj-list.open { display: flex; }

.bestiaire-badge--scenario {
  background: rgba(60,40,140,0.1);
  color: #3a2888;
  border: 1px solid rgba(60,40,140,0.25);
  font-style: italic;
}

/* Scénario inline dans badge chapitre (version B) */
.bestiaire-badge__scenario {
  font-size: 10px;
  opacity: 0.75;
  font-style: italic;
}

.bestiaire-badge__scenario {
  font-size: 10px;
  opacity: 0.75;
  font-style: italic;
}

.bestiaire-label {
  font-size: 12px;
  font-family: Georgia, serif;
  color: #8a6640;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 4px 0 2px;
  display: block;
}

/* ── Mini-portraits PJ / relations ────────────────────── */
.mini-portraits {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin: 4px 0 2px;
  align-items: flex-start;
  justify-content: center;
}
.mini-portrait {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}
.mini-portrait img {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  object-position: top;
  border: 2px solid #4a2e12;
  transition: transform 0.2s, box-shadow 0.2s;
}
.mini-portrait img:hover {
  transform: scale(1.12);
  box-shadow: 0 4px 12px rgba(0,0,0,0.45);
}
.mini-portrait__nom {
  font-size: 12px;
  font-family: Georgia, serif;
  color: #5a3a1a;
  text-align: center;
  line-height: 1.2;
  max-width: 52px;
  word-break: auto-phrase;
  align-items: center;
  justify-content: center;
}
.mini-portrait--pj  img { border-color: #2e5a35; margin: 5px auto 10px auto; }
.mini-portrait--rel img { border-color: #7a3a00; margin: 5px auto 10px auto; }
.mini-portrait--dev img { border-color: #7a3a00; margin: 5px auto 10px auto; }
.mini-portrait--inv img { border-color: #6a2888; margin: 5px auto 10px auto; }
.mini-portrait--nav img { border-color: #6a2888; margin: 5px auto 10px auto; }
.mini-portrait--aub img { border-color: #6a2888; margin: 5px auto 10px auto; }
.mini-portrait__more {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  border: 2px dashed rgba(128,0,0,0.35);
  background: rgba(128,0,0,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-family: Georgia, serif;
  color: #800000;
  cursor: pointer;
  transition: background 0.2s;
}
.mini-portrait__more:hover { background: rgba(128,0,0,0.12); }
.mini-portraits--hidden { display: none; }

/* Badge groupe sur les cartes */
.groupe-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    font-family: 'EB Garamond', serif;
    letter-spacing: 0;
    z-index: 2;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.groupe-badge--1 { background: aliceblue; color: #1a0a00; }
.groupe-badge--2 { background: burlywood; color: #1a0a00; }

/* Séparateur entre groupes dans la grille */
.groupe-separator {
    width: 100%;
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0 4px;
}
.groupe-separator::before,
.groupe-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--or);
    opacity: 0.4;
}
.groupe-separator span {
    font-family: 'IM Fell English SC', serif;
    color: var(--or);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    white-space: nowrap;
}

/* ==========================================================================
   MODULE DES ÉVÉNEMENTS LIÉS AUX CHAPITRES
   ========================================================================== */

/* Conteneur global de l'interaction (placé dans le corps du chapitre) */
.chap-events-wrapper {
  margin: 18px 0;
  width: 100%;
}

/* Bouton principal élégant pour afficher/masquer les événements */
.chap-events-toggle-btn {
  width: 100%;
  padding: 10px 14px;
  background: linear-gradient(to bottom, #fdf8f2, #f3e5d0);
  border: 1px solid #7a5a2c;
  border-radius: 6px;
  color: #5c2d0c;
  font-family: "Handlee", cursive;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
  transition: all 0.2s ease-in-out;
}

.chap-events-toggle-btn:hover {
  background: linear-gradient(to bottom, #fbf2e3, #e8d3b4);
  border-color: #5c2d0c;
  color: #b22222;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* Flèche d'indication d'état (s'inverse au dépliage) */
.chap-events-toggle-btn::after {
  content: "▼";
  font-size: 10px;
  margin-left: auto;
  transition: transform 0.25s ease;
  color: #7a5a2c;
}

.chap-events-toggle-btn.open::after {
  transform: rotate(-180deg);
  color: #b22222;
}

/* Bloc déroulant masqué par défaut */
.chap-events-dropdown {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 2px 0;
}

/* Micro-carte stylisée pour un événement individuel */
.mini-ev-card {
  background: linear-gradient(135deg, rgba(160,121,75,0.09), rgba(122,90,44,0.03));
  border: 1px solid rgba(160, 121, 75, 0.35);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

/* En-tête de l'événement (Émoji + Titre) */
.mini-ev-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.mini-ev-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.mini-ev-title {
  margin: 0;
  font-family: 'IM Fell English SC', Georgia, serif;
  font-size: 16px;
  color: #5c2d0c;
  letter-spacing: 0.3px;
  line-height: 1.2;
}

/* Mini Onglets discrets de tonalité de description */
.ev-desc-tabs {
  /*display: inline-flex;
  gap: 4px;
  background: rgba(122, 90, 44, 0.08);
  border-radius: 4px;
  padding: 2px;
  margin-bottom: 10px;*/
  display: inline-flex;
  background: rgba(122, 90, 44, 0.1);
  border: 1px solid rgba(122, 90, 44, 0.3);
  border-radius: 6px;
  padding: 2px;
  margin-bottom: 10px;
}

.ev-tab-btn {
  font-family: Georgia, serif;
  font-size: 11px;
  background: transparent;
  border: none;
  color: #5a3a1a;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
}

.ev-tab-btn.active {
  background: #7a5a2c;
  color: #f3e4c0;
}

/* Zone textuelle dynamique */
.ev-desc-contents {
  font-size: 14px;
  line-height: 1.5;
  color: #3a2510;
  text-align: justify;
}

.ev-desc-text {
  display: none; /* Géré par l'activation JS */
}

.ev-desc-text.active {
  display: block;
}

/* Style poétique particulier (italique avec liseré gauche) */
.ev-desc-text.type-narration, .ev-desc-text.type-poesie, .ev-desc-text.type-humour {
  font-style: italic;
  color: #6e421f;
  padding-left: 8px;
  border-left: 2px solid rgba(160, 121, 75, 0.35);
}

/* Bloc Média toujours visible lorsque le menu est déroulé */
.ev-media-block {
  margin-top: 12px;
  border-top: 1px dashed rgba(160, 121, 75, 0.25);
  padding-top: 12px;
  text-align: center;
}

/* Image d'illustration cliquable */
.ev-image-wrapper img {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid rgba(160, 121, 75, 0.4);
  background-color: rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s;
}

.ev-image-wrapper img:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 10px rgba(92, 45, 12, 0.2);
}

/* ==========================================================================
   MODULE DES ÉVÉNEMENTS LIÉS AUX CHAPITRES
   ========================================================================== */

/* Conteneur global de l'interaction (placé dans le corps du chapitre) */
.chap-events-wrapper {
  margin: 15px 0;
  width: 100%;
}

/* Bouton principal élégant pour afficher/masquer les événements */
.chap-events-toggle-btn {
  width: 100%;
  padding: 10px 14px;
  background: linear-gradient(to bottom, #fdf8f2, #f3e5d0);
  border: 1px solid #7a5a2c;
  border-radius: 6px;
  color: #5c2d0c;
  font-family: "Handlee", cursive;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
  transition: all 0.2s ease-in-out;
}

.chap-events-toggle-btn:hover {
  background: linear-gradient(to bottom, #fbf2e3, #e8d3b4);
  border-color: #5c2d0c;
  color: #b22222;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* Flèche d'indication d'état (s'inverse au dépliage) */
.chap-events-toggle-btn::after {
  content: "▼";
  font-size: 10px;
  margin-left: auto;
  transition: transform 0.25s ease;
  color: #7a5a2c;
}

.chap-events-toggle-btn.open::after {
  transform: rotate(-180deg);
  color: #b22222;
}

/* Bloc déroulant masqué par défaut */
.chap-events-dropdown {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 2px 0;
}

/* Micro-carte stylisée pour un événement individuel */
.mini-ev-card {
  background: linear-gradient(135deg, rgba(160,121,75,0.09), rgba(122,90,44,0.03));
  border: 1px solid rgba(160, 121, 75, 0.35);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

/* En-tête de l'événement (Émoji + Titre) */
.mini-ev-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.mini-ev-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.mini-ev-title {
  margin: 0;
  font-family: 'IM Fell English SC', Georgia, serif;
  font-size: 16px;
  color: #5c2d0c;
  letter-spacing: 0.3px;
  line-height: 1.2;
}

/* Mini Onglets discrets de tonalité de description */
.ev-desc-tabs {
  display: inline-flex;
  gap: 4px;
  background: rgba(122, 90, 44, 0.08);
  border-radius: 4px;
  padding: 2px;
  margin-bottom: 10px;
}

.ev-tab-btn {
  font-family: "Handlee", cursive;
  font-size: 12px;
  background: transparent;
  border: none;
  color: #5a3a1a;
  padding: 3px 10px;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.ev-tab-btn:hover {
  color: #b22222;
}

.ev-tab-btn.active {
  background: #7a5a2c;
  color: #fdf8f2;
}

/* Zone textuelle dynamique */
.ev-desc-contents {
  font-size: 14px;
  line-height: 1.5;
  color: #3a2510;
  text-align: justify;
}

.ev-desc-text {
  display: none; /* Géré par l'activation JS */
}

.ev-desc-text.active {
  display: block;
}

/* Style poétique particulier (italique avec liseré gauche) */
.ev-desc-text.type-poesie {
  font-style: italic;
  color: #6e421f;
  padding-left: 8px;
  border-left: 2px solid rgba(160, 121, 75, 0.35);
}

/* Bloc Média toujours visible lorsque le menu est déroulé */
.ev-media-block {
  margin-top: 12px;
  border-top: 1px dashed rgba(160, 121, 75, 0.25);
  padding-top: 12px;
  text-align: center;
}

/* Image d'illustration cliquable */
.ev-image-wrapper img {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid rgba(160, 121, 75, 0.4);
  background-color: rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s;
}

.ev-image-wrapper img:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 10px rgba(92, 45, 12, 0.2);
}


/* ==========================================================================
   MODULE DES RÉSUMÉS DE CHAPITRE (MIS À JOUR AVEC LIENS PDF)
   ========================================================================== */

.chap-resumes-wrapper {
  margin: 15px 0;
  width: 100%;
}

/* Bouton principal pour dérouler les récits/résumés */
.chap-resumes-toggle-btn {
  width: 100%;
  padding: 10px 14px;
  background: linear-gradient(to bottom, #fdf8f2, #eae0cf);
  border: 1px solid #5c2d0c;
  border-radius: 6px;
  color: #3a1e05;
  font-family: "Handlee", cursive;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
  transition: all 0.2s ease-in-out;
}

.chap-resumes-toggle-btn:hover {
  background: linear-gradient(to bottom, #fbf2e3, #ddccb3);
  color: #800000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.chap-resumes-toggle-btn::after {
  content: "▼";
  font-size: 10px;
  margin-left: auto;
  transition: transform 0.25s ease;
  color: #5c2d0c;
}

.chap-resumes-toggle-btn.open::after {
  transform: rotate(-180deg);
  color: #800000;
}

/* Conteneur des résumés */
.chap-resumes-dropdown {
  margin-top: 10px;
  background: rgba(253, 248, 242, 0.4);
  border: 1px solid rgba(92, 45, 12, 0.25);
  border-radius: 8px;
  padding: 12px;
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.03);
}

/* Barre d'onglets pour naviguer entre Détails, Résumé 1... */
.resume-tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  border-bottom: 1px solid rgba(92, 45, 12, 0.2);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.resume-tab-btn {
  font-family: "Handlee", cursive;
  font-size: 13px;
  background: rgba(92, 45, 12, 0.05);
  border: 1px solid rgba(92, 45, 12, 0.2);
  border-radius: 4px 4px 0 0;
  color: #5c2d0c;
  padding: 4px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.resume-tab-btn:hover {
  background: rgba(92, 45, 12, 0.1);
  color: #800000;
}

.resume-tab-btn.active {
  background: #5c2d0c;
  border-color: #5c2d0c;
  color: #fdf8f2;
}

/* Zone de contenu textuel */
.resume-contents {
  font-size: 14.5px;
  line-height: 1.55;
  color: #2b1b10;
  text-align: justify;
}

.resume-pane {
  display: none;
}

.resume-pane.active {
  display: block;
}

/* Signature de l'auteur */
.resume-author-signature {
  text-align: right;
  font-family: "Handlee", cursive;
  font-style: italic;
  font-size: 13px;
  color: #800000;
  margin-top: 8px;
  display: block;
}

/* --- Bloc d'accès au fichier PDF lié --- */
.resume-pdf-link-container {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px dashed rgba(92, 45, 12, 0.2);
  display: flex;
  align-items: center;
}

/* Le lien hypertexte du fichier */
.resume-pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "Handlee", cursive;
  font-size: 13px;
  color: #800000;
  text-decoration: none;
  font-weight: bold;
  padding: 3px 6px;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.resume-pdf-link:hover {
  background: rgba(128, 0, 0, 0.08);
  color: #b22222;
  text-decoration: underline;
}

/* Icône PDF stylisée en CSS pur à côté du texte */
.resume-pdf-link::before {
  content: "📕"; /* Icône émoji explicite de livre rouge / PDF */
  font-size: 14px;
  line-height: 1;
}

/* ==========================================================================
   MODULE DES ÉTAPES DE VOYAGE (MIS À JOUR ET HARMONISÉ)
   ========================================================================== */

.chap-etapes-wrapper {
  margin: 15px 0;
  width: 100%;
}

.chap-etapes-toggle-btn {
  width: 100%;
  padding: 10px 14px;
  background: linear-gradient(to bottom, #fdf8f2, #eaddca);
  border: 1px solid #5c2d0c;
  border-radius: 6px;
  color: #3a1e05;
  font-family: "Handlee", cursive;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
  transition: all 0.2s ease-in-out;
}

.chap-etapes-toggle-btn:hover {
  background: linear-gradient(to bottom, #fbf2e3, #d9c4aa);
  color: #800000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.chap-etapes-toggle-btn::after {
  content: "▼";
  font-size: 10px;
  margin-left: auto;
  transition: transform 0.25s ease;
  color: #5c2d0c;
}

.chap-etapes-toggle-btn.open::after {
  transform: rotate(-180deg);
  color: #800000;
}

.chap-etapes-dropdown {
  margin-top: 10px;
  background: rgba(253, 248, 242, 0.4);
  border: 1px solid rgba(92, 45, 12, 0.25);
  border-radius: 8px;
  padding: 12px;
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.03);
}

/* Style de la liste ul interne */
.chap-etapes-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Intégration de vos éléments .etape-item existants */
.chap-etapes-list .etape-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(92, 45, 12, 0.15);
  border-radius: 6px;
  transition: background 0.2s, box-shadow 0.2s;
}

.chap-etapes-list .etape-item.etape-has-img {
  cursor: pointer;
}

.chap-etapes-list .etape-item.etape-has-img:hover {
  background: rgba(160, 121, 75, 0.08);
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.chap-etapes-list .etape-num {
  background: #5c2d0c;
  color: #fdf8f2;
  width: 22px;
  height: 22px;
  font-size: 12px;
  font-weight: bold;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chap-etapes-list .etape-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  line-height: 1.3;
}

.chap-etapes-list .etape-lieu {
  font-weight: bold;
  font-size: 14px;
  color: #2b1b10;
}

.chap-etapes-list .etape-region {
  font-size: 12px;
  color: #6e5540;
  font-style: italic;
}

.chap-etapes-list .etape-img-icon {
  font-size: 14px;
  opacity: 0.7;
}


/* ==========================================================================
   AJUSTEMENTS RESPONSIVES (TABLETTES & MOBILES)
   ========================================================================== */

@media (max-width: 1024px) {
  .player-card img {
    width: 200px;
    height: 200px;
  }

  /* Événements */
  .chap-events-toggle-btn { font-size: 20px; padding: 14px; }
  .mini-ev-title { font-size: 24px; }
  .ev-tab-btn { font-size: 18px; padding: 6px 14px; }
  .ev-desc-contents { font-size: 22px; }
  .ev-image-wrapper img { max-height: 260px; }

  /* Résumés */
  .chap-resumes-toggle-btn { font-size: 20px; padding: 14px; }
  .resume-tab-btn { font-size: 18px; padding: 8px 16px; }
  .resume-contents { font-size: 22px; }
  .resume-author-signature { font-size: 18px; }
  .resume-pdf-link { font-size: 18px; }
  .resume-pdf-link::before { font-size: 18px; }

  /* Étapes de voyage */
  .chap-etapes-toggle-btn { font-size: 20px; padding: 14px; }
  .chap-etapes-list .etape-num { width: 32px; height: 32px; font-size: 18px; }
  .chap-etapes-list .etape-lieu { font-size: 22px; }
  .chap-etapes-list .etape-region { font-size: 18px; }
  .chap-etapes-list .etape-img-icon { font-size: 20px; }
}

/* Evolutions pjs */
.evolution-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 15px 0;
  }

  .portrait-evolution {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.2s ease-in-out, transform 0.2s ease;
    cursor: pointer;
  }

  .portrait-evolution.fading {
    opacity: 0.2;
  }

  .timeline-controls {
    width: 80%;
    margin-top: 10px;
  }

  .timeline-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: #7a5a2c;
    outline: none;
    border-radius: 2px;
  }

  .timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: darkred;
    border: 2px solid #fff;
    cursor: pointer;
    transition: transform 0.1s ease;
  }

  .timeline-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
  }

  .timeline-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75em;
    color: #7a5a2c;
    font-weight: bold;
    margin-top: 4px;
  }

  .timeline-labels span.active {
    color: darkred;
  }

  @media (max-width: 1024px) {
    .timeline-slider {
      height: 8px;
    }

    .timeline-labels {
      font-size: 2em;
    }
  }

  /* ==========================================================================
   MODULE DE LA GALERIE PHOTO DU CHAPITRE
   ========================================================================== */

.chap-galerie-wrapper {
  margin: 20px 0;
  width: 100%;
}

.chap-galerie-toggle-btn {
  width: 100%;
  padding: 10px 14px;
  background: linear-gradient(to bottom, #fdf8f2, #eaddca);
  border: 1px solid #5c2d0c;
  border-radius: 6px;
  color: #3a1e05;
  font-family: "Handlee", cursive;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
  transition: all 0.2s ease-in-out;
}

.chap-galerie-toggle-btn:hover {
  background: linear-gradient(to bottom, #fbf2e3, #d9c4aa);
  color: #800000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.chap-galerie-toggle-btn::after {
  content: "▼";
  font-size: 10px;
  margin-left: auto;
  transition: transform 0.25s ease;
  color: #5c2d0c;
}

.chap-galerie-toggle-btn.open::after {
  transform: rotate(-180deg);
  color: #800000;
}

.chap-galerie-dropdown {
  margin-top: 10px;
  background: rgba(253, 248, 242, 0.4);
  border: 1px solid rgba(92, 45, 12, 0.25);
  border-radius: 8px;
  padding: 12px;
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.03);
}

/* Grille de cartes pour la galerie */
.galerie-grid {
  display: flex;
  flex-wrap: wrap;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  justify-content: center;
}

.galerie-item {
  background: linear-gradient(#f3e4c0, #dbc89c);
  border: 2px solid #7a5a2c;
  border-radius: 8px;
  padding: 6px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  transition: transform 0.2s ease;
}

.galerie-item:hover {
  transform: translateY(-3px);
}

.galerie-thumb {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #4a2e12;
  cursor: pointer;
  display: block;
  margin: 0 auto;
  transition: filter 0.2s;
}

.galerie-thumb:hover {
  filter: brightness(1.1);
}

/* Ajustements mobiles */
@media (max-width: 1024px) {
  .chap-galerie-toggle-btn { font-size: 20px; padding: 14px; }
  .galerie-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .galerie-thumb { width: 140px; height: 140px; }
}

/* Lorsque le filtre Galerie est actif dans un chapitre */
body.filter-active-galerie .players-section-chapitre h2:not([data-category="galerie"]),
body.filter-active-galerie .players-section-chapitre .players-grid {
  display: none !important;
}

body.filter-active-galerie #chapGalerieWrapper,
body.filter-active-galerie h2[data-category="galerie"] {
  display: block !important;
}