@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');

:root {
    --neon-cyan: #00ffff;
    --neon-pink: #ff00ff;
    --space-black: #050510;
}

/* --- RESET E PULIZIA UI --- */
::-webkit-scrollbar { display: none; }
html, body {
    -ms-overflow-style: none;
    scrollbar-width: none;
    overflow-x: hidden;
    background: radial-gradient(circle at center, #11112b 0%, var(--space-black) 100%), 
                url('https://www.transparenttextures.com/patterns/stardust.png');
    background-attachment: scroll;
    color: #fff; 
    font-family: 'Orbitron', sans-serif;
    margin: 0; 
    min-height: 100vh;
    display: flex; 
    flex-direction: column; 
    align-items: center;
    justify-content: center;
}

@media (min-width: 768px) {
    html, body { background-attachment: fixed; }
}

/* --- CONTENITORE PRINCIPALE --- */
.main-cosmic-box {
    width: 94%;
    max-width: 480px;
    margin: 15px auto;
    padding: 20px;
    background: rgba(5, 5, 16, 0.85);
    border: 2px solid rgba(0, 255, 255, 0.35);
    border-radius: 20px;
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    transition: all 0.4s ease-in-out;
    overflow: visible;
}

/* --- FULLSCREEN MODALITÀ --- */
.main-cosmic-box:fullscreen {
    max-width: 100vw !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    border-radius: 0px;
    border: none;
    background: radial-gradient(circle at center, #161638 0%, var(--space-black) 100%);
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    padding: 20px;
}

.main-cosmic-box:fullscreen .live-hero {
    max-width: 800px !important;
    width: 90vw;
    height: 45vh;
}
@media (max-width: 768px) {
    .main-cosmic-box:fullscreen .live-hero {
        max-width: 95vw !important;
        height: 40vh;
    }
}

/* --- OROLOGIO E MILLESSECONDI ROSSI --- */
.lunar-clock { 
    font-size: 3.2rem; 
    color: var(--neon-cyan); 
    text-shadow: 0 0 20px var(--neon-cyan); 
    font-weight: 700; 
    margin: 8px 0 2px 0; 
}

#lunarMS { 
    color: #ff0055; 
    text-shadow: 0 0 10px #ff0055, 0 0 20px #ff0000; 
    font-size: 1.4rem; 
    font-weight: 700;
}

.user-local-info {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 1px;
    margin-bottom: 12px;
    text-align: center;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
}

/* --- HERO BOX --- */
.live-hero {
    background: 
        radial-gradient(1px 1px at 25px 35px, #fff, rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 60px 100px, #fff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 110px 50px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 180px 140px, rgba(255,255,255,0.8), rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 250px 60px, #fff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 320px 100px, #fff, rgba(0,0,0,0)),
        black;
    background-size: 250px 250px;
    animation: heroStars 10s infinite linear;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2), inset 0 0 15px rgba(255, 255, 255, 0.05);
    width: 100%;
    max-width: 440px;
    text-align: center;
    margin: 0 auto 15px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    position: relative;
    overflow: visible;
}

@keyframes heroStars { from { background-position: 0 0; } to { background-position: 0 250px; } }
.hero-station-name { color: var(--neon-cyan); text-shadow: 0 0 10px var(--neon-cyan); margin-bottom: 12px; font-size: 1.4rem; }

/* --- CONTENITORE MOON STATION --- */
.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    overflow: visible;
}

.moon-station-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 25px auto 35px;
    width: 180px;
    height: 180px;
    overflow: visible;
}

/* BUTTON LUNA */
.btn-main { 
    background: transparent; 
    border: none; 
    width: 120px; 
    height: 120px; 
    border-radius: 50%; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    position: relative;
    z-index: 10;
    padding: 0;
    outline: none;
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1); 
}

/* IMMAGINE LUNA REALE + ROTAZIONE CONTINUA */
.moon-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.6)) drop-shadow(0 0 25px var(--neon-cyan));
    transition: filter 0.6s ease;
    pointer-events: none;
    display: block;
    animation: rotateMoon 80s linear infinite;
}

@keyframes rotateMoon {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ICONA PLAY */
.btn-main i { 
    position: absolute;
    color: var(--neon-cyan);
    font-size: 1.8rem;
    text-shadow: 0 0 8px #000, 0 0 15px var(--neon-cyan);
    z-index: 15;
    pointer-events: none;
    transition: opacity 0.4s ease, visibility 0.4s ease; 
}

/* FIX PLAY BUTTON: SCOMPARSA TOTALE SENZA CONFLITTI HOVER */
.btn-main.hide-icon i { 
    opacity: 0 !important; 
    visibility: hidden !important;
}

.btn-main:not(.hide-icon):hover i { 
    opacity: 1; 
}

/* MANTIENE LA ROTAZIONE ED AGGIUNGE L'EFFETTO PULSAZIONE */
.btn-main.pulsing .moon-image { 
    animation: rotateMoon 80s linear infinite, moonPulse 4s infinite ease-in-out; 
}

@keyframes moonPulse { 
    0% { filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.8)) drop-shadow(0 0 20px var(--neon-cyan)); } 
    50% { filter: drop-shadow(0 0 22px rgba(255, 255, 255, 1)) drop-shadow(0 0 35px var(--neon-pink)); } 
    100% { filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.8)) drop-shadow(0 0 20px var(--neon-cyan)); } 
}

/* --- EVENTO LUNARE BURST --- */
.moon-station-container.burst-active {
    z-index: 99;
}

.moon-station-container.burst-active .btn-main {
    transform: scale(1.85);
}

.moon-station-container.burst-active .moon-image {
    filter: drop-shadow(0 0 25px #ffffff) 
            drop-shadow(0 0 50px var(--neon-cyan)) 
            drop-shadow(0 0 80px var(--neon-pink)) !important;
}

/* --- CONTROLLI COMPATTI PER MOBILE --- */
.selector-container { margin: 12px 0 0 0; display: flex; align-items: center; width: 100%; justify-content: space-between; gap: 8px; }
.mode-selection { display: flex; gap: 6px; align-items: center; font-size: 0.75rem; }
.mode-btn { background: none; border: 1px solid var(--neon-cyan); color: var(--neon-cyan); padding: 6px 10px; cursor: pointer; font-family: 'Orbitron'; border-radius: 5px; font-size: 0.75rem; }
.mode-btn.active { background: var(--neon-cyan); color: #000; }
.fullscreen-widget-btn { background: none; border: 1px solid rgba(0, 255, 255, 0.3); color: var(--neon-cyan); width: 34px; height: 34px; border-radius: 5px; cursor: pointer; font-size: 0.8rem; }

/* --- PULIZIA TITOLI ACCOMPAGNATI DA FRECCE --- */
.clean-summary { cursor: pointer; outline: none; list-style: none; display: flex; justify-content: center; align-items: center; }
.clean-summary::-webkit-details-marker { display: none; }
.menu-title { font-size: 1.1rem; color: #fff; letter-spacing: 2px; margin: 15px 0; text-align: center; display: flex; align-items: center; gap: 10px; font-weight: 700; text-transform: uppercase; }
.arrow-icon { font-size: 0.9rem; color: var(--neon-cyan); transition: transform 0.3s; }
details[open] .arrow-icon { transform: rotate(180deg); }

/* --- SEZIONI DETTAGLI --- */
.seo-timetable-container { width: 94%; max-width: 480px; margin: 5px auto; background: rgba(10, 10, 25, 0.5); border-radius: 10px; padding: 0 10px; border: 1px solid rgba(255,255,255,0.05); box-sizing: border-box; }
.details-content { padding: 15px 5px 20px 5px; font-size: 0.85rem; line-height: 1.5; color: #ccc; }
.details-content h3 { color: #fff; font-size: 1rem; margin-top: 0; }

/* --- GRIGLIA DENTRO TIMETABLE --- */
.grid { display: grid; gap: 10px; width: 100%; grid-template-columns: 1fr; margin-bottom: 15px; }
.slot { background: rgba(255, 255, 255, 0.02); padding: 12px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.08); display: flex; flex-direction: column; gap: 4px; }
.slot.active { border-color: var(--neon-pink); background: rgba(255, 0, 255, 0.08); box-shadow: 0 0 10px rgba(255, 0, 255, 0.1); }
.t-ltc { color: var(--neon-pink); font-size: 0.7rem; font-weight: 700; }
.s-artist { color: var(--neon-cyan); font-size: 0.85rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Pulsante Mostra Altri */
.load-more-slots { width: 100%; background: none; border: 1px solid var(--neon-cyan); color: var(--neon-cyan); font-family: 'Orbitron'; padding: 10px; border-radius: 5px; cursor: pointer; font-size: 0.8rem; margin-top: 5px; transition: all 0.3s; }
.load-more-slots:hover { background: rgba(0, 255, 255, 0.1); }

#volSlider { -webkit-appearance: none; width: 160px; height: 4px; background: rgba(0, 255, 255, 0.2); }
.footer-area { padding: 25px; }
.back-home { color: var(--neon-cyan); text-decoration: none; font-size: 0.8rem; }

/* --- HARDWARE ACCELERATION FIX --- */
* { -webkit-backface-visibility: hidden; backface-visibility: hidden; }

/* --- COSMO RED BUTTON --- */
.btn-group { display: flex; gap: 8px; }
.red-btn { display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255, 0, 0, 0.5) !important; color: #ff0000 !important; text-decoration: none; transition: all 0.3s ease; }
.red-btn:hover { background-color: rgba(255, 0, 0, 0.2); box-shadow: 0 0 10px rgba(255, 0, 0, 0.3); }
.red-btn i { font-size: 0.85rem; }

/* --- MOBILE LANDSCAPE OPTIMIZATION --- */
@media (orientation: landscape) and (max-height: 600px) {
    .main-cosmic-box:fullscreen { padding: 5px !important; }
    .live-hero { 
        max-width: 350px !important; 
        padding: 8px !important; 
        height: auto !important; 
    }
    .lunar-clock { font-size: 1.8rem !important; margin: 2px 0 !important; }

    /* Fix per il nome dell'artista: testo completo senza puntini */
    .hero-station-name { 
        font-size: 0.80rem !important; 
        margin-bottom: 4px !important;
        white-space: normal !important; 
        overflow: visible !important;
        text-overflow: clip !important; 
        max-width: 100% !important;
        line-height: 1.1 !important;
    }

    /* Riduzione ingombro Luna per evitare sovrapposizioni */
    .moon-station-container { 
        margin: 5px auto 10px !important; 
        width: 100px !important; 
        height: 100px !important; 
    }
    .btn-main { 
        width: 75px !important; 
        height: 75px !important; 
    }
}

    /* Riduzione ingombro Luna per evitare sovrapposizioni */
    .moon-station-container { 
        margin: 5px auto 10px !important; 
        width: 100px !important; 
        height: 100px !important; 
    }
    .btn-main { 
        width: 75px !important; 
        height: 75px !important; 
    }
}