The Brazilian flag is projected on the floor during the closing ceremony in the Maracana stadium at the 2016 Summer Olympics in Rio de Janeiro, Brazil, Sunday, Aug. 21, 2016. (AP Photo/Chris Carlson) Chris CarlsonAP

The Brazilian flag is projected on the floor during the closing ceremony in the Maracana stadium at the 2016 Summer Olympics in Rio de Janeiro, Brazil, Sunday, Aug. 21, 2016. (AP Photo/Chris Carlson) Chris CarlsonAP

Despite challenges and blemishes, Rio Olympics still won

A ceaseless city of 6 million people, swollen with hundreds of thousands of visitors, was hypnotized into a pause Saturday afternoon.

Seizing the beaches, favelas and bars, and even those within other venues, was the moment that mattered most to the host nation.

When the Brazilian men’s soccer team defeated Germany to win the gold medal, it exorcised a haunting Olympic and recent World Cup history.

Delivered with that was an infusion of inclusive pride to a land that has been polarized on the benefits of producing the Olympics but where “The Beautiful Game” is an obsession.

So that moving and galvanizing outcome speaks to the one thing you can say with certainty about the legacy of the Rio Olympics:

For all the worries in the runup, for all the logistical and safety matters amid them and the future implications of cost overruns on an economy in crisis, the continued inspiring and even healing powers of the world’s best athletes converging to compete will be the takeaway.

At least from afar.

In a metropolis where some 60,000 people were displaced in the making of the games, Rafaela Silva from the City of God slums won a gold medal in judo.

A Refugee Olympic Team debuted here, and every one of their tales could make you weep — both over the horrors of what they’ve been through and their capacity to persevere.

After the U.S. women’s water polo team won gold, its 13 members lined up by the side of the pool and one by one placed their medals over the neck of coach Adam Krikorian, whose brother had died just before the opening ceremony of the games.

You could find any number of similarly, or more, poignant stories from Rio.

But the point is that their tales live in a different way because of the context of the Olympics — unmanageable as it seems to have become, especially for a struggling nation.

And what makes this still the greatest spectacle on Earth also is as much the awe factor as the awww factor: the “Citius, Altius, Fortius” Olympic motto, Latin for “Faster, Higher, Stronger.”

Jamaican sprinter Usain Bolt and U.S. swimmer Michael Phelps long ago mesmerized with their dominance, only to come to Rio and somehow ascend to yet another tier.

As if it weren’t enough to have amassed 18 gold medals and 22 overall as of the 2012 London Games, Phelps snarfed up five more golds and a silver to give him 23 gold and 28 total.

Related stories from The Kansas City Star

At 31, he became the oldest male swimmer to win an individual gold medal. Whether or not he actually stays retired now, that bookended an Olympic career that began more than half his lifetime ago after qualifying for the 2000 Sydney Games as a 15-year-old.

“I love legends; I love reading up on the greats (from) their time periods,” wrestler Jordan Burroughs said as he spoke of the thrill of living in the era of Phelps. “ … You just want to know what it was like to be part of it.”

He could have said the same about the charismatic Bolt.

Bolt reinforced his place in Olympic lore by becoming the first man ever to win gold in the 100- and 200-meter dashes and 400-meter relay in three straight games.

His transcendence was all the more clear because of the whopping margins of victory that often enable him to be playful even as he runs, part of what makes him as endearing as he will be enduring.

With her unique combination of explosiveness and elegance, U.S. gymnast Simone Biles won four gold medals (including in the all-around and team events) and a bronze.

She did it with such style that she widely was being called the greatest gymnast ever — and such an array of skills and fearlessness make for a fine platform in any discussion on the matter.

Add in U.S. swimmer Katie Ledecky, who apparently never swims without breaking a world record and nabbed four golds and a silver, and maybe you have the makings of a virtual Mount Rushmore of faces to chisel out of Mount Olympus.

The games hardly were unblemished, of course, starting with the doping scandal that led to more than 100 Russian athletes being banned.

And at times it felt like the most appropriate symbol of what was happening here was not the Olympic rings but an empty office marked “Logistics” at the Main Press Center.

Simply put, a city among the most beautiful in the world but that struggles with traffic to begin with was overmatched by the invasion.

It was often complicated just to get around and initially hard for many to even get into venues because of organizational glitches, and it became a sad reality that many events (particularly track) were so poorly attended.

Then there were the more apparent dramas concerning the polluted water in Guanabara Bay and, as it happened, mishandled chemicals in the pool at the Maria Lenk Aquatics Centre.

Along with terrorism, rising crime (11,000 street robberies in June) had been a central focus in the months before the games.

So much so that organizers announced military and police forces would number some 85,000 — about twice the number deployed in London four years earlier.

It was easy to wonder how that would all play out when spectators departing the opening ceremony came across a man shot dead, and there were a number of crimes against people within the Olympic movement.

But as much attention as they got, the antics of Lochte and his three cohorts and the bizarre Hope Solo calling Sweden’s soccer players “cowards” were offset by a Team USA that not only romped in the medal count, finishing with 121, but made other important statements here.

And then there was basketball player Carmelo Anthony, who after Team USA’s semifinal win over Argentina was happy to speak instead about his visit to a favela.

“Wherever I go, I try to give back to the nitty-gritty of those communities: touch their soil, talk to their people, just be there,” he said. “ … They painted a mural for me. … I felt like I was kind of one of theirs.”

So maybe the Olympics shouldn’t have been here, and, for that matter, maybe it’s time they just go to a few rotating sites.