/* Shepard Tone display styles — strict circa-2015 CSS 3 with WebKit prefixes,
   flat lean-paint surfaces and canonical RCWeb QR panel rules. */
* {
    box-sizing: border-box;
}

html,
body,
#stage {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #0d1221;
    color: #efe7d8;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    -webkit-user-select: none;
    user-select: none;
}

#stage {
    position: relative;
}

#scene {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

[hidden] {
    display: none !important;
}

/* Unobtrusive audio-unlock banner shown only while browser autoplay keeps audio suspended */
#audioPrompt {
    position: fixed;
    top: 18px;
    left: 50%;
    z-index: 4;
    padding: 10px 18px;
    border: 1px solid rgba(255, 206, 120, 0.58);
    border-radius: 24px;
    background: rgba(16, 22, 38, 0.90);
    color: #fff2d6;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.03em;
    white-space: nowrap;
    cursor: pointer;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    -webkit-transition: background-color 150ms ease, border-color 150ms ease;
    transition: background-color 150ms ease, border-color 150ms ease;
}

#audioPrompt:hover,
#audioPrompt:focus {
    background: rgba(34, 46, 74, 0.96);
    border-color: #ffd07a;
    outline: none;
}

#audioPrompt:focus {
    outline: 2px solid #ffd07a;
    outline-offset: 2px;
}

/* Auto-hiding minimal toolbar (appears on mouse move, touch or keyboard activity) */
#controlBar {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 3;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    max-width: calc(100% - 82px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    -webkit-transition: opacity 220ms linear, visibility 0s linear 220ms;
    transition: opacity 220ms linear, visibility 0s linear 220ms;
}

#fullscreenToggle {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 3;
    width: 44px;
    height: 44px;
    padding: 11px;
    border: 1px solid rgba(220, 206, 178, 0.24);
    border-radius: 8px;
    background: rgba(12, 18, 32, 0.80);
    color: #f4ebd8;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    -webkit-transition: opacity 220ms linear, visibility 0s linear 220ms, background-color 140ms ease;
    transition: opacity 220ms linear, visibility 0s linear 220ms, background-color 140ms ease;
}

#fullscreenToggle svg {
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.fullscreen-exit,
#fullscreenToggle[aria-pressed="true"] .fullscreen-enter {
    display: none;
}

#fullscreenToggle[aria-pressed="true"] .fullscreen-exit {
    display: block;
}

.controls-visible #controlBar,
.controls-visible #fullscreenToggle {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    -webkit-transition-delay: 0s;
    transition-delay: 0s;
}

.hud-btn {
    height: 36px;
    margin: 0 6px 6px 0;
    padding: 0 12px;
    border: 1px solid rgba(220, 206, 178, 0.24);
    border-radius: 8px;
    background: rgba(12, 18, 32, 0.80);
    color: #f4ebd8;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.03em;
    line-height: 34px;
    cursor: pointer;
    white-space: nowrap;
    -webkit-transition: background-color 140ms ease, border-color 140ms ease;
    transition: background-color 140ms ease, border-color 140ms ease;
}

.hud-btn:hover,
#fullscreenToggle:hover {
    background: rgba(28, 38, 64, 0.92);
    border-color: rgba(255, 204, 114, 0.62);
}

.hud-btn:focus,
#fullscreenToggle:focus {
    outline: 2px solid #ffd07a;
    outline-offset: -2px;
}

.hud-btn.is-active {
    background: rgba(58, 44, 24, 0.92);
    border-color: rgba(255, 204, 114, 0.72);
    color: #ffe3a8;
}

.hud-btn.is-muted {
    background: rgba(54, 24, 28, 0.88);
    border-color: rgba(232, 128, 120, 0.60);
    color: #ffd2cc;
}

/* Lean-paint path for weak signage devices */
.lean-paint #controlBar,
.lean-paint #audioPrompt,
.lean-paint .hud-btn,
.lean-paint #fullscreenToggle {
    -webkit-transition: none;
    transition: none;
}

.lean-paint #audioPrompt,
.lean-paint .hud-btn,
.lean-paint #fullscreenToggle {
    background: #141c2e;
    border-color: #4d5a76;
}

/* Bottom-right standard RCWeb QR panel, uniformly scaled */
#qrPanel {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 2;
    -webkit-transform: scale(0.42);
    transform: scale(0.42);
    -webkit-transform-origin: bottom right;
    transform-origin: bottom right;
}

/* Canonical four RCWeb QR panel rules (lean variant without shadows/animation) */
.rcRoomQrCodeLink,
.rcRoomQrCodeLink * {
    box-sizing: content-box;
}

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

.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;
    border-radius: 8px 8px 0 0;
}

.rcRoomQrCode {
    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;
    border-radius: 0 0 8px 8px;
}

/* Compact & narrow portrait viewport refinements */
@media screen and (max-width: 600px) {
    #controlBar {
        top: 10px;
        left: 10px;
        max-width: calc(100% - 68px);
    }

    #fullscreenToggle {
        top: 10px;
        right: 10px;
    }

    .hud-btn {
        height: 34px;
        padding: 0 9px;
        font-size: 11px;
        line-height: 32px;
    }

    #audioPrompt {
        top: 58px;
        font-size: 13px;
        padding: 8px 14px;
    }

    #qrPanel {
        right: 12px;
        bottom: 12px;
        -webkit-transform: scale(0.36);
        transform: scale(0.36);
    }
}

@media screen and (max-height: 560px) {
    #qrPanel {
        right: 12px;
        bottom: 12px;
        -webkit-transform: scale(0.36);
        transform: scale(0.36);
    }
}
