:root {
  --bg: #060a13;
  --painel: #0d1424;
  --painel-2: #111b30;
  --linha: rgba(148, 163, 184, .12);
  --texto: #f1f5f9;
  --suave: #8a9bb8;
  --acento: #2dd4bf;
  --acento-2: #14b8a6;
  --ouro: #fbbf24;
  --prata: #cbd5e1;
  --bronze: #d97706;
  --vivo: #ef4444;
  --fs: clamp(14px, 1.05vw, 26px);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(1000px 500px at 100% -10%, rgba(20, 184, 166, .18), transparent 60%),
    radial-gradient(800px 400px at -10% 110%, rgba(59, 130, 246, .12), transparent 60%),
    var(--bg);
  color: var(--texto); font: 400 var(--fs)/1.4 'Inter', system-ui, sans-serif;
  display: flex; flex-direction: column; min-height: 100vh; -webkit-font-smoothing: antialiased;
}
body.tv { cursor: none; }
.num, .topo strong, .abas button, .pos, .pontos, .cabecalho h1 { font-family: 'Barlow Condensed', 'Inter', sans-serif; }

/* topo */
.topo { display: flex; align-items: center; gap: 1.2em; padding: 1em 2em; border-bottom: 1px solid var(--linha); background: rgba(6, 10, 19, .6); backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 5; }
.marca { display: flex; align-items: center; gap: .8em; flex: 1; min-width: 0; }
.logo { display: grid; place-items: center; width: 2.6em; height: 2.6em; border-radius: .6em; background: linear-gradient(135deg, var(--acento-2), #0f766e); box-shadow: 0 0 24px rgba(45, 212, 191, .35); flex: none; }
.logo svg { width: 1.5em; height: 1.5em; fill: none; stroke: #fff; stroke-width: 2; stroke-linejoin: round; }
.marca small { display: block; color: var(--suave); font-size: .75em; text-transform: uppercase; letter-spacing: .14em; font-weight: 600; }
.marca strong { display: block; font-size: 1.7em; font-weight: 700; letter-spacing: .01em; line-height: 1.05; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ao-vivo { display: flex; align-items: center; gap: .5em; padding: .35em .8em; border-radius: 999px; background: rgba(239, 68, 68, .12); color: #fca5a5; font-weight: 700; font-size: .8em; letter-spacing: .12em; }
.pulso { width: .6em; height: .6em; border-radius: 50%; background: var(--vivo); box-shadow: 0 0 0 0 rgba(239, 68, 68, .7); animation: pulso 1.8s infinite; }
@keyframes pulso { 70% { box-shadow: 0 0 0 .7em rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }
.relogio { font: 600 1.6em 'Barlow Condensed', sans-serif; color: var(--suave); font-variant-numeric: tabular-nums; }

/* abas */
.abas { display: flex; gap: .5em; padding: 1em 2em; overflow-x: auto; scrollbar-width: none; }
.abas::-webkit-scrollbar { display: none; }
.abas button { position: relative; flex: none; padding: .45em 1.1em; border-radius: .5em; border: 1px solid var(--linha); background: var(--painel); color: var(--suave); font-size: 1.15em; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; cursor: pointer; overflow: hidden; }
.abas button:hover { color: var(--texto); }
.abas button.ativa { background: linear-gradient(135deg, var(--acento-2), #0f766e); border-color: transparent; color: #fff; box-shadow: 0 6px 24px -6px rgba(45, 212, 191, .5); }
.abas .progresso { position: absolute; left: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .8); width: 0; }

/* placar */
.placar { flex: 1; width: 100%; padding: 0 2em 2em; }
.cabecalho { display: flex; align-items: flex-end; gap: 1em; padding: .4em .2em 1em; }
.cabecalho h1 { margin: 0; font-size: 2.6em; font-weight: 800; text-transform: uppercase; line-height: 1; letter-spacing: .01em; flex: 1; }
.cabecalho .tag { color: var(--acento); font: 700 .3em 'Inter', sans-serif; text-transform: uppercase; letter-spacing: .14em; display: block; margin-bottom: .4em; }
.cabecalho .legenda { color: var(--suave); font-size: .85em; text-align: right; }

.lista { list-style: none; margin: 0; padding: 0; display: grid; gap: .5em; }
.item { display: grid; grid-template-columns: 4.2em 2.4em 1fr auto; align-items: center; gap: 1.2em; padding: .7em 1.4em .7em .7em; border-radius: .8em; background: linear-gradient(90deg, var(--painel-2), var(--painel)); border: 1px solid var(--linha); animation: entra .45s both; }
.item.clicavel { cursor: pointer; }
.item.clicavel:hover { border-color: rgba(45, 212, 191, .4); }

.lista.estatico .item:not(.pisca-sobe):not(.pisca-desce) { animation: none; }
@keyframes entra { from { opacity: 0; transform: translateX(-12px); } }
.pos { display: grid; place-items: center; height: 2.4em; border-radius: .5em; background: rgba(148, 163, 184, .08); font-size: 1.6em; font-weight: 800; color: var(--suave); }
.nome { min-width: 0; }

/* seta de variação de posição */
.var { display: grid; justify-items: center; gap: .1em; font: 800 1.15em 'Barlow Condensed', sans-serif; line-height: 1; margin-left: -.6em; }
.var svg { width: 1.3em; height: 1.3em; }
.var.sobe { color: #22c55e; } .var.sobe svg { fill: #22c55e; filter: drop-shadow(0 0 6px rgba(34, 197, 94, .6)); }
.var.desce { color: #ef4444; } .var.desce svg { fill: #ef4444; filter: drop-shadow(0 0 6px rgba(239, 68, 68, .6)); }
.item.pisca-sobe { animation: pisca-sobe 2.4s ease-out; }
.item.pisca-desce { animation: pisca-desce 2.4s ease-out; }
@keyframes pisca-sobe { 0%, 40% { box-shadow: 0 0 0 2px #22c55e, 0 0 28px rgba(34, 197, 94, .45); } }
@keyframes pisca-desce { 0%, 40% { box-shadow: 0 0 0 2px #ef4444, 0 0 28px rgba(239, 68, 68, .4); } }
.nome strong { display: block; font-size: 1.25em; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nome small { color: var(--suave); font-size: .85em; }
.pontos { text-align: right; font-size: 2.2em; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.pontos small { display: block; font: 500 .38em 'Inter', sans-serif; color: var(--suave); letter-spacing: .08em; text-transform: uppercase; margin-top: .3em; }

/* pódio */
.item.p1, .item.p2, .item.p3 { padding-top: 1em; padding-bottom: 1em; }
.item.p1 { background: linear-gradient(90deg, rgba(251, 191, 36, .22), var(--painel) 55%); border-color: rgba(251, 191, 36, .45); }
.item.p2 { background: linear-gradient(90deg, rgba(203, 213, 225, .16), var(--painel) 55%); border-color: rgba(203, 213, 225, .3); }
.item.p3 { background: linear-gradient(90deg, rgba(217, 119, 6, .2), var(--painel) 55%); border-color: rgba(217, 119, 6, .38); }
.p1 .pos { background: var(--ouro); color: #3b2500; }
.p2 .pos { background: var(--prata); color: #1e293b; }
.p3 .pos { background: var(--bronze); color: #fff; }
.p1 .nome strong, .p2 .nome strong, .p3 .nome strong { font-size: 1.45em; }
.p1 .pontos { color: var(--ouro); }

/* final: boulders */
.boulders { display: flex; flex-wrap: wrap; gap: .35em; margin-top: .35em; }
.bl { display: inline-flex; gap: .2em; font: 600 .78em 'Inter', sans-serif; }
.bl span { padding: .1em .45em; border-radius: .3em; background: rgba(148, 163, 184, .12); color: var(--suave); }
.bl .t.ok { background: rgba(45, 212, 191, .2); color: var(--acento); }
.bl .z.ok { background: rgba(251, 191, 36, .16); color: var(--ouro); }
.placar-final { display: flex; gap: .3em; align-items: baseline; justify-content: flex-end; }
.placar-final b { font-weight: 800; }
.placar-final i { font-style: normal; font-size: .5em; color: var(--suave); font-weight: 600; }

.vazio { padding: 4em 1em; text-align: center; color: var(--suave); border: 1px dashed var(--linha); border-radius: .8em; }

.rodape { display: flex; justify-content: space-between; gap: 1em; padding: .8em 2em; color: var(--suave); font-size: .8em; border-top: 1px solid var(--linha); }

/* detalhes */
dialog { border: 1px solid var(--linha); border-radius: 1em; padding: 0; background: var(--painel); color: var(--texto); width: min(720px, calc(100vw - 24px)); max-height: 85vh; font-size: 15px; }
dialog::backdrop { background: rgba(2, 6, 15, .75); backdrop-filter: blur(3px); }
.d-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 1.2em 1.4em; border-bottom: 1px solid var(--linha); position: sticky; top: 0; background: var(--painel); }
.d-head small { color: var(--acento); text-transform: uppercase; letter-spacing: .12em; font-weight: 700; font-size: .75em; }
.d-head h3 { margin: .2em 0 0; font-size: 1.4em; }
.d-head button { background: none; border: 0; color: var(--suave); font-size: 1.3em; cursor: pointer; }
dialog table { width: 100%; border-collapse: collapse; }
dialog th, dialog td { padding: .7em 1.4em; text-align: left; border-bottom: 1px solid var(--linha); }
dialog th { color: var(--suave); font-size: .78em; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
dialog td:nth-child(3), dialog th:nth-child(3), dialog td:nth-child(4), dialog th:nth-child(4) { text-align: center; }
.flash { color: var(--ouro); font-weight: 700; }
.vantagem { color: var(--acento); font-size: .9em; white-space: nowrap; }
dialog th[data-ord] { cursor: pointer; user-select: none; white-space: nowrap; }
dialog th[data-ord]::after { content: ' ↕'; opacity: .35; }
dialog th[aria-sort="ascending"]::after { content: ' ▲'; opacity: 1; }
dialog th[aria-sort="descending"]::after { content: ' ▼'; opacity: 1; }
dialog th[aria-sort$="ending"] { color: var(--texto); }
dialog tr.conta td { background: color-mix(in srgb, var(--acento) 12%, transparent); }
dialog tr.conta td:first-child { box-shadow: inset 3px 0 var(--acento); }
dialog tr:not(.conta) td { color: var(--suave); }
.d-resumo { margin: 0; padding: .7em 1.4em; color: var(--suave); font-size: .85em; border-bottom: 1px solid var(--linha); }

@media (max-width: 700px) {
  :root { --fs: 14px; }
  .topo, .abas { padding-left: 16px; padding-right: 16px; }
  .placar { padding: 0 16px 24px; }
  .rodape { padding: 10px 16px; flex-direction: column; }
  .ao-vivo, .cabecalho .legenda { display: none; }
  .marca strong { font-size: 1.3em; }
  .cabecalho h1 { font-size: 2em; }
  .item { grid-template-columns: 2.8em 1.8em 1fr auto; gap: .8em; padding-right: 1em; }
  .pos { font-size: 1.3em; }
  .pontos { font-size: 1.8em; }
}
