The first thing you notice about Third Rail Repertory Theatre's production of John is the intensely detailed set. Heavy rugs blanket the floor. Toys are everywhere. Pale green wallpaper encircles the room.

Written by Annie Baker and directed by Rebecca Lingafelter, John is exactly like the stage where it unfolds—peculiar but entrancing. You don't have to understand every moment of the play because it's thrilling to allow yourself to become blissfully lost in what Baker has created—a three-hour compendium of wit, strife and mystery set inside what is probably the oddest bed-and-breakfast in American history.

The story begins with a couple, Jenny (Jennifer Lin) and Elias (Nick Ferrucci), arriving at the B&B, which is located in Gettysburg, Pa., and run by the ethereal Kitty (Karen Trumbo). She greets her guests by practically force-feeding them fudge and neglecting to turn on the heat in their room at night.

Yet forces more menacing than dubious candy and nighttime drafts are at work. Jenny recently had an affair with a man named John—who's never seen onstage—and Elias' bitterness over her betrayal clings to their vacation like a malicious cloud. His mood matches the gloom of the bed-and-breakfast, which was a hospital during the Civil War. Might a few ghosts from the 1860s be lurking nearby? Kitty's hint that one of the rooms may be haunted makes you think so, but then again, this doesn't seem to be a horror play.

John, as a matter of fact, doesn't fit into any particular genre. The production's meticulous details—including a miniature jukebox that blares obnoxiously loud piano music at inappropriate moments—are frequently played for laughs, but Jenny and Elias' tormented romance is dramatic and ambiguous. You feel for Elias when Jenny makes a cruel remark about the way he slurps cereal, but it's hard not to hate him when he belligerently demands to see a text message she has just received.

It's almost unbelievable that John works—on paper, it sounds like too much. Yet the cast plays the story's constant shifts with gusto, rightly trusting that Baker will not lead them astray. Lin and Ferrucci skillfully inhabit the narrative's nastier corners—one of the play's most potent moments is a scene in which Ferrucci abruptly goes from speaking in a normal voice to violently shouting—while Trumbo and Diane Kondrat (who portrays Kitty's friend Genevieve) seize upon John's eccentric streak with delicious aplomb.

With her wide eyes, airy voice and preternaturally delicate footsteps, Trumbo brings a touch of the otherworldly to the production—Kitty starts to seem like an offbeat fairy godmother to Jenny and Elias—while Kondrat's jolliness clashes entertainingly with Genevieve's sinister recollections.

Genevieve plays a vital role in the play's climax, an eerie sequence in which lights dim, candles are lit and the possibility of violence looms so intensely that your whole body stiffens in anticipation. Perhaps Elias' bullying will ascend to unforgivable heights. Perhaps the supernatural terror that Kitty vaguely alluded to will make its presence known. Perhaps something horrible that we have not imagined will emerge.

Yet as is always the case in John, nothing turns out quite the way you would expect. The play ends with conflict, but barely any explicit brutality—that would be too tidy for Baker, who relishes depicting life at its most messy and least straightforward. You're left beguiled, baffled and desperate to return to the marvelously maddening world that she and Third Rail have created.

SEE IT: John plays at CoHo Theater, 2257 NW Raleigh St., thirdrailrep.org. 7:30 pm Thursday-Saturday, Dec. 20-22. $17-$45.