:root {
  --bg: #0d1017;
  --panel: #161b25;
  --panel-2: #1b2130;
  --line: #2a3245;
  --fg: #e6e9f0;
  --muted: #98a2b8;
  --accent: #5b8cff;
  --warm: #ffbb76;
  --panel-border: #343f51;
  --ember: #ff8c1a;
  --ember-text: #ffc27a;
  --discord: #5865f2;
  --gutter: clamp(20px, 4vw, 48px);
  --site-width: 1200px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: linear-gradient(180deg, #121927 0, var(--bg) 440px);
  color: var(--fg);
  font: 16px/1.5 var(--sans);
  padding: 24px var(--gutter) 64px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: var(--serif); margin: 0; }
h1 { font-size: 40px; font-weight: 700; line-height: 1.15; }
h2 { font-size: 24px; font-weight: 700; margin: 28px 0 12px; }
h3 { font-size: 17px; font-weight: 700; color: var(--accent); margin-bottom: 6px; }
p { margin: 0 0 12px; }
.lede, .meta { color: var(--muted); }
code { font-family: var(--mono); font-size: 13px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--warm);
  outline-offset: 3px;
}

.site-head, main, .foot { width: min(100%, var(--site-width)); margin-inline: auto; }

.titlebar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(210px, 390px) auto;
  grid-template-areas: "brand search account";
  align-items: center;
  gap: 14px;
}
.site-brand {
  grid-area: brand;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  color: #f4eee5;
}
.site-brand:hover { text-decoration: none; }
.site-brand > div { min-width: 0; }
.site-brand h1 { font-size: clamp(24px, 3vw, 34px); }
.titlebar .icon {
  width: 50px;
  height: 50px;
  border-radius: 11px;
  border: 1px solid #886344;
  object-fit: cover;
  background: var(--panel);
  flex: 0 0 auto;
}
.versionline { color: var(--muted); font-size: 13px; }

.site-account { grid-area: account; position: relative; justify-self: end; min-width: 0; max-width: min(220px, 42vw); }
.site-account .account-sign-in { background: var(--discord); color: #fff; text-align: center; }
.account-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--fg);
  padding: 5px 10px 5px 5px;
  font: 600 15px var(--sans);
  cursor: pointer;
}
.account-trigger:hover, .account-trigger[aria-expanded="true"] { border-color: var(--warm); }
.account-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu {
  position: absolute;
  z-index: 8;
  right: 0;
  top: 100%;
  min-width: 132px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 20px #0006;
}
.account-menu :is(a, button) {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--fg);
  padding: 7px 10px;
  font: 600 15px var(--sans);
  text-align: left;
  cursor: pointer;
}
.account-menu :is(a, button):is(:hover, :focus-visible) { background: var(--panel-2); text-decoration: none; }

.search { grid-area: search; position: relative; min-width: 0; }
.search::before, .search::after { position: absolute; content: ""; pointer-events: none; }
.search::before {
  top: calc(50% - 7px);
  left: 13px;
  width: 9px;
  height: 9px;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
}
.search::after {
  top: calc(50% + 3px);
  left: 22px;
  width: 6px;
  height: 1.5px;
  transform: rotate(45deg);
  background: var(--muted);
}
.search input[type="search"] {
  width: 100%;
  font: 15px var(--sans);
  color: var(--fg);
  background: #111723;
  border: 1px solid var(--panel-border);
  border-radius: 9px;
  padding: 10px 12px 10px 35px;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { border-color: var(--warm); }
.results {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 5;
  margin-top: 4px;
  max-height: 360px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 9px;
  box-shadow: 0 12px 28px #0005;
}
.results[hidden] { display: none; }
.results a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  color: var(--fg);
}
.results a:hover { background: var(--panel-2); text-decoration: none; }
.results .kind { color: var(--warm); font-size: 13px; }

nav.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 5px;
  margin-top: 14px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #141b27;
}
nav.tabs a {
  padding: 6px 11px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  color: #b6c1d3;
}
nav.tabs a:hover { text-decoration: none; color: var(--fg); background: var(--panel-2); }
nav.tabs a.active { color: var(--warm); border-color: #6b4d3a; background: #302820; }

main { min-width: 0; margin-top: 22px; flex: 1; }

.section-banner {
  --banner-end: #302538;
  --banner-glow: #55372e;
  --banner-art-size: clamp(86px, 12vw, 146px);
  position: relative;
  display: flex;
  isolation: isolate;
  align-items: center;
  overflow: hidden;
  min-height: 168px;
  padding: clamp(24px, 4vw, 48px);
  border: 1px solid #57464c;
  border-radius: 16px;
  background: radial-gradient(ellipse at 94% 86%, var(--banner-glow), transparent 65%),
              linear-gradient(112deg, #1b2434 15%, var(--banner-end));
}
.banner-home { --banner-art-size: clamp(116px, 16.5vw, 187px); min-height: 294px; }
.banner-heroes { --banner-end: #262c42; --banner-glow: #3c3852; }
.banner-items { --banner-art-size: clamp(52px, 8vw, 98px); --banner-glow: #4b3c23; }
.banner-sponsorships { --banner-end: #332635; --banner-glow: #503544; }
.banner-guides { --banner-end: #242f3d; --banner-glow: #394c49; }
.banner-credits { --banner-end: #303043; --banner-glow: #423d52; }
.banner-copy { position: relative; z-index: 1; max-width: 60%; min-width: 0; }
.banner-copy h2 {
  margin: 0;
  color: #fff0df;
  font-size: clamp(39px, 5.4vw, 65px);
  line-height: 1.04;
  letter-spacing: -0.045em;
  text-shadow: 0 2px 18px #10121b;
  overflow-wrap: anywhere;
}
.banner-home h2 { font-size: clamp(51px, 7vw, 88px); text-wrap: balance; }
.banner-copy p { margin: 10px 0 0; color: #d0c7c9; font-size: clamp(15px, 1.8vw, 18px); }
.banner-actions { margin-top: 21px; }
.banner-art {
  position: absolute;
  inset: 0 clamp(14px, 6vw, 78px) 0 auto;
  display: flex;
  align-items: center;
  pointer-events: none;
}
.banner-home .banner-art { right: clamp(14px, 5vw, 70px); }
.banner-art img {
  position: relative;
  width: var(--banner-art-size);
  aspect-ratio: 1;
  object-fit: cover;
  border: 2px solid #9d775f;
  border-radius: 12px;
  box-shadow: 0 16px 30px #0007;
}
.banner-art img:first-child { transform: translateY(13px) rotate(-11deg); opacity: 0.88; }
.banner-art img:nth-child(2) { z-index: 1; transform: translateY(-2px) rotate(-2deg) scale(1.07); }
.banner-art img:nth-child(3) { transform: translateY(16px) rotate(10deg); opacity: 0.88; }
.banner-art img + img { margin-left: -10px; }
.banner-items .banner-art img + img { margin-left: 5px; }

.home-pages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.home-page-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: var(--panel);
  padding: 17px;
  color: var(--fg);
}
.home-page-card:hover { border-color: #a97b56; background: #1c2330; text-decoration: none; }
.home-page-card h3 { margin-bottom: 3px; font-size: 21px; color: var(--fg); }
.home-page-card p { margin: 0; color: var(--muted); line-height: 1.35; font-size: 14px; }
.home-page-card img { width: 46px; height: 46px; border: 1px solid #684f43; border-radius: 8px; object-fit: cover; }
.home-arrow { color: var(--warm); font-size: 19px; }
.home-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding: 13px 3px 0;
  font-weight: 600;
}
.home-shortcuts a { color: #d4dae5; }
.home-shortcuts span, .banner-actions span, .guide-panel a span { margin-left: 5px; }

.catalog-group { margin-top: 23px; }
.collection-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  margin-bottom: 10px;
}
.collection-head h3 { margin: 0; color: #f4ece2; font-size: 26px; }
.collection-head > span { color: var(--muted); font-size: 14px; }
.stat-jumps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.stat-jumps button {
  border: 1px solid var(--panel-border);
  border-radius: 7px;
  background: var(--panel);
  color: var(--fg);
  padding: 5px 11px;
  font: 600 14px var(--sans);
  cursor: pointer;
}
.stat-jumps button:hover { border-color: var(--warm); color: var(--warm); }

.sponsor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin-top: 14px; }
.sponsor-column { display: flex; flex-direction: column; gap: 11px; }
.sponsor-card, .content-panel {
  min-width: 0;
  padding: clamp(16px, 2.5vw, 24px);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: var(--panel);
}
.sponsor-card h3 { margin: 0; color: var(--fg); font: 700 19px/1.25 var(--serif); }
.sponsor-card p { margin: 8px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.sponsor-card .sponsor-price { color: var(--warm); font-weight: 700; }
.sponsor-owned { color: #6fcf97; }
.sponsor-progress { color: #f3d475; }
.sponsor-list { margin: 14px 0 0; padding: 0; list-style: none; }
.sponsor-list li { padding: 8px 0; border-top: 1px solid var(--panel-border); }
.sponsor-list li p { margin-top: 2px; }
.sponsor-option { display: flex; justify-content: space-between; gap: 12px; }
.sponsor-hero-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
.sponsor-download { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-top: 14px; }
.sponsor-download .swap-select { display: grid; gap: 4px; flex: 1; margin: 0; min-width: min(100%, 180px); }
.sponsor-claim-feedback:not(:empty) { flex-basis: 100%; }
.sponsor-claim-feedback:empty { display: none; }
.owner-heading { padding: 15px 0 19px; border-bottom: 1px solid var(--panel-border); margin-bottom: 18px; }
.owner-heading h2 { font-size: clamp(26px, 4vw, 36px); }
.owner-columns { display: grid; grid-template-columns: minmax(230px, 0.7fr) minmax(0, 1.85fr); gap: 14px; align-items: start; }
.owner-card, .owner-buyer-header, .owner-empty {
  padding: 18px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: var(--panel);
  min-width: 0;
}
.owner-card h3, .owner-buyer-header h3 { margin: 0 0 12px; font: 700 19px/1.25 var(--serif); }
.owner-card form { display: grid; gap: 10px; }
.owner-card label { display: grid; gap: 4px; min-width: 0; font-weight: 600; }
.owner-card label[hidden] { display: none; }
.owner-card input:not([type="checkbox"], [type="radio"]) {
  width: 100%; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px;
  color: var(--fg); background: var(--panel-2); font: 16px var(--sans);
}
.owner-hint, .owner-empty, .owner-card code, .owner-buyer-header code { color: var(--muted); }
.owner-hint, .owner-feedback { margin: 9px 0 0; font-size: 14px; }
.owner-feedback { color: var(--warm); overflow-wrap: anywhere; }
.owner-feedback:empty { display: none; }
.owner-card label .owner-hint { margin: 0; font-weight: 400; }
.owner-buyers { list-style: none; margin: 12px 0 0; padding: 0; }
.owner-list-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 8px; margin-top: 16px; }
.owner-list-heading h4 { margin: 0; font-size: 15px; }
.owner-list-heading button[hidden] { display: none; }
.owner-unmatched { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--panel-border); }
.owner-unmatched .button { width: 100%; }
.owner-buyer-views { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.owner-buyer-views button[aria-pressed="true"] { border-color: var(--warm); color: var(--warm); }
.owner-history { display: grid; gap: 12px; }
.owner-history[hidden], .owner-tools[hidden] { display: none; }
.owner-history-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 15px; }
.owner-history-table :is(th, td) { padding: 8px 10px; vertical-align: top; overflow-wrap: anywhere; }
.owner-history-table tr + tr, .owner-history-table tbody { border-top: 1px solid var(--panel-border); }
.owner-history-table :is(time, td span) { display: block; color: var(--muted); }
.owner-history-table td:first-child { min-width: 128px; }
.owner-unmatched-history > header h3 { margin: 0; }
.owner-unmatched-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-top: 12px; }
.owner-unmatched-controls form { flex: 1 1 300px; grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.owner-unmatched-controls .owner-feedback { flex: 1 1 100%; margin: 0; }
.owner-buyers button {
  display: grid; gap: 1px; width: 100%; margin-top: 6px; padding: 9px 11px; text-align: left;
  border: 1px solid var(--panel-border); border-radius: 8px; background: var(--panel-2); color: var(--fg); cursor: pointer;
  font: 15px var(--sans); overflow-wrap: anywhere;
}
.owner-buyers button:is(:hover, [aria-pressed="true"]) { border-color: var(--warm); }
.owner-buyers button span { color: var(--muted); }
.owner-buyer-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 9px 16px; }
.owner-buyer-header h3 { margin: 0 0 3px; overflow-wrap: anywhere; }
.owner-buyer-header span { color: var(--warm); font-weight: 700; }
.owner-tools { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 12px; margin: 12px 0; align-items: start; }
.owner-account-tools { display: grid; gap: 12px; min-width: 0; }
.owner-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.owner-product-picker { display: grid; gap: 12px; min-width: 0; margin: 0; padding: 0; border: 0; }
.owner-product-group h4 { margin: 0 0 4px; color: var(--muted); font-size: 14px; }
.owner-product-grid { display: grid; gap: 4px; }
.owner-product-row { min-width: 0; }
.owner-card .owner-product-choice {
  grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 8px; padding: 6px 8px;
  border: 1px solid var(--panel-border); border-radius: 6px; cursor: pointer;
}
.owner-product-choice input { margin: 4px 0 0; accent-color: var(--warm); }
.owner-product-choice:is(:hover, :has(input:checked)) { border-color: var(--warm); background: var(--panel-2); }
.owner-product-choice:has(input:disabled) { cursor: default; opacity: .65; }
.owner-product-choice small { display: block; color: var(--muted); font-weight: 400; }
.owner-card .owner-product-quantity:not([hidden]) { grid-template-columns: auto minmax(0, 72px); align-items: center; padding: 4px 8px; }
.owner-danger-button { background: #702c35; border-color: #a6515e; color: #fff0f2; }
.owner-danger-button:hover { background: #873542; }
.owner-delete-dialog {
  width: min(480px, calc(100% - 32px)); padding: 20px; border: 1px solid #a6515e; border-radius: 12px;
  background: var(--panel); color: var(--fg);
}
.owner-delete-dialog::backdrop { background: #090c12b8; }
.owner-delete-dialog h3 { margin: 0 0 4px; overflow-wrap: anywhere; }
.owner-delete-dialog code { color: var(--muted); }
.owner-delete-dialog p { margin: 10px 0 14px; }
.owner-delete-dialog .owner-actions { justify-content: flex-end; }
@media (min-width: 1050px) { .owner-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .owner-columns { grid-template-columns: 1fr; } }
@media (max-width: 620px) { .owner-tools { grid-template-columns: 1fr; } }
@media (max-width: 500px) {
  .owner-unmatched-controls form { grid-template-columns: minmax(0, 1fr); }
  .owner-history-table :is(table, tbody, tr, td) { display: block; }
  .owner-history-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .owner-history-table tr { padding: 7px 0; }
  .owner-history-table td { padding: 2px 0; }
  .owner-history-table td:last-child::before { content: "By "; color: var(--muted); }
}
.content-panel { margin-top: 14px; }
.guide-panel p { font-size: 18px; }
.credits-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 16px 22px; }
.credits-grid dt { margin-bottom: 4px; color: var(--warm); font-weight: 700; }
.credits-grid dd { margin: 0; color: var(--fg); }
.credits-version { font-variant-numeric: tabular-nums; }

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 11px;
}
.hero-tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--fg);
}
.hero-tile:hover { border-color: var(--warm); background: #252633; text-decoration: none; }
.hero-tile img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--panel-2);
}
.hero-tile-info { display: grid; gap: 5px; justify-items: start; padding: 8px 9px 10px; }
.hero-tile-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}

.back { margin: 0 0 10px; font-size: 14px; }
.back a { color: var(--warm); }
.hero-profile {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 25px);
  padding: clamp(14px, 3.2vw, 32px);
  border: 1px solid #57464c;
  border-radius: 15px;
  background: radial-gradient(ellipse at 90% 108%, #44352e, transparent 65%), #1b2434;
}
.hero-profile h2 {
  margin: 0;
  color: #fff0df;
  font-size: clamp(25px, 4.8vw, 59px);
  line-height: 1.07;
  letter-spacing: -0.04em;
}
.hero-traits { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.stat-label { border: 1px solid #7d5b45; border-radius: 99px; padding: 2px 9px; color: #f7d9bd; font-size: 13px; }
.hero-portrait {
  width: clamp(65px, 12vw, 114px);
  aspect-ratio: 1;
  border-radius: 10px;
  border: 1px solid #a47e61;
  object-fit: cover;
  background: var(--panel-2);
  flex: 0 0 auto;
}
.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}
.hero-model {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: 16px;
  justify-self: end;
  width: min(100%, calc(100vh - 145px));
}
.hero-abilities { grid-column: 1; grid-row: 1; min-width: 0; }
.hero-abilities > h3, .model-box > h3 { margin: 0 0 10px; color: #f4ece2; font-size: 23px; }
.model-box { padding: 13px; border: 1px solid var(--panel-border); border-radius: 12px; background: var(--panel); }
.model-view {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, var(--panel-2) 0%, var(--bg) 75%);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  overflow: hidden;
}
.model-view > p { margin: 12px; text-align: center; }
.model-canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.model-hint { font-size: 13px; margin: 8px 0 0; }
.ability {
  display: flex;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 11px;
  padding: 13px;
  margin-bottom: 10px;
}
.ability-icon {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  flex: 0 0 auto;
}
.ability-body { min-width: 0; flex: 1; }
.ability-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 5px 12px; margin-bottom: 5px; }
.ability-heading h4 { margin: 0; color: var(--fg); font: 700 17px/1.35 var(--serif); overflow-wrap: anywhere; }
.hotkey {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 6px;
}
.tooltip { margin: 0; white-space: pre-line; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.play-button {
  flex: 0 0 auto;
  background: #302721;
  color: var(--warm);
  border: 1px solid #73533f;
  border-radius: 6px;
  padding: 5px 12px;
  font: 600 14px var(--sans);
  cursor: pointer;
}
.play-button:hover:not(:disabled) { filter: brightness(1.1); }
.play-button:disabled { opacity: 0.45; cursor: default; }
.play-status { margin: 6px 0 0; color: var(--ember-text); font-size: 14px; }
.play-status:empty { margin: 0; }

.role {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
}
.role-tank { color: var(--accent); }
.role-dps { color: #ff8c7a; }
.role-utility { color: #6fcf97; }

input[type="search"], select {
  font: 16px var(--sans);
  color: var(--fg);
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  min-width: 0;
}
.item-catalog { margin-top: 14px; border: 1px solid var(--panel-border); border-radius: 12px; background: var(--panel); }
.item-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, minmax(108px, 0.31fr));
  gap: 10px;
  padding: 15px 16px 12px;
}
.item-filter { display: grid; gap: 3px; min-width: 0; color: #d4dae5; font-size: 14px; font-weight: 600; }
.item-filters :is(input, select) { width: 100%; background: #101723; border: 1px solid var(--panel-border); border-radius: 8px; }
.item-filters input::placeholder { color: var(--muted); }
.item-count { margin: 0; padding: 0 16px 11px; color: var(--muted); font-size: 14px; }
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 8px; padding: 0 16px 16px; }
.catalog-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #1b2432;
  color: var(--fg);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.catalog-item:hover { border-color: #926442; background: #252d3a; }
.catalog-item-icon { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid #6e5a49; border-radius: 6px; background: #111824; object-fit: cover; }
.catalog-item-copy { display: grid; gap: 2px; min-width: 0; line-height: 1.2; }
.catalog-item-copy strong { font-size: 15px; overflow-wrap: anywhere; }
.catalog-item-copy small { color: var(--muted); font-size: 12px; }
.item-tier { align-self: start; padding: 2px 5px; border-radius: 4px; background: #3b2d21; color: #ffd0a5; font-size: 12px; font-weight: 700; }
.item-tier.legacy { background: #2a3240; color: #bdc6d7; }
.item-empty { grid-column: 1 / -1; margin: 10px 0; color: var(--muted); }
.item-pagination:not([hidden]) { display: flex; justify-content: center; align-items: center; gap: 14px; padding: 0 16px 16px; color: var(--muted); font-size: 14px; }
.item-pagination button, .item-detail-heading button { border: 1px solid var(--panel-border); border-radius: 6px; background: #202939; color: var(--fg); font: inherit; cursor: pointer; }
.item-pagination button { padding: 5px 11px; }
.item-pagination button:disabled { opacity: .48; cursor: default; }
.item-pagination button:hover:not(:disabled), .item-detail-heading button:hover { border-color: var(--warm); }
.item-detail {
  width: min(calc(100% - 24px), 640px);
  max-height: min(760px, 88dvh);
  padding: 0;
  border: 1px solid #846147;
  border-radius: 12px;
  background: #151d29;
  color: var(--fg);
  box-shadow: 0 16px 54px #0009;
}
.item-detail::backdrop { background: #090b13c2; }
.item-detail-heading {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--panel-border);
  background: #202a38;
}
.item-detail-heading .catalog-item-icon { width: 56px; height: 56px; }
.item-detail-heading h3 { margin: 0; color: var(--fg); font-size: clamp(18px, 4.5vw, 23px); overflow-wrap: anywhere; }
.item-detail-heading p { margin: 2px 0 0; color: #b9c6d9; font-size: 14px; }
.item-detail-actions { display: flex; align-self: start; gap: 6px; }
.item-detail-heading button { align-self: start; width: 36px; height: 36px; padding: 0; font-size: 23px; line-height: 1; }
.item-detail .item-detail-tooltip { padding: 15px 16px 18px; color: #dbe4f2; font-size: 15px; }
.item-guide-section { display: grid; gap: 8px; padding: 12px 16px 14px; border-top: 1px solid var(--panel-border); }
.item-guide-section h4 { margin: 0; color: var(--fg); font-size: 16px; }
.item-guide-empty, .item-recipe p { margin: 0; color: var(--muted); font-size: 14px; }
.item-sources, .item-recipe-list { list-style: none; margin: 0; padding: 0; }
.item-sources { display: grid; gap: 5px; }
.item-sources li { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; color: #dbe4f2; font-size: 14px; }
.item-sources small { margin-left: 7px; color: var(--muted); font-size: 13px; }
.item-source-kind { color: #ecc39d; font-size: 12px; font-weight: 700; }
.item-recipe { padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #182331; }
.item-recipe p { margin-bottom: 6px; }
.item-recipe-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr)); gap: 6px; }
.item-recipe-link { display: flex; align-items: center; gap: 7px; width: 100%; min-height: 42px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: #202a39; color: var(--fg); text-align: left; font: inherit; }
button.item-recipe-link { cursor: pointer; }
button.item-recipe-link:hover { border-color: #926442; }
.item-recipe-link .catalog-item-icon { width: 28px; height: 28px; flex: 0 0 auto; }
.item-recipe-name { display: grid; flex: 1; gap: 2px; line-height: 1.2; }
.item-recipe-name strong { overflow-wrap: anywhere; font-size: 14px; font-weight: 600; }
.item-recipe-name small { color: var(--muted); font-size: 11px; }
.item-recipe-count { color: #ffca94; font-variant-numeric: tabular-nums; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); background: var(--panel-2); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td code { color: var(--muted); }

.button {
  display: inline-block;
  background: var(--accent);
  color: #0d1017;
  border: 0;
  border-radius: 6px;
  padding: 8px 14px;
  font: 600 15px var(--sans);
  cursor: pointer;
}
.button:hover { text-decoration: none; filter: brightness(1.1); }
.button:disabled { opacity: 0.55; cursor: wait; }
.warm-button { background: var(--warm); color: #21170f; }
.text-button {
  color: var(--accent);
  font: inherit;
  background: none;
  border: 0;
  padding: 4px 8px;
  cursor: pointer;
}
.text-button:hover { text-decoration: underline; }
.text-button:disabled { opacity: 0.55; cursor: wait; }

.error { color: var(--ember-text); font-weight: 600; }

.swap-workspace {
  --swap-accent: var(--warm);
  --swap-surface: #181f2c;
  --swap-border: var(--panel-border);
  --swap-padding: clamp(18px, 3vw, 32px);
  max-width: 1032px;
  margin: 24px auto 0;
}
.swap-banner {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: 164px;
  padding: var(--swap-padding);
  border: 1px solid #534046;
  border-radius: 16px;
  background: radial-gradient(ellipse at 94% 80%, #553529 0, transparent 62%),
              linear-gradient(110deg, #1c2637 12%, #2b2437 100%);
}
.swap-banner h2 {
  margin: 0;
  color: #fff6eb;
  font-size: clamp(38px, 6vw, 66px);
  line-height: 1;
  letter-spacing: -0.044em;
  text-shadow: 0 2px 20px #15151e;
}
.swap-art {
  position: absolute;
  z-index: -1;
  top: 0;
  right: clamp(10px, 4vw, 48px);
  bottom: 0;
  display: flex;
  align-items: center;
  pointer-events: none;
}
.swap-art img {
  position: relative;
  width: clamp(88px, 16vw, 146px);
  aspect-ratio: 1;
  object-fit: cover;
  border: 3px solid #a6775d;
  border-radius: 10px;
  box-shadow: 0 14px 28px #0008;
}
.swap-art img:first-child { transform: translateY(12px) rotate(-12deg); opacity: 0.85; }
.swap-art img:nth-child(2) { z-index: 1; transform: rotate(-4deg) scale(1.08); }
.swap-art img:last-child { transform: translateY(13px) rotate(10deg); opacity: 0.85; }
.swap-art img + img { margin-left: -12px; }

.swap-board {
  margin-top: 12px;
  border: 1px solid var(--swap-border);
  border-radius: 16px;
  background: var(--swap-surface);
  box-shadow: 0 18px 36px #0002;
}
.swap-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 20px var(--swap-padding) 0;
}
.swap-progress[hidden] { display: none; }
.swap-progress li {
  border-top: 3px solid var(--swap-border);
  padding-top: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.swap-progress li.is-complete { border-color: #957357; color: var(--fg); }
.swap-progress li[aria-current="step"] { border-color: var(--swap-accent); color: var(--swap-accent); }
.swap-stage, .swap-empty { padding: var(--swap-padding); }
.swap-stage h3, .swap-empty h3 {
  margin: 0 0 4px;
  color: var(--fg);
  font-size: clamp(21px, 3vw, 30px);
  line-height: 1.2;
}
.swap-stage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-bottom: 18px;
}
.swap-stage-head p, .swap-empty p { margin: 0; color: var(--muted); }
.swap-empty .error { color: var(--ember-text); }
.swap-empty .text-button { margin-top: 8px; padding-left: 0; }
.swap-stage-head .swap-balance {
  background: #2d2622;
  border: 1px solid #76543e;
  border-radius: 8px;
  padding: 5px 12px;
  color: #f2d9c1;
  white-space: nowrap;
}
.swap-balance strong { color: var(--swap-accent); font-size: 20px; }
.swap-feedback {
  margin: 14px var(--swap-padding) 0;
  border-left: 3px solid #83cba0;
  border-radius: 4px;
  background: #1d302b;
  color: #c6f0d9;
  padding: 10px 12px;
}
.swap-feedback.error { border-color: var(--swap-accent); background: #322824; color: var(--ember-text); }
.swap-file {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: clamp(14px, 3vw, 24px);
  border: 1px dashed #687487;
  border-radius: 10px;
  background: #111824;
  cursor: pointer;
}
.swap-file:hover, .swap-file.has-file { border-color: var(--swap-accent); background: #1c2029; }
.swap-file:focus-within { outline: 2px solid var(--swap-accent); outline-offset: 3px; }
.swap-file.is-dragging {
  border-style: solid;
  border-color: var(--swap-accent);
  background: #34261c;
  box-shadow: inset 0 0 0 1px var(--swap-accent), 0 0 22px #ff9e4933;
}
.swap-file.is-dragging .swap-file-icon { background: var(--swap-accent); color: #21170f; }
.swap-file .swap-drop-label, .swap-file.is-dragging [data-swap-filename] { display: none; }
.swap-file.is-dragging .swap-drop-label { display: block; color: var(--swap-accent); }
.swap-file input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.swap-file-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid #775842;
  border-radius: 9px;
  background: #312922;
  color: var(--swap-accent);
  font-size: 24px;
  pointer-events: none;
}
.swap-file-copy { display: grid; gap: 1px; min-width: 0; pointer-events: none; }
.swap-file-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swap-file-copy span, .swap-hint { color: var(--muted); font-size: 14px; }
.swap-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-top: 18px; }
.swap-primary { padding: 9px 17px; background: var(--swap-accent); color: #21170f; }

.swap-save-details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--swap-border);
  border-radius: 10px;
  background: #131a26;
}
.swap-hero-label, .swap-stats dt { color: var(--muted); font-size: 13px; }
.swap-save-details p { margin: 2px 0 0; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.swap-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.swap-stat { padding: 7px clamp(5px, 1.4vw, 12px); border: 1px solid transparent; border-radius: 6px; background: #202938; }
.swap-stat.primary { border-color: #9b6948; }
.swap-stat.attachment:not(.primary) { border-color: #527886; }
.swap-stat-roles { display: flex; flex-wrap: wrap; gap: 0 8px; }
.swap-stat-roles small { font-size: 12px; }
.swap-stat-roles .primary { color: var(--swap-accent); }
.swap-stat-roles .attachment { color: #a9d9e5; }
.swap-stats dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.swap-stats-compare dd { display: flex; align-items: baseline; gap: 0.4em; }
.swap-stat-before { color: var(--muted); font-weight: 600; }
.swap-stat-arrow { color: var(--swap-accent); }
.swap-hero-picker { padding: 0; margin: 20px 0 0; min-width: 0; border: 0; }
.swap-hero-picker legend { padding: 0; margin-bottom: 8px; font-weight: 700; }
.swap-affinities { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.swap-affinities button {
  min-width: 0;
  padding: 7px 3px;
  border: 1px solid var(--swap-border);
  border-radius: 7px;
  color: var(--muted);
  background: #131a26;
  font: inherit;
  font-size: clamp(13px, 2.8vw, 16px);
  font-weight: 700;
  cursor: pointer;
}
.swap-affinities button:hover { color: var(--fg); border-color: #9b6948; }
.swap-affinities button[aria-pressed="true"] { border-color: var(--swap-accent); background: #32271e; color: var(--swap-accent); }
.swap-heroes:not([hidden]) { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 175px), 1fr)); gap: 7px; margin-top: 10px; }
.swap-heroes > p { grid-column: 1 / -1; margin: 0; color: var(--muted); }
.swap-hero-option { position: relative; cursor: pointer; }
.swap-hero-option input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; }
.swap-hero-card { display: flex; align-items: center; gap: 9px; min-width: 0; }
.swap-hero-card img { width: clamp(31px, 6vw, 46px); aspect-ratio: 1; flex: 0 0 auto; border-radius: 7px; object-fit: cover; }
.swap-hero-copy { display: grid; min-width: 0; line-height: 1.22; }
.swap-hero-card strong { overflow-wrap: anywhere; }
.swap-hero-option .swap-hero-card { height: 100%; padding: 7px; border: 1px solid var(--swap-border); border-radius: 8px; background: #131a26; }
.swap-hero-option:hover .swap-hero-card { border-color: #9b6948; }
.swap-hero-option input:checked + .swap-hero-card { border-color: var(--swap-accent); background: #32271e; }
.swap-hero-option input:focus-visible + .swap-hero-card { outline: 2px solid var(--swap-accent); outline-offset: 2px; }
.swap-stat-choices { min-width: 0; padding: 12px; margin: 20px 0 0; border: 1px solid var(--swap-border); border-radius: 8px; background: #131a26; }
.swap-stat-choices legend { padding: 0 4px; font-weight: 700; }
.swap-stat-transfer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.3fr); gap: 10px; }
.swap-stat-pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 8px; }
.swap-stat-choice, .swap-stat-switch { color: var(--fg); font: inherit; }
button.swap-stat-choice, .swap-stat-switch { cursor: pointer; }
.swap-stat-choice {
  display: grid;
  align-content: start;
  gap: 1px;
  min-width: 0;
  padding: 8px clamp(7px, 2vw, 14px);
  border: 1px solid var(--swap-border);
  border-radius: 7px;
  background: #202938;
  text-align: left;
}
button.swap-stat-choice:hover { border-color: var(--swap-accent); }
.swap-stat-label { color: var(--muted); font-size: 14px; }
.swap-stat-choice strong { font-size: clamp(16px, 2.3vw, 22px); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.swap-stat-choice.primary { border-color: #9b6948; }
.swap-stat-choice .swap-stat-roles { min-height: 18px; }
.swap-stat-choice .swap-stat-roles:empty { display: none; }
.swap-stat-choice .attachment { display: none; }
.swap-stat-choice[aria-pressed="true"] { border-color: #6a9aa9; background: #20333d; }
.swap-stat-choice[aria-pressed="true"] .attachment { display: inline; }
.swap-stat-switch {
  align-self: center;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #755740;
  border-radius: 50%;
  background: #2f241c;
  color: var(--swap-accent);
  font-size: 23px;
  line-height: 1;
}
.swap-stat-switch:hover { border-color: var(--swap-accent); background: #3b2a1e; }
.swap-attachment-help { margin: 8px 0 0; }
.swap-matchup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.swap-matchup div { height: 100%; padding: 9px; border: 1px solid var(--swap-border); border-radius: 8px; background: #131a26; }
.swap-matchup div:last-child { border-color: #775842; }
.swap-arrow { color: var(--swap-accent); font-size: 21px; }
.swap-items { margin-top: 16px; }
.swap-items h4 { margin: 0; font-size: 17px; }
.swap-items p { margin: 0; }
[data-swap-item-options] > p { margin: 12px 0 0; }
.swap-item-heading { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; align-items: baseline; }
.swap-item-options, .swap-item-results { display: grid; align-items: start; gap: 7px; margin-top: 8px; }
.swap-item-option, .swap-item-result { border: 1px solid var(--swap-border); border-radius: 8px; background: #131a26; }
.swap-item-option { cursor: pointer; }
.swap-item-option:has(input:checked) { border-color: #9b6948; }
.swap-item-option:has(input:disabled) { opacity: .55; cursor: default; }
.swap-item-toggle { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: #1d2531; border-radius: 7px 7px 0 0; font-size: 14px; font-weight: 700; }
.swap-item-toggle input { margin: 0; width: 16px; height: 16px; accent-color: var(--swap-accent); }
.swap-item-toggle:has(input:disabled) > span::after { content: " (used by another exchange)"; font-weight: 400; }
.swap-item-change { display: grid; padding: 6px 9px 9px; }
.swap-item-change + .swap-item-change { border-top: 1px solid var(--swap-border); }
.swap-item-slot { margin-bottom: 4px; color: var(--muted); }
.swap-item-pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: clamp(4px, 1vw, 10px); align-items: center; }
.swap-item-tile { min-width: 0; display: flex; align-items: center; gap: 7px; line-height: 1.15; font-size: 14px; }
.swap-item-tile strong { display: block; overflow-wrap: anywhere; }
.swap-item-tile small:not(:empty) { display: inline-block; margin-top: 3px; padding: 1px 4px; border-radius: 4px; background: #252e3c; color: #cad7ea; }
.swap-item-tile img, .swap-item-icon { width: clamp(22px, 6vw, 40px); aspect-ratio: 1; flex: 0 0 auto; border-radius: 5px; background: #252b36; }
.swap-item-icon { display: grid; place-items: center; color: var(--muted); }
.swap-item-pair > .swap-item-tile:last-child { padding: 4px; border: 1px solid #755740; border-radius: 6px; background: #28221e; }
.swap-item-pair > .swap-item-tile:last-child small { background: #443225; color: #ffd4ac; }
.swap-item-option:not(:has(input:checked)) .swap-item-pair > .swap-item-tile:last-child { border-color: var(--swap-border); background: #181f2a; }
.swap-item-legend { display: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; margin: 6px 9px 0; color: var(--muted); font-size: 13px; }
.swap-item-legend span:last-child { color: var(--swap-accent); }
.swap-item-locks { margin-top: 10px; color: var(--muted); font-size: 14px; }
.swap-item-locks summary { cursor: pointer; }
.swap-item-locked { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 12px; margin-top: 7px; }
.swap-item-locked .swap-item-tile { color: var(--fg); }
@media (min-width: 821px) {
  .swap-item-options, .swap-item-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .swap-item-legend { display: grid; }
}

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  margin-top: 42px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: var(--muted);
  font-size: 13px;
}
.footer-brand { color: #d4bfaa; font: 600 16px var(--serif); }
.foot nav { display: flex; flex-wrap: wrap; gap: 14px; }
.foot nav a { color: var(--muted); }

@media (max-width: 900px) {
  .hero-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .hero-model, .hero-abilities { grid-column: 1; grid-row: auto; position: static; }
  .hero-model { max-width: 520px; width: 100%; margin: 0 auto; }
}

@media (max-width: 720px) {
  :root { --gutter: 16px; }
  body { padding-top: 16px; padding-bottom: 40px; }
  .titlebar { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand account" "search search"; gap: 10px; }
  .titlebar .icon { width: 42px; height: 42px; }
  .site-account .account-sign-in { padding: 6px 9px; font-size: 14px; }
  nav.tabs { margin-top: 10px; gap: 2px; }
  nav.tabs a { padding: 5px 7px; }
  main { margin-top: 16px; }
  .section-banner { --banner-art-size: clamp(55px, 13vw, 88px); min-height: 127px; padding: 19px; }
  .section-banner:not(.banner-home) .banner-art {
    right: 10px;
    opacity: 0.75;
    mask-image: linear-gradient(to right, transparent, #000 65%);
  }
  .banner-copy { max-width: 100%; }
  .banner-copy h2 { font-size: clamp(34px, 7vw, 48px); }
  .banner-copy p { max-width: 32ch; }
  .banner-home { --banner-art-size: clamp(65px, 15vw, 95px); display: grid; gap: 9px; }
  .banner-home .banner-copy { grid-row: 2; }
  .banner-home .banner-art { position: static; grid-row: 1; justify-self: end; min-height: 90px; }
  .banner-home h2 { font-size: clamp(38px, 8vw, 56px); text-wrap: initial; }
  .banner-actions { margin-top: 13px; }
  .home-pages { grid-template-columns: 1fr; }
  .swap-banner { min-height: 112px; }
  .swap-art { right: 10px; }
  .swap-art img { width: clamp(58px, 15vw, 96px); border-width: 2px; }
}

@media (max-width: 520px) {
  .section-banner:not(.banner-home) .banner-art img:first-child:nth-last-child(3) { display: none; }
  .section-banner:not(.banner-home) .banner-copy p { max-width: 23ch; }
  .sponsor-grid, .credits-grid { grid-template-columns: 1fr; }
  .hero-grid { grid-template-columns: repeat(auto-fill, minmax(114px, 1fr)); }
  .ability { gap: 9px; padding: 10px; }
  .ability-icon { width: 38px; height: 38px; }
  .item-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .item-filter:first-child { grid-column: 1 / -1; }
  .item-filters, .item-grid { padding-inline: 10px; }
  .item-count { padding-inline: 10px; }
  .swap-banner h2 { font-size: clamp(32px, 7.7vw, 39px); }
  .swap-art img:last-child { display: none; }
  .swap-save-details { grid-template-columns: 1fr; gap: 10px; }
  .swap-matchup { gap: 6px; }
  .swap-matchup strong { font-size: 16px; }
  .swap-stat-transfer { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .swap-stats-compare { grid-template-columns: 1fr; }
  .swap-stats-compare .swap-stat { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 8px; }
  .swap-stats-compare dd { grid-area: 1 / 2 / span 2; }
}

@media (max-width: 360px) {
  .swap-art img:first-child { display: none; }
}

.home-banner-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.home-patch-link { color: var(--warm); font-weight: 700; }

.patch-page { --patch-gold: #ffc486; --patch-muted: #b5bfd1; }
.patch-cover {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: clamp(285px, 33vw, 402px);
  padding: clamp(24px, 5.5vw, 74px);
  overflow: hidden;
  border: 1px solid #64443c;
  border-radius: 18px;
  background: #1a1727;
  box-shadow: 0 16px 54px #08090e75;
}
.patch-page .patch-cover-art {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  border-radius: 0;
}
.patch-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, #141423f5 0%, #141423c4 28%, #14142328 60%, #14142300 100%);
}
.patch-cover-copy h2 {
  margin: 0;
  color: #fff0dc;
  font-size: clamp(1.55rem, 4.1vw, 3.25rem);
  line-height: 1.05;
  text-shadow: 0 3px 18px #10101a;
}
.patch-cover-copy h2 span {
  display: block;
  margin-block: 3px 8px;
  color: var(--patch-gold);
  font-size: clamp(5.1rem, 12vw, 9.6rem);
  font-weight: 700;
  line-height: .95;
  letter-spacing: -.055em;
}
.patch-cover-copy p { margin: 18px 0 0; color: #f3d6b7; font-size: 1.05rem; font-weight: 600; }

.patch-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 30px;
  padding: 0;
  list-style: none;
}
.patch-highlights a {
  display: flex;
  align-items: center;
  gap: 13px;
  height: 100%;
  min-height: 80px;
  padding: 12px 16px;
  border: 1px solid #3f3947;
  border-radius: 12px;
  color: #f5e7d9;
  background: linear-gradient(112deg, #28212c, #181d2a 74%);
}
.patch-highlights a:hover { border-color: #ba8564; text-decoration: none; }
.patch-highlights a > span { display: grid; gap: 2px; min-width: 0; }
.patch-highlights strong { font: 700 1.05rem/1.18 var(--serif); }
.patch-highlights a span span { color: var(--patch-muted); font-size: .93rem; line-height: 1.3; }
.patch-page img { display: block; flex: 0 0 auto; object-fit: cover; border-radius: 8px; }
.patch-highlights img { border: 1px solid #a77a5f; box-shadow: 0 4px 12px #090a10a0; }
.patch-index { max-width: 720px; }
.patch-release-list { grid-template-columns: minmax(0, 1fr); }
.patch-release-list time { color: var(--patch-muted); font-size: .93rem; }
.patch-release-list img { width: 106px; height: 48px; }

.patch-layout { display: grid; grid-template-columns: 212px minmax(0, 1fr); gap: clamp(20px, 3vw, 38px); }
.patch-toc {
  position: sticky;
  top: 18px;
  align-self: start;
  padding: 17px 10px 10px;
  border: 1px solid #343d50;
  border-radius: 13px;
  background: #171c27;
}
.patch-toc h3 { margin: 0 9px 10px; color: #f2dfce; font-size: 1.1rem; }
.patch-toc ul { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
.patch-toc a {
  display: block;
  padding: 8px 9px;
  border-radius: 7px;
  color: #c7cfe0;
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.2;
}
.patch-toc a:hover { color: var(--patch-gold); background: #242a38; text-decoration: none; }

.patch-sections { display: grid; min-width: 0; align-content: start; gap: clamp(44px, 6vw, 78px); }
.patch-section {
  --patch-section-tint: #d68d63;
  min-width: 0;
  scroll-margin-top: 20px;
}
.patch-section:focus { outline: none; }
.patch-section:target .patch-section-head { border-color: var(--patch-section-tint); }
.patch-section:focus-visible .patch-section-head { box-shadow: 0 1px var(--patch-section-tint); }
.patch-section-inventory { --patch-section-tint: #c8a36a; }
.patch-section-combat { --patch-section-tint: #d58b9d; }
.patch-section-heroes { --patch-section-tint: #81b9f0; }
.patch-section-dungeons { --patch-section-tint: #80bfb8; }
.patch-section-items { --patch-section-tint: #b6a0e3; }
.patch-section-bosses { --patch-section-tint: #e1968d; }
.patch-section-head {
  padding: 4px 0 16px;
  margin-bottom: 17px;
  border-bottom: 1px solid color-mix(in srgb, var(--patch-section-tint) 38%, #252634);
}
.patch-section-head h3 { margin: 0; color: #f5e9df; font-size: clamp(1.65rem, 3.5vw, 2.65rem); line-height: 1.07; text-wrap: balance; }
.patch-topics { display: grid; grid-template-columns: minmax(0, 1fr); gap: 13px; }
.patch-section-dungeons > .patch-topics { margin-bottom: 22px; }
.patch-topic {
  padding: clamp(16px, 2vw, 23px);
  border: 1px solid #303646;
  border-radius: 12px;
  background: radial-gradient(ellipse at 0 0, color-mix(in srgb, var(--patch-section-tint) 11%, transparent), transparent 57%), #171b25;
}
.patch-topic h4, .patch-reference h4 {
  margin: 0 0 10px;
  color: #f5e4d6;
  font: 700 1.13rem/1.22 var(--serif);
}
.patch-topic h4 { display: flex; align-items: center; gap: 10px; }
.patch-topic h4 img { border: 1px solid #6e5d63; border-radius: 6px; box-shadow: 0 4px 12px #090a1070; }
.patch-topic p, .patch-reference p { margin: 0; color: #c9d0df; font-size: 1rem; line-height: 1.55; }
.patch-topic p + p { margin-top: 10px; }
.patch-point-with-icon { display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: start; gap: 8px; }
.patch-page code { padding: 1px 4px; border-radius: 4px; color: #ffd7a5; background: #2c252e; white-space: nowrap; }
.patch-section-heroes .patch-topic h4 { margin-bottom: 13px; font-size: 1.3rem; }
.patch-ability-list { display: grid; gap: 13px; padding: 0; margin: 0; list-style: none; }
.patch-ability-list li { display: grid; grid-template-columns: 37px minmax(0, 1fr); gap: 10px; align-items: start; }
.patch-ability-list li img { border: 1px solid #66596b; border-radius: 5px; }
.patch-ability-list strong { display: block; color: #f2e0cb; font-weight: 700; line-height: 1.3; margin-bottom: 3px; }
.patch-changes { display: grid; gap: 5px; margin: 4px 0 0; line-height: 1.42; }
.patch-changes dt { color: #d8ddeb; font-size: .92rem; font-weight: 700; }
.patch-changes dd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1px .45em; margin: 0; color: #b9c3d5; }
.patch-change-result { color: var(--patch-section-tint); font-weight: 700; }
.patch-changes + p { margin-top: 6px; }

.patch-change-heading { margin: 0 0 12px; color: #f5e4d6; font: 700 1.2rem/1.25 var(--serif); }
.patch-round-note { margin: 0 0 14px; color: var(--patch-muted); }
.patch-dungeon-list { display: grid; gap: 8px; }
.patch-dungeon {
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--patch-section-tint) 45%, #343a4a);
  border-radius: 10px;
  background: #171b25;
}
.patch-dungeon > h5 {
  margin: 0;
  padding: 11px 16px;
  color: #f5e4d6;
  font-size: 1rem;
}
.patch-dungeon-rows { margin: 0; padding: 0 16px; list-style: none; }
.patch-dungeon-rows > li {
  display: grid;
  grid-template-columns: minmax(6.5rem, .7fr) minmax(0, 2fr);
  gap: 8px 16px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid #303646;
}
.patch-dungeon-rows h6 { margin: 0; color: #f1eeee; font-size: 1rem; }
.patch-dungeon-rows .patch-changes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; margin: 0; }
.patch-dungeon-rows dd,
.patch-item-stats dd { font-variant-numeric: tabular-nums; }

.patch-item-stats { margin-top: 22px; }
.patch-item-stats h5 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  color: #f5e4d6;
  font: 700 1.06rem/1.25 var(--serif);
}
.patch-item-stats h5 img { border: 1px solid #655570; border-radius: 5px; }
.patch-item-stats .patch-changes { gap: 0; }
.patch-item-stats .patch-changes > div {
  display: grid;
  grid-template-columns: minmax(6.5rem, .7fr) minmax(0, 2fr);
  align-items: baseline;
  gap: 3px 16px;
  padding: 7px 0;
  border-top: 1px solid #303646;
}
.patch-item-stats .patch-changes > div:last-child { padding-bottom: 0; }

.patch-reference {
  margin-top: 15px;
  padding: clamp(13px, 2vw, 21px);
  border: 1px solid #343a4a;
  border-radius: 12px;
  background: #141821;
}
.patch-reference p { margin-bottom: 13px; color: var(--patch-muted); }
.patch-table-scroll { overflow-x: auto; border: 1px solid #333a4e; border-radius: 8px; }
.patch-table-scroll:focus-visible { outline: 2px solid var(--patch-gold); outline-offset: 2px; }
.patch-reference table { width: 100%; min-width: 30rem; border-collapse: collapse; font-size: .97rem; line-height: 1.38; }
.patch-reference th, .patch-reference td { padding: 9px 12px; text-align: left; vertical-align: top; }
.patch-reference thead { background: #242939; }
.patch-reference thead th { color: #e8cdb7; font-weight: 700; }
.patch-reference tbody th { color: #ebe7e4; font-weight: 600; }
.patch-reference tbody td { color: #c9d0df; }
.patch-reference tbody tr:nth-child(even) { background: #1b202b; }
.patch-reference tbody tr + tr { border-top: 1px solid #262d3c; }
.patch-boss-table table { min-width: 0; table-layout: fixed; }
.patch-boss-table thead th:nth-child(n + 2) { width: clamp(4.25rem, 12vw, 6.25rem); text-align: right; }
.patch-boss-table thead th:last-child { width: clamp(5.375rem, 12vw, 6.25rem); }
.patch-boss-table td { text-align: right; font-variant-numeric: tabular-nums; }
.patch-boss-table td:last-child { color: #f2b3a8; font-weight: 700; }
.patch-boss-table .patch-boss-name th {
  background: #302733;
  color: #f7e0d8;
  font: 700 1rem/1.3 var(--serif);
}
.patch-boss-table th[scope="row"] { padding-inline-start: 16px; font-weight: 400; overflow-wrap: anywhere; }
.patch-boss-table tbody + tbody .patch-boss-name th { border-top: 3px solid #141821; }

@media (max-width: 900px) {
  .patch-layout { grid-template-columns: 1fr; gap: 16px; }
  .patch-toc { position: static; }
  .patch-toc ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .patch-highlights { margin-bottom: 17px; }
}
@media (max-width: 620px) {
  .patch-cover {
    min-height: 260px;
    border-radius: 13px;
  }
  .patch-cover::after {
    background: linear-gradient(90deg, #141423ee 0%, #141423ac 43%, #14142314 100%);
  }
  .patch-page .patch-cover-art { object-position: 67% center; }
  .patch-highlights { grid-template-columns: 1fr; gap: 7px; margin-top: 10px; }
  .patch-highlights a { min-height: 60px; padding: 8px 12px; }
  .patch-highlights img { width: 40px; height: 40px; }
  .patch-release-list img { width: 86px; }
  .patch-toc a { padding-inline: 6px; }
  .patch-section-head { margin-bottom: 12px; padding-bottom: 12px; }
  .patch-topics { gap: 8px; }
  .patch-dungeon-rows > li,
  .patch-dungeon-rows .patch-changes,
  .patch-item-stats .patch-changes > div { grid-template-columns: 1fr; }
  .patch-reference th, .patch-reference td { padding: 8px 10px; }
}
