<!-- SOLID-PLAYTIME · part 171 -->
=l*0.7,u.add(v);let y=new On(c.color,t?12:22,92,2);y.position.y=18,u.add(y),u.userData.spin=l%2?-0.1:0.1,this.scene.add(u),this.distantLayers.push(u)}let s=[],a=t?64:150;for(let l=0;l<a;l+=1){let c=l*2.399,u=52+l*41%365,f=Math.sin(c)*u,h=Math.cos(c)*u,p=this.ground(f,h)+0.22,v=5+l%9;s.push(f,p,h,f+Math.cos(c)*v,p+0.04,h-Math.sin(c)*v)}let r=new me;r.setAttribute("position",new Zt(s,3));let o=new ji(r,new Sn({color:16750136,transparent:!0,opacity:0.24,blending:Ye,depthWrite:!1}));this.scene.add(o),this.distantLayers.push(o)}buildEmbers(t){let e=t?260:520,n=new Float32Array(e*3),i=new Float32Array(e*3);for(let r=0;r<e;r+=1){let o=r%4,l=o<2?o===0?-18:36:o===2?50:278,c=o<2?o===0?126:72:o===2?-95:92,u=o<2?92:72,f=l+(Math.random()-0.5)*u,h=c+(Math.random()-0.5)*u;n[r*3]=f,n[r*3+1]=this.ground(f,h)+3+Math.random()*(o<2?38:66),n[r*3+2]=h;let p=r%5===0;i[r*3]=1,i[r*3+1]=p?0.86:0.34,i[r*3+2]=p?0.38:0.07}this.emberOrigin=n.slice();let s=new me;s.setAttribute("position",new tn(n,3)),s.setAttribute("color",new tn(i,3));let a=new Bs({color:16777215,vertexColors:!0,size:t?3.4:3.1,transparent:!0,opacity:1,blending:Ye,depthWrite:!1,sizeAttenuation:!0,toneMapped:!1,map:window._roundStarTex});this.embers=new ts(s,a),this.scene.add(this.embers),this.distantLayers.push(this.embers)}buildContinuumMonument(){let t=document.createElement("canvas");t.width=1024,t.height=1536,this.leaderboardCanvas=t;let e=new qo(t);e.colorSpace=Hs,e.anisotropy=Math.min(4,this.renderer.capabilities.getMaxAnisotropy()),this.leaderboardTexture=e,this.paintLeaderboard({status:"loading",leaders:[]});let n=this.ground(Aa.x,Aa.y),i=new At(new fn(9,17,4.2,9),new Pe({color:526866,roughness:0.8,metalness:0.5,emissive:659735,emissiveIntensity:0.45}));i.position.set(Aa.x,n+1.5,Aa.y),this.scene.add(i);this.leaderboardMesh=i;let s=new he;s.position.set(Aa.x,n+3.2,Aa.y),s.lookAt(Jc.x,n+3.2,Jc.y);let a=new At(new $e(13.8,27,1.5),new Pe({color:329741,emissive:1056548,emissiveIntensity:0.7,roughness:0.3,metalness:0.84}));a.position.y=13.5,s.add(a);this.leaderboardBox=a;let r=new At(new qn(11.5,23.8),new Pn({map:e,toneMapped:!1}));r.position.set(0,13.5,0.77),s.add(r);let o=new Pe({color:13015613,emissive:8149019,emissiveIntensity:1.25,roughness:0.2,metalness:0.78}),l=new Pe({color:7533823,emissive:894904,emissiveIntensity:1.2,roughness:0.2,metalness:0.7}),c=new At(new $e(0.28,27.6,1.9),o);c.position.set(-7.04,13.5,0),s.add(c);let u=c.clone();u.position.x=7.04,s.add(u);let f=new At(new $e(14.3,0.3,1.9),l);f.position.set(0,27.15,0),s.add(f);let h=f.clone();h.position.y=-0.15,s.add(h);let p=new At(new ns(1.15,0),o);p.scale.set(0.58,1.7,0.58),p.position.set(0,29.2,0),s.add(p);let v=new On(16765803,20,58,2);v.position.set(0,21,4),s.add(v);let y=new On(7533823,13,46,2);y.position.set(0,7,3),s.add(y),this.scene.add(s)}paintLeaderboard(t){let e=this.leaderboardCanvas;if(!e)return;let n=e.getContext("2d");if(!n)return;let{width:i,height:s}=e,a=n.createLinearGradient(0,0,i,s);a.addColorStop(0,"#05080d"),a.addColorStop(0.48,"#0a1118"),a.addColorStop(1,"#07050c"),n.fillStyle=a,n.fillRect(0,0,i,s),n.strokeStyle="rgba(114,244,255,.28)",n.lineWidth=2;for(let o=0;o<16;o+=1)n.beginPath(),n.ellipse(i/2,s/2,90+o*44,160+o*61,0,0,Math.PI*2),n.stroke();let r=n.createLinearGradient(0,0,i,0);if(r.addColorStop(0,"rgba(255,211,107,0)"),r.addColorStop(0.5,"rgba(255,231,153,.88)"),r.addColorStop(1,"rgba(255,211,107,0)"),n.fillStyle=r,n.fillRect(72,380,i-144,3),n.textAlign="center",n.textBaseline="middle",n.fillStyle="#fff3be",n.shadowColor="rgba(255,203,71,.72)",n.shadowBlur=20,n.font="700 54px serif",n.fillText("LEADERBOARD OF",i/2,116),n.font="700 65px serif",n.fillText("CONTINUUM",i/2,199),n.fillStyle="#bcfbff",n.shadowColor="rgba(78,240,255,.74)",n.fillText("INFUSION",i/2,282),n.shadowBlur=0,n.font="700 26px sans-serif",n.fillStyle="#d6cba9",n.textAlign="left",n.fillText("RANK",76,342),n.fillText("TRAVELER",230,342),n.textAlign="right",n.fillText("INFUSION",i-76,342),t.status!=="ready")n.textAlign="center",n.font="600 38px sans-serif",n.fillStyle=t.status==="error"?"#c7c2ae":"#d5faff",n.fillText(t.status==="error"?"The board is dark.":"Reading the continuum…",i/2,760);else if(t.leaders.length===0)n.textAlign="center",n.font="600 34px sans-serif",n.fillStyle="#f1dfaa",n.fillText("No travelers infused yet — be the first.",i/2,760);else t.leaders.forEach((o,l)=>{let c=438+l*101;n.fillStyle=l%2===0?"rgba(114,244,255,.055)":"rgba(255,211,92,.045)",n.fillRect(62,c-43,i-124,86),n.strokeStyle="rgba(255,225,137,.16)",n.beginPath(),n.moveTo(68,c+45),n.lineTo(i-68,c+45),n.stroke(),n.font=l<3?"700 42px serif":"600 36px sans-serif",n.fillStyle=l<3?"#ffe49a":"#c7faff",n.textAlign="left",n.fillText(String(l+1).padStart(2,"0"),82,c),n.font=l<3?"700 36px sans-serif":"600 34px sans-serif",n.fillStyle="#fff5d1";let f=o.name.replace(/\s+/g," ").slice(0,80);while(f.length>1&&n.measureText(f).width>480)f=`${f.slice(0,-2)}…`;n.fillText(f,230,c),n.textAlign="right",n.fillStyle=