/* Journey XR viewer styles: responsive across 1920x1080, 960x540, 1080x1920 and 450x960,
   canonical RCWeb QR panel rules preserved from v/style.css, and lean-paint overrides. */

* {
    box-sizing: border-box;
}

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

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

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

#webgl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

#error-banner {
    position: fixed;
    top: 50%;
    left: 50%;
    -webkit-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    z-index: 60;
    max-width: 440px;
    padding: 18px 22px;
    background: #3f1422;
    border: 1px solid #f43f5e;
    border-radius: 14px;
    color: #ffe4e6;
    font-size: 15px;
    text-align: center;
}

/* Strict ES5 Compatibility Error & RCWeb Remote-Recovery Screen (circa-2015 CSS 3) */
.fallback-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    background: #0b071c;
    overflow-y: auto;
    padding: 24px 18px;
    text-align: center;
}

.fallback-card {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    width: 100%;
    max-width: 820px;
    margin: 6vh auto 0;
    padding: 24px 26px;
    background: #1a1026;
    border: 2px solid #f43f5e;
    border-radius: 18px;
    color: #fff1f2;
    text-align: left;
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.65);
}

.fallback-main {
    -webkit-flex: 1 1 auto;
    flex: 1 1 auto;
    min-width: 0;
    padding-right: 22px;
}

.fallback-head {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    margin-bottom: 14px;
}

.fallback-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: #ffffff;
    margin-right: 14px;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

.fallback-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #fda4af;
    margin-bottom: 4px;
}

.fallback-title {
    margin: 0;
    font-size: 26px;
    line-height: 1.15;
    color: #ffffff;
}

.fallback-reason {
    margin: 0 0 12px;
    padding: 10px 14px;
    background: #3b1122;
    border: 1px solid #fb7185;
    border-radius: 10px;
    font-size: 15px;
    line-height: 1.45;
    color: #ffe4e6;
    font-weight: 600;
}

.fallback-help {
    margin: 0 0 14px;
    font-size: 14px;
    line-height: 1.5;
    color: #e2e8f0;
}

.fallback-status {
    display: inline-block;
    padding: 8px 12px;
    background: #102a2e;
    border: 1px solid #2dd4bf;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: #99f6e4;
}

.fallback-qr-col {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-align-items: center;
    align-items: center;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
    width: 210px;
    padding-left: 20px;
    border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.fallback-qr-caption {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #99f6e4;
    margin-bottom: 8px;
    text-align: center;
}

@media (max-width: 720px) {
    .fallback-card {
        -webkit-flex-direction: column;
        flex-direction: column;
        margin-top: 2vh;
        padding: 18px 16px;
    }
    .fallback-main {
        padding-right: 0;
        margin-bottom: 16px;
    }
    .fallback-qr-col {
        width: 100%;
        padding-left: 0;
        padding-top: 14px;
        border-left: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.16);
    }
    .fallback-title {
        font-size: 21px;
    }
}

body.lean-paint .fallback-card {
    box-shadow: none;
}

/* Top-Left Telemetry HUD */
.hud-left {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 20;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    max-width: 310px;
    pointer-events: none;
}

.brand-pill {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    padding: 8px 12px 8px 9px;
    background: rgba(11, 10, 30, 0.78);
    border: 1px solid rgba(148, 163, 255, 0.28);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38);
}

.brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    margin-right: 10px;
    background: #ffffff;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

.brand-text {
    min-width: 0;
}

.brand-top {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
}

.brand-name {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #93c5fd;
    margin-right: 8px;
}

.mode-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(56, 242, 255, 0.18);
    color: #67e8f9;
    letter-spacing: 0.08em;
}

.mode-badge.is-vr {
    background: rgba(255, 79, 216, 0.26);
    color: #f9a8d4;
}

.world-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-card {
    margin-top: 8px;
    padding: 9px 12px;
    background: rgba(11, 10, 30, 0.74);
    border: 1px solid rgba(148, 163, 255, 0.22);
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.34);
}

.progress-meta {
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    -webkit-align-items: center;
    align-items: center;
    font-size: 11px;
    color: #cbd5e1;
    margin-bottom: 6px;
}

.world-sub {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
}

.world-timer {
    font-family: monospace;
    font-weight: 700;
    color: #38f2ff;
}

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

.progress-fill {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: #38f2ff;
    transition: width 120ms linear;
}

.stat-strip {
    margin-top: 6px;
    font-size: 11px;
    color: #94a3b8;
    font-family: monospace;
}

.stat-strip strong {
    color: #f8fafc;
}

.stat-dot {
    margin: 0 5px;
    opacity: 0.5;
}

/* Top-Right Action Bar */
.hud-right {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 25;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
}

.hud-btn {
    height: 38px;
    padding: 0 12px;
    margin-left: 6px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 255, 0.3);
    background: rgba(13, 12, 36, 0.82);
    color: #eef2ff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 140ms ease, border-color 140ms ease;
    white-space: nowrap;
}

.hud-btn:hover:not(:disabled) {
    background: rgba(34, 30, 78, 0.92);
    border-color: #38f2ff;
}

.hud-btn:disabled {
    opacity: 0.48;
    cursor: default;
}

.hud-btn.is-on {
    background: rgba(34, 211, 238, 0.22);
    border-color: #38f2ff;
    color: #e0f2fe;
}

.hud-btn-vr {
    background: #6d28d9;
    border-color: #c084fc;
    color: #ffffff;
}

.hud-btn-vr:hover:not(:disabled) {
    background: #7c3aed;
}

.hud-btn-vr.is-active {
    background: #db2777;
    border-color: #f9a8d4;
}

.hud-icon-btn {
    width: 38px;
    padding: 0;
    display: -webkit-inline-flex;
    display: inline-flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
}

.hud-icon-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.1;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hud-icon-btn .fs-exit,
.hud-icon-btn .menu-close-icon {
    display: none;
}

.hud-icon-btn.is-fullscreen .fs-enter,
.hud-icon-btn.is-open .menu-open-icon {
    display: none;
}

.hud-icon-btn.is-fullscreen .fs-exit,
.hud-icon-btn.is-open .menu-close-icon {
    display: inline;
}

.options-menu {
    position: absolute;
    top: 46px;
    right: 0;
    width: 268px;
    padding: 10px;
    background: rgba(11, 10, 30, 0.94);
    border: 1px solid rgba(148, 163, 255, 0.34);
    border-radius: 14px;
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.55);
}

.menu-row {
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: space-between;
    justify-content: space-between;
}

.menu-row .menu-item {
    -webkit-flex: 1 1 0;
    flex: 1 1 0;
    margin: 0 3px;
    padding: 0 6px;
    font-size: 11px;
}

.menu-sep {
    height: 1px;
    background: rgba(255, 255, 255, 0.14);
    margin: 9px 0;
}

.menu-section {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
}

.menu-section .menu-item {
    width: 100%;
    margin: 3px 0;
    text-align: left;
}

/* Centered World Entry Banner */
.world-banner {
    position: fixed;
    top: 26%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 18;
    max-width: 78%;
    text-align: center;
    pointer-events: none;
    padding: 12px 22px;
    border-radius: 16px;
    background: rgba(9, 8, 26, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.22);
    transition: opacity 420ms ease;
}

.banner-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.24em;
    color: #38f2ff;
}

.banner-title {
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
    margin-top: 4px;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.65);
}

.banner-sub {
    font-size: 14px;
    color: #dbeafe;
    margin-top: 3px;
}

/* Welcome & Canonical QR Panel (shown at the beginning of the journey!) */
.welcome-panel {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 30;
    width: calc(100% - 28px);
    max-width: 820px;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    padding: 18px 20px;
    border-radius: 20px;
    background: rgba(10, 10, 32, 0.84);
    border: 1px solid rgba(99, 179, 255, 0.42);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.62);
}

.welcome-main {
    -webkit-flex: 1 1 auto;
    flex: 1 1 auto;
    min-width: 0;
    padding-right: 18px;
}

.welcome-head {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    margin-bottom: 10px;
}

.welcome-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    margin-right: 13px;
    background: #ffffff;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

.welcome-eyebrow {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: #38f2ff;
    text-transform: uppercase;
}

.welcome-title {
    margin: 2px 0 0 0;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.15;
    color: #ffffff;
}

.welcome-desc {
    margin: 0 0 8px 0;
    font-size: 13.5px;
    line-height: 1.46;
    color: #e2e8f0;
}

.welcome-desc-sub {
    color: #cbd5e1;
    font-size: 12.5px;
    margin-bottom: 12px;
}

.welcome-actions {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.cta-btn {
    height: 42px;
    padding: 0 18px;
    margin: 0 10px 6px 0;
    border-radius: 11px;
    border: 1px solid transparent;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 120ms ease, background-color 140ms ease;
}

.cta-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.cta-vr {
    background: #7c3aed;
    border-color: #c4b5fd;
    color: #ffffff;
}

.cta-vr:hover:not(:disabled) {
    background: #8b5cf6;
}

.cta-vr:disabled {
    background: rgba(124, 58, 237, 0.32);
    border-color: rgba(196, 181, 253, 0.35);
    color: rgba(255, 255, 255, 0.72);
    cursor: default;
}

.cta-primary {
    background: #0ea5e9;
    border-color: #7dd3fc;
    color: #061224;
}

.cta-primary:hover {
    background: #38bdf8;
}

.welcome-hints {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    font-size: 11px;
    line-height: 1.45;
    color: #94a3b8;
}

.welcome-hints strong {
    color: #bae6fd;
}

.welcome-qr-col {
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-align-items: center;
    align-items: center;
    padding-left: 16px;
    border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.welcome-qr-caption {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.15em;
    color: #fde047;
    margin-bottom: 8px;
    text-align: center;
}

.qr-panel-wrap {
    width: 166px;
    min-height: 214px;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
}

.welcome-room-status {
    margin-top: 8px;
    font-size: 11px;
    font-family: monospace;
    color: #93c5fd;
    text-align: center;
}

/* =========================================================================
   CANONICAL RCWeb QR PANEL RULES (copied from v/style.css without altering
   white frame, black labels, monospace text, spacing, corners or 150x150 QR)
   ========================================================================= */
.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;
    transition: opacity 1s ease;
    text-decoration: none;
    box-shadow: 0 0 32px #000;
    transform-origin: center;
    transform: scale(1);
    animation: pop-in 500ms ease-in-out forwards;
}

@keyframes pop-in {
    0% {
        transform: scale(0.5);
    }
    66% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.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;
}

/* =========================================================================
   RESPONSIVE TARGET VIEWPORTS: 1920x1080, 960x540, 1080x1920, 450x960
   ========================================================================= */
@media screen and (max-width: 980px), screen and (max-height: 600px) {
    .welcome-panel {
        bottom: 14px;
        padding: 14px 16px;
        max-width: 760px;
    }
    .welcome-icon {
        width: 44px;
        height: 44px;
    }
    .welcome-title {
        font-size: 20px;
    }
    .welcome-desc {
        font-size: 12.5px;
    }
    .welcome-desc-sub {
        font-size: 11.5px;
        margin-bottom: 9px;
    }
    .welcome-hints {
        font-size: 10.5px;
    }
    .qr-panel-wrap {
        width: 144px;
        min-height: 186px;
    }
    .qr-panel-wrap .rcRoomQrCodeLink {
        transform: scale(0.84);
        animation: none;
    }
}

/* Portrait & Narrow Viewports (e.g. 1080x1920 and 450x960) */
@media screen and (max-width: 700px) {
    .hud-left {
        top: 10px;
        left: 10px;
        max-width: calc(100% - 170px);
    }
    .hud-right {
        top: 10px;
        right: 10px;
    }
    .hud-btn {
        height: 34px;
        padding: 0 8px;
        font-size: 11px;
        margin-left: 4px;
    }
    .hud-icon-btn {
        width: 34px;
    }
    #audio-btn {
        display: none;
    }
    .welcome-panel {
        -webkit-flex-direction: column;
        flex-direction: column;
        bottom: 12px;
        max-height: calc(100vh - 126px);
        overflow-y: auto;
        padding: 14px;
    }
    .welcome-main {
        padding-right: 0;
        margin-bottom: 10px;
    }
    .welcome-qr-col {
        width: 100%;
        padding-left: 0;
        padding-top: 10px;
        border-left: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.14);
    }
    .qr-panel-wrap {
        width: 140px;
        min-height: 178px;
    }
    .qr-panel-wrap .rcRoomQrCodeLink {
        transform: scale(0.8);
        animation: none;
    }
    .welcome-hints {
        display: none;
    }
    .banner-title {
        font-size: 21px;
    }
}

/* =========================================================================
   LEAN-PAINT MODE (?lean=1) for weak signage / low-GPU devices
   Flat solid backgrounds, zero costly shadows, animations, or filters.
   ========================================================================= */
body.lean-paint .brand-pill,
body.lean-paint .progress-card,
body.lean-paint .hud-btn,
body.lean-paint .options-menu,
body.lean-paint .world-banner,
body.lean-paint .welcome-panel {
    background: #0e1028;
    box-shadow: none;
    filter: none;
    transition: none;
}

body.lean-paint .rcRoomQrCodeLink {
    box-shadow: none;
    animation: none;
    transition: none;
}

body.lean-paint .banner-title {
    text-shadow: none;
}

.no-script {
    padding: 24px;
    text-align: center;
    color: #ffffff;
}
