/* =========================================================
   FONDS
   ========================================================= */
.fond-souterrains {
  background-image: url("../images/fonds/fond_souterrains.webp");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: #e8eeee;
}

.fond-araignee {
  background-image: url("../images/fonds/fond_araignee.webp");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: #e8eeee;
}

.fond-araignee-morte {
  background-image: url("../images/fonds/fond_araignee_morte.webp");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: #e8eeee;
}

.fond-sphinx {
  background-image: url("../images/fonds/fond_sphinx.webp");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: #e8eeee;
}

.fond-passage-bloque {
  background-image: url("../images/fonds/fond_passage_bloque.webp");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: #e8eeee;
}

.fond-passage-ouvert {
  background-image: url("../images/fonds/fond_passage_ouvert.webp");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: #e8eeee;
}

.fond-sol-code {
  background-image: url("../images/fonds/fond_sol_code.webp");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: #e8eeee;
}

.fond-joueur-mort {
  background-image: url("../images/fonds/fond_joueur_mort.webp");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: #e8eeee;
}

/* =========================================================
   CONTENU : pas de grand espace inutile
   ========================================================= */

.content_souterrains {
  max-width: 1200px;
  margin: 0.5rem auto 0; /* beaucoup moins d'espace sous le header */
  padding: 0 1rem;

  display: flex;
  justify-content: center;
}

/* =========================================================
   TEXTE SOUTERRAIN (VOILE)
   ========================================================= */

.texte-souterrain {
  max-width: 420px;
  padding: 1.5rem 2rem;

  background:
    radial-gradient(
      circle at center,
      rgba(50,80,90,0.25),
      rgba(20,30,35,0.05) 70%
    );

  border-left: 1px solid rgba(140,170,170,0.35);

  text-shadow: 0 1px 4px rgba(0,0,0,0.8);

  opacity: 0.75;
}

/* =========================================================
   TITRE : discret, gravé, pas dominant
   ========================================================= */

.texte-souterrain h1 {
  margin: 0 0 1.2rem 0;

  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: 0.12em;

  color: #d2c58a;
  text-transform: uppercase;
  text-align: center;

  opacity: 0.75;
}

/* =========================================================
   TEXTE
   ========================================================= */

.texte-souterrain p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: #e4eded;
}

/* =========================================================
   INDICES / CHIFFRES IMPORTANTS (strong)
   ========================================================= */

.texte-souterrain strong {
  font-weight: 700;
  color: #e6d89c; /* or pâle, déjà cohérent avec tes titres */

  letter-spacing: 0.12em;

  padding: 0.05em 0.3em;
  margin: 0 0.1em;

  background: rgba(230, 216, 156, 0.08);
  border-radius: 3px;

  text-shadow:
    0 0 6px rgba(230, 216, 156, 0.35),
    0 1px 2px rgba(0, 0, 0, 0.9);
}

/* =========================================================
   LIEN : TORCHE DES SOUTERRAINS
   ========================================================= */

.lien-caverne {
  display: inline-block;
  margin-top: 1.2rem;
}

.lien-caverne a {
  position: relative;

  color: #f3c27a;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.12em;

  padding-left: 1.8rem; /* place pour la flamme */

  text-shadow:
    0 0 6px rgba(255,180,90,0.5),
    0 0 14px rgba(200,110,30,0.35),
    0 1px 2px rgba(0,0,0,0.9);

  animation: lueur-torche 4.2s ease-in-out infinite;
}

.lien-caverne a::before {
  content: "";

  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);

  width: 10px;
  height: 16px;

  background: radial-gradient(
    ellipse at center,
    #ffd27d 0%,
    #ff9b3c 45%,
    #c45a1a 70%,
    transparent 75%
  );

  border-radius: 50% 50% 45% 45%;

  box-shadow:
    0 0 6px rgba(255,160,70,0.6),
    0 0 14px rgba(200,90,20,0.45);

  animation: flamme-torche 1.8s infinite ease-in-out;
}

@keyframes lueur-torche {
  0% {
    opacity: 0.85;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.88;
  }
}

@keyframes flamme-torche {
  0% {
    transform: translateY(-50%) scale(1);
    opacity: 0.85;
  }
  40% {
    transform: translateY(-55%) scale(1.08);
    opacity: 1;
  }
  70% {
    transform: translateY(-48%) scale(0.95);
    opacity: 0.9;
  }
  100% {
    transform: translateY(-50%) scale(1);
    opacity: 0.88;
  }
}

/* =======================================================
   ✉️ ENVELOPPE VOLANTE — MISSIVE
   ======================================================= */
.enveloppe-volante {
  position: absolute; /* ⬅️ CRUCIAL */
  top: 30%;
  left: 10%;

  width: 90px;
  height: 60px;

  background: url("../images/icones/lettre.webp") no-repeat center;
  background-size: contain;

  cursor: pointer;
  z-index: 20;

  transition: transform 0.2s ease;
}

.enveloppe-volante:hover {
  transform: scale(1.1);
}

/* =========================================================
   CORRECTION MOBILE — TEXTE SOUS FOOTER
   ========================================================= */

@media (max-width: 768px) {

  .content_souterrains {
    padding-bottom: 8rem; /* espace pour respirer avant le footer */
  }

  .texte-souterrain {
    margin-bottom: 4rem;
  }

}

/* === OVERLAY LETTRE === */
.overlay-lettre {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.overlay-lettre.active {
  opacity: 1;
  pointer-events: auto;
}

.lettre-container {
  background: #fdf6e3;
  color: #333;
  max-width: 500px;
  padding: 2rem 2.5rem;
  border-radius: 12px;
  box-shadow: 0 0 50px rgba(0,0,0,0.7);
  font-family: "Libre Baskerville", serif;
  text-align: left;
  transform: translateY(-50px);
  opacity: 0;
  animation: lettre-slide-in 0.7s forwards;
}

.overlay-lettre.active .lettre-container {
  animation: lettre-slide-in 0.7s forwards;
}

.lettre-container h2 {
  margin-top: 0;
  font-size: 1.8rem;
  color: #b85c38;
  text-align: center;
}

.lettre-container p {
  margin-top: 1rem;
  font-size: 1rem;
  line-height: 1.6;
}

/* Bouton fermeture */
.close-lettre {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 2rem;
  color: #b85c38;
  background: transparent;
  border: none;
  cursor: pointer;
}

/* Animation apparition lettre */
@keyframes lettre-slide-in {
  0% {
    opacity: 0;
    transform: translateY(-50px) rotate(-2deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
}


@media (max-width: 768px) {

  .texte-souterrain {
    padding-top: 0.8rem;
  }
  
  .texte-souterrain h1 {
    font-size: 1.05rem;
    letter-spacing: 0.08em;
    margin-bottom: 0.8rem;
  }
}

@media (orientation: portrait) {
  .fond-joueur-mort {
    background-position-x: 85%;
    background-position-y: center;
  }
  .fond-araignee {
	background-position-x: 75%;
    background-position-y: center;
  }
  .fond-sphinx {
	background-position-x: 75%;
    background-position-y: center;
  }
}