<!-- SOLID CITY · part 3174 -->
lass="label">heart charge</span></div></div><p style="font-size:10px;color:var(--muted);line-height:1.5">All totals above are reduced from this session’s recorded events. Handoff latency is measured locally from claim input to committed ownership. No values persist after reload.</p>';}
    if(which==='events'){title.textContent='Coordination Events';var list=events.slice().reverse().slice(0,80).map(function(e){var detail=Object.keys(e).filter(function(k){return !['id','type','t','at','message'].includes(k)}).map(function(k){return k+': '+(typeof e[k]==='number'?Math.round(e[k]*100)/100:e[k])}).join(' · ');return '<div class="event"><span>'+fmt(e.t)+'</span><b>'+e.type.replaceAll('_',' ')+'</b><span>'+detail+'</span></div>'}).join('');c.innerHTML='<div class="event-list">'+(list||'<p>No events recorded yet.</p>')+'</div>';}}
  function endGame(won,how){if(!state.running)return;state.running=false;state.paused=false;state.ended=true;state.won=won;record(won?'SIEGE_WON':'SIEGE_LOST',{duration:state.time,how:how||'hull'});document.getElementById('pauseGame').classList.add('hidden');document.getElementById('pauseOverlay').classList.add('hidden');updateStanceBar();var s=derived(),ov=document.getElementById('ending');document.getElementById('endEyebrow').textContent=won?'SIEGE COMPLETE':(how==='nova'?'HEART NOVA':'FLEET WITHDRAWAL');document.getElementById('endTitle').innerHTML=won?'FORTRESS<br>BREACHED.':(how==='nova'?'NOVA<br>UNLEASHED.':'ASSAULT<br>BROKEN.');var hull=Math.max(0,Math.round(state.ship.hp/state.ship.max*100));var line='Hull '+hull+'%, '+state.wings+' of '+state.maxWings+' wings, '+s.handoffs+' command handoffs in '+fmt(state.time)+'.';document.getElementById('endCopy').textContent=(won?'Kheiron\u2019s heart is still. ':how==='nova'?'The heart\u2019s nova outran the siege. ':'The fleet broke before the heart did. ')+line;ov.classList.remove('hidden');}
  canvas.addEventListener('pointerdown',function(e){if(!state||!state.running)return;var r=canvas.getBoundingClientRect(),x=(e.clientX-r.left)/r.width,y=(e.clientY-r.top)/r.height,best=null,dist=.08;state.targets.forEach(function(t){if(!t.alive)return;var d=Math.hypot(t.x-x,(t.y-y)*H/W);if(d<dist){dist=d;best=t}});if(best&&(tasks.bombard.owner==='HUMAN'||tasks.wings.owner==='HUMAN')){selectedTarget=best;state.lastInput=state.time;record('TARGET_DESIGNATED',{owner:'HUMAN',target:best.type,id:best.id});advise(best.type.toUpperCase()+' designated. Weapons await your command.');}});
  document.addEventListener('click',function(e){var b=e.target.closest('button');if(!b)return;if(b.dataset.task)claim(b.dataset.task);if(b.dataset.stance)chooseStance(b.dataset.stance);if(b.dataset.move){var v=b.dataset.move.split(',').map(Number);humanMove(v[0],v[1]);}if(b.dataset.action==='fire')fireBombard('HUMAN');if(b.dataset.action==='strike')strikeWings('HUMAN');if(b.dataset.action==='formation')toggleFormation();if(b.dataset.action==='aegis')aegisAction();if(b.dataset.drawer)openDrawer(b.dataset.drawer);});
  document.querySelector('.close').addEventListener('click',function(){document.getElementById('drawer').classList.remove('open');document.querySelectorAll('.tab').forEach(function(b){b.classList.remove('active')})});
  document.getElementById('begin').addEventListener('click',startGame);document.getElementById('pauseGame').addEventListener('click',pauseGame);document.getElementById('resumeGame').addEventListener('click',resumeGame);document.getElementById('restart').addEventListener('click',startGame);document.getElementById('endStats').addEventListener('click',function(){document.getElementById('ending').classList.add('hidden');openDrawer('stats')});
  window.addEventListener('resize',resize);state=initialState();spawnPhase();resize();draw();updateStations();
})();
</script>
</body>
</html>


===== FILE: public/city/siege/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, user-scalable=no" />
  <meta name="color-scheme" content="light dark" />
  <link rel="icon" href="data:," />
  <title>Siege Breaker</title>
  <style>
    :root{
      color-scheme:light dark;
      --bg:#eef1f1;--panel:#ffffff;--panel2:#e2e7e7;--ink:#10191d;--muted:#4c5d63;
      --line:#9aa9ad;--hot:#d02e1c;--gold:#a66a00;--teal:#007c78;--good:#087b4f;--shadow:0 14px 40px rgba(17,32,38,.14);
      --canvas:#050a0e;--canvasInk:#e7f5f4;
    }
    @media(prefers-color-scheme:dark){:root{
      --bg:#070b0e;--panel:#0e1519;--panel2:#152026;--ink:#e9f2f2;--muted:#9aa9ad;
      --line:#2d4149;--hot:#ff4b35;--gold:#f0ae31;--teal:#25c7bd;--good:#42d392;--shadow:0 16px 48px rgba(0,0,0,.45);
      --canvas:#030609;--canvasInk:#e7f5f4;
    }}
    *{box-sizing:border-box}
    html,body{margin:0;min-height:100%;background:var(--bg);color:var(--ink);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;overscroll-behavio