
/* Universal Live Streaming Widget V1.1 */

.universal-live-widget {
    --ulive-solo-size: 700px;
    --ulive-participant-size: 450px;

    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    background: #ffffff;
    color: #111111;
    font-family: Tahoma, Arial, sans-serif;
    container-type: inline-size;
}

.universal-live-widget * {
    box-sizing: border-box;
}

.universal-live-widget .ulive-header {
    padding: 12px 8px;
}

.universal-live-widget .ulive-header h2 {
    font-size: 22px;
    margin: 0;
    color: inherit;
}

.universal-live-widget .ulive-status {
    text-align: center;
    padding: 20px 10px;
    font-size: 14px;
}

.universal-live-widget .ulive-broadcasts {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    width: 100%;
}

.universal-live-widget .ulive-broadcast {
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.universal-live-widget .ulive-broadcast-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
}

.universal-live-widget .ulive-live-badge {
    background: #e60000;
    color: #ffffff;
    font-size: 12px;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 4px;
}

.universal-live-widget .ulive-name {
    font-weight: bold;
    font-size: 15px;
}

/* Solo broadcast */

.universal-live-widget .ulive-video-grid {
    display: grid;
    grid-template-columns:
        minmax(0, var(--ulive-solo-size));
    justify-content: center;
    align-items: start;
    gap: 12px;
    width: 100%;
}

/* Two participants: desktop */

.universal-live-widget .ulive-video-grid.ulive-two {
    grid-template-columns:
        repeat(2, minmax(0, var(--ulive-participant-size)));
}

.universal-live-widget[data-desktop-layout="stacked"]
.ulive-video-grid.ulive-two {
    grid-template-columns:
        minmax(0, var(--ulive-participant-size));
}

/* Individual square video tiles */

.universal-live-widget .ulive-video-tile {
    position: relative;
    width: 100%;
    min-width: 0;
    aspect-ratio: 1 / 1;
    background: #000000;
    overflow: hidden;
}

.universal-live-widget .ulive-video-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.universal-live-widget video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Participant name */

.universal-live-widget .ulive-participant-name {
    position: absolute;
    left: 8px;
    bottom: 8px;
    z-index: 5;
    max-width: 90%;
    background: rgba(0,0,0,.8);
    color: #ffffff;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 4px;
    overflow-wrap: anywhere;
}

/* Sound controls */

.universal-live-widget .ulive-sound {
    display: block;
    margin: 10px auto;
    padding: 10px 18px;
    background: #111111;
    color: #ffffff;
    border: 0;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.universal-live-widget [hidden] {
    display: none !important;
}

/* Mobile and PWA */

@media (max-width: 767px) {

    .universal-live-widget .ulive-video-grid,
    .universal-live-widget .ulive-video-grid.ulive-two {
        grid-template-columns: minmax(0, 1fr);
    }

    .universal-live-widget[data-mobile-layout="side-by-side"]
    .ulive-video-grid.ulive-two {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .universal-live-widget .ulive-header h2 {
        font-size: 20px;
    }
}

/* Narrow widget placement, including desktop sidebars */

@container (max-width: 550px) {

    .universal-live-widget .ulive-video-grid.ulive-two {
        grid-template-columns: minmax(0, 1fr);
    }
}



/* Universal Live Clean Display V1.3 */

/* Remove the theme's outer widget frame */

.layout_universallive_live_streams,
.universal-live-widget,
.universal-live-widget .ulive-broadcast,
.universal-live-widget .ulive-video-grid {

    background: transparent !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

.layout_universallive_live_streams,
.universal-live-widget {

    margin: 0 !important;
    min-height: 0 !important;
}

/* Hide all unnecessary headings */

.universal-live-widget .ulive-header,
.universal-live-widget .ulive-name,
.universal-live-widget .ulive-status {

    display: none !important;
}

/* Completely disappear when nobody is live */

.universal-live-widget[hidden],
.layout_universallive_live_streams.ulive-off-air {

    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}

.layout_universallive_live_streams:has(
    .universal-live-widget[hidden]
) {

    display: none !important;
}

/* Video container */

.universal-live-widget .ulive-broadcast {

    position: relative !important;
    overflow: hidden !important;
    width: 100% !important;
}

.universal-live-widget .ulive-video-tile,
.universal-live-widget .ulive-video-frame {

    border: 0 !important;
    outline: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

/* LIVE badge overlays the video */

.universal-live-widget .ulive-broadcast-header {

    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    left: auto !important;
    z-index: 20 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: 0 !important;
    pointer-events: none;
}

.universal-live-widget .ulive-live-badge {

    background: #E60000 !important;
    color: #FFFFFF !important;
    font-size: 12px !important;
    padding: 6px 10px !important;
    border-radius: 4px !important;
}

/* Unmute button overlays the video */

.universal-live-widget .ulive-sound {

    position: absolute !important;
    bottom: 10px !important;
    right: 10px !important;
    left: auto !important;
    z-index: 25 !important;
    width: auto !important;
    margin: 0 !important;
    padding: 10px 14px !important;
    background: rgba(0,0,0,.85) !important;
    color: #FFFFFF !important;
    border: 0 !important;
    border-radius: 5px !important;
    font-size: 14px !important;
}

/* Participant name */

.universal-live-widget .ulive-participant-name {

    background: rgba(0,0,0,.85) !important;
    color: #FFFFFF !important;
    bottom: 10px !important;
    left: 10px !important;
    max-width: calc(100% - 125px) !important;
    z-index: 10 !important;
}

/* Preserve existing desktop and mobile layouts */

@media (max-width: 767px) {

    .layout_universallive_live_streams,
    .universal-live-widget {

        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}


/* Universal Live V1.5 */

/* Space below active broadcasts only */

.layout_universallive_live_streams
.universal-live-widget:not([hidden]) {
    padding-bottom: 20px !important;
}

/* Keep mobile video full width but shorter */

@media (max-width: 767px) {

    .universal-live-widget .ulive-video-tile {
        width: 100% !important;
        max-width: 100% !important;
        aspect-ratio: 4 / 3 !important;
    }

    .universal-live-widget .ulive-video-frame {
        width: 100% !important;
        height: 100% !important;
    }

    .universal-live-widget video {
        object-fit: cover !important;
    }
}

/* Broadcaster's name overlays the video */

.universal-live-widget .ulive-broadcast-header {
    left: 10px !important;
    right: 10px !important;
    top: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
}

.universal-live-widget .ulive-name {
    display: block !important;
    color: #FFFFFF !important;
    background: rgba(0,0,0,.75) !important;
    padding: 6px 10px !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    overflow-wrap: anywhere !important;
}

.universal-live-widget .ulive-participant-name {
    display: none !important;
}

/* Preserve complete off-air hiding */

.universal-live-widget[hidden],
.layout_universallive_live_streams.ulive-off-air {
    display: none !important;
    padding: 0 !important;
    margin: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    border: 0 !important;
}



/* Universal Live V1.6 */

/* More space below active livestreams */

.layout_universallive_live_streams
.universal-live-widget:not([hidden]) {
    padding-bottom: 40px !important;
}

/* Keep the LIVE badge at the top right */

.universal-live-widget .ulive-broadcast-header {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    padding: 0 !important;
    pointer-events: none !important;
}

.universal-live-widget .ulive-live-badge {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
}

/* Move broadcaster's name to bottom left */

.universal-live-widget .ulive-name {
    position: absolute !important;
    top: auto !important;
    left: 10px !important;
    bottom: 10px !important;
    right: auto !important;
    max-width: calc(100% - 115px) !important;
    background: rgba(0,0,0,.85) !important;
    color: #FFFFFF !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    padding: 8px 10px !important;
    border-radius: 4px !important;
    overflow-wrap: anywhere !important;
}

/* Keep Unmute at the bottom right */

.universal-live-widget .ulive-sound {
    bottom: 10px !important;
    right: 10px !important;
}

/* Preserve complete off-air hiding */

.universal-live-widget[hidden],
.layout_universallive_live_streams.ulive-off-air {
    display: none !important;
    padding: 0 !important;
    margin: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
}

