:root {
  --font: 'Poppins';
  --border-radius: 5px;

  --p-white: #dddddd;
  --p-brown: #33131b;
  --p-brown2: #301118;
  --p-red: #c81f32;
  --p-blue: #486683;
  --p-maroon: #882c36;
  --p-purple: #3b244e;
  --p-yellow: #c78747;
  --p-black: #130b19;
  /* --p-gray: #5a5150; */
  /* --p-gray: #433634; */
  /* --p-gray: #352b2f; */
  /* --p-gray: #311820; */
  --p-gray: #3b282e;

  --bg: var(--p-black);
  --page-bg: var(--p-brown);
  --accent-bg: var(--p-purple);
  --text: var(--p-white);
  --border: var(--p-maroon);
  --accent: var(--p-yellow);
  --table-bg: var(--p-brown2);
  --table-accent: var(--p-gray);
}

/* reset box-sizing */
html {
  box-sizing: border-box;
}
*, *:before, *:after {
  box-sizing: inherit;
}

html {
  font-family: var(--font);
}

body {
  color: var(--text);
  background-color: var(--bg);
  font-size: 1.25rem;
  display: grid;
  grid-template-columns: 1fr min(70rem, 100%) 1fr;
  margin: 0;
}

body > * {
  grid-column: 2;
}

body > header {
  text-align: center;
  padding: 0 0rem 2rem 0rem;
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
}

main {
  padding: 0.5rem min(2rem, 4%) 2rem min(2rem, 4%);
  background-color: var(--page-bg);
  border-radius: 4px;
}

h2 {
  font-size: 2.2rem;
}
h2:not(:first-child) {
  margin-top: 4rem;
}

h3 {
  font-size: 1.5rem;
}
h3:not(:first-child) {
  margin-top: 3rem;
}

hr {
  color: var(--border);
}

body > footer {
  margin-top: 4rem;
  padding: 2rem 1rem 1.5rem 1rem;
  color: var(--text);
  font-size: 0.9rem;
  text-align: center;
  border-top: 1px solid var(--border);
}

a, a:visited {
  color: var(--accent);
}

a:hover {
  text-decoration: none;
}

header nav {
  font-size: 1rem;
  padding: 1rem 0 1rem 0;
}

header nav > ul {
  display: flex;
  flex-wrap: wrap;
  align-content: space-around;
  align-items: center;
  justify-content: center;
  row-gap: 0.8rem;

  list-style-type: none;
  margin: 0;
  padding: 0;
}

header nav ul li {
  display: inline-block;
}

header nav :is(a, a:visited, button) {
  display: inline-block;
  padding: 0.3rem 1rem;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--bg);
  text-decoration: none;
  font: inherit; /* needed for buttons for some reason? */
  min-width: 7.5rem;
}

header nav :is(a, button):hover {
  border-color: var(--accent);
  color: var(--accent);
  cursor: pointer;
}

header nav .nav-with-dropdown {
  position: relative;
}
header nav .nav-with-dropdown ul {
  position: absolute;
  list-style-type: none;
  margin: 0;
  padding: 0;
  z-index: 100;
}
header nav .nav-with-dropdown ul li {
  width: 100%;
}
header nav .nav-with-dropdown ul li a {
  margin: 0;
  width: 100%;
}
header nav .nav-with-dropdown:not(.nav-with-dropdown-open) ul {
  display: none;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
  font-size: 1.05rem;
}

table > caption {
  font-weight: bold;
  margin-bottom: 0.5rem;
}

td, th {
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
  text-align: start;
  padding: 0.5rem;
}
td:nth-last-child(1 of :not(.table-row-col-hidden)), th:nth-last-child(1 of :not(.table-row-col-hidden)) {
  border-right: 1px solid var(--border);
}
thead tr:first-child td, thead tr:first-child th {
  border-top: 1px solid var(--border);
}

th, thead td {
  background-color: var(--accent-bg);
  font-weight: bold;
}

tr:nth-child(odd of :not(.table-row-col-hidden)) {
  background-color: var(--table-bg);
}

tr:nth-child(even of :not(.table-row-col-hidden)) {
  background-color: var(--table-accent);
}

thead > tr:first-child {
  background-color: var(--accent-bg);
}

dt {
  font-weight: bold;
}

blockquote {
  font-style: italic;
}

fieldset {
  border: none;
}
legend {
  margin-bottom: 0.7rem;
  float: left;
  font-weight: bold;
}

input[type="checkbox"] {
  accent-color: var(--border);
}

summary {
  margin-bottom: 1rem;
}

mark {
  --mark-padding: 0.3rem;
  padding-left: var(--mark-padding);
  padding-right: var(--mark-padding);
}

#banner-image-a {
  flex: 1;
  width: 100%;
  min-width: 20rem;
  max-width: 30rem;
}
#banner-image-a img {
  max-width: 100%;
}

#toc {
  background-color: var(--accent-bg);
  padding: 0.1rem 1rem 0.2rem 1rem;
  width: fit-content;
  border-radius: 6px;
}
#toc h3 {
  margin-top: 0.8rem;
}
#toc ul {
  list-style-type: "-";
  padding-left: 0.7rem;
}
#toc ul ul {
  padding-left: 1.6rem;
}
#toc ul > li {
  padding-left: 0.4rem;
}

#kisses-graph {
  background-color: white;
}

.sam-cans-img, .sam-shirts-img, .battlemaps-img, .character-card-img {
  width: 400px;
  max-width: 100%;
  border-radius: 4px;
}
.character-card-data-img {
  width: 300px;
  max-width: 100%;
  border-radius: 4px;
}

.archivist-signature {
  width: 15rem;
}

.page-list {
  list-style-type: none;
}
.page-list li {
  margin-bottom: 0.3rem;
}
.character-page-list, .episode-page-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;

  list-style-type: none;
  padding-left: 0;
}
:is(.character-page-list, .episode-page-list) figure {
  margin: 0;
  width: min-content;
}
:is(.character-page-list, .episode-page-list) img {
  width: 15rem;
}
:is(.character-page-list, .episode-page-list) figcaption {
  text-align: center;
  font-size: 0.9em;
}
@media only screen and (max-width: 720px) {
  :is(.character-page-list, .episode-page-list) :is(li, figure, img) {
    width: 100%;
  }
}
.character-page-credit {
  font-size: 0.9em;
  font-style: italic;
  margin-top: 3rem;
  text-align: center;
}

#data-type-page-contents {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.data-type-grouping {
  flex: 1 1 auto;
  background-color: var(--accent-bg);
  padding: 0.5rem 1rem 0.7rem 1rem;
  border-radius: 4px;
}
.data-type-grouping ul {
  padding-left: 0;
}
.data-type-grouping ul > li {
  margin-left: 2rem;
}
.dtg-inventory {
  max-width: 22rem;
}
@media only screen and (max-width: 720px) {
  .dtg-inventory {
    max-width: 100%;
  }
}

.visually-hidden {
  position: absolute !important;
  top: -9999px !important;
  left: -9999px !important;
}

.air-date {
  font-size: 0.9em;
}

.article-date {
  font-size: 0.9em;
  font-style: italic;
  margin-top: -1.5rem;
  margin-bottom: 2.2rem;
}

.image-gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
}

.attribution {
  font-size: 0.9em;
  font-style: italic;
}

magic-table {
  display: block;
}
.data-table {
  margin: 1.5rem 0;
}
.data-table thead {
  position: sticky;
  top: 0px;
}
@media only screen and (max-width: 720px) {
  .data-table {
    overflow-x: auto;
  }
}
.data-table.data-table-fully-scrollable {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 40rem;
}
@media only screen and (max-width: 720px) {
  .data-table.data-table-fully-scrollable {
    overflow-y: visible;
    max-height: none;
  }
}

#toc-image-pair {
  display: flex;
  flex-wrap: wrap-reverse;
  align-items: center;
  justify-content: flex-start;
}
#toc-image-pair.character-toc-image-pair {
  column-gap: 5rem;
}
#toc-image-pair.episode-toc-image-pair {
  column-gap: 2rem;
}
#toc-image-pair figure {
  margin-left: 0;
  margin-right: 0;
}
#toc-image-pair figcaption {
  text-align: center;
  font-style: italic;
  font-size: 0.9em;
}
#toc-image-pair img {
  max-width: 100%;
}
#toc-image-pair.character-toc-image-pair img {
  width: 30rem;
}
#toc-image-pair.episode-toc-image-pair img {
  margin-bottom: 1rem;
  width: 35rem;
}

#fcg-coin {
  --scale-factor: 2;
  --frame-rate: 0.06s;
  --frame-width: calc(var(--spritesheet-width) / var(--num-frames));
  --scaled-frame-width: calc(var(--frame-width) / var(--scale-factor));
  --scaled-spritesheet-width: calc(var(--spritesheet-width) / var(--scale-factor));
  --scaled-spritesheet-height: calc(var(--spritesheet-height) / var(--scale-factor));

  width: var(--scaled-frame-width);
  height: var(--scaled-spritesheet-height);

  background-size: var(--scaled-spritesheet-width) var(--scaled-spritesheet-height);
  animation: anim calc(var(--num-frames) * var(--frame-rate)) steps(var(--num-frames)) paused;

  cursor: pointer;

  /* get rid of button styles */
  background-color: transparent;
  color: inherit;
  border: none;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
#fcg-coin.fcg-coin-heads {
  --num-frames: 40;
  --spritesheet-width: 12000px;
  --spritesheet-height: 1399px;

  background-image: url('/img/fcg-coin/heads.png');
}
#fcg-coin.fcg-coin-tails {
  --num-frames: 63;
  --spritesheet-width: 18900px;
  --spritesheet-height: 1399px;

  background-image: url('/img/fcg-coin/tails.png');
}
@keyframes anim {
  100% {
    background-position: calc(-1 * var(--scaled-spritesheet-width));
  }
}

#article-container {
  width: 40em;
  max-width: 100%;
  font-size: 1.15rem;
}

#expand-collapse-buttons {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}
#expand-collapse-buttons > button {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  color: var(--text);
  padding: 0.3rem 0.8rem 0.3rem 0.8rem;
  margin-right: 0.7rem;
  margin-bottom: 0.7rem;
  font: inherit;
}
#expand-collapse-buttons > button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
#expand-collapse-buttons .expand-collapse-button-symbol {
  margin-right: 0.5rem;
}
.collapsible-heading-button {
  display: flex;
  align-items: stretch;
  background: none;
  color: inherit;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.section-expansion-marker {
  margin-right: 0.7rem;
  background-color: var(--text);
  width: 1em;
  min-width: 1em;
  mask-size: 1em;
  -webkit-mask-size: 1em;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-position: center;
}
.data-heading.heading-collapsed .section-expansion-marker {
  mask-image: url(/img/marker-collapsed.svg);
  -webkit-mask-image: url(/img/marker-collapsed.svg);
}
.data-heading:not(.heading-collapsed) .section-expansion-marker {
  mask-image: url(/img/marker-expanded.svg);
  -webkit-mask-image: url(/img/marker-expanded.svg);
}
.collapsible-section.section-collapsed {
  display: none;
}
h3.data-heading {
  margin-top: 1rem;
  margin-bottom: 1rem;
}
.heading-link-container {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  column-gap: 1rem;
}
.heading-link-container .heading-link {
  font-size: 0.8em;
}
@media only screen and (max-width: 720px) {
  .heading-link-container {
    flex-wrap: wrap;
  }
  .heading-link-container .data-heading {
    width: 100%;
  }
}

#intro-paragraph {
  margin-bottom: 2rem;
}

#episode-navigation {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  row-gap: 0.4rem;
  margin-bottom: 2rem;
  font-size: 0.9em;
}
#episode-navigation.first-episode-navigation {
  justify-content: flex-end;
}
#episode-navigation.last-episode-navigation {
  justify-content: flex-start;
}
#episode-navigation > div {
  background-color: var(--accent-bg);
  padding: 0.7rem 1rem 0.7rem 1rem;
  border-radius: 4px;
}

.font-style-bold {
  font-weight: bold;
}
.font-style-italic {
  font-style: italic;
}
.font-style-underline {
  text-decoration: underline;
}

.table-row-col-hidden {
  display: none;
}
.element-hidden {
  display: none;
}

.level-ups-checkboxes-set {
  display: flex;
  align-items: flex-start;
  gap: 1.3rem;
  overflow-x: auto;
}
.level-ups-checkboxes, #character-card-checkboxes {
  background-color: var(--accent-bg);
  padding: 0.5rem 1rem 0.7rem 1rem;
  border-radius: 4px;
  font-size: 1.1rem;
  min-width: fit-content;
}
#character-card-checkboxes {
  width: fit-content;
}
.level-ups-checkboxes ol {
  display: grid;
  grid-auto-columns: max-content;
  grid-auto-flow: column;
  column-gap: 0.7rem;
  row-gap: 0.3rem;
  list-style-type: none;
  margin-top: 0;
  margin-bottom: 0;
  padding-left: 0;
}
.level-ups-checkboxes-rows ol {
  grid-template-rows: repeat(4, 1fr);
}
.level-ups-checkboxes-columns ol {
  grid-template-rows: repeat(10, 1fr);
}
#character-card-checkboxes ol {
  display: flex;
  flex-wrap: wrap;
  column-gap: 0.7rem;
  row-gap: 0.3rem;
  list-style-type: none;
  margin-top: 0;
  margin-bottom: 0;
  padding-left: 0;
}
.level-ups-checkbox-buttons, #character-card-checkbox-buttons {
  clear: both;
  margin-top: 0.3rem;
  margin-bottom: 0.3rem;
}
:is(.level-ups-checkbox-buttons, #character-card-checkbox-buttons) > button {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  color: var(--text);
  padding: 0.1rem 0.4rem 0.1rem 0.4rem;
  margin-right: 0.7rem;
  margin-bottom: 0.7rem;
  font: inherit;
}
:is(.level-ups-checkbox-buttons, #character-card-checkbox-buttons) > button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.level-ups-column-options-container > summary {
  color: var(--accent);
  cursor: pointer;
}
.level-ups-column-options-container > summary > span {
  text-decoration: underline;
}

#character-card-sections h4 {
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.4rem;
  margin-bottom: 0.4rem;
}
#character-card-sections .image-gallery {
  margin: 0;
}

.section-flex {
  display: flex;
  flex-wrap: wrap;
  column-gap: 1rem;
}

/* footnotes */
a.footnote-ref {
  vertical-align: super;
  font-size: 0.6em;
  margin-left: 2px;
  text-decoration: underline;
}
.footnote-container :target {
  background: var(--accent-bg);
}

.level-analysis-class {
  font-style: italic;
}
.level-analysis-stats {
  display: grid;
  grid-template-columns: max-content auto;
  column-gap: 1rem;
}
.level-analysis-stats dt {
  grid-column-start: 1;
}
.level-analysis-stats dt::after {
  content: ':';
}
.level-analysis-stats dd {
  grid-column-start: 2;
  margin-left: 0;
}

/* Table-specific styling */
.table-level-ups {
  font-size: 0.95rem;
}
.table-level-ups td p {
  --table-level-ups-p-margin: 0;
  margin-top: var(--table-level-ups-p-margin);
  margin-bottom: var(--table-level-ups-p-margin);
}
.table-level-ups :is(th, td).column-stats {
  white-space: nowrap;
}
.table-level-ups div.column-notes {
  width: 10rem;
  max-width: fit-content;
}
.table-level-ups div:is(
  .column-new-proficiencies,
  .column-other-new-blood-hunter-features-and-traits,
  .column-gnome-features-and-traits,
  .column-other-new-sorcerer-features-and-traits,
  .column-other-new-warlock-features-and-traits,
  .column-hollow-one-features-and-traits,
  .column-human-variant-features-and-traits,
  .column-other-new-cleric-features-and-traits,
  .column-aeormaton-warforged-features-and-traits,
  .column-other-new-paladin-features-and-traits,
  .column-other-new-bard-features-and-traits,
  .column-minotaur-features-and-traits,
  .column-other-new-rogue-features-and-traits,
  .column-other-new-druid-features-and-traits,
  .column-faun-satyr-features-and-traits,
  .column-other-new-fighter-features-and-traits,
  .column-halfling-features-and-traits,
  .column-other-new-barbarian-features-and-traits,
  .column-earth-genasi-features-and-traits,
  .column-air-genasi-features-and-traits,
  .column-other-new-features,
  .column-other-features-and-traits,
) {
  width: 10rem;
  max-width: fit-content;
}
.table-level-ups div:is(.column-spells-known, .column-wild-shape) {
  width: 8rem;
  max-width: fit-content;
}
.table-level-ups div:is(.column-channel-divinity, .column-maneuvers) {
  width: 9rem;
  max-width: fit-content;
}
.table-level-ups div.column-cantrips-known {
  width: 5rem;
  max-width: fit-content;
}

#fcg-highlights-paragraphs-coin-pair {
  display: grid;
  grid-template-columns: auto auto;
  gap: 4rem;
}
#fcg-highlights-coin-container {
  align-self: end;
}
.fcg-highlights-worldview-figure p {
  margin-top: 0;
  margin-bottom: 0;
  --indent-size: 1rem;
  text-indent: calc(-1 * var(--indent-size));
  padding-left: var(--indent-size);
}
@media only screen and (max-width: 720px) {
  #fcg-highlights-paragraphs-coin-pair {
    display: block;
    position: relative;
  }
  #fcg-highlights-coin-container {
    position: absolute;
    bottom: -10rem;
  }
  #fcg-highlights-paragraphs {
    margin-bottom: 12rem;
  }
}

#highlights-91-image-stat-flex {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}
#highlights-91-otohan-img {
  text-align: center;
  font-style: italic;
  font-size: 0.9em;
}
#highlights-91-otohan-img img {
  width: 20rem;
  max-width: 100%;
}
#highlights-91-stats-dl {
  flex: 1;
}

#highlight-118-table-container {
  overflow-x: auto;
}

.downfall-decoding-table > tbody td:first-child {
  font-family: monospace, monospace;
}

:is(.note-warn, .note-info) {
  margin-bottom: 2rem;
}
.note-warn {
  font-weight: bold;
}
.note-info {
  font-size: 0.9em;
}

.level-14-analysis-outro, .wthhl-outro {
  margin-top: 3rem;
}

.wthhl-img {
  max-width: 100%;
}

.ko-death-row:target td {
  --ko-death-row-target-border: 2px solid var(--accent);
  border-top: var(--ko-death-row-target-border);
  border-bottom: var(--ko-death-row-target-border);
}
.ko-death-row:target td:first-child {
  border-left: var(--ko-death-row-target-border);
}
.ko-death-row:target td:last-child {
  border-right: var(--ko-death-row-target-border);
}

.hp-over-time-graph-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-evenly;
  align-items: center;
  row-gap: 1rem;
  width: 130%;
}
@media only screen and (max-width: 950px) {
  .hp-over-time-graph-container {
    width: 100%;
  }
}
.hp-over-time-graph-container img{
  width: 400px;
  max-width: 100%;
}
.hp-over-time-graph-container figure {
  margin: 0;
}

.rounded-image {
  border-radius: 4px;
}

.multi-table-container {
  display: flex;
  flex-wrap: wrap;
  column-gap: 3rem;
  row-gap: 1rem;
}

.multi-details-container > details:not(:last-child) {
  margin-bottom: 0.3rem;
}
.multi-details-container > details > details {
  margin-left: 1.5rem;
}

.summary-details > summary {
  margin-bottom: 0;
  background-color: var(--accent-bg);
  border-radius: var(--border-radius);
  padding: 0 0.4rem;
}
.summary-details > summary:hover {
  color: var(--accent);
  cursor: pointer;
}

ul.data-pivot-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;

  padding-left: 0;
  list-style-type: none;
}
ul.data-pivot-list li {
  flex: 1 1 auto;
  background-color: var(--accent-bg);
  padding: 0.5rem 1rem 0.7rem 1rem;
  border-radius: 4px;
  text-align: center;
}
