Aaron Sorkin, long one of Hollywood’s premier writers, assumes directorial duties for the first time with “Molly’s Game,” which he fashioned from the memoir of Molly Bloom, who ran high-stakes poker games that made her rich before she was charged with racketeering and threatened with a long prison term. Sorkin proves as sharp and flashy a director as he is a writer, and he’s fortunate to have a strong cast, including Jessica Chastain, for his ensemble. But while glitzy and energetically put together by a trio of editors (Alan Baumgartner, Elliot Graham and Josh Schaeffer), Sorkin’s movie ultimately fails to score a winning hand.

That’s largely because the basic story isn’t all that compelling despite the zest with which Sorkin tells it, especially when it stumbles clumsily into pop psychology. He fashions the narrative overall as an extended flashback arising from the preparations for a “present day” arraignment after her arrest by the feds—Bloom’s conversations with her reluctant lawyer Charlie Jaffey (Idris Elba). They in turn trigger her admittedly self-justifying recollections of how things have come to such a head.

In this reconstruction Bloom (played by Jessica Chastain, who narrates much of the tale in the brusque, biting rat-a-tat manner Sorkin favors) is brought up by her demanding, imperious father Larry (Kevin Costner), a psychologist and coach, to be a great skier with an eye on an Olympic medal. Unfortunately, a freak accident ends her career on the slopes, and she flees to California, where she takes a job as assistant to semi-shady real estate guy Dean Keith (Jeremy Strong) who runs a big-money poker game at the Cobra Room (an adjustment from the Viper Room) on the side. There wealthy guys met weekly to put up big bets, chief among them a famous actor, referred to merely as Player X (Michael Cera), whose very presence attracts others to the table. (Though never officially revealed, the actual actor has been identified in some sources as Tobey Maguire.) Bloom learns the trade by serving as overseer-gatekeeper of the games, and eventually takes over the operation from Keith, shifting the locale from the bar to a swanky hotel suite complete with amenities.

The first hour of the film concentrates on this California episode, including subplots about players like Bad Brad (Brian d’Arcy James), who insists on playing despite losing big, and Harlan Eustice (Bill Camp), a good player who loses his cool—and lots of cash—when he’s bested in a hand by Brad. It’s probable that poker aficionados will appreciate all the card action—which Sorkin and his cinematographer Charlotte Bruus Christensen portray spiffily, sometimes even employing graphic overlays—more than those of us not up on the rules of the game. But happily the script concentrates more on the human side of things, which reaches a boiling point when Player X reveals that he has been manipulating the games to some extent by bankrolling Eustice. When Molly orders him to stop, he uses his clout to seize control of the game and end her profitable business.

That shifts the scene to New York, where Molly employs her varied skills to set up a new game that soon attracts East Coast swells. All goes nicely until she not only begins taking drugs along with money from the operation in illegal ways she’d studiously avoided up to now, but decides to run with a suggestion from a seen-better-days acquaintance (Chris O’Dowd) that she recruit players from the Russian mob. That proves an extremely bad idea, putting her not only in physical peril but in the sights of the feds, who want to pressure her for the goods about her regulars. But she’s too much of a stand-up person to turn informant, though it takes a deus ex machine-style intervention from none other than dear old dad to explain why—a misguided ”Robebud” moment that drags on and on rather than being disposed of quickly, as Welles did. That leads to a courtroom finale with a judge (Graham Greene) who proves more interested in justice than legal gamesmanship.

“Molly’s Game” is on one level a portrait of a strong, resilient woman, and the formidable Chastain certainly plays her as such, spitting out Sorkin’s finely-crafted dialogue with the cool intensity it mostly demands, the occasional maudlin moments apart. But ultimately it’s not far removed from her performance last year in “Miss Sloan,” nor—in the end—is Sorkin’s film conspicuously deeper than that one was. Elba’s role doesn’t provide him with much substance beyond a couple of big Sorkin speeches, but he handles those well. Of the supporting players Costner is a one-note bore, but Cera brings an intriguing undercurrent of venomous meanness to Player X, Camp some pathos to Eustice, and Greene his usual ease to the judge.

One can see what drew Sorkin to Molly Bloom’s story. He loves explaining complicated matters in rapid-fire fashion, and it allows him to lay out the complexities of Bloom’s poker operation in much the same way as he did those of baseball’s draft in “Moneyball” or Facebook in “The Social Network” (or the workings of Washington in “The West Wing,” for that matter). It also provided him with a fistful of characters into whose mouths he could insert his hyper-articulate, theatrical dialogue. And as a first-time director, it offered him the opportunity to juggle and juxtapose multiple plot threads, using quick edits and overlaps to show his mastery of the medium—as well as his ability to draw strong work from actors.

In the end, however, the story of Molly Bloom proves a pretty slender reed on which to hang the themes of female empowerment and legal chicanery that he wants to explore. In the end the word game feels just as applicable to Sorkin’s movie as to Bloom’s business—ultimately the film represents intricacy without much depth and style without much substance.