"A terrifying disease acting as a mild impediment to a youthful romance" is a firmly established genre, and I'm not sure that I'd ever have been able to explain why, but it's the world we live in. And insofar as that's the world we live in, I am grateful for the likes of Everything, Everything, based on a 2015 book by Nicola Yoon that I gather resides squarely in the "you can make a lot of money by copying John Green" marketing niche. For most of its running time, Everything, Everything is a perfectly satisfying bit of time spent in the presence of a hugely engaging romantic lead, 18-year-old Maddy Whittier (Amandla Stenberg), surrounded by some gently creative directing by Stella Meghie, who finds some beautiful, beguiling ways to pull us out of the claustrophobic world Maddy has been stuck in for her whole life.

The hook, y'see, is that Maddy has SCID - severe combined immunodeficiency - which means in practice that she'll die of all the diseases all at once if she ever sets foot out of the well-appointed, hermetically-sealed home where she lives with her neurotic doctor mother Pauline (Anika Noni Rose) and kindly nurse Carla (Ana de la Reguera). Naturally, 18 years in the same place start to grate on a bright teenager with a strong imagination, but what pushes Maddy from vague yearning to see the ocean to a passionate desire to get the hell out and start living is the arrival of a new set of next-door neighbors, most importantly the very pretty Olly (Nick Robinson). In no time at all, the two teens are texting each other and staring meaningfully through the glass walls of Maddy's posh prison, and all of that.

The two best things about Everything, Everything, by a considerable margin, are its main star and its fantasy sequences. The latter are how Meghie and screenwriter J. Mills Goodloe deal with the fact that their movie can't go outside: Maddy is a bit of a model-maker, and in order to dramatise her text conversations with Olly beyond the banal use of onscreen words (which does happen), the filmmakers allow her to mentally project herself and her new crush into the models, rendering the text messaging as face-to-face conversations in diners and other such places where a naΓ―ve, unworldly young woman might still suppose teen courtship takes place. It's genuinely transporting, and Meghie's light touch in moving us there almost invisibly keeps it from being tacky, showy spectacle.

As for Stenberg, she's simply phenomenal in a role that barely makes room for it - the leaden voice-over that dominates the first third of the movie would already be enough to do in the character. And it's not that Stenberg makes the voiceover interesting; she just keeps it from being fatal. Which is enough to make room for the rest of her exceptionally good work as Maddy in the flesh: she plays the character as naturally inquisitive but adept at burying that below a lifetime of being reminded that she will die if she ever breathes unfiltered air. Given the film's rather extreme scenario, it matters deeply that we believe that Maddy believes it, and Stenberg makes sure that happens. Contrast, say, The Fault in Our Stars, one of the most obvious influences on Everything, Everything, where it seems quite clear that nobody involved had given the reality of cancer more than the slightest moment's thought. Stenberg is also good at domesticating the character's passion to leave: she's careful to render Maddy less as a starry-eyed romantic dreamer than as a normal teenager who's bored out of her mind, which makes the material far more accessible.

With all this working in its favor, it's a pity that Everything, Everything goes to hell quite so hard in its finale; I won't spoil it, but it's sufficient to say that the film goes to some enormously dark, cruel extremes, apparently without noticing that it has done so. It retroactively makes the film less of a romantic drama than a horror story, and it's a little disconcerting that nobody involved in making it appears to have noticed that this was the case. Certainly, it's enough to leave the film with a foul, bitter aftertaste, one that completely trumps any sense of whimsy and wonder at the adolescent yearning and innocent sexuality that define so much of the film.

It's a pity, because much of the movie is better than it needs to be: besides Stenberg, Rose gives a pretty terrific performance (not, alas, Robinson, who has a largely flat, disinterested tenor to his line readings; he's only ever good when the film gives him some comedy to work with), and the film's design is eye-catching, if never wholly believable. And I admire the unusual quasi-minimalist score by Ludwig GΓΆransson, though I can certainly see that being a minority opinion. It's also pleasing to see a film present a mixed-race romance as no big deal, without so much as one solitary line of dialogue calling our attention to that fact.

But in the face of that horrendous ending, none of it much matters. This is always more of a charming film than an actively good one, and when that charm gets poisoned, there's nothing left. It's a sweet, likable movie, and sweet, likable movies absolutely should not make you feel so sour by the time the end.