:root {
    --nero-sporco: #12110e;
    --rosso-scuro: #7b1f1f;
    --bianco: #f5f5f5;
    --oro-gradient: linear-gradient(135deg, #8a7a3a, #5a4d2a, #c0a86a, #5a4d2a);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--nero-sporco);
    color: var(--bianco);
    font-family: 'Georgia', serif;
    min-height: 100vh;
}

header {
    position: relative;
    border-bottom: 6px solid transparent;
    border-image: var(--oro-gradient) 1;
    overflow: hidden;
    height: 350px; /* Altezza fissa per header */
}

header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: brightness(0.5); /* scurisce l'immagine per miglior contrasto */
}

/* Animazione per il titolo */
@keyframes textPulseGlow {
  0%, 100% {
    text-shadow:
      0 0 6px #c0a86a,
      0 0 10px #c0a86a,
      0 0 20px #8a7a3a,
      0 0 30px #c0a86a,
      0 0 40px #5a4d2a;
    opacity: 1;
  }
  50% {
    text-shadow:
      0 0 12px #f9d967,
      0 0 18px #f9d967,
      0 0 28px #c0a86a,
      0 0 38px #f9d967,
      0 0 48px #c0a86a;
    opacity: 0.85;
  }
}
/* Stile per il titolo all'interno dell'header */
header h1 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    font-size: 10rem;
    font-weight: 700;
    font-family: 'MedievalSharp', cursive, serif;
    color: var(--rosso-scuro);
    animation: textPulseGlow 3s ease-in-out infinite; /* Cambiato in textPulseGlow */
    pointer-events: none;
}

@media (max-width: 600px) {
  header {
    height: 220px; /* più compatto */
  }

  header h1 {
    font-size: 3.5rem; /* ridotto da 10rem */
    text-align: center;
    padding: 0 10px; /* per evitare overflow orizzontale */
    line-height: 1.2;
  }
}
@media (max-width: 768px) {
  header {
    height: 280px;
  }

  header h1 {
    font-size: 6rem;
  }
}


/*------------------------------------*/
/* Stile per la sezione intro */
.intro {
    background: var(--nero-sporco);
    padding: 40px 20px;
    text-align: center;
}

.intro .container {
    max-width: 800px;
    margin: 0 auto;
}

.intro h2 {
    font-family: 'MedievalSharp', cursive, serif;
    color: var(--rosso-scuro);
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
}

.intro p {
    font-family: 'Georgia', serif;
    font-size: 1.2rem;
    color: var(--bianco);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}
/*Pergamena stile intro*/
.pergamena {
    position: relative;
    background: #fdf4dc;
    background-image:
      radial-gradient(circle at top left, #fff9d8, transparent 70%),
      radial-gradient(circle at bottom right, #f2e6b9, transparent 70%),
      radial-gradient(ellipse 20% 10% at 25% 40%, rgba(90,70,40,0.15) 0%, transparent 80%),
      radial-gradient(ellipse 15% 12% at 60% 70%, rgba(80,65,35,0.12) 0%, transparent 90%);
    border: 4px solid #c8b36d;
    border-radius: 15px;
    box-shadow:
      inset 0 0 15px #c8b36d,
      3px 3px 10px rgba(0,0,0,0.3);
    padding: 30px 40px;
    color: #5a4d2a;
    font-family: 'Georgia', serif;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
    text-align: center;
    clip-path: polygon(
      5% 0%, 95% 0%, 100% 5%, 100% 95%, 95% 100%, 5% 100%, 0% 95%, 0% 5%
    );
    overflow: visible;
    z-index: 0;
}

/* Ombra interna irregolare per usura */
.pergamena::before {
    content: "";
    position: absolute;
    top: 10px; bottom: 10px; left: 10px; right: 10px;
    border-radius: 12px;
    pointer-events: none;
    z-index: 1;
    clip-path: inherit;

    background:
      /* macchie irregolari più numerose e sparse, più trasparenti */
      radial-gradient(ellipse 18px 9px at 8% 25%, rgba(90,70,40,0.07) 60%, transparent 100%),
      radial-gradient(ellipse 22px 13px at 22% 15%, rgba(80,60,35,0.05) 55%, transparent 100%),
      radial-gradient(ellipse 14px 10px at 35% 50%, rgba(100,80,50,0.04) 50%, transparent 100%),
      radial-gradient(ellipse 26px 16px at 45% 70%, rgba(85,65,40,0.06) 55%, transparent 100%),
      radial-gradient(ellipse 20px 12px at 55% 40%, rgba(95,75,45,0.05) 50%, transparent 100%),
      radial-gradient(ellipse 17px 11px at 70% 30%, rgba(100,80,50,0.04) 50%, transparent 100%),
      radial-gradient(ellipse 12px 10px at 82% 60%, rgba(90,70,40,0.06) 50%, transparent 100%),
      radial-gradient(ellipse 16px 9px at 88% 20%, rgba(85,65,40,0.05) 50%, transparent 100%),

      /* linee sottili irregolari per graffi, più sfumate */
      linear-gradient(30deg, transparent 45%, rgba(60,40,20,0.03) 46%, rgba(60,40,20,0.03) 54%, transparent 55%),
      linear-gradient(120deg, transparent 48%, rgba(70,50,25,0.02) 49%, rgba(70,50,25,0.02) 52%, transparent 53%);
}


/* Macchie nere irregolari sul bordo (grandi, più esterne) */
.pergamena::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 15px;
  pointer-events: none;
  box-shadow:
    inset 0 0 30px 5px rgba(0,0,0,0.2),
    inset 0 0 60px 15px rgba(0,0,0,0.1);
  z-index: 2;
}


/* Titoli dentro la pergamena */
.pergamena h2 {
    color: #7b5e1e; /* oro/marrone più scuro */
    font-family: 'MedievalSharp', cursive, serif;
    font-size: 2.7rem;
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(255 255 255 / 0.7);
}

/* Paragrafo nella pergamena */
.pergamena p {
    font-size: 1.2rem;
    color: #5a4d2a;
    margin: 0 auto;
    max-width: 600px;
}

/*------------------------------------*/

.master-profile-section {
    display: flex;
    justify-content: center;
    padding: 20px;
    background-color: #0c0b09;

}

.profile-container {
    border: 10px solid transparent;
    border-radius: 15px;
    padding: 6px;
    background:
      linear-gradient(#1a140a, #1a140a) padding-box,
      linear-gradient(135deg, #8a7a3a, #5a4d2a, #c0a86a, #5a4d2a) border-box;
    box-shadow:
      0 0 25px rgba(202, 174, 68, 0.25),
      inset 0 0 40px rgba(0, 0, 0, 0.5);
    max-width: 280px;
    margin-top: 200px;
}

.profile-frame {
    background-color: #1c150d;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 0 25px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
}

.profile-image-container {
    background: radial-gradient(circle at center, rgba(0,0,0,0.6), rgba(0,0,0,0.9));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.profile-icon {
    width: 100%;
    object-fit: cover;
    border: 2px solid #5a4d2a;
    box-shadow: inset 0 0 15px #000;
    filter: sepia(35%) contrast(110%) brightness(0.9);
    border-radius: 4px;
}

.profile-title {
    font-family: 'Cinzel Decorative', serif;
    background: linear-gradient(90deg, #5a4d2a, #8a7a3a, #5a4d2a);
    color: #f3e2a9;
    font-size: 1.4rem;
    padding: 6px 0;
    text-align: center;
    border-top: 2px solid #c0a86a;
    border-bottom: 1px solid #3a321f;
    text-shadow: 1px 1px 2px #000;
    letter-spacing: 1px;
}

.profile-info {
    padding: 10px;
    font-family: 'MedievalSharp', cursive;
    font-size: 0.85rem;
    background-color: rgba(0, 0, 0, 0.4);
    color: #eee;
}

.section-title {
    text-align: center;
    font-weight: bold;
    font-size: 1rem;
    color: #c0a86a;
    margin-bottom: 6px;
    border-bottom: 1px solid #5a4d2a;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    padding-bottom: 3px;
    border-bottom: 1px solid rgba(192, 168, 106, 0.2); /* dorato trasparente */
}


.info-cell.label {
    color: #c0a86a;
    font-weight: bold;
    width: 40%;
}

.info-cell.value {
    color: #f5f5f5;
    width: 60%;
}
@media (max-width: 600px) {
  .master-profile-section {
    padding: 10px;
    flex-direction: column;
    align-items: center;
  }

  .profile-container {
    width: 100%;
    max-width: 280px;
    margin-top: 60px;
    padding: 1px;
    margin-left: auto;
    margin-right: auto;
  }

  .profile-title {
    font-size: 1.1rem;
    padding: 4px 0;
  }

  .profile-info {
    font-size: 0.75rem;
    padding: 8px;
  }

  .section-title {
    font-size: 0.9rem;
  }

  .info-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .info-cell.label,
  .info-cell.value {
    width: 100%;
  }

  .info-cell.label {
    margin-bottom: 2px;
  }
}
@media (max-width: 768px) {
    .profile-container {
        width: 100%;
        max-width: 250px; /* o 300px per ancora più compattezza */
    }

    .profile-title {
      font-size: 1.2rem;
    }

    .profile-info {
      font-size: 0.8rem;
    }
}

/*------------------------------------*/

/*warper intro e altro tra itro e profilo*/
.intro-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

.intro-layout {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 60px;
    max-width: 1200px;
}

/* Centra e limita la larghezza della pergamena */
.intro .pergamena {
    margin: 0 auto;
    max-width: 1000px;
}

/* Rimuove eventuali bordi o margini dal titolo */
.intro .pergamena h2 {
    border: none;
    margin-top: 0;
    padding-top: 0;
}

/* Centra la card profilo e la rende elegante */
.profile-container {
    display: flex;
    justify-content: center;
    flex: 0 0 400px;
}


/*-------------------------------------*/
/*Footer styles */
.chest-footer {
    margin-top: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    z-index: 9999;
    position: relative;
    flex-shrink: 0;
}

/* Coperchio dello scrigno */
.chest-lid {
    width: 90%;
    max-width: 800px;
    height: 40px;
    background: linear-gradient(to bottom, #5c4420, #3e2f14);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    border: 3px solid #c0a86a;
    border-bottom: none;
    box-shadow: inset 0 4px 6px rgba(0,0,0,0.4), 0 2px 5px rgba(0,0,0,0.5);
}

/* Corpo dello scrigno */
.chest-body {
    width: 90%;
    max-width: 800px;
    padding: 20px;
    background: linear-gradient(to bottom, #4a3218, #2e1f0f);
    border: 3px solid #c0a86a;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    box-shadow: inset 0 -4px 6px rgba(0,0,0,0.4), 0 3px 8px rgba(0,0,0,0.6);
    color: #f0e6c8;
    font-family: 'Georgia', serif;
    text-align: center;
    position: relative;
}

.chest-lid,
.chest-body {
    background-image:
        repeating-linear-gradient(
            45deg,
            rgba(92, 68, 32, 0.2) 0px,
            rgba(92, 68, 32, 0.2) 2px,
            transparent 2px,
            transparent 4px
        ),
        linear-gradient(to bottom, #5c4420, #3e2f14);
}

/* Lucchetto al centro */
.lock-icon {
    font-size: 2.5rem;
    color: #d4b26a;
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.7);
    position: absolute;
    top: 0%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

/* Contenuti nascosti */
.footer-contents.hidden {
    visibility: hidden;
    opacity: 0;
    height: 0;
    overflow: hidden;
    transition: opacity 0.5s ease;
}

.footer-contents {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.5s ease, max-height 1s ease;
}

.footer-contents.revealed {
    max-height: 500px; /* abbastanza grande per contenere tutto */
    opacity: 1;
}


/* Link footer ( invisibili per ora) */
.footer-links a {
    margin: 6px 12px;
    color: #d4b26a;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    animation: lootFade 0.4s forwards;
    animation-play-state: paused;
    text-shadow: 0 0 4px rgba(255, 223, 100, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}



@keyframes lootFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.footer-links a:hover {
    color: #fffbe6;
    text-shadow: 0 0 5px #c0a86a;
    opacity: 0.7;
}

.footer-links img {
    width: 18px;
    height: 18px;
    filter: brightness(1.4);
    transition: transform 0.3s ease;
}

.footer-links a:hover img {
    transform: scale(1.1);
}


.footer-note {
    margin-top: 15px;
    font-size: 0.9rem;
    color: #c9bb9d;
    margin-top: 8px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
    text-align: center;
}

.footer-credit {
    position: absolute;
    bottom: 6px;
    left: 10px;
    font-size: 0.7rem;
    color: #aaa;
}

.footer-credit a {
    color: #bbb;
    text-decoration: underline;
}

/* Tremolio del lucchetto */
@keyframes shake {
    0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
    20% { transform: translate(-50%, -50%) rotate(-15deg); }
    40% { transform: translate(-50%, -50%) rotate(15deg); }
    60% { transform: translate(-50%, -50%) rotate(-10deg); }
    80% { transform: translate(-50%, -50%) rotate(10deg); }
}

.shake-lock {
    animation: shake 0.6s ease;
}

/* Caduta verso il basso */
@keyframes drop {
    0% { transform: translate(-50%, -50%) rotate(0deg); opacity: 1; }
    100% { transform: translate(-50%, 200px) rotate(180deg); opacity: 0; }
}

.drop-lock {
    animation: drop 1s forwards;
}

/*---------------------------------------------------------------------------*/
/*tip del giorno */
.tip-container {
    max-width: 280px;
    margin: 20px auto 0 auto; /* margine top e centratura orizzontale */
    padding: 12px 16px;
    border-radius: 12px;
    background:
      linear-gradient(#1a140a, #1a140a) padding-box,
      linear-gradient(135deg, #8a7a3a, #5a4d2a, #c0a86a, #5a4d2a) border-box;
    border: 6px solid transparent;
    box-shadow:
      0 0 15px rgba(202, 174, 68, 0.3),
      inset 0 0 30px rgba(0, 0, 0, 0.5);
    font-family: 'MedievalSharp', cursive, serif;
    color: #f3e2a9;
    text-align: center;
}


.tip-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px #000;
}

.tip-text {
    font-size: 0.9rem;
    line-height: 1.4;
    color: #eee;
    text-shadow: 0 0 2px #3a321f;
}
/*--------------------------------------------------------------------------*/  

.intro-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 60px 40px;
    max-width: 1200px;
    margin: 0 auto;
    align-items: start; /* Assicura che gli elementi partano dall'alto */
}

.profile-container {
    margin-top: 150px; /* Abbassa il profile-container */
    grid-column: 2;
    grid-row: 1;
}

.tip-container {
    grid-column: 2;
    grid-row: 2;
    margin-top: -320px; /* Regola questo valore per avvicinare il tip al profile */
}

@media (max-width: 900px) {
    .intro-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .profile-container,
    .tip-container {
        grid-column: 1;
    }
    .profile-container {
        margin-top: 0; /* Resetta su mobile */
    }
    .tip-container {
        margin-top: 20px; /* Spazio normale su mobile */
    }
}

/*---------------------------------------------------------------------------*/
/* Separator ornament */
.medieval-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 40px auto;
    max-width: 600px;
    gap: 20px;
    opacity: 0.8;
}

.medieval-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, transparent, #bfa24a, transparent);
    box-shadow: 0 0 6px rgba(191, 162, 74, 0.4);
}

.medieval-icon {
    font-size: 1.8rem;
    color: #bfa24a;
    text-shadow: 0 0 6px rgba(191, 162, 74, 0.4);
}

/*---------------------------------------------------------------------------*/
/*fanart styles */
.fanart-section {
  max-width: 650px; /* un po' più largo */
  background: #1a140a;
  border: 6px solid #a38c4a;
  border-radius: 18px;
  padding: 15px 10px 20px; /* più padding in basso */
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
  color: #f0e4c0;
  height: 650px; /* più alto per spazio verticale */
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fanart-title {
  font-family: 'MedievalSharp', cursive;
  text-align: center;
  font-size: 1.6rem;
  margin-bottom: 12px;
  color: #d4b26a;
  text-shadow: 1px 1px 3px black;
}

.fanart-wrapper {
  position: relative;
  overflow: hidden;
  flex-grow: 1; /* usa tutto lo spazio verticale */
  width: 100%;
}

.fanart-carousel {
  position: relative;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.carousel-image {
  position: absolute;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.8s ease-in-out;
  z-index: 0;
  width: 100%;  /* larghezza piena */
  display: flex;
  flex-direction: column;
  align-items: center;
}

.carousel-image.active {
  opacity: 1;
  transform: translateX(0);
  z-index: 2;
}

.carousel-image.prev {
  opacity: 0;
  transform: translateX(-100%);
  z-index: 1;
}

.carousel-image.next {
  opacity: 0;
  transform: translateX(100%);
  z-index: 1;
}

.carousel-image img {
  width: 100%;       /* Occupa tutta la larghezza del container */
  max-height: 480px; /* Limita l'altezza massima */
  height: auto;      /* Mantiene proporzioni corrette */
  border-radius: 12px;
  border: 2.5px solid #c0a86a;
  box-shadow: 0 0 16px rgba(212, 178, 106, 0.6);
  object-fit: contain; /* Mantiene l’immagine contenuta senza ritagli */
  display: block;       /* Rimuove spazi bianchi sotto immagine */
  margin: 0 auto;       /* Centra l'immagine se più piccola */
}


.caption {
  margin-top: 10px;
  background: rgba(161, 138, 74, 0.85); /* box dorato semitrasparente */
  padding: 6px 14px;
  border-radius: 8px;
  width: 90%;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: #2b1e00;
  text-shadow: none;
  white-space: nowrap; /* una sola riga */
  overflow: hidden;
  text-overflow: ellipsis; /* se troppo lungo, tronca con "..." */
}

/* ----------------------------------------------------------------------------*/
/*lightbox styles */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(20, 14, 3, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 9999;
  cursor: zoom-out;
}

.lightbox-overlay.hidden {
  display: none;
}

.lightbox-overlay img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 14px;
  border: 3px solid #a38c4a;
  box-shadow: 0 0 30px #d4b26acc;
  cursor: default;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2.5rem;
  color: #d4b26a;
  background: none;
  border: none;
  cursor: pointer;
  user-select: none;
  z-index: 10000;
  text-shadow: 1px 1px 3px black;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  color: #d4b26a;
  background: none;
  border: none;
  cursor: pointer;
  user-select: none;
  padding: 0 10px;
  text-shadow: 1px 1px 3px black;
  z-index: 10000;
}

#lightboxPrev {
  left: 20px;
}

#lightboxNext {
  right: 20px;
}

.lightbox-caption {
  margin-top: 10px;
  color: #e8d7a2;
  font-family: 'MedievalSharp', cursive;
  font-size: 1.2rem;
  text-align: center;
  max-width: 90vw;
  user-select: none;
}

/*---------------------------------------------------------------------------*/
/* news pergamena */
.news-section {
  max-width: 650px;
  background: #1a140a;
  border: 6px solid #a38c4a;
  border-radius: 18px;
  padding: 15px 10px 20px;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
  color: #f0e4c0;
  height: 650px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: 'MedievalSharp', cursive;
}

.news-title {
  font-size: 1.6rem;
  margin-bottom: 12px;
  color: #d4b26a;
  text-shadow: 1px 1px 3px black;
  text-align: center;
}

.news-scroll {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 10px;
}

.news-pergamena {
  background: linear-gradient(135deg, #f9f5dc 0%, #cbbf88 100%);
  border: 4px solid #a38c4a;
  border-radius: 16px;
  box-shadow:
    inset 0 0 12px rgba(163, 140, 74, 0.7),
    0 6px 12px rgba(0, 0, 0, 0.5);
  color: #3b2f0a;
  padding: 20px;
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: height 0.5s ease, padding 0.5s ease;
  height: 60px; /* Altezza chiusa */
  overflow: hidden;
}

.news-pergamena.open {
  height: auto; /* si apre */
  padding: 20px;
}

.news-header {
  font-weight: bold;
  font-size: 1.2rem;
  text-align: center;
}

.news-content {
  margin-top: 15px;
  font-size: 1rem;
  line-height: 1.4;
  display: none;
}

.news-pergamena.open .news-content {
  display: block;
}

/* aggiungiamo un “bordo rotto” come effetto pergamena chiusa */
.news-pergamena::before,
.news-pergamena::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: #a38c4a;
  top: 12px;
  border-radius: 50%;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.4);
  transition: background 0.3s ease;
}

.news-pergamena::before {
  left: 8px;
}

.news-pergamena::after {
  right: 8px;
}

.news-pergamena.open::before,
.news-pergamena.open::after {
  background: transparent;
}

/*---------------------------------------------------------------------------*/
/* Media Gallery e news Wrapper */
.media-gallery-wrapper {
  display: flex;
  justify-content: center;
  gap: 40px; /* Riduciamo il gap per dispositivi più piccoli */
  margin: 30px auto;
  max-width: 1400px;
  flex-wrap: wrap; /* Permette alle colonne di andare a capo su schermi piccoli */
  padding: 0 20px; /* Aggiunge padding per evitare che tocchino i bordi */
}

.fanart-section,
.news-section {
  width: 100%; /* Occupa tutta la larghezza disponibile */
  max-width: 650px; /* Massima larghezza */
  min-width: 300px; /* Larghezza minima prima di andare a capo */
  flex: 1 1 600px; /* Cresce e si riduce con base 600px */
}

@media (max-width: 1300px) {
  .media-gallery-wrapper {
    gap: 30px; /* Riduci ulteriormente il gap su schermi medi */
  }
}

@media (max-width: 768px) {
  .media-gallery-wrapper {
    flex-direction: column; /* Disposizione verticale su mobile */
    align-items: center;
    gap: 40px;
  }
  
  .fanart-section,
  .news-section {
    flex: 1 1 auto; /* Ripristina il comportamento normale */
    height: auto; /* Altezza automatica su mobile */
    min-height: 500px; /* Altezza minima ridotta */
  }
}

/*---------------------------------------------------------------------------*/
.news-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 2px solid #a38c4a;
    margin: 15px 0;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

.news-header span {
    cursor: pointer;
    user-select: none;
}

.news-pergamena {
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.news-pergamena:last-child {
    margin-bottom: 0;
}

/*---------------------------------------------------------------------------*/
/* Menu Hamburger - Stile Medievale Funzionante */
.hamburger-menu {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10000; /* Assicurati che sia sopra tutto */
}

.hamburger-btn {
    width: 50px;
    height: 50px;
    background: #7b1f1f;
    border: 3px solid #c0a86a;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
    position: relative;
    z-index: 10001;
}

.hamburger-btn:hover {
    background: #5a1a1a;
    box-shadow: 0 0 15px rgba(123, 31, 31, 0.7);
}

.hamburger-line {
    width: 60%;
    height: 3px;
    background: #c0a86a;
    margin: 4px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Stato attivo */
.hamburger-menu.active .hamburger-line:nth-child(1) {
    transform: translateY(11px) rotate(45deg);
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg);
}

/* Overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(18, 17, 14, 0.9);
    z-index: 9999;
    display: none;
}

.hamburger-menu.active .menu-overlay {
    display: block;
}

/* Contenuto del menu */
.menu-content {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: #000000;
    border-right: 5px solid #c0a86a;
    box-shadow: 5px 0 15px rgba(0,0,0,0.5);
    transform: translateX(-100%);
    transition: transform 0.4s ease;
    z-index: 10000;
    overflow-y: auto;
    padding-top: 80px;
}

.hamburger-menu.active .menu-content {
    transform: translateX(0);
}

/* Voci di menu */
.menu-nav {
    padding: 20px;
}

.menu-nav a {
    display: block;
    padding: 15px;
    margin: 15px 0;
    color: #c0a86a;
    text-decoration: none;
    font-family: 'MedievalSharp', cursive;
    font-size: 1.2rem;
    text-align: center;
    border: 2px solid #c0a86a;
    border-radius: 8px;
    background: rgba(123, 31, 31, 0.7);
    animation: buttonPulseGlow 3s infinite; /* Cambiato in buttonPulseGlow */
    transition: all 0.3s ease;
}

.menu-nav a:hover {
    background: rgba(90, 26, 26, 0.9);
    transform: scale(1.05);
    box-shadow: 0 0 15px #f9d967;
}

@keyframes buttonPulseGlow {
    0%, 100% {
        box-shadow: 0 0 5px #c0a86a;
    }
    50% {
        box-shadow: 0 0 15px #f9d967;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .menu-content {
        width: 250px;
    }
    
    .menu-nav a {
        padding: 12px;
        font-size: 1.1rem;
    }
}
/*---------------------------------------------------------------------------*/
/* FAQ Button - Stile Medievale */
.faq-container {
  position: fixed;
  bottom: 20px;
  left: 20px; /* Cambiato da right a left */
  z-index: 1000;
}

.faq-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: 
    linear-gradient(135deg, 
      #c0a86a 0%, 
      #8a7a3a 30%, 
      #5a4d2a 70%, 
      #8a7a3a 100%);
  color: #12110e;
  border: 3px solid #12110e;
  cursor: pointer;
  font-size: 30px;
  box-shadow: 
    0 2px 10px rgba(0, 0, 0, 0.5),
    inset 0 0 15px rgba(192, 168, 106, 0.7);
  transition: all 0.3s ease;
  text-shadow: 
    0 1px 0 rgba(255, 255, 255, 0.3),
    0 -1px 0 rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Effetto venature del legno */
.faq-toggle::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    linear-gradient(90deg, transparent 60%, rgba(0, 0, 0, 0.1) 60.5%, transparent 61%),
    linear-gradient(0deg, transparent 60%, rgba(0, 0, 0, 0.1) 60.5%, transparent 61%);
  background-size: 20px 20px;
  opacity: 0.5;
  pointer-events: none;
}

.faq-toggle:hover {
  background: 
    linear-gradient(135deg, 
      #f9d967 0%, 
      #c0a86a 30%, 
      #8a7a3a 70%, 
      #c0a86a 100%);
  transform: scale(1.1);
  box-shadow: 
    0 0 20px rgba(202, 174, 68, 0.7),
    inset 0 0 20px rgba(255, 235, 150, 0.5);
  color: #12110e;
}

.faq-panel {
  position: absolute;
  bottom: 70px;
  left: 0;
  width: 320px;
  max-height: 500px;
  overflow-y: auto;
  background: linear-gradient(to bottom, #fdf4dc, #cbbf88);
  border: 4px solid #a38c4a;
  border-radius: 16px;
  box-shadow: 
    inset 0 0 12px rgba(163, 140, 74, 0.7),
    0 6px 20px rgba(0, 0, 0, 0.6);
  color: #3b2f0a;
  padding: 20px;
  display: none;
  font-family: 'MedievalSharp', cursive;
    background: 
    linear-gradient(to bottom, #fdf4dc, #cbbf88),
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path fill="%23a38c4a" opacity="0.1" d="M0 50 Q25 40 50 50 Q75 60 100 50 L100 55 Q75 65 50 55 Q25 45 0 55 Z"/></svg>');
  background-size: auto, 100px 100px;
  border: 4px solid #a38c4a;
}

.faq-panel.show {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.faq-title {
  font-size: 1.5rem;
  color: #7b5e1e;
  margin-bottom: 15px;
  text-align: center;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.7);
  border-bottom: 2px solid #a38c4a;
  padding-bottom: 10px;
}

.faq-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  border-bottom: 1px solid rgba(163, 140, 74, 0.5);
  padding-bottom: 10px;
}

.faq-question {
  background: none;
  border: none;
  color: #5a4d2a;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  width: 100%;
  text-align: left;
  padding: 8px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'MedievalSharp', cursive;
  transition: color 0.3s ease;
}

.faq-question:hover {
  color: #7b5e1e;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #5a4d2a;
}

.faq-item.open .faq-answer {
  max-height: 300px;
  padding: 8px 0;
}

.faq-item.open .faq-arrow {
  transform: rotate(180deg);
}

.faq-arrow {
  transition: transform 0.3s ease;
  font-size: 14px;
  color: #7b5e1e;
}

.faq-panel::-webkit-scrollbar {
  width: 8px;
}

.faq-panel::-webkit-scrollbar-track {
  background: rgba(163, 140, 74, 0.2);
  border-radius: 4px;
}

.faq-panel::-webkit-scrollbar-thumb {
  background: #a38c4a;
  border-radius: 4px;
}

.faq-panel a {
  color: #7b1f1f;
  text-decoration: underline;
  font-weight: bold;
}

.faq-panel a:hover {
  color: #7b5e1e;
}

/*---------------------------------------------------------------------------*/
/*generator styles */
.generator-main {
  padding: 40px 20px;
  font-family: 'MedievalSharp', cursive;
  background: #12110e url('/assets/concrete-wall.png');
  background-size: cover;
  background-position: center;
  color: #f0e4c0;
  min-height: 100vh;

  display: flex;
  flex-direction: column;
  align-items: center;
}

.page-title {
  margin-bottom: 50px;
  text-align: center;
  font-size: 2rem;
  color: #d4b26a;
  margin-bottom: 30px;
  text-shadow: 1px 1px 3px black;
}
.generators-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 30px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}




/* BOX BASE */
.tool-card {
  background-color: #2b1f14;
  border: 2px solid #8b5c2b;
  border-radius: 12px;
  padding: 20px;
  width: 280px;
  margin: 0 auto; /* centra in orizzontale se mai */
  box-shadow: 0 0 10px #000;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.tool-card:hover {
  transform: scale(1.05);
}

.tool-card .icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

/* MODAL OVERLAY */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(20, 10, 2, 0.85);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.modal-content {
  background: #1a140a;
  border: 4px solid #a38c4a;
  border-radius: 16px;
  padding: 30px;
  max-width: 400px;
  width: 90%;
  color: #f0e4c0;
  position: relative;
  text-align: center;
  box-shadow: 0 0 20px #000;
}

.modal-icon {
  font-size: 2rem;
}

.modal-header h2 {
  margin-top: 10px;
  color: #d4b26a;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 18px;
  font-size: 24px;
  color: #fff;
  cursor: pointer;
}

/* Body e Output */
.modal-body label {
  display: block;
  margin-top: 12px;
  font-weight: bold;
}

.modal-body input,
.modal-body select {
  width: 100%;
  margin-top: 6px;
  padding: 8px;
  background: #2e1d0c;
  border: 2px solid #8b5c2b;
  border-radius: 6px;
  color: #f0e4c0;
}

.modal-body button {
  margin-top: 18px;
  padding: 10px 20px;
  background: #a38c4a;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  color: #2b1e00;
}

.modal-body .output {
  margin-top: 20px;
  font-size: 1.1rem;
  line-height: 1.4;
}

.modal-content.travel {
  max-width: 500px;
}

.travel-segment {
  background: #2e1d0c;
  border: 2px solid #8b5c2b;
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 15px;
  color: #f0e4c0;
}

.travel-segment h4 {
  margin-bottom: 10px;
  color: #d4b26a;
}

.travel-segment label {
  display: block;
  margin-top: 8px;
}

.travel-segment select,
.travel-segment input {
  width: 100%;
  padding: 6px;
  margin-top: 4px;
  background: #1a140a;
  border: 1px solid #a38c4a;
  color: #f0e4c0;
  border-radius: 4px;
}

.segment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.remove-segment {
  cursor: pointer;
  font-size: 1.2rem;
  color: #d46a6a;
  margin-left: 10px;
  transition: color 0.2s ease;
}

.remove-segment:hover {
  color: #ff2f2f;
}

.modal-content.dungeon { max-width: 500px; }

.modal-body label { margin-top: 12px; display: block; font-weight: bold; }

.modal-body select, .modal-body button {
  width: 100%; padding: 8px; margin-top: 5px;
  background: #2e1d0c; border: 2px solid #8b5c2b;
  border-radius: 6px; color: #f0e4c0;
}

.output { margin-top: 20px; line-height: 1.4; text-align: left; }

