:root {
    /* ──────────────────────────────────────────────
       Identidad de Marca + Glossy Glassmorphism 2026
    ────────────────────────────────────────────── */
    --bg-body: #0a0c12;
    --text-color: #ffffff;
    
    /* Branding Dinámico (Inyectado por JS) */
    --color-marca: #ff6b00; /* Fallback Default */
    --color-marca-rgb: 255, 107, 0;

    --naranja-gradient: linear-gradient(90deg, var(--color-marca), rgba(var(--color-marca-rgb), 0.8), var(--color-marca));
    --accent-gradient: linear-gradient(145deg, var(--color-marca), rgba(var(--color-marca-rgb), 0.6));

    --bg-overlay: rgba(10, 12, 20, 0.55);

    --glass-bg: rgba(20, 22, 30, 0.65);
    --glass-border: linear-gradient(145deg, rgba(255,255,255,0.18), var(--color-marca));
    --glass-inner-glow: inset 0 2px 12px rgba(255,255,255,0.35), inset 0 -2px 8px rgba(0,0,0,0.4);

    /* ╔══════════════════════════════════════════════════════════════════
       ║ OPTIMIZADO #1: --blur-power estaba declarado DOS VECES en :root
       ║ (32px y luego 28px). El navegador descartaba la primera
       ║ silenciosamente, generando confusión. Se unifica a 28px.
       ║ Se añade --blur-power-cinematic para zonas especiales que
       ║ antes usaban el valor fantasma de 32px.
       ╚══════════════════════════════════════════════════════════════════ -->
    --blur-power:            28px;
    --blur-power-cinematic:  32px;
    --blur-power-light:      18px;

    --font-base: 16px;

    /* Motion System 2026 */
    --ease-fast:   0.18s ease-out;
    --ease-normal: 0.38s cubic-bezier(0.4, 0, 0.2, 1);
    --ease-slow:   0.68s cubic-bezier(0.16, 1, 0.3, 1);
    --ease-bounce: 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Elevation & Glow 2026 */
    --shadow-soft:       0 10px 30px rgba(0,0,0,0.4);
    --shadow-medium:     0 20px 60px rgba(0,0,0,0.5);
    --glow-neon:         0 0 30px rgba(255,107,0,0.55);
    --glow-neon-strong:  0 0 60px rgba(255,107,0,0.75);

    /* Z-Index premium */
    --z-bg:              -10;
    --z-content:           1;
    --z-player-circle:    10;
    --z-player-controls: 100;
    --z-header:         1000;
    --z-sidebar:        1100;
    --z-overlay:        1200;
    --z-modal:          1300;
    --z-toast:          1400;

    /* ╔══════════════════════════════════════════════════════════════════
       ║ OPTIMIZADO #2: --bg-cover ahora tiene valor por defecto en CSS.
       ║ Antes solo existía en JS (main.js lo seteaba), por lo que el
       ║ pseudo-elemento body::before aparecía sin fondo durante el JS
       ║ init, causando un flash (CLS). Con este default, el fondo es
       ║ visible inmediatamente desde el primer paint.
       ╚══════════════════════════════════════════════════════════════════ -->
    --bg-cover: url('/envivo/fotos/LOGO.avif');
}

/* ==========================================
   BASE & RESET GLOBAL (OPTIMIZADO V2026)
   ========================================== */
html, body {
    width: 100%;
    max-width: 100vw;
    margin: 0;
    padding: 0;
    font-size: var(--font-base);
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    min-height: 100dvh;
    scroll-behavior: smooth;
    position: relative;
}

body {
    background-color: var(--bg-body);
    color: var(--text-color);
    margin: 0 !important;
    padding: 0 !important;
    display: block;
}

/* ╔══════════════════════════════════════════════════════════════════════
   ║ OPTIMIZADO #3: body::before sin CLS.
   ║ PROBLEMA ANTERIOR: El blur de 28px se aplicaba sobre un elemento
   ║ que empezaba sin imagen (--bg-cover no tenía fallback CSS), lo que
   ║ causaba un Cumulative Layout Shift visible al cargar.
   ║
   ║ SOLUCIÓN:
   ║   • content-visibility: auto  → el navegador salta el rendering
   ║     de este elemento hasta que sea necesario (reduce CPU/GPU).
   ║   • will-change: filter       → avisa al compositor que este
   ║     elemento va a animar, lo mueve a su propia capa GPU desde el
   ║     inicio, eliminando el re-layout al cambiar la imagen.
   ║   • transform: scale(1.05) en vez de 1.1 → área menor de cálculo.
   ║   • La transición de background-image NO afecta el layout (CLS=0).
   ╚══════════════════════════════════════════════════════════════════════ -->
body::before {
    content: "";
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;

    background-image: var(--bg-cover);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    filter: blur(var(--blur-power)) brightness(0.4) saturate(1.3);
    transform: scale(1.05);

    z-index: var(--z-bg);

    /* Promovemos a capa GPU propia para evitar repaints costosos */
    will-change: filter;

    /* Transición suave entre carátulas (no genera CLS — solo visual) */
    transition: background-image 1.2s ease-in-out;
}

/* ==========================================
   MODALES — GLOSSY 2026
   ========================================== */

/* Siempre oculto por defecto */
.modal-master {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal, 1300);
    display: none !important;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;

    background: rgba(10, 12, 20, 0.4);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: clamp(12px, 4vw, 24px);
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

/* Activo solo con .active */
.modal-master.active {
    display: flex !important;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

/* Contenedor interno */
.modal-card {
    width: 95%;
    max-width: 450px;
    max-height: 80dvh;
    background: var(--glass-bg, rgba(20, 22, 30, 0.8));
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* ==========================================
   FOOTER MINIMALISTA
   ========================================== */
#footer-credits {
    padding: 10px 0;
    margin-top: 50px;
    background: transparent;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

#credits-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: 'Montserrat SemiBold', sans-serif;
    font-size: 9px;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.25);
    text-transform: uppercase;
}

.credits-divider {
    width: 1px;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
}

#credits-container a {
    color: var(--color-marca, #ff6b00);
    text-decoration: none;
    font-weight: 900;
    opacity: 0.7;
    transition: all 0.4s ease;
}

#credits-container a:hover {
    opacity: 1;
    letter-spacing: 4px;
    filter: drop-shadow(0 0 10px rgba(var(--color-marca-rgb), 0.5));
}

/* ==========================================
   SISTEMA RESPONSIVE — MOBILE-FIRST
   Breakpoints intocables por diseño:
     Mobile:      max-width: 575.98px
     Tablet:      min-width: 768px
     Desktop:     min-width: 992px
     Extra Large: min-width: 1200px
   ========================================== */

/* 1. MOBILE: Proximidad Máxima y Centrado */
@media (max-width: 575.98px) {
    .contenedor-app {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 5px;
    }

    .seccion-central {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0;
    }

    .area-informacion {
        margin-top: -15px !important;
        padding-top: 0 !important;
        text-align: center;
        align-items: center;
    }

    .programa-titulo {
        line-height: 0.85 !important;
        margin-bottom: 5px !important;
    }
}

/* 2. TABLET */
@media (min-width: 768px) {
    .seccion-central {
        gap: 20px;
    }
}

/* 3. DESKTOP: Diseño Horizontal > 992px (> 1000px por diseño) */
@media (min-width: 992px) {
    .seccion-central {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: clamp(40px, 8vw, 100px);
        max-width: 1200px;
        margin: 40px auto;
        min-height: 60vh;
    }

    .area-informacion {
        text-align: left;
        align-items: flex-start;
        padding: 0;
    }

    .programa-actual {
        border-left: 5px solid var(--color-marca);
        padding-left: 25px;
    }
}

/* 4. EXTRA LARGE */
@media (min-width: 1200px) {
    .seccion-central {
        gap: 120px;
    }
}

/* ==========================================
   REDES SOCIALES LOCUTOR (MARCA BLANCA Y MINIMALISMO)
   ========================================== */
.redes-container {
    display: flex; /* Force render */
    gap: 16px;
    margin-top: 8px;
    opacity: 1;
    z-index: 1000;
    position: relative;
}

/* Alineación Horizontal Premium */
@media (max-width: 991.98px) {
    .redes-container {
        justify-content: center;
    }
}
@media (min-width: 992px) {
    .redes-container {
        justify-content: flex-start;
    }
}

.btn-red-locutor {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 0;
    color: var(--color-predominante);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
    font-size: 22px;
    text-decoration: none;
    opacity: 0;
    transform: scale(0.5) translateY(15px);
    transition: color 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
    cursor: pointer;
}

.btn-red-locutor:hover {
    color: var(--color-predominante);
    transform: scale(1.2) translateY(-2px) !important;
    filter: brightness(1.2) drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}

.btn-red-locutor.show {
    animation: bounceInOverlay 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes bounceInOverlay {
    0% { opacity: 0; transform: scale(0.5) translateY(15px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}
