Experiments and computer simulations are carried out to investigate ordering principles in a granular gas which phase separates under vibration. The densities of the dilute and the dense phase are found to follow a lever rule. A Maxwell construction is found to predict both the coexisting pressure and binodal densities remarkably well, despite the fact that the pressure-volume characteristic $P(v)$ is not an isotherm. Although the system is far from equilibrium and energy conservation is strongly violated, we derive the construction from the minimization of mechanical work and fluctuating particle currents.