Pat Riley sensed it during the summer. The Miami Heat president watched coach Erik Spoelstra work in his laboratory, working with players, stressing small concepts or drilling them in individual development. The shots. The moves. The rapid, almost free-form, style of accelerated play encouraged in scrimmages.

It was different from the Heat’s plodding, half-court offense in recent years dictated by Jimmy Butler’s talent. Yet this random-appearing style was anything but that, as Riley knew.

“You ever going to put in your offense?” he joked one day with Spoelstra.

“You’re looking at it, Pat,’’ Spoelstra said.

Riley knew that, of course, because sitting there over the summer he saw what’s played out through the first quarter of this Heat season. The running, the scoring, the speed — it all has similar concepts, as Riley sensed, to his 1980s Los Angeles Lakers. Showtime, those Lakers were called, because of the basketball drama they delivered.

“The concepts are similar, but I’d get the ball in Earvin (Magic Johnson’s) hands and we’d go,’’ Riley said. “This is different. This is attack. This is organized, very well thought out, balanced, running to spot, catch and go, kick it, relocate, move, get out of everyone’s ways and attack the basketball.

“The big difference with Showtime and (this Heat season) is when things bogged down for us, when the running game bogged down and all the beautiful dunks and running on the wings for layups — sometimes it bogged down and we had the equalizer.

“We could go to Kareem (Abdul-Jabbar).”

Riley was talking more than a week ago, but his words seem prescient now as the Heat offense has bogged down of late  after leading the league in scoring much of this young season with much the same cast that couldn’t score last year.

It was a feat of coaching, in a sport that undersells coaching, that the Heat started 14-8 with a go-go offense. Spoelstra has average-at-best parts. His system fast-paced system leads the league with 25.4 points a game in the opening six seconds of the shot clock.

Opponents have adjusted. That’s the lesson in all pro sports. Tuesday was the latest proof. The Heat jumped out to a 15-0 lead over Orlando in the first two minutes by hitting their opening six shots. Showtime East was on. But then they bogged down, to use Riley’s idea, and lost, 117-108.

What happened? Simple. They don’t have Johnson directing traffic at full speed. They don’t have Kareem to bail out a bad stretch.

“Every time we bogged down, I put a fist in the air,’’ Riley said. “That was the call to get the ball to Kareem. A tug at the ear was for James Worthy. If I wanted to run a catch-and-shoot, I’d rub my chin. Those were the only three signals we had.”

Talent, as everyone knows, wins in sports. Coaching can help or hide that talent, depending on the team. Spoelstra is masterful at that.

“Sometimes you have to slow down and change, because of your guys,’’ Riley said.

He wasn’t talking of the Heat of late. He was talking of himself in going from the Showtime Lakers to the grinding New York Knicks.

“We were 3 yards and a cloud of dust,’’ Riley said.

So, he’s seen it all, a game gone from speed to physical and back to speed. Oklahoma City, he notes, is the best at this kind of play, in good part because their a balanced team with this recent era’s equalizer in Shai Gilgeous-Alexander.

“And their defense is incredible,’’ he said. “They run like that and remain disciplined on defense.”

These Heat have lost four in a row. They’ve scored under their 121.7-point average in each, too, though playing defense-first teams like Orlando twice and Dallas exaggerated problems.

They don’t play again until Monday, so it’s back to the lab for Spoelstra. It’s what he does best. He helped Dwyane Wade evolve into a slasher, Chris Bosh into a 3-point shooter and LeBon James into the ultimate position-less player. Bam Adebayo’s offense is evolving with an outside game. Tyler Herro is less dependent on his mid-range game.

Spoelstra took the scoring-challenged team of last year and helped the Heat play so well that this rough patch is a story. Spoelstra talked after Tuesday’s loss how empty offensive possessions can translate into defensive problems, too.

It’s never steady over 82 games. But no one expected the Heat the start to look like this, except maybe a veteran basketball mind sitting at summer practices and seeing long-ago concepts come to life.