/* =============================================
   PuffCase — stream-widget.css
   Widget flotante de Twitch (abajo-derecha)
   ============================================= */

#stream-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9000;
    width: 380px;
    background: var(--card-bg, #1e1535);
    border: 1px solid var(--purple-border, #3d2a6e);
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.6), 0 0 0 1px rgba(124,58,237,0.15);
    overflow: hidden;
    transition: box-shadow 0.2s, border-color 0.2s;
    user-select: none;
}

#stream-widget:hover {
    border-color: var(--purple-accent, #7c3aed);
    box-shadow: 0 16px 56px rgba(0,0,0,0.65), 0 0 24px rgba(124,58,237,0.2);
}

/* ── Barra de título ──────────────────────── */
#stream-widget-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(124,58,237,0.18), rgba(124,58,237,0.06));
    border-bottom: 1px solid var(--purple-border, #3d2a6e);
    cursor: grab;
}
#stream-widget-header:active { cursor: grabbing; }

.stream-widget-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #aaa;
    flex-shrink: 0;
    transition: background 0.3s;
}
.stream-widget-dot.live {
    background: #f44336;
    box-shadow: 0 0 6px rgba(244,67,54,0.8);
    animation: stream-pulse 1.8s infinite;
}
@keyframes stream-pulse {
    0%, 100% { box-shadow: 0 0 6px rgba(244,67,54,0.8); }
    50%       { box-shadow: 0 0 14px rgba(244,67,54,1); }
}

.stream-widget-title {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--white, #fff);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stream-widget-status {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}
.stream-widget-status.live {
    background: rgba(244,67,54,0.18);
    border: 1px solid rgba(244,67,54,0.45);
    color: #f44336;
}
.stream-widget-status.offline {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: #888;
}

.stream-widget-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.stream-widget-btn {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 6px;
    background: rgba(255,255,255,0.06);
    color: #aaa;
    font-size: 0.78rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
}
.stream-widget-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.stream-widget-btn.twitch:hover { background: rgba(145,71,255,0.25); color: #9147ff; }
.stream-widget-btn.close-btn:hover  { background: rgba(244,67,54,0.2); color: #f44336; }

/* ── Cuerpo del embed ─────────────────────── */
#stream-widget-body { position: relative; width: 100%; }

/* Iframe del player */
#stream-widget-body iframe {
    display: block;
    width: 100%;
    height: 214px;
    border: none;
}

/* Pantalla offline */
#stream-offline-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 28px 20px;
    text-align: center;
}
.stream-offline-icon { font-size: 2.2rem; line-height: 1; }
.stream-offline-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--white, #fff);
}
.stream-offline-text {
    font-size: 0.8rem;
    color: #888;
    line-height: 1.45;
}
.stream-offline-link {
    display: inline-block;
    margin-top: 4px;
    background: rgba(145,71,255,0.15);
    border: 1px solid rgba(145,71,255,0.4);
    color: #9147ff;
    text-decoration: none;
    padding: 7px 18px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.2s;
}
.stream-offline-link:hover {
    background: rgba(145,71,255,0.28);
    color: #fff;
}

/* Botón de mute (overlay sobre el player) */
#stream-mute-btn {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0,0,0,0.62);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    color: #ddd;
    font-size: 0.75rem;
    padding: 4px 9px;
    cursor: pointer;
    z-index: 10;
    transition: background 0.15s;
    display: none; /* se muestra solo en live */
}
#stream-mute-btn:hover { background: rgba(0,0,0,0.82); color: #fff; }

/* ── Responsive ───────────────────────────── */
@media (max-width: 520px) {
    #stream-widget {
        width: calc(100vw - 24px);
        right: 12px;
        bottom: 12px;
    }
}