:root {
  --bg: #0e1013; --surface: #16191e; --surface-2: #1c2026; --line: #272c34; --line-2: #323844;
  --text: #eceef2; --text-2: #a3a9b5; --text-3: #737a87;
  --blue: #338ced; --aqua: #00a888; --yellow: #d28e05; --red: #eb6263; --orange: #e76624; --violet: #9887ef;
  --good: #0aac23; --warn: #fbb315; --bad: #eb6263;
  --radius: 12px; --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
button { font: inherit; }
.num, td.n, th.n { font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 13px; }
.muted { color: var(--text-2); } .small { font-size: 12px; } .dim { color: var(--text-3); }

.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line); background: #111317; display: flex; flex-direction: column; padding: 18px 12px; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.brand b { display: block; font-size: 14px; letter-spacing: .2px; } .brand small { color: var(--text-3); font-size: 11px; letter-spacing: 1.5px; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M8 21l5-6 4 3 7-9' stroke='white' stroke-width='3' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100%; }
nav { display: grid; gap: 2px; }
nav a { color: var(--text-2); padding: 8px 10px; border-radius: 8px; font-weight: 500; }
nav a:hover { background: var(--surface); color: var(--text); }
nav a.active { background: var(--surface-2); color: var(--text); box-shadow: inset 2px 0 0 var(--blue); }
.side-foot { margin-top: auto; display: grid; gap: 10px; padding: 0 8px; }
.live { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.live.on i { background: var(--good); box-shadow: 0 0 0 4px rgba(10,172,35,.18); }

.view { padding: 26px 32px 60px; max-width: 1400px; width: 100%; }
.loading { color: var(--text-2); padding: 40px 0; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.head h1 { font-size: 22px; margin: 0; letter-spacing: -.2px; }
.head p { margin: 4px 0 0; color: var(--text-2); }
h2 { font-size: 15px; margin: 0 0 12px; } h3 { font-size: 14px; margin: 0 0 8px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .shell { grid-template-columns: 1fr; } .side { position: static; height: auto; } .g2, .g3, .g4 { grid-template-columns: 1fr; } .view { padding: 18px; } }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile small { color: var(--text-2); display: block; font-size: 12px; }
.tile b { font-size: 24px; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.tile .sub { color: var(--text-3); font-size: 12px; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-2); background: transparent; color: var(--text-2); padding: 5px 11px; border-radius: 99px; cursor: pointer; font-size: 13px; }
.chip:hover { color: var(--text); border-color: var(--text-3); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.btn { border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); padding: 7px 13px; border-radius: 8px; cursor: pointer; font-weight: 500; }
.btn:hover { border-color: var(--text-3); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: white; }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
input, select, textarea { background: #0f1216; color: var(--text); border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 9px; font: inherit; }
label.f { display: grid; gap: 4px; font-size: 12px; color: var(--text-2); }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; color: var(--text-3); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--surface-2); }
th.n, td.n { text-align: right; }
.tablewrap { overflow: auto; max-height: 72vh; border-radius: var(--radius); }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line-2); white-space: nowrap; }
.pill.A { background: rgba(10,172,35,.14); color: #6fdc7f; border-color: rgba(10,172,35,.4); }
.pill.B { background: rgba(51,140,237,.14); color: #8cc0f6; border-color: rgba(51,140,237,.4); }
.pill.C { background: rgba(210,142,5,.14); color: #f0c36a; border-color: rgba(210,142,5,.4); }
.pos { color: #6fdc7f; } .neg { color: #f19494; }
.warnings { color: #f0c36a; font-size: 12px; }

/* barra 1x2 */
.pbar { display: flex; height: 8px; gap: 2px; border-radius: 4px; overflow: hidden; min-width: 120px; }
.pbar i { display: block; height: 100%; }
.pbar i:nth-child(1) { background: var(--blue); } .pbar i:nth-child(2) { background: #5b6270; } .pbar i:nth-child(3) { background: var(--orange); }
.plabels { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-2); font-family: var(--mono); margin-top: 3px; }

/* mapa de calor de posições */
.heat { display: grid; gap: 2px; }
.heat span { height: 18px; border-radius: 3px; background: #1d2633; font-size: 10px; display: grid; place-items: center; color: transparent; }
.heat span[data-v] { color: rgba(255,255,255,.85); }
.zone-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }

.match-hero { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; }
.match-hero .t { font-size: 20px; font-weight: 600; } .match-hero .t.r { text-align: right; }
.xg { font-family: var(--mono); color: var(--text-2); text-align: center; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; }
.kv dt { color: var(--text-2); } .kv dd { margin: 0; text-align: right; font-family: var(--mono); }
.form { display: inline-flex; gap: 3px; } .form b { width: 18px; height: 18px; border-radius: 4px; display: grid; place-items: center; font-size: 10px; color: #0e1013; }
.form .W { background: #45c35a; } .form .D { background: #8a919e; } .form .L { background: #eb6263; }
.empty { border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 28px; color: var(--text-2); text-align: center; }
.steps { margin: 0; padding-left: 18px; color: var(--text-2); } .steps li { margin: 6px 0; } .steps b { color: var(--text); }
code { font-family: var(--mono); font-size: 12px; background: var(--surface-2); padding: 1px 6px; border-radius: 5px; }
.tip { position: fixed; pointer-events: none; z-index: 50; background: #0a0c0f; border: 1px solid var(--line-2); color: var(--text); padding: 6px 9px; border-radius: 8px; font-size: 12px; max-width: 320px; opacity: 0; transition: opacity .08s; white-space: pre-line; }
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--surface-2); border: 1px solid var(--line-2); padding: 10px 14px; border-radius: 10px; opacity: 0; transform: translateY(8px); transition: .2s; z-index: 60; }
.toast.show { opacity: 1; transform: none; }
details summary { cursor: pointer; color: var(--text-2); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
svg text { fill: var(--text-2); font-size: 11px; font-family: Inter, system-ui, sans-serif; }
.g3 .card td, .g3 .card th { padding: 7px 5px; }
.g3 .card td:first-child { font-size: 13px; }
