WARSAW — It was supposed to be fun, but in the end, there was no escape.

When a fire broke out in a squat, two-story concrete building in northwestern Poland, five 15-year-old girls died, trapped in a tiny windowless room no bigger than a closet, with no emergency exit and no key.

They were locked in by design. The building, a private house in the city of Koszalin, had been converted into an “escape room,” a popular entertainment where groups have to follow clues and solve a series of puzzles in order to find their way out.

But a preliminary investigation has revealed that the house failed to meet even the most basic safety precautions, officials say, raising questions about the safety of hundreds of similar sites throughout the country and thousands across the region. As of Monday, the authorities had ordered at least 26 escape rooms in Poland to shut down amid a nationwide safety review.

In the building where the girls died on Friday, the windows had been covered with makeshift walls. There was no evacuation route. And there was apparently no system in place to deal with an emergency.