:root {
  --bg: #0b0d12;
  --bg-glow: rgba(226, 176, 74, .07);
  --surface: #13161d;
  --surface-2: #1b1f28;
  --surface-3: #232835;
  --border: #262b37;
  --border-strong: #353b4a;
  --text: #eef0f4;
  --muted: #8d94a3;
  --accent: #e8b54d;
  --accent-2: #f5cf7a;
  --accent-text: #1a1406;
  --good: #4cc38a;
  --bad: #ef6b63;
  --team1: #e8b54d;
  --team2: #5fa8f0;
  --radius: 14px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 8px 24px rgba(0, 0, 0, .25);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f5f8; --bg-glow: rgba(184, 134, 42, .08); --surface: #ffffff; --surface-2: #f3f4f7;
    --surface-3: #e9ebf0; --border: #e1e4ea; --border-strong: #cfd4dd; --text: #12151b; --muted: #5d6573;
    --accent: #b8862a; --accent-2: #9a6f1f; --accent-text: #ffffff; --team1: #b8862a; --team2: #2f74c0;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .06);
    color-scheme: light;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column; color: var(--text); line-height: 1.5;
  background: radial-gradient(900px 400px at 50% -120px, var(--bg-glow), transparent 70%), var(--bg);
}
a { color: var(--accent); text-underline-offset: 2px; }
strong { font-weight: 700; }

/* ---------- topo ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 20px; height: 54px; border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; color: var(--text); text-decoration: none; letter-spacing: .3px; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: .9rem;
  background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: var(--accent-text);
}
.brand-name span { color: var(--accent); }
nav { display: flex; gap: 4px; }
nav a { color: var(--muted); text-decoration: none; padding: 7px 12px; border-radius: 9px; font-weight: 500; font-size: .95rem; }
nav a:hover { color: var(--text); background: var(--surface-2); }
nav a.active { color: var(--text); background: var(--surface-3); }

main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 18px 20px 32px; flex: 1; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
h1 { font-size: 1.5rem; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 12px; }
.lead { color: var(--muted); margin: 6px 0 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: .85rem; color: var(--muted);
}
.chip strong { color: var(--text); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

/* ---------- formulários ---------- */
label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
input, select {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: inherit; font-size: .95rem;
  transition: border-color .15s, background .15s;
}
input:hover, select:hover { border-color: var(--border-strong); }
input:focus, select:focus { outline: none; border-color: var(--accent); background: var(--surface); }
button:focus-visible, a:focus-visible, .seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.field { margin-bottom: 12px; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600; font-size: .95rem;
  cursor: pointer; text-decoration: none; transition: transform .05s, background .15s, border-color .15s;
}
button:hover, .button:hover { background: var(--surface-3); }
button:active { transform: translateY(1px); }
button.primary, .button.primary {
  background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: var(--accent-text); border-color: transparent;
}
button.primary:hover, .button.primary:hover { filter: brightness(1.05); }
button.block, .button.block { width: 100%; }
button.big { height: 50px; font-size: 1.05rem; }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.stack { display: grid; gap: 8px; }

.notice { padding: 10px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--accent); font-size: .9rem; }
.notice.error { border-left-color: var(--bad); }
.notice.ok { border-left-color: var(--good); }
.notice + .notice, .notice + *, * + .notice { margin-top: 10px; }

/* ---------- previsão ---------- */
.predict { max-width: 760px; margin: 0 auto; }
.predict .page-head { margin-bottom: 12px; }
.match { padding: 14px; display: grid; gap: 6px; }
.match-row { display: grid; grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr); gap: 8px; align-items: center; }
.match-row > *, .match-row input { min-width: 0; }
.match-row input { height: 34px; font-size: .9rem; border-radius: 8px; padding: 0 10px; }
.match-row.head { margin-bottom: 4px; }
.match-row.head input.team-name { height: 42px; font-size: 1rem; font-weight: 700; border-width: 1px 1px 1px 3px; }
.side.t1 input { border-left-color: var(--team1); }
.side.t2 input { border-left-color: var(--team2); }
.vs { text-align: center; font-weight: 800; font-size: .75rem; color: var(--muted); letter-spacing: .05em; }
.slot { text-align: center; font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.match-foot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--border); }
.match-foot button { height: 40px; }
.seg { display: flex; gap: 3px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.seg label { flex: 1; margin: 0; cursor: pointer; position: relative; }
.seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg span { display: grid; place-items: center; height: 32px; border-radius: 7px; font-weight: 600; font-size: .85rem; color: var(--muted); }
.seg input:checked + span { background: var(--surface-3); color: var(--text); }
.status:not(:empty) { margin-top: 10px; }
.with-date { position: relative; min-width: 0; }
.with-date input { padding-right: 84px; }
.with-date .when {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none;
  font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums;
}
/* Sem a setinha do datalist: o espaço é da data. */
.with-date input::-webkit-calendar-picker-indicator { display: none !important; }

.result {
  margin-top: 10px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.result.empty { text-align: center; color: var(--muted); font-size: .85rem; border-style: dashed; box-shadow: none; padding: 18px; }
.result-names { display: flex; justify-content: space-between; gap: 12px; font-weight: 700; font-size: .9rem; }
.result-names span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-names .t1 { color: var(--team1); }
.result-names .t2 { color: var(--team2); text-align: right; }
.prob-big { display: flex; justify-content: space-between; font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.15; }
.prob-big .t1 { color: var(--team1); }
.prob-big .t2 { color: var(--team2); }
.bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--surface-2); margin: 8px 0 10px; gap: 2px; }
.bar .t1 { background: var(--team1); }
.bar .t2 { background: var(--team2); }
.facts { display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between; gap: 2px 16px; margin: 0; font-size: .8rem; }
.facts div { display: grid; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.result .notice { margin-top: 10px; font-size: .8rem; }
/* ---------- login, planos, conta ---------- */
.narrow { max-width: 440px; }
.code-input { font-size: 1.4rem; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; height: 52px; }
.plan { display: flex; flex-direction: column; position: relative; }
.plan .price { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
.plan .price small { font-size: .9rem; color: var(--muted); font-weight: 400; }
.plan .quota { color: var(--muted); margin: 2px 0 18px; }
.plan .stack { margin-top: auto; }
.plan.featured { border-color: var(--accent); }
.plan.current { outline: 2px solid var(--accent); }
.badge { display: inline-block; font-size: .7rem; padding: 3px 9px; border-radius: 999px; background: var(--accent); color: var(--accent-text); font-weight: 700; vertical-align: middle; }
.qr { display: block; width: 220px; max-width: 100%; margin: 12px auto; background: #fff; padding: 8px; border-radius: 10px; }
.code { word-break: break-all; font-family: ui-monospace, Consolas, monospace; font-size: .8rem; background: var(--surface-2); padding: 10px; border-radius: 8px; text-align: left; }
.meter { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.meter > div { height: 100%; background: var(--accent); }
dl.info { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
dl.info dt { color: var(--muted); }
dl.info dd { margin: 0; }
.hero { text-align: center; padding: 48px 20px; }
.hero h1 { font-size: 2.2rem; }
.hero .lead { font-size: 1.05rem; max-width: 520px; margin: 10px auto 24px; }

.footer { width: 100%; max-width: 1180px; margin: 0 auto; padding: 16px 20px; color: var(--muted); font-size: .8rem; border-top: 1px solid var(--border); }

@media (max-width: 600px) {
  main { padding: 16px 16px 32px; }
  .topbar { padding: 0 16px; }
  .match-row { grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr); gap: 6px; }
  .match-row input { font-size: .85rem; padding: 0 8px; }
  .facts { grid-template-columns: repeat(2, auto); }
  .with-date input { padding-right: 62px; }
  .with-date .when { right: 6px; font-size: .64rem; }
  .card { padding: 16px; }
  .prob-big { font-size: 1.7rem; }
  nav a { padding: 6px 9px; }
  .brand-name { display: none; }
}

/* ---------- páginas legais ---------- */
.legal { max-width: 760px; margin: 0 auto; }
.legal h1 { font-size: 1.7rem; margin-bottom: 4px; }
.legal h2 { font-size: 1.1rem; margin: 28px 0 8px; }
.legal p, .legal li { color: var(--text); font-size: .95rem; line-height: 1.65; }
.legal ul { padding-left: 20px; }
.legal li + li { margin-top: 4px; }
.legal .updated { color: var(--muted); font-size: .85rem; margin: 0 0 20px; }
.legal .box { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 8px; }
.footer nav a { color: var(--muted); padding: 0; background: none; font-size: .8rem; }
.footer nav a:hover { color: var(--text); background: none; }
.consent { color: var(--muted); font-size: .8rem; margin-top: 10px; }

/* ---------- Pix direto ---------- */
.card.pix h2 { margin-bottom: 8px; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 14px; }
.steps li { line-height: 1.5; }
.steps .code { margin: 8px 0; user-select: all; }
.row-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.row-buttons .button, .row-buttons button { height: 38px; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .85em; }

/* ---------- desempenho ---------- */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi-big .big { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
details.tournament { border-top: 1px solid var(--border); }
details.tournament summary {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 56px; gap: 12px; align-items: center;
  padding: 10px 4px; cursor: pointer; list-style: none;
}
details.tournament summary::-webkit-details-marker { display: none; }
details.tournament summary::before { content: "▸"; color: var(--muted); position: absolute; margin-left: -14px; }
details.tournament[open] summary::before { content: "▾"; }
details.tournament summary { position: relative; padding-left: 18px; }
details.tournament summary:hover { background: var(--surface-2); border-radius: 8px; }
.t-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-count { color: var(--muted); font-size: .85rem; }
.t-acc { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.scroll-x { overflow-x: auto; padding-bottom: 10px; }
table.matches { width: 100%; border-collapse: collapse; font-size: .85rem; min-width: 560px; }
table.matches th, table.matches td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
table.matches th { color: var(--muted); font-weight: 500; font-size: .75rem; }
table.matches tr.ok .mark { color: var(--good); font-weight: 800; }
table.matches tr.miss .mark { color: var(--bad); font-weight: 800; }
table.matches tr.miss td { color: var(--muted); }
.kpi-row > .card { margin-top: 0; }
