diff --git a/index.html b/index.html
index 9222c5f..61dbb4b 100644
--- a/index.html
+++ b/index.html
@@ -2333,6 +2333,18 @@ document.querySelectorAll('.tab-btn').forEach(btn => {
if (boost && /^\d{1,6}$/.test(boost)) document.getElementById('boostFunds').value = boost;
})();
+// ─── CTB Identity (sponsor alignment) ───────────────────────
+// One member, two usernames: their Crypto Team Build username and their
+// ClickBaitPays username (the affiliateid on their CTB downline-builder
+// entry for program #73). member-program-link.php resolves either direction.
+// Share links may carry ?ctb= (canonical) or the legacy
+// ?ref=; both end up fully resolved here.
+// MUST be declared before updateAll(): the ROI storage key reads IDENT
+// during the first paint (TDZ crash caught live 2026-08-01).
+const CTB_LOOKUP_URL = 'https://cryptoteambuild.com/api/member-program-link.php';
+const HUB_BASE = 'https://ctbrewards.saasy.top';
+const IDENT = { cbp: getRefFromURL() || 'cryptoteambuild', ctb: '', fallback: false };
+
updateAll();
// ─── URL Param Helpers ──────────────────────────────────────
@@ -2341,16 +2353,6 @@ function getRefFromURL() {
return p.get('ref') || '';
}
-// ─── CTB Identity (sponsor alignment) ───────────────────────
-// One member, two usernames: their Crypto Team Build username and their
-// ClickBaitPays username (the affiliateid on their CTB downline-builder
-// entry for program #73). member-program-link.php resolves either direction.
-// Share links may carry ?ctb= (canonical) or the legacy
-// ?ref=; both end up fully resolved here.
-const CTB_LOOKUP_URL = 'https://cryptoteambuild.com/api/member-program-link.php';
-const HUB_BASE = 'https://ctbrewards.saasy.top';
-const IDENT = { cbp: getRefFromURL() || 'cryptoteambuild', ctb: '', fallback: false };
-
function getCbpUser() { return IDENT.cbp; }
function hubUrl() {