.stream-player,
.stream-player *,
.stream-player *::before,
.stream-player *::after {
    box-sizing: border-box;
}

body.stream-player-page {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: #050608;
    color: #fff;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.stream-player button,
.stream-player input {
    font: inherit;
}

.stream-player [hidden] {
    display: none !important;
}

.stream-player {
    --player-accent: #ff4d24;
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: #050608;
    isolation: isolate;
    user-select: none;
}

.stream-player--preview {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
}

.preview-offline-slate {
    z-index: 45;
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(5, 6, 8, 0.66);
}

.preview-offline-slate.is-hidden {
    display: none !important;
}

.preview-offline-dot {
    width: 12px;
    height: 12px;
}

.preview-offline-copy {
    color: var(--ink-muted, rgba(255, 255, 255, 0.5));
    font-size: 12.5px;
}

.stream-player::after {
    position: absolute;
    inset: 55% 0 0;
    z-index: 10;
    /* background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.86)); */
    content: "";
    pointer-events: none;
}

.stream-player video {
    display: block;
    width: 100%;
    height: 100%;
    background: #050608;
    object-fit: contain;
}

.online-placeholder {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 22% 24%, var(--player-accent), transparent 34%),
        linear-gradient(135deg, #111722, #07090d 62%, #11141a);
    opacity: 1;
    pointer-events: none;
    transition: opacity 240ms ease;
}

.online-placeholder::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(5, 6, 8, 0.08), rgba(5, 6, 8, 0.54));
    content: "";
}

.online-placeholder.is-hidden {
    opacity: 0;
    visibility: hidden;
}

.online-placeholder-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.online-placeholder-logo {
    position: relative;
    z-index: 1;
    max-width: min(32vw, 180px);
    max-height: 64px;
    object-fit: contain;
    opacity: 0.86;
}

.online-placeholder-pulse {
    position: absolute;
    right: 18px;
    bottom: 62px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.online-placeholder-pulse::before {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--player-accent);
    content: "";
    animation: placeholder-pulse 1.4s ease-in-out infinite;
}

.stream-player[data-live="false"] .online-placeholder-pulse {
    display: none;
}

.player-control {
    display: inline-grid;
    place-items: center;
    border: 0;
    color: #fff;
    cursor: pointer;
    transition: background-color 140ms ease, opacity 140ms ease, transform 140ms ease;
}

.player-control:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.player-unmute-cta {
    position: absolute;
    left: 50%;
    bottom: 84px;
    z-index: 31;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 0;
    border-radius: 9999px;
    background: rgba(7, 8, 12, 0.78);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
    transform: translateX(-50%);
    cursor: pointer;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: opacity 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.player-unmute-cta:hover {
    background: rgba(12, 14, 20, 0.9);
}

.player-unmute-cta:active {
    transform: translateX(-50%) scale(0.98);
}

.player-unmute-cta svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.player-unmute-cta[hidden] {
    display: none !important;
}

.player-controls {
    position: absolute;
    right: 14px;
    bottom: 12px;
    left: 14px;
    z-index: 32;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.stream-player.show-controls .player-controls,
.stream-player:focus-within .player-controls {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.stream-player.is-offline .player-controls {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.player-controls-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 5px 10px;
    border-radius: 10px;
    background: linear-gradient(180deg, rgb(6 7 10 / 2%), rgb(6 7 10 / 13%));
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
.player-controls-left,
.player-controls-right {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.player-progress {
    display: flex;
    flex: 1;
    align-items: center;
    min-width: 64px;
    padding: 0 2px;
}

.player-progress-track {
    width: 100%;
    height: 2px;
    overflow: hidden;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.12);
}

.player-progress-fill {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--player-accent), rgba(255, 255, 255, 0.82));
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.player-control {
    width: 34px;
    height: 34px;
    padding: 0;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 9999px;
}

.player-control:hover {
    background: rgba(255, 255, 255, 0.1);
}

.player-control:active {
    transform: scale(0.94);
}

.player-control svg {
    width: 18px;
    height: 18px;
}

.player-live-state {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 28px;
    padding: 0 10px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.84);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.08em;
}

.player-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--player-accent);
}

.icon-pause,
.icon-volume-off,
.icon-pip-exit,
.icon-fullscreen-exit {
    display: none;
}

.stream-player.is-playing .icon-play,
.stream-player.is-muted .icon-volume-on,
.stream-player.is-pip .icon-pip,
.stream-player.is-fullscreen .icon-fullscreen {
    display: none;
}

.stream-player.is-playing .icon-pause,
.stream-player.is-muted .icon-volume-off,
.stream-player.is-pip .icon-pip-exit,
.stream-player.is-fullscreen .icon-fullscreen-exit {
    display: block;
}

#offline-overlay {
    position: absolute;
    inset: 0;
    z-index: 45;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    background: linear-gradient(180deg, rgba(5, 6, 8, 0.24), rgba(5, 6, 8, 0.72));
    text-align: center;
}

#offline-overlay.is-hidden {
    display: none;
}

#offline-overlay .off-icon {
    width: 52px;
    height: 52px;
    opacity: 0.22;
}

#offline-overlay h2,
#offline-overlay p {
    margin: 0;
}

#offline-overlay h2 {
    color: rgba(255, 255, 255, 0.7);
    font-size: 17px;
    font-weight: 650;
}

#offline-overlay p {
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
}

#offline-overlay .off-logo {
    max-width: 160px;
    max-height: 48px;
    margin-bottom: 6px;
    object-fit: contain;
    opacity: 0.78;
}

#live-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 34;
    display: none;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border: 0;
    border-radius: 9999px;
    background: rgba(7, 8, 12, 0.48);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: opacity 180ms ease, transform 180ms ease;
}

#live-badge.show {
    display: inline-flex;
}

#stream-logo {
    position: absolute;
    top: 11px;
    right: 12px;
    z-index: 25;
    max-width: 110px;
    max-height: 36px;
    object-fit: contain;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
}

#stream-logo.show {
    opacity: 0.9;
}

#reconnect-pill,
#player-toast {
    position: absolute;
    left: 50%;
    z-index: 36;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 7px;
    background: #11141a;
    color: rgba(255, 255, 255, 0.86);
    font-size: 12px;
    font-weight: 600;
    transform: translateX(-50%);
}

#reconnect-pill {
    bottom: 64px;
    display: none;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    white-space: nowrap;
}

#reconnect-pill.show {
    display: flex;
}

#reconnect-pill .spin {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.24);
    border-top-color: #fff;
    border-radius: 50%;
    animation: player-spin 750ms linear infinite;
}

#player-toast {
    bottom: 72px;
    padding: 7px 11px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 140ms ease;
}

#player-toast.show {
    opacity: 1;
}

@keyframes player-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes placeholder-pulse {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.35;
    }
}

@media (max-width: 560px) {
    .player-controls {
        right: 8px;
        bottom: 8px;
        left: 8px;
    }

    .player-controls-inner {
        gap: 8px;
        min-height: 42px;
        padding: 6px 8px;
        border-radius: 14px;
    }

    .player-control {
        width: 32px;
        height: 32px;
    }

    .player-unmute-cta {
        bottom: 76px;
        padding: 9px 12px;
        font-size: 11.5px;
    }

    .player-unmute-cta svg {
        width: 15px;
        height: 15px;
    }

    #stream-logo {
        max-width: 88px;
        max-height: 30px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .stream-player,
    .stream-player *,
    .stream-player *::before,
    .stream-player *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
