Thanks for the review!
It's not actually a bug, by design the fail/win states only activate between generating segments of the stage, so there's a bit of a buffer between reaching 0 or 100 energy, and then the game over/victory condition triggering. Makes it so if a player gets to 0 they can scramble to claw their way back up before the invisible timer runs out, or to maintain themselves over 100 for a little bit, rather than ending as soon as they reach it.
Of course that can all be changed but at the moment we thought this would work best, haha