@font-face {
    font-family: 'Blanka';
    src: url('fonts/Blanka-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

body {
    margin: 0;
    font-family: sans-serif;
    background-color: #000000;
    color: #ffdc10;
}

header {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 30px 0;
    background-color: #1a1a1a;
    position: relative;
    z-index: 1000;
    transition: height 0.5s ease;
    height: 60px;
}

header.expanded {
    height: 120px;
}

nav {
    width: 100%;
    max-width: 1400px;
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 2;
}

nav ul {
    display: flex;
    position: relative;
    align-items: center;
    padding: 0;
    margin: 0;
    width: 100%;
    justify-content: center;
    gap: 60px;
    list-style: none;
    transition: transform 0.5s ease;
}

nav ul li {
    position: relative;
    z-index: 1003;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

nav ul li a {
    color: #ffdc10;
    text-decoration: none;
    padding: 10px 20px;
    display: inline-block;
    font-size: 1.8em;
    font-weight: bold;
    text-transform: uppercase;
    position: relative;
    background: linear-gradient(45deg, #1a1a1a, #2d2d2d);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(255, 220, 16, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 220, 16, 0.1);
    overflow: hidden;
    z-index: 1004;
    letter-spacing: 1px;
}

nav ul li a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffdc10;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
    z-index: -1;
}

nav ul li a:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

nav ul li a:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 220, 16, 0.2);
    color: #000;
}

/* Stile per il link attivo */
nav ul li a.active {
    background: linear-gradient(45deg, #ffdc10, #ffc107);
    color: #000;
    box-shadow: 0 4px 15px rgba(255, 220, 16, 0.3);
    border: 1px solid rgba(255, 220, 16, 0.5);
    animation: pulse 2s infinite;
}

nav ul li a.active:hover {
    transform: translateY(-3px) scale(1.05);
}

/* Effetto pulse per il link attivo */
@keyframes pulse {
    0% {
        box-shadow: 0 4px 15px rgba(255, 220, 16, 0.3);
    }

    50% {
        box-shadow: 0 4px 25px rgba(255, 220, 16, 0.5);
    }

    100% {
        box-shadow: 0 4px 15px rgba(255, 220, 16, 0.3);
    }
}

nav ul li a.active {
    animation: pulse 2s infinite;
}

/* Responsive design */
@media (max-width: 768px) {
    nav ul {
        gap: 20px;
    }

    nav ul li a {
        font-size: 1em;
    }
}

.cta-header-button {
    background: linear-gradient(45deg, #ffdc10, #ffc107);
    color: #000;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(255, 220, 16, 0.2);
    border: none;
    transition: all 0.3s ease;
    position: relative;
    z-index: 3;
    margin-left: 40px;
    font-size: 1.8em !important;
    padding: 10px 30px !important;
}

.cta-header-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 220, 16, 0.4);
    background: linear-gradient(45deg, #ffa000, #ffdc10);
}

.cta-header-button {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1000;
}

.hero {
    text-align: center;
    padding: 20px;
    background-color: #000000;
    position: relative;
    z-index: 1;
}

.logo-centered {
    margin: 0 auto;
    max-width: 400px;
    position: relative;
    z-index: 2;
}

.hero .logo-centered,
.hero h2,
.hero p {
    display: block;
    margin: 0 auto;
}

.logo-centered img {
    width: 500px;
    height: auto;
    opacity: 0;
    transform: scale(5);
    transition: transform 0.5s ease-out;
}

.logo-centered img:hover {
    transform: scale(1.05);
}

.logo-centered.animate img {
    animation: zoomOutLogo 2s ease-out forwards;
}

.hero h2 {
    font-size: 36px;
    /* Aumenta la dimensione del titolo */
    margin-top: 50px;
    /* Aumenta lo spazio sopra il titolo */
    margin-bottom: 10px;
    color: #E8A23B;
    /* Cambia il colore del titolo */
    text-transform: uppercase;
    /* Trasforma il testo in maiuscolo */
    animation: fadeInUp 1.5s ease-out forwards;
}

.hero h1.animate,
.hero p.animate {
    animation: fadeInUp 1.5s ease-out forwards;
}

.hero p {
    font-size: 2.2em;
    margin: 20px 0;
    text-align: center;
    color: #ffffff;
    font-family: sans-serif;
    animation: fadeInUp 1.5s ease-out forwards;
}

.hero p strong {
    font-size: 1.1em;
    color: #ffdc10;
    font-family: sans-serif;
}

.hero p a {
    font-family: 'Blanka', sans-serif;
    font-size: 1.1em;
    color: #BD2600;
    text-decoration: none;
    position: relative;
    animation: glow 2s ease-in-out infinite alternate;
}

.centered-image {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.centered-image img {
    width: 600px;
    /* o la dimensione che preferisci */
    height: auto;
    border-radius: 15px;
    opacity: 0;
}

.centered-image.animate img {
    animation: fadeIn 2s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.image-cards {
    display: flex;
    justify-content: space-evenly;
    align-items: flex-start;
    gap: 60px;
    padding: 50px 20px;
    background-color: #1a1a1a;
    clip-path: polygon(0 5%, 100% 0, 100% 100%, 0 95%);
    flex-wrap: wrap;
    margin-top: -50px;
}

.card {
    width: calc(100% / 3 - 120px);
    max-width: 300px;
    background-color: transparent;
    border-radius: 10px;
    box-shadow: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transform: translateY(100px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.card:nth-child(2).visible {
    transition-delay: 0.2s;
}

.card:nth-child(3).visible {
    transition-delay: 0.4s;
}

.card.visible {
    opacity: 1;
    transform: translateY(0);
    animation: slideInCards 1s ease-out forwards;
}

.card:hover {
    transform: translateY(-15px);
}

.card-inner {
    padding: 15px;
    background-color: transparent;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    box-shadow: none;
    margin-bottom: 15px;
}

.card-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 15px;
}

.card-caption {
    width: 100%;
    padding: 10px;
    background-color: transparent;
    color: #ffdc10;
    font-size: 16px;
    text-align: center;
    border: none;
    border-radius: 10px;
    font-family: sans-serif;
}

@media (max-width: 768px) {
    .image-cards {
        display: flex;
        overflow-x: scroll;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .card {
        flex: 0 0 100%;
        max-width: 100%;
        scroll-snap-align: center;
    }

    .card-inner {
        padding: 15px;
        background-color: transparent;
        color: #ffffff;
        border: none;
        border-radius: 10px;
        box-shadow: none;
        margin-bottom: 15px;
        text-align: center;
    }

    .cta-header-button {
        padding: 10px 20px;
        top: 50px;
        font-size: 14px;
    }
}

footer {
    text-align: center;
    padding: 20px;
    background-color: #1a1a1a;
    color: #ffdc10;
    font-size: 14px;
    position: relative;
}

footer p:first-of-type {
    font-size: 20px;
    /* Imposta la dimensione del font a 50px */
    color: #ffdc10;
    /* Mantiene il colore giallo opaco */
    margin-bottom: 20px;
    /* Spazio tra il testo e i loghi social */
    font-weight: bold;
    /* Opzionale: aggiunge il grassetto */
}

footer .social-logos {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
}

footer .social-logos img {
    max-width: 80px;
    height: auto;
}

footer p {
    margin: 0;
    font-size: 18px;
    /* Imposta la dimensione del font a 18px */
    color: #ffdc10;
    font-family: sans-serif;
}

footer p a.policies-link {
    color: #ffdc10;
    text-decoration: none;
    font-weight: bold;
}

footer p a.policies-link:hover {
    color: #E8A23B;
    text-decoration: underline;
}

.policies-button {
    display: inline-block;
    padding: 10px 15px;
    background-color: #1a1a1a;
    color: #ffffff;
    text-decoration: none;
    border-radius: 5px;
    /* Raggio bordo ridotto */
    border: 1px solid #ccc;
    /* Aggiunta di un bordo */
    font-weight: normal;
    font-size: 16px;
    margin-top: 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.policies-button:hover {
    background-color: #333333;
    color: #ffffff;
    transform: none;
    /* Rimuove l'effetto di scala */
}

#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #1a1a1a;
    color: #ffdc10;
    padding: 20px;
    text-align: center;
    font-size: 16px;
    z-index: 1000;
    box-shadow: 0px -4px 10px rgba(0, 0, 0, 0.2);
    font-family: sans-serif;
}

#cookie-banner a {
    color: #E8A23B;
    text-decoration: underline;
    font-weight: bold;
}

#cookie-banner button {
    background-color: #ffdc10;
    color: #2F2F2F;
    padding: 10px 20px;
    margin-left: 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-family: sans-serif;
}

#cookie-banner button:hover {
    background-color: #E8A23B;
}

.game-details {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
    margin: 60px auto;
    max-width: 1200px;
    padding: 20px;
}

.game-detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: linear-gradient(145deg, #1a1a1a, #2d2d2d);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 220, 16, 0.1);
    transition: all 0.3s ease;
}

.game-detail-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(255, 220, 16, 0.2);
    border-color: rgba(255, 220, 16, 0.3);
}

.game-detail-item img {
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.game-detail-item:hover img {
    transform: scale(1.1);
}

.game-detail-item p {
    color: #ffffff;
    font-size: 1em;
    font-weight: bold;
    margin: 0;
    max-width: 200px;
}

/* Media query per la responsività */
@media (max-width: 768px) {
    .game-details {
        flex-direction: column;
        gap: 20px;
    }

    .game-detail-item {
        width: 100%;
        max-width: 300px;
    }
}

/* Keyframes per le animazioni */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes glow {
    from {
        text-shadow: 0 0 5px #BD2600, 0 0 10px #BD2600, 0 0 15px #BD2600;
    }

    to {
        text-shadow: 0 0 10px #BD2600, 0 0 20px #BD2600, 0 0 30px #BD2600;
    }
}

/* Animazione per i social nella footer */
.social-logos a {
    transition: transform 0.3s ease;
    display: inline-block;
}

.social-logos a:hover {
    transform: scale(1.2) rotate(5deg);
}

/* Keyframe per l'animazione del logo */
@keyframes zoomOutLogo {
    from {
        opacity: 0;
        transform: scale(5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.game-detail-item.animate {
    animation: fadeInLeft 1s ease-out forwards;
}

.card.visible {
    animation: slideInCards 1s ease-out forwards;
}

/* Stili per la pagina Chi Siamo */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.about-text p {
    font-size: 1.2em;
    line-height: 1.6;
    margin-bottom: 20px;
    color: #ffffff;
    opacity: 0;
}

.about-text p.animate {
    animation: fadeIn 1.5s ease-out forwards;
}

.team-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.team-member {
    background-color: #1a1a1a;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    width: calc(50% - 40px);
    min-width: 300px;
}

.team-member img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    margin-bottom: 15px;
    object-fit: cover;
    opacity: 1;
    display: block;
    margin: 0 auto 15px;
    background-color: #2F2F2F;
    /* Colore di fallback */
}

.team-member h3 {
    color: #ffdc10;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.team-member p {
    color: #ffffff;
    line-height: 1.6;
    margin: 0;
    font-size: 1.1em;
}

.team-member.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Delay per l'animazione sequenziale dei membri del team */
.team-member:nth-child(1) {
    animation-delay: 0s;
}

.team-member:nth-child(2) {
    animation-delay: 0.2s;
}

.team-member:nth-child(3) {
    animation-delay: 0.4s;
}

.team-member:nth-child(4) {
    animation-delay: 0.6s;
}

@keyframes fadeInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Stili per la pagina Capitoli */
.chapters-grid {
    display: flex;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.chapter-card {
    background-color: #1a1a1a;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    max-width: 800px;
}

.chapter-card img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    margin-bottom: 20px;
    opacity: 1;
}

.chapter-card h2 {
    color: #ffdc10;
    margin-bottom: 15px;
}

.chapter-title {
    font-family: 'Blanka', sans-serif;
    color: #BD2600;
}

.chapter-link {
    display: inline-block;
    background-color: #ffdc10;
    color: #2F2F2F;
    padding: 10px 20px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 20px;
}

.hero h1 {
    font-size: 36px;
    color: #ffdc10;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-top: -30px;
    font-weight: bold;
    position: relative;
    z-index: 2;
    opacity: 1;
    animation: none;
    transform: none;
}

.hero h1.animate {
    opacity: 1;
    transform: translateY(0);
}

.team-member,
.chapter-card {
    transition: transform 0.3s ease-out;
}

.team-member:hover,
.chapter-card:hover {
    transform: translateY(-5px);
}

/* Stili per i titoli nella hero section */
.hero h1 {
    color: #ffdc10;
    /* Giallo caratteristico del sito */
    font-size: 36px;
    margin-top: -30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-weight: bold;
}

/* Stili specifici per belcastro.html */
.capitolo-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    color: #ffffff;
    position: relative;
    z-index: 1;
}

.cover-image {
    text-align: center;
    margin: 20px 0;
    position: relative;
    z-index: 2;
}

.main-chapter-image {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(255, 220, 16, 0.2);
}

/* Assicuriamoci che la hero section non copra il contenuto */
.hero {
    position: relative;
    z-index: 1;
    margin-bottom: 30px;
}

/* Aggiustiamo il margine superiore del contenuto */
.trama-content {
    margin-top: 40px;
    position: relative;
    z-index: 2;
}

.trama-content h2 {
    color: #ffdc10;
    font-size: 2em;
    margin-bottom: 20px;
    text-align: center;
}

.trama-content p {
    margin-bottom: 20px;
    font-size: 1.1em;
}

.trama-content strong {
    color: #ffdc10;
}

.photo-cards {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-top: 60px;
    margin-bottom: 40px;
}

.photo-cards .card {
    background: linear-gradient(145deg, #1a1a1a, #2d2d2d);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.4s ease;
    position: relative;
    width: 300px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 220, 16, 0.1);
}

.photo-cards .card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 30px rgba(255, 220, 16, 0.2);
    border-color: rgba(255, 220, 16, 0.3);
}

.photo-cards .card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: all 0.4s ease;
}

.photo-cards .card:hover img {
    transform: scale(1.1);
    filter: brightness(1.1);
}

/* Aggiungiamo una didascalia hover */
.photo-cards .card::after {
    content: 'Scopri di più';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0));
    color: #ffdc10;
    font-weight: bold;
    text-align: center;
    transform: translateY(100%);
    transition: all 0.3s ease;
    opacity: 0;
}

.photo-cards .card:hover::after {
    transform: translateY(0);
    opacity: 1;
}

/* Effetto glow al hover */
.photo-cards .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 15px;
    background: radial-gradient(circle at center, rgba(255, 220, 16, 0.2), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.photo-cards .card:hover::before {
    opacity: 1;
}

/* Responsive design migliorato */
@media (max-width: 768px) {
    .photo-cards {
        gap: 20px;
        padding: 0 15px;
    }

    .photo-cards .card {
        width: 100%;
        max-width: 350px;
    }

    .photo-cards .card img {
        height: 250px;
    }
}

<script>document.addEventListener('DOMContentLoaded', function() {

        // Animazione immediata per logo e titolo
        setTimeout(()=> {
                document.querySelector('.logo-centered').classList.add('animate');
                document.querySelector('.hero h1').classList.add('animate');
            }

            , 100);

        // Funzione per controllare se un elemento è nel viewport
        function isInViewport(element) {
            const rect=element.getBoundingClientRect();
            return (rect.top <=(window.innerHeight || document.documentElement.clientHeight) && rect.bottom >=0);
        }

        // Animazione per gli elementi quando diventano visibili
        function handleScroll() {

            // Per la pagina Chi Siamo
            document.querySelectorAll('.team-member').forEach((member, index)=> {
                    if (isInViewport(member) && !member.classList.contains('animate')) {
                        setTimeout(()=> {
                                member.classList.add('animate');
                            }

                            , index * 200); // Aggiunge un delay progressivo
                    }
                });

            // Per la pagina Capitoli
            document.querySelectorAll('.chapter-card').forEach(card=> {
                    if (isInViewport(card) && !card.classList.contains('visible')) {
                        card.classList.add('visible');
                    }
                });
        }

        // Aggiungi l'event listener per lo scroll
        window.addEventListener('scroll', handleScroll);
        // Esegui il controllo anche al caricamento della pagina
        handleScroll();
    });
</script>

/* Rimuovi tutti gli stili precedenti di animazione e ripristina la visibilità base */
.team-member,
.chapter-card,
.logo-centered,
.hero h1 {
    opacity: 1;
    transform: none;
}

/* Stili per la pagina del capitolo */
.chapter-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: linear-gradient(145deg, rgba(26, 26, 26, 0.9), rgba(45, 45, 45, 0.9));
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 220, 16, 0.1);
}

.chapter-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    color: #ffffff;
}

.chapter-image {
    width: 100%;
    max-width: 800px;
    position: relative;
}

.chapter-image img {
    width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(255, 220, 16, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chapter-image img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 220, 16, 0.3);
}

.chapter-text {
    font-size: 1.1em;
    line-height: 1.6;
    text-align: justify;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    border: 1px solid rgba(255, 220, 16, 0.1);
}

.chapter-text p {
    margin-bottom: 20px;
}

.highlight-text {
    color: #ffdc10;
    text-align: center;
    font-size: 1.2em;
    margin-top: 30px;
}

/* Media queries */
@media (max-width: 768px) {
    .chapter-container {
        padding: 15px;
        margin: 10px;
    }

    .chapter-content {
        gap: 20px;
    }

    .chapter-text {
        font-size: 1em;
        padding: 15px;
    }
}

/* Stili per le animazioni */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Delays per le animazioni in sequenza */
.delay-1 {
    transition-delay: 0.2s;
}

.delay-2 {
    transition-delay: 0.4s;
}

.delay-3 {
    transition-delay: 0.6s;
}

.delay-4 {
    transition-delay: 0.8s;
}

/* Animazione fade-in-up */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.13, 0.62, 0.11, 0.99);
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Animazione per le card */
.photo-cards .card {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s cubic-bezier(0.13, 0.62, 0.11, 0.99);
}

.photo-cards .card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stile per il link attivo nella navigazione */
nav ul li a.active {
    color: #ffdc10;
    border-bottom: 2px solid #ffdc10;
}

/* Non applicare lo stile al pulsante Acquista quando attivo */
nav ul li a.cta-header-button.active {
    border-bottom: none;
}

/* Stili per la transizione di pagina */
.transition-fade {
    opacity: 1;
    transition: 500ms;
    transform: translateY(0);
}

html.is-animating .transition-fade {
    opacity: 0;
    transform: translateY(20px);
}

html.is-leaving .transition-fade {
    opacity: 0;
    transform: translateY(-20px);
}

/* Stile per il loader */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: black;
    z-index: 4;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.page-transition.active {
    opacity: 1;
    pointer-events: all;
}

/* Stili per la pagina policies */
.policies-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    color: #ffffff;
}

.policy-section {
    background: linear-gradient(145deg, rgba(26, 26, 26, 0.9), rgba(45, 45, 45, 0.9));
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 220, 16, 0.1);
}

.policy-section h2 {
    color: #ffdc10;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.policy-section h3 {
    color: #ffdc10;
    margin: 25px 0 15px;
    font-size: 1.4em;
}

.policy-section p,
.policy-section ul {
    line-height: 1.6;
    margin-bottom: 15px;
}

.policy-section ul {
    padding-left: 20px;
}

.policy-section ul li {
    margin-bottom: 10px;
}

.policy-section strong {
    color: #ffdc10;
}

@media (max-width: 768px) {
    .policies-container {
        padding: 15px;
    }

    .policy-section {
        padding: 20px;
        margin-bottom: 20px;
    }
}

/* Stili base per la navigazione */
nav ul {
    display: flex;
    position: relative;
    align-items: center;
    padding: 0;
    margin: 0;
    width: 100%;
    justify-content: center;
    gap: 60px;
}

/* Animazione SOLO per i primi tre pulsanti nella pagina policies */
.nav-animated ul li:nth-child(-n+3) {
    transform: translateX(-300px);
    opacity: 0.7;
    transition: all 0.5s ease;
    position: relative;
    z-index: 1;
}

.nav-animated ul li:nth-child(-n+3):hover {
    opacity: 1;
    transform: translateX(-300px) scale(1.1);
}

/* Stile per i pulsanti di navigazione standard */
nav ul li a {
    font-size: 1.8em;
    padding: 10px 20px;
    transition: all 0.5s ease;
    font-weight: bold;
    letter-spacing: 1px;
}

/* Posizionamento specifico per il pulsante Acquista */
nav ul li:nth-child(4) {
    position: absolute;
    right: 20px;
}

/* Stile per il pulsante della pagina corrente (POLICIES) */
.current-page {
    position: absolute;
    left: 50%;
    transform: translateX(-50%) translateY(-150px);
    opacity: 0;
    transition: all 0.5s ease;
    z-index: 3;
}

.nav-animated .current-page {
    opacity: 1;
    transform: translateX(-50%) translateY(80px);
}

/* Stile specifico per il pulsante Verità sospesa */
.current-page a[href="belcastro.html"] {
    color: #ffdc10 !important;
    border-bottom: 4px solid #ffdc10;
    font-size: 2.2em;
    font-weight: bold;
    padding: 10px 25px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(255, 220, 16, 0.4);
    white-space: nowrap;
    display: inline-block;
    position: relative;
    z-index: 1000;
}

/* Posizione specifica per Verità sospesa */
.nav-animated ul li.current-page[href="belcastro.html"] {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    opacity: 1;
}

/* Modifica lo stile per il pulsante current-page */
nav ul li.current-page a {
    background: linear-gradient(45deg, #1a1a1a, #333);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    position: relative;
    display: block;
    width: auto;
}

nav ul li.current-page a:hover {
    background: linear-gradient(45deg, #333, #4a4a4a);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Animazione solo per i primi tre elementi */
.nav-animated ul li.animated-item {
    transform: translateX(-500px);
    opacity: 0.7;
    transition: all 0.5s ease;
}

/* Assicurati che il pulsante current-page non sia influenzato dall'animazione */
.nav-animated ul li.current-page {
    transform: none !important;
    /* Previene qualsiasi trasformazione */
    opacity: 1 !important;
    /* Mantiene l'opacità al 100% */
}

nav ul li.current-page a {
    color: #ffdc10;
    text-shadow: 0 0 10px rgba(255, 220, 16, 0.5);
}

/* Stile base per desktop */
nav ul {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Media query per tablet (max-width: 768px) */
@media screen and (max-width: 768px) {
    nav ul {
        flex-direction: column;
        gap: 10px;
    }

    nav ul li a {
        font-size: 0.9em;
        padding: 8px 15px;
    }

    .chapter-content {
        flex-direction: column;
        padding: 10px;
    }

    .chapter-image img {
        width: 100%;
        max-width: 400px;
    }

    .game-details {
        flex-direction: column;
        align-items: center;
    }

    .game-detail-item {
        width: 100%;
        margin: 10px 0;
    }
}

/* Media query per smartphone (max-width: 480px) */
@media screen and (max-width: 480px) {
    nav ul li a {
        font-size: 0.8em;
        padding: 6px 12px;
    }

    .logo-centered img {
        width: 80%;
        max-width: 300px;
    }

    h1 {
        font-size: 1.5em;
        margin-top: -15px;
    }

    .chapter-text p {
        font-size: 0.9em;
        line-height: 1.4;
    }

    .game-detail-item img {
        width: 120px;
    }

    .game-detail-item p {
        font-size: 0.8em;
    }

    footer {
        font-size: 0.8em;
        padding: 10px;
    }

    .social-logos img {
        width: 60px;
    }
}

/* Media query per schermi molto piccoli (max-width: 320px) */
@media screen and (max-width: 320px) {
    nav ul li a {
        font-size: 0.7em;
        padding: 5px 10px;
    }

    .logo-centered img {
        width: 90%;
        max-width: 250px;
    }

    h1 {
        font-size: 1.2em;
    }

    .game-detail-item img {
        width: 100px;
    }
}

/* Mantieni le animazioni solo per desktop */
@media screen and (min-width: 769px) {
    .nav-animated ul li.animated-item {
        transform: translateX(-500px);
        opacity: 0.7;
        transition: all 0.5s ease;
    }
}

/* Stile base per desktop */
nav ul {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Stile specifico per il pulsante Acquista */
.cta-header-button {
    background: linear-gradient(45deg, #ffdc10, #ffc107);
    color: #000;
    padding: 10px 20px;
    border-radius: 5px;
    box-shadow: 0 4px 15px rgba(255, 220, 16, 0.3);
}

/* Media query per mobile (max-width: 768px) */
@media screen and (max-width: 768px) {
    nav ul {
        flex-direction: column;
        gap: 15px;
        padding: 10px 0;
        position: relative;
        margin-top: 60px;
    }

    .cta-header-button {
        display: block;
        text-align: center;
        padding: 15px 30px;
        font-size: 1.1em;
        width: 100%;
        transition: none;
        /* Riconferma la rimozione delle transizioni */
    }
}

/* Stile base per l'header */
header {
    background: #1a1a1a;
    position: relative;
    transition: all 0.5s ease;
    padding: 40px 0;
}

/* Stile base per il menu di navigazione */
nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

/* Stile per i primi 4 elementi (Home, Capitoli, Chi Siamo, Acquista) */
nav ul li:not(.current-page) {
    margin-top: 20px;
}

/* Stile per il pulsante current-page */
nav ul li.current-page {
    flex-basis: 100%;
    text-align: center;
    margin-top: 30px;
    opacity: 0;
}

/* Animazione quando la pagina è caricata */
.nav-animated header {
    padding-bottom: 80px;
}

.nav-animated nav ul li.current-page {
    opacity: 1;
    transition: opacity 0.5s ease;
    transition-delay: 0.3s;
}

/* Stile del pulsante */
nav ul li.current-page a {
    color: #ffdc10;
    text-shadow: 0 0 10px rgba(255, 220, 16, 0.5);
    padding: 10px 20px;
    display: inline-block;
}

/* Media query per mobile */
@media screen and (max-width: 768px) {
    header {
        padding: 15px 0;
        min-height: auto;
    }

    nav {
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }

    nav ul {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        padding: 0;
        margin: 0;
        gap: 12px;
    }

    /* Riordina gli elementi */
    nav ul li:nth-child(4) {
        order: -1;
        /* Acquista in cima */
    }

    nav ul li:nth-child(1) {
        order: 1;
        /* Home */
    }

    nav ul li:nth-child(2) {
        order: 2;
        /* Capitoli */
    }

    nav ul li:nth-child(3) {
        order: 3;
        /* Chi Siamo */
    }

    nav ul li.current-page {
        order: 4;
        /* Verità sospesa in fondo */
    }

    /* Stile comune per tutti i tasti */
    nav ul li {
        width: 85%;
        margin: 0;
        text-align: center;
        opacity: 1 !important;
        transform: none !important;
        position: static !important;
    }

    /* Stile per i link */
    nav ul li a {
        display: block;
        padding: 12px 20px;
        text-align: center;
        width: 100%;
        box-sizing: border-box;
    }

    /* Stile specifico per Verità sospesa */
    nav ul li.current-page a {
        color: #ffdc10;
        text-shadow: 0 0 10px rgba(255, 220, 16, 0.5);
    }

    /* Rimuovi tutte le animazioni */
    .nav-animated ul li {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* Media query per schermi molto piccoli */
@media screen and (max-width: 320px) {
    nav ul li a {
        font-size: 0.8em;
    }

    h1 {
        font-size: 1.3em;
    }

    .chapter-text p {
        font-size: 0.9em;
    }

    .game-detail-item img {
        width: 100px;
    }

    .social-logos img {
        width: 50px;
    }
}

document.addEventListener('DOMContentLoaded', function() {
        setTimeout(()=> {
                document.querySelector('header').classList.add('expanded');
                document.querySelector('nav').classList.add('nav-animated');
            }

            , 100);

        // Gestione della transizione quando si lascia la pagina
        document.querySelectorAll('nav a').forEach(link=> {
                link.addEventListener('click', function(e) {
                        if (this.getAttribute('target') !=='_blank') {
                            e.preventDefault();
                            const href=this.getAttribute('href');

                            // Rimuovi le classi per invertire l'animazione
                            document.querySelector('header').classList.remove('expanded');
                            document.querySelector('nav').classList.remove('nav-animated');

                            setTimeout(()=> {
                                    window.location.href=href;
                                }

                                , 500);
                        }
                    });
            });
    });

/* Stile base pulsanti */
nav ul li a {
    display: block;
    text-align: center;
    padding: 12px 20px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

/* Media query per mobile */
@media screen and (max-width: 768px) {

    /* Container navigazione */
    nav ul {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        padding: 10px;
    }

    /* Tutti i pulsanti di navigazione */
    nav ul li {
        width: 90%;
        margin: 2px 0;
    }

    nav ul li a {
        font-size: 1em;
        padding: 15px 20px;
        background: rgba(26, 26, 26, 0.8);
        border: 1px solid rgba(255, 220, 16, 0.2);
        color: #ffdc10;
        text-shadow: 0 0 5px rgba(255, 220, 16, 0.3);
    }

    /* Pulsante Acquista */
    nav ul li .cta-header-button {
        background: linear-gradient(45deg, #ffdc10, #ffc107);
        color: #000;
        font-weight: bold;
        text-shadow: none;
        border: none;
        box-shadow: 0 4px 15px rgba(255, 220, 16, 0.3);
    }

    /* Pulsante current-page (Verità sospesa/Policies) */
    nav ul li.current-page {
        margin-top: 20px;
        width: 90%;
    }

    nav ul li.current-page a {
        background: linear-gradient(45deg, #1a1a1a, #333);
        border: 1px solid rgba(255, 220, 16, 0.4);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }

    /* Effetti touch */
    nav ul li a:active {
        transform: scale(0.98);
        opacity: 0.9;
    }

    .cta-header-button:active {
        background: linear-gradient(45deg, #ffc107, #ffdc10);
    }
}

/* Media query per schermi molto piccoli */
@media screen and (max-width: 320px) {
    nav ul li {
        width: 95%;
    }

    nav ul li a {
        font-size: 0.9em;
        padding: 12px 15px;
    }
}

/* Stile base header */
header {
    background: #1a1a1a;
    width: 100%;
    position: relative;
}

/* Media query per mobile */
@media screen and (max-width: 768px) {
    header {
        padding-top: 0;
        min-height: 380px;
    }

    nav ul {
        flex-direction: column;
        gap: 8px;
        width: 100%;
        padding: 10px 0;
        margin-top: 40px;
    }

    /* Base style per tutti i pulsanti in mobile */
    nav ul li {
        opacity: 1;
        transform: none;
        transition: transform 0.2s ease;
        /* Solo una transizione leggera per il tocco */
    }

    /* Pulsante Acquista */
    nav ul li:nth-child(4) {
        order: -1;
        width: 90%;
        margin: 0 auto;
        position: relative;
        top: -20px;
    }

    /* Altri pulsanti di navigazione */
    nav ul li:not(:nth-child(4)):not(.current-page) {
        width: 90%;
        margin: 0 auto;
        position: relative;
        top: 40px;
    }

    /* Pulsante current-page */
    nav ul li.current-page {
        width: 90%;
        margin: 15px auto 0;
        position: relative;
        top: 40px;
    }

    /* Solo un leggero effetto al tocco */
    nav ul li:active {
        transform: scale(0.98);
    }
}

/* Keyframes per l'animazione di entrata */
@keyframes fadeInButton {
    from {
        opacity: 0.8;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

<div class="mobile-cta"><a href="https://www.amazon.it/dp/B0DMMF4W8Z" class="cta-header-button" target="_blank">Acquista</a></div>
/* Media query per mobile */
@media screen and (max-width: 768px) {
    header {
        padding: 10px 0;
        min-height: auto;
        background: #1a1a1a;
    }

    nav {
        width: 100%;
    }

    nav ul {
        flex-direction: column;
        width: 100%;
        gap: 10px;
        padding: 10px 0;
        margin: 0;
    }

    /* Stile base per tutti i pulsanti */
    nav ul li {
        width: 90%;
        margin: 0 auto;
        opacity: 1;
        transform: none;
        position: static;
        /* Rimuove il posizionamento relativo */
    }

    /* Pulsante Acquista */
    nav ul li:nth-child(4) {
        order: -1;
        /* Lo mantiene in cima */
        margin-bottom: 15px;
    }

    .cta-header-button {
        display: block;
        width: 100%;
        padding: 15px 20px;
        background: linear-gradient(45deg, #ffdc10, #ffc107);
        color: #000;
        font-weight: bold;
        border-radius: 5px;
        text-align: center;
    }

    /* Altri pulsanti di navigazione */
    nav ul li a {
        display: block;
        padding: 12px 20px;
        text-align: center;
    }

    /* Pulsante current-page */
    nav ul li.current-page {
        margin-top: 15px;
    }

    /* Solo un leggero effetto al tocco */
    nav ul li:active {
        transform: scale(0.98);
    }
}

/* Stile specifico per belcastro.html e policies.html in mobile */
@media screen and (max-width: 768px) {
    .current-page-container {
        background: #1a1a1a;
        padding: 15px 0;
    }

    /* Layout base per mobile */
    nav {
        width: 100%;
        background: #1a1a1a;
    }

    nav ul {
        display: flex;
        flex-direction: column;
        width: 100%;
        padding: 10px 0;
        margin: 0;
        gap: 10px;
        position: static;
        /* Rimuove qualsiasi posizionamento relativo */
    }

    /* Stile base per tutti i pulsanti */
    nav ul li {
        width: 90%;
        margin: 0 auto;
        position: static;
        /* Rimuove posizionamento relativo */
        transform: none !important;
        /* Previene trasformazioni */
        opacity: 1 !important;
        /* Mantiene sempre visibile */
    }

    /* Pulsante Acquista */
    nav ul li:nth-child(4) {
        order: -1;
        margin-bottom: 15px;
    }

    .cta-header-button {
        display: block;
        width: 100%;
        padding: 15px 0;
        text-align: center;
        background: linear-gradient(45deg, #ffdc10, #ffc107);
        color: #000;
        font-weight: bold;
        border-radius: 5px;
    }

    /* Altri pulsanti di navigazione */
    nav ul li a {
        display: block;
        padding: 12px 0;
        text-align: center;
        width: 100%;
    }

    /* Pulsante current-page (Verità sospesa/Policies) */
    nav ul li.current-page {
        margin-top: 10px;
        position: static;
        width: 90%;
    }

    /* Rimuovi tutte le animazioni problematiche */
    .nav-animated ul li,
    .nav-animated ul li.current-page {
        transform: none !important;
        opacity: 1 !important;
        transition: none !important;
    }
}