Why is the hamiltonian density defined as:
$$\mathcal{H}=\dot{\phi}\pi-\mathcal{L}$$
Where $\pi \equiv \frac{d\mathcal{L}}{d\dot{\phi}}$ and $\mathcal{L}(\dot\phi, \nabla \phi, \phi)$ is a function of the field and it's derivatives.
The thing that bothers me is that we favour the time coordinate over other coordinates such that we define $\pi \equiv \frac{d\mathcal{L}}{d\dot{\phi}}$ and not for example $\pi \equiv \frac{d\mathcal{L}}{d\partial_x \phi}$, which is what I would expect for a relativistic theory.
In case such thing exist, I hypothesize that it would be of the form:
$$\mathcal{H} = \partial_{\mu}\phi \frac{d\mathcal{L}}{d\partial_\mu \phi}-\mathcal{L}$$
Does such a thing exist? If not then what is the reason?