/* Apuração ao vivo · 4412 — identidade ID 26: azul-marinho #171E31, limão #CCFF00, azul #0B3984. Só tema escuro (TV). */
:root {
  --fundo: #0d1322;
  --fundo-2: #121a2d;
  --superficie: #171e31;
  --superficie-2: #1d2640;
  --linha: #2a3554;
  --linha-forte: #3a4770;
  --texto: #f5f5f5;
  --texto-2: #b7c0d8;
  --texto-3: #7d88a8;
  --limao: #ccff00;
  --limao-escuro: #0d1322;
  --azul: #0b3984;
  --azul-claro: #5b8def;
  --vivo: #ccff00;
  --alerta: #ffb547;
  --erro: #ff6b6b;
  --raio: 14px;
  --sombra: 0 1px 0 rgba(255,255,255,.04) inset, 0 12px 32px -18px rgba(0,0,0,.6);
  --fonte: 'Archivo', 'Segoe UI', system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 85% -10%, rgba(11,57,132,.45), transparent 60%), var(--fundo);
  background-attachment: fixed;
  color: var(--texto);
  font-family: var(--fonte);
  font-size: 15px;
  line-height: 1.4;
  min-height: 100vh;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.faixa-prova { background: repeating-linear-gradient(135deg, #ffb547 0 14px, #f59e0b 14px 28px); color: #1a1205; font-weight: 800; text-align: center; padding: 6px 16px; font-size: 13px; letter-spacing: .02em; }

/* ---------------------------------------------------------------- topo */
.topo { display: flex; align-items: center; gap: 24px; padding: 18px 28px; border-bottom: 1px solid var(--linha); background: rgba(13,19,34,.7); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; }
.topo-logo { height: 44px; width: auto; }
.topo-titulo { flex: 1; min-width: 0; }
.sobre { display: block; font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--limao); }
.topo h1 { margin: 2px 0 0; font-size: 22px; font-weight: 800; font-stretch: 90%; letter-spacing: -.01em; }
.topo-estado { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.hora { font-size: 12px; color: var(--texto-3); }
.pilula { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--linha-forte); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.pilula i { width: 8px; height: 8px; border-radius: 50%; background: var(--texto-3); }
.pilula[data-estado="vivo"] { border-color: rgba(204,255,0,.5); color: var(--limao); background: rgba(204,255,0,.07); }
.pilula[data-estado="vivo"] i { background: var(--limao); box-shadow: 0 0 0 0 rgba(204,255,0,.7); animation: pulso 1.6s infinite; }
.pilula[data-estado="aguardando"] { color: var(--alerta); border-color: rgba(255,181,71,.45); }
.pilula[data-estado="aguardando"] i { background: var(--alerta); }
.pilula[data-estado="concluida"] { color: var(--azul-claro); border-color: rgba(91,141,239,.5); }
.pilula[data-estado="concluida"] i { background: var(--azul-claro); }
.pilula[data-estado="indisponivel"] { color: var(--erro); border-color: rgba(255,107,107,.5); }
.pilula[data-estado="indisponivel"] i { background: var(--erro); }
@keyframes pulso { 70% { box-shadow: 0 0 0 8px rgba(204,255,0,0); } 100% { box-shadow: 0 0 0 0 rgba(204,255,0,0); } }
.topo-acoes { display: flex; gap: 8px; }
.bt { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--linha-forte); background: var(--superficie); font-size: 13px; font-weight: 700; cursor: pointer; transition: border-color .15s, background .15s, transform .1s; }
.bt svg { width: 16px; height: 16px; }
.bt:hover { border-color: var(--limao); }
.bt:active { transform: translateY(1px); }
.bt:focus-visible, .atalhos button:focus-visible, .abas button:focus-visible, input:focus-visible, select:focus-visible, .x:focus-visible, .estrela:focus-visible { outline: 2px solid var(--limao); outline-offset: 2px; }
.bt.girando svg { animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

.aviso { margin: 16px 28px 0; padding: 12px 16px; border-radius: 10px; border: 1px solid rgba(255,181,71,.4); background: rgba(255,181,71,.08); color: #ffd9a0; font-size: 14px; }
.aviso.erro { border-color: rgba(255,107,107,.45); background: rgba(255,107,107,.08); color: #ffc4c4; }

/* ---------------------------------------------------------------- totalização */
.totalizacao { display: grid; grid-template-columns: minmax(280px, 1.1fr) 2fr; gap: 28px; margin: 20px 28px 0; padding: 22px 26px; border-radius: var(--raio); background: linear-gradient(135deg, var(--superficie) 0%, #142350 100%); border: 1px solid var(--linha); box-shadow: var(--sombra); align-items: center; }
.rotulo, .tot-numeros dt { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--texto-3); }
.tot-pct { display: flex; align-items: baseline; gap: 4px; margin: 2px 0 10px; }
.tot-pct b { font-size: 64px; font-weight: 900; font-stretch: 85%; line-height: .95; letter-spacing: -.03em; }
.tot-pct span { font-size: 28px; font-weight: 800; color: var(--texto-2); }
.barra { height: 10px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.barra i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8fb800, var(--limao)); border-radius: inherit; transition: width .8s cubic-bezier(.2,.8,.2,1); }
.tot-secoes { display: block; margin-top: 8px; font-size: 13px; color: var(--texto-2); }
.tot-numeros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 24px; margin: 0; }
.tot-numeros div { border-left: 2px solid var(--linha-forte); padding-left: 12px; }
.tot-numeros dd { margin: 4px 0 0; font-size: 22px; font-weight: 800; font-stretch: 90%; }
.tot-numeros dd small { font-size: 13px; font-weight: 600; color: var(--texto-3); margin-left: 6px; }

/* ---------------------------------------------------------------- grade */
.grade { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); grid-template-areas: "acomp graf" "rank rank"; gap: 20px; margin: 20px 28px; }
.acompanhando { grid-area: acomp; }
.grafico { grid-area: graf; }
.ranking { grid-area: rank; }
.painel { background: var(--superficie); border: 1px solid var(--linha); border-radius: var(--raio); padding: 18px 20px 20px; box-shadow: var(--sombra); min-width: 0; }
.painel-topo { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.painel h2 { margin: 0; font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.qtd { font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: var(--superficie-2); color: var(--texto-2); }

/* busca + sugestões */
.busca-wrap { position: relative; flex: 1; max-width: 420px; min-width: 220px; }
.busca-wrap.pequena { max-width: 260px; min-width: 160px; }
.busca-wrap > svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--texto-3); pointer-events: none; }
.busca-wrap input, .filtros select { width: 100%; padding: 10px 12px 10px 36px; border-radius: 10px; border: 1px solid var(--linha-forte); background: var(--fundo-2); font-size: 14px; }
.filtros select { padding-left: 12px; width: auto; max-width: 220px; cursor: pointer; }
.busca-wrap input::placeholder { color: var(--texto-3); }
.sugestoes { position: absolute; left: 0; right: 0; top: calc(100% + 6px); list-style: none; margin: 0; padding: 6px; background: var(--superficie-2); border: 1px solid var(--linha-forte); border-radius: 12px; box-shadow: 0 18px 40px -12px rgba(0,0,0,.7); max-height: 360px; overflow: auto; z-index: 30; }
.sugestoes li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.sugestoes li[aria-selected="true"], .sugestoes li:hover { background: rgba(204,255,0,.1); }
.sugestoes li b { font-weight: 700; }
.sugestoes li small { grid-column: 1; color: var(--texto-3); font-size: 12px; }
.sugestoes li span { grid-row: 1 / 3; grid-column: 2; align-self: center; font-size: 13px; color: var(--texto-2); }
.sugestoes li.ja { opacity: .5; cursor: default; }
.sugestoes .vazio { color: var(--texto-3); cursor: default; }
.atalhos { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.atalhos button, .abas button { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--linha-forte); background: transparent; font-size: 12px; font-weight: 700; color: var(--texto-2); cursor: pointer; }
.atalhos button:hover, .abas button:hover { color: var(--texto); border-color: var(--texto-3); }
.abas { display: flex; gap: 6px; }
.abas button[aria-selected="true"] { background: var(--limao); border-color: var(--limao); color: var(--limao-escuro); }

/* cartões */
.cartoes { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.cartao { position: relative; padding: 14px 16px 12px; border-radius: 12px; background: var(--fundo-2); border: 1px solid var(--linha); border-top: 3px solid var(--cor, var(--texto-3)); display: flex; flex-direction: column; gap: 6px; }
.cartao.novo { animation: entra .3s ease-out; }
@keyframes entra { from { opacity: 0; transform: translateY(6px); } }
.cartao.destaque { background: linear-gradient(160deg, rgba(204,255,0,.10), rgba(204,255,0,0) 55%), var(--fundo-2); border-color: rgba(204,255,0,.35); grid-column: 1 / -1; }
.cartao .cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.cartao .nome { font-size: 16px; font-weight: 800; line-height: 1.15; }
.cartao.destaque .nome { font-size: 22px; }
.cartao .meta { font-size: 12px; color: var(--texto-3); margin-top: 2px; }
.cartao .pos { text-align: right; flex-shrink: 0; }
.cartao .pos small { display: block; font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--texto-3); }
.cartao .pos b { font-size: 26px; font-weight: 900; font-stretch: 85%; color: var(--cor); }
.cartao.destaque .pos b { font-size: 40px; }
.cartao .votos { font-size: 32px; font-weight: 900; font-stretch: 85%; letter-spacing: -.02em; line-height: 1; }
.cartao.destaque .votos { font-size: 56px; }
.cartao .linha-inf { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--texto-2); }
.delta { font-weight: 800; color: var(--limao); }
.delta.zero { color: var(--texto-3); font-weight: 600; }
.cartao .spark { width: 100%; height: 34px; display: block; }
.cartao.destaque .spark { height: 54px; }
.cartao .x { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; border: 0; background: transparent; color: var(--texto-3); cursor: pointer; opacity: 0; transition: opacity .15s; }
.cartao:hover .x, .cartao .x:focus-visible { opacity: 1; }
.cartao:hover .pos { visibility: hidden; }
.cartao .x:hover { background: rgba(255,255,255,.08); color: var(--texto); }
.cartao .x svg { width: 14px; height: 14px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: rgba(255,107,107,.12); color: #ffb0b0; }
.vazio-cartoes { grid-column: 1 / -1; padding: 28px; text-align: center; color: var(--texto-3); border: 1px dashed var(--linha-forte); border-radius: 12px; }

/* gráfico */
.grafico { display: flex; flex-direction: column; }
.grafico-area { position: relative; height: 380px; }
.grafico-area svg.g { position: absolute; inset: 0; }
.grafico-area.barras { height: auto; min-height: 120px; }
.grafico-area.barras svg.g { position: static; }
.grafico-area svg.g { width: 100%; height: 100%; display: block; overflow: visible; }
.g text { stroke: none; }
.g .sub-barra { fill: var(--texto-3); font-size: 11px; font-family: var(--fonte); }
.g .sub-val { fill: var(--texto-3); font-weight: 600; }
.g .eixo text { fill: var(--texto-3); stroke: none; font-size: 11px; font-family: var(--fonte); }
.g .grade-l { stroke: rgba(255,255,255,.06); stroke-width: 1; }
.g .linha { stroke-width: 2.5; }
.g .linha.destaque { stroke-width: 4; }
.g .ponto { stroke: var(--superficie); stroke-width: 2; }
.g .rotulo-fim { stroke: none; font-size: 12px; font-weight: 800; font-family: var(--fonte); }
.g .guia { stroke: rgba(255,255,255,.25); stroke-dasharray: 3 3; stroke-width: 1; }
.g .barra-r { transition: width .6s cubic-bezier(.2,.8,.2,1); }
.g .barra-txt { stroke: none; font-size: 13px; font-weight: 700; font-family: var(--fonte); fill: var(--texto); }
.g .barra-val { stroke: none; font-size: 13px; font-weight: 800; font-family: var(--fonte); }
.grafico-vazio { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--texto-3); padding: 24px; border: 1px dashed var(--linha-forte); border-radius: 12px; font-size: 14px; }
.grafico-vazio b { display: block; color: var(--texto-2); font-size: 16px; margin-bottom: 4px; }
.legenda { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12px; color: var(--texto-2); }
.legenda span { display: inline-flex; align-items: center; gap: 6px; }
.legenda i { width: 10px; height: 10px; border-radius: 3px; background: var(--cor); }
.dica { position: fixed; z-index: 50; pointer-events: none; background: #0a0f1c; border: 1px solid var(--linha-forte); border-radius: 10px; padding: 10px 12px; font-size: 12px; box-shadow: 0 12px 30px -10px rgba(0,0,0,.8); min-width: 180px; }
.dica h4 { margin: 0 0 6px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--texto-3); }
.dica div { display: flex; justify-content: space-between; gap: 14px; }
.dica div span { display: inline-flex; align-items: center; gap: 6px; }
.dica i { width: 8px; height: 8px; border-radius: 2px; background: var(--cor); }

/* ranking */
.filtros { display: flex; gap: 8px; flex-wrap: wrap; }
.tabela-wrap { overflow-x: auto; }
.tabela { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabela th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--texto-3); padding: 8px 10px; border-bottom: 1px solid var(--linha); position: sticky; top: 0; background: var(--superficie); }
.tabela td { padding: 9px 10px; border-bottom: 1px solid rgba(255,255,255,.04); }
.tabela tr:hover td { background: rgba(255,255,255,.025); }
.tabela tr.sel td { background: rgba(204,255,0,.05); }
.tabela tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--cor, var(--limao)); }
.c-pos { width: 64px; font-weight: 800; color: var(--texto-2); }
.c-num { text-align: right !important; white-space: nowrap; }
.c-pct { width: 80px; color: var(--texto-2); }
.c-part { width: 120px; color: var(--texto-2); }
.c-acao { width: 48px; text-align: center; }
.tabela .nome-c { font-weight: 700; }
.tabela .num-c { color: var(--texto-3); font-size: 12px; margin-left: 6px; }
.estrela { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--texto-3); cursor: pointer; }
.estrela svg { width: 16px; height: 16px; }
.estrela:hover { border-color: var(--linha-forte); color: var(--texto); }
.estrela[aria-pressed="true"] { color: var(--limao); }
.estrela[aria-pressed="true"] svg { fill: var(--limao); }
.bt-mais { margin: 14px auto 0; display: flex; }

.rodape { display: flex; flex-direction: column; gap: 4px; padding: 0 28px 28px; font-size: 12px; color: var(--texto-3); }

/* ---------------------------------------------------------------- telão */
body.telao { font-size: 17px; }
body.telao .ranking, body.telao .atalhos, body.telao .busca-wrap, body.telao .cartao .x, body.telao .rodape span:not(:first-child), body.telao #bt-atualizar { display: none; }
body.telao .grade { grid-template-areas: "acomp graf"; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
body.telao .grafico-area { height: 52vh; }
body.telao .tot-pct b { font-size: 84px; }
body.telao .cartao:hover .pos { visibility: visible; }

/* ---------------------------------------------------------------- telas menores */
@media (max-width: 1100px) {
  .grade { grid-template-columns: 1fr; grid-template-areas: "acomp" "graf" "rank"; }
  body.telao .grade { grid-template-areas: "acomp" "graf"; grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .topo { flex-wrap: wrap; gap: 10px 12px; padding: 12px 16px; position: static; }
  .topo-logo { height: 32px; }
  .topo-acoes { margin-left: auto; }
  .topo-acoes .bt { padding: 8px 10px; }
  .topo-acoes .bt span { display: none; }
  .topo-titulo { order: 3; flex-basis: 100%; }
  .topo h1 { font-size: 18px; }
  .topo-estado { order: 4; flex-basis: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
  .faixa-prova { font-size: 11px; }
  .totalizacao { grid-template-columns: 1fr; margin: 16px 16px 0; padding: 18px; gap: 18px; }
  .tot-pct b { font-size: 52px; }
  .tot-numeros { grid-template-columns: repeat(2, 1fr); }
  .tot-numeros dd { font-size: 18px; }
  .grade { margin: 16px; gap: 16px; }
  .aviso { margin: 12px 16px 0; }
  .painel { padding: 16px 14px; }
  .busca-wrap, .busca-wrap.pequena { max-width: none; min-width: 0; flex-basis: 100%; }
  .filtros { width: 100%; }
  .filtros select { max-width: none; width: 100%; }
  .cartao .x { opacity: 1; }
  .cartao:hover .pos { visibility: visible; }
  .cartao .pos { margin-right: 22px; }
  .cartao.destaque .votos { font-size: 44px; }
  .c-part, .c-pct { display: none; }
  .rodape { padding: 0 16px 24px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
