Mexico plays the final match of its disastrous 2014 World Cup qualifying campaign Tuesday night in Costa Rica.

Costa Rica has already qualified, so Mexico is the big favorite to win and advance to a World Cup playoff against New Zealand.

But there's an unlikely (though possible) nightmare scenario — where Costa Rica wins, Panama blows out the U.S., and Mexico fails to qualify for the World Cup for the first time in 23 years.

This scenario would be devastating for the once-promising team and its rabid fans. It would also be a huge hit to the Mexican soccer industry.

The total cost of Mexico missing the World Cup would be $600 million in lost TV, merchandise, sponsorship and other revenue, according to DreaMatch sports marketing expert Rogelia Roa.

TV broadcasters would take a hit on ad revenue, and not just in Mexico.

Televisa and TV Azteca paid a reported $100 million to broadcast the tournament in Mexico. These two companies don't just air the country's most popular sport, they own professional teams (like Club America) and even the famed Azteca Stadium. So a financial shortfall for these massive companies could have very real ripple effects for the rest of Mexican soccer.

Interestingly, a Mexico World Cup disaster would hurt the U.S. too.

Univision paid $325 million to broadcast the '10 and '14 tournaments in Spanish in the United States. While ESPN has been breaking World Cup qualifying ratings records with its broadcasts of U.S. men's national team games, its audience still lags behind its Spanish-language counterparts.

For the last U.S.-Mexico qualifier in September, ESPN set a record with 2.2 million average viewers. But an average of 3.5 million watched the game in Spanish on Unimas.

On June 11, the Mexico-Costa Rica game averaged 2.8 million viewers on Unimas alone. The U.S.-Panama game (played on that same night) averaged 2.6 million viewers across both Unimas and ESPN.

The 2010 World Cup game between Mexico and Argentina was the most-watched Spanish-language broadcast in U.S. history with 9.2 million average viewers.

Mexico is one of international soccer's largest markets. Brandon Wade/Getty Images It's not just TV money either. Shirt sales for Adidas, travel companies, and other sponsorships will also be affected.

Adidas says that Mexico was the company's best-selling international jersey at the last World Cup, with 1 million shirts sold. They just released a brand new jersey for 2014 — one that won't exactly be flying off the racks if it becomes the official uniform of Mexico's failure as a soccer nation.

Mexico's soccer enthusiasm isn't just a financial windfall for the national team, it affects club merchandise sales as well. In 2010 Javier "Chicharito" Hernandez had a fantastic World Cup, scoring goals against France and Argentina. The very next year he had the fourth-best selling jersey in the English Premier League, out-selling guys like Didier Drogba and Robin van Persie in his debut season at Manchester United.

The World Cup is often a launching pad for the individual brands of players. Failing to qualify will mean the next potential Chicharito won't have the platform to be an overnight international superstar.

Adidas shouldn't be the only sponsor worried about the nightmare scenario. Coca-Cola, Wells Fargo, Allstate, Visa, and Anheuser-Busch all have sponsorship deals with the Mexican team based on the assumption that they'd be participating in soccer's biggest, most visible event.

And then you have the travel companies in both Mexico and Brazil. According to FIFA, Mexico was one of the top-10 countries in terms of number of ticket requests for next summer's World Cup. Mexican soccer historian Leon Krauze wrote in Bloomberg that 15,000 Mexicans went to South Africa in 2010 at a cost of $10,000 a person.

Since next year's tournament is being held in the Americas, that number stands to rise. But if Mexico fails to qualify, it could hurt companies like Aeromexico (the country's largest airline), which somewhat presumptuously uses the 2014 World Cup as a selling point on its Sao Paulo page.

The soccer federations of all 32 countries that qualify also get a rumored $13 million from FIFA.

Mexico needed a miracle overhead bicycle-kick to beat Panama in its last game. On Tuesday in Costa Rica the stakes will be much higher, for the team and the economy.

Here's the three-step nightmare scenario for how Mexico would be eliminated:

Mexico loses to Costa Rica Panama beats U.S. The combined margin of victory for Costa Rica and Panama is greater than two, OR the combined margin of victory for Costa Rica and Panama is two AND Mexico doesn't score two more goals than Panama does

If Mexico wins and finishes fourth in the group, they will play New Zealand in a one-game playoff to decide who goes to Brazil.