.cbv-app,
.cbv-app * {
    box-sizing: border-box;
}

.cbv-app {
    --cbv-ink: #eef6f1;
    --cbv-muted: #aebdb6;
    --cbv-black: #070a09;
    --cbv-panel: rgba(10, 17, 15, 0.94);
    --cbv-green: #65ed9f;
    --cbv-green-dark: #163d2b;
    --cbv-amber: #ffb84d;
    --cbv-red: #ff655f;
    --cbv-blue: #7ad8ff;
    --cbv-paper: #e9dfc4;
    --cbv-paper-ink: #171812;
    --cbv-line: rgba(255, 255, 255, 0.16);
    position: relative;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    color: var(--cbv-ink);
    background: #050706;
    border: 1px solid #26322d;
    border-radius: 14px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    isolation: isolate;
}

.cbv-app:fullscreen,
.cbv-app:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    border: 0;
    border-radius: 0;
}

.cbv-app [hidden] {
    display: none !important;
}

.cbv-app button,
.cbv-app input,
.cbv-app select,
.cbv-app textarea {
    font: inherit;
}

.cbv-app button {
    min-height: 44px;
    cursor: pointer;
}

.cbv-app button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.cbv-app button:focus-visible,
.cbv-app input:focus-visible,
.cbv-app select:focus-visible,
.cbv-app textarea:focus-visible,
.cbv-app summary:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.cbv-shell {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: min(780px, calc(100vh - 40px));
    background:
        radial-gradient(circle at 22% 0%, rgba(54, 110, 84, 0.16), transparent 34%),
        var(--cbv-black);
}

.cbv-app:fullscreen .cbv-shell,
.cbv-app:-webkit-full-screen .cbv-shell {
    height: 100vh;
    min-height: 100vh;
}

.cbv-toolbar {
    z-index: 30;
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    min-height: 62px;
    padding: 8px 14px;
    background: linear-gradient(180deg, #15211c, #0a100e);
    border-bottom: 1px solid #2b3b34;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
}

.cbv-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: #dce9e2;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.cbv-brand > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cbv-brand em {
    margin-left: 4px;
    padding: 2px 5px;
    color: #211708;
    background: var(--cbv-amber);
    border-radius: 3px;
    font-size: 0.62rem;
    font-style: normal;
    letter-spacing: 0.08em;
}

.cbv-brand-mark {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 46px;
    height: 34px;
    color: var(--cbv-green);
    background: #06110c;
    border: 1px solid #347b54;
    border-radius: 4px;
    box-shadow: inset 0 0 14px rgba(101, 237, 159, 0.12);
    font-family: "Courier New", monospace;
    letter-spacing: 0.06em;
}

.cbv-hud {
    display: flex;
    align-items: stretch;
    gap: 7px;
}

.cbv-hud-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 82px;
    padding: 4px 10px;
    text-align: center;
    background: rgba(0, 0, 0, 0.32);
    border: 1px solid var(--cbv-line);
    border-radius: 6px;
}

.cbv-hud-item small {
    color: var(--cbv-muted);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.cbv-hud-item strong {
    color: var(--cbv-green);
    font-family: "Courier New", monospace;
    font-size: 1rem;
    line-height: 1.15;
}

.cbv-hud-item.is-warning strong,
.cbv-security-hud:not(.is-safe) strong {
    color: var(--cbv-red);
    animation: cbv-pulse-text 1s steps(2, end) infinite;
}

.cbv-security-hud.is-safe strong {
    color: var(--cbv-green);
}

.cbv-toolbar-actions {
    display: flex;
    gap: 6px;
}

.cbv-icon-button,
.cbv-modal-close {
    display: grid;
    place-items: center;
    width: 44px;
    min-width: 44px;
    padding: 0;
    color: var(--cbv-ink);
    background: #1c2923;
    border: 1px solid #3a5147;
    border-radius: 7px;
}

.cbv-inventory-button {
    width: auto;
    min-width: 44px;
    padding: 0 12px;
    color: #07110c;
    background: var(--cbv-green);
    border-color: #a9f8c8;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.cbv-icon-button:hover,
.cbv-modal-close:hover {
    color: #08100c;
    background: var(--cbv-green);
}

.cbv-stage {
    position: relative;
    min-width: 0;
    min-height: 660px;
    overflow: auto;
    outline: none;
}

.cbv-mission-footer {
    position: absolute;
    z-index: 90;
    left: 50%;
    bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    transform: translateX(-50%);
    color: #07110c;
    background: #bfffd5;
    border: 2px solid #5fdc91;
    border-radius: 7px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.52);
    font-family: "Courier New", monospace;
    pointer-events: none;
}

.cbv-mission-footer small {
    font-weight: 900;
    letter-spacing: 0.08em;
}

.cbv-mission-footer strong {
    font-size: 1.25rem;
}

.cbv-mission-footer.is-warning {
    color: #fff;
    background: #9f1f1a;
    border-color: #ff8983;
}

.cbv-mission-footer.is-critical {
    animation: cbv-timer-flash 0.85s steps(2, end) infinite;
}

.cbv-scene {
    position: relative;
    width: 100%;
    min-height: 660px;
    overflow: hidden;
}

/* Mode selection */
.cbv-mode-scene {
    display: grid;
    place-items: center;
    padding: clamp(24px, 6vw, 72px);
    background:
        radial-gradient(circle at 50% 0%, rgba(101, 237, 159, 0.17), transparent 36%),
        linear-gradient(145deg, #060907, #132019);
}

.cbv-mode-panel {
    width: min(960px, 100%);
    text-align: center;
}

.cbv-mode-panel h1 {
    margin: 0 0 12px;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1;
}

.cbv-mode-panel > p:not(.cbv-kicker) {
    max-width: 720px;
    margin: 0 auto 30px;
    color: #c6d3cc;
}

.cbv-mode-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(18px, 4vw, 34px);
}

.cbv-mode-card {
    display: grid;
    gap: 12px;
    padding: 12px 12px 18px;
    color: #f5fff8;
    background: #101814;
    border: 2px solid #40544a;
    border-radius: 10px;
    overflow: hidden;
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: 0.05em;
}

.cbv-mode-card:hover {
    border-color: var(--cbv-green);
    transform: translateY(-3px);
}

.cbv-mode-card img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 5px;
}

.cbv-image-scene {
    display: flex;
    align-items: center;
    padding: clamp(22px, 5vw, 72px);
    background: #080b0a;
}

.cbv-scene-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
}

.cbv-scene-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(2, 5, 4, 0.88) 0%, rgba(2, 5, 4, 0.52) 48%, rgba(2, 5, 4, 0.12) 76%);
}

.cbv-agent-scene .cbv-scene-shade,
.cbv-drain-scene .cbv-scene-shade {
    background: linear-gradient(90deg, rgba(2, 5, 4, 0.88), rgba(2, 5, 4, 0.28) 68%, rgba(2, 5, 4, 0.08));
}

.cbv-story-card {
    position: relative;
    z-index: 3;
    width: min(570px, 100%);
    padding: clamp(24px, 4vw, 46px);
    background: var(--cbv-panel);
    border: 1px solid rgba(120, 171, 145, 0.34);
    border-left: 4px solid var(--cbv-green);
    border-radius: 10px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(8px);
}

.cbv-story-left {
    margin-right: auto;
}

.cbv-story-card h1,
.cbv-story-card h2,
.cbv-paper-panel h2,
.cbv-modal-card h2,
.cbv-room-heading h2,
.cbv-success-card h2,
.cbv-failure-card h2,
.cbv-breathe-card h2 {
    margin: 0 0 14px;
    color: inherit;
    font-size: clamp(1.7rem, 4vw, 3.2rem);
    line-height: 1.04;
    letter-spacing: -0.035em;
}

.cbv-story-card h2,
.cbv-modal-card h2,
.cbv-paper-panel h2,
.cbv-breathe-card h2 {
    font-size: clamp(1.55rem, 3vw, 2.35rem);
}

.cbv-story-card p,
.cbv-modal-card p,
.cbv-paper-panel p {
    margin: 0 0 14px;
}

.cbv-story-card blockquote,
.cbv-clock-note {
    margin: 20px 0;
    padding: 14px 16px;
    color: #fff7df;
    background: rgba(255, 184, 77, 0.1);
    border-left: 4px solid var(--cbv-amber);
    font-size: 1.08rem;
    font-weight: 650;
}

.cbv-coordinate,
.cbv-kicker {
    margin-bottom: 9px !important;
    color: var(--cbv-green);
    font-size: 0.73rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.cbv-phone-ringing {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 24px !important;
    color: #fff;
    font-weight: 750;
}

.cbv-phone-ringing span {
    color: var(--cbv-green);
    animation: cbv-ring 1.1s ease-in-out infinite;
}

.cbv-phone-black {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    padding: 10px 12px;
    color: #f4f7f5;
    background: #0a0b0a;
    border: 1px solid #333a36;
    border-radius: 6px;
    font-size: 0.82rem;
}

.cbv-phone-black span {
    width: 26px;
    height: 38px;
    background: #000;
    border: 2px solid #737a76;
    border-radius: 5px;
    box-shadow: inset 0 0 0 2px #111;
}

.cbv-primary,
.cbv-secondary,
.cbv-danger,
.cbv-text-button,
.cbv-choice,
.cbv-room-object-list button,
.cbv-lock-button,
.cbv-tool,
.cbv-drawer-buttons button,
.cbv-number-choices button,
.cbv-hint-buttons button,
.cbv-lever-buttons button,
.cbv-keypad button,
.cbv-dial-number {
    appearance: none;
    border-radius: 6px;
    transition: transform 140ms ease, border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.cbv-primary,
.cbv-secondary,
.cbv-danger {
    padding: 11px 18px;
    border: 1px solid transparent;
    font-weight: 800;
}

.cbv-primary {
    color: #07110c;
    background: var(--cbv-green);
    border-color: #8ff7ba;
    box-shadow: 0 5px 18px rgba(101, 237, 159, 0.2);
}

.cbv-primary:hover:not(:disabled) {
    background: #91f6bc;
    transform: translateY(-1px);
}

.cbv-secondary {
    color: var(--cbv-ink);
    background: #1b2822;
    border-color: #42584e;
}

.cbv-secondary:hover:not(:disabled) {
    border-color: var(--cbv-green);
}

.cbv-danger {
    color: #fff;
    background: #9b2522;
    border-color: #f26661;
}

.cbv-text-button {
    padding: 8px 4px;
    color: var(--cbv-blue);
    background: transparent;
    border: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cbv-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
}

.cbv-small {
    color: var(--cbv-muted);
    font-size: 0.82rem;
}

.cbv-waveform {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 62px;
    margin: 15px 0;
    color: var(--cbv-green);
}

.cbv-waveform i {
    width: 5px;
    height: 20%;
    background: currentColor;
    border-radius: 5px;
    box-shadow: 0 0 14px currentColor;
    animation: cbv-wave 0.8s ease-in-out infinite alternate;
}

.cbv-waveform i:nth-child(2),
.cbv-waveform i:nth-child(6) { animation-delay: -0.55s; }
.cbv-waveform i:nth-child(3),
.cbv-waveform i:nth-child(5) { animation-delay: -0.25s; }
.cbv-waveform i:nth-child(4) { animation-delay: -0.7s; }

.cbv-transcript {
    max-height: 220px;
    overflow: auto;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--cbv-line);
    border-radius: 5px;
}

.cbv-transcript summary {
    cursor: pointer;
    color: var(--cbv-blue);
    font-weight: 750;
}

.cbv-transcript p {
    margin: 12px 0 2px;
    color: #d9e5df;
    font-size: 0.92rem;
}

/* The travel sequence is generated in CSS, so the camera direction stays intentional. */
.cbv-descent {
    display: grid;
    place-items: center;
    color: #fff;
    background: #010202;
}

.cbv-tunnel {
    position: absolute;
    inset: 0;
    overflow: hidden;
    perspective: 700px;
    background:
        radial-gradient(ellipse at 50% 46%, rgba(124, 146, 129, 0.2), transparent 32%),
        #020303;
}

.cbv-tunnel::before {
    content: "DESCENDING  ↓";
    position: absolute;
    z-index: 8;
    top: 7%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 11px;
    color: rgba(210, 234, 220, 0.9);
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(210, 234, 220, 0.24);
    border-radius: 4px;
    font-size: 0.69rem;
    font-weight: 900;
    letter-spacing: 0.16em;
}

.cbv-stair-flight {
    position: absolute;
    left: 14%;
    right: 14%;
    bottom: -18%;
    height: 112%;
    transform: rotateX(56deg) translateY(0) scale(1.08);
    transform-origin: 50% 100%;
    background:
        repeating-linear-gradient(to top, #191c1a 0 24px, #596058 25px 28px, #090b0a 29px 42px),
        linear-gradient(#101210, #3b403b);
    border-left: 7px solid #50554f;
    border-right: 7px solid #50554f;
    box-shadow: inset 0 0 70px #000, 0 0 80px #000;
    transition: transform 1.3s ease-in-out, opacity 0.8s ease;
    animation: cbv-stairs-descend 1.25s linear infinite;
}

.cbv-side-walls {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(75deg, #252823 0 22%, transparent 22% 78%, #252823 78%),
        repeating-linear-gradient(90deg, transparent 0 70px, rgba(112, 117, 108, 0.09) 71px 74px);
    box-shadow: inset 0 0 120px 55px #000;
}

.cbv-torch-beam {
    position: absolute;
    z-index: 4;
    inset: 0;
    background: radial-gradient(ellipse at 50% 62%, rgba(240, 239, 204, 0.45) 0%, rgba(216, 224, 194, 0.12) 26%, transparent 60%);
    mix-blend-mode: screen;
    animation: cbv-torch 2.8s ease-in-out infinite alternate;
}

.cbv-black-wall {
    position: absolute;
    z-index: 5;
    inset: 0;
    opacity: 0;
    background: radial-gradient(circle at 50% 45%, #171918, #000 56%);
    transition: opacity 1.2s ease;
}

.cbv-descent[data-phase="3"] .cbv-stair-flight {
    opacity: 0.15;
    transform: rotateX(80deg) translateY(-30%) scale(0.66);
}

.cbv-descent[data-phase="3"] .cbv-tunnel::before {
    content: "NARROW CORRIDOR  →";
}

.cbv-descent[data-phase="4"] .cbv-stair-flight,
.cbv-descent[data-phase="5"] .cbv-stair-flight {
    opacity: 1;
    transform: rotateX(56deg) rotate(180deg) translateY(-8%) scale(1.08);
    animation-direction: reverse;
}

.cbv-descent[data-phase="4"] .cbv-tunnel::before,
.cbv-descent[data-phase="5"] .cbv-tunnel::before {
    content: "ASCENDING  ↑";
}

.cbv-descent[data-phase="final"] .cbv-black-wall {
    opacity: 1;
}

.cbv-descent[data-phase="final"] .cbv-tunnel::before {
    content: "";
    border: 0;
    background: transparent;
}

.cbv-cinematic-caption {
    position: absolute;
    z-index: 10;
    left: 50%;
    bottom: 82px;
    width: min(760px, calc(100% - 40px));
    transform: translateX(-50%);
    padding: 12px 18px;
    text-align: center;
    color: #fff;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 5px;
    font-size: clamp(1rem, 2.2vw, 1.3rem);
}

.cbv-skip {
    position: absolute;
    z-index: 12;
    top: 18px;
    right: 18px;
    padding: 8px 12px;
    color: #d8e2dd;
    background: rgba(0, 0, 0, 0.62);
    border: 1px solid var(--cbv-line);
    border-radius: 5px;
}

.cbv-push-wall,
.cbv-mindset-trigger {
    position: absolute;
    z-index: 14;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
}

.cbv-room-intro {
    align-items: flex-start;
    justify-content: center;
}

.cbv-room-intro .cbv-scene-shade {
    background: rgba(0, 0, 0, 0.3);
}

.cbv-thought-bubble {
    position: relative;
    z-index: 4;
    width: min(620px, calc(100% - 48px));
    min-height: 126px;
    margin-top: 25px;
    padding: 24px 30px;
    color: #151815;
    background: #f8f5e8;
    border: 3px solid #171b18;
    border-radius: 50%;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.5);
    font-family: Georgia, serif;
    font-size: clamp(1.05rem, 2.5vw, 1.45rem);
    font-style: italic;
    text-align: center;
}

.cbv-thought-bubble::after {
    content: "";
    position: absolute;
    right: 17%;
    bottom: -28px;
    width: 25px;
    height: 25px;
    background: #f8f5e8;
    border: 3px solid #171b18;
    border-radius: 50%;
}

.cbv-paper-scene {
    display: grid;
    place-items: start center;
    padding: clamp(22px, 5vw, 58px);
    background:
        linear-gradient(rgba(42, 33, 20, 0.08) 1px, transparent 1px),
        radial-gradient(circle at 10% 8%, #f4e9cc, #c8b58d 72%);
    background-size: 100% 29px, auto;
    color: var(--cbv-paper-ink);
}

.cbv-paper-panel {
    width: min(960px, 100%);
    padding: clamp(24px, 5vw, 58px);
    background: rgba(255, 250, 234, 0.94);
    border: 1px solid rgba(62, 47, 22, 0.24);
    box-shadow: 0 24px 60px rgba(42, 29, 11, 0.3);
}

.cbv-slow-pulse {
    animation: cbv-slow-pulse 4.8s ease-in-out infinite;
}

.cbv-paper-panel .cbv-kicker,
.cbv-modal-card .cbv-kicker {
    color: #2e7d55;
}

.cbv-word-bank {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 20px 0;
    padding: 14px;
    background: #e1d5b7;
    border: 1px dashed #867757;
}

.cbv-word-bank strong {
    width: 100%;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.cbv-word-bank span {
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(60, 49, 30, 0.16);
    border-radius: 3px;
    font-size: 0.84rem;
}

.cbv-mindset-section {
    margin: 24px 0;
    padding-left: 15px;
    border-left: 4px solid #367959;
}

.cbv-mindset-section h3 {
    margin: 0 0 12px;
    color: #285f45;
    font-size: 0.78rem;
    letter-spacing: 0.14em;
}

.cbv-cloze-line {
    display: block;
    margin: 10px 0;
}

.cbv-cloze-line select,
.cbv-long-input input,
.cbv-long-input textarea,
.cbv-terminal-input input,
.cbv-random-inputs input {
    min-height: 44px;
    padding: 8px 10px;
    color: #111;
    background: #fff;
    border: 2px solid #7b806f;
    border-radius: 5px;
}

.cbv-cloze-line select {
    min-width: 175px;
    margin: 3px 4px;
}

.cbv-corrections {
    padding: 15px 18px;
    background: #fff2cd;
    border-left: 4px solid #b9770e;
}

.cbv-corrections h3,
.cbv-corrections ul {
    margin-top: 0;
}

.cbv-completed-answers {
    margin: 18px 0;
    padding: 14px 18px;
    background: #edf6ef;
    border-left: 4px solid #367959;
}

.cbv-completed-answers h3,
.cbv-completed-answers ol {
    margin-top: 0;
}

.cbv-completed-answers li {
    margin: 7px 0;
}

.cbv-success-text,
.cbv-feedback-line.is-correct {
    color: #145d3b;
    font-weight: 800;
}

.cbv-choice-stack {
    display: grid;
    gap: 10px;
}

.cbv-choice {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 15px 17px;
    color: #132018;
    text-align: left;
    background: #edf6ef;
    border: 2px solid #87a992;
}

.cbv-choice:hover {
    border-color: #2d7650;
    transform: translateX(3px);
}

.cbv-choice span {
    margin-top: 3px;
    color: #526057;
    font-size: 0.88rem;
}

.cbv-danger-choice {
    background: #fff1ef;
    border-color: #d1908c;
}

.cbv-breathe-scene {
    display: grid;
    place-items: center;
    padding: 30px;
    background: radial-gradient(circle, #285c47, #07100c 68%);
}

.cbv-breathe-card {
    width: min(620px, 100%);
    text-align: center;
}

.cbv-breathe-circle {
    display: grid;
    place-items: center;
    width: 160px;
    height: 160px;
    margin: 0 auto 36px;
    background: rgba(101, 237, 159, 0.18);
    border: 2px solid rgba(156, 255, 198, 0.72);
    border-radius: 50%;
    animation: cbv-breathe 8s ease-in-out infinite;
}

.cbv-breathe-circle span {
    font-weight: 850;
    letter-spacing: 0.08em;
}

.cbv-random-inputs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.cbv-random-inputs label,
.cbv-long-input,
.cbv-terminal-input {
    display: grid;
    gap: 6px;
    font-weight: 750;
}

.cbv-trapdoor-scene,
.cbv-failed-security {
    display: grid;
    place-items: center;
    padding: 30px;
    background: radial-gradient(circle at 50% 30%, #431511, #050303 70%);
}

.cbv-trapdoor {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.cbv-trapdoor span {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    background: #171816;
    border: 6px solid #333630;
    animation: cbv-trap-open 1.2s ease-in forwards;
}

.cbv-trapdoor span:first-child {
    left: 0;
    transform-origin: left center;
}

.cbv-trapdoor span:last-child {
    right: 0;
    transform-origin: right center;
}

.cbv-failure-card {
    position: relative;
    z-index: 3;
    width: min(580px, 100%);
    padding: 34px;
    text-align: center;
    background: rgba(14, 8, 7, 0.92);
    border: 1px solid #8f3b36;
    box-shadow: 0 20px 70px #000;
}

/* Main investigation room */
.cbv-room-scene {
    padding: clamp(15px, 3vw, 32px);
    background: #0a0c0b;
}

.cbv-room-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
}

.cbv-room-heading h2 {
    margin: 0;
    font-size: clamp(1.35rem, 3vw, 2rem);
}

.cbv-room-status {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.cbv-room-status span {
    padding: 4px 8px;
    color: #b9c5bf;
    background: #151b18;
    border: 1px solid #35423c;
    border-radius: 4px;
    font-size: 0.75rem;
}

.cbv-room-status .is-solved {
    color: #07110c;
    background: var(--cbv-green);
    border-color: var(--cbv-green);
    font-weight: 800;
}

.cbv-room-frame {
    position: relative;
    width: min(1180px, 100%);
    margin: 0 auto;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #161a18;
    border: 1px solid #46534d;
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.48);
}

.cbv-room-frame-scroll {
    width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
}

.cbv-room-frame > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cbv-hotspot {
    position: absolute;
    min-width: 50px;
    min-height: 50px;
    padding: 0;
    color: #07110c;
    background: rgba(101, 237, 159, 0.25);
    border: 2px solid rgba(162, 255, 201, 0.9);
    border-radius: 50%;
    box-shadow: 0 0 0 7px rgba(101, 237, 159, 0.12), 0 0 24px rgba(101, 237, 159, 0.35);
    animation: cbv-hotspot 1.8s ease-in-out infinite;
}

.cbv-hotspot:hover,
.cbv-hotspot:focus-visible {
    background: rgba(101, 237, 159, 0.9);
    transform: scale(1.08);
}

.cbv-hotspot span {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 9px);
    transform: translateX(-50%);
    padding: 4px 7px;
    color: #fff;
    background: rgba(0, 0, 0, 0.82);
    border-radius: 3px;
    font-size: 0.68rem;
    font-weight: 800;
    white-space: nowrap;
}

.cbv-hotspot-computer { left: 22%; top: 57%; }
.cbv-hotspot-cabinet { left: 20%; top: 43%; }
.cbv-hotspot-envelope { left: 72%; top: 82%; }
.cbv-hotspot-clocks { left: 68%; top: 8%; }
.cbv-hotspot-vault { left: 72%; top: 43%; }

.cbv-room-clue-object {
    position: absolute;
    z-index: 5;
    display: grid;
    place-items: center;
    align-content: center;
    min-width: 0;
    min-height: 0;
    padding: 3px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.86);
    border-radius: 1px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.46);
    font-size: clamp(0.32rem, 0.65vw, 0.58rem);
    font-weight: 900;
    line-height: 1.02;
    text-align: center;
}

.cbv-room-clue-object:hover,
.cbv-room-clue-object:focus-visible {
    z-index: 7;
    outline: 3px solid var(--cbv-green);
    outline-offset: 2px;
    transform: scale(1.08);
}

.cbv-room-clue-object strong,
.cbv-room-clue-object span {
    display: block;
}

.cbv-room-clue-calendar {
    left: 18.7%;
    top: 5.5%;
    width: 6.1%;
    height: 19%;
    color: #143352;
    background: linear-gradient(#376f96 0 28%, #fffdf5 28%);
}

.cbv-room-clue-acdc {
    left: 25.5%;
    top: 6.5%;
    width: 5.6%;
    height: 17.5%;
    color: #fff;
    background: #1c1c1c;
}

.cbv-room-clue-intensity {
    left: 31.8%;
    top: 5.5%;
    width: 6.2%;
    height: 19%;
    color: #171717;
    background: #f1e6c9;
}

.cbv-room-clue-mood {
    left: 76.8%;
    top: 2.2%;
    width: 7%;
    height: 16.5%;
    padding: 5px;
    color: #fff9e8;
    background: #a62924;
    font-size: clamp(0.28rem, 0.53vw, 0.48rem);
    line-height: 1.12;
}

/* In Advanced mode the room objects themselves are the click targets. */
.cbv-room-advanced .cbv-hotspot {
    min-width: 0;
    min-height: 0;
    color: transparent;
    background: transparent;
    border: 0;
    border-radius: 6px;
    box-shadow: none;
    animation: none;
}

.cbv-room-advanced .cbv-hotspot:hover,
.cbv-room-advanced .cbv-hotspot:focus-visible {
    background: rgba(101, 237, 159, 0.08);
    box-shadow: inset 0 0 0 2px rgba(176, 255, 207, 0.72);
    transform: none;
}

.cbv-room-advanced .cbv-hotspot span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.cbv-room-advanced .cbv-hotspot-computer { left: 14.2%; top: 44.5%; width: 20.5%; height: 28%; }
.cbv-room-advanced .cbv-hotspot-cabinet { left: 14.5%; top: 31.5%; width: 12%; height: 24%; }
.cbv-room-advanced .cbv-hotspot-envelope { z-index: 6; left: 69.2%; top: 79.2%; width: 7.5%; height: 8%; }
.cbv-room-advanced .cbv-hotspot-clocks { z-index: 2; left: 60.5%; top: 1.2%; width: 15.5%; height: 15.5%; }
.cbv-room-advanced .cbv-hotspot-vault { z-index: 1; left: 56.5%; top: 14.5%; width: 33%; height: 51%; }

.cbv-room-simplified .cbv-room-object-list {
    display: grid;
}

.cbv-room-object-list {
    display: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin-top: 10px;
}

.cbv-room-object-list button {
    padding: 9px;
    color: #dbe7e0;
    background: #15201b;
    border: 1px solid #405249;
}

.cbv-room-progress {
    margin: 12px 0 0;
    color: var(--cbv-muted);
    text-align: center;
    font-size: 0.85rem;
}

/* Modal and evidence */
.cbv-modal {
    position: absolute;
    z-index: 100;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
}

.cbv-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(5px);
}

.cbv-modal-card {
    position: relative;
    z-index: 2;
    width: min(880px, 100%);
    max-height: calc(100% - 24px);
    overflow: auto;
    padding: clamp(22px, 4vw, 40px);
    color: #18201b;
    background: #edf0e9;
    border: 1px solid #8da296;
    border-radius: 9px;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.7);
}

.cbv-modal-close {
    position: sticky;
    z-index: 3;
    top: 0;
    float: right;
    margin: -10px -10px 4px 12px;
    color: #fff;
    background: #24342c;
}

.cbv-modal-card .cbv-secondary {
    color: #142019;
    background: #d8e1dc;
    border-color: #81958a;
}

.cbv-modal-card .cbv-text-button {
    color: #18577c;
}

.cbv-modal-card .cbv-danger {
    color: #fff;
}

.cbv-modal-utility {
    display: flex;
    justify-content: flex-end;
    margin: 0 54px 12px 0;
}

.cbv-modal-utility .cbv-secondary {
    min-height: 40px;
    padding: 7px 11px;
    color: #07110c;
    background: #bfffd5;
    border-color: #3c9d62;
    font-size: 0.78rem;
    font-weight: 900;
}

.cbv-inventory-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.cbv-inventory-groups section {
    padding: 14px;
    background: #dde4df;
    border: 1px solid #bdc8c1;
}

.cbv-inventory-groups h3 {
    margin-top: 0;
}

.cbv-tool-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.cbv-tool {
    padding: 9px;
    color: #172019;
    background: #fff;
    border: 1px solid #81958a;
}

.cbv-tool:hover {
    border-color: #1d8050;
    box-shadow: inset 0 0 0 1px #1d8050;
}

.cbv-feedback-line,
.cbv-hint-output {
    min-height: 26px;
    margin: 14px 0 0;
    color: #8b251f;
    font-weight: 750;
}

.cbv-terminal {
    padding: 22px;
    color: #8cffac;
    background: #06100a;
    border: 6px solid #3f4943;
    border-radius: 5px;
    box-shadow: inset 0 0 55px rgba(43, 255, 103, 0.1);
    font-family: "Courier New", monospace;
}

.cbv-terminal h2,
.cbv-terminal .cbv-kicker {
    color: inherit;
}

.cbv-terminal-alert {
    color: #ff716b;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.cbv-terminal-warning-copy {
    font-size: clamp(1rem, 2.6vw, 1.35rem);
    line-height: 1.45;
}

.cbv-access-denied {
    color: #ff5149 !important;
    font-size: 1.12rem;
    letter-spacing: 0.05em;
}

.cbv-gerald-screen {
    text-align: center;
}

.cbv-gerald-screen img {
    display: block;
    width: 100%;
    max-height: 460px;
    margin: 18px auto;
    object-fit: contain;
    border: 2px solid #3e9f62;
}

.cbv-terminal-clock {
    width: fit-content;
    margin: 14px 0 20px;
    padding: 8px 13px;
    color: #ff716b;
    background: #120302;
    border: 1px solid #a13a34;
    font-size: clamp(2rem, 7vw, 4.8rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.08em;
    text-shadow: 0 0 18px rgba(255, 82, 74, 0.65);
}

.cbv-terminal-input input {
    width: 100%;
    color: #8cffac;
    background: #020603;
    border-color: #3e9f62;
    text-transform: uppercase;
}

.cbv-evidence-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(250px, 0.92fr);
    align-items: center;
    gap: clamp(18px, 4vw, 38px);
    margin-top: 16px;
}

.cbv-evidence-visual {
    min-width: 0;
    margin: 0;
}

.cbv-evidence-copy {
    min-width: 0;
}

.cbv-evidence-copy > :first-child {
    margin-top: 0;
}

.cbv-evidence-copy .cbv-actions {
    align-items: stretch;
    flex-direction: column;
}

.cbv-evidence-copy .cbv-actions > button {
    width: 100%;
}

.cbv-cabinet-visual {
    position: relative;
    overflow: hidden;
    background: #252a27;
    border: 1px solid #859088;
}

.cbv-cabinet-visual img,
.cbv-evidence-image,
.cbv-vault-image {
    display: block;
    width: 100%;
    max-height: 440px;
    object-fit: contain;
}

.cbv-postit {
    position: absolute;
    top: 31%;
    left: 31%;
    width: min(230px, 28%);
    padding: 12px;
    transform: rotate(-5deg);
    color: #241b08;
    background: #ffe36d;
    box-shadow: 4px 7px 12px rgba(0, 0, 0, 0.35);
    font-family: "Comic Sans MS", "Bradley Hand", cursive;
    font-size: clamp(0.52rem, 1.5vw, 0.95rem);
    font-weight: 700;
    line-height: 1.18;
}

.cbv-postit-alone {
    position: relative;
    top: auto;
    left: auto;
    display: grid;
    place-items: center;
    width: min(430px, 95%);
    min-height: 230px;
    margin: 24px auto 30px;
    padding: 34px;
    transform: rotate(-2deg);
    font-size: clamp(1.15rem, 3vw, 1.8rem);
    text-align: center;
}

.cbv-drawer-visual {
    max-height: 320px;
}

.cbv-drawer-buttons,
.cbv-number-choices,
.cbv-hint-buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    margin: 16px 0;
}

.cbv-drawer-buttons button,
.cbv-number-choices button,
.cbv-hint-buttons button {
    padding: 11px;
    color: #152018;
    background: #fff;
    border: 1px solid #88978f;
}

.cbv-drawer-buttons button {
    display: flex;
    flex-direction: column;
}

.cbv-drawer-buttons span,
.cbv-hint-buttons small {
    color: #637069;
    font-size: 0.78rem;
}

.cbv-drawing-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.cbv-drawing-gallery img {
    display: block;
    width: 100%;
    height: 260px;
    object-fit: contain;
    background: #d8ded9;
    border: 1px solid #89968f;
}

.cbv-drawing-gallery.cbv-drawing-single {
    grid-template-columns: 1fr;
}

.cbv-drawing-gallery.cbv-drawing-single img {
    height: auto;
    max-height: 460px;
}

.cbv-acorn-drawer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    min-height: 230px;
    margin: 20px 0;
    padding: 30px;
    overflow: hidden;
    background: linear-gradient(#5a3b23, #2e1b10);
    border: 16px solid #6d4b31;
    box-shadow: inset 0 12px 22px rgba(0, 0, 0, 0.55);
}

.cbv-acorn {
    position: relative;
    display: inline-block;
    flex: 0 0 auto;
    width: 25px;
    height: 29px;
    margin: 3px;
    background: linear-gradient(135deg, #a96c2e, #573016);
    border: 1px solid #3b210f;
    border-radius: 48% 48% 58% 58%;
    transform: rotate(8deg);
}

.cbv-acorn::before {
    content: "";
    position: absolute;
    left: -2px;
    right: -2px;
    top: -4px;
    height: 10px;
    background: #4c321d;
    border: 1px solid #2f1d0f;
    border-radius: 55% 55% 35% 35%;
}

.cbv-acorn::after {
    content: "";
    position: absolute;
    left: 13px;
    top: -9px;
    width: 3px;
    height: 7px;
    background: #34200f;
    transform: rotate(18deg);
}

.cbv-simple-hint {
    margin: 18px 0;
    padding: 13px;
    background: #fff3c8;
    border: 1px solid #c8a951;
    border-radius: 6px;
}

.cbv-simple-hint p {
    min-height: 1.5em;
    margin: 10px 0 0;
    color: #4c3a07;
    font-weight: 750;
}

.cbv-simple-hint-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cbv-simple-hint-actions button {
    flex: 1 1 150px;
}

.cbv-number-choices {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cbv-number-choices button {
    min-height: 64px;
    font-size: 1.4rem;
    font-weight: 850;
}

.cbv-letter {
    margin: 18px 0;
    padding: clamp(20px, 4vw, 36px);
    color: #252116;
    background: #f5ecd3;
    border: 1px solid #c3b795;
    box-shadow: 0 10px 28px rgba(46, 35, 17, 0.16);
    font-family: Georgia, serif;
    font-size: 1.08rem;
}

.cbv-letter-markable {
    background-image: repeating-linear-gradient(transparent 0 29px, rgba(75, 104, 140, 0.12) 30px 31px);
}

.cbv-poster-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.cbv-poster-single {
    width: min(520px, 100%);
    margin: 20px auto;
}

.cbv-poster-single .cbv-poster {
    width: 100%;
    min-height: 300px;
}

.cbv-poster {
    min-height: 250px;
    padding: 22px;
    text-align: center;
    border: 7px solid #efe9d9;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.cbv-poster h3 {
    margin: 0 0 15px;
    font-size: clamp(1.25rem, 3vw, 2rem);
    line-height: 1.08;
}

.cbv-poster p {
    font-family: "Courier New", monospace;
    font-size: clamp(0.88rem, 2.2vw, 1.25rem);
    font-weight: 850;
}

.cbv-poster-intensity {
    color: #171717;
    background: #f1e6c9;
    text-align: left;
}

.cbv-poster-intensity ol {
    padding-left: 30px;
    font-size: 1.08rem;
    font-weight: 750;
}

.cbv-poster-note {
    display: grid;
    place-items: center;
    min-height: 180px;
    color: #3f2d0b;
    background: #ffdd65;
    font-family: "Comic Sans MS", "Bradley Hand", cursive;
    transform: rotate(-1deg);
}

.cbv-poster-rock {
    display: grid;
    place-items: center;
    color: #f2f2ee;
    background: #252525;
}

.cbv-poster-rock h3 {
    font-size: clamp(2.4rem, 8vw, 5.5rem);
}

.cbv-guitar {
    font-size: clamp(3rem, 8vw, 5.5rem);
    filter: grayscale(0.5);
}

.cbv-poster-tomorrow {
    position: relative;
    color: #143352;
    background: #fffdf5;
    border-color: #d5d9dc;
}

.cbv-calendar-top {
    margin: -22px -22px 16px;
    padding: 16px;
    color: #fff;
    background: #376f96;
    font-size: 1.2rem;
}

.cbv-calendar-days {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 7px;
    margin-bottom: 16px;
    color: rgba(20, 51, 82, 0.12);
    font-size: 1.2rem;
    font-weight: 900;
}

.cbv-poster-calm {
    display: grid;
    place-items: center;
    color: #fff5d8;
    background: #a62924;
}

.cbv-poster-calm p {
    max-width: 18ch;
    color: #fff9e8;
    font-family: Georgia, serif;
    font-size: clamp(1.35rem, 4vw, 2.4rem);
    line-height: 1.24;
}

.cbv-poster-calm h3::before {
    content: "♛";
    display: block;
    margin-bottom: 12px;
    font-size: 2.4rem;
}

.cbv-clock-pair {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(25px, 7vw, 80px);
    margin: 30px 0;
}

.cbv-evidence-layout .cbv-clock-pair {
    flex-direction: column;
    gap: 20px;
    margin: 0;
}

.cbv-evidence-layout .cbv-digital-clock {
    font-size: clamp(1.8rem, 5vw, 3.4rem);
}

.cbv-evidence-layout .cbv-analogue-clock {
    width: min(230px, 100%);
}

.cbv-digital-clock {
    padding: 14px 18px;
    color: #99ff78;
    background: #0a130b;
    border: 7px solid #3f4842;
    border-radius: 8px;
    box-shadow: inset 0 0 18px rgba(129, 255, 98, 0.24);
    font-family: "Courier New", monospace;
    font-size: clamp(2rem, 7vw, 4.2rem);
    line-height: 1;
    text-shadow: 0 0 12px rgba(129, 255, 98, 0.66);
}

.cbv-analogue-clock {
    position: relative;
    flex: 0 0 auto;
    width: clamp(190px, 29vw, 280px);
    aspect-ratio: 1;
    color: #121512;
    background:
        repeating-conic-gradient(from -1deg, #1d211e 0deg 1.5deg, transparent 1.5deg 30deg),
        #f5f3e7;
    border: 12px solid #4c514d;
    border-radius: 50%;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
}

.cbv-clock-number {
    position: absolute;
    transform: translate(-50%, -50%);
    font-weight: 850;
}

.cbv-clock-number.n12 { left: 50%; top: 9%; }
.cbv-clock-number.n1 { left: 71%; top: 15%; }
.cbv-clock-number.n2 { left: 86%; top: 29%; }
.cbv-clock-number.n3 { left: 92%; top: 50%; }
.cbv-clock-number.n6 { left: 50%; top: 91%; }
.cbv-clock-number.n9 { left: 8%; top: 50%; }

.cbv-analogue-clock i {
    position: absolute;
    z-index: 2;
    left: calc(50% - 3px);
    bottom: 50%;
    width: 6px;
    transform-origin: 50% 100%;
    background: #171b18;
    border-radius: 6px;
}

.cbv-hour-hand {
    height: 28%;
    transform: rotate(30deg);
}

.cbv-minute-hand {
    height: 39%;
    transform: rotate(60deg);
}

.cbv-analogue-clock b {
    position: absolute;
    z-index: 3;
    left: 50%;
    top: 50%;
    width: 15px;
    height: 15px;
    transform: translate(-50%, -50%);
    background: #171b18;
    border-radius: 50%;
}

.cbv-vault-image {
    margin: 12px auto;
    background: #1b1d1c;
    border: 1px solid #8a918d;
}

.cbv-vault-layout .cbv-vault-image {
    max-height: 520px;
}

.cbv-vault-interactive {
    position: relative;
    width: min(760px, 100%);
    margin: 18px auto;
    overflow: hidden;
    background: #202321;
    border: 1px solid #7f8983;
}

.cbv-vault-interactive > img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.cbv-vault-hotspot {
    position: absolute;
    z-index: 2;
    min-width: 0;
    min-height: 0;
    padding: 0;
    color: transparent;
    background: transparent;
    border: 0;
    border-radius: 5px;
}

.cbv-vault-hotspot:hover,
.cbv-vault-hotspot:focus-visible {
    background: rgba(101, 237, 159, 0.12);
    box-shadow: inset 0 0 0 3px rgba(150, 255, 192, 0.9), 0 0 22px rgba(101, 237, 159, 0.32);
}

.cbv-vault-hotspot span {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    padding: 4px 7px;
    opacity: 0;
    color: #fff;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 3px;
    font-size: 0.72rem;
    font-weight: 850;
    white-space: nowrap;
}

.cbv-vault-hotspot:hover span,
.cbv-vault-hotspot:focus-visible span,
.cbv-vault-hotspot.is-solved span {
    opacity: 1;
}

.cbv-vault-hotspot.is-solved {
    background: rgba(101, 237, 159, 0.16);
    box-shadow: inset 0 0 0 2px rgba(101, 237, 159, 0.68);
}

.cbv-vault-hotspot-levers { left: 36.1%; top: 40%; width: 10.7%; height: 15.5%; }
.cbv-vault-hotspot-keypad { left: 47.2%; top: 33.8%; width: 13.9%; height: 22.8%; }
.cbv-vault-hotspot-dial { left: 62.7%; top: 35.2%; width: 13%; height: 20.8%; }
.cbv-vault-hotspot-barrels { left: 58.1%; top: 58.3%; width: 15.8%; height: 13.8%; }
.cbv-vault-hotspot-bolt-top { z-index: 1; left: 31.6%; top: 21.2%; width: 31.4%; height: 12.8%; }
.cbv-vault-hotspot-bolt-bottom { z-index: 1; left: 31.6%; top: 58%; width: 26%; height: 13%; }

.cbv-lock-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.cbv-lock-button {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px;
    color: #182019;
    background: #fff;
    border: 2px solid #89978f;
    text-align: left;
}

.cbv-lock-button span {
    color: #6c7770;
    font-size: 1.3rem;
}

.cbv-lock-button.is-solved {
    color: #0d4f31;
    background: #d8f6e4;
    border-color: #42a56c;
}

.cbv-lock-button.is-solved span {
    color: #27814e;
}

.cbv-final-handle {
    margin-top: 15px;
    padding: 14px;
    color: #fff;
    text-align: center;
    background: #4b5550;
    border: 1px solid #737f79;
}

.cbv-final-handle.is-ready {
    color: #0b3621;
    background: #d8f6e4;
    border-color: #42a56c;
    box-shadow: inset 0 0 24px rgba(42, 166, 99, 0.13);
}

.cbv-final-handle p {
    color: inherit;
}

.cbv-levers {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.cbv-lever-control {
    padding: 12px;
    text-align: center;
    background: #c9cfcb;
    border: 1px solid #939d97;
}

.cbv-lever-track {
    position: relative;
    width: 28px;
    height: 150px;
    margin: 12px auto;
    background: #3f4943;
    border: 4px solid #737e77;
    border-radius: 18px;
    box-shadow: inset 0 0 8px #000;
}

.cbv-lever-track i {
    position: absolute;
    left: 50%;
    bottom: calc(9px + (var(--lever-position) * 54px));
    width: 54px;
    height: 25px;
    transform: translateX(-50%);
    background: linear-gradient(#f0efe9, #777d79);
    border: 2px solid #2e3430;
    border-radius: 13px;
    transition: bottom 180ms ease;
}

.cbv-lever-buttons {
    display: grid;
    gap: 4px;
}

.cbv-lever-buttons button {
    min-height: 38px;
    padding: 5px;
    color: #253029;
    background: #e6e9e7;
    border: 1px solid #8d9791;
    font-size: 0.75rem;
}

.cbv-lever-buttons .is-selected {
    color: #07371f;
    background: #93eab6;
    border-color: #287849;
    font-weight: 800;
}

.cbv-keypad-word,
.cbv-keypad-entry,
.cbv-dial-entry {
    margin: 12px auto;
    padding: 10px 15px;
    color: #a2ff82;
    background: #09110a;
    border: 4px solid #525c56;
    font-family: "Courier New", monospace;
    font-size: clamp(1.6rem, 5vw, 3rem);
    font-weight: 800;
    letter-spacing: 0.16em;
    text-align: center;
}

.cbv-keypad-entry {
    min-height: 54px;
    color: #bce9ff;
    font-size: 1.35rem;
    letter-spacing: 0.1em;
}

.cbv-keypad {
    display: grid;
    grid-template-columns: repeat(3, minmax(60px, 90px));
    justify-content: center;
    gap: 8px;
}

.cbv-keypad button {
    min-height: 58px;
    color: #eaf7ef;
    background: linear-gradient(#4b5650, #222925);
    border: 2px solid #7e8a83;
    font-size: 1.2rem;
    font-weight: 800;
    box-shadow: 0 3px 0 #111;
}

.cbv-dial {
    position: relative;
    width: min(340px, 78vw);
    aspect-ratio: 1;
    margin: 20px auto;
    background: radial-gradient(circle, #777e7a 0 29%, #252b28 30% 55%, #9ca29e 56% 62%, #303633 63%);
    border: 10px solid #69716c;
    border-radius: 50%;
    box-shadow: inset 0 0 28px #000, 0 9px 26px rgba(0, 0, 0, 0.28);
}

.cbv-dial-number {
    position: absolute;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    min-height: 62px;
    transform: translate(-50%, -50%);
    color: #101511;
    background: #e7ece9;
    border: 3px solid #1b201d;
    border-radius: 50%;
    font-weight: 900;
}

.cbv-dial-number:hover { background: var(--cbv-green); }
.cbv-dial-number.d0 { left: 50%; top: 13%; }
.cbv-dial-number.d1 { left: 87%; top: 50%; }
.cbv-dial-number.d2 { left: 50%; top: 87%; }
.cbv-dial-number.d3 { left: 13%; top: 50%; }

.cbv-dial-centre {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 37%;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, #1c211e 0 18%, #858c87 19% 70%, #292f2b 71%);
    border: 3px solid #111512;
    border-radius: 50%;
}

.cbv-dial-centre i {
    position: absolute;
    left: calc(50% - 3px);
    bottom: 50%;
    width: 6px;
    height: 44%;
    transform: rotate(calc(var(--dial-turn) * 90deg));
    transform-origin: 50% 100%;
    background: #101310;
    border-radius: 5px;
    transition: transform 180ms ease;
}

.cbv-dial-entry {
    color: #1a241e;
    background: #dfe5e1;
    border-width: 2px;
    font-size: 1rem;
    letter-spacing: 0;
}

.cbv-barrels {
    display: grid;
    grid-template-columns: repeat(4, minmax(60px, 1fr));
    gap: 7px;
    max-width: 520px;
    margin: 15px auto;
}

.cbv-letter-wheel {
    display: grid;
    gap: 4px;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.cbv-letter-wheel select {
    width: 100%;
    min-height: 70px;
    padding: 8px;
    color: #f2f5f3;
    background: linear-gradient(#5c625e, #202522);
    border: 4px solid #777e79;
    border-radius: 10px;
    font-family: "Courier New", monospace;
    font-size: 2rem;
    font-weight: 900;
    text-align: center;
}

.cbv-barrel-divider {
    color: #59645d;
    text-align: center;
    font-size: 1.3rem;
}

/* Fifth physical mechanism: the two engraved manual bolts. */
.cbv-bolt-lock {
    display: grid;
    gap: 28px;
    margin: 22px 0;
    padding: 22px;
    color: #f2f5f3;
    background: linear-gradient(135deg, #4a514d, #242927);
    border: 8px solid #717973;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.55);
}

.cbv-bolt-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(120px, 0.8fr) minmax(220px, 2fr) minmax(120px, 0.8fr);
    align-items: center;
    gap: 14px;
    min-height: 126px;
    padding: 18px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.cbv-bolt-marking {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: #e3e8e5;
    text-align: center;
}

.cbv-bolt-marking strong {
    display: block;
    margin-left: 5px;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.cbv-oak-leaf {
    display: inline-block;
    width: 23px;
    height: 36px;
    background: #899477;
    border: 1px solid #414a3b;
    border-radius: 70% 18% 70% 20%;
    transform: rotate(35deg);
}

.cbv-bolt-rail {
    position: relative;
    height: 28px;
    background: linear-gradient(#c9cdca, #5d6560, #aeb4b0);
    border: 2px solid #171b19;
    border-radius: 16px;
}

.cbv-bolt-handle {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 32px;
    height: 82px;
    transform: translate(-50%, -50%);
    background: linear-gradient(90deg, #575f5a, #d1d5d2, #4d544f);
    border: 2px solid #1c211e;
    border-radius: 12px;
    transition: transform 180ms ease;
}

.cbv-bolt-handle.is-up { transform: translate(-50%, -76%) rotate(0deg); }
.cbv-bolt-handle.is-down { transform: translate(-50%, -24%) rotate(0deg); }

.cbv-bolt-controls {
    display: grid;
    gap: 6px;
}

.cbv-bolt-controls button {
    min-height: 38px;
    color: #17201b;
    background: #edf1ee;
    border: 1px solid #919b95;
    border-radius: 4px;
    font-weight: 850;
}

.cbv-bolt-letters {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: #fff5b4;
    font-family: "Courier New", monospace;
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-shadow: 0 1px 2px #000;
}

.cbv-bolt-letters-above { top: -5px; }
.cbv-bolt-letters-below { bottom: -8px; }

.cbv-inventory-list {
    display: grid;
    gap: 8px;
    padding: 0;
    list-style: none;
}

.cbv-inventory-list li {
    display: grid;
    gap: 2px;
    padding: 10px 12px;
    background: #fff;
    border-left: 4px solid #4b8f68;
}

.cbv-inventory-list span {
    color: #526057;
    font-size: 0.86rem;
}

.cbv-long-input textarea,
.cbv-long-input input {
    width: 100%;
    resize: vertical;
}

.cbv-toast {
    position: absolute;
    z-index: 140;
    left: 50%;
    bottom: 20px;
    max-width: calc(100% - 32px);
    padding: 10px 15px;
    transform: translate(-50%, 30px);
    opacity: 0;
    color: #06100b;
    background: var(--cbv-green);
    border: 1px solid #b5ffd2;
    border-radius: 5px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.48);
    font-weight: 800;
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
}

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

.cbv-opening-scene {
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #020403;
}

.cbv-opening-underlay,
.cbv-vault-opening-video,
.cbv-vault-open-still {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cbv-vault-opening-video {
    animation: cbv-video-fade-in 0.4s ease-out both;
}

.cbv-opening-caption {
    position: absolute;
    z-index: 6;
    left: 50%;
    bottom: 7%;
    transform: translateX(-50%);
    padding: 10px 16px;
    color: #dfffea;
    background: rgba(0, 0, 0, 0.86);
    border: 1px solid rgba(191, 255, 214, 0.52);
    font-family: "Courier New", monospace;
    font-weight: 800;
    letter-spacing: 0.1em;
    white-space: nowrap;
}

.cbv-success-scene {
    display: grid;
    place-items: center;
    padding: clamp(28px, 7vw, 90px);
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 45%, rgba(126, 255, 171, 0.29), transparent 36%),
        linear-gradient(135deg, #06100b, #173525 54%, #050806);
}

.cbv-confetti {
    position: absolute;
    z-index: 1;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.cbv-confetti i {
    position: absolute;
    left: var(--confetti-left);
    top: -12%;
    width: 10px;
    height: 18px;
    background: hsl(var(--confetti-hue) 86% 61%);
    border-radius: 2px;
    animation: cbv-confetti-fall var(--confetti-duration) linear var(--confetti-delay) infinite;
}

.cbv-confetti i:nth-child(3n) {
    width: 13px;
    height: 13px;
    border-radius: 50%;
}

.cbv-success-card {
    position: relative;
    z-index: 2;
    display: grid;
    justify-items: center;
    gap: 30px;
    width: min(760px, 100%);
    padding: clamp(40px, 8vw, 90px);
    color: #f6fff9;
    background: rgba(3, 12, 8, 0.78);
    border: 3px solid var(--cbv-green);
    border-radius: 16px;
    box-shadow: 0 0 80px rgba(101, 237, 159, 0.28);
    text-align: center;
    backdrop-filter: blur(5px);
}

.cbv-success-card h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(3rem, 10vw, 7rem);
    line-height: 0.95;
    letter-spacing: -0.045em;
    text-shadow: 0 0 30px rgba(101, 237, 159, 0.58);
}

.cbv-loading {
    display: grid;
    place-items: center;
    min-height: 500px;
    gap: 12px;
    color: #d9e6df;
    background: #080d0a;
}

.cbv-loading-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #33433a;
    border-top-color: var(--cbv-green);
    border-radius: 50%;
    animation: cbv-spin 0.9s linear infinite;
}

@keyframes cbv-ring {
    0%, 100% { transform: scale(1); opacity: 0.55; }
    50% { transform: scale(1.45); opacity: 1; }
}

@keyframes cbv-wave {
    from { height: 18%; }
    to { height: 90%; }
}

@keyframes cbv-pulse-text {
    50% { opacity: 0.45; }
}

@keyframes cbv-timer-flash {
    50% { opacity: 0.38; }
}

@keyframes cbv-confetti-fall {
    0% { transform: translate3d(0, -12vh, 0) rotate(0deg); }
    100% { transform: translate3d(36px, 120vh, 0) rotate(760deg); }
}

@keyframes cbv-video-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes cbv-slow-pulse {
    0%, 100% { box-shadow: 0 24px 60px rgba(42, 29, 11, 0.3); }
    50% { box-shadow: 0 24px 70px rgba(46, 121, 85, 0.42), 0 0 0 5px rgba(54, 121, 89, 0.08); }
}

@keyframes cbv-stairs-descend {
    from { background-position: 0 0, 0 0; }
    to { background-position: 0 -42px, 0 0; }
}

@keyframes cbv-torch {
    from { transform: translateX(-4%) rotate(-1deg); opacity: 0.72; }
    to { transform: translateX(4%) rotate(1deg); opacity: 1; }
}

@keyframes cbv-breathe {
    0%, 100% { transform: scale(0.72); opacity: 0.62; }
    50% { transform: scale(1.12); opacity: 1; }
}

@keyframes cbv-trap-open {
    to { transform: scaleX(0); }
}

@keyframes cbv-hotspot {
    0%, 100% { box-shadow: 0 0 0 5px rgba(101, 237, 159, 0.1), 0 0 18px rgba(101, 237, 159, 0.24); }
    50% { box-shadow: 0 0 0 11px rgba(101, 237, 159, 0.02), 0 0 30px rgba(101, 237, 159, 0.48); }
}

@keyframes cbv-vault-zoom {
    to { transform: scale(1.09); filter: brightness(0.35); }
}

@keyframes cbv-vault-glow {
    0% { transform: translate(-50%, -50%) scaleX(0.04); opacity: 0; }
    30% { opacity: 1; }
    100% { transform: translate(-50%, -50%) scaleX(1.25); opacity: 0.82; }
}

@keyframes cbv-retract-left {
    to { transform: translateX(-140%); opacity: 0; }
}

@keyframes cbv-retract-right {
    to { transform: translateX(140%); opacity: 0; }
}

@keyframes cbv-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 760px) {
    .cbv-app {
        border-radius: 0;
        font-size: 15px;
    }

    .cbv-shell {
        min-height: 720px;
    }

    .cbv-toolbar {
        grid-template-columns: 1fr auto;
        gap: 7px;
        padding: 7px 9px;
    }

    .cbv-brand > span:last-child {
        display: none;
    }

    .cbv-hud {
        grid-column: 1 / -1;
        grid-row: 2;
        order: 3;
        width: 100%;
    }

    .cbv-hud-item {
        flex: 1;
        min-width: 0;
    }

    .cbv-toolbar-actions {
        justify-self: end;
    }

    .cbv-stage,
    .cbv-scene {
        min-height: 625px;
    }

    .cbv-image-scene {
        align-items: flex-end;
        padding: 18px;
    }

    .cbv-scene-shade,
    .cbv-agent-scene .cbv-scene-shade,
    .cbv-drain-scene .cbv-scene-shade {
        background: linear-gradient(0deg, rgba(1, 4, 3, 0.96) 0%, rgba(1, 4, 3, 0.72) 48%, rgba(1, 4, 3, 0.05) 85%);
    }

    .cbv-story-card {
        max-height: 76%;
        overflow: auto;
        padding: 21px;
    }

    .cbv-briefing-card {
        max-height: 88%;
    }

    .cbv-room-intro {
        align-items: flex-start;
    }

    .cbv-thought-bubble {
        margin-top: 50px;
        padding: 20px 22px;
    }

    .cbv-paper-scene,
    .cbv-room-scene {
        padding: 16px;
    }

    .cbv-paper-panel {
        padding: 22px 18px;
    }

    .cbv-room-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .cbv-room-status {
        justify-content: flex-start;
    }

    .cbv-room-frame {
        aspect-ratio: 16 / 9;
    }

    .cbv-room-advanced .cbv-room-frame {
        width: 760px;
        max-width: none;
    }

    .cbv-room-simplified .cbv-hotspot {
        display: none;
    }

    .cbv-room-advanced .cbv-hotspot {
        display: block;
    }

    .cbv-room-object-list {
        display: grid;
    }

    .cbv-modal {
        padding: 8px;
    }

    .cbv-modal-card {
        max-height: calc(100% - 8px);
        padding: 20px 16px;
    }

    .cbv-poster-grid,
    .cbv-inventory-groups,
    .cbv-evidence-layout,
    .cbv-success-scene {
        grid-template-columns: 1fr;
    }

    .cbv-evidence-layout {
        align-items: start;
    }

    .cbv-success-scene {
        align-content: center;
        overflow: auto;
    }

    .cbv-secure-case {
        width: min(310px, 80%);
        margin: 0 auto;
    }

    .cbv-success-card {
        padding: 44px 20px;
        border: 3px solid var(--cbv-green);
    }

    .cbv-mission-footer {
        bottom: 8px;
        padding: 6px 10px;
    }

    .cbv-inventory-button {
        max-width: 126px;
        padding: 0 8px;
        font-size: 0.66rem;
    }

    .cbv-clock-pair {
        flex-direction: column;
    }

    .cbv-levers {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cbv-bolt-row {
        grid-template-columns: 1fr;
        gap: 18px;
        padding-top: 27px;
        padding-bottom: 27px;
    }

    .cbv-bolt-rail {
        width: 90%;
        margin: 0 auto;
    }
}

@media (max-width: 430px) {
    .cbv-room-object-list,
    .cbv-drawer-buttons,
    .cbv-hint-buttons,
    .cbv-random-inputs,
    .cbv-mode-grid,
    .cbv-drawing-gallery {
        grid-template-columns: 1fr;
    }

    .cbv-drawing-gallery img {
        height: auto;
        max-height: 300px;
    }

    .cbv-actions > button {
        width: 100%;
    }

    .cbv-tool-grid,
    .cbv-lock-grid {
        grid-template-columns: 1fr;
    }

    .cbv-barrels {
        grid-template-columns: repeat(4, minmax(46px, 1fr));
    }

    .cbv-letter-wheel select {
        min-height: 58px;
        padding: 4px;
        font-size: 1.45rem;
    }

    .cbv-cinematic-caption {
        bottom: 90px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cbv-app *,
    .cbv-app *::before,
    .cbv-app *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .cbv-confetti {
        display: none;
    }
}
