Overnight, U.S. television show “Shogun” has gone from contender to champion. On Sunday, the show set at the end of Japan's Sengoku Period received four Emmy Awards in drama, including the award for outstanding drama series, directing, outstanding lead actress and outstanding lead actor. Last week, the show received 14 Creative Arts Emmys, given for technical achievements, the most ever for a show in a single season.

The sweeping period piece is adapted from the bestselling 1975 novel of the same name by British author James Clavell, which is in turn a fictionalization of the historical events surrounding the end of the Sengoku Period (1482-1573). John Blackthorne, known as “Anjin” to the show’s Japanese characters and played by Cosmo Jarvis, is an English navigator who winds up in Japan and unwittingly falls under the protection of one of its most powerful lords, Yoshii Toranaga, played by Hiroyuki Sanada, who’s aided by his interpreter, Toda Mariko, played by Anna Sawai.

The show reportedly spent 10 years in production and is rumored to be the most expensive in the network’s history. The FX production has received critical and fan praise for its attention to detail, large Japanese cast and majority Japanese-language dialogue, and for offering a full ensemble alternative to a white savior-centered narrative.

The accolades are warranted. Aside from the gratuitous scenes of suffering and bloody heads on spikes that are now television de rigueur, “Shogun” is an incredibly crisp production and a pleasurable watch. This show’s got everything — natural light moving through shoji screens, rain falling on roofs and moss, brooms sweeping across floors, people unfolding and refolding pieces of paper.

For Japanese-speaking viewers, there’s the added drama of translations and mistranslations layered into the old-timey court honorific language and formalities of feudal Japan. The writers went out of their way to avoid orientalist pitfalls, leaning heavily in the opposite direction. The aristocratic Japanese characters are meticulously dressed and beautified, with stark and starched lines in their many layers of clothes, while Anjin is a shaggy seaman in a dirty robe whose manners and culinary tastes are repeatedly called “barbarian.”

Indeed, on and offscreen, the “Shogun” cast and crew have gone above and beyond to make sure the viewer knows: They really tried to “get things right.”

The show employed three masters of gestures just to advise actors on the movements of 16th-century Japanese lords and ladies. Perhaps the most prominent example was the lengths to which the writers went to produce the old-sounding Japanese heard on the show: The script was written first in an English-speaking writer’s room, with adjustments from one of the show’s Japanese-speaking producers; the script was then translated into modern Japanese in Tokyo; a non-English-speaking jidaigeki (period drama) playwright rewrote it into the formal Japanese spoken by the actors; finally, that dialogue was translated back into English for the subtitles.

“We’re really proud of the attention to that detail, because I hope it shows an effort to say, if we’re going to do the act of translation, we’re going to get it right and we’re going to do something that’s very special,” showrunner Justin Marks said on the show’s companion podcast.

(Although for a show so fine-tuned to language and all its implications, the script has all non-Japanese dialogue rendered as English, instead of the Portuguese that the characters are supposed to be speaking in, an odd choice that is never addressed.)

The events of the novel and show fictionalize the life of the historical Tokugawa Ieyasu (1543-1616), the founder of Japan’s last shogunate. In an entertainment landscape where a fandom can take down an entire show or franchise, this takes guts; “Shogun” producers took on the daunting task of “getting it right” with some of the loudest voices of the internet: not only fans of the bestselling novel and its first adaptation, a 1980s miniseries that first helped spark global interest in Japanese culture, but also Japanese history buffs, military wonks and nationalists of Reddit.

Still, high-budget production can only take a show so far. If visuals and costume design were enough to carry a show, “The Rings of Power,” Amazon’s attempt at a J.R.R. Tolkien adaptation, said to be the most expensive show ever made, wouldn’t be so unwatchable. When all the details and authenticity add up, they have to create an illusion of verisimilitude, a world with an internal logic that the viewer can believe in. In “Shogun,” the codified rituals around objects and movements mirror the internal codes of each of the characters — something unbreakable and also impenetrable.

Some of TV’s most memorable characters work on cryptic morality. Immortalized by Omar Little on “The Wire” (2002-08), who lived by the credo “Man’s got to have a code,” a line later repeated by the Hound on “Game of Thrones” (2011-19), these characters are bound by something the viewer has to decipher. A predictable internal code of ethics isn’t what hooks us — the power-hungry bureaucrat Ishido on “Shogun” is a bore — it’s only when the viewer has to guess at the rules that it makes for great drama.

On “Shogun,” Toranaga, “a master of trickery,” keeps his tactics and intentions close to the vest, shutting out even his closest vassals. Cracking the code of feudal Japan, where fatal rule-breaking and seppuku are as frequent as rain, becomes as difficult and mysterious as breaking the inner code of the lead character. That’s true of many of the characters, whose codes contain layered conflicts: Mariko is a high-born woman whose name has also been sullied by her treacherous father — and also she’s Catholic; likewise, Anjin arrives in Japan under a religious mandate from his queen, but soon his moral compass is sent spinning.

Much like “The Wire,” “Shogun” trades on a complex system of unspoken, unforgiving rules, a rigid hierarchy that viewers, the majority of whom are new to this world, are left to figure out. But the inscrutable moral code is only a mystery worth solving when the details of the constructed world “gotten right” are as intricate as the characters who carry them.