/* ============================================================
   Bolão da Copa 2026 — CSS moderno mobile-first
   flagcdn.com para bandeiras, Bootstrap 5 + DM Sans
   ============================================================ */

:root {
  --verde:        #1D9E75;
  --verde-dark:   #0F6E56;
  --verde-light:  #E1F5EE;
  --verde-mid:    #5DCAA5;
  --dourado:      #EF9F27;
  --dourado-dark: #BA7517;
  --dourado-light:#FEF3DC;
  --cinza-50:     #f9f9f7;
  --cinza-100:    #f2f2ef;
  --cinza-200:    #e4e4e0;
  --cinza-400:    #aaa89f;
  --cinza-500:    #888780;
  --cinza-700:    #444441;
  --text:         #1a1a18;
  --text-muted:   #6b6a65;
  --card-radius:  16px;
  --card-shadow:  0 2px 16px rgba(0,0,0,.07);
  --transition:   .18s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cinza-100);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

/* ========== TOPBAR ========== */
.topbar {
  background: linear-gradient(135deg, #0a4a38 0%, var(--verde-dark) 100%);
  color: #fff;
  padding: 0 1rem;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  min-width: 0;
}
.topbar-logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  object-fit: contain;
}
.topbar-brand-text {
  line-height: 1.1;
  min-width: 0;
}
.topbar-brand-text .title {
  font-size: .95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-brand-text .sub {
  font-size: .68rem;
  opacity: .75;
  font-weight: 400;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: .25rem;
  flex-shrink: 0;
}
.topbar-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.85);
  text-decoration: none;
  font-size: 1.05rem;
  transition: background var(--transition), color var(--transition);
  border: none;
  background: transparent;
  cursor: pointer;
}
.topbar-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.topbar-btn.admin-btn { background: rgba(239,159,39,.2); color: var(--dourado); }

/* ========== BOTTOM NAV ========== */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid var(--cinza-200);
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 16px rgba(0,0,0,.08);
}
.bottom-nav-items {
  display: flex;
  align-items: stretch;
}
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: .55rem .2rem;
  color: var(--cinza-400);
  text-decoration: none;
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .01em;
  transition: color var(--transition);
  position: relative;
}
.bottom-nav-item i { font-size: 1.2rem; line-height: 1; }
.bottom-nav-item.active { color: var(--verde); }
.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 2.5px;
  background: var(--verde);
  border-radius: 0 0 4px 4px;
}
.bottom-nav-item:hover { color: var(--verde); }

@media (max-width: 767px) {
  .bottom-nav { display: block; }
  body { padding-bottom: 68px; }
  .main-wrap { padding: 1rem .75rem; }
}

/* ========== LAYOUT ========== */
.main-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.25rem 1rem;
}

/* ========== HERO BANNER (dashboard) ========== */
.hero-banner {
  background: linear-gradient(135deg, #0a4a38 0%, var(--verde) 60%, #1ab87d 100%);
  border-radius: var(--card-radius);
  padding: 1.25rem 1.25rem 1rem;
  margin-bottom: 1rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero-banner::before {
  content: '⚽';
  position: absolute;
  right: -10px;
  top: -10px;
  font-size: 6rem;
  opacity: .07;
  line-height: 1;
}
.hero-banner h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: .25rem; }
.hero-banner p  { font-size: .82rem; opacity: .85; }

/* ========== CARDS ========== */
.card-bolao {
  background: #fff;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 1.1rem 1rem;
  margin-bottom: .85rem;
}
.card-bolao-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .85rem;
}
.card-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--verde-dark);
}

/* ========== STAT GRID ========== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .6rem;
  margin-bottom: .85rem;
}
@media (min-width: 480px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
}
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: .85rem .75rem;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
}
.stat-label { font-size: .72rem; color: var(--text-muted); font-weight: 600; margin-bottom: .2rem; text-transform: uppercase; letter-spacing: .03em; }
.stat-val   { font-size: 1.5rem; font-weight: 700; color: var(--verde-dark); line-height: 1.1; }
.stat-sub   { font-size: .7rem; color: var(--text-muted); margin-top: .15rem; }

/* ========== JOGO CARD — mobile-first ========== */
.jogo-card {
  background: #fff;
  border-radius: 14px;
  padding: .8rem .9rem;
  margin-bottom: .55rem;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
  transition: box-shadow var(--transition);
}
.jogo-card:hover { box-shadow: 0 3px 14px rgba(0,0,0,.1); }
.jogo-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .68rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .65rem;
  gap: .5rem;
}
.jogo-card-header .info { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Grade 3 colunas: time-A | placar | time-B */
.jogo-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .4rem;
}
.time-col {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-width: 0;
}
.time-col.esq { justify-content: flex-end; flex-direction: row; }
.time-col.dir { justify-content: flex-start; flex-direction: row; }

/* Bandeira via <img> do flagcdn */
.flag-img {
  width: 28px;
  height: 20px;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  flex-shrink: 0;
}
@media (max-width: 380px) { .flag-img { width: 22px; height: 16px; } }

.time-info { min-width: 0; }
.time-info.esq { text-align: right; }
.time-info.dir { text-align: left; }
.time-nome {
  font-weight: 700;
  font-size: .82rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
}
@media (min-width: 400px) { .time-nome { max-width: 115px; } }
@media (min-width: 520px) { .time-nome { max-width: none; white-space: normal; } }

.time-sigla {
  font-size: .65rem;
  font-weight: 700;
  color: var(--cinza-400);
  letter-spacing: .04em;
  line-height: 1;
}

/* Centro: inputs ou placar */
.jogo-centro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
  flex-shrink: 0;
}
.jogo-placar {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--verde-dark);
  letter-spacing: -.02em;
  line-height: 1;
}
.jogo-placar-sep { color: var(--cinza-200); margin: 0 .15rem; }
.jogo-status-text {
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--cinza-400);
  font-weight: 600;
}
.meu-chute-badge {
  font-size: .62rem;
  background: var(--verde-light);
  color: var(--verde-dark);
  border-radius: 8px;
  padding: .1rem .4rem;
  font-weight: 700;
  margin-top: .1rem;
}

/* Inputs de palpite */
.inputs-palpite {
  display: flex;
  align-items: center;
  gap: .3rem;
}
.palpite-input {
  width: 46px;
  height: 42px;
  border: 2px solid var(--cinza-200);
  border-radius: 10px;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  color: var(--verde-dark);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  -moz-appearance: textfield;
  appearance: textfield;
}
.palpite-input::-webkit-inner-spin-button,
.palpite-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.palpite-input:focus {
  outline: none;
  border-color: var(--verde);
  box-shadow: 0 0 0 3px rgba(29,158,117,.15);
}
.palpite-input:disabled {
  background: var(--cinza-100);
  color: var(--cinza-400);
  border-color: var(--cinza-200);
  cursor: not-allowed;
}
.palpite-sep { font-size: .95rem; color: var(--cinza-400); font-weight: 700; }

/* ========== RANKING ========== */
.rank-table { width: 100%; border-collapse: separate; border-spacing: 0 5px; }
.rank-table thead th {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  padding: .2rem .6rem;
}
.rank-row {
  background: #fff;
  box-shadow: 0 1px 5px rgba(0,0,0,.06);
  border-radius: 12px;
  transition: transform var(--transition);
}
.rank-row:hover { transform: translateY(-1px); box-shadow: 0 3px 12px rgba(0,0,0,.1); }
.rank-row td { padding: .65rem .6rem; vertical-align: middle; }
.rank-row td:first-child { border-radius: 12px 0 0 12px; }
.rank-row td:last-child  { border-radius: 0 12px 12px 0; }
.rank-pos { font-size: 1rem; font-weight: 700; color: var(--cinza-400); width: 32px; text-align: center; }
.rank-pos.ouro   { color: #c8a000; font-size: 1.15rem; }
.rank-pos.prata  { color: #888; }
.rank-pos.bronze { color: #b5651d; }
.rank-pts { font-size: 1.1rem; font-weight: 700; color: var(--verde-dark); text-align: right; white-space: nowrap; }
.rank-pts small  { font-size: .7rem; font-weight: 400; color: var(--text-muted); }
.rank-eu { background: var(--verde-light) !important; }

/* ========== AVATAR ========== */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

/* ========== BADGES ========== */
.badge-pts {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  padding: .2rem .5rem;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge-pts.exato   { background: #d4edda; color: #155724; }
.badge-pts.certo   { background: #d1ecf1; color: #0c5460; }
.badge-pts.parcial { background: #fff3cd; color: #856404; }
.badge-pts.zero    { background: var(--cinza-100); color: var(--cinza-500); }
.badge-pts.aguarda { background: var(--verde-light); color: var(--verde-dark); }
.badge-fase {
  display: inline-block;
  padding: .18rem .6rem;
  border-radius: 20px;
  font-size: .68rem;
  font-weight: 700;
  background: var(--verde-light);
  color: var(--verde-dark);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.label-encerrado {
  font-size: .65rem; font-weight: 700;
  background: #f8d7da; color: #721c24;
  border-radius: 20px; padding: .12rem .5rem;
  white-space: nowrap;
}
.label-aberto {
  font-size: .65rem; font-weight: 700;
  background: #d4edda; color: #155724;
  border-radius: 20px; padding: .12rem .5rem;
  white-space: nowrap;
}
.label-sem-palpite {
  font-size: .65rem; font-weight: 700;
  color: var(--dourado-dark);
  white-space: nowrap;
}

/* ========== BOTÕES ========== */
.btn-verde {
  background: var(--verde);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: .7rem 1.25rem;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  font-family: 'DM Sans', sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  text-decoration: none;
}
.btn-verde:hover  { background: var(--verde-dark); box-shadow: 0 4px 12px rgba(15,110,86,.3); color: #fff; }
.btn-verde:active { transform: scale(.97); }
.btn-verde:disabled { background: var(--cinza-200); color: var(--cinza-400); cursor: not-allowed; box-shadow: none; }
.btn-verde.w-100  { width: 100%; }

.btn-outline-verde {
  background: transparent;
  color: var(--verde);
  border: 2px solid var(--verde);
  border-radius: 12px;
  padding: .65rem 1.2rem;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'DM Sans', sans-serif;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  text-decoration: none;
}
.btn-outline-verde:hover { background: var(--verde); color: #fff; }

.btn-danger-outline {
  background: transparent;
  color: #dc3545;
  border: 1.5px solid #dc3545;
  border-radius: 10px;
  padding: .4rem .85rem;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.btn-danger-outline:hover { background: #dc3545; color: #fff; }

/* ========== FORMULÁRIOS ========== */
.form-label-bolao { font-size: .83rem; font-weight: 700; color: var(--text); margin-bottom: .35rem; display: block; }
.input-bolao {
  width: 100%;
  border: 1.5px solid var(--cinza-200);
  border-radius: 11px;
  padding: .65rem .9rem;
  font-size: .95rem;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}
.input-bolao:focus {
  outline: none;
  border-color: var(--verde);
  box-shadow: 0 0 0 3px rgba(29,158,117,.15);
}
.input-bolao::placeholder { color: var(--cinza-400); }
.form-group { margin-bottom: .9rem; }
.form-erro { color: #dc3545; font-size: .8rem; margin-top: .3rem; display: block; }

/* ========== PAGE TITLE ========== */
.page-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--verde-dark);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  letter-spacing: -.01em;
}

/* ========== FILTER TABS ========== */
.filter-tabs {
  display: flex;
  gap: .4rem;
  margin-bottom: .85rem;
  overflow-x: auto;
  padding-bottom: .2rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tab {
  padding: .38rem .85rem;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 700;
  border: 2px solid var(--cinza-200);
  background: #fff;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  text-decoration: none;
  flex-shrink: 0;
}
.filter-tab.ativo, .filter-tab:hover {
  border-color: var(--verde);
  color: var(--verde-dark);
  background: var(--verde-light);
}

/* ========== FLASH MESSAGES ========== */
.flash {
  padding: .7rem .9rem;
  border-radius: 11px;
  font-size: .87rem;
  font-weight: 600;
  margin-bottom: .85rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.flash.success { background: #d4edda; color: #155724; }
.flash.danger  { background: #f8d7da; color: #721c24; }
.flash.info    { background: var(--verde-light); color: var(--verde-dark); }
.flash.warning { background: #fff3cd; color: #856404; }

/* ========== LOGIN ========== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: linear-gradient(160deg, #072e20 0%, var(--verde-dark) 45%, var(--verde) 100%);
}
.login-card {
  background: #fff;
  border-radius: 20px;
  padding: 1.75rem 1.5rem;
  width: 100%;
  max-width: 390px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.login-logo { text-align: center; margin-bottom: 1.5rem; }
.login-logo img { width: 100px; margin: 0 auto .75rem; }
.login-logo h1  { font-size: 1.3rem; font-weight: 800; color: var(--verde-dark); margin-bottom: .2rem; }
.login-logo p   { font-size: .82rem; color: var(--text-muted); }

/* ========== MISC ========== */
.divider { border: none; border-top: 1px solid var(--cinza-200); margin: .9rem 0; }
.link-verde { color: var(--verde); font-weight: 600; text-decoration: none; }
.link-verde:hover { color: var(--verde-dark); text-decoration: underline; }
.text-muted-sm { font-size: .78rem; color: var(--text-muted); }
.jogo-fechado { opacity: .65; }
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--text-muted); }
.empty-state .emoji { font-size: 2.5rem; margin-bottom: .6rem; }
.empty-state p { font-size: .9rem; }

/* ========== SALVAR PALPITES — sticky bottom ========== */
.salvar-sticky {
  position: sticky;
  bottom: 76px;
  z-index: 50;
  padding: .6rem 0;
}
@media (min-width: 768px) { .salvar-sticky { bottom: 12px; } }

/* ========== QUICK LINKS GRID ========== */
.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
  margin-bottom: .85rem;
}
.quick-card {
  background: #fff;
  border-radius: 14px;
  padding: 1rem .75rem;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
  transition: box-shadow var(--transition), transform var(--transition);
  display: block;
}
.quick-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.1); transform: translateY(-1px); }
.quick-card .qc-icon { font-size: 1.75rem; margin-bottom: .3rem; line-height: 1; }
.quick-card .qc-label { font-size: .85rem; font-weight: 700; color: var(--verde-dark); }
.quick-card .qc-sub   { font-size: .72rem; color: var(--text-muted); margin-top: .1rem; }

/* ========== PONTUAÇÃO RÁPIDA ========== */
.pts-bar {
  background: #fff;
  border-radius: 12px;
  padding: .75rem .9rem;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
  margin-bottom: .85rem;
}
.pts-bar-label { font-size: .7rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; width: 100%; margin-bottom: .1rem; }
