Brazil's draw against Switzerland in its first Group E match could come back to haunt it yet. After a thrilling 2-0 win against Costa Rica on Friday that was 0-0 through 90 minutes, Brazil waited with bated breath to see what would happen between Switzerland and Serbia.

The result? Not exactly favorable when it comes to peace of mind.

Switzerland beat Serbia 2-1, giving it four points for the group -- tied with Brazil. Here's what the standings look like now:

This is one of only two groups in which three teams have a win, the other being Group B. Which, of course, means that things just got complicated. Here's how each of the remaining teams can advance (Costa Rica is eliminated).

Brazil

If you're Brazil, it's simple. A win or a draw against Serbia, and you're in. Brazil's four points have it sitting in good shape.

A draw leaves Serbia with four points and Brazil with five. The group would then be determined by Switzerland's match against Costa Rica. If Switzerland draws, Brazil has a plus-two goal differential as well, which gives it a slight edge over Switzerland's plus-one and the top spot out of the group. If both Brazil and Switzerland win by the same score, Brazil would also win the group. However, the bottom line is a win or a draw pushes Brazil forward.

Should Brazil and Switzerland both lose, Serbia would advance and Brazil and Switzerland's fates would be determined by goal differential.

Switzerland

Switzerland can also advance with a win or a draw. What matters are the scenarios that keep the Swiss out. If Brazil wins, Switzerland gets in no matter what.

However, if Brazil loses, Switzerland needs a win or a draw with Costa Rica in order to avoid a tiebreaker scenario with Brazil, which is still might win depending on the final scores of both matches. If Brazil and Serbia draw, meanwhile, Switzerland will need a win or a draw to avoid tiebreakers with Serbia.

Ultimately, Switzerland holds the keys to the knockout stage with a win or a draw over Costa Rica.

Serbia

Serbia also finds itself in a "win and you're in" situation, and it can still win the group. If Serbia beats Brazil, it punches a ticket to knockouts. What happens from there is up to Switzerland's match against Costa Rica. It can win the group with a win and Swiss loss or draw, as that would put Serbia at six points, Switzerland at four or five points, and Brazil at four points.

Possible outcomes

Brazil wins over Serbia

  • Brazil wins, Switzerland wins: Brazil and Switzerland advance, tiebreakers determine group
  • Brazil wins, Switzerland draws: Brazil and Switzerland advance, Brazil wins group
  • Brazil wins, Costa Rica wins: Brazil and Switzerland advance, Brazil wins group

Serbia wins over Brazil

  • Serbia wins, Switzerland wins: Serbia and Switzerland advance, Switzerland wins group
  • Serbia wins, Switzerland draws: Serbia and Switzerland advance, Serbia wins group 
  • Serbia wins, Costa Rica wins: Serbia advances and wins group, Brazil and Switzerland go into tiebreakers

Brazil and Serbia draw

  • Brazil and Serbia draw, Switzerland wins: Brazil and Switzerland advance, Switzerland wins group
  • Brazil and Serbia draw, Switzerland draws: Brazil and Switzerland advance, tiebreakers determine group
  • Brazil and Serbia draw, Costa Rica wins: Brazil advances and wins group, Serbia and Switzerland go into tiebreakers