It's not just casino-style gambling that's getting a boost in Pennsylvania. By spring, you may be able to pull up an app on your smartphone and tap your way to a lottery game.

On the train, at the beach, in the office — play your chances in the online lottery.

Part of the major gaming expansion approved by the state legislature in October, the online lottery won't simply provide a simulation of a ticket you'd buy in a corner store but "a new type of product, a new type of experience," said Drew Svitko, executive director of the Pennsylvania Lottery.

And if playing the lottery on your phone or computer isn't enough, you'll also be able to bet in bars and taverns on virtual sports games, which were approved by Gov. Wolf the day after the gaming bill passed.

"One of our goals," Svitko said in an interview, "is to be ubiquitous, everywhere."

The new measures bring potentially dramatic change to the 46-year-old lottery, which ranks fifth in the nation in profits and sixth in ticket sales, as officials anticipate a growing need for lottery revenue, relied upon by Pennsylvania's senior population. It joins a handful of other states in offering an online lottery, the new frontier in games of chance.

New Jersey, one of the first states to allow internet gaming, has considered similar proposals for online lotteries but has not yet approved one.

The scratch-off tickets and draw games Pennsylvania offers generate more than $1 billion a year for the state, which aids senior citizens through various programs — free rides, property tax and rent rebates, pharmaceutical assistance — and keeps open the doors of agencies on aging across the state. The new games are part of an endeavor to "stabilize" the lottery fund before Pennsylvania's aging baby boomers swell the older population. (And not the only vice to fund state programs.)

"It's sort of both an effort to make sure the lottery's keeping up with other areas of gaming while also working to make sure that those funds are still available as more and more Pennsylvanians age," said Wolf's spokesman, J.J. Abbott. "Pennsylvania has an aging population, so the governor sees that as a priority to just make sure the lottery fund is as strong as it can be."

Virtual sports, which allow players to bet on computer-generated matches or races, would bring in $75 million in the first five years, Wolf's office projected. Online lottery could generate $100 million annually after the first three years, estimated Todd Eilers, an analyst at Eilers & Krejcik Gaming.

In states such as Michigan, ticket sales in retail stores have gone up since iLottery was introduced; experts say that online games can attract new customers who then begin buying tickets in person, too.

"We don't anticipate any negative impact," Eilers said. "It's a chance to bring in kind of a newer customer base … and potentially even kind of drive traffic back to the land-based retailer."

Retailers have worried about effects on their sales, and others have opposed online gaming in general because of concerns about gambling addicts and minors getting access to the system. In iLottery systems, identity verification steps are meant to keep minors, money launderers, or out-of-state players from getting in. Bank accounts or payment cards used for play are verified as well.

The gaming bill also lifted a state prohibition on keno, a numbers-draw game that is popular in other states, but lottery administrators in Pennsylvania are still analyzing whether to offer it and will focus on iLottery and virtual sports,  spokesman Gary Miller said.

More than three million residents age 60 and older live in Pennsylvania — close to 25 percent of the population. That number is projected to rise to nearly 3.5 million by 2020 and nearly four million by 2030, according to the Department of Aging.

"It's … looking toward the future and making sure the lottery's in a position where it is able to … provide the same level of service for a greater number of people, and [now] that there is more and more competition out there for gaming," Abbott said.

In fiscal 2016, Pennsylvania lottery sales topped $4 billion, and more than $1 billion went to the lottery fund.

The Department of Aging receives 78 percent of its budget from the lottery, and the amount received has gone up each year for the last five years. While the department does not have projections for funding needed in coming years, said Department of Aging spokesman Drew Wilburne, "The lottery is critical to providing aging services to older Pennsylvanians."

Another chunk of lottery-generated change goes to the Office of Long-Term Living, whose costs have been increasing and are expected to continue rising, a spokesperson said. Last year, the lottery provided just over 4 percent of that office's funding.

The proceeds fund the shared-ride and free-ride programs for seniors in entirety (that was 37.2 million senior trips last year, according to PennDot), and provides about half the funding for the property tax/rent rebate program, with the rest coming from gaming. Costs are not expected to increase for either of those programs, spokespeople for the departments said.

Although lottery revenue and profits had been climbing steadily until last year, when they dropped slightly, there have been concerns about future profits. And public officials have said the future reliability of its funds are uncertain. If costs increase for the agencies that run programs for the elderly, the demand for funds likewise would increase, they said.

Officials worry about staying competitive in a world that offers boundless forms of entertainment and ever-growing gambling options.

"The industry has a big void right now where younger players just aren't engaged with the lottery," said Danny Bogus, a lottery consultant who founded the Michigan-based Digital Gaming Group. "The internet's one piece of that puzzle for appealing to a younger generation."

The Pennsylvania Lottery hopes to do that by creating "totally new concepts" for the instant-win games offered online. Details about how exactly the games will work are still being figured out. The new games will be similar to some sold in other states, like Michigan, which is considered the most successful iLottery state.

"It's really meant to just offer a different type of entertainment to a different audience," Svitko said. "We believe the most responsible way we can grow our sales is to grow by reaching new players in new ways and not just by asking existing players to spend more."

"We are working feverishly to try to figure all of it out," he added.

Instant games bring in the most revenue for iLotteries across the country, according to research by Bogus' group. An analysis showed that in Michigan the iLottery was growing rapidly — reaching $1 million by February 2017 — with retail sales nearing record highs.

In introducing virtual sports games, Pennsylvania will join Michigan on the cutting edge. The games have been popular in Europe, where bettors commonly take their virtual chances in between watching live sporting events, Eilers said.

Bar and tavern owners have campaigned for video gaming terminals, a fight they lost this legislative session (though VGTs were approved for truck stops). But 400 retailers will get to launch virtual sports games, and 500 more — primarily bars and taverns — will be added each year through fiscal year 2022-23, according to state officials.

Although precisely how much money these games raise will depend on how they are executed and how consumers respond, their adoption is seen as a victory among those in the industry.

"I am absolutely more positive that we're heading in the right direction even than I was six months ago, just because of this new legislation and the tools that we get to sell our product," Svitko said. "I feel great."