:root {
    --bg-deep: #050505;
    --candy-pink: #ff2a6d;
    --candy-purple: #d300c5;
    --candy-cyan: #60A5FA;
    --text-main: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --chat-bg: #18181B;
    --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;
    min-height: 200px;
    max-height: 95vh;
    padding: 20px;
    padding-bottom: 40px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Ocultar scrollbar pero permitir scroll */
.landing-container::-webkit-scrollbar { width: 0; }

.logo-area img {
    max-width: 150px;
    max-height: 20vh; /* Se adapta a la altura de la pantalla */
    margin-bottom: 15px;
    filter: 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;
    object-fit: contain;
}

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

/* --- 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-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 300px;
    background: linear-gradient(135deg, var(--candy-purple), var(--candy-pink));
    color: white;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 16px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(211, 0, 197, 0.35);
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.enter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}

.enter-btn:hover::before {
    left: 100%;
}

.enter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(211, 0, 197, 0.5);
}

.enter-btn:active {
    transform: translateY(0);
}

/* --- 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;
    flex-shrink: 0;
}

.ctrl-btn {
    background: linear-gradient(145deg, rgba(40, 45, 55, 0.9), rgba(25, 28, 35, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #b8bcc8;
    padding: 0;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    transition: all 0.25s ease;
    height: 34px;
    width: 36px;
    flex-shrink: 0; 
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.ctrl-btn span { display: none; }
.ctrl-btn i { font-size: 1.1rem; margin: 0; }

.ctrl-btn:hover { 
    color: #fff; 
    border-color: rgba(211, 0, 197, 0.4);
    background: linear-gradient(145deg, rgba(55, 60, 75, 0.95), rgba(35, 38, 50, 0.95));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 15px rgba(211, 0, 197, 0.15);
    transform: translateY(-1px);
}

.ctrl-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.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: linear-gradient(180deg, #0d1117 0%, #0b0e11 100%);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    position: relative;
}

/* Ocultar botón collapse chat en móvil portrait (no tiene sentido) */
@media (max-width: 768px) and (orientation: portrait) {
    #chatCollapseBtn {
        display: none !important;
    }
}

.chat-header {
    height: 46px;
    background: linear-gradient(90deg, rgba(96, 165, 250, 0.05), transparent);
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-bottom: 1px solid rgba(96, 165, 250, 0.1);
    flex-shrink: 0;
    justify-content: space-between;
}

.user-info-display {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--candy-cyan);
    font-size: 14px;
    font-weight: bold;
}

.user-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 2px solid var(--candy-cyan); }

#logoutBtn {
    background: linear-gradient(135deg, #ff4444, #cc0000); color: white; border: none; padding: 4px 10px;
    border-radius: 4px; cursor: pointer; font-size: 11px; margin-left: auto; display: none;
}
#logoutBtn:hover { opacity: 0.9; transform: scale(1.02); }

#chatMessages {
    flex: 1; padding: 10px; overflow-y: auto; color: #ddd; font-size: 14px;
    display: flex; flex-direction: column; gap: 4px; scroll-behavior: smooth;
    background: var(--chat-bg); 
}

.msg-line { 
    line-height: 1.5; 
    word-wrap: break-word; 
    padding: 3px 10px 3px 28px; 
    margin: 0;
    border-radius: 0; 
    transition: background 0.1s;
    background: transparent;
    border-bottom: 1px solid rgba(39, 46, 55, 0.3);
    position: relative;
}


.msg-line:nth-child(odd) {
    background: rgba(255, 255, 255, 0.01);
}

.msg-line:nth-child(even) {
    background: rgba(0, 0, 0, 0.05);
}

.msg-line:hover { 
    background: rgba(96, 165, 250, 0.04); 
}

/* ======= BOTÓN RESPONDER  ======= */
.msg-actions-left {
    position: absolute;
    left: 1px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.35;
    transition: opacity 0.15s;
}

.msg-line:hover .msg-actions-left {
    opacity: 1;
}

.msg-reply-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    transition: color 0.15s, transform 0.15s;
    padding: 4px;
}

.msg-reply-btn:hover {
    color: var(--candy-pink);
    transform: scale(1.2);
}

/* ======= MENÚ MODERACIÓN ======= */
.msg-mod-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-right: 4px;
}

.msg-mod-btn {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 6px 1px;
    font-size: 14px;
    line-height: 1;
    vertical-align: middle;
    opacity: 0.7;
    transition: opacity 0.15s, color 0.15s;
    border-radius: 4px;
    margin: -4px 0; 
}

.msg-line:hover .msg-mod-btn {
    opacity: 0.9;
}

.msg-mod-btn:hover,
.msg-mod-btn:active {
    color: var(--candy-cyan);
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

/* En móvil, área táctil aún más grande */
@media (max-width: 768px) {
    .msg-mod-btn {
        padding: 8px 10px;
        font-size: 16px;
    }
}

/* Dropdown  */
.mod-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 2px;
    background: rgba(20, 22, 28, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    min-width: 130px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    overflow: visible;
}

/* Para mensajes cerca del fondo, abrir hacia ARRIBA */
.mod-dropdown.open-up {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 2px;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.5);
}

.mod-dropdown.show {
    display: block;
}

.mod-dropdown-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    color: #ccc;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.15s;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.mod-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.mod-dropdown-item.danger {
    color: #ff6b6b;
}

.mod-dropdown-item.danger:hover {
    background: rgba(255, 70, 70, 0.15);
}

.mod-dropdown-item.warning {
    color: #ffa500;
}

.mod-dropdown-item.warning:hover {
    background: rgba(255, 165, 0, 0.15);
}

/* ===== MODAL DE MODERACIÓN ===== */
.modal-mod {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease;
}
.modal-mod.show {
    display: flex;
}
.modal-mod-content {
    background: linear-gradient(145deg, #1a1c23, #12141a);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    width: 90%;
    max-width: 380px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}
.modal-mod-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.modal-mod-header span {
    font-size: 1.4rem;
}
.modal-mod-header h3 {
    margin: 0;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
}
.modal-mod-body {
    padding: 20px;
}
.modal-mod-body p {
    margin: 0 0 10px 0;
    color: #ccc;
    font-size: 0.95rem;
}
.mod-user-target {
    color: var(--candy-cyan) !important;
    font-weight: 600;
    font-size: 1.05rem !important;
}
.timeout-selector {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.timeout-selector label {
    display: block;
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 10px;
}
.timeout-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.timeout-opt {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #ccc;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}
.timeout-opt:hover {
    background: rgba(255, 165, 0, 0.15);
    border-color: #ffa500;
    color: #ffa500;
}
.timeout-opt.selected {
    background: rgba(255, 165, 0, 0.25);
    border-color: #ffa500;
    color: #ffa500;
    font-weight: 600;
}
.modal-mod-footer {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.mod-btn-cancel,
.mod-btn-confirm {
    flex: 1;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}
.mod-btn-cancel {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #aaa;
}
.mod-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}
.mod-btn-confirm {
    background: linear-gradient(135deg, rgba(255, 100, 100, 0.2), rgba(255, 50, 50, 0.3));
    border: 1px solid #ff6b6b;
    color: #ff6b6b;
}
.mod-btn-confirm:hover {
    background: linear-gradient(135deg, rgba(255, 100, 100, 0.3), rgba(255, 50, 50, 0.4));
    box-shadow: 0 2px 15px rgba(255, 100, 100, 0.2);
}
.mod-btn-confirm.warning {
    background: linear-gradient(135deg, rgba(255, 165, 0, 0.2), rgba(255, 120, 0, 0.3));
    border-color: #ffa500;
    color: #ffa500;
}
.mod-btn-confirm.warning:hover {
    background: linear-gradient(135deg, rgba(255, 165, 0, 0.3), rgba(255, 120, 0, 0.4));
    box-shadow: 0 2px 15px rgba(255, 165, 0, 0.2);
}
.mod-btn-confirm.primary {
    background: linear-gradient(135deg, var(--candy-cyan), #3B82F6);
    border-color: var(--candy-cyan);
    color: #000;
}

/* Toast de notificación */
.mod-toast {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(90deg, rgba(96, 165, 250, 0.12), rgba(96, 165, 250, 0.04));
    border-top: 1px solid rgba(96, 165, 250, 0.25);
    color: #ddd;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    flex-shrink: 0;
    min-height: 32px;
    z-index: 5;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    text-align: center;
}
.mod-toast.show {
    opacity: 1;
    transform: translateY(0);
}
/* Fallback cuando el toast está en position:fixed (ej: sección noticias) */
.mod-toast.mod-toast-fixed {
    background: rgba(20, 22, 28, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
.mod-toast.mod-toast-fixed.show {
    transform: translateX(-50%) translateY(0);
}
.mod-toast.success {
    background: linear-gradient(90deg, rgba(0, 200, 83, 0.15), rgba(0, 200, 83, 0.04));
    border-top-color: rgba(0, 200, 83, 0.35);
    color: var(--kick-green);
}
.mod-toast.danger {
    background: linear-gradient(90deg, rgba(255, 68, 68, 0.15), rgba(255, 68, 68, 0.04));
    border-top-color: rgba(255, 68, 68, 0.35);
    color: #ff6b6b;
}
.mod-toast.warning {
    background: linear-gradient(90deg, rgba(255, 165, 0, 0.15), rgba(255, 165, 0, 0.04));
    border-top-color: rgba(255, 165, 0, 0.35);
    color: #ffa500;
}

.chat-link {
    color: var(--candy-cyan);
    text-decoration: none;
    border-bottom: 1px dotted var(--candy-cyan);
    transition: all 0.2s;
}

.chat-link:hover {
    color: #fff;
    border-bottom-color: #fff;
}

.msg-time { 
    color: #adadb8; 
    margin-right: 8px; 
    font-family: 'Inter'
}
.msg-author { color: var(--kick-green); font-weight: bold; margin-right: 5px; }
.msg-content { color: #e0e0e0; word-break: break-word; }
.system-msg { 
    color: var(--candy-cyan) !important; 
    font-style: normal; 
    font-size: 11px; 
    text-align: center;
    background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.08), transparent) !important;
    border: none !important;
    border-left: none !important;
    padding: 10px !important;
    margin: 8px 0;
}

.chat-input-area {
    padding: 8px 10px; 
    min-width: 0; 
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(96, 165, 250, 0.1); 
    display: flex; 
    flex-direction: column;
    gap: 6px;
    position: relative;
    z-index: 50; 
}


.chat-input-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.chat-tools-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

#chatInput {
    flex: 1; flex-shrink: 1; min-width: 50px; 
    background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12); color: #fff;
    padding: 10px 12px; border-radius: 8px; outline: none;
    transition: all 0.2s;
}
#chatInput:focus { border-color: var(--candy-cyan); box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1); }
#chatInput:disabled { opacity: 0.5; cursor: not-allowed; }

#sendBtn {
    background: linear-gradient(135deg, var(--candy-purple), var(--candy-pink)); 
    color: #fff; border: none;
    width: 40px; height: 40px;
    font-size: 1rem;
    border-radius: 10px; cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
#sendBtn:hover { transform: scale(1.05); box-shadow: 0 4px 15px rgba(211, 0, 197, 0.3); }
#sendBtn:disabled { background: #333; color: #666; cursor: not-allowed; transform: none; box-shadow: none; }

/* --- 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; 
    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%;
}


.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; }

#offline-countdown {
    font-family: 'Nunito', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--candy-cyan);
    margin: 12px 0;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    #offline-countdown { font-size: 1.2rem; }
    #offline-overlay h2 { font-size: 1.3rem !important; }
}

/* --- 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: 1 1 auto !important; 
        width: auto !important;
        height: 100%; 
        border-right: 1px solid #333;
        min-width: 0 !important;

        flex-basis: auto !important; 
    }

    /* 2. EL CHAT (Sólido como una roca) */
    .chat-group {

        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) {
    #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: 36px !important;
        padding: 0 !important; justify-content: center;
    }


    .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: 8px 10px !important;
        position: sticky;
        bottom: 0;
        z-index: 100;
        border-top: 1px solid rgba(96, 165, 250, 0.15);
    }


    .chat-group.hidden + .video-group,
    .video-group:only-child {
        height: 100% !important;
        flex: 1 1 auto !important;
    }
    

    #toggleBtn { display: none !important; }


    .logo-area { 
        overflow: visible !important; 
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .logo-area img { 
        max-width: 120px !important; 
        max-height: 100px !important;
        margin-bottom: 10px !important; 
        object-fit: contain;
    }
    .landing-container {
        padding: 15px 10px !important;
        display: flex; flex-direction: column; justify-content: center; 
        min-height: 100vh;
        min-height: 100dvh; /* Dynamic viewport height para iOS */
        overflow-y: auto;
    }
    .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: flex !important; font-size: 1.15rem !important; padding: 4px !important; }
    .puntos-box { display: flex !important; font-size: 10px !important; padding: 3px 8px !important; }
    #actionTriggerBtn { display: flex !important; font-size: 1.1rem !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) {
    

    #app-layer {
        flex-direction: row !important;
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

  
    .video-group {
        width: auto !important;
        height: 100% !important;
        flex: 1 !important; 
        min-height: 0 !important;
        border-bottom: none !important; 
        border-right: 1px solid #333;
    }


    .chat-group {
        width: 280px !important; 
        min-width: 280px !important;
        flex: 0 0 280px !important;
        height: 100% !important;
        border-left: 1px solid #333;
        padding-bottom: 0 !important;
    }
    

    .chat-header {
        height: 40px !important; /* Cabecera más compacta */
        min-height: 40px !important;
    }
    

    .landing-container .logo-area img {
        max-width: 80px !important; 
    }
}
/* =========================================
NOTICIAS
   ========================================= */
#news-layer {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(5, 5, 10, 0.85);
    z-index: 5000; overflow-y: auto;
    display: flex; flex-direction: column; align-items: center;
    padding-bottom: 50px;
    backdrop-filter: blur(5px); 
}

.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; }

/* Botón de acceso al chat en header de noticias */
.chat-access-btn {
    background: linear-gradient(135deg, var(--candy-pink), var(--candy-cyan));
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: auto;
    margin-right: 10px;
}

.chat-access-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 45, 85, 0.5);
}

/* CTA footer después de comentarios */
.news-cta-footer {
    margin-top: 30px;
    padding: 25px;
    background: linear-gradient(135deg, rgba(255, 45, 85, 0.1), rgba(96, 165, 250, 0.1));
    border: 1px solid rgba(255, 45, 85, 0.3);
    border-radius: 15px;
    text-align: center;
}

.news-cta-footer p {
    color: #aaa;
    margin-bottom: 15px;
    font-size: 1rem;
}

.cta-chat-btn {
    background: linear-gradient(135deg, var(--candy-pink), #ff6b9d);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.cta-chat-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 25px rgba(255, 45, 85, 0.4);
}

.cta-chat-btn i {
    font-size: 1.1rem;
}

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

.news-card {
    background: linear-gradient(145deg, rgba(20, 25, 35, 0.95), rgba(15, 18, 25, 0.9));
    border: 1px solid rgba(96, 165, 250, 0.1);
    border-radius: 12px;
    overflow: hidden; 
    transition: all 0.3s ease;
    cursor: pointer; 
    display: flex; 
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.news-card:hover { 
    transform: translateY(-4px); 
    box-shadow: 0 8px 25px rgba(96, 165, 250, 0.2); 
    border-color: var(--candy-cyan); 
}

.card-img { 
    width: 100%; 
    height: 140px; 
    object-fit: cover;
    border-bottom: 1px solid rgba(96, 165, 250, 0.1);
}

.card-content { 
    padding: 15px; 
    flex: 1; 
    display: flex; 
    flex-direction: column;
    background: rgba(0, 0, 0, 0.2);
}

.card-date { 
    font-size: 0.7rem; 
    color: var(--candy-cyan); 
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-title { 
    font-size: 1rem; 
    font-weight: bold; 
    color: #fff; 
    margin-bottom: 8px; 
    line-height: 1.3; 
}

.card-snippet { 
    font-size: 0.85rem; 
    color: #999; 
    display: -webkit-box; 
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical; 
    overflow: hidden; 
}

/* VISOR DE NOTICIA */
#news-reader { display: block; animation: fadeIn 0.3s ease; }
.reader-content { 
    background: linear-gradient(180deg, #111 0%, #0a0a0a 100%); 
    padding: 20px 25px; 
    border-radius: 12px; 
    border: 1px solid #333;
    max-width: 750px;
    margin: 0 auto;
}
#reader-img { 
    width: 100%; 
    max-height: 400px; 
    object-fit: cover; 
    border-radius: 10px; 
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}
#reader-title { 
    font-size: 1.6rem; 
    color: var(--candy-cyan); 
    margin-bottom: 10px; 
    line-height: 1.25;
    font-weight: 700;
}
.reader-meta { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 15px; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); 
    padding-bottom: 10px;
    color: #888;
    font-size: 0.85rem;
}


.chat-access-btn {
    background: linear-gradient(135deg, var(--candy-pink), var(--candy-cyan));
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: auto;
    margin-right: 10px;
}

.chat-access-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 45, 85, 0.5);
}

/* CTA footer después de comentarios */
.news-cta-footer {
    margin-top: 30px;
    padding: 25px;
    background: linear-gradient(135deg, rgba(255, 45, 85, 0.1), rgba(96, 165, 250, 0.1));
    border: 1px solid rgba(255, 45, 85, 0.3);
    border-radius: 15px;
    text-align: center;
}

.news-cta-footer p {
    color: #aaa;
    margin-bottom: 15px;
    font-size: 1rem;
}

.cta-chat-btn {
    background: linear-gradient(135deg, var(--candy-pink), #ff6b9d);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.cta-chat-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 25px rgba(255, 45, 85, 0.4);
}

.cta-chat-btn i {
    font-size: 1.1rem;
}

/* CUERPO DEL ARTÍCULO  */
#reader-body { 
    font-size: 0.95rem; 
    line-height: 1.5; 
    color: #ccc; 
    white-space: normal;
}
#reader-body p {
    margin-bottom: 0.7em;
}
#reader-body br {
    display: block;
    content: "";
    margin-top: 0.3em;
}
#reader-body img { 
    max-width: 100%; 
    border-radius: 8px; 
    margin: 12px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
#reader-body a {
    color: var(--candy-pink);
    text-decoration: none;
}
#reader-body a:hover {
    text-decoration: underline;
}
#reader-body h2, #reader-body h3 {
    color: #fff;
    margin: 15px 0 8px 0;
    font-size: 1.2rem;
}

.share-btn {
    background: var(--telegram-blue); color: white; border: none;
    padding: 6px 12px; border-radius: 5px; cursor: pointer; font-weight: bold;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.share-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 10px rgba(0, 136, 204, 0.4);
}

/* 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; 
    align-items: center;   
    gap: 15px;             
    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(96, 165, 250, 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;
    position: sticky;
    bottom: 0;
    background: #111;
    padding: 10px 0;
    z-index: 10;
}
.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; 
}

/* Shield */
.player-shield.okru-shield {

    height: 50px;
    width: calc(100% - 60px); 
    left: 60px; 
    top: 0;
    right: 0;
    bottom: auto;
    cursor: default;
}

/* Botón de ayuda para activar sonido (móvil) */
.okru-unmute-hint {
    position: absolute;
    top: 55px;
    left: 5px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    z-index: 20;
    display: none;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--candy-cyan);
    animation: pulseHint 2s infinite;
}

.okru-unmute-hint.show {
    display: flex;
}

.okru-unmute-hint span {
    font-size: 1.1rem;
}

@keyframes pulseHint {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Shield  */
@media (min-width: 769px) {
    .player-shield {
        display: none !important;
    }
    
    
    .player-shield.okru-shield {
        display: block !important;
        height: 50px;
        width: 100%;
        left: 0;
    }
    
    
    .okru-unmute-hint {
        display: none !important;
    }
}
/* =========================================
  PANEL
   ========================================= */
#actionsPanel {
    position: absolute;
    bottom: 85px; 
    left: 10px;
    right: 10px;
    background: rgba(15, 15, 15, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid var(--candy-cyan);
    border-radius: 12px;
    padding: 15px;
    z-index: 100;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
}

@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); 
    gap: 10px;
}

/* Botones */
.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(96, 165, 250, 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: 90px; 
        left: 5px; 
        right: 5px;
        max-height: 250px;
    }
}

.action-card.back-card .action-label {
    color: #ff4444; 
    font-weight: 800;
}

.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  --- */
.badge-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 4px;
    position: relative;
    top: -2px; 
}

.chat-emote {
    height: 32px;
    width: auto;
    object-fit: contain;
    vertical-align: middle;
    display: inline-block;
}

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

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


#emotesPanel {
    position: absolute;
    bottom: 100px; 
    left: 10px;
    right: 10px;
    background: rgba(15, 15, 15, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid var(--candy-cyan);
    border-radius: 12px;
    padding: 15px;
    z-index: 101;
    max-height: 230px;
    overflow-y: auto;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
}

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

/*  */
.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: 32px;
    height: 32px;
    pointer-events: none;
}


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

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

#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(96, 165, 250, 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; 
    }
}

.msg-line.mentioned {
    background: rgba(255, 165, 0, 0.15); 
    border-left: 3px solid var(--candy-cyan); 
    padding-left: 28px !important; /* Igual que msg-line normal para no cubrir el botón */
    margin-left: 0;
}

/* Asegurar que el botón reply siempre es visible en mensajes mencionados */
.msg-line.mentioned .msg-actions-left {
    left: 6px;
    z-index: 5;
}


.mention-text {
    color: var(--candy-cyan);
    font-weight: bold;
    background: rgba(96, 165, 250, 0.1);
    padding: 0 4px;
    border-radius: 4px;
}

/* =========================================
   MENSAJE FIJADO (PIN)
   ========================================= */
#pinned-message-container {
    display: none;
    padding: 0 10px;
}

.pinned-message {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 165, 0, 0.1));
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-left: 3px solid #ffd700;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.pinned-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 0.75rem;
}

.pinned-icon {
    font-size: 0.9rem;
}

.pinned-label {
    color: #ffd700;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.unpin-btn {
    margin-left: auto;
    background: rgba(255, 68, 68, 0.2);
    border: 1px solid rgba(255, 68, 68, 0.4);
    color: #ff6666;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.unpin-btn:hover {
    background: rgba(255, 68, 68, 0.4);
    color: #fff;
}

.pinned-content {
    display: flex;
    gap: 6px;
    font-size: 0.9rem;
    line-height: 1.4;
    flex-direction: column;
}

.pinned-author {
    color: var(--candy-pink);
    font-weight: bold;
    flex-shrink: 0;
}

.pinned-text {
    color: #ddd;
    word-break: break-word;
}

.pinned-text .chat-emote {
    height: 20px;
}

/* Botón expandir mensaje fijado */
.pinned-expand-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #aaa;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-left: auto;
    margin-right: 5px;
}

.pinned-expand-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* =========================================
   GAME WIDGET — SCRAMBLE / PREDICCIONES
   ========================================= */
.game-widget {
    flex-shrink: 0;
    overflow: hidden;
    animation: slideDown 0.4s ease;
    position: relative;
}
.game-widget.hidden { display: none; }

/* Botón cerrar juego (móvil) */
.game-close-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #999;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-left: 8px;
}
.game-close-btn:hover { background: rgba(255,68,68,0.3); color: #ff6b6b; }

/* Botón mostrar juego (header) */
.show-game-btn {
    background: linear-gradient(135deg, rgba(124,58,237,0.4), rgba(96,165,250,0.3));
    border: 1px solid rgba(124,58,237,0.4);
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    animation: timerPulse 1.5s ease-in-out infinite;
    flex-shrink: 0;
}
.show-game-btn.hidden { display: none; }
.show-game-btn:hover { 
    background: linear-gradient(135deg, rgba(124,58,237,0.6), rgba(96,165,250,0.5));
}

/* --- SCRAMBLE --- */
.scramble-widget {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(96, 165, 250, 0.08));
    border-bottom: 1px solid rgba(124, 58, 237, 0.25);
    padding: 12px 14px;
}
.scramble-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.scramble-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--candy-cyan);
    display: flex;
    align-items: center;
    gap: 6px;
}
.scramble-prize {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #3a2000;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 10px;
    border-radius: 10px;
}
.scramble-letters {
    display: flex;
    gap: 5px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 10px 0;
}
.scramble-letter {
    width: 36px;
    height: 40px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    font-family: 'Nunito', monospace;
    animation: letterPop 0.4s ease backwards;
}
.scramble-letter:nth-child(1) { animation-delay: 0.05s; }
.scramble-letter:nth-child(2) { animation-delay: 0.1s; }
.scramble-letter:nth-child(3) { animation-delay: 0.15s; }
.scramble-letter:nth-child(4) { animation-delay: 0.2s; }
.scramble-letter:nth-child(5) { animation-delay: 0.25s; }
.scramble-letter:nth-child(6) { animation-delay: 0.3s; }
.scramble-letter:nth-child(7) { animation-delay: 0.35s; }
.scramble-letter:nth-child(8) { animation-delay: 0.4s; }
.scramble-letter:nth-child(9) { animation-delay: 0.45s; }
.scramble-letter:nth-child(10) { animation-delay: 0.5s; }

@keyframes letterPop {
    from { transform: scale(0) rotate(20deg); opacity: 0; }
    to { transform: scale(1) rotate(0); opacity: 1; }
}

.scramble-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #999;
}
.scramble-hint {
    display: flex;
    align-items: center;
    gap: 4px;
}
.scramble-timer {
    font-weight: 700;
    color: var(--candy-cyan);
    font-family: 'Nunito', monospace;
    font-size: 0.85rem;
}
.scramble-timer.urgent {
    color: #ff6b6b;
    animation: timerPulse 0.5s ease-in-out infinite;
}
@keyframes timerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Estado: Ganado */
.scramble-widget.won {
    background: linear-gradient(135deg, rgba(0, 200, 83, 0.15), rgba(0, 200, 83, 0.05));
    border-bottom-color: rgba(0, 200, 83, 0.3);
}
.scramble-widget.won .scramble-letter {
    border-color: rgba(0, 200, 83, 0.4);
    color: var(--kick-green);
    animation: letterWin 0.5s ease backwards;
}
@keyframes letterWin {
    from { transform: scale(1.3); }
    to { transform: scale(1); }
}
.scramble-result {
    text-align: center;
    font-size: 0.8rem;
    margin-top: 6px;
}
.scramble-result .winner-name {
    color: var(--kick-green);
    font-weight: 700;
}
.scramble-result .winner-time {
    color: #999;
    font-size: 0.7rem;
}

/* Estado: Expirado */
.scramble-widget.expired {
    background: linear-gradient(135deg, rgba(255, 68, 68, 0.1), rgba(255, 68, 68, 0.03));
    border-bottom-color: rgba(255, 68, 68, 0.2);
    opacity: 0.7;
}
.scramble-widget.expired .scramble-letter {
    border-color: rgba(255, 68, 68, 0.3);
    color: #ff6b6b;
}

@media (max-width: 768px) {
    .scramble-widget { padding: 10px 12px; }
    .scramble-letter { width: 30px; height: 34px; font-size: 0.95rem; }
    .scramble-title { font-size: 0.65rem; }
}

/* --- WORDLE WIDGET --- */
.wordle-widget {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.10), rgba(34, 197, 94, 0.06));
    border-bottom: 1px solid rgba(96, 165, 250, 0.25);
    padding: 12px 14px;
}
.wordle-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.wordle-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--candy-cyan);
    display: flex;
    align-items: center;
    gap: 6px;
}
.wordle-partida {
    background: rgba(255,255,255,0.1);
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 0.65rem;
    color: #aaa;
}
.wordle-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    margin: 8px 0;
}
.wordle-row {
    display: flex;
    gap: 4px;
}
.wordle-tile {
    width: 32px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    font-family: 'Nunito', monospace;
    border-radius: 4px;
    color: #fff;
    transition: all 0.3s;
}
.wt-empty {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
}
.wt-green {
    background: #538d4e;
    border: 1px solid #6aaa64;
    animation: tileFlip 0.4s ease;
}
.wt-yellow {
    background: #b59f3b;
    border: 1px solid #c9b458;
    animation: tileFlip 0.4s ease;
}
.wt-gray {
    background: #3a3a3c;
    border: 1px solid #565656;
    animation: tileFlip 0.4s ease;
}
@keyframes tileFlip {
    0% { transform: scaleY(0); }
    50% { transform: scaleY(0); }
    100% { transform: scaleY(1); }
}
.wordle-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    color: #999;
    flex-wrap: wrap;
    gap: 4px;
}
.wordle-letras {
    font-size: 0.65rem;
    color: #666;
    text-align: center;
    margin-top: 4px;
    letter-spacing: 1px;
}
.wordle-input-row {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}
.wordle-input-row input {
    flex: 1;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(96,165,250,0.3);
    border-radius: 6px;
    padding: 6px 10px;
    color: #fff;
    font-size: 0.85rem;
    font-family: 'Nunito', sans-serif;
    outline: none;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.wordle-input-row input:focus {
    border-color: var(--candy-cyan);
}
.wordle-input-row button {
    background: var(--candy-cyan);
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    color: #000;
    font-size: 0.85rem;
    cursor: pointer;
}
.wordle-widget.won { 
    background: linear-gradient(135deg, rgba(0,200,83,0.15), rgba(0,200,83,0.05));
    border-bottom-color: rgba(0,200,83,0.3);
}
.wordle-widget.expired {
    background: linear-gradient(135deg, rgba(255,68,68,0.1), rgba(255,68,68,0.03));
    border-bottom-color: rgba(255,68,68,0.2);
}

/* --- TRIVIAL WIDGET --- */
.trivial-widget {
    background: linear-gradient(135deg, rgba(236,72,153,0.10), rgba(124,58,237,0.08));
    border-bottom: 1px solid rgba(236,72,153,0.25);
    padding: 12px 14px;
}
.trivial-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.trivial-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--candy-pink);
    display: flex;
    align-items: center;
    gap: 6px;
}
.trivial-blitz {
    background: linear-gradient(135deg, #ff6b00, #ff2d00);
    color: #fff;
    font-size: 0.6rem;
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 800;
    animation: timerPulse 0.8s ease-in-out infinite;
}
.trivial-question {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    padding: 8px 4px;
    line-height: 1.3;
}
.trivial-options {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 6px 0;
}
.trivial-option {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.82rem;
    color: #ddd;
}
.trivial-option:hover:not(.trivial-option-disabled):not(.trivial-option-correct) {
    background: rgba(124,58,237,0.2);
    border-color: rgba(124,58,237,0.4);
    color: #fff;
}
.trivial-option:active:not(.trivial-option-disabled) {
    transform: scale(0.98);
}
.trivial-option-num {
    background: rgba(124,58,237,0.3);
    color: var(--candy-pink);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.75rem;
    flex-shrink: 0;
}
.trivial-option-disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}
.trivial-option-correct {
    background: rgba(0,200,83,0.15) !important;
    border-color: rgba(0,200,83,0.4) !important;
    color: var(--kick-green) !important;
    cursor: default;
}
.trivial-option-correct .trivial-option-num {
    background: rgba(0,200,83,0.3);
    color: var(--kick-green);
}
.trivial-status {
    text-align: center;
    font-size: 0.75rem;
    color: #999;
    margin-top: 4px;
}
.trivial-widget.won {
    background: linear-gradient(135deg, rgba(0,200,83,0.15), rgba(0,200,83,0.05));
    border-bottom-color: rgba(0,200,83,0.3);
}
.trivial-widget.expired {
    background: linear-gradient(135deg, rgba(255,68,68,0.08), rgba(255,68,68,0.03));
    border-bottom-color: rgba(255,68,68,0.2);
}

@media (max-width: 768px) {
    .wordle-widget { padding: 8px 10px; }
    .wordle-tile { width: 26px; height: 28px; font-size: 0.72rem; }
    .wordle-row { gap: 3px; }
    .wordle-grid { gap: 3px; margin: 4px 0; }
    .wordle-info { font-size: 0.65rem; }
    .wordle-letras { font-size: 0.6rem; }
    .wordle-input-row { margin-top: 4px; }
    .wordle-input-row input { padding: 5px 8px; font-size: 0.8rem; }
    .trivial-widget { padding: 8px 10px; }
    .trivial-question { font-size: 0.78rem; padding: 3px 2px; }
    .trivial-option { padding: 5px 8px; font-size: 0.75rem; }
    .pred-question { font-size: 0.78rem; padding: 3px 2px; }
    .pred-option { padding: 5px 8px; }
    .pred-option-name { font-size: 0.75rem; }
    .pred-option-stats { font-size: 0.62rem; }
    .pred-pool { font-size: 0.68rem; }
    .scramble-word { font-size: 1.1rem; letter-spacing: 3px; }
    
    /* Limitar altura de widgets de juego en móvil */
    #gameWidget {
        max-height: 45vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Portrait: más restrictivo para no tapar chat-input */
/* Portrait estándar */
@media (max-width: 768px) and (orientation: portrait) {
    #gameWidget {
        max-height: 38vh;
    }
    .trivial-option { padding: 4px 8px; font-size: 0.72rem; min-height: 0; }
    .trivial-header .trivial-title { font-size: 0.75rem; }
    .wordle-tile { width: 24px; height: 26px; font-size: 0.68rem; }
    .wordle-grid { gap: 2px; margin: 2px 0; }
    .sala-option { padding: 6px 10px; font-size: 0.78rem; }
}

/* Portrait en pantallas altas (iPhone 12/13/14/15, Pixel 7+: >800px alto) */
@media (max-width: 768px) and (orientation: portrait) and (min-height: 800px) {
    #gameWidget {
        max-height: 42vh;
    }
    .trivial-widget, .wordle-widget, .scramble-widget { padding: 10px 14px; }
    .trivial-question { font-size: 0.88rem; }
    .trivial-option { padding: 7px 12px; font-size: 0.82rem; }
    .trivial-option-num { width: 26px; height: 26px; font-size: 0.78rem; }
    .wordle-tile { width: 30px; height: 32px; font-size: 0.78rem; }
    .wordle-grid { gap: 4px; margin: 5px 0; }
    .wordle-info { font-size: 0.72rem; }
    .scramble-letter { width: 36px; height: 38px; font-size: 1.1rem; }
    .scramble-result { font-size: 0.85rem; }
    .winner-name { font-size: 0.85rem; }
}

/* Pantallas pequeñas portrait (iPhone SE, Galaxy S5, etc: ≤400px ancho O ≤700px alto) */
@media (max-width: 400px) and (orientation: portrait),
       (max-height: 700px) and (orientation: portrait) {
    #gameWidget {
        max-height: 34vh;
    }
    .trivial-widget, .wordle-widget, .scramble-widget { padding: 5px 8px !important; }
    .trivial-header, .wordle-header, .scramble-header { margin-bottom: 2px; }
    .trivial-question { font-size: 0.72rem !important; padding: 2px 0 !important; margin: 1px 0; }
    .trivial-options { gap: 3px !important; }
    .trivial-option { 
        padding: 3px 6px !important; font-size: 0.68rem !important;
        border-radius: 5px;
    }
    .trivial-option-num { width: 18px; height: 18px; font-size: 0.6rem; }
    .trivial-status { font-size: 0.65rem; margin-top: 2px; }
    .trivial-blitz { font-size: 0.55rem !important; padding: 1px 4px !important; }
    .scramble-timer { font-size: 0.65rem !important; }
    .scramble-prize { font-size: 0.65rem !important; }
    .scramble-result { font-size: 0.7rem !important; padding: 3px 0 !important; }
    .winner-name { font-size: 0.72rem !important; }
    .wordle-tile { width: 20px !important; height: 22px !important; font-size: 0.6rem !important; }
    .wordle-row { gap: 2px !important; }
    .wordle-grid { gap: 1px !important; margin: 2px 0 !important; }
    .wordle-info { font-size: 0.58rem !important; }
    .wordle-letras { font-size: 0.55rem !important; }
    .wordle-input-row input { padding: 4px 6px !important; font-size: 0.75rem !important; }
    .wordle-input-row button { padding: 0 10px !important; }
    .scramble-letter { width: 28px !important; height: 30px !important; font-size: 0.85rem !important; }
    .scramble-letters { gap: 3px !important; }
    /* Control bar en pantallas estrechas */
    .control-bar { gap: 4px !important; padding: 0 6px !important; }
    .ctrl-btn { width: 32px !important; height: 30px !important; }
    .ctrl-btn i { font-size: 0.9rem !important; }
}

/* Ganador inline en la barra correcta del trivial */
.trivial-option-correct .trivial-winner-inline {
    margin-left: auto;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--kick-green);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

/* Keyboard abierto con wordle: mantener input visible */
body.keyboard-open #gameWidget {
    max-height: 35vh;
    overflow-y: auto;
}
body.keyboard-open .wordle-input-row {
    position: sticky;
    bottom: 0;
    background: rgba(10, 10, 25, 0.98);
    padding: 6px 8px;
    z-index: 2;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* === GANADOR INLINE EN TRIVIAL (barra verde) === */
.trivial-winner-inline {
    margin-left: auto;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--kick-green);
    white-space: nowrap;
    flex-shrink: 0;
}

/* === GANADOR INLINE EN WORDLE (header) === */
.wordle-winner-badge {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--kick-green);
    margin-left: 6px;
    white-space: nowrap;
}
.wordle-palabra-result {
    text-align: center;
    font-size: 0.75rem;
    color: #ccc;
    padding: 3px 0;
}

/* === PANTALLAS MUY PEQUEÑAS (iPhone SE, 375x667) === */
@media (max-width: 400px) {
    /* Control bar: quitar min-width forzado */
    .control-bar {
        min-width: 0 !important;
        padding: 0 6px !important;
        gap: 5px !important;
    }
    .ctrl-btn {
        width: 32px !important;
        height: 30px !important;
    }
    .ctrl-btn i { font-size: 0.95rem; }
}

@media (max-width: 400px) and (orientation: portrait) {
    /* Widget más compacto */
    #gameWidget {
        max-height: 36vh;
    }
    
    /* Trivial ultra-compacto */
    .trivial-widget { padding: 6px 8px; }
    .trivial-header { margin-bottom: 4px; }
    .trivial-title { font-size: 0.65rem; gap: 4px; }
    .trivial-question { font-size: 0.72rem; padding: 2px 2px; line-height: 1.2; }
    .trivial-options { gap: 3px; margin: 3px 0; }
    .trivial-option { padding: 3px 6px; font-size: 0.68rem; gap: 5px; border-radius: 6px; }
    .trivial-option-num { width: 20px; height: 20px; font-size: 0.65rem; }
    .trivial-status { font-size: 0.65rem; margin-top: 2px; }
    .trivial-winner-inline { font-size: 0.6rem; }
    .trivial-blitz { font-size: 0.5rem; padding: 1px 4px; }
    
    /* Wordle ultra-compacto */
    .wordle-widget { padding: 6px 8px; }
    .wordle-tile { width: 20px; height: 22px; font-size: 0.6rem; border-radius: 3px; }
    .wordle-row { gap: 2px; }
    .wordle-grid { gap: 2px; margin: 2px 0; }
    .wordle-header { margin-bottom: 2px; }
    .wordle-title { font-size: 0.65rem; }
    .wordle-info { font-size: 0.58rem; }
    .wordle-letras { font-size: 0.55rem; letter-spacing: 1px; }
    .wordle-input-row { margin-top: 3px; }
    .wordle-input-row input { padding: 4px 6px; font-size: 0.75rem; }
    .wordle-input-row button { padding: 4px 10px; font-size: 0.75rem; }
    .wordle-winner-badge { font-size: 0.58rem; }
    .wordle-palabra-result { font-size: 0.65rem; }
    
    /* Scramble ultra-compacto */
    .scramble-widget { padding: 8px 10px; }
    .scramble-letter { width: 26px; height: 28px; font-size: 0.85rem; }
    .scramble-result { font-size: 0.65rem !important; }
    .scramble-prize { font-size: 0.65rem; }
    
    /* Pred/Encuesta compactos */
    .pred-question { font-size: 0.72rem; }
    .pred-option { padding: 4px 6px; }
    .pred-option-name { font-size: 0.68rem; }
    
    /* Puntos box más pequeño */
    .puntos-box { font-size: 10px; padding: 4px 8px; min-width: 40px; }
}

/* === PANTALLAS PORTRAIT MEDIANAS-GRANDES (>400px ancho): texto más cómodo === */
@media (min-width: 401px) and (max-width: 768px) and (orientation: portrait) {
    .trivial-question { font-size: 0.85rem; }
    .trivial-option { font-size: 0.78rem; padding: 6px 10px; }
    .wordle-tile { width: 28px; height: 30px; font-size: 0.75rem; }
}

/* === KEYBOARD OPEN EN PANTALLAS PEQUEÑAS === */
@media (max-width: 400px) {
    body.keyboard-open #gameWidget {
        max-height: 30vh;
    }
    body.keyboard-open .wordle-input-row {
        padding: 4px 6px;
    }
    body.keyboard-open .wordle-input-row input {
        padding: 4px 6px;
        font-size: 0.75rem;
    }
    /* Ocultar grid de wordle cuando teclado abierto en pantallas muy pequeñas */
    body.keyboard-open .wordle-grid {
        max-height: 80px;
        overflow: hidden;
    }
    body.keyboard-open .wordle-info,
    body.keyboard-open .wordle-letras {
        display: none;
    }
}

/* Keyboard en pantalla pequeña: ocultar grid parcialmente para dar espacio al input */
@media (max-height: 700px) and (orientation: portrait) {
    body.keyboard-open #gameWidget {
        max-height: 30vh;
    }
    body.keyboard-open .wordle-grid {
        max-height: 80px;
        overflow: hidden;
    }
    body.keyboard-open .wordle-info,
    body.keyboard-open .wordle-letras {
        display: none;
    }
}

/* =========================================
/* =========================================
   CUCAS
   ========================================= */
.puntos-box {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.3), rgba(236, 72, 153, 0.3));
    color: #fff;
    padding: 6px 12px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: none;
    flex-shrink: 0;
    cursor: pointer;
    border: 1px solid rgba(236, 72, 153, 0.25);
    transition: all 0.2s;
    min-width: 50px;
    justify-content: center;
}

.puntos-box:hover:not(:disabled) {
    transform: scale(1.05);
    border-color: rgba(236, 72, 153, 0.4);
}

.puntos-box:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.puntos-icon { font-size: 13px; }

/* =========================================
   QUOTE
   ========================================= */
.quote-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(211, 0, 197, 0.05));
    border-left: 3px solid var(--candy-cyan);
    padding: 8px 12px;
    gap: 10px;
}

.quote-box.hidden { display: none; }

.quote-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.quote-icon { font-size: 1.2rem; flex-shrink: 0; }

.quote-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.quote-name {
    color: var(--candy-cyan);
    font-weight: bold;
    font-size: 0.85rem;
}

.quote-text {
    color: #888;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.quote-cancel {
    background: transparent;
    border: none;
    color: #666;
    font-size: 1rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.quote-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* =========================================
   QUOTE 2
   ========================================= */
.reply-bubble {
    align-items: center;
    gap: 6px;
    background: rgba(96, 165, 250, 0.08);
    border-left: 3px solid var(--candy-cyan);
    border-radius: 0 6px 6px 0;
    padding: 4px 10px;
    margin-bottom: 4px;
    font-size: 0.8em;
}

.reply-bubble-icon {
    font-size: 0.9em;
    opacity: 0.7;
}

.reply-bubble-name {
    color: var(--candy-cyan);
    font-weight: bold;
}

.reply-bubble-text {
    color: #777;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    display: block;
}

.msg-main {
    display: block;
}

/* =========================================
   DISABLE GLOW
   ========================================= */
body.in-app .bg-glow {
    opacity: 0;
    visibility: hidden; 
    filter: none !important; 
    animation: none !important;
    transition: none;
}


body.in-news .bg-glow {
    opacity: 0.4 !important;
    visibility: visible !important;
    filter: blur(80px) !important;
    animation: floatBlob 20s infinite alternate !important;
}

body.in-news .bg-glow.glow-2 {
    animation: floatBlob 25s infinite alternate-reverse !important;
}

/* Optimización: desactivar animaciones pesadas en la app */
body.in-app .bg-gradient {
    animation: none !important;
}

/* Reactivar gradiente en noticias */
body.in-news .bg-gradient {
    animation: gradientBG 15s ease infinite !important;
}

/* =========================================
   OPTIMIZACIÓN GPU 
   ========================================= */
.iframe-wrapper {
    isolation: isolate;
    contain: layout style paint;
}

.iframe-wrapper iframe {
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}


body.in-app #news-ticker-content {

    will-change: auto;
}


body.in-app .news-card:hover,
body.in-app .social-icon:hover {
    transform: none;
}

/* =========================================
   (< 700px)
   ========================================= */
@media (max-height: 700px) {
    .landing-container {
        padding: 10px 15px;
        padding-bottom: 15px;
        max-height: 100vh;
        justify-content: flex-start;
    }
    
    .logo-area img {
        max-width: 90px;
        max-height: 12vh;
        margin-bottom: 8px;
    }
    
    h1 {
        font-size: 1.6rem !important;
        margin-bottom: 5px !important;
    }
    
    .subtitle {
        font-size: 0.85rem !important;
        margin-bottom: 20px !important;
    }
    
    .info-card {
        padding: 8px 12px !important;
        margin: 6px 0 !important;
    }
    
    .info-card h3 {
        font-size: 0.8rem !important;
    }
    
    .info-card p {
        font-size: 0.75rem !important;
    }
    
    .enter-btn {
        padding: 12px 20px !important;
        font-size: 0.9rem !important;
    }
    
    .landing-footer {
        margin-top: 10px !important;
        padding-top: 10px !important;
    }
    
    .social-icon {
        width: 35px !important;
        height: 35px !important;
        font-size: 1rem !important;
    }
}

/* (< 500px altura) */
@media (max-height: 500px) {
    .landing-container {
        padding: 5px 10px;
    }
    
    .logo-area img {
        max-width: 60px;
        max-height: 8vh;
        margin-bottom: 5px;
    }
    
    h1 {
        font-size: 1.3rem !important;
    }
    
    .subtitle {
        font-size: 0.75rem !important;
        margin-bottom: 10px !important;
    }
    
    .info-card {
        padding: 5px 10px !important;
        margin: 4px 0 !important;
    }
    
    .info-card h3 {
        font-size: 0.7rem !important;
    }
    
    .enter-btn {
        padding: 10px 16px !important;
        font-size: 0.8rem !important;
    }
    
    .landing-footer {
        margin-top: 5px !important;
        padding-top: 5px !important;
    }
    
    .social-icon {
        width: 28px !important;
        height: 28px !important;
    }
}
/* --- Botón Collapse --- */
.collapse-chat-btn {
    position: relative;
}
.collapse-chat-btn.chat-hidden i {
    color: var(--candy-pink);
}
/* --- Indicador Estado del Chat (estilo Twitch) --- */
.chat-status-bar {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    flex-shrink: 0;
    animation: slideDown 0.3s ease;
}

.chat-status-bar.status-closed {
    background: linear-gradient(90deg, rgba(255, 68, 68, 0.15), rgba(255, 68, 68, 0.05));
    color: #ff6b6b;
    border-top: 1px solid rgba(255, 68, 68, 0.3);
}

.chat-status-bar.status-slow {
    background: linear-gradient(90deg, rgba(255, 165, 0, 0.15), rgba(255, 165, 0, 0.05));
    color: #ffa500;
    border-top: 1px solid rgba(255, 165, 0, 0.3);
}

.chat-status-bar.status-accounts {
    background: linear-gradient(90deg, rgba(96, 165, 250, 0.15), rgba(96, 165, 250, 0.05));
    color: var(--candy-cyan);
    border-top: 1px solid rgba(96, 165, 250, 0.3);
}
/* =========================================
   PREDICCIONES WIDGET
   ========================================= */
.pred-widget {
    background: linear-gradient(135deg, rgba(30, 28, 50, 0.95), rgba(20, 18, 35, 0.95));
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 10px;
    padding: 12px 14px;
}
.pred-widget.pred-locked { border-color: rgba(255, 180, 0, 0.3); }
.pred-widget.pred-resolved { border-color: rgba(74, 222, 128, 0.3); }
.pred-widget.pred-cancelled { border-color: rgba(255, 107, 107, 0.3); }
.pred-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px;
}
.pred-title {
    font-size: 0.75rem; font-weight: 700; color: #fff;
    display: flex; align-items: center; gap: 6px;
}
.pred-question {
    font-size: 0.88rem; font-weight: 600; color: #e2e8f0; text-align: center;
    padding: 4px 0 8px; line-height: 1.3;
}
.pred-options { display: flex; flex-direction: column; gap: 6px; }
.pred-option {
    position: relative; border-radius: 8px; overflow: hidden;
    cursor: pointer; transition: all 0.2s; border: 2px solid transparent;
    min-height: 42px; display: flex; align-items: center;
}
.pred-option:hover:not(.pred-option-locked) {
    border-color: var(--pred-color, #60a5fa); transform: scale(1.01);
}
.pred-option-selected {
    border-color: var(--pred-color, #60a5fa) !important;
    box-shadow: 0 0 12px color-mix(in srgb, var(--pred-color, #60a5fa) 40%, transparent);
}
.pred-option-mine { border-color: rgba(255, 215, 0, 0.5) !important; }
.pred-option-locked { cursor: default; }
.pred-option-winner { border-color: rgba(74, 222, 128, 0.5) !important; }
.pred-option-loser { opacity: 0.5; }
.pred-bar-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.05); border-radius: 8px;
}
.pred-bar-fill {
    height: 100%; border-radius: 8px; opacity: 0.25; transition: width 0.6s ease;
}
.pred-option-content {
    position: relative; z-index: 1; display: flex;
    justify-content: space-between; align-items: center;
    width: 100%; padding: 8px 12px;
}
.pred-option-name { font-size: 0.82rem; font-weight: 600; color: #fff; }
.pred-option-stats { font-size: 0.68rem; color: #aaa; white-space: nowrap; }
.pred-mine-badge {
    position: absolute; top: 2px; right: 8px; font-size: 0.58rem;
    color: #ffd700; font-weight: 600; z-index: 2;
}
.pred-pool { text-align: center; font-size: 0.7rem; color: #888; margin-top: 6px; }
.pred-bet-area {
    display: flex; flex-direction: column; gap: 4px; margin-top: 8px;
    padding: 8px; background: rgba(255,255,255,0.03); border-radius: 8px;
    border: 1px solid rgba(124, 58, 237, 0.2);
}
.pred-bet-label { font-size: 0.72rem; color: #b8a9e0; font-weight: 600; }
.pred-bet-row { display: flex; gap: 6px; }
.pred-bet-row input {
    flex: 1; background: rgba(0,0,0,0.3); border: 1px solid rgba(124,58,237,0.3);
    color: #fff; padding: 6px 10px; border-radius: 6px; font-size: 0.82rem;
    outline: none; -moz-appearance: textfield;
}
.pred-bet-row input::-webkit-inner-spin-button { -webkit-appearance: none; }
.pred-bet-row input:focus { border-color: rgba(124,58,237,0.6); }
.pred-bet-row button {
    background: linear-gradient(135deg, #7c3aed, #a855f7); color: #fff;
    border: none; padding: 6px 14px; border-radius: 6px; font-size: 0.78rem;
    font-weight: 600; cursor: pointer; white-space: nowrap; transition: all 0.2s;
}
.pred-bet-row button:hover { transform: scale(1.03); box-shadow: 0 0 10px rgba(124,58,237,0.4); }
.pred-bet-row button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.pred-bet-done {
    text-align: center; font-size: 0.72rem; color: #4ade80; margin-top: 6px;
    padding: 4px; background: rgba(74,222,128,0.08); border-radius: 6px;
}
.pred-my-result {
    text-align: center; font-size: 0.78rem; margin-top: 8px;
    padding: 6px; border-radius: 6px; font-weight: 600;
}
.pred-my-result.pred-won {
    color: #4ade80; background: rgba(74,222,128,0.1); border: 1px solid rgba(74,222,128,0.2);
}
.pred-my-result.pred-lost {
    color: #ff6b6b; background: rgba(255,107,107,0.08); border: 1px solid rgba(255,107,107,0.15);
}
.timer-urgent { color: #ff6b6b !important; animation: timerPulse 1s ease-in-out infinite; }

@media (max-width: 768px) {
    .pred-widget { padding: 10px 12px; }
    .pred-question { font-size: 0.82rem; }
    .pred-option-content { padding: 6px 10px; }
    .pred-option-name { font-size: 0.76rem; }
    .pred-option-stats { font-size: 0.62rem; }
    .pred-bet-row input { padding: 5px 8px; }
}

/* =========================================
   LEADERBOARD WIDGET
   ========================================= */
.lb-widget {
    background: linear-gradient(135deg, rgba(20, 25, 40, 0.95), rgba(12, 15, 25, 0.95));
    border: 1px solid rgba(255, 215, 0, 0.25);
    border-radius: 10px;
    padding: 12px 14px;
}
.lb-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;
}
.lb-title {
    font-size: 0.82rem; font-weight: 700; color: #ffd700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}
.lb-countdown { font-size: 0.7rem; color: #888; }
.lb-entries { display: flex; flex-direction: column; gap: 4px; }
.lb-entry {
    display: flex; align-items: center; gap: 6px;
    min-height: 28px;
    animation: lbSlideIn 0.3s ease-out both;
}
.lb-entry:nth-child(1) { animation-delay: 0.05s; }
.lb-entry:nth-child(2) { animation-delay: 0.1s; }
.lb-entry:nth-child(3) { animation-delay: 0.15s; }
.lb-entry:nth-child(4) { animation-delay: 0.2s; }
.lb-entry:nth-child(5) { animation-delay: 0.25s; }
.lb-entry:nth-child(6) { animation-delay: 0.3s; }
.lb-entry:nth-child(7) { animation-delay: 0.35s; }
.lb-entry:nth-child(8) { animation-delay: 0.4s; }
.lb-entry:nth-child(9) { animation-delay: 0.45s; }
.lb-entry:nth-child(10) { animation-delay: 0.5s; }
@keyframes lbSlideIn {
    from { opacity: 0; transform: translateX(-12px); }
    to { opacity: 1; transform: translateX(0); }
}
.lb-entry-me {
    border: 1px solid rgba(255, 215, 0, 0.35); border-radius: 6px;
    background: rgba(255, 215, 0, 0.06);
}
.lb-medal { width: 22px; text-align: center; font-size: 0.9rem; flex-shrink: 0; }
.lb-rank-num { font-size: 0.68rem; font-weight: 700; color: #666; }
.lb-entry-bar {
    flex: 1; position: relative; min-height: 26px; border-radius: 5px;
    overflow: hidden; background: rgba(255, 255, 255, 0.04);
}
.lb-bar-fill {
    position: absolute; top: 0; left: 0; height: 100%; border-radius: 5px;
    opacity: 0.2; transition: width 0.8s ease;
}
.lb-entry-info {
    position: relative; z-index: 1; display: flex;
    justify-content: space-between; align-items: center;
    padding: 4px 10px; width: 100%;
}
.lb-name {
    font-size: 0.74rem; font-weight: 600; color: #e2e8f0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%;
}
.lb-score { font-size: 0.68rem; color: #aaa; font-weight: 500; white-space: nowrap; }
.lb-my-pos {
    display: flex; align-items: center; gap: 8px; margin-top: 6px;
    padding: 5px 10px; border-radius: 6px;
    background: rgba(255, 215, 0, 0.06); border: 1px dashed rgba(255, 215, 0, 0.2);
    font-size: 0.72rem;
}
.lb-my-rank { font-weight: 700; color: #ffd700; }
.lb-my-name { color: #e2e8f0; flex: 1; }
.lb-my-score { color: #aaa; }

@media (max-width: 768px) {
    .lb-widget { padding: 10px 12px; }
    .lb-entry { min-height: 24px; gap: 4px; }
    .lb-medal { width: 18px; font-size: 0.78rem; }
    .lb-entry-info { padding: 3px 8px; }
    .lb-name { font-size: 0.68rem; max-width: 55%; }
    .lb-score { font-size: 0.62rem; }
    .lb-my-pos { font-size: 0.65rem; padding: 4px 8px; }
}

/* --- Botón Cofre de Cucas --- */
.cofre-btn {
    background: linear-gradient(135deg, #8B4513, #654321);
    color: #ccc;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 16px;
    display: none; /* Se muestra cuando config/cofre.activo = true */
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.4);
    flex-shrink: 0;
    cursor: pointer;
    border: 1px solid rgba(255, 215, 0, 0.2);
    transition: all 0.3s;
    min-width: 40px;
    height: 34px;
}

.cofre-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Cofre disponible: fondo dorado, icono oscuro para contraste */
.cofre-btn.cofre-ready {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    border-color: rgba(255, 215, 0, 0.6);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.5);
    color: #3a2000;
    animation: cofreWobble 2.5s ease-in-out infinite;
}

.cofre-btn.cofre-ready .cofre-icon {
    filter: none;
}

.cofre-btn.cofre-ready:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.7);
    animation: none;
}

/* Cofre en cooldown: apagado */
.cofre-btn.cofre-cooldown {
    background: linear-gradient(135deg, #333, #222);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: none;
    opacity: 0.6;
    color: #666;
}

.cofre-btn.cofre-cooldown .cofre-icon {
    filter: grayscale(0.8);
}

@keyframes cofreWobble {
    0%, 100% { transform: rotate(0deg); box-shadow: 0 0 8px rgba(255, 215, 0, 0.4); }
    15% { transform: rotate(-6deg); }
    30% { transform: rotate(5deg); }
    45% { transform: rotate(-3deg); }
    55% { transform: rotate(0deg); box-shadow: 0 0 18px rgba(255, 215, 0, 0.7); }
}

@media (max-width: 768px) {
    .cofre-btn { padding: 4px 10px; min-width: 36px; height: 32px; }
}
/* =========================================
   SALA DE EXPULSIÓN WIDGET
   ========================================= */
.sala-widget {
    background: linear-gradient(135deg, rgba(30, 15, 15, 0.95), rgba(15, 10, 20, 0.95));
    border: 1px solid rgba(255, 60, 60, 0.25);
    border-radius: 10px;
    padding: 12px 14px;
}
.sala-locked { border-color: rgba(255, 165, 0, 0.3); }
.sala-running { border-color: rgba(255, 60, 60, 0.4); animation: salaPulse 2s ease-in-out infinite; }
.sala-finished { border-color: rgba(255, 215, 0, 0.4); }
@keyframes salaPulse {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 60, 60, 0.1); }
    50% { box-shadow: 0 0 15px rgba(255, 60, 60, 0.25); }
}
.sala-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px;
}
.sala-title { font-size: 0.82rem; font-weight: 700; color: #ff6b6b; }
.sala-finished .sala-title { color: #ffd700; }
.sala-subtitle { font-size: 0.7rem; color: #999; margin-bottom: 8px; }
.sala-participants {
    display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; min-height: 24px;
}
.sala-participant {
    display: inline-block; padding: 3px 8px; border-radius: 12px; font-size: 0.68rem;
    background: rgba(255, 255, 255, 0.06); color: #ccc; font-weight: 500;
    animation: lbSlideIn 0.3s ease-out both;
}
.sala-alive { background: rgba(76, 175, 80, 0.15); color: #81c784; border: 1px solid rgba(76, 175, 80, 0.2); }
.sala-info { font-size: 0.68rem; color: #777; }
.sala-eliminated {
    padding: 6px 10px; margin-bottom: 6px; border-radius: 6px;
    background: rgba(255, 60, 60, 0.1); border: 1px solid rgba(255, 60, 60, 0.2);
    font-size: 0.74rem; color: #ff8a8a;
    animation: salaElimFade 0.5s ease-out;
}
@keyframes salaElimFade {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.sala-winner {
    text-align: center; font-size: 1.1rem; font-weight: 700; color: #ffd700;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
    margin: 8px 0 4px;
}
.sala-prize {
    text-align: center; font-size: 0.82rem; color: #81c784; font-weight: 600;
}
@media (max-width: 768px) {
    .sala-widget { padding: 10px 12px; }
    .sala-participant { font-size: 0.62rem; padding: 2px 6px; }
    .sala-eliminated { font-size: 0.68rem; }
    .sala-winner { font-size: 0.95rem; }
}

/* =========================================
   ACHIEVEMENT BADGES
   ========================================= */
.ach-badge {
    display: inline-block;
    line-height: 1;
    padding: 1px 3px;
    margin: 0 1px;
    border-radius: 4px;
    vertical-align: middle;
    cursor: default;
    user-select: none;
}
.lb-name .ach-badge {
    font-size: 9px;
    padding: 1px 2px;
    margin-left: 3px;
}
.lb-my-name .ach-badge {
    font-size: 9px;
}
@media (max-width: 768px) {
    .ach-badge { padding: 0px 2px; }
}

/* =========================================
   ENCUESTA WIDGET
   ========================================= */
.encuesta-widget {
    background: linear-gradient(135deg, rgba(20, 15, 40, 0.95), rgba(10, 10, 25, 0.95));
    border: 1px solid rgba(96, 165, 250, 0.25);
    border-radius: 10px;
    padding: 12px 14px;
}
.encuesta-widget.encuesta-closed {
    border-color: rgba(74, 222, 128, 0.3);
}
.encuesta-widget .pred-option:hover:not(.pred-option-locked) {
    cursor: pointer;
    transform: scale(1.01);
}
