/* Fut Palpites web — design system do app (Pitch Precision). */
:root {
  --bg: #0f1412;
  --surface-lowest: #0a0f0d;
  --surface-low: #181d1a;
  --card: #1c211e;
  --surface-high: #262b29;
  --surface-highest: #313633;
  --line: #2c3a2f;
  --line-soft: #232d25;
  --text: #e6ebe7;
  --text-soft: #b6c5b6;
  --text-mute: #7e8e7e;
  --neon: #00e676;
  --neon-lt: #75ff9e;
  --emerald: #4edea3;
  --minus: #ff5c5c;
  --yellow: #ffd23f;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; border: 0; color: inherit; }
a { color: var(--neon-lt); }
img { max-width: 100%; }

/* scrollbars discretas, no tom do tema */
* { scrollbar-width: thin; scrollbar-color: var(--surface-highest) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--surface-highest); border-radius: 99px;
  border: 2px solid var(--surface-low);
}
*::-webkit-scrollbar-thumb:hover { background: var(--line); }

.wrap { max-width: 940px; margin: 0 auto; padding: 0 16px; }

/* ── topo ─────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(15,20,18,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar .wrap { display: flex; align-items: center; gap: 12px; min-height: 62px; }
.logo { width: 38px; height: 38px; border-radius: 11px; background: var(--surface-low);
  padding: 3px; flex: none; }
.title b { display: block; font-size: 1.04rem; letter-spacing: -.01em; }
.title span { display: block; font-size: .62rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--neon); font-weight: 700; }
.spacer { flex: 1; }

.btn {
  background: var(--neon); color: #00301a; font-weight: 800;
  padding: 10px 17px; border-radius: 12px; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  white-space: nowrap; transition: filter .15s, transform .15s;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: scale(.985); }
.btn.ghost { background: var(--surface-high); color: var(--text); font-weight: 600; }
.btn.block { width: 100%; padding: 14px; }
.btn:disabled { opacity: .5; cursor: default; filter: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); }

/* ── hero ─────────────────────────────────────────────── */
.hero { padding: clamp(28px, 6vw, 48px) 0 22px; }
.hero h1 { font-size: clamp(1.55rem, 4.6vw, 2.35rem); margin: 0 0 10px;
  letter-spacing: -.028em; line-height: 1.15; }
.hero p { color: var(--text-soft); margin: 0; max-width: 60ch; }

/* ── abas ─────────────────────────────────────────────── */
.tabs { display: flex; gap: 5px; background: var(--surface-low);
  padding: 5px; border-radius: var(--r-md); margin: 18px 0 12px; }
.tabs button { flex: 1; background: transparent; color: var(--text-mute);
  padding: 11px 8px; border-radius: var(--r-sm); font-weight: 700;
  font-size: clamp(.82rem, 2.4vw, .93rem); transition: .15s; }
.tabs button.on { background: var(--surface-high); color: var(--neon); }
.daylabel { color: var(--text-mute); font-size: .8rem; margin: 0 0 14px; }

/* ── cards de estatística ─────────────────────────────── */
.stathead { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.stathead .h { font-size: .68rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-mute); }
.stathead .tag { margin-left: auto; display: inline-flex; align-items: center;
  gap: 5px; font-size: .62rem; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; padding: 5px 10px; border-radius: 99px;
  background: var(--surface-high); color: var(--text-mute); }

.statgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px; margin-bottom: 8px; }
.statcard { position: relative; background: var(--card); border-radius: var(--r-md);
  padding: 13px 6px 11px; text-align: center; border: 1px solid transparent;
  transition: border-color .15s, transform .15s, background .15s; }
.statcard:hover { border-color: var(--line); transform: translateY(-2px); }
.statcard .ic { width: 36px; height: 36px; margin: 0 auto 7px;
  background: var(--surface-high); border-radius: 11px;
  display: grid; place-items: center; }
.statcard .sign { font-size: 1rem; font-weight: 800; line-height: 1; }
.statcard .val { font-size: 1.12rem; font-weight: 800; line-height: 1.2;
  font-variant-numeric: tabular-nums; }
.statcard .lbl { font-size: clamp(.58rem, 1.9vw, .67rem); font-weight: 600;
  color: var(--text); margin-top: 3px; }
.statcard.over .sign, .statcard.over .val { color: var(--neon); }
.statcard.under .sign, .statcard.under .val { color: var(--minus); }
.statcard.locked .ic, .statcard.locked .sign, .statcard.locked .val { opacity: .36; }
.statcard.locked .lbl { color: var(--text-mute); }
.statcard .lock { position: absolute; top: 7px; right: 7px; width: 20px; height: 20px;
  border-radius: 7px; background: var(--surface-highest); color: var(--text-mute);
  display: grid; place-items: center; transition: .15s; }
.statcard.locked:hover { border-color: var(--neon); }
.statcard.locked:hover .lock { background: var(--neon); color: #00301a; }

/* ── card de jogo ─────────────────────────────────────── */
.game { background: var(--surface-low); border-radius: var(--r-lg);
  margin-bottom: 14px; overflow: hidden; border: 1px solid var(--line-soft); }
.game .top { height: 3px;
  background: linear-gradient(90deg, var(--neon-lt), var(--emerald)); }
.game .body { padding: clamp(14px, 3vw, 18px); }
.game .row1 { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.league { font-size: .7rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-soft); }
.pill { margin-left: auto; font-size: .63rem; font-weight: 700; letter-spacing: .06em;
  padding: 5px 11px; border-radius: 99px; background: rgba(0,230,118,.12);
  color: var(--neon); text-transform: uppercase; white-space: nowrap; }
.pill.locked { background: var(--surface-high); color: var(--text-mute); }

.teams { display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: start; gap: clamp(6px, 2vw, 14px); }
.team { text-align: center; min-width: 0; }
.team img { width: clamp(42px, 11vw, 56px); height: clamp(42px, 11vw, 56px);
  object-fit: contain; border-radius: 12px; background: var(--surface-highest);
  padding: 5px; }
.team .nm { font-weight: 700; margin-top: 8px; font-size: clamp(.82rem, 2.6vw, .95rem);
  line-height: 1.25; overflow-wrap: anywhere; }
.team .side { font-size: .6rem; letter-spacing: .1em; color: var(--text-mute);
  text-transform: uppercase; margin-top: 2px; }
.kick { text-align: center; padding-top: 6px; }
.kick .h { font-size: clamp(1.15rem, 3.6vw, 1.45rem); font-weight: 800;
  color: var(--neon); line-height: 1; font-variant-numeric: tabular-nums; }
.kick .d { font-size: .58rem; letter-spacing: .1em; color: var(--text-mute);
  text-transform: uppercase; margin-top: 5px; }

/* ── blocos de conteúdo ───────────────────────────────── */
.sheet { background: var(--card); border-radius: var(--r-md); padding: 16px;
  margin-bottom: 12px; border: 1px solid var(--line-soft); }
.sheet h3 { margin: 0 0 3px; font-size: .97rem; }
.sheet .sub { color: var(--text-mute); font-size: .79rem; margin: 0 0 13px; }

/* ⚠️ auto-fit, não repeat(4): o container é o modal, não a janela.
   Com media query o último card era cortado em telas largas. */
.proj { display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); }
.proj div { background: var(--surface-low); border: 1px solid var(--line-soft);
  border-radius: var(--r-sm); padding: 12px 6px; text-align: center; }
.proj .v { font-size: clamp(1.15rem, 4vw, 1.4rem); font-weight: 800;
  color: var(--neon); line-height: 1.1; font-variant-numeric: tabular-nums; }
.proj .k { font-size: .58rem; color: var(--text-mute); text-transform: uppercase;
  letter-spacing: .07em; margin-top: 4px; }

/* tabela rola sozinha em tela estreita, sem estourar o modal */
.tscroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table { width: 100%; border-collapse: collapse; font-size: .82rem;
  min-width: 300px; }
th, td { padding: 9px 6px; text-align: center; border-bottom: 1px solid var(--line-soft); }
th { color: var(--text-mute); font-weight: 600; font-size: .64rem;
  text-transform: uppercase; letter-spacing: .07em; white-space: nowrap; }
td:first-child, th:first-child { text-align: left; padding-left: 2px;
  color: var(--text-soft); }
tbody tr:last-child td { border-bottom: 0; }
.num { font-variant-numeric: tabular-nums; font-weight: 700; }
tr.avg td { border-top: 1px solid var(--line); border-bottom: 0;
  padding-top: 11px; color: var(--text); }
tr.avg .num { color: var(--neon); }

/* ── estados ──────────────────────────────────────────── */
.empty { text-align: center; padding: 48px 20px; color: var(--text-mute); }
.empty .circle { width: 62px; height: 62px; border-radius: 50%; background: var(--card);
  display: grid; place-items: center; margin: 0 auto 14px; }
.empty b { display: block; color: var(--text); margin-bottom: 4px; }
.empty p { margin: 0 auto; max-width: 42ch; font-size: .88rem; }
.spinner { width: 32px; height: 32px; margin: 46px auto; border-radius: 50%;
  border: 3px solid var(--surface-high); border-top-color: var(--neon);
  animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── modal ────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; background: rgba(4,7,6,.78);
  backdrop-filter: blur(3px); z-index: 50; display: flex;
  align-items: center; justify-content: center; padding: 20px;
  animation: fade .16s ease-out; }
.modal[hidden] { display: none; }
@keyframes fade { from { opacity: 0 } }

.modal .box { position: relative; background: var(--surface-low);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  width: min(680px, 100%); max-height: min(86vh, 900px);
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 24px 70px rgba(0,0,0,.6); animation: pop .18s ease-out; }
@keyframes pop { from { transform: translateY(10px) scale(.985); opacity: 0 } }

.mhead { position: sticky; top: 0; z-index: 2; padding: 20px 56px 14px 22px;
  background: linear-gradient(180deg, var(--surface-low) 72%, transparent);
  border-bottom: 1px solid var(--line-soft); }
.mhead h2 { margin: 0; font-size: clamp(1.02rem, 3.2vw, 1.22rem);
  letter-spacing: -.015em; line-height: 1.3; }
.mhead p { margin: 4px 0 0; color: var(--text-mute); font-size: .83rem; }
.mbody { padding: 16px 22px 22px; overflow-y: auto; overscroll-behavior: contain; }
.close { position: absolute; top: 14px; right: 14px; z-index: 3;
  width: 34px; height: 34px; border-radius: 50%; background: var(--surface-high);
  color: var(--text-soft); font-size: 1.15rem; line-height: 1;
  display: grid; place-items: center; }
.close:hover { background: var(--surface-highest); color: var(--text); }

.plan { background: var(--card); border: 1px solid var(--line-soft);
  border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 9px;
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  transition: .15s; }
.plan:hover { border-color: var(--line); }
.plan.sel { border-color: var(--neon); background: rgba(0,230,118,.07); }
.plan b { display: block; }
.plan small { color: var(--text-mute); }
.plan .price { margin-left: auto; font-weight: 800; color: var(--neon);
  white-space: nowrap; }

.gbtn { display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; background: #fff; color: #1f1f1f; font-weight: 700;
  padding: 13px; border-radius: 12px; }
.gbtn:hover { filter: brightness(.96); }

.qr { text-align: center; }
.qr img { width: min(230px, 62vw); background: #fff; padding: 10px;
  border-radius: var(--r-md); }
.copy { display: flex; gap: 8px; margin-top: 12px; }
.copy input { flex: 1; min-width: 0; background: var(--surface-lowest);
  border: 1px solid var(--line); color: var(--text-soft);
  border-radius: var(--r-sm); padding: 11px; font-size: .76rem; }

.fine { font-size: .75rem; color: var(--text-mute); text-align: center;
  margin: 14px 0 0; }

footer { border-top: 1px solid var(--line-soft); margin-top: 48px;
  padding: 24px 0 40px; color: var(--text-mute); font-size: .83rem; }
footer a { color: var(--text-soft); margin-right: 16px;
  display: inline-block; margin-bottom: 6px; }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--surface-highest); color: var(--text); padding: 13px 22px;
  border-radius: var(--r-md); z-index: 80; max-width: calc(100% - 32px);
  box-shadow: 0 10px 34px rgba(0,0,0,.55); }
.toast[hidden] { display: none; }

/* ── telas estreitas: modal vira folha de baixo ───────── */
@media (max-width: 620px) {
  .modal { padding: 0; align-items: flex-end; }
  .modal .box { max-height: 92vh; border-radius: var(--r-lg) var(--r-lg) 0 0;
    border-bottom: 0; animation: up .2s ease-out; }
  @keyframes up { from { transform: translateY(24px); opacity: 0 } }
  .mhead { padding: 18px 52px 12px 18px; }
  .mbody { padding: 14px 18px 26px; }
  .statgrid { gap: 6px; }
  .statcard { padding: 11px 3px 9px; }
}
