<!-- RUBY-BACKUP · part 204 -->
k.'
    }
  ]
};

/* THE SINKING — Continuum to max for 2 minutes. No alternative. */
var CONTINUUM_LOCKED = false;
function sinkContinuum(){
  if(typeof DESK_PAD==='undefined') return;
  /* force to max 25 */
  var paradoxCodes = [
    'twin', 'flare', 'court', 'solid', 'quest',
    'ancestors', 'hokulea', 'dark', 'city', 'plaza',
    'wildlife', 'spaceport', 'cosmic', 'valleys', 'wildterrain',
    'rural', 'tribal', 'play', 'officer', 'spacemission',
    'continuum', 'dome', 'stranger', 'stats', 'ending'
  ];
  DESK_PAD = paradoxCodes.slice(0, 25);
  try{ localStorage.setItem('ruby-chartpad', JSON.stringify(DESK_PAD)); }catch(e){}
  CONTINUUM_LOCKED = true;
  /* show the sinking */
  var div = document.createElement('div');
  div.id = 'continuum-sink';
  div.style.cssText = 'position:fixed;top:40%;left:50%;transform:translate(-50%,-50%);z-index:20000;background:rgba(10,5,30,0.97);border:3px solid #8844ff;border-radius:12px;padding:25px 40px;color:#fff;font-family:Georgia,serif;text-align:center;max-width:85%;';
  div.innerHTML = '<div style="color:#aa88ff;font-size:22px;font-weight:bold;margin-bottom:15px;">THE CONTINUUM SINKS</div>'
    + '<div style="font-style:italic;font-size:17px;line-height:1.7;">'
    + 'Your pad fills to max. 25/25.<br>'
    + 'You cannot help it.<br><br>'
    + 'That is all you could do.<br>'
    + 'There was no other option.<br>'
    + 'No alternative.'
    + '</div>'
    + '<div style="margin-top:15px;font-size:14px;color:#888;">Locked for 2 minutes</div>'
    + '<div id="sink-timer" style="font-size:28px;color:#aa88ff;margin-top:10px;">2:00</div>';
  document.body.appendChild(div);
  /* 2 minute countdown */
  var remaining = 120;
  var timer = setInterval(function(){
    remaining--;
    var t = document.getElementById('sink-timer');
    if(t){
      var m = Math.floor(remaining/60), s = remaining%60;
      t.innerHTML = m+':'+(s<10?'0':'')+s;
    }
    if(remaining <= 0){
      clearInterval(timer);
      CONTINUUM_LOCKED = false;
      var d = document.getElementById('continuum-sink');
      if(d){
        d.innerHTML = '<div style="color:#ffd700;font-size:20px;font-weight:bold;">RELEASED</div>'
          + '<div style="font-style:italic;margin-top:10px;">The paradox passes.<br>You did all you could do.</div>'
          + '<button onclick="document.getElementById(\'continuum-sink\').remove()" style="margin-top:15px;padding:10px 25px;background:transparent;border:2px solid #ffd700;color:#ffd700;border-radius:6px;cursor:pointer;">Continue</button>';
      }
      codeStatus('Continuum released — the 2 minutes have passed');
    }
  }, 1000);
  codeStatus('Continuum sunk to max — locked for 2 minutes. No alternative.');
}
/* prevent changes while locked */
var _origPadAdd = null;
function guardContinuum(){
  /* this runs on pad add attempts */
  if(CONTINUUM_LOCKED){
    codeStatus('Continuum is locked — the paradox holds it. No alternative.');
    return true;
  }
  return false;
}

/* THE COURT WAITS — months of playing first */
function monthsPlayed(){
  try{
    var first = localStorage.getItem('ruby-first-play');
    if(!first){
      localStorage.setItem('ruby-first-play', Date.now().toString());
      return 0;
    }
    return (Date.now() - parseInt(first)) / (30*24*60*60*1000);
  }catch(e){ return 0; }
}
function courtIsReady(){
  return monthsPlayed() >= 2;
}
/* boundary respected — they never cross it. The capsule comes to them. */
/* old proximity check disabled */
function courtNotReady(){
  var m = monthsPlayed();
  var remaining = Math.max(0, 2 - m);
  var days = Math.ceil(remaining * 30);
  codeStatus('the court has not convened yet — '+days+' days of playing remain');
}

/* THE FORBIDDEN THING — futuristic, seems like it should be theirs */
var FORBIDDEN_TOUCHED = false;
function buildForbiddenThing(x, y, z){
  var g = new THREE.Group();
  /* futuristic — sleek, glowing, beautiful */
  var chrome = new THREE.MeshStandardMaterial({color: 0xc0c0ff, metalness: 0.95, roughness: 0.1});
  var glowCyan = new THREE.MeshBasicMaterial({color: 0x00ffff, transparent: true, opacity: 0.6});
  var glowViolet = new THREE.MeshBasicMaterial({color: 0x8844ff, transparent: true, opacity: 0.5});
  /* the core — a floating twin crystal */
  var crystal1 = new THREE.Mesh(new THREE.OctahedronGeometry(0.3), chrome);
  crystal1.position.set(-0.25, 1.5, 0);
  g.add(crystal1);
  var crystal2 = new THREE.Mesh(new THREE.OctahedronGeometry(0.3), chrome);
  crystal2.position.set(0.25, 1.5, 0);
  g.add(crystal2);
  /* twin lightning arcs between them */
  for(var i=0; i<3; i++){
    var arc = new THREE.Mesh(new THREE.TorusGeometry(0.25, 0.02, 8, 20, Math.PI), glowCyan);
    arc.position.set(0, 1.5, 0);
    arc.rotation.z = (i * Math.PI / 3);
    g.add(arc);
  }
  /* halo — it looks GOOD, inviting */
  var halo = new THREE.Mesh(new THREE.TorusGeometry(0.8, 0.05, 10, 40), glowViolet);
  halo.position.y = 1.5;
  halo.rotation.x = Math.PI/2;
  g.add(halo);
  /* p