

:root{color-scheme:dark;--ink:#f9eedc;--muted:#d4c9b5;--accent:#efbf70;--glass:#17242be6;--paper:#f1e3c9;--dark:#24252b;font-family:system-ui,sans-serif}*{box-sizing:border-box}body{margin:0;background:#10181d;color:var(--ink);height:100dvh;overflow:hidden}button,input,select{font:inherit}button,a{touch-action:manipulation}button{cursor:pointer}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #ffd579;outline-offset:4px}button{color:inherit;border:1px solid #ffffff36;background:#24333cbf;border-radius:7px;padding:.65rem .85rem}button:hover{background:#3b4b53}button:disabled{opacity:.45;cursor:default}.primary{background:#efbf70;color:#24252b;border-color:#efbf70;font-weight:700}.primary:hover{background:#f6d7a1}h1,h2,h3,p{margin-top:0}h1,h2,h3{font-family:Georgia,serif;font-weight:400}a{color:inherit}#game{height:100dvh;isolation:isolate;position:relative;overflow:hidden}.backdrop{position:absolute;inset:0;background:#13191d}.backdrop img{width:100%;height:100%;object-fit:cover;opacity:.48;filter:blur(24px)}.viewport{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}.painting{position:relative;aspect-ratio:1672/941;width:min(100vw,177.68dvh);max-height:100dvh;flex:none;box-shadow:0 0 80px #0008}.painting>img{display:block;width:100%;height:100%;object-fit:fill}.hotspots{position:absolute;inset:0}.hotspot{position:absolute;border:0;background:transparent;padding:0;border-radius:0;color:transparent}.hotspot:hover,.hotspot:focus-visible{background:transparent;outline:0;box-shadow:none}.hotspot.using{cursor:crosshair}.hud{position:absolute;top:max(18px,env(safe-area-inset-top));left:max(22px,env(safe-area-inset-left));right:max(22px,env(safe-area-inset-right));display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;pointer-events:none}.hud>*{pointer-events:auto}.location{padding:10px 15px;background:#14212bdd;border:1px solid #f5e5bf33;border-radius:7px;max-width:55%;backdrop-filter:blur(12px)}.eyebrow{text-transform:uppercase;letter-spacing:.16em;font-size:10px;font-weight:700;color:var(--accent);display:block;margin-bottom:5px}.location h1{font-size:clamp(15px,2vw,23px);margin:0}.hud-actions{display:flex;gap:6px}.hud-actions button{background:#14212bdd;min-width:40px;min-height:40px;backdrop-filter:blur(12px)}.hud-actions svg{width:19px;height:19px;display:block}#timer{font-variant-numeric:tabular-nums;font-size:12px;display:block;margin-top:5px}.controls{position:absolute;right:max(22px,env(safe-area-inset-right));bottom:max(22px,env(safe-area-inset-bottom));display:flex;gap:7px;z-index:4}.controls button{box-shadow:0 3px 14px #0005;background:#14212bea}.controls svg{width:20px;height:20px;vertical-align:middle;margin-right:6px}.exits{position:absolute;left:22px;right:22px;bottom:92px;display:flex;justify-content:center;flex-wrap:wrap;gap:8px;pointer-events:none}.exits button{pointer-events:auto;background:#162831eb;border-color:#d6c19365;font-size:12px;box-shadow:0 3px 20px #0004}.exits .locked:before{content:'◇ ';color:#e3be87}.bag-shell{position:absolute;left:22px;right:22px;bottom:153px;z-index:4;border:1px solid #e1c49655;border-radius:12px;background:#1b2325f2;box-shadow:0 12px 45px #0006;backdrop-filter:blur(15px)}.bag-shell[hidden]{display:none}.bag-top{padding:10px 13px;border-bottom:1px solid #ffffff20;display:flex;justify-content:space-between;align-items:center;font-size:12px}.bag{padding:10px;display:flex;gap:10px;overflow:auto;overscroll-behavior:contain}.bag-item{width:112px;flex:none;position:relative;display:flex;align-items:stretch;border-radius:8px;background:#bca6840e}.bag-pick{width:100%;background:transparent;border-color:#bca68444;padding:9px 4px 24px;display:flex;flex-direction:column;align-items:center;gap:5px;font-size:11px;min-height:103px}.bag-pick svg{width:46px;height:46px;color:#dfc79b}.bag-pick[aria-pressed=true]{background:#ebc17a28;border-color:#ebc17a}.inspect{position:absolute;right:3px;bottom:3px;border:0;padding:2px 6px;background:#26333d;font-size:13px;min-width:29px;min-height:24px}.observation{position:absolute;left:22px;bottom:153px;width:min(440px,calc(100vw - 44px));padding:19px 22px;background:#14232bf2;border:1px solid #d5bb8c5c;border-radius:10px;box-shadow:0 15px 50px #0007;backdrop-filter:blur(14px);z-index:5}.observation[hidden]{display:none}.observation h2{font-size:22px;margin-bottom:10px;padding-right:26px}.observation p{font-size:14px;line-height:1.65;white-space:pre-line;margin-bottom:14px}.observation .dismiss{position:absolute;right:8px;top:7px;border:0;padding:3px 8px;background:transparent}.row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.observation button{font-size:12px}.message{position:absolute;left:50%;bottom:153px;transform:translateX(-50%);max-width:min(640px,calc(100vw - 44px));background:#14232bf2;border:1px solid #d5bb8c5c;box-shadow:0 5px 30px #0006;border-radius:8px;padding:12px 18px;font-size:13px;line-height:1.5;z-index:6;white-space:pre-line}.message[hidden]{display:none}dialog{color:var(--ink);border:1px solid #d5bb8c66;border-radius:16px;background:#18262cfb;box-shadow:0 25px 100px #000a;padding:0;width:min(780px,calc(100vw - 28px));max-height:calc(100dvh - 28px);overflow:auto}dialog::backdrop{background:#0a141bb0;backdrop-filter:blur(5px)}.modal-head{position:sticky;top:0;z-index:5;background:#18262cfa;border-bottom:1px solid #ffffff22;padding:18px 25px;display:flex;gap:15px;justify-content:space-between;align-items:center}.modal-head h2{font-size:27px;margin:0}.modal-head button{padding:2px 10px;font-size:24px;background:transparent;border:0}.modal-body{padding:24px 28px 28px}.modal-body>p{line-height:1.8;white-space:pre-line}.modal-body h3{font-size:22px;margin-bottom:10px}.intro .modal-body{padding:36px 44px}.intro h2{font-size:clamp(31px,5vw,52px);line-height:1.08;margin-bottom:24px}.intro .modal-head{border:0}.intro p{font-size:15px;line-height:1.9}.small{font-size:12px;color:var(--muted);line-height:1.6}.rule-text{font-family:Georgia,serif;font-size:17px;line-height:1.8;white-space:pre-line;border-left:2px solid #dbb880;padding-left:18px;margin:0 0 25px}.paper{color:#332f32;background:radial-gradient(ellipse at 30% 5%,#fff6e6,#dccaaa);border:1px solid #b89a77;border-radius:3px;box-shadow:0 5px 25px #0004;padding:24px;font-family:Georgia,serif;line-height:1.9;white-space:pre-line}.paper p:last-child{margin-bottom:0}.poem{font-style:italic;line-height:2.1}.tokens{display:flex;flex-wrap:wrap;justify-content:center;gap:9px;padding:16px 0}.token{font-family:Georgia,serif;font-size:16px;padding:13px 18px;background:#e5d0a4;color:#3e3331;box-shadow:0 3px 0 #8d775e;border-color:#e9d4ac}.token.selected{outline:3px solid #f5c16b;outline-offset:3px;background:#fff0cc}.token.placed{opacity:.45}.slots{display:grid;grid-template-columns:repeat(auto-fit,minmax(125px,1fr));gap:12px;margin:18px 0}.slot{display:flex;flex-direction:column;min-height:90px;gap:11px;justify-content:center;align-items:center;border:1px dashed #d9b77a99;background:#101e24;color:var(--ink)}.slot strong{font-family:Georgia,serif;font-size:18px}.slot small{font-size:11px;color:var(--muted)}.puzzle-feedback{min-height:1.5em;margin-top:18px;color:#ffdda4;font-size:14px;line-height:1.6;white-space:pre-line}.document-list{display:grid;gap:18px}.note-card{padding:16px;border:1px solid #cfb27e44;border-radius:6px}.note-card h3{font-size:20px}.note-card p{font-size:14px;line-height:1.8;white-space:pre-line;margin-bottom:0}.word-lock{display:flex;justify-content:center;gap:6px;margin:20px 0;flex-wrap:wrap}.drum{width:50px;text-align:center;display:flex;flex-direction:column;gap:8px;align-items:center}.drum small{font-size:11px}.drum input{width:44px;height:62px;background:linear-gradient(#ae895f,#f2dfb7 35%,#dbc29a 65%,#97744f);color:#33271d;border:2px solid #816546;border-radius:8px;text-align:center;text-transform:uppercase;font:bold 29px Georgia,serif;caret-color:#433118}.color-lock{display:flex;gap:8px;margin:20px 0;flex-wrap:wrap;justify-content:center}.color-lock label{display:flex;flex-direction:column;gap:8px;font-size:12px}.color-lock select{background:#e7d6b3;color:#312d2c;border-radius:6px;padding:13px;max-width:105px}.jugs{display:flex;gap:24px;align-items:flex-end;justify-content:center;margin:20px 0}.jug{height:180px;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:10px;position:relative}.jug-glass{position:relative;width:88px;border:3px solid #c6a373;border-top:0;border-radius:5px 5px 28px 28px;overflow:hidden;background:#aecacf20}.jug-glass:after{content:'';position:absolute;inset:0;border:5px solid #d9ba8530;pointer-events:none}.water{position:absolute;bottom:0;width:100%;background:linear-gradient(#9cdef6ab,#3c99b4bb);border-top:3px solid #c9f5f6;transition:height .4s}.jug small{font-variant-numeric:tabular-nums}.transfer{display:flex;justify-content:center;gap:8px;flex-wrap:wrap}.transfer label{display:flex;gap:8px;align-items:center;font-size:12px}.transfer select{padding:8px;background:#273f49;color:var(--ink);border:1px solid #ffffff44;border-radius:5px}.grid-wrap{margin:20px auto;max-width:350px;position:relative}.letter-grid{display:grid;grid-template-columns:repeat(6,1fr);aspect-ratio:1;border:10px solid #a7865b;border-radius:4px;background:#f2dfb6;color:#39343c}.letter-cell{display:grid;place-content:center;font:24px Georgia,serif;border:1px solid #8a785c33;position:relative}.letter-cell.covered{background:#444449;color:transparent}.letter-cell.hole{background:#ffe9bd}.letter-cell.hole:after{content:attr(data-order);font:9px system-ui;position:absolute;top:2px;left:3px;color:#8d6d46}.letter-grid.unmirrored{transform:scaleX(-1)}.notch{color:#edca88;text-align:center;font-size:12px}.maze{display:grid;grid-template-columns:repeat(3,1fr);width:min(300px,100%);margin:22px auto;aspect-ratio:1;border:8px solid #916746;border-radius:6px;background:#bc9366;gap:3px}.maze div{display:grid;place-content:center;background:#282f35;min-height:55px;position:relative;color:#efcb80;font-size:29px}.maze .wall{background:repeating-linear-gradient(45deg,#62432e 0 8px,#ac7d51 8px 16px)}.maze small{font-size:10px;position:absolute;bottom:4px;left:5px;color:#dfcba9}.clock-face{display:block;width:min(290px,90%);margin:20px auto;background:#f3e2c2;border:12px solid #927248;border-radius:50%;color:#443831}.clock-face text{font:13px Georgia,serif;fill:currentColor}.clock-controls{display:flex;justify-content:center;gap:15px;flex-wrap:wrap}.clock-controls label{display:flex;align-items:center;gap:10px}.clock-controls select{padding:10px;color:#292d32;background:#efdbb7;border-radius:6px}.portrait-choices{display:grid;grid-template-columns:repeat(3,1fr);gap:15px;margin:20px 0}.portrait-choice{border:6px ridge #c4a678;background:#37323e;border-radius:45% 45% 8px 8px;padding:25px 8px 16px;text-align:center;font-family:Georgia,serif;font-size:18px}.portrait-choice svg{display:block;width:70px;height:90px;margin:auto auto 15px;color:#d8b995}.map{width:100%;height:auto;max-height:440px;background:#eadab9;border-radius:7px}.map line{stroke:#967c5e;stroke-width:2;stroke-dasharray:5 4}.map circle{fill:#605657;stroke:#f5e6c5;stroke-width:2}.map .current{fill:#b25436}.map text{font:11px system-ui;fill:#302d32;text-anchor:middle}.map-button-list{display:flex;flex-wrap:wrap;gap:10px;margin-top:20px}.hint-list{display:flex;flex-direction:column;gap:9px}.hint-list button{text-align:left}.check-row{display:flex;gap:10px;align-items:center;margin:18px 0}.volume{display:grid;grid-template-columns:110px 1fr 35px;gap:12px;align-items:center;margin:14px 0}.volume input{width:100%}.ending-image{width:100%;border-radius:8px;margin-bottom:20px}.finish-title{font-size:42px}.load-state{position:absolute;inset:0;display:grid;place-content:center;background:#14212b;z-index:20}body[data-episode=pastel]{--accent:#e6b7c8;--glass:#302d3de8}.timing{font-size:12px;font-style:italic;color:#c9c3b6}.status{font-size:11px;color:#c2cfb5}
@media(max-width:650px){.hud{left:12px;right:12px;top:12px}.location{max-width:54%;padding:8px 10px}.eyebrow{font-size:8px;letter-spacing:.1em}.hud-actions{gap:4px}.hud-actions button{min-width:34px;min-height:34px;padding:6px;font-size:11px}.controls{left:12px;right:12px;bottom:max(12px,env(safe-area-inset-bottom));justify-content:space-between;gap:4px}.controls button{font-size:11px;padding:9px 8px;min-height:39px}.controls svg{width:16px;height:16px;margin-right:3px}.exits{bottom:70px;left:12px;right:12px;gap:5px}.exits button{font-size:11px;padding:7px 9px}.bag-shell{left:12px;right:12px;bottom:165px}.bag-item{width:94px}.bag-pick{min-height:95px}.observation{left:12px;bottom:165px;width:calc(100vw - 24px);max-height:50dvh;overflow:auto;padding:15px 18px}.observation h2{font-size:20px}.message{bottom:165px}.modal-head{padding:14px 18px}.modal-head h2{font-size:23px}.modal-body{padding:20px 18px}.intro .modal-body{padding:20px 25px}.rule-text{font-size:15px;padding-left:12px}.slots{grid-template-columns:repeat(2,1fr)}.token{font-size:14px;padding:11px 13px}.jugs{gap:13px}.jug-glass{width:70px}.volume{grid-template-columns:80px 1fr 30px;font-size:13px}.drum{width:40px}.drum input{width:38px}.portrait-choice{font-size:14px;padding:15px 3px}.portrait-choice svg{width:50px;height:70px}.paper{padding:18px;font-size:14px}.poem{line-height:1.8}}
@media(max-height:500px){.hud{top:9px}.location{padding:7px 10px}.location h1{font-size:15px}.location .eyebrow{font-size:8px}.controls{bottom:9px}.controls button{padding:7px 10px;font-size:11px}.exits{bottom:55px}.exits button{padding:6px 9px}.bag-shell{bottom:99px;left:70px;right:70px}.bag-top{padding:5px 10px}.bag{padding:6px}.bag-item{width:90px}.bag-pick{min-height:80px;padding:4px 4px 20px}.bag-pick svg{width:30px;height:30px}.observation,.message{bottom:99px;max-height:60dvh;overflow:auto}.modal-body{padding:18px 24px}.modal-head{padding:10px 20px}.intro .modal-body{padding:16px 26px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important;animation:none!important}}

.nonogram{display:grid;grid-template-columns:45px repeat(5,minmax(25px,54px));gap:3px;justify-content:center;align-items:center;margin:24px auto}.nono-clue{text-align:center;font-size:14px;color:#efcd8e;white-space:pre-wrap;padding:6px 0}.nono-cell{aspect-ratio:1;background:#e9dbb9;border:1px solid #8c7655;border-radius:2px;padding:0;color:#936752;font-size:25px;min-width:0}.nono-cell.inked{background:#233a47}.nono-cell:hover{background:#9aa69c}.seal-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;width:min(330px,100%);margin:20px auto}.seal{background:linear-gradient(35deg,#77553e,#c29465);box-shadow:0 4px 0 #463b30;color:#fff0d3;font:20px Georgia,serif;padding:18px}.scale-diagram{max-width:400px;margin:0 auto}.scale-diagram svg,.print-proof svg,.bridge-plan svg{width:100%;display:block}.print-proof{max-width:360px;margin:15px auto}.corner-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;margin:18px 0}.bridge-plan{position:relative;max-width:550px;margin:20px auto 30px}.bridge-node{position:absolute;transform:translate(-50%,20px);font-size:11px;padding:5px 8px;white-space:nowrap;background:#273f49}.prop-layer{position:absolute;inset:0;pointer-events:none}.scene-prop{position:absolute;color:#352b20;filter:drop-shadow(1px 2px 1px #0008);opacity:.95}.scene-prop svg{display:block;width:100%;height:100%}.clock-overlay{position:absolute;left:45.9%;top:5%;width:8.9%;height:15.8%;pointer-events:none}.clock-overlay svg{width:100%;height:100%}

.message{pointer-events:auto;width:max-content;min-height:58px}
.message-copy{display:block;overflow-wrap:anywhere}
.message-close{position:sticky;top:0;float:right;min-width:44px;min-height:44px;margin:-5px -11px 5px 12px;padding:5px;font-size:24px;line-height:1;touch-action:manipulation;z-index:1}
/* Keep the title, close control and actions visible; only the observation text scrolls. */
body.escape-ui[data-escape-engine="gallery"] #observation{display:grid;grid-template-columns:minmax(0,1fr) 44px;grid-template-rows:auto minmax(0,1fr);column-gap:12px;row-gap:14px;padding:7px;overflow:hidden;scrollbar-gutter:auto}
body.escape-ui[data-escape-engine="gallery"] #observation>.observation-close-rail{grid-column:2;grid-row:1;position:relative;top:auto;width:44px;height:44px;margin:0;z-index:2}
body.escape-ui[data-escape-engine="gallery"] #observation .dismiss{position:absolute;inset:0;display:grid;place-items:center;float:none;width:44px;height:44px;min-width:44px;min-height:44px;margin:0;padding:0;border:1px solid var(--escape-line,#d5bb8c5c);border-radius:50%;line-height:1}
body.escape-ui[data-escape-engine="gallery"] #observation .dismiss svg{display:block;width:20px;height:20px;margin:0;pointer-events:none}
body.escape-ui[data-escape-engine="gallery"] #observation>h2{grid-column:1;grid-row:1;min-width:0;margin:10px 0 0 14px;padding:0;overflow-wrap:anywhere}
body.escape-ui[data-escape-engine="gallery"] #observation>p{grid-column:1/-1;grid-row:2;min-height:0;margin:0;padding:0 14px 7px;overflow:auto;overscroll-behavior:contain;overflow-wrap:anywhere}
body.escape-ui[data-escape-engine="gallery"] #observation>.row{grid-column:1/-1;grid-row:3;margin:0;padding:0 14px 7px}
body.escape-ui[data-escape-engine="gallery"] #observation>.row:empty{display:none}

[hidden]{display:none!important}

/* Shared exit, kept inside the existing game menus and start/end screens. */
.worlds-exit{margin-block:1rem;max-width:100%}.worlds-exit-link{display:inline-flex;align-items:center;min-height:44px;padding:.5rem .25rem;color:inherit;text-decoration:underline;text-underline-offset:.2em;white-space:normal}.worlds-exit-link:focus-visible{outline:2px solid currentColor;outline-offset:3px}.worlds-exit [role=alert]{margin-block:.5rem;font-size:.9em;line-height:1.5}
/* Controls for the three later tableaux. Every board stays usable by keyboard. */
body[data-episode="symbolisme"]{--gold:#e3c78b;--accent:#7ba4a1}body[data-episode="expressionnisme"]{--gold:#e6bb6c;--accent:#cb6c62}body[data-episode="surrealisme"]{--gold:#e4c69b;--accent:#84b6c0}
.suite-grid{display:grid;grid-template-columns:repeat(var(--cols),minmax(0,1fr));gap:8px;max-width:560px;margin:24px auto}.suite-grid label{display:block;min-width:0}.suite-grid label label{font-size:11px}.suite-grid select{width:100%;padding:10px 4px;min-width:0}.suite-grid button{min-width:0;min-height:46px;padding:8px}.suite-latin{padding:15px;background:repeating-linear-gradient(0deg,#3c393433 0 1px,transparent 1px 5px),#2b302e;border:1px solid #9f8d67;border-radius:5px}.suite-cylinder{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;background:linear-gradient(90deg,#5b4e35,#aa9161 10%,#4a402e 95%);padding:25px 16px;border-radius:20px;color:#fff3d1}.suite-cylinder select{max-width:100%;color:#fff}.suite-teeth{height:40px;letter-spacing:3px;font-size:24px}.suite-triangle{position:relative;height:310px;max-width:470px;margin:25px auto 55px;background:linear-gradient(148deg,transparent 49.5%,#baa06b 49.6% 50.4%,transparent 50.5%),linear-gradient(32deg,transparent 49.5%,#baa06b 49.6% 50.4%,transparent 50.5%);border-bottom:3px solid #baa06b}.suite-triangle>div{position:absolute;transform:translate(-50%,-50%);width:95px;background:#232c2a;border:1px solid #baa06b;border-radius:14px;padding:6px;font-size:11px}.suite-triangle select{width:100%;min-width:0;padding:6px}.suite-mirrors{gap:1px;border:2px solid #6a969c;background:#34575e;max-width:420px}.suite-mirrors>span,.suite-mirrors>button{aspect-ratio:1;display:grid;place-items:center;border-radius:0;background:#163a42;min-height:0;font-size:32px}.suite-mirrors>.ray{box-shadow:inset 0 0 0 3px #e7cc7e;background:#6b7248}.suite-lanterns{max-width:100%;gap:5px}.suite-lanterns button{font-size:12px;min-height:90px;border-radius:35px 35px 8px 8px;background:#252b2c}.suite-lanterns .lit,.relay-lamp.lit{background:#6d552c;color:#fff1af;box-shadow:inset 0 0 30px #e6b64666}.suite-banks{border-bottom:8px solid #82734c}.suite-banks>div{padding:15px;background:#293632;border-radius:12px}.suite-figure{display:flex;gap:10px;margin:14px 0}.suite-figure input{width:21px;height:21px}.suite-order{padding:16px 16px 16px 42px;min-height:70px;background:#2e3233;line-height:2.1}.suite-shadow-grid{max-width:280px;gap:3px}.suite-shadow-grid>span,.suite-mini>span{aspect-ratio:1;background:#a4a18e;border:2px solid transparent}.suite-shadow-grid>span.wanted{border-color:#e5bc68}.suite-shadow-grid>span.opaque,.suite-mini>span.opaque{background:#090d12}.suite-mini{width:100px;height:100px;gap:1px;margin:22px auto}.relay-lamp{padding:15px;border:1px solid #8c8b78;border-radius:50%;display:grid;place-items:center;max-width:125px;aspect-ratio:1;text-align:center}.suite-floor{font:700 60px/1.4 Georgia,serif;text-align:center;color:#f0c673}.suite-queens{max-width:340px;gap:2px}.suite-queens button{aspect-ratio:1;background:#443a3f;font-size:25px;border-radius:1px}.suite-queens button:nth-child(8n+1),.suite-queens button:nth-child(8n+3),.suite-queens button:nth-child(8n+6),.suite-queens button:nth-child(8n+8){background:#6a6464}.suite-queens .seen{background-image:repeating-linear-gradient(45deg,transparent 0 6px,#d5b38955 6px 8px)}.suite-queens .occupied{color:#ffe0a2}.suite-queens button:disabled{opacity:1}.suite-output{display:block;min-height:60px;padding:20px;border:1px solid #94845f;border-radius:6px;letter-spacing:3px;font-size:21px;overflow-wrap:anywhere}.suite-map{max-width:420px;gap:2px;background:#867a67;padding:4px}.suite-cell{aspect-ratio:1;background:#3d4543;display:grid;place-items:center;font-size:23px;border:1px solid #b5b5a255;line-height:1}.suite-cell.wall{background:#10181c;border-color:#10181c}.suite-cell.goal{box-shadow:inset 0 0 0 3px #bbcfb2}.suite-cell.beam{background:repeating-linear-gradient(45deg,#665c2e 0 4px,#b8a04e 4px 6px);color:white}.suite-directions{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;padding:12px;border:1px solid transparent}.suite-directions:focus-visible{border-color:#edc879}.suite-hourglasses{display:flex;justify-content:center;gap:50px;margin:25px auto;text-align:center}.sand-top,.sand-bottom{width:90px;height:65px;margin:auto;border:2px solid #bb9e66;background:linear-gradient(to top,#ceb175 var(--sand),#414f52 var(--sand))}.sand-top{clip-path:polygon(0 0,100% 0,52% 100%,48% 100%)}.sand-bottom{clip-path:polygon(48% 0,52% 0,100% 100%,0 100%)}.suite-projection{height:170px;display:grid;place-items:center;background:#d9cfaa;color:#182329;overflow:hidden;margin:15px auto;border:10px solid #695c3d;border-radius:3px}.suite-projection svg{height:calc(22px * var(--shadow-size));max-height:145px;max-width:90%;width:auto}.suite-readonly{pointer-events:none;opacity:.9}.suite-map-legend{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;font-size:13px}
@media(max-width:600px){.suite-grid{gap:4px}.suite-latin{padding:7px}.suite-latin select{font-size:11px}.suite-cylinder{gap:5px;padding:15px 8px;font-size:12px}.suite-teeth{font-size:19px;letter-spacing:0}.suite-triangle{max-width:calc(100% - 80px);height:250px}.suite-triangle>div{width:78px;font-size:10px}.suite-lanterns{grid-template-columns:repeat(3,1fr)}.suite-map-legend{grid-template-columns:1fr}.suite-map{gap:1px}.suite-cell{font-size:18px}.suite-hourglasses{gap:18px}.suite-directions button{padding:12px 10px}}

.suite-signs{display:flex;gap:8px;justify-content:center;flex-wrap:wrap}.suite-signs button{display:grid;place-items:center;gap:7px;min-width:95px}.suite-signs svg{height:30px;width:30px}.suite-signs [aria-pressed=true]{border-color:#e7c277;background:#8d755c55}.suite-latin>button{aspect-ratio:1.15;background:repeating-linear-gradient(0deg,#bfa77415 0 1px,transparent 1px 4px),#635b43;color:#eed8a4;border:1px solid #a19062;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:5px}.suite-latin>button svg{width:40%;height:55%}.suite-latin>button small{font-size:10px}.suite-latin>button:disabled{opacity:.7;background-color:#3b433d}.suite-latin>button:disabled::after{content:'●';font-size:6px;position:absolute;right:4px;top:3px}.suite-latin>button{position:relative}

.inventory-art{display:block;width:80px;height:48px;background-repeat:no-repeat;flex-shrink:0}.inventory-examination{aspect-ratio:1;display:grid;place-items:center;overflow:hidden;border-radius:15px;background:#151d1f}.inventory-examination>.inventory-art{width:240px;max-width:100%;height:144px;transition:transform .2s;transform-origin:center}.bag-pick>.inventory-art{margin:auto}.bag-pick{overflow:hidden}@media(prefers-reduced-motion:reduce){.inventory-examination>.inventory-art{transition:none}}

.suite-scene-state,.suite-scene-state>svg{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}

/* The previous painting remains visible until the next one has decoded. */
.scene-transition-cover{position:absolute;inset:0;z-index:8;background-size:100% 100%;background-position:center;pointer-events:none}
.scene-load-status{position:absolute;z-index:31;left:50%;top:50%;transform:translate(-50%,-50%);width:min(420px,calc(100% - 40px));display:grid;gap:18px;padding:24px;border:1px solid #d9bd8366;border-radius:10px;background:#16252cf2;box-shadow:0 12px 50px #0006;text-align:center;line-height:1.7}
.scene-load-status button{justify-self:center;min-height:44px}
.recovery-copy{display:block;width:100%;margin:10px 0;text-align:left}
.document-painting{margin:0 0 24px}.document-painting img{display:block;width:100%;height:auto;border-radius:4px}
.escape-document-dialog .document-actions,.escape-journal-dialog .document-actions{display:flex;align-items:stretch;gap:8px;flex-wrap:wrap;margin-top:16px}
.escape-document-dialog .document-actions>button,.escape-journal-dialog .document-actions>button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;margin:0;padding:9px 14px;font:inherit;line-height:1.35}
body.material-ui #dialog.escape-journal-dialog .document-list{gap:8px}
body.material-ui #dialog.escape-journal-dialog .journal-document{padding:0}
body.material-ui #dialog.escape-journal-dialog .journal-document>summary{padding:14px 16px;min-height:44px;cursor:pointer;font:500 17px/1.4 Georgia,serif}
body.material-ui #dialog.escape-journal-dialog .journal-document>summary:focus-visible{outline:3px solid var(--escape-accent,var(--accent));outline-offset:2px}
body.material-ui #dialog.escape-journal-dialog .journal-document>p{padding:0 16px 16px}
body.material-ui #dialog.escape-journal-dialog .journal-document>.document-actions{padding:0 16px 16px;margin:0}
#modal-body>a[download]{display:block;margin:18px 0;overflow-wrap:anywhere}
.painting[aria-busy=true] .hotspots,.painting[aria-busy=true] .prop-layer{visibility:hidden}

/* The preserved gallery engine uses the same escape HUD as the two rebuilt games. */
body.escape-ui[data-escape-engine="gallery"] .location{background:none;border:0;border-radius:0;box-shadow:none;backdrop-filter:none}
body.escape-ui[data-escape-engine="gallery"] .hud-actions #fullscreen,
body.escape-ui[data-escape-engine="gallery"] .hud-actions #sound,
body.escape-ui[data-escape-engine="gallery"] .controls #journal,
body.escape-ui[data-escape-engine="gallery"] .controls #help{display:inline-flex}
body.escape-ui[data-escape-engine="gallery"] .escape-options>.modal-head{position:static;background:none;border:0}
body.escape-ui[data-escape-engine="gallery"] .escape-options>.modal-body{padding:0}
body.escape-ui[data-escape-engine="gallery"] #game.escape-gallery-contemplating :is(.hud,.controls,#bag-shell,#hotspots,#exits,#observation,#message){visibility:hidden;pointer-events:none}
body.escape-ui[data-escape-engine="gallery"].reduce-motion *,
body.escape-ui[data-escape-engine="gallery"].reduce-motion *::before,
body.escape-ui[data-escape-engine="gallery"].reduce-motion *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}

/* Keep the carried inventory in the modal interaction scope of a mechanism. */
body.escape-ui[data-escape-engine="gallery"] #dialog.escape-puzzle-dialog[open]{--escape-puzzle-edge:8px;position:fixed;inset:max(var(--escape-puzzle-edge),env(safe-area-inset-top,0px)) max(var(--escape-puzzle-edge),env(safe-area-inset-right,0px)) max(var(--escape-puzzle-edge),env(safe-area-inset-bottom,0px)) max(var(--escape-puzzle-edge),env(safe-area-inset-left,0px));display:flex;flex-direction:column;overflow:hidden;width:auto;height:auto;max-width:none;max-height:none;margin:0}
body.escape-ui[data-escape-engine="gallery"] #dialog.escape-puzzle-dialog>.modal-head{flex:none;position:relative;padding:8px 16px;gap:12px}
body.escape-ui[data-escape-engine="gallery"] #dialog.escape-puzzle-dialog>.modal-head h2{font-size:clamp(20px,1.8vw,26px);line-height:1.2}
body.escape-ui[data-escape-engine="gallery"] #dialog.escape-puzzle-dialog>.modal-body{flex:1 1 auto;min-height:90px;padding:12px 16px 16px;overflow:auto;overscroll-behavior:contain}
/* One compact bar; the real inventory opens above it without shrinking the puzzle. */
body.escape-ui[data-escape-engine="gallery"] #dialog .escape-puzzle-inventory{flex:none;position:relative;z-index:6;min-width:0;padding:6px 12px;background:var(--escape-surface,#152820);border-top:1px solid var(--escape-line,#ded4b43d);color:var(--escape-ink,#f5efdf)}
body.escape-ui[data-escape-engine="gallery"] #dialog .escape-puzzle-inventory[hidden],
body.escape-ui[data-escape-engine="gallery"] #dialog .escape-puzzle-inventory-bar[hidden],
body.escape-ui[data-escape-engine="gallery"] #dialog .escape-puzzle-use[hidden]{display:none!important}
body.escape-ui[data-escape-engine="gallery"] #dialog .escape-puzzle-inventory-bar{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:8px;min-width:0}
body.escape-ui[data-escape-engine="gallery"] #dialog .escape-puzzle-inventory-bar #bag-toggle{grid-column:1;min-height:40px;padding:6px 10px;font-size:12px}
body.escape-ui[data-escape-engine="gallery"] #dialog .escape-puzzle-use{grid-column:2;justify-self:end;min-width:0;max-width:100%;min-height:40px;padding:6px 10px;font:500 13px/1.3 var(--escape-ui-font,system-ui);text-align:left;white-space:normal;overflow-wrap:anywhere;color:var(--escape-ink,#f5efdf);border:1px solid var(--escape-line,#d7c28b5c);background:var(--escape-button,#ffffff0a);border-radius:8px}
body.escape-ui[data-escape-engine="gallery"] #dialog .escape-puzzle-inventory-bar #cancel-selection{grid-column:3;min-height:40px;padding:6px 10px;font-size:12px}
body.escape-ui[data-escape-engine="gallery"] #dialog.escape-puzzle-dialog #bag-shell{position:absolute;inset:auto auto calc(100% + 6px) 12px;width:min(620px,calc(100vw - 48px));max-width:calc(100% - 24px);max-height:min(260px,45dvh);margin:0;padding:0;translate:none;transform:none;overflow:hidden;border:1px solid var(--escape-line,#ded4b43d);border-radius:10px;box-shadow:0 -8px 30px #0005;background:var(--escape-surface,#152820)}
body.escape-ui[data-escape-engine="gallery"] #dialog.escape-puzzle-dialog #bag-shell[hidden]{display:none!important}
body.escape-ui[data-escape-engine="gallery"] #dialog.escape-puzzle-dialog .bag-top{display:contents;cursor:default}
body.escape-ui[data-escape-engine="gallery"] #dialog.escape-puzzle-dialog .bag-top::before{content:none}
body.escape-ui[data-escape-engine="gallery"] #dialog.escape-puzzle-dialog :is(#bag-label,#selected-status){display:none}
body.escape-ui[data-escape-engine="gallery"] #dialog.escape-puzzle-dialog #bag-close{position:absolute;inset:6px 6px auto auto;display:inline-flex;align-items:center;justify-content:center;width:40px;min-width:40px;min-height:40px;margin:0;z-index:2}
body.escape-ui[data-escape-engine="gallery"] #dialog.escape-puzzle-dialog #bag{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));align-items:stretch;gap:6px;padding:8px 54px 8px 8px;max-height:min(260px,45dvh);overflow:auto;overscroll-behavior:contain;scroll-padding:8px}
body.escape-ui[data-escape-engine="gallery"] #dialog.escape-puzzle-dialog .bag-item{min-width:0;width:auto;align-self:stretch;margin:0}
body.escape-ui[data-escape-engine="gallery"] #dialog.escape-puzzle-dialog .bag-pick,
body.escape-ui[data-escape-engine="gallery"] #dialog.escape-puzzle-dialog .bag-pick[aria-pressed="true"]{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:8px;min-height:64px;padding:6px 48px 6px 8px;font-size:12px;line-height:1.3;text-align:left;white-space:normal;overflow-wrap:anywhere;touch-action:none;user-select:none;-webkit-user-select:none;cursor:grab}
body.escape-ui[data-escape-engine="gallery"] #dialog.escape-puzzle-dialog .bag-pick .inventory-art{flex:none;width:32px;height:32px;margin:0}
body.escape-ui[data-escape-engine="gallery"] #dialog.escape-puzzle-dialog .bag-pick svg{flex:none;width:32px;height:32px;max-height:32px}
body.escape-ui[data-escape-engine="gallery"] #dialog.escape-puzzle-dialog .inspect{right:4px;top:50%;bottom:auto;min-width:40px;min-height:40px;padding:4px;transform:translateY(-50%)}
body.escape-ui[data-escape-engine="gallery"] #dialog.escape-puzzle-dialog .bag-pick:hover{background:var(--escape-hover,#35483f);color:var(--escape-ink,#f5efdf)}
body.escape-ui[data-escape-engine="gallery"] #dialog .escape-puzzle-item-feedback{margin:6px 0 0;max-height:3.9em;overflow:auto;font:400 12px/1.3 var(--escape-ui-font,system-ui);color:var(--escape-ink,#e5d3a9)}
body.escape-ui[data-escape-engine="gallery"] #dialog .escape-puzzle-item-feedback:empty{display:none}
body.escape-ui[data-escape-engine="gallery"] #dialog .escape-puzzle-inventory-bar[hidden]~.escape-puzzle-item-feedback{margin-top:0}
body.escape-ui[data-escape-engine="gallery"] #dialog .escape-puzzle-return{margin:0 0 16px}
body.escape-ui[data-escape-engine="gallery"] #dialog .escape-puzzle-preparation{min-height:90px;padding:12px 0}
body.escape-ui[data-escape-engine="gallery"] #dialog .escape-puzzle-target:focus-visible{outline:2px solid #e1c992;outline-offset:3px}
body.escape-ui[data-escape-engine="gallery"] #dialog .escape-inventory-ghost{position:fixed;z-index:1000;pointer-events:none;transform:translate(14px,-50%);max-width:180px;padding:8px 12px;background:#152820f5;border:1px solid #e1c992;border-radius:8px;color:#f5efdf;font:500 13px/1.35 var(--escape-ui-font,system-ui);box-shadow:0 5px 20px #0006}
body.escape-ui[data-escape-engine="gallery"] #dialog.escape-inventory-dragging{user-select:none}
@media(max-width:600px){
 body.escape-ui[data-escape-engine="gallery"] #dialog.escape-puzzle-dialog[open]{--escape-puzzle-edge:4px}
 body.escape-ui[data-escape-engine="gallery"] #dialog.escape-puzzle-dialog>.modal-body{padding:10px 10px 14px}
 body.escape-ui[data-escape-engine="gallery"] #dialog .escape-puzzle-inventory{padding:5px 8px}
 body.escape-ui[data-escape-engine="gallery"] #dialog .escape-puzzle-inventory-bar{gap:6px}
 body.escape-ui[data-escape-engine="gallery"] #dialog .escape-puzzle-inventory-bar :is(#bag-toggle,#cancel-selection),
 body.escape-ui[data-escape-engine="gallery"] #dialog .escape-puzzle-use{font-size:12px;padding-inline:8px}
 body.escape-ui[data-escape-engine="gallery"] #dialog.escape-puzzle-dialog #bag-shell{left:8px;width:calc(100% - 16px);max-width:calc(100% - 16px)}
 body.escape-ui[data-escape-engine="gallery"] #dialog.escape-puzzle-dialog #bag{grid-template-columns:repeat(auto-fit,minmax(min(180px,100%),1fr))}
}
@media(max-height:520px){
 body.escape-ui[data-escape-engine="gallery"] #dialog.escape-puzzle-dialog[open]{--escape-puzzle-edge:4px}
 body.escape-ui[data-escape-engine="gallery"] #dialog.escape-puzzle-dialog #bag-shell,
 body.escape-ui[data-escape-engine="gallery"] #dialog.escape-puzzle-dialog #bag{max-height:42dvh}
 body.escape-ui[data-escape-engine="gallery"] #dialog .escape-puzzle-inventory{padding-block:4px}
 body.escape-ui[data-escape-engine="gallery"] #dialog .escape-puzzle-item-feedback{max-height:2.6em}
}

/* Message recall overlays the scenery without reserving space in the game. */
body.escape-ui[data-escape-engine="gallery"] #game.escape-message-layout{
 display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;
 height:100dvh;min-height:0;overflow:hidden;background:var(--escape-surface,#18262c);
}
body.escape-ui[data-escape-engine="gallery"] .escape-message-scene{grid-row:1;position:relative;min-width:0;min-height:0;overflow:hidden;isolation:isolate;container-type:size}
body.escape-ui[data-escape-engine="gallery"] .escape-message-scene>.viewport{position:absolute;inset:0;min-height:0;overflow:hidden}
body.escape-ui[data-escape-engine="gallery"] .escape-message-scene .painting{width:min(100%,calc(var(--escape-scene-height,100dvh) * 1672 / 941));max-height:100%;max-width:100%;aspect-ratio:1672/941}
body.escape-ui[data-escape-engine="gallery"] .escape-message-layout>.escape-message-home{position:absolute;grid-area:1/1/2/2;inset:0;pointer-events:none}
body.escape-ui[data-escape-engine="gallery"] .escape-message-layout>.controls{
 grid-row:2;position:relative;inset:auto!important;min-height:58px;margin:0!important;padding:7px max(12px,env(safe-area-inset-right,0px)) max(7px,env(safe-area-inset-bottom,0px)) max(12px,env(safe-area-inset-left,0px));width:100%;box-sizing:border-box;background:var(--escape-surface,#18262c);border-top:1px solid var(--escape-line,#d5bb8c5c);
}
body.escape-ui[data-escape-engine="gallery"] #game.escape-gallery-contemplating{grid-template-rows:minmax(0,1fr) 0}
body.escape-ui[data-escape-engine="gallery"] #game.escape-gallery-contemplating>.escape-message-home,
body.escape-ui[data-escape-engine="gallery"] #game.escape-gallery-contemplating>.controls{visibility:hidden;pointer-events:none;min-height:0;height:0;padding:0;overflow:hidden}
@media(max-height:540px) and (min-width:681px){
 body.escape-ui[data-escape-engine="gallery"] .escape-message-layout>.controls{min-height:54px;padding-block:4px}
}

/* An inventory card gives its label and its examination button separate cells.
   The same structure follows the real inventory into a puzzle dialog. */
body.escape-ui[data-escape-engine="gallery"] #bag-shell #bag.bag{display:flex;flex-flow:row wrap;align-items:stretch;justify-content:flex-start;gap:8px}
body.escape-ui[data-escape-engine="gallery"] #bag-shell #bag .bag-item{display:grid;grid-template-columns:minmax(0,1fr) 44px;align-items:center;flex:0 1 244px;width:244px;max-width:100%;min-width:0;margin:0}
body.escape-ui[data-escape-engine="gallery"] #bag-shell #bag .bag-pick{grid-column:1;display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:8px;box-sizing:border-box;width:100%;min-width:0;min-height:72px;margin:0;padding:8px;white-space:normal;overflow-wrap:anywhere;text-align:left;font-size:12px;line-height:1.4;overflow:visible}
body.escape-ui[data-escape-engine="gallery"] #bag-shell #bag .bag-pick>.inventory-art{flex:0 0 70px;width:70px;height:42px;max-width:70px;max-height:42px;margin:0}
body.escape-ui[data-escape-engine="gallery"] #bag-shell #bag .bag-pick>.inventory-art-single{display:flex;align-items:center;justify-content:center;flex:0 0 64px;width:64px;height:64px;max-width:64px;max-height:64px;overflow:visible}
body.escape-ui[data-escape-engine="gallery"] #bag-shell #bag .inventory-art-single>:is(img,svg){display:block;width:100%;height:100%;max-width:100%;max-height:100%;margin:0;object-fit:contain}
body.escape-ui[data-escape-engine="gallery"] #bag-shell #bag .inventory-art-single>svg{overflow:hidden}
body.escape-ui[data-escape-engine="gallery"] #bag-shell #bag .bag-pick>svg{flex:0 0 42px;width:42px;height:42px;max-width:42px;max-height:42px}
body.escape-ui[data-escape-engine="gallery"] #bag-shell #bag .inspect{grid-column:2;position:static;inset:auto;display:grid;place-items:center;align-self:center;justify-self:center;box-sizing:border-box;width:44px;height:44px;min-width:44px;min-height:44px;margin:0;padding:0;transform:none}
body.escape-ui[data-escape-engine="gallery"] #bag-shell #bag .inspect svg{width:18px;height:18px;max-width:18px;max-height:18px}
body.escape-ui[data-escape-engine="gallery"] :is(#game,#dialog) #bag-shell:has(#bag>.bag-item:only-child){width:min(300px,calc(100% - 24px));min-width:0}

