:root {
    --fundo: #0f1115;
    --fundo-cartao: #181b22;
    --fundo-escuro: #12151b;
    --borda: #2a2f3a;
    --texto: #e6e6e6;
    --texto-suave: #9aa3b2;
    --destaque: #f5c451;
    --alta: #e5484d;
    --media: #f5a524;
    --baixa: #3e9bff;
    --cor-classe: #cccccc;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--fundo);
    color: var(--texto);
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    line-height: 1.5;
}

/* Arte de fundo no topo de todas as páginas, escurecida e sumindo no fundo da página, como no mythicstats.com */
body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 500px;
    z-index: -1;
    pointer-events: none;
    /* 95% deixa a caverna e o grupo à vista no celular, onde só cabe um pedaço da arte;
       70% na vertical mantém o grupo acima dos cartões em telas largas, onde a arte é cortada em cima */
    background:
        linear-gradient(to bottom, rgba(15, 17, 21, .3), rgba(15, 17, 21, .7) 65%, var(--fundo)),
        url("fundo-caverna.svg") 95% 70% / cover no-repeat;
}

a { color: var(--destaque); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; }
h1:focus { outline: none; }
h3 { font-size: 1rem; margin: 1.25rem 0 .5rem; }
code { font-family: Consolas, "Cascadia Mono", monospace; }

.suave { color: var(--texto-suave); }
.ruim { color: var(--alta); }
.dica { color: var(--texto-suave); font-size: .9rem; margin-top: 0; }

/* Estrutura */
.topo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: .75rem 1.5rem;
    border-bottom: 1px solid var(--borda);
    /* Semitransparente para a arte de fundo aparecer atrás do topo */
    background: rgba(18, 21, 27, .6);
}
.topo nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; font-size: 1.4rem; font-weight: 700; letter-spacing: .04em; color: var(--texto); }
.logo span { color: var(--destaque); }
.logo svg { width: 1.75rem; height: 1.75rem; margin-right: .4rem; fill: none; stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; }
.logo polyline { stroke: var(--destaque); }
.logo line { stroke: var(--texto); }
.logo:hover { text-decoration: none; }
.conteudo { max-width: 1150px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.rodape {
    max-width: 1150px;
    margin: 0 auto;
    padding: 1rem;
    color: var(--texto-suave);
    font-size: .8rem;
    border-top: 1px solid var(--borda);
}

/* Componentes */
.botao {
    display: inline-block;
    background: var(--destaque);
    color: #111;
    border: 1px solid var(--destaque);
    border-radius: 6px;
    padding: .45rem 1rem;
    font-weight: 600;
    font-size: .92rem;
    cursor: pointer;
    white-space: nowrap;
}
.botao:hover { text-decoration: none; filter: brightness(1.1); }
.botao:disabled { opacity: .6; cursor: wait; }
.botao.secundario { background: transparent; color: var(--destaque); }
.botao.perigo { background: var(--alta); border-color: var(--alta); color: #fff; }

.cartao {
    background: var(--fundo-cartao);
    border: 1px solid var(--borda);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    min-width: 0;
}
.cartao h2 { margin-top: 0; font-size: 1.1rem; }

.aviso {
    background: #2a2413;
    border: 1px solid #5c4a14;
    border-radius: 8px;
    padding: .75rem 1rem;
}

.grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.duas-colunas { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 0 1rem; }
.tres-colunas { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 1rem; }

.numeros { display: flex; gap: 1rem; flex-wrap: wrap; margin: 1rem 0; }
.numeros div {
    background: var(--fundo-escuro);
    border: 1px solid var(--borda);
    border-radius: 8px;
    padding: .5rem .9rem;
}
.numeros strong { display: block; font-size: 1.35rem; }
.numeros span { color: var(--texto-suave); font-size: .8rem; }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--borda); vertical-align: top; }
th { color: var(--texto-suave); font-weight: 600; }
.tabela-rolagem { overflow-x: auto; }
.tabela-rolagem td { min-width: 180px; }
.tabela-rolagem td:first-child { min-width: 0; }

/* Barras de popularidade */
.linha-popularidade {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px 2.6rem;
    align-items: center;
    gap: .6rem;
    padding: .15rem 0;
    font-size: .9rem;
}
.linha-popularidade .nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linha-popularidade .barra { height: 8px; background: #262b35; border-radius: 4px; overflow: hidden; }
.linha-popularidade .barra span { display: block; height: 100%; background: var(--cor-classe); }
.linha-popularidade .percentual { text-align: right; color: var(--texto-suave); }
.linha-popularidade.destaque .nome::after { content: " (você)"; color: var(--destaque); }

/* Página inicial */
.chamada { text-align: center; padding: 1.5rem 0 2rem; }
.chamada h1 { font-size: 2rem; margin-bottom: .5rem; }
.chamada p { max-width: 640px; margin: 0 auto 1.25rem; }
.classe { border-top: 3px solid var(--cor-classe); }
.classe h2 { color: var(--cor-classe); }
.classe a { display: block; padding: .2rem 0; }
.classe small { color: var(--texto-suave); margin-left: .35rem; }

/* Especialização e comparação */
.titulo-spec h1 { color: var(--cor-classe); margin: 0 0 .25rem; }
.titulo-spec h1 span { color: var(--texto-suave); font-weight: 400; font-size: .6em; }
.titulo-spec p { margin: 0; }
.cabecalho-personagem { display: flex; gap: 1rem; align-items: center; }
.cabecalho-personagem > img { width: 72px; height: 72px; border-radius: 10px; border: 2px solid var(--cor-classe); }

.codigo-talentos { display: flex; gap: .6rem; align-items: center; margin-bottom: .5rem; }
.codigo-talentos code {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: #0c0e12;
    padding: .35rem .5rem;
    border-radius: 6px;
    font-size: .78rem;
}

.sugestao { display: flex; gap: .75rem; align-items: baseline; padding: .5rem 0; border-bottom: 1px solid var(--borda); }
.sugestao:last-child { border-bottom: 0; }
.etiqueta { font-size: .7rem; font-weight: 700; text-transform: uppercase; padding: .1rem .45rem; border-radius: 4px; white-space: nowrap; }
.prioridade-1 { background: var(--alta); color: #fff; }
.prioridade-2 { background: var(--media); color: #111; }
.prioridade-3 { background: var(--baixa); color: #fff; }
.categoria { color: var(--texto-suave); font-size: .8rem; white-space: nowrap; min-width: 6.5rem; }

/* Meus personagens */
.personagem {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    border-left: 4px solid var(--cor-classe);
}
.personagem strong { color: var(--cor-classe); font-size: 1.05rem; }
.personagem small { display: block; color: var(--texto-suave); }
.acoes { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Ícones */
.icone-pequeno { width: 18px; height: 18px; border-radius: 3px; vertical-align: -4px; margin-right: .3rem; }
.icone-classe { width: 26px; height: 26px; border-radius: 5px; vertical-align: -6px; margin-right: .4rem; border: 1px solid var(--cor-classe); }
.icone-item { width: 34px; height: 34px; border-radius: 4px; border: 1px solid #a335ee; flex-shrink: 0; }
.icone-grande { width: 64px; height: 64px; border-radius: 10px; border: 2px solid var(--cor-classe); }
.item-com-icone { display: flex; align-items: center; gap: .5rem; }
.item-com-icone:hover { text-decoration: none; }
/* Várias opções de item no mesmo slot, uma embaixo da outra */
.item-com-icone + .item-com-icone { margin-top: .4rem; }
/* Nome da spec em cima e o rating embaixo, para o nome não quebrar no meio */
.link-spec { display: flex !important; align-items: center; gap: .6rem; line-height: 1.25; }
.link-spec .icone-spec { width: 30px; height: 30px; border-radius: 5px; flex-shrink: 0; }
.link-spec small { display: block; margin-left: 0; font-size: .78rem; }
.nome-jogador { color: var(--cor-classe); font-weight: 600; }
.voltar { margin: 0 0 .75rem; font-size: .9rem; }
.identificacao-personagem { display: flex; align-items: center; gap: .75rem; }
.identificacao-personagem .icone-classe { width: 40px; height: 40px; margin: 0; }
.linha-popularidade .nome a { color: var(--texto); }
.link-encantamento { color: var(--texto); }
.link-sugestao { font-weight: 600; }
.link-sugestao .icone-pequeno { margin-right: .2rem; }
.encantamento-mais-usado { margin-top: .35rem; }
.etiqueta-sua { background: var(--destaque); color: #111; border-radius: 4px; padding: 0 .35rem; font-size: .7rem; font-weight: 700; margin-left: .35rem; }

/* Comparação de atributos: você x top */
.comparacao-atributo { margin-bottom: .65rem; }
.rotulo-atributo { font-weight: 600; font-size: .92rem; margin-bottom: .15rem; }
.linha-comparacao { display: grid; grid-template-columns: 3.6rem minmax(0, 1fr) 2.8rem; align-items: center; gap: .6rem; font-size: .85rem; }
.linha-comparacao .legenda { color: var(--texto-suave); }
.linha-comparacao .barra { height: 10px; background: #262b35; border-radius: 5px; overflow: hidden; }
.linha-comparacao .barra span { display: block; height: 100%; border-radius: 5px; }
.linha-comparacao.voce .barra span, .linha-comparacao.jogador .barra span { background: var(--destaque); }
.linha-comparacao.top .barra span { background: var(--cor-classe); }
.linha-comparacao .valor { text-align: right; }

/* Árvore de talentos */
/* Classe e spec lado a lado; as heroicas embaixo, separadas por uma linha. Tudo centralizado. */
.arvores { display: flex; flex-direction: column; gap: 1.5rem; }
.linha-arvores { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 1.5rem 3.5rem; }
.linha-arvores.heroicas { border-top: 1px solid var(--borda); padding-top: 1.25rem; }
.bloco-arvore { display: flex; flex-direction: column; align-items: center; min-width: 0; max-width: 100%; }
.bloco-arvore h3 { margin: 0 0 .75rem; text-align: center; }
.bloco-arvore h3 small { font-weight: 400; margin-left: .35rem; }
/* Folga lateral: o rótulo dos nós de escolha ("8 · 92") é mais largo que o nó */
.arvore-rolagem { overflow-x: auto; max-width: 100%; padding: 4px 14px .25rem; }
.arvore-talentos { position: relative; --tamanho-no: 44px; }
.arvore-talentos .ligacoes { position: absolute; inset: 0; pointer-events: none; }
.arvore-talentos .ligacoes line { stroke: #353b47; stroke-width: 2.5; }
.arvore-talentos .ligacoes line.forte { stroke: #7a6a3a; }
.no { position: absolute; width: var(--tamanho-no); height: var(--tamanho-no); border-radius: 50%; background: #0c0e12; box-shadow: 0 0 0 2px #3a404c; }
.no.ativo { border-radius: 8px; }
.no.escolha { border-radius: 10px; }
/* Recorta os ícones no formato do nó; o anel colorido é o box-shadow do .no, por fora */
.no .icones { display: flex; width: 100%; height: 100%; border-radius: inherit; overflow: hidden; }
.no .opcao { flex: 1; min-width: 0; height: 100%; display: block; }
.no.escolha .opcao + .opcao { border-left: 2px solid #0c0e12; }
.no .opcao img { width: 100%; height: 100%; object-fit: cover; display: block; }
.no .sem-icone { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; font-size: .8rem; color: var(--texto-suave); }
.no .uso { position: absolute; top: calc(var(--tamanho-no) + 2px); left: 50%; transform: translateX(-50%); font-size: .72rem; white-space: nowrap; color: var(--texto-suave); }
.no.muito-usado { box-shadow: 0 0 0 2px #3fb950; }
.no.muito-usado .uso { color: #3fb950; font-weight: 600; }
.no.usado { box-shadow: 0 0 0 2px #d29922; }
.no.meu { box-shadow: 0 0 0 3px var(--destaque), 0 0 6px 2px rgba(245, 196, 81, .35); }
.legenda-arvore { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.2rem; font-size: .8rem; color: var(--texto-suave); margin-bottom: 1.1rem; }
.legenda-arvore .marca { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -2px; margin-right: .3rem; background: #0c0e12; box-shadow: 0 0 0 2px #3a404c; }
.legenda-arvore .marca.muito-usado { box-shadow: 0 0 0 2px #3fb950; }
.legenda-arvore .marca.usado { box-shadow: 0 0 0 2px #d29922; }
.legenda-arvore .marca.meu { box-shadow: 0 0 0 2px var(--destaque), 0 0 6px 1px rgba(245, 196, 81, .55); }

/* Janela do build: quem rola é o fundo, então a janela pode ser mais alta que a tela */
.fundo-janela {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, .72);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 3vh 1rem;
    overflow-y: auto;
    outline: none;
}
body:has(.fundo-janela) { overflow: hidden; }
.janela-build {
    width: min(1240px, 100%);
    background: var(--fundo-cartao);
    border: 1px solid var(--borda);
    border-top: 3px solid var(--cor-classe);
    border-radius: 10px;
    padding: 1rem 1.25rem 1.5rem;
}
.topo-janela { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .5rem; }
.topo-janela h2 { margin: 0; font-size: 1.15rem; }
.topo-janela h2 small { font-weight: 400; font-size: .85rem; margin-left: .4rem; }
.fechar-janela { background: none; border: 0; color: var(--texto-suave); font-size: 1.8rem; line-height: 1; cursor: pointer; padding: 0 .25rem; }
.fechar-janela:hover { color: var(--texto); }
.janela-build .codigo-talentos { margin-bottom: 1.25rem; }

/* Aviso de cookies do Google Analytics: fica no rodapé até a pessoa escolher */
.aviso-cookies {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 900;
    max-width: 760px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: var(--fundo-cartao);
    border: 1px solid var(--borda);
    border-radius: 8px;
    padding: .75rem 1rem;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .45);
    font-size: .9rem;
}
.aviso-cookies[hidden] { display: none; }
.aviso-cookies p { margin: 0; flex: 1 1 320px; }
.aviso-cookies div { display: flex; gap: .5rem; }

@media (max-width: 600px) {
    .sugestao { flex-wrap: wrap; gap: .4rem; }
    .chamada h1 { font-size: 1.5rem; }
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}
.blazor-error-boundary::after { content: "Ocorreu um erro."; }
