/* SmartBuilds: tema escuro. Cores de dado seguem a skill de dataviz: divergente azul (+) e
   vermelho (−) com meio cinza; texto sempre em tinta neutra; status com ícone e rótulo. */
:root {
  color-scheme: dark;
  --bg: #0e0f11;
  --surface-1: #16171a;
  --surface-2: #1d1f23;
  --surface-3: #26282d;
  --border: #2a2c31;
  --text-primary: #f0efec;
  --text-secondary: #c3c2b7;
  --text-muted: #8d8c86;
  --accent: #34d399;
  --accent-ink: #062b1d;
  --pos: #3987e5;
  --neg: #e66767;
  --neutral: #383835;
  --anchor-start: #3987e5;
  --anchor-buy: #d95926;
  --good: #0ca30c;
  --critical: #d03b3b;
  --warning: #d9a441;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 12px 32px rgb(0 0 0 / 0.45);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
img { display: block; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
.muted { color: var(--text-muted); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Topo */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgb(14 15 17 / 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar__inner {
  max-width: 1180px; margin: 0 auto; padding: 0 24px;
  height: 60px; display: flex; align-items: center; gap: 28px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-primary); text-decoration: none; font-size: 19px; font-weight: 500;
}
.brand b { font-weight: 800; color: var(--accent); }
.nav { display: flex; gap: 4px; flex: 1; justify-content: center; }
.nav__link {
  color: var(--text-muted); text-decoration: none; font-weight: 600;
  padding: 8px 12px; border-radius: var(--radius-sm);
}
.nav__link:hover { color: var(--text-primary); background: var(--surface-2); }
.nav__link.is-active { color: var(--text-primary); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.patch-badge {
  font-size: 12px; font-weight: 700; color: var(--accent);
  border: 1px solid rgb(52 211 153 / 0.4); padding: 4px 10px; border-radius: 999px;
}

/* Página */
.page { max-width: 1180px; margin: 0 auto; padding: 32px 24px 48px; }
.portrait { width: 128px; height: 72px; border-radius: var(--radius); object-fit: cover; box-shadow: 0 0 0 1px var(--border); }
.intro__text { flex: 1; min-width: 280px; }
.intro { display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.intro h1 { font-size: 34px; font-weight: 800; }
.lead { color: var(--text-secondary); max-width: 620px; margin: 8px 0 0; font-size: 15px; }
.note.sample-note { max-width: 620px; margin: 10px 0 0; border-left-color: var(--warning); }
.stats { display: flex; gap: 10px; margin: 0; }
.stats div {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 16px; min-width: 112px;
}
.stats dt { color: var(--text-muted); font-size: 12px; }
.stats dd { margin: 2px 0 0; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Filtros */
.filters {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin: 28px 0 8px; padding-bottom: 20px; border-bottom: 1px solid var(--border);
}
.filters__spacer { flex: 1; }
.control {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px;
  background: var(--surface-1); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font: inherit; font-weight: 600; cursor: pointer;
}
.control:hover { border-color: var(--text-muted); }
.control svg, .icon-btn svg, .chev { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.control__label { color: var(--text-muted); font-weight: 500; }
.control--input { cursor: text; font-weight: 500; width: 260px; }
.control--input::placeholder { color: var(--text-muted); }
.hero-btn { min-width: 190px; }
.hero-btn img { width: 28px; height: 28px; border-radius: 4px; object-fit: cover; }
.hero-btn span { flex: 1; text-align: left; }
.kbd {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px;
  font: 600 11px/1 var(--font); color: var(--text-muted);
  border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; background: var(--surface-2);
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Seletor de herói: grade por atributo, como no cliente do Dota, com busca. */
.modal.hero-modal {
  width: min(960px, calc(100vw - 32px)); height: min(720px, calc(100vh - 48px));
  display: none; flex-direction: column;
}
.hero-modal[open] { display: flex; }
.hero-modal__head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.hero-search {
  flex: 1; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-muted);
}
.hero-search:focus-within { border-color: var(--accent); }
.hero-search svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; flex: none; }
.hero-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text-primary); font: inherit; font-size: 15px; }
.hero-search input::placeholder { color: var(--text-muted); }
.hero-modal__tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 999px; background: transparent;
  color: var(--text-secondary); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.chip:hover { border-color: var(--text-muted); color: var(--text-primary); }
.chip[aria-checked="true"] { background: var(--surface-3); border-color: var(--accent); color: var(--text-primary); }
.attr-icon { width: 18px; height: 18px; flex: none; object-fit: contain; }
.hero-count { margin-left: auto; color: var(--text-muted); font-size: 12px; }
.hero-modal__body { flex: 1; overflow-y: auto; padding: 4px 16px 16px; overscroll-behavior: contain; }
.hero-group h3 {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px;
  padding: 12px 0 8px; background: var(--surface-1); font-size: 13px; font-weight: 700;
  color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em;
}
.hero-group h3 small { color: var(--text-muted); font-weight: 600; }
.hero-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px; }
/* Ícone em pixel art do minimapa ao lado do nome, como na lista antiga: mais nomes por tela. */
.hero-tile {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px; min-width: 0;
  border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent;
  color: var(--text-primary); font: inherit; cursor: pointer; text-align: left;
}
.hero-tile__img { width: 32px; height: 32px; flex: none; image-rendering: pixelated; }
.hero-tile__img.icon--fallback { display: grid; place-items: center; border-radius: 4px; background: var(--surface-3); font-weight: 800; font-size: 12px; color: var(--text-muted); }
.hero-tile__text { display: flex; flex-direction: column; min-width: 0; }
.hero-tile__name, .hero-tile__meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-tile__name { font-weight: 600; }
.hero-tile__meta { font-size: 11px; color: var(--text-muted); }
.hero-tile:hover, .hero-tile:focus-visible { background: var(--surface-3); outline: none; }
.hero-tile:focus-visible { border-color: var(--accent); }
.hero-tile[aria-current="true"] { background: var(--surface-3); box-shadow: inset 2px 0 0 var(--accent); }
.hero-tile--soon { cursor: not-allowed; }
.hero-tile--soon:hover { background: transparent; }
.hero-tile--soon .hero-tile__img { filter: grayscale(1); opacity: 0.4; }
.hero-tile--soon .hero-tile__name { color: var(--text-muted); font-weight: 500; }
.hero-tile--soon .hero-tile__meta { font-style: italic; opacity: 0.7; }
.hero-empty { padding: 40px 0; text-align: center; color: var(--text-muted); }
.hero-modal__foot { display: flex; gap: 18px; margin: 0; padding: 10px 16px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 12px; }
.hero-modal__foot span { display: inline-flex; align-items: center; gap: 4px; }
.segmented {
  display: inline-flex; height: 44px; padding: 3px; gap: 2px;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.segmented button {
  border: 0; background: transparent; color: var(--text-muted); font: inherit; font-weight: 600;
  padding: 0 16px; border-radius: 4px; cursor: pointer; display: flex; align-items: center; gap: 6px;
}
.segmented button small { font-weight: 500; }
.segmented button[aria-checked="true"] { background: var(--surface-3); color: var(--text-primary); box-shadow: inset 0 -2px 0 var(--accent); }
.segmented button:disabled { opacity: 0.35; cursor: not-allowed; }

/* Seções */
.section { margin-top: 36px; }
.section__head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.section__head h2 { font-size: 24px; font-weight: 700; color: var(--text-secondary); }
.section__hint { margin: 0; color: var(--text-muted); font-size: 13px; }

/* Cards de posição */
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: start; }
.card {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; min-height: 120px;
}
.card--wide { grid-column: span 2; }
.card__head {
  display: grid; grid-template-columns: 1fr 58px 48px; align-items: center; gap: 8px;
  padding: 11px 10px; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.card__title { font-weight: 700; font-size: 15px; }
.card__title small { display: block; color: var(--text-muted); font-weight: 500; font-size: 11px; }
.sort-btn {
  border: 0; background: none; color: var(--text-muted); font: inherit; font-size: 12px; font-weight: 700;
  cursor: pointer; text-align: right; padding: 0; display: flex; align-items: center; justify-content: flex-end; gap: 4px;
}
.sort-btn[aria-pressed="true"] { color: var(--text-primary); }
.sort-btn[aria-pressed="true"]::before { content: "▾"; color: var(--accent); }
.card__body { display: flex; flex-direction: column; max-height: 404px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
.card { height: 448px; }
.card--auto { height: auto; }
.card__empty { padding: 18px 12px; color: var(--text-muted); font-size: 13px; }
.row {
  display: grid; grid-template-columns: 33px 1fr 58px 48px; gap: 8px; align-items: center;
  padding: 8px 10px; border: 0; border-bottom: 1px solid var(--border);
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; width: 100%;
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--surface-2); }
.row.is-active { background: var(--surface-3); }
/* Item sem WPA (não há alternativa comum): não abre a gaveta. */
.row--static { cursor: default; }
.row--static:hover { background: none; }
.row__name small { font-weight: 500; font-size: 11.5px; color: var(--text-muted); }
/* Consenso: o item que quase todos fecham na posição, fixo no topo do card. */
.row--consensus, .row--consensus:hover { background: var(--surface-2); border-left: 3px solid var(--accent); }
.row--consensus:not(.row--static):hover { background: var(--surface-3); }
.icon {
  width: 33px; height: 24px; border-radius: 4px; object-fit: cover;
  background: var(--surface-3); box-shadow: 0 0 0 1px rgb(255 255 255 / 0.06);
}
.icon--fallback {
  display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--text-secondary);
}
/* Itens iniciais: a combinação inteira no lugar do nome, um ícone por cópia e as cargas sobre o ícone. */
.row--combo { grid-template-columns: 1fr 58px 48px; }
.combo { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.combo__item { position: relative; display: inline-flex; }
.combo__count {
  position: absolute; right: -4px; bottom: -5px; padding: 0 3px; border-radius: 3px;
  background: var(--surface-1); box-shadow: 0 0 0 1px var(--border);
  font-size: 10px; font-weight: 800; line-height: 13px; color: var(--text-primary);
}
.row__name { font-weight: 600; font-size: 13px; line-height: 1.2; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.row__name span { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.metric { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.vmark { display: inline-grid; place-items: center; width: 15px; height: 15px; margin-right: 5px; border-radius: 50%; font-size: 10px; font-weight: 900; vertical-align: 1px; }
.vmark--good { color: #062b06; background: var(--good); }
.vmark--bad { color: #fff; background: var(--critical); }
.metric__value { white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 13px; }
.metric__value.is-faint { color: var(--text-secondary); font-weight: 600; }
.meter { display: grid; grid-template-columns: repeat(4, 8px); gap: 2px; }
.meter i { height: 4px; border-radius: 2px; background: var(--neutral); }
.meter--pos i.on { background: var(--pos); }
.meter--neg i.on { background: var(--neg); }
.meter--pop i.on { background: #8d8c86; }

/* Selos de veredito: status com ícone e rótulo, nunca só cor. */
.badge {
  display: inline-flex; align-items: center; gap: 3px; width: fit-content;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase;
  padding: 1px 6px; border-radius: 4px; border: 1px solid;
}
.badge--good { color: #7be37b; border-color: rgb(12 163 12 / 0.6); background: rgb(12 163 12 / 0.12); }
.badge--bad { color: #f29b9b; border-color: rgb(208 59 59 / 0.6); background: rgb(208 59 59 / 0.12); }
.badge--soft { color: var(--text-muted); border-color: var(--border); background: transparent; }

/* Build por WPA */
.paths { display: grid; gap: 12px; }
.path {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: center;
}
.path__label { font-weight: 700; }
.path__label small { display: block; color: var(--text-muted); font-weight: 500; }
.path__steps { display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap; }
.step {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 8px; flex: 1 1 150px; min-width: 0;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.step:hover { border-color: var(--text-muted); }
.step--consensus { border-color: var(--accent); }
.step--static { cursor: default; }
.step--static:hover { border-color: var(--border); }
.step--consensus.step--static:hover { border-color: var(--accent); }
.step__slot { font-size: 11px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; }
.step__name { font-weight: 700; line-height: 1.2; }
.step .icon { width: 44px; height: 32px; }
.step__wpa { font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.arrow { align-self: center; color: var(--text-muted); }
.summary { color: var(--text-secondary); max-width: 900px; margin: 16px 0 0; }
.summary b { color: var(--text-primary); }

/* Tabela */
.table-tools { margin-bottom: 12px; }
.table-wrap { overflow: auto; max-height: 560px; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th, .table td { padding: 9px 14px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.table th { position: sticky; top: 0; background: var(--surface-2); color: var(--text-muted); font-size: 12px; font-weight: 700; }
.table th[data-sort] { cursor: pointer; }
.table th[aria-sort] { color: var(--text-primary); }
.table th[aria-sort="descending"]::after { content: " ▾"; color: var(--accent); }
.table th[aria-sort="ascending"]::after { content: " ▴"; color: var(--accent); }
.table .num { text-align: right; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.cell-item { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.cell-item .icon { width: 33px; height: 24px; }
/* O destino pode ter três partes: quebra a linha em vez de criar rolagem horizontal na tabela. */
.fate { display: inline-block; min-width: 180px; white-space: normal; }

/* Metodologia */
.method__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.method article { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.method h3 { font-size: 15px; margin-bottom: 6px; }
.method p { margin: 0; color: var(--text-secondary); }

.footer { border-top: 1px solid var(--border); color: var(--text-muted); font-size: 12px; }
.footer p { max-width: 1180px; margin: 0 auto; padding: 20px 24px; }
.lang-toggle { margin-left: 8px; color: var(--text-secondary); text-decoration: underline; }

/* Gaveta de detalhe */
.scrim { position: fixed; inset: 0; background: rgb(0 0 0 / 0.5); z-index: 30; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 31; width: min(480px, 100vw);
  background: var(--surface-1); border-left: 1px solid var(--border); box-shadow: var(--shadow);
  display: flex; flex-direction: column; animation: slide 0.18s ease-out;
}
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.drawer__head {
  display: grid; grid-template-columns: 64px 1fr 32px; gap: 14px; align-items: center;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.drawer__head img { width: 64px; height: 47px; border-radius: 6px; object-fit: cover; background: var(--surface-3); }
.drawer__head h2 { font-size: 20px; }
.drawer__head p { margin: 2px 0 0; }
.drawer__body { overflow-y: auto; padding: 18px 20px 28px; display: flex; flex-direction: column; gap: 22px; }
.icon-btn {
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-muted); border: 1px solid transparent; cursor: pointer;
}
.icon-btn:hover { color: var(--text-primary); border-color: var(--border); }
.hero-number { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.hero-number strong { font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.hero-number span { color: var(--text-muted); }
.block h3 { font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; }
.block p { margin: 0; color: var(--text-secondary); }
.kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0; }
.kv div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.kv dt { color: var(--text-muted); font-size: 12px; }
.kv dd { margin: 2px 0 0; font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.list .row { grid-template-columns: 33px 1fr 64px 52px; }
.note { font-size: 13px; color: var(--text-secondary); background: var(--surface-2); border-left: 3px solid var(--accent); padding: 10px 12px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* Gráfico de intervalo (forest plot) */
.forest { width: 100%; overflow: visible; }
.forest text { fill: var(--text-secondary); font: 12px var(--font); }
.forest .axis text { fill: var(--text-muted); font-size: 11px; }
.forest .grid-line { stroke: var(--surface-3); stroke-width: 1; }
.forest .zero { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 3 3; }
.forest .ci { stroke-width: 2; stroke-linecap: round; }
.forest .dot { stroke: var(--surface-1); stroke-width: 2; }
.forest .hit { fill: transparent; cursor: default; }
.forest .is-current text { fill: var(--text-primary); font-weight: 700; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-secondary); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }

/* Modal de filtros */
.modal {
  width: min(420px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-1); color: var(--text-primary); box-shadow: var(--shadow);
}
.modal::backdrop { background: rgb(0 0 0 / 0.55); }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal__head h2 { font-size: 17px; }
.modal__group { border: 0; margin: 0; padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.modal__group legend { font-weight: 700; padding: 0; margin-bottom: 8px; float: left; width: 100%; }
/* Filtro de ranks: medalhas da maior para a menor; "Divino+" marca a linha e as de cima. */
.segmented--block { display: flex; height: 40px; }
.segmented--block button { flex: 1; justify-content: center; }
.ranks { display: flex; flex-direction: column; gap: 6px; }
.ranks.is-disabled .ranks__list, .ranks.is-disabled .ranks__head { opacity: 0.4; }
.ranks__head { display: flex; align-items: center; justify-content: space-between; color: var(--text-muted); font-weight: 600; font-size: 13px; }
.link-btn { border: 0; background: none; padding: 4px 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.link-btn:disabled { color: var(--text-muted); cursor: not-allowed; }
.ranks__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rank { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 6px; border-radius: var(--radius-sm); }
.rank:hover { background: var(--surface-2); }
.rank__check { flex: 1; display: flex; align-items: center; gap: 10px; cursor: pointer; color: var(--text-muted); font-weight: 600; min-height: 36px; }
.rank.is-on .rank__check { color: var(--text-primary); }
.rank__check input {
  appearance: none; margin: 0; flex: none; width: 20px; height: 20px; cursor: pointer;
  border: 2px solid var(--text-muted); border-radius: 4px; display: grid; place-items: center;
}
.rank__check input:checked { background: var(--accent); border-color: var(--accent); }
.rank__check input:checked::after {
  content: ""; width: 10px; height: 5px; margin-top: -3px;
  border: solid var(--accent-ink); border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg);
}
.rank__check input:disabled { cursor: not-allowed; }
.medal { flex: none; width: 24px; height: 24px; object-fit: contain; }
/* Medalha desmarcada fica apagada, como o rótulo. */
.rank:not(.is-on) .medal { opacity: 0.55; filter: saturate(0.6); }
.rank__plus {
  flex: none; height: 26px; padding: 0 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: transparent; color: var(--text-muted); font: inherit; font-size: 12px; font-weight: 600;
  opacity: 0; transition: opacity 0.12s;
}
.rank:hover .rank__plus, .rank__plus:focus-visible { opacity: 1; }
.rank__plus:hover { border-color: var(--accent); color: var(--text-primary); }
.ranks__status { margin: 4px 0 0; font-size: 13px; color: var(--text-secondary); }
.ranks__warn { color: var(--warning); }
.ranks__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ranks__chips small { color: var(--text-muted); font-weight: 500; }
/* Sem hover, o atalho "X+" fica sempre visível. */
@media (hover: none) { .rank__plus { opacity: 1; } }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; color: var(--text-secondary); }
.switch input { position: absolute; opacity: 0; }
.switch__track { flex: none; width: 36px; height: 20px; border-radius: 999px; background: var(--surface-3); position: relative; transition: background 0.15s; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-secondary); transition: transform 0.15s; }
.switch input:checked + .switch__track { background: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(16px); background: var(--accent-ink); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--accent); outline-offset: 2px; }
.modal__foot { display: flex; justify-content: flex-end; padding: 14px 18px; }
.btn { height: 36px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); color: var(--text-primary); font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { border-color: var(--text-muted); }

/* Tooltip */
.tooltip {
  position: fixed; z-index: 50; pointer-events: none; max-width: 280px;
  background: #23252a; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 10px; font-size: 12px; color: var(--text-secondary); box-shadow: var(--shadow);
}
.tooltip b { color: var(--text-primary); }
.tooltip .tt-row { display: flex; justify-content: space-between; gap: 16px; font-variant-numeric: tabular-nums; }

/* Até o primeiro render (classe posta no hero.html): o topo já vem pré-renderizado com o
   texto final e aparece na hora; o que o app.js redesenha (filtros, cards, build, tabela) fica
   escondido para não crescer depois e empurrar o resto da página. */
.is-loading .filters, .is-loading .section, .is-loading .footer { visibility: hidden; }

/* Conteúdo pré-renderizado (site.hero_page): é o que o crawler e quem está sem JS leem; o
   app.js troca pelos cards e pela build interativos. */
.prerender { padding: 12px; }
.prerender h3 { font-size: 14px; margin-bottom: 8px; }
.prerender .table th, .prerender .table td { padding: 6px 8px; }
.prerender .table th { position: static; }
.prerender-build { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.cell-item img { width: 24px; height: 18px; border-radius: 3px; vertical-align: middle; margin-right: 6px; }
.links h3 { font-size: 14px; color: var(--text-secondary); margin: 14px 0 6px; }
.links__list { margin: 0; color: var(--text-muted); line-height: 1.9; }
.links__list a { color: var(--text-secondary); }
.links__list a:hover { color: var(--text-primary); }
.table-wrap--static { max-height: none; }
.portrait--item { width: 88px; height: 64px; }
a.hero-tile { text-decoration: none; }
.home .hero-group h3 { position: static; background: none; }
.home-soon { margin-top: 18px; color: var(--text-muted); }
.home-soon summary { cursor: pointer; font-weight: 600; color: var(--text-secondary); }
.lang-hint { font-size: 13px; font-weight: 600; }
.lang-hint a { color: var(--accent); }

/* Esqueleto de carregamento */
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 4px; height: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty-state { grid-column: 1 / -1; padding: 40px; text-align: center; color: var(--text-muted); background: var(--surface-1); border: 1px dashed var(--border); border-radius: var(--radius); }

@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card--wide { grid-column: span 2; }
}
@media (max-width: 720px) {
  .portrait { display: none; }
  .nav { display: none; }
  .topbar__inner { justify-content: space-between; }
  .page { padding: 20px 16px 40px; }
  .intro h1 { font-size: 26px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .card--wide { grid-column: auto; }
  .path { grid-template-columns: 1fr; }
  .method__grid { grid-template-columns: 1fr; }
  .control--input { width: 100%; }
  .filters__spacer { display: none; }
  .modal.hero-modal { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; border: 0; border-radius: 0; }
  .hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; }
  .chip { flex: none; }
  .hero-count { width: 100%; margin-left: 0; }
}
/* Sem teclado físico, os atalhos só ocupam espaço. */
@media (hover: none) {
  .kbd, .hero-modal__foot { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Conta no topo (account.js) */
.account { margin-left: auto; position: relative; }
.steam-signin img { width: 180px; height: 35px; }
.account__menu { position: relative; }
.account__menu > summary { list-style: none; }
.account__menu > summary::-webkit-details-marker { display: none; }
.account__who {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; font-weight: 600;
}
.account__who:hover { border-color: var(--text-muted); }
.account__avatar { width: 28px; height: 28px; border-radius: 4px; }
.account__pop {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 180px; z-index: 30;
  display: flex; flex-direction: column; gap: 2px; padding: 8px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.account__pop a, .account__pop .link-btn { padding: 8px 10px; text-align: left; color: var(--text-primary); text-decoration: none; border-radius: 4px; }
.account__pop a:hover, .account__pop .link-btn:hover { background: var(--surface-3); }

/* Minhas partidas (me.html) */
.me .section { margin-top: 28px; }
.me-cta { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; margin-top: 28px; }
.me-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 28px 0 16px; }
.btn--accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); height: 44px; }
.btn--accent:hover { border-color: var(--text-primary); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.note--warn { border-left-color: var(--warning); margin: 0 0 16px; }
.wpa-pos { color: #7fb4f0; font-weight: 700; }
.wpa-neg { color: #f29b9b; font-weight: 700; }
.hero-cell, .item-cell { display: inline-flex; align-items: center; gap: 8px; color: var(--text-primary); text-decoration: none; }
a.hero-cell:hover span { text-decoration: underline; }
.icon--hero { width: 28px; height: 28px; border-radius: 4px; object-fit: cover; }
.table tr.is-locked td { color: var(--text-muted); }
.table tr.is-muted td { color: var(--text-muted); }
.table tr.is-worst { background: rgb(208 59 59 / 0.1); }
.lock { color: var(--warning); font-weight: 600; }
.stats dd small { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.worst { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.me-chart { margin: 0; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; min-height: 276px; }
.me-chart svg { display: block; width: 100%; }
.me-chart text { fill: var(--text-muted); font-size: 11px; }
.me-chart .grid { stroke: var(--surface-3); stroke-width: 1; }
.me-chart .axis { stroke: var(--text-muted); stroke-width: 1; }
.me-chart .line { fill: none; stroke: var(--text-secondary); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.me-chart .mark-pos { fill: var(--pos); stroke: var(--bg); stroke-width: 1.5; }
.me-chart .mark-neg { fill: var(--neg); stroke: var(--bg); stroke-width: 1.5; }

/* Privacidade */
.prose { max-width: 760px; }
.prose p { color: var(--text-secondary); font-size: 15px; }
