:root {
  --verde: #0b6b3a;
  --verde-claro: #0f8a4c;
  --amarelo: #f5c518;
  --bg: #f4f6f5;
  --card: #ffffff;
  --txt: #1c2520;
  --muted: #6b7770;
  --borda: #e2e7e4;
  --erro: #c0392b;
  --ok: #0f8a4c;
  --radius: 14px;
  --sombra: 0 2px 10px rgba(0, 0, 0, 0.06);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--txt);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }

/* ---------- LOGIN ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--verde) 0%, #084f2b 100%);
  padding: 20px;
}
.login-card {
  background: var(--card);
  border-radius: 20px;
  padding: 32px 28px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}
.brand { text-align: center; margin-bottom: 22px; }
.brand .trophy { font-size: 46px; }
.brand h1 { margin: 6px 0 2px; font-size: 22px; color: var(--verde); }
.brand .sub { margin: 0; color: var(--muted); font-size: 14px; font-weight: 600; letter-spacing: 0.3px; }
form label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 14px; }
form input {
  width: 100%;
  margin-top: 5px;
  padding: 12px 14px;
  border: 1.5px solid var(--borda);
  border-radius: 10px;
  font-size: 16px;
  outline: none;
}
form input:focus { border-color: var(--verde-claro); }
.hint { font-size: 12px; color: var(--muted); line-height: 1.5; margin: -4px 0 16px; }
.btn-primary {
  width: 100%;
  background: var(--verde);
  color: #fff;
  border: 0;
  padding: 13px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
}
.btn-primary:hover { background: var(--verde-claro); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }
.erro { color: var(--erro); font-size: 13px; text-align: center; min-height: 18px; margin: 10px 0 0; }

/* ---------- TOPBAR ---------- */
.topbar {
  background: var(--verde);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 18px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: var(--sombra);
}
.topbar-brand { font-weight: 800; font-size: 16px; white-space: nowrap; }
.tabs { display: flex; gap: 4px; flex: 1; }
.tab {
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.75);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
}
.tab.active { background: rgba(255, 255, 255, 0.18); color: #fff; }
.topbar-user { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.btn-ghost {
  background: rgba(255, 255, 255, 0.15);
  border: 0;
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}
main { max-width: 760px; margin: 0 auto; padding: 18px 14px 60px; }

/* ---------- JOGOS ---------- */
.day-head {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 22px 4px 10px;
}
.match {
  background: var(--card);
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: var(--sombra);
}
.match-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.match-grupo { font-weight: 700; }
.tag-locked { color: var(--erro); font-weight: 600; }
.tag-open { color: var(--ok); font-weight: 600; }
.match-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.team { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.team.fora { justify-content: flex-end; text-align: right; }
.flag { font-size: 22px; line-height: 1; }
.score-inputs { display: flex; align-items: center; gap: 6px; }
.score-inputs input {
  width: 44px;
  height: 44px;
  text-align: center;
  font-size: 19px;
  font-weight: 700;
  border: 1.5px solid var(--borda);
  border-radius: 10px;
  outline: none;
}
.score-inputs input:focus { border-color: var(--verde-claro); }
.score-inputs input:disabled { background: #f1f3f2; color: var(--txt); }
.score-x { color: var(--muted); font-weight: 700; }
.match-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; min-height: 24px; }
.resultado { font-size: 13px; font-weight: 700; }
.resultado .placar { color: var(--verde); }
.pts-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  background: #eef4f0;
  color: var(--muted);
}
.pts-badge.win { background: #e3f6ea; color: var(--ok); }
.btn-save {
  background: var(--verde);
  color: #fff;
  border: 0;
  padding: 8px 16px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
}
.btn-save:hover { background: var(--verde-claro); }
.btn-save.saved { background: var(--ok); }
.link-palpites { background: none; border: 0; color: var(--verde); font-size: 13px; font-weight: 600; text-decoration: underline; padding: 0; }
.link-inline { background: none; border: 0; color: var(--verde); font-weight: 700; text-decoration: underline; padding: 0; cursor: pointer; font-size: inherit; }

/* ---------- RANKING ---------- */
.rank-card { background: var(--card); border: 1px solid var(--borda); border-radius: var(--radius); overflow: hidden; box-shadow: var(--sombra); }
.rank-row { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--borda); }
.rank-row:last-child { border-bottom: 0; }
.rank-row.me { background: #f0f8f3; }
.rank-pos { font-weight: 800; font-size: 17px; color: var(--muted); text-align: center; }
.rank-row.top1 .rank-pos { color: var(--amarelo); }
.rank-nome { font-weight: 600; }
.rank-sub { font-size: 12px; color: var(--muted); }
.rank-pts { font-weight: 800; font-size: 18px; color: var(--verde); }
.rank-pts small { font-size: 11px; color: var(--muted); font-weight: 600; }

/* ---------- ADMIN ---------- */
.panel { background: var(--card); border: 1px solid var(--borda); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; box-shadow: var(--sombra); }
.panel h3 { margin: 0 0 12px; font-size: 15px; }
.admin-match { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--borda); font-size: 14px; }
.admin-match:last-child { border-bottom: 0; }
.admin-match input { width: 40px; height: 36px; text-align: center; border: 1.5px solid var(--borda); border-radius: 8px; font-size: 15px; }
.admin-match .lbl { display: flex; align-items: center; gap: 6px; }
.part-acoes { display: flex; gap: 12px; justify-content: flex-end; }
.field-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.field-row label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field-row input { padding: 9px 11px; border: 1.5px solid var(--borda); border-radius: 8px; font-size: 14px; }
.btn-sm { background: var(--verde); color: #fff; border: 0; padding: 9px 14px; border-radius: 8px; font-weight: 700; font-size: 13px; }

/* ---------- TOAST ---------- */
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: #1c2520;
  color: #fff;
  padding: 12px 20px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  z-index: 100;
}
.toast.erro-toast { background: var(--erro); }

@media (max-width: 480px) {
  .topbar-brand { font-size: 14px; }
  .topbar { gap: 8px; padding: 0 10px; }
  .tab { padding: 8px 9px; font-size: 14px; }
  .team { font-size: 13px; }
  .flag { font-size: 19px; }
}
