:root{font-family:ui-rounded,"PingFang SC","Microsoft YaHei",system-ui,sans-serif;color:#2d322d;background:#e9e9df;font-synthesis:none;--paper:#f7f6f0;--ink:#2d322d;--muted:#878b7e;--green:#667f69;--line:#d8dbcf;--accent:#e9d694}
*{box-sizing:border-box;--minitool-row-gap:0px;--minitool-column-gap:0px}body{margin:0;min-width:280px;background-image:radial-gradient(#cfd3c7 .7px,transparent .7px);background-size:8px 8px}button{font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent;color:inherit}button:disabled{opacity:.45;cursor:default}html.minitool-no-focus-visible button:focus{outline:3px solid #91a696;outline-offset:4px}button:focus-visible{outline:3px solid #91a696;outline-offset:4px}button,canvas{touch-action:manipulation}button{border:0}svg{display:block}button svg{pointer-events:none}[hidden]{display:none!important}.notebook{position:relative;max-width:460px;margin:0 auto;min-height:100vh;min-height:calc(var(--minitool-vh,1vh) * 100);min-height:100dvh;background:var(--paper);box-shadow:0 0 60px #36433012;overflow:hidden}.notebook:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;inset:0;pointer-events:none;opacity:.5;background-image:linear-gradient(#c7cdc326 1px,transparent 1px),linear-gradient(90deg,#c7cdc326 1px,transparent 1px);background-size:24px 24px}.home-screen,.game-screen{position:relative;z-index:1}.home-screen{min-height:100vh;min-height:calc(var(--minitool-vh,1vh) * 100);min-height:100dvh;display:flex;flex-direction:column;padding:calc(22px + var(--safe-area-inset-top,0px)) 30px calc(20px + var(--safe-area-inset-bottom,0px));padding:calc(22px + var(--safe-area-inset-top,env(safe-area-inset-top,0px))) 30px calc(20px + var(--safe-area-inset-bottom,env(safe-area-inset-bottom,0px)))}.home-header,.game-header{display:flex;align-items:center;justify-content:space-between}.edition{font-size:9px;letter-spacing:2px;font-weight:650;color:#77816d}.icon-button{width:40px;height:40px;display:grid;align-items:center;justify-items:center;place-items:center;border:1px solid var(--line);border-radius:50%;background:#faf9f3}.icon-button svg{width:19px;height:19px}.home-heading{margin-top:37px;text-align:center}.eyebrow{font-size:11px;letter-spacing:3px;color:var(--muted)}h1{font-size:34px;letter-spacing:-1px;margin:13px -10px 15px;font-family:"Songti SC","Noto Serif CJK SC",serif;font-weight:800}.title-dot{color:#839372}.subtitle{display:flex;align-items:center;justify-content:center;--minitool-row-gap:10px;--minitool-column-gap:10px;grid-gap:10px;gap:10px;font-size:10px;letter-spacing:1.7px;color:#737b68}.subtitle>span{width:17px;height:1px;background:#c2c8b7}.cover-art{height:300px;position:relative;margin:9px -15px 0}.tower-art{position:absolute;width:100%;height:100%;color:#454c40}.tower-art .cloud{stroke:#b5bdae;stroke-width:1.8}.cover-bear{position:absolute;left:21px;bottom:29px;width:145px;height:157px;background:url('assets/characters.webp') 0 0 /400% 400% no-repeat;transform:rotate(-5deg)}.cover-note{position:absolute;bottom:0;right:25px;font-size:11px;letter-spacing:1px;transform:rotate(-4deg);color:#7f8974}.little-star{position:absolute;left:21px;bottom:47px;font-size:31px;color:#a89960}.home-description{font-size:12px;line-height:2.1;color:#848979;text-align:center;margin:25px 0 22px;letter-spacing:.5px}.home-actions{display:grid;--minitool-row-gap:12px;--minitool-column-gap:12px;grid-gap:12px;gap:12px;margin-top:auto;padding-top:8px}.primary-button{border-radius:9px 11px 8px 12px;background:var(--ink);color:#fffef7;padding:17px 23px;font-size:14px;font-weight:650;letter-spacing:1.4px;display:flex;align-items:center;justify-content:space-between;box-shadow:3px 4px 0 #cfd4c4;min-height:51px}.primary-button:hover{background:#455240}.primary-button span{font-size:21px;font-weight:400;line-height:15px}.primary-button.secondary{background:transparent;color:var(--ink);box-shadow:none;border:1px solid #bfc6b6}.text-button{background:transparent;color:#868c7b;font-size:11px;padding:8px}.text-button span{margin-left:8px}.home-footer{margin-top:25px;padding:15px 0 0;border-top:1px dashed #d4d8cb;display:flex;justify-content:center;align-items:center;--minitool-row-gap:25px;--minitool-column-gap:25px;grid-gap:25px;gap:25px;font-size:9px;letter-spacing:1px;color:#939b88}.home-footer i{font-style:normal;font-size:16px;color:#9ca88f}.game-screen{--game-gutter:18px;padding:calc(15px + var(--safe-area-inset-top,0px)) 0 calc(10px + var(--safe-area-inset-bottom,0px));padding:calc(15px + var(--safe-area-inset-top,env(safe-area-inset-top,0px))) 0 calc(10px + var(--safe-area-inset-bottom,env(safe-area-inset-bottom,0px)));height:100vh;height:calc(var(--minitool-vh,1vh) * 100);height:100dvh;min-height:520px;display:flex;flex-direction:column}.game-screen> .game-header,.game-screen> .stats-paper,.game-screen> .field-note,.game-screen> .bottom-nav{margin-left:var(--game-gutter);margin-right:var(--game-gutter);margin-inline:var(--game-gutter);flex-shrink:0}.game-header{margin-bottom:14px}.game-brand{background:transparent;display:flex;align-items:center;--minitool-row-gap:9px;--minitool-column-gap:9px;grid-gap:9px;gap:9px;padding:0;text-align:left;font-size:15px;letter-spacing:.3px;font-weight:700}.game-brand small{display:block;font-size:7px;letter-spacing:1.9px;margin-top:5px;font-weight:500;color:#909783}.brand-bear{display:block;width:36px;height:39px;background:url('assets/characters.webp') 0 0 /400% 400% no-repeat}.game-header .icon-button{width:35px;height:35px}.stats-paper{background:#fffef9;border:1px solid #d7dcce;border-radius:7px 9px 8px 10px;padding:14px 15px 12px;box-shadow:2px 3px 0 #e7e9de}.health-line{display:flex;align-items:center;--minitool-row-gap:7px;--minitool-column-gap:7px;grid-gap:7px;gap:7px}.health-icon{color:#b48170;width:17px}.health-label{font-size:10px;color:#8c9185}.health-line strong{font-size:20px;line-height:1;font-variant-numeric:tabular-nums;letter-spacing:-.5px}.level-label{font-size:10px;margin-left:auto;color:#667a5c;white-space:nowrap}.level-label b{font-size:12px}.level-label>span{font-size:8px;color:#a0a693;margin-left:5px}.stats-row{display:grid;grid-template-columns:repeat(4,1fr);--minitool-row-gap:8px;--minitool-column-gap:8px;grid-gap:8px;gap:8px}.stats-row>div{display:flex;align-items:center;--minitool-row-gap:8px;--minitool-column-gap:8px;grid-gap:8px;gap:8px}.stats-row i{width:20px;color:#8c957d}.stats-row span{font-size:9px;color:#919687}.stats-row strong{display:block;font-size:15px;line-height:1.5;color:var(--ink);font-weight:650;letter-spacing:.3px;font-variant-numeric:tabular-nums}.floor-line{display:flex;align-items:center;justify-content:space-between;height:26px;margin:0 var(--game-gutter) 10px}.floor-line>div{display:flex;align-items:center;--minitool-row-gap:9px;--minitool-column-gap:9px;grid-gap:9px;gap:9px}h2{font-size:13px;letter-spacing:.5px;margin:0;font-weight:650}.damage-toggle{display:flex;align-items:center;--minitool-row-gap:5px;--minitool-column-gap:5px;grid-gap:5px;gap:5px;font-size:10px;color:#929887;background:transparent;padding:5px}.damage-toggle svg{width:15px}.damage-toggle[aria-pressed=true]{color:#547758;background:#e7ece1;border-radius:5px}.board-frame{position:relative;width:100%;overflow:hidden}.board-frame canvas{display:block;width:100%;height:auto;aspect-ratio:1;touch-action:none;cursor:pointer;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}.floor-transition{position:absolute;top:0;right:0;bottom:0;left:0;inset:0;z-index:1;display:none;align-items:center;justify-content:center;background:#f6f6ec;color:#485b3c;font-family:serif;font-size:24px;letter-spacing:4px;pointer-events:auto;touch-action:none}.floor-transition.visible{display:flex}.undo-button{margin-left:auto;background:none;font-size:9px;color:#909983;display:flex;align-items:center;--minitool-row-gap:3px;--minitool-column-gap:3px;grid-gap:3px;gap:3px;padding:6px 0}.undo-button svg{width:14px}.field-note{display:flex;align-items:center;justify-content:center;--minitool-row-gap:6px;--minitool-column-gap:6px;grid-gap:6px;gap:6px;min-height:34px;padding:7px 3px;color:#8e9782;font-size:10px;line-height:1.7;text-align:center}.field-note>span{flex-shrink:0}.field-note svg{width:13px}.field-note p{margin:0}.bottom-nav{display:grid;grid-template-columns:repeat(4,1fr);padding:11px 1px 9px;border-top:1px solid #d9dfcf;border-bottom:1px solid #d9dfcf;margin-top:0;--minitool-row-gap:7px;--minitool-column-gap:7px;grid-gap:7px;gap:7px}.bottom-nav button{background:none;display:flex;align-items:center;flex-direction:column;--minitool-row-gap:7px;--minitool-column-gap:7px;grid-gap:7px;gap:7px;font-size:9px;color:#67725c;min-height:45px;padding:4px 0;border-radius:8px}.bottom-nav button:hover,.bottom-nav button:active{background:#e8eddf}.bottom-nav svg{width:23px;height:23px;stroke-width:1.5}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;inset:0;z-index:30;background:#242e2448;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);display:flex;justify-content:center;align-items:flex-end;animation:appear .15s ease}.modal-sheet{position:relative;width:100%;width:min(460px,100%);background:var(--paper);border-radius:22px 22px 0 0;max-height:88vh;max-height:calc(var(--minitool-vh,1vh) * 88);max-height:88dvh;padding:23px 22px calc(22px + var(--safe-area-inset-bottom,0px));padding:23px 22px calc(22px + var(--safe-area-inset-bottom,env(safe-area-inset-bottom,0px)));box-shadow:0 -10px 60px #26392619;animation:slide-in .22s ease;display:flex;flex-direction:column;overflow:auto;overscroll-behavior:contain}.modal-sheet:before{content:"";position:absolute;top:8px;left:calc(50% - 18px);width:36px;height:3px;border-radius:2px;background:#d4d9cd}.modal-header{display:flex;align-items:center;justify-content:space-between;margin:1px 0 20px;--minitool-row-gap:10px;--minitool-column-gap:10px;grid-gap:10px;gap:10px}.modal-header h2{font-size:18px;font-family:"Songti SC",serif;letter-spacing:1px}.close-button{background:#e9ede2;border-radius:50%;width:32px;height:32px;display:grid;align-items:center;justify-items:center;place-items:center;font-size:22px;color:#7e8c75;flex-shrink:0}.panel-intro{font-size:11px;line-height:1.9;color:#8a947f;margin:0 0 18px}.empty-state{text-align:center;padding:22px 10px;font-size:12px;color:#8c9680;line-height:2}.empty-state img,.empty-state canvas{width:90px;height:90px;object-fit:contain;margin:0 auto 14px;display:block}.panel-list{display:grid;--minitool-row-gap:10px;--minitool-column-gap:10px;grid-gap:10px;gap:10px}.item-card,.enemy-card,.save-card{border:1px solid #dce1d3;border-radius:9px;background:#fffef8;padding:13px;display:flex;align-items:center;--minitool-row-gap:12px;--minitool-column-gap:12px;grid-gap:12px;gap:12px;text-align:left;width:100%;min-height:70px}.item-card>img,.item-card>canvas,.enemy-card>img,.enemy-card>canvas{width:43px;height:45px;object-fit:contain;flex-shrink:0}.item-card h3,.enemy-card h3,.save-card h3{font-size:12px;margin:0 0 5px;letter-spacing:.4px}.item-card p,.enemy-card p,.save-card p{font-size:10px;color:#8b947f;margin:0;line-height:1.7}.item-card>div,.enemy-card>div,.save-card>div{flex:1}.item-card .count{font-size:11px;color:#839271}.card-action{font-size:10px;color:#688259}.enemy-card{flex-wrap:wrap}.enemy-card .enemy-content{min-width:130px}.enemy-numbers{display:flex;--minitool-row-gap:12px;--minitool-column-gap:12px;grid-gap:12px;gap:12px;font-size:10px;color:#89947e;line-height:2}.damage-pill{border-radius:5px;background:#edf1e6;color:#5d8057;padding:6px 7px;font-size:10px;align-self:center;white-space:nowrap}.damage-pill.danger{background:#f2e4dd;color:#a5705f}.damage-pill small{display:block;font-size:8px;opacity:.7;margin-bottom:2px}.sheet-button{width:100%;margin-top:15px}.option-button{padding:16px;border:1px solid #d6deca;background:#fffef8;border-radius:9px;text-align:left;font-size:13px;line-height:1.7;width:100%;display:block;margin-bottom:10px}.option-button small{display:block;color:#969f89;font-size:10px;margin-top:5px}.option-button.selected{border-color:#8da17d;background:#eaf0e1}.dialogue-text{font-size:14px;line-height:2.1;letter-spacing:.5px;white-space:pre-wrap;margin:0 0 20px;min-height:70px}.dialogue-footer{display:flex;justify-content:space-between;align-items:center;--minitool-row-gap:10px;--minitool-column-gap:10px;grid-gap:10px;gap:10px}.dialogue-footer .primary-button{margin-left:auto;min-width:130px;padding:13px 18px;min-height:45px;font-size:12px}.skip-button{background:none;color:#9aa28e;font-size:10px;padding:12px 0}.floor-grid{display:grid;grid-template-columns:repeat(4,1fr);--minitool-row-gap:9px;--minitool-column-gap:9px;grid-gap:9px;gap:9px}.floor-select{padding:15px 3px;border:1px solid #d3ddc9;border-radius:7px;background:#fffef9;font-size:12px}.floor-select.current{background:#e6eddd;color:#638051}.ending-art{width:135px;height:140px;object-fit:contain;display:block;margin:0 auto 12px}.ending-score{display:grid;grid-template-columns:repeat(3,1fr);padding:20px 0;text-align:center;border-top:1px dashed #ccd8c0;border-bottom:1px dashed #ccd8c0;border-block:1px dashed #ccd8c0;margin:15px 0}.ending-score small{display:block;color:#87997a;font-size:10px;margin-bottom:9px}.ending-score strong{font-size:18px}.minor-button{background:none;color:#8b977f;font-size:11px;padding:13px}.danger-button{color:#a97963}.save-meta{font-size:11px;color:#879b75}.fatal{padding:25px;font-size:13px;line-height:2;color:#8b5447}
@keyframes appear{from{opacity:0}to{opacity:1}}@keyframes slide-in{from{transform:translateY(25px);opacity:.5}to{transform:translateY(0);opacity:1}}
@media(min-width:600px){body{padding:28px 0}.notebook{min-height:850px;border:1px solid #c9d0c0;border-radius:15px}.home-screen{min-height:850px;padding-left:38px;padding-right:38px;padding-inline:38px}.game-screen{--game-gutter:22px;height:calc(100vh - 58px);height:calc(calc(var(--minitool-vh,1vh) * 100) - 58px);height:calc(100dvh - 58px)}.home-heading{margin-top:46px}.cover-art{height:310px}.home-description{margin-top:30px}.modal-backdrop{align-items:center}.modal-sheet{border-radius:18px;max-height:85vh;max-height:calc(var(--minitool-vh,1vh) * 85);max-height:85dvh}.modal-sheet:before{display:none}}
@media(max-height:740px) and (max-width:599px){.home-screen{padding-top:15px}.home-heading{margin-top:16px}h1{font-size:30px}.cover-art{height:255px}.cover-bear{width:123px;height:135px;bottom:25px;left:25px}.home-description{margin:16px 0 12px;font-size:11px}.home-footer{margin-top:15px}.game-screen{--game-gutter:14px;padding-top:10px}.game-header{margin-bottom:10px}.stats-paper{padding:10px 13px}.field-note{min-height:35px;font-size:9px}.bottom-nav{padding-top:8px;padding-bottom:8px;padding-block:8px}}
@media(max-width:360px){.game-screen{--game-gutter:11px}.home-screen{padding-left:25px;padding-right:25px;padding-inline:25px}h1{font-size:29px}.stats-row{--minitool-row-gap:5px;--minitool-column-gap:5px;grid-gap:5px;gap:5px}.stats-row>div{--minitool-row-gap:5px;--minitool-column-gap:5px;grid-gap:5px;gap:5px}.stats-row i{width:16px}.level-label>span{display:none}.home-heading{margin-top:19px}.cover-art{height:257px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}
@media(max-height:740px) and (max-width:599px){
  .game-screen{padding-top:calc(8px + var(--safe-area-inset-top,0px));padding-top:calc(8px + var(--safe-area-inset-top,env(safe-area-inset-top,0px)));padding-bottom:calc(8px + var(--safe-area-inset-bottom,0px));padding-bottom:calc(8px + var(--safe-area-inset-bottom,env(safe-area-inset-bottom,0px)))}
  .game-header{height:28px;margin-bottom:7px}.brand-bear{width:26px;height:28px}.game-brand{font-size:13px;--minitool-row-gap:7px;--minitool-column-gap:7px;grid-gap:7px;gap:7px}.game-brand small{font-size:6px;margin-top:2px;letter-spacing:1.4px}.game-header .icon-button{width:28px;height:28px}.game-header .icon-button svg{width:16px}
  .stats-paper{padding:8px 12px}.health-line strong{font-size:18px}.stats-row strong{font-size:13px;line-height:1.3}.stats-row span{font-size:8px}.stats-row i{width:17px}
  .field-note{min-height:26px;padding-top:4px;padding-bottom:4px;padding-block:4px}.bottom-nav{padding-top:5px;padding-bottom:5px;padding-block:5px}.bottom-nav button{min-height:38px;--minitool-row-gap:4px;--minitool-column-gap:4px;grid-gap:4px;gap:4px;font-size:8px;padding-top:3px;padding-bottom:3px;padding-block:3px}.bottom-nav svg{width:20px;height:20px}
}
@media(max-height:650px) and (max-width:599px){.home-heading{margin-top:11px}.home-heading h1{font-size:28px;margin-top:9px;margin-bottom:11px;margin-block:9px 11px}.home-heading .eyebrow{font-size:10px}.cover-art{height:210px}.cover-bear{width:102px;height:111px;left:40px;bottom:23px}.cover-note{font-size:9px;right:35px}.home-description{font-size:10px;margin-top:9px;margin-bottom:9px;margin-block:9px}.home-actions{--minitool-row-gap:7px;--minitool-column-gap:7px;grid-gap:7px;gap:7px;padding-top:3px}.home-actions .primary-button{min-height:46px;padding-top:12px;padding-bottom:12px;padding-block:12px;font-size:12px}.home-footer{padding-top:10px;margin-top:12px}.home-header .icon-button{width:32px;height:32px}.edition{font-size:7px;letter-spacing:1.7px}}
@media(min-width:600px){.notebook,.home-screen{min-height:calc(100vh - 58px);min-height:calc(calc(var(--minitool-vh,1vh) * 100) - 58px);min-height:calc(100dvh - 58px)}}

/* Size the map first; inventory only occupies the space left above it. */
.map-region{--map-heading-height:36px;--supplies-full-min:84px;--supplies-full-gap:10px;--supplies-compact-height:24px;--supplies-compact-gap:6px;flex:1;min-height:196px;container-type:size;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;margin-top:4px}
.map-content{width:100%;flex-shrink:0;display:flex;flex-direction:column;align-items:center}
.map-content>.floor-line{width:calc(100% - 2 * var(--game-gutter));flex-shrink:0}
.map-content>.board-frame{width:calc(var(--minitool-container-width,100vw) * 1.0);width:min(100cqw,calc(100cqh - var(--map-heading-height)))}
.floor-actions{--minitool-row-gap:10px!important;--minitool-column-gap:10px!important;grid-gap:10px!important;gap:10px!important}
.supplies-row{display:none;grid-template-columns:minmax(118px,.75fr) minmax(0,1.25fr);--minitool-row-gap:12px;--minitool-column-gap:12px;grid-gap:12px;gap:12px;width:calc(100% - 2 * var(--game-gutter));height:var(--supplies-full-min);height:clamp(var(--supplies-full-min),calc(100cqh - 100cqw - var(--map-heading-height) - var(--supplies-full-gap)),112px);margin-bottom:var(--supplies-full-gap);flex-shrink:0}
.supplies-summary{display:none;align-items:center;justify-content:space-between;--minitool-row-gap:12px;--minitool-column-gap:12px;grid-gap:12px;gap:12px;width:calc(100% - 2 * var(--game-gutter));height:var(--supplies-compact-height);margin-bottom:var(--supplies-compact-gap);flex-shrink:0;color:#707b65;font-size:11px;line-height:1.5;white-space:nowrap;font-variant-numeric:tabular-nums}
.supplies-summary>span{flex-shrink:0}
.map-region[data-supplies=full] .supplies-row{display:grid}
.map-region[data-supplies=compact] .supplies-summary{display:flex}
.supply-panel{min-width:0;min-height:0;border:1px solid #d7dcce;border-radius:8px;background:#fffef9b3}
.equipment-panel{display:flex;flex-direction:column;padding:11px 12px 8px}
.equipment-panel h2{font-size:10px;font-weight:500;color:#8c947f;letter-spacing:1px}
.equipped-items{display:flex;align-items:center;justify-content:center;--minitool-row-gap:10px;--minitool-column-gap:10px;grid-gap:10px;gap:10px;flex:1;min-height:0}
.equipped-item{min-width:0;display:flex;flex-direction:column;align-items:center;--minitool-row-gap:3px;--minitool-column-gap:3px;grid-gap:3px;gap:3px;font-size:9px;color:#707b65}
.equipped-item img{display:block;width:40px;height:40px;object-fit:contain}
.equipped-item span{white-space:nowrap}
.equipment-empty{font-size:10px;color:#a3aa99;letter-spacing:1px}
.equipment-vacant{min-width:0;display:flex;flex-direction:column;align-items:center;--minitool-row-gap:3px;--minitool-column-gap:3px;grid-gap:3px;gap:3px;font-size:9px;color:#9aa18f}
.equipment-vacant>svg{width:30px;height:30px;padding:5px;border:1px dashed #c3c9b8;border-radius:6px;color:#a7ae9c}
.equipment-vacant span{white-space:nowrap}
.key-panel{overflow:auto;overscroll-behavior:contain;padding:12px;scrollbar-width:thin;scrollbar-color:#cad2bf transparent}
.key-icons{display:flex;flex-wrap:wrap;align-content:flex-start;--minitool-row-gap:5px;--minitool-column-gap:5px;grid-gap:5px;gap:5px}
.key-group{display:contents}
.held-key{display:block;flex:0 0 21px;width:21px;height:24px;object-fit:contain}
@media(max-height:740px) and (max-width:599px){
  .map-region{--supplies-full-min:72px;--supplies-full-gap:8px}.supplies-row{--minitool-row-gap:9px;--minitool-column-gap:9px;grid-gap:9px;gap:9px}.equipment-panel{padding:7px 9px 5px}.equipment-panel h2{font-size:9px}.equipped-items{--minitool-row-gap:10px;--minitool-column-gap:10px;grid-gap:10px;gap:10px}.equipped-item{--minitool-row-gap:1px;--minitool-column-gap:1px;grid-gap:1px;gap:1px;font-size:8px}.equipped-item img{width:28px;height:28px}.equipment-vacant{--minitool-row-gap:1px;--minitool-column-gap:1px;grid-gap:1px;gap:1px;font-size:8px}.equipment-vacant>svg{width:24px;height:24px;padding:4px}.key-panel{padding:8px}.key-icons{--minitool-row-gap:3px;--minitool-column-gap:3px;grid-gap:3px;gap:3px}.held-key{flex-basis:18px;width:18px;height:21px}
}

@media(max-height:650px) and (max-width:599px){.field-note{display:none}}

/* Both screens fit the viewport; only their content panels can scroll. */
html,body{height:100%;overflow:hidden;overscroll-behavior:none}
body{padding:0}
.notebook{max-width:none;width:100%;height:100vh;height:calc(var(--minitool-vh,1vh) * 100);height:100dvh;min-height:0;border:0;border-radius:0}
.notebook .game-screen{height:100vh;height:calc(var(--minitool-vh,1vh) * 100);height:100dvh;min-height:0}
.game-screen>.map-region{min-height:0}
.game-sidebar{display:contents}.game-sidebar>.game-header,.game-sidebar>.stats-paper,.game-sidebar>.bottom-nav{margin-left:var(--game-gutter);margin-right:var(--game-gutter);margin-inline:var(--game-gutter);flex-shrink:0}
.game-sidebar>.game-header{order:0}
.game-sidebar>.stats-paper{order:1}
.game-sidebar>.feedback-host{order:2}
.game-screen>.map-region{order:3}
.game-sidebar>.bottom-nav{order:4}
.game-screen>.bottom-nav{order:4}

/* Preserve complete numbers; reflow the stat rows before reducing type size. */
.game-screen .stats-row{grid-template-columns:repeat(4,minmax(0,1fr));margin-top:11px}
@media(max-height:740px) and (max-width:599px){.game-screen .stats-row{margin-top:7px}}
/* A slim status card lets the equipment and key panels stay visible above the map. */
.game-screen[data-layout=stacked][data-status=slim] .game-header{height:28px;margin-bottom:4px}
.game-screen[data-layout=stacked][data-status=slim] .brand-bear{width:26px;height:28px}
.game-screen[data-layout=stacked][data-status=slim] .game-brand{font-size:13px;--minitool-row-gap:7px;--minitool-column-gap:7px;grid-gap:7px;gap:7px}
.game-screen[data-layout=stacked][data-status=slim] .game-brand small{font-size:6px;margin-top:2px;letter-spacing:1.4px}
.game-screen[data-layout=stacked][data-status=slim] .stats-paper{padding:6px 12px 5px}
.game-screen[data-layout=stacked][data-status=slim] .health-line strong{font-size:18px}
.game-screen[data-layout=stacked][data-status=slim] .stats-row{margin-top:5px}
.game-screen[data-layout=stacked][data-status=slim] .stats-row strong{font-size:13px;line-height:1.25}
.game-screen[data-layout=stacked][data-status=slim] .stats-row span{font-size:8px}
.game-screen[data-layout=stacked][data-status=slim] .stats-row i{width:16px}
.game-screen .stats-row>div,.game-screen .stats-row span{min-width:0}
.game-screen .stats-row i{flex-shrink:0}
.game-screen .stats-row strong{white-space:nowrap;overflow-wrap:normal}
.game-screen .stats-row[data-fit] i{display:none}
.game-screen .stats-row[data-fit=compact] span{width:100%}
.game-screen[data-layout] .stats-row[data-fit=wide]{grid-template-columns:repeat(2,minmax(0,1fr))}
.game-screen[data-layout] .stats-row[data-fit=list]{grid-template-columns:minmax(0,1fr)}.game-screen .stats-row[data-fit=wide] span,.game-screen .stats-row[data-fit=list] span{width:100%;display:flex;align-items:baseline;justify-content:space-between;--minitool-row-gap:5px;--minitool-column-gap:5px;grid-gap:5px;gap:5px}
.game-screen .floor-line{height:44px;margin-bottom:6px}
.game-screen .floor-actions button{min-width:44px;min-height:44px;justify-content:center;padding:8px 5px}

/* A side column releases the full height for the map, including its heading. */
.game-screen[data-layout=side]{--sidebar-width:208px;--game-gutter:0px;flex-direction:row;--minitool-row-gap:12px;--minitool-column-gap:12px;grid-gap:12px;gap:12px;padding:calc(8px + var(--safe-area-inset-top,0px)) calc(8px + var(--safe-area-inset-right,0px)) calc(8px + var(--safe-area-inset-bottom,0px)) calc(8px + var(--safe-area-inset-left,0px));padding:calc(8px + var(--safe-area-inset-top,env(safe-area-inset-top,0px))) calc(8px + var(--safe-area-inset-right,env(safe-area-inset-right,0px))) calc(8px + var(--safe-area-inset-bottom,env(safe-area-inset-bottom,0px))) calc(8px + var(--safe-area-inset-left,env(safe-area-inset-left,0px)))}
.game-screen[data-layout=side]>.game-sidebar{display:flex;flex-direction:column;--minitool-row-gap:10px;--minitool-column-gap:10px;grid-gap:10px;gap:10px;flex:0 0 var(--sidebar-width);width:var(--sidebar-width);min-height:0;overflow:hidden;padding:2px 4px 6px}
.game-screen[data-layout=side] .game-header{height:auto;min-height:44px;margin:0}
.game-screen[data-layout=side] .game-brand{font-size:13px;--minitool-row-gap:6px;--minitool-column-gap:6px;grid-gap:6px;gap:6px}
.game-screen[data-layout=side] .game-brand small{font-size:6px;letter-spacing:1px}
.game-screen[data-layout=side] .brand-bear{width:26px;height:28px;flex-shrink:0}
.game-screen[data-layout=side] .game-header .icon-button{width:44px;height:44px;flex-shrink:0}
.game-screen[data-layout=side] .stats-paper{padding:10px;min-width:0}
.game-screen[data-layout=side] .health-line{--minitool-row-gap:5px;--minitool-column-gap:5px;grid-gap:5px;gap:5px;flex-wrap:wrap}
.game-screen[data-layout=side] .health-line strong{font-size:18px;overflow-wrap:break-word;overflow-wrap:anywhere}
.game-screen[data-layout=side] .level-label>span{display:none}
.game-screen[data-layout=side] .stats-row{margin-top:8px;grid-template-columns:repeat(2,minmax(0,1fr));--minitool-row-gap:8px;--minitool-column-gap:8px;grid-gap:8px;gap:8px}
.game-screen[data-layout=side] .stats-row>div{--minitool-row-gap:5px;--minitool-column-gap:5px;grid-gap:5px;gap:5px;min-width:0}
.game-screen[data-layout=side] .stats-row i{width:16px;flex-shrink:0}
.game-screen[data-layout=side] .stats-row span{min-width:0}
.game-screen[data-layout=side] .stats-row strong{font-size:13px}
.game-screen[data-layout=side] .floor-line{order:2;flex-shrink:0;flex-wrap:wrap;--minitool-row-gap:4px;--minitool-column-gap:4px;grid-gap:4px;gap:4px;height:auto;margin:0;align-items:center}
.game-screen[data-layout=side] .floor-line h2{width:100%;font-size:13px}
.game-screen[data-layout=side] .floor-actions{width:100%;justify-content:space-between}
.game-screen[data-layout=side] .floor-actions button{min-width:64px;min-height:44px;justify-content:center;padding:6px}
.game-screen[data-layout=side] .feedback-host{order:3;flex-shrink:0}
.game-screen[data-layout=side] .bottom-nav{margin-top:auto;padding:6px 1px 3px;grid-template-columns:repeat(2,minmax(0,1fr));--minitool-row-gap:8px;--minitool-column-gap:8px;grid-gap:8px;gap:8px}
.game-screen[data-layout=side] .bottom-nav button{min-height:48px}
.game-screen[data-layout=side]>.map-region{min-width:0;min-height:0;align-self:stretch;margin:0;justify-content:center}
.game-screen[data-layout=side] .supplies-row,.game-screen[data-layout=side] .supplies-summary{max-width:calc(calc(var(--minitool-container-height,100vh) * 1.0) - var(--map-heading-height));max-width:calc(100cqh - var(--map-heading-height))}
/* Keys stay readable beside the map; the card shrinks before the tools could be clipped. */
.side-supplies{display:none}
.game-screen[data-layout=side] .side-supplies{order:3;display:flex;flex-direction:column;--minitool-row-gap:7px;--minitool-column-gap:7px;grid-gap:7px;gap:7px;flex-shrink:0;padding:8px 10px;border:1px solid #d7dcce;border-radius:8px 7px 9px 8px;background:#fffef9b3}
.game-screen[data-layout=side][data-side-supplies=hidden] .side-supplies{display:none}
.game-screen[data-layout=side][data-side-supplies=compact] .side-supplies{padding:4px 8px}
.game-screen[data-layout=side][data-side-supplies=compact] .side-equipment{display:none}
.side-keys{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));--minitool-row-gap:4px;--minitool-column-gap:4px;grid-gap:4px;gap:4px}
.side-key{display:flex;align-items:center;--minitool-row-gap:3px;--minitool-column-gap:3px;grid-gap:3px;gap:3px;min-width:0;font-size:9px;color:#707b65}
.side-key img{width:18px;height:21px;object-fit:contain;flex-shrink:0}
.side-key b{font-size:14px;font-weight:650;color:var(--ink);font-variant-numeric:tabular-nums;overflow-wrap:break-word;overflow-wrap:anywhere;min-width:0}
.side-equipment{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));--minitool-row-gap:6px;--minitool-column-gap:6px;grid-gap:6px;gap:6px;padding-top:7px;border-top:1px dashed #d7dcce}
.side-equip{display:flex;align-items:center;--minitool-row-gap:5px;--minitool-column-gap:5px;grid-gap:5px;gap:5px;min-width:0;font-size:10px;color:#5d6852;line-height:1.3}
.side-equip img{width:24px;height:24px;object-fit:contain;flex-shrink:0}
.side-equip span{min-width:0;overflow-wrap:break-word;overflow-wrap:anywhere}
.side-equip.vacant{color:#9aa18f}
.side-equip.vacant svg{width:20px;height:20px;padding:2px;border:1px dashed #c3c9b8;border-radius:5px;color:#a7ae9c;flex-shrink:0}
@media(max-height:450px){.side-key img{width:15px;height:18px}.side-key b{font-size:12px}}
@media(min-width:1200px) and (min-height:600px){.game-screen[data-layout=side]{--sidebar-width:224px}}
@media(max-height:450px){
  .game-screen[data-layout=side]>.game-sidebar{--minitool-row-gap:6px;--minitool-column-gap:6px;grid-gap:6px;gap:6px}
  .game-screen[data-layout=side] .stats-paper{padding:6px 8px}
  .game-screen[data-layout=side] .stats-row{margin-top:5px;grid-template-columns:repeat(4,minmax(0,1fr));--minitool-row-gap:5px;--minitool-column-gap:5px;grid-gap:5px;gap:5px}
  .game-screen[data-layout=side] .stats-row i{display:none}
  .game-screen[data-layout=side] .stats-row strong{font-size:12px}
  .game-screen[data-layout=side] .floor-line{flex-wrap:nowrap}
  .game-screen[data-layout=side] .floor-line h2{width:auto;min-width:0;font-size:11px}
  .game-screen[data-layout=side] .floor-actions{width:auto;flex-shrink:0;--minitool-row-gap:4px!important;--minitool-column-gap:4px!important;grid-gap:4px!important;gap:4px!important}
  .game-screen[data-layout=side] .floor-actions button{min-width:44px;padding:3px;font-size:9px}
  .game-screen[data-layout=side] .bottom-nav{grid-template-columns:repeat(4,minmax(0,1fr));--minitool-row-gap:4px;--minitool-column-gap:4px;grid-gap:4px;gap:4px}
  .game-screen[data-layout=side] .bottom-nav button{font-size:9px;min-width:44px;min-height:48px;padding-left:0;padding-right:0;padding-inline:0}
}
@media(max-height:360px){
  .game-screen[data-layout=side]{--sidebar-width:clamp(208px,calc(100vw - 100dvh - 12px),320px)}
  .game-screen[data-layout=side]>.game-sidebar{position:relative;--minitool-row-gap:3px;--minitool-column-gap:3px;grid-gap:3px;gap:3px;padding:0 4px}
  .game-screen[data-layout=side] .game-header{display:none}
  .game-screen[data-layout=side] .stats-paper{padding:4px 7px}
  .game-screen[data-layout=side] .stats-row{margin-top:4px;--minitool-row-gap:4px;--minitool-column-gap:8px;grid-gap:4px 8px;gap:4px 8px}
  .game-screen[data-layout=side] .floor-line{order:-1;min-height:44px}
  .game-screen[data-layout=side] .floor-actions button{min-height:44px}
  .game-screen[data-layout=side] .bottom-nav{padding:2px 1px}
  .game-screen[data-layout=side] .bottom-nav button{min-height:44px;--minitool-row-gap:3px;--minitool-column-gap:3px;grid-gap:3px;gap:3px}
}

/* Keep the speaker beside their name without taking a row away from choices. */
.modal-heading{min-width:0}
.interaction-sheet .modal-header{justify-content:flex-start;--minitool-row-gap:14px;--minitool-column-gap:14px;grid-gap:14px;gap:14px;margin-bottom:16px;flex-shrink:0}
.interaction-sheet .modal-header h2{overflow-wrap:break-word;overflow-wrap:anywhere}
.speaker-portrait{display:block;width:72px;height:72px;object-fit:contain;flex-shrink:0}
.animations-paused *,.animations-paused *:before,.animations-paused *:after{animation-play-state:paused!important}
.speaker-detail{margin:6px 0 0;font-size:11px;line-height:1.6;color:#8a947f}.interaction-sheet> .dialogue-text,.interaction-sheet> .dialogue-footer,.interaction-sheet> .panel-intro,.interaction-sheet> .panel-list{flex-shrink:0}
.choice-sheet .panel-intro{white-space:pre-line;margin-bottom:14px}
.choice-sheet .panel-list{--minitool-row-gap:10px;--minitool-column-gap:10px;grid-gap:10px;gap:10px}
.choice-sheet .option-button{margin:0;padding:12px 14px;min-height:48px}
.shop-sheet .speaker-portrait{width:52px;height:52px}
.shop-sheet .close-button{margin-left:auto}
@media(max-width:360px){.interaction-sheet{padding-left:18px;padding-right:18px;padding-inline:18px}.interaction-sheet .modal-header{--minitool-row-gap:12px;--minitool-column-gap:12px;grid-gap:12px;gap:12px}.dialogue-sheet .speaker-portrait{width:64px;height:64px}}

/* The original duel layout: enemy on the left, hero on the right. */
.battle-backdrop{align-items:center;padding:16px;background:#242e2460;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}
.battle-sheet{width:100%;width:min(420px,100%);max-height:92vh;max-height:calc(var(--minitool-vh,1vh) * 92);max-height:92dvh;border:1.5px solid #75806b;border-radius:13px 16px 12px 15px;padding:20px 20px 17px;box-shadow:5px 6px 0 #303c2b35;overflow:auto;background:#fbfaf3;animation:combat-enter .2s ease}
.battle-sheet:before{display:none}
.battle-sheet:focus{outline:none}
.battle-sheet .modal-header{justify-content:center;margin:0 0 19px;border-bottom:1px dashed #cbd1bd;padding-bottom:14px}
.battle-sheet .modal-header h2{font-size:16px;letter-spacing:6px;padding-left:6px}
.combat-arena{display:grid;grid-template-columns:minmax(0,1fr) 42px minmax(0,1fr);--minitool-row-gap:6px;--minitool-column-gap:6px;grid-gap:6px;gap:6px;align-items:center}
.combatant{min-width:0;text-align:center}
.combatant h3{font-size:13px;line-height:1.4;min-height:19px;margin:0 0 11px;color:#4f5948;overflow-wrap:break-word;overflow-wrap:anywhere}
.combat-portrait{position:relative;height:106px;display:flex;justify-content:center;align-items:center;background:radial-gradient(ellipse at 50% 65%,#ecebdc 0%,#f2f1e644 58%,transparent 70%);isolation:isolate}
.combat-portrait:after{content:"";position:absolute;width:76px;height:10px;left:50%;bottom:4px;transform:translateX(-50%);background:#a4a88e22;border-radius:50%;z-index:-1}.combat-portrait img,.combat-portrait canvas{display:block;width:96px;height:96px;object-fit:contain;transform-origin:center 80%}
.combat-versus{align-self:start;padding-top:66px;color:#9b977f;text-align:center}
.combat-versus span{font-family:Georgia,serif;font-size:22px;font-style:italic;letter-spacing:-2px}
.combat-versus i{display:block;font-size:18px;font-style:normal;margin-top:8px;color:#bcb9a4}
.combat-health-track{height:6px;border-radius:3px;background:#e8e7db;margin:12px 0 11px;overflow:hidden}
.combat-health-track>div{height:100%;width:100%;border-radius:3px;background:#c57866;transition:width .17s linear}
.hero .combat-health-track>div{background:#78976b}
.combat-stats{margin:0;padding:0 3px;display:grid;--minitool-row-gap:7px;--minitool-column-gap:7px;grid-gap:7px;gap:7px}
.combat-stats>div{display:flex;justify-content:space-between;align-items:center;--minitool-row-gap:5px;--minitool-column-gap:5px;grid-gap:5px;gap:5px}
.combat-stats dt{font-size:11px;color:#8a907e}
.combat-stats dd{margin:0;font-size:15px;font-weight:650;font-variant-numeric:tabular-nums;letter-spacing:.2px}
.combat-stats>div:first-child dd{color:#9e5b4e}
.hero .combat-stats>div:first-child dd{color:#5c7e50}
.combat-damage{position:absolute;z-index:3;top:13px;left:50%;width:max-content;transform:translateX(-50%);font-size:18px;font-weight:850;color:#ad4c3d;text-shadow:0 2px #fffef7,1px 0 #fffef7,-1px 0 #fffef7;opacity:0;pointer-events:none}
.combat-hit{position:absolute;z-index:2;left:50%;top:46%;width:65px;height:4px;background:#f6e3a2;border-radius:50%;box-shadow:0 0 0 1px #b99a50,0 0 13px #f0d58b;transform:translate(-50%,-50%) rotate(-42deg);opacity:0;pointer-events:none}
.combat-hit:after{content:"";position:absolute;left:50%;width:41px;height:3px;background:inherit;transform:translateX(-50%) rotate(84deg);box-shadow:0 0 0 1px #b99a50;border-radius:50%}
.taking-hit .combat-damage{animation:combat-damage .38s ease-out both}
.taking-hit .combat-hit{animation:combat-slash .25s ease-out}.taking-hit .combat-portrait img,.taking-hit .combat-portrait canvas{animation:combat-hurt .24s ease-out}.hero.attacking .combat-portrait img,.hero.attacking .combat-portrait canvas{animation:combat-hero-strike .27s ease-out}.enemy.attacking .combat-portrait img,.enemy.attacking .combat-portrait canvas{animation:combat-enemy-strike .27s ease-out}
.critical-hit .combat-damage{color:#ba7521;font-size:20px}
.battle-caption{display:flex;flex-direction:column;align-items:center;--minitool-row-gap:6px;--minitool-column-gap:6px;grid-gap:6px;gap:6px;min-height:66px;margin-top:17px;padding:12px 0 9px;border-top:1px dashed #cbd1bd}
.battle-status{font-size:13px;color:#626e54;font-weight:600;text-align:center}
.battle-round{font-size:10px;color:#959980;font-variant-numeric:tabular-nums}
.battle-reward{display:flex;justify-content:center;--minitool-row-gap:14px;--minitool-column-gap:14px;grid-gap:14px;gap:14px;font-size:11px;color:#a08448;padding:10px 5px;background:#efeddf;border-radius:6px}
.battle-reward span{color:#c0b999}
.battle-won .battle-status{font-size:20px;letter-spacing:5px;color:#697e43}.battle-won .enemy .combat-portrait img,.battle-won .enemy .combat-portrait canvas{opacity:.3;transform:translateY(3px);transition:opacity .3s}
.battle-won .battle-reward{background:#e9edd9;color:#6c8050}
.damage-pill .damage-reason{margin:4px 0 0;opacity:1}
@keyframes combat-enter{from{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}
@keyframes combat-hero-strike{0%,100%{transform:translateX(0) rotate(0)}40%{transform:translateX(-13px) rotate(-8deg)}}
@keyframes combat-enemy-strike{0%,100%{transform:translateX(0) rotate(0)}40%{transform:translateX(13px) rotate(8deg)}}
@keyframes combat-hurt{0%,100%{transform:translateX(0)}25%{transform:translateX(-4px)}50%{transform:translateX(4px);filter:brightness(1.3)}75%{transform:translateX(-2px)}}
@keyframes combat-slash{0%{opacity:0;transform:translate(-50%,-50%) rotate(-42deg) scale(.2)}30%{opacity:1}100%{opacity:0;transform:translate(-50%,-50%) rotate(-42deg) scale(1.15)}}
@keyframes combat-damage{0%{opacity:0;transform:translate(-50%,6px) scale(.8)}25%{opacity:1;transform:translate(-50%,-1px) scale(1.06)}85%{opacity:1}100%{opacity:0;transform:translate(-50%,-17px) scale(1)}}
@media(max-width:360px){.battle-sheet{padding:17px 15px 14px}.combat-arena{grid-template-columns:minmax(0,1fr) 30px minmax(0,1fr);--minitool-row-gap:5px;--minitool-column-gap:5px;grid-gap:5px;gap:5px}.combat-portrait,.combat-portrait img,.combat-portrait canvas{height:84px}.combat-portrait img,.combat-portrait canvas{width:84px}.combat-versus{padding-top:56px}.combat-stats dd{font-size:13px}.combatant h3{font-size:12px}}
@media(prefers-reduced-motion:reduce){.taking-hit .combat-damage{opacity:1}.taking-hit .combat-hit{display:none}}
