SAN FRANCISCO — In an otherwise quiet moment before the Kings took the court for their most important playoff game in nearly two decades, Harrison Barnes gathered his teammates around him and urged them to focus on the task at hand so they could take the series back to Sacramento.

At the ripe age of 30, Barnes is considered a voice of wisdom on a team brimming with youth. The Kings are so bouncy and bubbly they seem almost carbonated. Perhaps their postseason inexperience is serving them well in their first-round series with the Warriors.

After all, the basketball gods were not favoring the Kings ahead of Game 6 on Friday night.

They were on the brink of elimination after having lost three straight, a grim stretch that included a loss in Sacramento on Wednesday. De’Aaron Fox, the team’s All-Star point guard, was coping with a broken finger on his shooting hand. And, of course, the Kings were facing the Warriors, a championship-tested team that appeared to have found its rhythm.

So, what did the Kings do? They assembled one of their most complete games of the season in a 118-99 victory that tied the series at three games apiece and ensured a Game 7 in Sacramento on Sunday afternoon, signaling to everyone — as if anyone needed proof at this late stage — that their resurgence is no fluke.

There was never any question that the Kings were talented and brash.

But they are resilient, too.

“It’s no pressure for us because didn’t nobody think we would be here,” said Kings guard Malik Monk, 25, who scored a team-high 28 points off the bench.

The winner of the game on Sunday will face the Lakers in the Western Conference semifinals starting Tuesday.

The Lakers advanced by defeating the Grizzlies on Friday 125-85 in Game 6 of their first-round series.

The Warriors remain a mystery. Even as defending champions, they have not exactly carried themselves with an air of inevitability, as they did in the 2014-15 season, when they coasted into the playoffs with a 67-15 record, or in the 2017-18 season, which they punctuated with their third title in four years.

This latest iteration of the Warriors — even with their familiar core — is an abstract painting. There is little continuity. Momentum is a foreign concept.

Some nights, they produce basketball as high art.

Other nights, they look uninspired or — gasp! — a little old.

Curry, 35, who scored 29 points in the loss, cited “mental errors” as the culprit.

“I don’t know if that was an energy thing or a focus thing,” he said, “but you have to be able to learn those lessons quick.

Because we put ourselves in a situation where we have to be the team that’s playing with desperation.”

Injured Embiid ‘doubtful’ for Game 1: 76ers coach Doc Rivers says MVP finalist Joel Embiid is doubtful for Game 1 of the playoff series against the Celtics with a sprained right knee.

Embiid was examined by doctors this week and has yet to practice ahead of Monday’s Eastern Conference semifinals opener at Boston.