<!-- SOLID CITY · part 3168 -->
ria-label="Close panel">×</button></div><div class="drawer-content" id="drawerContent"></div></section>

<div class="overlay" id="intro">
  <div class="brief">
    <div class="eyebrow">SIEGE BREAKER · FORTRESS KHEIRON</div>
    <h1>BREAK THE<br>FORTRESS.</h1>
    <p>Four AI admirals are already at their stations. Claim any command with one tap; they yield instantly and continue fighting everywhere else. Break the fortress in three escalating phases before your fleet collapses.</p>
    <div class="orders"><div class="order"><b>01 · TURRETS</b><span>Silence the outer ring.</span></div><div class="order"><b>02 · SHIELDS</b><span>Destroy four generators.</span></div><div class="order"><b>03 · CORE</b><span>Open the breach.</span></div></div>
    <button class="begin" id="begin">BEGIN SIEGE</button>
    <div class="sub">Tap a station to claim it. Tap the battlefield to designate a target.</div>
    <a class="city-link" href="/city/">← back to Solid City</a>
  </div>
</div>

<div class="overlay hidden" id="pauseOverlay">
  <div class="brief">
    <div class="eyebrow">SIEGE PAUSED</div>
    <h1>HOLD<br>POSITION.</h1>
    <div class="pause-actions"><button id="resumeGame">RESUME</button><a href="/city/?back=strike">QUIT TO CITY</a></div>
  </div>
</div>

<div class="overlay hidden" id="ending"><div class="brief"><div class="eyebrow" id="endEyebrow">SIEGE COMPLETE</div><h1 id="endTitle">FORTRESS<br>BREACHED.</h1><p id="endCopy"></p><div class="end-actions"><button class="primary" id="restart">RUN AGAIN</button><button id="endStats">VIEW STATS</button></div></div></div>

<script>
(function(){
  'use strict';
  var canvas=document.getElementById('battle'),ctx=canvas.getContext('2d');
  var DPR=Math.min(2,window.devicePixelRatio||1),W=0,H=0,last=0,raf=0;
  var tasks={
    fleet:{owner:'AI',epoch:1,admiral:'ADMIRAL RHEA'},
    bombard:{owner:'AI',epoch:1,admiral:'ADMIRAL VELA'},
    wings:{owner:'AI',epoch:1,admiral:'MARSHAL KITE'},
    aegis:{owner:'AI',epoch:1,admiral:'WARDEN SOL'}
  };
  var state,events=[],sessionStart=0,lastSignal=0,selectedTarget=null,nextId=1,stars=[];
  var phaseData=[
    {name:'SILENCE THE RING',objective:'Outer turret ring',text:'Destroy all outer turrets before the fleet is broken.',count:8,hp:34,type:'turret'},
    {name:'SHATTER THE SHIELD',objective:'Shield generators',text:'Punch through four generators while interceptor wings close in.',count:4,hp:72,type:'generator'},
    {name:'BREACH THE CORE',objective:'Fortress core',text:'The core is exposed. Commit everything to the final breach.',count:1,hp:360,type:'core'}
  ];
  // SUMMIT — the heart of Kheiron: the fortress again, at half scale. Counts halved (8/4/1 -> 4/2/1), hull x phi.
  var summitData=[
    {name:'SILENCE THE INNER RING',objective:'Inner turret ring',text:'The heart wears its own ring. Silence it.',count:4,hp:55,type:'turret',ring:.115},
    {name:'BREAK THE HEARTSHIELD',objective:'Heart generators',text:'Two generators feed the heart. Starve it.',count:2,hp:116,type:'generator',ring:.075},
    {name:'THE HEART OF KHEIRON',objective:'The heart',text:'The heart is open. Choose the breach.',count:1,hp:582,type:'heart',ring:.04}
  ];
  function initialState(){return {running:false,paused:false,ended:false,won:false,phase:0,phaseDelay:0,time:0,ship:{x:.18,y:.52,hp:420,max:420,shield:180,maxShield:180,vx:0,vy:0},wings:12,maxWings:12,targets:[],shots:[],enemyShots:[],particles:[],targetPulse:0,bombardCooldown:0,wingCooldown:0,enemyCooldown:1.5,aegisBurst:0,formation:'SCREEN',killsBy:{HUMAN:0,AI:0},fps:0,frameSamples:[],lastInput:0,summit:false,summitPhase:0,reveal:0,stance:null,heartCharge:0};}
  function record(type,data){events.push(Object.assign({id:nextId++,type:type,t:state?state.time:0,at:performance.now()},data||{}));if(events.length>600)events.shift();updateTicker(type,data||{});}
  function fmt(t){var m=Math.floor(t/60),s=Math.floor(t%60);return String(m).padStart(2,'0')+':'+String(s).padStart(2,'0');}
  function spawnPhase(){
    if(state.summit){spawnSummitPhase();return;}
    var p=phaseData[state.phase];state.targets=[];selectedTarget=null;
    for(var i=0;i<p.count;i++){
      var a=(Math.PI*2*i/p.count)-Math.PI/2,rad=p.type==='turret'?.23:p.type==='generator'?.15:0;
      state.targets.push({id:nextId++,type:p.type,x:.73+Math.cos(a)*rad,y:.5+Math.sin(a)*rad,hp:p.hp,max:p.hp,alive:true,angle:a});
    }
    record('PHASE_STARTED',{phase:state.phase+1,label:p.name});
    advise(state.phase===0?'Outer ring acquired. I can hold bombardment unless you claim it.':state.phase===1?'Shield harmonics located. Generators are vulnerable after each cannon strike.':'Core exposed. Fortress reinforcements inbound — commit all stations.',state.phase===2);
  }
  function beginSummit(){
    state.summit=true;state.summitPhase=0;state.reveal=0;state.stance=null;state.heartCharge=0;
    state.phaseDelay=1.6;
    burst(.73,.5,'#f0ae31',60);
    record('SUMMIT_BEGUN',{});
    advise("The core was a shell