Technically, the line is at the second to last opponent in the direction of attack.
The usual case is that the goalkeeper is the last opponent, so the line is at the last defender.
If the keeper comes forward past some of the defenders, then the line would be at the second last defender.
The attacker also has to be ahead of the ball to be offside, which doesn’t seem to be mentioned in the link. You could have two attackers, both in offside positions, but if the one with the ball passes to the second attacker and the second is behind the ball when the pass is made, then it is not offside.
So almost exactly the same rule as ice hockey.
Similar, there’s just no blue line. The “line” in football is just wherever the rearmost defender happens to be standing.
Technically, the line is at the second to last opponent in the direction of attack.
The usual case is that the goalkeeper is the last opponent, so the line is at the last defender. If the keeper comes forward past some of the defenders, then the line would be at the second last defender.
The attacker also has to be ahead of the ball to be offside, which doesn’t seem to be mentioned in the link. You could have two attackers, both in offside positions, but if the one with the ball passes to the second attacker and the second is behind the ball when the pass is made, then it is not offside.
I never even considered the goalie being past a defender, but that’s a good distinction.