As mascots from around the league gyrated, popped-and-locked, and shook their tail feathers in front of a packed house at the 2016 NHL All-Star Game in Nashville, members of the Philadelphia Flyers front office realized they were missing out.

After two years of planning, that at times descended into pure comedy, a 7-foot-tall bright orange, googly-eyed star was born.

By the time Gritty burst onto the scene a week ago, the Flyers knew the tidal wave of haters was coming. In true Philly spirit, they leaned into the negativity, and created a local legend by the end of his first day on the job.

"The goal was to engage with kids and create another vehicle to entertain and be more involved in the community at times when we don't have access to players when they're traveling or whatever it might be," Flyers chief operating officer Shawn Tilger said. "But the part that we're most excited about is that his identity has matched (the idea that) we can pick on our brother but no one else can."

Children were at the center of Gritty's creation and had a big hand in his design. But in making something that was edited through a child's mind, the finished product downright terrified some adults.

The Flyers had an expert guiding them throughout the process, however. They brought in Dave Raymond, the first person inside the Phillie Phanatic who also owns a mascot company, to help them come up with an A to Z creation and rollout plan. The Delaware native and lifelong Philadelphia sports fan had a warning and stressed that for this to work, it required the entire organization riding out whatever came their way.

"The first five minutes of the first meeting, I said, 'You know you guys are going to get killed, right?'" Raymond said. "And we hadn't even started one conversation yet and they said, 'Yup, we know it, but we're committed.'"

The Flyers hired graphic designer Brian Allen of Flyland Designs because of his ability to create cartoons with an edge, in the same vein as the Garbage Pail Kids of the 1980s. He created about 25 concepts of animals, people and monsters, some of which were too cute, some too creepy, before settling on something close to Gritty's current look.

Gritty's features were fine tuned with the help of focus groups of kids who looked at versions of him and gave their opinions of what they liked and didn't like. Gritty could have been skinny, or had a nose, been bald, or had eyebrows, but the kids responded best to his big body, wild eyes and long hair. It took eight weeks for mascot costume provider Character Translations to build Gritty.

One of the most important things was coming up with Gritty's origin story, because, as Raymond said, a mascot's success is largely dependent on storytelling. Discovering him during Wells Fargo Center renovations was a good place to start.

Raymond advised that Gritty had to be more than just a performer in a costume. He needed to have a complete persona. Expecting backlash from adults, the Flyers social media team played into Gritty as "nightmare fuel" and gave him a feisty personality on his Twitter account as the reactions from social media spun out of control.

"I was nervous when they rolled it out because I knew people were going to scream and holler," Raymond said. "But they did a fabulous job of just embracing the negativity and throwing it back at 'em. And by the end of the day people were going 'He's ugly, he's scary, but you know, I kind of like him!'"

The biggest turn came when Gritty made his on-ice debut at a Flyers preseason game. He'd already been a hit with 600 kids at his unveiling at the Please Touch Museum during the day with his slick dance moves, squeaky hands and belly button.

He had one shot to win over a notoriously tough home crowd at night.

And then he fell. But then he got back up. He fell some more and got back up again. He was Gritty, not just in name.

Video: Flyers new mascot 'Gritty' takes a spill in debut

"We have the best fans in the world, but we knew Gritty was going to have to earn the love and respect of the fan base," Tilger said. "When he came out and he fell and he embraced it by doing snow angels and then got up and fired one of our ice crew in the back (with a T-shirt gun), we saw the shift coming to people liking him."

The enormity of the response shocked Allen, but he started to feel better about his product once opinions started to change.

"Of course when you design something, you want the whole world to love it and that didn't happen, exactly," said Allen. "At first I was pretty overwhelmed and I was worried that the backlash was too negative and we would have to deal with that. But not even 24 hours had passed and it seemed like things were moving in a more positive direction."

Gritty closed his first day as a viral sensation with one last blast of internet greatness. He tweeted a picture of himself as the famous Kim Kardashian "break the internet" photo.

Tweet from @GrittyNHL: Goodnight, internet. pic.twitter.com/gx2Pbxfcds

"Graphic design, all the social media you saw, that's how beautifully young and creative the Flyers organization has become," Raymond said. "They're young, they're aggressive, they've got tremendous experience and it was a joy to collaborate with them."

By the end of the next day, Gritty had been featured on "Good Morning America," and mentioned on "The Today Show," "CBS Morning News," "Jimmy Kimmel Live," "The Late Show with Stephen Colbert," "The Late Late Show with James Corden" and "The Daily Show." Later in the week, he scuffled with comedian Ricky Gervais on "The Tonight Show Starring Jimmy Fallon," was joked about on "Saturday Night Live" and "Last Week Tonight with John Oliver," and danced on the dugout with the Phillie Phanatic at a Philadelphia Phillies game.

Tweet from @GrittyNHL: 🎶 Hey now, hey now,This is what dreams are made of 🎶 pic.twitter.com/4oFxTyzaNF

"This has truly been something that is organic," Tilger said. "It's not like you plan and all these pieces come together in terms of national exposure. The fact that he became polarizing, to a degree, gave this its momentum."

Meanwhile on social media, he beefed and bonded with other mascots, became best pals with Flyers forward Wayne Simmonds and developed a sweet infatuation with Philadelphia captain Claude Giroux.

Instagram from @grittynhl: Here are some pictures of me and my best friends Wayne and Claude. My brother Jake was busy.

The Flyers have been inundated with hundreds of requests for appearances everywhere from media to weddings, so now the focus becomes managing Gritty's popularity while sticking with the original intent of creating entertainment and growing the fan base, which is a pretty great problem to have.

"Mascots are supposed to be fun and everybody's having fun with this," Tilger said. "So that's the perfect outcome."

Instagram from @grittynhl: To my friends, the day ones & the day twos:As I sit here I realize that you all woke up on Monday morning not knowing me. And now I'm here - I've been featured on late night TV and made so many new friends.But Philly, I am here for you. You're my city and the @philadelphiaflyers my team. -Gritty