  Assume $n$ players are placed on the $n$ vertices of a graph $G$. The
following game was introduced by Winkler: An adversary puts a hat on each
player, where each hat has a colour out of $q$ available colours. The players
can see the hat of each of their neighbours in $G$, but not their own hat.
Using a prediscussed guessing strategy, the players then simultaneously guess
the colour of their hat. The players win if at least one of them guesses
correctly, else the adversary wins. The largest integer $q$ such that there is
a winning strategy for the players is denoted by $\text{HG}(G)$, and this is
called the hat guessing number of $G$.
  Although this game has received a lot of attention in the recent years, not
much is known about how the hat guessing number relates to other graph
parameters. For instance, a natural open question is whether the hat guessing
number can be bounded from above in terms of degeneracy. In this paper, we
prove that the hat guessing number of a graph can be bounded from above in
terms of a related notion, which we call strong degeneracy. We further give an
exact characterisation of graphs with bounded strong degeneracy. As a
consequence, we significantly improve the best known upper bound on the hat
guessing number of outerplanar graphs from $2^{125000}$ to $40$, and further
derive upper bounds on the hat guessing number for any class of $K_{2,s}$-free
graphs with bounded expansion, such as the class of $C_4$-free planar graphs,
more generally $K_{2,s}$-free graphs with bounded Hadwiger number or without a
$K_t$-subdivision, and for Erd\H{o}s-R\'enyi random graphs with constant
average degree.
