Teen anomie is such a heavily trafficked film genre that you wouldn’t think it could still offer new directions to explore. Which is what’s surprising about The Perks of Being a Wallflower, a movie that makes teenage isolation and high-school torment seem like fresh subjects again. The film’s careful structure allows the story to keep surprising us, right up to the end; and its three lead performances, by Logan Lerman, Ezra Miller, and Emma Watson, mark notable advances in these young actors’ careers.

Director Stephen Chbosky has adapted his own 1995 novel—an enormous young-adult bestseller that I haven’t read—with considerable style. The picture looks great (cinematographer Andrew Dunn also shot Precious and Crazy, Stupid, Love), and Chbosky has devised some wonderfully well-constructed scenes to advance his unpredictable narrative.

The story is set in the suburbs of Pittsburgh around the dawn of the 1990s, in the kind of small town where Dexys’ MTV-immortalized “Come on Eileen” is a cherished oldie, but David Bowie’s “‘Heroes’” is an unknown art-rock transmission from a faraway earlier age. We meet the protagonist, Charlie (Lerman), on his first day of high school, and find him already counting the days till graduation, four years hence. Charlie is personable, but withdrawn. He’s haunted by the memory of a young aunt who died in a car crash some years earlier. He’s been on some sort of medication ever since. His family is solid and supportive, but clearly concerned. The movie is in no rush to let us know why.

Charlie’s high school is of course a drag, but it isn’t a complete palace of horrors. There are the usual knucklehead jocks and snotty cool kids, but Chbosky doesn’t over-build them into caricatures. Charlie hangs back, and soon finds himself adopted by a group of fellow outcasts, all seniors. One of them, Patrick (Miller), is flamboyantly gay; another, Sam (Watson), is a recovering school slut. (Watson is too classy to be completely persuasive as this sort of character, but she’s such a charmer you can’t complain.) Charlie is immediately drawn to Sam, but she’s dating some college guy; meanwhile, Charlie himself is being targeted by a new-wavy brainiac named Mary Elizabeth (Mae Whitman), who tells him, “I’m sick of macho guys.”

So far, so generic. But the story ventures into some unexpected areas. Patrick is having a very ill-advised secret affair with another boy, and we see that, behind his ebullient, wise-cracking façade, he’s heartbroken because this romance can never be publicly acknowledged. Charlie himself is too much of a nice guy to stave off the advances of Mary Elizabeth—even though she’s an Ani DiFranco fan!—and he soon must wrestle with the eternal issue of how to be rid of someone without trashing that person’s feelings. Charlie really wants to be with Sam; he senses that her new boyfriend is just using her, yet again, and he’s baffled. “Why do nice people choose the wrong people to date?” he wonders. His nice-guy English teacher (Paul Rudd) tells him, “We accept the love we think we deserve.”

There are some sweet, small performances tucked in around the edges of the main story. Rudd is especially effective as the teacher, who quickly spots his new student’s writing talent, and is reminded once more of his own fading dream to move to New York and become a writer himself. And while some of the scenes—like the party at which Charlie is unknowingly dosed with drugs—seem undeterrably bound for the shoals of teen-flick cliché, Chbosky manages to reroute them in entertaining ways. And the scene in which Patrick, Sam, and Charlie are driving through a highway tunnel in a truck, with Sam standing exultantly on the flatbed and “‘Heroes’” roaring out of the dashboard radio, is a classic.

Ezra Miller, who was so good in a much darker way in last year’s We Need to Talk About Kevin, is irresistibly effervescent here as a guy who wishes high spirits were the only social armor he would ever need. And Emma Watson, as a girl with a bruised heart and a diminishing supply of hope, will give her Harry Potter costars Daniel Radcliffe and Rupert Grint, both mired in receding franchise fame, something worrisome to contemplate. That Logan Lerman, playing the shy, recessive Charlie, manages to hold the screen alongside these two is a tribute to his own quiet skill. Lerman has seemed to be on the verge of breaking through in previous films like Gamer and Percy Jackson & the Olympians: The Lightning Thief. Here, he really does it. His Charlie is a winsome oddball, but he’s not a whiner, and he doesn’t see himself as a victim. He doesn’t want a lot, he says—“just one moment when you are not a sad story.”