While actively playing, you are protected by a shield. This shield prevents you from losing card pieces when players attack you during that time.
Some players reported having lost a Card Piece while being in the game. This is entirely possible.
"Actively playing" implies that actions have to be taken. Just keeping the game open and tapping a menu button does not keep the protection shield up.