:root,
.light,
.rust,
.coal,
.navy,
.ayu {
  --bg: #0d1016;
  --fg: #d6dbe3;
  --links: #ff5b5b;
  --inline-code-color: #ffd8d8;
  --sidebar-active: #ff8080;
  --sidebar-bg: #11161f;
  --sidebar-fg: #c9b5ba;
  --sidebar-non-existant: #6f7786;
  --theme-popup-bg: #151b25;
  --theme-popup-border: #2b3342;
  --searchbar-bg: #151b25;
  --searchbar-fg: #f4f7fb;
  --searchbar-shadow-color: transparent;
  --searchresults-header-fg: #ff8080;
  --searchresults-border-color: #2b3342;
  --searchresults-li-bg: #151b25;
  --search-mark-bg: rgba(255, 91, 91, 0.22);
}

html, body {
  background:
    radial-gradient(circle at top left, rgba(191, 22, 41, 0.18), transparent 30%),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.05), transparent 18%),
    linear-gradient(180deg, #090c12 0%, #0d1016 100%);
}

body {
  color: var(--fg);
}

p,
li,
dd,
td,
blockquote {
  color: #d3d8df;
}

#mdbook-menu-bar,
.sidebar {
  backdrop-filter: blur(12px);
  background: rgba(12, 16, 23, 0.92);
}

.menu-title,
h1,
h2,
h3,
h4 {
  letter-spacing: 0.01em;
}

h1,
h2,
h3,
h4,
strong {
  color: #eceff4;
}

#mdbook-theme-toggle,
#mdbook-help-container {
  display: none;
}

#mdbook-menu-bar .menu-title {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

#mdbook-menu-bar .menu-title::before {
  content: "";
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: url('../assets/server-icon.png') center/contain no-repeat;
  flex: 0 0 20px;
}

.hero {
  padding: 1.45rem 1.55rem;
  border: 1px solid rgba(255, 91, 91, 0.18);
  background: linear-gradient(135deg, rgba(165, 16, 33, 0.16), rgba(18, 22, 31, 0.82));
  border-radius: 22px;
  margin-bottom: 1rem;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.banner-only {
  margin: 0 0 1rem;
}

.hero-home {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.hero-home--stack {
  display: block;
}

.hero-banner {
  display: block;
  width: 100%;
  max-width: 100%;
  border-radius: 16px;
  margin: 0;
}

.server-icon {
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  background: rgba(255,255,255,0.04);
  padding: 0.35rem;
}

.hero-copy {
  flex: 1;
}

.hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
  color: #ffb0b0;
  opacity: 0.92;
  margin: 0 0 0.55rem;
}

.hero h1 {
  margin: 0 0 0.65rem;
  font-size: 2.1rem;
  line-height: 1.08;
}

.hero .lead {
  margin: 0;
  max-width: 44rem;
  font-size: 1rem;
  line-height: 1.7;
  color: #dbe4f1;
}

.info-box {
  margin: 0.8rem 0 1.55rem;
  padding: 0.9rem 1.05rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 91, 91, 0.12);
  background: rgba(255, 255, 255, 0.025);
}

.info-box ul,
.info-box ol {
  margin: 0;
}

.quick-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 0 0 1.55rem;
}

.quick-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 91, 91, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: #d9e0ea;
  text-decoration: none;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.quick-pill:hover {
  border-color: rgba(255, 91, 91, 0.28);
  background: rgba(255, 255, 255, 0.045);
  transform: translateY(-1px);
}

.quick-pill strong {
  color: #ffffff;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.95rem;
  margin: 1.1rem 0 1.7rem;
}

.recipe-card,
.machine-card {
  margin: 0.95rem 0 1.25rem;
  padding: 1rem 1.05rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 91, 91, 0.14);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.025));
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
}

.recipe-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(3, 56px);
  gap: 0.45rem;
  padding: 0.75rem;
  border-radius: 16px;
  background: rgba(7, 10, 16, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.recipe-slot,
.recipe-output,
.machine-slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.08);
}

.recipe-slot img,
.recipe-output img,
.machine-slot img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  image-rendering: pixelated;
}

.recipe-slot--empty {
  background: rgba(255,255,255,0.02);
  border-style: dashed;
}

.recipe-slot[data-item]::after,
.recipe-output[data-item]::after,
.machine-slot[data-item]::after {
  content: attr(data-item);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  padding: 0.45rem 0.65rem;
  border-radius: 12px;
  background: rgba(9, 12, 18, 0.96);
  border: 1px solid rgba(255, 91, 91, 0.2);
  color: #eef2f8;
  font-size: 0.92rem;
  line-height: 1.28;
  white-space: normal;
  min-width: 110px;
  max-width: 190px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  z-index: 3;
}

.recipe-slot[data-item]:hover::after,
.recipe-output[data-item]:hover::after,
.machine-slot[data-item]:hover::after,
.recipe-slot[data-item]:focus-within::after,
.recipe-output[data-item]:focus-within::after,
.machine-slot[data-item]:focus-within::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

.recipe-arrow {
  font-size: 1.8rem;
  color: #ff9d9d;
  line-height: 1;
  opacity: 0.9;
}

.recipe-result {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 170px;
}

.recipe-output {
  width: 68px;
  height: 68px;
}

.recipe-output img {
  width: 46px;
  height: 46px;
}

.recipe-caption,
.machine-caption {
  margin: 0.8rem 0 0;
  color: #bcc5d1;
  line-height: 1.6;
}

.recipe-caption strong,
.machine-caption strong {
  color: #f4f7fb;
}


.machine-board {
  position: relative;
  width: min(100%, 390px);
  aspect-ratio: 176 / 166;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(7, 10, 16, 0.42);
}

.machine-board > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.machine-slot {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(8, 11, 17, 0.72);
  backdrop-filter: blur(3px);
}

.machine-slot img {
  width: 28px;
  height: 28px;
}

.machine-slot--top-left {
  left: 61px;
  top: 35px;
}

.machine-slot--top-center {
  left: 104px;
  top: 35px;
}

.machine-slot--top-right {
  left: 147px;
  top: 35px;
}

.machine-slot--fuel {
  left: 61px;
  top: 92px;
}

.machine-slot--flux {
  left: 104px;
  top: 92px;
}

.machine-slot--output {
  right: 24px;
  top: 62px;
  width: 48px;
  height: 48px;
}

.machine-side {
  flex: 1 1 240px;
  min-width: 240px;
}

.machine-side ul {
  margin: 0;
}

.wiki-card {
  display: block;
  padding: 1rem 1rem 0.95rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 91, 91, 0.14);
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.02));
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

.wiki-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 91, 91, 0.32);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.03));
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.30);
}

.wiki-card strong {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 1.02rem;
  color: #ffffff;
}

.wiki-card span {
  display: block;
  color: #d6deeb;
  line-height: 1.55;
}

.ship-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.95rem;
  margin: 1rem 0 1.4rem;
}

.ship-gallery__item {
  margin: 0;
  padding: 0.9rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 91, 91, 0.14);
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.02));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

.ship-gallery__item img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 14px;
}

.ship-gallery__item figcaption {
  margin-top: 0.7rem;
  text-align: center;
  color: #f1f4f9;
  font-weight: 600;
}

.content main {
  max-width: 940px;
}

.sidebar .chapter li a {
  color: #ccb8bd;
}

.sidebar .chapter li a.active,
a:hover,
a:focus {
  color: #ff8b8b;
}

code {
  color: #ffd8d8;
}

@media (max-width: 700px) {
  .hero-home {
    flex-direction: column;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .recipe-grid {
    grid-template-columns: repeat(3, 50px);
  }

  .recipe-slot,
  .machine-slot {
    width: 50px;
    height: 50px;
  }

  .recipe-output {
    width: 60px;
    height: 60px;
  }

  .recipe-arrow {
    width: 100%;
    text-align: center;
  }
}

