@font-face {
  font-family: Grenze;
  src: url("/fonts/grenze-700-latin.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --night: #0d0e0f;
  --iron: #2b2f33;
  --iron-hi: #4a4f55;
  --steel: #8d939a;
  --ash: #b3b8bd;
  --bone: #ece4d4;
  --ember: #f05a32;
  --ember-hi: #ff7a4d;
  --parchment: #e4d5b3;
  --parchment-hi: #f3e9d2;
  --rule: #a48c63;
  --ink: #2a2118;
  --ink-soft: #4b3c2b;
  --ember-ink: #a33816;
  --rare: #1f5aa8;
  --epic: #7730b3;
  --legendary: #7d5800;
  --display: Grenze, ui-serif, Georgia, serif;
  --sans: Verdana, Tahoma, "DejaVu Sans", "Segoe UI", sans-serif;
  color-scheme: dark;
  scrollbar-color: var(--iron-hi) var(--night);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--night);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 0.875rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
::selection { background: var(--ember); color: var(--night); }
img { display: block; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
[hidden] { display: none !important; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; z-index: 100; padding: 0.5rem 1rem; background: var(--ember); color: #1a0b05; }
.skip:focus { left: 0; }
.px { image-rendering: pixelated; }

.iron {
  background-color: #24272b;
  background-image: url("/art/iron.webp"), linear-gradient(180deg, #353a3f, #202326);
  background-size: 384px, auto;
  border: 1px solid #070808;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.09), inset 0 -2px 0 rgb(0 0 0 / 0.45);
}

.iron-deep {
  background-color: #17191b;
  background-image: url("/art/iron.webp"), linear-gradient(180deg, #1d2023, #141618);
  background-size: 384px, auto;
  background-blend-mode: multiply, normal;
}

.parchment {
  color: var(--ink);
  background-color: var(--parchment);
  background-image: url("/art/parchment.webp"), radial-gradient(ellipse at 50% 40%, var(--parchment-hi), transparent 75%);
  background-size: 512px, auto;
  border: 1px solid #070808;
  box-shadow: inset 0 0 0 1px rgb(255 248 230 / 0.35), inset 0 0 48px rgb(120 86 40 / 0.28);
}

.parchment :focus-visible { outline-color: var(--ember-ink); }
.parchment ::selection { background: var(--ember-ink); color: var(--parchment-hi); }

.plate-title {
  font-family: var(--display);
  font-weight: 700;
  color: var(--bone);
  letter-spacing: 0.02em;
  text-shadow: 0 1px 0 #000;
  font-size: 1.5rem;
  line-height: 1.33;
}

.ember-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.6rem;
  font-family: var(--display);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
  color: #1a0b05;
  text-decoration: none;
  background: linear-gradient(180deg, #ff7a4d, #e04a22 55%, #b9381a);
  border: 1px solid #3a1206;
  box-shadow: inset 0 1px 0 rgb(255 214 190 / 0.6), inset 0 -2px 0 rgb(80 20 6 / 0.45), 0 6px 18px rgb(0 0 0 / 0.5);
  transition: filter 160ms ease-out, transform 160ms ease-out;
}
.ember-button:hover { filter: brightness(1.08) saturate(1.05); }
.ember-button:active { transform: translateY(1px); }
.ember-small { padding: 0.45rem 0.9rem; font-size: 1.0625rem; white-space: nowrap; }

.iron-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 0.85rem;
  font-family: var(--display);
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
  white-space: nowrap;
  color: var(--bone);
  text-decoration: none;
  text-shadow: 0 1px 0 #000;
  background-color: #24272b;
  background-image: url("/art/iron.webp"), linear-gradient(180deg, #3a3f44, #1f2225);
  background-size: 384px, auto;
  border: 1px solid #070808;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.1), inset 0 -2px 0 rgb(0 0 0 / 0.45), 0 3px 8px rgb(60 40 15 / 0.35);
  cursor: pointer;
  transition: color 160ms ease-out, transform 160ms ease-out;
}
.iron-button:hover { color: var(--ember-hi); }
.iron-button:active { transform: translateY(1px); }
.iron-button.inline { display: inline-flex; white-space: normal; }

.ink-link {
  color: var(--ember-ink);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.ink-link:hover { text-decoration-thickness: 2px; }

.field {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.5rem 0.625rem;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--parchment-hi);
  border: 1px solid #8a7552;
  border-radius: 0;
  box-shadow: inset 0 1px 3px rgb(60 40 15 / 0.22);
  caret-color: var(--ember-ink);
  color-scheme: light;
}
.field:focus-visible { outline-offset: 0; border-color: var(--ember-ink); }

.top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  border-width: 0 0 1px;
}
.brand { display: flex; align-items: center; gap: 0.5rem; color: var(--bone); text-decoration: none; flex-shrink: 0; }
.brand:hover .brand-name { color: var(--ember-hi); }
.brand img { height: 26px; width: auto; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 1.5rem; line-height: 1; letter-spacing: 0.02em; text-shadow: 0 1px 0 #000; transition: color 160ms ease-out; }
.top-link { margin-left: auto; color: var(--ash); white-space: nowrap; font-size: 0.8125rem; }
.top-link:hover { color: var(--ember-hi); }
.top .search { flex: 1 1 auto; max-width: 34rem; }
.top .search + .menu-toggle + .top-link { margin-left: auto; }
.menu-toggle { display: none; }

.search { position: relative; }
.search-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--parchment-hi);
  border: 1px solid #070808;
  border-radius: 0;
  box-shadow: inset 0 1px 3px rgb(60 40 15 / 0.35);
  caret-color: var(--ember-ink);
  color-scheme: light;
}
.search-input::placeholder { color: var(--ink-soft); opacity: 1; }
.search-results {
  position: absolute;
  z-index: 50;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 2px;
  max-height: min(70vh, 34rem);
  overflow-y: auto;
  background: var(--parchment-hi);
  color: var(--ink);
  border: 1px solid #070808;
  box-shadow: 0 10px 28px rgb(0 0 0 / 0.55);
  text-align: left;
}
.search-results a {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  grid-template-areas: "sprite name" "sprite kind";
  column-gap: 0.625rem;
  align-items: center;
  padding: 0.3rem 0.625rem;
  color: inherit;
  text-decoration: none;
  line-height: 1.3;
}
.search-results [aria-selected="true"] a, .search-results a:hover { background: rgb(196 172 126 / 0.45); }
.search-sprite { grid-area: sprite; display: flex; align-items: flex-end; justify-content: center; width: 2.25rem; height: 2.25rem; overflow: hidden; }
.search-sprite img { max-width: 2.25rem; max-height: 2.25rem; }
.search-name { grid-area: name; font-weight: 700; }
.search-kind { grid-area: kind; font-size: 0.75rem; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-empty { padding: 0.75rem; color: var(--ink-soft); }

.frame {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 1rem;
  max-width: 88rem;
  margin: 0 auto;
  padding: 1rem;
}
.menu { position: sticky; top: 3.75rem; align-self: start; max-height: calc(100vh - 4.5rem); overflow-y: auto; scrollbar-width: thin; }
.menu-section + .menu-section { margin-top: 0.625rem; }
.menu-title { padding: 0.3rem 0.75rem; font-size: 1.125rem; }
.menu-list { border: 1px solid #000; border-top: 0; font-size: 0.8125rem; }
.menu-list li + li { border-top: 1px solid rgb(0 0 0 / 0.7); }
.menu-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.1875rem 0.625rem 0.1875rem 0.375rem; color: var(--bone); font-weight: 700; text-decoration: none; transition: background-color 160ms ease-out, color 160ms ease-out; }
.menu-row:hover { background: rgb(255 255 255 / 0.06); color: var(--ember-hi); }
.menu-row[aria-current="page"] { color: var(--ember-hi); background: rgb(255 255 255 / 0.04); }
.menu-icon { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex-shrink: 0; }
.menu-name { flex: 1 1 auto; min-width: 0; }
.menu-count { color: var(--steel); font-weight: 400; font-size: 0.75rem; font-variant-numeric: tabular-nums; }

.frame-home { grid-template-columns: minmax(0, 1fr); max-width: 72rem; }
.frame-home .menu { display: none; }
.content { min-width: 0; display: flex; flex-direction: column; gap: 1rem; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; font-size: 0.8125rem; color: var(--ash); }
.crumbs li + li::before { content: "/"; margin-right: 0.5rem; color: var(--steel); }
.crumbs a { color: var(--ash); }
.crumbs a:hover { color: var(--ember-hi); }
.crumbs [aria-current] { color: var(--bone); }
.page-title { font-family: var(--display); font-size: 2.25rem; line-height: 1.05; color: var(--bone); }

.panel { box-shadow: 0 10px 28px rgb(0 0 0 / 0.55); }
.plate { padding: 0.5rem 1.25rem; }
.body { padding: 1.25rem; border-top: 0; display: flow-root; }
.body > * + * { margin-top: 0.875rem; }
.body h3 { font-family: var(--display); font-size: 1.25rem; line-height: 1.4; }
.lead { font-size: 0.9375rem; line-height: 1.625; max-width: 75ch; }
.note { font-size: 0.8125rem; color: var(--ink-soft); max-width: 75ch; }
.note strong { color: var(--ink); }
.tag { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ember-ink); white-space: nowrap; }

.hero-row { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: flex-start; }
.hero-text { flex: 1 1 20rem; min-width: 0; display: flex; flex-direction: column; gap: 0.875rem; }
.look { padding: 0.5rem 0.75rem; background: #1b1c1e; color: #d0d0d0; font-family: Verdana, Tahoma, sans-serif; font-size: 0.75rem; border: 1px solid #070808; color-scheme: dark; }
.look-spell { color: #5ff7f7; font-size: 0.9375rem; font-style: italic; }

.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); padding: 1px 0 0 1px; }
.facts > div { margin: -1px 0 0 -1px; padding: 0.375rem 0.625rem; background: var(--parchment-hi); border: 1px solid var(--rule); }
.facts dt { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em; color: var(--ink-soft); text-transform: uppercase; }
.facts dd { font-family: var(--display); font-size: 1.25rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.facts dd .ink-link { font-family: var(--display); }

.slot { display: inline-flex; flex-shrink: 0; align-items: flex-end; justify-content: flex-end; width: 34px; height: 34px; padding: 1px; background: #2a2a2a; box-shadow: inset 0 0 0 1px #444; overflow: hidden; }
.slot img { max-width: none; }
.slot-big { width: 68px; height: 68px; padding: 2px; }
.beast { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 64px; height: 64px; background: var(--parchment-hi); box-shadow: 0 0 0 1px var(--rule); overflow: hidden; }
.beast img { max-width: none; }
.beast-big { width: 128px; height: 128px; }
.row-with-sprite { display: inline-flex; align-items: center; gap: 0.625rem; }
.sprite-strip { display: flex; flex-wrap: wrap; gap: 3px; }
.sprite-strip .beast { width: 40px; height: 40px; }
.sprite-strip .beast img { max-width: 64px; }
.glow-rare .slot img { filter: drop-shadow(0 0 1px #3c8cff) drop-shadow(0 0 1px #3c8cff); }
.glow-epic .slot img { filter: drop-shadow(0 0 1px #b04cff) drop-shadow(0 0 1px #b04cff); }
.glow-legendary .slot img { filter: drop-shadow(0 0 1px #ffc21a) drop-shadow(0 0 2px #ffc21a); }

.tier { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; }
.tier-rare { color: var(--rare); }
.tier-epic { color: var(--epic); }
.tier-legendary { color: var(--legendary); }

.ledger-wrap { overflow-x: auto; border: 1px solid #070808; scrollbar-width: thin; scrollbar-color: var(--rule) transparent; }
.ledger { width: 100%; border-collapse: collapse; font-size: 0.8125rem; color-scheme: light; }
.ledger th {
  position: sticky;
  top: 0;
  padding: 0.375rem 0.75rem;
  background: var(--iron);
  color: var(--bone);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: left;
  white-space: nowrap;
}
.ledger th button { all: unset; cursor: pointer; }
.ledger th button:hover { color: var(--ember-hi); }
.ledger th button:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
.ledger th[aria-sort="ascending"] button::after { content: " \25B4"; color: var(--ember-hi); }
.ledger th[aria-sort="descending"] button::after { content: " \25BE"; color: var(--ember-hi); }
.ledger td { padding: 0.25rem 0.75rem; border-top: 1px solid rgb(164 140 99 / 0.6); }
.ledger tbody tr:nth-child(odd) { background: rgb(255 250 236 / 0.55); }
.ledger tbody tr:nth-child(even) { background: rgb(196 172 126 / 0.28); }
.ledger .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger th.num { text-align: right; }
.gold { white-space: nowrap; font-variant-numeric: tabular-nums; }
.words { font-style: italic; white-space: nowrap; }

.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem 0.75rem; font-size: 0.8125rem; font-weight: 700; }
.filters:not(.is-ready) { display: none; }
.filters label { flex: 0 1 11rem; }
.filters label:first-child { flex: 1 1 15rem; max-width: 26rem; }
.filter-count { font-weight: 400; color: var(--ink-soft); padding-bottom: 0.5rem; white-space: nowrap; }

.outfit-note { display: block; font-size: 0.75rem; color: var(--ink-soft); }
.chance { white-space: nowrap; }
.chance-name { font-weight: 700; }
.chance-value { color: var(--ink-soft); font-size: 0.75rem; }
.chance-always .chance-name, .chance-common .chance-name { color: #33691e; }
.chance-uncommon .chance-name { color: #6b5a12; }
.chance-scarce .chance-name { color: #864915; }
.chance-rare .chance-name { color: var(--rare); }
.chance-very-rare .chance-name { color: var(--epic); }

.chips { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.chip { padding: 0.125rem 0.5rem; font-size: 0.75rem; border: 1px solid var(--rule); background: var(--parchment-hi); }
.chip-weak { border-color: #33691e; color: #24500f; }
.chip-immune { border-color: var(--ember-ink); color: #7c2a10; }
.chip-resist { border-color: #92521a; color: #6d3c11; }
.chip-note { color: var(--ink-soft); }

.voices { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-family: Verdana, Tahoma, sans-serif; font-size: 0.75rem; padding: 0.5rem 0.75rem; background: #1b1c1e; color: #ff9b3d; border: 1px solid #070808; color-scheme: dark; }
.raid-voices { color: #ff6b5e; display: block; }

.links { display: flex; flex-direction: column; gap: 0.25rem; }
.links.columns { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); gap: 0.5rem; }
.tile { display: flex; align-items: center; gap: 0.625rem; padding: 0.375rem; color: var(--ink); text-decoration: none; background: rgb(255 250 236 / 0.5); border: 1px solid var(--rule); transition: background-color 160ms ease-out, border-color 160ms ease-out; }
.tile:hover { background: var(--parchment-hi); border-color: var(--ember-ink); }
.tile-name { flex: 1 1 auto; font-weight: 700; color: var(--ember-ink); }
.tile-count { color: var(--ink-soft); font-size: 0.75rem; font-variant-numeric: tabular-nums; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0.5rem; }
.card { padding: 0.5rem; background: rgb(255 250 236 / 0.5); border: 1px solid var(--rule); }
.card-head { display: flex; align-items: center; gap: 0.625rem; color: inherit; text-decoration: none; }
a.card-head .card-title { color: var(--ember-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.card-title { font-weight: 700; }
.card-line { margin-top: 0.25rem; font-size: 0.75rem; color: var(--ink-soft); }
.outfit-pair { display: flex; justify-content: center; gap: 0.25rem; min-height: 64px; align-items: flex-end; }
.outfit-pair img { max-width: none; }
.outfit { text-align: center; }

.maps { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.map { flex: 0 0 auto; max-width: 100%; }
.map-view { position: relative; max-width: 100%; overflow: hidden; background: #000; border: 1px solid #070808; }
.map-view img { position: absolute; max-width: none; image-rendering: pixelated; }
.map-pin { position: absolute; width: 11px; height: 11px; margin: -4px 0 0 -4px; background: var(--ember); border: 2px solid #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.8); }
.map-dot { position: absolute; width: 5px; height: 5px; margin: -1px 0 0 -1px; background: var(--ember); border: 1px solid #fff; }
.map-box { position: absolute; border: 1px solid var(--ember-hi); background: rgb(240 90 50 / 0.14); }
.map figcaption { margin-top: 0.25rem; font-size: 0.75rem; color: var(--ink-soft); }

.chests { display: flex; flex-direction: column; gap: 1rem; }
.chest { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; padding-bottom: 1rem; border-bottom: 1px solid rgb(164 140 99 / 0.6); }
.chest:last-child { border-bottom: 0; padding-bottom: 0; }
.chest-items { flex: 1 1 14rem; display: flex; flex-direction: column; gap: 0.375rem; }

.guides { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 1rem 1.5rem; }
.guides h2 { font-family: var(--display); font-size: 1.25rem; line-height: 1.3; }
.guides p { font-size: 0.8125rem; color: var(--ink-soft); }

.home-hero {
  padding: 2.5rem 1.5rem 1.5rem;
  text-align: center;
  background-image: linear-gradient(180deg, rgb(13 14 15 / 0.55), rgb(13 14 15 / 0.9)), url("/art/key-art-wide.webp");
  background-size: cover;
  background-position: center 30%;
}
.home-title { font-family: var(--display); font-size: clamp(3rem, 8vw, 5.25rem); line-height: 1; letter-spacing: 0.01em; text-shadow: 0 2px 0 #000, 0 6px 22px rgb(0 0 0 / 0.8); }
.home-lead { margin: 0.5rem auto 1.25rem; max-width: 40rem; font-size: 0.9375rem; color: var(--bone); text-shadow: 0 1px 2px #000; }
.home-hero .search { max-width: 40rem; margin: 0 auto; }
.home-hero .search-input { padding: 0.75rem 1rem; font-size: 1.0625rem; }
.home-counts { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem 1.25rem; margin-top: 1.25rem; font-size: 0.8125rem; color: var(--ash); }
.home-counts strong { font-family: var(--display); font-size: 1.25rem; color: var(--bone); font-variant-numeric: tabular-nums; }
.showcase { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: 0.625rem; }
.showcase a { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; color: var(--ember-ink); font-size: 0.75rem; font-weight: 700; text-align: center; text-decoration: none; }
.showcase a:hover span:last-child { text-decoration: underline; text-underline-offset: 3px; }

.foot { padding: 0.5rem 0.25rem 1rem; color: var(--steel); font-size: 0.75rem; }
.foot a { color: var(--ash); }
.foot a:hover { color: var(--ember-hi); }
.foot p + p { margin-top: 0.25rem; }

@media (max-width: 1023px) {
  .frame { display: block; padding: 0.75rem; }
  .menu { position: static; display: none; max-height: none; margin-bottom: 0.75rem; }
  .menu.is-open { display: block; }
  .menu-toggle { display: flex; padding: 0.4rem 0.7rem; }
  .top-link { display: none; }
  .top { flex-wrap: wrap; padding: 0.5rem 0.75rem; gap: 0.5rem; }
  .top .search { order: 5; flex-basis: 100%; max-width: none; }
  .menu-toggle { order: 2; margin-left: auto; }
  .top .ember-small { order: 3; }
}

@media (max-width: 639px) {
  .wide { display: none; }
  .body { padding: 0.875rem; }
  .plate { padding: 0.375rem 0.875rem; }
  .ledger td, .ledger th { padding-left: 0.5rem; padding-right: 0.5rem; }
  .top .ember-small { display: none; }
  .brand-name { font-size: 1.25rem; }
  .beast-big { width: 64px; height: 64px; }
  .beast-big img { width: auto; height: auto; max-width: 64px; max-height: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
