In his youth, Richard Garfield, the mathematician who created Magic: The Gathering, liked to play and invent games. Before his family settled in Oregon, in the mid-seventies, he spent many of his early years in Bangladesh and Nepal, places where his father worked as an architect. Garfield didn’t speak Bengali or Nepali, so, to make friends, he would unpack a deck of cards or spill out a bag of marbles. Back in the United States, around the age of thirteen, he began to hear about a game called Dungeons & Dragons—he was told that it had pit traps and orcs and treasure—but his local game store didn’t have the rulebooks yet, and none of his classmates knew how to play. A lack of language had never stopped him before; he made something up.

The game he devised was nothing like D. & D. “It was more like a Clue board,” he recalled. “You could move around the map and go into different rooms and then there would be monsters in these rooms.” You could also “win” in Garfield’s version. When the zine-like D. & D. manuals finally arrived, he was astonished to discover that you could keep playing the game indefinitely. Players would collectively tell a story about their characters wielding enchanted swords or picking locks, with dice rolls deciding many of the consequences. “It puts players in the position of game designers,” Garfield told me. The books themselves “were dreadfully written,” he said. “The game was very hard to learn from the rules, which is something it shares with Magic, I guess, but its brilliance shone through.”

Like the misfit musicians who bought the Velvet Underground’s first album, the young kids of the seventies who pored over the first set of D. & D. manuals all went out to make their own games. The ideas that bubbled up in the following decade flowed in a similar direction. Wiz-War had wizards hurling fireballs at each other in a maze. Titan had players commanding an army of mythological creatures like centaurs and griffons to attack the other players’ titans. Garfield himself made a game called Five Magics. He granted elemental characteristics to five distinct colors of energy that arose, as in many other fantasy games of the period, from different geographies. The colors shifted around, but, eventually, red aggression came from mountains, black ambition from swamps, blue rumination from islands, white orderliness from plains, and green growth from forests. Garfield never considered Five Magics publishable and, because of constant tinkering, he never played it the same way twice. Sometimes it was a board game. Sometimes it was a card game. “There were some versions where you collected victory points to win,” he recalled, “and some versions where you wiped out your opponents.”

It wasn’t until 1991, when a friend put him in touch with a gaming entrepreneur named Peter Adkison, that Garfield, by then finishing a Ph.D. in combinatorial mathematics at Penn, thought he could make something of his creation. Adkison lived in Seattle and worked a day job as a systems analyst for Boeing; he moonlit as the founder and C.E.O. of a gaming company called Wizards of the Coast. He met up with Garfield in Oregon, where the young mathematician was visiting his parents. The lives of these two men and what followed has been chronicled, especially in books like “Jonny Magic & The Card Shark Kids" by David Kushner and “Generation Decks” by Titus Chalk, with particular attention to what happened at this fortuitous moment: Adkison suggested that Garfield create something portable that people could pull out during their downtime at the conventions where nerds flocked to find rare comic books, purchase esoteric collectibles, and discover new games.

After the meeting, Garfield drove outside Portland with his family and hiked a path that winds to the top of Multnomah Falls. As he circled his way up, he had a burst of inspiration. People playing a game like Five Magics could separately collect different cards, have different decks, and come up with different strategies from those decks. In doing so, they could transcend the game itself and express, in the midst of calculations concerning goblins and demons and angels, something that would be unique to them: an identity. “Magic is closer to roleplaying than any other card or board game I know of,” Garfield later wrote. “Each player’s deck is like a character.”

He met Adkison again near the Wizards office, and, when Adkison heard the idea, he started yelling and hollering with excitement. He instantly grasped that the game that would become Magic wasn’t like Monopoly or Clue, which families purchase once and use for a lifetime. Players would want to acquire more and more cards in order to remake the game and find their own unique expressions within it. “If executed properly,” Adkison wrote in a post on Usenet, the cards “would make us millions.”

Magic: The Gathering débuted in August of 1993, and had a modest initial print run of 2.6 million cards with fantasy illustrations to match. Over the next decade, it would inspire a genre of collectible-card games such as Yu-Gi-Oh! and Pokémon. Mel Li, a game designer who has a Ph.D. in biomedical engineering and who worked at Wizards until last year, discovered the game in 1995. “I grew up in the suburbs,” she said. “You spend a lot of time on your own.” Magic gave her nerdy friends something to talk about in the schoolyard, a “common language.” The next year, Mirage, a set of Magic cards with African fantasy elements, came out. “That was eye-opening for me,” she told me. “It wasn’t a typical, Tolkien-esque vision of what a fantasy world should be.” Her mom and dad thought it was a waste of time, so she kept her cards hidden in a shoebox under her bed. “I’d lay them out and make decks at night,” she recalled, “when my parents were asleep.”

In the game, players were fashioned as “planeswalkers,” who cast spells and travel between planes of existence. The spells themselves were the cards, which could be purchased in places like bookstores and comic-book shops. It soon became a common sight to see kids ripping off the wrappers of Magic packs, and—as a blend of chemicals from the bouquet of ink and finish wafted up—taking account of what they possessed of the two hundred and ninety-five cards that Garfield and his colleagues had conceived. The cards had names like “Bad Moon” and “Celestial Prism” and featured beasts such as “Giant Spider” and “Gray Ogre.” Garfield devised a set of rules about how many cards to draw each turn, how to charge up magical powers, or “mana,” from so-called land cards, and how to cast spell cards and summon creatures to bring an opponent’s life total from twenty points to zero. Flowing through this was a strain of wild invention: the cards often gave players the license to bend or change the rules.

To change more rules, you needed to buy more cards. Many of the most powerful cards were rarely printed, which drove fans to crack open even more packs. By November of 1993, under the headline “Professor’s Game Casts Magic Spell on Players,” the Seattle Times reported that ten million cards had been sold in a few months. “I’ve wasted—no not wasted—I’ve used all my money just buying Magic cards,” an eleven-year-old boy named Jake told the Washington Post. He carried his deck around with him everywhere he went in case a game broke out. By 1997, Magic: The Gathering was so successful that Wizards of the Coast acquired Dungeons & Dragons. Newsweek noted that Wizards had sold two billion cards. A game like Magic, Garfield told the reporter, could “take over your personal operating system, like a virus.”

Since its beginning, Magic has spread to more than thirty million human operating systems. Today, those humans play with some combination of the game’s eighteen thousand unique cards, in eleven different languages. Magic YouTube shows like Geek & Sundry’s “Spellslingers” regularly draw hundreds of thousands of views. In a video on a channel called “openboosters,” a man opens a very old pack of cards and his gloved hands begin to tremble when he finds a “Black Lotus,” the most coveted card in the game. That video has six million views. Last year, I spoke to a game-store owner named Jon Freeman about the cultural resurgence of Dungeons & Dragons, a fantasy mainstay with a much higher profile than Magic’s, and he told me that, in his store, “if you want to look at the sheer number of people who are playing games, Magic far exceeds all of the above.”