The first great poker movie is finally here.

Every movie that Aaron Sorkin has written since the turn of the 21st century has been about a real person. On the other hand, it might be more accurate to say that none of the movies that Aaron Sorkin has written since the turn of the 21st century have been about a real person. Sure, “The Social Network” effectively “Rashomon”-ed the myth of Mark Zuckerberg, “Moneyball” immortalized Billy Beane, “Charlie Wilson’s War” reintroduced Americans to a semi-forgotten Congressman, and “Steve Jobs” made sure everyone knows that the guy who invented our phones was a pretty shitty dad, but those films weren’t interested in capturing their respective subjects so much as they were in selling them for spare parts.

Sorkin doesn’t want the life story; he wants the life rights. He wants to take the facts, sharpen them until they can cut through all the noise, and then run them through the particle accelerator of his manic imagination until things are moving so fast they blur into a single core idea that may not have even been there before he got involved. The truth can be fun, but there’s really only so much you can do with it.

“Molly’s Game” only seems to buck that trend. Sure, this absolute barnburner of a biopic likes to act like the same rise-and-fall crime story that you’ve seen a million times before — complete with the most incessant, self-aware voiceover track since “The Wolf of Wall Street” — but the subtly profound ways in which this movie distorts the recent past makes it one of the most radically entertaining things its iconoclastic scribe has ever written. Also, it’s about a woman, which is unfamiliar territory for him.

Arguably the first great poker film ever made (don’t you even think about rebutting that with “Rounders”), Sorkin’s electrifying directorial debut is adapted from Molly Bloom’s 2013 memoir, which she wrote while awaiting sentencing for her role in one of the most exclusive and extravagant high-stakes underground hold-em games in the United States. She probably should have waited; as her lawyer smarts during one of the many conversations invented for the movie: “You finished writing a book before the good part happened!”

Hindsight being 20/20, Sorkin has been kind enough to fix that mistake for his subject, expanding on the story so that much of it takes place after her memoir was published and fudging the timeline so that she isn’t arrested until after the hardcover is already sitting on store shelves. On paper, those might sound like minor tweaks (you won’t even notice without a post-viewing Google). In practice, they become major changes that help Molly to comment on her own history, and — more relevantly — allow Sorkin to reshape it as he sees fit. With “Molly’s Game,” he’s taken a singularly American saga about money and stretched it out on both ends in order to explore what people really play for. The result is a typically staccato and silver-tongued drama that boasts a zillion killer lines, at least two of the year’s most exciting performances, and a rare understanding of the difference between power and pride.

Read More: The 2017 IndieWire TIFF Bible: Every Review, Interview, and News Item Posted During the Festival

The film begins with a prologue that’s every bit as memorable as the one Sorkin wrote for “The Social Network.” We meet Molly (Jessica Chastain) before she got in trouble with the law, back when she was one of the best freestyle skiers in the country. Her Olympic tryout, laced with a voiceover full of vintage Sorkin-isms, does not go well. And so, between flashbacks in which she starts to snap at her overbearing father (Kevin Costner, making the most of an awkward role), we watch as Molly moves to Los Angeles and rededicates her ample genius to a job running a high-stakes card game for Hollywood’s biggest douchebag.

Meanwhile, in the present day, she’s in the New York offices of defense attorney Charlie Jaffey (Idris Elba), desperately trying to convince him to take her case even though she can’t cover the $250,000 retainer. In a movie that often boasts the subtlety of a check-raise, the moment that Jaffey agrees to work with her is a wonderfully understated (and very funny) beat, the black lawyer and the female gambling mastermind recognizing how different prejudices have mutually inspired them both to power. Two hours later, Elba also gets the biggest moment in the movie, and he crushes it so hard you’ll never think of “The Dark Tower” again.

Chastain, who plays Molly at at least three different points in her life, hasn’t been this good since “Zero Dark Thirty.” When Bloom was first asked who she wanted to play her in a hypothetical movie about her life, she replied that she’d “want it to be somebody who is smart and obviously talented with dimension because there was a pretty big transformation from where I started to now.” She got her wish and then some. Chastain bulldozes through the role with a confidence that only the best actors can make convincing; her Molly is always the smartest person in the room, but never impervious to what’s coming her way. Cleavage on full display as she presides over “the world’s most exclusive, decadent man cave,” Chastain once again plays a woman who rules the roost in a world full of boys. Elusive and unattainable but sitting with her back straight in a room full of hand-picked high-rollers, Chastain weaponizes her stardom in a way that also deflects it; she’s the most glamorous and powerful person on screen, but she also makes a malicious Tobey Maguire stand-in played by Michael Cera feel like he’s holding all the cards.

Sorkin hasn’t always been the best at handling female characters (to put things as generously as possible), but his script is too fiercely keyed in to Molly’s well-earned sense of self to let her become a shrew or feel like someone who needs saving. Aside from one thorny scene towards the very end of the film, the screenwriter’s first female protagonist is as well-rounded as any of his male heroes. As for that one scene, it’s vintage Sorkin: It makes you cry and cringe at the same time.

Still, it’s worth noting that “Molly’s Game” is less cringe-inducing than you might fear. Sorkin is a natural behind the camera, and his direction is a lot like his writing: Fast, precise, and often just a tiny bit too blunt, it never gets in the way (mercifully, he seems to have learned more from David Fincher than he has from Danny Boyle, though the confidence with which he busts out some sly visual effects suggests that he wasn’t totally put off by what the latter did to his last script). Nevertheless, this was certainly the right time for him to assume full control. “Molly’s Game” is an immensely riveting testament to the notion that money can buy freedom, and the veteran creative mega-force is finally cashing in his chips. He bends the truth here in all the right ways, creating a movie that that lusts after power but settles down with pride. Victory doesn’t come cheap, but the house always wins in the end.

Grade: A-

“Molly’s Game” premiered at the 2017 Toronto International Film Festival. STX will release it in theaters on November 22.

Sign Up: Stay on top of the latest breaking film and TV news! Sign up for our Email Newsletters here.