/* Frontispiece and Bell Yard */
body.at-title,body.in-yard{overflow:hidden}
.gateway,.opening{position:fixed;inset:0;isolation:isolate;overflow:hidden;background:#171b2b}
.title-paint,.title-paint img,.title-shade,#motes{position:absolute;inset:0;width:100%;height:100%}
.title-paint img{object-fit:cover;object-position:57% 55%}
.title-shade{background:linear-gradient(90deg,#16172a3b,transparent 58%),linear-gradient(0deg,#100e1b62,transparent 15%)}
.title-content{position:absolute;inset:0 auto 0 2.5%;width:48%;max-width:820px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:clamp(28px,5.7svh,64px);padding-bottom:2svh}
.title-lockup{display:flex;align-items:center;flex-direction:column;width:100%}
.title-lockup h1{margin:0;width:100%;line-height:0}
.title-lockup h1 img{display:block;width:100%;height:auto;filter:drop-shadow(0 5px 1px #0e111c80)}
.ribbon{position:relative;z-index:0;margin-top:-1px;display:flex;justify-content:center;align-items:center;gap:11px;color:#ffda91;font:clamp(16px,1.75vw,31px)/1 var(--pixel);letter-spacing:.11em;text-transform:uppercase;text-shadow:0 2px #261723;padding:8px 23px 7px;background:#5a3844;border-top:2px solid #c79965;border-bottom:3px solid #af815e;box-shadow:inset 0 2px #8c5952,0 3px #271d2b}
.ribbon:before,.ribbon:after{content:'';position:absolute;z-index:-1;width:24px;height:85%;top:6px;background:#65404a;box-shadow:inset 0 2px #c08f65,inset 0 -3px #9d7158;clip-path:polygon(0 0,100% 0,100% 100%,0 100%,25% 50%)}
.ribbon:before{left:-20px}.ribbon:after{right:-20px;transform:rotate(180deg)}
.ribbon i{width:5px;height:5px;background:#efc883;transform:rotate(45deg)}
.title-menu{display:flex;flex-direction:column;align-items:center;gap:14px}
.start-button,.gold-choice{--cut:7px;position:relative;background:#3c2830;color:#422b2f;padding:3px;filter:drop-shadow(0 5px 0 #211925);border:0;clip-path:polygon(0 var(--cut),var(--cut) var(--cut),var(--cut) 0,calc(100% - var(--cut)) 0,calc(100% - var(--cut)) var(--cut),100% var(--cut),100% calc(100% - var(--cut)),calc(100% - var(--cut)) calc(100% - var(--cut)),calc(100% - var(--cut)) 100%,var(--cut) 100%,var(--cut) calc(100% - var(--cut)),0 calc(100% - var(--cut)))}
.start-button{display:flex;align-items:center;justify-content:center;gap:15px;min-width:clamp(215px,20vw,310px);height:clamp(49px,6.5svh,74px);font:clamp(24px,2.1vw,35px) var(--pixel);text-shadow:0 1px #ffe4ad;isolation:isolate}
.start-button:before{content:'';position:absolute;z-index:-1;inset:3px;clip-path:polygon(0 4px,4px 4px,4px 0,calc(100% - 4px) 0,calc(100% - 4px) 4px,100% 4px,100% calc(100% - 4px),calc(100% - 4px) calc(100% - 4px),calc(100% - 4px) 100%,4px 100%,4px calc(100% - 4px),0 calc(100% - 4px));background:linear-gradient(#ffe7a3 0 8%,#e5b76b 8% 14%,#f4d08a 14% 72%,#e9bc77 72% 86%,#b58151 86%);box-shadow:inset 3px 0 #ffe6ac,inset -3px 0 #c59762}
.start-button:hover:before,.start-button:focus-visible:before{filter:brightness(1.13)}
.start-button:focus-visible{outline:0;background:#fff4b5}.play-mark{width:12px;height:15px;clip-path:polygon(0 0,30% 0,30% 17%,60% 17%,60% 32%,85% 32%,85% 43%,100% 43%,100% 58%,85% 58%,85% 70%,60% 70%,60% 85%,30% 85%,30% 100%,0 100%);background:#65413b}
.title-link{color:#fff0d3;text-shadow:0 2px #271c2c,1px 0 #271c2c;font:clamp(16px,1.45vw,23px) var(--pixel);border:0;background:#211c2b9e;padding:7px 14px;border-radius:2px}
.title-link:hover{color:#ffe09f;background:#342436}
.title-sound{position:absolute;right:max(18px,env(safe-area-inset-right));bottom:max(20px,env(safe-area-inset-bottom));display:flex;align-items:center;gap:9px;min-height:38px;padding:5px 12px;color:#f3deba;background:#251e2bd9;border:1px solid #a18b77;box-shadow:inset 0 0 0 2px #443642,0 2px #1a1522;font:16px var(--pixel)}
#resumePoint{font:14px var(--pixel);color:#ffe6b4;background:#241e2bc9;padding:6px 9px;margin-top:-7px}
#motes{pointer-events:none}
#motes i{position:absolute;width:3px;height:3px;background:#ffe7a0;box-shadow:0 0 5px 1px #ffc66b;animation:firefly 7s ease-in-out infinite}
@keyframes firefly{0%,100%{opacity:0;transform:translate(0,8px)}35%{opacity:.85}75%{opacity:.16;transform:translate(13px,-17px)}}
.opening{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:8px max(3vw,env(safe-area-inset-left)) 14px;background:#211c24 url(./art/cloth.png);background-size:128px}
.opening-head{text-align:center;margin:0 0 9px;text-shadow:0 2px #171118}
.opening-head span{font:12px var(--pixel);text-transform:uppercase;color:#cba877;letter-spacing:2px}
.opening-head h1{font:clamp(24px,2.5vw,43px)/1.1 var(--pixel);color:#ffe4ac;margin:3px 0 0}
.yard-camera,.story-box{width:min(1100px,calc((100svh - 190px)*1.882),100%)}
.yard-camera{position:relative;aspect-ratio:960/510;overflow:hidden;border:3px solid #3b2b31;outline:2px solid #ba976c;box-shadow:0 4px #120f16}
.yard{position:relative;height:100%;width:100%;isolation:isolate;touch-action:manipulation}
#yardPainting{position:absolute;left:50%;top:0;display:block;width:auto;height:100%;transform:translateX(-50%);image-rendering:pixelated;pointer-events:none}
.yard-friend,.yard-table,.yard-exit{position:absolute;transform:translate(-50%,-100%);width:max(44px,6.2%);height:max(44px,12%);border:0;background:transparent;padding:0}
.yard-friend:focus-visible,.yard-table:focus-visible,.yard-exit:focus-visible{background:#fce2a622;outline:2px dashed #fff1b4}
.yard-hotspot{position:absolute;left:44%;top:8%;width:14%;height:32%;border:0;background:transparent}
.yard-hotspot b{display:none;position:absolute;left:54%;top:64%;width:25px;height:26px;background:#fff0af;box-shadow:0 3px #563c49;border:2px solid #533947;color:#5a3940;font:21px var(--pixel)}
.yard-hotspot.call-bell b{display:block;animation:hintBob 1.6s ease-in-out infinite}
@keyframes hintBob{50%{translate:0 -4px}}
.story-box{display:flex;align-items:center;gap:14px;background:#352936;border:2px solid #b28f6c;box-shadow:inset 0 0 0 3px #57434b,0 3px #181420;padding:12px 16px;margin-top:12px}
.yard-face{flex:none;width:50px;height:50px}.yard-face img{width:100%;height:100%;object-fit:contain}
.yard-speech{flex:1;min-width:0}.yard-speech span{font:17px var(--pixel);color:#f6ce86}.yard-speech p{margin:4px 0 0;font:600 clamp(16px,1.3vw,20px)/1.35 var(--body)}
.yard-buttons{display:flex;align-items:center;gap:7px}.yard-buttons>button{min-height:43px}#yardVoice,.voice-action{display:inline-flex;align-items:center;justify-content:center;background:#493a47;border:1px solid #937b77;min-width:42px}
.belt{display:flex;align-items:center;gap:18px;justify-content:space-between;margin-top:11px}
.belt-tools,.belt-actions,.belt-move,.belt-tool,.field-action,.hud-end{display:flex;align-items:center}
.belt-tools,.belt-actions{gap:8px}
.belt-tool,.field-action{justify-content:center;gap:7px;padding:6px 11px;font:17px var(--pixel);min-height:43px;border:2px solid #816b66;background:#383039;box-shadow:inset 0 2px #594853,inset 0 -2px #29222c,0 2px #17131c}
.belt-tool>span,.field-action>span{width:27px;height:27px}
.field-action{background:#4c3941;border-color:#b18a6a;box-shadow:inset 0 2px #7b6059,inset 0 -2px #342a32,0 2px #17131c;color:#fff0d5}
.field-action:last-child{background:#384645;border-color:#899082;box-shadow:inset 0 2px #5a6d60,inset 0 -2px #283333,0 2px #17131c}
.belt-tool:hover,.field-action:hover{filter:brightness(1.15)}.field-action kbd{font-size:10px;padding:3px}
.belt-move{gap:6px;color:#c7b5b2;font:14px var(--body)}.move-keys{color:#d1bba9;font:12px var(--pixel);border-bottom:2px solid #6b555b;padding:3px 4px}
.touch-hint{display:none}.hud-end{gap:17px}.hud-end .tool{width:38px;height:37px}.hud{padding-right:12px}
.cabinet{width:min(1320px,calc((100svh - 156px)*1.88235),calc(100% - 56px));min-width:0;margin:auto;padding:max(12px,2.5svh) 0 10px}
body:not(.at-title):not(.in-yard){display:flex;align-items:center;min-height:100svh}
.quest{pointer-events:auto;text-align:left;max-width:min(78%,530px);cursor:pointer}
.quest .glyph{opacity:.63;margin-left:4px;scale:.72}
.quest strong{font-family:var(--body);font-weight:650;font-size:clamp(14px,1.4vw,19px)}
.quest small{font-size:11px}
.quest:hover{border-color:#f5ce90}
.sheet-hero{display:block;width:100%;max-height:185px;object-fit:cover;image-rendering:pixelated}
.sheet-help{display:grid;grid-template-columns:auto 1fr;gap:12px;align-items:center;padding:8px 0;border-bottom:1px solid #664f59}
.sheet-help img{width:38px;height:38px;object-fit:contain}.sheet-help strong{display:block;font:18px var(--pixel);color:#f6d397}.sheet-help small{font:15px var(--body);color:#e1d2ce}
/* Open chests keep the room visible above the three choices. */
.veil:has(.dialog-relic){align-items:end;padding:max(12px,3svh) max(10px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom));background:linear-gradient(0deg,#160f1cef 0%,#21162850 38%,#20162c12 72%);backdrop-filter:none}
.dialog.dialog-relic{width:min(750px,100%);padding:8px 5px;border:0;box-shadow:none;background:transparent;overflow-y:auto;max-height:88svh;scrollbar-width:thin}
.dialog-relic h2{width:fit-content;max-width:100%;margin:0 auto 13px;padding:5px 21px 6px;background:#60455e;color:#fff1e3;border:2px solid #e5bfd3;box-shadow:0 0 0 3px #392733,0 5px #281a28,inset 0 -3px #4e344d;text-align:center;text-shadow:0 2px #342331;font:clamp(21px,3.4vw,31px)/1.05 var(--pixel)}
.dialog-relic .reward-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.reward-list .card{--rim:#d6b1c4;--light:#f8decd;position:relative;display:flex;flex-direction:column;align-items:center;justify-content:stretch;gap:0;text-align:center;padding:8px 4px 4px;min-width:0;border:3px solid var(--rim);border-radius:0;background:#78586f;box-shadow:inset 0 2px #a28093,inset 0 -3px #a88599,0 3px #4a324b,0 5px #251c29;}
.reward-list .card:nth-child(2){background:#77536a}.reward-list .card:nth-child(3){background:#78566e}
.reward-list .card:hover,.reward-list .card:focus-visible{border-color:#ffe3a3;outline:2px solid #b97a44;outline-offset:0;box-shadow:inset 0 2px #ffe3ac,0 3px #a66b41,0 5px #372638;filter:none}
.reward-list .card-icon{width:64px;height:64px;max-width:85%}
.reward-list .card-text{flex:1;display:flex;flex-direction:column;width:100%;gap:5px}
.reward-list .card-name{margin:4px 0 0;color:#fff4e8;font:clamp(18px,2.4vw,23px)/1.08 var(--pixel)}
.reward-list .card-desc{flex:1;display:grid;place-items:center;margin:0;padding:9px 6px;color:#4a3045;background:#ecd1cc;box-shadow:inset 0 2px #f6e1d8;font:600 clamp(13px,1.55vw,16px)/1.24 var(--body)}
.reward-list .card-key{right:5px;top:4px;color:#eed7dc}
.dialog-relic .dialog-actions{justify-content:center;margin:10px 0 0}
@media(max-width:550px){.dialog-relic .reward-list{gap:7px}.reward-list .card{padding:6px 2px 2px;border-width:2px}.reward-list .card-name{font-size:18px;display:grid;place-items:center;min-height:2.16em}.reward-list .card-desc{padding:7px 4px}.reward-list .card-icon{width:48px;height:48px}.reward-list .card-key{display:none}}
@media(max-width:340px){.dialog-relic .reward-list{gap:5px}.reward-list .card-name{font-size:16px}.veil:has(.dialog-relic){padding-inline:2px}}
@media(max-height:420px) and (orientation:landscape){.reward-list .card-icon{width:34px;height:34px}.reward-list .card-desc{padding:5px}.dialog-relic h2{font-size:19px;margin-bottom:9px}.dialog-relic .dialog-actions{margin-top:6px}}
.dialog-story .speaker{border-color:#8c705b}.dialog-story{width:min(96%,590px)}
.note-key{width:43px;height:44px;padding:5px;border:2px solid #b89671;background:#58434d;box-shadow:inset 0 2px #785c62,0 2px #1c1621}
.note-key:disabled{filter:grayscale(1);opacity:.48}.note-key img{width:100%;height:100%;object-fit:contain}.note-key.playing{background:#ac8251;border-color:#fff4c8}
#dialog.dialog-setpiece{width:min(96%,730px)}
@media(orientation:portrait){
 .title-paint img{object-position:center;object-fit:cover}.title-shade{background:linear-gradient(0deg,#17212c58,transparent 18%)}
 .title-content{inset:0;width:100%;max-width:none;justify-content:space-between;padding:clamp(40px,12svh,140px) 4% max(28px,5.5svh);gap:0}
 .title-lockup{max-width:650px}.title-menu{gap:9px}.ribbon{font-size:clamp(15px,3.5vw,23px);padding:5px 13px}
 .title-sound{right:10px;top:max(10px,env(safe-area-inset-top));bottom:auto;min-height:37px}.title-sound span{display:none}
 .start-button{height:52px;min-width:235px;font-size:25px}.title-link{font-size:17px}
 .yard-camera,.story-box{width:100%}.yard-camera{aspect-ratio:1.24;max-height:53svh}
 .yard{width:100%;left:0}.story-box{flex-wrap:wrap;padding:10px;gap:9px}.yard-buttons{width:100%;justify-content:flex-end}
 .yard-face{width:35px;height:35px}.opening-head{margin-bottom:15px}.opening{padding:14px}
}
@media(max-width:650px) and (orientation:portrait){
 .cabinet{width:calc(100% - 16px);padding:8px 0 16px}
 .scene{height:clamp(310px,62svh,670px);aspect-ratio:auto}
 .hud{padding:0 6px;height:58px}.hud-end{gap:4px}.wallet{font-size:14px}.hud-end .tool{width:32px;min-width:32px;height:34px}.hud-end .glyph{scale:.8}
 .place{max-width:37%;left:49%}.place h1{white-space:normal;line-height:1.05;font-size:16px}.chapter{letter-spacing:.5px}
 .belt{gap:3px;margin-top:8px}.belt-tools,.belt-actions{gap:4px}.belt-move{display:none}
 .belt-tool,.field-action{gap:3px;font-size:13px;padding:6px;min-height:45px}.belt-tool>span,.field-action>span{width:21px;height:21px}
 .field-action kbd{display:none}.quest{max-width:calc(100% - 14px);padding-right:6px}.quest strong{font-size:14px}.quest small{font-size:9px}
}
@media(max-height:560px) and (orientation:landscape){
 .title-content{gap:18px}.start-button{height:40px;font-size:20px;min-width:185px}.ribbon{padding:4px 10px;font-size:13px}.title-menu{gap:5px}.title-link{padding:5px 11px;font-size:15px}
 .opening{padding:3px 80px}.opening-head{display:none}.yard-camera{width:min(100%,calc((100svh - 94px)*1.88))}.story-box{width:100%;padding:4px 9px;margin-top:6px;gap:9px}.yard-speech span{font-size:12px}.yard-speech p{font-size:14px}.yard-face{width:30px;height:30px}
 .cabinet{display:block;width:min(99%,calc((100svh - 51px)*1.88235));padding:0}.scene{height:auto;min-height:0;aspect-ratio:960/510}.hud{height:35px}.hud-end .tool{height:28px;min-width:29px;width:29px}
 .belt{position:absolute;inset:35% 4px auto;pointer-events:none;align-items:flex-start;margin:0}.belt-tools,.belt-actions{flex-direction:column;pointer-events:auto}.belt-tool,.field-action{flex-direction:column;font-size:11px;gap:2px;padding:5px 3px;min-width:44px;background:#342a35e8}.belt-tool>span,.field-action>span{width:20px;height:20px}
 .belt-move,.field-action kbd{display:none}.quest strong{font-size:12px}.quest small{font-size:8px}.quest .glyph{display:none}
}
@media(pointer:coarse){.field-action kbd,.desktop-hint,.move-keys{display:none}.touch-hint{display:inline}}
@media(prefers-reduced-motion:reduce){#motes{display:none}.yard-hotspot.call-bell b{animation:none}}
.scene.arriving:before{content:'';position:absolute;z-index:3;inset:0;pointer-events:none;animation:roomEnter .38s ease-out both}
@keyframes roomEnter{from{background:#271e32b0}to{background:transparent}}
.veil:has(.dialog-story){align-items:end;padding-bottom:clamp(18px,5svh,65px);background:linear-gradient(0deg,#140e1bd9,transparent 70%);backdrop-filter:none}
@media(prefers-reduced-motion:reduce){.scene.arriving:before{display:none}}

/* The notebook opens along a stitched seam. Its pages can be read independently on a phone. */
.dialog-journal {
  width: min(790px,96vw);
  background: #ebd6ad;
  background-image: linear-gradient(90deg,#d4b68a 0,transparent 3%,transparent 48%,#ddc49b 49.6%,#c2a37d 50%,#ead2aa 51%,transparent 53%);
  color: #4b3540;
  border-color: #a58260;
  box-shadow: 0 0 0 4px #422d38,0 0 0 7px #66434a,0 10px 0 4px #211820,inset 0 0 0 2px #f5e4bd;
}
.dialog-journal h2,.dialog-journal h3{color:#5a3a3b}
.dialog-journal .eyebrow,.dialog-journal .book-count{color:#715345}
.dialog-journal .eyebrow{font-size:11px}
.book-spread{display:grid;grid-template-columns:1fr 1fr;gap:clamp(30px,6vw,68px)}
.book-page{min-width:0}
.field-sketch{width:100%;height:104px;object-fit:cover;border:3px solid #ba9a70;box-shadow:0 2px #c6a67c;margin:3px 0 12px}
.dialog-journal .book-page h3{margin:8px 0 6px;font-size:23px}
.current-job{border-left:3px solid #9b704e;padding-left:10px;font-weight:bold}
.book-emblem{width:40px;height:40px;display:block;margin:0 0 6px}
.notes{display:flex;flex-wrap:wrap;gap:5px}
.dialog-journal .note-key{width:32px;height:35px;padding:4px;background:#bd9b71;border-color:#8f6d55}
.book-count{font-size:14px}
.dialog-journal .smallbtn{font-size:15px;background:#6d5148;color:#fff0ce}
.dialog-journal .book-page .dialog-actions{margin-top:9px}
.dialog-journal .book-page .dialog-actions + h3{margin-top:18px}
.dialog-journal .close{color:#f7e8cc}
.bag-title{display:flex;align-items:center;gap:14px}.bag-emblem{width:69px;height:69px;display:block}
.dialog-satchel .entry{padding:10px 6px}.dialog-satchel .entry img{width:43px;height:43px}
.worldlist{grid-template-columns:1fr 1fr}.world-row{flex-wrap:wrap;column-gap:5px}.world-row b{font-size:14px}
.world-row small{flex-basis:100%;padding-left:32px}.dialog-map{width:min(660px,95vw)}
@media(max-width:520px){
 .book-spread{grid-template-columns:1fr;gap:15px}.dialog-journal{background:#ebd6ad}.book-page+.book-page{border-top:1px solid #bc9976;padding-top:12px}
 .field-sketch{height:86px}.book-emblem{float:right}.dialog-map .world-row{padding:5px}.world-row b{font-size:12px}.world-row small{padding-left:0}
}

/* Compact inventory art is drawn at a fixed 12-pixel size. */
.hud .hearts img,.hud .wallet i{width:24px;height:24px}
.hud .portrait{width:54px;height:54px;padding:1px}
.hud .portrait img{width:48px;height:48px}
.belt-tool>span,.field-action>span{width:32px;height:32px}
@media(max-width:650px) and (orientation:portrait){
 .hud{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:4px}
 .hud .place{position:static;transform:none;max-width:100%;margin:auto}
 .hud .portrait{width:30px;height:30px}.hud .portrait img{width:24px;height:24px}
 .hud .vitals{gap:3px}.hud .hearts{display:grid;grid-template-columns:repeat(4,12px);gap:1px}
 .hud .hearts img,.hud .wallet i{width:12px;height:12px}
 .hud .place h1{font-size:clamp(13px,3.8vw,18px)}
 .belt-tool>span,.field-action>span{width:24px;height:24px}
}
@media(max-height:560px) and (orientation:landscape){
 .hud .hearts img,.hud .wallet i{width:12px;height:12px}
 .hud .portrait{width:30px;height:30px}.hud .portrait img{width:24px;height:24px}
 .belt-tool>span,.field-action>span{width:24px;height:24px}
}
