Democrats are in a grumpy mood, and with good reason. A big special-election victory in upstate New York quickly sagged into a disastrous media frenzy over Democratic Congressman–Internet lothario Anthony Weiner’s spectacular success in becoming the Twittersphere’s most obvious twit. To make matters worse, a brand-new Washington Post/ABC News poll shows President Obama actually losing to Mitt Romney among registered voters, in a tight 49%-to-46% contest.

The race is close because next year both Obama and the Republican nominee are likely to be skating on wafer-thin ice. For while the weak economy is one huge force driving these numbers, there is a second force in play that could be equally unsettling. The 2012 election is shaping up as a battle between economics and demographics. The economy is threatening to end the President’s political career. The demographics of a changing America might just re-elect him.

(See why it’s tough to take on Obama in 2012.)

Start with the economy. The Washington Post poll is full of bad news for the White House. The fabled “wrong track” number — a sort of overall-dissatisfaction index measuring the percentage of voters who think the country is moving in the wrong direction — has risen to 66%, a dangerous level for incumbent Presidents. Ironically, it was the same kind of wrong-track tilt — near 80% — in 2008 that propelled the Obama campaign to the White House. The wrong-track change wave is building again, this time against Obama. The President’s numbers on how he’s handling the economy are his biggest problem. In the Post poll, 59% gave him a poor grade. When 6 out of 10 voters flunk you on the economy, it’s political kryptonite.

What will the Obama campaign do to address this dire threat? First, try like mad to change perceptions of him as a hapless economic manager by offering unhappy voters a sweet sundae of fresh action: Yes, we hear you loud and clear, the President is working hard, he has a brilliant new plan and new economic advisers, stand by for good news, etc. Atop this sugary dish will be a bitter red cherry of class warfare, with Democrats’ claiming that unlike the rich, uncaring, corporate-shill Republicans, Obama actually cares about the economic pain of the middle class. The Obama campaign will then cue up negative ads to try to shove the spotlight away from the boss’s economic failures and toward a referendum on the Republican nominee.

(See why chronic joblessness is on the rise.)

In a bad economy, I doubt this conjuring will be enough to beat a credible Republican of the Romney, Tim Pawlenty or Jon Huntsman variety. The real ace up Obama’s sleeve in 2012? Changing demographics. As I wrote in this space two years ago, Republicans need to learn that we no longer hold our presidential elections in Ronald Reagan’s America. Here are the numbers: in 1980, white voters cast 88% of the total presidential vote; by 2008, the percentage had shrunk to 74%. Which is why, though George W. Bush in 2000 and John McCain in 2008 both won 55% of the white vote, McCain lost by 7 points and Bush essentially tied Al Gore. Worse for the GOP, the proportion of overall votes cast by white voters will decline even more in 2012.

Latinos are rapidly redrawing the demographic playing field. In 2008, Obama won the Latino vote by 36 points. His massive fundraising machine is preparing to spend millions registering even more Latinos to vote. This will have a powerful impact in the vital Western swing states of Nevada, Colorado, New Mexico and Arizona, all of which have rapidly growing Latino populations. Obama carried three of these states in 2008, losing only McCain’s Arizona. The crucial question next year is, Will a poor economy trim Obama’s huge margin with these Latino voters? If not, the West may be bleak for Republicans. The GOP could offset these Western-state losses by winning the economically pressed states of Ohio, Michigan, Wisconsin and Pennsylvania. In 2010 each switched from a Democratic to a Republican governor. That said, the Republican presidential nominee has not carried Michigan or Pennsylvania since 1988 or Wisconsin since ’84. Finally, Florida remains the critical linchpin. Its Latino population has increased 57% since 2000. Polls there show a tight race.

(See “A Flight Plan for the American Economy.”)

So who wins next year? In the long term, bet on demographics. The GOP must shed its nativism and attract more Latinos, or the Electoral College math becomes prohibitive. In the short term, if financial conditions don’t improve soon, bet on economics. High unemployment next year will be a firing offense for Obama.

But only one thing is certain: in this street fight, each side has a glass jaw.

Murphy is a GOP political consultant and writer. He Twitters at murphymike