This story appears in ESPN The Magazine's Analytics Issue. Subscribe today!

The gatekeeper of America's most popular nightclub is a 33-year-old man known to NBA players simply as "Purple." And tonight he's busy. A former high school dropout who rose to become the go-to guy for nightlife in Miami, on this night Purple gets a text, makes some arrangements, and now he's meeting his "friends" through a secret side door of the famous LIV nightclub, the portal to an underground network beneath the famed Fontainebleau hotel in Miami Beach.

"Ever seen the movie 'Goodfellas,' when he takes his girl underground?" Purple asks. "They love the whole walking underground thing."

Purple's friend is an NBA star, and that star emerges from the shadowy labyrinth to a packed, 18,000-square-foot nightclub and a dance floor full of beautiful people. Confetti falls from the ceiling. Air horns blare. The industry's top DJ shouts on the mic announcing the player's presence while he and his friends are ushered by security to the club's top table. Bottles of Hennessy cognac, Don Julio 1942 tequila and Armand de Brignac champagne, a bottle famously known as the Ace of Spades, all appear. (After winning the 2011 title, Dirk Nowitzki was photographed drinking from a 6-liter bottle of Ace of Spades, which Mark Cuban purchased for a cool $90,000.)

"Whenever they come to Miami," Purple says, "they already know who to hit up."

Stars posing with Purple on his Instagram feed include everyone from LeBron James to Scottie Pippen; Gucci Mane to Justin Bieber; Johnny Manziel to Odell Beckham Jr.; Khloe Kardashian to Jeremy Piven. For the price of a five-figure sum, Purple customizes the finest detail to a player's liking, everything from the type of drinks to the type of music -- even the type of women. It is, as Purple calls it, "the VIP treatment."

Welcome to the world of top-shelf partying, where the NBA player can come to revel in his hard-earned fame and fortune. It's everything you think of when you imagine the star-athlete lifestyle. And the only thing that's surprising about it? It's happening, these days, far less than you think.

The Houston Rockets' James Harden blamed off-court distractions for what he called his worst season ever in 2015-16. This season, he's distraction-free and mounting an MVP run. AP Photo/David J. Phillip

Something strange happens when NBA teams play on the road these days, a trend line that baffles statheads. In the 1987-88 season, home teams won an astounding 67.9 percent of games, boasting an average win margin of 5.8 points, the highest on record. The advantage was so profound that home teams, on average, played at the level of a 55-win team.

Then, in less than a decade, the home-court advantage gap was sliced in half. By 1996-97, home teams won only 57.5 percent of the time, by an average margin of only 2.6 points. And now, after hovering around 60 percent for most of the 2000s, home-court advantage is dropping again. This season, it sits at an all-time low of 57.4 percent.

What's causing the drop? Are refs monitored better and therefore less susceptible to the home crowd's jeers? Are the crowds themselves quieter, populated as they are by iPhone-gripping, corporate-ticket-holding fans? Is something even weirder going on? I spoke with dozens of players, coaches, team trainers and front-office execs, and most think the same thing is happening: NBA players are sleeping more and drinking less.

One general manager calls it the "Tinderization of the NBA."

"Tin-der-i-za-tion," he repeats, "like the dating app. No need to go to the clubs all night anymore."

Indeed, various apps have done for sex in the NBA what Amazon has done for books. One no longer needs to leave home to find a party. The party now comes to you. And lifestyle judgments aside, the NBA road life is simply more efficient -- and less taxing -- when there aren't open hours spent trolling clubs.

"It's absolutely true that you get at least two hours more sleep getting laid on the road today versus 15 years ago," says one former All-Star, who adds that players actually prefer Instagram to Tinder when away from home. "No schmoozing. No going out to the club. No having to get something to eat after the club but before the hotel."

"It's absolutely true that you get at least two hours more sleep getting laid on the road today versus 15 years ago." Former NBA All-Star

The NBA player staring at a 9:30 a.m. team breakfast in a hotel conference room the morning of the game can now log seven or eight hours of z's and still enjoy a tryst. Thanks to direct messaging and texting, some NBA players even arrange to have keys left at the front desk so dates can be inside the room when a player arrives at the hotel.

Much as the NBA dating scene has become streamlined, so has jet travel. In many cases, teams on a back-to-back used to take the first commercial flight out on the morning of the second game. About the time home-court advantage declined the first time in the '90s, charter flights started sweeping players out of town immediately after games.

"Home-court advantage was huge because of commercial flights," Clippers coach Doc Rivers says. "It was the travel. And nightlife was a little different back then. You knew you were staying overnight, but you were also at the airport at 5:30 in the morning."

Often, guys wouldn't go to bed before then. Now, instead of partying, they're 30,000 feet in the air. And then there's one more little thing: NBA players are poisoning themselves far less.

If you'd happened to be a passenger on one of those commercial flights that NBA players used to fly, what you would have seen was booze. You'd have seen it after games, too -- in coolers in locker rooms, provided by the home team as a "general courtesy," according to one NBA trainer. Heck, former player and veteran NBA coach George Karl said teammates drank at halftime of games back in the '70s. They actually thought beer was hydrating. No, seriously.

But times change. Just as commercial NBA flights fell out of fashion and team charters became the rule, "alcohol kind of stopped," Karl says. "In general, players have become very serious about their profession. Players today have a more dedicated attitude about 'This is big money.' They're very aware of having a plan, a plan of development, a plan of commitment, a plan of growing."

"In general, players have become very serious about their profession. Players today have a more dedicated attitude about 'This is big money.'" George Karl

Alcohol can only interfere with these best-laid plans. New Zealand researcher Matthew Barnes of the Massey University School of Sport and Exercise wrote in a recent study that "alcohol is a poison and as such should be treated as one." It has negative effects on both athletic performance and recovery. Heavy drinking can promote inflammation, and when inflammation doesn't properly heal, muscles strain and tear more easily. It causes the body's immune system to become more vulnerable to infection and illness. And because alcohol is a diuretic, a player urinates more, which leads to dehydration. "Just a 2 percent decrease in body weight through dehydration has a significant effect on physical performance," Barnes says.

A recent study by WHOOP, a biometric device company with NBA clients, found what researchers called a "four-day hangover" in the post-drinking health metrics of 148 student-athletes. Heart rates were 16 percent higher after a night of drinking, and a measurement of heartbeat interval variation was 23 percent lower. According to the researchers, the effects are "a change of similar magnitude to that of aging 12 years."

And it's all the worse at altitude. Because of dehydration effects, combining alcohol with air travel is "a double whammy," a huge concern in an NBA world where an 82-game season brings 45,000 miles of air travel on average, equivalent to cumulatively spending about 140 hours in the air per season. Typical flights operate between 10 percent and 20 percent humidity in the cabin, drier than the Sahara. If an NBA player downs a six-pack or a bottle of wine on a flight across the country, his body will be operating at a significant loss.

For years, NBA teams have invited speakers to spook players about the effects of alcohol. One such speaker, former NCAA All-American runner and current consultant for the U.S. Navy SEALs John Underwood, works from a Powerpoint citing a 2000 study that found athletes who consumed alcohol at least once a week were twice as likely as non-drinkers to suffer injury. And somewhere along the way, between the education, NBA teams' emphasis in recent years on sports science, and the professionalization of the professional athlete, alcohol has developed a stigma among players. Although clubs in some cities, notably Miami, still draw NBA stars, players as a rule seem more wary of booze.

D.J. Augustin, who has played for eight NBA teams in nine professional seasons, remembers his personal trainer showing him the injury study.

"From the teams I've been on, nobody drinks on the plane," Augustin says. "A lot of teams don't allow it. Guys are being smart about their bodies and their careers. Taking care of your body is the biggest thing."

John Lucas, a former No. 1 overall pick and current Rockets assistant coach, is a living cautionary tale of the NBA's former sex, drugs and rock 'n' roll lifestyle. In the 1980s, cocaine ran rampant among basketball circles, swallowing up Lucas and nearly ending his career when Houston waived him on March 14, 1984, after he woke up soaked in his own urine following an all-night bender in downtown Houston.

Lucas was far from alone. A battle with drugs and alcohol ended fellow No. 1 overall pick David Thompson's career in 1984 when he wrecked his knee at Manhattan's famous Studio 54 nightclub in the middle of a road trip. Cocaine ended top prospect Len Bias' life in 1986 two days after he was selected No. 2 overall by Boston. That same year, NBA commissioner David Stern levied a lifetime ban against four-time All-Star Micheal Ray Richardson after Richardson tested positive for cocaine. GMs are quick to note that this decade also marked the statistical peak of home-court advantage -- or, more to the point, road-court disadvantage.

"The late '70s and '80s was the [height] of the drug and drinking era," George Karl says.

The height of the era, but hardly the end. Lucas, who is 31 years sober, asks us to consider Michael Jordan, caught gambling in Atlantic City the night before the 1993 Eastern Conference finals Game 2 against the Knicks. The New York Times, citing two sources, reported that Jordan was outside the Bally's Grand casino until 2:30 a.m. Jordan disputed the report, insisting he left by 11 p.m. A Snapchat timestamp surely would have done the trick.

"Think about what Michael did," Lucas says. "What would that be like today?"

Or consider the night before an exhibition game against the Magic in 1997, when Charles Barkley was out at Phineas Phogg's, a bar in Orlando, with Rockets teammate Clyde Drexler. Barkley, coming off a season in which he averaged 23.2 points and 11.6 rebounds for Phoenix, tossed a man through a glass window after an altercation. Barkley was arrested and jailed for five hours before being released on a $6,000 bond.

There is no video of the incident. It was not posted on Snapchat, Facebook or Instagram. Apple wouldn't introduce the iPhone for another 10 years. If LeBron James hadn't brought up the incident in January, many of today's NBA fans wouldn't have even known it had ever happened. And it raises the question: What if Barkley played today, rather than 20 years ago? Would he have even been at the bar if he knew everyone had a camera in their hands? Would NBA players have gone out as much as they did in the '80s and '90s if their actions could be uploaded and sent to TMZ within seconds?

There are just some things we're smarter about these days. Nineteen-foot jumpers? Rarely a good play. If your goal is to score, it's the least efficient way to do it. Partying is the midrange jumper of nightlife. And it can get you in the headlines for all the wrong reasons.

Nets GM Sean Marks, an 11-year NBA veteran, says there's a stigma now that players can't risk.

"You don't get away with things anymore," he says. "Guys are too into their brand to risk it. Corporate sponsors won't tolerate that."

One current NBA coach notes: "[Players are] not going out to clubs anymore, acting like imbeciles. They get crushed in the media when pictures come out, then they get clowned on for 24 hours."

Says one executive who tells players to find clubs that take phones at the door: "You cannot get framed if you're not in the frame."

All of which might help explain the off-court behavior and on-court performance of an MVP front-runner this season.

In years past, the analytically-minded Rockets have made it a point to show James Harden the career trajectories of similar statistical comps at the end of every season. Names like LeBron James and Kobe Bryant have appeared on the list. But so have two other NBA stars -- Steve Francis and Gilbert Arenas -- who, it has been widely reported, didn't take their games as seriously. Both playmaking guards were three-time All-Stars by age 25, like Harden. Both playmaking guards finished their last NBA game at age 30.

Type Harden's name into TMZ.com's archives, and you'll find him mentioned in at least 25 posts last season, while he dated tabloid magnet Khloe Kardashian. The distractions amounted to what Harden has called his worst year ever (even if he did post career-best numbers).

"If you do anything ... everything is on social media, it's on Instagram. People make it bigger than what it really is," Harden says. "I guess it comes with it, man. It's a new day."

This season, though, we're seeing a different Harden, and it's not lost on NBA folks that his name has appeared just once on TMZ since the season began. And that lone post? It's a video of Drake making a toast during a New Year's Eve performance at Hakkasan, a nightclub in Las Vegas.

"Make some noise for my brother James Harden in here tonight," Drake urged a crowd of screaming fans. "My brother scored 53 with 16 [rebounds] and 17 [assists]. ... It's just that type of night."

Except it wasn't, of course, not for Harden. He was offstage and out of the limelight. He didn't step forward. In fact, he might very well have gone home early. The next game, Harden produced another triple-double, helping the surging Rockets notch another win.

A day later, across the country, Purple grabbed his phone and posted another photo to his Instagram. It was a picture of him walking a celebrity couple into the LIV nightclub for the New Year's Eve party.

The couple?

Khloe Kardashian and, finishing off a road trip, Cavs center Tristan Thompson.

ESPN writer Kevin Arnovitz contributed to this story.