/* Pipe Dream display styles — circa-2015 CSS 3 with WebKit prefixes,
   lean-paint overrides and canonical RCWeb QR panel rules. */
*,
*:before,
*:after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #07050c;
    color: #f3effa;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    -webkit-user-select: none;
    user-select: none;
}

#webgl-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
    cursor: -webkit-grab;
}

#webgl-canvas:active {
    cursor: grabbing;
    cursor: -webkit-grabbing;
}

.hidden,
[hidden] {
    display: none !important;
}

/* Loading Pill */
#loading-pill {
    position: fixed;
    top: 50%;
    left: 50%;
    -webkit-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    z-index: 30;
    width: 320px;
    max-width: 84%;
    padding: 14px 18px;
    border-radius: 6px;
    background: rgba(14, 10, 24, 0.92);
    border: 1px solid rgba(255, 210, 102, 0.35);
    text-align: center;
}

.progress-track {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.14);
    overflow: hidden;
    margin-bottom: 8px;
}

#progress-bar {
    width: 0%;
    height: 100%;
    border-radius: 3px;
    background: #f5b942;
    -webkit-transition: width 0.15s ease-out;
    transition: width 0.15s ease-out;
}

#loading-status {
    font-size: 13px;
    color: #c8bddb;
}

#error-banner {
    position: fixed;
    top: 42%;
    left: 8%;
    right: 8%;
    z-index: 35;
    max-width: 560px;
    margin: 0 auto;
    padding: 18px 20px;
    border-radius: 6px;
    background: #2b141a;
    border: 1px solid #8a4252;
    color: #fce8ec;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
}

/* Top HUD & Banners */
#top-stack {
    position: fixed;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 20;
    pointer-events: none;
}

#banner-stack {
    margin-top: 8px;
    text-align: center;
    pointer-events: none;
}

#unmute-pill {
    display: inline-block;
    pointer-events: auto;
    border: 1px solid rgba(255, 215, 106, 0.55);
    border-radius: 6px;
    padding: 7px 14px;
    margin-bottom: 6px;
    background: rgba(20, 13, 34, 0.92);
    color: #ffe285;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    max-width: 100%;
}

#unmute-pill:hover {
    background: rgba(36, 24, 58, 0.96);
}

.hud-fade {
    -webkit-transition: opacity 0.35s ease;
    transition: opacity 0.35s ease;
}

.hud-idle {
    opacity: 0;
    pointer-events: none;
}

#top-hud {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    pointer-events: none;
}

.badge-group,
.cam-pills {
    pointer-events: auto;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    padding: 5px 8px;
    margin-bottom: 6px;
    border-radius: 6px;
    background: rgba(14, 10, 24, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.badge-group > * {
    margin-right: 6px;
}

.badge-group > *:last-child {
    margin-right: 0;
}

.cam-pills {
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    max-width: 100%;
}

.title-pill {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: #ffd76a;
    padding: 0 4px 0 6px;
    white-space: nowrap;
}

.info-btn {
    width: 22px;
    height: 22px;
    border: 1px solid rgba(255, 215, 106, 0.45);
    border-radius: 4px;
    background: rgba(255, 215, 106, 0.14);
    color: #ffe285;
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    font-weight: 700;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
    -webkit-transition: background-color 0.15s, border-color 0.15s, color 0.15s;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.info-btn:hover {
    background: rgba(255, 215, 106, 0.28);
    border-color: rgba(255, 215, 106, 0.78);
    color: #fff6cf;
}

.section-pill {
    font-size: 12px;
    color: #ddd4f0;
    padding: 2px 9px;
    border-radius: 4px;
    background: rgba(139, 92, 246, 0.3);
    border: 1px solid rgba(167, 139, 250, 0.4);
    white-space: nowrap;
}

.fps-pill {
    font-size: 11px;
    font-family: monospace;
    color: #86efac;
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(22, 101, 52, 0.42);
    white-space: nowrap;
}

.cam-btn {
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.05);
    color: #cfc6e2;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    padding: 5px 10px;
    margin: 2px;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    text-align: center;
    -webkit-transition: background-color 0.15s, color 0.15s, border-color 0.15s;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.cam-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.cam-btn.active {
    background: #e9a533;
    color: #160e04;
    font-weight: 600;
}

#resume-auto-btn {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 22;
    border: 1px solid rgba(255, 215, 106, 0.45);
    background: rgba(20, 13, 34, 0.88);
    color: #ffe285;
    font-family: inherit;
    font-weight: 600;
    font-size: 12px;
    line-height: 1;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    -webkit-transition: background-color 0.15s, border-color 0.15s;
    transition: background-color 0.15s, border-color 0.15s;
}

#resume-auto-btn:hover {
    background: rgba(38, 25, 62, 0.96);
    border-color: rgba(255, 215, 106, 0.78);
}

.free-orbit-active #top-hud {
    padding-right: 146px;
}

/* Bottom Transport HUD — always leaves room for bottom-right QR panel */
#bottom-hud {
    position: fixed;
    left: 16px;
    right: 104px;
    bottom: 14px;
    z-index: 15;
    max-width: 860px;
    margin: 0 auto;
    padding: 10px 14px 9px;
    border-radius: 6px;
    background: rgba(14, 10, 24, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.timeline-row {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    margin-bottom: 8px;
}

.time-label {
    font-size: 12px;
    font-family: monospace;
    color: #d8d0e8;
    min-width: 38px;
    text-align: center;
}

.scrubber-wrap {
    position: relative;
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    margin: 0 10px;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
}

#chapter-ticks {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    pointer-events: none;
}

.chapter-tick {
    position: absolute;
    top: 50%;
    width: 2px;
    height: 10px;
    -webkit-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    background: rgba(255, 215, 106, 0.55);
    border-radius: 1px;
}

#timeline {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 5px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    cursor: pointer;
}

#timeline::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 14px;
    border-radius: 3px;
    background: #ffd76a;
    cursor: pointer;
}

.controls-row {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    justify-content: space-between;
}

.controls-left,
.controls-right {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
}

.controls-left > *,
.controls-right > * {
    margin-right: 8px;
}

.controls-left > *:last-child,
.controls-right > *:last-child {
    margin-right: 0;
}

.controls-center {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    text-align: center;
    padding: 0 8px;
}

.hotkey-hint {
    font-size: 11px;
    color: #8f83a8;
}

.icon-btn,
.text-btn {
    border: 0;
    background: rgba(255, 255, 255, 0.1);
    color: #f3effa;
    font-family: inherit;
    border-radius: 4px;
    cursor: pointer;
    display: inline-block;
    text-align: center;
    -webkit-transition: background-color 0.15s;
    transition: background-color 0.15s;
}

.icon-btn {
    width: 34px;
    height: 34px;
    line-height: 34px;
    font-size: 15px;
}

.icon-btn.primary {
    width: 38px;
    height: 36px;
    line-height: 36px;
    background: #f5b942;
    color: #160e04;
    font-weight: 700;
}

.text-btn {
    height: 34px;
    line-height: 34px;
    padding: 0 11px;
    font-size: 12px;
    font-weight: 600;
}

.text-btn.active {
    background: #e9a533;
    color: #160e04;
}

.icon-btn:hover,
.text-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.text-btn.active:hover {
    background: #f5b942;
    color: #160e04;
}

.icon-btn.primary:hover {
    background: #ffd16b;
}

#volume-slider {
    width: 74px;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.22);
    cursor: pointer;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 12px;
    border-radius: 2px;
    background: #e9e2f8;
}

/* Info Modal */
#info-modal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    padding: 16px;
    background: rgba(5, 3, 10, 0.8);
}

.info-dialog {
    width: 600px;
    max-width: 100%;
    max-height: 86vh;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-flex-direction: column;
    flex-direction: column;
    border-radius: 6px;
    background: #140e22;
    border: 1px solid rgba(255, 215, 106, 0.35);
    overflow: hidden;
    -webkit-user-select: text;
    user-select: text;
}

.info-header {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
}

.info-header-brand {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
}

.info-logo {
    height: 36px;
    width: auto;
    margin-right: 12px;
}

.info-header h2 {
    font-size: 17px;
    letter-spacing: 0.2em;
    color: #ffd76a;
    line-height: 1.2;
}

.info-tagline {
    font-size: 12px;
    color: #b7aacf;
}

.info-close-btn {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: #e6dff5;
    font-size: 14px;
    cursor: pointer;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

.info-close-btn:hover {
    background: rgba(255, 255, 255, 0.18);
}

.info-body {
    padding: 16px;
    overflow-y: auto;
}

.info-section {
    margin-bottom: 14px;
}

.info-section:last-child {
    margin-bottom: 0;
}

.info-section h3 {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #ffe285;
    margin-bottom: 5px;
}

.info-section p {
    font-size: 13px;
    line-height: 1.55;
    color: #d6cde8;
}

.info-keys {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    font-size: 12px;
    color: #c7bddb;
}

.info-keys span {
    margin: 0 14px 8px 0;
}

.info-keys kbd {
    display: inline-block;
    padding: 1px 5px;
    margin-right: 4px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
}

.info-footer {
    padding: 10px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 11px;
    color: #8f82a8;
    background: rgba(0, 0, 0, 0.26);
}

/* Lean-paint path for weak signage devices */
.lean-paint #progress-bar,
.lean-paint .hud-fade,
.lean-paint .info-btn,
.lean-paint .cam-btn,
.lean-paint .icon-btn,
.lean-paint .text-btn {
    -webkit-transition: none;
    transition: none;
}

.lean-paint #loading-pill,
.lean-paint #unmute-pill,
.lean-paint .badge-group,
.lean-paint .cam-pills,
.lean-paint #resume-auto-btn,
.lean-paint #bottom-hud {
    background: #140e22;
    border-color: #463c63;
}

/* Bottom-right standard RCWeb QR panel, uniformly scaled */
#qrPanel {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 25;
    -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;
}

/* Hide QR code panel on smartphones and let bottom transport use full width */
body.is-smartphone #qrPanel {
    display: none !important;
}

body.is-smartphone #bottom-hud {
    left: 10px;
    right: 10px;
}

@media screen and (pointer: coarse) and (max-width: 520px),
       screen and (pointer: coarse) and (max-height: 520px) {
    #qrPanel {
        display: none !important;
    }

    #bottom-hud {
        left: 10px;
        right: 10px;
    }
}

/* Responsive layouts covering 1920x1080, 960x540, 1080x1920 and 450x960 */
@media screen and (max-width: 900px) {
    .controls-center {
        display: none;
    }
}

@media screen and (max-width: 720px) {
    #top-stack {
        top: 10px;
        left: 10px;
        right: 10px;
    }

    #resume-auto-btn {
        top: 10px;
        right: 10px;
        padding: 9px 11px;
    }

    .free-orbit-active #top-hud {
        padding-right: 0;
    }

    .cam-pills {
        width: 100%;
        padding: 4px;
    }

    .cam-btn {
        width: 31%;
        padding: 6px 4px;
        font-size: 11px;
    }

    #bottom-hud {
        left: 10px;
        right: 84px;
        bottom: 12px;
        padding: 8px 10px;
    }

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

@media screen and (max-width: 520px) {
    #volume-slider {
        display: none;
    }

    .section-pill {
        display: none;
    }
}

@media screen and (max-height: 560px) {
    #bottom-hud {
        right: 86px;
        bottom: 10px;
        padding: 8px 12px;
    }

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