:root{color-scheme:dark;--paper:#f8edcd;--muted:#c4bfd0;--night:#0b0c1e;--panel:#17182e;--gold:#ffc857;--cyan:#78e3e8;--line:#60516d;font:18px/1.45 Nunito,system-ui,sans-serif;background:var(--night);color:var(--paper)}*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0;padding:env(safe-area-inset-top) max(8px,env(safe-area-inset-right)) env(safe-area-inset-bottom) max(8px,env(safe-area-inset-left));background:radial-gradient(ellipse at top,#23123d,var(--night) 65%);min-height:100dvh}button,select{font:inherit;color:inherit}button{min-width:44px;min-height:44px;padding:8px 13px;border:1px solid var(--line);border-radius:12px;background:#25223b;cursor:pointer;touch-action:manipulation;line-height:1.25}button:hover:not(:disabled){border-color:var(--gold);background:#302943}button:focus-visible,select:focus-visible{outline:3px solid var(--cyan);outline-offset:3px}button:disabled{opacity:.46;cursor:default}button[aria-pressed=true]{border-color:var(--cyan);box-shadow:inset 0 0 0 2px var(--cyan)}button.primary,.homeActions>button:first-child{background:var(--gold);color:#211526;border-color:var(--gold);font-weight:800}#app{max-width:1080px;margin:auto}.mast{display:flex;align-items:center;gap:12px;padding:10px 0}.brand{color:var(--gold);font-size:32px}h1{font:600 clamp(22px,4vw,36px)/1.1 Georgia,serif;flex:1;margin:0}h2{font:600 1.25em/1.2 Georgia,serif;margin:0}p{margin:10px 0}#home{text-align:center;max-width:900px;margin:0 auto}.cover{width:100%;aspect-ratio:3/2;max-height:48dvh;overflow:hidden;border-radius:20px;border:1px solid var(--line);background:#1f1147}.cover img{width:100%;height:100%;object-fit:cover}.homeActions{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin:18px 0}#progress{color:var(--cyan);font-weight:800}.hud{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.hud strong{flex:1 1 180px}.hud span{font-size:.88em;color:var(--muted)}#status{font-size:.9em;margin:6px 0;min-height:1.3em;color:var(--cyan)}#stage{position:relative;width:100%;aspect-ratio:3/2;background:#152239;border:1px solid #775d77;border-radius:16px;overflow:hidden}#stage canvas,#stage svg,#hotspots{position:absolute;inset:0;width:100%;height:100%}#hotspots button{position:absolute;padding:2px;background:#091c3414;border:1px dashed #ffd687ab;border-radius:8px;font-size:0;min-width:44px;min-height:44px}#hotspots button:focus-visible,#hotspots button:hover{background:#00e5ff21;border-color:var(--cyan);outline-offset:-3px}.wallNav{display:flex;align-items:center;justify-content:center;gap:12px;margin:8px 0}.wallNav strong{min-width:6em;text-align:center}.tools{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}.tools button{flex:1 1 auto}.inventory{display:flex;gap:6px;overflow-x:auto;overscroll-behavior-x:contain;padding:6px 2px 10px}.inventory button{flex:0 0 110px;display:flex;align-items:center;flex-direction:column;justify-content:flex-start;gap:2px;font-size:.8em;padding:5px}.inventory img{height:58px;width:58px;object-fit:contain}.inventory:empty{display:none}#selection,#objectSelection{font-size:.9em;color:var(--gold);min-height:1.35em}#notice{font-size:.9em;color:var(--gold);overflow-wrap:anywhere;margin:12px 0}#result{padding:18px;border:1px solid var(--gold);border-radius:16px;text-align:center;background:#211a32}#result button{margin:5px}dialog{padding:0;border:1px solid #90738f;border-radius:18px;color:var(--paper);background:var(--panel);width:min(720px,calc(100% - 16px));max-height:calc(100dvh - 20px);overflow:hidden;box-shadow:0 20px 90px #000a}dialog[open]{display:flex;flex-direction:column}dialog::backdrop{background:#070915ba;backdrop-filter:blur(3px)}dialog>header{display:flex;align-items:center;gap:10px;padding:10px 12px;border-bottom:1px solid var(--line);flex:none;background:var(--panel);z-index:2}dialog>header h2{flex:1}dialog footer{display:flex;flex-wrap:wrap;gap:6px;flex:none;padding:10px 12px;border-top:1px solid var(--line);background:var(--panel)}dialog footer:empty{display:none}dialog footer button{flex:1 1 auto}.sheetBody{padding:12px;overflow:auto;overscroll-behavior:contain;min-height:0}#loading{padding:20px;max-width:460px}#loading p{margin-top:0}.diagram{white-space:pre-line;padding:10px;background:#0c1224;border-radius:10px;color:var(--cyan);overflow-wrap:anywhere}.diagram:empty{display:none}#puzzle{display:flex;flex-wrap:wrap;gap:6px;margin:12px 0}#puzzle>.full{flex-basis:100%}#puzzle.grid{display:grid;grid-template-columns:repeat(3,minmax(44px,1fr));max-width:390px;margin:12px auto}#puzzle .full{grid-column:1/-1}#puzzle button{flex:1 1 25%;min-height:48px}.roomCards{display:grid;gap:9px}.roomCards button{display:flex;justify-content:space-between;align-items:center;text-align:left;gap:10px;padding:14px}.settingsRow{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:14px;flex-wrap:wrap}.settingsRow select{max-width:100%;background:var(--night);border:1px solid var(--line);padding:8px;border-radius:8px;min-height:44px}.keepsakes{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:12px}.keepsakes figure{margin:0;text-align:center;padding:8px;border:1px solid var(--line);border-radius:12px}.keepsakes img{width:100%;height:130px;object-fit:contain}.keepsakes figcaption{font-size:.85em}.keepsakes button{width:100%;margin-top:6px}.motionOff *{scroll-behavior:auto!important;animation:none!important;transition:none!important}@media(max-width:450px){:root{font-size:17px}.mast{padding:8px 0}h1{font-size:25px}.hud{gap:5px}.hud strong{flex-basis:100%}.hud button{padding:6px 10px}.inventory button{flex-basis:90px}.inventory img{width:48px;height:48px}.tools button{font-size:.9em;padding:7px}dialog>header{padding:8px}dialog footer{padding:8px}.sheetBody{padding:10px}.cover{max-height:40dvh}}@media(orientation:landscape) and (max-height:500px){body>.mast,body #run .hud strong{display:none}#app>.mast{padding:4px 0}#app>.mast h1{font-size:20px}.brand{font-size:20px}.hud{justify-content:center}.hud strong{display:none}#run{max-width:900px;margin:auto}#stage{max-width:62dvh;margin:auto}.wallNav{margin:4px 0}.tools{margin:4px 0}.inventory{padding:2px;max-width:100%}.inventory button{flex-direction:row;flex-basis:125px;min-height:44px}.inventory img{width:34px;height:34px}#status{margin:2px}.sheetBody{padding:8px}dialog{max-height:calc(100dvh - 8px)}dialog>header,dialog footer{padding:6px 10px}.cover{max-height:36dvh}}

.journalBookmark{float:right;width:72px;height:96px;object-fit:contain;margin:0 0 10px 12px}.sheetBody:has(.journalBookmark) .diagram{min-height:106px}

dialog>header h2{min-width:0;overflow-wrap:anywhere}dialog>header>button{flex:none}.mast h1{min-width:0;overflow-wrap:anywhere}

.languageCycle{display:flex;gap:8px;margin:0 0 14px;flex-wrap:wrap}.languageCycle button{flex:1}

button{overflow-wrap:anywhere}dialog>header{flex-wrap:wrap;justify-content:flex-end}dialog>header h2{flex:1 1 155px}

#puzzle.grid button[data-command=digit][data-value="0"]{grid-column:2}.editorTools{display:flex;gap:6px}.editorTools button{flex:1 1 0!important;min-width:44px}
