The streets of Bratislava have been spruced up at a cost of €14m (£12m). Potholes have been plugged, new benches and shiny rubbish bins brought in to adorn the green spaces, along with mobile toilets and free wireless connections. It’s all meant to convey the message that Slovakia is taking its current presidency of the council of the European Union extremely seriously.

For the next six months, the government of this small country of 5.5 million citizens will hold that rotating role. But all of its plans to set the agenda have suddenly become irrelevant. Brexit is the only agenda now. “No one saw it coming,” said Dariusz Kałan, central European analyst at the Polish Institute of International Affairs. “The reactions across the region have been of genuine shock and helplessness.”

The Slovakian prime minister, Robert Fico, is now faced with the herculean task of continuing with business as usual when nothing is as it was.

“This is a brutal start for our presidency,” his foreign minister, Miroslav Lajčák , admitted to journalists. “We are in the centre of the volcano and everyone is looking to us. Brexit is the number one order of the day – regardless of any other plans we had.”

The fallout across the region, said Kałan, will “likely be felt economically and politically for years to come”. Particularly palpable in central Europe, he said, was the fear that “Germany and [Jean-Claude] Juncker [the commission president] will use a Brexit to help speed up EU integration, deeply opposed by Slovakia, Poland, Hungary and the Czech Republic, as they’re afraid of simply being marginalised”.

But the coming half-year could also be a chance for these central European countries – members of the Visegrád group – to have their voices more clearly heard in the EU than ever before. “The genuine concerns of our citizens need to be better reflected,” the group’s four prime ministers said in a joint statement delivered last week, in which they appealed for the EU’s executive to be restrained. “Instead of endless theoretical debates on ‘more Europe’ or ‘less Europe’, we need to focus on ‘better Europe’,” they wrote.

With the exit of the UK, the V4 will have lost their leading EU partner. London was always seen as an invaluable ally in Warsaw, Prague, Bratislava and Budapest because it shared a “common perception of European problems”, as Poland’s foreign minister, Witold Waszczykowski, put it.

Britain was also admired for the decision to open its labour market to the new members immediately – unlike Germany and France, which instituted transitional arrangements. Thanks to that, an estimated 1.2 million people from the V4 live in the UK. But thanks to Brexit, partly prompted by concerns over migration, they, like the EU itself, now face an unsure future.

Of even greater concern to V4 leaders is the loss of a heavyweight that had until now helped rein in the integrationist instincts of Germany and France. Warsaw in particular had welcomed Britain’s insistence that the EU should concentrate on expanding rather than deepening the EU.

On other points, too, the UK was a valuable friend, supporting the V4 in their desire to keep their age-old enemy, Russia, in check by continuing with sanctions when other EU members wanted to relax them.

Already, there appears to be a stuggle to get central European voices heard in the post-Brexit debate. There was fury among V4 members when, the day after the Brexit result was revealed, only the foreign ministers from the EU’s six founding states were invited to Berlin by the German foreign minister, Frank-Walter Steinmeier, to pledge their support for an “ever closer union”. Steinmeier and Jean-Marc Ayrault, his French counterpart, ended the meeting with a petition for a political union constructed around the euro.

For countries such as Poland, the Czech Republic and Hungary that have not adopted the euro – and which say it makes sense to do so only once their citizens’ incomes are higher – the nightmare scenario is a two-speed Europe in which their interests would be a low priority. “If Britain had voted to stay in the EU and carved out its own niche with various opt-outs, that would have made an alternative model of EU membership more realistic,” Pawel Swidlicki, a policy analyst at thinktank Open Europe, said. “Now that Britain is leaving, the Visegrád Four have to answer some tough questions.”

The despair that has swept across central European countries as a result of Brexit is most keenly felt in Poland, as one of the EU’s largest countries and soon to be its largest outside the eurozone as well as, crucially, the country with the most citizens living in Britain.

Surveys suggest that Poles overwhelmingly support EU membership, although they remain divided over what it should mean. Jan Zaleski, 20, a Law and Justice party supporter in Praga, Warsaw, said that, to him, the EU’s scope should be limited to “the original idea’’ of free trade and free movement. “We didn’t sign up to being governed by Brussels. Nato is there to defend us and the EU is there for trade and to allow us to travel.

“We Poles have been dominated by both Russia and Germany. After all we have been through, we did not go into the EU to be under the thumb of Brussels,’’ said Zaleski, a veterinary student.

Juncker and the (Polish) European Council president Donald Tusk are seen by Law and Justice as the architects of a humiliating round of inspections that Warsaw has endured since Law and Justice came to power last October. These have concerned the government’s attempts at bringing Poland’s judiciary to heel, reining in the state media and increasing surveillance powers. For Law and Justice, Tusk is a political enemy. He was a prime minister under the previous Polish government.

Poland has kept its zloty and is an emerging market. Without Britain, it fears moves towards a “real EU’’ in which the locomotive is driven by the eurozone. Jacek Kucharczyk, of the Warsaw-based Institute of Public Affairs, said Britain’s departure means the loss to the Polish government of its most important ally in the European parliament. “Even before a departure, the waning of Britain’s influence means there will be no one to put in a good word for Law and Justice, should the European commission continue its investigation into Polish democracy.’’

Meanwhile, the editor-in-chief of Poland’s largest daily, Gazeta Wyborcza, summed up the fear in an editorial: “Brexit is good news for the opponents of European integration, the populists, followers of national egoism, isolationism and xenophobia,” he wrote.

“It is also good news for Vladimir Putin, who is doing everything to break up the EU and to get dominance over Europe. It is a warning for Poles, the vast majority of whom declare themselves to be pro-EU. The only way we can save what is most important – Poland and Europe – is to unite against the threats facing European and democratic values.”

It may be wishful thinking, but among the Visegrád Group there is still hope that the US secretary of state, John Kerry, might be right when he suggests the Brexit result could be “walked back”. Miroslav Lajčák previewed his country’s takeup of the EU presidency with the remark: “I would support any measure that will help reverse the position of the British people, which we have to respect but also regret.”

The V4’s calls in its truculent statement for more powers to be repatriated to member countries – a dig at those who want more federalism – have partly been triggered by countries’ anger over the obligatory quotas forced on them last year for receiving refugees. It is in Hungary, under the premiership of authoritarian Viktor Orbán, and where anti-immigrant sentiment has been most strongly felt, that the EU’s next nailbiting referendum is due to be held. Orbán’s national conservative government is expected to win the vote, scheduled for September, which will ask: “Do you agree that the European Union should have the power to order the forced settlement of non-Hungarians, without Hungary’s national parliament approving it?”

The referendum is being seen as standing also for a wider demand for EU powers to be to curbed, a call reiterated in an appeal last week by rightwing Polish politician Jarosław Kaczyński, the chairman of the Law and Justice party, for a new EU treaty to give back more power to member states. “We were happy to share the power,” Hungary’s justice minister, László Trócsányi, told the Frankfurter Allgemeine newspaper in a recent interview. “But just as one’s territorial boundaries are not up for debate, neither is the makeup of the population – it is definitely not something anyone else can decide on.” He said that, because of the decades Hungary was under Soviet rule, it could not be expected to be as willing and able to take in refugees as countries such as Germany and Sweden.

The strength of anti-EU sentiment in Hungary was illustrated by the decision of the speaker of parliament, László Kövér, to replace the EU flag, which had hung from the parliament building next to the Hungarian flag, with the flag of the Szekler, a Romania-based Hungarian minority. The nationalist gesture was popularly received.

In a sign of just how highly he regarded Britain as an EU partner, Orbán placed a whole-page advert in the Daily Mail ahead of the referendum stating his support for remain. At the same time he took the opportunity to heap praise, when speaking to his own people, on Britons’ decision to take back their sovereignty.

The V4 may have lost its closest ally and protector, but in many ways its members have never felt bolder than they do now to call for exactly what they want from the Brussels executive.

Despite the region’s Euroscepticism, its suffering during the cold war has done much to secure support for the EU among the V4. The dramatic changes the region has undergone mean they are more pragmatic regarding reform, claim V4 leaders, adding that the EU would do well to recognise that by giving them greater voting powers. But in the current mood of retrenchment in Brussels, that might be a hard argument to sell.

Fico, Slovakia’s Eurosceptic left-wing prime minister, may have considered his recent triple heart bypass to have been his biggest problem. Now, with all eyes on Slovakia’s presidency, it is more likely to be the challenge he faces to set a bruised EU on the path of reform. Nevertheless, as the prospect of Brexit sinks in, he is determined: “If somebody thinks that after Brexit we can offer to the European people what we give them now, they are wrong,” he said. This article was amended on 4 July 2016.

• Jarosław Kaczyński is not Poland’s justice minister as we said in this article, he is the chairman of the Law and Justice party. This has been corrected.

Additional reporting by Philip Oltermann and Alex Duval Smith