Hugo Chávez's death has plunged Venezuela into uncertainty over the future of his socialist revolution.

For 14 years he dominated like a Colossus and now that he has fallen, so have the old rules and certitudes. An election, which under the constitution must be held within 30 days of a president's passing, will pit Chávez's ruling party against an opposition coalition. Internal power struggles within each side could prove just as important.

The world's biggest oil reserves, a troubled economy and a deeply polarised population of 29 million people are the ambiguous prizes for whoever claims the presidential palace of Miraflores.

First, however, will come Chávez's funeral, likely to be a vast, clamorous affair to rival Evita's. To the millions who revered him – a third of the country, according to some polls – a messiah has fallen, and their grief will be visceral. To the millions who detested him as a thug and charlatan, it will be occasion to bid, vocally or discreetly, good riddance.

As president, Chávez would liven his near daily marathon broadcasts by singing, rapping, dancing and reciting poetry, an unparalleled showman, and the government will doubtless choreograph a fitting farewell with the help of the civilian militias and state media empire he created. Leaders from across Latin America, Asia, Africa and Europe are expected to fly into Caracas along with celebrities such as the actors Sean Penn and Danny Glover and the director Oliver Stone.

Foreign governments, not least the US administration, will watch closely to see if the late president's movement, "Chavismo", succeeds in holding power and perpetuating his "21st-century socialist revolution", a model entailing state control of the economy, subsidies to Cuba and rhetorical broadsides against Yankee imperialism.

Foreign oil companies, including Chevron and state-owned Russian and Chinese behemoths, will manoeuvre to protect investments. China, in particular, will be anxious for the new president to honour the huge loans it has made to Venezuela, which Chávez used to supplement record oil revenues and government spending.

The election, should it be held by the deadline mandated by the constitution, will probably pit the vice-president, Nicolás Maduro, Chávez's anointed heir, against Henrique Capriles, an opposition regional governor who lost to Chávez in last October's election.

Opinion polls suggest Maduro, a former bus driver lacking the charisma of his old boss, will struggle against Capriles, a youthful challenger who casts himself as a centrist and has the support of traditional elites. Maduro, however, stands to benefit from an emotional funeral, a tight timetable and the "red machine", a formidable electoral alliance of the ruling PSUV party, state institutions and oil revenues.

Internal power struggles will roil both sides. Maduro has the support of key ministers, civilian ideologues and the Cubans who occupy multiple positions in Venezuela's government.

However, an ambitious rival, Diosdado Cabello, the head of the national assembly, has allies in the military, the militias and big business, an eclectic coalition considered more pragmatic – and corrupt – than other Chavista factions. There has been speculation he will seek to install himself as provisional president and delay an election.

A wild card is Chávez's family. His two adult daughters and his older brother, Adán, a governor of their home state of Barinas, have the power to help unite or fracture Chavismo.

The opposition coalition known as MUD may crack now that it can no longer be held together by loathing of Chávez. A tradition of backstabbing and grandstanding may resurface if figures such as Henri Falcón, governor of Lara state, challenge Capriles for the nomination.

Should the opposition win the election, observers in Caracas warn of a fraught transition. "The generals, the militias, the civil service, they're all politicised, would they accept a new dispensation? And what about all the Chavista governors and mayors?" asked one diplomat in Caracas.

No matter who wins, analysts agree he or she will swiftly face dilemmas. Chávez used lavish spending to heat the economy and buy imports in the runup to his re-election. But subsidies, regulations and threats have warped the public sector and withered the private sector.

Economists say the new president, Chavista or not, will have to cut spending and devalue the currency, stoking inflation and potential unrest. Some opposition analysts wonder if it would be better that Maduro wins so Chavismo reaps the whirlwind.