Text this: Subgame-perfect Equilibria in Mean-payoff Games (journal version)