diff --git a/public/assets/refuel.js b/public/assets/refuel.js
index 0e9bc5f..d794a0f 100644
--- a/public/assets/refuel.js
+++ b/public/assets/refuel.js
@@ -6,6 +6,8 @@
var nonce = '', tokRet = ''; try { var claims = JSON.parse(atob(tok.split('.')[0].replace(/-/g, '+').replace(/_/g, '/'))); nonce = claims.nonce || ''; tokRet = claims.ret || ''; } catch (e) {}
// every dead end on this page keeps a way back to the run (Marty, 2026-09-30)
var gameHome = tokRet ? tokRet.split('?')[0] : 'https://driprunner.saasy.top/play';
+ var GAME = 'Drip Runner', inGame = false; try { inGame = window.parent !== window; } catch (e) { inGame = true; } // Gem Kingdom shows this page in an overlay (2026-10-03)
+ function setGame(r) { if (!r || !r.game) return; GAME = r.game; var bar = document.querySelector('.rf-bar span'); if (bar) bar.innerHTML = 'InstantAdPay \u00b7 verified visit \u00b7 ' + (r.label || 'refuel') + ' for ' + esc(GAME); }
var ret = null, dwell = 8, left = 8, timer = null, done = false;
function msg(title, text, backUrl) { $('rfFrame').innerHTML = '
' + title + '
' + text + '
'; $('rfDone').hidden = true; $('rfCheck').hidden = true; var b = $('rfBack'); b.hidden = false; var to = backUrl || gameHome; b.textContent = backUrl ? 'Back to the game' : 'Back to Drip Runner'; b.onclick = function () { location.href = to; }; }
function esc(s) { return String(s == null ? '' : s).replace(/[&<>"']/g, function (c) { return { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]; }); }
@@ -30,13 +32,16 @@
function answer(i) {
api('/api/refuel/done', { n: nonce, answer: i }).then(function (r) {
if (r.error) { if (r.retry) return challenge(); $('rfHint').textContent = r.error; $('rfCheck').hidden = true; return; }
- done = true; $('rfCheck').hidden = true; $('rfHint').textContent = 'Visit counted. Your tank is full.';
- var b = $('rfDone'); b.disabled = false; b.textContent = 'Back to the run'; b.onclick = function () { location.href = r.ret; };
+ done = true; $('rfCheck').hidden = true; var gk = GAME === 'Gem Kingdom';
+ $('rfHint').textContent = gk ? 'Visit counted. Your heroes are back on their feet.' : 'Visit counted. Your tank is full.';
+ if (gk && inGame) { try { window.parent.postMessage({ gkContinue: nonce, ok: true }, '*'); } catch (e) {} }
+ var b = $('rfDone'); b.disabled = false; b.textContent = gk ? 'Back to the battle' : 'Back to the run'; b.onclick = function () { location.href = r.ret; };
setTimeout(function () { location.href = r.ret; }, 1200);
});
}
if (!tok) return msg('No refuel link', 'Open this page from the game’s Refuel button.');
api('/api/refuel/open?t=' + encodeURIComponent(tok)).then(function (r) {
+ setGame(r);
if (r.error) return msg('Refuel link problem', esc(r.error));
if (r.done) { location.href = r.ret; return; }
if (r.none) return msg(r.why === 'cap' ? 'That is today’s refuels' : 'No sponsor pages right now', r.why === 'cap' ? 'You have used today’s refuels. Your run and progress are saved, and refuels reopen at midnight Central. Your regular InstantAdPay visits are not affected.' : 'You have used every sponsor page and video running right now. Try again later: new ones start all the time.', r.ret + '&none=1');
diff --git a/public/refuel.html b/public/refuel.html
index b78637b..0ae021d 100644
--- a/public/refuel.html
+++ b/public/refuel.html
@@ -37,6 +37,6 @@ a.rf-open{color:#8FF0FF;font-size:12px}
-
+