It’s a magical fairy tale and special-effects fantasy with a starkly realistic streak of modern history running through it. Its central figure is a bright, adventurous 10-year-old named Ofelia who plunges into a mythical quest in the fantastic underworld that she begins to discover just as she and her mother move into an old mill that is also the military headquarters of her new stepfather. Pan’s Labyrinth generates a fairy-tale sense of wonder throughout, but it’s never merely childish. Indeed, the grimness of its oozy underworld encounters and the savagery of Vidal’s violence (for which he will be repaid in kind) provide ample reason for its R-rating. And it’s very much to the production’s credit that its fairy tale mystique has sufficient tough-mindedness to prevail amid the story’s assorted forays into horror-film territory.