Stacey and Ardy Gibbs ran into the same problem that face many Twin Cities homeowners these days: selling their house was a snap but buying another was difficult.

What’s worse, the couple live in Richfield, the hottest real estate market in the metro.

They looked at nearly 30 houses, offered on two and lost out to other buyers. They finally scored their new house, a 1950s rambler 2 miles from their old one, by acting quickly and outbidding four other buyers. “We were starting to feel a little desperate,” Stacey Gibbs said. “We toured the house, thought about it for five minutes and decided to write an offer.”

The houses in Richfield aren’t the biggest, fanciest or most expensive in the Twin Cities metro. But the city is walkable, close-in and has lots of homes that are affordable to first-time buyers, traits that put it at the top of a new index designed by the Star Tribune to measure real estate performance beyond raw sales figures.

The index combines price increases, market times, seller discounts and the presence of foreclosures and short sales using sales data from the Minneapolis Area Association of Realtors. To create the index, the Star Tribune ranked each community on each of the four sale metrics, then added those rankings together to come up with a single score. The higher the score, the hotter the market.

And the hottest markets are those with plenty of inexpensive houses that are close to urban amenities and easy access to shopping and transportation, including under-the-radar suburbs like Crystal, Brooklyn Park and up-and-coming neighborhoods such as Bottineau and Holland in northeast Minneapolis.

The results highlighted a growing challenge for Twin Cities home buyers: Communities that are most affordable are also those where demand is most fierce, causing price increases that are quickly putting those communities beyond reach of first-time buyers and working-class families.

The situation has left sellers in the most expensive markets wondering what happened to the recovery. North Oaks, for example, is one of the wealthiest cities in the metro and a coveted place to live, but houses there took four times as long to sell than in Richfield. The buyer pool is significantly smaller, and sellers are offering significant markdowns.

By just about every measure, the metro-area housing market has rebounded from the housing crash of 2008. The foreclosure crisis is long over, and it’s now rare to find a homeowner with a mortgage that’s “underwater,” meaning it exceeds the value of the house. In many areas, including Richfield and several first-ring suburbs and inner-city neighborhoods, sellers are routinely getting multiple bids and more than their list price.

“This used to be a market where the houses sold for $60,000 to $120,000, and now it’s just crazy,” said Nancy Walker, an agent with Coldwell Banker Burnet who grew up in Richfield and is now a prolific seller there.

She said that buyers are drawn to the area in part because the houses there tend to be less expensive than those in the adjacent neighborhoods of southwest Minneapolis. “It’s accessible to everything that Minneapolis has to offer, and the reputation of the school district is strong,” she said. “You can get a really nice house at an affordable price and more bang for your buck than in Minneapolis.”

But when looking at the average price per square foot, which isn’t as heavily influenced by the size or price of the homes that are selling during the month, most cities and neighborhoods across the metro have yet to break pre-2008 records.

In top-ranked Richfield, houses sold for an average $133 per square foot last year, compared with a pre-recession peak of $146. Compared with a combined average of per-square-foot prices from 2012 to 2015, prices last year had increased 19 percent, suggesting a strong postrecession rebound.

Even in the most coveted communities, including Orono and Wayzata, the sale price per square foot has yet to rebound. In North Oaks, the average price per square foot last year was just shy of $155, almost $32 below the pre-recession peak. Compared with the previous four-year average, prices were essentially flat.

The same patterns are playing out in several Minneapolis and St. Paul neighborhoods, which the Star Tribune ranked separately because those markets are typically much smaller than their suburban counterparts. In Minneapolis, the hottest neighborhoods are in northeast Minneapolis where homes have long been considered values compared with more expensive neighborhoods near the Chain of Lakes in the Uptown area.

In the Bottineau neighborhood, which is tucked alongside the banks of the Mississippi River in northeast Minneapolis, first-time buyers who have been priced out of other parts of the city are snapping up the area’s humble, wood-framed houses as quickly as they come on the market. The average price per square foot last year in that area was a whopping 32 percent higher than the previous four-year average. Houses there sold in lightning speed, on average in just 29 days, in part because there were very few listings.

The situation was similar in the nearby Holland neighborhood, where price gains were even stronger and sellers got 100 percent of their asking price, suggesting that multiple offers are the norm. In both cases, and in other city neighborhoods that scored well, buyers value a quick commute to downtown Minneapolis.

Though a high index score might indicate that a market is particularly hot, it doesn’t necessarily mean that it’s a healthy market.

“It all depends on whether you’re a buyer or seller,” said Terry Ahlstrom, an agent with Edina Realty who has lived most of his life in Richfield. He said that a few years ago buyers could choose from 85 to 105 active listings. “Today, if you have 10 people who want a house, only one gets it, there are a lot of Realtors and clients that are disappointed.”

Across the metro, there’s a deepening shortage of houses for sale. At the end of February, there were only about 8,800 properties on the market in the 13-county metro, far too few to create a balanced market.

And homebuilding isn’t keeping pace, in part because most of the new houses are affordable only to move-up buyers. That’s expected to change as builders cater to a demographic shift. The first wave of baby boomers are aging into retirement, and are ready to sell the big house in the suburbs. At the same time, millennials are beginning to move out of rentals and homeownership.

For many, like the Gibbs family in Richfield, being in an established community that’s close to urban amenities is more important than having a big house with a big yard. The house they ended up buying is only slightly bigger than their previous one, but it’s in the location they love, so they’re finishing the basement and adding two bedrooms and a bathroom.

“Richfield has that small-town feel in the middle of the city,” said Stacey Gibbs. “But there aren’t a lot of houses for sale, so when this came on the market we were eager.”