<!-- RUBY-BACKUP · part 199 -->
ld);
  caneTop.position.set(0, 1.12, 0.28); g.add(caneTop);
  [-1,1].forEach(function(s){
    var leg = new THREE.Mesh(new THREE.CylinderGeometry(0.07, 0.06, 0.6, 8), suit);
    leg.position.set(0, 0.3, s*0.1); g.add(leg);
    var shoe = new THREE.Mesh(new THREE.BoxGeometry(0.2, 0.08, 0.1), gold);
    shoe.position.set(0.05, 0.04, s*0.1); g.add(shoe);
  });
  /* aura — subtle gold */
  var aura = new THREE.Mesh(new THREE.SphereGeometry(0.8, 16, 16),
    new THREE.MeshBasicMaterial({color: 0xffd700, transparent: true, opacity: 0.08}));
  aura.position.y = 1.0; g.add(aura);
  g.position.set(x, y, z);
  /* his story */
  var story = [
    'I have traveled 40 years.',
    'I have everything. Except one thing.',
    'Will you help me find it?',
    'It is not gold. It is not land.',
    'It is a moment. Like this one.'
  ];
  var sIdx = 0;
  var sCv = document.createElement('canvas');
  sCv.width = 512; sCv.height = 80;
  var sCtx = sCv.getContext('2d');
  var sTex = new THREE.CanvasTexture(sCv);
  var sBubble = new THREE.Mesh(new THREE.PlaneGeometry(2.8, 0.44),
    new THREE.MeshBasicMaterial({map: sTex, transparent: true}));
  sBubble.position.set(0, 2.2, 0);
  g.add(sBubble);
  function drawStory(){
    sCtx.clearRect(0, 0, 512, 80);
    sCtx.fillStyle = 'rgba(30,25,10,0.95)';
    sCtx.fillRect(0, 0, 512, 80);
    sCtx.strokeStyle = '#ffd700'; sCtx.lineWidth = 3;
    sCtx.strokeRect(4, 4, 504, 72);
    sCtx.fillStyle = '#ffd700'; sCtx.font = 'italic 20px Georgia'; sCtx.textAlign = 'center';
    sCtx.fillText(story[sIdx], 256, 48);
    sTex.needsUpdate = true;
    sIdx = (sIdx+1) % story.length;
  }
  drawStory();
  var storyTimer = setInterval(drawStory, 5000);
  g.userData.storyTimer = storyTimer;
  /* he waits. He is patient. */
  var t = 0;
  var anim = setInterval(function(){
    t += 0.02;
    aura.material.opacity = 0.06 + Math.sin(t*2)*0.03;
    watch.rotation.y += 0.05; /* glinting */
  }, 50);
  g.userData.anim = anim;
  return g;
}
function summonStranger(){
  if(typeof scene==='undefined' || typeof mePos==='undefined') return;
  if(!checkStrangerEligibility()){
    codeStatus('the stranger has not come yet. Keep playing. He comes once.');
    return;
  }
  if(STRANGER){
    try{ scene.remove(STRANGER); }catch(e){}
  }
  /* appears at the plaza — the heart */
  var x = mePos.x*0.13, z = mePos.z*0.13;
  STRANGER = buildRichStranger(x+5, 0, z+5);
  scene.add(STRANGER);
  try{ localStorage.setItem('ruby-stranger-seen', '1'); }catch(e){}
  codeStatus('THE RICH STRANGER — he has come. Once in a lifetime. Help him.');
}

/* BONUS — cheat codes, codex, world to build */
var CHEAT_CODES = [
  {code: 'fly', desc: 'Fly anywhere'},
  {code: 'noclip', desc: 'Walk through walls'},
  {code: 'godmode', desc: 'Cannot be harmed'},
  {code: 'spawnall', desc: 'Spawn all wildlife at once'},
  {code: 'timefreeze', desc: 'Freeze all animations'},
  {code: 'timeflow', desc: 'Resume time'},
  {code: 'bigme', desc: 'Grow 3x size'},
  {code: 'tinyme', desc: 'Shrink to 1/3'},
  {code: 'normalme', desc: 'Normal size'},
  {code: 'summonhokulea', desc: 'Hokulea descends (not orbit)'},
  {code: 'allquests', desc: 'See all 120 quests'},
  {code: 'instantcity', desc: 'Build everything at once'}
];
var BONUS_UNLOCKED = false;
function unlockBonus(){
  BONUS_UNLOCKED = true;
  try{ localStorage.setItem('ruby-bonus', '1'); }catch(e){}
  codeStatus('BONUS UNLOCKED — cheat codes, Soliditronium codex, and a world to build. Yours.');
}
function checkBonus(){
  try{
    if(localStorage.getItem('ruby-bonus')==='1') BONUS_UNLOCKED = true;
  }catch(e){}
  return BONUS_UNLOCKED;
}
function showCheats(){
  if(!checkBonus()){
    codeStatus('bonus not unlocked yet — fill your Continuum to max (fillmax) to earn it');
    return;
  }
  var html = '<b style="color:#ff0">CHEAT CODES</b><br><br>';
  CHEAT_CODES.forEach(function(ch){
    html += '<button onclick="runCodeByName(\''+ch.code+'\')" style="margin:3px;background:#440;color:#ff0;border:1px solid #ff0;border-radius:5px;padding:5px 10px;">'+ch.code+'</button> <small>'+ch.desc+'</small><br>';
  });
  var d = document.createElement('div');
  d.id = 'cheat-panel';
  d.style.cssText = 'position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:10000;background:rgba(20,20,0,0.95);border:3px solid #ff0;border-radius:12px;padding:20px;color:#fff;max-width:400px;max-height:70%;overflow:auto;';
  d.innerHTML = html + '<br><button onclick="document.getElementById(\'cheat-panel\').remove()">CLOSE</button>';
  document.body.appendChild(d);
}
function showCodex(){
  if(!checkBonus()){
    codeStatus('bonus not unlocked yet');
    return;
  }
  /* the Soliditronium codex — all codes */
  codeStatus('the Soliditronium Codex holds every code. Use "help" to see them all.');
  if(typeof handleCode==='function') handleCode('help');
}
/* a world to build — personal map */
var MY_WORLD = null;
function buildMyWorld(){
  if(!checkBonus()){
    codeStatus('bonus not unlo