<!-- SOLID CITY · part 1870 -->
vel===5){drawCorridorView(ctx,w,h,index);return}var g=ctx.createRadialGradient(w*.5,h*.45,10,w*.5,h*.5,Math.max(w,h));g.addColorStop(0,'#111b2b');g.addColorStop(1,'#02040a');ctx.fillStyle=g;ctx.fillRect(0,0,w,h);var baseScale=Math.max(.68,Math.min(1.05,Math.min(w/700,h/500))),scale=level===3?baseScale/(1+(progression.expansionStage-1)*.22):baseScale;
    nebula.forEach(function(n){var p=worldToScreen(n,cam,w,h,scale);ctx.beginPath();ctx.fillStyle=n.c;ctx.arc(p.x,p.y,n.r*scale,0,6.28);ctx.fill()});
    stars.forEach(function(s){var p=worldToScreen(s,cam,w,h,scale);if(p.x>-3&&p.x<w+3&&p.y>-3&&p.y<h+3){ctx.globalAlpha=s.a;ctx.fillStyle='#d8e9ff';ctx.fillRect(p.x,p.y,s.r,s.r)}});ctx.globalAlpha=1;
    hazards.forEach(function(q){if(progression.expansionStage<q.stage)return;var p=worldToScreen(q,cam,w,h,scale);if(onScreen(p,w,h,q.r*scale)){ctx.save();ctx.globalAlpha=.13+.04*Math.sin(elapsed*3);ctx.fillStyle=q.color;ctx.strokeStyle=q.color;ctx.lineWidth=2;ctx.beginPath();ctx.arc(p.x,p.y,q.r*scale,0,6.28);ctx.fill();ctx.setLineDash([7,9]);ctx.stroke();ctx.restore()}});
    rings.forEach(function(q){var p=worldToScreen(q,cam,w,h,scale);if(onScreen(p,w,h,45))drawSpeedRing(ctx,p,q,scale)});
    if(progression.pursuer){var p=worldToScreen(progression.pursuer,cam,w,h,scale);if(onScreen(p,w,h,70))drawPursuer(ctx,p,progression.pursuer,scale)}
    meteors.forEach(function(m){var p=worldToScreen(m,cam,w,h,scale);if(onScreen(p,w,h,50))drawMeteor(ctx,p,m,scale)});
    pickups.forEach(function(q){var p=worldToScreen(q,cam,w,h,scale);if(onScreen(p,w,h,30))drawPickup(ctx,p,q,scale)});
    enemies.forEach(function(e){var p=worldToScreen(e,cam,w,h,scale);if(onScreen(p,w,h,e.isPrime?90:e===progression.boss?80:30)){if(e.isPrime)drawPrime(ctx,p,e,scale);else if(e===progression.boss)drawBoss(ctx,p,e,scale);else drawDrone(ctx,p,e,scale)}});
    if(level===6&&progression.summit){var sm6=progression.summit;
      if(sm6.phase==='pairs')Object.keys(sm6.pairState).forEach(function(pid){var st=sm6.pairState[pid];if(st.resolved)return;var ms=enemies.filter(function(o){return o.pairId===pid&&o.hull>0&&!o.pairDone});if(ms.length===2){var p1=worldToScreen(ms[0],cam,w,h,scale),p2=worldToScreen(ms[1],cam,w,h,scale);ctx.save();ctx.strokeStyle=ms[0].enraged||ms[1].enraged?'rgba(255,91,102,.55)':'rgba(255,255,255,.22)';ctx.lineWidth=1;ctx.setLineDash([4,6]);ctx.beginPath();ctx.moveTo(p1.x,p1.y);ctx.lineTo(p2.x,p2.y);ctx.stroke();ctx.restore()}});
      if(sm6.phase==='shock'&&sm6.prime){var pr=worldToScreen(sm6.prime,cam,w,h,scale),rad=sm6.shockT/2.8*620;ctx.save();ctx.strokeStyle='rgba(255,242,168,'+Math.max(0,1-sm6.shockT/2.8)+')';ctx.lineWidth=6;ctx.shadowColor='#ffc84a';ctx.shadowBlur=30;ctx.beginPath();ctx.arc(pr.x,pr.y,rad*scale,0,6.28);ctx.stroke();ctx.restore()}
    }
    shots.forEach(function(s){var p=worldToScreen(s,cam,w,h,scale);if(onScreen(p,w,h,10)){ctx.strokeStyle=s.color;ctx.lineWidth=2;ctx.beginPath();ctx.moveTo(p.x,p.y);ctx.lineTo(p.x-s.vx*.025,p.y-s.vy*.025);ctx.stroke()}});
    bolts.forEach(function(b){var p=worldToScreen(b,cam,w,h,scale);if(onScreen(p,w,h,10)){ctx.fillStyle='#ff4864';ctx.shadowColor='#ff264d';ctx.shadowBlur=8;ctx.beginPath();ctx.arc(p.x,p.y,4,0,6.28);ctx.fill();ctx.shadowBlur=0}});
    sparks.forEach(function(s){var p=worldToScreen(s,cam,w,h,scale);if(onScreen(p,w,h,6)){ctx.globalAlpha=Math.min(1,s.life*2);ctx.fillStyle=s.color;ctx.fillRect(p.x,p.y,2,2)}});ctx.globalAlpha=1;
    muzzles.forEach(function(m){var p=worldToScreen(m,cam,w,h,scale);if(onScreen(p,w,h,12)){ctx.globalAlpha=Math.min(1,m.life*10);ctx.fillStyle='#fff7c5';ctx.shadowColor=m.color;ctx.shadowBlur=16;ctx.beginPath();ctx.arc(p.x,p.y,4+m.life*35,0,6.28);ctx.fill();ctx.shadowBlur=0}});ctx.globalAlpha=1;
    if(level>=3){ctx.save();ctx.strokeStyle=level===4&&flight.mode==='formation'?'#44e1d055':'#ffffff18';ctx.lineWidth=1;ctx.setLineDash([3,8]);ctx.beginPath();ctx.arc(w/2,h/2,(level===3?140:180)+(progression.expansionStage-1)*34,0,6.28);ctx.stroke();ctx.restore()}
    drawTogetherness(ctx,cam,w,h,scale,index);
    ships.forEach(function(s,si){if(!s.alive)return;var p=worldToScreen(s,cam,w,h,scale);if(onScreen(p,w,h,55))drawShip(ctx,p,s,scale,si===index)});
    if(index===0&&armEl.checked){ctx.strokeStyle='#ffc84a20';ctx.setLineDash([4,6]);ctx.beginPath();ctx.arc(w/2,h/2,82,0,6.28);ctx.stroke();ctx.setLineDash([])}
    ctx.fillStyle='rgba(0,0,0,.16)';ctx.fillRect(0,0,w,28);ctx.fillRect(0,h-18,w,18)
  }
  function drawTogetherness(ctx,cam,w,h,scale,index){
    if(!ships[0].alive||!ships[1].alive)return;var partner=ships[index?0:1],p=worldToScreen(partner,cam,w,h,scale),now=performance.now();
    if(flight.mode==='formation'){
      var self=worldToScreen(ships[index],cam,w,h,scale),pulse=.22+Math.sin(elapsed*5)*.06;ctx.save();ctx.strokeStyle='rgba(112,239,220,'+pulse+')';ctx.lineWidth=1.4;ctx.setLineDash([5,7]);ctx.beginPath();ctx.moveTo(self.x,self.y);ctx.lineTo(p.x,p.y);ctx.stroke();ctx.setLineDash([]);
      if(