SAN FRANCISCO -- Look out Las Vegas, here comes FarmVille.

Silicon Valley is betting that online gambling is its next billion-dollar business, with developers across the industry turning casual games into occasions for adults to wager.

At the moment these games are aimed overseas, where attitudes toward gambling are more relaxed and online betting is generally legal, and extremely lucrative. But game companies, from small teams to Facebook and Zynga, have their eye on the ultimate prize: the rich U.S. market, where most types of real-money online wagers have been cleared by the Justice Department.

Two states, Nevada and Delaware, are already laying the groundwork for virtual gambling. Within months they will most likely be joined by New Jersey. Bills have also been introduced in Mississippi, Iowa, California and other states, driven by the realization that online gambling could bring in streams of tax revenue. In Iowa alone, online gambling proponents estimated that 150,000 residents were playing poker illegally.

Legislative progress, though, is slow. Opponents include an influential casino industry wary of competition and traditional anti-gambling factions.

Silicon Valley is hardly discouraged. Companies here believe that online gambling will soon become as simple as buying an e-book or streaming a movie, and that the convenience of being able to bet from your couch, surrounded by virtual friends, will offset the lack of glittering ambience found in a real-world casino. Think you can get a field of corn in FarmVille, the popular Facebook game, to grow faster than your brother-in-law's? Five bucks says you cannot.

"Gambling in the U.S. is controlled by a few land-based casinos and some powerful Indian casinos," said Chris Griffin, chief executive of Betable, a London gambling startup that helps companies negotiate licenses and handle the betting aspects of the business. "What potentially becomes an interesting counterweight is all of a sudden thousands of developers in Silicon Valley making money overseas and wanting to turn their efforts inward and make money in the U.S."

Betable has set up shop in San Francisco, where 15 studios are now using its back-end platform.

As companies eagerly wait for the U.S. market to open up, they are introducing betting games in Britain, where Apple has tweaked the iPhone software to accommodate them. Facebook began allowing online gambling for British users last summer with Jackpotjoy, a bingo site; deals with other developers followed in December and this month.

Zynga, the company that developed FarmVille, Mafia Wars, Words With Friends and many other popular casual games, is advertising the imminent release of its first betting games in Britain.

Cesar and Edgar Miranda are two young developers who have won hackathons, where the goal is to build a game in a weekend. The brothers, who rent rooms from their parents in San Jose, have spent the last few weeks refining their game, Claw Crane. It is a simple variation of the grabbing game found in amusement arcades for decades: successfully secure a toy from a pile and you win. If Apple approves, the game, offering cash prizes, will be available in Britain later this month. A virtual money version will be available in the United States.

"We saw the opportunity here," said Cesar Miranda, 24. "Anyone can jump in and try and grab a piece of this market while it is still fresh. There's a low entry to failure."

Casual gaming first blossomed on Facebook's website, where players could readily corral friends into their games. It is now being rethought for mobile devices, so people can play in brief snippets as they wait for a bus or a sandwich. Some games mimic the slots and poker found in casinos; others emphasize considerably more creativity. The vast majority of casual game players play at no charge. A small number buy virtual objects in the game to speed their play or increase their status.

Tech executives expect an equally small number to play for real money but believe they will bet heavily, making them much more valuable to the gaming companies. By Betable's estimate, the lifetime value of a casual player is $2 versus $1,800 for a real-money player.

The powerful Las Vegas and Indian casinos have mixed attitudes toward online gambling. Caesars Entertainment in 2011 acquired the Israeli startup Playtika, developer of the popular Facebook game Slotomania, for about $180 million, offering it a springboard into the digital world. But Sheldon Adelson, the Vegas magnate and major Republican Party donor, is opposed to online betting because he thinks children will end up gambling.