:root {
  --bg: hsl(210 40% 98%); --fg: hsl(222 47% 11%); --card: #fff; --muted: hsl(210 40% 96%);
  --muted-fg: hsl(215 16% 47%); --primary: hsl(217 91% 60%); --primary-fg: #fff; --border: hsl(214 32% 91%);
  --destructive: hsl(0 84% 60%); --ouro: #eab308; --prata: #9ca3af; --bronze: #b45309; --radius: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; }
.pagina { max-width: 720px; margin: 0 auto; padding: 32px 16px 48px; }
.pagina.larga { max-width: 960px; }
.pagina.xl { max-width: 1200px; }
.pagina.xxl { max-width: 1400px; }
.topo { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.topo-esq { display: flex; align-items: center; gap: 14px; }
.topo h1 { font-size: 32px; line-height: 1.15; margin: 0; display: flex; align-items: center; gap: 8px; letter-spacing: -.5px; }
.topo h1 .ico { width: 30px; height: 30px; color: var(--primary); }
.sub { margin: 2px 0 0; color: var(--muted-fg); }
.nav { display: flex; gap: 4px; }
.nav a, .voltar { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: var(--radius); color: var(--fg); }
.nav a:hover, .voltar:hover { background: var(--muted); }
.ico { width: 20px; height: 20px; flex: none; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.card + .card { margin-top: 24px; }
.card h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.3px; }
.card .desc { margin: 0 0 20px; color: var(--muted-fg); font-size: 14px; }
.card-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-cab h2 { margin: 0; }
label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
input[type=text], input[type=number], select { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; font: inherit; color: inherit; }
input:focus, select:focus, .cb-input:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.campo { margin-bottom: 20px; }
.botao { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; border: 0; border-radius: var(--radius); background: var(--primary); color: var(--primary-fg); font: inherit; font-weight: 600; cursor: pointer; }
.botao:hover { filter: brightness(.95); }
.botao:disabled { opacity: .6; cursor: default; }
.botao.cheio { width: 100%; }
.botao.perigo { background: var(--destructive); }
.botao.fantasma { background: transparent; color: var(--fg); width: 36px; height: 36px; padding: 0; }
.botao.fantasma:hover { background: var(--muted); }
.botao.fantasma .ico { width: 16px; height: 16px; }
.linha { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.linha .num { width: 32px; font-weight: 600; font-size: 14px; }
.linha .cb { flex: 1; }
.lista-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; }
.lista-item .min { color: var(--muted-fg); font-size: 13px; margin-left: 6px; }
h3 { font-size: 17px; margin: 28px 0 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--muted-fg); font-weight: 500; }
td.dir, th.dir { text-align: right; }
td.forte { font-weight: 700; }
.trofeu { width: 18px; height: 18px; vertical-align: -3px; margin-left: 4px; }
.ouro { color: var(--ouro); } .prata { color: var(--prata); } .bronze { color: var(--bronze); }
.vazio { text-align: center; color: var(--muted-fg); padding: 24px 0; }
.abas { display: grid; grid-template-columns: 1fr 1fr; background: var(--muted); border-radius: var(--radius); padding: 4px; margin-bottom: 16px; }
.abas button { border: 0; background: transparent; font: inherit; font-weight: 600; font-size: 14px; padding: 8px; border-radius: 6px; cursor: pointer; color: var(--muted-fg); }
.abas button.ativa { background: #fff; color: var(--fg); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.aba { display: none; } .aba.ativa { display: block; }
/* interruptor */
.chave { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; user-select: none; }
.chave input { position: absolute; opacity: 0; width: 0; height: 0; }
.chave .pista { width: 40px; height: 22px; border-radius: 11px; background: var(--border); position: relative; transition: background .15s; }
.chave .pista::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.chave input:checked + .pista { background: var(--primary); }
.chave input:checked + .pista::after { transform: translateX(18px); }
/* combobox com busca */
.cb { position: relative; }
.cb-input { width: 100%; height: 40px; padding: 0 36px 0 12px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.cb-input.vazio { color: var(--muted-fg); }
.cb::after { content: ''; position: absolute; right: 14px; top: 17px; width: 6px; height: 6px; border-right: 1.5px solid var(--muted-fg); border-bottom: 1.5px solid var(--muted-fg); transform: rotate(45deg); pointer-events: none; }
.cb-pop { display: none; position: absolute; z-index: 20; left: 0; right: 0; top: 44px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.cb.aberto .cb-pop { display: block; }
.cb-busca { width: 100%; height: 40px; border: 0; border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; padding: 0 12px; font: inherit; }
.cb-busca:focus { outline: 0; }
.cb-lista { max-height: 260px; overflow: auto; padding: 4px; margin: 0; list-style: none; }
.cb-lista li { padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.cb-lista li:hover, .cb-lista li.foco { background: var(--muted); }
.cb-lista li.sel { font-weight: 600; }
.cb-lista .nada { color: var(--muted-fg); text-align: center; cursor: default; }
/* toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--fg); color: #fff; padding: 10px 16px; border-radius: var(--radius); font-size: 14px; opacity: 0; pointer-events: none; transition: all .2s; max-width: 90vw; }
.toast.erro { background: var(--destructive); }
.toast.mostrar { opacity: 1; transform: translateX(-50%) translateY(0); }
.rodape { margin-top: 40px; text-align: center; color: var(--muted-fg); font-size: 12px; }
pre.erro, pre.logs { white-space: pre-wrap; font-size: 12px; margin: 0; }
/* histórico */
.partida .card-cab p { margin: 2px 0 0; color: var(--muted-fg); font-size: 13px; }
/* dashboard */
.grade { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grade-2 { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .grade-2 { grid-template-columns: 1fr 1fr; } }
.grade .card, .grade-2 .card { margin: 0; }
.bloco { margin-bottom: 24px; }
.mini { padding: 18px 20px; }
.mini .t { display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 500; }
.mini .t .ico { width: 16px; height: 16px; color: var(--muted-fg); }
.mini .v { font-size: 26px; font-weight: 700; margin-top: 4px; }
.mini .n { font-size: 12px; color: var(--muted-fg); }
.graf { width: 100%; height: 300px; }
.graf.alto { height: 400px; }
.graf.enorme { height: 600px; }
.podio { display: flex; align-items: flex-end; justify-content: center; gap: 16px; height: 256px; }
.podio .lugar { display: flex; flex-direction: column; align-items: center; }
.podio .lugar .ico { width: 48px; height: 48px; margin-bottom: 8px; }
.podio .bloco-podio { width: 128px; background: hsl(217 91% 60% / .18); border-radius: var(--radius) var(--radius) 0 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 16px 8px; text-align: center; }
.podio .p1 .bloco-podio { height: 192px; } .podio .p2 .bloco-podio { height: 144px; } .podio .p3 .bloco-podio { height: 112px; }
.podio .nome { font-weight: 700; font-size: 17px; line-height: 1.2; }
.podio .pts { font-size: 24px; font-weight: 700; color: var(--primary); }
.podio .un { font-size: 13px; color: var(--muted-fg); }
.heat { overflow-x: auto; }
.heat table { table-layout: fixed; border-collapse: collapse; font-size: 13px; }
.heat th, .heat td { border: 1px solid var(--border); padding: 6px 4px; text-align: center; width: 64px; }
.heat th.jog, .heat td.jog { width: 150px; text-align: left; position: sticky; left: 0; background: #fff; z-index: 2; font-weight: 500; }
.heat th { background: var(--muted); }
.heat th .rot { display: flex; align-items: center; justify-content: center; height: 110px; }
.heat th .rot span { transform: rotate(-90deg); white-space: nowrap; font-size: 11px; font-weight: 500; }
.tab-jogo { font-size: 14px; }
.tab-jogo .cab, .tab-jogo .lin { display: grid; grid-template-columns: 1fr 90px 100px; gap: 8px; padding: 8px 10px; border-radius: 6px; }
.tab-jogo .cab { background: var(--muted); font-weight: 600; }
.tab-jogo .lin { border: 1px solid var(--border); margin-top: 6px; }
.tab-jogo .c { text-align: center; } .tab-jogo .d { text-align: right; font-weight: 600; }
.rede-tip { position: absolute; top: 20px; right: 20px; min-width: 200px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: 0 8px 24px rgba(0,0,0,.12); font-size: 14px; pointer-events: none; display: none; }
.rede-tip h4 { margin: 0 0 6px; font-size: 17px; }
.rel { position: relative; }
@media (max-width: 600px) { .topo h1 { font-size: 26px; } .pagina { padding-top: 20px; } }
