I really like this! I just wanted to report that when you click out of the game into a new tab/window and come back, all of the colors become full instantly. I'm not sure what's causing the bug, but figured you'd want to know.
I think I know the issue. The time calculated as being "away" isn't actually related to how long you are out of the game. It's how long you were in the game before clicking off and back in again!
So if you have the game open for 30 minutes, move to a new tab and move back to the game then you instantly get 30 minutes of offline gains. You can easily test this by keeping the game open for 30 seconds, click off and back instantly and you get 30 seconds of gains.