/* Twitch Live Status – Badge Styles v1.1.0 */

.tls-widget-wrap {
    display: flex;
}

.tls-link {
    text-decoration: none;
    display: inline-flex;
}

.tls-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding-top: 5px;
    padding-right: 12px;
    padding-bottom: 5px;
    padding-left: 8px;
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.08em;
    line-height: 1;
    vertical-align: middle;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: default;
}

.tls-link:hover .tls-badge {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(145, 70, 255, 0.4);
}

/* ── LIVE state ── */
.tls-badge.tls-live {
    background-color: #9146FF;
    color: #ffffff;
}

/* ── Dot base ── */
.tls-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    display: block;
}

.tls-badge.tls-live .tls-dot {
    background-color: #ff3e3e;
}

/* ── Pulse animation (opt-in via tls-dot-pulse class) ── */
.tls-badge.tls-live .tls-dot-pulse {
    box-shadow: 0 0 0 0 rgba(255, 62, 62, 0.7);
    animation: tls-pulse 1.6s ease-in-out infinite;
}

/* ── OFFLINE state ── */
.tls-badge.tls-offline {
    background-color: #3d3d3d;
    color: #adadad;
}

.tls-badge.tls-offline .tls-dot {
    background-color: #666;
}

/* ── Pulse keyframes ── */
@keyframes tls-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 62, 62, 0.7);
        background-color: #ff3e3e;
    }
    40% {
        box-shadow: 0 0 0 7px rgba(255, 62, 62, 0);
        background-color: #ff6b6b;
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 62, 62, 0);
        background-color: #ff3e3e;
    }
}

/* ── Dark mode support ── */
@media (prefers-color-scheme: dark) {
    .tls-badge.tls-offline {
        background-color: #2a2a2a;
        color: #888;
    }
}

/* ── Twitch Player Widget ── */

.tls-player-wrap {
    width: 100%;
    position: relative;
}

.tls-player-ratio {
    position: relative;
    width: 100%;
    height: 0;
    /* padding-bottom wird inline gesetzt je nach Seitenverhältnis */
}

.tls-player-ratio iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Editor-Vorschau */
.tls-player-preview {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

/* Offline-Nachricht */
.tls-player-offline {
    width: 100%;
    background: #1a1a1a;
    color: #adadad;
    text-align: center;
    border-radius: 8px;
    box-sizing: border-box;
}

.tls-player-offline-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 12px;
}

.tls-player-offline p {
    margin: 0;
    font-size: 15px;
}

/* ── Hover Player Popup (Desktop) ── */

#tls-hover-popup {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.75);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

#tls-hover-popup.tls-popup-visible {
    display: flex;
    opacity: 1;
}

#tls-hover-popup-inner {
    position: relative;
    width: 420px;
    max-width: 95vw;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    animation: tls-popup-in 0.2s ease;
}

@keyframes tls-popup-in {
    from { transform: scale(0.92); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

#tls-hover-popup-ratio {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    background: #000;
}

#tls-hover-popup-ratio iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: 0;
}

#tls-hover-popup-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

#tls-hover-popup-close:hover {
    background: rgba(145, 70, 255, 0.8);
}

/* ── Inline Player (Mobile) ── */

.tls-inline-player {
    display: none;
    width: 100%;
    margin-top: 10px;
    border-radius: 8px;
    overflow: hidden;
}

.tls-inline-player.tls-inline-open {
    display: block;
    animation: tls-inline-in 0.2s ease;
}

@keyframes tls-inline-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Auf Desktop inline Player nie anzeigen */
@media (min-width: 768px) {
    .tls-inline-player {
        display: none !important;
    }
}

/* Badge-Cursor wenn Hover-Player aktiv */
.tls-has-hover-player .tls-badge {
    cursor: pointer;
}
