People cheer as the legal teams, defending same-sex marriages leave the US Supreme Court on April 28, 2015 in Washington, DC. (MLADEN ANTONOV/AFP/Getty Images)National Journal

The Supreme Court is widely expected to legalize same-sex marriage nationwide by the end of the month. But if the Court defies those predictions—and, hey, it wouldn't be the first time—its ruling would open up a new front in one of the most polarizing culture wars of the past 20 years.

A high court ruling against same-sex marriage would plunge millions of gay couples into a chaotic patchwork of conflicting, uncertain state laws, leaving their marriage rights in limbo—and igniting a new political firestorm too big for 2016 contenders to ignore.

Legal experts agree that the fallout from a ruling against same-sex marriage would amount to legal chaos. The right to marry would disappear in several states where it exists, deepening the divide between states and, in some cases, even creating uneven playing fields within the same state.

But it's impossible to know where, exactly, same-sex marriage would remain legal, where it would disappear temporarily, and where it would disappear forever.

"You'd have to guess based on the politics of the state," said Steve Sanders, a professor of constitutional law at Indiana University's Maurer School of Law.

Right now, same-sex marriage is legal in 36 states and Washington, D.C. But that number could shrink significantly if the Supreme Court rules that the Constitution doesn't guarantee a right to same-sex marriage.

In 16 states and D.C., marriage is legal because of a state-court ruling, legislative action, or a ballot initiative. Marriage equality is safe in those states no matter what the Supreme Court rules.

In the other states, however, same-sex marriage is legal because a federal court ruled that state laws banning it are unconstitutional. If the Supreme Court disagrees with that conclusion, at least some of those states would stop issuing marriage licenses to same-sex couples, joining the 14 that still don't permit gay couples to marry.

"There will be some states [where] it will be complicated and get challenging. "¦ Certainly there will be a period of time where people will see protections denied to them," said Evan Wolfson, president of Freedom to Marry.

Adding to the legal discrepancies, marriages already performed in those states still would be legal—meaning one same-sex couple couldn't get a marriage license, while the same-sex couple next door would remain legally married.

Without a mandate from federal courts, the issue would be left up to the voters and elected officials in each state.

Most of the states where federal courts legalized same-sex marriage are red states with Republican governors, and many of them fought hard in court to defend their bans on gay marriage. And if the high court says those bans do not violate the Constitution, state officials would be free to enforce them again.

Officials in a handful of states—including California, Pennsylvania, and Virginia—did not make much of an effort to fight same-sex marriage in the courts. Sanders said those officials could probably just decide that their states will continue to allow same-sex marriages.

"They're perfectly free to just continue under the current regime of issuing same-sex marriage licenses," he said.

By ruling that the Constitution doesn't guarantee a right to marry, the Supreme Court would be rejecting the legal logic that lower courts applied when they said states could not enforce their bans on same-sex marriage. But its decision wouldn't automatically erase those lower-court rulings.

Generally, someone involved in a lawsuit has to ask a lower court to vacate its earlier decision, a request the courts would probably have to grant in this case—if anyone asks. But in states where the governor and attorney general support same-sex marriage, no one has much of an incentive to ask the courts to reverse their orders.

And it would be hard to find another party with the legal standing to force the issue back into court, Sanders said.

Aside from those few states, though, the fight over marriage equality would likely shift from the courts back to the democratic process—legislation and ballot initiatives. Given the dramatic shift in public opinion on marriage equality, plus the political energy that a Supreme Court loss would generate, a legislative push would likely succeed in several states.

But advocacy groups such as Freedom to Marry never planned to win legislative battles in all 50 states; they've sought to build legislative momentum that would help bolster their legal challenges, and the Supreme Court has always been seen as the inevitable last step. That strategy wouldn't change if they lose this time, Wolfson said—it'll just take a lot longer.

"We will continue working the same strategy that has brought us so much progress already "¦ (build) public support, tap into the energy and disappointment the Court will have triggered, work to win more states, and set the stage for another return to the Court—hopefully before a more receptive group of justices," he said.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.