:root {
    --bg-0: #04060b;
    --bg-1: #0a0f18;
    --panel: rgba(10, 15, 24, 0.82);
    --panel-border: rgba(255, 186, 110, 0.22);
    --text: #f3ecdf;
    --muted: #a99b86;
    --accent: #ffb35c;
    --cool: #7fd8ff;
    --edge-gap: 22px;
    --left-column-width: 360px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    background: var(--bg-0);
    color: var(--text);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.stage {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 0;
}

.stage canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.vignette {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 42%, rgba(0, 0, 0, 0.55) 82%, rgba(0, 0, 0, 0.78) 100%);
}

.hud-shell {
    position: fixed;
    top: var(--edge-gap);
    left: var(--edge-gap);
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 360px;
    max-width: 92vw;
    width: min(var(--left-column-width), calc(100vw - (var(--edge-gap) * 2)));
    transform-origin: top left;
}

.brand-card,
.hint-card {
    border: 1px solid var(--panel-border);
    border-radius: 22px;
    background: var(--panel);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 22px 44px rgba(0, 0, 0, 0.46);
}

.brand-card {
    position: relative;
    padding: 18px 18px 16px;
}

.room-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 5px 10px;
    border: 1px solid rgba(255, 186, 110, 0.28);
    border-radius: 999px;
    color: var(--accent);
    font-family: monospace;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    background: rgba(255, 186, 110, 0.08);
}

.eyebrow,
.info-label {
    color: var(--cool);
    font-size: 0.7rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.brand-card h1 {
    margin: 8px 0 6px;
    font-size: 2.6rem;
    line-height: 0.94;
    letter-spacing: 0.04em;
}

.brand-card p {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.42;
}

.info-row {
    display: flex;
    gap: 8px;
}

.info-chip {
    flex: 1 1 0;
    min-width: 0;
    padding: 9px 11px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
}

.info-value {
    display: block;
    margin-top: 5px;
    font-size: 1.16rem;
    font-weight: 700;
}

.status-row {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: 13px;
    padding-top: 13px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.status-light {
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #6b5b45;
    box-shadow: 0 0 12px rgba(107, 91, 69, 0.7);
    transition: background 220ms ease, box-shadow 220ms ease;
}

.status-light.live {
    background: #6bf0a5;
    box-shadow: 0 0 14px rgba(107, 240, 165, 0.8);
}

.status-copy {
    min-width: 0;
}

.status-copy strong {
    display: block;
    font-size: 0.98rem;
}

.status-copy span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.82rem;
}

.hint-card {
    padding: 12px 16px;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.6;
}

.hint-key {
    display: inline-block;
    margin-right: 6px;
    padding: 2px 8px;
    border: 1px solid rgba(127, 216, 255, 0.28);
    border-radius: 999px;
    color: var(--cool);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hint-key + .hint-key,
.hint-card .hint-key:nth-of-type(2) {
    margin-left: 8px;
}

.compass-shell {
    position: fixed;
    right: var(--edge-gap);
    bottom: var(--edge-gap);
    z-index: 3;
    text-align: center;
}

.compass {
    position: relative;
    width: 118px;
    height: 118px;
    margin: 0 auto;
    border: 1px solid var(--panel-border);
    border-radius: 50%;
    background: var(--panel);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.46), inset 0 0 26px rgba(0, 0, 0, 0.5);
}

.compass-dial,
.compass-needle-wrap {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.compass-needle-wrap {
    transition: transform 140ms linear;
}

.compass-mark {
    position: absolute;
    width: 20px;
    margin-left: -10px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.mark-n {
    top: 9px;
    left: 50%;
    color: var(--accent);
}

.mark-s {
    bottom: 9px;
    left: 50%;
}

.mark-e {
    top: 50%;
    left: 88%;
    margin-top: -9px;
}

.mark-w {
    top: 50%;
    left: 12%;
    margin-top: -9px;
}

.compass-needle {
    display: block;
    position: absolute;
    top: 24px;
    left: 50%;
    width: 0;
    height: 0;
    margin-left: -9px;
    border-right: 9px solid transparent;
    border-bottom: 34px solid var(--accent);
    border-left: 9px solid transparent;
    opacity: 0.92;
}

.compass-label {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.8rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.qr-shell {
    position: fixed;
    left: var(--edge-gap);
    bottom: var(--edge-gap);
    z-index: 3;
    transform-origin: bottom left;
    transform: scale(0.82);
}

.status-toast {
    position: fixed;
    top: 26px;
    left: 50%;
    z-index: 4;
    padding: 12px 24px;
    border: 1px solid var(--panel-border);
    border-radius: 999px;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    background: rgba(10, 15, 24, 0.9);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.42);
    opacity: 0;
    transform: translate(-50%, -14px);
    transition: opacity 260ms ease, transform 260ms ease;
    pointer-events: none;
}

.status-toast.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.level-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 6;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(3, 5, 9, 0.72);
}

.level-overlay.visible {
    display: flex;
}

.level-card {
    width: 520px;
    max-width: 92vw;
    width: min(520px, calc(100vw - 48px));
    padding: 34px 38px;
    border: 1px solid var(--panel-border);
    border-radius: 28px;
    text-align: center;
    background: rgba(10, 15, 24, 0.94);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
}

.level-eyebrow {
    color: var(--accent);
    font-size: 0.78rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
}

.level-card h2 {
    margin: 12px 0 18px;
    font-size: 2.6rem;
    line-height: 1.04;
}

.level-stats {
    display: flex;
    justify-content: center;
    gap: 26px;
    color: var(--muted);
    font-size: 1.02rem;
}

.level-stats strong {
    display: block;
    margin-top: 6px;
    color: var(--text);
    font-size: 1.5rem;
}

.level-countdown {
    margin-top: 22px;
    color: var(--muted);
    font-size: 0.95rem;
    letter-spacing: 0.06em;
}

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

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

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

@media (max-width: 1100px) {
    :root {
        --edge-gap: 16px;
        --left-column-width: 310px;
    }

    .brand-card h1 {
        font-size: 2.1rem;
    }

    .qr-shell {
        transform: scale(0.66);
    }

    .compass {
        width: 96px;
        height: 96px;
    }

    .compass-needle {
        top: 20px;
        border-bottom-width: 28px;
    }
}

@media (max-width: 720px), (max-height: 560px) {
    .hud-shell {
        transform: scale(0.86);
    }

    .hint-card {
        display: none;
    }

    .qr-shell {
        transform: scale(0.56);
    }

    .compass-shell {
        transform: scale(0.82);
        transform-origin: bottom right;
    }
}

/* Lean paint path for weak devices: flat panels, no blur or heavy shadows. */

.lean-paint .brand-card,
.lean-paint .hint-card,
.lean-paint .compass,
.lean-paint .status-toast,
.lean-paint .level-card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    background: #0a0f18;
}

.lean-paint .vignette {
    display: none;
}
