/* Rei da Prancheta: celular primeiro, escuro, com o verde do gramado. */
:root {
  --fundo: #0f1a14;
  --painel: #16241c;
  --painel2: #1d3025;
  --linha: #2a4235;
  --texto: #e7f5ec;
  --fraco: #93ad9d;
  --verde: #22c55e;
  --amarelo: #facc15;
  --vermelho: #ef4444;
  --azul: #60a5fa;
  --raio: 12px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fundo); color: var(--texto); font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
button, input, select { font: inherit; color: inherit; }
a { color: var(--azul); }
.carregando { padding: 40px; text-align: center; color: var(--fraco); }

/* estrutura */
.tela { max-width: 720px; margin: 0 auto; padding: 12px 12px 24px; }
.topo { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: rgba(15, 26, 20, 0.95); border-bottom: 1px solid var(--linha); backdrop-filter: blur(6px); }
.topo h1 { font-size: 17px; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topo .data { color: var(--fraco); font-size: 13px; }
.abas { position: fixed; bottom: 0; left: 0; right: 0; z-index: 6; display: flex; background: var(--painel); border-top: 1px solid var(--linha); padding-bottom: env(safe-area-inset-bottom); }
.abas a { flex: 1; min-width: 0; text-align: center; padding: 8px 0 7px; color: var(--fraco); text-decoration: none; font-size: 10px; }
.abas a span { display: block; font-size: 18px; line-height: 1.15; }
.abas a.ativa { color: var(--verde); }

/* blocos */
.card { background: var(--painel); border: 1px solid var(--linha); border-radius: var(--raio); padding: 12px; margin: 10px 0; }
.card h2 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fraco); margin: 0 0 8px; }
.linha { display: flex; align-items: center; gap: 8px; }
.entre { justify-content: space-between; }
.coluna { display: flex; flex-direction: column; gap: 8px; }
.fraco { color: var(--fraco); }
.pequeno { font-size: 12px; }
.grande { font-size: 22px; font-weight: 700; }
.centro { text-align: center; }
.cresce { flex: 1; min-width: 0; }
.quebra { flex-wrap: wrap; }
.oculto { display: none !important; }

/* botões e campos */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--linha); background: var(--painel2); border-radius: 10px; padding: 10px 14px; cursor: pointer; min-height: 44px; }
.btn:active { transform: translateY(1px); }
.btn.principal { background: var(--verde); border-color: var(--verde); color: #052e16; font-weight: 700; }
.btn.perigo { border-color: var(--vermelho); color: #fecaca; }
.btn.chip { min-height: 34px; padding: 6px 10px; font-size: 13px; border-radius: 999px; }
.btn.chip.sim { background: var(--verde); color: #052e16; border-color: var(--verde); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.largo { width: 100%; }
.campo { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.campo input, .campo select, select.sel { background: var(--fundo); border: 1px solid var(--linha); border-radius: 10px; padding: 10px; min-height: 44px; }
.erro { color: #fecaca; background: #451a1a; border-radius: 8px; padding: 8px 10px; }
.aviso { color: #fde68a; background: #3b2f0b; border-radius: 8px; padding: 8px 10px; }

/* listas e tabelas */
.lista { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--linha); }
.item:last-child { border-bottom: 0; }
.item.toque { cursor: pointer; }
.item.toque:active { background: var(--painel2); }
table.tab { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tab th { color: var(--fraco); font-weight: 600; text-align: right; padding: 4px 3px; }
table.tab td { text-align: right; padding: 5px 3px; border-top: 1px solid var(--linha); }
table.tab td:nth-child(2), table.tab th:nth-child(2) { text-align: left; }
table.tab tr.meu td { background: rgba(34, 197, 94, 0.12); font-weight: 700; }
table.tab tr.zona-sobe td:first-child { box-shadow: inset 3px 0 var(--verde); }
table.tab tr.zona-cai td:first-child { box-shadow: inset 3px 0 var(--vermelho); }
.pos { display: inline-block; min-width: 34px; padding: 2px 4px; border-radius: 6px; font-size: 11px; font-weight: 700; text-align: center; background: var(--painel2); }
.pos.GOL { color: #fde047; } .pos.ZAG, .pos.LAT { color: #93c5fd; } .pos.VOL, .pos.MEI { color: #86efac; } .pos.PNT, .pos.ATA { color: #fca5a5; }
.ovr { font-weight: 800; min-width: 28px; text-align: right; }
.barra { height: 5px; background: var(--fundo); border-radius: 3px; overflow: hidden; width: 54px; }
.barra i { display: block; height: 100%; background: var(--verde); }
.barra i.media { background: var(--amarelo); } .barra i.baixa { background: var(--vermelho); }
.tag { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: var(--painel2); color: var(--fraco); }
.tag.mal { background: #451a1a; color: #fecaca; }
.tag.alerta { background: #3b2f0b; color: #fde68a; }

/* escudo */
.escudo { width: 34px; height: 38px; flex: none; }
.escudo.g { width: 56px; height: 62px; }

/* campo da tática */
.gramado { position: relative; width: 100%; aspect-ratio: 68 / 100; max-height: 62vh; margin: 0 auto; border-radius: 10px; overflow: hidden;
  background: repeating-linear-gradient(0deg, #166534 0 10%, #15803d 10% 20%); border: 2px solid #bbf7d0; touch-action: none; }
.gramado::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px solid rgba(255, 255, 255, 0.5); }
.gramado::after { content: ""; position: absolute; left: 50%; top: 50%; width: 22%; aspect-ratio: 1; transform: translate(-50%, -50%); border: 2px solid rgba(255, 255, 255, 0.5); border-radius: 50%; }
.area { position: absolute; left: 25%; width: 50%; height: 14%; border: 2px solid rgba(255, 255, 255, 0.5); }
.area.cima { top: -2px; border-top: 0; } .area.baixo { bottom: -2px; border-bottom: 0; }
.peca { position: absolute; transform: translate(-50%, -50%); width: 64px; text-align: center; z-index: 2; cursor: grab; user-select: none; }
.peca .bola { width: 30px; height: 30px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: #f8fafc; color: #0f172a; border: 2px solid #0f172a; }
.peca.sel .bola { background: var(--amarelo); }
.peca.mal .bola { background: #fca5a5; }
.peca .nome { font-size: 11px; line-height: 1.1; margin-top: 2px; text-shadow: 0 1px 2px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* partida */
.placar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; text-align: center; }
.placar .gols { font-size: 34px; font-weight: 800; letter-spacing: 2px; }
.placar .relogio { font-size: 13px; color: var(--amarelo); font-weight: 700; }
.narracao { display: flex; flex-direction: column; gap: 2px; max-height: 52vh; overflow-y: auto; }
.lance { display: flex; gap: 8px; padding: 6px 2px; border-bottom: 1px solid var(--linha); }
.lance .m { color: var(--fraco); min-width: 40px; font-variant-numeric: tabular-nums; font-size: 13px; }
.lance.gol { background: rgba(34, 197, 94, 0.15); font-weight: 700; }
.lance.cartao-a .t::before { content: "🟨 "; } .lance.cartao-v .t::before { content: "🟥 "; }
.lance.mudanca { color: var(--azul); }
.faixa { display: flex; gap: 10px; overflow-x: auto; font-size: 12px; padding: 4px 0; white-space: nowrap; color: var(--fraco); }
.faixa b { color: var(--texto); }
.stat { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 6px; font-size: 13px; margin: 4px 0; }
.stat .meio { text-align: center; color: var(--fraco); }
.stat .duas { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--fundo); }
.stat .duas i:first-child { background: var(--verde); } .stat .duas i:last-child { background: var(--azul); }
.mapa { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; aspect-ratio: 3 / 2; }
.mapa div { border-radius: 4px; display: grid; place-items: center; font-size: 11px; }
.sugestao { border-left: 3px solid var(--amarelo); padding: 6px 8px; margin: 6px 0; background: var(--painel2); border-radius: 0 8px 8px 0; font-size: 13px; }
.folha { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; max-height: 82vh; overflow-y: auto; background: var(--painel); border-top: 1px solid var(--linha); border-radius: 16px 16px 0 0; padding: 14px 14px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5); }
.veu { position: fixed; inset: 0; z-index: 19; background: rgba(0, 0, 0, 0.5); }
.segmentos { display: flex; gap: 4px; background: var(--fundo); border-radius: 10px; padding: 3px; }
.segmentos button { flex: 1; border: 0; background: transparent; padding: 8px 4px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--fraco); }
.segmentos button.sim { background: var(--painel2); color: var(--texto); font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); background: #052e16; border: 1px solid var(--verde); padding: 10px 16px; border-radius: 10px; z-index: 30; max-width: 90vw; }
@media (min-width: 760px) { .duas-colunas { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } }
