<!-- SOLID CITY · part 1905 -->
ind(function(t){return t.id===s.target&&!t.cleared});if(target&&flight.mode==='formation'){s.x+=(target.x-s.x)*dt*3.2;s.alt+=(target.band-s.alt)*dt*3.2}corridorThreats.forEach(function(t){if(t.cleared||s.life<=0)return;if(Math.abs(t.z-s.z)<.075&&Math.abs(t.x-s.x)<t.r&&Math.abs(t.band-s.alt)<.34){s.life=0;t.hull-=flight.mode==='formation'?2:1;if(t.hull<=0){t.cleared=true;progression.corridorCleared++;metrics.kills++;ships[s.owner].score+=100;metrics.coordinated+=flight.mode==='formation'?1:0;dropCorridorPower(t);notify(s.owner,flight.mode==='formation'?'FORMATION STRIKE':'HEAD-ON HIT',420)}}})});
    corridorThreats.forEach(function(t){if(t.cleared)return;t.phase+=dt*(t.type==='enemy'?4:1.7);if(t.type==='enemy')t.x+=Math.sin(t.phase)*dt*.045;t.z-=dt*(.255+Math.min(.11,levelElapsed*.0025));if(t.z<=.045){var hit=false;ships.forEach(function(s,i){if(s.alive&&Math.abs(t.x-s.corridorX)<t.r+.13&&Math.abs(t.band-s.altitude)<.38){damage(s,i,t.type==='enemy'?27:36,t.type==='enemy'?'attack run':'meteor');hit=true}});t.cleared=true;progression.corridorCleared++;if(!hit){ships[0].score+=30;ships[1].score+=30}}});
    corridorPickups.forEach(function(p){if(p.collected)return;p.phase+=dt*3;p.z-=dt*.22;var bestShip=nearestCorridorShip(p);if(bestShip&&p.z<.2&&Math.abs(p.x-bestShip.s.corridorX)<.26&&Math.abs(p.band-bestShip.s.altitude)<.38){p.collected=true;collectPower({type:p.type,component:false,life:1},bestShip.s,bestShip.i)}if(p.z<0)p.collected=true});
    corridorShots=corridorShots.filter(function(s){return s.life>0&&s.z<1.18});corridorThreats=corridorThreats.filter(function(t){return !t.cleared});corridorPickups=corridorPickups.filter(function(p){return !p.collected});
    objectiveEl.textContent='THREAD THE CORRIDOR · '+Math.min(24,progression.corridorCleared)+' / 24 · '+bandName(human.altitude);speedValueEl.textContent=String(Math.min(599,390+Math.round(levelElapsed*4))).padStart(3,'0');speedBarEl.style.setProperty('--speed','100%');if(progression.corridorCleared>=24&&levelElapsed>16)completeLevel()
  }
  function nearestCorridorShip(p){var best=null,bd=9;ships.forEach(function(s,i){if(!s.alive)return;var d=Math.abs(p.x-s.corridorX)+Math.abs(p.band-s.altitude);if(d<bd){bd=d;best={s:s,i:i}}});return best}
  function updateLevelSystems(dt){
    if(level===2||level===4){
      [0,1].forEach(function(owner){if(!rings.some(function(r){return r.owner===owner}))spawnSpeedRing(owner)});
      rings.forEach(function(r){r.phase+=dt*2;var s=ships[r.owner];if(s.alive&&distObj(r,s)<r.r+18){s.ringScore++;s.speedBank=Math.min(100,s.speedBank+42);r.life=0;notify(r.owner,'SPEED BANKED '+s.ringScore+'/3',700);burst(r.x,r.y,s.color,18)}});rings=rings.filter(function(r){return r.life!==0});
    }
    if(level===2){
      var p=progression.pursuer,target=ships[0].ringScore<ships[1].ringScore?ships[0]:ships[1];if(p){steer(p,target.x,target.y,dt,285);var pl=Math.hypot(p.vx,p.vy);if(pl>315){p.vx=p.vx/pl*315;p.vy=p.vy/pl*315}p.a=Math.atan2(p.vy,p.vx);p.x=wrapX(p.x+p.vx*dt);p.y=wrapY(p.y+p.vy*dt);ships.forEach(function(s,i){if(distObj(p,s)<58&&performance.now()-p.lastHit>700){p.lastHit=performance.now();damage(s,i,24,'pursuer');s.speedBank=Math.max(0,s.speedBank-30);var dx=delta(s.x,p.x,WORLD.w),dy=delta(s.y,p.y,WORLD.h),d=Math.hypot(dx,dy)||1;s.vx+=dx/d*180;s.vy+=dy/d*180;notify(i,'OUTRUN IT',600)}})}
      var fast=ships.every(function(s){return s.ringScore>=3&&Math.hypot(s.vx,s.vy)>=SPEED_TARGET});progression.speedHold=fast?progression.speedHold+dt:Math.max(0,progression.speedHold-dt*1.4);objectiveEl.textContent='RINGS '+Math.min(3,ships[0].ringScore)+'/3 + '+Math.min(3,ships[1].ringScore)+'/3 · HOLD '+progression.speedHold.toFixed(1)+'/3.0s';if(progression.speedHold>=3)completeLevel()
    }
    if(level===3){
      var stage=progression.levelKills>=12?3:progression.levelKills>=5?2:1;if(stage>progression.expansionStage){progression.expansionStage=stage;notify(0,stage===3?'REACH EXPANSION':'SECTOR '+stage+' OPEN',1500);notify(1,stage===3?'REACH EXPANSION':'SECTOR '+stage+' OPEN',1500);burst(ships[0].x,ships[0].y,'#b9a7ff',28);burst(ships[1].x,ships[1].y,'#b9a7ff',28)}objectiveEl.textContent=stage===3?'REACH EXPANSION · CLEAR THE FRONTIER '+progression.levelKills+'/18':'PUSH OUTWARD · SECTOR '+stage+' / 3';if(stage===3&&progression.levelKills>=18)completeLevel()
    }
    hazards.forEach(function(h){if(progression.expansionStage<h.stage)return;h.phase=(h.phase||0)+dt;ships.forEach(function(s,i){var d=distObj(h,s);if(d<h.r){if(h.type==='ion'){s.vx*=Math.pow(.965,dt*60);s.vy*=Math.pow(.965,dt*60)}else if(Math.sin(elapsed*3+i)>.985)damage(s,i,6,'rift')}})});
    if(level===4&&progression.boss){var locked=progression.expansionStage===3&&flight.mode==='formation';objectiveEl.textContent=(locked?'AUTO-LOCK · ':'LOCK LOST · ')+Math.max(0,Math.ceil(progression.boss.hull))+' / '+progression.boss.maxHull;if(locked){flightStateEl.textContent='FORMATION · LOCK';flightStateEl.className='flight-state formation'}if(progre