The "you're out of moves, game over" state can be erroneous. For instance, if you fill the board while still having any spare gadgets to remove a piece on the board, the game still forces a game over, even if using that gadget would clear half the board.
Thus, please change the game over prerequisite to full board plus no gadgets remaining.