<!-- SOLID CITY · part 3706 -->
);
  breakMirrorRing(owners);
}
function breakMirrorRing(owners){
  const sm=summit;if(!sm||sm.rings<=0)return;
  sm.rings--;
  emit('mirror_ring_broken',{ringsLeft:sm.rings,owners});
  if(!sm.advisedCrack){sm.advisedCrack=true;emit('advisory',{task:'crew',text:'THE MIRROR CRACKS.'});}
  if(sm.rings===1){
    sm.phase='stillness';sm.stillT=0;enemyShots=[];
    const db=$('dropBtn');if(db)db.hidden=false;
    if(!sm.advisedShield){sm.advisedShield=true;emit('advisory',{task:'crew',text:'THE LAST RING IS A SHIELD.'});}
  }else if(sm.rings===0){
    sm.mirrorGone=true;sm.phase='ascent';sm.ascentT=0;
    for(let i=0;i<90;i++)particle(sm.x+(rand()-.5)*.3,sm.y+(rand()-.5)*.3,'boom');
    const db=$('dropBtn');if(db)db.hidden=true;
    emit('mirror_shattered',{returned:sm.returned});
  }
  updateHUD();
}
function dropShields(){
  const sm=summit;
  if(!sm||sm.phase!=='stillness'||sm.shieldsDown)return;
  ship.shield=0;sm.shieldsDown=true;sm.finalT=1.0;
  emit('shields_dropped',{by:'human'});
  emit('advisory',{task:'crew',text:'FIRE AS ONE.'});
  updateHUD();
}
function updateSummit(dt){
  const s=summit;if(!s)return;
  s.x=ship.x;s.y+=(0.30-s.y)*Math.min(1,dt*2.2);
  if(s.phase==='reveal'){
    s.revealT+=dt;
    if(s.y>0.295&&s.revealT>1.2){s.phase='trial';s.counterT=2.6;}
  }else if(s.phase==='trial'){
    s.counterT-=dt;
    if(s.counterT<=0){s.counterT=s.rings>=3?2.6:2.6/PHI;summitMirrorFire();}
    const humanB=['batteryA','batteryB'].filter(n=>coordination.tasks[n].owner==='human');
    if(humanB.length){s.nudgeT+=dt;if(s.nudgeT>14){s.nudgeT=0;emit('advisory',{task:'crew',text:'FIRE WITH THE CREW.'});}}
    else s.nudgeT=0;
  }else if(s.phase==='stillness'){
    s.stillT+=dt;
    if(s.stillT>2.5&&!s.advisedOrder){s.advisedOrder=true;emit('advisory',{task:'crew',text:'BARE HULLS ONLY · THE ORDER IS YOURS.'});}
    if(s.stillT>22){s.stillT=0;s.advisedOrder=false;}
  }else if(s.phase==='ascent'){
    s.ascentT+=dt;
    ship.x+=(0.5-ship.x)*Math.min(1,dt*2);ship.y-=dt*0.22;
    if(rand()<.6)particle(ship.x+(rand()-.5)*.05,ship.y+.05,'muzzle');
    if(s.ascentT>2.4){s.phase='done';finish(true);}
  }
}
function summitAI(dt){
  const s=summit;if(!s||s.phase==='ascent'||s.phase==='done')return;
  const owned=['batteryA','batteryB'].filter(n=>coordination.tasks[n].owner==='ai');
  if(!owned.length)return;
  if(s.phase==='stillness'){
    /* the crew holds its fire — and will never give the vulnerable order */
    if(s.shieldsDown){s.finalT-=dt;if(s.finalT<=0){s.finalT=999;owned.forEach(n=>fireBattery(n,'ai'));}}
    return;
  }
  if(!s.aiSync){owned.forEach(n=>{if(rand()<.12)fireBattery(n,'ai');});}
  else{s.syncT-=dt;if(s.syncT<=0){s.syncT=2.1;owned.forEach(n=>fireBattery(n,'ai'));}}
}
function drawSummit(){
  const s=summit,t=gameClock/1000,power=(3-s.rings)/3;
  ctx.save();
  ctx.strokeStyle='rgba(255,215,130,'+(.35+.45*power)+')';ctx.lineWidth=2+3*power;
  ctx.beginPath();ctx.arc(W*.5,H*.11,W*(.10+.05*power+.012*Math.sin(t*2)),0,Math.PI*2);ctx.stroke();
  if(s.phase==='ascent'){
    const g=ctx.createRadialGradient(W*.5,H*.11,4,W*.5,H*.11,W*.3);
    g.addColorStop(0,'rgba(255,240,200,.95)');g.addColorStop(1,'rgba(255,240,200,0)');
    ctx.fillStyle=g;ctx.beginPath();ctx.arc(W*.5,H*.11,W*.3,0,Math.PI*2);ctx.fill();
  }
  ctx.restore();
  if(s.mirrorGone)return;
  const x=s.x*W,y=s.y*H,ms=Math.max(22,Math.min(34,W*.035));
  ctx.save();ctx.translate(x,y);
  for(let i=0;i<3;i++){
    if(i>=s.rings)continue;
    const last=s.rings===1&&i===0;
    ctx.strokeStyle=last?'rgba(255,210,120,'+(.55+.35*Math.sin(t*3))+')':'rgba(255,210,120,.8)';
    ctx.lineWidth=last?3:2;
    ctx.beginPath();ctx.arc(0,0,ms*(2.4+i*.8),0,Math.PI*2);ctx.stroke();
  }
  /* the mirror copies your shield facing — reflected across the gate line */
  const a=ship.shieldFace==='left'?Math.PI*.55:ship.shieldFace==='right'?-Math.PI*.05:Math.PI*1.05;
  if(!s.shieldsDown&&ship.shield>0){
    ctx.strokeStyle='rgba(255,209,102,'+(.25+ship.shield/450)+')';ctx.lineWidth=2;
    ctx.beginPath();ctx.arc(0,0,ms*1.7,-a-Math.PI*.9,-a);ctx.stroke();
  }
  ctx.save();ctx.scale(1,-1);
  ctx.fillStyle='rgba(232,217,174,.96)';ctx.strokeStyle='#fff3d6';ctx.lineWidth=1.5;
  ctx.beginPath();ctx.moveTo(0,-ms*1.25);ctx.lineTo(-ms*.72,ms*.8);ctx.lineTo(-ms*.28,ms*.56);ctx.lineTo(0,ms*.9);ctx.lineTo(ms*.28,ms*.56);ctx.lineTo(ms*.72,ms*.8);ctx.closePath();ctx.fill();ctx.stroke();
  ctx.fillStyle='#7a5c14';ctx.fillRect(-ms*.18,-ms*.55,ms*.36,ms*.65);
  ctx.globalAlpha=s.phase==='stillness'?.25:1;
  ctx.fillStyle='#ffd166';[-.55,-.3,.3,.55].forEach(q=>{ctx.fillRect(q*ms,-ms*.05,3,8);});
  ctx.globalAlpha=1;
  ctx.strokeStyle='rgba(20,12,4,.85)';ctx.lineWidth=2;
  for(let c=0;c<3-s.rings;c++){
    ctx.beginPath();let cx=-ms*.6+c*ms*.18,cy=-ms*.9;ctx.moveTo(cx,cy);
    for(let k=0;k<5;k++){cx+=(rand()-.5)*ms*.5;cy+=ms*.38;ctx.lineTo(cx,cy);}
    ctx.stroke();
  }
  ctx.restore();ctx.restore();
}
/* Test/dev handle for the summit: read-only state p