:root {
  --bg: #0f1420;
  --surface: #171e2d;
  --surface-2: #1f2839;
  --border: #2a3448;
  --text: #e8ecf4;
  --text-2: #aab4c6;
  --muted: #7d889c;
  --accent: #e9c46a;
  --accent-ink: #1a1405;
  --link: #8ec5ff;
  --r5: linear-gradient(160deg, #a86d3b, #c9923f);
  --r4: linear-gradient(160deg, #5c4a8a, #8a6bb5);
  --r3: linear-gradient(160deg, #3d5f8a, #5b86b5);
  --bar: #e9c46a;
  --radius: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--link); }
.container { max-width: 1180px; margin: 0 auto; padding: 24px 16px 48px; }

header h1 { margin: 0 0 6px; font-size: clamp(24px, 4vw, 34px); letter-spacing: -0.01em; }
header .desc { margin: 0 0 8px; color: var(--text-2); max-width: 760px; }
header .meta { margin: 0; color: var(--muted); font-size: 13px; }
header .meta .badge { margin-left: 6px; }

.page-tabs {
  display: flex; gap: 4px; margin: 20px 0 16px; overflow-x: auto;
  border-bottom: 1px solid var(--border); scrollbar-width: none;
}
.page-tabs::-webkit-scrollbar { display: none; }
.ptab {
  padding: 10px 14px; color: var(--text-2); text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent; font-weight: 500;
}
.ptab:hover { color: var(--text); }
.ptab.active { color: var(--accent); border-bottom-color: var(--accent); }

.page { display: none; }
.page.active { display: block; }

.controls { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px; align-self: flex-start; flex-wrap: wrap; }
.seg button {
  border: 0; background: none; color: var(--text-2); font: inherit; font-weight: 500;
  padding: 6px 14px; border-radius: 999px; cursor: pointer;
}
.seg button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  font: inherit; font-size: 13px; padding: 4px 10px; border-radius: 999px; cursor: pointer;
}
.chip[aria-pressed="true"] { border-color: var(--accent); color: var(--text); background: var(--surface-2); }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--el); flex: none; }
select, input[type="search"] {
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; font: inherit; font-size: 14px;
}
input[type="search"] { min-width: 0; flex: 1 1 160px; max-width: 240px; }
.source-toggles { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.source-toggles .chip .check { width: 12px; height: 12px; border-radius: 3px; border: 1.5px solid var(--muted); flex: none; }
.source-toggles .chip[aria-pressed="true"] .check { background: var(--accent); border-color: var(--accent); }

.notes { color: var(--muted); font-size: 13px; margin: 0 0 12px; max-width: 820px; }
.badge {
  display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); vertical-align: 1px;
}
.badge.stale { color: #f4a261; border-color: #6b4a2b; }

/* Tier rows */
.tierlist { display: flex; flex-direction: column; gap: 6px; }
.tier-row { display: flex; background: var(--surface); border-radius: var(--radius); overflow: hidden; min-height: 104px; }
.tier-label {
  flex: 0 0 64px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--tier); color: #10131a; font-weight: 700; font-size: 26px; line-height: 1;
}
.tier-label small { font-size: 11px; font-weight: 600; opacity: .7; margin-top: 4px; }
.tier-cards { flex: 1; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; align-content: flex-start; }
.tier-empty { color: var(--muted); font-size: 13px; align-self: center; }

.card {
  position: relative; width: 76px; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--text); font: inherit; text-align: center;
}
.card .pic {
  position: relative; display: block; width: 76px; height: 76px; border-radius: 8px; overflow: hidden;
  background: var(--r4);
}
.card.r5 .pic { background: var(--r5); }
.card.r3 .pic { background: var(--r3); }
.card img { width: 100%; height: 100%; display: block; }
.card .el {
  position: absolute; top: 4px; left: 4px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--el); box-shadow: 0 0 0 2px rgba(0,0,0,.45);
}
.card .name { display: block; margin-top: 4px; font-size: 12px; line-height: 1.2; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card:hover .pic, .card:focus-visible .pic { outline: 2px solid var(--accent); outline-offset: 1px; }
.card:focus-visible { outline: none; }

/* Contested */
.contested-row {
  display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center;
  background: var(--surface); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 6px; cursor: pointer;
}
.contested-row img { width: 56px; height: 56px; border-radius: 8px; background: var(--r4); }
.contested-row.r5 img { background: var(--r5); }
.contested-row .top { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.contested-row .top strong { font-size: 15px; }
.contested-row .top span { color: var(--muted); font-size: 13px; }
.src-tiers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.src-tier {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; background: var(--surface-2);
  border-radius: 6px; padding: 2px 8px 2px 2px; color: var(--text-2);
}
.src-tier b {
  display: inline-block; min-width: 24px; text-align: center; border-radius: 4px; padding: 0 4px;
  background: var(--tier); color: #10131a;
}

/* DPS chart */
.dps-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.linkbtn { background: none; border: 0; color: var(--link); font: inherit; font-size: 13px; cursor: pointer; padding: 4px 0; }
.dps-chart { display: flex; flex-direction: column; gap: 2px; }
.dps-row { display: grid; grid-template-columns: minmax(96px, 170px) 74px 1fr; gap: 10px; align-items: center; padding: 3px 0; }
/* The three teammates in the tested team (the character is the row itself). */
.dps-row .mates { display: flex; gap: 2px; }
.dps-row .mates img { width: 22px; height: 22px; border-radius: 5px; background: var(--r4); cursor: pointer; }
.dps-row .mates img.r5 { background: var(--r5); }
.dps-row .mates img:hover { outline: 2px solid var(--accent); outline-offset: 1px; }
.dps-row .who { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); min-width: 0; }
.dps-row .who span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dps-row .who .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--el); flex: none; }
.dps-row .track { position: relative; height: 22px; display: flex; align-items: center; }
.dps-row .bar { height: 12px; background: var(--bar); border-radius: 0 4px 4px 0; min-width: 2px; }
.dps-row .bar.est { background: repeating-linear-gradient(135deg, var(--bar) 0 5px, #b89849 5px 8px); }
.dps-row .val { margin-left: 8px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dps-row:hover .who { color: var(--text); }
.dps-row:hover .bar { filter: brightness(1.12); }
.dps-axis { display: grid; grid-template-columns: minmax(96px, 170px) 74px 1fr; gap: 10px; font-size: 11px; color: var(--muted); margin-top: 6px; }
.dps-table table, .sources-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dps-table th, .dps-table td, .sources-table th, .sources-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.dps-table td.num, .dps-table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Sources */
.source-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.source-card { background: var(--surface); border-radius: var(--radius); padding: 14px; }
.source-card h3 { margin: 0 0 4px; font-size: 16px; }
.source-card h3 a { color: var(--text); text-decoration: none; }
.source-card h3 a:hover { text-decoration: underline; }
.source-card p { margin: 4px 0; font-size: 13px; color: var(--text-2); }
.source-card .scale { color: var(--muted); }
.method { margin-top: 28px; max-width: 820px; color: var(--text-2); }
.method h2 { color: var(--text); font-size: 18px; }
.thresholds { display: flex; flex-wrap: wrap; gap: 6px; }
.thresholds .src-tier { padding-right: 8px; }

/* The hidden attribute always wins over a class's display (e.g. .dps-chart is flex). */
[hidden] { display: none !important; }

/* Modal */
dialog {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 14px; padding: 0; width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
}
dialog::backdrop { background: rgba(5,8,14,.7); }
.modal-body { padding: 20px; overflow-y: auto; }
/* "‹ Name": back to the panel this one was opened from. Sits above the
   content (not over it) and is thumb-sized on phones. */
.modal-back {
  display: inline-flex; align-items: center; gap: 6px; max-width: calc(100% - 64px);
  margin: 12px 0 -8px 14px; padding: 6px 12px 6px 8px; min-height: 36px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
  color: var(--text); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
}
.modal-back[hidden] { display: none; }
.modal-back:hover { border-color: var(--muted); }
.modal-back:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.modal-back > span[aria-hidden] { font-size: 20px; line-height: 1; margin-top: -2px; color: var(--text-2); }
.modal-back-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-close {
  position: absolute; top: 10px; right: 12px; background: none; border: 0; color: var(--muted);
  font-size: 26px; line-height: 1; cursor: pointer;
}
.modal-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.modal-head img { width: 84px; height: 84px; border-radius: 10px; background: var(--r4); }
.modal-head.r5 img { background: var(--r5); }
.modal-head.r3 img { background: var(--r3); }
.modal-head h2 { margin: 0; font-size: 20px; }
.modal-head p { margin: 2px 0 0; color: var(--text-2); font-size: 13px; }
.big-tier { display: inline-flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.big-tier b { font-size: 22px; background: var(--tier); color: #10131a; border-radius: 6px; padding: 0 10px; }
.big-tier span { color: var(--muted); font-size: 13px; }
.modal-body h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 6px; }
.kv { width: 100%; border-collapse: collapse; font-size: 13px; }
.kv th, .kv td { text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.kv th { color: var(--muted); font-weight: 500; }
.kv .t { display: inline-block; min-width: 28px; text-align: center; border-radius: 4px; padding: 0 5px; background: var(--tier); color: #10131a; font-weight: 700; }

.tooltip {
  position: fixed; z-index: 20; pointer-events: none; background: #0b0f18; color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 12px; max-width: 240px;
}

.site-footer { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--border); }
/* Legal notice: small, but kept at the muted text colour so it stays readable. */
.legal { font-size: 11px; line-height: 1.7; color: var(--muted); margin: 0; max-width: 900px; }
.legal strong { color: var(--text-2); font-weight: 600; }
.legal a, .footer-links a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.footer-links { font-size: 12px; margin: 10px 0 0; }
.footer-links a:hover, .legal a:hover { color: var(--text-2); }

/* Text pages (privacy) */
.doc { max-width: 720px; color: var(--text-2); }
.doc h2 { color: var(--text); font-size: 18px; margin: 28px 0 8px; }
.doc p { margin: 0 0 12px; }
.doc .doc-date { color: var(--muted); font-size: 13px; }

@media (max-width: 600px) {
  .tier-label { flex-basis: 44px; font-size: 20px; }
  .tier-cards { gap: 6px; padding: 8px; }
  .card, .card .pic { width: 60px; }
  .card .pic { height: 60px; }
  .card .name { font-size: 11px; }
  .dps-row, .dps-axis { grid-template-columns: 96px 1fr; }
}
.muted { color: var(--muted); }

.badge.now { color: #10131a; background: var(--accent); border-color: var(--accent); }
.src-h { font-size: 15px; color: var(--text); margin: 22px 0 10px; }
.src-h:first-child { margin-top: 0; }

/* Small portrait/icon chips: featured 4-stars, "best on" lists */
.mini-list { display: flex; flex-wrap: wrap; gap: 8px; }
.mini {
  display: inline-flex; flex-direction: column; align-items: center; gap: 3px; width: 64px;
  background: none; border: 0; padding: 0; color: var(--text-2); font: inherit; font-size: 11px; cursor: pointer;
  position: relative;
}
.mini img { width: 56px; height: 56px; border-radius: 8px; background: var(--r4); }
.mini.r5 img { background: var(--r5); }
.mini span { width: 100%; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .t { position: absolute; top: 38px; right: 2px; font-size: 10px; min-width: 20px; text-align: center;
  border-radius: 4px; padding: 0 3px; background: var(--tier); color: #10131a; font-weight: 700; }
.mini:hover img { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Build-guide tags on recommended weapons: a guide's top pick, free-to-play. */
.mini .tag { position: absolute; top: 2px; left: 6px; font-size: 9px; font-style: normal; font-weight: 700;
  letter-spacing: .02em; border-radius: 4px; padding: 0 4px; line-height: 15px; }
.mini .tag.best { background: var(--accent); color: var(--accent-ink); }
.mini .tag.f2p { background: #7fd18b; color: #0c1a10; }

/* Should I pull? */
.pull-phase { margin-bottom: 32px; }
.pull-phase h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 20px; margin: 0 0 12px; }
.pull-phase h2 small { font-size: 13px; font-weight: 500; color: var(--muted); }
.pull-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.pull-card { background: var(--surface); border-radius: var(--radius); padding: 14px; }
.pull-head { display: flex; gap: 12px; align-items: center; }
.pull-pic { flex: none; padding: 0; border: 0; background: var(--r4); border-radius: 10px; cursor: pointer; line-height: 0; }
.pull-head.r5 .pull-pic { background: var(--r5); }
.pull-pic img { width: 72px; height: 72px; border-radius: 10px; }
.pull-pic:hover { outline: 2px solid var(--accent); outline-offset: 1px; }
.pull-who { flex: 1; min-width: 0; }
.pull-who h3 { margin: 0; font-size: 18px; }
.pull-who p { margin: 2px 0 0; font-size: 13px; }
.kicker { margin: 0 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.verdict { flex: none; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.v-strong { color: #10131a; background: #7fe0a0; border-color: #7fe0a0; }
.v-good { color: #10131a; background: #c7e98a; border-color: #c7e98a; }
.v-maybe { color: #f4d58d; border-color: #6b5a2b; }
.v-skip { color: var(--muted); border-color: var(--border); }
.v-early { color: var(--link); border-color: #2d4a6b; }
.pull-body { margin-top: 12px; }
.pull-body .big-tier { margin: 0 0 8px; }
.reasons { margin: 0 0 10px; padding-left: 18px; color: var(--text-2); font-size: 13px; }
.reasons li { margin: 3px 0; }
.pull-fours { margin: 14px 0 0; }
.pull-weapons { margin-top: 12px; }
.pull-weapon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 12px; }
.pull-weapon .pull-body .mini-list { margin-bottom: 10px; }
.pull-note { margin-top: 8px; }
@media (max-width: 600px) {
  .pull-grid, .pull-weapon-grid { grid-template-columns: 1fr; }
  .verdict { white-space: normal; text-align: center; }
}

/* Buttons */
.btn {
  font: inherit; font-size: 13px; font-weight: 500; padding: 6px 12px; border-radius: 8px; cursor: pointer;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { color: #ff9b9b; }
kbd { font: inherit; font-size: 12px; padding: 1px 6px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); }

/* Pull tracker */
.tr-onboard { background: var(--surface); border-radius: var(--radius); padding: 20px; max-width: 760px; }
.tr-onboard.compact { margin: 12px 0; }
.tr-onboard h2 { margin: 0 0 6px; font-size: 20px; }
.tr-onboard > p { margin: 0 0 14px; font-size: 14px; }
.tr-tabs { margin-bottom: 8px; }
.tr-steps { padding-left: 20px; color: var(--text-2); font-size: 14px; }
.tr-steps li { margin: 10px 0; }
.tr-steps b { color: var(--text); }
.tr-steps .muted { display: block; font-size: 12px; margin-top: 4px; }
.tr-cmd { display: flex; gap: 8px; align-items: center; margin: 8px 0 4px; flex-wrap: wrap; }
.tr-cmd code {
  flex: 1 1 280px; background: #0b0f18; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
  font-size: 13px; color: var(--accent); overflow-x: auto; white-space: nowrap;
}
.tr-paste, .tr-drop {
  width: 100%; background: #0b0f18; color: var(--text); border: 2px dashed var(--border); border-radius: 10px;
  padding: 14px; font: inherit; font-size: 14px; resize: vertical;
}
.tr-paste:focus { outline: none; border-color: var(--accent); }
.tr-drop { text-align: center; color: var(--muted); cursor: pointer; padding: 28px 14px; }
.tr-drop.over { border-color: var(--accent); color: var(--text); }
.tr-progress { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; margin: 12px 0; max-width: 760px; }
.tr-progress p { margin: 0 0 6px; }
.tr-progress ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.tr-progress li.cur { color: var(--text); }
.tr-status { margin: 12px 0; padding: 10px 14px; border-radius: 8px; font-size: 14px; background: var(--surface); max-width: 760px; }
.tr-status.ok { border-left: 3px solid #7fe0a0; }
.tr-status.warn { border-left: 3px solid #f4d58d; }
.tr-status.error { border-left: 3px solid #ff9b9b; }
.tr-head { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.tr-head .muted { font-size: 13px; }
.tr-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.tr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; margin-bottom: 12px; }
.tr-card { background: var(--surface); border-radius: var(--radius); padding: 14px; }
.tr-card header { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.tr-card h3 { margin: 0; font-size: 16px; }
.tr-pity { display: flex; align-items: baseline; gap: 6px; margin: 8px 0 6px; }
.tr-pity b { font-size: 36px; line-height: 1; }
.tr-pity span { color: var(--muted); font-size: 14px; }
.tr-bar { position: relative; height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.tr-bar span { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 0 4px 4px 0; }
.tr-bar i { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text-2); opacity: .6; }
.tr-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--text-2); margin: 10px 0; }
.tr-fives { display: flex; flex-wrap: wrap; gap: 6px; }
.tr-five { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 64px; padding: 0; border: 0; background: none; cursor: pointer; color: var(--text-2); font: inherit; }
.tr-five-pic { position: relative; width: 52px; height: 52px; border-radius: 8px; background: var(--r5); }
.tr-five img { width: 52px; height: 52px; border-radius: 8px; display: block; }
.tr-five.lost .tr-five-pic { background: linear-gradient(160deg, #4a4f5c, #6b7180); }
.tr-five.lost img { opacity: .75; }
.tr-five-cap { font-size: 11px; white-space: nowrap; }
.tr-five:hover .tr-five-pic { outline: 2px solid var(--accent); outline-offset: 1px; }
.tr-five .t { position: absolute; right: 2px; top: 2px; font-size: 10px; min-width: 18px; text-align: center; border-radius: 4px;
  padding: 0 3px; background: var(--tier); color: #10131a; font-weight: 700; }
.tr-noimg { display: grid; place-items: center; width: 52px; height: 52px; color: var(--text); }
.tr-strip {
  display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; background: var(--surface); border-left: 3px solid var(--accent);
  border-radius: 8px; padding: 10px 14px; margin-bottom: 18px; font-size: 14px; color: var(--text-2);
}
.tr-strip b { color: var(--text); }
.tr-strip a { margin-left: auto; }
@media (max-width: 600px) {
  .tr-grid { grid-template-columns: 1fr; }
  .tr-strip a { margin-left: 0; }
}

/* Character modal */
.char-title { font-style: italic; color: var(--text-2); }
.modal-head .t { display: inline-block; min-width: 26px; text-align: center; border-radius: 4px; padding: 0 5px;
  background: var(--tier); color: #10131a; font-weight: 700; font-size: 12px; }
.stars.r5 { color: #f2c35b; letter-spacing: 1px; }
.stars.r4 { color: #b58ce6; letter-spacing: 1px; }
.el-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--el); margin-right: 4px; vertical-align: 0; }
.char-desc { color: var(--text-2); font-size: 14px; margin: 0 0 12px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 16px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
.facts.stats { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.facts.stats dd { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.h-note { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 6px; }
.mats { display: flex; flex-wrap: wrap; gap: 8px; }
.mat { position: relative; width: 76px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.mat img { width: 56px; height: 56px; border-radius: 8px; background: var(--r4); }
.mat.r1 img { background: linear-gradient(160deg, #5a5f6b, #7c818c); }
.mat.r2 img { background: linear-gradient(160deg, #3f6b55, #5c9577); }
.mat.r3 img { background: var(--r3); }
.mat.r5 img { background: var(--r5); }
.mat-n { font-size: 12px; font-weight: 700; color: var(--text); }
.mat-name { font-size: 10px; line-height: 1.2; color: var(--muted); }
.mat-days { font-size: 10px; color: var(--accent); }
.mat-mora { font-size: 12px; margin: 6px 0 0; }
details.tl { border-top: 1px solid var(--border); }
details.tl:last-of-type { border-bottom: 1px solid var(--border); }
details.tl summary { cursor: pointer; padding: 8px 2px; font-size: 14px; color: var(--text); list-style-position: outside; }
details.tl summary .kicker { display: inline-block; margin: 0 8px 0 0; min-width: 0; }
.tl-body { padding: 0 2px 10px; font-size: 13px; line-height: 1.55; color: var(--text-2); }
.tl-body b { color: var(--accent); font-weight: 600; }

/* Endgame teams */
.eg-section { margin-bottom: 36px; }
.eg-section h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 22px; margin: 0 0 12px; }
.eg-section h2 small { font-size: 13px; font-weight: 500; color: var(--muted); }
.eg-blessing { background: var(--surface); border-left: 3px solid var(--accent); border-radius: 8px; padding: 12px 16px; margin-bottom: 12px; }
.eg-blessing h3 { margin: 0 0 4px; font-size: 16px; }
.eg-blessing p:last-child { margin: 0; color: var(--text-2); font-size: 14px; }
.eg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; }
.eg-grid.three { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.eg-card { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; }
.eg-card h3 { margin: 0 0 8px; font-size: 18px; }
.eg-card .kicker { margin-top: 12px; }
.eg-leyline { font-size: 13px; color: var(--text-2); margin: 0; }
.eg-leyline b { color: var(--text); }
.eg-slots { display: flex; flex-wrap: wrap; gap: 6px; }
.eg-slots span { font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; color: var(--text-2); }
.team-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.team-row .mini { width: 60px; }
.team-row .mini img { width: 52px; height: 52px; }
/* Recommended teams (character pages and panels): alternatives sit under each slot. */
.bteam { margin: 4px 0 10px; }
.bteam .team-row { margin-bottom: 0; }
.bteam .badge.agree { display: inline-block; margin-bottom: 4px; color: var(--accent); border-color: #6b5a2b; }
.slot { display: flex; flex-direction: column; align-items: center; width: 60px; }
.alts { display: flex; gap: 2px; margin-top: 2px; }
.alts img { width: 19px; height: 19px; border-radius: 4px; background: var(--r4); display: block; }
.alts img.r5 { background: var(--r5); }
.alts a:hover img { outline: 2px solid var(--accent); outline-offset: 1px; }
.bteam-name { font-size: 12px; color: var(--muted); margin: 8px 0 4px; }
/* stygian.moe usage: share of verified clears each character appears in. */
.usage { display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 4px 0 10px; }
.usage a { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); text-decoration: none; }
.usage img { width: 26px; height: 26px; border-radius: 6px; background: var(--r4); }
.usage img.r5 { background: var(--r5); }
.usage b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
/* Weapon passive with R1-R5 tabs. */
.refine { margin-top: 6px; }
.refine-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin: 18px 0 6px; }
.modal-body .refine-head h3 { margin: 0; color: var(--text); text-transform: none; letter-spacing: 0; font-size: 15px; }
.refine-text p { margin: 4px 0; font-size: 14px; line-height: 1.55; color: var(--text-2); }
.refine-text b { color: var(--accent); font-weight: 600; }
.refine-cost { font-size: 12px !important; color: var(--muted) !important; }
.eg-clears-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.eg-clears-head .kicker { margin: 0; }
.seg.seg-sm { padding: 2px; }
.seg.seg-sm button { font-size: 12px; padding: 3px 10px; }
.eg-stats { font-size: 13px; color: var(--text-2); margin: 6px 0 2px; }
.eg-pop { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 6px 0; }
.eg-pop .team-row { margin: 0; }
.eg-pop .share { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.el-chip { display: inline-flex; align-items: center; gap: 6px; align-self: center; font-size: 13px; color: var(--text-2);
  background: var(--surface-2); border-radius: 999px; padding: 4px 10px; }
.el-chip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--el); }
.eg-enemies, .eg-notes { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-2); }
.eg-enemies li, .eg-notes li { margin: 3px 0; }
.eg-enemies b { color: var(--text); font-weight: 600; }
.eg-alt { margin-bottom: 4px; }
.eg-alt .muted { font-size: 12px; }
.eg-card details.tl { margin-top: 8px; }
@media (max-width: 600px) { .eg-grid, .eg-grid.three { grid-template-columns: 1fr; } }
.mini .cons { font-size: 10px; color: var(--muted); margin-top: -2px; }
.eg-clear p { font-size: 12px; margin: 4px 0; }
.eg-clear a, .eg-notes a { color: var(--link); }
.sources-line { margin-top: 8px; }

/* Multi-page additions */
a.card, a.mini, a.pull-pic { text-decoration: none; color: inherit; }
a.pull-pic { display: block; }
.brand { display: inline-block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; }
.brand:hover { text-decoration: underline; }
.full-link { margin: 6px 0 0; font-size: 13px; }
.seo-copy { max-width: 820px; margin-top: 36px; color: var(--text-2); font-size: 14px; }
.seo-copy h2 { color: var(--text); font-size: 18px; margin: 0 0 8px; }
.seo-copy h3 { color: var(--text); font-size: 15px; margin: 18px 0 6px; }
.seo-copy a { color: var(--link); }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--text-2); }
.char-page { max-width: 820px; }
.char-page h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 26px 0 8px; }
.char-hero img { width: 112px; height: 112px; }
.el-heading { display: flex; align-items: center; gap: 8px; font-size: 16px; margin: 22px 0 8px; }
.char-index { padding: 0; }

/* Ad slots: collapsed until ads.js turns ads on (adds .ads-on to <html>).
   Heights are reserved when on, so content doesn't jump when an ad loads. */
.ad-slot { display: none; }
.ads-on .ad-slot { display: flex; justify-content: center; align-items: center; margin: 16px auto; }
.ads-on #ad-top, .ads-on #ad-bottom { min-height: 90px; }
.ads-on #ad-mid { min-height: 250px; }
@media (max-width: 600px) {
  .ads-on #ad-top, .ads-on #ad-bottom { min-height: 100px; }
}
