/* --- PENSATO E REALIZZATO DA PAOLO SACCHI SEMPRE DOPO I CAFFÈ :-P--- */
        
/* --- REGOLA AUREA (Reset) --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* --- STILI GENERALI --- */
body, html { margin: 0; padding: 0; min-height: 100%; background-color: #000; font-family: 'MedievalSharp', cursive; color: #d4af37; display: flex; flex-direction: column; overflow-x: hidden; }

/* Cursore Bacchetta */
body, html { cursor: url('image/bacchetta.png') 4 4, auto; min-height: 100vh; }
a, button, .btn-forgia, .btn-footer, #gameCanvas, input[type=range] { cursor: url('image/bacchetta.png') 4 4, pointer !important; }

/* Font */
@font-face { font-family: 'Uncial Antiqua'; src: url('fonts/UncialAntiqua-Regular.ttf') format('truetype'); font-weight: normal; font-style: normal; }
@font-face { font-family: 'MedievalSharp'; src: url('fonts/MedievalSharp-Regular.ttf') format('truetype'); font-weight: normal; font-style: normal; }

/* Animazioni */
@keyframes luce-candela {
    0% { opacity: 0.6; text-shadow: 0 0 5px #d4af37; }
    50% { opacity: 1; text-shadow: 0 0 15px #d4af37, 0 0 25px #ffb347; }
    100% { opacity: 0.6; text-shadow: 0 0 5px #d4af37; }
}
@keyframes glow-gioco {
    0% { box-shadow: 0 0 20px rgba(212, 175, 55, 0.4), inset 0 0 10px rgba(212, 175, 55, 0.2); }
    50% { box-shadow: 0 0 40px rgba(212, 175, 55, 0.7), inset 0 0 20px rgba(255, 179, 71, 0.4); }
    100% { box-shadow: 0 0 20px rgba(212, 175, 55, 0.4), inset 0 0 10px rgba(212, 175, 55, 0.2); }
}
@keyframes flicker-pulsanti {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% { box-shadow: 0 0 8px rgba(212, 175, 55, 0.5), inset 0 0 3px rgba(212, 175, 55, 0.2); opacity: 0.9; }
    20%, 24%, 55% { box-shadow: 0 0 25px rgba(255, 179, 71, 1), inset 0 0 10px rgba(255, 179, 71, 0.7); opacity: 1; }
    22% { box-shadow: 0 0 2px rgba(212, 175, 55, 0.1), inset 0 0 1px rgba(212, 175, 55, 0.05); opacity: 0.6; }
}

/* Layout */
#starCanvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 9999; pointer-events: none; }
.main-wrapper { position: relative; z-index: 1; flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 40px 20px; }
.site-title { font-family: 'Uncial Antiqua', serif; font-size: clamp(2.5rem, 8vw, 4rem); margin-bottom: 20px; letter-spacing: 5px; animation: luce-candela 3s infinite ease-in-out; }
.poetic-text { max-width: 700px; font-size: 1.4rem; line-height: 1.6; margin-bottom: 30px; color: #e2c055; text-align: justify; text-align-last: center; }

/* Video e Contenuti */
.video-wrapper { width: 100%; max-width: 800px; aspect-ratio: 16 / 9; background: #000; margin-bottom: 20px; border: none; }
video { width: 100%; height: 100%; border: none; }
.presentation-box { max-width: 900px; padding: 20px; margin: 20px 0; background: transparent; color: #e2c055; display: flex; flex-direction: column; align-items: center; }
.invito-gioco { margin-top: 25px; font-size: 1.2rem; color: #ffb347; font-style: italic; margin-bottom: 25px; }

/* Controlli e Bottoni */
.controlli-lab { display: flex; gap: 30px; flex-wrap: wrap; margin-bottom: 30px; justify-content: center; align-items: flex-start; }

/* GRUPPO DI CONTROLLO (Bottone + Slider) */
.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; 
    gap: 15px; 
    width: 250px; 
}

/* STILE PULSANTI AGGIORNATO */
.btn-forgia {
    background: transparent; 
    color: #d4af37;
    border: 2px solid #d4af37; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    padding: 0 10px; 
    font-family: 'Uncial Antiqua', serif; 
    cursor: pointer; 
    transition: 0.3s, box-shadow 0.1s linear, opacity 0.1s linear; 
    width: 100%; 
    height: 54px; /* <--- ALTEZZA FISSA: Risolve il problema del pulsante "grasso" */
    font-size: 1rem; 
    border-radius: 50px; 
    animation: flicker-pulsanti 5s infinite linear; 
    white-space: nowrap; 
    margin: 0; 
    box-sizing: border-box; 
}

.btn-forgia:hover { background: #d4af37;color: #000; animation: none; box-shadow: 0 0 25px #d4af37, inset 0 0 10px rgba(255, 255, 255, 0.5); transform: scale(1.02); }       

.btn-start { 
    width: 280px; 
    font-size: 1.1rem; 
    border-color: #ffb347; 
    color: #ffb347; 
    box-shadow: 0 0 10px rgba(255, 179, 71, 0.2); 
}

/* STILI VOLUME SLIDER */
.slider-mini-wrapper {
    width: 100%; 
    text-align: center;
    opacity: 0.8;
    transition: opacity 0.3s;
    padding: 0 5px;
}
.slider-mini-wrapper:hover { opacity: 1; }

.slider-mini-wrapper label {
    display: block; font-size: 0.8rem; color: #867029; margin-bottom: 2px; font-family: sans-serif; text-transform: uppercase;
}

input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; background: transparent; }
input[type=range]:focus { outline: none; }
input[type=range]::-webkit-slider-runnable-track { width: 100%; height: 4px; cursor: pointer; background: #333; border-radius: 2px; border: 1px solid #555; }
input[type=range]::-webkit-slider-thumb { height: 16px; width: 16px; border-radius: 50%; background: #D4AF37; border: 2px solid #000; cursor: pointer; -webkit-appearance: none; margin-top: -7px; box-shadow: 0 0 5px rgba(212, 175, 55, 0.8); transition: transform 0.1s; }
input[type=range]::-webkit-slider-thumb:active { transform: scale(1.2); background: #FFF; }

/* GIOCO CANVAS */
#gameCanvas { 
    display: none; margin: 10px auto; border: 1px solid rgba(212, 175, 55, 0.5); border-radius: 8px; 
    background-image: url('image/lab.png'); background-size: cover; background-position: center; 
    cursor: none; touch-action: none; max-width: 95vw; max-height: 80vh; 
    width: auto; height: auto; object-fit: contain; animation: glow-gioco 4s infinite ease-in-out;
}

/* Footer */
footer {flex-shrink: 0; padding: 40px 20px; width: 100%; text-align: center; color: #d4af37; position: relative; z-index: 2; background-color: rgba(0,0,0,0.8); display: flex; flex-direction: column; align-items: center; padding-bottom: 60px; max-width: 100vw; overflow-x: hidden;}
.avvertenze-box { max-width: 800px; padding: 10px; margin: 10px 0; background: transparent; color: #867029; display: flex; flex-direction: column; align-items: center; }
.copyright-text { font-size: 1rem; margin-bottom: 15px; }
.footer-buttons { display: flex; gap: 15px; margin-top: 15px; flex-wrap: wrap; justify-content: center; }
.btn-footer { background: transparent; color: #d4af37; border: 1px solid #d4af37; padding: 8px 20px; cursor: pointer; font-size: 1rem; border-radius: 4px; font-family: 'MedievalSharp', cursive; text-decoration: none; display: inline-block; transition: 0.3s; letter-spacing: 1px; }
.btn-footer:hover { color: #ffb347; border-color: #ffb347; background: rgba(212, 175, 55, 0.1); box-shadow: 0 0 12px rgba(255, 179, 71, 0.5); transform: translateY(-2px); }