You stride into the bright, twinkly casino with your wallet filled with cash and a vision of putting lady luck on your side. But just a few hours later, you have no idea what time it is or how much money you’ve spent. It’s a familiar scene in casinos around the world. Gambling is fun and can provide a rush when things go your way, but it’s not like it looks in the movies. Every aspect of a casino is designed to lead patrons into spending more money than they should.

Beneath the flashing lights, free cocktails and music of casinos lies a bedrock of mathematics, engineered to slowly bleed patrons of their hard-earned money. For years, mathematically inclined physicists have tried to turn the tables on casinos by using their knowledge of probability and game theory to exploit the rigged system.

But the casinos have responded with a host of techniques, from the design of their buildings to their rules and regulations. They have also bolstered security with cameras and other technology to keep track of what’s happening inside their doors, including the use of microcircuitry in betting chips that enable casinos to oversee exact amounts wagered minute by minute.

Another trick casinos employ is the use of sounds and lighting to create an atmosphere that’s at once inviting and intimidating. When a player hits a jackpot or wins a hand at the poker table, cheers erupt and lights flash. This is designed to give the impression that it’s possible to win regularly and to make gambling seem exciting and glamorous.

And then there’s the food. Whether it’s the buffet or the bar, casino food is often delicious and hard to resist. Even the name of a casino, such as the MGM Grand in Las Vegas, is meant to draw customers in with its promise of great food.

Bathrooms are hidden from view, deep within the casino and past many more opportunities to press your fortunes. This is to encourage players to spend more time at the gaming tables, where bathrooms are a bit further away from the entrance than they would be if they were located conveniently outside the door. This is called the “casino footprint.”

Modern slot machines are simple and easy to play: Insert your currency, choose your bet amount, push spin and hope for the best. While a few games such as video poker require some skill, most are strictly games of chance.

It’s not just the mafia and casinos that are complicated; gambling is complicated, too. But Casino does a masterful job of illustrating how big corporations took over the desert city and how the business has evolved. It’s a long movie at almost three hours but it never lags or runs out of steam and is gripping till the end. And for a movie about casino gambling, you can’t get better than the performances by De Niro, Sharon Stone and Joe Pesci.