PHILADELPHIA — The doors to the Philadelphia Flyers locker room opened and Lionel Ritchie's "All Night Long" was cranked at full volume. Raise the roof and have some fun? Sure, the Flyers could afford to cut loose for a change and enjoy a rare string of success in an otherwise waste of a season.

Heck, even Gritty shook his beastly belly and danced with NASCAR champion Martin Truex Jr.

Sean Couturier had his first regular-season hat trick and rookie Carter Hart stopped 39 shots in another bright outing to lead the Flyers past the Boston Bruins 4-3 on Wednesday night.

"It's not something I was thinking about," Couturier said. "The pucks find their way in. It's nice to have them."

Couturier scored twice within 90 seconds in the second period and sealed the win with his 19th goal late in the third. "Coots" gave the Flyers hat tricks in consecutive games for the first time in 16 years after James van Riemsdyk kicked it off in Monday's win. Couturier's only two previous hat tricks had come in the post-season.

The Flyers could open their own Lids franchise with the hundreds of hats collected this week.

The Flyers entered in 30th place in the NHL and got a rare comeback victory in front of another sparse crowd at the Wells Fargo Center. The fans that showed up caught a slice of franchise history: Claude Giroux got his 500th career assist and joined Hall of Famer Bobby Clarke (852) as the only Flyers to hit that milestone.

"I've been lucky to play with really good players and (am) lucky to be able to give the puck to all these players," Girous said. "It's a great accomplishment, but we just have to keep going here."

Hart, the 20-year-old rookie goalie, had another solid game as he tries to meet the hype that surrounded his call-up last month. Hart may not get the Flyers to the playoffs, but he at least helped them win consecutive games for the first time since Dec. 18-20.

"We still have to find a way to have some fun," Hart said. "When I got called up here, we were in a bit of a slide and things weren't going too well. But they welcomed me with open arms."

Peter Cehlarik scored in his first game of the season and David Pastrnak scored in the first period to stake Boston to a 2-0 lead. Pastrnak scored on the power play just 4:29 into the game. Cehlarik made it 2-0 on a slapper where no Flyer was anywhere near him.

The Flyers didn't even take their first shot until nearly 12 minutes into the game, and it seemed like it was shaping up to be another sorry game for the fallen franchise.

They salvaged a goal in the first period when Giroux snagged a loose puck at the blue line and fed to Oskar Lindblom for his fifth goal of the season. Lindblom scored for the first time in 31 games.

Couturier took over from there and sparked the Flyers to one of their more memorable wins of the season. He tied it on a tip-in past Jaroslav Halak and got the feed from Wayne Simmonds — after Carter turned away the puck off an odd-man rush — for the 3-2 lead.

"They were more opportunistic or the goaltending was better at their end. Sum it up either way," Bruins coach Bruce Cassidy said.

Hart made the lead stand in a ferocious third where the Bruins got a second goal from Cehlarik to make it 4-2 with 1:06 left.

"He's a mature kid. He prepares himself pretty well and does a lot of little things away from the rink that helps the team on the ice," Couturier said. "He's pretty calm back there. It's what you want from your goalie."

Halak had 15 saves.

"I had to make that one big save in the third and I wasn't able to," Halak said.

Couturier has 18 goals and is one of the few untouchables — along with Giroux and Hart — the Flyers have as they trudge toward the Feb. 25 trade deadline. Flyers general manager Chuck Fletcher, hired in November, will surely look to shake up the team and perhaps undergo a true rebuild.

NOTES: Flyers F Jori Lehtera got a 5-minute major for boarding and a game misconduct for driving Ryan Donato face-first into the boards late in the second period. ... Truex, a Flyers fans and New Jersey native, attended the game and was presented a No. 19 jersey (his car number) from Gritty.

UP NEXT:

Bruins host St. Louis on Thursday.

Flyers play Saturday at Montreal.

___

More AP NHL: https://apnews.com/NHL and https://twitter.com/AP_Sports