Casual, cool and compelling in its first hour, 21 adapts the story of real-life college mathletes counting cards at Las Vegas blackjack tables. (It’s based on Ben Mezrich’s non-fiction book Bringing Down the House: The Inside Story of Six M.I.T. Students Who Took Vegas For Millions.)

Reducing gambling to mathematical mechanisms that beat blackjack is an idea clearly illustrated with wry humor from Peter Steinfeld and Allan Loeb’s script. Also, director Robert Luketic (Legally Blonde) glides his camera through Sin City’s glitz with a breezy confidence.

Yet 21 could use a shot of that urban-legend oxygen casinos pump on the floor in its dragging second half. It’s stacked with switcheroos that can be seen as far away as the old Strip, idiotic strategies spurred only by product placement and the usual sudden stupidity of smart people.

Ben Campbell (Jim Sturgess) is a star senior at M.I.T. with a lifelong dream of attending Harvard Medical School, but the inability to bankroll the $300,000 it will take. To get a crucial scholarship, Ben must go beyond his dime-a-dozen academic career to really jump off the page.

Last year, the scholarship Ben seeks went to a one-legged Korean student. He’s not the only Asian character 21 cuts off at the knees. The real-life students mostly were Asian-Americans, but 21 whitewashes its cast and disappointingly lumps its only major Asian actors (Aaron Yoo and Liza Lapira) into one-note designations as the team’s kleptomaniac and a slot-playing “loser.”

Following his role in last year’s Across the Universe, the British-born Sturgess has a leading man’s looks (Tobey Maguire meets Ewan McGregor) but not much of an insistent presence. He has the wide-eyed simpleton routine down cold. Yet his breathy, jittery voice oftentimes feels more like a Bobcat Goldthwait warm-up than the realistic nervousness of a man struggling with his future.

So what is Ben, a meek 21-year-old working at a menswear shop and building a self-driving car with nerdy pals (Josh Gad, Sam Golzari), to do in his attempt to dazzle? Leave that to Micky Rosa (Kevin Spacey, also a producer), a persuasive professor who brings Ben to a backroom club where he’s teaching students the how and when of which blackjack tables are hot enough to rake in cash. It’s not illegal, only discouraged, and it’s illustrious, but only if cool heads avoid detection.

Ben sees a get-in, get-out fix to his cash-flow woes and becomes the team’s new “big player,” a main moneymaker who scopes out signals from spotters to pilfer a table for all it’s worth. He also finds a romantic in with Jill Taylor (an underused Kate Bosworth), a hot teammate he’s pined for.

Yet it’s not long before the allure of anonymity and natural high of winning clouds Ben’s focus. Soon, he’s alienating his friends, losing his command at the tables and landing on the radar of Cole Williams (Laurence Fishburne), a Vegas vet of loss prevention not above using his fists for work.

Part of 21’s problem as it ups its stakes is that it’s about as dangerous and sexy as a $1-minimum keno game. When Ben and Jill get busy, it’s timid, with silly Bellagio fountain symbolism. Both Cole and Micky (whose nasty side comes out) feel like autopilot characters from Fishburne and Spacey, neither working to his top level. And the only conceivable reason the team goes to Planet Hollywood so often (even after being burned) is that the casino ponied up tie-in money.

Just approach this mildly tantalizing timewaster about wish fulfillment with the same cautions and expectations as a blackjack table at the Palms: Know the returns will be impossibly high before they gradually drag down and expect that breaking even is about the best result possible.