The scenes are immediately familiar. Customers browse products on tablets ranged along wooden tables. Store employees in brightly coloured T-shirts advise consumers on the features of the models on sale. Long lines form outside the store on the first day of sale, and camera bulbs flash as an employee hugs the first customer through the doors.

But this isn't an Apple store, it's a marijuana store, and the employees aren't Geniuses – though they may sometimes think they are – they're Budtenders. California has legalised the sale of recreational marijuana, and it's no surprise its retail outlets emulate California's most successful brand.

The historic day came more than two decades after California paved the way for legal weed by passing the nation's first medical marijuana law, though other states were quicker to allow the drug's recreational use. Colorado, Washington, Oregon, Alaska and Nevada were the first to introduce recreational pot sales on a state-regulated, licensed and taxed basis. Massachusetts and Maine are on track to follow suit later this year.

From the small town of Shasta Lake just south of Oregon to San Diego on the Mexican border, the first of about 90 shops licensed by the state opened on New Year's Day to customers who previously needed a medical reason or a dope dealer to score pot. Hundreds more are expected to open throughout the state as the year progresses.

California legalises recreational marijuana
Nicole Salisbury, owner of Green Pearl Organics marijuana dispensary in Desert Hot Springs, poses in the drying room on the first day of legal recreational marijuana sales in California Robyn Beck/AFP

Licences have not yet been handed out to businesses in the city of Los Angeles so consumers would have to go to neighbouring West Hollywood or other neighbourhoods to buy recreational use cannabis. This is expected to change in the coming days. Unlicensed medical marijuana shops in LA that continue to supply customers in the interim would technically be violating state law, but police won't crack down on those operating in good faith, Assistant Chief Michel Moore said. He said police would focus on pot operations run by felons or that attract gang activity or violence.

Marijuana smokers previously purchased weed on the black market through friends or dealers. Many say that may continue, given the high costs of the legal stuff, which is heavily taxed. But with regulatory controls being phased in to ensure a higher-quality product, stores could take a higher share of the market.

California legalises recreational marijuana
Various strains of marijuana are displayed at Harborside in Oakland, along with their levels of psychoactive chemicals and prices (from $30 to $50 for an eighth of an ounce) Elijah Nouvelage/Reuters

Shops will be able to sell marijuana harvested without full regulatory controls for six months but will eventually only be able to sell pot tested for potency, pesticides and other contaminants, and products that have been tracked from seed to sale.

The slow rollout of the tracking system is just one sign of the daunting task facing the nation's most populous state as it attempts to transform its long-standing medicinal and illegal marijuana markets into a multibillion-dollar regulated system. Not since the end of Prohibition in 1933 has such an expansive illegal economy been reshaped into a legal one.

It wasn't exactly reefer madness as California launched the first legal sales of recreational marijuana, but those who could find the drug took advantage of the historic day, lining up early for ribbon cuttings, freebies and offerings ranging from cookies to gummy bears to weed with names like "heaven mountain" and "alien rock candy."

Around 100 people queued outside Harborside dispensary, an established medical cannabis shop in Oakland. Jeff Deakin, 66, his wife Mary and their dog waited in the cold all night to be first in the queue. "It's been so long since others and myself could walk into a place where you could feel safe and secure and be able to get something that was good without having to go to the back alley," Deakin said. "This is kind of a big deal for everybody."

Harborside opened at 6am and offered its first customers joints for a penny and free T-shirts that read "Flower to the People — Cannabis for All." The store's founder Steve DeAngelo used a giant pair of scissors to cut a green ribbon, declaring, "With these scissors I dub thee free," before ringing up the first customer at a cash register.

In West Hollywood, long lines formed outside the MedMen dispensary, catering to adults who enjoy the drug for its psychoactive effects. "This is what it's all about. I mean this is the first day legal, recreational sales in the city of West Hollywood, there's a line of about 150 people outside, we are at capacity inside for the fire marshall and as you can see the excitement around legal, adult marijuana it's evident"

The marijuana market in California alone, which boasts the world's sixth-largest economy, is valued by most experts at several billion dollars annually and is expected to generate at least a $1 billion a year in tax revenue. Customers in the recreational sector – which state regulators prefer to call the "adult use" market – are only permitted to buy an ounce (28 grams) of raw cannabis or its equivalent at a time. Medical patients can buy unlimited quantities, but must present a doctor's note and have purchased a medical ID card.

The long, strange trip to get here has been a frustrating one for advocates of a drug that in the federal government's eyes remains illegal and in a class with heroin. California banned marijuana in 1913. The first attempt to undo that by voter initiative in 1972 failed, but three years later felony possession of less than an ounce was downgraded to a misdemeanour. In 1996, over objections of law enforcement, the drug czar under President Bill Clinton and three former presidents who warned it was an enormous threat to the public health of "all Americans," California voters approved marijuana for medicinal purposes.

In November 2016, California voters legalised recreational marijuana for adults 21 and older, making it legal to grow six plants and possess an ounce of pot. The state was given a year to set retail market regulations that are still being formalised and will be phased in over the next year.

With California and its 39.5 million residents officially joining the pack, more than one in five Americans now live in states where recreational marijuana is legal for purchase, even though cannabis remains classified as an illegal narcotic under US law.