/* Menus, options and values of RetroArch, written in italics (*Settings → Video*): shown as on-screen labels */
:root {
  --ui-label-fg: #37474f;
  --ui-label-bg: #eceff1;
}
[data-md-color-scheme="slate"] {
  --ui-label-fg: #eceff1;
  --ui-label-bg: #37474f;
}
.md-typeset em {
  font-style: normal;
  font-weight: 600;
  color: var(--ui-label-fg);
  background-color: var(--ui-label-bg);
  padding: 0.05em 0.3em;
  border-radius: 0.25em;
  /* A long menu path may wrap: each line keeps its background and rounded corners */
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* The values: of the tables' "Value" column (see javascripts/values.js), and inside a sentence, written
   *value*{.value}. A dark green label, apart from the grey menus */
:root {
  --ui-value-fg: #1b5e20;
  --ui-value-bg: #e8f5e9;
}
[data-md-color-scheme="slate"] {
  --ui-value-fg: #e8f5e9;
  --ui-value-bg: #1b5e20;
}
.md-typeset .ui-value,
.md-typeset em.value {
  font-style: normal;
  font-weight: 600;
  color: var(--ui-value-fg);
  background-color: var(--ui-value-bg);
  padding: 0.05em 0.3em;
  border-radius: 0.25em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Every table: the header row in the theme's colour, the first column (console, core, file...) in bold */
.md-typeset table:not([class]) th {
  background-color: var(--md-primary-fg-color);
  color: var(--md-primary-bg-color);
}
.md-typeset table:not([class]) td:first-child {
  font-weight: 700;
}

/* Game lists (made by site-gen\game_lists.py): the tags of a game */
.md-typeset .tag {
  display: inline-block;
  padding: 0 0.5em;
  border-radius: 0.6em;
  font-size: 0.85em;
  white-space: nowrap;
}
.md-typeset .tag.pc { background-color: #dbe4ff; color: #2b3a8c; }
.md-typeset .tag.missing { background-color: #eceff1; color: #546e7a; }
.md-typeset .tag.other { background-color: #e6f4ea; color: #1e6b3a; }
[data-md-color-scheme="slate"] .md-typeset .tag.other { background-color: #1e6b3a; color: #e6f4ea; }
[data-md-color-scheme="slate"] .md-typeset .tag.pc { background-color: #2b3a8c; color: #dbe4ff; }
[data-md-color-scheme="slate"] .md-typeset .tag.missing { background-color: #37474f; color: #cfd8dc; }

/* Comparison tables (see javascripts/compare.js): the value most devices share in green, a different one in orange */
:root {
  --same-bg: #d8f3dc;
  --differs-bg: #ffe5c2;
}
[data-md-color-scheme="slate"] {
  --same-bg: #1f4d2c;
  --differs-bg: #5c3b10;
}
.compare td.same { background-color: var(--same-bg); }
.compare td.differs { background-color: var(--differs-bg); }

/* Buttons by console: the original controller's photo and the button diagram side by side, one above the
   other on a narrow screen */
.md-typeset .pad-pair {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}
.md-typeset .pad-pair > p {
  flex: 1 1 260px;
  margin: 0;
  text-align: center;
}
.md-typeset .pad-pair img {
  max-height: 300px;
  object-fit: contain;
}

/* Game notes: the box art of the games, in a row */
.md-typeset .boxarts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.md-typeset .boxarts img.boxart {
  height: 170px;
  width: auto;
  border-radius: 0.2rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Photos of the consoles and accessories (Consoles, Multiplayer) */
.md-typeset img.photo {
  max-height: 240px;
  width: auto;
  display: block;
  margin: 0.5rem 0 1rem;
}

/* Game lists: a picture added by hand (Own) or changed online (Changed) */
.md-typeset .tag.own {
  color: #5d4037;
  background-color: #efebe9;
}
[data-md-color-scheme="slate"] .md-typeset .tag.own {
  color: #efebe9;
  background-color: #5d4037;
}

/* A photo with its caption (Multiplayer): centred, like the caption */
.md-typeset figure img.photo {
  margin-left: auto;
  margin-right: auto;
}

/* Left menu: the site title and the section titles (Set up RetroArch, Play, Others) in blue, underlined by a
   blue line */
.md-nav--primary > .md-nav__title,
.md-nav--primary .md-nav__item--section > .md-nav__link {
  color: var(--md-primary-fg-color);
  font-weight: 700;
  border-bottom: 2px solid var(--md-primary-fg-color);
  padding-bottom: 0.2rem;
  margin-bottom: 0.3rem;
}
[data-md-color-scheme="slate"] .md-nav--primary > .md-nav__title,
[data-md-color-scheme="slate"] .md-nav--primary .md-nav__item--section > .md-nav__link {
  color: var(--md-accent-fg-color);
  border-bottom-color: var(--md-accent-fg-color);
}

/* Consoles: one card per console (photo, name, games, devices), linking to its page */
.md-typeset .console-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.8rem;
  margin: 1rem 0;
}
.md-typeset a.console-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.2rem;
  padding: 0.6rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.4rem;
  color: var(--md-default-fg-color);
  font-size: 0.75rem;
}
.md-typeset a.console-card:hover {
  border-color: var(--md-primary-fg-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.md-typeset a.console-card img {
  height: 110px;
  width: 100%;
  object-fit: contain;
  margin-bottom: 0.3rem;
}
.md-typeset a.console-card strong {
  font-size: 0.85rem;
  color: var(--md-primary-fg-color);
}

/* A button diagram on its own (Game Boy, controllers) */
.md-typeset img.pad {
  max-width: 520px;
  width: 100%;
}
