/* ============================================================
   PALPITE PREMIADO v7 — CSS Layout Estilo Flashscore
   Fundo claro, compacto, responsivo desktop + mobile
   ============================================================ */

/* ── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #f5f5f5;
  --bg2:       #ffffff;
  --bg3:       #f0f0f0;
  --bg4:       #e8e8e8;
  --border:    #e0e0e0;
  --text:      #1a1a1a;
  --text2:     #555555;
  --text3:     #888888;
  --yellow:    #f5a623;
  --green:     #00a651;
  --red:       #e03131;
  --blue:      #1565c0;
  --live:      #e03131;
  --radius:    6px;
  --shadow:    0 1px 3px rgba(0,0,0,.10);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input { font-family: inherit; }

/* ── HEADER ───────────────────────────────────────────────── */
.header {
  background: #1a237e;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0,0,0,.2);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.logo img { height: 36px; }

.header-nav {
  display: flex;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 8px;
}
.header-nav::-webkit-scrollbar { display: none; }
.nav-link {
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 20px;
  color: rgba(255,255,255,.8);
  font-size: 13px;
  font-weight: 600;
  transition: all .15s;
  border: none;
  background: transparent;
}
.nav-link:hover, .nav-link.active {
  background: rgba(255,255,255,.15);
  color: #fff;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.saldo-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.saldo-label { font-size: 10px; color: rgba(255,255,255,.6); }
.saldo-valor { font-size: 15px; font-weight: 900; color: #fff; }

/* ── BOTÕES ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 14px;
  border-radius: var(--radius);
  border: none;
  font-size: 12px;
  font-weight: 700;
  transition: all .15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary { background: var(--yellow); color: #fff; }
.btn-primary:hover { background: #e09210; }
.btn-ghost { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.3); }
.btn-ghost:hover { background: rgba(255,255,255,.25); }
.btn-green { background: var(--green); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 11px; }
.btn-full { width: 100%; }

/* ── LAYOUT PRINCIPAL ─────────────────────────────────────── */
.main-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 12px;
}

@media (max-width: 768px) {
  .main-layout { grid-template-columns: 1fr; padding: 8px; }
  .sidebar { display: none; }
}

/* ── SIDEBAR ──────────────────────────────────────────────── */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-box {
  background: var(--bg2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.sidebar-titulo {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .5px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .1s;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.sidebar-item:hover { background: var(--bg3); }
.sidebar-item.active { background: #e3f2fd; color: var(--blue); font-weight: 700; }
.sidebar-item img { width: 16px; height: 16px; object-fit: contain; }

/* ── FILTROS TOPO ─────────────────────────────────────────── */
.filtros-topo {
  background: var(--bg2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  box-shadow: var(--shadow);
}
.filtros-topo::-webkit-scrollbar { display: none; }
.filtro-btn {
  white-space: nowrap;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.filtro-btn:hover { border-color: var(--blue); color: var(--blue); }
.filtro-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.filtro-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; flex-shrink: 0; }

/* ── MODO TOGGLE ──────────────────────────────────────────── */
.modo-toggle {
  display: flex;
  gap: 4px;
  background: var(--bg2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 4px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
}
.modo-btn {
  flex: 1;
  padding: 7px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text2);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
}
.modo-btn.active { background: var(--blue); color: #fff; }

/* ── SEÇÃO DE LIGA ────────────────────────────────────────── */
.liga-secao {
  background: var(--bg2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 6px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.liga-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.liga-header img { width: 18px; height: 18px; object-fit: contain; }
.liga-nome { font-size: 12px; font-weight: 700; color: var(--text); flex: 1; }
.liga-pais { font-size: 11px; color: var(--text3); }

/* ── LINHA DO JOGO ────────────────────────────────────────── */
.jogo-linha {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
  transition: background .1s;
}
.jogo-linha:last-child { border-bottom: none; }
.jogo-linha:hover { background: var(--bg3); }

.jogo-hora {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  text-align: center;
}
.jogo-hora.ao-vivo { color: var(--live); font-weight: 700; }
.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--live);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
}
.badge-live::before { content: ''; width: 5px; height: 5px; background: #fff; border-radius: 50%; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

.jogo-times {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.jogo-time-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.time-logo-sm {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
}
.time-nome-sm {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.time-nome-sm.vencedor { font-weight: 700; }
.placar-sm {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  min-width: 16px;
  text-align: right;
  margin-left: auto;
}
.placar-sm.vencedor { color: var(--green); }

/* ── ODDS INLINE ──────────────────────────────────────────── */
.odds-inline {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}
.odd-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 44px;
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg3);
  cursor: pointer;
  transition: all .15s;
}
.odd-box:hover { border-color: var(--blue); background: #e3f2fd; }
.odd-box.ativo { background: var(--yellow); border-color: var(--yellow); }
.odd-box.ativo .odd-label-sm, .odd-box.ativo .odd-valor-sm { color: #fff; }
.odd-label-sm { font-size: 10px; color: var(--text3); font-weight: 600; }
.odd-valor-sm { font-size: 13px; font-weight: 700; color: var(--blue); }
.odd-box.ativo .odd-valor-sm { color: #fff; }
.odd-mais {
  font-size: 11px;
  color: var(--blue);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  padding: 4px;
}
.odd-mais:hover { text-decoration: underline; }

/* ── EXPANDIDO — MERCADOS ─────────────────────────────────── */
.jogo-expandido {
  border-top: 1px solid var(--border);
  background: var(--bg3);
  padding: 12px;
  display: none;
}
.jogo-expandido.aberto { display: block; }

.mercados-tabs-novo {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin-bottom: 10px;
  scrollbar-width: none;
}
.mercados-tabs-novo::-webkit-scrollbar { display: none; }
.mercado-tab-novo {
  white-space: nowrap;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text2);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.mercado-tab-novo.active { background: var(--blue); color: #fff; border-color: var(--blue); }

.odds-grid-novo {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.odds-grid-novo-2 { grid-template-columns: repeat(2, 1fr); }
.odds-grid-novo-4 { grid-template-columns: repeat(4, 1fr); }

.ou-grid-novo { display: flex; flex-direction: column; gap: 4px; }
.ou-row-novo {
  display: grid;
  grid-template-columns: 60px 1fr 1fr;
  gap: 4px;
  align-items: center;
}
.ou-linha-novo { font-size: 12px; font-weight: 700; color: var(--text2); text-align: center; }

.placar-grid-novo { display: grid; grid-template-columns: repeat(4,1fr); gap: 4px; }

/* ── STATS AO VIVO ────────────────────────────────────────── */
.stats-ao-vivo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: #fff3e0;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
}
.stats-posse-wrap { display: flex; align-items: center; gap: 4px; flex: 1; }
.stats-posse-bar { flex: 1; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; display: flex; }
.stats-posse-casa { background: var(--blue); height: 100%; }
.stats-posse-fora { background: var(--red); height: 100%; }
.stats-posse-val { font-size: 10px; font-weight: 700; color: var(--text2); min-width: 28px; }

/* ── BILHETE FLUTUANTE ────────────────────────────────────── */
.bilhete-fab {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 200;
}
.bilhete-fab button {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 28px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(21,101,192,.4);
  display: flex;
  align-items: center;
  gap: 8px;
}
.fab-count {
  background: var(--yellow);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── MODAL ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
@media (min-width: 600px) {
  .modal-overlay { align-items: center; }
  .modal-sheet { border-radius: 12px; max-width: 520px; }
}
.modal-sheet {
  background: var(--bg2);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 16px 16px 0 0;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg2);
  z-index: 1;
}
.modal-header h3 { font-size: 15px; font-weight: 700; }
.btn-close { background: none; border: none; font-size: 18px; color: var(--text2); padding: 4px 8px; border-radius: 4px; }
.btn-close:hover { background: var(--bg3); }

/* ── BILHETE MODAL ────────────────────────────────────────── */
.bilhete-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.bilhete-item-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.bilhete-jogo { font-size: 12px; color: var(--text2); margin-bottom: 2px; }
.bilhete-selecao { font-size: 14px; font-weight: 700; }
.bilhete-odd { font-size: 12px; color: var(--blue); font-weight: 700; }
.btn-remove { background: none; border: none; color: var(--text3); font-size: 18px; padding: 2px 6px; }
.bilhete-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text);
  background: var(--bg3);
}
.bilhete-input:focus { outline: none; border-color: var(--blue); }
.bilhete-retorno { font-size: 12px; color: var(--green); font-weight: 700; margin-top: 4px; }
.bilhete-resumo { padding: 12px 16px; background: var(--bg3); border-top: 1px solid var(--border); }
.resumo-linha { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; }

/* ── BOLÃO ────────────────────────────────────────────────── */
.bolao-card {
  background: var(--bg2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 6px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.bolao-premio-box { padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; }
.bolao-premio-val { font-size: 20px; font-weight: 900; color: var(--green); }
.bolao-info { text-align: right; font-size: 11px; color: var(--text2); }

.palpite-times { display: flex; align-items: center; gap: 16px; justify-content: center; padding: 16px; }
.palpite-time { text-align: center; }
.palpite-nome { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.palpite-counter { display: flex; align-items: center; gap: 10px; }
.counter-btn { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--blue); background: none; color: var(--blue); font-size: 18px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.counter-val { font-size: 24px; font-weight: 900; min-width: 32px; text-align: center; }
.palpite-x { font-size: 20px; font-weight: 900; color: var(--text3); }
.palpite-info { padding: 0 16px 8px; }
.palpite-info-linha { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }

/* ── FORMULÁRIOS ──────────────────────────────────────────── */
.form-card { background: var(--bg2); border-radius: 12px; padding: 24px; box-shadow: 0 4px 20px rgba(0,0,0,.08); }
.form-logo { text-align: center; margin-bottom: 20px; }
.form-titulo { font-size: 22px; font-weight: 900; text-align: center; margin-bottom: 4px; }
.form-subtitulo { font-size: 13px; color: var(--text2); text-align: center; margin-bottom: 20px; }
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; font-weight: 700; color: var(--text2); margin-bottom: 5px; }
.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text);
  background: var(--bg3);
  transition: border-color .15s;
}
.form-input:focus { outline: none; border-color: var(--blue); background: #fff; }
.form-hint { font-size: 11px; color: var(--text3); margin-top: 3px; }

/* ── TOAST ────────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); z-index: 500; display: flex; flex-direction: column; gap: 6px; }
.toast { padding: 10px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.15); animation: slideUp .3s ease; }
.toast.sucesso { background: var(--green); }
.toast.erro    { background: var(--red); }
.toast.info    { background: var(--blue); }
@keyframes slideUp { from{transform:translateY(20px);opacity:0} to{transform:translateY(0);opacity:1} }

/* ── HERO (visitantes) ────────────────────────────────────── */
.hero { background: linear-gradient(135deg,#1a237e,#1565c0); padding: 24px 16px; margin-bottom: 0; }
.hero-content { max-width: 600px; margin: 0 auto; text-align: center; color: #fff; }
.hero-content h1 { font-size: 22px; font-weight: 900; margin-bottom: 8px; }
.hero-content p { font-size: 13px; opacity: .85; margin-bottom: 16px; }
.hero-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ── LOADING ──────────────────────────────────────────────── */
.loading-spinner { text-align: center; padding: 40px; color: var(--text2); }
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--blue); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── ENCERRADO ────────────────────────────────────────────── */
.jogo-linha.encerrado { opacity: .7; }
.encerrado-badge { font-size: 10px; background: var(--bg4); color: var(--text3); padding: 2px 6px; border-radius: 3px; font-weight: 600; }

/* ── ADMIN (mantém fundo escuro) ──────────────────────────── */
.admin-body { background: #0d0f14; color: #fff; }

/* ── RESPONSIVO MOBILE ────────────────────────────────────── */
@media (max-width: 480px) {
  .odds-inline { gap: 2px; }
  .odd-box { min-width: 38px; padding: 3px 4px; }
  .odd-valor-sm { font-size: 12px; }
  .jogo-linha { padding: 6px 8px; }
  .time-nome-sm { font-size: 12px; }
  .header-inner { padding: 0 10px; height: 50px; }
}
