﻿/* ===== Joao Havelange — Tema Escuro Mobile-first ===== */
:root {
  --bg: #0a0e0f; --surface: #14191c; --surface2: #1a2024; --surface3: #21282d;
  --primary: #00d084; --primary-glow: rgba(0,208,132,0.15); --primary-dark: #00a868;
  --text: #e8ecef; --text-secondary: #8899a6; --text-muted: #5c6e7a;
  --border: #293138; --border-light: #333d45;
  --live: #ff4444; --danger: #ef5350; --danger-bg: rgba(239,83,80,0.08);
  --warning: #ffa726; --gold: #ffc107; --silver: #a0a8b0; --bronze: #c97e48;
  --radius: 14px; --radius-sm: 8px; --radius-xs: 6px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; font-family: 'Inter', 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
body { display: flex; flex-direction: column; overflow-x: hidden; }
.hidden { display: none !important; }
::selection { background: var(--primary); color: #000; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.standings-scroll::-webkit-scrollbar { height: 4px; }
.standings-scroll::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 2px; }
.bracket-scroll::-webkit-scrollbar { height: 4px; }
.bracket-scroll::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 2px; }

/* ===== LOGIN (OVERLAY) ===== */
#tela-login {
  display: none;
  position: fixed; inset: 0; z-index: 200;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  padding: 20px;
}
#tela-login.show { display: flex; }
.card-login { width: 100%; max-width: 400px; background: var(--surface); border-radius: var(--radius); padding: 32px 28px 28px; border: 1px solid var(--border); box-shadow: 0 24px 60px rgba(0,0,0,.50); position: relative; max-height: 95vh; overflow-y: auto; }
.login-close { position: absolute; top: 12px; right: 16px; background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.2em; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.login-close:hover { background: var(--surface3); color: var(--text); }
.logo-login { width: 72px; height: 72px; border-radius: 12px; margin: 0 auto 10px; display: block; object-fit: cover; background: var(--surface3); }
.app-titulo { text-align: center; font-size: 1.25em; font-weight: 900; color: var(--text); letter-spacing: -0.5px; }
.app-subtitulo { text-align: center; font-size: 0.75em; color: var(--text-muted); font-weight: 500; margin: 4px 0 20px; }

.auth-tabs { display: flex; gap: 4px; background: var(--bg); border-radius: var(--radius-xs); padding: 4px; margin-bottom: 24px; }
.auth-tab { flex: 1; padding: 10px; border: none; background: transparent; color: var(--text-muted); cursor: pointer; font-weight: 600; font-size: 0.88em; border-radius: 4px; font-family: inherit; }
.auth-tab.ativo { background: var(--surface2); color: var(--text); }
.auth-form { display: none; }
.auth-form.ativo { display: block; }

.form-grupo { margin-bottom: 12px; }
.form-grupo input { width: 100%; padding: 12px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--text); font-size: 0.94em; font-family: inherit; outline: none; }
.form-grupo input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,208,132,0.08); }
.form-grupo select { width: 100%; padding: 12px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--text); font-size: 0.94em; font-family: inherit; outline: none; }
.form-grupo select:focus { border-color: var(--primary); }
.form-grupo input[type="date"], .form-grupo input[type="time"] { color-scheme: dark; }
.input-icon { position: relative; }
.input-icon .icon-left { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.input-icon input { padding-left: 42px !important; padding-right: 38px !important; }
.feedback { min-height: 18px; font-size: 0.78em; color: var(--danger); text-align: center; margin-bottom: 4px; font-weight: 600; }

/* Password toggle */
.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 42px !important; }
.pwd-toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); cursor: pointer; font-size: 0.95em; }
.pwd-toggle:hover { color: var(--text); }
.input-icon .pwd-toggle { right: 14px; }
.input-icon input { padding-right: 42px !important; }

.btn { height: 44px; border: none; border-radius: var(--radius-xs); font-size: 0.94em; font-weight: 700; cursor: pointer; font-family: inherit; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.btn:active { transform: scale(0.98); }
.btn-primario { background: var(--primary); color: #000; }
.btn-primario:hover { background: var(--primary-dark); }
.btn-perigo { background: var(--danger); color: #fff; }
.btn-outline { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--surface2); color: var(--text); }
.btn-icon { background: transparent; border: 1px solid var(--border); color: var(--text-muted); cursor: pointer; padding: 5px 8px; border-radius: 4px; font-size: 0.75em; font-family: inherit; }
.btn-icon:hover { background: var(--surface3); color: var(--text); }

/* ===== TOPBAR ===== */
#app-tela { min-height: 100dvh; display: flex; flex-direction: column; }
#topbar { background: var(--surface); height: 56px; display: flex; justify-content: space-between; align-items: center; padding: 0 12px 0 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; position: sticky; top: 0; z-index: 60; }
.topbar-logo { display: flex; align-items: center; gap: 10px; }
.topbar-logo-img { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.topbar-texto { display: flex; flex-direction: column; justify-content: center; line-height: 1.1; }
.topbar-titulo { font-weight: 900; font-size: 0.95em; letter-spacing: -0.3px; }
.topbar-edicao { font-weight: 400; font-size: 0.6em; color: var(--text-muted); }
.topbar-user { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
#user-logged { display: none; align-items: center; gap: 6px; }
.user-avatar { 
  width: 34px; height: 34px; 
  border-radius: 50%; 
  background: var(--surface3); 
  display: flex; align-items: center; justify-content: center; 
  font-weight: 700; font-size: 0.75em; 
  color: var(--primary); 
  border: 2px solid var(--border); 
  flex-shrink: 0; 
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s;
}
.user-avatar:hover { border-color: var(--primary); }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-nome { font-weight: 600; font-size: 0.8em; color: var(--text-secondary); white-space: nowrap; max-width: 100px; overflow: hidden; text-overflow: ellipsis; }
.btn-logout { background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.95em; padding: 6px; border-radius: 50%; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.btn-logout:hover { color: var(--danger); background: var(--danger-bg); }

/* ===== PERFIL ===== */
.perfil-foto-area { text-align: center; margin-bottom: 20px; }
.perfil-foto { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; border: 3px solid var(--border); background: var(--surface3); display: flex; align-items: center; justify-content: center; font-size: 2.2em; font-weight: 900; color: var(--primary); margin: 0 auto; overflow: hidden; cursor: pointer; transition: border-color 0.2s; }
.perfil-foto:hover { border-color: var(--primary); }
.perfil-foto img { width: 100%; height: 100%; object-fit: cover; }
.perfil-foto-label { display: inline-block; cursor: pointer; font-size: 0.75em; color: var(--primary); margin-top: 8px; font-weight: 600; }
.perfil-foto-label:hover { text-decoration: underline; }
.perfil-foto-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.perfil-info { text-align: center; margin-bottom: 6px; }
.perfil-nome { font-size: 1.1em; font-weight: 700; }
.perfil-usuario { font-size: 0.8em; color: var(--text-muted); }
.perfil-senha-toggle { font-size: 0.78em; color: var(--text-muted); cursor: pointer; padding: 8px 0; margin-bottom: 8px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 6px; }
.perfil-senha-toggle:hover { color: var(--text); }
.btn-entrar-top { background: var(--primary); color: #000; border: none; padding: 8px 16px; border-radius: 20px; font-weight: 700; cursor: pointer; font-size: 0.78em; font-family: inherit; display: flex; align-items: center; gap: 6px; flex-shrink: 0; white-space: nowrap; }
.btn-entrar-top:hover { background: var(--primary-dark); }
.btn-admin-top { background: var(--surface3); color: var(--warning); border: 1px solid rgba(255,167,38,0.2); padding: 5px 10px; border-radius: 20px; font-weight: 600; cursor: pointer; font-size: 0.72em; font-family: inherit; display: flex; align-items: center; gap: 5px; flex-shrink: 0; white-space: nowrap; }
.btn-admin-top:hover { background: rgba(255,167,38,0.1); }

/* ===== TABS ===== */
.tabs-nav { display: flex; gap: 4px; background: var(--surface2); margin: 12px 16px; border-radius: var(--radius-xs); padding: 4px; overflow-x: auto; scrollbar-width: none; flex-shrink: 0; }
.tabs-nav::-webkit-scrollbar { display: none; }
.tab { flex: 1 0 auto; padding: 10px 14px; background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.82em; font-weight: 600; border-radius: 4px; font-family: inherit; white-space: nowrap; display: flex; align-items: center; justify-content: center; gap: 6px; }
.tab:hover { color: var(--text-secondary); }
.tab.ativo { background: var(--surface3); color: var(--text); }
.tab-badge { font-size: 0.78em; background: var(--border); color: var(--text-muted); padding: 2px 7px; border-radius: 10px; }
.tab.ativo .tab-badge { background: var(--primary); color: #000; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--live); animation: pulse 1.5s infinite; vertical-align: middle; margin-right: 2px; }

/* ===== CONTEUDO ===== */
#conteudo { flex: 1; padding: 0 16px 32px; overflow-y: auto; overflow-x: hidden; max-width: 900px; margin: 0 auto; width: 100%; }
.tab-content { display: none; }
.tab-content.ativo { display: block; }

/* ===== GAME CARDS ===== */
.game-card { background: var(--surface); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 14px; border: 1px solid var(--border); box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.game-header { display: flex; justify-content: space-between; align-items: center; font-size: 0.8em; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.game-status-live { color: var(--live); font-weight: 700; display: flex; align-items: center; gap: 8px; background: rgba(255,68,68,0.08); padding: 4px 12px; border-radius: 20px; }
.game-status-live i { font-size: 0.5em; animation: pulse 1.5s infinite; }
.match-tempo { font-weight: 800; color: var(--live); font-size: 1em; font-variant-numeric: tabular-nums; letter-spacing: 0.5px; background: rgba(255,68,68,0.10); padding: 2px 8px; border-radius: 12px; white-space: nowrap; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.2; } }
.game-status-finished { color: var(--text-muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.game-status-upcoming { color: var(--primary); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.game-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-bottom: 18px; }
.team-block { text-align: center; }
.team-block.home { text-align: right; }
.team-block.away { text-align: left; }
.team-name { font-weight: 700; font-size: 1em; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; transition: color 0.15s; }
.team-name:hover { color: var(--primary); }
.team-block.home .team-name { justify-content: flex-end; }
.team-block.away .team-name { justify-content: flex-start; }
.game-flag { font-size: 1.3em; line-height: 1; flex-shrink: 0; }
.team-score { font-size: 2em; font-weight: 900; color: var(--primary); letter-spacing: -1px; }

  .team-score.empty { color: var(--primary); opacity: 0.45; font-size: 1.3em; }
.vs-divider { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.vs-badge { background: var(--surface3); color: var(--text-muted); font-weight: 700; font-size: 0.7em; padding: 5px 10px; border-radius: 20px; }
.phase-badge { font-weight: 700; font-size: 0.68em; padding: 2px 8px; border-radius: 10px; margin-left: 8px; white-space: nowrap; }
.phase-badge.semi { background: rgba(255,167,38,0.15); color: var(--warning); }
.phase-badge.final { background: rgba(255,193,7,0.15); color: var(--gold); }

/* Match controls */
.btn-match-start { background: var(--primary); color: #000; border: none; padding: 6px 14px; border-radius: 20px; font-weight: 700; cursor: pointer; font-size: 0.75em; font-family: inherit; display: flex; align-items: center; gap: 6px; }
.btn-match-start:hover { background: var(--primary-dark); }

.btn-match-reopen { background: var(--surface3); color: var(--warning); border: 1px solid rgba(255,167,38,0.3); padding: 6px 14px; border-radius: 20px; font-weight: 700; cursor: pointer; font-size: 0.75em; font-family: inherit; display: flex; align-items: center; gap: 6px; }
.btn-match-reopen:hover { background: rgba(255,167,38,0.1); }
.btn-match-score { background: var(--surface3); color: var(--text); border: 1px solid var(--border); width: 30px; height: 26px; border-radius: 4px; cursor: pointer; font-size: 0.75em; font-weight: 700; font-family: inherit; display: flex; align-items: center; justify-content: center; }
.btn-match-score:hover { background: var(--border); }
.btn-match-pause { background: var(--surface3); color: var(--warning); border: 1px solid rgba(255,167,38,0.2); width: 30px; height: 26px; border-radius: 4px; cursor: pointer; font-size: 0.75em; display: flex; align-items: center; justify-content: center; }
.btn-match-pause:hover { background: rgba(255,167,38,0.1); }
.btn-match-finish { background: var(--danger); color: #fff; border: none; width: 30px; height: 26px; border-radius: 4px; cursor: pointer; font-size: 0.75em; display: flex; align-items: center; justify-content: center; }
.btn-match-finish:hover { opacity: 0.85; }

.match-live-ctrl-full { background: var(--surface2); border-radius: var(--radius-sm); padding: 14px; text-align: center; }
.match-live-score-big { font-size: 1.8em; font-weight: 900; color: var(--primary); margin-bottom: 8px; letter-spacing: -1px; }
.match-live-score-big span { color: var(--primary); opacity: 0.6; font-size: 0.5em; font-weight: 700; }
.match-live-ctrl-full .match-tempo { display: inline-block; margin-bottom: 8px; }
.match-ht-badge { font-size: 0.75em; font-weight: 800; color: var(--warning); background: rgba(255,167,38,0.12); padding: 2px 10px; border-radius: 12px; white-space: nowrap; display: inline-block; margin-bottom: 6px; }
.match-live-btns { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.match-live-btns .btn-match-score { width: auto; padding: 6px 12px; font-size: 0.72em; height: auto; }
.btn-match-remark { background: var(--surface3); color: var(--primary); border: 1px solid rgba(0,208,132,0.35); padding: 6px 14px; border-radius: 20px; font-weight: 700; cursor: pointer; font-size: 0.75em; font-family: inherit; display: flex; align-items: center; gap: 6px; }
.btn-match-remark:hover { background: rgba(0,208,132,0.1); }

/* Remarcar jogo — atalhos rapidos (Hoje, Amanha, Sabado, Terca) */
.rem-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.rem-chip { background: var(--surface3); color: var(--text-secondary); border: 1px solid var(--border); padding: 5px 12px; border-radius: 16px; font-size: 0.72em; font-weight: 700; cursor: pointer; font-family: inherit; }
.rem-chip:hover { border-color: var(--primary); color: var(--primary); }

/* ===== CARTOES (registro durante a partida) ===== */
.cartao-secao-titulo { font-weight: 800; font-size: 0.85em; margin: 14px 0 6px; display: flex; align-items: center; gap: 6px; }
.cartao-lista { background: var(--surface2); border-radius: var(--radius-xs); border: 1px solid var(--border); overflow: hidden; }
.cartao-linha { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,0.03); }
.cartao-linha:last-child { border-bottom: none; }
.cartao-nome { flex: 1; min-width: 0; font-size: 0.8em; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cartao-grupo { display: flex; align-items: center; gap: 3px; font-size: 0.8em; flex-shrink: 0; }
.cartao-grupo b { min-width: 14px; text-align: center; font-size: 0.9em; }
.cartao-grupo.am i { color: var(--warning); font-size: 0.7em; }
.cartao-grupo.verm i { color: var(--danger); font-size: 0.7em; }
.cartao-btn { width: 24px; height: 24px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface3); color: var(--text); cursor: pointer; font-weight: 700; font-size: 0.85em; line-height: 1; display: flex; align-items: center; justify-content: center; font-family: inherit; }
.cartao-btn:hover { background: var(--border); }
.cartao-btn:active { transform: scale(0.92); }

/* ===== GOL: QUEM MARCOU? ===== */
.gol-jogador { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-bottom: 1px solid rgba(255,255,255,0.03); cursor: pointer; }
.gol-jogador:hover { background: var(--surface3); }
.gol-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--surface3); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.8em; color: var(--primary); flex-shrink: 0; }
.gol-nome { flex: 1; min-width: 0; font-size: 0.85em; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gol-gols { font-size: 0.72em; color: var(--text-muted); flex-shrink: 0; }

/* ===== DETALHES DO JOGO ===== */
.game-card-clickable { cursor: pointer; }
.game-card-clickable:hover { border-color: var(--border-light); }
.det-resumo { display: flex; justify-content: space-around; background: var(--surface2); border-radius: var(--radius-xs); padding: 10px 8px; margin-bottom: 14px; border: 1px solid var(--border); }
.det-resumo-item { text-align: center; }
.det-resumo-item span { display: block; font-size: 0.65em; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.det-resumo-item b { font-size: 1em; font-weight: 800; }
.det-secao-titulo { font-weight: 800; font-size: 0.85em; margin: 12px 0 6px; display: flex; align-items: center; gap: 6px; color: var(--primary); }
.det-time-titulo { font-weight: 700; font-size: 0.8em; margin: 8px 0 4px; }
.det-stat-linha { display: flex; align-items: center; gap: 8px; padding: 5px 2px; font-size: 0.8em; border-bottom: 1px solid rgba(255,255,255,0.02); }
.det-stat-nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.det-stat-badge { font-size: 0.72em; font-weight: 700; padding: 2px 7px; border-radius: 4px; background: var(--surface3); display: inline-flex; align-items: center; gap: 3px; }
.det-stat-badge.gol i { color: var(--primary); }
.det-stat-badge.am i { color: var(--warning); }
.det-stat-badge.verm i { color: var(--danger); }
.det-timeline { border-left: 2px solid var(--border); margin-left: 6px; padding-left: 12px; }
.det-event { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 0.82em; }
.det-event-min { font-weight: 800; color: var(--text-muted); font-size: 0.8em; min-width: 34px; }
.det-event-ico { width: 20px; text-align: center; flex-shrink: 0; }
.det-event-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.det-event-tipo { font-size: 0.68em; font-weight: 700; padding: 1px 6px; border-radius: 8px; background: var(--surface3); }
.det-event-tipo.gol { color: var(--primary); }
.det-event-tipo.amarelo { color: var(--warning); }
.det-event-tipo.vermelho { color: var(--danger); }
.det-event-time { font-size: 0.7em; color: var(--text-muted); }

/* Eventos estilo jogo oficial: casa à esquerda, minuto no centro, visitante à direita */
.det-events-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin-bottom: 8px; padding: 8px 10px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-xs); }
.det-events-team { font-weight: 800; font-size: 0.75em; display: flex; align-items: center; gap: 4px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.det-events-team.left { justify-self: start; justify-content: flex-start; }
.det-events-team.right { justify-self: end; justify-content: flex-end; text-align: right; }
.det-events-vs { justify-self: center; font-size: 0.7em; color: var(--primary); flex-shrink: 0; line-height: 1; }
.det-events-track { display: flex; flex-direction: column; padding: 2px 0 8px; }
.det-ev-row { display: grid; grid-template-columns: 1fr 40px 1fr; align-items: center; gap: 6px; padding: 5px 0; }
.det-ev-chip { display: flex; align-items: center; gap: 4px; font-size: 0.75em; min-width: 0; color: var(--text-secondary); }
.det-ev-chip.left { justify-content: flex-end; text-align: right; }
.det-ev-chip.right { justify-content: flex-start; text-align: left; }
.det-ev-chip b { font-weight: 800; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.det-ev-min { text-align: center; font-weight: 800; font-size: 0.72em; color: var(--text-muted); background: var(--surface3); border-radius: 12px; padding: 3px 0; width: 40px; justify-self: center; }

/* ===== TIMES ===== */
.teams-header { text-align: center; margin-bottom: 20px; }
.teams-header h2 { font-size: 1.2em; font-weight: 800; color: var(--gold); display: flex; align-items: center; justify-content: center; gap: 8px; }

/* ===== STANDINGS ===== */
.standings-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.standings-header h2 { font-size: 1.1em; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.standings-logo { 
  width: 36px; height: 36px; 
  border-radius: 8px; 
  flex-shrink: 0; 
  border: 2px solid var(--primary); 
  background: var(--primary-glow) url('../img/logo.png') center/cover no-repeat;
  display: inline-block;
}

/* Wrapper com scroll horizontal proprio */
.standings-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  position: relative;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}
/* Sombra lateral direita — indica que tem mais conteudo pra rolar */
.standings-scroll::before,
.standings-scroll::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 24px;
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.3s;
}
.standings-scroll::before {
  left: 0;
  background: linear-gradient(to right, var(--bg) 0%, transparent 100%);
  opacity: 0;
}
.standings-scroll::after {
  right: 0;
  background: linear-gradient(to left, var(--bg) 30%, transparent 100%);
  opacity: 1; /* sempre visivel como dica */
}
.standings-scroll.scrolled-left::before { opacity: 1; }
.standings-scroll.scrolled-right::after { opacity: 0; }

.standings-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.85em;
  white-space: nowrap;
}
.standings-table thead { position: sticky; top: 0; z-index: 1; }
.standings-table th {
  text-align: left;
  padding: 10px 8px;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.7em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.standings-table th:first-child { padding-left: 16px; }
.standings-table th.center { text-align: center; }
.standings-table td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-weight: 500;
}
.standings-table td:first-child { padding-left: 16px; }
.standings-table td:last-child { padding-right: 16px; }
.standings-table tr:last-child td { border-bottom: none; }
.standings-table tr:nth-child(even) td { background: rgba(255,255,255,0.01); }
.standings-table .center { text-align: center; }
.standings-table .team-col { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.standings-table .team-flag-icon { 
  width: 32px; height: 32px; 
  border-radius: 50%; 
  background: var(--surface3); 
  display: flex; align-items: center; justify-content: center; 
  font-size: 1em; 
  flex-shrink: 0; 
  border: 1px solid var(--border);
  line-height: 1;
}
.standings-table .pos-col { font-weight: 800; text-align: center; color: var(--text-muted); }
.standings-table tr:nth-child(1) .pos-col { color: var(--gold); }
.standings-table tr:nth-child(2) .pos-col { color: var(--silver); }
.standings-table tr:nth-child(3) .pos-col { color: var(--bronze); }
.standings-table .pts-col { font-weight: 900; color: var(--primary); text-align: center; font-size: 1.05em; }
.standings-table .sg-col { font-weight: 700; }
.standings-table .sg-pos { color: var(--primary); }
.standings-table .sg-neg { color: var(--danger); }

/* Dica de scroll no mobile */
.standings-scroll-hint {
  display: none;
  text-align: center;
  font-size: 0.68em;
  color: var(--text-muted);
  padding: 6px 0 0;
  gap: 6px;
  align-items: center;
  justify-content: center;
  animation: hintPulse 2s ease-in-out infinite;
}
@keyframes hintPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.9; }
}

/* ===== BRACKET v2 ===== */
.bracket-v2 { margin-top: 28px; }
.br-title { font-size: 1.05em; font-weight: 800; display: flex; align-items: center; gap: 8px; margin-bottom: 16px; color: var(--gold); }
.br-round-label { text-align: center; font-size: 0.7em; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 8px; font-weight: 700; }

.br-round-row { display: flex; gap: 12px; justify-content: center; margin-bottom: 4px; }

/* Card de partida */
.br-card { 
  flex: 1; max-width: 220px; min-width: 140px;
  background: var(--surface); border: 1px solid var(--border); 
  border-radius: var(--radius-sm); overflow: hidden;
}
.br-card-final { max-width: 280px; }

.br-team { 
  display: flex; align-items: center; justify-content: space-between; 
  padding: 10px 12px; font-weight: 600; font-size: 0.82em;
  border-bottom: 1px solid var(--border);
}
.br-team:last-child { border-bottom: none; }
.br-team-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.br-flag { font-size: 1.2em; flex-shrink: 0; line-height: 1; }
.br-score { font-weight: 900; font-size: 1.05em; color: var(--primary); flex-shrink: 0; margin-left: 10px; }
.br-winner { background: rgba(0,208,132,0.08); }
.br-winner .br-team-name { color: var(--primary); }
.br-loser { color: var(--text-muted); }
.br-loser .br-score { color: var(--text-muted); }

/* Conector entre semis e final */
.br-connector {
  display: flex; align-items: stretch; justify-content: center;
  height: 32px; margin: 0;
}
.br-conn-left, .br-conn-right { flex: 1; max-width: 220px; position: relative; }
.br-conn-center { width: 12px; position: relative; flex-shrink: 0; }
/* Linhas verticais nas bordas internas dos cards */
.br-conn-left::before, .br-conn-right::before {
  content: ''; position: absolute; 
  top: 0; bottom: 50%; width: 2px;
  background: var(--border);
}
.br-conn-left::before { right: 0; }
.br-conn-right::before { left: 0; }
/* Linha horizontal central */
.br-conn-center::after {
  content: ''; position: absolute;
  top: 50%; left: -50%; right: -50%; height: 2px;
  background: var(--border);
  transform: translateY(-50%);
}
/* Linha vertical descendo do centro */
.br-conn-center::before {
  content: ''; position: absolute;
  top: 50%; bottom: 0; left: 50%; width: 2px;
  background: var(--border);
  transform: translateX(-50%);
}

/* ===== TEAMS ===== */
.team-card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 12px; overflow: hidden; }
.team-card-header { display: flex; align-items: center; gap: 10px; padding: 14px 18px; cursor: pointer; }
.team-card-header:hover { background: var(--surface2); }
.team-flag { font-size: 1.6em; width: 42px; text-align: center; flex-shrink: 0; }
.team-name-title { font-weight: 800; font-size: 1em; flex: 1; }
.team-count { font-size: 0.78em; color: var(--text-muted); }
.team-chevron { color: var(--text-muted); transition: transform 0.2s; }
.team-card.open .team-chevron { transform: rotate(180deg); }
.team-card.open .team-roster { display: block; }
.team-roster { display: none; padding: 0 16px 14px; border-top: 1px solid var(--border); }
.roster-section { margin-top: 12px; }
.roster-title { font-size: 0.7em; color: var(--primary); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.player-list { display: flex; flex-direction: column; gap: 1px; }
.player-row { display: flex; align-items: center; gap: 10px; padding: 5px 10px; border-radius: 6px; cursor: pointer; }
.player-row:hover { background: var(--surface3); }
.player-row-avatar { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; background: var(--surface3); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.72em; color: var(--primary); overflow: hidden; border: 2px solid var(--border); }
.player-row-avatar img { width: 100%; height: 100%; object-fit: cover; }
.player-row-name { font-weight: 600; font-size: 0.82em; }
.player-row-badges { display: flex; gap: 3px; flex-shrink: 0; margin-left: auto; flex-wrap: wrap; }
.player-badge { font-size: 0.65em; font-weight: 700; padding: 2px 6px; border-radius: 10px; white-space: nowrap; }
.player-badge.cap { background: rgba(255,193,7,0.15); color: var(--gold); }
.player-badge.gol { background: rgba(0,208,132,0.12); color: var(--primary); }
.player-badge.am { background: rgba(255,167,38,0.12); color: var(--warning); }
.player-badge.verm { background: rgba(239,83,80,0.12); color: var(--danger); }
.player-badge.mvp { background: rgba(0,208,132,0.2); color: var(--primary); }
.player-badge.les { background: rgba(239,83,80,0.15); color: var(--danger); }
.player-badge.sus { background: rgba(158,158,158,0.15); color: var(--text-muted); }

/* ===== MODAIS ===== */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); z-index: 100; align-items: center; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius); padding: 24px; width: 480px; max-width: 95vw; border: 1px solid var(--border); box-shadow: 0 8px 32px rgba(0,0,0,0.5); max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 1em; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.2em; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: var(--surface3); color: var(--text); }
.modal-jogador { width: 340px; text-align: center; }
.modal-jogador .modal-close { position: absolute; top: 12px; right: 16px; }

.score-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; justify-content: center; }
.score-input { width: 64px; padding: 10px; text-align: center; font-size: 1.2em; font-weight: 800; background: var(--bg); border: 2px solid var(--border); color: var(--text); border-radius: var(--radius-xs); outline: none; font-family: 'Inter', monospace; }
.score-input:focus { border-color: var(--primary); }
.score-vs { font-weight: 700; color: var(--text-muted); font-size: 1em; }
.admin-game-list { max-height: 180px; overflow-y: auto; margin-top: 8px; }
.admin-game-item { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,0.03); font-size: 0.8em; }

.empty-state { text-align: center; padding: 48px 16px; color: var(--text-muted); }
.empty-state i { font-size: 2.8em; opacity: 0.12; display: block; margin-bottom: 12px; }
.empty-state p { font-size: 0.88em; }

/* ===== TOAST ===== */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column-reverse; gap: 10px; pointer-events: none; }
.toast { background: var(--surface2); border: 1px solid var(--border); padding: 12px 18px; border-radius: var(--radius-sm); color: var(--text); font-weight: 600; font-size: 0.84em; pointer-events: all; display: flex; align-items: center; gap: 10px; min-width: 280px; box-shadow: 0 8px 32px rgba(0,0,0,0.5); animation: toastIn 0.35s ease; }
.toast.success { border-left: 3px solid var(--primary); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  .tabs-nav { margin: 8px 8px; padding: 3px; gap: 2px; }
  .tab { font-size: 0.7em; padding: 9px 8px; flex-shrink: 0; }
  #conteudo { padding: 0 8px 24px; }
  .game-card { padding: 14px; margin-bottom: 10px; }
  .team-name { font-size: 0.85em; }
  .team-score { font-size: 1.6em; }
  .team-score.empty { font-size: 1.1em; }

  /* Standings mobile */
  .standings-header { padding: 0; }
  .standings-scroll { border-radius: var(--radius-sm); }
  .standings-table { font-size: 0.75em; }
  .standings-table th { padding: 8px 6px; font-size: 0.65em; }
  .standings-table td { padding: 9px 6px; }
  .standings-table th:first-child,
  .standings-table td:first-child { padding-left: 12px; }
  .standings-table td:last-child { padding-right: 12px; }
  .standings-table .team-flag-icon { width: 28px; height: 28px; font-size: 0.9em; }
  .standings-scroll-hint { display: flex; }

  /* Bracket mobile */
  .br-round-row { gap: 8px; }
  .br-card { max-width: none; min-width: 0; font-size: 0.9em; }
  .br-team { padding: 8px 10px; font-size: 0.75em; }
  .br-conn-left, .br-conn-right { max-width: none; }

  .team-card-header { padding: 12px 14px; }
  .team-flag { font-size: 1.3em; width: 36px; }
  .team-name-title { font-size: 0.9em; }
  .player-row { padding: 9px 7px; gap: 8px; }
  .player-row-avatar { width: 34px; height: 34px; }
  .player-row-name { font-size: 0.85em; }
  .modal { width: 100%; max-width: 100%; border-radius: 16px 16px 0 0; margin-top: auto; max-height: 85vh; padding: 20px; }
  .modal-overlay { align-items: flex-end; }
  .modal-jogador { width: 300px; max-width: 92vw; margin: auto; border-radius: var(--radius); }
  #modal-jogador.modal-overlay { align-items: center; }
  .toast-container { bottom: 10px; right: 10px; left: 10px; }
  .toast { min-width: auto; font-size: 0.8em; }
  .score-input { width: 52px; font-size: 1em; padding: 8px; }
}

@media (max-width: 380px) {
  .game-teams { display: flex; flex-direction: column; align-items: center; gap: 6px; }
  .game-teams .team-block { text-align: center !important; width: 100%; }
  .game-teams .team-block .team-score { font-size: 1.3em; }
  .vs-divider { flex-direction: row; gap: 10px; }
  .score-input { width: 44px; font-size: 0.9em; }
  .tab { font-size: 0.65em; padding: 6px 7px; }
}

/* ===== DESKTOP ===== */
@media (min-width: 769px) {
  .standings-scroll {
    margin: 0;
    border-radius: var(--radius);
    border: 1px solid var(--border);
  }
  .standings-scroll-hint { display: none !important; }
}

@media (min-width: 1024px) {
  #conteudo { max-width: 1000px; padding-bottom: 48px; }
  .tabs-nav { margin: 16px 0; }
  .game-card { padding: 20px 28px; }
  .game-card:hover { border-color: var(--border-light); }
}
