/* Cold brushed steel with a sodium-orange accent, like the Box and the lab. */
:root > * {
  --md-primary-fg-color: #2b2f33;
  --md-primary-fg-color--light: #3a4046;
  --md-primary-fg-color--dark: #1d2023;
}

[data-md-color-scheme="slate"] {
  --md-default-bg-color: #16181a;
  --md-typeset-a-color: #f0913a;
}

/* Minecraft textures are 16x16: keep the pixels sharp. */
.md-header__button.md-logo img,
.md-typeset img.pixel {
  image-rendering: pixelated;
}

.mw-hero {
  position: relative;
  margin: 0 0 1.5rem;
  border-radius: 6px;
  overflow: hidden;
}

.mw-hero img {
  max-height: 420px;
  object-fit: cover;
  display: block;
  width: 100%;
}

.mw-hero .mw-hero__text {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.5rem 1.8rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  color: #e8e3da;
}

.mw-hero h1 {
  margin: 0 0 0.3rem;
  color: #fff;
  font-weight: 700;
}

.mw-hero p {
  margin: 0;
  font-size: 0.85rem;
}

/* ---- Icons, recipes and galleries (mwiki/macros.py) ---------------------------------------------------- */
.mw-icon, .mw-slot-icon, .mw-card-icon, .mw-cell-icon {
  image-rendering: pixelated;
}

.mw-item {
  white-space: nowrap;
}

.mw-icon {
  width: 1.4em;
  height: 1.4em;
  vertical-align: -0.35em;
  margin-right: 0.2em;
}

.mw-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  background: #4a4f55;
  color: #e8e3da;
  font-size: 0.6em;
  font-weight: 700;
}

.mw-recipe {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: 1rem 0;
  padding: 0.7rem 0.9rem;
  background: #8b8b8b22;
  border: 1px solid #8b8b8b55;
  border-radius: 6px;
  width: fit-content;
}

.mw-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), 2.6rem);
  gap: 3px;
}

.mw-row {
  display: flex;
  gap: 3px;
}

.mw-slot {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  background: #8b8b8b;
  box-shadow: inset 2px 2px #373737, inset -2px -2px #ffffff;
}

.mw-slot-icon {
  width: 2rem;
  height: 2rem;
}

.mw-slot .mw-tile {
  width: 2rem;
  height: 2rem;
  font-size: 0.65rem;
}

.mw-count {
  position: absolute;
  right: 2px;
  bottom: 0;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-shadow: 1px 1px #3f3f3f;
}

.mw-arrow {
  font-size: 1.4rem;
  opacity: 0.7;
}

.mw-recipe-caption {
  flex-basis: 100%;
  font-size: 0.75rem;
}

.mw-station {
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: #f0913a22;
}

.mw-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.8rem 0;
}

.mw-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 6.2rem;
  padding: 0.5rem 0.3rem;
  border-radius: 6px;
  background: #8b8b8b1c;
  border: 1px solid #8b8b8b40;
  text-align: center;
  font-size: 0.68rem;
  line-height: 1.2;
}

.mw-card-icon {
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.3rem;
}

.mw-card .mw-tile {
  width: 3rem;
  height: 3rem;
  font-size: 0.9rem;
}

/* ---- Screenshots ------------------------------------------------------------------------------------------ */
.mw-shot {
  margin: 1.2rem 0;
}

.mw-shot img {
  border-radius: 6px;
}

.mw-shot figcaption {
  font-size: 0.75rem;
  opacity: 0.8;
}

.mw-shot__box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  aspect-ratio: 16 / 9;
  max-height: 300px;
  width: 100%;
  border: 2px dashed #f0913a88;
  border-radius: 6px;
  background: repeating-linear-gradient(45deg, #f0913a0d 0 12px, transparent 12px 24px);
  color: #f0913a;
  font-weight: 700;
}

.mw-shot__box code {
  font-weight: 400;
  font-size: 0.7rem;
}

/* ---- The Box diagram -------------------------------------------------------------------------------------- */
.mw-boxdiagram {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 0 0.4rem;
}

.mw-layer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
}

.mw-layer-grid {
  display: grid;
  grid-template-columns: repeat(5, 1.6rem);
  gap: 2px;
}

.mw-cell {
  display: inline-block;
  width: 1.6rem;
  height: 1.6rem;
}

.mw-cell-icon {
  width: 100%;
  height: 100%;
}

.mw-cell--air {
  border: 1px dashed #8b8b8b88;
  border-radius: 2px;
}

.mw-cell--key {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
}

.mw-legend {
  font-size: 0.75rem;
}

/* ---- World pages and the world list ------------------------------------------------------------------------ */
.mw-lede {
  font-size: 1.05rem;
  font-style: italic;
  opacity: 0.85;
}

.mw-badge {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  border-radius: 1rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  background: #555;
}

.mw-badge--calm { background: #3f8f7a; }
.mw-badge--physics { background: #5b6bc4; }
.mw-badge--hostile { background: #b23b3b; }
.mw-badge--ruin { background: #7b6a55; }
.mw-badge--civilization { background: #c08a2e; }
.mw-badge--light { background: #c7a92a; }
.mw-badge--time { background: #8a5bc4; }
.mw-badge--senses { background: #c45b9b; }
.mw-badge--reflection { background: #5b8fc4; }

.mw-worlds {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.6rem;
  margin: 0.8rem 0 1.5rem;
}

.mw-world {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid #8b8b8b40;
  border-radius: 6px;
  color: inherit !important;
  font-size: 0.72rem;
  line-height: 1.35;
}

.mw-world:hover {
  border-color: #f0913a;
}

.mw-world strong {
  font-size: 0.85rem;
}

.mw-guide-tag {
  align-self: flex-start;
  padding: 0 0.4rem;
  border-radius: 1rem;
  background: #f0913a;
  color: #111;
  font-size: 0.6rem;
  font-weight: 700;
}

.mw-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.8rem;
}

.mw-step {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid #8b8b8b40;
  border-radius: 6px;
}

.mw-step .mw-gallery {
  margin: 0 0 0.3rem;
}

.mw-step .mw-card {
  width: 4.2rem;
  font-size: 0.55rem;
}

.mw-step span {
  font-size: 0.75rem;
  opacity: 0.85;
}

.md-typeset table.mw-glance {
  float: right;
  max-width: 18rem;
  margin: 0 0 1rem 1.2rem;
  font-size: 0.7rem;
  border: 1px solid #8b8b8b55;
  border-radius: 6px;
}

.md-typeset table.mw-glance caption {
  padding: 0.3rem;
  font-weight: 700;
  background: #f0913a22;
}

.md-typeset table.mw-glance th {
  text-align: left;
  white-space: nowrap;
  opacity: 0.8;
}

@media (max-width: 60em) {
  .md-typeset table.mw-glance {
    float: none;
    margin: 0 0 1rem;
  }
}

/* 3D viewers (assets/viewer.js) */
.mw-viewer {
  clear: both;
  margin: 1rem 0 1.5rem;
  border: 1px solid #8b8b8b55;
  border-radius: 8px;
  background: var(--md-code-bg-color);
  overflow: hidden;
}

.mw-viewer-loading,
.mw-viewer-error {
  padding: 2rem 1rem;
  text-align: center;
  opacity: 0.7;
}

.mw-stage {
  position: relative;
  height: 26rem;
  background: radial-gradient(ellipse at 50% 35%, #3a434b 0%, #1b1f23 75%);
  touch-action: none;
  cursor: grab;
}

.mw-stage:active {
  cursor: grabbing;
}

.mw-stage canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.mw-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.5rem;
  border-bottom: 1px solid #8b8b8b33;
}

.mw-tabs button,
.mw-toggle,
.mw-swatch,
.mw-bird-pick {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.mw-tabs button,
.mw-toggle {
  padding: 0.25rem 0.6rem;
  font-size: 0.68rem;
  font-weight: 600;
  border: 1px solid #8b8b8b55;
  border-radius: 4px;
  background: transparent;
}

.mw-tabs button[aria-selected="true"],
.mw-toggle[aria-pressed="true"] {
  background: #e07a1f;
  border-color: #e07a1f;
  color: #1a1208;
}

.mw-panel,
.mw-bird-view > .mw-row,
.mw-bird-card {
  padding: 0.6rem 0.8rem;
}

.mw-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.mw-field {
  display: grid;
  gap: 0.15rem;
  font-size: 0.68rem;
}

.mw-field > span {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
}

.mw-field select {
  font: inherit;
  color: inherit;
  padding: 0.2rem;
  border: 1px solid #8b8b8b55;
  border-radius: 4px;
  background: var(--md-default-bg-color);
}

.mw-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.mw-swatch {
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  background: conic-gradient(var(--a) 0 50%, var(--b) 50% 85%, var(--c) 85% 100%);
}

.mw-swatch[aria-pressed="true"] {
  border-color: #e07a1f;
  box-shadow: 0 0 0 2px var(--md-default-bg-color) inset;
}

.mw-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.mw-hint {
  font-size: 0.62rem;
  opacity: 0.7;
}

.mw-part-note {
  margin: 0.5rem 0 0;
  font-size: 0.7rem;
}

.md-typeset .mw-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
  gap: 0.4rem;
  margin: 0 0 0.6rem;
}

.md-typeset .mw-stats dt {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.7;
}

.md-typeset .mw-stats dd {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
}

/* The birds page: the list beside the viewer, the viewer above its log page on narrow screens. */
.mw-viewer--birds {
  display: grid;
  grid-template-columns: 15rem 1fr;
  min-height: 34rem;
}

.mw-bird-side {
  display: flex;
  flex-direction: column;
  border-right: 1px solid #8b8b8b33;
  max-height: 46rem;
}

.mw-search {
  margin: 0.5rem;
  padding: 0.35rem 0.5rem;
  font: inherit;
  font-size: 0.7rem;
  color: inherit;
  border: 1px solid #8b8b8b55;
  border-radius: 4px;
  background: var(--md-default-bg-color);
}

.mw-bird-list {
  overflow-y: auto;
  padding: 0 0.4rem 0.5rem;
}

.md-typeset .mw-bird-world {
  margin: 0.6rem 0.3rem 0.2rem;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e07a1f;
}

.mw-bird-pick {
  display: block;
  width: 100%;
  padding: 0.2rem 0.4rem;
  text-align: left;
  font-size: 0.7rem;
  border: 1px solid transparent;
  border-radius: 4px;
  background: none;
}

.mw-bird-pick small {
  display: block;
  font-size: 0.58rem;
  opacity: 0.65;
}

.mw-bird-pick:hover,
.mw-bird-pick[aria-current="true"] {
  background: #e07a1f22;
  border-color: #e07a1f66;
}

.mw-bird-view {
  min-width: 0;
}

.mw-stage--bird {
  height: 24rem;
}

.md-typeset .mw-bird-card h3 {
  margin: 0;
}

.md-typeset .mw-latin {
  margin: 0;
  font-style: italic;
  opacity: 0.75;
}

.md-typeset .mw-bird-tags {
  margin: 0.3rem 0 0.5rem;
  font-size: 0.7rem;
}

.mw-danger {
  margin-left: 0.5rem;
  padding: 0.05rem 0.4rem;
  font-size: 0.6rem;
  font-weight: 700;
  border-radius: 3px;
  background: #c9302e;
  color: #fff;
}

.md-typeset .mw-bird-text dt {
  font-weight: 700;
  margin-top: 0.4rem;
}

.md-typeset .mw-bird-text dd {
  margin-left: 0;
}

@media (max-width: 45em) {
  .mw-viewer--birds {
    grid-template-columns: 1fr;
  }

  .mw-bird-side {
    max-height: 14rem;
    border-right: none;
    border-bottom: 1px solid #8b8b8b33;
  }

  .mw-stage,
  .mw-stage--bird {
    height: 20rem;
  }
}
