:root{color-scheme:dark;--ink:#0a1525;--gold:#e3bd73;--text:#f0e6ce;--muted:#9eb8c3;--panel:rgba(9,23,40,.97)}*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#080e1b;color:var(--text);font-family:Georgia,serif}body{display:flex;flex-direction:column;align-items:center;justify-content:center}#game{position:relative;width:min(100vw,calc((100vh - 42px)*16/9));aspect-ratio:16/9;outline:none;background:#102437;overflow:hidden;box-shadow:0 15px 80px #000}canvas{width:100%;height:100%;image-rendering:pixelated;display:block}#ui{position:absolute;inset:0;pointer-events:none;font-size:clamp(14px,1.8vw,22px)}#ui>*{pointer-events:auto}button{font:inherit;color:inherit;border:0;cursor:pointer;background:none;text-align:left}button:focus-visible{outline:2px solid var(--gold);outline-offset:2px}button:disabled{color:#647786;cursor:default}.panel{background:var(--panel);border:1px solid #9a9872;box-shadow:inset 0 0 0 3px #15283b,0 8px 25px #0007;padding:20px}.eyebrow{font:11px monospace;letter-spacing:4px;color:var(--gold);text-transform:uppercase}.title{position:absolute;inset:0;display:flex;align-items:center;flex-direction:column;padding-top:8%;background:linear-gradient(180deg,#06122540,transparent 40%,#050d1fd9)}.title h1{font-size:clamp(42px,7vw,94px);font-weight:normal;letter-spacing:.19em;margin:0 0 0 .19em;text-shadow:0 4px 0 #112534,0 2px 35px #000}.title .subtitle{color:var(--gold);font:clamp(12px,1.3vw,18px) monospace;letter-spacing:.5em;margin-top:8px}.title .choices{margin-top:auto;margin-bottom:4%;min-width:230px}.choices{display:flex;flex-direction:column;gap:4px}.choices button{padding:8px 15px;border:1px solid transparent;position:relative}.choices button.selected,.choices button:hover:not(:disabled){border-color:#e3bd7370;background:#75919c22;color:#ffe6a4}.choices button.selected:before{content:'▸';position:absolute;left:0;color:var(--gold)}small,.muted{color:var(--muted);font:13px/1.5 monospace}.hud{position:absolute;top:12px;left:14px;right:14px;display:flex;justify-content:space-between;gap:15px;pointer-events:none!important;text-shadow:0 2px 3px #000}.location{background:#071724d9;border-left:2px solid var(--gold);padding:9px 13px}.location small{display:block;font-size:11px;margin-top:5px}.hint{position:absolute;bottom:16px;left:50%;transform:translateX(-50%);background:#071724dc;padding:7px 14px;font:13px monospace;white-space:nowrap;border:1px solid #76989777}.dialogue{position:absolute;left:3%;right:3%;bottom:4%;min-height:28%;display:grid;grid-template-columns:72px 1fr;gap:20px}.portrait{width:72px;height:88px;image-rendering:pixelated;object-fit:contain;background:#243344;border:1px solid #70818b}.speaker{font:13px monospace;color:var(--gold);letter-spacing:2px;margin:0 0 9px}.speech{font-size:clamp(16px,2vw,24px);line-height:1.45;white-space:pre-wrap;margin:0}.advance{position:absolute;bottom:8px;right:14px;font:11px monospace;color:var(--gold)}.modal{position:absolute;inset:7% 12%;overflow:auto}.modal h2{font-weight:normal;font-size:28px;margin:0 0 14px;color:var(--gold)}.modal p{line-height:1.5;margin:8px 0}.modal .choices button{font-size:18px}.modal.narrow{inset:14% 25%}.bottom-help{margin-top:15px;border-top:1px solid #64808c55;padding-top:10px;font:12px monospace;color:var(--muted)}.columns{display:grid;grid-template-columns:1fr 1fr;gap:20px}.stat{font:13px/1.6 monospace;color:var(--muted)}.bar{height:5px;background:#203249;margin-top:4px;width:100%;overflow:hidden}.bar i{display:block;height:100%;background:#71bdab}.bar.mp i{background:#92a9e4}.party-card{display:flex;gap:12px;padding:10px;border-bottom:1px solid #5f778644}.party-card img{width:32px;height:48px;image-rendering:pixelated}.party-card strong{font-size:18px}.battle-top{position:absolute;top:12px;left:3%;right:3%;padding:10px 15px;background:#091728da;font:13px monospace;color:var(--gold)}.battle-bottom{position:absolute;bottom:3%;left:3%;right:3%;display:grid;grid-template-columns:1.25fr 1fr;gap:10px}.battle-bottom .panel{padding:10px 15px}.battle-bottom .choices{display:grid;grid-template-columns:1fr 1fr;gap:0}.battle-bottom .choices button{font-size:16px;padding:6px 14px}.battle-party{display:grid;grid-template-columns:1fr 1fr;gap:8px;font:12px monospace}.battle-party .active{color:var(--gold)}.battle-log{grid-column:1/-1;font:12px/1.5 monospace;color:var(--muted);min-height:38px}.scrolltext{max-height:55vh;overflow:auto;font-size:17px}.objective{font-size:17px;line-height:1.5;border-left:2px solid var(--gold);padding-left:14px;margin:15px 0}.row-meta{font:11px monospace;color:var(--muted);display:block;margin-top:4px}.chapter{position:absolute;inset:0;background:#070e1df4;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}.chapter h2{font-size:clamp(28px,4vw,50px);font-weight:normal;margin:20px}.chapter p{max-width:65%;line-height:1.6}.chapter button{border-bottom:1px solid var(--gold);margin-top:15px;padding:10px}.journal-list{display:flex;gap:8px;margin:12px 0;flex-wrap:wrap}.chip{font:12px monospace;border:1px solid #5a7585;padding:5px 8px}.enemy-label{position:absolute;color:#ffe4a4;font:11px monospace;background:#071422d9;padding:4px;text-align:center;pointer-events:none!important}.enemy-label .bar{min-width:65px}#toast{position:absolute;top:14%;left:50%;transform:translateX(-50%);background:#0d2338ee;border:1px solid var(--gold);padding:10px 18px;font:14px monospace;opacity:0;transition:opacity .15s;pointer-events:none;z-index:10;max-width:85%}#toast.on{opacity:1}footer{width:min(100vw,calc((100vh - 42px)*16/9));height:40px;display:flex;justify-content:space-between;align-items:center;font:10px monospace;color:#819ba8;gap:15px;padding:0 12px}footer i{font-style:normal;letter-spacing:2px;margin-left:10px;color:#c4a878}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}@media(max-width:750px){footer span:last-child{display:none}.panel{padding:12px}.modal{inset:3% 5%}.modal.narrow{inset:8% 15%}.modal h2{font-size:22px}.modal .choices button{font-size:14px;padding:5px 14px}.dialogue{grid-template-columns:44px 1fr;gap:12px}.portrait{width:44px;height:58px}.speech{font-size:14px}.battle-bottom .choices button{font-size:12px}.battle-party,.battle-log{font-size:10px}.columns{gap:10px}.title .choices{margin-bottom:2%}.title .choices button{padding:4px 14px}.location{padding:5px 9px}.location small{font-size:9px}.hud{top:6px}.scrolltext{font-size:14px}.eyebrow{font-size:9px}}

.battle-bottom .speaker{letter-spacing:.5px;font-size:12px;line-height:1.35;margin-bottom:6px}.battle-bottom .choices button{line-height:1.25}.enemy-label{max-width:36%;}.battle-top{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* Native game windows: silver stepped frames and a saturated indigo fill. */
:root{--ink:#111535;--gold:#f5e3a9;--text:#fff4d7;--muted:#bbc4e0;--panel:#19265c}html,body,button{font-family:monospace}.panel{border:3px solid #dedbd2;border-radius:2px;box-shadow:inset 0 0 0 2px #5b6282,0 0 0 2px #282339;padding:16px;background:linear-gradient(#273a7a,#141b49)}.title .eyebrow{display:none}.title h1{font-family:Georgia,serif;font-weight:bold;text-shadow:2px 2px #30233c,4px 4px #151629;letter-spacing:.1em}.title .subtitle{color:#f5e3bd;letter-spacing:.22em}.title{background:linear-gradient(180deg,#10112740,transparent 45%,#101127b0)}.title .choices{min-width:250px}.choices button.selected,.choices button:hover:not(:disabled){background:#435296;border-color:transparent;color:#fff5ce}.location{background:#182552df;border:2px solid #b1b4c6;padding:5px 9px}.hud{opacity:.94}.hint{background:#182552ed;border:2px solid #b1b4c6}.bar i{background:#91cb50}.speaker{color:#ffe4a4;letter-spacing:0}.eyebrow{letter-spacing:1px}.portrait{background:#282b60;border:2px solid #b1b4c6}.dialogue{gap:14px}.speech{font-family:monospace;font-size:clamp(14px,1.6vw,21px);line-height:1.4}.modal h2{font-family:monospace;font-size:23px}.modal .choices button{font-size:16px}.battle-top,.enemy-label{background:#1e285de8;color:#fff1c7}.battle-bottom{gap:6px}.battle-bottom .panel{padding:8px 12px}.title .choices button{font-size:18px}.location small{color:#d3d3df}button:disabled{color:#8489a4}

.mechanism-state{white-space:pre-wrap;font:14px/1.5 monospace;color:#d6dbec}.mechanism-grid{display:grid;max-width:430px;margin:12px auto;gap:2px}.mechanism-grid span{min-width:20px;min-height:26px;text-align:center;background:#101632;padding:3px}.mechanism-grid .lit{background:#776126;color:#fff4ad}.mechanism-grid .danger{background:#82363e}.mechanism-grid small,.cargo-row small{display:block}.tanks,.cargo-row,.heat-gauges{display:flex;gap:14px;justify-content:center;margin:16px 0}.tank{height:80px;width:70px;border:3px solid #b7bdcd;position:relative;background:#10152e}.tank i{position:absolute;bottom:0;left:0;right:0;background:#467fac}.tank b{position:absolute;inset:0;display:grid;place-items:center;color:white}.cargo-row span{border:2px solid #c6a66a;padding:10px;font-size:13px;background:#624933}.puzzle-feedback{color:#ffdc83}.heat-gauges label{display:flex;flex-direction:column}

.spatial-help{position:absolute;bottom:2%;left:3%;right:3%;padding:9px;font:12px/1.35 monospace}.spatial-help p{margin:2px 0}.spatial-help button{border:1px solid #b1b9cf;padding:4px 12px;margin:3px 4px 0 0;font-size:12px}

/* Keep the entire combat stage visible at compact browser sizes. */
.battle-bottom{height:39%;grid-template-rows:minmax(0,1fr) 28px}.battle-bottom .panel{min-height:0;padding:5px 9px}.battle-bottom .speaker{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:clamp(10px,1.25vw,14px);margin:0 0 3px}.battle-bottom .choices button{font-size:clamp(10px,1.25vw,16px);padding:3px 10px;line-height:1.15}.battle-log{min-height:0;font-size:clamp(9px,1vw,12px);line-height:1.2;overflow:hidden}.battle-bottom .battle-log{padding:2px 8px}.battle-party{align-content:start}.battle-party>div{min-width:0}
.mechanism-modal{inset:3% 5%;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr) auto;gap:5px 14px;overflow:hidden}.mechanism-modal>.eyebrow,.mechanism-modal>h2,.mechanism-modal>.bottom-help{grid-column:1/-1}.mechanism-modal>h2{font-size:clamp(14px,1.8vw,23px);margin:0}.mechanism-modal .mechanism-description,.mechanism-modal>.choices{overflow:auto;min-height:0}.mechanism-modal .choices{display:block}.mechanism-modal .choices button{display:block;width:100%;font-size:clamp(11px,1.3vw,16px);padding:5px 10px}.mechanism-modal p,.mechanism-modal .objective,.mechanism-modal .mechanism-state{font-size:clamp(11px,1.2vw,14px);line-height:1.35;margin:4px 0}.mechanism-modal .objective{padding-left:7px}.mechanism-modal .tanks{gap:6px;margin:10px 0}.mechanism-modal .tank{width:44px;height:52px}.mechanism-modal small{font-size:10px}.mechanism-modal .bottom-help{margin:2px 0 0;padding-top:4px;font-size:10px}.mechanism-modal .mechanism-grid{gap:1px;margin:6px 0}.mechanism-modal .mechanism-grid span{min-width:0;min-height:16px;padding:1px;font-size:11px}.mechanism-modal .cargo-row{flex-wrap:wrap;gap:3px;margin:6px 0}.mechanism-modal .cargo-row span{padding:4px;font-size:10px}

#game{container-type:inline-size}
/* Company windows: portraits and gauges carry the overview; prose lives in details. */
.menu-sheet{position:absolute;top:4%;bottom:4%;left:6%;right:6%;display:flex;flex-direction:column;padding:14px 18px;overflow:hidden;font-size:17px;text-shadow:1px 1px #0c1536}
.sheet-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:0 0 12px;border-bottom:2px solid #6676a0;flex-shrink:0}
.sheet-heading h2{font:inherit;font-weight:bold;font-size:26px;color:#fff2c8;margin:0}
.sheet-heading>span{color:#c9d0e8;font-size:12px;text-align:right}
.sheet-body{display:flex;flex:1;min-height:0;gap:18px;padding:14px 0}
.sheet-choices{flex:0 0 36%;min-width:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#8393be #18224f;gap:4px;padding:2px 5px 2px 2px}
.sheet-detail{flex:1;min-width:0;min-height:0;overflow:auto;scrollbar-width:thin;padding:4px 2px 4px 18px;border-left:2px solid #6676a0}
.sheet-choices button{display:block;width:100%;font-size:17px;line-height:1.3;padding:10px 12px;flex-shrink:0;min-width:0}
.sheet-choices button.selected{box-shadow:inset 0 0 0 1px #94a5d0;background:#394d88}
.sheet-choices button.selected:before{left:1px;color:#fff5d8}
.sheet-choices button:disabled{opacity:.53;color:#c9cce1}
.sheet-choices button:focus-visible{outline:2px solid #ffe5a0;outline-offset:-2px}
.sheet-footer{width:auto;height:auto;min-height:25px;flex-shrink:0;display:flex;justify-content:space-between;align-items:center;gap:10px;margin:0;padding:8px 0 0;border-top:2px solid #6676a0;font:11px/1.4 monospace;color:#bbc6e3}
.sheet-footer span{display:block!important}
.sheet-footer span:last-child{text-align:right}
.menu-sheet small{font:inherit;font-size:11px;color:#c1cbe2;letter-spacing:0}
.menu-sheet b,.menu-sheet strong{font-weight:normal;color:#fff4d7}
.menu-portrait{width:72px;height:87px;object-fit:contain;image-rendering:pixelated;background:#25334d;border:2px solid #a1aac5;box-shadow:2px 2px #101839;flex-shrink:0}
.hero-summary{display:flex;gap:14px;align-items:center;min-width:0;position:relative}
.hero-summary-copy{display:block;flex:1;min-width:0}
.hero-name{display:flex;align-items:baseline;justify-content:space-between;gap:8px;font-size:20px;color:#fff2c8}
.hero-name small{white-space:nowrap}
.hero-role{display:block;font-size:11px;line-height:1.3;color:#c6cee4;margin:3px 0 9px}
.hero-tag{display:block;font-size:10px;color:#e6ce85;margin:7px 0 0;text-transform:uppercase;letter-spacing:1px}
.resource{display:block;margin:5px 0 0;font-size:12px}
.resource-numbers{display:flex;justify-content:space-between;align-items:baseline;gap:6px;line-height:1.1}
.resource-numbers>span:first-child{font-size:10px;color:#b6c0dc}
.resource-numbers small{font-size:10px}
.resource-track{display:block;height:6px;background:#0d1638;border:1px solid #070d24;margin-top:4px;box-shadow:0 1px #52658e;overflow:hidden}
.resource-track i{display:block;height:100%;background:#a3c65b;border-top:1px solid #d9e99f}
.mp .resource-track i{background:#759bd6;border-color:#c6d9f5}
.low .resource-track i{background:#c06d59;border-color:#efbd8d}
.company-roster{display:grid;grid-template-columns:1fr 1fr;gap:22px 20px;align-content:start;padding:2px}
.company-roster>.hero-summary{display:block}
.company-roster .menu-portrait{float:left;margin:0 12px 8px 0;width:64px;height:78px}
.company-roster .hero-summary-copy{display:contents}
.company-roster .hero-name{font-size:18px;display:block}
.company-roster .hero-name small{display:block;margin-top:4px}
.company-roster .hero-role{min-height:28px;margin:5px 0}
.company-roster .resource{clear:both}
.sheet-company .sheet-choices{flex-basis:31%}
.sheet-party .sheet-choices{flex:1;display:grid;grid-template-columns:1fr 1fr;grid-auto-rows:max-content;align-content:start;gap:10px 12px}
.sheet-party .sheet-choices button{padding:12px 14px;background:#15224d;border:1px solid #7582a2}
.sheet-party .sheet-choices button.selected{background:#354b85;border-color:#e6dcae}
.sheet-party .sheet-choices .secondary-choice{grid-column:1/-1;padding:7px 14px;background:transparent;border-color:transparent}
.sheet-party .sheet-choices .secondary-choice.selected{border-color:#94a5d0}
.sheet-party .hero-summary{gap:12px}
.sheet-party .hero-name{font-size:18px}
.sheet-party .hero-role{margin-bottom:7px}
.sheet-status .sheet-choices{flex-basis:29%}
.status-content>.hero-summary{max-width:430px;margin:0 0 20px}
.status-content>.hero-summary .menu-portrait{width:96px;height:116px}
.status-content>.hero-summary .hero-name{font-size:26px}
.status-content .hero-role{font-size:13px}
.stat-tiles{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:12px 0}
.stat-tiles>div{background:#131d45;border:1px solid #64749a;padding:9px 6px;text-align:center}
.stat-tiles>div>span{display:block;font-size:10px;text-transform:uppercase;letter-spacing:1px;color:#bac8e4}
.stat-tiles strong{display:block;font-size:22px;margin:5px 0}
.stat-tiles strong small{font-size:11px}
.stat-tiles .stat-change{display:block;font-size:12px}
.menu-sheet .gain{color:#c0dc80}
.menu-sheet .loss{color:#f0ad8d}
.menu-sheet .neutral{color:#b5bedb}
.experience{font-size:11px;color:#c5cde1;margin:12px 0 16px}
.experience .resource-track i{background:#c6a962;border-color:#eee0a6}
.worn-gear{display:flex;flex-direction:column;gap:7px}
.worn-piece{display:flex;align-items:center;gap:10px;padding:7px 0;border-top:1px solid #51658d}
.worn-piece span{display:flex;flex-direction:column;gap:3px;font-size:13px}
.worn-piece small{font-size:10px}
.menu-icon{display:block;width:28px;height:28px;flex-shrink:0;fill:#dcc78e;filter:drop-shadow(2px 2px #0b1532)}
.icon-tonic{fill:#d59871}.icon-tea{fill:#cab283}.icon-salve{fill:#c1d387}.icon-revive{fill:#c3badb}.icon-feast{fill:#d5b068}.icon-weapon{fill:#c6d4e0}.icon-armor{fill:#92b0c6}
.item-row{display:flex;gap:12px;align-items:center;width:100%;min-width:0}
.item-row>span{display:block;flex:1;min-width:0}
.item-row b{display:block;font-size:18px;line-height:1.35;overflow-wrap:break-word}
.item-row small{display:block;font-size:12px;margin-top:5px}
.item-count{font-size:20px;white-space:nowrap}
.item-row>.stat-change{font-size:11px;white-space:nowrap}
.sheet-inventory .sheet-choices,.sheet-equipment .sheet-choices{flex-basis:51%}
.sheet-inventory .sheet-choices button,.sheet-equipment .sheet-choices button{padding:14px 12px}
.sheet-inventory .sheet-choices .secondary-choice,.sheet-equipment .sheet-choices .secondary-choice{padding:9px 12px}
.item-detail{display:flex;flex-direction:column;align-items:flex-start;min-height:100%;padding:4px 4px 8px}
.item-detail>.menu-icon{width:56px;height:56px;margin:7px 0 20px}
.item-detail h3{font-size:22px;line-height:1.4;margin:8px 0 14px;color:#fff2c8}
.detail-type{font-size:10px;color:#c3cde5;text-transform:uppercase;letter-spacing:1px}
.item-effect{font-size:17px;line-height:1.5;padding:7px 0;border-top:1px solid #62749b;border-bottom:1px solid #62749b;width:100%}
.item-detail p{font-size:14px;line-height:1.6;color:#d4d8e7;margin:14px 0}
.detail-foot{margin-top:auto;padding-top:16px;color:#b8c4df;font-size:10px;line-height:1.5}
.equipment-detail .stat-tiles{width:100%;gap:4px;margin:4px 0}
.equipment-detail .stat-tiles>div{padding:8px 3px}
.equipment-detail .stat-tiles strong{font-size:15px;white-space:nowrap}
.equipment-detail .stat-tiles>div>span{letter-spacing:0;font-size:10px}
.sheet-abilities .sheet-choices,.sheet-biography .sheet-choices{flex-basis:20%}
.ability-list{display:flex;flex-direction:column;gap:14px}
.ability-row{display:flex;gap:12px;align-items:flex-start;border-bottom:1px solid #6676a0;padding:8px 0 16px}
.ability-row>span{flex:1;min-width:0}
.ability-row b{font-size:15px}
.ability-row small{display:block;font-size:11px;line-height:1.5;margin-top:6px}
.ability-row>strong{font-size:17px;white-space:nowrap}.ability-row>strong small{display:inline;font-size:10px}
.ability-row.unlearned{opacity:.48}
.hero-biography{display:flex;gap:20px;align-items:flex-start}.hero-biography p{font-size:14px;line-height:1.7;margin:0}
.sheet-inventory .sheet-choices button,.sheet-equipment .sheet-choices button{min-height:68px}.sheet-inventory .sheet-choices .secondary-choice,.sheet-equipment .sheet-choices .secondary-choice{min-height:36px}
@container(max-width:1000px){
 .menu-sheet{top:3%;bottom:3%;left:4%;right:4%;padding:10px 12px}
 .sheet-heading{padding-bottom:8px}.sheet-heading h2{font-size:18px}.sheet-heading>span{font-size:10px}
 .sheet-body{padding:9px 0;gap:12px}.sheet-detail{padding-left:12px}.sheet-choices button{font-size:12px;padding:7px 10px}
 .sheet-footer{font-size:9px;padding-top:6px;min-height:20px}.sheet-footer span{font-size:9px}
 .menu-portrait{width:48px;height:58px}.hero-summary{gap:10px}.hero-name,.sheet-party .hero-name{font-size:15px}.hero-name small{font-size:10px}
 .hero-role{font-size:9px;margin:3px 0 5px}.hero-tag{font-size:9px;margin-top:5px}.resource{font-size:11px;margin-top:4px}.resource-track{height:5px;margin-top:3px}
 .sheet-party .sheet-choices{gap:7px}.sheet-party .sheet-choices button{padding:8px 11px}.sheet-party .hero-role{margin-bottom:4px}
 .status-content>.hero-summary{margin-bottom:10px}.status-content>.hero-summary .menu-portrait{width:64px;height:78px}.status-content>.hero-summary .hero-name{font-size:21px}.status-content .hero-role{font-size:10px}
 .stat-tiles{margin:8px 0;gap:5px}.stat-tiles>div{padding:6px}.stat-tiles strong{font-size:18px;margin:4px 0}.experience{margin:8px 0 10px;font-size:10px}
 .worn-piece{padding:5px 0}.worn-piece span{font-size:11px}.worn-gear{gap:5px}
 .company-roster{gap:12px}.company-roster .menu-portrait{width:40px;height:49px;margin-right:9px}.company-roster .hero-name{font-size:13px}.company-roster .hero-role{min-height:23px}
 .menu-icon{width:23px;height:23px}.item-row{gap:9px}.item-row b{font-size:12px}.item-row small{font-size:9px;margin-top:3px}.item-count{font-size:14px}.item-row>.stat-change{font-size:9px}
 .sheet-inventory .sheet-choices button,.sheet-equipment .sheet-choices button{padding:10px;min-height:54px}
 .item-detail>.menu-icon{width:40px;height:40px;margin:3px 0 12px}.item-detail h3{font-size:16px;margin:7px 0 10px}.item-effect{font-size:12px}.item-detail p{font-size:11px;margin:10px 0}.detail-foot{padding-top:10px;font-size:9px}
 .equipment-detail .stat-tiles strong{font-size:13px}.equipment-detail .stat-tiles strong small{font-size:8px}.equipment-detail .stat-tiles>div>span{font-size:8px}
 .ability-list{gap:8px}.ability-row{gap:9px;padding:4px 0 10px}.ability-row b{font-size:12px}.ability-row small{font-size:10px}.hero-biography{gap:12px}.hero-biography p{font-size:12px}
}
@container(max-width:650px){
 .menu-sheet{left:2%;right:2%;padding:7px 9px}.sheet-heading h2{font-size:15px}.sheet-heading>span{font-size:9px}.sheet-body{gap:8px;padding:7px 0}.sheet-detail{padding-left:8px}
 .sheet-footer{gap:5px;font-size:8px}.sheet-footer span{font-size:8px}
 .sheet-party .sheet-choices{gap:5px}.sheet-party .sheet-choices button{padding:7px 9px}.sheet-party .hero-summary{gap:7px}.sheet-party .menu-portrait{width:32px;height:39px}.sheet-party .hero-name{font-size:12px}.sheet-party .hero-role{font-size:8px}.sheet-party .hero-name small{font-size:8px}
 .sheet-choices button{font-size:10px;padding:6px 9px}.hero-tag{font-size:8px}.resource,.resource-numbers small{font-size:9px}.resource-numbers>span:first-child{font-size:8px}
 .item-row b{font-size:10px}.item-row small{font-size:8px}.item-row{gap:6px}.item-count{font-size:11px}.menu-icon{width:18px;height:18px}.item-row>.stat-change{font-size:8px}
 .sheet-inventory .sheet-choices button,.sheet-equipment .sheet-choices button{padding:8px 9px;min-height:44px}
 .item-detail h3{font-size:14px}.item-detail>.menu-icon{width:30px;height:30px;margin-bottom:8px}.item-detail p{font-size:10px}.item-effect{font-size:10px}.detail-type{font-size:8px}
 .equipment-detail .stat-tiles{grid-template-columns:1fr}.equipment-detail .stat-tiles>div{display:flex;align-items:center;justify-content:space-between;padding:3px 5px}.equipment-detail .stat-tiles strong{font-size:11px;margin:0}.equipment-detail .stat-change{font-size:10px}
 .status-content>.hero-summary .menu-portrait{width:48px;height:58px}.status-content>.hero-summary .hero-name{font-size:16px}.status-content .hero-role{font-size:9px}.stat-tiles>div>span{font-size:8px}.stat-tiles strong{font-size:15px}.worn-piece span{font-size:10px}
 .company-roster{gap:10px}.company-roster .menu-portrait{width:32px;height:39px;margin-right:6px}.company-roster .hero-name{font-size:11px}.company-roster .hero-name small{font-size:8px}.company-roster .hero-role{font-size:8px;min-height:21px}
}

/* Exploration maps and readable decisions, sized to the game viewport. */
.hint{max-width:94%;white-space:normal;text-align:center;font-size:clamp(9px,1.15cqw,13px);line-height:1.35}
.area-map svg{display:block;width:100%;max-height:49cqw;image-rendering:pixelated;border:3px solid #817b60;background:#25273e}
.area-map .map-legend{font-size:11px;line-height:1.5;color:#d0c79e;margin:8px 0 0}
.route-detail{font-size:13px;line-height:1.5;margin-bottom:12px}.route-detail h3{font-size:16px;margin:0 0 8px}.route-detail ol{padding-left:22px}.route-detail .objective{font-size:14px}.route-detail .muted{font-size:11px}
.menu-sheet .sheet-detail:has(.area-map){padding-top:0}
.balance-cradles,.ferry-banks{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:12px 0;font-size:12px}
.balance-cradles section,.ferry-banks section{background:#172044;border:2px solid #898598;padding:8px;min-height:100px}
.weight-hooks{display:flex;flex-wrap:wrap;gap:4px;margin-top:8px}.weight-hooks span{padding:5px;background:#66543e;border:1px solid #bcaa77}.weight-hooks small{display:block}
.ferry-banks .boat-here{border-color:#edd086}.ferry-banks span{display:block;padding:5px 0;border-bottom:1px solid #566386}.ferry-banks b{display:block;color:#f5d99f;margin-bottom:8px}
.indicator-row{display:flex;flex-wrap:wrap;gap:7px;margin:12px 0}.indicator{flex:1;min-width:60px;text-align:center;background:#172044;border:2px solid #81869d;padding:6px}.indicator.matched{border-color:#c0d38a;background:#314e47}.indicator b{font-size:11px}.indicator strong{font-size:30px;display:block;color:#fff0bc}.indicator small{display:block;font-size:10px}
.battle-bottom{height:40%;grid-template-rows:minmax(0,1fr) 43px;grid-template-columns:1fr 1.25fr}
.battle-commands{display:flex;flex-direction:column;overflow:hidden}.battle-commands .choices{overflow:auto;min-height:0;align-content:start;scrollbar-width:thin;flex:1}.battle-commands .choices button{min-width:0;overflow-wrap:anywhere;min-height:26px}
.battle-bottom .battle-log{white-space:normal;overflow:auto;line-height:1.35;padding:4px 8px;font-size:clamp(10px,1.15cqw,13px)}
.battle-bottom .battle-party{font-size:clamp(10px,1.2cqw,14px);gap:9px}.battle-roster{overflow:auto}
.enemy-label{font-size:clamp(9px,1cqw,12px);max-width:none;border:1px solid #b2b1bc;padding:5px;line-height:1.3}.enemy-label b,.enemy-label span{display:block}.enemy-label span{font-size:clamp(8px,.9cqw,11px);color:#cfd8e9;margin-top:3px}.enemy-label.targeted{outline:2px solid #fff2ab;outline-offset:2px}.enemy-label.targeted:before{content:'▼';position:absolute;top:-17px;left:44%;color:#fff2ab}.enemy-label.charging{border-color:#efb36e;background:#542d36}.enemy-label.charging span{color:#ffe0a5}.enemy-label .bar{min-width:0}
.spatial-help{font-size:clamp(9px,1.15cqw,13px);padding:7px 10px}.spatial-help .muted,.spatial-help button{font-size:clamp(8px,1.05cqw,12px)}
@container(max-width:700px){.battle-bottom{height:42%;grid-template-rows:minmax(0,1fr) 33px}.battle-bottom .panel{padding:3px 5px}.battle-commands .choices button{font-size:10px;min-height:20px;padding:3px 8px}.battle-bottom .battle-party{font-size:9px;gap:4px}.battle-bottom .battle-log{font-size:9px}.area-map .map-legend{font-size:9px}.route-detail{font-size:11px}.route-detail h3{font-size:12px}.spatial-help button{padding:2px 6px}.spatial-help p{margin:1px 0}}
.battle-portrait{float:left;width:30px;height:37px;object-fit:contain;image-rendering:pixelated;margin:0 7px 6px 0;background:#182043;border:1px solid #6d7a9d}
.battle-party>div{padding:3px}.battle-party>div.targeted{outline:2px solid #ffe7a0;outline-offset:-1px;background:#45567e}.battle-party .bar{clear:both}
@container(max-width:700px){.battle-portrait{width:18px;height:23px;margin:0 4px 2px 0}.battle-party>div{padding:1px}.battle-party .bar{margin-top:2px;height:3px}}

/* Comfort settings enlarge text inside scrollable panels, retaining the native pixel canvas. */
#game { --ui-scale:1; --text-scale:1; }
#game .modal,#game .menu-sheet { font-size:calc(16px * var(--ui-scale)); }
#game .choices button { font-size:calc(15px * var(--ui-scale)); }
#game .dialogue-text,#game .dialogue p { font-size:calc(18px * var(--text-scale)); }
#game .modal { overflow-y:auto; max-height:94%; }
#game .history-log { max-height:48vh; overflow-y:auto; padding:0 12px; line-height:1.6; }
#game .history-log p { border-bottom:1px solid #bca77745; padding-bottom:12px; }
#game .autosave-mark { display:block; font-size:10px; color:#bdd3b2; }
#game[data-reduced-motion="true"] *,#game[data-reduced-motion="true"] *::before { animation:none!important; transition:none!important; scroll-behavior:auto!important; }

#game .hint { max-width:92%; white-space:normal; text-align:center; font-size:12px; line-height:1.35; width:max-content; }
#game .dialogue .speech { font-size:calc(clamp(14px,1.6vw,21px) * var(--text-scale)); max-height:32vh; overflow-y:auto; }
#game .dialogue .speaker {font-size:13px;}

.command-effect{display:block;font:10px/1.35 monospace;color:#d2d9ea;margin-top:3px;letter-spacing:0;}
#game .battle-commands .choices button{min-height:38px;padding-top:5px;padding-bottom:5px;}
#game .battle-log{max-height:19vh;overflow:auto;line-height:1.4;}
#game .stat-tiles{grid-template-columns:repeat(4,minmax(0,1fr));}
#game .town-routes{position:absolute;left:3%;bottom:10%;display:flex;flex-wrap:wrap;gap:4px;max-width:94%;pointer-events:auto;}
#game .town-routes button{background:#1d2c45ed;border:1px solid #b5a174;color:#f0dfb5;padding:5px 8px;font:12px monospace;}
#game .town-routes button:hover,#game .town-routes button:focus-visible{background:#49566b;outline:2px solid #eed294;}
@container (max-width:650px){.command-effect{font-size:8px;}#game .town-routes button{font-size:10px;padding:3px 5px;}#game .battle-commands .choices button{min-height:32px;}}
/* Let wrapped command content determine row height; never paint into the next row. */
#game .battle-commands .choices{grid-auto-rows:max-content;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:3px;}
#game .battle-commands .choices button{font-size:calc(clamp(10px,1.65cqw,16px) * var(--ui-scale));line-height:1.25;height:auto;min-height:38px;overflow-wrap:normal;padding:4px 7px;}
#game .battle-commands .command-effect{font-size:calc(clamp(8px,1.35cqw,11px) * var(--ui-scale));line-height:1.3;}

#game .field-footer{position:absolute;bottom:4%;left:4%;right:4%;display:flex;flex-direction:column;align-items:center;gap:5px;pointer-events:none;}
#game .field-footer .town-routes{position:static;transform:none;justify-content:center;pointer-events:auto;}
#game .field-footer .hint{position:static;transform:none;max-width:100%;margin:0;pointer-events:none;}

/* Short decisions remain close to their choices instead of filling the screen. */
.modal.compact{top:50%;bottom:auto;transform:translateY(-50%);max-height:86%}

.choices button:hover:not(.selected):not(:disabled){background:transparent;color:inherit;border-color:#6676a0}

.personal-work .personal-diagram{display:block;width:min(100%,420px);height:auto;max-height:154px;margin:8px auto;border:1px solid #ab9169;image-rendering:pixelated}.personal-work p{margin:6px 0;font-size:.9em;line-height:1.35}.personal-work .work-feedback{color:#ffe0a0;border-left:3px solid #d2a15e;padding-left:8px}.story-progress{color:#d5dbb4}.story-place{color:#e8c88d}

/* Inventory art shares one atlas identity in shops, equipment, status and battle. */
.menu-icon.sprite-icon{display:inline-block;flex-shrink:0;width:40px;height:40px;background-repeat:no-repeat;image-rendering:pixelated;vertical-align:middle}
.equipment-icon{background-image:url('assets/equipment-icons.png')}
.supply-icon{background-image:url('assets/supply-icons.png')}
.item-detail>.sprite-icon{width:64px;height:64px}
.worn-piece .sprite-icon{width:36px;height:36px}
.quantity-item{display:flex;align-items:center;gap:14px}
.quantity-item .sprite-icon{width:64px;height:64px}
.battle-item-choice{display:flex;align-items:center;gap:8px}
.battle-item-choice .sprite-icon{width:30px;height:30px}
.shop-tabs{display:flex;gap:8px;margin-top:12px;border-bottom:1px solid #827858;padding-bottom:8px}
.shop-tabs button{flex:1;padding:8px;border:1px solid #62677b;background:#192539;color:#c9ced8;font:inherit}
.shop-tabs button.active{color:#fff1cb;background:#3a4660;border-color:#d3b678;box-shadow:inset 0 -3px #d3b678}
.sheet-shop .sheet-choices{flex:0 0 43%}
.sheet-shop .item-detail{min-height:0}
.sheet-shop .item-detail>.sprite-icon{float:left;margin:0 12px 4px 0}
.sheet-shop .item-detail h3{font-size:19px;margin:4px 0}
.sheet-shop .item-detail p{font-size:13px;line-height:1.4;margin:8px 0;clear:both}
.sheet-shop .detail-foot{font-size:11px}
.sheet-shop .item-effect{font-size:14px}
.shop-preview-heading{font-size:11px;color:#c9bc9c;margin:12px 0 6px;border-top:1px solid #535c70;padding-top:8px}
.shop-company{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.shop-companion{display:flex;flex-direction:column;align-items:center;background:#202d43;border:1px solid #54617a;padding:5px 3px;min-width:0}
.shop-companion>b{font-size:12px;color:#eee1c3}
.shop-companion canvas{width:72px;height:66px;image-rendering:pixelated}
.fit-badge{font-size:10px;color:#d2dda3;white-space:nowrap}
.shop-companion.incompatible .fit-badge{color:#edb6a0}
.shop-deltas{display:flex;gap:8px;font-size:10px;margin-top:4px;white-space:nowrap}
@media(max-width:760px),(max-height:600px){
 .sheet-shop .sheet-body{gap:10px;padding:8px 0}.sheet-shop .sheet-detail{padding-left:10px}
 .shop-tabs{margin-top:6px;padding-bottom:4px}.shop-tabs button{padding:4px}
 .sheet-shop .sheet-choices button{padding:6px}.sheet-shop .item-row b{font-size:12px}
 .sheet-shop .item-detail h3{font-size:15px}.sheet-shop .item-detail p{font-size:11px;margin:5px 0}
 .sheet-shop .item-detail>.sprite-icon{width:48px;height:48px}
 .shop-companion canvas{width:48px;height:44px}.shop-company{gap:4px}.shop-deltas{gap:4px;font-size:9px}
 .shop-preview-heading{margin:6px 0 4px;padding-top:5px}
}
.item-row>.sprite-icon{flex:0 0 40px;width:40px;height:40px}
.sheet-shop .item-detail{display:block}
.sheet-shop .item-detail .detail-type,.sheet-shop .item-detail .item-effect{display:block}
@media(max-width:760px),(max-height:600px){.item-row>.sprite-icon{flex-basis:32px;width:32px;height:32px}}
.sheet-shop .detail-foot{padding-top:4px}
.sheet-shop .sheet-choices button{padding-top:8px;padding-bottom:8px}
.shop-companion canvas{height:60.5px;width:66px}
@media(max-width:760px),(max-height:600px){.shop-companion canvas{width:48px;height:44px}}

.run-toggle{pointer-events:auto;display:block;margin-top:5px;padding:3px 7px;background:#24334c;border:1px solid #8b9aad;color:#ded9c4;font:inherit;font-size:10px;cursor:pointer}
.run-toggle[aria-pressed="true"]{border-color:#dac28b;color:#fff0b7;background:#3c493b}
.run-toggle:focus-visible{outline:2px solid #f5dfa3;outline-offset:2px}
