html, body {
  margin: 0;
  padding: 0;
  overflow: hidden; /* coupe scroll horizontal + vertical */
  width: 100%;
  height: 100%;
}

/* Fond de la salle */
.fond-genealogies {
  background-image: url("../images/fonds/fond_genealogies.webp");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: #fff;
}

.genealogie-single {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 1rem auto;
  height: calc(80vh - 60px); /* fixe la hauteur du conteneur pour centrer image et flèches */
}

.arbre-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  perspective: 1500px;
  position: relative;
  overflow: hidden;
}

.arbre {
  max-width: 100%;
  max-height: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0,0,0,0.7);
  opacity: 0;
  transform: rotateY(90deg);
  transition: transform 0.8s ease, opacity 0.8s ease;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotateY(90deg);
}

.arbre.active {
  opacity: 1;
  transform: translate(-50%, -50%) rotateY(0deg);
}

/* Flèches */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.6);
  border: none;
  color: #ffd700;
  font-size: 2.5rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: 5px;
  z-index: 10;
}

.nav-btn.left { left: -2rem; }
.nav-btn.right { right: -2rem; }

.nav-btn:hover {
  background: rgba(0,0,0,0.8);
}

/* Responsive */
@media (max-width: 800px) {
  .arbre { max-height: 60vh; }
  .nav-btn { font-size: 2rem; }
  .nav-btn.left { left: -1rem; }
  .nav-btn.right { right: -1rem; }
}
