When the game is minimized, it shifts to an "Away" mode, where when it's opened again, it shows you how many resources you gathered while the game was minimized.
I've discovered a possible bug: when the game enters "Away" mode, the amounts by which each resource grows/shrinks freezes. If you minimized the game while earning -2 food, it doesn't matter if that would be fixed in the next tick by your 20 masons, it remains "-2 food" for as long as "Away" mode is active.
If this behavior is intentional, please let me know.