CARLSBAD, Calif. — You might call it Lego on steroids.

From the moment young kids are greeted in the hotel lobby by a towering Lego wizard who stages a surprise light show to when they crawl into their bunk beds and gaze up to see a shooting star, they are transported to a medieval castle inhabited by more than 2,000 Lego-crafted characters.

And that’s even before a visit to Legoland next door.

The Carlsbad theme park recently debuted the 250-room Castle Hotel, its second onsite hotel in five years. Conceived four years ago, the latest lodging project capitalizes on the broad appeal of all things Lego — from licensed films and video games to the brand’s toy sets and its familiar swivel-armed brick characters.

Globally, Legoland has eight branded hotels, most of which opened over the last six years. By comparison, Disney boasts 37 that it owns and operates at its theme parks, with nearly half of those at Walt Disney World in Florida. In Anaheim, work is expected to start this year on a new 700-room luxury hotel, which will be the Disneyland Resort’s fourth theme park hotel.

Nightly rates at the Castle Hotel, which can be up to $50 more a night than those at Legoland’s original 250-room hotel, are expected to range from a low of $205 to the $400’s during the peak season.

The design of the Castle Hotel is a creative blend of Lego-building artistry, whimsy and a generous dash of humor. Take, for example, a royal throne that doubles as a whoopee cushion and emits fart noises and a jester door that tells bad knock-knock jokes.

Everything about the hotel, from the Dragon’s Den restaurant to the knight-, princess- and wizard-themed rooms, is designed around a simple story line created to captivate Legoland’s key demographic — children. The narrative is that the bad knights, many of whom are hiding in plain sight throughout the hotel, weren’t invited to the upcoming grand tournament, and they’re doing everything in their power to sneak in.

“In the knights and dragons rooms, the headboard looks like stained glass when you turn on the lights, almost like a glass mosaic piece,” explained Keith Carr, Merlin Entertainment’s project director for the Americas. “In the wizard rooms, you feel like you’re in a wizard’s office, potion bottles lit within the inside and (Lego) owls in the corner overseeing what’s going on. It’s like painting the story and making you feel like you’re living inside a medieval castle.”

Like Disney, Legoland is trading on a lucrative licensed brand, namely the Lego toys. In the case of the castle, designers not only took inspiration from the actual toy sets, but they were fastidious in scaling the toys to real-life proportions. For example, the brick motif on the castle exterior and on the interior wallpaper is exactly 25 times the size of a toy Lego piece.

What distinguishes the newest hotel from the first is much more robust, premium theming — more Lego models, more storytelling imagery on the walls, more interactive elements. The guestrooms are slightly larger, and the hotel’s outdoor courtyard area, which covers two-thirds of an acre, is an attraction in itself — from a resort-style pool and cabanas to a playground with slides, a live entertainment stage and a giant LCD screen for movie viewing.

Bryan Brandow, whose wife and two young children traveled from their home in Fremont to vacation at Legoland earlier this month, stayed four nights at the Legoland California hotel, which they used as a home base to visit the park, the Sea Life Aquarium and the San Diego Zoo.

Staying at the resort was all about the “fun factor” and the ever-present Legos, says Brandow, but convenience was also a huge inducement.

“It was definitely binging on Lego for a few days,” said Brandow, whose sons are 7 and 6. “And the proximity to the park is amazing. If we were staying offsite, we’re the type who would get to the park right when they open but here we could take an afternoon break and then come back before the park closed.

“I got the sense my kids would want to live there.”