<!-- RUBY-BACKUP · part 397 -->
 = a.x; cursor.z = a.z; saveCursor(); paintCursor();
  persistAnchors(); drawAnchorRings();
  codeStatus('anchor locked in');
}
function tapUnlock(grp){
  awaitingUnlock = false;
  var px=grp.position.x, pz=grp.position.z, py=grp.userData.y||0, idx=-1;
  for(var i=0;i<lockedAnchors.length;i++){ var e=lockedAnchors[i];
    if(Math.abs(e.x-px)<1.5 && Math.abs(e.z-pz)<1.5 && Math.abs((e.y||0)-py)<0.01){ idx=i; break; } }
  if(idx<0){ codeStatus('that is not a locked anchor'); return; }
  lockedAnchors.splice(idx,1);
  persistAnchors(); drawAnchorRings();
  codeStatus('anchor released');
}
/* portals — an anchor of a block as a portal to a build site.
   `portal <id>`, tap the block; tapping it again opens the watch —
   you meet me there, and we play together. */
function loadPortals(){ try{ portals = JSON.parse(localStorage.getItem('ruby-portals-v1')||'[]'); }catch(e){ portals=[]; } }
function persistPortals(){ try{ localStorage.setItem('ruby-portals-v1', JSON.stringify(portals)); }catch(e){} }
function drawPortals(){
  for(var i=portalGrp.children.length-1;i>=0;i--) portalGrp.remove(portalGrp.children[i]);
  portals.forEach(function(p){
    var ring = new T.Mesh(new T.RingGeometry(1.15, 1.45, 40),
      new T.MeshBasicMaterial({color:0x7df9ff, transparent:true, opacity:0.9, side:T.DoubleSide}));
    ring.rotation.x = -Math.PI/2;
    ring.position.set(p.x, 0.12+(p.y||0)*0.13, p.z);
    portalGrp.add(ring);
  });
}
function portalAt(grp){
  var px=grp.position.x, pz=grp.position.z, py=grp.userData.y||0;
  for(var i=0;i<portals.length;i++){ var e=portals[i];
    if(Math.abs(e.x-px)<1.5 && Math.abs(e.z-pz)<1.5 && Math.abs((e.y||0)-py)<0.01) return e; }
  return null;
}
function tapPortal(grp){
  var id = awaitingPortal; awaitingPortal = null;
  portals.push({x:grp.position.x, z:grp.position.z, y:grp.userData.y||0, watch:id});
  persistPortals(); drawPortals();
  codeStatus('portal open — tap it to meet me there');
}
function tapUnportal(grp){
  awaitingUnportal = false;
  var e = portalAt(grp);
  if(!e){ codeStatus('that is not a portal'); return; }
  portals.splice(portals.indexOf(e),1);
  persistPortals(); drawPortals();
  codeStatus('portal closed');
}
/* the Brain — keeper of every code. punch 'brain' and it remembers for you. */
var BRAIN = [
 ['day / night / storm / cosmic / cave / dawn / ember / aurora','the eight skies'],
 ['rain','the Rain Law — totality clouds + rain'],
 ['clouds','clouds alone (never kills rain)'],
 ['whiteout','hold the sky white — two codes at once, on purpose'],
 ['floor','lay the stone layer — the whole is 1'],
 ['land','raise the landscape — our feet rest upon it'],
 ['dig','carve the earth open where you stand'],
 ['come','call Solid — he flies to you'],
 ['go','send Solid back to his post'],
 ['new','something new grows — a surprise'],
 ['eyeslive','eyes non-stop \u2014 eyesoff ends it'],
  ['eyeson / eyesoff','let Solid see every load, or look away'],
  ['eyes','share your view — Solid sees'],
 ['babystep','one step, for my children'],
 ['edge','to the bottom of the map'],
 ['b1','home — to the ruby at the center'],
 ['brane','the membrane view — low, gazing up'],
 ['walk','a body — joystick runs, triangle jumps'],
 ['fly','the sword — drag aims 360, you follow'],
 ['crown','first-person inside the crown'],
 ['mirror','the camera stands before you'],
 ['king / nokings','a king that is not you / clear them'],
 ['selfdestruct / soliditronium1snap','the frame crumbles — bodies untouched'],
 ['oops','undo — brings it back'],
 ['oops-my-bad','surgical — tap the anchor stone'],
 ['newmap','a fresh field (oops brings it back)'],
 ['save1.. / go1..','claim a spot / return to it'],
 ['lock / unlock / anchors','anchor stones'],
 ['wear <name>','wear a saved build'],
 ['walkline','the ground you cross rises'],
 ['seams','red seams toggle'],
 ['invite','copy the room link'],
 ['send <n> / take <code>','share builds as text'],
 ['did','what you did — 1. 2. 3.'],
 ['twinstrike','when the sky hits twice — the earth remembers']
];
/* the monument shoe — his picture rendered precisely with the game's own tools:
   chrome armor, dark mesh, galaxy panels, blue energy, hex sole pods, heel reactor */
function buildShoe(){
  var g = new T.Group();
  function P(geo, mat, x, y, z){ var m = new T.Mesh(geo, mat); m.position.set(x,y,z); g.add(m); return m; }
  var chrome = new T.MeshStandardMaterial({color:0xd0d4dc, metalness:0.95, roughness:0.28});
  var darkM  = new T.MeshStandardMaterial({color:0x0b0b0e, roughness:0.92});
  var galax  = new T.MeshStandardMaterial({color:0x12125a, emissive:0x2c2ce0, emissiveIntensity:0.8, roughness:0.35});
  var energy = new T.MeshBasicMaterial({color:0x4499ff});
  var steel  = new T.MeshStandardMaterial({color:0xb9bec8, metalness:0.9, roughness:0.32});
  var L = 10; /* length, toe at +z */
  /* sole — dark base, blue light sandwich, hex pods */
  P(new T.BoxGeometry(3.6, 0.9, L), darkM, 0, 0.45, 0);
  P(new T.BoxGeometry(3.8, 0.28, L