Games, equilibria and the variational representation of preferences