Teen movies have existed for decades, but the past 10 years or so have introduced a major feeder into the genre: young adult novels. Whether fantastical, romantic, or down-to-earth, these adaptations trade the endlessly referential John Hughes piety of late 1990s/early 2000s teen movies for fidelity to their oft-beloved source materials. The resulting movies are more plugged in than ever to a sense of what their audience wants, but only occasionally inspired.

The Hate U Give, which opens in wide release this weekend, doesn't avoid all of those pitfalls. Over 132 sprawling minutes, this adaptation of the 2017 book by Angie Thomas sometimes lumbers with the weight of unnecessary characters and subplots, and sometimes juxtaposes lighter, smaller-scale scenes against bigger moments in ways that halt its narrative momentum. But at its best, George Tillman Jr.'s film has a gravity and forthrightness missing from so many movies aimed at younger audiences.

It also uses its YA appeal to smuggle a genuine drama into American movie theaters — no small feat in a year where most wide-release dramas have doubled as thrillers or romances. The film focuses on Starr (Amandla Stenberg), a teenager who lives with her family in a poor black neighborhood (the fictional Garden Heights) while also attending the posh and mostly white private school Williamson Prep, where she can get the more rigorous education her mother Lisa (Regina Hall) clearly wants for her. Starr's early narration describes the code-switching she goes through between school and her neighborhood, and the filmmaking echoes that process visually: Many of the school scenes are shot with a blue-ish filter that lightens the look of Starr's skin, while the scenes in Garden Heights look richer and more saturated.

While leaving a neighborhood party with her childhood friend Khalil (Algee Smith), the kids are pulled over by a cop who wastes little time mistaking Khalil's hairbrush for a weapon and shoots the unarmed teenager dead in the street. Much, though not all, of the movie involves Starr deciding whether to testify in front of a grand jury, and whether that decision will affect her place in Garden Heights or at Williamson, where her (non-black) friends have little real sense of her background.

It's heavy stuff for a teen drama, but it's carried off beautifully by the actors, especially Stenberg, Hall, and Russell Hornsby as Maverick, Starr's ex-gang-member father. The film opens with Maverick sitting his kids down to explain how to behave if they're stopped by cops (hands on the dash, no sudden movements). There's a heartbreaking callback to this moment later in the movie, where a distraught Maverick quizzes his kids again, years later, on these procedures, as powerful a moment as I've seen in a YA film in ages.

As upsetting as it can be to see Starr suffer PTSD and the tragedy of losing a friend so unjustly, The Hate U Give (which takes its title from a Tupac Shakur "THUG LIFE" acronym) is thoughtful, rather than didactic. It communicates even its sharpest points (the inevitable "no angel" B.S. about police-shooting victims; the carelessness of many fair-weather white protesters) with empathy and emotion. Stenberg is also a major find, equally capable in scenes of anguish and scenes of joy.

But the movie's range of emotions and faith in its source material means that it indulges in subplots that probably made more sense on the page, but loom awkwardly behind the film's most compelling moments. Anthony Mackie plays a member of Maverick's former gang, who seems unduly concerned that Khalil's connection to the gang's drug-dealing operations might be exposed. KJ Apa, Riverdale's Archie, plays Starr's highly unconvincing boyfriend, who disappears from the story for large chunks of time. Given Starr's fraught relationship with her other Williamson friends, the boyfriend would have been an easy lift out of the story.

But if The Hate U Give isn't always as sharply cut or graceful as its best scenes, it's still affecting and effective, and something of a milestone for mainstream teen movies. These characters still go to prom, fight with their friends, and come to a better understanding with their parents. What the movie knows all too well is how Starr's blackness, whether in her home neighborhood or her faux-colorblind school, affects those things and brings terrible injustice right to her door. To some viewers, it will feel all too real.