THE DECISION
The referee awards an indirect free kick to Team B because the offside offence occurred before the foul. As the attacker was in an offside position, there was no promising attack, so the defender cannot be cautioned for SPA (no yellow card).
Read official Law 11 ↗