/* Histatu Skyblock — public API showcase.
 * System: Imagine/Lounge Lizard tokens (Albert Sans 300, tight tracking, 34px cards, coral
 * primary, teal accent, 5/8/20/40/60 spacing, .2s ease-in-out) inverted onto its own #202020 ink.
 * Every colour below is from that palette. Game colours (rarity, enchantments) arrive from the API
 * as resolved hex and are painted inline — never mapped here. */

:root {
  --bg: #202020; --bg-2: #2b2b2b;
  --surface: #2E2E2E; --surface-2: #333333; --surface-3: #343438;
  --line: #333333; --line-2: #626161;
  --text: #FFFFFF; --text-2: #EFEFEF; --muted: #C2C4C4; --dim: #A2A2A2; --faint: #828282;
  --primary: #FF5D4C; --primary-deep: #CE3E2F; --accent: #00ACAD;
  --ok: #61A229; --bad: #CE3E2F; --slate: #4A6E78;
  --font: "Albert Sans", "AlbertSans", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --fs-display: 56px; --fs-h-lg: 35.2px; --fs-h-md: 30.4px; --fs-title: 22.4px;
  --fs-body-lg: 18px; --fs-body: 16px; --fs-label: 14.4px; --fs-small: 12px;
  --track: -0.48px;
  --r-sm: 3.2px; --r-md: 15px; --r-lg: 34px; --r-pill: 999px;
  --sh-sm: 0 4px 30px #0000001a; --sh-md: 0 0 15px rgba(0,0,0,.4); --sh-lg: rgba(0,0,0,.5) 0px 5px 50px;
  --s-xs: 5px; --s-sm: 8px; --s-md: 20px; --s-lg: 40px; --s-xl: 60px;
  --prose: 767px; --wide: 1200px;
  --ease: .2s ease-in-out;
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; min-height: 100vh; overflow-x: clip;
  background: var(--bg) linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 45%) no-repeat;
  background-size: 100% 900px;
  color: var(--text-2); font-family: var(--font); font-weight: 300;
  font-size: var(--fs-body); line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-wrap: pretty;
}
h1, h2, h3, h4 { font-weight: 300; letter-spacing: var(--track); line-height: 1; margin: 0; color: var(--text); }
h1 { font-size: clamp(var(--fs-h-lg), 5vw, var(--fs-display)); }
h2 { font-size: var(--fs-h-md); }
h3 { font-size: var(--fs-title); line-height: 1.2; }
h4 { font-size: var(--fs-body-lg); line-height: 1.33; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; transition: color var(--ease); }
a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
a:active { color: var(--primary); }
b, strong { font-weight: 500; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
code, .mono { font-family: var(--mono); font-size: .92em; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
::selection { background: rgba(0,172,173,.35); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -9999px; top: 10px; z-index: 90; background: var(--surface-2); color: var(--text); padding: 8px 14px; border-radius: var(--r-pill); }
.skip:focus { left: 12px; }

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 var(--s-md); }
.prose { max-width: var(--prose); }
.muted { color: var(--muted); } .dim { color: var(--dim); } .faint { color: var(--faint); }
.small { font-size: var(--fs-label); } .tiny { font-size: var(--fs-small); }
.num { font-variant-numeric: tabular-nums; }
.grow { flex: 1 1 auto; }
.row { display: flex; align-items: center; gap: var(--s-sm); flex-wrap: wrap; }
.stack { display: grid; gap: var(--s-md); }
.right { text-align: right; }

/* ───────── motion */
@keyframes come-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0% { opacity: .3 } 50% { opacity: 1 } 100% { opacity: .3 } }
@keyframes shimmer { from { background-position: 200% 0 } to { background-position: -200% 0 } }
.page { padding: var(--s-lg) 0 var(--s-xl); animation: come-in .5s ease forwards; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ───────── header */
.top { position: sticky; top: 0; z-index: 40; background: rgba(32,32,32,.82); backdrop-filter: blur(3px); border-bottom: 1px solid var(--line); }
.top-in { max-width: var(--wide); margin: 0 auto; padding: 10px var(--s-md); display: flex; align-items: center; gap: var(--s-md); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; color: var(--text); }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: linear-gradient(320deg, var(--primary) 43.69%, var(--primary-deep) 103.39%); box-shadow: 0 0 12px rgba(255,93,76,.55); }
.brand-word { font-size: var(--fs-body-lg); font-weight: 300; letter-spacing: var(--track); }
.brand-word b { font-weight: 500; }
.brand-word.small { font-size: var(--fs-body); }
.menu-toggle { display: none; border: 1px solid var(--line-2); background: transparent; border-radius: var(--r-pill); width: 40px; height: 40px; place-items: center; cursor: pointer; }
.nav { display: flex; gap: 2px; align-items: center; }
.group { position: relative; }
.nav-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 0; background: transparent;
  border-radius: var(--r-pill); color: var(--muted); font-size: var(--fs-label); font-weight: 400; cursor: pointer;
  transition: all var(--ease);
}
.nav-btn:hover, .group[aria-open="true"] .nav-btn { color: var(--text); background: var(--surface-2); }
.nav-btn.on { color: var(--text); box-shadow: inset 0 -2px 0 var(--primary); border-radius: var(--r-sm); }
.chev { opacity: .6; transition: transform var(--ease); }
.group[aria-open="true"] .chev { transform: rotate(180deg); }
.group[aria-open="true"] .menu::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.group[aria-open="true"]::after { content: ""; position: absolute; top: 100%; left: -20px; right: -20px; height: 16px; }
.menu {
  position: absolute; top: calc(100% + 10px); left: 0; z-index: 60; min-width: 250px; padding: 8px;
  display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r-md); box-shadow: var(--sh-lg); animation: come-in .2s ease-in-out;
}
.menu a { display: grid; gap: 1px; padding: 8px 12px; border-radius: 10px; color: var(--text-2); }
.menu a b { font-weight: 400; font-size: var(--fs-label); color: var(--text); }
.menu a span { font-size: var(--fs-small); color: var(--dim); }
.menu a:hover, .menu a:focus-visible { background: var(--surface-2); text-decoration: none; outline: none; }
.menu a.on { background: rgba(255,93,76,.12); }
.menu a.on b { color: var(--primary); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: var(--s-sm); }
.top-search { display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 40px; border: 1px solid var(--line-2); border-radius: var(--r-pill); color: var(--dim); background: transparent; transition: border-color var(--ease); }
.top-search:focus-within { border-color: var(--accent); color: var(--text); }
.top-search input { border: 0; background: transparent; color: var(--text); font: inherit; font-size: var(--fs-label); width: 150px; outline: none; }
.top-search input::placeholder { color: var(--dim); }
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: transparent; color: var(--muted); display: inline-grid; place-items: center; cursor: pointer; transition: all var(--ease); }
.icon-btn:hover { color: var(--text); border-color: var(--muted); }
.badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; display: grid; place-items: center; font-size: 11px; font-weight: 500; border-radius: var(--r-pill); background: var(--primary); color: #fff; }
.loadbar { height: 2px; width: 0; background: linear-gradient(90deg, transparent, var(--accent)); opacity: 0; transition: width .35s ease, opacity .3s ease; }
.loadbar.on { opacity: 1; }

@media (max-width: 991px) {
  .top-search input { width: 110px; }
}
@media (max-width: 575px) { .top-search { display: none; } .brand-word { font-size: var(--fs-body); } }

/* ───────── buttons, tags, chips, forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  font-weight: 400; font-size: var(--fs-label); line-height: 1; padding: 11px 20px; border-radius: var(--r-pill);
  border: 1px solid var(--line-2); background: transparent; color: var(--text); text-decoration: none; transition: all var(--ease);
}
.btn:hover { text-decoration: none; border-color: var(--muted); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { border-color: transparent; color: #fff; background: linear-gradient(320deg, var(--primary) 43.69%, var(--primary-deep) 103.39%); }
.btn-primary:hover { filter: brightness(1.08); color: #fff; }
.btn-accent { border-color: var(--accent); color: var(--accent); }
.btn-accent:hover { background: rgba(0,172,173,.12); color: var(--accent); }
.btn-ghost { border-color: transparent; color: var(--accent); padding: 8px 10px; }
.btn-ghost:hover { background: rgba(0,172,173,.1); }
.btn-sm { padding: 7px 14px; font-size: var(--fs-small); }
.btn svg { display: block; }
.tag {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  font-weight: 500; padding: 3px 8px; border-radius: var(--r-sm); border: 1px solid var(--line-2); color: var(--muted);
}
.tag.ok { color: var(--ok); border-color: rgba(97,162,41,.6); }
.tag.bad { color: var(--primary); border-color: rgba(255,93,76,.6); }
.tag.acc { color: var(--accent); border-color: rgba(0,172,173,.6); }
.tag.off { color: var(--dim); border-style: dashed; }
/* A write verb. Deliberately not .bad: POST is not an error, it is just the one thing on
   this API that changes something, and it should not read like a green GET either. */
.tag.warn { color: #E0A32E; border-color: rgba(224,163,46,.6); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--r-pill); font-size: var(--fs-small); border: 1px solid var(--line-2); color: var(--muted); background: transparent; white-space: nowrap; transition: all var(--ease); }
.chip b { font-weight: 500; color: var(--text); }
a.chip, button.chip { cursor: pointer; }
a.chip:hover, button.chip:hover { color: var(--text); border-color: var(--muted); text-decoration: none; }
.chip.on { color: var(--text); border-color: var(--primary); background: rgba(255,93,76,.12); }
.chip.acc { color: var(--accent); border-color: rgba(0,172,173,.6); }
.pip { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.chip.live .pip { background: var(--ok); box-shadow: 0 0 8px var(--ok); animation: pulse 2.4s infinite; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line-2); border-radius: var(--r-pill); flex-wrap: wrap; }
.seg > * { padding: 6px 12px; border: 0; background: transparent; border-radius: var(--r-pill); color: var(--muted); cursor: pointer; font-size: var(--fs-small); font-weight: 400; text-decoration: none; transition: all var(--ease); }
.seg > *:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.seg > .on { color: #fff; background: var(--primary); }
.field { display: grid; gap: 6px; }
.field > span, .field > label { font-size: var(--fs-small); color: var(--dim); letter-spacing: .04em; text-transform: uppercase; }
.input {
  width: 100%; min-height: 42px; padding: 8px 16px; font: inherit; font-size: var(--fs-label); color: var(--text);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-pill); caret-color: var(--accent); transition: border-color var(--ease);
}
.input:hover { border-color: var(--muted); }
.input:focus-visible { border-color: var(--accent); outline: none; }
select.input { cursor: pointer; appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: var(--s-md) 0; }
.toolbar .f { display: flex; align-items: center; gap: 8px; }
.toolbar .f > label { font-size: var(--fs-small); color: var(--dim); text-transform: uppercase; letter-spacing: .04em; }
.searchbox { position: relative; flex: 1 1 220px; max-width: 360px; }
.searchbox svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--dim); pointer-events: none; }
.searchbox .input { padding-left: 38px; }

/* ───────── page structure */
.page-head { margin-bottom: var(--s-lg); max-width: var(--prose); }
.kicker { font-size: var(--fs-small); letter-spacing: .14em; text-transform: uppercase; color: var(--primary); margin-bottom: 12px; font-weight: 500; }
.lede { color: var(--muted); font-size: var(--fs-body-lg); margin-top: var(--s-md); max-width: 62ch; }
.band { margin-top: var(--s-xl); }
.band-head { display: flex; align-items: baseline; gap: var(--s-md); margin-bottom: var(--s-md); flex-wrap: wrap; }
.band-head h2 { font-size: var(--fs-h-md); }
.band-head .meta { color: var(--dim); font-size: var(--fs-label); margin-left: auto; }
.g2 { display: grid; gap: var(--s-md); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { display: grid; gap: var(--s-md); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { display: grid; gap: var(--s-md); grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: 1 / -1; }
@media (max-width: 991px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) { .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); } .band { margin-top: var(--s-lg); } .page { padding-top: var(--s-md); } }

/* ───────── cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-md); min-width: 0; display: flex; flex-direction: column; }
.card-head { display: flex; align-items: center; gap: 10px; padding: var(--s-md) var(--s-md) 0; flex-wrap: wrap; }
.card-head h3 { font-size: var(--fs-title); }
.card-head .sp { flex: 1 1 auto; }
.card-body { padding: var(--s-md); min-width: 0; }
.card-body > :first-child { margin-top: 0; }
.card.flush .card-body { padding: 0; }
.card.accent { border-color: rgba(255,93,76,.45); }
.card.lift { box-shadow: var(--sh-lg); }
.absent {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 16px var(--s-md);
  border: 1px dashed var(--line-2); border-radius: var(--r-md); color: var(--dim); font-size: var(--fs-label); background: transparent;
}
.absent b { color: var(--text); font-weight: 400; }
.absent .tag { margin-left: auto; }
.err { padding: 16px var(--s-md); border: 1px solid rgba(206,62,47,.6); border-radius: var(--r-md); color: var(--text-2); font-size: var(--fs-label); background: rgba(206,62,47,.08); }
.err b { color: var(--primary); font-weight: 400; }
.empty { color: var(--dim); font-size: var(--fs-label); padding: 6px 0; }
.skel { border-radius: var(--r-md); background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.6s linear infinite; min-height: 14px; }
.skel + .skel { margin-top: 12px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; }
.st { padding: 16px var(--s-md); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.st .k { font-size: var(--fs-small); text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin-bottom: 6px; }
.st .v { font-size: var(--fs-h-md); font-weight: 300; letter-spacing: var(--track); line-height: 1; color: var(--text); overflow-wrap: anywhere; }
.st .v.sm { font-size: var(--fs-title); }
.st .v.acc { color: var(--primary); }
.st .sub { font-size: var(--fs-small); color: var(--dim); margin-top: 6px; }
.card .stats { border-radius: var(--r-lg) var(--r-lg) 0 0; overflow: hidden; }
.card .stats:last-child { border-radius: var(--r-lg); }
.card .stats:last-child .st { border-bottom: 0; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: var(--fs-label); }
.kv dt { color: var(--dim); } .kv dd { margin: 0; color: var(--text-2); overflow-wrap: anywhere; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-label); }
.list li:last-child { border-bottom: 0; }

/* big number with exact-on-hover */
.bn { position: relative; cursor: help; border-radius: var(--r-sm); }
.bn::after {
  content: attr(data-exact); position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%);
  padding: 6px 10px; border-radius: var(--r-sm); background: var(--surface-3); color: var(--text); border: 1px solid var(--line-2);
  font-size: var(--fs-small); font-weight: 400; letter-spacing: 0; white-space: nowrap; font-variant-numeric: tabular-nums;
  opacity: 0; pointer-events: none; transition: opacity var(--ease); z-index: 5; box-shadow: var(--sh-md);
}
.bn:hover::after, .bn:focus-visible::after { opacity: 1; }

/* bars */
.bar { height: 6px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary-deep), var(--primary)); transition: width .3s ease-out; }
.bar.teal i { background: var(--accent); }
.bar.soft { background: var(--surface-3); }
.barline { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 6px 0; font-size: var(--fs-label); }
.barline .lab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.barline .n { font-variant-numeric: tabular-nums; color: var(--muted); }
.barline .bar { grid-column: 1 / -1; }
a.barline-link { display: block; color: inherit; border-radius: var(--r-sm); }
a.barline-link:hover { text-decoration: none; background: var(--surface-2); }

/* tables */
.scroll { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-label); }
th, td { padding: 10px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); font-weight: 500; }
td { color: var(--text-2); }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background var(--ease); }
tbody tr:hover { background: var(--surface-2); }
th.n, td.n { text-align: right; font-variant-numeric: tabular-nums; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover, th.sortable.on { color: var(--text); }
.pos { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: var(--r-pill); font-size: var(--fs-small); color: var(--muted); border: 1px solid var(--line-2); font-variant-numeric: tabular-nums; }
tr.r1 .pos { color: #fff; background: var(--primary); border-color: var(--primary); }
tr.r2 .pos, tr.r3 .pos { color: var(--text); border-color: var(--muted); }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who > a, .who > span { overflow: hidden; text-overflow: ellipsis; }
td .val { font-weight: 400; color: var(--text); }
.delta { font-variant-numeric: tabular-nums; font-size: var(--fs-small); }
.delta.up { color: var(--ok); } .delta.down { color: var(--primary); } .delta.flat { color: var(--dim); }

/* avatars */
.av { position: relative; width: 28px; height: 28px; flex: none; border-radius: var(--r-sm); background: var(--surface-3); display: grid; place-items: center; font-size: var(--fs-small); color: var(--muted); overflow: hidden; }
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.av.lg { width: 40px; height: 40px; border-radius: 6px; }
.face { position: relative; width: 96px; height: 96px; border-radius: var(--r-md); background: var(--surface-3); display: grid; place-items: center; font-size: var(--fs-h-md); font-weight: 300; color: var(--muted); overflow: hidden; }
.face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.pref { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.pref:hover { text-decoration: none; color: var(--accent); }

/* ───────── item tiles, frames, tooltips */
.frame { position: relative; width: 100%; aspect-ratio: 1; border-radius: 8px; background: var(--surface-3); border: 1px solid var(--line-2); display: grid; place-items: center; overflow: hidden; }
.frame.q { border-color: transparent; background-color: transparent; }
.frame img { width: 78%; height: 78%; object-fit: contain; image-rendering: pixelated; }
.frame .none, .frame .ini { font-size: var(--fs-small); color: var(--dim); text-align: center; padding: 4px; }
.frame .ini { font-size: var(--fs-title); color: var(--muted); }
/* xs: an icon that sits INSIDE a chip. The base .frame is width:100%, so a frame with no
   size class inside inline text stretches to the container and wrecks the row. */
.frame.xs { width: 18px; flex: none; border-radius: 4px; }
.frame.sm { width: 32px; flex: none; border-radius: 5px; }
.frame.md { width: 48px; flex: none; }
.tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.tiles.wide { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line); color: var(--text-2); transition: all var(--ease); min-width: 0;
}
a.tile:hover, .tile:focus-within { border-color: var(--line-2); text-decoration: none; color: var(--text-2); transform: translateY(-2px); box-shadow: var(--sh-md); }
.tile .frame { width: 64px; margin: 0 auto 4px; }
.tile .nm { font-size: var(--fs-label); color: var(--text); line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 2.5em; }
.tile .px { font-size: var(--fs-label); display: flex; flex-direction: column; gap: 1px; }
.tile .px b { font-weight: 400; color: var(--text); font-variant-numeric: tabular-nums; }
.tile .px .sub { font-size: var(--fs-small); color: var(--dim); }
.tile .id { font-size: var(--fs-small); color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .add { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); cursor: pointer; line-height: 1; font-size: 16px; opacity: 0; transition: all var(--ease); }
.tile:hover .add, .tile .add:focus-visible { opacity: 1; }
.tile .add:hover { border-color: var(--accent); color: var(--accent); }
.imark { position: absolute; top: 8px; left: 8px; display: flex; gap: 3px; z-index: 1; }
.imark b { font-size: 10px; font-weight: 500; padding: 2px 5px; border-radius: var(--r-sm); background: var(--bg); color: var(--text); border: 1px solid var(--line-2); }
.imark b.lg { color: var(--primary); }
.echips { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: middle; }
.echip { font-size: 11px; padding: 1px 6px; border-radius: var(--r-sm); border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.echip.more { color: var(--dim); }
.ihost { position: relative; display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; border-radius: var(--r-sm); }
.slotgrid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.slot { position: relative; display: grid; gap: 4px; padding: 10px; border-radius: var(--r-md); background: var(--surface-3); border: 1px solid var(--line); text-align: center; }
.slot .frame { width: 56px; margin: 0 auto; }
.slot .nmm { font-size: var(--fs-small); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot .lbl { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }

.tip-layer { position: fixed; inset: 0; pointer-events: none; z-index: 80; }
.itip {
  position: fixed; width: 300px; max-width: calc(100vw - 20px); padding: 12px 14px; border-radius: var(--r-md);
  background: rgba(32,32,32,.96); border: 1px solid var(--line-2); box-shadow: var(--sh-lg); font-size: var(--fs-label);
  color: var(--text-2); pointer-events: none; opacity: 0; transition: opacity .15s linear;
}
.itip.show { opacity: 1; }
.itip .nm { font-size: var(--fs-body); font-weight: 400; color: var(--text); }
.itip .sub { color: var(--dim); font-size: var(--fs-small); margin-top: 2px; }
.itip .rar { font-size: var(--fs-small); text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; }
.itip .lore { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: var(--fs-small); line-height: 1.45; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.itip .ench { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.itip .e-row { display: grid; gap: 1px; font-size: var(--fs-small); }
.itip .e-nm { font-weight: 500; }
.itip .e-bon { color: var(--muted); }
.itip .e-row.off { opacity: .55; }
.itip .e-off { color: var(--dim); font-style: italic; }
.itip .dur { margin-top: 10px; display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; font-size: var(--fs-small); color: var(--muted); font-variant-numeric: tabular-nums; }
.itip .dur .bar { height: 5px; }
.itip .dur .bar i { background: var(--accent); }
.itip .note { margin-top: 10px; font-size: 11px; color: var(--dim); font-style: italic; }

/* ───────── hero + landing */
.hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--s-lg); align-items: center; padding: var(--s-md) 0 var(--s-lg); }
.hero h1 { font-size: clamp(38px, 6vw, var(--fs-display)); }
.hero .lede { max-width: 54ch; }
.hero-form { display: flex; gap: 8px; margin-top: var(--s-lg); max-width: 520px; }
.hero-form .input { flex: 1 1 auto; }
.hint { font-size: var(--fs-small); color: var(--dim); margin-top: 8px; min-height: 1.4em; }
.hint.bad { color: var(--primary); }
.handshake { padding: var(--s-md); border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--sh-md); }
.handshake .code { margin-top: 12px; }
.code { position: relative; font-family: var(--mono); font-size: 13px; line-height: 1.5; padding: 14px 16px; border-radius: var(--r-md); background: var(--bg); border: 1px solid var(--line); color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.code .cp { position: absolute; top: 6px; right: 6px; }
.code .jk { color: var(--accent); } .code .js { color: #FFAB91; } .code .jn { color: var(--text); } .code .jb { color: var(--primary); }
.statband { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-md); padding: var(--s-lg); border-radius: var(--r-lg); background: linear-gradient(320deg, var(--primary) 43.69%, var(--primary-deep) 103.39%); color: #fff; box-shadow: var(--sh-lg); }
.statband .k { font-size: var(--fs-small); letter-spacing: .1em; text-transform: uppercase; opacity: .9; }
.statband .v { font-size: clamp(var(--fs-h-md), 4vw, var(--fs-display)); line-height: 1; letter-spacing: var(--track); margin-top: 8px; }
.statband .sub { font-size: var(--fs-label); opacity: .9; margin-top: 6px; }
.statband a { color: #fff; text-decoration: underline; }
@media (max-width: 991px) { .hero { grid-template-columns: minmax(0, 1fr); } .statband { grid-template-columns: minmax(0, 1fr); padding: var(--s-md); } .hero-form { flex-direction: column; } }

/* ───────── profile */
.profile { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: var(--s-lg); align-items: start; }
.rail { position: sticky; top: 76px; display: grid; gap: var(--s-md); }
.idcard { padding: var(--s-md); }
.idcard .name { font-size: var(--fs-h-md); letter-spacing: var(--track); color: var(--text); margin-top: 14px; overflow-wrap: anywhere; }
.idcard .uuid { font-size: 11px; color: var(--faint); margin-top: 4px; overflow-wrap: anywhere; }
.idcard .meta { display: grid; gap: 6px; margin-top: 14px; font-size: var(--fs-label); color: var(--dim); }
.idcard .meta b { color: var(--text-2); font-weight: 400; }
.secnav { display: grid; padding: 8px; }
.secnav a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; color: var(--muted); font-size: var(--fs-label); }
.secnav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.secnav a.on { color: var(--text); background: rgba(255,93,76,.12); box-shadow: inset 2px 0 0 var(--primary); }
.secnav a .c { font-size: 11px; color: var(--dim); }
.section { scroll-margin-top: 80px; }
@media (max-width: 991px) {
  .profile { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; }
  .secnav { display: flex; overflow-x: auto; gap: 4px; }
  .secnav a { white-space: nowrap; }
}
.crest { width: 64px; height: 64px; flex: none; }
.crest svg { width: 100%; height: 100%; display: block; }

/* compare */
.cmp-head { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--s-md); align-items: center; }
.cmp-side { display: flex; align-items: center; gap: 12px; }
.cmp-side.b { justify-content: flex-end; text-align: right; }
.cmp-vs { text-align: center; font-size: var(--fs-h-md); letter-spacing: var(--track); color: var(--text); }
.cmprow { display: grid; grid-template-columns: 1fr minmax(90px, auto) 1fr; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-label); }
.cmprow:last-child { border-bottom: 0; }
.cmprow .lab { text-align: center; color: var(--dim); font-size: var(--fs-small); text-transform: uppercase; letter-spacing: .06em; }
.sideval { display: grid; gap: 6px; }
.sideval.a { text-align: right; } .sideval.a .track { direction: rtl; }
.sideval span { font-variant-numeric: tabular-nums; color: var(--text); }
.track { height: 6px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.track i { display: block; height: 100%; background: var(--line-2); }
.cmprow.win-a .track i.a, .cmprow.win-b .track i.b { background: var(--primary); }

/* ───────── countdowns, bosses */
.cd-box { display: grid; gap: 6px; justify-items: start; }
.cd { font-size: clamp(var(--fs-h-md), 4vw, var(--fs-display)); letter-spacing: var(--track); line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.cd.soon { color: var(--primary); }
.cd.off { color: var(--dim); font-size: var(--fs-title); }
.cd-when { font-size: var(--fs-label); color: var(--muted); }
.portrait { width: 72px; height: 72px; border-radius: var(--r-md); background: var(--surface-3); display: grid; place-items: center; overflow: hidden; flex: none; color: var(--dim); font-size: var(--fs-title); }
.portrait img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.portrait.lg { width: 112px; height: 112px; }

/* ───────── chart */
.chart { position: relative; width: 100%; height: 240px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--dim); font-size: 11px; font-family: var(--font); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: url(#chartFill); }
.chart .dot { fill: var(--accent); }
.chart .knob { fill: var(--primary); }
.chart .cross { stroke: var(--line-2); stroke-dasharray: 3 3; }
.chart-tip { position: absolute; top: 0; padding: 6px 10px; border-radius: var(--r-sm); background: var(--surface-3); border: 1px solid var(--line-2); font-size: var(--fs-small); color: var(--text); pointer-events: none; white-space: nowrap; transform: translateX(-50%); box-shadow: var(--sh-md); }
.chart-tip .t { color: var(--dim); }

/* ───────── API explorer / docs */
.probe { border-bottom: 1px solid var(--line); }
.probe:last-child { border-bottom: 0; }
.probe summary { display: flex; align-items: center; gap: 12px; padding: 12px var(--s-md); cursor: pointer; list-style: none; flex-wrap: wrap; }
.probe summary::-webkit-details-marker { display: none; }
.probe summary:hover { background: var(--surface-2); }
.probe .verb { font-size: 11px; font-weight: 500; letter-spacing: .08em; color: var(--accent); }
.probe .p { font-family: var(--mono); font-size: 13px; color: var(--text); overflow-wrap: anywhere; flex: 1 1 200px; }
.probe .ptags { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.probe .ms { font-size: var(--fs-small); color: var(--dim); font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }
.probe .pbody { padding: 0 var(--s-md) var(--s-md); display: grid; gap: 12px; }
.probe.skip summary { opacity: .6; }
.json { max-height: 420px; overflow: auto; font-size: 12.5px; }
.endpoint { padding: 14px 0; border-bottom: 1px solid var(--line); }
.endpoint:last-child { border-bottom: 0; }
.endpoint .sig { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.endpoint .sig code { color: var(--text); font-size: 13.5px; overflow-wrap: anywhere; }
.endpoint p { font-size: var(--fs-label); color: var(--muted); margin-top: 6px; max-width: 74ch; }
.endpoint .code { margin-top: 10px; }
.toc { display: flex; flex-wrap: wrap; gap: 6px; }

/* ───────── drawer, toasts, footer */
.drawer { position: fixed; inset: 0; z-index: 70; }
.drawer-back { position: absolute; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(3px); }
.drawer-box { position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: var(--bg-2); border-left: 1px solid var(--line-2); box-shadow: var(--sh-lg); display: flex; flex-direction: column; animation: come-in .3s ease-out; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s-md); border-bottom: 1px solid var(--line); }
.drawer-body { padding: var(--s-md); overflow: auto; }
.brow { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-label); }
.brow .qty { display: inline-flex; align-items: center; gap: 4px; }
.brow .qty button { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; cursor: pointer; }
.brow .qty button:hover { border-color: var(--accent); color: var(--accent); }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 90; pointer-events: none; }
.toast { padding: 10px 18px; border-radius: var(--r-pill); background: var(--surface-3); border: 1px solid var(--line-2); color: var(--text); font-size: var(--fs-label); box-shadow: var(--sh-lg); animation: come-in .3s ease-out; }
.foot { border-top: 1px solid var(--line); margin-top: var(--s-xl); padding: var(--s-lg) 0; color: var(--dim); }
.foot-in { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--s-lg); align-items: start; }
.foot-note { font-size: var(--fs-label); max-width: 52ch; margin-top: 10px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: var(--fs-label); justify-content: flex-end; }
.foot-links a { color: var(--muted); }
.foot-meta { grid-column: 1 / -1; font-size: 11px; color: var(--faint); }
@media (max-width: 767px) { .foot-in { grid-template-columns: minmax(0, 1fr); } .foot-links { justify-content: flex-start; } }

/* util */
.items-note { font-size: var(--fs-small); color: var(--dim); margin-top: 12px; }
.assetgrid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.assetgrid .tile { padding: 8px; gap: 4px; }
.assetgrid .tile .frame { width: 48px; }
.assetgrid .tile .nm { font-size: var(--fs-small); min-height: 2.4em; }
.catlist { columns: 3; column-gap: var(--s-md); font-size: var(--fs-label); }
.catlist > div { break-inside: avoid; padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; }
.catlist code { color: var(--dim); font-size: 12px; }
@media (max-width: 991px) { .catlist { columns: 2; } }
@media (max-width: 575px) { .catlist { columns: 1; } .st { padding: 12px 14px; } .card-body, .card-head { padding-left: 14px; padding-right: 14px; } }


/* ═══════════ MD layout pass: 767px container, section rhythm, glass pill bar ═══════════ */
.wrap { max-width: var(--prose); padding: 0 var(--s-md); }
.page { padding: 80px 0 120px; }
.page-head { margin-bottom: var(--s-xl); max-width: none; }
.page-head h1 { font-size: clamp(var(--fs-h-lg), 6vw, var(--fs-display)); }
.lede { font-size: var(--fs-body-lg); max-width: none; }
.band { margin-top: 80px; }
.band-head { margin-bottom: 30px; }
.band-head h2 { font-size: var(--fs-h-lg); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* Only data breaks out of the 767px column: grids, tiles, the profile and any card holding a table.
   The pull is measured from the element's OWN containing block, so it is only right for a block
   sitting directly in the prose column. Anything already inside something that broke out -- the
   profile's two columns, a cell of a g2/g3/g4, a card -- must be left alone: applying it again
   re-centres a 1200px box on an 880px column and lands it on top of the rail. */
.page :not(.card *, .profile *, .g2 *, .g3 *, .g4 *, .tiles *, .statband *, .cmp-head *, .assetgrid *, .catlist *):is(.g2, .g3, .g4, .tiles, .profile, .statband, .cmp-head, .breakout, .card:has(.scroll), .card:has(.tiles), .card:has(.slotgrid), .card:has(.probe), .card:has(.chart), .assetgrid, .catlist) {
  width: min(var(--wide), 100vw - 40px); margin-left: calc(50% - min(var(--wide), 100vw - 40px) / 2);
}
.page > .card:has(.scroll), .page :not(.card *).card { position: relative; }
@media (max-width: 991px) { .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) { .g3 { grid-template-columns: minmax(0, 1fr); } .page { padding: 40px 0 80px; } .band { margin-top: 60px; } }
/* A fixed 2- or 3-up grid holding FEWER cards than it has columns leaves the empty tracks on the
   right and the row reads as pushed to the left -- two world bosses in a three-column grid sit at
   4/10ths of the page. Size the tracks to the cards and centre what there is. Nothing changes for
   a full row: auto-fit lays out the same tracks and centring a full row is a no-op. */
.g2:not(:has(> :nth-child(2))), .g3:not(:has(> :nth-child(3))) {
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 386px));
  justify-content: center;
}

/* header: a floating glass pill, 767 wide */
.top { position: sticky; top: 0; z-index: 40; background: transparent; backdrop-filter: none; border-bottom: 0; padding: 12px var(--s-md) 0; pointer-events: none; }
.top-in {
  pointer-events: auto; max-width: var(--prose); margin: 0 auto; padding: 6px 6px 6px 18px; gap: 12px;
  background: rgba(46,46,46,.72); backdrop-filter: blur(3px); border: 1px solid var(--line); border-radius: var(--r-pill); box-shadow: var(--sh-md);
}
.brand-word { font-size: var(--fs-body); }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a { padding: 9px 14px; border-radius: var(--r-pill); color: var(--muted); font-size: var(--fs-label); font-weight: 400; transition: all var(--ease); white-space: nowrap; }
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav a.on { color: #fff; background: linear-gradient(320deg, var(--primary) 43.69%, var(--primary-deep) 103.39%); }
.top-right { margin-left: 0; gap: 4px; }
.top-search { height: 36px; border-color: transparent; padding: 0 12px; }
.top-search:focus-within { border-color: var(--accent); }
.top-search input { width: 90px; }
.icon-btn { width: 36px; height: 36px; border-color: transparent; }
.subnav { pointer-events: auto; max-width: var(--prose); margin: 8px auto 0; display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; padding: 0 6px; }
.subnav a { padding: 6px 12px; border-radius: var(--r-pill); font-size: var(--fs-small); color: var(--dim); border: 1px solid transparent; transition: all var(--ease); white-space: nowrap; }
.subnav a:hover { color: var(--text); text-decoration: none; border-color: var(--line-2); }
.subnav a.on { color: var(--accent); border-color: var(--accent); }
.loadbar { position: absolute; left: 0; right: 0; top: 0; }
@media (max-width: 767px) {
  .top-in { flex-wrap: wrap; padding: 8px 10px; border-radius: 22px; }
  .nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; justify-content: flex-start; }
  .top-right { margin-left: auto; }
  .top-search { display: flex; } .top-search input { width: 70px; }
}
@media (max-width: 575px) { .top-search { display: none; } }

/* hero on the landing: display type, 120px rhythm, one idea */
.hero { display: block; padding: 60px 0 40px; }
.hero h1 { font-size: clamp(40px, 7vw, var(--fs-display)); max-width: 14ch; }
.hero .lede { max-width: none; }
.hero-form { max-width: none; }
.handshake { margin-top: 0; }
.statband { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.build { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-md); }
.build a { display: grid; gap: 10px; padding: 30px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-md); color: var(--text-2); transition: all var(--ease); }
.build a:hover { text-decoration: none; border-color: var(--line-2); transform: translateY(-2px); color: var(--text-2); }
.build h3 { font-size: var(--fs-title); }
.build p { font-size: var(--fs-label); color: var(--muted); }
@media (max-width: 767px) { .build { grid-template-columns: minmax(0, 1fr); } }
.foot-in { max-width: var(--prose); }
