* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background-color: #090d14;
    color: #eef2f4;
    font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
}

button {
    font: inherit;
}

[hidden] {
    display: none !important;
}

.viewer-shell {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.game-stage {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    padding: 12px;
    background-color: #05070b;
}

.game-frame {
    position: relative;
    width: 960px;
    height: 600px;
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
    border: 3px solid #66727c;
    background-color: #000;
}

#runtimeFrame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background-color: #000;
}

.side-panel {
    position: relative;
    flex: 0 0 330px;
    width: 330px;
    min-height: 0;
    padding: 28px 24px 116px;
    overflow: hidden;
    border-left: 1px solid #34404a;
    background-color: #111821;
}

.eyebrow,
.join-heading {
    color: #c9d0d5;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.brand-block h2,
.loading-card h1 {
    margin: 7px 0 10px;
    color: #f3f5f6;
    font-family: Impact, "Arial Black", sans-serif;
    font-weight: normal;
    letter-spacing: 0.06em;
    line-height: 0.92;
}

.brand-block h2 {
    font-size: 43px;
}

.brand-block p,
.loading-card p,
.qr-modal-card p {
    color: #aeb8c0;
    line-height: 1.45;
}

.brand-block p {
    margin: 0;
    font-size: 14px;
}

.join-block {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #34404a;
}

.qr-panel {
    width: 166px;
    min-height: 230px;
    margin-top: 10px;
}

.rcRoomQrCodeLink,
.rcRoomQrCodeLink * {
    box-sizing: content-box;
}

.rcRoomQrCodeLink {
    display: block;
    width: 150px;
    margin: 0 auto;
    overflow: hidden;
    border: solid 8px #fff;
    border-radius: 8px;
    color: #fff;
    background-color: #fff;
    text-align: center;
    text-decoration: none;
}

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

.rcRoomQrCode {
    width: 150px;
    height: 150px;
    overflow: hidden;
}

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

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

.qr-open-button {
    display: none;
    width: 100%;
    min-height: 42px;
    margin-top: 10px;
    border: 2px solid #9aa6ae;
    border-radius: 8px;
    background-color: #27333d;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
}

.viewer-status {
    position: absolute;
    right: 20px;
    bottom: 48px;
    left: 20px;
    display: flex;
    align-items: center;
    padding: 13px;
    border: 1px solid #3a4752;
    border-radius: 10px;
    background-color: #18232d;
}

.viewer-status strong,
.viewer-status span {
    display: block;
}

.viewer-status strong {
    font-size: 14px;
}

.viewer-status div span {
    margin-top: 3px;
    color: #9ba8b1;
    font-size: 11px;
}

.status-light {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    border: 3px solid #59636a;
    border-radius: 50%;
    background-color: #7c302c;
    margin-right: 11px;
}

.status-light.online {
    border-color: #81905d;
    background-color: #b6cb72;
}

.key-hint {
    position: absolute;
    right: 24px;
    bottom: 15px;
    left: 24px;
    margin: 0;
    color: #73818b;
    font-size: 10px;
}

.loading-panel,
.error-panel {
    position: absolute;
    z-index: 4;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #070a0f;
}

.loading-card {
    width: 76%;
    max-width: 520px;
    padding: 28px;
    border: 1px solid #52606b;
    background-color: #111821;
    text-align: center;
}

.loading-card h1 {
    font-size: 54px;
}

.loading-card p {
    margin: 8px 0 14px;
}

.loading-card .sound-hint {
    margin-bottom: 0;
    color: #77858f;
    font-size: 12px;
}

.load-track {
    width: 100%;
    height: 8px;
    overflow: hidden;
    border: 1px solid #52606b;
    background-color: #080b10;
}

.load-bar {
    display: block;
    width: 18%;
    height: 100%;
    background-color: #b6cb72;
    transition: width 250ms linear;
}

.sound-gate {
    position: absolute;
    z-index: 6;
    top: 12px;
    right: 12px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid #aeb8c0;
    border-radius: 7px;
    background-color: #27333d;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
}

.error-panel {
    z-index: 7;
    flex-direction: column;
    padding: 30px;
    color: #ffd4d0;
    text-align: center;
}

.error-panel strong {
    font-size: 22px;
}

.error-panel span {
    margin-top: 8px;
    color: #c7a7a4;
}

.qr-modal {
    position: fixed;
    z-index: 20;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.qr-modal-backdrop {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.86);
}

.qr-modal-card {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 230px;
    max-width: calc(100% - 28px);
    padding: 20px 20px 16px;
    border: 2px solid #66727c;
    background-color: #111821;
    text-align: center;
    transform: translate(-50%, -50%);
}

.qr-modal-card p {
    margin: 8px 0 0;
    font-size: 11px;
}

.qr-modal-close {
    position: absolute;
    top: 3px;
    right: 5px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    background-color: transparent;
    color: #fff;
    font-size: 30px;
    line-height: 34px;
    cursor: pointer;
}

.qr-panel.qr-modal-panel {
    width: 166px;
    margin: 12px auto 0;
}

.qr-open-button:focus,
.qr-modal-close:focus,
.sound-gate:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.lean-paint .load-bar {
    transition: none;
}

@media (max-width: 1100px) and (min-aspect-ratio: 4/3) {
    .side-panel {
        flex-basis: 250px;
        width: 250px;
        padding: 18px 14px 105px;
    }

    .brand-block h2 {
        font-size: 32px;
    }

    .brand-block p {
        font-size: 12px;
    }

    .join-block {
        margin-top: 18px;
        padding-top: 14px;
    }

    .qr-panel {
        width: 132px;
        min-height: 182px;
    }

    .qr-panel .rcRoomQrCodeLink {
        margin: 0;
        transform: scale(0.78);
        transform-origin: top left;
    }
}

@media (max-aspect-ratio: 4/3) {
    .viewer-shell {
        flex-direction: column;
    }

    .game-stage {
        flex: 1 1 auto;
        padding: 7px;
    }

    .side-panel {
        flex: 0 0 215px;
        width: 100%;
        padding: 12px 14px 70px;
        border-top: 1px solid #34404a;
        border-left: 0;
    }

    .brand-block h2 {
        margin: 4px 0 5px;
        font-size: 28px;
    }

    .brand-block p {
        margin-right: 145px;
        font-size: 11px;
    }

    .join-block {
        position: absolute;
        top: 12px;
        right: 14px;
        width: 130px;
        margin: 0;
        padding: 0;
        border: 0;
    }

    .join-heading {
        font-size: 9px;
        letter-spacing: 0.1em;
    }

    .join-block .qr-panel {
        display: none;
    }

    .qr-open-button {
        display: block;
        min-height: 37px;
        margin-top: 6px;
        font-size: 11px;
    }

    .viewer-status {
        right: 14px;
        bottom: 22px;
        left: 14px;
        padding: 9px 11px;
    }

    .key-hint {
        display: none;
    }

    .loading-card h1 {
        font-size: 38px;
    }
}

@media (max-height: 700px) and (max-aspect-ratio: 4/3) {
    .side-panel {
        flex-basis: 170px;
    }

    .brand-block p {
        display: none;
    }
}
