<!-- RUBY-BACKUP · part 211 -->
ouch');
        if(d) d.remove();
        /* THE CASE BEGINS */
        if(courtIsReady()){
          startTwinCase();
        }else{
          codeStatus('the lightning sleeps... for now. The court has not convened yet.');
        }
      }, 2000);
    }
  }, 1800);
}
/* check on load */
try{
  if(localStorage.getItem('ruby-forbidden-touched')==='1') FORBIDDEN_TOUCHED = true;
}catch(e){}
function startTwinCase(){
  TWIN_CASE.active = true;
  TWIN_CASE.stage = 0;
  showTwinStage();
  codeStatus('CASE: The Twin Lightning — the court will try to make you look bad. Stand firm.');
}
function showTwinStage(){
  var s = TWIN_CASE.stages[TWIN_CASE.stage];
  if(!s){
    endTwinCase();
    return;
  }
  var div = document.createElement('div');
  var existing = document.getElementById('quest-hud');
  if(existing) existing.remove();
  div.id = 'quest-hud';
  div.style.cssText = 'position:fixed;top:15%;left:50%;transform:translateX(-50%);z-index:9999;background:rgba(25,10,30,0.97);border:3px solid #8844ff;border-radius:12px;padding:20px 30px;color:#fff;font-family:Georgia,serif;max-width:85%;text-align:center;';
  var choicesHtml = s.choices.map(function(ch, i){
    return '<button onclick="twinChoose('+i+')" style="display:block;width:100%;margin:8px 0;padding:10px;background:#332055;color:#fff;border:1px solid #8844ff;border-radius:6px;cursor:pointer;">'+ch+'</button>';
  }).join('');
  div.innerHTML = '<div style="color:#aa88ff;font-weight:bold;font-size:20px;margin-bottom:10px;">⚡ THE TWIN LIGHTNING</div>'
    + '<div style="font-size:13px;color:#888;margin-bottom:15px;">Stage '+(TWIN_CASE.stage+1)+' of '+TWIN_CASE.stages.length+' — the court is trying to make you look bad</div>'
    + '<div style="font-style:italic;font-size:17px;margin-bottom:15px;line-height:1.5;">"'+s.prosecution+'"</div>'
    + choicesHtml;
  document.body.appendChild(div);
}
function twinChoose(idx){
  var s = TWIN_CASE.stages[TWIN_CASE.stage];
  if(s.sink && !CONTINUUM_LOCKED){
    sinkContinuum();
  }
  var div = document.getElementById('quest-hud');
  /* reveal the truth */
  if(div){
    div.innerHTML = '<div style="color:#aa88ff;font-weight:bold;font-size:20px;margin-bottom:15px;">⚡ THE TRUTH</div>'
      + '<div style="font-style:italic;font-size:16px;line-height:1.6;color:#ddccff;">'+s.truth+'</div>'
      + '<div style="margin-top:20px;"><button onclick="twinNext()" style="padding:10px 25px;background:#442288;color:#fff;border:1px solid #8844ff;border-radius:6px;cursor:pointer;">Continue</button></div>';
  }
}
function twinNext(){
  TWIN_CASE.stage++;
  if(TWIN_CASE.stage >= TWIN_CASE.stages.length){
    endTwinCase();
  }else{
    showTwinStage();
  }
}

/* THE JURY — they select not guilty */
function juryDeliberate(callback){
  var jurors = [
    'Juror 1: "The evidence... it does not hold."',
    'Juror 2: "A victim of circumstance. I see it."',
    'Juror 3: "The twin lightning — who can fight the storm?"',
    'Juror 4: "We tried to make them look bad. We failed."',
    'Juror 5: "There is only one just choice."',
    'Juror 6: "Not guilty. That is all we could really do."'
  ];
  var div = document.createElement('div');
  var existing = document.getElementById('quest-hud');
  if(existing) existing.remove();
  div.id = 'quest-hud';
  div.style.cssText = 'position:fixed;top:15%;left:50%;transform:translateX(-50%);z-index:9999;background:rgba(15,15,25,0.97);border:3px solid #8888ff;border-radius:12px;padding:20px 30px;color:#fff;font-family:Georgia,serif;max-width:85%;text-align:center;';
  div.innerHTML = '<div style="color:#8888ff;font-weight:bold;font-size:20px;margin-bottom:10px;">THE JURY DELIBERATES</div>'
    + '<div style="font-size:13px;color:#888;margin-bottom:15px;">The case rests. They decide.</div>'
    + '<div id="jury-talk" style="font-style:italic;font-size:16px;line-height:1.8;min-height:120px;text-align:left;"></div>';
  document.body.appendChild(div);
  var talk = document.getElementById('jury-talk');
  var i = 0;
  var jt = setInterval(function(){
    if(i < jurors.length){
      talk.innerHTML += '<div style="margin:8px 0;opacity:0;animation:fadein 1s forwards;">'+jurors[i]+'</div>';
      i++;
    }else{
      clearInterval(jt);
      setTimeout(function(){
        /* the verdict */
        talk.innerHTML += '<div style="margin-top:15px;font-weight:bold;color:#00ff88;font-size:18px;animation:fadein 1s forwards;">FOREPERSON: "We the jury find the defendant... NOT GUILTY."</div>';
        setTimeout(function(){
          var d = document.getElementById('quest-hud');
          if(d) d.remove();
          if(callback) callback();
        }, 3000);
      }, 1000);
    }
  }, 1800);
  /* fadein animation */
  var style = document.createElement('style');
  style.innerHTML = '@keyframes fadein { to { opacity: 1; } }';
  document.head.appendChild(style);
}

/* AFTER THE COURT — the rich stranger appears */

/* THE RESOLUTION — all he ever needed */

/* FRIENDLY CALLS — overheard kindn