SAN JOSE — The Sharks are drunk on their own potential, and Tuesday night the Boston Bruins handed them the bar tab.

It came out to a 6-3 loss at SAP Center, and it should have been stamped with an overdue notice.

Play stupid games, win stupid prizes. The Sharks are still finding that out the hard way.

San Jose is breathtakingly talented, wonderfully fun to watch, and completely, utterly unserious at the moment.

They pelted 38 shots on Bruins goalie Jeremy Swayman and controlled long stretches of the night like a heavyweight working the body. Then they lost by three goals.

That’s not bad luck. That’s immaturity.

In the NHL, the margins do not just matter; they are where games are won and lost. And if you treat the little things like optional homework, grown-up teams will happily take your lunch money and shove you into a locker.

Boston blocked 18 shots, scored on dirty rebounds, and capitalized on every brain cramp San Jose offered on a silver platter.

The Sharks, meanwhile, played as if they were too talented to do the little things right.

It’s becoming a theme for this team. A somewhat expected one, but a troubling one nevertheless.

Consider the first period: a solid, grinding 1-1 game entered the final seconds.

Instead of controlling the puck, doing the safe thing, and getting into the dressing room, the Sharks fell asleep, backchecked in slow motion, and let Charlie McAvoy score with 17 seconds remaining.

Naturally, they doubled down the error at the end of the second. With just seconds left before the intermission horn, they lost their assignments entirely and conceded again. They were too concerned with what did not happen on the offensive end to notice what was about to happen in their defensive end.

Giving up a backbreaker in the final moments of a period is sloppy. Doing it twice in 40 minutes is a red flag. And it would be one thing if it were just a one-game issue, but this has been a trend for San Jose this season. Tuesday marked the fifth and sixth goals against in the final three minutes of a period this season.

Macklin Celebrini can come out for the third period with that look in his eye, snap a power-play one-timer from the circle that would make Steven Stamkos blush, and cut the deficit to 4-3.

Will Smith and Ivar Stenberg can whip the puck around like wizards. Igor Chernyshov can fly up the wing and look like a future perennial All-Star.

None of it matters when you cannot win a power-play draw or properly pick up a trailer on the backcheck.

San Jose won 51 percent of its even-strength faceoffs Tuesday — solid — but went 3-for-7 on the man advantage and an abysmal 1-for-5 shorthanded. (They weren’t burned by that last stat, but they found enough ways to get scorched otherwise.)

When you start every power play chasing the puck backward, your best-case scenario is already shot.

Then came the third period’s dagger: Michael Misa, a kid bursting with speed and flash, turned routine board play into a hideous turnover. Boston turned it into an odd-man rush, and Fraser Minten buried the put-away. No one picked up the slack.

Misa is going to be sensational. Right now, he is learning. Stenberg is, too. There are going to be growing pains with a young team. But who is covering for them?

Because it is not just the kids making immature plays. Jacob Trouba, Darnell Nurse, and Keifer Sherwood got in on the action Tuesday, too.

Yaroslav Askarov did not bail them out between the pipes, either. Tough gig, but someone has to do it.

This roster is teeming with dazzling, franchise-altering capability. You can see the blueprint of a future powerhouse while the game is in progress.

Yet right now, they are losing on the exact details that separate playoff contenders from draft-lottery regulars.

Head coach Ryan Warsofsky is not afraid to swap lines or bench players — it seemed as if both Smith and Luca Cagnoni had shifts skipped Tuesday — but there is simply not enough calm, collective professionalism on this team right now. This is what they have to work with, and, frankly, it should be enough. It has to be enough.

I suppose the bench boss still has some growing pains, too.

Yes, Warsofsky could swap Collin Graf with Sherwood to give the Misa-Stenberg line some grown-up defensive discipline. (Oh, the wisdom of a 24-year-old.)

But who else can provide it? Tyler Toffoli is not the guy — at least not on a nightly basis. Alexander Wennberg centers his own line. Mason Marchment and Sherwood are probably not cut out for the job. The rest of this team’s veteran depth would be dead weight on that wing.

The tank at the Tank is officially over, which means the excuses must be, too.

The Sharks do not lack game-breaking talent anymore. They lack discipline. They lack the understanding that consistency is a better metric of skill than the highlight play.

It’s early yet, but at some point, it must click that less is more.

When it does, look out.

And until it does, well, also look out.

If you did not know the score of Tuesday’s game, you would have thought the Sharks were one of the best teams in hockey.

But until this team executes the little things that win hockey games, the big scoreboard will keep telling a much different story.