<!-- RUBY-BACKUP · part 208 -->
ained it.<br>You will need to recharge.</div>'
    + '<div style="margin-top:20px;"><button onclick="rechargePad()" style="padding:12px 30px;background:#003300;color:#00ff88;border:2px solid #00ff88;border-radius:6px;cursor:pointer;font-size:16px;">RECHARGE</button></div>';
  document.body.appendChild(div);
  codeStatus('pad shut down — the long walk drained it');
}
function rechargePad(){
  var div = document.getElementById('pad-shutdown');
  loadPadCharge();
  /* recharge takes a moment */
  if(div){
    div.innerHTML = '<div style="font-size:20px;margin-bottom:15px;">⚡</div>'
      + '<div style="font-weight:bold;">RECHARGING...</div>'
      + '<div id="charge-bar" style="width:200px;height:20px;background:#222;border:1px solid #00ff88;border-radius:10px;margin:15px auto;overflow:hidden;"><div id="charge-fill" style="width:0%;height:100%;background:#00ff88;"></div></div>';
  }
  var pct = 0;
  var ct = setInterval(function(){
    pct += 10;
    var fill = document.getElementById('charge-fill');
    if(fill) fill.style.width = pct+'%';
    if(pct >= 100){
      clearInterval(ct);
      PAD_CHARGE = 100;
      savePadCharge();
      if(div) div.remove();
      codeStatus('pad recharged to 100%');
      /* now the return mission */
      returnMission();
    }
  }, 300);
}
/* THE RETURN MISSION */
function returnMission(){
  var div = document.createElement('div');
  div.id = 'return-mission';
  div.style.cssText = 'position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:20000;background:rgba(10,15,30,0.97);border:3px solid #00ffff;border-radius:12px;padding:25px 40px;color:#fff;font-family:Georgia,serif;text-align:center;max-width:85%;';
  div.innerHTML = '<div style="color:#00ffff;font-weight:bold;font-size:22px;margin-bottom:15px;">YOUR MISSION</div>'
    + '<div style="font-style:italic;font-size:17px;line-height:1.8;">'
    + 'Return the twin lightning crystal.<br><br>'
    + 'Take it back to where it belongs.<br>'
    + 'To the Soliditronium.<br><br>'
    + 'The capsule was on its way there.<br>'
    + 'Finish its journey.'
    + '</div>'
    + '<div style="margin-top:20px;"><button onclick="doReturn()" style="padding:12px 35px;background:transparent;border:2px solid #00ffff;color:#00ffff;font-size:16px;border-radius:6px;cursor:pointer;">Return It</button></div>';
  document.body.appendChild(div);
}
function doReturn(){
  var div = document.getElementById('return-mission');
  if(div) div.remove();
  /* remove from inventory */
  removeFromInventory('twin-crystal');
  codeStatus('the twin lightning is returned to the Soliditronium');
  unlockAchievement('Returned the Twin Lightning');
  /* the court searches him — cannot find it */
  setTimeout(function(){ courtSearch(); }, 3000);
}

/* THE GRID — the crystal cannot connect. He has no charger. */
function gridDesperation(){
  var div = document.createElement('div');
  div.id = 'grid-desperation';
  div.style.cssText = 'position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:20000;background:rgba(5,15,25,0.97);border:3px solid #00ffff;border-radius:12px;padding:25px 40px;color:#fff;font-family:Georgia,serif;text-align:center;max-width:85%;';
  div.innerHTML = '<div style="color:#00ffff;font-weight:bold;font-size:20px;margin-bottom:15px;">WHY THEY MUST FIND IT</div>'
    + '<div id="grid-words" style="font-style:italic;font-size:17px;line-height:1.9;min-height:180px;text-align:left;"></div>';
  document.body.appendChild(div);
  var words = [
    'The twin lightning cannot connect to the grid.',
    'The grid is where everything is tracked. Controlled. Safe.',
    'But the crystal is backwards. It will not connect.',
    'It drains. It steals. It stays dark.',
    '',
    'He wants to connect to the grid.',
    'He wants to plug in. To be found. To be helped.',
    'But he has no charger.',
    'His pad is dead. The valley took it all.',
    '',
    '<span style="color:#ff6666;">That is why the court needs to find it.</span>',
    '<span style="color:#ff6666;">A thing that cannot be tracked, in the hands of a man who cannot call for help.</span>'
  ];
  var w = document.getElementById('grid-words');
  var i = 0;
  var wt = setInterval(function(){
    if(i < words.length){
      if(words[i]===''){
        w.innerHTML += '<div style="height:10px;"></div>';
      }else{
        w.innerHTML += '<div style="margin:8px 0;opacity:0;animation:fadein 1s forwards;">'+words[i]+'</div>';
      }
      i++;
    }else{
      clearInterval(wt);
      setTimeout(function(){
        var d = document.getElementById('grid-desperation');
        if(d) d.remove();
      }, 4000);
    }
  }, 1600);
}
function courtSearch(){
  gridDesperation();
  setTimeout(function(){
  var div = document.createElement('div');
  div.id = 'court-search';
  div.style.cssText = 'position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:20000;background:rgba(25,5,5,0.97);border:3px solid #ff0000;border-radius:0;padding:2