RIO DE JANEIRO — For years, Brazilians had a phrase they would inevitably utter when things went wrong. “Imagina na Copa,” they said after an endless traffic jam or a construction accident or an ugly rash of violence dominated the news — imagine if this happened during the World Cup. It became a foreboding warning, a pre-emptive sigh at the presumed disasters that lay ahead.

Over five weeks, though, Brazil avoided any of the major catastrophes it feared. Thrilling games and entertaining soccer — as well as the national team’s own stunning collapse — generally overshadowed any logistical issues, and the tournament was seen as a global success. So it was fitting, then, that in the tournament’s final game, the Brazilians managed to dodge the ultimate on-field nightmare, too.