**Abstract** : For the 2D Euler equations and related models of geophysical flows, minima of energy--Casimir variational problems are stable steady states of the equations (Arnol'd theorems). The same variational problems also describe sets of statistical equilibria of the equations. In this paper, we make use of Lyapunov--Schmidt reduction in order to study the bifurcation diagrams for these variational problems, in the limit of small energy or, equivalently, of small departure from quadratic Casimir functionals. We show a generic occurrence of phase transitions, either continuous or discontinuous. We derive the type of phase transitions for any domain geometry and any model analogous to the 2D Euler equations. The bifurcations depend crucially on a_4, the quartic coefficient in the Taylor expansion of the Casimir functional around its minima. Note that a_4 can be related to the fourth moment of the vorticity in the statistical mechanics framework. A tricritical point (bifurcation from a continuous to a discontinuous phase transition) often occurs when a_4 changes sign. The bifurcations depend also on possible constraints on the variational problems (circulation, energy). These results show that the analytical results obtained with quadratic Casimir functionals by several authors are non-generic (not robust to a small change in the parameters).