Grimdark
Grimdark is a subgenre of speculative fiction with a  tone, style, or setting that is particularly dystopian, amoral, or violent. The term is inspired by the tagline of the tabletop strategy game Warhammer 40,000: "In the grim darkness of the far future there is only WAR."

Definitions
Several attempts to define "grimdark" have been made:
Adam Roberts described it as fiction "where nobody is honourable and Might is Right", and as "the standard way of referring to fantasies that turn their backs on the more uplifting, Pre-Raphaelite visions of idealized medievaliana, and instead stress how nasty, brutish, short and, er, dark life back then 'really' was". But he noted that grimdark has little to do with re-imagining an actual historic reality and more with conveying the sense that our own world is a "cynical, disillusioned, ultraviolent place".  
Genevieve Valentine called grimdark a "shorthand for a subgenre of fantasy fiction that claims to trade on the psychology of those sword-toting heroes, and the dark realism behind all those kingdom politics". 
In the view of Jared Shurin, grimdark fantasy has three key components: a grim and dark tone, a sense of realism (for example, monarchs are useless and heroes are flawed), and the agency of the protagonists: whereas in high fantasy everything is predestined and the tension revolves around how the heroes defeat the Dark Lord, grimdark is "fantasy protestantism": characters have to choose between good and evil, and are "just as lost as we are". 
Liz Bourke considered grimdark's defining characteristic to be "a retreat into the valorisation of darkness for darkness's sake, into a kind of nihilism that portrays right action ... as either impossible or futile". This, according to her, has the effect of absolving the protagonists as well as the reader from moral responsibility.

Whether grimdark is a genre in its own right or an unhelpful label has also been discussed. Valentine noted that while some writers have embraced the term, others see it as "a dismissive term for fantasy that's dismantling tropes, a stamp unfairly applied."

Use in fantasy fiction
According to Roberts, grimdark is a modern form of an "anti-Tolkien" approach to fantasy writing. The most successful and popular grimdark fantasy, George R. R. Martin's A Song of Ice and Fire, is characterized in Roberts's view by its reaction to Tolkien's idealism even though it owes a lot to Tolkien's work.  

Writing for The Guardian in 2016, Damien Walter summarized what he considered grimdark's "domination" of the fantasy genre as "bigger swords, more fighting, bloodier blood, more fighting, axes, more fighting", and, he surmised, a "commercial imperative to win adolescent male readers". He saw this trend as being in opposition to "a truly epic and more emotionally nuanced kind of fantasy" that delivered storytelling instead of only fights.

Authors whose works have been described as grimdark tend to be people writing from the 1990s onward. They include – apart from Martin – Glen Cook, Joe Abercrombie, Richard K. Morgan, and Mark Lawrence. In a broader sense, the "pervasively gritty, bleak, pessimistic, or nihilistic view of the world" characteristic of grimdark fiction is found in broad swathes of popular fiction from the 2000s, including in such media franchises as Batman, Breaking Bad, and The Walking Dead.

Contrasting genres and trends
In 2017, the writer Alexandra Rowland proposed that the "opposite of grimdark" is "hopepunk", a literary trend that emphasizes what grimdark rejects: the importance of hope and the sense that ideals are worth fighting for despite adversity. Another style proposed to provide a contrast to grimdark is "noblebright", which takes as its premise that not only are there good fights worth fighting, but that they are also winnable and result in a happy ending.