@font-face{font-family:'Press Start 2P';src:url(fonts/PressStart2P-Regular.woff2) format('woff2');font-weight:400;font-style:normal;font-display:swap}
:root{color-scheme:dark;--px:'Press Start 2P',monospace;--ink:#f4f4f4;--navy:#101838;--rim:#8090c8;--gold:#f4d040;--on:#e03030;--off:#5a1e1e;--fs:16px;--lh:24px}
*{box-sizing:border-box}
html,body{margin:0;height:100%;overflow:hidden;background:#070d16;color:var(--ink);font-family:var(--px);-webkit-font-smoothing:none;text-rendering:optimizeSpeed}
#viewport{position:fixed;inset:0}
canvas{display:block;width:100%;height:100%;touch-action:none}
.vignette{position:fixed;inset:0;pointer-events:none;background:linear-gradient(#07121c99,transparent 25%,transparent 65%,#07121cbf)}
svg{display:inline-block;vertical-align:middle;shape-rendering:crispEdges}
[hidden]{display:none!important}
.frame{background:var(--navy);border:2px solid var(--ink);box-shadow:inset 0 0 0 2px var(--navy),inset 0 0 0 4px var(--rim)}
/* HUD strip */
#hud{position:fixed;top:0;left:0;right:0;height:calc(40px + env(safe-area-inset-top));background:rgba(0,0,0,.55);display:grid;grid-template-columns:1fr auto 1fr;align-items:center;padding:env(safe-area-inset-top) calc(10px + env(safe-area-inset-right)) 0 calc(10px + env(safe-area-inset-left));font-size:var(--fs);line-height:1;z-index:10;user-select:none;-webkit-user-select:none}
#hud .zone{display:flex;align-items:center;gap:12px;min-width:0}
#hud .zone.right{justify-self:end}
#hud b{font-weight:400}
#hud .counter{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
#hud .counter svg{width:16px;height:16px}
#hud #companion svg{width:12px;height:12px}
#item{width:32px;height:32px;border:2px solid var(--ink);background:#000;display:flex;align-items:center;justify-content:center}
#item svg{width:24px;height:24px}
.row{display:inline-flex;gap:2px;vertical-align:middle}
#hearts svg{width:10px;height:10px}
.sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.pixel{font:8px/1 var(--px);color:var(--ink);background:var(--navy);border:2px solid var(--ink);box-shadow:inset 0 0 0 2px var(--navy),inset 0 0 0 4px var(--rim);padding:0 10px;min-height:28px;cursor:pointer;pointer-events:auto;text-transform:uppercase;touch-action:manipulation;-webkit-user-select:none;user-select:none}
.pixel:hover,.pixel:focus-visible{color:var(--gold);outline:none}
.pixel:active{background:#1a2450}
/* reticle: a dot, or a hollow square when something can be examined */
#reticle{position:fixed;left:50%;top:50%;width:4px;height:4px;margin:-2px 0 0 -2px;background:var(--ink);opacity:.85;pointer-events:none;z-index:4}
#reticle.hot{width:10px;height:10px;margin:-5px 0 0 -5px;background:transparent;border:2px solid var(--ink)}
/* dialogue box */
#dialogue{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);width:min(640px,92vw);min-height:calc(var(--lh)*3 + 32px);padding:14px 18px 16px;font-size:var(--fs);line-height:var(--lh);z-index:6;cursor:pointer;-webkit-user-select:none;user-select:none}
#text{white-space:pre-wrap;word-break:break-word;min-height:calc(var(--lh)*3)}
#text .pending{visibility:hidden}
#choices{list-style:none;margin:6px 0 0;padding:0}
#choices li{padding:2px 0 2px 24px;position:relative;cursor:pointer;white-space:normal;word-break:break-word}
#choices li.on::before{content:'▶';position:absolute;left:0;color:var(--gold)}
#choices li svg{width:14px;height:14px;margin-left:8px}
#more{position:absolute;right:10px;bottom:6px;font-size:var(--fs);line-height:1;animation:blink 1s steps(1) infinite}
#extra{display:flex;align-items:center;gap:10px;margin-top:8px;font-size:var(--fs)}
#extra:empty{display:none}
#extra .row{gap:3px}
#extra svg{width:14px;height:14px}
@keyframes blink{50%{opacity:0}}
/* touch controls */
#touch{display:none;position:fixed;left:0;right:0;bottom:0;height:0;z-index:6}
.dpad{position:absolute;left:calc(12px + env(safe-area-inset-left));bottom:calc(12px + env(safe-area-inset-bottom));display:grid;grid-template-columns:repeat(3,44px);grid-template-rows:repeat(3,44px);gap:2px}
.dpad button{min-height:44px;min-width:44px;padding:0;font-size:12px;touch-action:none;-webkit-touch-callout:none}
.dpad [data-key=ArrowUp]{grid-column:2;grid-row:1}
.dpad [data-key=ArrowLeft]{grid-column:1;grid-row:2}
.dpad [data-key=ArrowRight]{grid-column:3;grid-row:2}
.dpad [data-key=ArrowDown]{grid-column:2;grid-row:3}
#interact{position:absolute;right:calc(16px + env(safe-area-inset-right));bottom:calc(24px + env(safe-area-inset-bottom));width:56px;height:56px;font-size:16px;padding:0}
/* wherever the touch controls show, the dialogue box sits above them and taps on it never zoom or scroll */
@media (pointer:coarse),(max-width:760px){#touch{display:block}#dialogue{bottom:calc(156px + env(safe-area-inset-bottom))}#dialogue,#title,#choices li{touch-action:manipulation}#choices li{padding-top:6px;padding-bottom:6px}#pause .panel{touch-action:pan-y}}
#touch.off{display:none}
/* pause screen */
#pause{position:fixed;inset:0;background:rgba(0,0,0,.8);z-index:8;display:flex;align-items:center;justify-content:center;padding:48px 16px 16px}
#pause .panel{width:min(720px,94vw);max-height:calc(100vh - 64px);overflow:auto;padding:18px 20px;font-size:8px;line-height:14px;outline:none}
#pause h1{font-size:16px;line-height:1;margin:0 0 10px;font-weight:400}
#pause .obj{color:var(--gold);margin-bottom:12px}
#pause h2{font-size:8px;line-height:1;margin:12px 0 6px;color:var(--rim);font-weight:400}
.grid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.cell{border:2px solid var(--rim);min-height:44px;display:flex;align-items:center;justify-content:center;gap:8px;background:#0b1128;padding:4px;white-space:nowrap;overflow:hidden}
.cell svg{width:24px;height:24px}
.cell.acct svg{width:16px;height:16px}
#journal{max-height:26vh;overflow:auto;border:2px solid var(--rim);padding:6px 8px;background:#0b1128}
#journal p{margin:0 0 8px}
#options{list-style:none;margin:12px 0 0;padding:0;font-size:12px;line-height:20px}
#options li{padding-left:22px;position:relative;cursor:pointer}
#options li.on::before{content:'▶';position:absolute;left:0;color:var(--gold)}
#pause .hint{margin-top:10px;color:var(--rim)}
/* title screen */
#title{position:fixed;inset:0;background:rgba(0,0,0,.6);z-index:9;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:18px;cursor:pointer;-webkit-user-select:none;user-select:none}
#title .word{font-size:24px;line-height:1;letter-spacing:2px}
#title .sub{font-size:8px;line-height:1;color:#c0c8e8}
#title .press{font-size:8px;line-height:1;margin-top:26px;animation:blink 1.1s steps(1) infinite}
/* phones */
@media (max-width:760px){:root{--fs:12px;--lh:18px}#hud{height:calc(36px + env(safe-area-inset-top));padding:env(safe-area-inset-top) calc(8px + env(safe-area-inset-right)) 0 calc(8px + env(safe-area-inset-left))}#hud .word{display:none}#hud .zone{gap:8px}#hud .counter svg{width:12px;height:12px}#hud #companion svg{width:10px;height:10px}#hearts .row{gap:1px}#hearts svg{width:7px;height:7px}#item{width:28px;height:28px}#item svg{width:20px;height:20px}.pixel{min-height:24px;padding:0 6px}#dialogue{width:94vw;padding:10px 12px 14px}#choices li{padding:7px 0 7px 18px}#choices li.on::before{font-size:10px;top:10px}#pause{padding:44px 10px 10px}#pause .panel{padding:12px}#pause h1{font-size:12px;line-height:1.4}.cell.acct{flex-direction:column;gap:3px;white-space:normal;text-align:center;word-break:break-word}#options{font-size:10px;line-height:18px}}
@media (prefers-reduced-motion:reduce){#more,#title .press{animation:none}}
