/* Forge indicator and larger touch controls. */
.axe-boosted{color:#ffe3a0!important;text-shadow:0 0 9px #dfbd6655}
.bow-cooling{opacity:.65}.bow-touch img{width:32px;height:32px}.touch-movement [data-touch=crouch]{font:9px/1 ui-monospace,monospace;min-height:44px}
.forge-modal{width:min(760px,100%)}.recipe-list{grid-template-columns:repeat(3,minmax(0,1fr))}.forge-stock{flex-wrap:wrap}.materials{grid-template-columns:repeat(5,minmax(0,1fr))}
@media(max-width:1000px){.materials{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:560px){.recipe-list{grid-template-columns:1fr}.recipe{display:grid;grid-template-columns:30px 1fr;column-gap:12px}.recipe>img{grid-row:1/3}.recipe h3,.recipe p{margin:0 0 7px}.recipe-cost,.recipe>.button{grid-column:1/-1}.materials{grid-template-columns:repeat(3,minmax(0,1fr))}}
.in-game-forge{position:absolute;z-index:2;right:1.8%;top:17%;width:66px;min-height:63px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;border:1px solid #879260;background:#142d26ed;border-radius:5px;color:#d5c291;box-shadow:0 3px 14px #0004;touch-action:manipulation}
.in-game-forge img{width:33px;height:33px;image-rendering:pixelated}.in-game-forge>span{font:8px/1.2 ui-monospace,monospace;letter-spacing:.5px;display:flex;align-items:center;gap:4px}.in-game-forge kbd{height:13px;min-width:12px;font-size:7px;padding:0 2px}.in-game-forge:hover{border-color:#e5d199;background:#294332}.forge-ready{animation:forge-pulse 1.25s ease-in-out infinite;color:#ffe3a0!important;border-color:#e8cb82!important}.forge-ready img{filter:drop-shadow(0 0 5px #ead99177)}
@keyframes forge-pulse{0%,100%{box-shadow:0 0 0 1px #dfb86733,0 0 10px #dfb86725;filter:brightness(1)}50%{box-shadow:0 0 0 3px #dfb86744,0 0 24px #efce7b77;filter:brightness(1.25)}}
/* The normal deck stays below the scene. Fullscreen uses the same large
   controls in the corners instead of scaling them with the canvas. */
.touch-help,.world-help{font-size:11px;line-height:1.6;color:#b4c4ad;margin:14px 0 8px}.touch-help{padding:12px;background:#1b352b;border:1px solid #41563d;border-radius:4px}.touch-help b{color:#e8d5a2}
.stage-viewport.touch-enabled:not(:fullscreen){aspect-ratio:auto;min-height:0}
.stage-viewport.touch-enabled:not(:fullscreen) canvas{height:auto;aspect-ratio:16/9}
.touch-enabled .touch-controls{--stick-size:128px;--action-size:80px;--cluster-width:200px;--cluster-height:224px;--face-row:72px;--dash-size:52px;position:relative;inset:auto;width:100%;padding:12px 18px max(17px,env(safe-area-inset-bottom));min-height:0;background:linear-gradient(#132f26,#0c241f);border-top:1px solid #4c6247;display:grid;grid-template-columns:var(--stick-size) var(--cluster-width);grid-template-rows:50px var(--cluster-height);justify-content:space-between;align-items:end;gap:12px;pointer-events:none;user-select:none;-webkit-user-select:none}
.touch-enabled .touch-utilities{grid-column:1/-1;grid-row:1;display:flex;gap:12px;justify-content:center;align-items:center}
.touch-enabled .touch-controls .touch-minor{width:68px;height:50px;min-width:56px;min-height:50px;border:1px solid #8ba07880;border-radius:12px;font:9px/1 ui-monospace,monospace;background:#254538;display:flex;flex-direction:column;justify-content:center;gap:3px;letter-spacing:.3px}
.touch-enabled .touch-minor img{width:23px;height:23px}.touch-enabled .touch-minor b{font:25px/.85 Georgia,serif}
.touch-enabled .touch-movement{grid-column:1;grid-row:2;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:8px;padding:0 0 4px}
.movement-stick{position:relative;width:var(--stick-size);height:var(--stick-size);flex:none;pointer-events:auto;touch-action:none;cursor:grab;border:2px solid #8aa07a8c;border-radius:50%;background:radial-gradient(circle,#3b5945 0,#1a3a2e 62%,#102c25 64%);box-shadow:inset 0 3px 14px #061a16b3,0 3px 12px #0004;outline-offset:4px}
.movement-stick:focus-visible{outline:2px solid #e5ca89}.movement-stick.engaged{border-color:#e7cf92;cursor:grabbing;box-shadow:inset 0 3px 14px #061a16b3,0 0 16px #acba6933}
.stick-axis{position:absolute;left:50%;top:50%;background:#78906a40;pointer-events:none}.stick-axis.horizontal{height:1px;width:80%;transform:translate(-50%,-50%)}.stick-axis.vertical{width:1px;height:80%;transform:translate(-50%,-50%)}
.stick-thumb{position:absolute;width:44%;height:44%;left:28%;top:28%;border:2px solid #c9d3a5;border-radius:50%;background:radial-gradient(circle at 35% 25%,#72876a,#425d47 68%,#2b493a);box-shadow:0 4px 8px #0006,inset 0 1px #eef6c755;transform:translate(var(--stick-x,0px),var(--stick-y,0px));pointer-events:none}
.stick-down{position:absolute;bottom:5px;left:0;width:100%;text-align:center;font-size:17px;color:#d2c99d80;pointer-events:none}.stick-caption{font:8px/1 ui-monospace,monospace;letter-spacing:.5px;color:#afbd9e;white-space:nowrap}
.touch-enabled .touch-actions{grid-column:2;grid-row:2;display:block;position:relative;align-self:end;width:var(--cluster-width);height:var(--cluster-height)}
.touch-enabled .touch-controls .touch-major{position:absolute;width:var(--action-size);height:var(--action-size);min-width:72px;min-height:72px;border:2px solid #bece9a99;border-radius:50%;background:radial-gradient(circle at 35% 25%,#52745b,#2c513e);box-shadow:0 4px 10px #0004,inset 0 2px #f3eec01a;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;padding:3px;touch-action:none}
.touch-enabled .touch-major img{width:34px;height:34px}.touch-enabled .touch-major .action-caption{font:9px/1.3 ui-monospace,monospace;letter-spacing:.5px;color:#eee9ce}
.touch-enabled .touch-major .pad-symbol{position:absolute;right:9px;top:5px;font:15px/1 ui-sans-serif,system-ui,sans-serif;opacity:.85}
.touch-enabled .touch-controls .bow-touch{top:0;left:calc((100% - var(--action-size))/2);background:radial-gradient(circle at 35% 25%,#41654c,#1f4035);border-color:#9dc9a1}.touch-enabled .bow-touch .pad-symbol{color:#b2e0ab}
.touch-enabled .touch-controls .sword-touch{top:var(--face-row);left:0;background:radial-gradient(circle at 35% 25%,#82634f,#4c3b34);border-color:#d7acbe}.touch-enabled .sword-touch .pad-symbol{color:#efbbd8}
.touch-enabled .touch-controls .shield-touch{top:var(--face-row);right:0;background:radial-gradient(circle at 35% 25%,#805d56,#493a36);border-color:#d89a8c}.touch-enabled .shield-touch .pad-symbol{color:#f1afa0}
.touch-enabled .touch-controls .jump-touch{bottom:0;left:calc((100% - var(--action-size))/2);background:radial-gradient(circle at 35% 25%,#4d80a0,#294b69);border-color:#a6c7d6}.touch-enabled .jump-touch b{font:34px/1 ui-sans-serif,system-ui,sans-serif}.touch-enabled .jump-touch .pad-symbol{color:#accfe9}
.touch-enabled .touch-controls .dash-touch{position:absolute;top:0;right:0;width:var(--dash-size);height:var(--dash-size);min-width:var(--dash-size);min-height:var(--dash-size);border-radius:14px;font-size:7px;letter-spacing:0;gap:2px;background:#264333}.touch-enabled .dash-touch b{font-size:24px}
.touch-enabled .touch-controls button.pressed{filter:brightness(1.35);border-color:#fff0bb;box-shadow:inset 0 3px 8px #0005,0 0 13px #e4d49c44;transform:scale(.97)}
.touch-enabled .touch-controls .axe-touch{background:linear-gradient(to top,#a98d41 var(--charge,0%),#254538 var(--charge,0%));color:#efd18d}.touch-enabled .touch-controls .axe-ready{border-color:#f4d58c;box-shadow:0 0 18px #eed08a77;color:#fff0bd}
.touch-enabled .touch-controls .bow-cooling{opacity:.65}
.game-container:has(.touch-enabled) .keyboard-hint{display:none}.game-container:has(.touch-enabled) .game-toolbar{justify-content:flex-end}
@media(max-width:900px){.touch-enabled .in-game-forge{top:clamp(46px,10vw,90px);right:9px;width:54px;min-height:55px}.touch-enabled .in-game-forge img{width:30px;height:30px}.touch-enabled .in-game-forge kbd{display:none}.touch-enabled .toast{top:15%;max-width:83%}}
@media(max-width:450px){.touch-enabled .touch-controls{--stick-size:116px;--action-size:76px;--cluster-width:180px;--cluster-height:208px;--face-row:66px;--dash-size:48px;padding-inline:8px;column-gap:8px}.touch-enabled .touch-utilities{gap:0}.touch-enabled .touch-major img,.touch-enabled .shield-touch svg{width:32px;height:32px}}
@media(max-width:350px){.touch-enabled .touch-controls{--stick-size:100px;--action-size:72px;--cluster-width:166px;--cluster-height:200px;--face-row:64px;--dash-size:44px}.touch-enabled .touch-major .pad-symbol{right:8px;font-size:13px}.touch-enabled .touch-major .action-caption{font-size:8px}}
.stage-viewport.touch-enabled:fullscreen .touch-controls{position:absolute;left:max(18px,env(safe-area-inset-left));right:max(18px,env(safe-area-inset-right));bottom:max(15px,env(safe-area-inset-bottom));width:auto;padding:0;min-height:0;grid-template-columns:var(--stick-size) 1fr var(--cluster-width);grid-template-rows:var(--cluster-height);gap:14px;background:none;border:0}
.stage-viewport.touch-enabled:fullscreen .touch-movement{grid-column:1;grid-row:1}.stage-viewport.touch-enabled:fullscreen .touch-actions{grid-column:3;grid-row:1}.stage-viewport.touch-enabled:fullscreen .touch-utilities{grid-column:1/-1;grid-row:1;position:absolute;left:50%;bottom:4px;width:68px;transform:translateX(-50%);justify-content:center;align-self:end;padding-bottom:0}.stage-viewport.touch-enabled:fullscreen .touch-minor{background-color:#183c30e6}
.stage-viewport.touch-enabled:fullscreen .in-game-forge{top:19%;right:3%;width:62px;min-height:63px}
@media(orientation:portrait),(max-width:620px){.stage-viewport.touch-enabled:fullscreen .touch-controls{left:max(10px,env(safe-area-inset-left));right:max(10px,env(safe-area-inset-right));grid-template-columns:var(--stick-size) var(--cluster-width);grid-template-rows:50px var(--cluster-height);justify-content:space-between;row-gap:12px}.stage-viewport.touch-enabled:fullscreen .touch-utilities{grid-column:1/-1;grid-row:1;position:static;inset:auto;width:auto;transform:none;justify-content:center;padding-bottom:0}.stage-viewport.touch-enabled:fullscreen .touch-movement{grid-row:2}.stage-viewport.touch-enabled:fullscreen .touch-actions{grid-column:2;grid-row:2}}
@media(prefers-reduced-motion:reduce){.forge-ready{animation:none;box-shadow:0 0 0 2px #e6c987,0 0 13px #e6c98766}.forge-ready img{filter:brightness(1.2)}}

@media(orientation:landscape) and (max-height:420px){.stage-viewport.touch-enabled:fullscreen .touch-controls{--stick-size:112px;--action-size:72px;--cluster-width:176px;--cluster-height:200px;--face-row:64px;--dash-size:48px}}
/* Independent audio channels; ranges remain comfortable to drag on touch. */
.audio-modal{width:min(470px,100%)}.audio-modal h2{margin-bottom:10px}.audio-status{font-size:12px!important;line-height:1.6;min-height:38px}.volume-control{padding:15px 0;border-top:1px solid #3d533d}.volume-label{display:flex;justify-content:space-between;align-items:center;gap:12px}.volume-label label{font-size:14px;color:#e9e2cc}.volume-label output{font:12px/1 ui-monospace,monospace;color:#e4c78b}.volume-control input[type=range]{display:block;width:100%;height:44px;margin:5px 0 0;padding:0;cursor:pointer;accent-color:#ddbd7c;touch-action:pan-y;background:transparent;appearance:none;-webkit-appearance:none}.volume-control input:focus-visible{outline:2px solid #ddbd7c;outline-offset:3px;border-radius:5px}.volume-control input::-webkit-slider-runnable-track{height:7px;border-radius:8px;background:linear-gradient(to right,#c6ab6b var(--volume,70%),#304e3c var(--volume,70%))}.volume-control input::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:26px;height:26px;margin-top:-9.5px;background:#e1ca90;border:3px solid #f2dfaf;border-radius:50%;box-shadow:0 2px 8px #0005}.volume-control input::-moz-range-track{height:7px;border-radius:8px;background:#304e3c}.volume-control input::-moz-range-progress{height:7px;background:#c6ab6b;border-radius:8px}.volume-control input::-moz-range-thumb{width:21px;height:21px;background:#e1ca90;border:3px solid #f2dfaf;border-radius:50%}.volume-control p{font-size:11px!important;line-height:1.5;margin:0;color:#a7b99f}.audio-test{min-height:44px;padding:9px 0;font-size:12px}.audio-test:disabled{opacity:.45}.audio-actions{display:flex;justify-content:space-between;align-items:center;gap:15px;border-top:1px solid #3d533d;padding-top:17px}.audio-actions .text-button{font-size:12px;min-height:44px}.audio-save-note{font-size:10px!important;color:#99ad91!important;margin:16px 0 0!important}.modal-links{flex-wrap:wrap}
