<!-- SOLID-PLAYTIME · part 198 -->
t.interact();if(de==="escape")ft("pause")},lt=(Kt)=>{let Yt=Y.current;if(!Yt)return;let de=Kt.key.toLowerCase();if(["w","a","s","d","arrowup","arrowdown","arrowleft","arrowright"].includes(de))Yt.setMovement(0,0);if(de==="shift")Yt.setRun(!1);if(de==="v")Yt.setVision(!1)};return window.addEventListener("keydown",I),window.addEventListener("keyup",lt),()=>{window.removeEventListener("keydown",I),window.removeEventListener("keyup",lt)}});function E(){if(!U||ce.current)return;let I=window.AudioContext??window.webkitAudioContext;if(!I)return;let lt=new I,Kt=lt.createGain();Kt.gain.value=0.025,Kt.connect(lt.destination);let Yt=[55,82.4,110].map((de,Os)=>{let Zn=lt.createOscillator();Zn.type=Os===0?"sine":"triangle",Zn.frequency.value=de;let zs=lt.createGain();return zs.gain.value=Os===0?0.8:0.18,Zn.connect(zs).connect(Kt),Zn.start(),Zn});ce.current={context:lt,nodes:Yt,gain:Kt}}function B(){let I=ce.current;if(!I)return;I.nodes.forEach((lt)=>lt.stop()),I.context.close(),ce.current=null}function tt(){o("world"),E(),xr("Far from home.",v),xe("FAR FROM HOME")}function st(){let I=kt.current;if(I)I.pause(),I.currentTime=0;at(Kf.length),o("title")}function Q(){let I=kt.current;if(!I)return;I.currentTime=0,at(0),I.play()}function Tt(){let I=kt.current;if(!I||!Number.isFinite(I.duration)||I.duration<=0)return;let lt=Math.min(Kf.length,Math.floor(I.currentTime/I.duration*Kf.length+0.5));at(lt)}function z(){let I=Bt.current;if(!I||!Number.isFinite(I.duration)||I.duration<=0)return;let lt=Math.min(Zf.length,Math.floor(I.currentTime/I.duration*Zf.length+0.5));ht(lt)}function j(){let I=Bt.current;if(I)I.pause(),I.currentTime=0;ht(Zf.length),o("world"),xe("THE ROAD HEARD SOLID'S WORD")}function ft(I){if(r==="world")D.current=r;if(I==="pause")be();o(I),Y.current?.setMovement(0,0),Y.current?.setRun(!1),Y.current?.setVision(!1)}function K(){o(D.current==="world"?"world":"world")}function rt(I,lt){X((Kt)=>{let Yt=new Set(Kt);if(lt)Yt.add(I);else Yt.delete(I);return Yt})}function _t(I,lt){rt(I,!0),lt(),window.setTimeout(()=>rt(I,!1),140)}function Lt(I){let lt={...vt.current.settings,...I};if(y(lt.voice),d(lt.music),m(lt.sensitivity),Y.current?.updateSettings(lt),vt.current={...vt.current,settings:lt},lt.music)E();else B();Ee(vt.current)}function gt(I){let lt=Wc.find((de)=>de.id===mt);if(!lt)return;if(I!==lt.correct){Ft("THE PANEL HOLDS. REVIEW THE METHOD AND TRY AGAIN.");return}let Kt={...vt.current.settings.ascension.tools,[lt.id]:!0},Yt=Wc.every((de)=>Kt[de.id]);if(Lt({ascension:{tools:Kt,graduated:Yt}}),Ft(Yt?"ASCENSION COMPLETE. NUMBERS FALL AWAY. SOLIDITRONIUM IS THE STANDARD.":`${lt.name} MASTERED. THE NEXT INSTRUMENT AWAITS.`),Yt)xr("Ascension complete. The future opens beyond numbers.",v)}function Wt(I){if(Ue.current!==I.pointerId)return;let lt=I.clientX-Dt.current.x,Kt=I.clientY-Dt.current.y,Yt=Math.max(1,Math.hypot(lt,Kt)),de=Math.min(42,Yt),Os=lt/Yt*de,Zn=Kt/Yt*de,zs=I.currentTarget.querySelector(".stick");if(zs)zs.style.transform=`translate(${Os}px, ${Zn}px)`;Y.current?.setMovement(Os/42,-Zn/42)}function P(I){let lt=I.currentTarget.getBoundingClientRect();Ue.current=I.pointerId,Dt.current={x:lt.left+lt.width/2,y:lt.top+lt.height/2},I.currentTarget.setPointerCapture(I.pointerId),Wt(I)}function xt(I){if(Ue.current!==I.pointerId)return;Ue.current=null,Y.current?.setMovement(0,0);let lt=I.currentTarget.querySelector(".stick");if(lt)lt.style.transform="translate(0, 0)"}function Ut(I){if(r!=="world")return;It.current={id:I.pointerId,x:I.clientX,y:I.clientY},I.currentTarget.setPointerCapture(I.pointerId)}function Rt(I){let lt=It.current;if(!lt||lt.id!==I.pointerId)return;Y.current?.orbit(I.clientX-lt.x,I.clientY-lt.y),It.current={id:lt.id,x:I.clientX,y:I.clientY}}function ct(I){if(It.current?.id===I.pointerId)It.current=null}function it(I){let lt=I.trim();if(!lt)return;let Kt=lt.toLowerCase(),Yt="I am beside you in the open highlands. Ask me of the road, vision, the blade, or the chest.";if(/rank|strong/.test(Kt))Yt=`${l.rank} is the word the world gives you. ${l.cleared?"Gold burns behind you; the next seal waits.":"The first nightmare waits beyond the shore."}`;else if(/vision|hidden|shard/.test(Kt))Yt="Hold hero vision near a palace. Blacklight reveals a secret path and the Star Shard the dark hoped you would pass.";else if(/where|go|road|path/.test(Kt))Yt=l.cleared===le.length?"The golden road is awake. Follow the warm light to the castle.":`Seek ${le[l.cleared]?.name??"the castle"}. The compass knows its direction.`;else if(/dawn|beam|radiance/.test(Kt))Yt="When radiance is whole, strike. Dawnbeam carries every ounce of gathered light through distance.";else if(/enemy|boss|fight/.test(Kt))Yt="Move around the nightmare, break its sentinels, and do not meet a hazard standing still. The sovereign waits after them.";T((de)=>[...de,{who:"LIGHT-BEARER",text:lt},{who:"SOLID",text:Yt}]),b(""),xr(Yt,v)}async function Ct(I){I.preventDefault();let lt=M.trim();if(!lt)return;try{let Kt=await s.mut