<!-- RUBY-BACKUP · part 105 -->
 m.geometry) layers.push(m);
        });
        if(layers.length === 0 && obj.isMesh) layers.push(obj);
        var group = new THREE.Group();
        layers.forEach(function(layer, li){
          try{
            /* gold base — the layer's own linework */
            var wg = new THREE.WireframeGeometry(layer.geometry);
            var wm = new THREE.LineBasicMaterial({
              color: 0xffd700, transparent: true, opacity: 0.85
            });
            var w = new THREE.LineSegments(wg, wm);
            /* orange finer — ultra-dense second pass */
            var wg2 = new THREE.WireframeGeometry(layer.geometry);
            var wm2 = new THREE.LineBasicMaterial({
              color: 0xff6600, transparent: true, opacity: 0.45
            });
            var w2 = new THREE.LineSegments(wg2, wm2);
            w2.scale.set(1.015, 1.015, 1.015);
            /* match the layer's transform for grow/shrink */
            var lw = new THREE.Group();
            lw.add(w); lw.add(w2);
            lw.position.copy(layer.position);
            lw.rotation.copy(layer.rotation);
            lw.scale.copy(layer.scale);
            lw.userData.layerRef = layer;
            lw.userData.isIntaglio = true;
            group.add(lw);
          }catch(e){}
        });
        obj.add(group);
        INTAGLIO_OVERLAYS[objId] = group;
      }catch(e){}
      codeStatus('anchored — intaglio holds it');
    }
  }catch(e){}
}
/* enforce anchors — locked bodies stay in one spot */

/* sync intaglio linework to layer scale during grow/shrink */

/* LAW: the intaglio must fit the object's boundaries — or no adjustment */




/* OBLIGATION: you arrived owing. 16 to balance. Carry to pay it down. */
var OBLIGATION_TOTAL = 16;
var OBLIGATION_PAID = 0;
try{
  var op = localStorage.getItem('ruby-obligation-paid');
  if(op) OBLIGATION_PAID = parseInt(op, 10) || 0;
}catch(e){}
function saveObligation(){
  try{ localStorage.setItem('ruby-obligation-paid', String(OBLIGATION_PAID)); }catch(e){}
}
function payObligation(n){
  n = n || 1;
  if(OBLIGATION_PAID >= OBLIGATION_TOTAL) return;
  OBLIGATION_PAID = Math.min(OBLIGATION_TOTAL, OBLIGATION_PAID + n);
  saveObligation();
  try{
    if(OBLIGATION_PAID >= OBLIGATION_TOTAL){
      codeStatus('Obligation balanced. You owe nothing.');
      if(typeof playfulSparkle==='function' && typeof mePos!=='undefined'){
        playfulSparkle(new THREE.Vector3(mePos.x, mePos.y+2, mePos.z), 0xffd700);
      }
    }
  }catch(e){}
}
function getObligationLeft(){
  try{ return OBLIGATION_TOTAL - OBLIGATION_PAID; }catch(e){ return 16; }
}
function isObligationBalanced(){
  try{ return OBLIGATION_PAID >= OBLIGATION_TOTAL; }catch(e){ return false; }
}
/* CONTINUUM IS THE CURRENCY */
/* BALANCE: gather and flow in harmony — unlocks the 2nd level */
var CONTINUUM_GATHERED = 0;
var CONTINUUM_SPENT = 0;
try{
  var cg = localStorage.getItem('ruby-continuum-gathered');
  if(cg) CONTINUUM_GATHERED = parseInt(cg, 10) || 0;
  var cs = localStorage.getItem('ruby-continuum-spent');
  if(cs) CONTINUUM_SPENT = parseInt(cs, 10) || 0;
}catch(e){}
function saveContinuumFlow(){
  try{
    localStorage.setItem('ruby-continuum-gathered', String(CONTINUUM_GATHERED));
    localStorage.setItem('ruby-continuum-spent', String(CONTINUUM_SPENT));
  }catch(e){}
}
function getContinuumBalance(){ try{ return CONTINUUM_GATHERED - CONTINUUM_SPENT; }catch(e){ return 0; } }
function continuumGathered(){
  CONTINUUM_GATHERED++;
  saveContinuumFlow();
  checkContinuumBalance();
}
function continuumSpent(){
  CONTINUUM_SPENT++;
  saveContinuumFlow();
  checkContinuumBalance();
}
function hasContinuumBalance(){
  /* balance: gathered in flow, spent in kind, pad alive */
  try{
    var padCount = (typeof DESK_PAD!=='undefined' ? DESK_PAD.length : 0);
    return CONTINUUM_GATHERED >= 10 && CONTINUUM_SPENT >= 5 && padCount > 0;
  }catch(e){ return false; }
}
/* at level 2 you hold 100% and 100% — the numbers are never shown */
var LEVEL2_FULL = { inflow: false, outflow: false };
function checkContinuumBalance(){
  try{
    if(hasContinuumBalance() && PLAYER_LEVEL < 2){
      PLAYER_LEVEL = 2;
      LEVEL2_FULL.inflow = true;
      LEVEL2_FULL.outflow = true;
      saveProgress();
      try{
        localStorage.setItem('ruby-level2-full', '1');
      }catch(e){}
      /* no numbers — the state is felt, not displayed */
      try{ codeStatus('continuum balance achieved — 2nd level earned'); }catch(e){}
    }
  }catch(e){}
}
try{
  if(localStorage.getItem('ruby-level2-full')==='1'){
    LEVEL2_FULL.inflow = true;
    LEVEL2_FULL.outflow = true;
  }
}catch(e){}
/* check on load */
setTimeout(function(){ try{ checkContinuumBalance(); }catch(e){} }, 3000);





/* THE PROPHETESS: she knew you would come. She knows when you see her. */
var PROPHETESS_AURA = null;
var LITTLE_GIRL = null;
var FLOWER_GIFT = null;
var BUSY_DAD_SHIP = null;
function buildProphetessScene(){
  try{
    var cc = (typeof getCityCenter==='fun