.kg-app-v2 #chat-window .msg.msg--random-player {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0;
    width: min(360px, 100%);
    max-width: min(360px, calc(100vw - 32px));
    box-sizing: border-box;
}

.kg-app-v2 #chat-window .msg.msg--random-player::before,
.kg-app-v2 #chat-window .msg.msg--random-player::after {
    display: none !important;
}

.random-player-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 12px;
    border: 1px solid rgba(111, 139, 174, 0.36);
    border-radius: 18px;
    background: rgba(14, 24, 38, 0.72);
    color: #fff;
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.34);
}

.random-player-card__main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.random-player-card__thumb {
    width: 112px;
    height: 76px;
    flex: 0 0 auto;
    border-radius: 14px;
    object-fit: cover;
    background: rgba(52, 60, 99, 0.78);
}

.random-player-card__thumb--empty {
    display: grid;
    place-items: center;
    font-size: 1.7rem;
}

.random-player-card__body {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.random-player-card__body strong {
    font-size: 1rem;
}

.random-player-card__body span,
.random-player-card__body small {
    overflow: hidden;
    color: rgba(218, 230, 244, 0.78);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.random-player-card__open {
    width: 100%;
    margin-top: 12px;
    border: 0;
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(52, 60, 99, 0.92);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.random-player-card__open:hover {
    background: rgba(73, 86, 143, 0.98);
}

.random-player-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999998;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #050912;
    touch-action: none;
    user-select: none;
}

.random-player-overlay.hidden {
    display: none;
}

.random-player-stage {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    touch-action: none;
    background:
        radial-gradient(900px 620px at 20% 0%, rgba(52, 60, 99, 0.36), transparent 62%),
        linear-gradient(180deg, #050912, #0b1624);
}

.random-player-stage::before {
    content: "";
    position: absolute;
    inset: -8vh -8vw;
    z-index: 0;
    background-image: var(--random-player-ambient-image);
    background-position: center;
    background-size: cover;
    opacity: 0;
    filter: blur(54px) saturate(1.35);
    transform: scale(1.08);
    transition: opacity 0.28s ease;
}

.random-player-stage.has-ambient::before {
    opacity: 0.42;
}

.random-player-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(900px 620px at 50% 50%, transparent 0%, rgba(5, 9, 18, 0.22) 58%, rgba(5, 9, 18, 0.86) 100%),
        linear-gradient(180deg, rgba(5, 9, 18, 0.42), rgba(5, 9, 18, 0.36));
}

.random-player-video-slot,
.random-player-video {
    width: 100%;
    height: 100%;
}

.random-player-video-slot {
    position: relative;
    z-index: 2;
    overflow: hidden;
    touch-action: none;
}

.random-player-video {
    display: block;
    object-fit: contain;
    background: transparent;
    touch-action: none;
}

.random-player-close {
    position: fixed;
    top: 16px;
    right: 18px;
    z-index: 5;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 14px;
    background: rgba(52, 60, 99, 0.82);
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}

.random-player-center-toggle {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 5;
    display: grid;
    place-items: center;
    width: 74px;
    height: 74px;
    border: 0;
    border-radius: 50%;
    background: rgba(15, 19, 27, 0.48);
    color: #fff;
    font-size: 1.72rem;
    font-weight: 900;
    line-height: 1;
    transform: translate(-50%, -50%) scale(0.94);
    opacity: 0;
    cursor: pointer;
    transition: opacity 0.22s ease, transform 0.22s ease, background 0.22s ease;
}

.random-player-center-toggle:hover {
    background: rgba(22, 29, 42, 0.72);
}

.random-player-center-toggle.is-paused,
.random-player-overlay.is-controls-visible .random-player-center-toggle {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.random-player-center-toggle.is-paused {
    background: rgba(15, 19, 27, 0.66);
}

.random-player-controls {
    position: fixed;
    left: 50%;
    bottom: 38px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(-50%);
    padding: 10px;
    border-radius: 18px;
    background: rgba(12, 20, 32, 0.78);
    opacity: 0;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.random-player-overlay.is-controls-visible .random-player-controls {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.random-player-controls button {
    border: 0;
    border-radius: 12px;
    padding: 10px 14px;
    background: rgba(52, 60, 99, 0.92);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.random-player-next-btn {
    min-width: 126px;
}

.random-player-votes,
.random-player-hint {
    color: rgba(225, 235, 247, 0.8);
    font-weight: 700;
}

.random-player-votes.hidden {
    display: none;
}

.random-player-hint {
    position: fixed;
    left: 50%;
    bottom: 86px;
    z-index: 5;
    transform: translateX(-50%);
    font-size: 0.9rem;
    pointer-events: none;
    opacity: 0.92;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.random-player-switch-pending {
    position: fixed;
    left: 50%;
    top: 58%;
    z-index: 5;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(12, 20, 32, 0.78);
    color: rgba(225, 235, 247, 0.92);
    font-weight: 800;
    opacity: 0;
    transform: translate(-50%, 10px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.random-player-overlay.is-switch-pending .random-player-switch-pending {
    opacity: 1;
    transform: translate(-50%, 0);
}

.random-player-overlay.is-switch-pending .random-player-next-btn {
    opacity: 0.74;
}

.random-player-overlay.is-hint-hidden .random-player-hint {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
}

.random-player-progress {
    position: fixed;
    left: 18px;
    right: 18px;
    bottom: 18px;
    z-index: 5;
    width: calc(100vw - 36px);
    height: 1px;
    margin: 0;
    padding: 3px;
    border: 0;
    border-radius: 999px;
    outline: none;
    background: transparent;
    --range-bg: linear-gradient(to right, rgb(255 0 0) 0%, rgb(255 79 79) 0%, rgba(255,255,255,0.28) 0%, rgba(255,255,255,0.28) 100%);
    cursor: pointer;
    opacity: 0.84;
    -webkit-appearance: none;
    appearance: none;
}

.random-player-progress::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 999px;
    background: var(--range-bg);
}

.random-player-progress::-moz-range-track {
    height: 4px;
    border-radius: 999px;
    background: var(--range-bg);
}

.random-player-progress::-webkit-slider-thumb {
    width: 14px;
    height: 14px;
    margin-top: -5px;
    border: 0;
    border-radius: 50%;
    background: rgb(255 0 0);
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.18);
    -webkit-appearance: none;
    appearance: none;
}

.random-player-progress::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: 0;
    border-radius: 50%;
    background: rgb(255 0 0);
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.18);
}

.random-player-preload {
    position: fixed;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.random-player-empty {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    width: 100%;
    height: 100%;
    color: #fff;
    font-size: 1.2rem;
    text-align: center;
}

.random-player-empty small {
    max-width: 80vw;
    color: rgba(225, 235, 247, 0.72);
}

.random-player-loading {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    width: 100%;
    height: 100%;
    color: #fff;
    text-align: center;
}

.random-player-loading span {
    width: 54px;
    height: 54px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #6df0a7;
    border-radius: 50%;
    animation: random-player-spin 0.8s linear infinite;
}

.random-player-loading small {
    color: rgba(225, 235, 247, 0.72);
}

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

.random-player-slide-track {
    position: relative;
    width: 100%;
    height: 200%;
    transform: translateY(0);
    transition: transform 0.34s cubic-bezier(0.2, 0.78, 0.22, 1);
}

.random-player-slide-track.is-active {
    transform: translateY(-50%);
}

.random-player-slide-track > .random-player-video,
.random-player-slide-track > .random-player-loading,
.random-player-slide-track > .random-player-empty {
    width: 100%;
    height: 50%;
}

.random-player-overlay.is-switch-requested .random-player-video-slot {
    animation: random-player-nudge 0.34s ease;
}

@keyframes random-player-nudge {
    45% {
        transform: translateY(-18px);
    }

    100% {
        transform: translateY(0);
    }
}

body.random-player-open {
    overflow: hidden;
}

@media (max-width: 1000px) {
    .kg-app-v2 #chat-window .msg.msg--random-player {
        width: min(100%, calc(100vw - 72px));
        max-width: calc(100vw - 72px);
    }

    .random-player-card {
        width: 100%;
    }

    .random-player-card__thumb {
        width: 96px;
        height: 68px;
    }

    .random-player-controls {
        right: 12px;
        bottom: 34px;
        left: 12px;
        justify-content: center;
        transform: none;
    }

    .random-player-overlay.is-controls-visible .random-player-controls {
        transform: none;
    }

    .random-player-hint {
        bottom: 82px;
        width: calc(100vw - 24px);
        text-align: center;
    }

    .random-player-center-toggle {
        width: 68px;
        height: 68px;
    }

    .random-player-stage.has-ambient::before {
        opacity: 0.26;
    }
}
