This is the issue of the game right now, there isn't a clear game over condition. When you cannot beat a fight, you should lose. I didn't find an elegant solution for this, apart from trying to solve the board by code ?
Some other solutions would be to have a hard 20 turn limit, or try to detect a stalemate, but both of these solution implies the player to deliberately do the actions for that.
Some other other solutions would be to lose if you get under a certain piece threshold.
I take suggestions on this if anyone has a cool way to do it !