@font-face{font-family:UmaPixel;src:url('./assets/fonts/PressStart2P-Regular.ttf') format('truetype');font-display:swap}
@font-face{font-family:UmaText;src:url('./assets/fonts/UmaText.ttf') format('truetype');font-display:swap}
@font-face{font-family:UmaDisplay;src:url('./assets/fonts/UmaDisplay.ttf') format('truetype');font-display:swap}
:root{color-scheme:dark;--ink:#030a1e;--cream:#ffe4a3;--cyan:#08d9f4;--edge:#1679ad;--gold:#ffd05b}
*{box-sizing:border-box}[hidden]{display:none!important}
body{margin:0;min-height:100svh;background:var(--ink);color:var(--cream);font:13px ui-monospace,Consolas,monospace;display:flex;align-items:center;justify-content:center}
main{width:100%;max-width:1536px;margin:auto}.cabinet{width:100%;background:var(--ink);container-type:inline-size}
.game-shell{position:relative;aspect-ratio:8/5;isolation:isolate;background:#071839;overflow:hidden}
canvas{display:block;image-rendering:pixelated}#game{width:100%;height:100%;outline:none}#controls-art{width:100%;height:auto}
button,a{touch-action:manipulation;-webkit-tap-highlight-color:transparent}button{cursor:pointer;font:inherit}button:disabled{cursor:wait;opacity:.65}
button:focus-visible,a:focus-visible{outline:3px solid #dff6ff;outline-offset:4px}a{color:var(--cream)}.screen{position:absolute;inset:0}
.game-heading{position:absolute;top:5%;left:3%;width:94%;text-align:center}
.game-heading h1{font:clamp(22px,5.1cqw,78px)/1.14 UmaDisplay,UmaPixel,monospace;margin:0;color:#ffe7a9;text-shadow:0 5px #b37527,4px 6px #000716;filter:drop-shadow(-3px 0 #000716) drop-shadow(3px 0 #000716)}
.ornament{display:flex;justify-content:center;align-items:center;gap:clamp(8px,1.2cqw,18px);color:var(--cyan);margin:12px auto 0;font:clamp(16px,2.6cqw,40px)/1.1 UmaText,monospace;letter-spacing:clamp(1px,.16cqw,2.5px)}
.ornament span{position:relative;white-space:nowrap;padding:6px 18px;border-top:2px solid #0f82a5;border-bottom:2px solid #0f82a5;text-shadow:2px 2px #00101e}
.ornament::before,.ornament::after{content:'';height:6px;width:clamp(24px,6cqw,92px);background:var(--cyan);box-shadow:0 3px #075783;clip-path:polygon(0 30%,83% 30%,90% 0,97% 30%,100% 30%,100% 70%,97% 70%,90% 100%,83% 70%,0 70%)}
.ornament::after{transform:scaleX(-1)}.game-heading p{text-transform:lowercase;font-size:clamp(17px,2.7cqw,42px);margin-top:14px}
.pixel-panel{position:relative;background:#020c20f2;border:3px solid #06d4f4;box-shadow:0 0 0 3px #143f6c,inset 0 0 0 4px #092d55,5px 5px #010716}
.pixel-panel::before,.pixel-panel::after{content:'';position:absolute;width:16px;height:16px;pointer-events:none;z-index:2;border-color:#ffcb54;border-style:double}
.pixel-panel::before{left:5px;top:5px;border-width:6px 0 0 6px}.pixel-panel::after{right:5px;bottom:5px;border-width:0 6px 6px 0}
.menu-panel{position:absolute;left:16%;top:29%;width:38%;height:54%;padding:16px 30px 24px}
.menu-panel h2{font:clamp(16px,2.15cqw,33px)/1.2 UmaText,monospace;text-align:center;color:var(--cyan);margin:0 0 14px}
.menu-options{height:calc(100% - 48px);display:flex;flex-direction:column;justify-content:space-between;gap:10px}
.menu-item{position:relative;display:flex;align-items:center;justify-content:center;text-align:center;flex:1;min-height:0;width:100%;font:clamp(16px,2.45cqw,38px)/1.1 UmaText,monospace;border:2px solid #0878ac;box-shadow:inset 0 2px #163856,2px 2px #00071a;color:#ffe9ba;background:#031024;text-decoration:none;padding:7px 4px;white-space:nowrap}
.menu-item.selected,.menu-item:focus-visible,.monster-option.selected{background:linear-gradient(110deg,#ffda75,#ffda86);color:#101b2b;border-color:#ffe6a2;box-shadow:inset 0 0 0 3px #be8b32,2px 3px #00091c}
.paw-icon,.menu-item.selected::before,.monster-option.selected::before{width:30px;height:32px;flex-shrink:0;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 20' shape-rendering='crispEdges'%3E%3Cpath fill='%23010918' d='M0 4h6v8H0zM4 0h6v9H4zM10 1h6v9h-6zM14 6h4v8h-4zM3 11h12v9H3z'/%3E%3Cpath fill='%23fff1c1' d='M1 6h4v5H1zM5 1h4v6H5zM11 2h4v6h-4zM15 8h3v5h-3zM5 12h8v6H5zM7 10h4v2H7zM3 15h12v3H3z'/%3E%3C/svg%3E") center/contain no-repeat}
.menu-item.selected::before{content:'';position:absolute;left:-36px;top:50%;transform:translateY(-50%)}
.media-blue{color:#72d8ff}.media-link.selected .media-blue{color:#17679d}.loading{position:absolute;bottom:3%;left:5%;width:90%;text-align:center;color:#bddeee;font-size:12px}
.menu-hint{height:clamp(30px,4.17cqw,64px);display:flex;align-items:center;justify-content:center;gap:clamp(16px,3cqw,46px);font:clamp(12px,1.75cqw,27px)/1 UmaText,monospace;color:#00cfff;background:#030a1e8c}
[data-screen="library"] .cabinet{background:url('./assets/library-room.png?v=0.15.0') center/cover}
.section-heading{position:absolute;top:3.7%;left:4.3%;width:91.4%;text-align:center}
.section-heading h2{margin:0;font:clamp(35px,6.51cqw,100px)/1.04 UmaDisplay,UmaPixel,monospace;color:#ffe6a4;text-shadow:0 6px #a96b23,4px 7px #020816;filter:drop-shadow(-4px 0 #020816) drop-shadow(4px 0 #020816)}
.section-heading>.ornament{margin-top:0;font-size:clamp(16px,2.6cqw,40px);letter-spacing:clamp(1px,.26cqw,4px)}.section-heading>.ornament span{border:0;padding:0 4px}
.back-button{color:#fff0c9;background:#021124;border:2px solid #07cfee;box-shadow:0 0 0 2px #113e6b,inset 0 0 0 2px #092844,3px 3px #01091b;padding:8px 18px;font:clamp(14px,2.6cqw,40px)/1.1 UmaText,monospace;text-decoration:none;cursor:pointer}
.section-heading .back-button{position:absolute;left:0;top:10px;min-width:17.2%;z-index:2}
.library-panel{position:absolute;left:11.3%;top:20%;width:77.3%;height:74.5%;display:grid;grid-template-columns:36% 64%;padding:7px}
.library-panel::before,.library-panel::after{content:none}
.frame-corner{position:absolute;width:clamp(18px,2cqw,31px);height:clamp(18px,2cqw,31px);pointer-events:none;z-index:3;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' shape-rendering='crispEdges'%3E%3Cpath fill='%23040c20' d='M0 0h24v5H10v5H5v14H0zM7 7h15v15H7z'/%3E%3Cpath fill='%23ce8b1b' d='M2 2h20v3H9v4H5v13H2zM9 9h12v12H9z'/%3E%3Cpath fill='%23ffd649' d='M1 4h3V1h14v3H7v4H4v10H1zM9 9h10v10H9z'/%3E%3Cpath fill='%23fff0a3' d='M4 1h5v3H4zM1 4h3v5H1zM10 10h4v3h-4z'/%3E%3Cpath fill='%23704917' d='M13 13h4v4h-4z'/%3E%3C/svg%3E") center/contain no-repeat}
.top-left{left:-4px;top:-4px}.top-right{right:-4px;top:-4px;transform:rotate(90deg)}.bottom-left{left:-4px;bottom:-4px;transform:rotate(-90deg)}.bottom-right{right:-4px;bottom:-4px;transform:rotate(180deg)}
#monster-list{display:flex;flex-direction:column;gap:clamp(3px,.46cqw,7px);padding:clamp(8px,1.04cqw,16px) 9px clamp(10px,1.43cqw,22px) 11px;border-right:5px double #14ccf0;min-width:0}
.monster-option{position:relative;flex:1;min-height:0;border:2px solid #087db4;background:#020c1df2;color:#f9edcf;padding:3px;display:grid;grid-template-columns:46% 54%;align-items:center;text-align:left;width:100%;font:clamp(16px,2.73cqw,42px)/1.06 UmaText,monospace;box-shadow:inset 0 0 0 2px #03192e}
.monster-option::after{content:'';position:absolute;inset:3px;pointer-events:none;background:linear-gradient(135deg,#ffcf57 0 4px,transparent 4px) top left,linear-gradient(-135deg,#ffcf57 0 4px,transparent 4px) top right,linear-gradient(45deg,#ffcf57 0 4px,transparent 4px) bottom left,linear-gradient(-45deg,#ffcf57 0 4px,transparent 4px) bottom right;background-size:8px 8px;background-repeat:no-repeat}
.monster-option.selected::before{content:'';position:absolute;left:-20px;top:50%;transform:translateY(-50%);z-index:1}
.monster-option canvas{width:100%;height:100%;max-height:110px;object-fit:contain}.monster-option span{overflow-wrap:normal;padding:0 6px 0 0}
#monster-card{min-width:0;display:flex;flex-direction:column;padding:clamp(7px,.91cqw,14px) clamp(10px,1.69cqw,26px) clamp(8px,1.17cqw,18px) clamp(10px,1.56cqw,24px);overflow:auto;scrollbar-color:#437391 #061329}
#monster-title{font:clamp(28px,5.47cqw,84px)/1 UmaDisplay,UmaPixel,monospace;color:#ffebaf;text-transform:uppercase;text-align:left;margin:0;flex-shrink:0;text-shadow:2px 3px #050916}
#monster-title.long-title{font-size:clamp(24px,3.65cqw,56px);line-height:1.2}
.portrait-stage{position:relative;flex:1;min-height:clamp(40px,6.51cqw,100px);margin:2px -6px 8px;background:linear-gradient(0deg,#08537d 0 2px,transparent 2px 7px,#03142d 7px 9px,transparent 9px),url('./assets/library-room.png?v=0.15.0') 73% 50% /200%;isolation:isolate}
.portrait-stage::before{content:'';position:absolute;inset:0;background:#020e23c9;z-index:-1}
#monster-art{width:100%;height:100%;object-fit:contain;position:absolute;inset:0}
#monster-description{font:clamp(14px,2.21cqw,34px)/1.04 UmaText,monospace;color:#fff3d4;margin:0 0 12px;flex-shrink:0}
#monster-abilities{margin:0;border-top:2px solid #087bb4;flex-shrink:0}
#monster-abilities>div{display:grid;grid-template-columns:37% 63%;align-items:center;border-bottom:1px solid #087bb4;min-height:clamp(24px,3.39cqw,52px);padding:5px 0;gap:0}
dt{display:flex;align-items:center;gap:clamp(6px,1.3cqw,20px);font:clamp(13px,2.15cqw,33px)/1 UmaText,monospace;color:#fff3da;overflow-wrap:anywhere;padding-right:5px}
dd{font:clamp(13px,1.82cqw,28px)/1.06 UmaText,monospace;margin:0;padding-right:4px;color:#fff0d5;display:flex;gap:8px}dd::before{content:'—';flex-shrink:0}
.sound-icon{display:block;width:38px;height:38px;flex:0 0 38px;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' shape-rendering='crispEdges'%3E%3Cpath fill='%2303e2f4' d='M2 9h4v4h3v7H6v4H2v-5h3v-5H2zM10 4h4v4h3v5h2v7h-2v5h-3v4h-4v-4h3v-5h2v-7h-2V8h-3zM20 0h4v4h3v6h2v12h-2v6h-3v4h-4v-5h3v-6h2V11h-2V5h-3z'/%3E%3C/svg%3E") center/contain no-repeat}
.danger-icon{position:relative;display:block;flex:0 0 38px;height:38px}.danger-icon::before,.danger-icon::after{content:'';position:absolute;background:#ff252c;left:14px;width:11px}
.danger-icon::before{top:0;height:24px;clip-path:polygon(20% 0,80% 0,100% 15%,80% 90%,50% 100%,20% 90%,0 15%)}.danger-icon::after{bottom:0;height:8px;clip-path:polygon(20% 0,80% 0,100% 30%,100% 70%,70% 100%,30% 100%,0 70%,0 30%)}
.tactic{position:relative;border:2px solid #ffd12c;box-shadow:inset 0 0 0 3px #3f3416;padding:clamp(5px,.65cqw,10px) clamp(6px,.78cqw,12px);margin-top:clamp(6px,1.04cqw,16px);display:flex;gap:clamp(6px,1.17cqw,18px);align-items:center;min-height:clamp(32px,4.43cqw,68px);flex-shrink:0}
.tactic::before,.tactic::after{content:'';position:absolute;width:6px;height:6px;background:#ffe57c;left:2px;top:2px;box-shadow:3px 3px #ae7a1f}.tactic::after{left:auto;top:auto;right:2px;bottom:2px}
.tactic strong{display:flex;align-items:center;gap:8px;font:clamp(13px,1.82cqw,28px)/1 UmaText,monospace;color:#ffd12c;flex-shrink:0;padding-right:12px;border-right:2px solid #c28a25;white-space:nowrap}
.tactic p{font:clamp(13px,1.69cqw,26px)/1.06 UmaText,monospace;margin:0;color:#fff0d3}
.authors-screen::before{content:'';position:absolute;inset:0;background:#02091b70}.authors-panel{position:absolute;left:15%;top:24%;width:70%;padding:35px;line-height:2.1;background:#020d22f5}
.authors-panel h3{font:clamp(12px,1.65cqw,24px)/1.8 UmaPixel,monospace}.authors-panel p{font-size:clamp(12px,1.4cqw,20px);margin:20px 0}.authors-panel a{color:#8bd9ff}.credits-small{opacity:.7}
.overlay{position:absolute;inset:0;display:grid;place-items:center;background:#020a1cb0;padding:20px;text-align:center}.result-panel{max-width:600px;width:65%;padding:30px}
.result-panel h2{font:clamp(12px,2cqw,28px)/1.7 UmaPixel,monospace;margin:0}.result-panel p{line-height:1.8;color:#d5e1e5}
.gold-button{background:#ffda83;color:#172137;border:2px solid #ffebbc;border-bottom:5px solid #a87f3c;padding:14px 18px;font:clamp(9px,1cqw,15px)/1.5 UmaPixel,monospace;cursor:pointer}.result-panel .back-button{display:block;margin:16px auto 0;font-size:20px}
.status{position:absolute;bottom:7%;left:50%;transform:translateX(-50%);background:#06152cf0;border:2px solid #70aecb;padding:10px 16px;color:#edf2ed;font-size:12px;line-height:1.6;text-align:center;pointer-events:none;max-width:90%;width:max-content;opacity:0;transition:opacity .15s}.status.visible{opacity:1}
#pause{position:absolute;top:2%;right:1.8%;width:4%;height:8%;min-width:25px;min-height:25px;border:3px solid #7285ab;border-radius:0;background:#0c1731;display:flex;align-items:center;justify-content:center;gap:12%;padding:0}#pause span{width:13%;height:45%;background:#a7bada}
footer{display:flex;align-items:center;justify-content:space-between;padding:10px 18px;color:#6d84a8;font-size:9px;letter-spacing:1px}footer button{background:none;color:#8fa7c3;border:1px solid #334565;font-size:10px;padding:8px 10px}
.touch-controls{display:none;justify-content:space-between;gap:12px;padding:10px}.touch-controls>div{display:flex;gap:8px}.touch-controls button{min-width:48px;height:50px;background:#122b46;color:#ffe4a3;border:2px solid #6f85a8;border-bottom:4px solid #34445e;touch-action:none;user-select:none}.touch-controls button:active{background:#3b5d7b}
.has-touch .touch-controls{display:flex}.has-touch [data-screen="game"] #controls-art{display:none}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
@media(pointer:coarse){[data-screen="game"] #controls-art{display:none}.touch-controls{display:flex}}
@media(max-width:700px){
 .pixel-panel{border-width:2px;box-shadow:0 0 0 2px #123f6b,inset 0 0 0 1px #082c51,2px 2px #010716}.pixel-panel::before,.pixel-panel::after{width:7px;height:7px;border-width:3px}
 .game-heading h1{text-shadow:0 2px #a57430;filter:drop-shadow(2px 2px #000716)}.ornament{gap:6px}.ornament span{padding:5px 8px;border-width:1px}.game-heading p{margin-top:10px}
 .menu-panel{padding:10px 14px 14px}.menu-panel h2{margin-bottom:8px}.menu-options{height:calc(100% - 30px);gap:6px}.menu-item{padding:5px 2px}.menu-item.selected{box-shadow:inset 0 0 0 1px #b78639}.menu-item.selected::before{left:-20px;width:16px;height:20px}
 .menu-hint{gap:12px;font-size:12px}.loading{font-size:9px;bottom:0}.status{font-size:9px;padding:7px 10px}.result-panel{width:92%;padding:16px}.result-panel p{font-size:11px}.result-panel .back-button{font-size:15px;padding:8px}.gold-button{font-size:9px;padding:10px 12px}
 footer{font-size:7px;letter-spacing:0;padding:8px 10px}footer button{font-size:8px;padding:6px}.touch-controls{gap:8px;padding:8px}.touch-controls>div{gap:4px}.touch-controls button{width:44px;min-width:44px;padding:0;font-size:9px;height:46px}#pause{border-width:2px}
 .authors-panel{left:5%;width:90%;top:115px;padding:18px}.authors-panel h3{font-size:10px}.authors-panel p{font-size:13px;margin:15px 0}
}
@media(max-width:700px) and (orientation:portrait){
 #app[data-screen="menu"] .game-shell{height:600px;aspect-ratio:auto}.game-heading{top:6%;left:4%;width:92%}.game-heading h1{font-size:clamp(24px,6cqw,38px);line-height:1.45}.game-heading p{font-size:24px;letter-spacing:0;gap:7px}.game-heading .ornament::before,.game-heading .ornament::after{width:22px}
 .menu-panel{left:6%;top:28%;width:58%;height:62%;padding:14px 12px 18px}.menu-panel h2{font-size:24px;margin-bottom:12px}.menu-options{height:calc(100% - 42px);gap:10px}.menu-item{font-size:23px;min-height:55px}
 #app[data-screen="library"] .game-shell{height:auto;min-height:1000px;aspect-ratio:auto}#app[data-screen="library"] #game{position:absolute;inset:0}#library-screen{position:relative;min-height:1000px;padding:152px 0 26px}
 .section-heading{top:16px;left:5%;width:90%}.section-heading h2{font-size:38px;margin-top:52px;text-shadow:0 3px #a57430;filter:none}.section-heading .back-button{top:0;font-size:23px;padding:6px 10px}
 .section-heading>.ornament{font-size:17px;letter-spacing:0;margin-top:8px;gap:5px}.section-heading .ornament::before,.section-heading .ornament::after{width:20px}
 .library-panel{position:relative;left:5%;width:90%;top:auto;height:auto;display:flex;flex-direction:column;padding:6px}#monster-list{height:320px;flex:none;gap:4px;border-right:0;border-bottom:3px double #14ccf0;padding:4px 4px 10px}
 .monster-option{grid-template-columns:85px 1fr;font-size:26px;padding:0 4px}.monster-option canvas{height:54px;width:80px;object-fit:contain}.monster-option span{padding-left:5px}.monster-option.selected::before{width:20px;height:24px;left:-12px}
 #monster-card{padding:16px 7px 8px;overflow:visible}#monster-title{font-size:34px;text-align:center;line-height:1.1}#monster-title.long-title{font-size:25px}.portrait-stage{height:170px;min-height:170px;flex:none;margin:6px 0 12px}
 #monster-description{font-size:23px;line-height:1.12;margin-bottom:12px}#monster-abilities>div{min-height:50px;padding:8px 0;grid-template-columns:1fr;gap:6px}dt{font-size:22px;gap:8px;padding-right:6px;overflow-wrap:normal}dd{font-size:21px;line-height:1.15;gap:3px;padding-left:30px}
 .sound-icon,.danger-icon{flex-basis:22px;width:22px;height:27px}.danger-icon::before,.danger-icon::after{left:8px;width:8px}.danger-icon::before{height:18px}.danger-icon::after{height:6px}
 .tactic{gap:8px;padding:10px 8px;margin-top:14px;min-height:75px;flex-direction:column;align-items:stretch}.tactic strong{font-size:21px;gap:8px;padding:0 0 8px;max-width:none;line-height:1.15;white-space:nowrap;border-right:0;border-bottom:1px solid #c28a25}.tactic .paw-icon{width:20px;height:23px}.tactic p{font-size:22px;line-height:1.15}
 #app[data-screen="authors"] .game-shell{aspect-ratio:auto;height:550px}
}
@media(max-height:550px) and (orientation:landscape){
 main{max-width:150svh}body{align-items:start}footer{display:none}.touch-controls{position:fixed;inset:auto 0 0;background:transparent;pointer-events:none;padding:7px}.touch-controls button{pointer-events:auto;opacity:.85;height:40px;min-width:44px}.menu-hint{height:25px}
 .game-heading{top:4%}.game-heading p{font-size:2.8cqw;margin-top:7px}.menu-panel{padding:7px 15px 12px}.menu-panel h2{margin-bottom:5px}.menu-options{height:calc(100% - 24px);gap:4px}.back-button{padding:4px 8px}.section-heading .back-button{top:3px}
 #monster-card{padding:7px 10px 7px}#monster-list{padding:7px 5px 10px 5px;gap:4px}.monster-option{font-size:2.7cqw}#monster-abilities>div{min-height:23px;padding:3px 0}dt{gap:7px}.sound-icon,.danger-icon{width:18px;height:18px;flex-basis:18px}.danger-icon::before,.danger-icon::after{width:6px;left:6px}.danger-icon::before{height:12px}.danger-icon::after{height:4px}
 #monster-description{margin-bottom:5px}.portrait-stage{min-height:40px;margin-bottom:5px}.tactic{margin-top:6px;padding:5px;min-height:29px;gap:7px}.tactic strong{gap:4px;padding-right:6px}.tactic .paw-icon{width:16px;height:18px}
 #app[data-screen="authors"] .game-shell{height:auto;min-height:350px;aspect-ratio:8/5}.authors-panel{top:24%}
}
.dialogue-screen{position:absolute;inset:auto 2% 2%;z-index:8;filter:drop-shadow(0 -15px 25px #020817a0)}
.dialogue-panel{display:grid;grid-template-columns:auto 1fr;gap:clamp(12px,1.56cqw,24px);padding:clamp(12px,1.43cqw,22px);background:#020b1dfb}
#narrator-portrait{width:clamp(100px,12.5cqw,192px);height:auto;image-rendering:pixelated;align-self:center}
.dialogue-content{min-width:0}.dialogue-heading{display:flex;align-items:start;justify-content:space-between;gap:12px}
.dialogue-heading h2{font:clamp(18px,2.34cqw,36px)/1.15 UmaDisplay,UmaPixel,monospace;margin:0;color:#ffe4a3}
.narrator-role{font:clamp(15px,1.56cqw,24px)/1.1 UmaText,monospace;color:#a4bacb;margin:5px 0 0}
#dialogue-progress{font:clamp(16px,1.56cqw,24px)/1 UmaText,monospace;color:#88dce9;white-space:nowrap}
.dialogue-scene{font:clamp(16px,1.69cqw,26px)/1.1 UmaText,monospace;letter-spacing:1px;color:#05d9f0;margin:14px 0 7px}
#dialogue-text{font:clamp(20px,2.21cqw,34px)/1.16 UmaText,monospace;color:#fff0d2;margin:0 0 18px;min-height:2.3em}
.dialogue-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.dialogue-actions .gold-button{font:clamp(18px,1.82cqw,28px)/1.1 UmaText,monospace;min-height:44px;padding:9px 20px}
.dialogue-secondary{font:clamp(16px,1.56cqw,24px)/1.1 UmaText,monospace;min-height:44px;padding:8px 12px;border:1px solid #357b9e;background:#06172a;color:#b1d0de}
.dialogue-hint{font:clamp(13px,1.17cqw,18px)/1.1 UmaText,monospace;color:#7595ad;margin:12px 0 0}
.dialogue-touch-hint{display:none}.has-touch .dialogue-keyboard-hint{display:none}.has-touch .dialogue-touch-hint{display:inline}
[data-dialogue="true"] .touch-controls{display:none}
@media(max-width:700px) and (orientation:portrait){
 [data-screen="game"][data-dialogue="true"] .game-shell{aspect-ratio:auto}
 [data-screen="game"][data-dialogue="true"] #game{height:auto}
 .dialogue-screen{position:relative;inset:auto;padding:0 10px 14px;filter:none;background:#030b1e}
 .dialogue-panel{display:block;padding:12px}
 #narrator-portrait{float:left;width:76px;margin:0 12px 10px 0}
 .dialogue-heading{min-height:100px;gap:4px}.dialogue-heading h2{font:28px/1.12 UmaText,monospace}
 .narrator-role{font-size:19px;line-height:1.15}#dialogue-progress{font-size:17px}
 .dialogue-scene{clear:both;font-size:21px;line-height:1.2;margin:9px 0}
 #dialogue-text{clear:both;font-size:24px;line-height:1.16;margin-bottom:16px}
 .dialogue-actions{clear:both;display:grid;grid-template-columns:1fr 1fr;gap:8px}
 .dialogue-actions .gold-button{grid-column:1/-1;font-size:25px}
 .dialogue-secondary{font-size:20px;padding:7px 5px}
 .dialogue-hint{font-size:17px;line-height:1.25;margin-top:10px}
 .dialogue-keyboard-hint{display:none}.dialogue-touch-hint{display:inline}
 .authors-panel{padding:14px}.authors-panel p{margin:12px 0}
 #app[data-screen="authors"] .game-shell{height:650px}
}
@media(max-height:550px) and (orientation:landscape){
 .dialogue-screen{inset:auto 2% 1%}.dialogue-panel{padding:9px;gap:10px}
 #narrator-portrait{width:78px}.dialogue-heading h2{font-size:21px}
 .narrator-role{font-size:16px}.dialogue-scene{font-size:17px;margin:7px 0 5px}
 #dialogue-text{font-size:20px;margin-bottom:8px}.dialogue-actions{gap:6px}
 .dialogue-actions .gold-button,.dialogue-secondary{min-height:34px;padding:6px 10px;font-size:18px}
 .dialogue-hint{display:none}
}
/* Dialogues share one grid and one height; page length cannot move the controls. */
.dialogue-screen{position:absolute;inset:auto 2% 2%;padding:0;background:none;z-index:8}
.dialogue-panel{height:310px;min-height:0;display:grid;grid-template-columns:140px minmax(0,1fr);gap:18px;padding:16px;background:#020c20fc}
#narrator-portrait{float:none;width:140px;height:175px;margin:0;align-self:center;object-fit:contain}
.dialogue-content{display:grid;grid-template-rows:64px 26px minmax(0,1fr)44px 18px;gap:7px;min-height:0}
.dialogue-heading{position:relative;min-height:0;display:flex;align-items:start;gap:12px;padding-right:50px}
.dialogue-heading h2{font:30px/1.1 UmaDisplay,monospace;margin:0;white-space:nowrap}
.narrator-role{font:21px/1 UmaText,monospace;margin:6px 0 0}
#dialogue-progress{position:absolute;right:0;top:0;font:24px/1 UmaText,monospace}
.dialogue-scene{clear:none;font:23px/1 UmaText,monospace;letter-spacing:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0;align-self:center}
#dialogue-text{clear:none;min-height:0;margin:0;font:28px/1.17 UmaText,monospace;overflow:auto;scrollbar-width:thin;scrollbar-color:#2f83a5 #07142c}
.dialogue-actions{clear:none;display:flex;flex-wrap:nowrap;align-items:stretch;gap:10px}
.dialogue-actions .gold-button,.dialogue-secondary{min-height:44px;margin:0;font:24px/1 UmaText,monospace;padding:8px 14px;white-space:nowrap}
.dialogue-hint{display:block;clear:none;font:17px/1 UmaText,monospace;margin:0;align-self:end}
#pause{flex-direction:column;gap:10%;z-index:9}
#pause span{width:48%;height:7%;flex:none}
.pause-layer{position:absolute;inset:0;z-index:15;background:#01081bd6;display:grid;place-items:center;padding:20px}
.pause-panel{width:min(380px,86%);padding:22px 24px}
.pause-panel h2{font:38px/1.1 UmaDisplay,monospace;text-align:center;color:#ffe6a4;margin:0 0 20px}
.pause-options{display:flex;flex-direction:column;gap:9px}
.pause-options .menu-item{flex:none;min-height:49px;padding:9px;font:30px/1 UmaText,monospace}
.pause-options .menu-item.selected::before{left:-31px;width:24px;height:26px}
.controls-panel{width:min(610px,95%);max-height:100%;overflow:auto;padding:22px}
.controls-panel h2{font:30px/1.2 UmaDisplay,monospace;margin:0 0 18px;text-align:center}
.controls-panel dl{margin:0}.controls-panel dl>div{display:grid;grid-template-columns:minmax(0,35fr) minmax(0,65fr);gap:12px;border-bottom:1px solid #1f5b80;padding:7px 0}
.controls-panel dt,.controls-panel dd{font:25px/1.12 UmaText,monospace;display:block;padding:0;margin:0;overflow-wrap:normal}
.controls-panel dt{color:#8be4f4}.controls-panel dd::before{content:none}
.controls-panel p{font:24px/1.18 UmaText,monospace;color:#d6e0d9;margin:17px 0}
.controls-panel .controls-note{font-size:20px;color:#9bb6c7}
.controls-actions{position:sticky;bottom:-22px;background:#020c20;display:flex;gap:10px;justify-content:space-between;padding:10px 0 4px}
.exit-screen{display:grid;place-items:center;background:#020a1a88}
.exit-panel{width:min(700px,88%);padding:35px;text-align:center}
.exit-panel h2{font:clamp(24px,4cqw,48px)/1.3 UmaDisplay,monospace;margin:0;color:#ffe7a9}
.exit-panel p{font:30px/1.2 UmaText,monospace;margin:25px 0}.exit-panel button{font:25px/1.1 UmaText,monospace}
.wake-caption{position:absolute;inset:auto 2% 4% auto;z-index:5;display:flex;align-items:center;gap:16px;padding:7px 10px;background:#020c20e8;color:#d6e8de;font:24px/1 UmaText,monospace;border-left:2px solid #21bddc}
/* Touch controls live inside the game field. No separate lower button bar. */
.touch-controls,.has-touch .touch-controls{position:absolute;inset:0;display:none;width:100%;height:100%;padding:0;gap:0;pointer-events:none;z-index:5;background:none}
.has-touch .touch-controls{display:block}
#stick-pad{display:block;position:absolute;left:0;top:38%;width:48%;height:62%;pointer-events:auto;touch-action:none;user-select:none}
#stick-base{position:absolute;left:66px;top:calc(100% - 76px);width:112px;height:112px;transform:translate(-50%,-50%);border:3px solid #6bc6d080;border-radius:50%;background:#05162e6e;box-shadow:inset 0 0 0 9px #36799516;opacity:.65}
#stick-knob{position:absolute;left:31px;top:31px;width:44px;height:44px;border:3px solid #b3e2e8;border-radius:50%;background:#45778d99;box-shadow:0 3px #04112280}
#stick-pad.engaged #stick-base{opacity:1;border-color:#8ee8ee}
#touch-actions{display:block;position:absolute;right:max(12px,env(safe-area-inset-right));bottom:max(22px,env(safe-area-inset-bottom));width:144px;height:154px;pointer-events:none}
#touch-actions button{position:absolute;display:flex;align-items:center;justify-content:center;pointer-events:auto;touch-action:none;user-select:none;min-width:0;padding:0;border:3px solid #9ac8d4bd;border-radius:50%;background:#0a2542b8;color:#ffedbd;box-shadow:0 3px #01091780}
#touch-actions .touch-paw{width:74px;height:74px;right:0;bottom:0;font:26px/1 UmaText,monospace}
#touch-actions .touch-jump{width:60px;height:60px;right:6px;top:0;font:32px/1 UmaText,monospace}
#touch-actions .touch-dash{width:56px;height:56px;left:0;bottom:14px;font:19px/1 UmaText,monospace;flex-direction:column;gap:2px;background:radial-gradient(circle,#10263c 63%,transparent 65%),conic-gradient(#93d9e0 var(--ready,100%),#263b58 0)}
#touch-actions button.pressed{background:#38647bd9;transform:scale(.94);border-color:#ffe4a0}
#dash-status{font:15px/1 UmaText,monospace;height:13px;color:#a9c7ce}
#game{touch-action:none}
.has-touch #app[data-screen="game"] footer{display:none}
@media(pointer:coarse){.touch-controls{display:block}}
@media(max-width:950px){
 .dialogue-panel{height:280px;grid-template-columns:100px minmax(0,1fr);padding:12px;gap:14px}
 #narrator-portrait{width:100px;height:125px}
 .dialogue-content{grid-template-rows:56px 22px minmax(0,1fr)40px 16px;gap:6px}
 .dialogue-heading h2{font-size:25px}.narrator-role{font-size:18px}
 .dialogue-scene{font-size:21px}#dialogue-text{font-size:24px}
 .dialogue-actions .gold-button,.dialogue-secondary{font-size:22px;padding:7px 10px;min-height:40px}
}
@media(max-width:700px) and (orientation:portrait){
 #app[data-screen="menu"] .menu-panel{top:26%;height:66%}.menu-options{gap:8px}.menu-item{min-height:51px}.menu-panel h2{margin-bottom:8px}
 #app[data-screen="game"] .game-shell{height:min(100svh,160cqw);aspect-ratio:auto}
 #app[data-screen="game"][data-dialogue="true"] .game-shell{height:auto;aspect-ratio:auto}
 #app[data-screen="game"][data-dialogue="true"] #game{height:min(100svh,160cqw);width:100%}
 #pause{width:44px;height:44px;right:8px;top:8px;min-width:44px;min-height:44px}
 .dialogue-screen{position:relative;inset:auto;padding:0 8px 10px;background:#030b1e}
 .dialogue-panel{height:400px;display:grid;grid-template-columns:68px minmax(0,1fr);grid-template-rows:84px 21px minmax(0,1fr)44px 34px;gap:6px 10px;padding:12px}
 #narrator-portrait{width:68px;height:84px;float:none;grid-column:1;grid-row:1;align-self:start;margin:0}
 .dialogue-content{display:contents}
 .dialogue-heading{grid-column:2;grid-row:1;min-height:0;padding-right:36px;gap:0;display:block}
 .dialogue-heading h2{font:23px/1.15 UmaText,monospace;white-space:normal;margin:0}
 .narrator-role{font:18px/1.12 UmaText,monospace;margin-top:7px}
 #dialogue-progress{font-size:18px}
 .dialogue-scene{grid-column:1/-1;grid-row:2;font:20px/1 UmaText,monospace;letter-spacing:0;margin:0}
 #dialogue-text{grid-column:1/-1;grid-row:3;font:22px/1.17 UmaText,monospace;margin:0;min-height:0;clear:none}
 .dialogue-actions{grid-column:1/-1;grid-row:4;display:grid;grid-template-columns:1fr 1.15fr .8fr;gap:6px}
 .dialogue-actions .gold-button,.dialogue-secondary{grid-column:auto;font-size:19px;padding:6px 4px;min-height:44px;white-space:nowrap}
 .dialogue-hint{grid-column:1/-1;grid-row:5;font-size:16px;line-height:1;margin:0;display:block}
 .pause-layer{padding:14px}.pause-panel{width:82%;padding:20px}.pause-panel h2{font-size:32px;margin-bottom:16px}
 .pause-options .menu-item{min-height:48px;font-size:27px}.pause-options .menu-item.selected::before{left:-26px;width:22px}
 .controls-panel{padding:14px}.controls-panel h2{font-size:23px}.controls-panel dt,.controls-panel dd{font-size:21px}.controls-panel p{font-size:21px}
 .controls-actions{bottom:-14px}.controls-actions button{font-size:20px;min-height:44px}
 .wake-caption{left:auto;right:8px;bottom:12px;gap:8px;font-size:20px;padding:6px}
 .wake-caption button{font-size:18px;min-height:36px;padding:6px}
}
@media(max-height:550px) and (orientation:landscape){
 .has-touch #app[data-screen="game"]{max-width:none;width:100%;margin:0}
 .has-touch #app[data-screen="game"] .game-shell{height:100svh;aspect-ratio:auto}
 .dialogue-screen{position:absolute;inset:auto 2% 1%;padding:0}
 .dialogue-panel{height:205px;grid-template-columns:76px minmax(0,1fr);padding:10px;gap:12px;grid-template-rows:none}
 #narrator-portrait{width:76px;height:95px;grid-column:auto;grid-row:auto;align-self:center}
 .dialogue-content{display:grid;grid-template-rows:44px 20px minmax(0,1fr)34px;gap:5px}
 .dialogue-heading{grid-column:auto;grid-row:auto;padding-right:35px;min-height:0;display:flex}
 .dialogue-heading h2{font-size:20px}.narrator-role{font-size:15px;margin-top:3px}#dialogue-progress{font-size:18px}
 .dialogue-scene{grid-column:auto;grid-row:auto;font-size:18px;margin:0}
 #dialogue-text{grid-column:auto;grid-row:auto;font-size:21px;margin:0}
 .dialogue-actions{grid-column:auto;grid-row:auto;display:flex;gap:6px}
 .dialogue-actions .gold-button,.dialogue-secondary{font-size:19px;min-height:34px;padding:5px 10px}
 .dialogue-hint{display:none}
 .pause-layer{padding:10px}.pause-panel{width:290px;padding:12px 20px}.pause-panel h2{font-size:27px;margin-bottom:8px}
 .pause-options{gap:5px}.pause-options .menu-item{min-height:34px;font-size:23px;padding:5px}
 .controls-panel{max-height:calc(100svh - 20px);padding:14px}.controls-panel h2{font-size:24px;margin-bottom:10px}
 .controls-panel dt,.controls-panel dd,.controls-panel p{font-size:21px}
 .controls-actions{bottom:-14px}
 #pause{width:40px;height:40px;right:8px;top:8px;min-width:40px;min-height:40px}
 #touch-actions{bottom:14px;right:14px}#stick-base{top:calc(100% - 68px)}
 .wake-caption{font-size:20px;padding:4px}.wake-caption button{min-height:32px;font-size:18px;padding:5px}
}
/* Compact editor dialogue: portrait fills the window; two actions only. */
.dialogue-panel{height:280px;display:grid;grid-template-columns:220px minmax(0,1fr);grid-template-rows:1fr;padding:0;gap:0;overflow:hidden}
#narrator-portrait{width:100%;height:100%;min-height:0;align-self:stretch;object-fit:cover;object-position:50% 40%;margin:0;grid-column:1;grid-row:1;border-right:2px solid #1683a4}
.dialogue-content{display:grid;grid-column:2;grid-row:1;grid-template-rows:62px minmax(0,1fr)44px;gap:14px;min-width:0;min-height:0;padding:20px 24px}
.dialogue-heading{display:block;min-height:0;padding:0;grid-column:auto;grid-row:auto}.dialogue-heading h2{font:32px/1.1 UmaText,monospace;white-space:normal;margin:0}.narrator-role{font:22px/1 UmaText,monospace;margin:5px 0 0}
#dialogue-text{grid-column:auto;grid-row:auto;font:28px/1.2 UmaText,monospace;min-height:0;margin:0;overflow:auto}
.dialogue-actions{grid-column:auto;grid-row:auto;display:flex;gap:12px;flex-wrap:nowrap}.dialogue-actions .gold-button,.dialogue-actions .dialogue-secondary{grid-column:auto;font:24px/1 UmaText,monospace;min-height:44px;padding:8px 20px}
#monster-list{gap:5px;padding-top:10px;padding-bottom:10px}.monster-option{font-size:clamp(16px,2.45cqw,38px)}
@media(max-width:950px){.dialogue-panel{height:260px;grid-template-columns:190px minmax(0,1fr)}.dialogue-content{padding:16px 18px;grid-template-rows:55px minmax(0,1fr)42px;gap:10px}.dialogue-heading h2{font-size:29px}.narrator-role{font-size:20px}#dialogue-text{font-size:25px}.dialogue-actions .gold-button,.dialogue-actions .dialogue-secondary{font-size:22px;padding:7px 14px;min-height:42px}}
@media(max-width:700px) and (orientation:portrait){
 .dialogue-panel{height:360px;grid-template-columns:88px minmax(0,1fr);grid-template-rows:1fr;gap:0;padding:0}
 #narrator-portrait{width:100%;height:100%;grid-column:1;grid-row:1;object-position:53% 40%;align-self:stretch}
 .dialogue-content{display:grid;grid-column:2;grid-row:1;grid-template-rows:48px minmax(0,1fr)44px;gap:10px;padding:14px 10px}
 .dialogue-heading{grid-column:auto;grid-row:auto;display:block;padding:0}.dialogue-heading h2{font:27px/1 UmaText,monospace}.narrator-role{font:18px/1 UmaText,monospace;margin-top:5px}
 #dialogue-text{font:20px/1.17 UmaText,monospace;grid-column:auto;grid-row:auto}
 .dialogue-actions{display:flex;grid-column:auto;grid-row:auto;gap:6px}.dialogue-actions .gold-button,.dialogue-actions .dialogue-secondary{font:18px/1 UmaText,monospace;min-height:44px;padding:7px 6px;white-space:nowrap}
 #monster-list{height:390px;gap:4px;padding:4px 4px 10px}.monster-option{font-size:25px}
}
@media(max-height:550px) and (orientation:landscape){
 .dialogue-panel{height:220px;grid-template-columns:155px minmax(0,1fr);padding:0;gap:0;grid-template-rows:1fr}
 #narrator-portrait{height:100%;width:100%;grid-column:1;grid-row:1;align-self:stretch}
 .dialogue-content{display:grid;grid-column:2;grid-row:1;padding:12px 16px;grid-template-rows:44px minmax(0,1fr)36px;gap:8px}
 .dialogue-heading h2{font-size:25px}.narrator-role{font-size:17px;margin-top:4px}#dialogue-text{font-size:22px}
 .dialogue-actions .gold-button,.dialogue-actions .dialogue-secondary{font-size:20px;min-height:36px;padding:6px 13px}
 #monster-list{gap:3px;padding-top:5px;padding-bottom:5px}.monster-option{font-size:2.45cqw}
}
.library-panel{min-height:0}#monster-list{min-height:0;overflow:hidden}#monster-card{min-height:0;height:100%}.monster-option{grid-template-columns:40% minmax(0,60%);font-size:clamp(16px,2.2cqw,34px);overflow:hidden}.monster-option canvas{min-height:0;max-height:100%;width:100%;object-fit:contain}
@media(max-width:700px) and (orientation:portrait){#monster-card{height:auto;overflow:visible}.monster-option{grid-template-columns:85px minmax(0,1fr);font-size:25px}}
@media(max-height:550px) and (orientation:landscape){.monster-option{font-size:2.2cqw}}
@media(max-height:550px) and (orientation:landscape){.has-touch #app[data-screen="library"]{max-width:none;width:100%}.has-touch #app[data-screen="library"] .game-shell{height:max(600px,100svh);aspect-ratio:auto}}
#monster-list{overflow:visible}.monster-option{overflow:visible}
/* The corner HUD belongs to health/fish and three life portraits. */
#app[data-screen="game"] #pause{top:clamp(52px,6.4cqw,98px);right:10px;width:38px;height:38px;min-width:38px;min-height:38px}
@media(max-width:700px) and (orientation:portrait){
 #app[data-screen="game"][data-opening="true"] .game-shell{height:min(100svh,120cqw)}
 #app[data-screen="game"][data-opening="true"][data-dialogue="true"] .game-shell{height:auto}
 #app[data-screen="game"][data-opening="true"] #game{height:min(100svh,120cqw)}
}
.has-touch #app[data-screen="game"] #pause{width:44px;height:44px;min-width:44px;min-height:44px}
@media(max-width:700px) and (orientation:portrait){#app[data-screen="game"] #pause{top:max(52px,16cqw)}}
/* Open abilities form a readable pixel keycap rail; the stage has no extra footer. */
.controls-bar{display:flex;flex-wrap:wrap;justify-content:center;gap:12px 22px;padding:16px 20px 18px;border-top:2px solid #305577;background:linear-gradient(#10243b,#061424);box-shadow:inset 0 2px #a3dce51c}
.control-chip{display:flex;align-items:center;gap:11px;color:#d3e9e8;font:clamp(21px,2cqw,30px)/1 UmaText,monospace;animation:skill-in .35s ease-out both}
.control-keys{display:flex;gap:5px}.control-keys kbd{display:grid;place-items:center;min-width:40px;height:40px;padding:0 10px;border:2px solid #8bb8c9;background:linear-gradient(#254760,#132d45);box-shadow:inset 0 -4px #081a2d,2px 3px #020b18;color:#e8f7f0;font:24px/1 UmaText,monospace;text-shadow:1px 2px #06101d}
.control-paw kbd{color:#ffe0a1;border-color:#d4b479}.control-dash kbd{color:#a6e9ee}.control-sneak kbd{color:#bbe7b7;border-color:#81afa6}
@keyframes skill-in{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}
:root:not(.has-touch) #pause{display:none!important}
.has-touch .controls-bar{display:none}
.pause-panel{max-height:100%;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#538da4 #071428}
@media(max-width:700px){.controls-bar{gap:12px;padding:12px 8px}.control-chip{gap:7px;font-size:22px}.control-keys kbd{height:34px;min-width:34px;padding:0 8px;font-size:23px}}
@media(max-height:550px) and (orientation:landscape){.pause-options .menu-item{min-height:44px}}
@media(prefers-reduced-motion:reduce){.control-chip{animation:none}}
/* Every catalogue entry uses the same five fixed regions and two ability rows. */
#monster-list{overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-color:#25a9c4 #041027;scrollbar-width:thin;padding-left:12px;scroll-padding:8px;display:flex;min-height:0}
.monster-option{flex:0 0 clamp(64px,6.15cqw,94px);min-height:clamp(64px,6.15cqw,94px);max-height:clamp(64px,6.15cqw,94px);grid-template-columns:40% minmax(0,1fr);overflow:hidden;font-size:clamp(18px,2.15cqw,33px)}
.monster-option.selected::before{left:1px;width:18px;height:22px}.monster-option canvas{width:100%;height:100%;max-height:100%}
#monster-card{display:grid;grid-template-rows:11% 33% 15% 21% 20%;height:100%;min-height:0;overflow:hidden;padding-top:10px;padding-bottom:14px}
#monster-title,#monster-title.long-title{font-size:clamp(25px,4.1cqw,63px);line-height:1.1;align-self:center;margin:0;white-space:nowrap}
.portrait-stage{height:auto;min-height:0;flex:none;margin:0 0 5px}
#monster-description{min-height:0;overflow:auto;margin:6px 0;font:clamp(15px,1.95cqw,30px)/1.1 UmaText,monospace;align-self:stretch}
#monster-abilities{display:grid;grid-template-rows:1fr 1fr;min-height:0;overflow:auto}#monster-abilities>div{min-height:0;padding:4px 0;grid-template-columns:39% minmax(0,61%)}
#monster-abilities dt{font-size:clamp(14px,1.85cqw,28px);gap:8px}#monster-abilities dd{font-size:clamp(14px,1.7cqw,26px);line-height:1.12}
#monster-abilities .sound-icon,#monster-abilities .danger-icon{flex-basis:26px;width:26px;height:28px}
#monster-abilities .danger-icon::before{left:9px;width:8px;height:18px}#monster-abilities .danger-icon::after{left:9px;width:8px;height:6px}
.tactic{height:auto;min-height:0;overflow:auto;margin:6px 0 0;padding:7px 8px;gap:10px;align-items:flex-start}.tactic strong{font-size:clamp(14px,1.65cqw,25px);padding-right:8px;gap:6px}.tactic p{font-size:clamp(14px,1.7cqw,26px);line-height:1.12;margin:0;min-width:0}
@media(max-width:700px) and (orientation:portrait){
 #app[data-screen="library"] .game-shell,#library-screen{min-height:1380px}
 #monster-list{height:390px;flex:0 0 390px;overflow-y:auto;padding:4px 5px 8px}.monster-option{flex-basis:68px;min-height:68px;max-height:68px;grid-template-columns:85px minmax(0,1fr);font-size:25px}
 #monster-card{height:880px;flex:0 0 880px;grid-template-rows:45px 180px 145px 260px 215px;padding:16px 7px 8px;overflow:hidden}
 #monster-title,#monster-title.long-title{font-size:29px;text-align:center;white-space:nowrap}.portrait-stage{height:auto;min-height:0;margin:0 0 6px}
 #monster-description{font-size:22px;line-height:1.14;margin:8px 0}
 #monster-abilities>div{grid-template-columns:1fr;grid-template-rows:32px 1fr;gap:4px;align-items:start;padding:8px 0}#monster-abilities dt{font-size:22px;overflow-wrap:normal}#monster-abilities dd{font-size:21px;line-height:1.15;padding-left:30px}
 .tactic{padding:10px 8px;margin-top:12px;gap:8px;display:flex;flex-direction:column;align-items:stretch}.tactic strong{font-size:21px;padding:0 0 8px}.tactic p{font-size:22px;line-height:1.15}
}
@media(max-height:550px) and (orientation:landscape){
 .monster-option{flex-basis:52px;min-height:52px;max-height:52px;font-size:2.15cqw}#monster-card{grid-template-rows:11% 29% 14% 23% 23%;padding:7px 10px}
 #monster-title,#monster-title.long-title{font-size:3.8cqw}#monster-description{font-size:1.95cqw;margin:4px 0}.tactic strong{font-size:1.65cqw}.tactic p{font-size:1.75cqw}
}
/* Four complete chapter collections, four equal entries in each collection. */
#library-chapters{position:absolute;left:11.3%;top:19.6%;width:77.3%;height:6.5%;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
#library-chapters button{min-width:0;border:2px solid #167da1;background:#04142c;color:#a3d7e4;font:clamp(17px,1.8cqw,28px)/1 UmaText,monospace;padding:5px}
#library-chapters button.selected{color:#15223a;background:#ffdb83;border-color:#ffeab0}
.library-panel{top:27.8%;height:66.5%}
#monster-list{overflow:hidden;gap:8px;display:grid;grid-template-rows:repeat(4,minmax(0,1fr));padding:10px 8px 10px 11px}
.monster-option{height:100%;min-height:0;max-height:none;font-size:clamp(18px,2cqw,31px)}
#monster-title,#monster-title.long-title{font-size:clamp(23px,2.9cqw,44px)}
#monster-description{overflow:hidden}#monster-abilities,.tactic{overflow:hidden}
#monster-abilities>div{grid-template-columns:34% minmax(0,66%)}
#monster-abilities dt{font-size:clamp(15px,1.75cqw,27px)}#monster-abilities dd{font-size:clamp(15px,1.7cqw,26px)}
.result-actions{display:flex;flex-direction:column;gap:10px;margin:20px auto 0;width:min(100%,340px)}
.result-actions .gold-button,.result-actions .back-button{width:100%;margin:0;min-height:46px;font:26px/1.1 UmaText,monospace;padding:10px}
.result-panel p{font:24px/1.2 UmaText,monospace}.result-panel{max-height:95%;overflow:auto}
#app[data-dialogue="true"] .controls-bar{display:none}
@media(max-width:700px) and (orientation:portrait){
 #app[data-screen="library"] .game-shell,#library-screen{min-height:0}
 #library-screen{padding:238px 0 24px}
 #library-chapters{top:150px;left:5%;width:90%;height:76px;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
 #library-chapters button{font-size:21px;padding:6px}
 .library-panel{top:auto;height:auto}
 #monster-list{height:280px;flex:0 0 280px;gap:5px;padding:5px;border-bottom:3px double #14ccf0}
 .monster-option{height:100%;min-height:0;max-height:none;font-size:23px;grid-template-columns:83px minmax(0,1fr)}
 #monster-card{height:640px;flex:0 0 640px;grid-template-rows:44px 155px 82px 180px 151px;padding:12px 8px 8px}
 #monster-title,#monster-title.long-title{font-size:25px;white-space:nowrap}
 #monster-description{font-size:22px;line-height:1.14}
 #monster-abilities>div{grid-template-columns:1fr;grid-template-rows:29px minmax(0,1fr);padding:6px 0}
 #monster-abilities dt{font-size:22px}#monster-abilities dd{font-size:21px;line-height:1.14}
 .tactic strong{font-size:21px}.tactic p{font-size:22px;line-height:1.14}
 /* Yuri occupies the former lower hint area while the world stays visible above. */
 #app[data-screen="game"] .game-shell,#app[data-screen="game"][data-opening="true"] .game-shell,#app[data-screen="game"][data-dialogue="true"] .game-shell,#app[data-screen="game"][data-opening="true"][data-dialogue="true"] .game-shell{height:100svh;aspect-ratio:auto}
 #app[data-screen="game"] #game,#app[data-screen="game"][data-opening="true"] #game{height:100%;width:100%}
 #app[data-screen="game"][data-dialogue="true"] #game{height:calc(100svh - 236px)}
 .dialogue-screen{position:absolute;inset:auto 5px 5px;padding:0;background:none;filter:none}
 .dialogue-panel{height:226px;grid-template-columns:78px minmax(0,1fr)}
 .dialogue-content{padding:10px;grid-template-rows:42px minmax(0,1fr)44px;gap:7px}
 .dialogue-heading h2{font-size:26px}.narrator-role{font-size:18px;margin-top:4px}
 #dialogue-text{font:22px/1.1 UmaText,monospace;overflow:hidden}
 .dialogue-actions{gap:6px}.dialogue-actions .gold-button,.dialogue-actions .dialogue-secondary{font-size:20px;padding:7px 8px;min-height:44px}
 .menu-hint{display:none}
}
@media(max-width:350px) and (orientation:portrait){
 #app[data-screen="game"][data-dialogue="true"] #game{height:calc(100svh - 270px)}
 .dialogue-panel{height:260px;grid-template-columns:64px minmax(0,1fr)}
 .dialogue-content{padding:10px 8px}.dialogue-actions .gold-button,.dialogue-actions .dialogue-secondary{font-size:18px;padding:6px}
 #monster-title,#monster-title.long-title{font-size:22px}.monster-option{font-size:21px}
}
@media(max-height:550px) and (orientation:landscape){
 #library-chapters{top:19.6%;height:7.5%}.library-panel{top:29%;height:66%}
 #monster-list{height:auto;gap:5px}.monster-option{height:100%;min-height:0;max-height:none;font-size:2cqw}
 #monster-title,#monster-title.long-title{font-size:2.9cqw}
 .has-touch #app[data-screen="game"][data-dialogue="true"] #game{height:calc(100svh - 160px)}
 .dialogue-screen{inset:auto 1% 4px}.dialogue-panel{height:154px;grid-template-columns:100px minmax(0,1fr)}
 .dialogue-content{padding:8px 12px;grid-template-rows:35px minmax(0,1fr)38px;gap:4px}
 .dialogue-heading h2{font-size:23px}.narrator-role{font-size:16px;margin-top:2px}#dialogue-text{font:22px/1.1 UmaText,monospace}
 .dialogue-actions .gold-button,.dialogue-actions .dialogue-secondary{font-size:20px;min-height:38px;padding:6px 12px}
}
.monster-option span{min-width:0;overflow-wrap:anywhere;line-height:1.08}

@media(max-width:700px) and (orientation:portrait){.dialogue-panel{height:246px}#app[data-screen="game"][data-dialogue="true"] #game{height:calc(100svh - 256px)}#dialogue-text{font:21px/1.1 UmaText,monospace}}
@media(max-width:350px) and (orientation:portrait){.dialogue-panel{height:260px}#app[data-screen="game"][data-dialogue="true"] #game{height:calc(100svh - 270px)}#dialogue-text{font-size:20px}}

@media(max-width:700px) and (orientation:portrait){#app[data-screen="game"][data-opening="true"] #game{height:min(100svh,120cqw)}#app[data-screen="game"][data-opening="true"][data-dialogue="true"] #game{height:min(120cqw,calc(100svh - 256px))}}

.has-touch #app[data-screen="game"] #pause{top:calc(10% + 8px)}

/* Long names cannot change the implicit grid column width. */
#monster-card{grid-template-columns:minmax(0,1fr)}
@media(max-width:350px) and (orientation:portrait){#monster-title,#monster-title.long-title{font-size:21px}}
@media(min-width:701px) and (min-height:551px){
 #monster-card{grid-template-rows:11% 29% 14% 26% 20%}
}
.ending-screen{position:absolute;inset:0;z-index:8;background:#02091cf5;display:grid;place-items:center;padding:18px}
.ending-panel{width:min(960px,96%);height:min(94%,850px);display:grid;grid-template-rows:auto minmax(0,1fr)auto auto;gap:12px;padding:18px 24px}
.ending-panel header{display:flex;gap:18px;align-items:center;min-height:35px}.ending-panel header span{font:24px/1 UmaText,monospace;color:#78d5e9;white-space:nowrap}
.ending-panel h2{font:clamp(22px,2.6cqw,40px)/1.15 UmaDisplay,monospace;margin:0;color:#ffe7ac}
#ending-art{width:100%;height:100%;object-fit:contain;min-height:0;background:#031126}
#ending-caption{font:clamp(22px,2.1cqw,30px)/1.2 UmaText,monospace;margin:0;min-height:2.4em;color:#f4e5bd}
.ending-actions{display:flex;justify-content:space-between;gap:14px}.ending-actions button{font:26px/1 UmaText,monospace;min-height:46px;padding:10px 24px}.ending-actions button:disabled{cursor:default;opacity:.35}
#app[data-ending="true"] .controls-bar{display:none}.result-panel{width:min(760px,94%)}.result-panel #result-purpose{font:24px/1.2 UmaText,monospace;color:#c9dce0;margin:16px 0}
.result-score{border:2px solid #2489a5;background:#081e35;padding:12px}.result-score>span{display:block;font:21px/1 UmaText,monospace;color:#8dd8e5}.result-score strong{display:block;color:#ffdb82;font:40px/1.2 UmaDisplay,monospace;margin:8px 0}.result-panel #result-breakdown{font:19px/1.2 UmaText,monospace;margin:0;color:#abc3ca}
.result-actions a{display:block;text-decoration:none;min-height:46px;font:26px/1 UmaText,monospace;padding:12px}.result-actions a .media-blue{color:#11608f}
@media(max-width:700px) and (orientation:portrait){.ending-screen{padding:6px}.ending-panel{width:100%;height:96%;padding:12px;gap:10px;grid-template-rows:auto minmax(0,1fr)auto 48px}.ending-panel header{padding-right:40px;gap:8px;align-items:start}.ending-panel header span{font-size:19px}.ending-panel h2{font-size:21px}#ending-caption{font-size:23px;min-height:4.8em}.ending-actions button{font-size:23px;padding:10px 18px}.has-touch #app[data-ending="true"] #pause{top:12px;right:12px}.result-panel{padding:15px}.result-panel #result-purpose{font-size:22px}.result-panel #result-breakdown{font-size:19px}.result-score strong{font-size:34px}}
@media(max-height:550px) and (orientation:landscape){.ending-screen{padding:6px}.ending-panel{width:96%;height:calc(100dvh - 12px);min-width:0;min-height:0;padding:10px 14px;gap:6px;grid-template-columns:minmax(0,3fr)minmax(0,2fr);grid-template-rows:40px minmax(0,1fr)44px}.ending-panel header{grid-column:1/-1;padding-right:44px}.ending-panel h2{font-size:24px}.ending-panel #ending-art{grid-column:1;grid-row:2/4;min-width:0;min-height:0;aspect-ratio:auto}#ending-caption{grid-column:2;grid-row:2;font-size:23px;align-self:center;padding:10px}.ending-actions{grid-column:2;grid-row:3;gap:8px}.ending-actions button{min-width:0;min-height:40px;font-size:21px;padding:7px 14px}.result-panel{padding:14px;max-width:95%}.result-panel #result-purpose{font-size:22px}}
.has-touch #app[data-boss="true"] #pause{top:calc(24% + 8px)}
@media(max-width:700px) and (orientation:portrait){
 .ending-panel{height:auto;max-height:96%;grid-template-rows:auto auto auto 48px}
 .ending-panel header{padding-right:0}.ending-panel #ending-art{height:auto;aspect-ratio:3/2;max-height:50svh}
 .ending-panel #ending-caption{min-height:3.6em}
}
.result-panel h2{font:28px/1.1 UmaText,monospace}.result-panel #result-purpose{font-size:22px;margin:12px 0}.result-panel #result-breakdown{font-size:19px;line-height:1.15}
@media(max-width:700px) and (orientation:portrait){.result-panel h2{font-size:24px}.result-panel #result-purpose{font-size:21px}.result-score{padding:10px}.result-score strong{font-size:32px;margin:6px 0}.result-actions{margin-top:14px}.result-actions .gold-button,.result-actions .back-button,.result-actions a{min-height:44px;font-size:24px;padding:10px}}
@media(max-width:350px) and (orientation:portrait){.result-panel h2{font-size:22px}.result-panel #result-purpose{font-size:20px}.result-panel #result-breakdown{font-size:18px}.result-panel #result-text{font-size:22px}}
@media(max-height:550px) and (orientation:landscape){
 .result-panel{display:grid;grid-template-columns:minmax(0,60%)minmax(0,40%);column-gap:14px}.result-panel h2{grid-column:1/-1;font-size:25px}
 .result-panel #result-text{grid-column:1;grid-row:2;margin:8px 0;font-size:22px}.result-panel #result-purpose{grid-column:1;grid-row:3;font-size:20px;margin:8px 0}
 .result-panel #result-score{grid-column:1;grid-row:4;display:grid;grid-template-columns:90px minmax(0,1fr);gap:6px 10px;padding:8px}.result-score strong{font-size:29px;margin:0}.result-score>span{font-size:18px}.result-panel #result-breakdown{grid-column:2;grid-row:1/3;align-self:center;font-size:18px}
 .result-actions{grid-column:2;grid-row:2/5;width:100%;margin:0;align-self:center}.result-actions .gold-button,.result-actions .back-button,.result-actions a{min-height:42px;font-size:23px;padding:9px}
}
@media(max-width:700px) and (orientation:portrait){#monster-card{grid-template-rows:44px 139px 82px 196px 151px}}

/* The game owns the viewport; hints never reserve space below the picture. */
body.playing-screen{height:100dvh;min-height:0;overflow:hidden;overscroll-behavior:none}
#app[data-screen="game"]{position:fixed;inset:0;max-width:none;width:100%;height:100dvh;margin:0}
#app[data-screen="game"] .cabinet{height:100%;width:100%}
#app[data-screen="game"] .game-shell{height:100dvh!important;width:100%;aspect-ratio:auto!important}
#app[data-screen="game"] #game{height:100%!important;width:100%}
#app[data-screen="game"] .controls-bar{display:none!important}
.has-touch #touch-actions button{background:#06182d22;box-shadow:none;opacity:.32;border-color:#c0eafa99;color:#e8f7ff}
.has-touch #touch-actions button.pressed{opacity:.9;background:#0d3f5b77}
.has-touch #stick-base{opacity:.32;background:#06182d22}
.has-touch #stick-pad.engaged #stick-base{opacity:.8}
#app[data-screen="game"] #ending-caption{font-size:clamp(25px,2.5cqw,38px);line-height:1.2}

#app[data-screen="menu"]{position:fixed;inset:0;max-width:none;width:100%;height:100dvh;margin:0}
#app[data-screen="menu"] .cabinet{width:100%;height:100%}
#app[data-screen="menu"] .game-shell{height:100dvh!important;min-height:0!important;width:100%;aspect-ratio:auto!important}
#app[data-screen="menu"] #game{height:100%;width:100%}
#app[data-screen="menu"] .menu-hint{position:absolute;bottom:8px;left:0;width:100%;pointer-events:none}

.has-touch #app[data-boss="true"] #pause{top:calc(29% + 8px)}

@media(max-width:700px) and (orientation:portrait){#app[data-story="interlude"] .ending-panel #ending-art{aspect-ratio:1;max-height:40svh}}

/* Optional investigation journal, readable on both portrait and landscape phones. */
.clues-panel{width:min(580px,94%);max-height:92%;padding:22px;overflow-y:auto;scrollbar-width:thin;background:#06162b;color:#f2dfb5}
.clues-panel h2{margin:0 0 12px;text-align:center;font:clamp(22px,3vw,35px)/1.2 UmaDisplay,monospace}
.clues-panel p{margin:0 0 14px;font:clamp(16px,2vw,21px)/1.3 UmaText,monospace;color:#9dd6df}
.clues-panel ol{margin:0 0 16px;padding-left:28px;font:clamp(17px,2vw,23px)/1.4 UmaText,monospace}
.clues-panel li{padding:6px 0;border-bottom:1px solid #396078}
@media(max-height:550px){.clues-panel{max-height:96%;padding:12px}.clues-panel li{padding:3px 0}}

/* The instrument panel has its own space; level pixels begin below its frame. */
#app[data-screen="game"]{--hud-height:94px}
#app[data-screen="game"] #game{position:absolute;inset:var(--hud-height) 0 0;height:calc(100% - var(--hud-height))!important}
.game-hud{position:absolute;inset:0 0 auto;height:var(--hud-height);z-index:2;background:#10253b;pointer-events:none}
#hud{width:100%;height:100%}
.has-touch #app[data-screen="game"] #pause{top:calc(var(--hud-height) + 8px)}
#app[data-screen="game"][data-ending="true"] #game{inset:0;height:100%!important}
#app[data-screen="game"][data-hud="false"] #game{inset:0;height:100%!important}
#app[data-screen="game"][data-ending="true"] .game-hud{display:none}
@media(max-width:699px){#app[data-screen="game"]{--hud-height:64px}#app[data-screen="game"][data-boss="true"]{--hud-height:132px}}
@media(max-height:550px) and (min-width:700px){#app[data-screen="game"]{--hud-height:64px}#app[data-screen="game"][data-boss="true"]{--hud-height:94px}}

/* The prologue reads as illustrated sentences, without chapter headings or counters. */
#app[data-story="prologue"] .ending-panel{grid-template-rows:minmax(0,1fr)auto auto}
@media(max-width:700px) and (orientation:portrait){#app[data-story="prologue"] .ending-panel{grid-template-rows:auto auto 48px}}
@media(max-height:550px) and (orientation:landscape){
 #app[data-story="prologue"] .ending-panel{grid-template-rows:minmax(0,1fr)44px}
 #app[data-story="prologue"] #ending-art{grid-row:1/3}
 #app[data-story="prologue"] #ending-caption{grid-row:1}
 #app[data-story="prologue"] .ending-actions{grid-row:2}
}

/* A dedicated defeat composition: Infoshum, outcome, then four equal actions. */
#overlay[data-result="lost"]{padding:12px;background:radial-gradient(ellipse at 50% 25%,#153749f0,#03091cf5 68%)}
#overlay[data-result="lost"] .result-panel{display:flex;flex-direction:column;align-items:center;width:min(540px,96%);max-width:none;max-height:calc(100dvh - 24px);padding:14px 26px 24px;gap:12px;overflow:auto;background:#06162cf5}
#defeat-art{width:100%;height:min(30dvh,260px);object-fit:contain;flex:0 0 auto}
#overlay[data-result="lost"] #result-title{font:clamp(27px,3vw,38px)/1.15 UmaDisplay,monospace;color:#ffe3b2;text-align:center;margin:0;text-shadow:2px 3px #422339}
#overlay[data-result="lost"] .result-actions{width:100%;display:flex;flex-direction:column;gap:9px;margin:4px 0 0}
#overlay[data-result="lost"] .result-actions button{width:100%;min-height:48px;margin:0;font:27px/1 UmaText,monospace;padding:11px 12px}
@media(max-width:700px){#overlay[data-result="lost"] .result-panel{padding:12px 18px 20px}#overlay[data-result="lost"] .result-actions button{font-size:25px}}
@media(max-height:550px) and (orientation:landscape){
 #overlay[data-result="lost"] .result-panel{width:min(550px,96%);padding:8px 22px 12px;gap:5px}
 #defeat-art{height:22dvh}
 #overlay[data-result="lost"] #result-title{font-size:26px}
 #overlay[data-result="lost"] .result-actions{gap:5px;margin:0}
 #overlay[data-result="lost"] .result-actions button{min-height:40px;font-size:23px;padding:7px 12px}
}
@media(max-width:700px) and (orientation:portrait){#app[data-screen="menu"] .menu-panel{top:25%;height:39%}}
@media(max-width:700px) and (orientation:portrait){
 #app[data-screen="menu"] .menu-panel{left:3%;top:25%;width:54%;height:44%;padding:12px 8px 16px}
 #app[data-screen="menu"] .menu-panel h2{font-size:23px;margin-bottom:12px}
 #app[data-screen="menu"] .menu-options{height:calc(100% - 40px);gap:8px}
 #app[data-screen="menu"] .menu-item{font-size:24px;padding:7px 2px;min-height:44px}
 #app[data-screen="menu"] .menu-item.selected::before{left:-18px;width:20px;height:22px}
}
/* Shared story composition for the prologue, interludes and ending. */
#app[data-story] .ending-screen{padding:12px}
#app[data-story] .ending-panel{width:min(1200px,100%);height:calc(100dvh - 24px);max-height:none;min-height:0;min-width:0;padding:14px;gap:12px;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr)auto 48px}
#app[data-story] .ending-panel #ending-art{grid-column:1;grid-row:1;min-width:0;min-height:0;width:100%;height:100%;aspect-ratio:3/2;max-height:none;object-fit:contain}
#app[data-story] #ending-caption{grid-column:1;grid-row:2;align-self:center;min-height:0;text-align:center;padding:0 12px;font:clamp(25px,2.3vw,36px)/1.2 UmaText,monospace}
#app[data-story] .ending-actions{grid-column:1;grid-row:3}
@media(max-width:700px) and (orientation:portrait){#app[data-story] .ending-screen{padding:6px}#app[data-story] .ending-panel{height:calc(100dvh - 12px);padding:10px;gap:10px}#app[data-story] #ending-caption{font-size:25px;padding:0}}
@media(max-height:550px) and (orientation:landscape){#app[data-story] .ending-panel{grid-template-columns:minmax(0,3fr)minmax(0,2fr);grid-template-rows:minmax(0,1fr)44px}#app[data-story] .ending-panel #ending-art{grid-column:1;grid-row:1/3}#app[data-story] #ending-caption{grid-column:2;grid-row:1;font-size:23px;padding:0 8px}#app[data-story] .ending-actions{grid-column:2;grid-row:2}}
.settings-layer{position:absolute;inset:0;z-index:24;display:grid;place-items:center;background:#020a1de8;padding:12px}
.settings-panel{width:min(550px,96%);max-height:calc(100dvh - 24px);overflow:auto;padding:22px;display:flex;flex-direction:column;gap:13px}
.settings-panel h2{text-align:center;font:30px/1 UmaDisplay,monospace;margin:0 0 6px}
.settings-panel .menu-item{flex:none;min-height:46px;font:25px/1.15 UmaText,monospace;white-space:normal;padding:10px}
.settings-panel label{font:24px/1.1 UmaText,monospace;display:flex;justify-content:space-between;gap:10px;color:#ffe4ac}
.settings-panel input{width:100%;height:28px;accent-color:#ffd473;cursor:pointer}
.testing-note{font:19px/1.15 UmaText,monospace;color:#9cc9d5;margin:0}
.settings-panel .gold-button{font:25px/1 UmaText,monospace}
#controls-panel{width:min(980px,96%);max-height:94dvh;overflow:auto;padding:18px}
#controls-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:12px 0}
#controls-cards figure{margin:0;border:1px solid #30718b;background:#0a2037;padding:7px;min-width:0}
#controls-cards canvas{width:100%;height:100px;object-fit:contain}
#controls-cards figcaption{display:flex;flex-direction:column;gap:5px;text-align:center;font:21px/1.1 UmaText,monospace}
#controls-cards figcaption span{color:#8fe2eb;font-size:19px}
#controls-panel>p{font:23px/1.15 UmaText,monospace;margin:10px 0}
@media(max-width:700px){#controls-cards{grid-template-columns:repeat(2,minmax(0,1fr))}#controls-cards canvas{height:84px}.settings-panel{padding:15px;gap:10px}}
@media(max-height:550px) and (orientation:landscape){.settings-panel{width:min(680px,96%);gap:8px;padding:12px 20px}#controls-cards canvas{height:70px}}
.status{bottom:6%;padding:15px 22px;font:clamp(22px,2vw,30px)/1.18 UmaText,monospace;background:#031123f5;border:3px solid #ffda7d;box-shadow:0 4px #010714,0 0 18px #010814b0;color:#fff3cb;width:min(760px,90%);text-shadow:1px 2px #000c1c}
@media(min-width:1000px){#app[data-screen="menu"] .menu-panel{left:20%;width:28%;top:25%;height:59%;padding:18px 22px}#app[data-screen="menu"] .menu-item{font-size:30px}}
@media(max-width:700px) and (orientation:portrait){#app[data-screen="menu"] .menu-panel{height:50%;top:23%}#app[data-screen="menu"] .menu-item{min-height:40px;font-size:23px}}
/* Fixed caption rows keep every story image in the same frame. */
#app[data-story] .ending-panel{grid-template-rows:minmax(0,1fr)120px 48px}
@media(max-width:700px) and (orientation:portrait){#app[data-story] .ending-panel{grid-template-rows:minmax(0,1fr)200px 48px}}
@media(max-height:550px) and (orientation:landscape){#app[data-story] .ending-panel{grid-template-rows:minmax(0,1fr)44px}}

/* Approved two-line logo: cat ears on М, small tentacles on ИНФОШУМА. */
#app[data-screen="menu"] .game-heading{top:1%;left:4%;width:92%;height:22%;pointer-events:none}
#app[data-screen="menu"] .game-heading h1{position:absolute;inset:0;width:100%;height:100%;min-width:0;min-height:0;margin:0;text-shadow:none;filter:none}
.game-logo{position:absolute;inset:0;display:block;width:100%;height:100%;overflow:hidden;image-rendering:pixelated}
@media(max-width:700px) and (orientation:portrait){#app[data-screen="menu"] .game-heading{top:2%;left:3%;width:94%;height:18%}}
@media(max-width:999px) and (max-height:550px) and (orientation:landscape){#app[data-screen="menu"] .game-heading{height:25%}}


/* Approved menu composition: one open left column, illustration on the right. */
#menu-screen{background:linear-gradient(90deg,#020b1f99 0%,#020b1f80 31%,#020b1f25 49%,transparent 62%)}
#app[data-screen="menu"] .game-heading{left:8%;top:8%;width:49%;height:22%}
#app[data-screen="menu"] .game-logo{overflow:visible}
#app[data-screen="menu"] .menu-panel{left:16.5%;top:36%;width:32%;height:49%;padding:0;background:transparent;border:0;box-shadow:none}
#app[data-screen="menu"] .menu-panel::before,#app[data-screen="menu"] .menu-panel::after{display:none}
#app[data-screen="menu"] .menu-options{height:100%;gap:8px;align-items:stretch}
#app[data-screen="menu"] .menu-item{justify-content:center;text-align:center;min-height:0;padding:7px 20px;border:2px solid transparent;background:transparent;box-shadow:none;color:#ffe9ba;font-size:clamp(25px,2.4vw,44px);text-shadow:2px 3px #020919}
#app[data-screen="menu"] .menu-item:focus-visible{background:transparent;border-color:transparent;box-shadow:none;color:#ffe9ba;outline:none}
#app[data-screen="menu"] .menu-item.selected{justify-content:center;text-align:center;border-color:#ffe5a2;background:#ffda83;box-shadow:inset 0 0 0 3px #b98b3d,2px 3px #020919;color:#102035;text-shadow:none}
#app[data-screen="menu"] .menu-item.selected::before{left:-32px;width:25px;height:29px}
#app[data-screen="menu"] .media-link.selected .media-blue{color:#17679d}
#app[data-screen="menu"] .menu-hint{display:none}
@media(max-width:700px) and (orientation:portrait){
 #app[data-screen="menu"] .game-heading{left:6%;top:5%;width:88%;height:17%}
 #app[data-screen="menu"] .menu-panel{left:14%;top:23%;width:72%;height:clamp(240px,35dvh,320px)}
 #app[data-screen="menu"] .menu-options{display:flex;gap:4px}
 #app[data-screen="menu"] .menu-item{min-height:44px;font-size:clamp(23px,6.4vw,30px);padding:5px 6px}
 #app[data-screen="menu"] .menu-item.selected::before{display:none}
}
@media(max-width:700px) and (max-height:650px) and (orientation:portrait){
 #app[data-screen="menu"] .game-heading{top:4%;height:18%}
 #app[data-screen="menu"] .menu-panel{top:23%;height:240px}
 #app[data-screen="menu"] .menu-options{gap:4px}
}
@media(max-height:550px) and (orientation:landscape){
 #app[data-screen="menu"] .game-heading{left:7%;top:5%;width:49%;height:25%}
 #app[data-screen="menu"] .menu-panel{left:14.5%;top:33%;width:34%;height:60%}
 #app[data-screen="menu"] .menu-options{gap:2px}
 #app[data-screen="menu"] .menu-item{min-height:30px;padding:3px 12px;font-size:clamp(20px,3vw,26px)}
 #app[data-screen="menu"] .menu-item.selected::before{left:-25px;width:19px;height:23px}
}
/* Short, nearly square portrait windows use the free space left of Uma. */
@media(max-width:700px) and (orientation:portrait) and (min-aspect-ratio:3/4){
 #app[data-screen="menu"] .game-heading{left:7%;top:5%;width:49%;height:22%}
 #app[data-screen="menu"] .menu-panel{left:10.5%;top:33%;width:42%;height:60%}
 #app[data-screen="menu"] .menu-options{display:flex;gap:2px}
 #app[data-screen="menu"] .menu-item{font-size:clamp(20px,3.8vw,26px)}
}

/* The library fills wide screens just like the main menu, without side gutters. */
#app[data-screen="library"]{width:100%;max-width:none;margin:0}
@media(min-width:1000px){
 #app[data-screen="library"]{position:fixed;inset:0;height:100dvh}
 #app[data-screen="library"] .cabinet{height:100%}
 #app[data-screen="library"] .game-shell{height:100%;min-height:0;aspect-ratio:auto}
 #app[data-screen="library"] .menu-hint{position:absolute;bottom:8px;left:0;width:100%;height:25px}
}

@media(max-width:700px) and (orientation:portrait) and (max-aspect-ratio:3/4){#menu-screen{background:linear-gradient(180deg,#020b1f22,transparent 70%)}}

/* Hints live under the HUD, never over the floor, Uma or the touch controls. */
#app .status{top:calc(var(--hud-height,10%) + 10px);bottom:auto;padding:10px 20px;width:max-content;max-width:min(700px,calc(100% - 120px));background:#031123e8}
@media(max-width:600px){#app .status{top:calc(var(--hud-height,10%) + 58px);max-width:calc(100% - 24px);padding:8px 12px}}
/* In-game level select: one row per chapter, the location and its boss side by side. */
.levels-panel{width:min(640px,94%);max-height:94dvh;overflow:auto;padding:18px 22px;scrollbar-width:thin;scrollbar-color:#538da4 #071428}
.levels-panel h2{font:38px/1.1 UmaDisplay,monospace;text-align:center;color:#ffe6a4;margin:0 0 14px}
.levels-list{display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1fr) minmax(0,1fr);gap:8px 10px;align-items:center;margin-bottom:14px}
.levels-list .level-chapter{font:21px/1.1 UmaText,monospace;color:#8fe2eb;text-align:right}
.levels-list .menu-item{min-height:46px;padding:6px 8px;font:22px/1.05 UmaText,monospace}
.levels-list .menu-item.boss{color:#ffc39a}
.levels-list .menu-item.current{border-color:#ffd36e}
.levels-list .menu-item.wide{grid-column:span 2}
.levels-panel #levels-back{display:block;margin:0 auto;font:25px/1 UmaText,monospace}
@media(max-width:700px){.levels-panel{padding:14px}.levels-panel h2{font-size:30px;margin-bottom:10px}.levels-list{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:6px}.levels-list .level-chapter{grid-column:span 2;text-align:left;font-size:19px;margin-top:4px}.levels-list .menu-item{min-height:42px;font-size:20px}}
@media(max-height:550px) and (orientation:landscape){.levels-panel{padding:10px 16px}.levels-panel h2{font-size:26px;margin-bottom:6px}.levels-list{gap:5px 8px;margin-bottom:8px}.levels-list .menu-item{min-height:36px;font-size:19px}.levels-list .level-chapter{font-size:18px}}
.levels-list .menu-item.selected::before{display:none}
.levels-list .menu-item{white-space:normal;hyphens:manual}
@media(max-width:700px){.levels-list .menu-item{font-size:18px;line-height:1}}
@media(max-width:360px){.levels-list .menu-item{font-size:16px;padding:4px 3px}.levels-list{gap:5px}}

/* ——— Library: Uma's field notebook (assets/library-*.png) ———
   Landscape: an open notebook spread — the chapter's four polaroids on the left page, the chosen monster on the right,
   bookmark tabs on the edge, arrows and dots at the bottom. Portrait phones: one page in the same style.
   --u is one hundredth of the notebook's width × 1.16 (the old cqw unit), so everything scales with the book. */
#app #library-screen{--book:86cqw;--u:calc(var(--book)/86);position:absolute;inset:0;padding:0;min-height:0}
@media(min-width:1000px){#app #library-screen{--book:min(86cqw,calc((100dvh - 150px)*1.943))}}
#app #library-screen::before{content:'';position:absolute;inset:0;pointer-events:none;background:radial-gradient(ellipse at 50% 55%,#02081400 35%,#020814d0 100%),#0208144d}
#app #library-screen .section-heading{position:absolute;left:0;top:0;width:100%;height:calc(9*var(--u));z-index:2;text-align:center}
#app #library-screen .section-heading h2{position:absolute;left:50%;top:calc(.5*var(--u));transform:translateX(-50%);width:calc(19*var(--u));aspect-ratio:167/79;margin:0;padding-top:calc(4.5*var(--u));box-sizing:border-box;background:url('./assets/library-plate.png') center/100% 100% no-repeat;font:calc(1.5*var(--u))/1 UmaDisplay,UmaPixel,monospace;letter-spacing:.06em;color:#4b2a10;text-shadow:1px 1px #fff1bd;filter:none}
#app #library-screen .section-heading>.ornament{display:none}
#app #library-screen .section-heading .back-button{position:absolute;left:calc(50% - var(--book)/2);top:calc(1.2*var(--u));width:calc(14*var(--u));min-width:0;aspect-ratio:124/73;padding:0 0 0 calc(3.2*var(--u));border:0;box-shadow:none;background:url('./assets/library-tag.png') center/100% 100% no-repeat;color:#432612;font:calc(1.45*var(--u))/1 UmaText,monospace;text-shadow:none}
#app #library-screen .section-heading .back-button:hover,#app #library-screen .section-heading .back-button:focus-visible{filter:brightness(1.08) drop-shadow(0 0 4px #ffd36a);outline:none}
#app #library-screen .library-panel{position:absolute;left:50%;top:calc(8.6*var(--u));transform:translateX(-50%);width:var(--book);height:auto;aspect-ratio:1160/597;padding:0;display:block;border:0;box-shadow:none;background:url('./assets/library-book.png') 0 0/100% 100% no-repeat;filter:drop-shadow(0 calc(.8*var(--u)) calc(1.2*var(--u)) #000a)}
#app #library-screen .library-panel::before,#app #library-screen .library-panel::after,#app #library-screen .frame-corner{display:none}
/* Bookmark tabs on the notebook's right edge. */
#app #library-screen #library-chapters{position:absolute;left:calc(50% + var(--book)/2 - 2.2*var(--u));top:calc(13*var(--u));width:calc(6.4*var(--u));height:auto;display:flex;flex-direction:column;gap:calc(.7*var(--u));z-index:3}
#app #library-screen #library-chapters button{width:100%;aspect-ratio:95/85;padding:0;border:0;background:url('./assets/library-tabs.png') calc(var(--tab)*2/7*100%) 0/800% 100% no-repeat;font-size:0;color:transparent;cursor:pointer;transition:transform .12s}
#app #library-screen #library-chapters button span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
#app #library-screen #library-chapters button.selected,#app #library-screen #library-chapters button:hover,#app #library-screen #library-chapters button:focus-visible{background-position:calc((var(--tab)*2 + 1)/7*100%) 0;outline:none}
#app #library-screen #library-chapters button.selected{transform:translateX(calc(.7*var(--u)))}
/* Left page: four polaroids. */
#app #library-screen #monster-list{position:absolute;left:5.5%;top:7.5%;width:39%;height:76%;padding:0;margin:0;border:0;display:grid;grid-template-columns:repeat(2,auto);grid-template-rows:repeat(2,minmax(0,1fr));justify-content:center;align-content:stretch;gap:calc(1.1*var(--u)) calc(2.4*var(--u));overflow:visible}
#app #library-screen .monster-option{position:relative;height:100%;width:auto;aspect-ratio:130/165;min-height:0;max-height:none;flex:none;padding:0;margin:0;border:0;box-shadow:none;display:block;overflow:visible;background:url('./assets/library-cards.png') 0 0/600% 100% no-repeat;color:#3a2314;cursor:pointer}
#app #library-screen .monster-option[hidden]{display:none}
#app #library-screen .monster-option::before,#app #library-screen .monster-option::after{content:none}
#app #library-screen .monster-option:hover,#app #library-screen .monster-option:focus-visible{background-position:20% 0;outline:none}
#app #library-screen .monster-option.selected{background-position:40% 0}
#app #library-screen .monster-option.boss{background-position:60% 0}
#app #library-screen .monster-option.boss:hover,#app #library-screen .monster-option.boss:focus-visible{background-position:80% 0}
#app #library-screen .monster-option.boss.selected{background-position:100% 0}
#app #library-screen .monster-option canvas{position:absolute;left:15.4%;top:21.2%;width:65%;height:47.6%;max-height:none;object-fit:contain;background:#16112a}
#app #library-screen .monster-option span{position:absolute;left:9%;right:9%;top:70.5%;height:15%;padding:0;display:flex;align-items:center;justify-content:center;text-align:center;font:calc(1.2*var(--u))/1 UmaText,monospace;color:#3a2314;overflow-wrap:normal}
#app #library-screen .monster-option.boss span{color:#5b2b06}
#app #library-screen .monster-option span.long{font-size:calc(.98*var(--u));letter-spacing:-.03em}
/* Right page: the chosen monster. */
#app #library-screen #monster-card{position:absolute;left:52.4%;top:6.6%;width:39.6%;height:78%;padding:0;margin:0;overflow:hidden;display:grid;grid-template-columns:56% 44%;grid-template-rows:38% 10.5% 12.5% 39%;grid-template-areas:"stage stage" "title title" "desc desc" "abil note";min-height:0;border:0;background:none}
#app #library-screen .portrait-stage{grid-area:stage;position:relative;height:auto;min-height:0;margin:0 calc(1.5*var(--u));flex:none;background:url('./assets/library-stages.png') calc(var(--stage,0)/3*100%) 0/400% 100% no-repeat}
#app #library-screen #monster-card[data-chapter="1"] .portrait-stage{--stage:1}#app #library-screen #monster-card[data-chapter="2"] .portrait-stage{--stage:2}#app #library-screen #monster-card[data-chapter="3"] .portrait-stage{--stage:3}
#app #library-screen .portrait-stage::before{content:none}
#app #library-screen #monster-art{position:absolute;left:9%;top:9%;width:82%;height:84%;object-fit:contain}
#app #library-screen #monster-title,#app #library-screen #monster-title.long-title{grid-area:title;align-self:center;justify-self:center;width:76%;height:88%;margin:0;padding:0;display:flex;align-items:center;justify-content:center;background:url('./assets/library-strip.png') center/100% 100% no-repeat;font:calc(1.75*var(--u))/1 UmaDisplay,UmaPixel,monospace;color:#3b2010;text-shadow:none;text-transform:uppercase;white-space:nowrap;text-align:center}
#app #library-screen #monster-title.long-title{font-size:calc(1.4*var(--u))}
#app #library-screen #monster-description{grid-area:desc;margin:0;padding:calc(.5*var(--u)) calc(1*var(--u)) 0;min-height:0;overflow:hidden;font:max(10px,calc(1.3*var(--u)))/1.2 UmaText,monospace;color:#3a2a22;text-align:center}
#app #library-screen #monster-abilities{grid-area:abil;margin:0;border:0;display:grid;grid-template-rows:1fr 1fr;gap:calc(.5*var(--u));min-height:0;overflow:hidden;padding:0 0 0 calc(.6*var(--u))}
#app #library-screen #monster-abilities>div{display:grid;grid-template-columns:calc(3.6*var(--u)) minmax(0,1fr);grid-template-rows:auto 1fr;column-gap:calc(.7*var(--u));align-items:start;min-height:0;padding:calc(.15*var(--u)) calc(.3*var(--u));border:0;border-bottom:1px dashed #b89a7a}
#app #library-screen #monster-abilities dt{grid-column:1/3;grid-row:1;display:contents;font:max(10px,calc(1.15*var(--u)))/1.1 UmaText,monospace;color:#8b1d1d}
#app #library-screen #monster-abilities dt .seal-icon{grid-column:1;grid-row:1/3;align-self:center;width:calc(3.4*var(--u));height:auto;aspect-ratio:75/80;background:url('./assets/library-seals.png') calc(var(--seal)/9*100%) 0/1000% 100% no-repeat}
#app #library-screen #monster-abilities dt .seal-icon::before,#app #library-screen #monster-abilities dt .seal-icon::after{content:none}
#app #library-screen #monster-abilities dd::before{content:none}
#app #library-screen #monster-abilities dd{grid-column:2;grid-row:2;margin:0;padding:0;font:max(10px,calc(1.08*var(--u)))/1.15 UmaText,monospace;color:#3a2a22}
#app #library-screen .tactic{grid-area:note;position:relative;margin:calc(.2*var(--u)) 0 0 calc(.6*var(--u));padding:calc(3.3*var(--u)) calc(1.9*var(--u)) calc(1.4*var(--u)) calc(1.3*var(--u));min-height:0;height:auto;overflow:hidden;display:flex;flex-direction:column;gap:calc(.4*var(--u));align-items:stretch;border:0;box-shadow:none;background:url('./assets/library-note.png') center/100% 100% no-repeat}
#app #library-screen .tactic::before,#app #library-screen .tactic::after{content:none}
#app #library-screen .tactic strong{display:block;padding:0;margin-top:calc(.4*var(--u));border:0;font:max(9px,calc(.88*var(--u)))/1 UmaText,monospace;color:#7a4b0a;white-space:nowrap}
#app #library-screen .tactic .paw-icon{display:none}
#app #library-screen .tactic p{margin:0;font:max(9px,calc(.98*var(--u)))/1.15 UmaText,monospace;color:#3a2a22}
/* Pager under the pages. */
#app #library-screen .library-pager{position:absolute;left:8%;right:9.5%;bottom:7.5%;height:6.5%;display:flex;align-items:center;justify-content:space-between;pointer-events:none}
#app #library-screen .library-arrow{pointer-events:auto;height:100%;aspect-ratio:50/65;padding:0;border:0;background:url('./assets/library-arrows.png') 0 0/400% 100% no-repeat;cursor:pointer}
#app #library-screen .library-arrow.prev:active{background-position:33.333% 0}
#app #library-screen .library-arrow.next{background-position:66.667% 0}#app #library-screen .library-arrow.next:active{background-position:100% 0}
#app #library-screen .library-arrow:hover,#app #library-screen .library-arrow:focus-visible{filter:brightness(1.1) drop-shadow(0 0 3px #ffcf5a);outline:none}
#app #library-screen .library-dots{display:flex;gap:calc(.7*var(--u));margin-right:auto;margin-left:calc(1.6*var(--u))}
#app #library-screen .library-dots i{width:calc(.9*var(--u));height:calc(.9*var(--u));border-radius:50%;background:#9a8a78;box-shadow:0 1px #5b4a3a}
#app #library-screen .library-dots i.on{background:#e7ac2c;box-shadow:0 0 0 1px #8a5a10}

/* Portrait phones: a single notebook page. */
@media(max-width:700px) and (orientation:portrait){
 #app[data-screen="library"] .game-shell,#app #library-screen{min-height:0}
 #app #library-screen{--u:3.4px;position:relative;inset:auto;padding:0 0 30px;display:flex;flex-direction:column;align-items:center}
 #app #library-screen .section-heading{position:relative;height:96px;width:100%}
 #app #library-screen .section-heading .back-button{left:8px;top:10px;width:112px;padding-left:24px;font-size:15px}
 #app #library-screen .section-heading h2{left:auto;right:8px;transform:none;top:6px;width:min(190px,48%);padding-top:44px;font-size:15px}
 #app #library-screen #library-chapters{position:relative;left:auto;top:auto;flex-direction:row;width:min(340px,94%);gap:8px;justify-content:center;margin:2px auto 0}
 #app #library-screen #library-chapters button{width:23%;flex:none}
 #app #library-screen #library-chapters button.selected{transform:translateY(-6px)}
 #app #library-screen .library-panel{position:relative;left:auto;top:auto;transform:none;width:calc(100% - 12px);aspect-ratio:auto;margin:6px auto 0;background:url('./assets/library-paper.png') 0 0/106px 103px repeat;border-style:solid;border-width:30px 16px 20px 18px;border-image:url('./assets/library-page.png') 75 40 50 42/30px 16px 20px 18px round;display:flex;flex-direction:column;gap:12px;padding:6px 6px 8px;filter:none}
 #app #library-screen #monster-list{position:relative;left:auto;top:auto;width:100%;height:auto;grid-template-columns:repeat(2,minmax(0,150px));grid-template-rows:auto;gap:10px 14px;margin-bottom:10px}
 #app #library-screen .monster-option{width:100%;height:auto}
 #app #library-screen .monster-option span{font-size:13px}#app #library-screen .monster-option span.long{font-size:11px}
 #app #library-screen #monster-card{position:relative;left:auto;top:auto;width:100%;height:auto;display:grid;grid-template-columns:100%;grid-template-rows:200px 52px 64px 176px 124px;grid-template-areas:"stage" "title" "desc" "abil" "note";overflow:visible}
 #app #library-screen .portrait-stage{margin:0 auto;width:min(100%,290px)}
 #app #library-screen #monster-title,#app #library-screen #monster-title.long-title{width:min(92%,300px);height:46px;font-size:21px}
 #app #library-screen #monster-title.long-title{font-size:16px}
 #app #library-screen #monster-description{font-size:16px;padding:6px 4px 0}
 #app #library-screen #monster-abilities{gap:6px;padding:0}
 #app #library-screen #monster-abilities>div{grid-template-columns:46px minmax(0,1fr);column-gap:10px}
 #app #library-screen #monster-abilities dt{font-size:16px}
 #app #library-screen #monster-abilities dt .seal-icon{width:44px}
 #app #library-screen #monster-abilities dd{font-size:15px}
 #app #library-screen .tactic{margin:8px 4px 0;padding:14px 14px 12px;background:#f9e27a;box-shadow:inset 0 0 0 2px #e2bf46,3px 4px 0 #0003;gap:6px}
 #app #library-screen .tactic strong{font-size:14px}
 #app #library-screen .tactic p{font-size:15px}
 #app #library-screen .library-pager{position:relative;left:auto;right:auto;bottom:auto;height:44px;width:100%;order:-1}
 #app #library-screen .library-dots{margin-left:auto}
 #app #library-screen .library-dots i{width:9px;height:9px}
}

/* Authors: four credits. */
.authors-list{list-style:none;margin:14px 0;padding:0;display:grid;gap:clamp(8px,1cqw,16px);font-size:clamp(12px,1.45cqw,21px)}.authors-list li{display:flex;gap:.6em;flex-wrap:wrap;align-items:baseline}.authors-list li::before{content:counter(list-item) '.';color:#ffd36a;min-width:1.4em}.authors-list strong{color:#ffe6a4;font-weight:normal}

/* Loading the game: a tiny Infoshum hauls the loading bar (assets/loading-walk.png, 4 cells of 225×102). */
#loading.loading{display:flex;flex-direction:column;align-items:center;gap:10px;top:50%;bottom:auto;transform:translateY(-50%);left:0;width:100%;font:16px/1.3 UmaText,monospace;color:#c9b7ff;text-shadow:0 2px #050816}
#loading[hidden]{display:none}
/* While the art loads only the loading strip is shown; the menu appears once everything is ready. */
html.booting #menu-screen>:not(#loading),html.booting #menu-hint{visibility:hidden}
html.booted #menu-screen>:not(#loading),html.booted #menu-hint{animation:menu-reveal .45s ease-out both}
@keyframes menu-reveal{from{opacity:0}to{opacity:1}}
#loading .shum-walk{width:158px;height:72px;background:url(assets/loading-walk.png) 0 0/632px 72px no-repeat;animation:shum-walk .45s steps(4) infinite;image-rendering:pixelated}
#loading .shum-bar{display:block;width:min(360px,70vw);height:26px;background:url(assets/loading-shum-bar.png) center/100% 100% no-repeat;position:relative}
#loading .shum-bar i{position:absolute;left:5%;top:30%;height:40%;width:0;max-width:90%;background:linear-gradient(#9ff4ff,#2fb6ff 55%,#7b4dff);box-shadow:0 0 10px #4fd2ff;border-radius:6px;transition:width .2s}
@keyframes shum-walk{to{background-position:-632px 0}}
/* Messages from Yuri: the riveted panel (assets/hint-panel.png as a 9-slice frame) with his face in a little CRT. */
#app .status{background:none;box-shadow:none;border-style:solid;border-color:transparent;border-width:24px 23px 30px 23px;border-image:url(assets/hint-panel.png) 48 46 60 46 fill / 24px 23px 30px 23px stretch;padding:4px 14px 2px 78px;min-height:60px;color:#ffe7b3;text-shadow:1px 2px #0a0420;display:flex;align-items:center;text-align:left}
#app .status::before{content:'';position:absolute;left:-6px;top:50%;width:76px;height:82px;margin-top:-41px;background:url(assets/hint-portrait.png?v=fb6) 0 0/152px 82px no-repeat;animation:yuri-talk .5s steps(2) infinite;image-rendering:pixelated}
@keyframes yuri-talk{to{background-position:-152px 0}}
@media(max-width:600px){#app .status{border-width:16px 15px 20px 15px;border-image-width:16px 15px 20px 15px;padding:2px 8px 2px 54px;min-height:44px}#app .status::before{width:52px;height:56px;margin-top:-28px;left:-4px;background-size:104px 56px;animation-name:yuri-talk-small}}
@keyframes yuri-talk-small{to{background-position:-104px 0}}
/* Phones held upright: a compact dialogue — a small framed portrait beside the name, the text across the full width. */
@media(max-width:700px) and (orientation:portrait){
 #app .dialogue-panel{height:268px;display:grid;grid-template-columns:76px minmax(0,1fr);grid-template-rows:88px minmax(0,1fr) 40px;gap:8px 12px;padding:12px;align-items:stretch}
 #app #narrator-portrait{grid-column:1;grid-row:1;width:76px;height:88px;margin:0;align-self:start;object-fit:cover;object-position:50% 15%;object-view-box:inset(3% 16% 30% 16%);border:2px solid #1683a4;box-sizing:border-box}
 #app .dialogue-content{display:contents}
 #app .dialogue-heading{grid-column:2;grid-row:1;align-self:center;padding:0}#app .dialogue-heading h2{font-size:25px}#app .narrator-role{font-size:17px;margin-top:4px}
 #app #dialogue-text{grid-column:1/-1;grid-row:2;font-size:20px;line-height:1.17;margin:0;min-height:0}
 #app .dialogue-actions{grid-column:1/-1;grid-row:3;display:flex;gap:8px}
 #app .dialogue-actions .gold-button,#app .dialogue-actions .dialogue-secondary{font-size:18px;min-height:40px;padding:6px 14px}
}
@media(max-width:360px) and (orientation:portrait){#app #dialogue-text{font-size:18px}#app .dialogue-panel{height:292px}}
/* Victory: a picture on top, the score in four equal tiles, «Главное меню» on the left and «Поделиться» on the right. */
#overlay[data-result="won"]{padding:12px;background:radial-gradient(ellipse at 50% 20%,#1b2f5af0,#03091cf5 70%)}
#overlay[data-result="won"] .result-panel{position:relative;display:flex;flex-direction:column;align-items:stretch;width:min(560px,96%);max-width:none;max-height:calc(100dvh - 24px);padding:0 0 18px;gap:10px;overflow:auto;background:#06162cf8;text-align:center}
#overlay[data-result="won"] .result-art{display:block;width:100%;aspect-ratio:16/9;max-height:36dvh;object-fit:cover;object-position:50% 60%;border-bottom:2px solid #2489a5;image-rendering:pixelated}
#overlay[data-result="won"] #result-title{font:clamp(26px,3vw,36px)/1.1 UmaDisplay,monospace;color:#ffe3b2;margin:4px 18px 0;text-shadow:2px 3px #422339}
#overlay[data-result="won"] #result-text{font:22px/1.2 UmaText,monospace;color:#e6f1f2;margin:0 18px}
#overlay[data-result="won"] .result-panel #result-score{display:block;margin:0 18px;padding:10px 12px 12px;border:2px solid #2489a5;background:#081e35}
#overlay[data-result="won"] .result-score>span{font:19px/1 UmaText,monospace;color:#8dd8e5}
#overlay[data-result="won"] .result-score strong{font:40px/1.1 UmaDisplay,monospace;color:#ffdb82;margin:6px 0 10px}
.result-tiles{list-style:none;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:0;padding:0}
.result-tiles li{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:58px;padding:6px 4px;border:1px solid #1d5f7a;background:#0b2744}
.result-tiles b{font:26px/1 UmaDisplay,monospace;color:#fff0d2}.result-tiles span{font:16px/1 UmaText,monospace;color:#9fc3d0}
#overlay[data-result="won"] #result-purpose{font:18px/1.25 UmaText,monospace;color:#b9cfd6;margin:0 18px}
#overlay[data-result="won"] #result-media{display:inline;font:inherit;color:#ffdb82;text-decoration:none;white-space:nowrap}#overlay[data-result="won"] #result-media .media-blue{color:#5fd1ff}
#overlay[data-result="won"] .result-actions{display:grid;grid-template-columns:1fr 1fr;gap:12px;width:auto;margin:4px 18px 0}
#overlay[data-result="won"] .result-actions button{width:100%;min-height:48px;margin:0;font:24px/1 UmaText,monospace;padding:10px}
.share-menu{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:0 18px;padding:8px;background:#0a1d36;border:2px solid #5fd1ff}
.share-menu[hidden]{display:none}
.share-menu a,.share-menu button{display:block;font:19px/1 UmaText,monospace;color:#fff0d2;background:#123459;border:1px solid #2d6c94;padding:10px 8px;text-decoration:none;text-align:center;cursor:pointer}
.share-menu a:hover,.share-menu button:hover,.share-menu a:focus-visible,.share-menu button:focus-visible{background:#1d4d7c;outline:2px solid #ffdb82}
@media(max-width:700px){#overlay[data-result="won"] .result-art{max-height:30dvh}#overlay[data-result="won"] #result-text{font-size:20px}.result-tiles{gap:5px}.result-tiles b{font-size:22px}.result-tiles span{font-size:14px}#overlay[data-result="won"] #result-purpose{font-size:16px}#overlay[data-result="won"] .result-actions button{font-size:21px}}
@media(max-width:420px){#overlay[data-result="won"] .result-actions button{font-size:19px;white-space:nowrap;padding:10px 6px}.share-menu a,.share-menu button{font-size:16px}}
@media(max-height:550px) and (orientation:landscape){#overlay[data-result="won"] .result-panel{display:grid;grid-template-columns:40% minmax(0,1fr);width:min(860px,96%);padding:0;gap:6px 14px;align-content:start}
 #overlay[data-result="won"] .result-art{grid-column:1;grid-row:1/8;height:100%;max-height:none;aspect-ratio:auto;border-bottom:0;border-right:2px solid #2489a5}
 #overlay[data-result="won"] .result-panel>:not(.result-art){grid-column:2;grid-row:auto;align-self:start;margin-left:0;margin-right:14px}
 #overlay[data-result="won"] #result-title{margin-top:10px;font-size:26px}#overlay[data-result="won"] #result-text{font-size:19px}#overlay[data-result="won"] #result-purpose{font-size:15px}
 #overlay[data-result="won"] .result-panel #result-score{padding:6px 8px 8px}#overlay[data-result="won"] .result-score strong{font-size:28px;margin:2px 0 6px}.result-tiles li{min-height:42px}#overlay[data-result="won"] .result-actions{margin-bottom:10px}}

#menu-cat{position:absolute;left:0;top:0;pointer-events:none;display:none;image-rendering:auto}#app[data-screen="menu"] #menu-cat{display:block}

#dialogue[data-speaker="uma"] .dialogue-panel{box-shadow:inset 0 0 0 2px #f0a9a2aa}#dialogue[data-speaker="uma"] #dialogue-speaker{color:#ffc7b8}

.game-logo-tv{position:absolute;inset:0;width:100%;height:100%;display:none;pointer-events:none}
/* ── Portrait phone layout «Г» (mobile-layout.js): the scene under the HUD at one fixed scale, a decorated panel below ── */
#app[data-layout="panel"][data-screen="game"] #game{top:var(--hud-height)!important;bottom:auto!important;height:var(--scene-h)!important}
.touch-panel{display:none}
#app[data-layout="panel"] .touch-panel:not([hidden]){display:block;position:absolute;left:0;right:0;top:calc(var(--hud-height) + var(--scene-h));bottom:0;z-index:1;pointer-events:none;
 border-top:3px solid #d9a95a;box-shadow:inset 0 3px #6e4b22,inset 0 6px #0a1428,0 -2px #0a1428;
 background:
  radial-gradient(ellipse 60% 55% at 50% 0%,#ffcf8a26,transparent 70%),
  radial-gradient(ellipse 80% 70% at 50% 120%,#5b3fa033,transparent 70%),
  repeating-linear-gradient(0deg,#0000 0 17px,#0b1530 17px 19px),
  repeating-linear-gradient(90deg,#0000 0 37px,#0b153099 37px 39px),
  linear-gradient(180deg,#2a3561 0%,#1c2448 45%,#121a36 100%);
 background-blend-mode:normal}
#app[data-layout="panel"] .touch-panel:not([hidden]){border-top:0;box-shadow:0 -2px #0a1428;background:url('./assets/touch-panel.jpg') 50% 0/100% auto no-repeat,#0f142a}
#app[data-layout="panel"] .touch-controls{inset:calc(var(--hud-height) + var(--scene-h)) 0 0 0!important;width:auto!important;height:auto!important;z-index:5}
#app[data-layout="panel"] #stick-pad{left:0;top:0;width:56%;height:100%}
#app[data-layout="panel"] #stick-base{left:50%;top:52%;opacity:.8;background:#06182dab;border-color:#8fd6e0cc}
#app[data-layout="panel"] #stick-pad.engaged #stick-base{opacity:1}
#app[data-layout="panel"] #touch-actions{right:max(12px,env(safe-area-inset-right));top:50%;bottom:auto;transform:translateY(-50%);width:176px;height:180px}
#app[data-layout="panel"] #touch-actions button{opacity:1;font-size:0;color:transparent;background-color:#0a2542e8;background-repeat:no-repeat;background-position:center;box-shadow:0 4px #050d1f,inset 0 0 0 3px #ffffff14}
#app[data-layout="panel"] #touch-actions button.pressed{background-color:#1e5172;transform:scale(.94);box-shadow:0 1px #050d1f}
#app[data-layout="panel"] #touch-actions .touch-jump{width:76px;height:76px;right:0;top:0;border-color:#6fdcec;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff1cf' d='M12 3 3 12h5v8h8v-8h5z'/%3E%3C/svg%3E");background-size:36px}
#app[data-layout="panel"] #touch-actions .touch-paw{width:80px;height:80px;left:0;top:auto;bottom:0;right:auto;border-color:#f2c661;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff1cf'%3E%3Cellipse cx='12' cy='16' rx='5.2' ry='4.4'/%3E%3Cellipse cx='5.2' cy='10.5' rx='2.1' ry='2.6'/%3E%3Cellipse cx='9.4' cy='6.4' rx='2.1' ry='2.7'/%3E%3Cellipse cx='14.6' cy='6.4' rx='2.1' ry='2.7'/%3E%3Cellipse cx='18.8' cy='10.5' rx='2.1' ry='2.6'/%3E%3C/svg%3E");background-size:40px}
#app[data-layout="panel"] #touch-actions .touch-dash{width:62px;height:62px;right:4px;left:auto;bottom:4px;top:auto;border-color:#b693ff;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff1cf' d='M14 2 4 14h6l-2 8 10-12h-6z'/%3E%3C/svg%3E") center/30px no-repeat,radial-gradient(circle,#10263c 62%,transparent 64%),conic-gradient(#b693ff var(--ready,100%),#263b58 0)}
#app[data-layout="panel"] #touch-actions .touch-dash #dash-status{position:absolute;bottom:-18px;font:13px/1 UmaText,monospace;color:#d8c8ff}
/* ── Visual-novel dialogue on phones (novel-portraits.js): whole busts standing on the text box, tap to go on ── */
.novel-portrait,.novel-hint{display:none}
#app[data-layout="panel"] #dialogue{--box-h:min(214px,30svh);position:absolute!important;inset:var(--hud-height) 0 0 0!important;padding:0!important;filter:none!important;z-index:8;
 background:linear-gradient(180deg,#02081740 0%,#020817a8 45%,#020817e6 100%)!important;cursor:pointer}
#app[data-layout="panel"] #dialogue[hidden]{display:none!important}
#app[data-layout="panel"] .novel-portrait{display:block;position:absolute;bottom:calc(var(--box-h) + max(10px,env(safe-area-inset-bottom)) - 4px);height:min(250px,31svh);width:auto;z-index:0;transform-origin:50% 100%;transition:transform .18s ease-out}
#app[data-layout="panel"] #novel-uma{right:1%;transform:translateY(1%) scaleX(-1)}
#app[data-layout="panel"] #novel-yuri{left:1%;transform:translateY(7%)}
#app[data-layout="panel"] #dialogue .dialogue-panel{position:absolute;left:8px;right:8px;bottom:max(10px,env(safe-area-inset-bottom));height:var(--box-h)!important;display:block!important;padding:14px 16px 10px!important;z-index:1;background:#020c20f7!important;overflow:hidden}
#app[data-layout="panel"] #dialogue #narrator-portrait{display:none!important}
#app[data-layout="panel"] #dialogue .dialogue-content{display:flex!important;flex-direction:column;height:100%;gap:6px;padding:0!important}
#app[data-layout="panel"] #dialogue .dialogue-heading{display:block!important;padding:0 104px 0 0!important;min-height:0!important}
#app[data-layout="panel"] #dialogue .dialogue-heading h2{font:24px/1.1 UmaText,monospace!important;margin:0}
#app[data-layout="panel"] #dialogue .narrator-role{font:15px/1 UmaText,monospace!important;margin:3px 0 0!important}
#app[data-layout="panel"] #dialogue #dialogue-text{flex:1;min-height:0;margin:2px 0 0!important;font:20px/1.2 UmaText,monospace!important;overflow:auto}
#app[data-layout="panel"] #dialogue .dialogue-actions{position:absolute;top:12px;right:12px;display:block!important}
#app[data-layout="panel"] #dialogue #dialogue-next{display:none!important}
#app[data-layout="panel"] #dialogue #dialogue-skip{font:15px/1 UmaText,monospace!important;min-height:36px!important;padding:6px 10px!important}
#app[data-layout="panel"] #dialogue .novel-hint{display:block;margin:0;font:13px/1 UmaText,monospace;color:#7f98bb;text-align:center}
#app[data-layout="panel"] #dialogue .dialogue-panel::after{background:none;left:auto;right:5px;top:auto;bottom:5px;width:16px;height:16px}
#app[data-layout="panel"] #dialogue .dialogue-content{align-items:stretch!important}
#app[data-layout="panel"] #dialogue .dialogue-heading{padding-left:6px!important}
#app[data-layout="panel"] #dialogue .dialogue-heading,#app[data-layout="panel"] #dialogue .dialogue-heading h2{text-align:left!important}
#app[data-layout="panel"] #novel-uma{transform-origin:50% 100%}#app[data-layout="panel"] #novel-yuri{transform-origin:50% 100%}
#app[data-layout="panel"] #dialogue{--box-h:clamp(204px,30svh,236px)}
#app[data-layout="panel"] #dialogue #dialogue-text{font-size:clamp(17px,5.2vw,20px)!important}
/* Library on portrait phones: the four monster cards in one row above the open card. */
@media(max-width:700px) and (orientation:portrait){
 #app #library-screen #monster-list{grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:auto;grid-auto-rows:auto;align-items:start;height:auto!important;flex:none!important;min-height:0!important;max-height:none;gap:6px;margin-bottom:10px}
 #app #library-screen .monster-option span{font-size:clamp(9px,2.8vw,12px);line-height:1.05;white-space:normal;text-align:center}
 #app #library-screen .monster-option span.long{font-size:clamp(7px,2.05vw,9.5px);letter-spacing:-.04em;white-space:nowrap;overflow:visible}
}
/* Phone novel: no corner mark, the name block flush left. */
#app[data-layout="panel"] #dialogue .dialogue-panel::before{display:none}
#app[data-layout="panel"] #dialogue .dialogue-heading{align-self:stretch!important;width:auto!important;margin:0!important;padding:0 112px 0 0!important}
/* Phone hints from Yuri: a slim strip under the HUD (his face says who it is), clear of the menu button. */
#app[data-layout="panel"] .status{top:calc(var(--hud-height) + 6px)!important;left:8px!important;transform:none!important;width:auto!important;max-width:calc(100% - 68px)!important;font-size:15px!important;line-height:1.18!important;
 border-width:11px 10px 13px 10px!important;border-image-width:11px 10px 13px 10px!important;padding:1px 6px 0 38px!important;min-height:30px!important}
#app[data-layout="panel"] .status::before{width:38px!important;height:41px!important;margin-top:-20px!important;left:-3px!important;background-size:76px 41px!important;animation-name:yuri-talk-xs!important}
@keyframes yuri-talk-xs{to{background-position:-76px 0}}
/* Phone controls: brass-rimmed buttons that match the panel's cornice; the main action (jump) is the biggest and
   sits under the thumb, the paw to its left, the dash above between them. */
#app[data-layout="panel"] #touch-actions{width:188px;height:176px;top:auto;bottom:max(18px,calc(env(safe-area-inset-bottom) + 10px));transform:none}
#app[data-layout="panel"] #touch-actions button{border:0;box-shadow:0 5px 0 #050a18,0 7px 12px #0008;
 background-color:transparent;background-repeat:no-repeat;transition:transform .06s}
#app[data-layout="panel"] #touch-actions button::after{content:'';position:absolute;inset:0;border-radius:50%;pointer-events:none;
 box-shadow:inset 0 0 0 3px #f6cf7a,inset 0 0 0 6px #7a5524,inset 0 0 0 8px #1a1430,inset 0 10px 14px #ffffff1c}
#app[data-layout="panel"] #touch-actions button.pressed{transform:translateY(4px) scale(.96);box-shadow:0 1px 0 #050a18,0 2px 6px #0008}
#app[data-layout="panel"] #touch-actions .touch-jump{width:88px;height:88px;right:0;bottom:0;top:auto;left:auto;
 background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff1cf' d='M12 3 3 12h5v8h8v-8h5z'/%3E%3C/svg%3E") center/40px no-repeat,radial-gradient(circle at 50% 35%,#2a7f9b,#123b5c 62%,#0b2240)}
#app[data-layout="panel"] #touch-actions .touch-paw{width:74px;height:74px;left:0;bottom:6px;top:auto;right:auto;
 background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff1cf'%3E%3Cellipse cx='12' cy='16' rx='5.2' ry='4.4'/%3E%3Cellipse cx='5.2' cy='10.5' rx='2.1' ry='2.6'/%3E%3Cellipse cx='9.4' cy='6.4' rx='2.1' ry='2.7'/%3E%3Cellipse cx='14.6' cy='6.4' rx='2.1' ry='2.7'/%3E%3Cellipse cx='18.8' cy='10.5' rx='2.1' ry='2.6'/%3E%3C/svg%3E") center/36px no-repeat,radial-gradient(circle at 50% 35%,#a8742c,#5c3a17 62%,#341f0d)}
#app[data-layout="panel"] #touch-actions .touch-dash{width:62px;height:62px;left:56px;top:0;bottom:auto;right:auto;
 background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff1cf' d='M14 2 4 14h6l-2 8 10-12h-6z'/%3E%3C/svg%3E") center/28px no-repeat,radial-gradient(circle,#3b2a6e 52%,transparent 54%),conic-gradient(#c8a6ff var(--ready,100%),#241b40 0)}
#app[data-layout="panel"] #touch-actions .touch-dash #dash-status{bottom:auto;top:-17px}
#app[data-layout="panel"] #stick-base{width:118px;height:118px;border:0;opacity:1;background:radial-gradient(circle,#0b1a35cc 0 55%,#132a4ccc 56% 100%);
 box-shadow:inset 0 0 0 3px #f6cf7a,inset 0 0 0 6px #7a5524,inset 0 0 0 8px #1a1430,0 6px 14px #0009}
#app[data-layout="panel"] #stick-knob{left:34px;top:34px;width:50px;height:50px;border:0;background:radial-gradient(circle at 45% 35%,#ffe9b0,#d9a24c 45%,#7a5524 100%);box-shadow:0 4px 0 #2a1a0a,0 6px 10px #0009}
#app[data-layout="panel"] #stick-pad.engaged #stick-base{box-shadow:inset 0 0 0 3px #ffe39a,inset 0 0 0 6px #9a6c2c,inset 0 0 0 8px #1a1430,0 0 16px #ffcf6a55}
/* Library on portrait phones: no title plate; the «В меню» tag sits between the pager arrows instead of the dots. */
@media(max-width:700px) and (orientation:portrait){
 #app #library-screen .section-heading{display:none}
 #app #library-screen #library-chapters{margin-top:12px}
 #app #library-screen .library-pager{justify-content:space-between;align-items:center}
 #app #library-screen .library-pager .library-dots{display:none}
 #app #library-screen .library-pager .back-button{border:0;box-shadow:none;outline:none;min-width:0;background:url('./assets/library-tag.png') center/100% 100% no-repeat;color:#432612;font-family:UmaText,monospace;text-shadow:none;line-height:1;position:relative;z-index:3;pointer-events:auto;transform:none;margin:0 auto;width:118px;height:auto;aspect-ratio:124/73;padding:0 0 0 26px;font-size:15px;flex:none}
}
}
#app[data-layout="panel"] #dialogue[data-speaker="uma"] #dialogue-text{font-size:30px!important;line-height:1.3!important}
