<!-- SOLID CITY · part 2901 -->
alAlpha=known?1:.2+.08*progress;
    const shudder=(a.phase==='anchor'||a.phase==='retrieve')?Math.sin(elapsed*20)*(1-a.integrity/100)*4:0;ctx.translate(shudder,0);
    ctx.strokeStyle=known?'#708791':'#41545c';ctx.fillStyle='#0a151a';ctx.lineWidth=4;
    ctx.beginPath();ctx.moveTo(-78,-34);ctx.lineTo(52,-34);ctx.lineTo(82,0);ctx.lineTo(52,34);ctx.lineTo(-78,34);ctx.lineTo(-94,0);ctx.closePath();ctx.fill();ctx.stroke();
    ctx.beginPath();ctx.moveTo(-30,-34);ctx.lineTo(-9,-6);ctx.lineTo(-20,14);ctx.lineTo(10,34);ctx.strokeStyle=progress>1||known?'#ff6375':'#41545c';ctx.lineWidth=2+progress;ctx.stroke();
    ctx.strokeStyle='#536a74';ctx.lineWidth=5;ctx.beginPath();ctx.moveTo(-72,0);ctx.lineTo(58,0);ctx.stroke();
    const total=13,lit=Math.floor(total*Math.max(0,Math.min(1,a.lights)));
    for(let i=0;i<total;i++){const x=-66+i*10.2,on=i<lit;ctx.fillStyle=on?'#ffc857':'#1a2c34';if(on){ctx.shadowColor='#ffc857';ctx.shadowBlur=14}else ctx.shadowBlur=0;ctx.beginPath();ctx.arc(x,0,on?3.5:2.5,0,Math.PI*2);ctx.fill()}
    ctx.shadowBlur=0;if(known){ctx.fillStyle='#d8edf2';ctx.font='700 12px "Arial Narrow"';ctx.textAlign='center';ctx.fillText('LANTERN ANCHOR',0,-49);if(a.phase==='choice'||a.phase==='retrieve'){ctx.fillStyle='#ff6375';ctx.beginPath();ctx.arc(-18,18,5+Math.sin(elapsed*6)*2,0,Math.PI*2);ctx.fill()}}
    ctx.restore();
  }
  function drawHazard(h){ctx.save();ctx.translate(h.x,h.y);ctx.rotate(h.spin);ctx.strokeStyle='rgba(255,99,117,.48)';ctx.fillStyle='rgba(255,70,92,.05)';ctx.lineWidth=2;ctx.setLineDash([8,8]);ctx.beginPath();ctx.arc(0,0,h.r,0,Math.PI*2);ctx.fill();ctx.stroke();ctx.setLineDash([]);for(let i=0;i<3;i++){ctx.rotate(2.094);ctx.fillStyle='rgba(255,99,117,.28)';ctx.beginPath();ctx.moveTo(0,-8);ctx.lineTo(10,-h.r*.72);ctx.lineTo(-10,-h.r*.72);ctx.closePath();ctx.fill()}ctx.restore()}
  function drawDebris(d){ctx.save();ctx.translate(d.x,d.y);ctx.fillStyle='#59666b';ctx.strokeStyle='#8d9da3';ctx.beginPath();for(let i=0;i<7;i++){const a=i/7*Math.PI*2,r=d.r*(.7+((i*3)%5)/10);const x=Math.cos(a)*r,y=Math.sin(a)*r;i?ctx.lineTo(x,y):ctx.moveTo(x,y)}ctx.closePath();ctx.fill();ctx.stroke();ctx.restore()}
  function drawPod(p){if(p.status==='rescued'||p.status==='lost')return;ctx.save();ctx.translate(p.x,p.y);const cargo=p.status==='cargo';ctx.strokeStyle=p.hp<42?'#ff6375':'#ffc857';ctx.fillStyle='#1e3037';ctx.lineWidth=3;ctx.shadowColor=ctx.strokeStyle;ctx.shadowBlur=10;ctx.beginPath();ctx.roundRect(-14,-9,28,18,8);ctx.fill();ctx.stroke();ctx.shadowBlur=0;if(!cargo){ctx.globalAlpha=.32;ctx.beginPath();ctx.arc(0,0,48,0,Math.PI*2);ctx.stroke();ctx.globalAlpha=1;ctx.fillStyle='#eefcff';ctx.font='600 11px system-ui';ctx.textAlign='center';ctx.fillText(p.id+' · '+Math.ceil(p.hp)+'%',0,-56);if(p.stabilize>0){ctx.fillStyle='rgba(0,0,0,.7)';ctx.fillRect(-28,18,56,5);ctx.fillStyle='#ffc857';ctx.fillRect(-28,18,56*(p.stabilize/100),5)}}ctx.restore()}
  function drawEnemy(e){ctx.save();ctx.translate(e.x,e.y);ctx.rotate(Math.PI);ctx.fillStyle='#b72a42';ctx.strokeStyle='#ff8290';ctx.lineWidth=2;ctx.beginPath();ctx.moveTo(18,0);ctx.lineTo(-11,-9);ctx.lineTo(-5,0);ctx.lineTo(-11,9);ctx.closePath();ctx.fill();ctx.stroke();ctx.restore()}
  function drawShot(s){ctx.save();ctx.fillStyle='#72f7ff';ctx.shadowColor='#72f7ff';ctx.shadowBlur=9;ctx.beginPath();ctx.arc(s.x,s.y,3,0,Math.PI*2);ctx.fill();ctx.restore()}
  function drawShip(){const s=state.ship;ctx.save();ctx.translate(s.x,s.y);ctx.rotate(s.angle);ctx.fillStyle='#d4eef2';ctx.strokeStyle='#42dce5';ctx.lineWidth=2;ctx.shadowColor='#42dce5';ctx.shadowBlur=10;ctx.beginPath();ctx.moveTo(22,0);ctx.lineTo(-13,-13);ctx.lineTo(-8,-4);ctx.lineTo(-19,0);ctx.lineTo(-8,4);ctx.lineTo(-13,13);ctx.closePath();ctx.fill();ctx.stroke();ctx.shadowBlur=0;ctx.fillStyle='#ffc857';ctx.fillRect(-18,-3,7,6);if(s.pulse>0){ctx.strokeStyle='rgba(87,231,255,'+(.25+s.pulse/2)+')';ctx.beginPath();ctx.arc(0,0,32+s.pulse*10,0,Math.PI*2);ctx.stroke()}ctx.restore()}

  function updateUI(){
    const s=state.ship,p=s.cargo,a=state.anchor;$('#shipVal').textContent=Math.ceil(s.hp)+'%';$('#shipBar').style.width=s.hp+'%';$('#shieldVal').textContent=Math.ceil(s.shield)+'%';$('#shieldBar').style.width=s.shield+'%';$('#shipMeter').classList.toggle('danger',s.hp<35);
    $('#podVal').textContent=p?Math.ceil(p.hp)+'%':'None';$('#podBar').style.width=p?p.hp+'%':'0%';$('#anchorVal').textContent=Math.ceil(a.integrity)+'%';$('#anchorBar').style.width=a.integrity+'%';
    $('#rescuedCount').textContent=state.rescued;const originalOpen=state.pods.filter(x=>x.status==='adrift'||x.status==='cargo').length;const fourthOpen=(a.heartbeat.status==='unknown'||a.heartbeat.status==='located')?1:0;$('#remainingCount').textContent=originalOpen+fourthOpen;$('#riskCount').textContent=state.risk+(a.phase==='retrieve'?1:0);$('#lostCount').textContent=state.lost;
    let obj;
    if(a.phase==='scan')obj=a.scan<100?'Approach Lantern Anchor while the AI locates its structural weakness.':'Mark the