Turkish newspapers were not a pretty sight in the days after the New Year’s Eve attack on an Istanbul nightclub that left 39 dead. We didn’t even know the identity of the gunman who rampaged through Reina, a glitzy venue on the European bank of the Bosphorus, but the blame game had already begun. “The prime suspect is America,” one conservative, pro-government paper declared. An ultra-critical opposition title blamed the ruling Justice and Development Party (AKP) for tolerating “fundamentalist propaganda”. This response was no surprise to anyone in Turkey. Last year was a disaster, a long string of bombings, escalation of an internal conflict with Kurdish militants and a coup attempt.

In a country where rival political and social camps seem to expend much energy on loathing one another, each calamity provoked another bout of bitter argument. As 2016 drew to a close, many were already long worried that Turkey – a member of Nato, a key Western security partner and technically still a candidate for EU accession – was falling apart. The Reina attack, claimed by Isis in a crowing statement, aimed to give the country another kick even before 2017 had got going.

Foreign observers often blame Turkey’s woes on Recep Tayyip Erdogan, the rabble-rousing president who has dominated the political landscape for the past decade and a half. He has not helped with his fiery anti-Western rants, or his provocative outbursts about women and religion. A huge crackdown after the failed coup in July has focused not just on those with clear links to the plot but also critical journalists, activists, Kurdish opposition politicians and civil rights groups. Yet despite his reputation as a strongman, Erdogan at times seems more like the daredevil driver of a speeding go-kart whose brakes have failed.

Perhaps the single most important factor in the new state of permanent crisis here is the Syrian conflict, which has raged for close to six years on the southern border. It has been deeply destabilising. Ankara’s opposition to Bashar al-Assad, and its support for those who took up arms against him, have left the country increasingly isolated. Kurdish militants in Turkey were emboldened by the successes of their Syrian counterparts. The war sent vast numbers of refugees across the border and spawned Isis. For a time, Turkey was criticised by Western security agencies for failing to take the threat of the jihadis sufficiently seriously. But it has since tightened its borders, cracking Isis cells on Turkish soil and launching military operations against the group in Syria. The country has slowly shifted in the eyes of Isis – from being just one target in a long list of enemy states to its latest primary focus. In mid-2015, the bombings began.

The attacks appear calculated to exploit Turkey’s weak spots. Suicide bombers have targeted Kurdish political gatherings and struck at the heart of the tourism sector. With the attack on Reina, where women in short skirts hit the dance floor clutching glasses of champagne, Isis has amplified tensions between Turkey’s socially conservative Muslims and its secular liberals. The mass shooting also exposes the cracks and contradictions in the stance of Erdogan’s AKP, which rallies supporters with Islam-infused rhetoric but has not shut down or banned venues such as Reina.

By targeting a nightclub, Isis is “taunting” the government, says the Ankara-based analyst Selim Koru. “Isis has the luxury of calling them out and saying: ‘You’re compromising. We’re not,’” he says. “There are these existential questions about what Turkey is. Isis attacks just that spot.”

In public, the country’s leaders prefer to sidestep the Isis problem. On 22 December, when the group released a gruesome video that claimed to show two captured Turkish soldiers being burned to death, the government imposed reporting restrictions and throttled access to YouTube and Twitter. A reporter for the Wall Street Journal was detained for two and a half days after sharing a tweet about the clip. The crackdown on freedom of speech is one of many knee-jerk measures that have made European leaders increasingly critical of Turkey (though not sufficiently angry to cancel a €3bn deal with Erdogan to stop refugees from turning up on the EU’s shores).

Meanwhile, Washington is coming under daily attack from Ankara for backing Kurdish forces in Syria and harbouring the exiled cleric accused of masterminding last summer’s failed coup. Into this melee has stepped Vladimir Putin. The Russian leader has worked increasingly closely with Erdogan since accepting an apology for Turkey’s ill-fated decision to shoot down a Russian jet near the Syrian border in late 2015. The assassination of Moscow’s ambassador to Turkey at an Ankara art gallery last month did not stop the two countries from thrashing out a deal for a Syrian ceasefire later adopted by the United Nations.

Behind the scenes, Turkish officials insist that they are not about to sever long-standing ties with the West. But stoking conspiracy theories about CIA meddling in Turkey’s domestic affairs is one of the few hobbies that appeal to a broad spectrum of citizens. It is easier to blame the plunging value of the lira or the deteriorating security climate on foreign plots than it is to ask probing questions. Erdogan needs to deflect such inquiries as much as possible as he gears up for a referendum, expected to be held this spring, on deep changes to the constitution that would result in him becoming a kind of “super-president”.

Erdogan argues that this overhaul will bring much-needed stability to Turkey, yet the referendum campaign seems likely to exacerbate tensions in an increasingly unhappy country.

A few days after the attack at the Reina nightclub, I received a despondent message from a Turkish friend. “I’m tired of being sorry,” he wrote. “I’m tired of feeling upset.” With the evening news bulletins filled once more with images of weeping mothers and fathers slumped over coffins, the bad feeling is almost universal among Turkish citizens. Just don’t ask them to agree on how to make it stop.