The most definitive overarching issue with the Marvel Cinematic Universe has been the lack of stakes. Over the course of the saga’s previous 18 movies, MCU heroes have faced numerous world-ending threats, eking out victories by the skin of their teeth, only to have their worlds essentially return to normal in time for the next installment. The approach worked early, on a film-by-film basis, but when viewed as part of a 10-year narrative, it’s tended to weaken the broader franchise. There can be no drama without true risk, and in the MCU, audiences have learned that none of their favorites are ever really in harm’s way.

Directors Joe and Anthony Russo seem acutely aware of this issue with their latest entry, the massive, multi-film team-up Avengers: Infinity War. The long-awaited face-off between the Avengers and Thanos (Josh Brolin), the MCU’s ultimate big bad, is massively entertaining, deftly incorporating dozens of characters across multiple storylines with a kinetic flair. Its devotion to banter and one-liners makes it one of the funniest movies in the studio’s history, but it’s also a film where very bad things happen to good people. After years of movies where even the most mediocre heroes appeared to be invulnerable and indomitable, it’s an arresting jolt — and exactly the film the franchise needed.

After years of teasing Thanos’ upcoming arrival, Avengers: Infinity War wastes no time with stage-setting. It opens with Thor (Chris Hemsworth) and Loki (Tom Hiddleston) on the ship last seen at the end of Thor: Ragnarok, facing off against the big purple villain. Thanos is after a powerful crystal called an Infinity Stone, and he suspects Loki has one in the Tesseract — the glowing cube that served as a key plot device six years ago in The Avengers.

There are six Infinity Stones, the film explains: powerful crystals that originated in the Big Bang, and that represent aspects of existence and have related elemental powers. Some are spread across the universe, but half of them are on Earth, where they’ve played significant roles in past MCU movies. Thanos is trying to collect all of them, slotting them into a massive golden glove. If he acquires them all, he says, he’ll have the power to wipe out half the universe with a snap of his fingers.

It pays off years of emotional investment in ways that are often heart-wrenching.

The film tracks Thanos’ quest as he moves from stone to stone, while various superhero factions attempt to stop him. Tony Stark (Robert Downey Jr.), Spider-Man (Tom Holland), and Doctor Strange (Benedict Cumberbatch) are attacked by several of Thanos’ henchman, who are eager to get the green Time Stone that Strange protects within the mystic Eye of Agamotto. Scarlet Witch (Elizabeth Olsen) and Vision (Paul Bettany), who have gone into hiding to nurture their burgeoning romantic relationship, are attacked by minions seeking the Mind Stone that’s integrated within Vision’s brain. Along the way, the Guardians of the Galaxy team up with various heroes, a bearded Captain America (Chris Evans) comes out of hiding, and Black Panther’s home of Wakanda becomes ground zero for a central conflict. Nearly every character in the MCU is roped into the war, with Thanos swiftly establishing himself as an unprecedented threat on multiple fronts.

With so many characters in play, writers Christopher Markus and Stephen McFeely (Captain America: Civil War) are faced with a remarkable challenge: giving every character a place in the story, without letting anyone other than Thanos dominate the larger narrative. The story crosscuts between four or five major story threads, much like Game of Thrones, Westworld, and other complicated serial narratives. It’s a testament to Markus and McFeely’s work that the film never feels crowded, even though it’s juggling such a massive number of movie stars. In fact, the film is able to give many characters their own meaningful story arcs throughout the film, with Tony Stark, Star-Lord (Chris Pratt), Gamora (Zoe Saldana), and the Vision / Scarlet Witch love story given particular focus. The result is a film that often feels surprisingly earnest and emotional. It pays off the emotional investment movie audiences have been making in these characters for years, sometimes in genuinely heart-wrenching ways.

The most outlandish-looking Marvel villain is also its most complex and layered one

Even with all of that, this film belongs to Josh Brolin’s Thanos. The prospect of a giant purple computer-generated bad guy has prompted some skepticism, but in context, the character is wonderfully effective. The visual effects undeniably capture the nuances of Brolin’s facial tics and mannerisms, allowing the actor to shine through all the CGI wizardry. It’s a good thing that it works so well, because Thanos is not the cardboard cutout villain that some previous Marvel bad guys have been. His master plan involves destroying half the universe, but in his own mind, his motivations are noble. He thinks he’s the hero of his story, and while nobody is going to agree with his tactics, his backstory does give his overall reasoning a perverse sort of logic. At several key moments in the film, Thanos nearly becomes a sympathetic character — even while he is doing truly horrific, unforgivable things. The biggest surprise of all may be that the most outlandish-looking Marvel villain is also its most complex and layered one, which simply wouldn’t be possible without the film’s synthesis of script, direction, performance, and visual effects.

The film’s sparkling sense of humor balances the weight of Thanos’ actions. Marvel’s films have always had a flair for comedy, but Infinity War turns the dial up further, maximizing the levity found in movies like Thor: Ragnarok and Guardians of the Galaxy. Pitting Star-Lord’s hyper-insecurity against Thor’s arrogant hyper-masculinity provides for some of the funniest moments in the entire MCU.

Doctor Strange and Tony Stark also play as comedic foils for each other, sparring over what might as well be the title for Most Arrogant Superhero On Earth. In a film that mixes so many different elements, it would be easy for many of these characters’ essential traits to fall by the wayside. But the Russo brothers don’t just preserve the characters’ innate sensibility. They’re actually able to incorporate the filmmaking sensibilities of the different franchises into their own tapestry. Sequences with Star-Lord, Rocket (Bradley Cooper), and Groot (Vin Diesel) feel like they’re from one of James Gunn’s Guardians films; Thor seems like he’s walked right off the set of Taika Waititi’s Thor: Ragnarok. The movie is a Marvel mixtape, combining the very best of everything that’s come before, but recontextualizing the individual parts to tell its own unique story.

The massive scale of the undertaking does have periodic downsides. The action sequences are mostly effective, but at times, there are so many characters being flung around like CG rag dolls that it can be hard to gauge what is happening to whom, in which order. And while every character does get a laugh, a heroic choice, or some other moment to shine, fans will no doubt be frustrated if their particular favorite hero isn’t foregrounded as much as other characters are. That’s simply the nature of the beast, however — it was inevitably going to happen with a project of this size. The fact that those concerns are fleeting, however, is a testament to what a massive storytelling achievement Infinity War is.

Audiences will be aghast at just how far The Avengers have fallen

The film can’t spread around its camera time in equal measure, but it does give all the characters an equal shot at despair. A decade of films have led up to Thanos, and Avengers: Infinity War delivers on that threat with a film that upends the entire fabric of the Marvel Cinematic Universe. No character is safe from the far-reaching implications of his actions, and it’s impressive to see just how dark Marvel is willing to go for this story. Even the biggest fan favorites are truly vulnerable, and the movie reinforces that idea — relentlessly, at times — as it sprints toward its final stunning moments. By the time the credits roll, audiences will no doubt be aghast at just how far the Avengers have fallen.

One problem, though, is that Infinity War leans so excessively toward darkness that it’s impossible to believe the studio won’t take back many of the things that happen onscreen. This is still the Disney-run Marvel universe, after all, and the popularity of some of its flagship characters all but guarantees that, no matter what happens during Avengers: Infinity War, much of it won’t be permanent. (In fact, in its final act, the film seems to tip its hand toward a Hail Mary solution that’s likely to come into play in the still-untitled Infinity War sequel.) But that’s the most minor of complaints. This is a comic book universe, after all, and the fact that Infinity War is able to embrace this darkness in the first place is a wonder. The only real crime is that audiences will have to wait until 2019 to see the conclusion.

Avengers: Infinity War opens on April 27th.