In a 3 player game, the game should end if anyone leaves
In a 4 player game with 2 pink, 2 green, if a guesser leaves, the remaining guesser should defect to the gray team. If a spymaster leaves, their guesser should be promoted to spymaster and the other guesser should defect to the gray team.
Similar logic for 5+ players (promote to spymaster if necessary, redistribute guessers as needed)