Ted Cruz knew he was going to get crushed in New York. The Texas senator didn't hold a single campaign event (excluding TV appearances) over the last three days in the Empire State, instead campaigning in Pennsylvania, Maryland and Wyoming.

Donald Trump, a native New Yorker who campaigned vigorously and dominated in the state, picked up nearly all of New York's 95 Republican delegates, while Cruz, who finished third, was shut out.

The path for Cruz to 1,237 delegates before the July convention in Cleveland is now officially closed: 674 delegates remain in the states ahead, and Cruz is 678 short of the magic number, according to an Associated Press tally. Worse, his double-digit victory in Wisconsin on April 5 has failed to produce a perceptible polling bounce in key upcoming states.

At a campaign event in Philadelphia on Tuesday night, Cruz dismissed Trump's imminent victory in New York as "a politician winning his home state" in a 12-minute prepared speech that struck a new tone for the candidate, emphasizing optimism over anger. He compared himself to "outsiders" John F. Kennedy and Ronald Reagan, and called on Americans to elect him and "chart a new American journey forward - one led by you." A Cruz campaign official said afterward that he "will continue" to offer inspiring rhetoric to energize voters and "expand his support."

Lowman Henry, Cruz's Pennsylvania state chair, told reporters at the National Constitution Center that the road ahead will be kinder.

"I think once we get by (April) 26th, and we start heading west again, you're going to particularly there see Sen. Cruz start to rack up delegates," he said. "I think we're going to be competitive all the way to California," which votes on June 7, the final day of the primary season.

Cruz's task now is to starve Trump of a majority of delegates and challenge him after the first ballot. Critical to that is grinding out small victories at state conventions and delegate battles, using the maze of arcane primary rules to his advantage. On this front, the Cruz campaign has proven vastly superior to Trump's.

"He's doing everything right. He's winning first-ballot delegates in places like Wyoming and Colorado. He's inserting his people into Trump's slots in places like Georgia in successive ballots," said Ryan Williams, a former spokesman for Mitt Romney's 2012 campaign. "He needs to keep winning at party conventions and doing as well as he can in the remaining primaries to narrow Trump's path to 1,237 until it's impossible."

"If he can get to a contested convention, I don't think Trump's prospects are great," Williams said.,

Pennsylvania delegates

The next contest on April 26 features Pennsylvania and four other Northeastern states - Connecticut, Delaware, Maryland, and Rhode Island. In Pennsylvania, where Trump leads comfortably in recent polls, the winner takes 17 delegates. But Pennsylvanians also elect 54 "unbound" delegates who can vote for whomever they want in Cleveland. And the Cruz campaign is working hard to elect Cruz-friendly delegates.

"Stay tuned. I don't want to tell you exactly what we're doing, because Donald Trump will tune in," Henry said. "We are going to be employing a number of campaign tactics on behalf of our delegates. ... We are going to be using all the typical campaign tools that you would use to run an election to elect someone."

Henry said it's "very possible" that the Keystone State's 54 unbound delegates determine whether Trump clinches the 1,237 delegates on the first ballot. "We're going to have one of the largest uncommitted delegations."

Trump's expected delegate haul in New York means he'll need about 59 percent of remaining pledged delegates to secure the prize - no sure thing, but he's poised to expand his lead next Tuesday. A Quinnipiac University poll of likely Connecticut voters released Wednesday found Trump leading Kasich, his nearest competitor there, by 20 points.

After that comes the Indiana primary on May 3, which may be pivotal to stopping Trump, according to an analysis by the New York Times' Upshot blog. The state's large share of white working-class voters makes it a natural fit for Trump, but its many evangelicals and conservatives provide an opening for Cruz. Perhaps sensing the importance of the state, Trump has scheduled a rally in Indianapolis on Wednesday.

If Trump loses in Indiana, "I don't see how he gets to 1,237 in any scenario," said Patrick Ruffini, an adviser to the #NeverTrump PAC working to defeat the billionaire. Indiana awards delegates on a winner-take-all basis by congressional district and statewide.

Ruffini argued that Trump's path to clinching victory before the convention requires "sweeping next Tuesday, winning Indiana decisively, and then winning 70 percent of the delegates available in California. Not undoable by any means, but he needs to run the table to get to 1,237" delegates.

Rick Tyler, former communications director for the Cruz campaign, said the senator's best prospects to pick up delegates are in Indiana, South Dakota, Montana, Oregon, Washington and California. The Golden State is a crucial contest, where winner-take-all-by-congressional-district rules make it 53 micro-primaries, plus a statewide victory bonus, totaling 172 delegates.

Crucial California

Cruz's hopes in California hinge on winning the state's wealthy, conservative and rural districts, Tyler posited. But he warned not to underestimate Trump: "California has an entertainment industry, and Trump certainly knows that industry well. There's a media there that knows and follows Trump."

Tyler said Cruz must keep Trump "at least 100 delegates away from the majority" to make a strong case against him at the convention. If so, "I think Cruz wins fairly handily on the second ballot," Tyler said, citing the campaign's superior organization and groundwork when it comes to delegate selection. It is an area where Trump has struggled, contributing to a recent shake-up among his top aides.

Trump, for his part, slammed those who want to deny him the nomination even if he leads in votes and delegates. "The people aren't going to stand for it," he said at Trump Tower in Manhattan.

But the anti-Trump forces within the party aren't sold.

"If (Trump) can't get to the majority then, he basically has six weeks to prove to the country that he is in fact the greatest negotiator and deal-maker in history," Heye said.