<!-- CODERS100 · part 22 -->
ct(this.ctx.destination);
    o.start(t); o.stop(t + dur + 0.02);
  },
  /* Named futuristic effects — all short (<0.3s), all fast */
  place:  function(){ this.blip(800, 1600, 0.12, 'square', 0.12); },  /* laser zap up */
  pickup: function(){ this.blip(600, 1200, 0.10, 'sine', 0.15); },    /* ascending blip */
  brk:    function(){ this.blip(400, 100, 0.15, 'sawtooth', 0.10); }, /* descending crunch */
  click:  function(){ this.blip(1000, 1000, 0.05, 'square', 0.08); }, /* UI tick */
  error:  function(){ this.blip(200, 150, 0.20, 'sawtooth', 0.10); }, /* low buzz */
  swim:   function(){ this.blip(300, 600, 0.18, 'sine', 0.08); },     /* splash sweep */
  jump:   function(){ this.blip(400, 800, 0.12, 'triangle', 0.12); },  /* launch */
  land:   function(){ this.blip(300, 150, 0.10, 'sine', 0.10); },     /* thud */
  spin:   function(){ this.blip(500, 2000, 0.15, 'sawtooth', 0.08); },/* spin-up */
  undo:   function(){ this.blip(1200, 600, 0.12, 'square', 0.10); },  /* reverse zap */
};
/* Global shorthand */
function sfx(name){ if(AudioSys[name]) AudioSys[name](); }
/* Init on first touch (iOS requires user gesture) */
document.addEventListener('touchstart', function(){ AudioSys.init(); }, {once:true, passive:true});
document.addEventListener('click', function(){ AudioSys.init(); }, {once:true});


/* HIDDEN CODES — never shown in public listings */
function isHiddenCode(name){
  return name === 'deletefreeze1';
}
function visibleCodes(){
  return visibleCodes().filter(function(k){ return !isHiddenCode(k); });
}

var CODES = {
  newbody: { cat: 'Build', desc: 'Spawn a new body', fn: function(){ spawnNewBody(); } },
  wall: { cat: 'Build', desc: 'Build the 56-button wall', fn: function(){ buildButtonWall(); } },
  'deletefreeze1': {cat:'Royal', hidden:true, desc:'The King\'s override — unfreeze the mastered mechanics', fn:function(){
    if(typeof window.deletefreeze1 === 'function'){
      var m = window.deletefreeze1();
      say('freeze lifted by the King');
    } else if(typeof MASTER_MECHANICS !== 'undefined'){
      /* Fallback: create mutable copy directly */
      try {
        window.MASTER_MECHANICS_LIVE = JSON.parse(JSON.stringify(MASTER_MECHANICS));
        say('freeze lifted by the King');
      } catch(e){ say('freeze holds'); }
    } else {
      say('no freeze found');
    }
  }},
  /* SPECIAL */
  'bam':      {cat:'Special', desc:'Direct build — bam box 10, bam box 10 x5, bam wall 10 line 5', fn:doBam},
  'mk':       {cat:'Special', desc:'Alias for bam', fn:doBam},
  'again':    {cat:'Special', desc:'Repeat last bam', fn:function(){
    if(lastBam) doBam([lastBam.shape, String(lastBam.size)]);
    else say('no bam yet');
  }},
  'bamtest':  {cat:'Special', desc:'Backup test build', fn:function(){
    try{ localStorage.setItem('coders100-test', 'ok'); say('backup works'); }
    catch(e){ say('backup failed'); }
  }},
  'solidfast':{cat:'Special', desc:'100% speed', fn:function(){ say('full speed'); }},
  'whereami': {cat:'Special', desc:'Exact coordinates', fn:function(){
    say(Math.round(kingPos.x)+', '+Math.round(kingPos.z));
  }},
  'listall':  {cat:'Special', desc:'Count objects', fn:function(){
    say(scene.children.length + ' things');
  }},
  'tp':       {cat:'Special', desc:'Teleport — tp 600 600', fn:function(a){
    if(a.length>=2){ kingPos.x=parseFloat(a[0])||0; kingPos.z=parseFloat(a[1])||0; say('at '+kingPos.x+', '+kingPos.z); }
    else say('tp x z');
  }},
  'intaglio': {cat:'Special', desc:'Ultra-dense linework mode', fn:function(){ say('intaglio on'); }},
  'nightcity':{cat:'Special', desc:'Night lighting', fn:function(){
    scene.background=new THREE.Color(0x0b0906); scene.fog.color=new THREE.Color(0x0b0906); say('night');
  }},
  'daycity':  {cat:'Special', desc:'Day lighting', fn:function(){
    scene.background=new THREE.Color(0x4a0e0e); scene.fog.color=new THREE.Color(0x4a0e0e); say('day');
  }},
  'exportfbx':{cat:'Special', desc:'Export scene as FBX', fn:function(){ say('fbx export — coming'); }},

  /* CAMERA */
  'vfront': {cat:'Camera', desc:'Front view', fn:function(){ camYaw=0; camPitch=0.35; camDist=12; }},
  'vback':  {cat:'Camera', desc:'Back view', fn:function(){ camYaw=Math.PI; camPitch=0.35; camDist=12; }},
  'vleft':  {cat:'Camera', desc:'Left view', fn:function(){ camYaw=Math.PI/2; camPitch=0.35; camDist=12; }},
  'vright': {cat:'Camera', desc:'Right view', fn:function(){ camYaw=-Math.PI/2; camPitch=0.35; camDist=12; }},
  'vtop':   {cat:'Camera', desc:'Top down', fn:function(){ camPitch=1.45; camDist=30; }},
  'vbelow': {cat:'Camera', desc:'From below', fn:function(){ camPitch=-0.5; camDist=20; }},
  'vclose': {cat:'Camera', desc:'Close up', fn:function(){ camDist=6; }},
  'vfar':   {cat:'Camera', desc:'Far away', fn:function(){ camDist=80; camPitch=0.7; }},
  'vzoomout':{cat:'Camera', desc:'Zoom out', fn:function(){ camDist=Math.min(200, camDist*1.5); }},
  'vreset': {cat:'Camera', desc:'Reset camera', fn:function