<!-- SOLID CITY · part 1834 -->
lign=ux<-.3?'left':ux>.3?'right':'center';ctx.textBaseline=uy<0?'bottom':'top';ctx.fillText('HOME '+Math.round(flight.lastDistance),ux<-.3?12:ux>.3?-12:0,uy<0?13:-13);ctx.restore()
  }
  function onScreen(p,w,h,m){return p.x>-m&&p.x<w+m&&p.y>-m&&p.y<h+m}
  function drawShip(ctx,p,s,scale,focus){var now=performance.now();ctx.save();ctx.translate(p.x,p.y);ctx.scale(scale,scale);if(s.shieldCharges>0&&now<s.shieldUntil){var pulse=2+Math.sin(elapsed*7)*2;ctx.fillStyle='rgba(70,224,255,.08)';ctx.strokeStyle=now<s.shieldHitUntil?'#ffffff':'#6ef2ff';ctx.lineWidth=now<s.shieldHitUntil?4:1.6;ctx.shadowColor='#38dfff';ctx.shadowBlur=10+pulse;ctx.beginPath();ctx.arc(0,0,31+pulse,0,6.28);ctx.fill();ctx.stroke();ctx.shadowBlur=0;if(now<s.shieldRingUntil){var q=1-(s.shieldRingUntil-now)/700;ctx.globalAlpha=1-q;ctx.lineWidth=2;ctx.beginPath();ctx.arc(0,0,35+q*40,0,6.28);ctx.stroke();ctx.globalAlpha=1}if(now<s.shieldHitUntil){ctx.strokeStyle='#fff';ctx.lineWidth=1;for(var z=0;z<4;z++){var a=z*1.5+elapsed*2;ctx.beginPath();ctx.moveTo(Math.cos(a)*24,Math.sin(a)*24);ctx.lineTo(Math.cos(a+.14)*34,Math.sin(a+.14)*34);ctx.lineTo(Math.cos(a-.08)*39,Math.sin(a-.08)*39);ctx.stroke()}}}else if(now<s.shieldShatterUntil){ctx.globalAlpha=Math.max(0,(s.shieldShatterUntil-now)/500);ctx.strokeStyle='#6ef2ff';ctx.setLineDash([4,6]);ctx.beginPath();ctx.arc(0,0,34+(1-ctx.globalAlpha)*28,0,6.28);ctx.stroke();ctx.setLineDash([]);ctx.globalAlpha=1}ctx.rotate(s.a);if(s.build.bio>0){ctx.save();ctx.strokeStyle='#7dff96';ctx.lineWidth=1.5+s.build.bio*.5;ctx.shadowColor='#46ff77';ctx.shadowBlur=8;for(var t=-1;t<=1;t+=2){ctx.beginPath();ctx.moveTo(-5,t*7);ctx.bezierCurveTo(-17,t*(13+s.build.bio*3),-25,t*(7+s.build.bio*5),-31-s.build.bio*4,t*(12+s.build.bio*3));ctx.stroke()}ctx.globalAlpha=.45+.15*Math.sin(elapsed*4);ctx.fillStyle='#7dff96';ctx.beginPath();ctx.ellipse(-2,0,8+s.build.bio*2,4+s.build.bio,0,0,6.28);ctx.fill();ctx.restore()}ctx.shadowColor=s.color;ctx.shadowBlur=focus?14:8;ctx.fillStyle=s.color;ctx.beginPath();ctx.moveTo(23,0);ctx.lineTo(-14,-12);ctx.lineTo(-8,0);ctx.lineTo(-14,12);ctx.closePath();ctx.fill();if(s.build.thruster>0){ctx.fillStyle=s.color;ctx.globalAlpha=.72;ctx.beginPath();ctx.moveTo(-7,-10);ctx.lineTo(-19-s.build.thruster*4,-18-s.build.thruster*2);ctx.lineTo(-14,-5);ctx.closePath();ctx.fill();ctx.beginPath();ctx.moveTo(-7,10);ctx.lineTo(-19-s.build.thruster*4,18+s.build.thruster*2);ctx.lineTo(-14,5);ctx.closePath();ctx.fill();ctx.globalAlpha=1}if(s.build.cannon>0){ctx.strokeStyle='#fff2aa';ctx.lineWidth=2;for(var c=-1;c<=1;c+=2){ctx.beginPath();ctx.moveTo(2,c*8);ctx.lineTo(17+s.build.cannon*4,c*(9+s.build.cannon));ctx.stroke()}}if(s.build.hull>0){ctx.strokeStyle='#ffffffaa';ctx.lineWidth=1;ctx.beginPath();ctx.moveTo(-9,-8-s.build.hull*2);ctx.lineTo(6,-4);ctx.moveTo(-9,8+s.build.hull*2);ctx.lineTo(6,4);ctx.stroke()}ctx.shadowBlur=0;ctx.fillStyle='#071019';ctx.beginPath();ctx.moveTo(10,0);ctx.lineTo(-7,-5);ctx.lineTo(-4,0);ctx.lineTo(-7,5);ctx.closePath();ctx.fill();var flame=8+Math.random()*8;ctx.fillStyle='#fff3ae';ctx.beginPath();ctx.moveTo(-10,-4);ctx.lineTo(-10-flame,0);ctx.lineTo(-10,4);ctx.fill();ctx.restore()}
  function drawPickup(ctx,p,q,scale){var colors={shield:'#6ef2ff',spread:'#ff9b57',rapid:'#fff26a',repair:'#72ff9d',hull:'#d7e2ee',cannon:'#ff9858',thruster:'#fff06a',bio:'#7dff96'},labels={shield:'S',spread:'3',rapid:'R',repair:'+',hull:'H',cannon:'C',thruster:'T',bio:'B'},bob=Math.sin(q.phase)*3;ctx.save();ctx.translate(p.x,p.y+bob);ctx.scale(scale,scale);ctx.rotate(q.phase*.35);ctx.fillStyle=colors[q.type]+'33';ctx.strokeStyle=colors[q.type];ctx.lineWidth=2;ctx.shadowColor=colors[q.type];ctx.shadowBlur=14;ctx.beginPath();ctx.moveTo(0,-13);ctx.lineTo(13,0);ctx.lineTo(0,13);ctx.lineTo(-13,0);ctx.closePath();ctx.fill();ctx.stroke();ctx.rotate(-q.phase*.35);ctx.shadowBlur=0;ctx.fillStyle='#fff';ctx.font='900 10px ui-monospace,monospace';ctx.textAlign='center';ctx.textBaseline='middle';ctx.fillText(labels[q.type],0,0);ctx.restore()}
  function drawSpeedRing(ctx,p,q,scale){ctx.save();ctx.translate(p.x,p.y);ctx.scale(scale,scale);ctx.rotate(q.phase*.35);ctx.strokeStyle=q.owner?'#44e1d0':'#ffc84a';ctx.shadowColor=ctx.strokeStyle;ctx.shadowBlur=16;ctx.lineWidth=4;ctx.beginPath();ctx.arc(0,0,q.r,0,6.28);ctx.stroke();ctx.lineWidth=1;ctx.setLineDash([4,5]);ctx.beginPath();ctx.arc(0,0,q.r+8,0,6.28);ctx.stroke();ctx.restore()}
  function drawPursuer(ctx,p,q,scale){ctx.save();ctx.translate(p.x,p.y);ctx.rotate(q.a);ctx.scale(scale,scale);ctx.fillStyle='#25060a';ctx.strokeStyle='#ff334f';ctx.lineWidth=3;ctx.shadowColor='#ff1f42';ctx.shadowBlur=18;ctx.beginPath();ctx.moveTo(46,0);ctx.lineTo(-20,-34);ctx.lineTo(-10,-9);ctx.lineTo(-38,0);ctx.lineTo(-10,9);ctx.lineTo(-20,34);ctx.closePath();ctx.fill();ctx.stroke();ctx.fillStyle='#fff';ctx.font='900 9px ui-monospace,monospace';ctx.textAlign='center';ctx.fillText('UNSTOPPABLE',0,4);ctx.restore()}
  function drawBoss(ctx,p,e,scale){ctx.save();ctx.tra