I just spend whatever I have before I close it.
That's a good habit to have, but sometimes you might need to do as I suggested.
For example, I needed 890k gold to upgrade my mana storage, but I only had 790k and all my troops had just died so I couldn't raid. I had to leave the app open for 30 minutes waiting on troops so I could raid that last 100k.
This post was edited on 1/1 at 9:57 pm