<!-- SOLID CITY · part 3453 -->
'')+(dr.status==='DISABLED'?'disabled ':'')+(dr.id===selectedId?'active':'');b.innerHTML='<b>'+dr.name+'</b><span>'+(dr.status==='DISABLED'?'disabled':dr.owner+' · '+dr.task)+'</span>';b.setAttribute('aria-label',dr.name+', '+dr.owner+', '+dr.status+', '+dr.task);b.addEventListener('click',function(){claimDrone(dr.id)});roster.appendChild(b)});var latBtn=document.getElementById('latticeBtn');if(latBtn)latBtn.hidden=!summit;
    var lock=summit&&['choice','collapse','cage','breach','done'].indexOf(summit.phase)>=0;
    document.querySelectorAll('.order-btn').forEach(function(b){b.disabled=summit?(lock||b.dataset.order!=='LATTICE'):false});
    updateMetrics();updateHUD();
  }
  function openStats(){
    if(paused)return;var types=['ORDER','TAKEOVER','HANDOFF','CLEARED','LOST','RECOVERED','REJECTED'];var labels=['Orders','Takeovers','Handoffs','Cleared','Lost','Recovered','Stale rejected'];var html='';types.forEach(function(t,i){html+='<div class="metric"><b>'+count(t)+'</b><span>'+labels[i]+'</span></div>'});document.getElementById('statsSummary').innerHTML=html;
    document.getElementById('droneRows').innerHTML=drones.map(function(d){return '<tr><td><b>'+d.name+'</b> · '+d.group+'</td><td class="'+(d.owner==='HUMAN'?'owner-human':'owner-ai')+'">'+d.owner+'</td><td>'+d.epoch+'</td><td>'+d.task+'</td><td>'+d.status+'</td><td>'+Math.max(0,Math.round(d.hp))+'%</td></tr>'}).join('');
    document.getElementById('eventList').innerHTML=events.slice().reverse().map(function(e){return '<div class="event"><time>'+e.time+'</time><b>'+e.type+'</b><span><strong>'+e.subject+':</strong> '+e.detail+'</span></div>'}).join('');document.getElementById('statsDialog').showModal();
  }
  function pointerDrone(ev){var r=canvas.getBoundingClientRect(),x=(ev.clientX-r.left)/r.width,y=(ev.clientY-r.top)/r.height,best=null,dist=.045;drones.forEach(function(d){if(d.status!=='ACTIVE')return;var dd=Math.hypot(d.x-x,(d.y-y)*r.height/r.width);if(dd<dist){dist=dd;best=d}});if(best)claimDrone(best.id)}
  canvas.addEventListener('pointerdown',pointerDrone);
  document.getElementById('orderGrid').addEventListener('click',function(e){var b=e.target.closest('[data-order]');if(b)issueOrder(b.dataset.order)});
  document.querySelectorAll('[data-dir]').forEach(function(b){var dir=b.dataset.dir;function on(e){e.preventDefault();pressed[dir]=true}function off(e){e.preventDefault();pressed[dir]=false}b.addEventListener('pointerdown',on);b.addEventListener('pointerup',off);b.addEventListener('pointercancel',off);b.addEventListener('pointerleave',off)});
  window.addEventListener('keydown',function(e){if(paused)return;var map={ArrowUp:'up',w:'up',ArrowDown:'down',s:'down',ArrowLeft:'left',a:'left',ArrowRight:'right',d:'right'};if(map[e.key]){pressed[map[e.key]]=true;e.preventDefault()}if(e.code==='Space'){firePulse();e.preventDefault()}});
  window.addEventListener('keyup',function(e){var map={ArrowUp:'up',w:'up',ArrowDown:'down',s:'down',ArrowLeft:'left',a:'left',ArrowRight:'right',d:'right'};if(map[e.key])pressed[map[e.key]]=false});
  document.getElementById('pulseBtn').addEventListener('click',firePulse);document.getElementById('collapseBtn').addEventListener('click',function(){summitChoose('collapse')});document.getElementById('cageBtn').addEventListener('click',function(){summitChoose('cage')});document.getElementById('releaseBtn').addEventListener('click',releaseSelected);document.getElementById('statsBtn').addEventListener('click',openStats);document.getElementById('closeStats').addEventListener('click',function(){document.getElementById('statsDialog').close()});
  pauseBtn.addEventListener('click',pauseMission);document.getElementById('resumeBtn').addEventListener('click',resumeMission);
  document.getElementById('launchBtn').addEventListener('click',function(){startScreen.hidden=true;missionStart=performance.now();last=missionStart;running=true;pauseBtn.hidden=false;addEvent('LAUNCH','MISSION','Human launched swarm; local coordination channel active');requestAnimationFrame(loop)});
  document.getElementById('restartBtn').addEventListener('click',function(){debrief.hidden=true;setup();missionStart=performance.now();last=missionStart;running=true;pauseBtn.hidden=false;requestAnimationFrame(loop)});
  setup();resize();draw();
})();
</script>
</body>
</html>

===== FILE: public/city/swarm/index.html.bak-cityreturn-20261011 =====
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
  <meta name="color-scheme" content="light dark" />
  <link rel="icon" href="data:," />
  <title>Swarm Command</title>
  <style>
    :root{
      color-scheme:light dark;
      --bg:#071013;--panel:#0d1a1e;--panel2:#122329;--ink:#f2f7f6;--muted:#9bb0b2;
      --line:#284047;--gold:#ffc34d;--gold2:#ff8b3d;--teal:#52e0d0;--red:#ff625f;--green:#7ee39b;
      --shadow:0 18px 48px rgba(0,0,0,.28);--soft:rgba(255,255,255,.055);
    }
   