diff --git a/index.html b/index.html index 9225393..59c4f9b 100644 --- a/index.html +++ b/index.html @@ -1724,18 +1724,26 @@ ${numPeople > 0 ? ` } let cumRunning = 0; + let roiCum = 0; let roiHit = false; + let roiRow = ''; // phase key where ROI was achieved let rows = ''; for (const k of phases) { const p = HYBRIDS[k]; const yourCut = p.payout * (commPct / 100); - const cyclesNum = p.cycles; + const cyclesNum = k === '3xL7' ? 1 : p.cycles; + // Track cumulative payout (always accumulates — this is the total to sponsor) + cumRunning += yourCut * cyclesNum; + + // Track ROI separately (only when there's a gift cost) if (!roiHit && giftCost > 0) { - for (let i = 0; i < cyclesNum; i++) cumRunning += yourCut; - if (cumRunning >= giftCost) roiHit = true; + roiCum += yourCut * cyclesNum; + if (roiCum >= giftCost) { + roiHit = true; + roiRow = k; + } } - const isRoi = giftCost > 0 && !roiHit ? true : false; - const cls = k === '3xL7' ? 'endgame' : (isRoi && roiHit ? 'highlight' : ''); + const cls = k === '3xL7' ? 'endgame' : (k === roiRow ? 'highlight' : ''); rows += ` ${p.label} ${k === '3xL7' ? 'every 19d' : `${cyclesNum}×`}