/* Legiões do jogo (/legioes e /legiao/…): carregado depois do home.css (e do perfil.css na página da legião).
   Tudo dentro de body.gn; o resto vem das peças da página inicial (hn-*) e do perfil (pn-*). */

/* ---------- ranking ---------- */
/* o cartão da busca tem borda: um respiro abaixo do cabeçalho (o `body.hn .wrap` zera o padding-top do .hn-main) */
body.gn .hn-main { padding-top: 20px; }
body.gn .gn-hero { flex: none; padding: 18px 22px 20px; gap: 18px; }
body.gn .gn-hero .hn-title span { max-width: 640px; line-height: 1.45; }
.gn-table .hn-char { gap: 9px; }
.gn-flag { display: grid; place-items: center; flex: none; }
.gn-flag .gn-shield { width: 22px; height: 25px; }
.gn-sub { display: none; font-size: 12px; color: var(--hn-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gn-sub .hn-server { font-weight: 600; }
/* a força é o critério da página: número maior, barra dourada cheia; o maior poder fica discreto */
.gn-strength b { font-size: 15px; color: oklch(0.86 0.1 85); }
.gn-strength .hn-bar span { background: var(--gold); opacity: 0.7; }
.gn-maxpower { color: var(--hn-faint); }
td.gn-maxpower { font-size: 13px; }
.gn-table tbody tr:hover { box-shadow: inset 3px 0 0 var(--fac, var(--gold)); }
.gn-table tbody tr:hover .hn-nick { color: var(--gold); }
.gn-reset {
  height: 32px; padding: 0 12px; border-radius: 8px; cursor: pointer; font-size: 13px; white-space: nowrap;
  background: none; border: 1px solid var(--hn-line-2); color: var(--hn-muted);
}
.gn-reset:hover { color: var(--hn-strong); border-color: #33405c; }
.gn-note { margin: -4px 2px 0; font-size: 12px; line-height: 1.5; color: var(--hn-faint); }
@media (max-width: 860px) { .gn-sub { display: block; } }
@media (min-width: 721px) and (max-width: 1199px) {
  .hn-toolbar .gn-reset { order: 2; }
}
@media (max-width: 720px) {
  /* a coluna do nome encolhe (nome e o que vem embaixo com reticências) para a tabela caber na tela: ranking e ranking da classe */
  .gn-table td:nth-child(2), .gn-class-table td:nth-child(2) { max-width: 0; width: 100%; }
  .gn-table .hn-char, .gn-table .hn-char > div, .gn-class-table .hn-char, .gn-class-table .hn-char > div { min-width: 0; overflow: hidden; }
  .gn-table .hn-nick, .gn-class-table .hn-nick, .gn-class-table .hn-guild { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .gn-flag { display: none; }
  .hn-toolbar .gn-reset { flex: 1 1 calc(50% - 4px); }
}

/* ---------- página da legião: cabeçalho ---------- */
/* brasão (public/js/guild-crest.js): o mesmo escudo decorativo para todas as legiões, na cor da facção; não é o emblema de nenhuma */
.gn-shield { display: block; overflow: visible; }
.gn-shield-body { fill: color-mix(in srgb, var(--fac, var(--gold)) 26%, #0d1320); stroke: var(--fac, var(--gold)); stroke-width: 2.5; stroke-linejoin: round; }
.gn-shield-rim { fill: none; stroke: color-mix(in srgb, var(--fac, var(--gold)) 45%, transparent); stroke-width: 1.2; }
.gn-shield-mark { fill: var(--fac, var(--gold)); opacity: 0.9; }
.gn-crest { flex: none; display: grid; place-items: center; width: 118px; height: 128px; }
.gn-crest .gn-shield { width: 99px; height: 112px; filter: drop-shadow(0 0 14px color-mix(in srgb, var(--fac) 30%, transparent)); }
body.gn .pn-legion { font-size: 14px; font-weight: 500; color: var(--hn-soft); }
body.gn .pn-legion a { color: var(--fac); font-weight: 600; }
body.gn .pn-legion a:hover { color: var(--gold); }
/* "● Ariel  ● Elyos" logo abaixo do nome (a bolinha na cor da facção nos dois) */
.gn-where { gap: 14px; }
.gn-where a { display: inline-flex; align-items: center; gap: 6px; }
.gn-where .pn-faction { font-size: 14px; }
/* "i": a explicação ao passar o mouse */
.gn-info { display: inline-flex; vertical-align: -2px; margin-left: 4px; color: var(--hn-faint); cursor: help; }
.gn-info:hover { color: var(--hn-soft); }
.hn-kpi .gn-info svg { width: 13px; height: 13px; }
body.gn button.pn-chip { cursor: pointer; font: inherit; }
body.gn button.pn-chip:hover { border-color: #3a4763; color: var(--hn-strong); }
body.gn .pn-chip svg { color: var(--hn-muted); }

/* ---------- visão geral ---------- */
/* cartões lado a lado com a mesma altura: o conteúdo do mais baixo se distribui na altura (sem vão embaixo) */
.gn-fill { flex: 1; display: flex; flex-direction: column; }
.gn-fill > .gn-hls { flex: 1; grid-auto-rows: 1fr; }
.pn-ov-row > .pn-card > ul.gn-bars { flex: 1; justify-content: space-around; }
.gn-hls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.gn-hl { align-items: flex-start; padding: 9px 10px; }
.gn-hl .pn-ach-text small:first-child { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--hn-muted); }
.gn-hl .pn-ach-text b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gn-hl .pn-ach-text b a:hover { color: var(--gold); }
.gn-hl.up .pn-ach-text b { color: var(--gain); }
.gn-hl.up .pn-ach-icon { color: var(--gain); }

/* os mais fortes (visão geral, classes e ganhos da semana): posição, personagem e o número à direita */
ol.gn-top { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
ol.gn-top li { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-top: 1px solid var(--hn-row); min-width: 0; }
ol.gn-top li:first-child { border-top: 0; }
ol.gn-top li:hover { background: var(--hn-hover); }
ol.gn-top .hn-char { flex: 1; min-width: 0; }
ol.gn-top .hn-guild .hn-cls { font-size: 12px; gap: 5px; }
ol.gn-top .hn-guild .class-emblem { width: 16px; height: 16px; }
.gn-top-num { display: grid; grid-template-columns: auto 64px; align-items: center; column-gap: 10px; justify-items: end; flex: none; }
.gn-top-num b { font-weight: 700; color: var(--hn-strong); }
.gn-top-num b.gain { color: var(--gain); }
.gn-top-num .hn-bar { width: 64px; max-width: none; }
.gn-top-num small { grid-column: 1 / -1; font-size: 11px; color: var(--hn-faint); }

/* classes em barras (botões: levam à aba Classes com a classe escolhida) */
ul.gn-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.gn-bar-row {
  width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; row-gap: 5px; align-items: center; padding: 6px 6px 7px;
  border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.gn-bar-row:hover { background: var(--hn-hover); }
.gn-bar-row .pn-meter { grid-column: 1 / -1; }
.gn-bar-num { display: flex; align-items: baseline; gap: 8px; }
.gn-bar-num b { font-weight: 700; color: var(--hn-strong); }
.gn-bar-num small { width: 34px; text-align: right; font-size: 12px; color: var(--hn-muted); }

/* ---------- membros ---------- */
.gn-filter {
  display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; flex: 0 1 240px; min-width: 0;
  background: var(--hn-bg); border: 1px solid var(--hn-line-2); border-radius: 8px; color: #8b93a7;
}
.gn-filter:focus-within { border-color: oklch(0.82 0.11 85 / 0.6); }
.gn-filter input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: none; color: var(--hn-text); font-size: 13px; }
.gn-filter input::-webkit-search-cancel-button { display: none; }
/* os 30 que formam a força: a posição em dourado claro e a linha que os separa do resto */
.gn-in-top .hn-rank:not(.r1):not(.r2):not(.r3) { color: oklch(0.86 0.1 85); }
tr.gn-cutline td { height: auto; padding: 6px 14px; cursor: default; background: var(--gold-soft); border-top: 1px dashed oklch(0.82 0.11 85 / 0.5); }
tr.gn-cutline span { font-size: 12px; color: oklch(0.86 0.1 85); }
body.gn .hn-table tbody tr.gn-cutline { cursor: default; }
body.gn .hn-table tbody tr.gn-cutline:hover { background: var(--gold-soft); }
td.gn-checked { font-size: 12px; color: var(--hn-faint); }

/* ---------- classes ---------- */
.gn-compact td { height: 44px; }
.gn-compact tbody tr { cursor: pointer; }
.gn-compact a:hover .hn-cls, a.gn-best:hover { color: var(--gold); }
a.gn-best { font-weight: 600; color: var(--hn-soft); }
.gn-class-seg { flex-wrap: wrap; align-self: flex-start; }
.gn-class-seg > button { height: 28px; }
/* ranking da classe: tabela como a dos membros, com "Mostrar todos" embaixo */
#class-list { display: flex; flex-direction: column; gap: 8px; }
.gn-class-table tbody tr { cursor: pointer; }
/* todas as colunas centradas (título e valor), menos a do personagem */
.gn-class-table th:not(:nth-child(2)), .gn-class-table td:not(:nth-child(2)) { text-align: center; white-space: nowrap; }
.gn-class-table td:not(:nth-child(2)) { font-family: var(--mono); }
.gn-class-table .hn-power { justify-content: center; }
.gn-gain.up { color: var(--gain); }
.gn-gain.down { color: oklch(0.8 0.12 25); }

/* ---------- atividade ---------- */
.gn-change-who { flex: none; max-width: 120px; font-weight: 600; color: var(--hn-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gn-change-who:hover { color: var(--gold); }
/* várias mudanças do mesmo personagem numa atualização: uma linha que abre */
.gn-chg-group > details { border-radius: 8px; border-left: 3px solid var(--hn-line-3); background: var(--hn-bg); }
.gn-chg-group > details[open] { border-left-color: var(--gold); }
.gn-chg-group summary {
  display: flex; align-items: center; gap: 10px; min-width: 0; padding: 7px 8px; cursor: pointer; list-style: none;
  font-size: 13px; color: var(--hn-soft); border-radius: 8px;
}
.gn-chg-group summary::-webkit-details-marker { display: none; }
.gn-chg-group summary:hover { background: #121a2b; }
.gn-chg-group summary::after { content: '+'; margin-left: auto; padding-left: 6px; color: var(--hn-muted); }
.gn-chg-group details[open] summary::after { content: '−'; }
.gn-chg-group time { flex: none; width: 40px; font-size: 12px; color: var(--hn-faint); }
.gn-chg-count { flex: none; padding: 1px 7px; border-radius: 4px; font-size: 11px; font-weight: 600; color: var(--hn-soft); background: var(--hn-raised); }
.gn-chg-icons { display: flex; gap: 4px; min-width: 0; overflow: hidden; --tile: 28px; }
.gn-chg-icons .tile { --tile: 28px; border-radius: 6px; flex: none; }
.gn-chg-group .pn-changes { padding: 0 6px 8px 10px; }

/* ---------- tablet e celular ---------- */
@media (max-width: 720px) {
  body.gn .hn-main { padding-top: 14px; }
  .gn-crest { width: 84px; height: 94px; }
  .gn-crest .gn-shield { width: 75px; height: 86px; }
  .gn-chg-icons { display: none; }
  .gn-filter { flex: 1 1 100%; }
  .hn-toolbar #m-class, .hn-toolbar #m-sort { flex: 1 1 calc(50% - 4px); }
  .gn-top-num { grid-template-columns: auto; }
  .gn-top-num .hn-bar { display: none; }
  .gn-change-who { max-width: 90px; }
}
@media (max-width: 480px) {
  .gn-hls { grid-template-columns: minmax(0, 1fr); }
  body.gn .pn-ovstat span { white-space: normal; font-size: 10px; }
  body.gn .pn-ovstat b { font-size: 16px; }
}

/* "Ariel #1 / LATAM #1" do cabeçalho: o nome em negrito */
body.gn .pn-kpi-ranks strong { font-weight: 700; color: var(--hn-strong); }
body.gn .pn-kpi-ranks a:hover strong { color: var(--gold); }
