<!-- SOLID CITY · part 1921 -->
nent:true,target:target,x:x,y:y,vx:(Math.random()-.5)*45,vy:(Math.random()-.5)*45,phase:Math.random()*6.28,life:18})
  }
  function applyComponent(p,s,i){
    if(s.build[p.type]>=2)return;s.build[p.type]++;
    if(p.type==='hull'){s.maxHull+=25;s.hull=s.maxHull}
    if(p.type==='bio'){s.hull=Math.min(s.maxHull,s.hull+22)}
    var names={hull:'PLATING',cannon:'CANNON',thruster:'THRUSTER',bio:'BIO ADAPTATION'},solidity=buildTotal(s);notify(i,names[p.type]+' · SOLIDITY '+solidity+' / 8',1200);burst(s.x,s.y,p.type==='bio'?'#7dff96':s.color,26);p.life=0;
    var total=buildTotal(ships[0])+buildTotal(ships[1]);objectiveEl.textContent='SOLIDIVISM · '+total+' / 16';
    if(total>=16){objectiveEl.textContent='SHIPS SOLID';notify(0,'SHIP SOLID · WHOLE · UNBREAKABLE',1500);notify(1,'SHIP SOLID · WHOLE · UNBREAKABLE',1500);setTimeout(completeLevel,1500)}
  }
  function dropPower(x,y){if(Math.random()>.46)return;var r=Math.random(),type=r<.4?'shield':r<.62?'spread':r<.84?'rapid':'repair';pickups.push({id:nextId++,type:type,x:x,y:y,vx:(Math.random()-.5)*55,vy:(Math.random()-.5)*55,phase:Math.random()*6.28,life:14})}
  function collectPower(p,s,i){if(p.component){applyComponent(p,s,i);return}var now=performance.now();if(p.type==='shield'){s.shieldCharges=Math.min(5,s.shieldCharges+3);s.shieldUntil=now+12000;s.shieldRingUntil=now+700;notify(i,'SHIELD ONLINE',900);burst(s.x,s.y,'#6ef2ff',28)}else if(p.type==='spread'){s.spreadUntil=now+8000;notify(i,'TRIPLE SHOT',800);burst(s.x,s.y,'#ff9b57',18)}else if(p.type==='rapid'){s.rapidUntil=now+8000;notify(i,'RAPID FIRE',800);burst(s.x,s.y,'#fff26a',18)}else{s.hull=Math.min(s.maxHull,s.hull+38);s.repairUntil=now+1400;notify(i,'HULL REPAIRED',800);burst(s.x,s.y,'#72ff9d',18)}p.life=0}
  function fireShot(s,idx,manual){if(!s.alive)return;if(level===5){fireCorridor(s,idx,manual);return}var target=null,autoLock=level===4&&progression.expansionStage===3&&flight.mode==='formation';if(idx===1&&s.coveringTarget!==null)target=enemies.concat(meteors).find(function(o){return o.id===s.coveringTarget&&!o.resolved&&o.hull>0})||null;if(!target)target=nearest(s,enemies,autoLock?1450:(level>=3?980:manual?760:560));if(!target&&(autoLock||(idx===1&&(armEl.checked||s.coveringTarget!==null))))target=nearest(s,meteors,autoLock?1200:500);var a=target?Math.atan2(delta(target.y,s.y,WORLD.h),delta(target.x,s.x,WORLD.w)):s.a;var spread=performance.now()<s.spreadUntil?[-.17,0,.17]:[0];spread.forEach(function(off){var q=a+off;shots.push({fid:nextId++,x:s.x+Math.cos(q)*22,y:s.y+Math.sin(q)*22,vx:Math.cos(q)*700,vy:Math.sin(q)*700,life:1.25,owner:idx,color:s.color})});s.a=a;s.actionTick++;muzzles.push({x:s.x+Math.cos(a)*24,y:s.y+Math.sin(a)*24,color:s.color,life:.1});var badge=document.querySelector('#auto'+idx);badge.classList.add('hot');setTimeout(function(){badge.classList.remove('hot')},90)}
  function autoFire(s,idx,dt){if(!s.alive)return;s.fire-=dt;if(s.fire>0)return;if(level===5){var corridorTarget=corridorThreats.some(function(t){return !t.cleared&&Math.abs(t.x-s.corridorX)<.34&&Math.abs(t.band-s.altitude)<.48});if(corridorTarget){fireCorridor(s,idx,false);s.fire=performance.now()<s.rapidUntil?.085:.18}return}var autoLock=level===4&&progression.expansionStage===3&&flight.mode==='formation',target=null;if(idx===1&&s.coveringTarget!==null)target=enemies.concat(meteors).find(function(o){return o.id===s.coveringTarget&&!o.resolved&&o.hull>0})||null;if(!target)target=nearest(s,enemies,autoLock?1450:(level>=3?980:560));if(!target&&(autoLock||(idx===1&&(armEl.checked||s.coveringTarget!==null))))target=nearest(s,meteors,autoLock?1200:500);if(!target)return;fireShot(s,idx,false);s.fire=performance.now()<s.rapidUntil ? .085 : .18}
  function manualFire(s,idx,dt){if(!s.alive||!fireControl.active)return;s.manualFire-=dt;if(s.manualFire>0)return;fireShot(s,idx,true);s.manualFire=performance.now()<s.rapidUntil ? .065 : .12}
  function clamp(v,a,b){return Math.max(a,Math.min(b,v))}
  function altitudeBand(v){return v>.36?1:v<-.36?-1:0}
  function bandName(v){var b=altitudeBand(v);return b>0?'ABOVE':b<0?'BELOW':'ALONGSIDE'}
  function spawnCorridorRun(){
    var bands=[0,1,-1,0,-1,1],band=bands[progression.corridorSequence%bands.length],isEnemy=progression.corridorSequence%3===2;progression.corridorSequence++;
    [-.56,0,.56].forEach(function(lane,i){corridorThreats.push({id:nextId++,x:lane+(Math.random()-.5)*.08,band:band,z:1.08+i*.025,r:isEnemy?.19:.23,hull:isEnemy?3:2,type:isEnemy?'enemy':'meteor',phase:Math.random()*6.28,cleared:false,hit:false})});
    notify(0,'INCOMING · '+bandName(band),650);notify(1,'INCOMING · '+bandName(band),650)
  }
  function fireCorridor(s,idx,manual){
    var target=null,best=9;if(flight.mode==='formation'){corridorThreats.forEach(function(t){if(t.cleared)return;var d=t.z+Math.abs(t.x-s.corridorX)*.65+Math.abs(t.band-s.altitude)*.45;if(d<best){best=d;target=t}})}else{corridorThreats.forEach(function(t){if(t.cleared)return;var d=t.z+Math.abs(t.x-s.corrid