SO CLOSE to the stage that Donald Trump could almost have touched it, a notice on the school wall in Mechanicsburg, Pennsylvania, carried this message: “Welcome to Cumberland Valley where sportsmanship is an expectation. So please …let the spectators be positive.” No chance of that. Even before the Republican nominee appeared, late on August 1st, on a pit-stop between Ohio and New York, the 3,000-odd people packing the gymnasium were spewing hate.

“What should we do with Hillary Clinton?” hollered a local politician, as if this crowd, of young people wearing “Trump that bitch” T-shirts and older ones who apparently did not mind the slogan, needed warming up. “Kill her!” someone shouted. “Lock her up!” the chant began.

This is Mr Trump’s achievement. The billionaire demagogue has not merely responded to the grievances of working-class whites—such as the folk in Mechanicsburg, mourning their lost steel mills and the pay rises and other benefits that once accrued to being hardworking and white in America. He has also sought to stoke their anger. Vengeance against “rapist” Mexicans, Muslim fifth-columnists, job-killing outsourcers and his “criminal” Democratic opponent, Mr Trump tells his supporters, is the solution to their gripes. Anyone who says otherwise, he added in his bleak convention speech last month, is conning them. “No longer can we rely on those elites in media and politics, who will say anything to keep a rigged system in place.”

And yet, appearing onstage in Mechanicsburg, to the accompaniment of mock-heroic synthesiser chords, as if he were a game-show host, Mr Trump looked tired and unenthused. He did not thump the air and trumpet polling data as he likes to; how could he? After a disastrous fortnight for the Republican nominee, in which the chaos and thuggery he has brought to American politics appear to have united much of non-Trumpian America in disgust, the polls look bad for him.

In Pennsylvania, which he probably must win to gain the White House, he is trailing Mrs Clinton by an average of five points, as he is nationally. “I guess the polls have it sort of even,” is how he put this. He also claimed the polls understate his appeal: “It’s a little embarrassing, people don’t want to say they want to vote for me, but then they get into the booth and they say, ‘Is anyone looking? Boom, I’m taking Trump’!” But there is little evidence for these shy Trumpkins—or that Mr Trump believed his shtick. The speech that followed was even more rambling than usual, and peppered with personal gripes; the boasts were fewer, and his haranguing of the media (“some of the most dishonest people”) went on for longer.

At times, Mr Trump sounded deranged. Some of the negotiators he says he will commission to improve America’s trade terms “are horrible, horrible human beings”, he said. “Some of them don’t sleep at night, some of them turn and toss and sweat, they’re turning and tossing and sweating and it’s disgusting, and these are the people we want to negotiate for us, right?” Whose experience, actually, was he describing? With three months to the election, it is early days, and the contest looks close; yet Mr Trump’s campaign is a mess. In Mechanicsburg it was tempting to think he really had seen the writing on the wall.

His troubles are in part the flipside of his vote-getting strategy. As an exercise in riling angry whites, his convention speech was masterful; Mr Trump’s lead over Mrs Clinton with high-school-educated whites swelled to almost 40 points in one poll. He could win this group more crushingly than any presidential candidate since Ronald Reagan in 1984. The problem is that, back then, no-college whites represented 62% of the electorate; now they represent around 34%. And Mr Trump’s raving depiction of America as a “divided crime scene” does not ring true to most other Americans.

By expanding his angry fan base, Mr Trump enjoyed a small post-convention boost, as newly-crowned nominees usually do. This gave him a small lead over Mrs Clinton in some polls. Yet, among the weeds, his ratings among non-whites and college-educated whites plunged. A poll by Gallup suggests that, for the first time ever recorded, the Republican convention repelled more voters than it attracted. Mr Trump now trails Mrs Clinton with college-educated whites, a group that has voted Republican since polling began, by a five-point margin. If Mr Trump cannot close that gap, he will probably lose.

You might think this would have given a pragmatic tycoon, pursuing success with the focused greed of a truffle-hog, a moment’s pause. Yet the incontinence Mr Trump has displayed since the convention has been astounding. In particular, consider the fight he has picked with a pair of Pakistani-Americans, Khizr and Ghazala Khan, whose 27-year-old son, Humayun, was killed fighting for America in Iraq.

Speaking at the Democratic convention in Philadelphia on July 28th, with his wife standing demurely beside him, Mr Khan noted that, had the ban Mr Trump swears to impose on foreign Muslims been in place at the time, his son might never have moved to America as a child. “Donald Trump, you’re asking Americans to trust you with their future. Let me ask you: Have you even read the United States constitution?” said Mr Khan. “Have you ever been to Arlington cemetery? Go look at the graves of brave patriots who died defending the United States. You will see all faiths, genders and ethnicities. You have sacrificed nothing and no one.”

A “sane, competent” person (a standard Michael Bloomberg, in another memorable moment in Philadelphia, suggested his fellow-New Yorker does not meet) might have responded by praising the Khans and changing the subject. Mr Trump bit back, suggesting Mrs Khan had not delivered the speech because of her religion (“Maybe she wasn’t allowed to have anything to say”). He also protested that, as a hardworking builder, he too had “sacrificed”. Unfortunately for Mr Trump, Mrs Khan, in subsequent television interviews and a piece in the Washington Post, turned out to be almost as articulate as her husband; she had chosen not to speak, she said, because, as she had stood beneath a giant portrait of her dead child, her pain was too great.

The row dominated America’s airwaves for almost a week, setting Mr Trump against veterans’ groups, the families of other dead servicemen and a parade of wretched-looking Republican leaders. The efforts of Mr Trump’s campaign team to quash it were hapless. Its spokeswoman claimed Mr Khan had died because of stringent rules of engagement introduced under Mr Obama; he was killed, in 2004, serving George Bush.

Meanwhile, out of puerile spite, Mr Trump launched an assault on his disapproving party leadership, by refusing to endorse Senator John McCain, his predecessor in 2008, and Paul Ryan, the Speaker of the House of Representatives, in their forthcoming primary fights. He also implied, in an interview, that he would take revenge on his main rivals in the primaries, Ted Cruz and John Kasich, by backing their opponents. No wonder, despite an improvement in Mr Trump’s fund-raising performance (in July he and his party raised $82m), there were reports of confusion in his campaign team. Its chief, Paul Manafort, was also linked to allegations that Mr Trump has an unhealthily high regard for Vladimir Putin; Mr Manafort previously worked for the pro-Putin former government of Ukraine. (In Mechanicsburg Mr Trump repeated his suggestion that Russia should keep annexed Crimea: “You want to have World War III to get it back?”)