:root{color-scheme:dark;--ink:#e8e5d8;--gold:#d5c296;--line:#d7c49a35;--safe-top:env(safe-area-inset-top,0px);--safe-bottom:env(safe-area-inset-bottom,0px)}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#111d1b;color:var(--ink);font-family:system-ui,-apple-system,sans-serif}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;color:inherit;cursor:pointer;border:1px solid var(--line);background:#14211ed9;border-radius:5px;min-height:44px;padding:11px 16px}button:disabled{opacity:.38;cursor:default}button:focus-visible,a:focus-visible{outline:2px solid var(--gold);outline-offset:4px}a{color:#d9c9a4;font-size:13px;text-underline-offset:5px}button.primary{background:#c9b88c;color:#17231e;border:0;font-weight:700}button.subtle{border-color:transparent;background:transparent;color:#c5cbbb;font-size:14px}[hidden]{display:none!important}#world,#worldLabels{position:fixed;inset:0;width:100%;height:100%;touch-action:none}#worldLabels{pointer-events:none;z-index:1}.screen{position:fixed;inset:0;z-index:20;display:flex;flex-direction:column;justify-content:center;padding:calc(32px + var(--safe-top)) 9vw calc(32px + var(--safe-bottom));background:#101b19}.title-screen{background:linear-gradient(90deg,#0a1815ed,#102320bd 52%,#0c191588),url('./assets/art/forest-v14.webp') center/cover}.title-copy{max-width:620px}.eyebrow{color:var(--gold);font-size:10px;letter-spacing:.24em;text-transform:uppercase;line-height:1.6}h1{font:500 clamp(38px,10vw,90px)/1.2 Georgia,serif;letter-spacing:.12em;margin:12px 0 19px}h2{font:400 28px/1.2 Georgia,serif;margin:16px 0}.chapter-rule{width:45px;height:1px;background:var(--gold);margin:15px 0 25px}.intro{font-size:15px;line-height:1.85;color:#d4d9cc}.title-actions{display:flex;flex-direction:column;align-items:flex-start;gap:8px;margin:30px 0 15px}.title-actions .primary{min-width:225px}.chapter-note{font-size:11px;color:#b1bfb3;margin:0 0 20px}.title-footer{position:absolute;bottom:calc(23px + var(--safe-bottom));left:9vw;right:9vw;display:flex;justify-content:space-between;gap:15px;flex-wrap:wrap;font-size:9px;letter-spacing:.16em;color:#a5b4a5}.title-footer span{letter-spacing:.04em}.loading{align-items:center;text-align:center}.loading progress{width:min(330px,80vw);height:3px;accent-color:var(--gold);margin:15px}.loading p:not(.eyebrow){color:#b4c0b4;font-size:13px;max-width:350px}#hud{position:fixed;inset:0;z-index:3;pointer-events:none;touch-action:none}#hud button,#stick{pointer-events:auto}.topbar{position:absolute;top:calc(14px + var(--safe-top));left:18px;right:14px;display:flex;gap:7px;align-items:center}.health{margin-right:auto;min-width:95px;text-shadow:0 2px 5px #000}#hearts{font-size:14px;letter-spacing:5px;color:#dfcdb0}.stamina-track{height:3px;background:#12201966;width:94px;margin-top:8px}#stamina{height:100%;background:#b6c5a3;transition:width .1s}.icon-btn{position:relative;width:43px;height:43px;min-height:43px;padding:0;font-size:21px;border:0;background:#0e201957;border-radius:50%}.icon-btn i{width:5px;height:5px;border-radius:50%;background:var(--gold);position:absolute;right:8px;top:8px}.objective{position:absolute;top:calc(78px + var(--safe-top));left:18px;max-width:calc(100% - 36px);padding:4px 9px 5px 0;background:none;border:0;text-align:left;text-shadow:0 2px 5px #000;font-size:14px;min-height:40px}.objective span{display:block;font-weight:600}.objective small{display:block;margin-top:4px;font-size:10px;color:#d5d6c6;font-weight:400}.combat-status{position:absolute;top:calc(130px + var(--safe-top));left:18px;color:#f1c495;font-size:12px;text-shadow:0 2px 6px #000}.toast{position:absolute;top:35%;left:50%;transform:translateX(-50%);max-width:500px;width:calc(100% - 46px);padding:13px 17px;background:linear-gradient(90deg,#10201de8,#14241ee0);border-left:2px solid #ccb986;color:#ece9da;font-size:13px;line-height:1.65;box-shadow:0 8px 30px #0002}.context{position:absolute;bottom:calc(187px + var(--safe-bottom));left:0;right:0;text-align:center}.context-action{padding:10px 19px;border:1px solid #d9c89d70;border-radius:25px;background:#12211bd9;color:#f3e0b7;font-size:13px;max-width:85%;box-shadow:0 3px 15px #0002}.stick{position:absolute;left:27px;bottom:calc(34px + var(--safe-bottom));width:114px;height:114px;border:1px solid #d1d9c432;border-radius:50%;background:#18251b22;touch-action:none}.stick span{position:absolute;left:35px;top:35px;width:44px;height:44px;border-radius:50%;border:1px solid #cbd4bd60;background:#c8ceaf2c}.stick small{position:absolute;bottom:12px;left:0;right:0;font-size:8px;letter-spacing:.2em;text-align:center;color:#ccd0c0a8}.actions{position:absolute;right:19px;bottom:calc(35px + var(--safe-bottom));width:163px;height:149px}.action{position:absolute;width:67px;height:67px;border-radius:50%;padding:4px;background:#11231ad9;border-color:#c1cdb143;box-shadow:0 2px 15px #0002}.action span{display:block;font-size:26px;height:31px;line-height:28px;color:#e3d5b2}.action small{display:block;font-size:10px}.attack{right:0;bottom:0;width:78px;height:78px;border-color:#dcc89c90}.dodge{left:0;bottom:3px}.utility{top:0;right:11px;width:59px;height:59px}.control-hint{position:absolute;bottom:calc(6px + var(--safe-bottom));left:0;right:0;font-size:9px;text-align:center;color:#d2d9c894;margin:0;text-shadow:0 1px 4px #000}#damageFlash{position:absolute;inset:0;box-shadow:inset 0 0 70px #902c23;opacity:0;transition:opacity .15s}dialog{color:var(--ink);background:#15231ff7;border:1px solid #b7bc9550;border-radius:12px;box-shadow:0 20px 100px #0009;width:min(470px,calc(100% - 32px));max-height:85dvh;overflow:auto;padding:22px}dialog::backdrop{background:#07100db8;backdrop-filter:blur(6px)}.panel-top{display:flex;justify-content:space-between;align-items:center}dialog h2{margin-top:6px;font-size:30px}#panelBody{font-size:13px;line-height:1.8;color:#c5cfc1}#panelBody p{margin:0 0 15px}#panelActions{display:grid;gap:10px;margin-top:23px}#panelActions button{text-align:left;font-size:14px}#panelActions small{display:block;color:#aab9ab;font-size:11px;font-weight:400;line-height:1.7;margin-top:4px}#panelActions .primary small{color:#38483a}#panelBody article{padding:16px 0;border-top:1px solid var(--line)}#panelBody article strong{color:#e1d6b7;font-weight:600}#panelBody article small{display:block;font-size:9px;text-transform:uppercase;letter-spacing:.15em;color:#9aaa91}#panelBody .stats{display:flex;gap:20px;border-top:1px solid var(--line);padding-top:14px}.keyboard-hint{font-size:11px;color:#9ead9f!important}
@media(min-width:850px){.topbar{left:32px;right:28px}.objective,.combat-status{left:32px}.stick{opacity:.55}.actions{right:35px}.toast{top:27%;max-width:470px}.control-hint{font-size:11px}.context{bottom:90px}.context-action{min-width:190px}}
@media(max-height:500px){.title-screen{padding:25px 7vw}.title-copy{max-width:none}h1{font-size:34px;margin:4px 0}.title-copy h2{font-size:22px;margin:8px 0}.chapter-rule,.intro,.chapter-note,.title-footer{display:none}.title-actions{margin:16px 0 10px;flex-direction:row}.topbar{top:9px}.objective{top:58px}.combat-status{top:105px}.context{bottom:45px}.toast{top:23%;width:48%;font-size:12px}.actions{bottom:20px;transform:scale(.87);transform-origin:bottom right}.stick{bottom:20px;transform:scale(.85);transform-origin:bottom left}dialog{max-height:92dvh}}

button svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;vertical-align:middle}.action svg{width:28px;height:28px}

/* v16: readable text over bright terrain, without expanding the HUD. */
.objective{width:fit-content;background:linear-gradient(100deg,#10231ee6,#10231e82);padding:9px 13px;border-radius:6px;box-shadow:0 3px 14px #07110b24}.health{padding:7px 10px;border-radius:6px;background:#10231e9c}.combat-status{top:calc(151px + var(--safe-top));background:#13261ed9;padding:6px 9px;border-radius:4px}.topbar .icon-btn{background:#10231e99}.toast{background:#14251cf0}@media(max-height:500px){.combat-status{top:117px}.objective{max-width:54vw;font-size:12px}}

/* Keep orientation and actions in view; only the narrative scrolls. */
dialog{padding:18px 20px 16px;overflow:hidden;max-height:min(86dvh,820px)}
dialog[open]{display:flex;flex-direction:column}.panel-top,dialog h2,#panelSummary,#panelActions{flex:none}
#panelBody{overflow-y:auto;min-height:0;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#a4ae9766 transparent;padding-right:6px;touch-action:pan-y}
#panelActions{margin-top:12px;padding-top:12px;border-top:1px solid var(--line);gap:7px}
#panelActions button{padding:10px 14px;min-height:44px}
#panelSummary{border:1px solid #cbb98a55;border-radius:6px;background:#26382c;padding:12px 14px;margin:0 0 14px;line-height:1.5}
#panelSummary small{display:block;font-size:9px;letter-spacing:.15em;color:#cfbc8f;margin-bottom:4px}
#panelSummary strong{display:block;font-size:14px;color:#eee3c5}#panelSummary p{margin:5px 0 0;font-size:12px;color:#c3cfbe}
.save-summary{font-size:13px;line-height:1.5;color:#e4d5af;max-width:350px;margin:0 0 14px}
#panelBody .chapter-progress strong{color:#b7d4b0}
@media(max-height:550px){dialog{max-height:calc(100dvh - 24px);padding:10px 18px}dialog h2{font-size:23px;margin:0 0 7px}.panel-top .eyebrow{margin:0}#panelSummary{padding:7px 12px;margin-bottom:8px}#panelSummary p{display:none}#panelActions{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px;padding-top:6px}#panelActions button{flex:1;min-width:140px;font-size:12px}#panelActions small{display:none}#panelBody{font-size:12px}.save-summary{display:none}}

/* Keep all three entry choices reachable on small phones. */
@media(max-height:760px) and (min-height:501px){.title-screen{padding-top:24px;padding-bottom:40px}.title-actions{margin-top:16px;gap:3px}.title-copy h1{margin:5px 0 12px}.chapter-rule{margin:10px 0}.title-copy h2{margin:12px 0}.intro{font-size:13px}.chapter-note{margin-bottom:10px}}
@media(max-height:500px){.title-actions{flex-wrap:wrap;gap:4px}.title-actions button{font-size:12px;padding:9px 12px;min-width:0!important}}

#panelActions:has(button:nth-child(5)){flex-shrink:1;min-height:0;max-height:48dvh;overflow-y:auto;overscroll-behavior:contain}

/* A quiet inspection overlay, with the same live creature and forest as the campaign. */
#fieldHud{position:fixed;inset:0;z-index:7;pointer-events:none;color:#ece8d8;text-shadow:0 2px 8px #07110d}#fieldHud[hidden]{display:none}.field-heading{position:absolute;left:32px;top:24px;padding:16px 22px;background:#111d1bcc;border:1px solid #c5ba8f40;border-radius:12px;backdrop-filter:blur(8px)}.field-heading h2{font-size:25px;margin:8px 0}.field-heading p{margin:4px 0}.field-exit{position:absolute;right:32px;top:30px;pointer-events:auto;background:#13241deb!important}.field-controls{position:absolute;left:50%;bottom:24px;transform:translateX(-50%);width:max-content;max-width:94vw;padding:14px 22px;background:#111d1be8;border:1px solid #c5ba8f40;border-radius:12px;text-align:center;pointer-events:auto}.field-controls p{font-size:13px;margin:0 0 10px;color:#d2d4c7}.field-controls>div{display:flex;gap:8px}.field-controls button{padding:10px 18px;font-size:14px}.field-controls small{display:block;margin-top:10px;color:#bec7b7;font:12px system-ui}#fieldBtn small{display:block;font-size:12px;font-weight:400;margin-top:3px;color:#c0c9b8}@media(max-width:600px){.field-heading{left:12px;top:12px;padding:12px}.field-heading h2{font-size:18px}.field-heading .eyebrow{font-size:9px}.field-exit{right:12px;top:132px;padding:10px}.field-controls{bottom:14px;padding:12px}.field-controls>div{flex-wrap:wrap;justify-content:center}.field-controls button{padding:8px 12px;font-size:12px}.field-controls p{font-size:11px}}

/* Keyboard play keeps more of the world visible, while preserving touch controls. */
@media (pointer:fine) and (min-width:900px){.keyboard-controls .stick{display:none}.keyboard-controls .actions{bottom:32px;gap:9px}.keyboard-controls .action{width:58px;height:58px;background:#10221b99;backdrop-filter:blur(5px)}.keyboard-controls .action.utility{width:48px;height:48px}.keyboard-controls .control-hint{left:32px;bottom:24px;transform:none;text-align:left;color:#d0d5c7;background:#10221b9c;padding:8px 12px;border-radius:5px}.keyboard-controls .context{bottom:35px}.keyboard-controls .action:after{position:absolute;right:-3px;bottom:-3px;background:#d0c8a9;color:#14221d;padding:2px 5px;border-radius:3px;font:10px system-ui}.keyboard-controls #toolBtn:after{content:'R'}.keyboard-controls #attackBtn:after{content:'F'}.keyboard-controls #dodgeBtn:after{content:'Space'}}

/* v36: separate weapon, evasion and limited sprint controls. */
#staminaText{display:block;font-size:9px;color:#c7ceb8;margin-top:3px}.stamina-track{margin-top:4px}#stamina.tired{background:#db997b}.throw{left:5px;top:0;width:59px;height:59px}.sprint{left:48px;bottom:calc(163px + var(--safe-bottom));width:68px;height:54px;border-radius:18px}.sprint span{height:23px;line-height:21px}.action[aria-pressed="true"]{border-color:#f0d39d;background:#526346e8}.spear-status{position:absolute;top:calc(187px + var(--safe-top));left:18px;max-width:calc(100% - 36px);padding:7px 11px;min-height:36px;border-color:#dfc58d6b;background:#18291deb;color:#eddbaf;font-size:11px;border-radius:6px}.context{bottom:calc(232px + var(--safe-bottom))}
@media(pointer:fine) and (min-width:900px){.keyboard-controls .sprint{left:32px;bottom:76px;width:64px;height:54px}.keyboard-controls .control-hint{right:auto;max-width:calc(100% - 280px);font-size:10px}.keyboard-controls #attackBtn:after{content:'Space / F'}.keyboard-controls #dodgeBtn:after{content:'Q'}.keyboard-controls #throwBtn:after{content:'G'}.keyboard-controls #sprintBtn:after{content:'Shift'}.keyboard-controls .context{bottom:42px}.spear-status{left:32px}.keyboard-controls .actions{height:146px}}
@media(max-height:500px){.sprint{left:39px;bottom:126px;width:60px;height:48px}.spear-status{top:157px;left:18px}.context{bottom:31px}.context-action{max-width:36vw;font-size:11px}.control-hint{font-size:8px}}

/* Survival controls keep the two contextual choices together on touch and keyboard. */
.pack-button{font-size:10px;line-height:1.1}.pack-button small{display:block;font-size:9px;margin-top:3px;color:#d5c296}.survival-tools{position:absolute;top:calc(192px + var(--safe-top));left:18px;display:flex;gap:7px}.survival-tools button{min-height:38px;padding:7px 12px;font-size:11px;background:#13261ee6}.survival-tools button[aria-pressed=true]{border-color:#d5c296;background:#40543ddd}.survival-tools:not([hidden])~.spear-status{top:calc(238px + var(--safe-top))}.context{display:flex;justify-content:center;gap:8px;padding:0 16px;flex-wrap:wrap}.context-action{max-width:calc(100vw - 32px)}.secondary-interaction{background:#253a2ce8;padding:8px 14px;font-size:12px}.pack-summary{padding:16px;background:#233b2b;border:1px solid #ccb98644;border-radius:8px;margin-bottom:18px}.pack-summary strong{display:flex;justify-content:space-between;gap:15px}.pack-summary p{font-size:13px!important}.pack-summary span{color:#e5d09c}
@media(pointer:fine) and (min-width:900px){.survival-tools{left:32px;top:190px}.secondary-interaction:after{content:' · T';font-size:10px}.context-action{min-width:0}}
@media(max-height:500px){.survival-tools{top:76px;right:18px;left:auto}.survival-tools:not([hidden])~.spear-status{top:165px}.context{padding:0 140px;bottom:24px}.context-action{max-width:100%;font-size:10px;padding:8px}.title-actions{flex-wrap:wrap}}

/* Personal home building: thumb-sized controls, same quiet material language. */
.home-catalog{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:20px 0}.home-catalog button{padding:14px;text-align:left;min-width:0}.home-catalog strong,.home-catalog small{display:block}.home-catalog small{font-size:12px;line-height:1.5;color:#bcc7b6;margin-top:5px}
#homeBuild{position:fixed;z-index:45;bottom:max(18px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:min(720px,calc(100% - 28px));padding:15px;background:rgba(18,35,29,.96);border:1px solid #68715a;border-radius:16px;box-shadow:0 15px 60px #0008;color:#dedac2;pointer-events:auto}#homeBuild[hidden]{display:none}.build-top,.build-controls{display:flex;gap:7px;align-items:center;flex-wrap:wrap}.build-top strong{flex:1}.build-top button,.build-controls button{padding:10px 12px;min-height:43px}.build-controls .primary{margin-left:auto}#homeBuild p{margin:9px 0;font-size:14px;line-height:1.45}#homeBuild small{display:block;margin-top:9px;font-size:11px;opacity:.7}#homeBuild .valid{color:#c6d5b7}#homeBuild .invalid{color:#e2b397}body:has(#homeBuild:not([hidden])) #hud{pointer-events:none;opacity:.3}body:has(#homeBuild:not([hidden])) #stick{visibility:hidden}
@media(min-width:900px){.home-catalog{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:480px){#homeBuild{padding:11px}.build-top strong{flex-basis:100%}.build-controls button{padding:8px 11px}#homeBuild small{display:none}.home-catalog button{padding:11px}}

body:has(#homeBuild:not([hidden])) #hud button{pointer-events:none}

/* v41: keep the world clear. Secondary actions live in Equipment or Pause. */
#hud #buildBtn,#hud #bagBtn,#hud #journalBtn,#hud #quietBtn,#hud #toolBtn,#hud #throwBtn,#hud #alternateBtn,#hud #controlHint,#hud #trialMoves,#hud #trialExit{display:none!important}
#hud .survival-tools{top:calc(14px + var(--safe-top));left:auto;right:66px;gap:0}
#hud #equipBtn{min-height:43px;padding:8px 14px;border-radius:22px;font-size:12px;background:#10231ed9;border-color:#b9c4a448}
#hud .objective{top:calc(74px + var(--safe-top));max-width:min(330px,calc(100% - 36px));font-size:13px}
#hud .combat-status{top:calc(140px + var(--safe-top));max-width:calc(100% - 36px);font-size:11px}
#hud .spear-status{top:calc(176px + var(--safe-top));min-height:0;padding:5px 9px;border:0;background:#14241eb8;font-size:10px}
#hud .actions{height:78px;width:146px;bottom:calc(26px + var(--safe-bottom));right:20px}
#hud .action.attack{width:68px;height:68px}#hud .action.dodge{width:58px;height:58px;bottom:5px}
#hud .stick{width:100px;height:100px;left:20px;bottom:calc(26px + var(--safe-bottom))}
#hud .stick span{left:28px;top:28px}#hud .sprint{left:35px;bottom:calc(140px + var(--safe-bottom));width:66px;height:48px}
#hud .context{bottom:calc(113px + var(--safe-bottom));left:132px;right:16px;padding:0;justify-content:flex-end}
#hud .context-action{max-width:100%;font-size:12px;min-height:44px;padding:9px 14px}
#hud .toast{top:calc(208px + var(--safe-top));left:18px;transform:none;width:calc(100% - 36px);max-width:380px;font-size:12px;padding:8px 11px;pointer-events:none}
#hud .trial-controls{left:auto;right:20px;bottom:calc(112px + var(--safe-bottom));transform:none}
#hud .trial-controls button{font-size:11px;min-height:36px;padding:6px 12px}
#hud .grip-panel{left:auto;right:16px;bottom:calc(28px + var(--safe-bottom));width:min(210px,55vw);transform:none}
#hud .grip-panel button{min-height:56px;padding:10px 12px;font-size:12px}
.keyboard-controls #hud .actions,.keyboard-controls #hud #sprintBtn,.keyboard-controls #hud #stick{display:none!important}
.keyboard-controls #hud .survival-tools{right:82px}
.keyboard-controls #hud .context{bottom:26px;left:180px;right:180px;justify-content:center}
.keyboard-controls #hud .context-action::after{content:' · E';color:#c5cdbb;font-size:10px}
.keyboard-controls #hud .trial-controls{right:32px;bottom:26px}
.keyboard-controls #hud .toast{top:auto;bottom:86px;left:50%;transform:translateX(-50%);text-align:center;max-width:420px}
.keyboard-controls #hud .grip-panel{bottom:28px;right:32px;width:210px}
.controls-reference strong{color:#e2d2ac}.controls-reference p{padding-bottom:9px;border-bottom:1px solid var(--line)}
@media(max-height:500px){#hud .objective{top:60px;font-size:11px;max-width:270px}#hud .combat-status{top:118px;max-width:55vw}#hud .spear-status{top:153px}#hud .toast{left:50%;transform:translateX(-50%);top:12px;width:40%;font-size:10px}#hud .context{bottom:108px;left:140px}#hud .actions{transform:none}#hud .survival-tools{top:9px}.keyboard-controls #hud .toast{top:auto;bottom:75px}}

/* Capture controls stay reachable without covering the body or movement pad. */
.grip-panel{position:fixed;left:50%;bottom:155px;transform:translateX(-50%);width:min(350px,54vw);display:grid;gap:8px;pointer-events:auto;z-index:12}.grip-panel[hidden],.trial-controls[hidden]{display:none}.grip-panel progress{width:100%;height:9px;accent-color:#d1ba82}.grip-panel button{padding:13px;background:#c9b581;color:#17241d;border:1px solid #e2d3ab;border-radius:8px;touch-action:none;font-weight:700}.trial-controls{position:fixed;bottom:16px;left:50%;transform:translateX(-50%);display:flex;gap:5px;pointer-events:auto;z-index:11}.trial-controls button{background:#15271eee;border:1px solid #64765b;color:#e2dcc8;padding:8px 12px;border-radius:7px}.trial-label{display:grid;gap:8px}.trial-label select{max-width:100%;padding:12px;background:#21332a;color:#e6dec6;border:1px solid #8c9478;border-radius:6px;font:inherit}@media(max-width:600px){.grip-panel{bottom:145px;width:54vw}.grip-panel button{font-size:12px;padding:10px}.trial-controls{bottom:7px}.trial-controls button{font-size:12px;padding:6px 10px}}

/* App actions live outside the playable HUD. */
.app-actions{display:flex;gap:10px;flex-wrap:wrap;margin:16px 0 8px}.app-actions button{flex:1;min-width:140px;min-height:44px;border:1px solid #667369}.app-status{font-size:.76rem;line-height:1.5;color:#b1bcae;margin:.6rem 0}.title-copy{padding-bottom:36px}#panelBody a{color:#d6c48f;overflow-wrap:anywhere}
