/* --- CONFIGURACIÓN MODO TV --- */
.tv-mode-body { background-color: #000; margin: 0; padding: 0; overflow: hidden; cursor: default; }

/* --- SALUDO HORARIO FINO --- */
.glass-toast {
    position: fixed; top: -60px; left: 50%; transform: translateX(-50%);
    background: rgba(10, 10, 12, 0.7); backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 40px;
    padding: 10px 24px; color: #fff; font-family: 'Montserrat', sans-serif; 
    font-size: 0.62rem; font-weight: 500; letter-spacing: 0.5px; text-transform: uppercase;
    z-index: 10000; opacity: 0; transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 15px 35px rgba(0,0,0,0.6); pointer-events: none;
}
.glass-toast.show { top: 35px; opacity: 1; }

/* --- VIDEO ÚNICO DE FONDO --- */
#video-container { position: fixed; top: 0; left: 0; width: 100vw; height: 100dvh; z-index: 1; background: #020205; }
#bg-video {
    width: 100%; height: 100%; object-fit: cover; opacity: 0.85;
    transition: filter 1s ease, transform 1s ease; transform: scale(1.01);
}

/* Pausa Cinematográfica */
#bg-video.video-paused { filter: grayscale(100%) brightness(0.4) blur(4px) contrast(1.1); transform: scale(1.05); }
.video-vignette { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: radial-gradient(circle, rgba(0,0,0,0) 40%, rgba(0,0,0,0.9) 100%); pointer-events: none; z-index: 3; }

/* Glitch */
.glitch-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: url('data:image/svg+xml,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="n"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="1.5" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23n)" opacity="0.5"/%3E%3C/svg%3E'); z-index: 4; mix-blend-mode: overlay; pointer-events: none; opacity: 0; transition: opacity 0.1s; }
.glitch-active { opacity: 1 !important; }

/* --- INTERFAZ TV --- */
#tv-ui { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 10; pointer-events: none; transition: opacity 0.5s ease; }
.clean-feed #tv-ui { opacity: 0; }
.clean-feed .bottom-nav-container { opacity: 0; pointer-events: none; }

.tv-hud { position: absolute; top: 40px; left: 40px; font-family: 'Space Mono', monospace; font-size: 0.6rem; color: rgba(255,255,255,0.4); letter-spacing: 2px; z-index: 5; }

.tv-header { position: absolute; top: 40px; right: 40px; display: flex; align-items: center; gap: 20px; }
.tv-logo { height: 45px; opacity: 0.8; filter: drop-shadow(0 0 10px rgba(0,0,0,0.5)); }

/* Sponsor Tag */
.tv-sponsor { position: absolute; top: 100px; right: 40px; background: rgba(0,0,0,0.6); backdrop-filter: blur(5px); border: 1px solid rgba(255,215,0,0.3); padding: 4px 10px; border-radius: 4px; color: rgba(255,255,255,0.7); font-size: 0.5rem; font-weight: 400; letter-spacing: 1px; display: none; transition: opacity 0.5s; }
.tv-sponsor strong { color: #ffd700; }

/* Track Info - Layout Base Escritorio */
.tv-track-info { position: absolute; bottom: 130px; left: 40px; display: flex; align-items: center; gap: 15px; pointer-events: auto; }
.tv-cover { width: 65px; height: 65px; border-radius: 50%; box-shadow: 0 10px 20px rgba(0,0,0,0.8); border: 2px solid rgba(255,255,255,0.1); }
.girando { animation: spin 8s linear infinite; animation-play-state: paused; }
.girando.is-playing { animation-play-state: running; }
@keyframes spin { 100% { transform: rotate(360deg); } }

.tv-text-wrapper { display: flex; flex-direction: column; gap: 2px; }
#tv-trackTitle { font-size: 1rem; font-weight: 800; margin: 0; text-transform: uppercase; text-shadow: 0 2px 10px rgba(0,0,0,0.8); }
#tv-trackArtist { font-size: 0.8rem; font-weight: 400; margin: 0; opacity: 0.7; text-transform: uppercase; letter-spacing: 2px; }

/* FIX UX: Ocultar Siguiente Track en Video */
.tv-up-next { display: none !important; }

/* Social & Acciones TV - Layout Base Escritorio */
.tv-actions { position: absolute; bottom: 130px; right: 40px; display: flex; align-items: center; gap: 12px; pointer-events: auto; }
.tv-btn { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: white; width: 45px; height: 45px; border-radius: 50%; backdrop-filter: blur(10px); cursor: pointer; transition: 0.3s; font-size: 1.1rem; display: flex; justify-content: center; align-items: center; }
.tv-btn:hover { background: rgba(255,255,255,0.3); transform: scale(1.1); }
.play-btn-tv { width: 55px; height: 55px; background: white; color: black; font-size: 1.3rem; position: relative; }
.social-btn { font-size: 1rem; opacity: 0.7; width: 40px; height: 40px; border: none; background: transparent; } 
.social-btn.active-like { color: #4ade80; opacity: 1; text-shadow: 0 0 10px rgba(0, 230, 118, 0.8); }
.social-btn.active-dislike { color: #f87171; opacity: 1; }
#cast-btn { display: none; }

/* Ticker (Restaurado Glass Effect nativo) */
.tv-ticker { 
    position: absolute; bottom: 90px; left: 0; width: 100%; height: 25px; 
    display: flex; align-items: center; overflow: hidden; pointer-events: none; 
    background: rgba(20, 20, 25, 0.4) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.3) !important;
}
.ticker-text { white-space: nowrap; font-size: 0.60rem; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; color: #fff; opacity: 0.7; padding-left: 100vw; animation: ticker-scroll 35s linear infinite; }
@keyframes ticker-scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-150%); } }

/* Hype Meter */
#hype-meter { display: inline-block; opacity: 0; font-size: 0.55rem; font-weight: 700; color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1); padding: 3px 10px; border-radius: 20px; text-transform: uppercase; letter-spacing: 2px; transition: opacity 0.4s ease; width: fit-content; }

/* ==========================================
   FIX UX: MOBILE LAYOUT (Reels / TikTok Style)
   ========================================== */
@media (max-width: 768px) {
    .tv-hud { top: 20px; left: 20px; font-size: 0.5rem; }
    .tv-header { top: 20px; right: 20px; }
    .tv-logo { height: 35px; }
    
    /* 1. Ocultar Botón Fullscreen en Móviles */
    #fullscreen-btn { display: none !important; }
    
    /* 2. Metadata (Cover y Textos): Mantenidos abajo a la izquierda con TAMAÑOS ORIGINALES RESTAURADOS */
    .tv-track-info { 
        bottom: 130px; 
        left: 20px; 
        max-width: calc(100vw - 90px); 
        align-items: center; 
        pointer-events: none; 
    }
    
    .tv-cover { width: 65px !important; height: 65px !important; } /* Restaurado */
    
    /* Forzar salto de línea sin encoger el tamaño de la fuente */
    .tv-text-wrapper { max-width: 100%; }
    #tv-trackTitle { 
        font-size: 1rem !important; /* Restaurado */
        white-space: normal !important; 
        word-wrap: break-word !important;
        line-height: 1.2;
    }
    #tv-trackArtist { font-size: 0.8rem !important; /* Restaurado */ }
    
    /* 3. Botones de Acción: ELEVADOS en columna derecha (soluciona el choque) */
    .tv-actions { 
        bottom: 230px; 
        right: 20px; 
        flex-direction: column; 
        gap: 15px; 
        z-index: 110;
    }
    
    .tv-ticker { bottom: 95px; }
    .tv-sponsor { top: 75px; right: 20px; }
    
    .tv-actions > div { display: none; }
}