.twitch-popup {
    position: fixed;
    left: 1.5rem;
    bottom: 1.5rem;
    width: 320px;
    background: var(--bg-panel, #111);
    border: 1px solid var(--border, #333);
    box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
    z-index: 999;
    font-family: "Space Mono", monospace;
}

.twitch-popup-bar {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem .6rem;
    background: var(--bg-panel-strong, #1a1a1a);
    border-bottom: 1px solid var(--border, #333);
    cursor: default;
}

.twitch-popup-title {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .75rem;
    flex: 1;
}

.twitch-popup-title .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #555;
}

.twitch-popup.is-live .twitch-popup-title .dot {
    background: #ff2d55;
    box-shadow: 0 0 6px #ff2d55;
    animation: live-pulse 1.4s ease-in-out infinite;
}

.twitch-popup-btn {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: .8rem;
    line-height: 1;
    padding: .2rem .4rem;
}

.twitch-popup-body {
    height: 180px;
}

.twitch-popup-body iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.twitch-popup.is-minimized .twitch-popup-body {
    display: none;
}

.twitch-popup-offline {
    display: none;
    position: relative;
    width: 100%;
    height: 100%;
}

.twitch-popup-offline img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.35) saturate(0.8);
}

.twitch-popup-offline::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(6, 6, 10, 0.15), rgba(6, 6, 10, 0.75));
}

.twitch-popup-offline-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    font-family: var(--font-mono);
    font-size: 1.3rem;
    letter-spacing: 0.14em;
    color: var(--text-hi);
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
    animation: offline-pulse 2.4s ease-in-out infinite;
}

@keyframes offline-pulse {

    0%,
    100% {
        opacity: 0.55;
    }

    50% {
        opacity: 1;
    }
}

.twitch-popup.is-live .twitch-popup-offline {
    display: none;
}

.twitch-popup:not(.is-live) #twitchPopupTarget {
    display: none;
}

.twitch-popup:not(.is-live) .twitch-popup-offline {
    display: block;
}