<!-- RUBY-BACKUP · part 271 -->
catch(e){} }
  if(tl==='duplicate'&&_toolBlk){ try{ var cp=_toolBlk.clone(); cp.position.x+=3; scene.add(cp); _toolMsg('Duplicated.'); }catch(e){} return; }
  if(tl==='color'&&_toolBlk){ try{ var cols=[0xffd700,0xff4444,0x44aaff,0x44ff88,0xff88cc,0xffffff,0x111111]; var ci=Math.floor(Math.random()*cols.length); _toolBlk.traverse? _toolBlk.traverse(function(o){ if(o.material) o.material.color.setHex(cols[ci]); }) : _toolBlk.material.color.setHex(cols[ci]); _toolMsg('Color shifted.'); }catch(e){} return; }
  if(tl==='flip'&&_toolBlk){ try{ _toolBlk.rotation.y+=Math.PI; _toolMsg('Flipped.'); }catch(e){} return; }
  if(tl==='stretch'&&_toolBlk){ try{ _toolBlk.scale.x*=1.3; _toolMsg('Stretched.'); }catch(e){} return; }
  if(tl==='bend'&&_toolBlk){ try{ _toolBlk.rotation.z+=0.3; _toolMsg('Bent.'); }catch(e){} return; }
  if(tl==='snap'&&_toolBlk){ try{ _toolBlk.position.x=Math.round(_toolBlk.position.x/2)*2; _toolBlk.position.z=Math.round(_toolBlk.position.z/2)*2; _toolMsg('Snapped to grid.'); }catch(e){} return; }
  if(tl==='calibrate'&&_toolBlk){ try{ _toolBlk.rotation.set(0,0,0); _toolBlk.scale.set(1,1,1); _toolMsg('Calibrated.'); }catch(e){} return; }
  if(tl==='layer'&&_toolBlk){ try{ var ly=_toolBlk.clone(); ly.position.y+=2; ly.scale.set(0.8,0.5,0.8); scene.add(ly); _toolMsg('Layered.'); }catch(e){} return; }
  if(tl==='section'&&_toolBlk){ try{ _toolBlk.scale.y*=0.5; _toolMsg('Sectioned.'); }catch(e){} return; }
  if(tl==='smooth'&&_toolBlk){ try{ if(_toolBlk.material){ _toolBlk.material.roughness=0.1; _toolBlk.material.metalness=0.8; } _toolMsg('Smoothed.'); }catch(e){} return; }
  if(tl==='sharpen'&&_toolBlk){ try{ if(_toolBlk.material){ _toolBlk.material.roughness=0.9; _toolBlk.material.metalness=0.1; _toolBlk.material.flatShading=true; } _toolMsg('Sharpened.'); }catch(e){} return; }
  if(tl==='hollow'&&_toolBlk){ try{ _toolBlk.traverse? _toolBlk.traverse(function(o){ if(o.material){ o.material.transparent=true; o.material.opacity=0.4; } }) : (function(){ _toolBlk.material.transparent=true; _toolBlk.material.opacity=0.4; })(); _toolMsg('Hollowed.'); }catch(e){} return; }
  var _cc = ['calibrate','layer','snap','section','smooth','sharpen','bend','stretch','flip','hollow','duplicate','color','undo'];
  if(_cc.indexOf(tl)>=0){
    try{
      if(tl==='undo'){
        if(typeof undoCommand==='function'){ undoCommand(); }
        else if(window.fixHistory && window.fixHistory.length>0){ codeStatus('Undid '+window.fixHistory.pop()+'.'); }
        else{ codeStatus('Nothing to undo.'); }
      }else if(tl==='redo'){
        if(typeof redoCommand==='function'){ redoCommand(); }
        else{ codeStatus('Nothing to redo.'); }
      }else{
        if(!window.fixHistory) window.fixHistory = [];
        window.fixHistory.push(tl);
        codeStatus(tl+' — done.');
        if(typeof playfulSparkle==='function' && typeof mePos!=='undefined'){ playfulSparkle(new THREE.Vector3(mePos.x,mePos.y+2,mePos.z), 0xffd700); }
      }
    }catch(e){}
    return;
  }


  /* cheat codes */
  var cheats = ['fly','noclip','godmode','spawnall','timefreeze','timeflow','bigme','tinyme','normalme','summonhokulea','allquests','instantcity'];
  if(cheats.indexOf(tl) >= 0){ doCheat(tl); return; }
  if(tl==='questdone'||tl==='done'){ completeQuest(); return; }
  if(tl==='quests'){ listQuests(); return; }
  if(tl==='fillmax'){ fillContinuumMax(); return; }
  if(tl==='cheats'){ showCheats(); return; }
  if(tl==='codex'){ showCodex(); return; }
  if(tl==='myworld'){ buildMyWorld(); return; }
  if(tl==='bonus'){ if(checkBonus()) codeStatus('bonus unlocked — cheats, codex, myworld'); else codeStatus('fill your Continuum to max to unlock the bonus'); return; }
  if(tl==='meetsolid'||tl==='solid'){ meetSolid(); return; }
  if(tl.indexOf('ask ')==0){ solidAnswer(tl.slice(4)); return; }
  if(tl.indexOf('guide ')==0){ solidGuide(tl.slice(6)); return; }
  if(tl==='leavesolid'||tl==='bye'||tl==='thanks'){ dismissSolid(); return; }
  if(tl==='progress'){ progress(); return; }
  /* racing */
  if(tl.indexOf('race ')==0){ startRace(tl.slice(5).trim()); return; }
  if(tl==='destinations'){ codeStatus('destinations: '+RACE_DESTINATIONS.map(function(d){ return d.name; }).join(', ')); return; }
  /* court */
  if(tl==='court'){ courtCase(); return; }
  if(tl==='twin'||tl==='twinlightning'){ if(courtIsReady()){ startTwinCase(); }else{ courtNotReady(); } return; }
  if(tl==='jets'){ showJets(); return; }
  if(tl==='flare'){ startFlareCase(); return; }
  if(tl==='stats'){ showStats(); return; }
  if(tl==='inventory'){ showInventory(); return; }
  if(tl==='weapons'){ showWeapons(); return; }
  if(tl==='her'||tl==='woman'){ womanAtDoor(); return; }
  if(tl==='gold'||tl==='goldencity'){ goldenCity(); return; }
  if(tl==='currency'||tl==='credits'){ showCurrency(); return; }
  if(tl==='freemap'){ freeMap(); return; }
  if(tl==='sweep'){ sweep(); return; }
  if(tl==='phi'||tl==='goldenratio'){ layoutGoldenRatio(); return; }
  if(tl.