html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: #050505;
    color: #f5f5f5;
    font-family: Arial, Helvetica, sans-serif;
}

body::before,
body::after {
    content: "";
    position: fixed;
    left: 0;
    right: 0;
    z-index: 1;
    pointer-events: none;
}

body::before {
    top: 0;
    height: 31.2vh;
    background: linear-gradient(180deg, #CD201F 0, #A91B1A 62%, rgba(205, 32, 31, 0) 100%);
}

body::after {
    bottom: 0;
    height: 10px;
    background: #CD201F;
}

body.has-video::before,
body.has-video::after {
    display: none;
}

button {
    font: inherit;
}

#stage,
#player,
#player iframe {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: #050505;
}

#fullscreenTouchLayer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 3;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

#fullscreenTouchLayer:focus {
    outline: none;
}

#welcomePanel {
    position: fixed;
    left: 50%;
    top: 62%;
    z-index: 5;
    width: 232px;
    max-width: 90vw;
    box-sizing: border-box;
    transform: translate(-50%, -50%);
    overflow: hidden;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(15, 15, 15, 0.96);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.7);
    text-align: center;
    transition: opacity 180ms ease;
}

#welcomePanel::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 7px;
    background: #CD201F;
}

body.has-video #welcomePanel {
    left: auto;
    right: 14px;
    top: auto;
    bottom: 14px;
    width: 123px;
    transform: none;
    overflow: visible;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
}

body.has-video #welcomePanel::before {
    display: none;
}

body.has-video #welcomePanel:hover {
    opacity: 1;
}

#displayLogoBar {
    position: fixed;
    top: 14px;
    right: 0;
    left: 0;
    z-index: 4;
    text-align: center;
    pointer-events: none;
}

.appInfo {
    font-size: 13px;
    font-weight: 400;
    color: #aab6c5;
    margin: 0 0 12px;
}

#displayWordmark {
    display: block;
    width: auto;
    max-width: 78vw;
    height: 26.4vh;
    max-height: 288px;
    margin: 0 auto;
    border-radius: 8px;
}

body.has-video #displayLogoBar,
body.has-video #displayWordmark {
    display: none;
}

#poweredBy {
    flex: 0 0 auto;
    width: 106px;
    text-align: left;
}

#poweredBy span {
    display: block;
    margin-bottom: 3px;
    color: #aab6c5;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

#youtubeHomeLink {
    display: block;
    width: 96px;
    margin: 0;
    line-height: 0;
}

#youtubeWordmark {
    display: block;
    width: 96px;
    height: auto;
    margin: 0;
}

body.has-video #poweredBy,
body.has-video #fullscreenButton {
    display: none;
}

#controlLink {
    display: block;
    width: 166px;
    margin: 4px auto 8px;
    line-height: 0;
}

body.has-video #controlLink {
    width: 123px;
    height: 173px;
    margin: 0;
}

body.has-video .rcRoomQrCodeLink {
    margin: 0;
    opacity: 0.5;
}

#scanPanel {
    width: 166px;
}

body.has-video #scanPanel {
    transform: scale(0.74);
    transform-origin: top left;
}

.rcRoomQrCodeLink {
    display: block;
    -webkit-box-sizing: content-box;
    box-sizing: content-box;
    width: 150px;
    margin-top: 8px;
    margin-right: auto;
    margin-bottom: 8px;
    margin-left: auto;
    border: solid 8px #fff;
    border-radius: 8px;
    color: #fff;
    background-color: #fff;
    box-shadow: 0 0 0 1px #fff;
    text-align: center;
    transition: opacity 1s ease;
    text-decoration: none;
    transform-origin: top left;
    transform: scale(1);
    line-height: normal;
}

.rcTechLabel {
    background-color: #000;
    color: #fff;
    font-family: monospace;
    font-size: 13px;
    font-weight: bold;
    margin: 0 0 8px 0;
    padding: 4px;
    letter-spacing: 0.2em;
    line-height: 1.2;
}

.rcRoomQrCode {
    -webkit-box-sizing: content-box;
    box-sizing: content-box;
    width: 150px;
    height: 150px;
    overflow: hidden;
}

.rcRoomQrCode img,
.rcRoomQrCode canvas {
    display: block;
    width: 150px;
    height: 150px;
}

.rcRoomId {
    background-color: #000;
    color: #fff;
    font-family: monospace;
    font-size: 16px;
    padding: 4px;
    margin: 8px 0 0 0;
    letter-spacing: 0.25em;
    line-height: 1.2;
}

#controlUrl {
    display: none;
}

#fullscreenButton {
    display: block;
    margin: 8px auto 0;
    min-height: 30px;
    padding: 0 11px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 8px;
    background: #f5f5f5;
    color: #101010;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
}

#hud {
    position: static;
    max-width: none;
    margin: 0 0 8px;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.58);
    text-shadow: 0 1px 2px #000;
    pointer-events: none;
}

body.has-video #hud {
    position: fixed;
    left: 16px;
    top: 16px;
    z-index: 4;
    max-width: 620px;
    margin: 0;
}

body.hide-title #hud,
body.hide-qr #controlLink,
body.hide-qr #roomName,
body.hide-qr #fullscreenButton {
    display: none;
}

body.has-video.hide-qr #welcomePanel {
    width: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

#videoTitle {
    font-size: 15px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#videoMeta {
    margin-top: 3px;
    color: #d6d6d6;
    font-size: 11px;
}

#statsPanel {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 4;
    display: none;
    width: 420px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 120px);
    overflow: auto;
    box-sizing: border-box;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.72);
    color: #f4f4f4;
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    text-shadow: 0 1px 2px #000;
    pointer-events: none;
}

body.show-stats #statsPanel {
    display: block;
}

.statsTitle {
    margin-bottom: 8px;
    color: #b7d9ff;
    font-weight: 700;
}

#statsList {
    display: block;
    margin: 0;
}

#statsList dt,
#statsList dd {
    margin: 0;
}

#statsList dt {
    clear: left;
    float: left;
    width: 120px;
    margin: 0 12px 5px 0;
    color: #a8b5c4;
}

#statsList dd {
    margin: 0 0 5px 132px;
    word-wrap: break-word;
}

#enablePlaybackPanel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 7;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.44);
}

body.needs-playback-enable #enablePlaybackPanel {
    display: flex;
}

#enablePlaybackButton {
    min-height: 54px;
    padding: 0 24px;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 8px;
    background: #f5f5f5;
    color: #101010;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65);
}

#enablePlaybackButton:active {
    transform: translateY(1px);
}

#complianceFooter {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    box-sizing: border-box;
    min-height: 48px;
    padding: 7px 14px 8px;
    background: rgba(5, 5, 5, 0.92);
    color: #cfd7df;
    font-size: 11px;
    line-height: 1.35;
    text-align: left;
}

#complianceText {
    flex: 1 1 auto;
    text-align: center;
}

#complianceFooter a {
    color: #fff;
    font-weight: 700;
    text-decoration: underline;
}

body.has-video #complianceFooter {
    display: none;
}

@media (max-width: 640px) {
    body.has-video #hud {
        left: 10px;
        top: 10px;
        max-width: calc(100vw - 20px);
    }

    #videoTitle {
        font-size: 15px;
    }

    body.has-video #welcomePanel {
        right: 10px;
        bottom: 10px;
    }

    #complianceFooter {
        display: block;
        min-height: 0;
        padding: 7px 10px 8px;
        font-size: 10px;
    }

    #poweredBy {
        width: auto;
        margin-bottom: 5px;
        text-align: center;
    }

    #youtubeHomeLink,
    #youtubeWordmark {
        margin-right: auto;
        margin-left: auto;
    }

    #statsPanel {
        left: 10px;
        bottom: 10px;
        width: calc(100vw - 20px);
    }
}
