/* --- Police personnalisée --- */
@font-face {
  font-family: 'PR Vikings';
  src: url('fonts/PRVikings.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* --- Styles Globaux --- */
body {
  margin: 0;
  padding: 0;
  font-family: 'PR Vikings', serif;
  background: #0f0f0f;
  background-attachment: fixed;
  color: #f0f0f0;
  text-align: center;
}

/* Appliquer la texture sur les pages de catégories */
.with-texture {
  background: #0f0f0f url('images/background_texture.jpg') center center repeat;
}

/* --- Bandeau Principal --- */
.header-banner {
  background: url('images/banner.jpg') center center / cover no-repeat;
  padding: 30px 0;
  margin-bottom: 0;
  position: relative;
  box-shadow: 0 6px 12px rgba(0,0,0,0.8);
}
.header-banner.full {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
}
.header-banner h1 {
  font-size: 3.5em;
  margin: 0;
  color: #F5F5F5;
  text-shadow: 3px 3px 6px rgba(0,0,0,0.7);
  letter-spacing: 3px;
  text-transform: uppercase;
  cursor: pointer;
}

/* --- Navigation dans la Bannière (Accueil) --- */
.banner-nav {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 15px;
  z-index: 10;
}
.banner-nav .nav-btn {
  text-decoration: none;
  background: #F5DEB3;
  color: #3E2C1C;
  padding: 10px 30px;
  border-radius: 5px;
  font-size: 1.1em;
  transition: background 0.3s, transform 0.3s;
  box-shadow: 0 0 8px rgba(0,0,0,0.5);
  min-width: 130px;
}
.banner-nav .nav-btn:hover {
  background: #E8CDA5;
  transform: scale(1.05);
}

/* --- Navigation Secondaire pour les pages de catégories --- */
.nav-buttons {
  margin: 20px auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
}
.nav-buttons .nav-btn {
  text-decoration: none;
  background: #F5DEB3;
  color: #3E2C1C;
  padding: 15px 25px;
  border-radius: 5px;
  font-size: 1.2em;
  transition: background 0.3s, transform 0.3s;
  box-shadow: 0 0 8px rgba(0,0,0,0.5);
}
.nav-buttons .nav-btn:hover {
  background: #E8CDA5;
  transform: scale(1.05);
}

/* --- Bouton Musique --- */
#musicToggle {
  position: fixed;
  top: 10px;
  right: 10px;
  background: rgba(20,20,20,0.75);
  border: 1px solid #e0d8c3;
  color: #e0d8c3;
  padding: 0.5em 1em;
  cursor: pointer;
  font-family: inherit;
  border-radius: 5px;
  transition: background 0.3s;
  z-index: 20;
}
#musicToggle:hover {
  background: rgba(20,20,20,0.9);
}

/* --- Catégories --- */
.category {
  margin: 50px auto;
  width: 90%;
  max-width: 800px;
  padding: 20px;
  border: 2px solid #8B4513;
  border-radius: 10px;
  background: rgba(245,222,179,0.85);
}
.category h2 {
  font-size: 2em;
  margin-bottom: 20px;
  color: #3E2C1C;
  border-bottom: 1px solid #8B4513;
  padding-bottom: 0.5em;
}

/* --- Mise en page Pyramidale --- */
.pyramid {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.pyramid-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}
.pyramid-row ul {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0;
  justify-content: center;
}

/* --- Nodes (Cartes des Personnages) --- */
.node {
  background: #F5DEB3;
  border: 2px solid #8B4513;
  border-radius: 10px;
  padding: 10px;
  width: 200px;
  text-align: center;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
}
.node img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 8px;
}
.node h3 {
  margin: 0.5em 0 0.2em;
  font-size: 1.5em;
  color: #3E2C1C;
}
.node p {
  margin: 0;
  font-size: 1em;
  color: #3E2C1C;
}

/* Pour le node des Nornes (dans Entités du destin) */
.node.nornes {
  width: 300px;
}
.node.nornes img {
  object-fit: contain;
  height: 250px;
}

/* --- Hover Effects par Catégorie --- */
.node.ases:hover {
  box-shadow: 0 0 15px #00BFFF;
}
.node.vanes:hover {
  box-shadow: 0 0 15px #32CD32;
}
.node.destin:hover {
  box-shadow: 0 0 15px #9370DB;
}
.node.creatures:hover {
  box-shadow: 0 0 15px #FFA500;
}
.node.geants:hover {
  box-shadow: 0 0 15px #FF4500;
}

/* --- Popup Modal --- */
.popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.85);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.5s;
  padding: 2em;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.popup-content {
  background: rgba(20,20,20,0.95);
  padding: 1.5em;
  border: 2px solid #e0d8c3;
  border-radius: 10px;
  max-width: 600px;
  width: 90%;
  position: relative;
  text-align: center;
  box-shadow: 0 0 25px #0ff;
}
.popup-content h2 {
  margin-top: 0;
  font-size: 2em;
  color: #e0d8c3;
  border-bottom: 1px dashed #e0d8c3;
  padding-bottom: 0.5em;
}
.popup-content img {
  max-width: 90%;
  max-height: 50vh;
  border-radius: 8px;
  margin: 1em 0;
  box-shadow: 0 0 20px #fff;
}
.popup-content p {
  font-size: 1.2em;
  color: #f0f0f0;
  text-shadow: 1px 1px 3px #000;
}
.close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 2em;
  color: #f0f0f0;
  cursor: pointer;
  transition: color 0.3s;
}
.close:hover {
  color: #e0d8c3;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .category ul, .pyramid {
    flex-direction: column;
    align-items: center;
  }
  .node {
    width: 90%;
  }
}
