.escape-header { position:absolute;top:4.5%;left:27%;width:53%;text-align:center; }
.escape-header h1 { margin:0;font-size:clamp(22px,2.4cqw,40px);font-weight:400;line-height:1.5;color:#fffaff;-webkit-text-stroke:2px #4c247f;paint-order:stroke fill;text-shadow:2px 2px #7952bb; }
.escape-header p { margin:4px 0;font-size:clamp(14px,1.2cqw,18px); }
.escape-toolbar { position:absolute;right:3%;top:5%;display:flex;flex-direction:column;gap:5px; }
.escape-toolbar .pixel-button,.escape-toolbar .text-link { font-size:14px;min-height:44px;padding:5px 12px; }
.escape-room { position:absolute;left:4%;top:22%;width:67%;aspect-ratio:1672/941;overflow:hidden;border:3px solid #8d69b8;border-radius:5px;background:#c7a9ef;box-shadow:4px 4px #8d69b850; }
.escape-room-art { display:block;width:100%;height:100%;object-fit:fill;pointer-events:none;user-select:none; }
.room-hotspot { position:absolute;z-index:1;padding:0;background:transparent;border:2px solid transparent;border-radius:4px;min-width:44px;min-height:44px; }
.room-hotspot:hover,.room-hotspot:focus-visible { border-color:#fffaff;background:#fffaff22; }
.room-hotspot>span { position:absolute;left:50%;bottom:-4px;transform:translate(-50%,70%);padding:4px 7px;white-space:nowrap;font-size:14px;background:#fffafff2;border:1px solid #9871c7;border-radius:3px;color:#4c247f; }
.hotspot-shelf { left:4%;top:34%;width:22%;height:20%; }
.hotspot-shelf>span { bottom:0; }
.hotspot-note { left:30%;top:56%;width:12%;height:10%;border-color:#9871c7;background:#fffaffd9; }
.hotspot-note>span { bottom:50%;transform:translate(-50%,50%);border:0;padding:0;background:none; }
.hotspot-table { left:44%;top:57%;width:19%;height:11%;border:2px dashed #7952bb90;background:#fffaff55; }
.hotspot-table canvas { width:100%;height:100%;object-fit:contain; }
.hotspot-frame { left:63.2%;top:21.4%;width:6.4%;height:12.2%;touch-action:none;background-image:url('assets/escape/room.png');background-size:1562.5% 819.7%;background-position:67.52% 24.37%; }
.hotspot-frame img { position:absolute;left:14%;top:17%;width:70%;height:64%;object-fit:contain;pointer-events:none; }
.hotspot-frame>span { bottom:-14px; }
.hotspot-gift { left:64.5%;top:47%;width:10.5%;height:18%; }
.hotspot-door { left:80.5%;top:44%;width:8%;height:15%;border:2px dashed #fffaff88; }
.hotspot-door>span { bottom:-12px; }
.room-hotspot.drop-ready,.paper-slot.drop-ready { outline:4px solid #a4e2ec;outline-offset:3px;background:#dffaffaa; }
.room-hotspot.dragging { border-color:#fffaff;box-shadow:0 0 0 3px #7952bb; }
.escape-door-glow { position:absolute;left:81%;top:10%;width:17%;height:66%;background:#fff9cfcc;animation:escape-door-open .8s ease both;pointer-events:none;box-shadow:0 0 25px #fff5bf; }
@keyframes escape-door-open { from { opacity:0;transform:scaleX(.02);transform-origin:left; }to { opacity:1;transform:scaleX(1);transform-origin:left; } }
.escape-bottom { position:absolute;left:73%;right:4%;top:22%;bottom:7%;display:flex;flex-direction:column;gap:16px; }
.escape-inventory-panel { min-width:0;padding:8px 12px;border:2px solid #b999dc;background:#fffaffda;border-radius:4px; }
.escape-inventory-panel h2 { font-weight:400;font-size:16px;line-height:1.3;margin:0 0 5px; }
.escape-inventory { display:flex;align-items:center;gap:8px;min-height:44px;flex-wrap:wrap; }
.inventory-item { position:relative;display:flex;align-items:center;gap:6px;padding:4px 6px;background:#f4e9fc;border:2px solid #b999dc;border-radius:3px;font-family:inherit;font-size:14px;min-height:44px;touch-action:none; }
.inventory-item[aria-pressed="true"] { border-color:#4c247f;box-shadow:0 0 0 2px #a4e2ec; }
.inventory-item canvas { width:26px;height:32px;object-fit:contain;pointer-events:none; }
.inventory-empty { font-size:14px;color:#7952bb; }
.escape-inventory-panel>p { font-size:14px;line-height:1.5;margin:4px 0 0; }
.escape-guide { display:flex;flex-direction:column;align-items:center;gap:6px;min-width:0;flex:1; }
.escape-guide>img { width:50%;max-width:145px;height:auto; }
.escape-guide>div { width:100%; }
.escape-guide p { font-size:16px;line-height:1.5;margin:0 0 5px; }
.escape-hint-actions { display:flex;align-items:center;gap:6px;flex-wrap:wrap; }
.escape-hint-actions button { font-size:14px;padding:4px 8px;min-height:44px; }
.escape-save-status { position:absolute;bottom:1%;left:4%;font-size:13px;line-height:1.5;margin:0;color:#72529c; }
.escape-dialog { font-family:Zpix,monospace;color:#4c247f;width:min(720px,94vw);max-height:92svh;overflow:auto;border:3px solid #9975d6;border-radius:6px;background:#fffaff;padding:26px;text-align:center;box-shadow:7px 7px #7952bb50; }
.escape-dialog::backdrop { background:#39215d77;backdrop-filter:blur(3px); }
.escape-dialog h2 { font-size:24px;line-height:1.5;font-weight:400;margin:4px 38px 20px; }
.escape-dialog h3 { font-size:18px;line-height:1.5;font-weight:400;margin:12px 0; }
.escape-dialog p { font-size:16px;line-height:1.8;margin:12px 0;overflow-wrap:anywhere; }
.escape-dialog .pixel-button { font-size:16px; }
.escape-dialog-status { min-height:1.6em;color:#7952bb; }
.escape-actions { display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin:15px 0 0; }
.escape-dialog a.pixel-button { display:inline-flex;align-items:center;justify-content:center;color:#4c247f;text-decoration:none; }
.escape-note-paper { padding:24px 15px;background:#f7eefb;border:2px solid #c7a9ef; }
.book-rack { display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px; }
.book-choice { display:flex;flex-direction:column;align-items:center;gap:5px;min-height:125px;padding:6px;border:2px solid #c7a9ef;background:#f4e9fc;font-size:18px;touch-action:none; }
.book-choice .book-cover { width:26px;height:70px;background-image:url('assets/escape/room.png');background-size:1672px 941px;background-position:-90px -370px;background-repeat:no-repeat;pointer-events:none; }
.book-sheet { margin:10px 0;padding:18px;border:2px solid #dfc9f2;background:#f9f4ff;touch-action:pan-y;min-height:260px; }
.book-sheet p { margin:8px 0; }.book-page-number { color:#7952bb; }
.paper-preview { display:block;margin:10px auto;max-width:100%;height:190px;object-fit:contain; }
.book-navigation { display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:12px; }
.book-navigation label { font-size:16px; }.book-navigation input { font:inherit;color:inherit;width:75px;min-height:44px;font-size:18px;border:2px solid #b999dc;padding:6px;background:#fff; }
.book-range { width:min(100%,400px);height:44px;accent-color:#9975d6; }
.photo-inspect { margin:auto;width:min(320px,100%);aspect-ratio:4/3;display:flex;align-items:center;justify-content:center;border:10px double #b999dc;background:#f2e7fc;transition:transform .3s; }
.photo-inspect img { max-width:100%;max-height:100%;object-fit:contain; }.photo-inspect.flipped { background:#e8dbf4;animation:escape-photo-flip .3s ease both; }
@keyframes escape-photo-flip { from { transform:rotateY(-90deg);opacity:.3; }to { transform:rotateY(0deg);opacity:1; } }
.paper-back { display:grid;place-items:center;min-height:240px;padding:25px;border:2px dashed #c7a9ef;background:#f8f0fc; }
.workbench { display:flex;justify-content:center;align-items:stretch;margin:12px auto;width:min(360px,100%);border:2px solid #b999dc;background:#faf6ff; }
.paper-slot { display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0;border:2px dashed #b999dc;min-height:250px;background:#efe4fb55;font-size:18px; }
.paper-slot[data-drop="left"] { width:44.444%; }.paper-slot[data-drop="right"] { width:55.556%; }
.paper-slot canvas { display:block;width:100%;height:auto;pointer-events:none; }.paper-slot span { padding:15px; }
.paper-slot.placed { border:0;background:#fffaff; }.workbench.joined { border-color:#7952bb;animation:escape-snap .5s ease; }.workbench.joined .paper-slot { pointer-events:none; }
@keyframes escape-snap { 50% { box-shadow:0 0 0 6px #c7a9ef66; } }
.workbench-items { display:flex;justify-content:center;gap:12px;flex-wrap:wrap; }.workbench-items .inventory-item { min-height:65px;font-size:16px; }
.color-order { display:flex;justify-content:center;align-items:center;gap:15px;margin:20px 0; }.color-order span { display:flex;align-items:center;gap:7px;font-size:18px; }.color-order i { width:26px;height:26px;border:2px solid #685d78;border-radius:50%;display:inline-block; }
.gift-wheels { display:flex;justify-content:center;gap:18px; }.gift-wheel { display:flex;flex-direction:column;align-items:center;gap:6px; }
.gift-wheel button { min-height:44px;min-width:58px;border:2px solid #c7a9ef;background:#f2e6fb;font:inherit;font-size:20px; }
.gift-wheel .wheel-value { width:70px;height:80px;border:3px solid #9975d6;background:#fffaff;display:grid;place-items:center;font-size:40px;touch-action:none;cursor:ns-resize; }
.gift-wheel label { font-size:14px; }.gift-wheel .wheel-value:focus-visible { outline:3px dashed #4c247f;outline-offset:3px; }
.gift-open { animation:escape-snap .6s ease; }.key-icon { width:26px;height:26px;display:block;object-fit:contain;font-size:24px;line-height:1; }
.escape-key-button { min-height:85px;display:flex;align-items:center;justify-content:center;gap:10px;margin:20px auto; }.escape-key-button .key-icon { width:46px;height:46px; }
.escape-cake { width:230px;max-width:65vw;aspect-ratio:1;margin:0 auto;animation:cake-walk .7s steps(1) 2,breath 3s ease-in-out 1.4s infinite; }
.escape-surprise-dialog { width:min(600px,94vw); }.escape-surprise-dialog h2 { margin:0 20px 12px; }.escape-reward-note { color:#7952bb; }.escape-surprise-dialog>p { margin:12px 0; }
.escape-drag-ghost { position:fixed;pointer-events:none;z-index:1000;width:90px;height:100px;display:grid;place-items:center;padding:5px;background:#fffaffdf;border:2px solid #7952bb;box-shadow:3px 3px #c7a9ef;transform:translate(-50%,-50%); }.escape-drag-ghost canvas { width:100%;height:100%;object-fit:contain; }.escape-drag-ghost img { width:75%;height:75%;object-fit:contain; }
@media(max-width:760px) and (max-aspect-ratio:4/3){
 .house-menu { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));top:15%;gap:7px; }.house-menu button { flex-direction:row;justify-content:center;min-height:50px;padding:7px 3px;gap:5px;font-size:13px; }.house-menu .menu-mark,.house-menu .camera-mark,.house-menu .gacha-menu-mark { display:none; }
 .stage[data-screen="escape"] { min-height:1120px;height:auto; }.escape-header { top:125px;left:5%;width:90%; }.escape-header h1 { font-size:25px; }.escape-header p { font-size:16px; }
 .escape-toolbar { top:225px;left:5%;right:5%;flex-direction:row;justify-content:space-between; }.escape-toolbar .pixel-button,.escape-toolbar .text-link { min-height:44px;font-size:16px; }
 .escape-room { top:285px;left:4%;width:92%;height:350px;aspect-ratio:auto; }.escape-room-art { object-fit:fill; }
 .room-hotspot>span { font-size:14px;padding:4px 5px; }.hotspot-shelf { left:3%;top:31%;width:24%;height:24%; }.hotspot-shelf>span { bottom:0; }
 .hotspot-note { left:29%;top:53%;width:25%;height:13%; }.hotspot-note>span { font-size:14px; }.hotspot-table { left:35%;top:70%;width:34%;height:16%; }.hotspot-table>span { bottom:5px;transform:translate(-50%,30%); }
 .hotspot-frame { left:61%;top:19%;width:12%;height:17%; }.hotspot-frame>span { bottom:-12px; }.hotspot-gift { left:64%;top:45%;width:16%;height:20%; }.hotspot-door { left:81%;top:41%;width:16%;height:18%; }
 .escape-bottom { top:660px;bottom:auto;left:5%;right:5%;display:flex;flex-direction:column;gap:20px; }.escape-inventory-panel { padding:12px;min-height:130px; }.escape-inventory-panel h2 { font-size:18px; }.escape-inventory { min-height:52px;gap:6px;flex-wrap:wrap; }.inventory-item { min-height:48px;font-size:14px;padding:6px; }
 .escape-guide { display:grid;grid-template-columns:24% minmax(0,1fr);align-items:start; }.escape-guide>img { width:100%; }.escape-guide p { font-size:16px; }.escape-hint-actions { gap:6px; }.escape-hint-actions button { min-height:44px;font-size:14px;padding:6px; }
 .escape-save-status { left:5%;right:5%;bottom:25px;font-size:14px; }.escape-dialog { padding:22px 14px; }.escape-dialog h2 { font-size:22px;margin-left:25px;margin-right:25px; }.escape-dialog .pixel-button { font-size:16px; }
 .book-rack { grid-template-columns:repeat(4,minmax(0,1fr));gap:8px; }.book-choice { min-height:105px;font-size:18px; }.book-choice .book-cover { width:26px;height:58px; }.book-sheet { padding:12px; }.book-navigation { gap:8px; }.book-navigation input { width:65px; }
 .gift-wheels { gap:12px; }.gift-wheel .wheel-value { width:65px; }.color-order { gap:8px; }.color-order span { font-size:16px; }.color-order i { width:22px;height:22px; }.paper-slot { min-height:220px;font-size:16px; }.paper-slot span { padding:6px; }
}
@media(max-width:900px) and (min-aspect-ratio:4/3){
 .stage[data-screen="escape"] { height:auto;min-height:900px;aspect-ratio:auto;width:100%; }
 .escape-room { left:4%;width:92%;top:180px; }.escape-bottom { top:calc(200px + 51.77cqw);left:4%;right:4%;bottom:auto;display:grid;grid-template-columns:42% minmax(0,1fr);gap:18px; }
 .escape-guide { flex-direction:row;align-items:start; }.escape-guide>img { width:24%; }.escape-guide>div { flex:1;width:auto; }.escape-save-status { bottom:16px; }
}
@media(prefers-reduced-motion:reduce){.escape-screen *,.escape-dialog * { animation:none!important;transition:none!important; }}
