diff --git a/game.js b/game.js index ff6cf10..f27985d 100644 --- a/game.js +++ b/game.js @@ -1849,11 +1849,17 @@ function renderResources() { const el = document.getElementById(id); if (el) { el.textContent = fmt(val); - // Show full spelled-out number on hover for educational value + // Show full spelled-out number on hover for educational reference el.title = val >= 1000 ? spellf(Math.floor(val)) : ''; } const rEl = document.getElementById(id + '-rate'); - if (rEl) rEl.textContent = (rate >= 0 ? '+' : '') + fmt(rate) + '/s'; + if (rEl) { + rEl.textContent = (rate >= 0 ? '+' : '') + fmt(rate) + '/s'; + // Red when draining, green when gaining, dim when zero + if (rate < 0) rEl.style.color = '#f44336'; + else if (rate > 0) rEl.style.color = '#4caf50'; + else rEl.style.color = '#555'; + } }; set('r-code', G.code, G.codeRate);