IN THE fight between Squid and Barbie, Barbie won. Squid is the nickname of Ivo Josipovic, Croatia’s incumbent centre-left president, who lost a run-off election on January 11th; Barbie is the nickname of Kolinda Grabar-Kitarovic, the right-wing candidate and a former foreign minister and senior NATO official. Ms Grabar-Kitarovic won, but she inherits a country that is sharply divided.

Her victory was by a whisker, confounding pollsters who had all predicted a win for Mr Josipovic. Croats voting in Hercegovina and in the diaspora helped her. But the poll was also a test of how voters feel ahead of a general election later this year. The answer: they are fed up.

In the first round in December, Ivan Vilibor Sincic, a 24-year old populist who rails against banks, the European Union, NATO and Croatia’s elite, took 16% of the vote. His support base is akin to those for the far-left Syriza in Greece and the Five-Star movement in Italy. Mr Sincic called on his backers to spoil their ballots in the second round—and over 60,000 did (almost twice Ms Grabar-Kitrovic’s winning margin).

Mr Josipovic lost largely because the Social Democratic-led government had failed to drag Croatia out of recession. The economy has been shrinking or stagnant since 2009; even joining the EU in mid-2013 has not lifted it. Unemployment was 9% in 2008 but is now 19%, with youth unemployment running at over 45%. Ever more people with education and skills are leaving. Ms Grabar-Kitarovic promises to tackle the economy, although as president she will have little power.

She promises to be the president of all Croats. Yet a churlish prime minister, Zoran Milanovic, has declared that his centre-left government is all that stands between the people and the return of “that criminal group”, meaning the right-wing opposition Croatian Democratic Union (HDZ) that backed Ms Grabar-Kitarovic. His angry rhetoric mirrors that of Tomislav Karamarko, HDZ’s leader, who rails against the “Yugonostalgics” of the left.

Mr Karamarko may become Croatia’s next prime minister, but he does not seem to want an election before December. Some say this is because HDZ has little idea how to cure the sick economy. According to Will Bartlett, of the London School of Economics, there is little room for manoeuvre. A big devaluation is out of the question, he says, because many company and household loans are in foreign currency. The European Commission holds veto power, as Croatia is under its excessive-deficit procedure. The education system cries out for reform as it churns out graduates for an economy that cannot generate jobs. Little attempt has been made to slim a bloated and sclerotic public administration.

It is assumed that Mr Milanovic’s government will lose in December. But Dejan Jovic, a political scientist who once worked for Mr Josipovic, says that, if the Social Democrats play up their modest successes, and if a period of cohabitation with Ms Grabar-Kitarovic runs smoothly, Croats may decide they don’t want a big change. Enough voters may be put off by the 1990s-style nationalism of Mr Karamarko to produce a hung parliament and a broad-based coalition. Given its dire economy, it is amazing that Croatia holds together as well as it does.