/* VARIABLES DE DISENO - PALETA MODERN CYBER-BLUE & DARK */
:root {
    --bg-main: #0b0f19;
    --bg-card: #151d30;
    --bg-card-hover: #1b263f;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --accent-cyan: #06b6d4;
    --accent-blue: #3b82f6;
    --accent-gradient: linear-gradient(135deg, #3b82f6, #06b6d4);
    --border-color: #24344d;
    --radius-lg: 12px;
    --radius-md: 8px;
    --max-width: 1140px;
    --transition: all 0.3s ease;
}

/* RESET GENERAL Y TIPOGRAFIA */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
    overflow-x: hidden;
}

/* CORRECCIÓN: Ahora permitimos scroll libre en cualquier modo */
body.chat-mode-active {
    position: relative;
    width: 100%;
    height: auto;
    overflow: auto;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* CONTENEDOR FLUIDO EXTRA ANCHO DE PUNTA A PUNTA EN MOVILES */
.container-fluid {
    width: 100%;
    padding: 0;
    margin: 0;
}

/* NAVEGACION Y CABECERA */
header {
    background-color: #0f172a;
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0 30px 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    position: relative;
    margin-bottom: 20px;
}

.nav-logo {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    user-select: none;
    cursor: pointer;
}

.nav-logo .accent-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* MENU HAMBURGUESA */
.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 19px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

.menu-toggle.open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.menu-toggle.open span:nth-child(2) {
    opacity: 0;
}
.menu-toggle.open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.main-nav {
    position: absolute;
    top: 60px;
    right: 0;
    width: 260px;
    background-color: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    display: none;
    z-index: 1000;
}

.main-nav.active {
    display: block;
}

.main-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.main-nav a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 10px 12px;
    border-radius: 6px;
    transition: var(--transition);
}

.main-nav a:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

/* TEXTOS DE CABECERA */
.header-text {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.header-text h1 {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.header-text .tagline {
    font-size: 1rem;
    color: var(--accent-cyan);
    font-weight: 400;
}

/* ESTRUCTURA DE TARJETAS (CARDS) */
.page-content {
    padding: 30px 20px;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px;
    margin-bottom: 25px;
}

/* TARJETAS COMPLETAMENTE ANCHAS PARA MODO CHAT REAL EN MOVILES */
.card-fullwidth {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 15px;
    margin-bottom: 25px;
}

.card h2, .card h3, .card-fullwidth h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.card p, .card-fullwidth p {
    color: var(--text-secondary);
    margin-bottom: 15px;
}

/* ELEMENTOS HERO */
.hero-img {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.cta-container {
    display: flex;
    justify-content: center;
    margin-top: 25px;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #ffffff;
    font-weight: 700;
    font-size: 1.1rem;
    border: none;
    padding: 14px 35px;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    transition: var(--transition);
}

/* SECCION AISLAMIENTO DE ADSENSE */
.adsense-isolation-box {
    margin: 20px 0;
    padding: 10px;
    background-color: rgba(15, 23, 42, 0.4);
    border-radius: var(--radius-md);
}

.adsense-top-fixed-box {
    width: 100%;
    background-color: #0f172a;
    border-bottom: 1px solid var(--border-color);
    padding: 8px 10px;
    text-align: center;
    margin-bottom: 20px;
}

.adsense-inner {
    max-width: 728px;
    height: 50px;
    line-height: 50px;
    background: rgba(255,255,255,0.02);
    border: 1px dashed #24344d;
    margin: 0 auto;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* DISEÑO CONTENIDOS FLEXIBLES */
.flex-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.side-img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
}

.styled-list li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 12px;
    list-style: none;
    color: var(--text-secondary);
}

.styled-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--accent-cyan);
    font-weight: bold;
}

/* LISTAS CON ICONOS FONTAWESOME DEL INDEX */
ul.styled-list-fixed {
    list-style: none;
    padding-left: 0;
}

ul.styled-list-fixed li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 12px;
    line-height: 1.6;
    color: var(--text-secondary);
}

ul.styled-list-fixed li i {
    position: absolute;
    left: 0;
    top: 4px;
    color: var(--accent-cyan);
    font-size: 16px;
}

.grid-paises {
    background-color: rgba(11, 15, 25, 0.5);
    border-left: 4px solid var(--accent-blue);
    padding: 15px;
    margin: 20px 0;
}

.footer-img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin-top: 20px;
}

.faq-item {
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
}

/* CONTENEDOR DEL CHAT (KIWIIRC) */
#live-chat-box {
    display: none;
    width: 100%;
    min-height: 650px;
    background: #000;
    border: none;
}

.iframe-chat {
    width: 100%;
    height: 100%;
    min-height: 650px;
    border: none;
    display: block;
}

/* PANTALLA COMPLETA REAL AL ACTIVAR EL CHAT (EVITA EL CUADRO MINÚSCULO) */
body.chat-fullscreen-active {
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
}

body.chat-fullscreen-active header,
body.chat-fullscreen-active footer,
body.chat-fullscreen-active #vista-salas,
body.chat-fullscreen-active #hero,
body.chat-fullscreen-active #salas-juegos,
body.chat-fullscreen-active #seccion-karaoke,
body.chat-fullscreen-active #radio-online,
body.chat-fullscreen-active #historia-karaoke-detalles,
body.chat-fullscreen-active #costumbres-chat-latino,
body.chat-fullscreen-active #comunidad,
body.chat-fullscreen-active #arkanoid-container,
body.chat-fullscreen-active #encuesta-container,
body.chat-fullscreen-active #historia-chat,
body.chat-fullscreen-active #beneficios-site,
body.chat-fullscreen-active #politicas-site,
body.chat-fullscreen-active #faq,
body.chat-fullscreen-active .adsense-isolation-box,
body.chat-fullscreen-active .adsense-top-fixed-box,
body.chat-fullscreen-active #cookie-consent-banner {
    display: none !important;
}

body.chat-fullscreen-active main.page-content,
body.chat-fullscreen-active #vista-home {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
    width: 100vw !important;
    height: 100vh !important;
}

body.chat-fullscreen-active #live-chat-box {
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 999999 !important;
    background: #000 !important;
}

body.chat-fullscreen-active #live-chat-box .iframe-chat {
    width: 100vw !important;
    height: 100vh !important;
    min-width: 100% !important;
    min-height: 100% !important;
    border: none !important;
    display: block !important;
}

/* CORRECCIÓN DE CONTENEDOR DE SALAS: Scroll natural y fluido */
#vista-salas {
    display: none;
    height: auto !important;
    min-height: 100vh;
    overflow: visible !important;
    padding-bottom: 40px;
}

.chat-main-wrapper {
    width: 100%;
    height: auto !important;
    overflow: visible !important;
    padding-bottom: 20px;
}

/* GRILLA DE BOTONES DE SALA TOTALMENTE ADAPTATIVA */
.grid-salas {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 15px;
}

.btn-sala {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 16px 8px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: var(--transition);
}

.btn-sala:hover {
    background-color: var(--bg-card-hover);
    border-color: var(--accent-cyan);
}

.btn-sala .hashtag {
    color: var(--accent-cyan);
}

/* INDICADOR EN VIVO Y ANIMACIÓN DEL FOOTER */
@keyframes blink {
    0% { opacity: 0.2; }
    50% { opacity: 1; }
    100% { opacity: 0.2; }
}

.live-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
    animation: blink 1.5s infinite ease-in-out;
}

/* FOOTER Y COMPLIANCE */
footer {
    background-color: #0f172a;
    border-top: 1px solid var(--border-color);
    padding: 25px 0;
    margin-top: 30px;
    clear: both;
}

.footer-content {
    text-align: center;
    font-size: 0.9rem;
}

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    background-color: #0f172a;
    border-top: 2px solid var(--accent-cyan);
    z-index: 999999;
    display: none;
}

.cookie-container {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cookie-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.cookie-buttons {
    display: flex;
    gap: 10px;
}

.btn-cookie-accept, .btn-cookie-reject {
    flex: 1;
    padding: 10px;
    border-radius: var(--radius-md);
    font-weight: bold;
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
}

.btn-cookie-accept { background: var(--accent-gradient); color: #fff; }
.btn-cookie-reject { background: rgba(255,255,255,0.05); color: var(--text-primary); border: 1px solid var(--border-color); }

/* RESPONSIVE DESKTOP (PANTALLAS GRANDES) */
@media (min-width: 768px) {
    .header-text h1 { font-size: 2.5rem; }
    .menu-toggle { display: none; }
    
    .main-nav {
        position: static;
        display: block;
        width: auto;
        background: transparent;
        border: none;
        padding: 0;
        box-shadow: none;
    }
    
    .main-nav ul { flex-direction: row; }
    .flex-content { flex-direction: row; align-items: center; }
    .flex-content.reverse { flex-direction: row-reverse; }
    .side-img { width: 40%; }

    .chat-main-wrapper {
        max-width: var(--max-width);
        margin: 0 auto;
        width: 100%;
    }
    
    .grid-salas {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    }
    
    .cookie-container { flex-direction: row; justify-content: space-between; }
    .cookie-buttons { width: auto; }
}