.sm-tv-launcher {
    background: #66ccff;
    color: #000000;
    border: 2px solid #66ccff;
    font-family: 'Arial', sans-serif;
    font-weight: bold;
    font-size: 12px;
    padding: 8px 14px;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 0 0 16px rgba(102, 204, 255, 0.45);
}

.sm-tv-launcher:hover {
    background: #ffffff;
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.6);
}

.sm-tv-launcher--hidden {
    display: none;
}

.sm-tv-window {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 9995;
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
}

.sm-tv-window--hidden {
    display: none;
}

.sm-tv-window--dragging,
.sm-tv-window--resizing {
    user-select: none;
}

.sm-tv-set {
    position: relative;
    width: 100%;
    cursor: move;
}

.sm-tv-screen {
    position: absolute;
    z-index: 1;
    overflow: hidden;
    background: #000000;
    border-radius: 2px;
}

.sm-tv-frame {
    position: relative;
    z-index: 2;
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
    pointer-events: none;
}

.sm-tv-frame--missing {
    min-height: 360px;
    background:
        linear-gradient(180deg, #2a2a2a 0%, #111 100%);
    border: 8px solid #333;
    border-radius: 18px;
    box-sizing: border-box;
}

.sm-tv-video {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    object-fit: cover;
    display: block;
    background: #000000;
}

.sm-tv-static {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: none;
    pointer-events: none;
    opacity: 0.95;
}

.sm-tv-static.is-active {
    display: block;
}

.sm-tv-no-signal {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-family: 'Courier New', Courier, monospace;
    font-size: clamp(14px, 3vw, 28px);
    letter-spacing: 0.2em;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
    background: repeating-linear-gradient(
        0deg,
        #111 0px,
        #111 2px,
        #222 2px,
        #222 4px
    );
}

.sm-tv-no-signal.is-visible {
    display: flex;
}

.sm-tv-buttons {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

.sm-tv-channel-btn {
    position: absolute;
    pointer-events: auto;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
}

.sm-tv-channel-btn:focus-visible {
    outline: 2px solid #66ccff;
    outline-offset: 2px;
}

.sm-tv-close {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    line-height: 1;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    border: none;
    border-top-right-radius: 4px;
    background: linear-gradient(
        315deg,
        transparent 0 35%,
        rgba(0, 0, 0, 0.18) 35% 100%
    );
    color: rgba(102, 204, 255, 0.45);
}

.sm-tv-close:hover,
.sm-tv-window--dragging .sm-tv-close:hover {
    color: rgba(102, 204, 255, 0.75);
}

.sm-tv-close:focus-visible {
    outline: 2px solid rgba(102, 204, 255, 0.55);
    outline-offset: 2px;
}

.sm-tv-resize-handle {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 5;
    width: 24px;
    height: 24px;
    cursor: nwse-resize;
    border-bottom-right-radius: 4px;
    background: linear-gradient(
        135deg,
        transparent 0 40%,
        rgba(0, 0, 0, 0.18) 40% 100%
    );
}

.sm-tv-resize-handle::before {
    content: '';
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 14px;
    height: 14px;
    opacity: 0.4;
    pointer-events: none;
    background:
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 3px,
            rgba(102, 204, 255, 0.75) 3px,
            rgba(102, 204, 255, 0.75) 4px
        );
}

.sm-tv-resize-handle:hover::before,
.sm-tv-window--resizing .sm-tv-resize-handle::before {
    opacity: 0.7;
}
