MIAMI (Reuters) - Marco Rubio had all that you need in a Republican presidential candidate: fluency on the issues, a conservative outlook, crossover appeal as a Cuban-American, and youthful good looks.

But in an election year when anyone associated with the Republican establishment is seen as tainted, Rubio ended his campaign after New York real estate mogul Donald Trump won the coveted primary, or nominating contest, in Rubio’s home state of Florida on Tuesday.

“This may not have been the year for a hopeful and optimistic message about our future,” Rubio told supporters as he announced his decision.

How the 44-year-old U.S. senator got to this point is a story of miscalculations and missed opportunities, according to interviews with more than a dozen campaign officials, financial donors and Republican strategists.

Rubio attempted to position himself as a new-age Republican, the son of Cuban immigrants who was able to connect with everyday voters with tales of his hard-luck upbringing. He also tried to appeal to America’s growing Hispanic population to help boost his party’s chances of claiming victory in the Nov. 8 election.

He got off to a difficult start.

His advisers wanted to run a campaign where it made more sense to be on Fox News, a channel popular with Republicans, or on other cable networks and local broadcasters whose clips can go viral on social media, rather than spend a lot of time in small towns in Iowa and New Hampshire. The early nominating contests there often shape the narrative and direction of presidential elections.

So Rubio made a strategic gamble. He would try a different approach in those two states, strategists familiar with his campaign said. He would try to save time and money by making strategic stops in those states rather than carpet-bomb them with multiple visits.

‘HE COULD HAVE DONE IT’

It would be a break from the usual playbook of White House hopefuls that says candidates should saturate Iowa and New Hampshire with town halls and other events and aim for early wins to garner media coverage and campaign donations and build momentum.

Rubio’s gamble backfired. Republican activists in Iowa complained he was largely absent from the state for long stretches, not spending the face-to-face time necessary to sell himself. He only made an all-out push in the late stages of the race.

Throughout the campaign, Rubio has battled perceptions that he does not work hard enough. For other candidates running for president, a voting record in the Senate would be a minor issue. But for Rubio, missing votes on the Senate floor dovetailed with the narrative that was building on the trail. If he was not in the Senate and was not on the trail, where was he?

Rubio spokesman Alex Conant said Rubio faced more than $50 million in attacks ads. “Obviously that had a massive impact. I think we could have won Iowa had it not been for the more than $25 million in attacks spent on us in Iowa alone.”

U.S. Senator and Republican presidential candidate Marco Rubio listens to the invocation from a backstage area before a campaign rally at Palm Beach Atlantic University in West Palm Beach, Florida, March 14, 2016. REUTERS/Carlo Allegri

Republican rival and U.S. Senator Ted Cruz of Texas tried to visit every Iowa county on a bus. Rubio tended to fly in and fly out. Polls showed he typically did better in metropolitan areas, not the hamlets than can often make or break candidates in early states.

Cruz won Iowa’s caucuses on Feb. 1 with Trump second. Rubio’s third-place finish was seen as something of a victory by his camp, but Republicans in the state were not so sure.

“He had a chance to win Iowa,” said Jamie Johnson, a Republican activist in Iowa. As Johnson traveled the state ahead of the caucuses, voters often asked him when Rubio would visit their area, he said.

“Iowans like being visited in their home county,” he explained. “If a presidential candidate wants to win in Iowa, then he must put in the shoe leather.”

Rubio’s team said he had tended to campaign in major population centers in Iowa in order to get the most impact from the news media.

“I was very pleased with the campaign that we ran here and I thought the national team did a very good job and I had no complaints,” said Iowa state Senator Jack Whitver, who was the head of Rubio’s Iowa campaign.

NO-SHOW AT DINNERS

Rubio heard similar complaints in New Hampshire. He spent just 28 days campaigning there, about half as much as former Florida Governor Jeb Bush and a fraction of the some 70 days that New Jersey Governor Chris Christie and Ohio Governor John Kasich were there.

Fergus Cullen, a former chairman of the state Republican Party, sought to hold meet-and-greet events at his home for each candidate. Candidates such as Bush and Kasich took him up on it. Rubio did not. Cullen eventually aligned himself with Kasich, who went on to finish second to Trump in the state.

“There were a lot of opinion leaders - key endorsers who end up on a candidate’s delegate list - who were interested in Rubio but never got to meet him or have those small-group, private meetings that result in commitments,” Cullen said.

Renee Plummer, a real-estate developer and an influential conservative activist in Portsmouth, New Hampshire, who hosted more than 10 Republican candidates for intimate dinners with local leaders, said she tried to schedule Rubio three separate times to no avail. She eventually threw her support behind Christie.

‘LACK OF STATURE’

Rubio faced another problem: a perception that he could only muster well-worn talking points.

At a July 6, 2015, dinner at a Chicago steakhouse with reporters, he appeared relaxed and knowledgeable. But as the campaign intensified, that Rubio appeared less and less frequently, replaced by a candidate who seemed able only to deliver canned lines and talking points.

Christie’s campaign noticed. Days before the Feb. 9 New Hampshire primary, Christie caught Rubio in repeat mode during a debate, calling him robotic and scripted. It affirmed some voters’ doubts that he lacked depth. Rubio never quite recovered.

“What happened to Marco in New Hampshire struck a responsive chord,” said John “Mac” Stipanovich, a prominent Florida lobbyist who first supported Bush and then switched to Rubio. “It crystallized that lack of stature.”

Trump’s unrelenting dominance of the media spotlight made it hard for rivals to shine. But Rubio’s decision, starting with a debate in Houston on Feb. 25, to try to match Trump insult for insult was cited by voters as another wrong move. Rubio has since said he regretted the negative turn.

A campaign source said it was Rubio who made the ultimate decision to switch gears and attack Trump personally, motivated in part by a desire to win more media coverage. It worked. At a rally in West Palm Beach, Florida, on Monday, he ruefully noted that when he was engaged in his war of insults with Trump, CNN and other networks carried his events live, something they had not done before.

That was, in a nutshell, the problem. Months of wall-to- wall news coverage of Trump decimated Rubio’s strategy of using free-media avenues.

“You can’t out-Trump Trump,” said Rubio supporter Jim Bundstein in Florida.

‘NOTHING BUT AMNESTY’

For some, the roots of Rubio’s problems can be traced back further to an icy afternoon in Washington on Jan. 28, 2013. That is when he held a news conference with three Democratic senators and a Republican on Capitol Hill to launch immigration reforms.

The legislation, sponsored by what became known as a bipartisan “Gang of Eight” senators, would have created a pathway to citizenship for illegal immigrants, but only if steps were taken to secure the U.S. southern border with Mexico and strengthen visa tracking.

Rubio had already faced conservative anger when flirting with immigration reform a year earlier, when he proposed a path to citizenship for young people who came to the country illegally but would join the military.

Conservative columnist Ann Coulter derided those ideas as “nothing but amnesty” for lawbreakers.

The “Gang of Eight” bill ran into similar resistance. As Rubio distanced himself from it, Hispanic groups faulted him for giving up.

In a Republican primary race where Trump has thrilled many conservatives by vowing to deport immigrants and build a wall on the Mexican border, Rubio’s involvement in the legislation and sudden abandonment of it haunted his 2016 campaign.

It was the centerpiece of attack ads by his rivals and the independent fundraising groups supporting them.

At a rally in Tampa, Florida, on Monday, Trump said of the senator: “He’s weak on immigration. He’s very weak on amnesty. I don’t know how he got elected.”