:root {
    --bg-deep: #050505;
    --candy-pink: #ff2a6d;
    --candy-purple: #d300c5;
    --candy-cyan: #05d9e8;
    --text-main: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --chat-bg: #0b0e11;
    --kick-green: #53fc18;
    --twitch-purple: #9146FF;
    --telegram-blue: #0088cc;
    --candy-red: #fc0505;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-deep);
    color: var(--text-main);
    overflow: hidden; 
    -webkit-text-size-adjust: 100%; 
    text-size-adjust: 100%;
}

/* =========================================
   0. EFECTOS GLOBALES Y ESTÉTICA
   ========================================= */

/* Scrollbar Personalizado (Webkit) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #0a0a0a; 
}
::-webkit-scrollbar-thumb {
    background: #333; 
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--candy-pink); 
}

/* Fondos Animados */
.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    z-index: 0; 
    pointer-events: none;
}

.glow-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--candy-purple), transparent 70%);
    animation: floatBlob 20s infinite alternate;
}

.glow-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--candy-cyan), transparent 70%);
    animation: floatBlob 25s infinite alternate-reverse;
}

@keyframes floatBlob {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 30px) scale(1.1); }
}

/* =========================================
   1. PANTALLA DE INICIO (LANDING)
   ========================================= */
#landing-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(-45deg, #050505, #1b0019, #012331, #050505);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    transition: opacity 0.5s ease;
    overflow-y: auto;
    text-align: center;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.landing-container {
    position: relative;
    z-index: 10;
    width: 90%;
    max-width: 700px;
    padding: 20px;
    padding-bottom: 60px;
}

.logo-area img {
    max-width: 150px;
    margin-bottom: 20px;
    drop-shadow: 0 0 20px rgba(255, 42, 109, 0.3);
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    animation: floatLogo 6s ease-in-out infinite;
}

@keyframes floatLogo {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* --- H1 */
h1 {
    font-family: 'Nunito', sans-serif;
    font-size: 2.5rem;
    margin: 0;
    margin-bottom: 10px;
    color: #fff;
    font-weight: 800;
    display: inline-block;
    /* Borde simulado con sombras duras */
    text-shadow: 
        2px 2px 0 #000, 
        -1px -1px 0 #000,  
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000;
    border-bottom: 2px solid var(--candy-pink);
    padding-bottom: 5px;
    letter-spacing: -0.5px;
}

.subtitle {
    color: #aaa;
    margin-top: 0;
    margin-bottom: 60px;
    font-size: 1.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 10px;
}

/* Info Card con efecto Glass */
.info-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    margin: 15px 0;
    text-align: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2); /* Sombra añadida */
}

.info-card h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 300;
    font-size: 1rem;
    line-height: 1.6;
    color: #e0e0e0;
    margin-top: 0;
    display: block; 
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}
.info-card h3 span {
    color: var(--candy-cyan);
    font-weight: 600;
    display: inline;
}

.info-card p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #ccc;
    margin-bottom: 0;
}

/* --- BOTÓN DE ENTRADA --- */
.enter-btn {
    display: inline-block;
    width: 300px;
    background: linear-gradient(135deg, var(--candy-purple), var(--candy-pink));
    color: white;
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 20px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(211, 0, 197, 0.4);
    transition: all 0.3s ease;
    animation: pulseBtn 2s infinite;
}

@keyframes pulseBtn {
    0% { box-shadow: 0 0 0 0px rgba(211, 0, 197, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(211, 0, 197, 0); }
    100% { box-shadow: 0 0 0 0px rgba(211, 0, 197, 0); }
}

.enter-btn:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* --- FOOTER & REDES --- */
.landing-footer {
    margin-top: 40px;
    border-top: 1px solid var(--glass-border);
    padding-top: 20px;
    width: 100%;
}

.social-footer-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

.social-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.social-icon:hover { transform: translateY(-5px); background: rgba(255, 255, 255, 0.1); }
.btn-tg:hover { color: #0088cc; border-color: #0088cc; }
.btn-x:hover { color: #ffffff; border-color: #ffffff; }
.btn-twitch:hover { color: #9146FF; border-color: #9146FF; }
.btn-kick:hover { color: #53fc18; border-color: #53fc18; }

.social-disabled {
    opacity: 0.3;
    pointer-events: none;
    filter: grayscale(1);
}

.legal-link {
    font-size: 0.75rem;
    color: #ababab;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s;
    margin-top: 30px;
}
.legal-link:hover { color: var(--candy-cyan); }


/* =========================================
   2. APP LAYER (PRINCIPAL)
   ========================================= */
#app-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
    flex-direction: column;
}

/* --- GRUPO DE VIDEO --- */
.video-group {
    position: relative;
    background: #000;
    display: flex;
    flex-direction: column;
    flex-basis: 75%;
    flex-grow: 0;
    flex-shrink: 0;
    min-height: auto;
    min-width: 670px !important;
    z-index: 10;
    height: 100%;
    width: auto;
    border-right: 1px solid #333;
}

.iframe-wrapper {
    flex: 1;
    width: 100%;
    height: 100%;
    position: relative;
    background: #000;
}

.iframe-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* --- BARRA DE CONTROL --- */
.control-bar {
    display: flex;
    align-items: center;
    background: #0f0f0f;
    padding: 0 15px;
    height: 45px;
    border-bottom: 1px solid #222;
    gap: 8px;
    overflow: hidden;
    min-width: 410px !important; 
    flex-shrink: 0;
}

.ctrl-btn {
    background: transparent;
    border: 1px solid #333;
    color: #aaa;
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: 0.3s;
    height: 32px;
    flex-shrink: 0; 
    white-space: nowrap;
}

.ctrl-btn:hover { color: #fff; border-color: #ff2a6d; background: rgba(255, 42, 109, 0.1); }

.live-badge {
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    background: #e91e63;
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: 5px;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Online Pills */
.online-pill {
    display: flex; align-items: center; background: rgba(0, 0, 0, 0.5);
    border: 1px solid #333; padding: 2px 8px; border-radius: 12px;
    margin-left: 10px; font-size: 10px; color: #ccc; font-weight: bold;
}
.dot-online {
    width: 6px; height: 6px; background: #ff0000; border-radius: 50%;
    margin-right: 5px; box-shadow: 0 0 5px #f00;
}

/* --- RESIZER --- */
#resizer {
    background: #1a1a1a;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 12px;
    width: 100%;
    cursor: row-resize;
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
}

#resizer::after {
    content: '';
    width: 40px;
    height: 4px;
    background: #555;
    border-radius: 2px;
}
#resizer:hover, #resizer.active { background: var(--kick-green); }
#resizer.active::after { background: #000; }

#drag-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 9999; display: none; cursor: grabbing;
}

/* --- CHAT --- */
.chat-group {
    flex: 1;
    background: var(--chat-bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.chat-header {
    height: 46px;
    background: var(--chat-bg);
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-bottom: 1px solid #222;
    flex-shrink: 0;
    justify-content: space-between;
}

.user-info-display {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
}

.user-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

#logoutBtn {
    background: #ff4444; color: white; border: none; padding: 4px 8px;
    border-radius: 4px; cursor: pointer; font-size: 11px; margin-left: auto; display: none;
}
#logoutBtn:hover { background: #cc0000; }

#chatMessages {
    flex: 1; padding: 10px; overflow-y: auto; color: #ddd; font-size: 14px;
    display: flex; flex-direction: column; gap: 8px; scroll-behavior: smooth;
}

.msg-line { line-height: 1.4; word-wrap: break-word; }
.msg-time { color: #666; font-size: 0.8em; margin-right: 6px; font-family: monospace; }
.msg-author { color: var(--kick-green); font-weight: bold; margin-right: 5px; }
.msg-content { color: #fff; }
.system-msg { color: #777; font-style: italic; font-size: 12px; }

.chat-input-area {
    padding: 10px; min-width: 0; background: var(--chat-bg);
    border-top: 1px solid #222; display: flex; gap: 8px;
}

#chatInput {
    flex: 1; flex-shrink: 1; min-width: 50px; 
    background: #1a1a1a; border: 1px solid #333; color: #fff;
    padding: 10px 12px; border-radius: 6px; outline: none;
}
#chatInput:focus { border-color: var(--kick-green); }
#chatInput:disabled { opacity: 0.5; cursor: not-allowed; }

#sendBtn {
    background: var(--kick-green); color: #000; border: none; padding: 0 15px;
    font-weight: bold; border-radius: 6px; cursor: pointer;
}
#sendBtn:hover { opacity: 0.8; }
#sendBtn:disabled { background: #333; color: #777; cursor: not-allowed; }

/* --- TICKERS (SISTEMA DUAL) --- */
/* 1. Ticker Escritorio (Arriba) */
#news-ticker-container {
    flex-grow: 10;
    min-width: 0;
    height: 100%;
    margin: 0 15px;
    overflow: hidden;
    position: relative;
    display: none; /* Se activa por JS */
    align-items: center;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

#news-ticker-content {
    white-space: nowrap; position: absolute; color: white; font-weight: bold;
    font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px;
    animation: tickerMove 30s linear infinite; padding-left: 100%;
}

/* 2. Ticker Móvil (Abajo/Cabecera) - Por defecto OCULTO */
.mobile-ticker-container {
    display: none; 
}

@keyframes tickerMove {
    0% { transform: translateX(0); }
    100% { transform: translateX(-150%); }
}


/* =========================================
   3. MODAL & UTILIDADES
   ========================================= */
.modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); z-index: 10000; align-items: center;
    justify-content: center; backdrop-filter: blur(5px);
}
.modal-content {
    background-color: #1a1a1a; border: 1px solid #333; padding: 25px;
    border-radius: 15px; width: 90%; max-width: 600px; color: #ddd;
    max-height: 80vh; overflow-y: auto; box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}
.close-modal { color: #aaa; float: right; font-size: 28px; font-weight: bold; cursor: pointer; }
.close-modal:hover { color: #fff; }

.hidden { display: none !important; }

/* --- MODO OFFLINE --- */
body.offline-mode .enter-btn { background: #444 !important; cursor: pointer !important; animation: none; transform: none; box-shadow: none; }
body.offline-mode .live-badge { background: #666 !important; }
#offline-overlay {
    display: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); z-index: 100; flex-direction: column;
    align-items: center; justify-content: center; backdrop-filter: blur(10px);
}
body.offline-mode #offline-overlay { display: flex; }

/* --- EMOJIS & SETTINGS --- */
.icon-btn {
    background: transparent; border: none; color: #aaa; font-size: 1.2rem; cursor: pointer;
    padding: 0 8px; transition: color 0.3s; display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { color: var(--candy-cyan); }
.icon-btn:disabled { opacity: 0.3; cursor: not-allowed; }
#emojiBtn { font-size: 1.3rem; padding-right: 5px; flex-shrink: 0; }
#settingsBtn { font-size: 1rem; color: #888; }
#settingsBtn:hover { color: var(--candy-pink); }
#sendBtn { flex-shrink: 0; }

/* Grid Colores */
.color-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px;
    justify-items: center; margin-bottom: 20px;
}
.color-option {
    width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
    border: 2px solid transparent; transition: transform 0.2s, box-shadow 0.2s;
}
.color-option:hover { transform: scale(1.1); }
.color-option.selected {
    border: 2px solid #fff; box-shadow: 0 0 15px currentColor; transform: scale(1.2);
}


/* =========================================
   MEDIA QUERIES (LOGICA RESPONSIVE)
   ========================================= */

/* ESCRITORIO (> 769px) */
@media (min-width: 769px), (orientation: landscape) and (min-width: 550px) {
    #app-layer { 
        flex-direction: row; 
        overflow: hidden;
    }

    /* 1. EL VIDEO (Líquido) */
    .video-group {
        /* flex-grow: 1, flex-shrink: 1, flex-basis: auto */
        flex: 1 1 auto !important; 
        width: auto !important;
        height: 100%; 
        border-right: 1px solid #333;
        min-width: 0 !important;
        /* Nos aseguramos de borrar cualquier rastro de porcentajes */
        flex-basis: auto !important; 
    }

    /* 2. EL CHAT (Sólido como una roca) */
    .chat-group {
        /* flex-grow: 0, flex-shrink: 0, flex-basis: 340px */
        flex: 0 0 340px !important; 
        width: 340px !important; 
        min-width: 340px !important;
        max-width: 340px !important;
        height: 100%;
        border-left: 1px solid #333;
    }

    /* 3. RESIZER (Oculto y anulado) */
    #resizer { display: none !important; }
}

/* B. TABLET/PORTATIL (1100px - 769px) */
@media (max-width: 1100px) {
    .ctrl-btn span { display: none; }
    .ctrl-btn { padding: 0; width: 36px; justify-content: center; }
    .ctrl-btn i { font-size: 1.1rem; margin: 0; }
    #news-ticker-content { font-size: 0.8rem; }
}

/* MÓVIL (MAX-WIDTH: 768px) */
@media (max-width: 768px) {
    body, html {
        height: 100% !important; width: 100%; overflow: hidden !important;
        position: fixed; overscroll-behavior: none;
    }
    #app-layer {
        display: flex !important; flex-direction: column !important;
        height: 100%; width: 100%; overflow: hidden;
    }

    /* BARRA DE CONTROL */
    .control-bar {
        width: 100% !important; 
        justify-content: flex-start !important;
        overflow-x: auto !important; 
        white-space: nowrap; 
        padding: 0 10px !important;
        gap: 8px !important; 
        flex-shrink: 0; 
        background: #0f0f0f;
    }
    .control-bar::-webkit-scrollbar { display: none; }
    
    .ctrl-btn { 
        display: flex !important; flex-shrink: 0 !important; width: 40px !important;
        padding: 0 !important; justify-content: center;
    }
    
    #toggleBtn { display: none !important; }

    /* Ocultamos espaciadores en tablet vertical/movil horizontal */
    .control-bar > div[style*="flex-grow"] { display: none !important; }

    #resizer { display: none !important; }

    .video-group {
        display: flex !important; flex-direction: column !important;
        min-width: 0 !important; width: 100% !important;
        height: 240px !important; flex: 0 0 240px !important;
        order: 1; z-index: 10; border-bottom: 1px solid #333; background: #000;
    }
    .iframe-wrapper iframe {
        position: absolute; top: 0; left: 0; width: 100% !important; height: 100% !important; object-fit: contain;
    }

    /* CHAT GROUP */
    .chat-group {
        flex: 1 1 auto !important; display: flex; flex-direction: column;
        order: 2; min-height: 0; overflow: hidden;
    }
    .chat-header { flex-shrink: 0; justify-content: space-between !important; padding-right: 5px; }
    .chat-header > div[style*="flex-grow"] { display: none !important; }
    
    .chat-input-area {
        flex-shrink: 0; background: var(--chat-bg); padding: 10px !important;
        position: relative; z-index: 50;
    }

    /* LANDING */
    .logo-area img { max-width: 100px !important; margin-bottom: 10px !important; }
    .landing-container {
        padding-top: 10px !important; padding-bottom: 10px !important;
        display: flex; flex-direction: column; justify-content: center; min-height: 100vh;
    }
    .landing-container h1 { font-size: 1.8rem !important; margin-bottom: 5px !important; }
    .info-card { padding: 10px !important; margin: 10px 0 !important; }
    .info-card h3 { font-size: 0.9rem !important; }
    .landing-footer { margin-top: 15px !important; padding-top: 10px !important; }
    .enter-btn { padding: 15px !important; width: 100% !important; max-width: 280px; }
    .social-icon { width: 38px !important; height: 38px !important; font-size: 1.1rem !important; }
    
    #emojiBtn { display: none !important; }
}
/* PANTALLA PEQUEÑA (MAX-WIDTH: 600px) */
@media (max-width: 600px) {
    /* 1. Ocultar Ticker Arriba */
    #news-ticker-container { display: none !important; }
    
    /* 2. Activar espaciador para separar botones */
    .control-bar > div[style*="flex-grow"] { 
        display: block !important; 
        flex-grow: 1 !important;
    }

    /* 3. Mostrar Ticker Móvil */
    .mobile-ticker-container {
        display: flex !important;
        flex: 1; 
        min-width: 0;
        overflow: hidden;
        height: 20px;
        background: rgba(0,0,0,0.3);
        border-radius: 4px;
        margin: 0 10px;
        align-items: center;
        mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
        -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
    }
    
    #mobile-ticker-content {
        white-space: nowrap; color: white; font-size: 0.75rem; font-weight: bold;
        animation: tickerMove 15s linear infinite; padding-left: 100%;
    }

    .subtitle { font-size: 0.85rem !important; margin-bottom: 30px !important; }
}

/* E. PANTALLA MICRO (MAX-WIDTH: 360px) */
@media (max-width: 360px) {
    .mobile-ticker-container { display: none !important; }
}

/* =========================================
   ESTILO ESPECIAL: TECLADO ABIERTO
   ========================================= */
body.keyboard-open #chatMessages { display: none !important; }
body.keyboard-open .chat-group { flex: 0 1 auto !important; }

@media (orientation: landscape) and (max-height: 600px) {
    
    /* 1. Forzamos la disposición en FILA (Lado a lado) */
    #app-layer {
        flex-direction: row !important;
        /* Protegemos contra el "Notch" o isla del iPhone a los lados */
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    /* 2. El Video ocupa todo el ancho disponible */
    .video-group {
        width: auto !important;
        height: 100% !important;
        flex: 1 !important; /* Ocupa el espacio sobrante */
        min-height: 0 !important;
        border-bottom: none !important; /* Quitamos la linea de abajo del modo vertical */
        border-right: 1px solid #333;
    }

    /* 3. El Chat en columna derecha (Más estrecho que en PC para ganar espacio) */
    .chat-group {
        width: 280px !important; /* Un poco más estrecho que en PC (340px) */
        min-width: 280px !important;
        flex: 0 0 280px !important;
        height: 100% !important;
        border-left: 1px solid #333;
        padding-bottom: 0 !important;
    }
    
    /* 4. Ajustes internos para que quepa todo en poca altura */
    .chat-header {
        height: 40px !important; /* Cabecera más compacta */
        min-height: 40px !important;
    }
    
    /* Ocultamos cosas innecesarias en horizontal móvil si estorban */
    .landing-container .logo-area img {
        max-width: 80px !important; /* Logo más pequeño en landing horizontal */
    }
}
/* =========================================
NOTICIAS
   ========================================= */
#news-layer {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-deep); z-index: 5000; overflow-y: auto;
    display: flex; flex-direction: column; align-items: center;
    padding-bottom: 50px;
}

.news-container { width: 95%; max-width: 1000px; padding-top: 20px; }

.news-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 30px; border-bottom: 1px solid #333; padding-bottom: 15px;
}
.news-header h2 { color: #fff; margin: 0; font-size: 1.5rem; text-transform: uppercase; letter-spacing: 2px; }

.back-btn { font-size: 1rem; color: #aaa; border: 1px solid #333; padding: 5px 15px; border-radius: 20px; }
.back-btn:hover { background: #fff; color: #000; }

/* GRID DE NOTICIAS */
.news-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px; width: 100%;
}

.news-card {
    background: #0f0f0f; border: 1px solid #222; border-radius: 12px;
    overflow: hidden; transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer; display: flex; flex-direction: column;
}
.news-card:hover { transform: translateY(-5px); box-shadow: 0 5px 15px rgba(5, 217, 232, 0.2); border-color: var(--candy-cyan); }

.card-img { width: 100%; height: 160px; object-fit: cover; }
.card-content { padding: 15px; flex: 1; display: flex; flex-direction: column; }
.card-date { font-size: 0.75rem; color: #666; margin-bottom: 5px; }
.card-title { font-size: 1.1rem; font-weight: bold; color: #fff; margin-bottom: 10px; line-height: 1.3; }
.card-snippet { font-size: 0.9rem; color: #aaa; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* VISOR DE NOTICIA (LECTURA) */
#news-reader { display: block; animation: fadeIn 0.3s ease; }
.reader-content { background: #111; padding: 20px; border-radius: 15px; border: 1px solid #333; }
#reader-img { width: 100%; max-height: 400px; object-fit: cover; border-radius: 10px; margin-bottom: 20px; }
#reader-title { font-size: 2rem; color: var(--candy-cyan); margin-bottom: 10px; line-height: 1.2; }
.reader-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 1px solid #333; padding-bottom: 15px; }
#reader-body { font-size: 1.1rem; line-height: 1.8; color: #ddd; white-space: pre-wrap; }
#reader-body img { max-width: 100%; border-radius: 8px; margin: 10px 0; }

.share-btn {
    background: var(--telegram-blue); color: white; border: none;
    padding: 8px 15px; border-radius: 5px; cursor: pointer; font-weight: bold;
}

/* ADMIN INPUTS */
.admin-input {
    width: 100%; background: #222; border: 1px solid #444; color: #fff;
    padding: 10px; margin-bottom: 10px; border-radius: 5px; outline: none;
}
.admin-input:focus { border-color: var(--candy-cyan); }

@media (max-width: 768px) {
    .news-grid { grid-template-columns: 1fr; }
    #reader-title { font-size: 1.5rem; }
}

.landing-buttons-container {
    display: flex;
    flex-direction: column; /* Uno debajo de otro */
    align-items: center;    /* Centrados */
    gap: 15px;              /* Espacio entre ellos */
    width: 100%;
}


.btn-news {
    background: transparent !important;
    border: 2px solid var(--candy-cyan) !important;
    color: var(--candy-cyan) !important;
    box-shadow: none !important;
    animation: none !important; 
    margin-top: 0 !important; 
}

.btn-news:hover {
    background: rgba(5, 217, 232, 0.1) !important;
    box-shadow: 0 0 15px var(--candy-cyan) !important;
}
#reader-body blockquote {
    border-left: 4px solid var(--candy-pink);
    background: rgba(255, 42, 109, 0.1);
    padding: 15px;
    margin: 20px 0;
    border-radius: 0 10px 10px 0;
    font-style: italic;
    color: #fff;
}
#reader-body ul {
    margin-left: 20px;
    margin-bottom: 20px;
}
#reader-body li {
    margin-bottom: 8px;
}
/* --- COMENTARIOS EN NOTICIAS --- */
.comments-list {
    margin-top: 20px;
    margin-bottom: 20px;
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.comment-item {
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #333;
}

.comment-avatar {
    width: 35px; height: 35px; border-radius: 50%; object-fit: cover;
    border: 1px solid var(--candy-cyan);
}

.comment-body { display: flex; flex-direction: column; }
.comment-author { font-size: 0.85rem; color: var(--candy-cyan); font-weight: bold; margin-bottom: 2px; }
.comment-text { font-size: 0.95rem; color: #ddd; line-height: 1.4; }
.comment-time { font-size: 0.7rem; color: #666; margin-top: 5px; }

.comment-input-area {
    display: flex; gap: 10px; margin-top: 10px;
}
.comment-input-area input {
    flex: 1; background: #222; border: 1px solid #444; color: white;
    padding: 10px; border-radius: 5px; outline: none;
}
.comment-input-area input:focus { border-color: var(--candy-cyan); }
.comment-input-area button {
    background: var(--candy-purple); color: white; border: none;
    padding: 0 20px; border-radius: 5px; cursor: pointer; font-size: 1.2rem;
}
.comment-input-area button:disabled { background: #333; cursor: not-allowed; }



.player-shield {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - 70px); 
    z-index: 15;
    background: transparent;
    /* background: rgba(255, 0, 0, 0.2); */
    display: none; 
}


@media (min-width: 769px) {
    .player-shield {
        display: none !important;
    }
}
/* =========================================
  PANEL
   ========================================= */
#actionsPanel {
    position: absolute;
    bottom: 60px; /* Justo encima del input */
    left: 10px;
    right: 10px;
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--candy-cyan);
    border-radius: 12px;
    padding: 15px;
    z-index: 100;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.actions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
    color: var(--candy-cyan);
    font-weight: bold;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 columnas por defecto */
    gap: 10px;
}

/* Botones de acción */
.action-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    user-select: none;
}

.action-card:hover {
    background: rgba(5, 217, 232, 0.1);
    border-color: var(--candy-cyan);
    transform: translateY(-2px);
}

.action-card:active {
    transform: scale(0.98);
}

.action-icon {
    font-size: 1.5rem;
}

.action-info {
    display: flex;
    flex-direction: column;
}

.action-label {
    color: #fff;
    font-weight: bold;
    font-size: 0.9rem;
}

.action-cost {
    color: #aaa;
    font-size: 0.7rem;
}

/* Ajustes Responsive */
@media (max-width: 768px) {
    
    #actionTriggerBtn {
        display: flex !important;
        margin-right: 5px;
    }
    
    
    #actionsPanel {
        bottom: 70px; 
        left: 5px; 
        right: 5px;
    }
}

.action-card.back-card .action-label {
    color: #ff4444; 
    font-weight: 800;
}
/* Input de Invitado */
.guest-input {
    width: 80%;
    max-width: 300px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--candy-cyan);
    border-radius: 30px;
    color: #fff;
    text-align: center;
    font-size: 1.1rem;
    font-family: 'Poppins', sans-serif;
    outline: none;
    transition: all 0.3s;
}
.guest-input:focus {
    box-shadow: 0 0 15px var(--candy-cyan);
    background: rgba(255, 255, 255, 0.15);
}

/* --- ICONOS Y EMOTES DEL CHAT --- */
.badge-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 4px;
    position: relative;
    top: -2px; 
}

.chat-emote {
    height: 24px; 
    vertical-align: middle;
    display: inline-block;
    transition: transform 0.2s;
}

.chat-emote:hover {
    transform: scale(1.2); /* Efecto zoom al pasar el ratón */
}
/* =========================================

   ========================================= */


#emotesPanel {
    position: absolute;
    bottom: 60px;
    left: 10px;
    right: 10px;
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--candy-cyan);
    border-radius: 12px;
    padding: 15px;
    z-index: 101; /* Un poco por encima del de acciones */
    max-height: 250px;
    overflow-y: auto;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

/* Grid de Emotes */
.emotes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); /* Adaptable */
    gap: 10px;
    justify-items: center;
}

/* El botón del emote individual */
.emote-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
    transition: transform 0.2s, background 0.2s;
}

.emote-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.emote-btn img {
    width: 28px;
    height: 28px;
    pointer-events: none;
}


.badge-icon, .chat-emote {
    user-select: none;          
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;       
    -webkit-user-drag: none;   
}

/* Ajuste móvil para el panel */
@media (max-width: 768px) {
    #emotesPanel {
        bottom: 70px;
        left: 5px;
        right: 5px;
    }
}

#guestNickInput {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid #333;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#guestNickInput:focus {
    border-color: var(--candy-cyan);
    box-shadow: 0 0 15px rgba(5, 217, 232, 0.2);
}

/* =========================================

   ========================================= */
@media (orientation: landscape) and (max-height: 500px) {

    body.keyboard-open #chatMessages {
        display: flex !important; 
    }
    
    .chat-group {
        min-width: 300px !important; 
        width: 40% !important; 
    }
    
    .video-group {
        width: 60% !important; 
    }
}
.delete-btn {
    cursor: pointer;
    font-size: 0.8rem;
    margin-left: 8px;
    opacity: 0.5;
    transition: opacity 0.2s;
    float: right; /* Opcional: para que se vaya a la derecha del todo */
}
.delete-btn:hover {
    opacity: 1;
    transform: scale(1.2);
}