FOR months Chinese officials have stuck to the same script: China does not want a trade war, but will win if dragged into one. As hostilities turn more serious, this confident façade has taken a blow. Chinese equities have plunged into bear-market territory. The yuan had its biggest monthly fall against the dollar on record. Economic indicators have weakened. Even bombastic state-run media have turned introspective, counselling against arrogance.

All this, and the tit-for-tat trade battle is only just getting under way. On July 6th, after The Economist went to press, America was due to impose its first major set of tariffs on China: 25% duties on $34bn-worth of imports, notably machinery and electronic parts. China was set to retaliate with tariffs on goods worth the same amount, hitting products from soyabeans to sport-utility vehicles. Both countries have listed more tariffs to follow, on goods worth another $16bn. Both have also warned that they are willing to inflict much more pain if the conflict escalates.

Donald Trump’s bet is that since China has a massive bilateral trade surplus, it stands to lose more than America as barriers go up against imports. Were their stockmarkets gauges of the two countries’ trade-war prospects, he would seem to have a point. The S&P 500, America’s leading index of big shares, has fallen by 5% since late January; the CSI 300, China’s analogue, is down by more than 20% over the same period. Exchange-rate movements reinforce the impression. The yuan has depreciated by 5% against the dollar over the past three months, a sharp fall for a closely managed currency (see chart).

China is nervous about the perception of vulnerability. A drumbeat of reports in state-run media have talked up the stockmarket. On July 3rd the central bank tried to bolster the yuan, saying that the economy’s fundamentals were strong. But the toll from the trade war is starting to show up in some data. Surveys of China’s manufacturing sector have pointed to falling export orders. Mr Trump could take all this as evidence that he was right when he tweeted that trade wars would be easy for America to win. In that, though, he would be mistaken. The turbulence in China reflects domestic challenges more than trade tensions. The hit to growth from the $34bn-worth of tariffs is likely to be minuscule, adding up to just about 0.1% of Chinese GDP. Depictions of China as a trade-reliant economy are hopelessly outdated: net exports account for just 2% of national income. Instead, the bigger cause of China’s market turmoil is homegrown. After a rapid build-up of debt over the past decade, officials have been working to defuse financial risks. This has depressed demand for both equities and corporate bonds. Slower credit growth has weighed on liquidity. Capital spending has slowed sharply. Adding to the gloom was a report published by the National Institute for Finance and Development, a government-backed think-tank, on June 25th, warning that China was “very likely to see a financial panic”. The institute’s head later clarified that he believed the government could manage the risks. But jittery investors latched onto his warning, not his reassurance. Yet seen from a different angle, China’s market troubles demonstrate one of the reasons why its officials think they can outlast America in a trade war. An authoritarian regime can limit and dictate the public discussion. After the stockmarket tumbled, authorities warned journalists against citing the trade conflict as an explanation, according to a directive published by the China Digital Times, a website that tracks government censorship. Reporters were also ordered to emphasise the economy’s bright spots. In America, meanwhile, the hurly-burly of its public discourse has been on display. On July 2nd the US Chamber of Commerce, the country’s biggest business group, launched a lobbying campaign to explain how tariffs would hurt the economy. Republican lawmakers in Congress are criticising the president’s trade policies more openly than heretofore—though on past form, if Mr Trump pushes ahead, they will probably fall into line.

Another source of confidence for China is the knowledge that it is not fighting America alone. From steel tariffs on Japan to threats of auto tariffs on Europe and negotiations that might wreck the North American Free-Trade Agreement, Mr Trump is taking on every one of America’s allies. China has tried to rally them to its side. It has asked the European Union to join it in condemning Mr Trump’s trade actions, according to Reuters (the EU declined because of its own trade grievances against China). Even as it raised tariffs on soyabeans from America, it removed them from soyabeans from India, South Korea and others in Asia. Xi Jinping, China’s president, has hinted that its markets will become more open to non-American firms.

Still, China’s preference would be to avoid a trade war altogether. That is why its officials had tried in May to hammer out an agreement to buy more American oil and farm goods, which they thought might satisfy Mr Trump. Many in China still cling to the hope that he can be reasoned with. Hawks in the White House had, after all, pushed for harsh restrictions on Chinese investors in late June, but Mr Trump went for a softer option, refusing to single out China. Lu Zhengwei of Industrial Bank, a Chinese lender, says the staggered way in which Mr Trump is imposing tariffs suggests that he wants to leave room for talks. “It feels like a chess match,” he says. With its financial markets in bad shape, China’s opening move looks wobbly. But the game is nowhere close to checkmate.