Every year, there is talk about how a Super Bowl hangover threatens the team that loses the NFL’s championship game. But few teams have felt the jinx as intensely as last year’s San Francisco 49ers.

In the months following their narrow loss to the Kansas City Chiefs, the 49ers suffered through an onslaught of injuries that began before training camp and continued throughout the season. They dealt with restrictions tied to the coronavirus pandemic that forced them to relocate to Arizona for the final weeks of the season. And after the conclusion of a frustrating 6-10 campaign, they had to deal with a salary cap crunch that put them at risk of losing several key players.

But one hallmark of the 49ers in recent years is strong communication between Coach Kyle Shanahan and General Manager John Lynch. That ability to talk through tough decisions was critical this offseason, as they were able to retain many of their most important contributors while also making a bold trade up the draft board to select a quarterback whom they hope is their long-term answer.

“Obviously, last year was a disappointment,” Lynch said. “We felt like we had a roster that could compete with any team in the league, but those plans got derailed by injuries and other things. I’m not making excuses, but it’s reality. You lose some of your best players like we did, and it was a tough year.”

For the season, the 49ers had 117 missed starts, most in the league. Center Weston Richburg missed the entire season with a shoulder injury and eventually retired. Defensive linemen Nick Bosa and Solomon Thomas blew out ACLs in the season’s first month; fellow pass rusher Dee Ford was limited by injury to a single game. Tight end George Kittle was out for half the season. Quarterback Jimmy Garoppolo missed 10 games, bringing his total to 23 missed starts in the past three seasons.

Garoppolo’s injury history spurred the most important decision that Shanahan and Lynch have had to make since they’ve been together. As much as they like Garoppolo, who is entering the fourth year of a five-year contract that pays him $27.5 million per year, they knew they needed to find a long-term quarterback. They began thinking through the decision from the start of the offseason.

“I think the first big decision we made was, we were going to go out and, through whatever means, try to find our quarterback long-term,” Lynch said. “That was a tough decision, because we’re big fans of Jimmy’s. We took everything into account and said, ‘This is something we want to do.’ … That was a difficult decision for us, because I think Jimmy’s record speaks for itself. We win when he’s been our quarterback. The challenge has been keeping him on the field.”

Garoppolo is 22-8 as the 49ers’ quarterback. He led the team to the cusp of a Super Bowl championship. Unlike the Green Bay Packers’ situation with Aaron Rodgers, Shanahan and Lynch made a point of communicating the team’s plans to Garoppolo.

“We very directly communicated with his agent,” Lynch said. “Those two things [finding a quarterback and keeping the current quarterback happy] don’t have to be mutually exclusive. We can work on finding our quarterback of the future.”

Ownership signed off, and Garoppolo accepted the concept. But simply deciding to make a run at a new quarterback wasn’t enough. The 49ers had to figure out a way to get one — which wasn’t going to be easy with the 12th pick in the draft. The 49ers knew several teams picking ahead of them could pick a QB and that other teams might similarly be looking to trade up. They decided to make a bold move.

In the Miami Dolphins, owners of the third pick, the 49ers found the right match. San Francisco was willing to give up first-round picks in 2022 and 2023, in addition to a 2022 third-rounder, and Miami, which didn’t want to move too far down the board, agreed with the Philadelphia Eagles on a swap that gave them this year’s sixth pick for the No. 12 choice and a 2022 first-rounder.

“We found a great trade partner with the Dolphins,” Lynch said. “… We were able to come up with something I think benefited both teams. We wanted that to happen early.”

What Shanahan and Lynch didn’t want was for their quarterback preference to get out. With much of the league assuming (correctly) that the Jacksonville Jaguars would select Trevor Lawrence with the No. 1 pick and the New York Jets would take Zach Wilson second, much of the speculation focused on Alabama’s Mac Jones and North Dakota State’s Trey Lance. The majority of the buzz centered on Jones, whose style resembled that of past Shanahan quarterbacks, but the 49ers’ brain trust continued to like what they saw in Lance.

“It started on the tape,” said Lynch, who added that Lance’s athleticism and mobility were part of what sold them. “… Kyle zeroed in on him and felt very strongly he had the DNA, rhythm and timing that it takes to be an effective quarterback in this league. He played only one true [college] season, but the concepts they had at North Dakota State were very similar to what we do.”

What few knew was that Shanahan communicated with Lance to have former NFL quarterback John Beck help coach him through the draft process. Beck is a good friend of Shanahan’s and kept the coach informed of his progress, speaking highly of Lance’s maturity and work ethic.

Garoppolo is the likely Week 1 starter, but Lance is the 49ers’ future. Before making the decision to draft him, Lynch and Shanahan had plenty of other work to do on the roster. They had a league-high 29 free agents. Their top four cornerbacks were unsigned. To keep left tackle Trent Williams, they would have to make him the highest-paid offensive lineman in the league.

“It was going to be hard with the reduction in the cap to keep our team together,” Lynch said.

The 49ers got things started by reaching deals to bring back cornerback Emmanuel Moseley and fullback Kyle Juszczyk. They caught a break when markets failed to develop for some of their defensive backs; they got Jason Verrett back on a one-year, $5.5 million deal and K’Waun Williams — one of the best slot defenders in the NFL — on a one-year deal at $2.4 million. Safety Jaquiski Tartt came back for the minimum. That helped reinforce a defense that was one of the NFL’s best two seasons ago and will benefit from the return of Bosa, its top player.

“Fortunately, a lot of the guys came back to us on one-year deals,” Lynch said.

Those short-term contracts paved the way for perhaps the biggest move outside of the QB decision: On March 23, they reached a six-year, $138 million contract with Trent Williams. The re-signing solidified left tackle and the rest of the offensive line (along with the addition of center Alex Mack to replace Richburg), and with the return from injury of Kittle, the 49ers should field a talented supporting cast around Garoppolo or Lance. Overall, they have a roster that looks capable of competing for the division title, even in the competitive NFC West.

Of course, the threat of injury hasn’t gone away. Running back Jeff Wilson Jr. tore his meniscus in the locker room after a recent workout and could miss half the season. Last week, the 49ers lost two contributors to season-ending injuries: offensive lineman Justin Skule (ACL) and safety Tarvarius Moore (Achilles’). Those injuries prompted Shanahan to stop OTAs after eight practices and cancel minicamp.

But overall, Lynch and the 49ers believe they have reason for optimism.

“It’s been a good offseason,” he said. “As I always say, a good offseason gives you a chance, so we’ve got a chance. We’ve got a strong roster. What we did is put a little more focus on guys who have been durable and have been able to stay on the field during their career.”