/* E7 Codex — one stylesheet, no build step, no framework. */

:root {
  --bg: #14141a;
  --panel: #1c1c24;
  --panel-2: #23232d;
  --line: #32323e;
  --text: #e9e4d8;
  --muted: #8d8d9b;
  --gold: #d8b263;
  --fire: #e06b4a;
  --ice: #56a8dd;
  --earth: #63b06a;
  --light: #ddc76a;
  --dark: #a173c9;
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }

/* Global UI scale. Root font-size is 125% and every length below is in rem, so the
   whole UI — font, icons, cards, spacing — scales together off this one value.
   Deliberately NOT `zoom`: zoom desynchronises click hit-testing from the visual
   position in some Chromium versions, which broke every link. rem has no such risk. */
:root { font-size: 125%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 0.9375rem/1.55 "Segoe UI", system-ui, -apple-system, sans-serif;
}

kbd {
  font: 0.6875rem/1 ui-monospace, monospace;
  border: 0.0625rem solid var(--line);
  border-radius: 0.25rem;
  padding: 0.1875rem 0.3125rem;
  color: var(--muted);
  background: var(--panel-2);
}

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 0.875rem;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: rgba(20, 20, 26, .96);
  border-bottom: 0.0625rem solid var(--line);
  backdrop-filter: blur(0.375rem);
}
.topbar h1 { margin: 0; font-size: 1.1875rem; letter-spacing: .04em; cursor: pointer; }
.topbar h1 span { color: var(--gold); }

.search-wrap { position: relative; flex: 1; max-width: 28.75rem; }
.search {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 0.0625rem solid var(--line);
  border-radius: 0.375rem;
  background: #101015;
  color: var(--text);
  font: inherit;
}
.search:focus { outline: 0.125rem solid var(--gold); outline-offset: -0.0625rem; }
.search-hint { position: absolute; right: 0.625rem; top: 0.4375rem; pointer-events: none; }

.sort { display: flex; align-items: center; gap: 0.4375rem; font-size: 0.8125rem; }
.sort select {
  background: var(--panel-2); color: var(--text); font: inherit; font-size: 0.8125rem;
  border: 0.0625rem solid var(--line); border-radius: 0.375rem; padding: 0.375rem 0.5rem; cursor: pointer;
}

.count { color: var(--muted); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }

.ghost {
  background: none; border: 0.0625rem solid var(--line); color: var(--muted);
  border-radius: 0.375rem; padding: 0.375rem 0.625rem; cursor: pointer; font-size: 0.875rem;
}
.ghost:hover { color: var(--text); border-color: var(--gold); }

/* -------------------------------------------------------------- provenance */
.meta {
  padding: 0.75rem 1.25rem; background: var(--panel);
  border-bottom: 0.0625rem solid var(--line); font-size: 0.8125rem;
}
.meta-intro { color: var(--muted); margin: 0 0 0.5rem; }
.meta-row { display: flex; gap: 1rem; align-items: baseline; padding: 0.1875rem 0; }
.meta-provides { flex: 1; color: var(--text); }
.meta-src {
  color: var(--gold); text-decoration: none; white-space: nowrap; font-weight: 600;
}
.meta-src:hover { text-decoration: underline; }
.meta-src::after { content: " ↗"; color: var(--muted); font-weight: 400; }
.meta-row.coverage {
  gap: 1.375rem; margin-top: 0.625rem; border-top: 0.0625rem solid var(--line); padding-top: 0.5rem;
  color: var(--muted);
}

/* ----------------------------------------------------------------- filters */
.filters {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.125rem; align-items: center;
  padding: 0.75rem 1.25rem; border-bottom: 0.0625rem solid var(--line);
}
.filter-group { display: flex; gap: 0.375rem; flex-wrap: wrap; align-items: center; }
.group-label {
  font-size: 0.6875rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin-right: 0.125rem;
}
.zodiac-row { flex-basis: 100%; padding-top: 0.25rem; }

.chip {
  padding: 0.3125rem 0.6875rem; border: 0.0625rem solid var(--line); border-radius: 62.4375rem;
  background: var(--panel); color: var(--muted); cursor: pointer;
  font: inherit; font-size: 0.8125rem; transition: background .12s, color .12s, border-color .12s;
}
.chip:hover { color: var(--text); border-color: #4a4a58; }
.chip.active { background: var(--gold); border-color: var(--gold); color: #221b09; font-weight: 600; }
.chip.clear { border-style: dashed; margin-left: auto; }
.toggle-more { display: flex; gap: 0.25rem; align-items: center; }

/* Element chips carry their own colour when active — faster to scan than text. */
.chip-fire.active  { background: var(--fire);  border-color: var(--fire);  color: #2a0f08; }
.chip-ice.active   { background: var(--ice);   border-color: var(--ice);   color: #04202f; }
.chip-earth.active { background: var(--earth); border-color: var(--earth); color: #06210a; }
.chip-light.active { background: var(--light); border-color: var(--light); color: #2a2205; }
.chip-dark.active  { background: var(--dark);  border-color: var(--dark);  color: #1e0e2b; }

/* -------------------------------------------------------------------- grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.75rem, 1fr));
  gap: 0.625rem;
  padding: 1.125rem 1.25rem 3.75rem;
}
.card {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 0.3125rem;
  padding: 0.75rem 0.5rem 0.625rem;
  border: 0.0625rem solid var(--line);
  border-top: 0.125rem solid var(--line);   /* the element stripe */
  border-radius: 0.625rem;
  background: var(--panel); color: inherit; cursor: pointer; font: inherit;
  text-decoration: none;   /* it is an <a> so middle-click opens a new tab */
  transition: border-color .12s, transform .12s, background .12s;
}
.card:hover { transform: translateY(-0.125rem); background: var(--panel-2); }
.card:focus-visible { outline: 0.125rem solid var(--gold); outline-offset: 0.125rem; }

/* A colour stripe reads faster than the word, and survives at small sizes. */
.edge-fire  { border-top-color: var(--fire); }
.edge-ice   { border-top-color: var(--ice); }
.edge-earth { border-top-color: var(--earth); }
.edge-light { border-top-color: var(--light); }
.edge-dark  { border-top-color: var(--dark); }

.icon { width: 4rem; height: 4rem; border-radius: 0.5rem; }
.no-icon {
  width: 4rem; height: 4rem; border-radius: 0.5rem; background: var(--panel-2);
  display: grid; place-items: center; color: var(--muted);
}
.card-name { font-size: 0.8125rem; text-align: center; line-height: 1.25; }
.card-meta {
  display: flex; gap: 0.375rem; font-size: 0.6875rem; color: var(--muted);
  flex-wrap: wrap; justify-content: center;
}
.card-stars { color: var(--gold); font-size: 0.6875rem; letter-spacing: -0.0625rem; }
.match-hint {
  font-size: 0.625rem; color: var(--gold); border: 0.0625rem dashed #4a3d1e;
  border-radius: 62.4375rem; padding: 0.0625rem 0.4375rem; margin-top: 0.125rem;
}
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 3.75rem; }

/* element colours — the game's palette, using the game's names */
.el-fire { color: var(--fire); }
.el-ice { color: var(--ice); }
.el-earth { color: var(--earth); }
.el-light { color: var(--light); }
.el-dark { color: var(--dark); }

/* ------------------------------------------------------------------ detail */
.detail { max-width: 55rem; margin: 0 auto; padding: 1.125rem 1.25rem 5rem; }
.back {
  display: flex; gap: 0.5rem; align-items: center;
  background: none; border: 0; color: var(--muted); cursor: pointer;
  font: inherit; padding: 0.375rem 0; margin-bottom: 0.75rem;
}
.back:hover { color: var(--gold); }

/* Built around the banner's 204x89 shape: it sits as a full-width strip with the
   title beneath, rather than pretending to be a portrait beside the text. */
.hero-head {
  display: flex; gap: 1.125rem; align-items: center;
  border: 0.0625rem solid var(--line);
  border-top: 0.1875rem solid var(--line);
  border-radius: 0.75rem;
  background: var(--panel);
  padding: 1rem 1.125rem;
  margin-bottom: 1rem;
}
.hero-art { flex: none; }
/* Never upscale past the source (436x206) and never crop — the art is wide by
   nature, and stretching it is what produced the eyeball close-up. */
.portrait {
  display: block; width: 100%; max-width: 18.75rem; height: auto;
  object-fit: contain;
  border-radius: 0.625rem; background: var(--panel-2);
}
.hero-title { min-width: 0; }
.hero-name-row { display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
.hero-name-row h2 { margin: 0; font-size: 1.6875rem; letter-spacing: .01em; }
.stars { color: var(--gold); letter-spacing: -0.0625rem; }
.tagline { margin: 0.375rem 0 0.625rem; color: var(--gold); font-size: 0.9375rem; }
.badges { display: flex; gap: 0.75rem; flex-wrap: wrap; font-size: 0.8125rem; color: var(--muted); }
.badges .code { font-family: ui-monospace, monospace; font-size: 0.75rem; opacity: .7; }

.panel {
  border: 0.0625rem solid var(--line); border-radius: 0.625rem;
  background: var(--panel); padding: 0.875rem 1rem; margin-bottom: 0.875rem;
}
.panel h3 {
  margin: 0 0 0.625rem; font-size: 0.8125rem; text-transform: uppercase;
  letter-spacing: .08em; color: var(--gold);
}
.panel h4 { margin: 1rem 0 0.5rem; font-size: 0.8125rem; color: var(--muted); }
.panel p { margin: 0 0 0.5rem; }
.muted { color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; }

/* Aligned key/value table — used by Stats and Profile. One label/value pair per
   row: a fixed label column so every value starts at the same left edge, and the
   value taking the rest of the width. Reads top-to-bottom as a clean list. */
.kv {
  width: 100%; border-collapse: collapse;
  display: grid; grid-template-columns: max-content 1fr;
}
.kv tr { display: contents; }
.kv th, .kv td {
  padding: 0.4375rem 0; font-size: 0.8125rem; text-align: left;
  border-top: 0.0625rem solid var(--line); vertical-align: top;
}
.kv th {
  color: var(--muted); font-weight: 400; white-space: nowrap; padding-right: 1.5rem;
}
.kv td { color: var(--text); font-variant-numeric: tabular-nums; }
/* No rule above the first row. */
.kv tr:first-child th, .kv tr:first-child td { border-top: 0; }

/* Per-set builds table. */
.table-scroll { overflow-x: auto; }
.builds {
  width: 100%; border-collapse: collapse; font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}
.builds th, .builds td {
  padding: 0.375rem 0.5rem; text-align: right; white-space: nowrap;
  border-top: 0.0625rem solid var(--line);
}
.builds thead th { border-top: 0; color: var(--muted); font-weight: 400; }
.builds .l { text-align: left; }
.builds td.l { color: var(--text); }
.builds .share { text-align: left; display: flex; align-items: center; gap: 0.5rem; min-width: 5.75rem; }
.builds tbody tr:hover { background: var(--panel-2); }
.bar.mini { width: 2.875rem; flex: none; }

.skill { display: flex; gap: 0.75rem; padding: 0.75rem 0; border-top: 0.0625rem solid var(--line); }
.skill:first-of-type { border-top: 0; padding-top: 0.125rem; }
.skill-icon { width: 2.875rem; height: 2.875rem; border-radius: 0.5rem; flex: none; }
.skill-icon-none {
  display: grid; place-items: center;
  background: var(--panel-2); border: 0.0625rem dashed var(--line);
  color: var(--muted); font-size: 0.6875rem; letter-spacing: .04em;
}
/* flex: 1 so the body fills the row regardless of how short the skill text is —
   without it a one-line skill shrinks the enhancement table and its costs wrap. */
.skill-body { flex: 1; min-width: 0; }
.skill-head {
  display: flex; gap: 0.625rem; align-items: baseline; margin-bottom: 0.3125rem; flex-wrap: wrap;
}
.slot {
  font-size: 0.6875rem; color: var(--gold); background: #2a2417;
  border-radius: 0.25rem; padding: 0.125rem 0.375rem; letter-spacing: .04em;
}
.skill-name { font-weight: 600; }
.src {
  margin-left: auto; font-size: 0.6875rem; padding: 0.0625rem 0.4375rem; border-radius: 62.4375rem;
  border: 0.0625rem dashed #4a3d1e; color: var(--gold);
}
.soulburn { color: var(--ice); font-size: 0.8125rem; }

/* Skill enhancement levels — collapsed by default. */
.enh-toggle {
  display: inline-flex; gap: 0.375rem; align-items: center; margin-top: 0.25rem;
  background: none; border: 0; padding: 0.125rem 0; cursor: pointer;
  color: var(--gold); font: inherit; font-size: 0.8125rem;
}
.enh-toggle:hover { text-decoration: underline; }
.enh { width: 100%; border-collapse: collapse; margin: 0.375rem 0 0.125rem; font-size: 0.8125rem; }
.enh tr { border-top: 0.0625rem solid var(--line); }
.enh td { padding: 0.3125rem 0.5rem 0.3125rem 0; vertical-align: top; }
.enh-lv { width: 2.125rem; color: var(--gold); font-variant-numeric: tabular-nums; }
.enh-effect { width: 42%; }
.enh-cost { color: var(--muted); }
.cost {
  display: inline-flex; align-items: center; gap: 0.25rem;
  margin-right: 0.75rem; white-space: nowrap;
}
.cost-icon { width: 1.125rem; height: 1.125rem; vertical-align: middle; }
.cost b { color: var(--text); font-variant-numeric: tabular-nums; }
.enhance { color: var(--muted); font-size: 0.8125rem; }

.profile { display: grid; grid-template-columns: repeat(auto-fit, minmax(15.625rem, 1fr)); gap: 0.5rem; margin: 0; }
.profile div { display: flex; gap: 0.5rem; }
.profile dt { color: var(--muted); min-width: 6rem; flex: none; }
.profile dd { margin: 0; }

.note { color: var(--muted); font-size: 0.8125rem; }

.bar-row { display: flex; align-items: center; gap: 0.625rem; margin-bottom: 0.3125rem; font-size: 0.8125rem; }
.bar-label { width: 13.125rem; flex: none; color: var(--muted); }
.bar { flex: 1; height: 0.5rem; background: var(--panel-2); border-radius: 0.25rem; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--gold); }
.bar-n { width: 2.625rem; text-align: right; font-variant-numeric: tabular-nums; }

.nav-hint { text-align: center; font-size: 0.75rem; margin-top: 1.125rem; }

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; }
  .search-wrap { order: 3; flex-basis: 100%; max-width: none; }
  .hero-head { flex-direction: column; align-items: stretch; }
  .portrait { max-width: 100%; }
  .bar-label { width: 7.5rem; }
  .profile dt { min-width: 4.875rem; }
}

/* ------------------------------------------------------ view tabs + artifacts */
.viewtabs { display: flex; gap: 0.25rem; background: var(--panel-2); padding: 0.1875rem; border-radius: 0.5rem; }
.viewtabs button {
  border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 0.8125rem;
  padding: 0.3125rem 0.875rem; border-radius: 0.375rem; cursor: pointer;
}
.viewtabs button:hover { color: var(--text); }
.viewtabs button.active { background: var(--gold); color: #221b09; font-weight: 600; }

/* Rarity edge on artifact cards, mirroring the element stripe on hero cards. */
.rar-5 { border-top-color: var(--gold); }
.rar-4 { border-top-color: var(--dark); }
.rar-3 { border-top-color: var(--ice); }
.rar-2 { border-top-color: var(--muted); }
.rar-edge-5 { border-color: var(--gold); }
.rar-edge-4 { border-color: var(--dark); }
.rar-edge-3 { border-color: var(--ice); }

/* Letter placeholder until artifact art is extracted from data.pack. */
.art-mark {
  font-size: 1.625rem; font-weight: 700; color: var(--gold); background: var(--panel-2);
}
.art-detail-mark {
  width: 6rem; height: 6rem; border-radius: 0.625rem; background: var(--panel-2);
  display: grid; place-items: center; font-size: 2.5rem; font-weight: 700; color: var(--gold);
  flex: none;
}

/* A build/used-by row that is itself a link. The name carries a persistent (but
   faint) underline so it reads as clickable at rest, which solidifies to gold on
   hover along with a ↗ hint. */
a.used-row { text-decoration: none; color: inherit; border-radius: 0.375rem; cursor: pointer; }
a.used-row .bar-label { text-decoration: underline; text-decoration-color: var(--line);
  text-underline-offset: 0.1875rem; transition: text-decoration-color .12s, color .12s; }
a.used-row:hover { background: var(--panel-2); }
a.used-row:hover .bar-label { color: var(--gold); text-decoration-color: var(--gold); }
a.used-row:hover .bar-label::after { content: " ↗"; font-size: 0.6875rem; color: var(--muted); }

/* Clickable badge (exclusive hero) in the artifact detail header. */
.badge-link { color: var(--gold); text-decoration: none; font-weight: 600; }
.badge-link:hover { text-decoration: underline; }

/* Artifact full illustration in the detail header — tall (378x598), so cap the
   height rather than the width, and never upscale past the source. */
.art-portrait {
  display: block; height: auto; max-height: 15rem; max-width: 10rem;
  border-radius: 0.625rem;
}

/* Small element/class icons beside their text (extracted from data.pack). */
.tag-icon {
  width: 0.9375rem; height: 0.9375rem; vertical-align: -0.1875rem; margin-right: 0.1875rem;
  display: inline-block;
}
/* In the used-by rows the label is flex, so align the icon as a flex item. */
.bar-label .tag-icon { vertical-align: middle; margin-right: 0.3125rem; }
/* Card meta / badges pair icon+text; keep each pair from breaking across lines. */
.card-meta span, .badges span { white-space: nowrap; }
.card-meta .tag-icon, .badges .tag-icon { width: 0.875rem; height: 0.875rem; }
/* Chips: nudge the icon to sit on the text baseline. */
.chip .tag-icon { width: 0.875rem; height: 0.875rem; vertical-align: -0.125rem; margin-right: 0.125rem; }

/* -------------------------------------------------------------- imprints */
/* Two columns (Release | Concentration), each a five-grade table — laid out to
   read like the in-game Memory Imprint screen. */
.imprints { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.imprint {
  flex: 1; min-width: 15rem;
  background: var(--panel-2); border: 0.0625rem solid var(--line);
  border-radius: 0.5rem; padding: 0.75rem 0.875rem;
}
.imprint-head { display: flex; gap: 0.6rem; align-items: center; margin-bottom: 0.15rem; }
.imprint-kind { color: var(--text); font-weight: 700; font-size: 0.95rem; }
.imprint-desc { font-size: 0.75rem; margin: 0 0 0.5rem; }
.imprint-note { font-size: 0.75rem; margin: 0.4rem 0 0; }

/* Grade table: [badge] [stat icon] [stat + value], one row per B..SSS. */
.grades { width: 100%; border-collapse: collapse; }
.grades tr { border-top: 0.0625rem solid var(--line); }
.grades tr:first-child { border-top: 0; }
.grades td { padding: 0.3rem 0; vertical-align: middle; }
.grade-badge {
  width: 2.2rem; font-weight: 800; font-family: ui-monospace, monospace;
  font-size: 0.9rem; letter-spacing: -0.03em;
}
.grade-icon { width: 1.4rem; }
.grade-icon .tag-icon { width: 1.1rem; height: 1.1rem; margin: 0; vertical-align: middle; }
.grade-stat { font-size: 0.9rem; }
.grade-stat b { font-variant-numeric: tabular-nums; }
/* In-game grade colours: D grey, C green, B blue, A purple, S/SS/SSS red. The
   badge and value are tinted; the stat name stays neutral. */
.grade-D  .grade-badge, .grade-D  .grade-stat b { color: var(--muted); }
.grade-C  .grade-badge, .grade-C  .grade-stat b { color: #7fc94b; }
.grade-B  .grade-badge, .grade-B  .grade-stat b { color: var(--ice); }
.grade-A  .grade-badge, .grade-A  .grade-stat b { color: var(--dark); }
.grade-S  .grade-badge, .grade-S  .grade-stat b,
.grade-SS .grade-badge, .grade-SS .grade-stat b,
.grade-SSS .grade-badge, .grade-SSS .grade-stat b { color: var(--fire); }
.grades .grade-stat { color: var(--text); }

/* Imprint Release positions grid — a diamond of 4 formation slots, lit where the
   release stat is granted (front / middle x2 / back), matching the game's icon. */
.release-grid {
  display: grid; grid-template-columns: repeat(2, 0.7rem); gap: 0.18rem; flex: none;
  transform: rotate(45deg);   /* the game shows it as a diamond */
}
.release-grid .pos {
  width: 0.7rem; height: 0.7rem; border-radius: 0.12rem;
  background: #101015; border: 0.0625rem solid var(--line);
}
.release-grid .pos.on { background: var(--gold); border-color: var(--gold); }

/* Gear-set combo in the builds panel: set symbol + proper name per piece. */
.set-combo { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.15rem 0.35rem; }
.set-piece { display: inline-flex; align-items: center; gap: 0.25rem; white-space: nowrap; }
.set-icon { width: 1.05rem; height: 1.05rem; vertical-align: middle; }
.set-plus { color: var(--muted); margin-right: 0.15rem; }

/* ------------------------------------------------------------- tier lists */
.tierlist { max-width: 75rem; margin: 0 auto; padding: 1rem 1.25rem 3.75rem; }
.tier-note { font-size: 0.85rem; margin: 0 0 1rem; line-height: 1.5; }
.tier-note b { color: var(--text); }
.tier-src {
  color: var(--gold); text-decoration: none; font-weight: 600; margin-left: 0.4rem;
}
.tier-src:hover { text-decoration: underline; }
.tier-src::after { content: " ↗"; color: var(--muted); font-weight: 400; }

/* A tier band: a coloured grade box on the left, hero chips flowing to the right. */
.tier-row {
  display: flex; align-items: stretch; gap: 0.5rem; margin-bottom: 0.5rem;
  border: 0.0625rem solid var(--line); border-radius: 0.5rem; overflow: hidden;
  background: var(--panel);
}
.tier-label {
  flex: none; width: 3.2rem; display: grid; place-items: center;
  font-weight: 800; font-size: 1.15rem; color: #14141a;
  font-family: ui-monospace, monospace;
}
.tier-heroes {
  display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.45rem 0.5rem; flex: 1;
}
.tier-hero {
  display: flex; flex-direction: column; align-items: center; width: 3.6rem;
  text-decoration: none; color: inherit; border-radius: 0.4rem; padding: 0.2rem 0.1rem;
  border-top: 0.125rem solid transparent;
}
.tier-hero:hover { background: var(--panel-2); }
.tier-icon { width: 2.6rem; height: 2.6rem; border-radius: 0.4rem; font-size: 0.9rem; }
.tier-hero-name {
  font-size: 0.6rem; text-align: center; line-height: 1.1; margin-top: 0.15rem;
  color: var(--muted); overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.tier-hero:hover .tier-hero-name { color: var(--text); }

/* ------------------------------------------------ tier placement (detail) */
.tier-placement { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.tier-slot {
  display: flex; align-items: center; gap: 0.6rem; flex: 1 1 15rem;
  border: 0.0625rem solid var(--line); border-radius: 0.5rem;
  background: var(--panel-2); padding: 0.55rem 0.7rem;
}
.tier-slot-mode {
  font-size: 0.7rem; font-weight: 700; letter-spacing: .08em; color: var(--muted);
  width: 2.4rem; flex: none;
}
.tier-badge {
  flex: none; display: grid; place-items: center; width: 2.6rem; height: 2.6rem;
  border-radius: 0.45rem; font-weight: 800; font-size: 1.15rem; color: #14141a;
  font-family: ui-monospace, monospace; text-decoration: none;
}
a.tier-badge:hover { outline: 0.125rem solid var(--text); outline-offset: 0.0625rem; }
.tier-badge-none { background: var(--panel); color: var(--muted); border: 0.0625rem solid var(--line); }
.tier-slot-meta { font-size: 0.75rem; color: var(--muted); line-height: 1.4; }
.tier-slot-meta .tier-src { margin-left: 0.35rem; }

/* --------------------------------------------- PvE usage (STOVE, M12) */
/* Browsable per-activity ranking. Same width/padding envelope as the tier lists
   so the usage % column is never clipped at the viewport edge. */
.content-view { max-width: 75rem; margin: 0 auto; padding: 1rem 1.25rem 3.75rem; }
.content-tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.9rem; }
/* Second level: the variant row under a category. Smaller, and offset so it reads
   as a child of the category tabs above it. */
.content-tabs-sub { margin: -0.5rem 0 1rem; padding-left: 0.9rem;
  border-left: 0.1875rem solid var(--line); }
.content-tabs-sub button { font-size: 0.75rem; padding: 0.22rem 0.6rem; }
.content-tabs-sub button.active { background: var(--ice); border-color: var(--ice); }
.content-tabs button {
  padding: 0.3rem 0.7rem; border: 0.0625rem solid var(--line); border-radius: 999px;
  background: var(--panel-2); color: var(--muted); font-size: 0.8rem; cursor: pointer;
}
.content-tabs button:hover { color: var(--text); }
.content-tabs button.active { background: var(--gold); border-color: var(--gold); color: #14141a; font-weight: 700; }

.usage-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.usage-row { display: flex; align-items: center; gap: 0.7rem; }
.usage-rank { width: 2.6rem; flex: none; text-align: right; color: var(--muted);
  font-family: ui-monospace, monospace; font-size: 0.85rem; }
.usage-hero {
  display: flex; align-items: center; gap: 0.5rem; text-decoration: none; color: var(--text);
  width: 15rem; flex: none; border-left: 0.1875rem solid var(--line); padding-left: 0.5rem;
}
.usage-hero:hover .tier-hero-name { color: var(--gold); }
.usage-bar { flex: 1; height: 0.55rem; background: var(--panel-2); border-radius: 999px; overflow: hidden; min-width: 3rem; }
.usage-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--ice), var(--gold)); }
.usage-pct { width: 3.6rem; flex: none; text-align: right; font-family: ui-monospace, monospace;
  font-size: 0.85rem; color: var(--text); }
/* Expedition rows have no usage %; this fills the bar column so the row never
   reads as empty. */
.usage-rec { flex: 1; font-size: 0.8rem; font-style: italic; }

/* Per-hero PvE usage on the detail page */
.pve-usage { display: flex; flex-direction: column; gap: 0.7rem; }
.pve-mode { border: 0.0625rem solid var(--line); border-radius: 0.5rem;
  background: var(--panel-2); padding: 0.55rem 0.7rem; }
.pve-mode-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; }
.pve-mode-label { font-weight: 600; }
.pve-mode-stat { font-size: 0.9rem; }
.pve-mode-stat b { color: var(--gold); font-family: ui-monospace, monospace; }
.pve-teams { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin-top: 0.55rem; }
.pve-team { display: flex; align-items: center; gap: 0.25rem; }
.pve-team-pct { font-size: 0.72rem; color: var(--muted); font-family: ui-monospace, monospace;
  width: 2.9rem; flex: none; text-align: right; margin-right: 0.15rem; }
.pve-mem { display: block; line-height: 0; }
.pve-mem-icon { width: 2rem; height: 2rem; border-radius: 0.3rem; display: grid; place-items: center; }
.pve-mem:hover .pve-mem-icon { outline: 0.125rem solid var(--gold); }

/* --------------------------------------------------------- site footer */
.site-footer {
  max-width: 60rem; margin: 2.5rem auto 1.5rem; padding: 1.1rem 1.25rem 0;
  border-top: 0.0625rem solid var(--line);
  color: var(--muted); font-size: 0.78rem; line-height: 1.5; text-align: center;
}
.site-footer p { margin: 0 auto 0.45rem; max-width: 44rem; }
.site-footer-copy { color: var(--muted); opacity: 0.75; margin-top: 0.7rem; }
.site-footer .link-btn {
  background: none; border: 0; padding: 0; font: inherit; cursor: pointer;
  color: var(--gold); text-decoration: underline;
}

/* Server-rendered content (crawlers + first paint; removed on hydration). */
.ssr { max-width: 55rem; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.ssr h1 { margin: 0.5rem 0 0.25rem; }
.ssr h2 { margin: 1.25rem 0 0.35rem; color: var(--gold); font-size: 1rem; }
.ssr h3 { margin: 0.7rem 0 0.15rem; font-size: 0.95rem; }
.ssr .ssr-attrs { color: var(--muted); }
.ssr a { color: var(--gold); }

/* ------------------------------------------------ PvP counters (M14) */
/* One counter per row — a clean vertical list, win % aligned to the right. */
.counters { display: flex; flex-direction: column; gap: 0.4rem; }
.counter-chip {
  display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--text);
  border: 0.0625rem solid var(--line); border-left: 0.1875rem solid var(--line);
  border-radius: 0.5rem; background: var(--panel-2); padding: 0.4rem 0.75rem 0.4rem 0.5rem;
}
.counter-chip:hover { background: var(--panel); }
.counter-chip:hover .counter-name { color: var(--gold); }
.counter-icon { width: 2.1rem; height: 2.1rem; border-radius: 0.3rem; flex: none; }
.counter-name { font-size: 0.9rem; }
.counter-win {
  font-family: ui-monospace, monospace; font-size: 0.85rem; font-weight: 700;
  color: var(--earth); margin-left: auto;
}
.counter-note { font-size: 0.75rem; margin-top: 0.6rem; }
