I'd put team as part of environment/atmosphere (or vice versa) - I know they arent perfectly matched, but dont the people you work with directly impact the atmosphere?
But in that situation, team definitely won out. Sure, the environment itself sucked, but you hardly noticed because of the group atmosphere.