@font-face {
  font-family: "Pixelify Sans";
  src: url("/fonts/pixelify-sans-latin.woff2") format("woff2");
  font-display: swap;
}

html { background: #100e1a; }

body.wiki-workspace {
  --ws-bg: #100e1a;
  --ws-panel: #191524;
  --ws-border: #383048;
  --ws-ink: #f5ecf8;
  --ws-muted: #c5b6cb;
  --shop-cyan: #8ae6e0;
  margin: 0;
}

.wiki-workspace .ws-header { background: #171222; }
.wiki-workspace .ws-sidebar { background: #140f20; }
.wiki-workspace .ws-search-open { background: #0e0b17; border-color: #60506a; }
.wiki-workspace .ws-sidebar a[aria-current=page] { background: #2c1b31; }
.wiki-workspace .ws-sidebar a:hover { background: #281d32; }
.wiki-workspace .ws-header button, .wiki-workspace main button { min-height: 44px; }
.wiki-workspace main { min-width: 0; min-height: 0; width: min(calc(100% - 232px), 1380px); }
.wiki-workspace main a { color: #ffa9cf; }
.wiki-workspace main > h1 { font-size: clamp(1.75rem, 4vw, 2.55rem); font-weight: 800; }
.wiki-workspace main > p { color: var(--ws-muted); }
.wiki-workspace main h2 { margin-top: 26px; }
.wiki-workspace .ws-page-sections { overflow-wrap: anywhere; }
.wiki-workspace [hidden] { display: none !important; }

.skip { position: fixed; z-index: 90; top: 8px; left: 10px; padding: 10px; background: var(--ws-bg); transform: translateY(-140%); }
.skip:focus { transform: none; }
.crumbs { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin: 0 0 9px; color: var(--ws-muted); font-size: .88rem; }

.mast {
  position: relative;
  display: grid;
  min-height: clamp(240px, 33vw, 392px);
  align-content: end;
  overflow: clip;
  isolation: isolate;
  border: 1px solid #705479;
  background: #191421;
}
.mast-art { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 54% 52%; }
.mast::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, #0e0a17 4%, #100b19d9 28%, #100b194a 70%, transparent); }
.mast-content { padding: clamp(20px, 5vw, 48px); }
.mast h1 { font: 700 clamp(2.8rem, 5.6vw, 5.5rem)/.98 "Pixelify Sans", monospace; letter-spacing: -.03em; margin: 0; }
.mast p { margin: 12px 0 16px; max-width: 42ch; color: #f0e9f4; }
.mast-content > a { display: inline-flex; min-height: 44px; align-items: center; padding: 7px 15px; background: #352037; border: 1px solid #bd709b; text-decoration: none; font-weight: 700; }

.home-counts, .shortcuts, .next-links { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center; }
.home-counts { border-bottom: 1px solid var(--ws-border); padding-block: 8px; }
.home-counts a, .shortcuts a, .next-links a { display: inline-flex; align-items: center; min-height: 44px; }
.home-counts a { font-weight: 670; text-decoration: none; }
.shortcuts { padding: 4px 0 12px; }
.next-links { margin: 22px 0 12px; border-top: 1px solid var(--ws-border); padding-block: 7px; }
.tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--ws-border); }
.tool-grid a { display: flex; flex-direction: column; min-height: 64px; padding: 12px 10px; border-bottom: 1px solid var(--ws-border); text-decoration: none; }
.tool-grid a:hover { background: #20192d; }
.tool-grid a span { color: var(--ws-muted); }

.tablebox { max-width: 100%; min-width: 0; overflow: auto; border: 1px solid var(--ws-border); background: var(--ws-panel); }
[data-filters] .tablebox { max-height: min(67vh, 650px); }
.wiki-workspace .tablebox table { min-width: 550px; margin: 0; }
.wiki-workspace .tablebox table:has(thead th:nth-child(2):last-child) { min-width: 0; width: 100%; }
.wiki-workspace .tablebox thead th { position: sticky; top: 0; z-index: 1; color: var(--shop-cyan); background: #282033; }
.wiki-workspace .tablebox tbody th { text-align: left; min-width: 185px; font-size: 14px; color: var(--ws-ink); background: none; }
.wiki-workspace .tablebox th, .wiki-workspace .tablebox td { padding: 10px 12px; }
.wiki-workspace .tablebox tr:target { background: #35223b; }
.wiki-workspace .tablebox tbody tr:hover { background: #271c31; }
.tablebox td:nth-child(n+2) { min-width: 95px; }
.tablebox td a { display: inline-block; padding-block: 5px; }
.row-title { display: inline-flex; align-items: center; gap: 9px; min-height: 28px; }
.row-title .sprite { width: 36px; height: 34px; object-fit: contain; flex: none; image-rendering: pixelated; }
.tablebox summary, .check-row summary, .feedback summary { min-height: 44px; display: list-item; cursor: pointer; padding: 10px 0; }
.wiki-workspace main summary { min-height: 44px; padding-block: 10px; cursor: pointer; }
.tablebox dl { margin: 8px 0; font-size: .82rem; font-weight: 400; }
.tablebox dt { color: var(--ws-muted); }
.tablebox dd { margin: 0 0 7px; }
.quantity { white-space: nowrap; }

.tool-fields, .ingredient, .material-grid { display: grid; gap: 12px 16px; }
.tool-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 12px 0; }
.ingredient { grid-template-columns: minmax(0, 1fr) minmax(0, .45fr) auto; align-items: end; margin: 10px 0; }
.material-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 20px; }
.wiki-workspace main label { min-width: 0; overflow-wrap: anywhere; color: var(--ws-muted); font-weight: 620; }
.wiki-workspace main label > :is(input:not([type=checkbox]), select, textarea) { display: block; width: 100%; min-width: 0; margin-top: 4px; }
.wiki-workspace main :is(input:not([type=checkbox]), select, textarea) { background: #100c19; border-color: #695675; min-height: 44px; }
.wiki-workspace main button { background: #302037; border-color: #986688; cursor: pointer; }
.wiki-workspace main button:hover { background: #462540; }
.wiki-workspace main button[type=submit] { margin: 12px 5px 5px 0; }
.tool-result { display: block; margin-top: 12px; border-left: 3px solid var(--shop-cyan); padding: 10px 14px; background: var(--ws-panel); }
.tool-result:empty { display: none; }
.tool-result p { margin: 4px 0 8px; }
.filter-count { min-height: 18px; }
.inline-check { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.check-row { margin: 0; padding: 9px 2px; border-top: 1px solid var(--ws-border); }
.check-row > label { min-height: 44px; display: flex; align-items: center; gap: 11px; cursor: pointer; }
.check-row > label input { width: 20px; height: 20px; flex: none; }
.check-row > label strong { color: var(--ws-ink); font-size: 1rem; }
.check-row p, .check-row details { margin: 0 0 2px 31px; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 16px; }
.site-foot a { min-height: 44px; display: inline-flex; align-items: center; }
.feedback { margin-top: 12px; }
.feedback form { max-width: 700px; }
.planner-results h2 { margin-bottom: 7px; }
.planner-equipment { margin-block: 20px; }
.planner-equipment input { flex: none; }

@media (max-width: 1100px) {
  .wiki-workspace main { width: calc(100% - 200px); }
  .material-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .wiki-workspace main { width: 100%; }
  .wiki-workspace .ws-search-open { width: 44px; justify-content: center; }
  .wiki-workspace .ws-sidebar a { min-height: 44px; display: flex; align-items: center; }
  .tool-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .mast { min-height: 270px; }
  .mast-content { padding: 18px; }
  .tool-grid, .tool-fields { grid-template-columns: minmax(0, 1fr); }
  .ingredient { grid-template-columns: minmax(0, 1fr) minmax(0, .62fr); }
  .ingredient button { justify-self: start; }
  .material-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tablebox :is(th, td) a { min-height: 44px; display: inline-flex; align-items: center; }
  .wiki-workspace .tablebox tbody th { min-width: 152px; }
  .wiki-workspace .ws-game small { display: none; }
}

.buyer-lookup {
  padding: 2px 14px 10px;
  border: 1px solid var(--ws-border);
  background: var(--ws-panel);
}
.buyer-lookup .tool-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.buyer-results ul, .wiki-workspace main .customer-list { list-style: none; margin: 0; padding: 0; }
.buyer-results li {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 2fr;
  gap: 0 12px;
  align-items: center;
  border-top: 1px solid var(--ws-border);
}
.buyer-results a { display: flex; align-items: center; min-height: 44px; }
.buyer-results span, .customer-row small { color: var(--ws-muted); }
.wiki-workspace main .customer-list { border-block: 1px solid var(--ws-border); }
.wiki-workspace main .customer-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(175px, 1fr) minmax(0, 1.4fr) minmax(160px, 1fr);
  gap: 8px 16px;
  padding: 10px 12px;
  margin: 0;
  align-items: center;
}
.customer-row:nth-child(odd) { background: var(--ws-panel); }
.customer-row + .customer-row { border-top: 1px solid var(--ws-border); }
.customer-row:target, .customer-row:has(.customer-anchor:target) { outline: 2px solid var(--shop-cyan); outline-offset: -2px; }
.customer-anchor { position: absolute; top: 0; }
.customer-row small, .buyer-budget span { display: block; }
.customer-row .row-title { font-weight: 700; }
.customer-row .row-title .sprite { width: 34px; height: 34px; }

@media (max-width: 625px) {
  .wiki-workspace main .customer-row, .buyer-lookup .tool-fields, .buyer-results li { grid-template-columns: minmax(0, 1fr); }
  .buyer-results li span { padding-bottom: 8px; }
  .buyer-budget span { display: inline-block; margin-inline-end: 12px; }
  .customer-row a { display: inline-flex; min-height: 44px; align-items: center; }
}

.mast { min-height: clamp(218px, 26vw, 320px); }
.mast-content { padding: clamp(16px, 4vw, 38px); }
.mast h1 { font-size: clamp(2.35rem, 5.2vw, 4.25rem); }
.mast-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.mast-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 12px;
  background: #23142b;
  border: 1px solid #bd709b;
  text-decoration: none;
  font-weight: 700;
}
.home-catalogue, .home-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.home-catalogue > a, .home-tools > a {
  display: flex;
  align-items: center;
  min-height: 68px;
  gap: 14px;
  padding: 10px 14px;
  border: 1px solid var(--ws-border);
  background: var(--ws-panel);
  text-decoration: none;
}
.home-catalogue > a:hover, .home-tools > a:hover, .home-questions a:hover, .mast-links a:hover {
  background: #322038;
}
.home-catalogue :is(strong, span), .home-tools :is(strong, small) { display: block; }
.home-catalogue strong { color: var(--shop-cyan); font-size: 1.12rem; line-height: 1.2; }
.home-catalogue .sprite, .home-tools .sprite {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  object-fit: contain;
  image-rendering: pixelated;
}
.home-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-tools small, .home-patch time { color: var(--ws-muted); }
.wiki-workspace main .home-questions {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
  margin: 0;
  padding: 0;
}
.home-questions li { border-top: 1px solid var(--ws-border); margin: 0; }
.home-questions a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 5px 8px;
  text-decoration: none;
}
.home-patch { margin-top: 26px; border-top: 1px solid var(--ws-border); }
.wiki-workspace main .home-patch h2 { margin: 14px 0 2px; }
.home-patch > a { display: inline-flex; align-items: center; min-height: 44px; }

@media (max-width: 580px) {
  .mast { min-height: 218px; }
  .home-catalogue { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-catalogue > a, .home-tools > a { gap: 8px; padding: 7px 8px; }
  .home-catalogue .sprite, .home-tools .sprite { width: 28px; height: 28px; }
  .wiki-workspace main .home-questions, .home-tools { grid-template-columns: minmax(0, 1fr); }
}

.item-attrs { display: block; font-weight: 500; color: var(--ws-muted); }
.buyer-lookup .tool-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 625px) {
  .buyer-lookup .tool-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .buyer-lookup .tool-fields label:first-child { grid-column: 1 / -1; }
}

[data-filters=customers] .customer-list { max-height: min(68vh, 690px); overflow: auto; }

.wiki-workspace .ws-header :is(.ws-game, .ws-account) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.wiki-workspace .ws-page-sections a { display: inline-flex; align-items: center; min-height: 44px; }
.wiki-workspace main .tool-grid a:focus-visible,
.wiki-workspace main .buyer-results a:focus-visible,
.wiki-workspace main .home-catalogue a:focus-visible,
.wiki-workspace main .home-tools a:focus-visible { outline-offset: -2px; }

@media (max-width: 625px) {
  .wiki-workspace main .ws-page-sections {
    overflow-x: auto;
    flex-wrap: nowrap;
    white-space: nowrap;
    scrollbar-width: thin;
    gap: 12px;
  }
  .wiki-workspace main .ws-page-sections > * { flex: 0 0 auto; }
  .wiki-workspace main .crumbs a { display: inline-flex; align-items: center; min-height: 44px; }
}

@media (max-width: 520px) {
  .wiki-workspace main:not([data-route="/items/"]) .tablebox table:has(thead th:nth-child(3):last-child),
  .wiki-workspace main[data-route="/guides/getting-started/"] .tablebox table {
    min-width: 0;
    width: 100%;
  }
  .wiki-workspace main:not([data-route="/items/"]) .tablebox table:has(thead th:nth-child(3):last-child) :is(th, td),
  .wiki-workspace main[data-route="/guides/getting-started/"] .tablebox :is(th, td) {
    min-width: 0;
    padding-inline: 8px;
  }
  .wiki-workspace main[data-route="/items/"] table { min-width: 420px; }
  .wiki-workspace main[data-route="/items/"] .tablebox td { min-width: 75px; }
}
