<!-- RUBY-BACKUP · part 91 -->
he map stays night, King's order */
    setTimeout(function(){
      try{ if(typeof skyState === 'function') skyState('day'); }catch(e){}
    }, 3500);
    /* GRASS MAP + BROWN BLOCKS — on every load, King's order */
    setTimeout(function(){
      try{ if(typeof runLine === 'function'){ runLine('grassmap'); } }catch(e){}
    }, 4000);
    setTimeout(function(){
      try{ if(typeof runLine === 'function'){ runLine('spawncircle'); } }catch(e){}
    }, 5000);
    /* NIGHT LAST — the 40 Days, nothing overrides it */
    setTimeout(function(){
      try{ if(typeof skyState === 'function') skyState('day'); }catch(e){}
    }, 6000);
    /* FUTURE WEAPON — the King holds it on every load (King's order) */
    setTimeout(function(){
      try{ if(typeof runLine === 'function'){ runLine('futureweapon'); } }catch(e){}
    }, 7000);
    /* BREAKOUT — clears a path on every load, just in case (King's order) */
    /* BUT NOT on another player's spawn — only at Cloud 9 (King's order) */
    setTimeout(function(){
      try{
        if(typeof runLine === 'function' && typeof mePos !== 'undefined'){
          var _sx = mePos.x - 9, _sz = mePos.z - 8;
          if(Math.sqrt(_sx*_sx + _sz*_sz) < 50){
            runLine('breakout');
          }
        }
      }catch(e){}
    }, 8000);
    /* JAILBREAK WATCH — retired, King's order (he's out) */
    /* sonic button moved to MOVE panel */
    /* buildRealToggles removed — joysticks install themselves */
    /* Table starts COLLAPSED in the button — toggles stay visible */
    setTimeout(function(){
      try{
        osEl.style.display = 'none';
        setFloaters(true);
      }catch(e){}
    }, 500);
  }
  if(document.readyState === 'complete'){ startOpen(); }
  else { window.addEventListener('load', startOpen); }

  try{ console.log('[ruby-os] new system live — the law holds'); }catch(e){}
})();


===== FILE: public/ruby-backup/ruby.js =====
var SOLID_SURFACES = [];
(function(){
'use strict';
/* BARE RUBY — the ruby, the grid, tap to place one stone. No menus at all. */
var PLATEAU = {x:8, z:8, r:2.5, h:0.9}; /* reality 1 — our ground, born first */
window.addEventListener('error',function(e){
  try{
    /* Small error table — never blocks the map */
    var t = document.getElementById('ruby-errors');
    if(!t){
      t = document.createElement('div');
      t.id = 'ruby-errors';
      t.style.cssText = 'position:fixed;top:10px;right:10px;z-index:99999;'
        + 'width:200px;max-height:150px;overflow-y:auto;'
        + 'background:rgba(20,10,5,0.9);border:1px solid #d8a920;border-radius:8px;'
        + 'color:#ffaa00;font:10px monospace;padding:6px;display:none;';
      document.body.appendChild(t);
    }
    t.style.display = 'block';
    var row = document.createElement('div');
    row.style.cssText = 'border-bottom:1px solid #442200;padding:2px 0;';
    row.textContent = new Date().toLocaleTimeString() + ' ' + String((e&&e.message)||'unknown').slice(0,80);
    t.appendChild(row);
    /* Keep only last 10 */
    while(t.children.length > 10) t.removeChild(t.firstChild);
    /* Hide the boot screen so the map loads */
    var b = document.getElementById('boot');
    if(b) b.style.display = 'none';
  }catch(ee){}
});
var T = window.THREE;
if(!T){ document.getElementById('boot').textContent='NO LIGHT — THREE MISSING'; return; }
try{
  var _c=document.createElement('canvas');
  if(!(_c.getContext('webgl')||_c.getContext('experimental-webgl')))
    throw new Error('no webgl in this browser');
}catch(e){
  document.getElementById('boot').textContent='THIS BROWSER HAS NO WEBGL';
  return;
}

/* ---- Minimum: the King's eye, 0.13. Nothing is created smaller, by default. ---- */
window.MINIMUM = 0.13;
window.MINIMUM_OFF = window.MINIMUM_OFF || false;
window.applyMinimum = function(obj){
  if(window.MINIMUM_OFF || !obj) return obj;
  var box = new T.Box3().setFromObject(obj);
  var size = new T.Vector3(); box.getSize(size);
  var smallest = Math.min(size.x, size.y, size.z);
  if(smallest > 0 && smallest < window.MINIMUM){
    var k = window.MINIMUM / smallest;
    obj.scale.multiplyScalar(k);
  }
  return obj;
};
var shapeK1 = {};   /* legal scale of each shape's 1-ruby base — filled by legalK1 */

var CELL = 2;                 /* placement still snaps to the 2-unit grid */
var LSKEY = 'ruby-builds-v1';
/* watch / shared room: ?watch=<id> streams the field to the box; ?watch=<id>&view=1
   only watches. with just ?watch=<id> it is a shared room — we play together there:
   both sides poll, both sides post, the newest field wins. */
var _wq = {};
try{ location.search.slice(1).split('&').forEach(function(p){ var kv=p.split('='); _wq[decodeURIComponent(kv[0])]=decodeURIComponent(kv[1]||''); }); }catch(e){}
var WATCH_ID = /^[a-z0-9-]{1,32}$/.test(_wq.watch||'') ? _wq.watch : '';
var IS_PRACTICE = (typeof location!=='undefined' && location.pathname==='/practice');
var _duckMode = false;
var VIEW_ONLY = !!WATCH_ID && _wq.view==='1';
var SHARED = !