/* ── TikTok Live – Floating Widget ────────────────────────────────────── */

#tklive-widget {
    position: fixed;
    top: 72px;
    left: 12px;
    z-index: 9000;
    display: none;
    align-items: center;
    gap: 8px;
    background: linear-gradient(120deg, #1c0505 0%, #2d0b0b 100%);
    border: 1px solid #aa0000;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,.7), 0 0 14px rgba(180,0,0,.25);
    padding: 7px 10px 7px 12px;
    max-width: 290px;
    animation: tklive-slide .4s ease;
    transition: opacity .3s;
}
#tklive-widget.tklive-show { display: flex; }

@keyframes tklive-slide {
    from { opacity:0; transform: translateX(-18px); }
    to   { opacity:1; transform: translateX(0);     }
}

/* Badge pulsante */
.tklive-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #cc0000;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border-radius: 20px;
    padding: 3px 8px;
    white-space: nowrap;
    flex-shrink: 0;
    animation: tklive-pulse 1.5s infinite;
}

@keyframes tklive-pulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(204,0,0,.6); }
    50%      { box-shadow: 0 0 0 5px rgba(204,0,0,0); }
}

.tklive-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #fff;
    display: inline-block;
    flex-shrink: 0;
}

/* Icono TikTok */
.tklive-icon {
    flex-shrink: 0;
    opacity: .85;
}

/* Username */
.tklive-w-user {
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

/* Botón ver */
.tklive-w-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #cc0000;
    color: #fff !important;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    text-decoration: none !important;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background .2s;
}
.tklive-w-btn:hover { background: #ee0000; }

/* Botón cerrar */
.tklive-w-close {
    background: none;
    border: none;
    color: #555;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: color .2s;
}
.tklive-w-close:hover { color: #fff; }

@media (max-width: 480px) {
    #tklive-widget {
        top: auto;
        bottom: 80px;
        left: 8px;
        right: 8px;
        max-width: none;
    }
}

#tklive-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.8);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}
#tklive-overlay.tklive-show { display: flex; }

#tklive-modal {
    position: relative;
    background: #0d0d0d;
    border: 2px solid #cc0000;
    border-radius: 14px;
    box-shadow: 0 0 50px rgba(204,0,0,.45), 0 0 100px rgba(0,0,0,.9);
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: tklive-in .3s ease;
}

@keyframes tklive-in {
    from { opacity:0; transform: scale(.88) translateY(24px); }
    to   { opacity:1; transform: scale(1)  translateY(0);     }
}

/* ── Header ── */
#tklive-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #1a0505;
    border-bottom: 1px solid #2a0a0a;
    flex-shrink: 0;
}

.tklive-pulse {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #cc0000;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border-radius: 20px;
    padding: 3px 9px;
    white-space: nowrap;
    animation: tklive-pulse 1.4s infinite;
    flex-shrink: 0;
}

@keyframes tklive-pulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(204,0,0,.6); }
    50%      { box-shadow: 0 0 0 6px rgba(204,0,0,0); }
}

.tklive-pulse-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #fff;
    display: inline-block;
    flex-shrink: 0;
}

.tklive-user {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0;
}

.tklive-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #cc0000;
    color: #fff !important;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .3px;
    padding: 5px 11px;
    border-radius: 6px;
    text-decoration: none !important;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background .2s;
}
.tklive-btn:hover { background: #ee0000; }

#tklive-close {
    background: none;
    border: none;
    color: #666;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 0 0 0 4px;
    flex-shrink: 0;
    transition: color .2s;
}
#tklive-close:hover { color: #fff; }

/* ── Stream iframe ── */
#tklive-frame-wrap {
    position: relative;
    width: 100%;
    /* 9:16 portrait aspect ratio */
    aspect-ratio: 9 / 16;
    max-height: 65vh;
    background: #000;
    overflow: hidden;
}

#tklive-frame-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ── Fallback message (shown if iframe is blocked) ── */
#tklive-fallback {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #888;
    font-size: 13px;
    text-align: center;
    padding: 20px;
    gap: 12px;
}
#tklive-fallback a {
    background: #cc0000;
    color: #fff !important;
    padding: 9px 22px;
    border-radius: 6px;
    text-decoration: none !important;
    font-weight: 700;
    font-size: 14px;
}

@media (max-width: 420px) {
    #tklive-modal { max-width: 100%; border-radius: 10px; }
    #tklive-frame-wrap { max-height: 60vh; }
}
