We develop an analytic theory of strong anisotropy of the energy spectra in the thermally-driven turbulent counterflow of superfluid He-4. The key ingredients of the theory are the three-dimensional differential closure for the vector of the energy flux and the anisotropy of the mutual friction force. We suggest an approximate analytic solution of the resulting energy-rate equation, which is fully supported by the numerical solution. The two-dimensional energy spectrum is strongly confined in the direction of the counterflow velocity. In agreement with the experiment, the energy spectra in the direction orthogonal to the counterflow exhibit two scaling ranges: a near-classical non-universal cascade-dominated range and a universal critical regime at large wavenumbers. The theory predicts the dependence of various details of the spectra and the transition to the universal critical regime on the flow parameters. This article is a part of the theme issue Scaling the turbulence edifice.