:root{color-scheme:dark;--bg:#151813;--screen:#050b06;--panel:#1e271d;--text:#c6edaa;--muted:#b2bba3;--bright:#e7ffd1;--line:#46523d;--amber:#e6be77;--error:#ffc2a3;--mono:'Courier New',monospace}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:16px/1.5 var(--mono);padding:0 20px}button,input,select{font:inherit}button,summary,select{cursor:pointer}button{border:1px solid var(--line);background:transparent;color:var(--text);min-height:44px;padding:8px 12px;border-radius:2px;touch-action:manipulation}button:hover{background:var(--panel);border-color:var(--text)}button:active{background:var(--line)}button:disabled{opacity:.45;cursor:default}button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible,a:focus-visible,[tabindex]:focus-visible{outline:2px solid var(--text);outline-offset:3px}a{color:var(--text);text-underline-offset:4px}h1,h2,p{margin:0}h2{font-size:14px;font-weight:normal}.topbar,main,footer{max-width:740px;margin:auto}.topbar{display:flex;gap:14px;align-items:center;flex-wrap:wrap;padding:18px 0 14px}.wordmark{font-size:22px;font-weight:bold;letter-spacing:.04em;color:var(--bright)}.edition{font-size:9px;letter-spacing:.08em;color:var(--muted);margin-left:auto}.topbar nav{width:100%;display:flex;gap:16px}.topbar nav button{font-size:11px;border:0;min-height:32px;padding:4px 0;color:var(--muted)}.topbar nav button:last-child{margin-left:auto}.monitor{border:1px solid #697259;box-shadow:0 0 0 5px #23291f,0 15px 50px #0004;background:var(--screen);padding:0 18px 12px}.location-bar{display:flex;justify-content:space-between;gap:14px;align-items:center;padding:13px 0 10px;border-bottom:1px solid var(--line)}.location-bar h1{font:normal 18px/1.3 var(--mono);color:var(--bright)}.location-bar>#area,.location-bar #area{display:none}.clock-box{display:flex;align-items:center;gap:10px}.clock-box .eyebrow{font-size:10px;color:var(--muted)}.clock-box strong{font-weight:normal;font-size:18px}#turns{display:none}.scene-frame{background:#000;display:flex;align-items:center;justify-content:center;min-height:0}canvas{display:block;width:min(100%,480px);height:auto;image-rendering:pixelated;aspect-ratio:280/152}.scene-frame #text-mode{padding:40px;min-height:180px;text-align:center;color:var(--muted);font-size:14px}.exits-row{display:flex;align-items:center;gap:12px;border-bottom:1px solid var(--line);font-size:12px;min-height:44px;padding:4px 0}.exits-row>span{color:var(--muted);font-size:11px}#exits{display:flex;flex-wrap:wrap;gap:8px}#exits button{font-size:12px;border:0;padding:5px 8px;min-height:34px;text-decoration:underline;text-underline-offset:3px}.journal-top{display:flex;align-items:center;justify-content:space-between;padding:3px 0}.journal-top h2{font-size:10px;letter-spacing:.06em;color:var(--muted)}.journal-top button{font-size:10px;color:var(--muted);min-height:30px;border:0;padding:4px 0}#journal{height:152px;overflow:auto;padding:8px 0 12px;scrollbar-color:var(--line) var(--screen)}#journal.expanded{height:300px}.entry{margin-bottom:18px}.entry:last-child{margin-bottom:0}.entry.old{display:none}#journal.expanded .entry.old{display:block;border-bottom:1px dashed var(--line);padding-bottom:18px}.entry .action{font-size:12px;color:var(--muted);margin-bottom:8px;display:flex;gap:12px}.action .stamp{margin-left:auto;white-space:nowrap}.entry .arrival{display:none}.entry.win .arrival{display:block;font-size:20px;color:var(--bright);margin:10px 0}.entry .result{font-size:16px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere;text-shadow:0 0 4px #87cf431a}.command-area{border-top:1px solid var(--line);padding-top:10px}label{display:block;font-size:10px;letter-spacing:.06em;color:var(--muted);margin-bottom:6px}.command-line{display:flex;gap:8px;align-items:center}.command-line>span{font-size:22px;color:var(--bright)}input{min-width:0;width:100%;min-height:44px;border:0;border-bottom:1px solid var(--line);background:transparent;color:var(--bright);padding:8px;font-size:17px;border-radius:0;caret-color:var(--bright)}input::placeholder{color:#98a68b}#execute{font-size:12px;min-height:44px;white-space:nowrap;flex-shrink:0;background:#253020;border-color:#6d805b}#command-help{font-size:10px;color:var(--muted);margin-top:7px}#error{font-size:12px;color:var(--error);margin-top:8px}#error:empty{display:none}#prompt-options{display:flex;gap:8px;flex-wrap:wrap;padding:0 0 12px}#prompt-options button{min-width:44px}.examples{margin-top:24px;padding-bottom:16px}.examples-heading{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:10px}.examples-heading h2{font-size:11px;color:var(--bright);letter-spacing:.04em}.examples-heading>span{font-size:10px;color:var(--muted)}#suggestions{display:flex;flex-wrap:wrap;gap:8px}#suggestions button{font-size:12px;min-height:38px;padding:7px 10px;background:var(--panel)}#completion{color:var(--muted);font-size:12px;margin-top:10px;min-height:24px}kbd{display:inline-block;border:1px solid #839371;border-bottom-width:2px;border-radius:3px;font:12px var(--mono);padding:1px 5px;color:var(--bright);margin-right:4px}.possessions,.guide{border-top:1px solid var(--line)}.guide{border-bottom:1px solid var(--line)}summary{padding:14px 0;min-height:48px;font-size:12px;color:var(--muted)}.tabs{display:flex;gap:16px;border-bottom:1px solid var(--line)}.tabs button{font-size:12px;border:0;border-bottom:2px solid transparent;color:var(--muted);border-radius:0}.tabs button[aria-selected=true]{border-bottom-color:var(--text);color:var(--bright)}.tabs span{font-size:10px;color:var(--text);padding-left:6px}.item-list{display:flex;flex-wrap:wrap;gap:8px;padding:14px 0}.item-list button{font-size:12px;display:flex;gap:10px;align-items:center}.item-list button[aria-pressed=true]{background:var(--panel);border-color:var(--text)}.worn{font-size:9px;color:var(--amber);text-transform:uppercase}.selection-help{font-size:11px;color:var(--muted);padding-bottom:15px}.guide-grid{display:grid;grid-template-columns:1fr 1fr;gap:28px;padding:4px 0 20px}.guide-grid h2{font-size:13px;color:var(--bright);margin-bottom:12px}.guide-grid p{font-size:12px;color:var(--muted);margin-bottom:12px}code{font:inherit;color:var(--text)}footer{display:flex;justify-content:space-between;gap:20px;padding:20px 0;font-size:10px;color:var(--muted)}dialog{background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:4px;width:min(540px,calc(100vw - 32px));max-height:85dvh;padding:24px;box-shadow:0 20px 80px #0009}dialog::backdrop{background:#000b}dialog h2{font:normal 24px/1.2 var(--mono);margin-bottom:14px}dialog p{font-size:14px;margin-bottom:20px}.dialog-top,.dialog-actions{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:20px}.dialog-top button{font-size:12px}.dialog-top .eyebrow{font-size:10px;color:var(--muted)}.dialog-actions{margin:22px 0 0}.dialog-actions button{font-size:13px}.primary{background:var(--text);color:var(--screen);border-color:var(--text)}.primary:hover{background:var(--bright)}select{width:100%;font-size:14px;padding:12px;background:var(--screen);color:var(--text);border:1px solid var(--line);min-height:44px}#hints-list{padding-left:22px;font-size:14px}#hints-list li{margin:16px 0}.muted{color:var(--muted)}.skip{position:absolute;top:-70px;padding:10px;background:var(--screen);z-index:10}.skip:focus{top:5px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}[hidden]{display:none!important}@media(max-width:600px){body{padding:0 14px}.topbar{gap:8px;padding-top:16px}.wordmark{font-size:18px}.edition{font-size:8px}.monitor{padding:0 12px 12px}.location-bar{gap:10px}.location-bar h1{font-size:15px}.clock-box{gap:6px}.clock-box .eyebrow{display:none}.clock-box strong{font-size:16px}#exits{gap:4px}#exits button{padding:5px;min-height:44px}.journal-top button{min-height:40px}#journal{height:180px}.entry .result{font-size:16px}#execute{padding:8px;font-size:11px}.command-line{gap:5px}input{font-size:16px}.examples-heading{align-items:start;flex-direction:column;gap:3px}#suggestions button{min-height:44px}.guide-grid{grid-template-columns:1fr;gap:10px}footer{display:block}footer>a{display:inline-block;margin-top:10px}.topbar nav button{min-height:44px}.dialog-actions{flex-wrap:wrap}dialog{padding:20px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

/* Illustrated backgrounds share the original 280:152 coordinate space. */
.graphics-status{font-size:10px;line-height:1.4;margin:0;padding:5px 12px;color:#8fae97;min-height:24px}
canvas[data-graphics="illustrated"]{width:100%;image-rendering:auto}

/* Classic Apple II shell. Modern scene assets retain their own geometry. */
@font-face{font-family:'Print Char 21';src:url('assets/fonts/PrintChar21.ttf') format('truetype');font-weight:400;font-style:normal;font-display:swap}
body.classic{--bg:#000;--screen:#000;--panel:#141414;--text:#fff;--bright:#fff;--muted:#ccc;--line:#666;--error:#fff;--mono:'Print Char 21',monospace;background:#000;color:#fff;padding:16px;font:16px/1.25 var(--mono);font-synthesis:none;-webkit-font-smoothing:none;text-transform:uppercase}
.classic :is(main,.topbar,footer,#opening){max-width:840px;margin-left:auto;margin-right:auto}
.classic .monitor{border:0;box-shadow:none;padding:0;background:#000}
.classic .location-bar{padding:0 0 12px;border:0}
.classic .location-bar h1{font-size:16px;line-height:1.25}
.classic .scene-frame{width:100%}
.classic canvas{width:100%}
.classic .command-area{border:0;padding:0}
.classic #journal{height:144px;padding:12px 0 0}
.classic #journal.expanded{height:320px}
.classic .entry .result,.classic .entry .action{font:inherit;line-height:1.25;color:#fff;text-shadow:none}
.classic .entry .action{margin-bottom:4px}
.classic .entry.win .arrival{font:inherit}
.classic .command-line{gap:0;min-height:44px}
.classic .classic-prompt{font:inherit;flex:0 0 auto;margin-right:1ch}
.classic .input-shell{position:relative;flex:1;min-width:0;overflow:hidden;font:inherit}
.classic #command{display:block;font:inherit;line-height:1.25;text-transform:uppercase;padding:0;min-height:44px;border:0;caret-color:transparent;outline:none;background:transparent}
.classic #caret-measure{position:absolute;visibility:hidden;white-space:pre;font:inherit;text-transform:uppercase}
.classic #block-cursor{position:absolute;top:50%;transform:translateY(-50%);width:.875em;height:.875em;background:#fff;pointer-events:none;mix-blend-mode:difference;animation:classic-cursor 1s step-end infinite}
.classic #command-form>label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.classic:not(.helpers-on) :is(.topbar,#graphics-status,.exits-row:not(.scene-exit-hint),.journal-top,.examples,.possessions,.guide,#command-help,#execute,#prompt-options,.verb-row,.utility-actions,footer){display:none!important}
.classic.game-ended:not(.helpers-on) .topbar{display:block!important}
.classic.game-ended:not(.helpers-on) .topbar :is(.wordmark,.edition,#save,#restore,#hints-open){display:none}
.classic :is(button,select){border-radius:0}
.classic #execute{background:#222;border-color:#888}
.classic :is(.topbar nav button,#graphics-status,#command-help,.examples-heading h2,.examples-heading>span,.journal-top h2,.journal-top button,footer){font-size:12px;letter-spacing:0}
.classic .topbar{padding:0 0 12px}
.classic.opening-active :is(.topbar,main,footer,.skip){display:none!important}
.classic #opening{width:100%}
.classic .language-picker{display:flex;justify-content:flex-end;gap:16px;margin-bottom:8px}
.classic .language-picker button{font:14px var(--mono);text-transform:none;padding:4px 8px;border-color:transparent;color:#aaa}
.classic .language-picker button[aria-pressed="true"]{color:#fff;text-decoration:underline;text-underline-offset:5px}
.classic .opening-screen{display:block;width:100%;padding:0;border:0;background:#000;text-align:left;color:#fff;font:inherit}
.classic .opening-screen:focus-visible{outline:1px solid #fff;outline-offset:4px}
.classic .title-art{position:relative;display:block;width:100%;aspect-ratio:1602/982;overflow:hidden;background:#000;container-type:inline-size}
.classic .title-illustration{display:block;width:100%;height:auto;pointer-events:none}
.classic .opening-credit{position:absolute;left:3%;color:#fff;font-size:clamp(8px,2.5cqw,21px);line-height:1.4;white-space:nowrap;pointer-events:none}
.classic .credit-author{top:54%}
.classic .credit-artist{top:66%}
.classic .credit-copyright{top:90%}
.classic .cigarette-effects{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
/* Only smoke geometry and ember opacity change. The image and smoke origin stay fixed. */
.classic .smoke-one{animation:cigarette-smoke-one 4.8s ease-in-out infinite}
.classic .smoke-two{animation:cigarette-smoke-two 6.2s ease-in-out infinite}
.classic .cigarette-ember{animation:cigarette-ember 4.8s ease-in-out infinite}
.classic .opening-continue{display:block;text-align:center;width:100%;background:#000;border:0;font:inherit;min-height:52px;padding:12px 0;color:#fff}
.classic .intro-copy{padding:12px 0;line-height:1.25}
.classic .intro-copy p{margin-bottom:1em}
@keyframes cigarette-smoke-one{0%,100%{d:path("M781 630 C768 612 786 599 769 581 C748 560 744 546 757 527 C770 507 748 490 735 470");opacity:.65}50%{d:path("M781 630 C787 613 760 600 765 581 C772 560 742 544 739 527 C736 507 759 492 746 470");opacity:.9}}
@keyframes cigarette-smoke-two{0%,100%{d:path("M781 630 C786 611 760 604 761 584 C763 563 743 554 738 536 C734 518 748 499 728 480");opacity:.35}50%{d:path("M781 630 C769 614 782 601 768 584 C749 563 759 551 754 536 C747 518 728 502 736 480");opacity:.65}}
@keyframes cigarette-ember{0%,65%,100%{opacity:.3}35%{opacity:.85}}
@keyframes classic-cursor{0%,49.99%{opacity:1}50%,100%{opacity:0}}
@media(min-width:880px){body.classic{font-size:24px;line-height:1}.classic .location-bar h1{font-size:24px;line-height:1}.classic #journal{height:168px}.classic .entry :is(.result,.action),.classic .intro-copy,.classic #command{line-height:1}}
@media(max-width:480px){body.classic{padding:12px 8px}.classic #journal{height:180px}.classic .location-bar{padding-bottom:8px}.classic .opening-continue{font-size:12px}.classic .intro-copy{font-size:16px}}
@media(prefers-reduced-motion:reduce){.classic #block-cursor,.classic .smoke-trail,.classic .cigarette-ember{animation:none}.classic .smoke-one{opacity:.55}.classic .smoke-two{opacity:.3}.classic .cigarette-ember{opacity:.3}}

/* Only the unlisted MAP command opens this reference; no game state changes. */
#map-dialog{width:fit-content;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);padding:12px;background:#000;color:#fff;border:1px solid #fff}
.map-toolbar{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:10px}
#map-title{font:inherit;margin:0}
#map-close{font-size:12px;min-height:44px}
.secret-map{display:block;width:auto;height:auto;max-width:100%;max-height:calc(100dvh - 116px);object-fit:contain;margin:auto}

.classic .language-picker{flex-wrap:wrap;align-items:center}.classic .project-about{font:11px/1.5 var(--mono);text-transform:none;display:inline-flex;align-items:center;min-height:44px;margin-right:auto;color:#ccc}@media(max-width:520px){.classic .project-about{flex-basis:100%}.classic .language-picker{gap:4px 16px}}

/* The cage has too little floor for a natural south/west path cue. */
.classic:not(.helpers-on) .exits-row.scene-exit-hint{display:flex!important;gap:10px;align-items:center;font-size:11px;padding:4px 12px}
.exits-row.scene-exit-hint #exits{display:flex;gap:8px}

/* Command help remains readable and links stay available in the classic shell. */
.classic #journal.showing-help{height:auto;min-height:144px}
.command-reference .result+.result{margin-top:12px}

/* Phone play surface: the scene and command stay in place; only the log scrolls.
   VisualViewport supplies the space above the keyboard, including iOS panning. */
html.mobile-play{overflow:hidden;overscroll-behavior:none}
body.classic.mobile-play{position:fixed;inset:0;padding:0;overflow:hidden;overscroll-behavior:none;-webkit-text-size-adjust:100%;text-size-adjust:100%}
.classic.mobile-play main{position:fixed;top:var(--game-top,0px);left:0;right:0;height:var(--game-height,100dvh);max-width:840px;padding:8px max(8px,env(safe-area-inset-right)) max(4px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));overflow:hidden}
.classic.mobile-play .monitor{height:100%;display:flex;flex-direction:column;min-height:0}
.classic.mobile-play .location-bar{flex:none;padding:0 0 6px}
.classic.mobile-play .location-bar h1{font-size:14px;line-height:1.25}
.classic.mobile-play .game-layout{display:flex;flex:1;flex-direction:column;min-height:0}
.classic.mobile-play .scene-column{flex:none;min-height:0}
.classic.mobile-play .scene-frame{height:min(calc((100vw - 16px)*152/280),var(--scene-max-height,calc(100dvh - 128px)))}
.classic.mobile-play .scene-frame canvas{width:100%;height:100%;object-fit:contain}
.classic.mobile-play .scene-frame #text-mode{min-height:0;padding:12px;font-size:14px}
.classic.mobile-play .play-column{display:flex;flex:1;flex-direction:column;min-height:0;overflow:hidden}
.classic.mobile-play #journal,.classic.mobile-play #journal.showing-help,.classic.mobile-play #journal.expanded{flex:1;height:0;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;padding:10px 0 8px;scrollbar-gutter:stable}
.classic.mobile-play .entry :is(.result,.action,.arrival){font-size:14px;line-height:1.35;overflow-wrap:break-word;word-break:normal}
.classic.mobile-play .command-area{flex:none;background:#000;padding-top:4px}
.classic.mobile-play #command,.classic.mobile-play .classic-prompt{font-size:16px;line-height:1.25}
.classic.mobile-play #error{max-height:3.6em;overflow:auto}
