Illinois is among the states embroiled in the widening dispute over the legality of daily fantasy sports. It’s also one of the states where competing interests are vying to control the future of the online daily fantasy industry within its borders.

Several state attorneys general say the game is illegal gambling, even as legislation is introduced in their states to protect the game. Consumers are filing lawsuits and putative class actions against daily fantasy sports operators alleging fraud and insider trading and seeking to recoup money lost by wagering.

Illinois provides a good example of what’s happening at the state level. In her opinion from last December, Attorney General Lisa M. Madigan declared daily fantasy sports illegal sports gambling under the state Criminal Code and the federal Unlawful Internet Gambling Enforcement Act of 2006, which leaves to each state the authority to determine whether the game constitutes illegal sports gambling.

Madigan addressed the ongoing debate over whether daily fantasy sports constitutes gambling or a game of skill. She acknowledged that the game may require some degree of skill in selecting athletes for fantasy teams based on knowledge of the athlete’s performance history. But she maintained that daily fantasy sports contests among individuals “who pay entry fees for the chance to win a prize for forecasting the performance of professional or college athletes over whom they have no control or influence” are not exempt from state gambling laws.

Here’s how daily fantasy sports works.

Players build theoretical teams of real professional athletes and earn points based on the athletes’ performances in real-world games. Competitions are conducted over short periods of time, from a day to a week, instead of over a whole season. Daily fantasy sports sites offer contests in professional football, baseball, basketball and hockey and college football and basketball. Some also offer professional golf and soccer as well as NASCAR and mixed martial arts.

Two game giants, FanDuel of New York and DraftKings of Boston, clearly dominate the market, drawing approximately 90 percent of the players. A myriad smaller sites, including DraftPot, DraftDay and Yahoo Sports’ daily fantasy sports site, fight for what’s left. Payouts can be huge. FanDuel offered the first $1 million prize in 2013.

The current outcry against daily fantasy sports stems from a scandal in September 2015 that put the brakes on the industry’s momentum. A DraftKings employee was accused of using insider information to win $350,000 in prizes on FanDuel’s site. The New York Times reported that DraftKings determined through an internal investigation that the employee obtained the insider information after the deadline for submitting his lineup to a FanDuel contest and therefore was prohibited from profiting on it.

The incident unleashed a torrent of news coverage, and actions by state attorneys general and legislation on how daily fantasy sports should be handled. It also triggered two federal probes.

The FBI is looking into claims DraftKings and FanDuel employees prey on inexperienced customers to win money on the sites, according to the Times. The agency is also investigating whether DraftKings accepted deposits and bets from customers in states where the game is banned.

Adding to the layers of complexity, parties representing government, legislative and consumer interests are scrambling to be heard.

Before the scandal, only six states prohibited DraftKings and FanDuel’s operations: Arizona, Hawaii, Iowa, Louisiana, Montana and Washington. The attorneys general of Illinois, Mississippi, Nevada and Vermont recently issued opinions stating the game constitutes illegal gambling under state law or, in the case of Texas, issued an opinion that the game is likely to be declared gambling by the state’s courts, according to the website Legal Sports Reports’ DFS State Watch.

On the other hand, the attorneys general of Massachusetts and Maryland say daily fantasy sports are legal, although Maryland’s attorney general is urging the state legislature to review the issue. Rhode Island’s attorney general also weighed in, saying the game is legal in the state but must be regulated.

Bills regulating the game have been introduced in 29 states. Several states have two or more bills pending.

Numerous lawsuits have been filed across the country. In fact, consumers have brought so many lawsuits and putative class actions against DraftKings and FanDuel that the U.S. Judicial Panel on Multidistrict Litigation consolidated the litigation in a Massachusetts federal court in early February.

Of the 80 cases being transferred to the multidistrict court, 42 allege insider trading; 36 center on alleged illegal gambling; and eight allege bonus fraud, according to a February report by Law360.

The situation is getting downright messy in Illinois, New York and Hawaii.

In Illinois, Madigan said in her opinion that daily fantasy sports meets the definition of “illegal gambling” under the state’s Criminal Code. DraftKings and FanDuel countered by suing the attorney general, Legal Sports Reports noted. At the same time, several bills introduced in the Illinois General Assembly seek to create the Fantasy Contests Act and to exempt contests defined under the proposed act from the state’s gambling ban. One bill proposes putting the game under the Illinois Gaming Board’s authority.

DraftKings and FanDuel are defendants in several proposed class actions in Illinois alleging very different claims. One proposed class action accuses DraftKings of violating the federal Telephone Consumer Protection Act by sending unsolicited text messages to class members, and another alleges DraftKings violated the Illinois consumer fraud statute by misleading customers about its first-time deposit bonus terms.

A third action seeking class status alleges the two daily fantasy sports operators induced customers into playing by claiming the contests were fair games of skill and failed to disclose that their employees used insider information to compete against the plaintiffs.

The fourth alleges that DraftKings contests are illegal gambling under state law and seeks reimbursement of money wagered and lost by the plaintiffs. A former college football player brought a fifth action seeking class status against the two game operators, alleging they profited from using the names and images of college athletes without consent.

In New York, Attorney General Eric Schneiderman is locked in a legal battle with DraftKings and FanDuel after he slapped the fantasy giants with cease-and-desist letters in November and then sued both companies. A judge’s order to stop accepting bets in the state has been stayed so the fantasy business in New York continues for now.

But that could change because two payment processors are caught in the conflict. Citigroup Inc. announced in February that it will stop processing transactions for DraftKings and FanDuel players in New York until the legal issues are resolved. In December, Cincinnati-based Vantiv, which processes payments for DraftKings, reportedly sued the fantasy operator and Schneiderman in a New York state court for a declaration on how it should proceed.

Of the four bills introduced so far in New York, two want the state’s gaming commission to oversee the game, another proposes exempting the game from gambling statutes as a game of skill and the fourth would amend the state constitution to allow daily fantasy sports wagering.

Hawaii, one of the few states that kept DraftKings and FanDuel at bay, faces new challenges to the status quo. Hawaii’s attorney general issued an opinion in January reinforcing the state’s position. However, two bills seek to change that by regulating daily fantasy sports as a game of skill under state law. Two additional bills aim to clarify that the game should be governed by the state’s gambling laws.

While it’s too early to predict the outcome of so many legal disputes and regulatory initiatives, it is a pretty safe bet that fantasy supporters and detractors will be closely watching how courts and legislators in states, including Illinois and New York, address the competing interests, and what, if any, actions the federal government decides to take.