/* ============================================================
   BSPORTS — Global Styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@300;400;500&family=DM+Mono:wght@400;500&display=swap');

/* ── Variáveis de tema ── */
:root {
  --bg: #ffffff;
  --sf: #edf1f7;
  --sf2: #d9dfe9;
  --bd: #9aa4b8;
  --bd2: #7a8499;
  --tx: #0d1117;
  --mu: #4d5560;
  --mu2: #63707d;
  --ac: #185FA5;
  --acl: #2878c8;
  --acll: #bdd4f2;
  --acd: #0C447C;
  --red: #dc2626;
  --green: #16a34a;
  --gold: #d97706;

  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;

  --radius: 8px;
  --radius-lg: 12px;
  --avatar-bd: #7a8499;
  --shadow: 0 1px 3px rgba(0,0,0,.09), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.09), 0 2px 4px rgba(0,0,0,.06);
}

.dark {
  --bg: #0d1117;
  --sf: #161b22;
  --sf2: #1f2733;
  --bd: #30363d;
  --bd2: #484f58;
  --tx: #e6edf3;
  --mu: #b0bec5;
  --mu2: #8b949e;
  --ac: #58a6ff;
  --acl: #79b8ff;
  --acll: #1c3557;
  --acd: #a5c8f0;
  --avatar-bd: #484f58;
  --red: #f87171;
  --green: #4ade80;
  --gold: #fbbf24;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--tx);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* Trava rolagem horizontal da página inteira — só vertical, sempre. Evita
     que qualquer elemento largo demais (ex.: linha de abas) deixe o site
     inteiro arrastável pros lados. */
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font-family: var(--font-body); cursor: pointer; }
input, select, textarea { font-family: var(--font-body); }

/* ── Utilitários ── */
.divider { height: 1px; background: var(--bd); }
.eyebrow {
  font-size: 10px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--ac); display: flex; align-items: center; gap: 6px; margin-bottom: .5rem;
}
.eyebrow::before { content: ''; width: 16px; height: 1.5px; background: var(--ac); display: block; }

/* ── Navbar ── */
.navbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem; height: 52px;
  border-bottom: 1px solid var(--bd);
  background: var(--bg);
  position: sticky; top: 0; z-index: 200;
}
.navbar-logo {
  display: flex; align-items: center;
}
.navbar-logo img { height: 38px; width: auto; display: block; }
.dark .navbar-logo img { filter: brightness(0) invert(1); }
.navbar-links { display: flex; gap: 1.5rem; list-style: none; }
.navbar-links a {
  color: var(--mu); font-size: 11px;
  letter-spacing: .8px; text-transform: uppercase;
  transition: color .2s;
}
.navbar-links a:hover { color: var(--ac); }
.navbar-links a.active { color: var(--tx); }
.navbar-right { display: flex; align-items: center; gap: 10px; }

/* ── Theme toggle ── */
.theme-toggle {
  display: flex; align-items: center;
  background: var(--sf); border: 1px solid var(--bd);
  padding: 4px; border-radius: 20px; cursor: pointer;
}
.toggle-track {
  width: 40px; height: 22px; border-radius: 11px;
  background: var(--bd2); position: relative; flex-shrink: 0;
  transition: background .3s;
}
.dark .toggle-track { background: var(--ac); }
.toggle-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3);
  transition: transform .3s;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--gold);
}
.dark .toggle-thumb { transform: translateX(18px); color: var(--ac); }
.toggle-thumb .ti-moon { display: none; }
.dark .toggle-thumb .ti-sun { display: none; }
.dark .toggle-thumb .ti-moon { display: block; }

/* ── Botões ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border: none; border-radius: var(--radius);
  font-size: 12px; font-weight: 500; letter-spacing: .3px;
  cursor: pointer; transition: all .2s;
}
.btn-primary { background: var(--ac); color: #fff; }
.btn-primary:hover { background: var(--acd); }
.btn-secondary {
  background: transparent; color: var(--tx);
  border: 1.5px solid var(--bd2);
}
.btn-secondary:hover { border-color: var(--ac); color: var(--ac); }
.btn-sm { padding: 5px 12px; font-size: 11px; }
.btn-xs { padding: 3px 8px; font-size: 10px; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { opacity: .88; }

/* ── Seção padrão ── */
.section { padding: 2rem 1.5rem; }
.section-title {
  font-family: var(--font-display); font-size: 36px;
  letter-spacing: 1px; color: var(--tx); margin-bottom: 1.25rem; line-height: 1;
}

/* ── Tabs ── */
/* Com muitas categorias (7+), as abas não cabem todas numa linha só — em vez
   de vazar pra fora da tela (deixando a página inteira arrastável pros
   lados, o que não queremos), quebra pra uma segunda linha. A página só
   fica mais alta (rolagem vertical normal), nunca mais larga. */
.tabs {
  display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--bd); margin-bottom: 1.25rem;
}
.tab {
  padding: 8px 16px; font-size: 11px; letter-spacing: .8px; text-transform: uppercase;
  color: var(--mu); cursor: pointer; border: none; white-space: nowrap;
  border-bottom: 2px solid transparent; background: transparent;
  font-family: var(--font-body); transition: color .2s, border-color .2s;
}
.tab:hover { color: var(--tx); }
.tab.active { color: var(--ac); border-bottom-color: var(--ac); }

/* ── Tabela ranking ── */
.rank-table { width: 100%; border-collapse: collapse; }
.rank-table th {
  font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--mu2); padding: .55rem .75rem; text-align: left;
  border-bottom: 1px solid var(--bd); font-weight: 400;
  background: var(--bg);
}
.rank-table td {
  padding: .65rem .75rem; border-bottom: 1px solid var(--bd);
  vertical-align: middle; background: var(--bg); color: var(--tx);
}
.rank-table tbody tr:hover td { background: var(--sf); }
.rank-num { font-family: var(--font-mono); font-size: 11px; color: var(--mu2); }
.rank-num.top { color: var(--ac); font-weight: 500; }
.player-name { font-weight: 500; font-size: 13px; color: var(--tx); }
.bar-wrap { display: flex; align-items: center; gap: 8px; }
.bar-bg { height: 3px; background: var(--sf2); flex: 1; border-radius: 2px; overflow: hidden; min-width: 60px; }
.bar-fill { height: 100%; background: var(--ac); border-radius: 2px; transition: width 1.1s cubic-bezier(.16,1,.3,1); }
.pts-val { font-family: var(--font-mono); font-size: 11px; min-width: 42px; text-align: right; color: var(--tx); }
.bonus-badge {
  display: inline-block; font-size: 10px; padding: 2px 7px;
  background: var(--acll); color: var(--ac);
  border-radius: 3px; font-family: var(--font-mono);
}
/* V / D / P da classificação: vitórias, derrotas e o total de partidas.
   Colunas estreitas e centradas — são sempre números de um ou dois dígitos,
   e alinhadas à esquerda ficavam soltas longe do próprio cabeçalho. */
.rank-table th.rec-col, .rank-table td.rec-col {
  text-align: center; width: 34px; padding-left: .3rem; padding-right: .3rem;
}
.rec-val { font-family: var(--font-mono); font-size: 11px; color: var(--mu); }
.rec-val.v { color: var(--green); }
.rec-val.d { color: var(--red); }
.trend-up { color: var(--green); font-size: 12px; }
.trend-down { color: var(--red); font-size: 12px; }
.trend-flat { color: var(--mu2); font-size: 12px; }

/* ── Avatar ── */
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--acll);
  border: 1.5px solid var(--avatar-bd);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 500; color: var(--ac); flex-shrink: 0;
  overflow: hidden;
}
.avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.avatar.sm {
  width: 22px; height: 22px; font-size: 9px;
}
.avatar-lg {
  width: 48px; height: 48px; font-size: 16px;
}
.avatar-link {
  display: inline-flex; text-decoration: none; border-radius: 50%;
  transition: transform .15s, opacity .15s;
}
.avatar-link:hover { opacity: .82; transform: scale(1.08); }

/* ── Banner de boas-vindas (home) ── */
.welcome-banner {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: .9rem;
}
.welcome-banner .avatar { width: 36px; height: 36px; font-size: 13px; }
.welcome-banner-text { font-size: 13px; color: var(--mu); }
.welcome-banner-text strong { color: var(--tx); font-weight: 500; }

/* ── Slot aguardando adversário (calendário) ── */
.slot-waiting { display: flex; flex-direction: column; gap: 4px; width: 100%; }
/* Slot recomendado: precisa saltar aos olhos no meio da grade de horários,
   senão o jogador não percebe que aquele ali foi escolhido pra ele. */
.slot-recommended {
  background: color-mix(in srgb, var(--ac) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--ac) 45%, transparent);
  border-radius: 8px; padding: 6px 7px;
  /* sem margem negativa: a coluna da quadra tem overflow:hidden e o cartão
     escapava pela borda, cortando o selo no celular */
}
.slot-rec-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  color: #fff; background: var(--ac);
  border-radius: 999px; padding: 3px 9px; margin: 2px 0 1px;
  box-shadow: 0 1px 4px color-mix(in srgb, var(--ac) 45%, transparent);
}
.slot-rec-badge .ti { font-size: 12px; flex-shrink: 0; }
@media (max-width: 700px) {
  /* coluna de quadra estreita: selo menor pra caber numa linha só */
  .slot-rec-badge { font-size: 8px; padding: 2px 7px; letter-spacing: .3px; gap: 3px; }
  .slot-rec-badge .ti { font-size: 10px; }
  .slot-recommended { padding: 4px 5px; }
}

/* ── Wrapper nome + categoria (flex-column) ── */
.slot-player-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; overflow: hidden; }
.slot-waiting-label { font-size: 9px; color: var(--mu2); text-transform: uppercase; letter-spacing: .5px; }
.slot-waiting .btn-xs { align-self: flex-start; }

/* ── Slot bloqueado pelo admin (calendário) ── */
.slot-blocked {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--mu2); text-transform: uppercase; letter-spacing: .5px;
}
/* Reservado usa o mesmo desenho do bloqueado -- os dois tiram o horario do
   agendamento. A cor separa os dois motivos: reservado quer dizer que aquele
   horario ja tem dono; bloqueado, que a quadra esta indisponivel. */
.slot-reserved { color: var(--ac); }

/* ── Cards ── */
.card {
  background: var(--sf); border: 1px solid var(--bd);
  border-radius: var(--radius-lg); padding: 1.25rem;
}
.card:hover { border-color: var(--acl); }

/* ── Formulários ── */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 1rem; }
.form-label { font-size: 11px; font-weight: 500; letter-spacing: .5px; text-transform: uppercase; color: var(--mu); }
.form-input {
  background: var(--bg); color: var(--tx);
  border: 1px solid var(--bd); border-radius: var(--radius);
  padding: 9px 12px; font-size: 13px;
  transition: border-color .2s;
  width: 100%;
}
.form-input:focus { outline: none; border-color: var(--ac); }
.form-input::placeholder { color: var(--mu2); }
.pw-wrap { position: relative; }
.pw-wrap .form-input { padding-right: 38px; }
.pw-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--mu); padding: 4px;
  display: flex; align-items: center; font-size: 16px;
}
.pw-toggle:hover { color: var(--tx); }
.form-select {
  background: var(--bg); color: var(--tx);
  border: 1px solid var(--bd); border-radius: var(--radius);
  padding: 9px 12px; font-size: 13px;
  width: 100%; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.form-select:focus { outline: none; border-color: var(--ac); }
.dark .form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b0bec5' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* ── Alert / Toast ── */
.alert {
  padding: .75rem 1rem; border-radius: var(--radius);
  font-size: 13px; margin-bottom: 1rem;
}
.alert-error { background: rgba(220,38,38,.13); color: var(--red); border: 1px solid rgba(220,38,38,.3); }
.alert-success { background: rgba(22,163,74,.13); color: var(--green); border: 1px solid rgba(22,163,74,.3); }

/* ── Confirm modal ── */
.confirm-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.55); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
}
.confirm-box {
  background: var(--sf); border: 1px solid var(--bd);
  border-radius: 14px; padding: 2rem; max-width: 400px; width: 100%;
  text-align: center; box-shadow: 0 16px 48px rgba(0,0,0,.25);
}
.confirm-msg {
  font-size: 14px; color: var(--tx); line-height: 1.7;
  margin-bottom: 1.5rem; white-space: pre-line;
}
.confirm-btns { display: flex; gap: .75rem; justify-content: center; }
.confirm-btns .btn { min-width: 110px; padding: 10px 20px; font-size: 13px; font-weight: 600; border-radius: 8px; }
.btn-confirm-ok { background: var(--green); color: #fff; border: none; cursor: pointer; }
.btn-confirm-ok:hover { opacity: .88; }
.btn-confirm-cancel { background: var(--sf); color: var(--tx); border: 1px solid var(--bd); cursor: pointer; }
.btn-confirm-cancel:hover { background: var(--bg); }

/* ── Calendário mini ── */
.mini-cal {
  display: inline-block; width: 280px;
  border: 1px solid var(--bd); border-radius: var(--radius-lg); overflow: hidden;
}
.cal-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: .65rem 1rem; border-bottom: 1px solid var(--bd); background: var(--sf);
}
.cal-nav-title { font-weight: 500; font-size: 13px; color: var(--tx); }
.cal-arrow {
  background: transparent; border: none; color: var(--mu);
  cursor: pointer; padding: 2px 8px; border-radius: 4px; font-size: 18px; line-height: 1;
}
.cal-arrow:hover { background: var(--sf2); color: var(--tx); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-dow {
  background: var(--sf2); padding: .35rem 0; text-align: center;
  font-size: 9px; letter-spacing: .5px; text-transform: uppercase;
  color: var(--mu); border-bottom: 1px solid var(--bd);
}
.cal-day {
  padding: .3rem 0; text-align: center; font-size: 12px;
  color: var(--tx); min-height: 30px;
  display: flex; align-items: center; justify-content: center;
  position: relative; border-bottom: 1px solid var(--bd);
  background: var(--bg);
}
.cal-day.clickable { cursor: pointer; }
.cal-day.clickable:hover { background: var(--acll); color: var(--ac); }
.cal-day.empty { background: var(--sf); cursor: default; }
.cal-day.today { color: var(--ac); font-weight: 600; }
.cal-day.selected { background: var(--ac) !important; color: #fff !important; font-weight: 600; }
.cal-day.has-dot::after {
  content: ''; position: absolute; bottom: 3px; left: 50%;
  transform: translateX(-50%); width: 4px; height: 4px;
  border-radius: 50%; background: var(--ac);
}
.cal-day.selected.has-dot::after { background: #fff; }
.cal-day.past { color: var(--mu2); cursor: default; }

/* ── Loading ── */
.loading {
  display: flex; align-items: center; justify-content: center;
  padding: 2rem; gap: 8px; font-size: 13px; color: var(--mu);
}
.spinner {
  width: 16px; height: 16px; border: 2px solid var(--bd);
  border-top-color: var(--ac); border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty state ── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 3rem 1rem; gap: 8px;
  font-size: 13px; color: var(--mu); text-align: center;
}
.empty-state i { font-size: 28px; color: var(--mu2); margin-bottom: .25rem; }

/* ── Stats row ── */
.stats-row {
  display: inline-grid; grid-template-columns: repeat(4, auto);
  border: 1px solid var(--bd); border-radius: var(--radius-lg);
  overflow: hidden; background: var(--bd); gap: 1px;
  max-width: 100%;
}
.stats-row .stat-cell { background: var(--sf); padding: .65rem 1.25rem; text-align: center; }
.stat-num { font-family: var(--font-display); font-size: 28px; color: var(--ac); line-height: 1; }
.stat-lbl { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--mu); }

/* ── Court SVG ── */
.court-img { height: 100px; overflow: hidden; flex-shrink: 0; }

/* ── Badges de status ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; padding: 3px 9px; border-radius: 20px;
  font-weight: 500; letter-spacing: .5px; text-transform: uppercase;
}
.badge-upcoming { background: var(--acll); color: var(--ac); }
.badge-ongoing  { background: rgba(22,163,74,.18); color: var(--green); }
.badge-finished { background: var(--sf2); color: var(--mu); }

/* ── Match types — cores fixas independente do tema ── */
.badge-future-verde   { background: rgba(34,197,94,.2)  !important; color: #15803d !important; }
.badge-feminino-dupla { background: rgba(236,72,153,.18) !important; color: #be185d !important; }

.slot-row.slot-future-verde   { background: rgba(34,197,94,.12)  !important; border-left: 3px solid #22c55e; }
.slot-row.slot-future-verde:hover { background: rgba(34,197,94,.2) !important; }
.slot-row.slot-feminino-dupla { background: rgba(236,72,153,.12) !important; border-left: 3px solid #ec4899; }
.slot-row.slot-feminino-dupla:hover { background: rgba(236,72,153,.2) !important; }

.match-row-future-verde   > td { background: rgba(34,197,94,.07)  !important; }
.match-row-feminino-dupla > td { background: rgba(236,72,153,.07) !important; }

.slot-no-access {
  font-size: 11px; color: var(--mu); display: flex; align-items: center; gap: 5px;
  padding: 4px 8px; border-radius: 6px; background: var(--sf2); line-height: 1.4;
}

/* ── Feminino Dupla 2v2 layout ── */
.slot-fem-2v2 {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2px 6px;
  align-items: start;
  width: 100%;
}
.slot-fem-team {
  display: flex;
  flex-direction: column;
  gap: 1px;
  /* Item de grid tem min-width:auto por padrão, e o nome é nowrap: sem isso a
     coluna 1fr nunca encolhe, a grade 2v2 estoura o card e o nome da Dupla 2
     fica cortado pela borda. */
  min-width: 0;
}
.slot-fem-team-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--mu);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.slot-fem-team-win .slot-fem-team-label { color: var(--ac); }
.slot-fem-name {
  font-size: 11.5px;
  color: var(--tx);
  white-space: nowrap;
  /* Sem ellipsis de propósito: quem faz o nome caber é fitSlotName, reduzindo
     a fonte. overflow:hidden fica só como rede de segurança. */
  overflow: hidden;
  line-height: 1.4;
}
.slot-fem-name.slot-winner { color: var(--ac); font-weight: 600; }
.slot-fem-vacancy {
  font-size: 10.5px;
  color: var(--mu);
  opacity: .5;
  font-style: italic;
  line-height: 1.4;
}
.slot-fem-vs-col {
  font-size: 10px;
  font-weight: 700;
  color: var(--mu);
  text-align: left;
  padding-top: 18px;
  min-width: 20px;
  line-height: 1.3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.slot-fem-join-btn {
  margin-top: 4px;
  font-size: 10px !important;
  padding: 2px 6px !important;
}
.slot-fem-set-score {
  display: block;
  font-size: 9px;
  font-weight: 700;
  color: var(--mu);
  text-align: left;
  line-height: 1.5;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 1.5rem;
}
.modal {
  background: var(--bg); border: 1px solid var(--bd); border-radius: var(--radius-lg);
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--bd);
  position: sticky; top: 0; background: var(--bg);
}
.modal-title { font-family: var(--font-display); font-size: 24px; letter-spacing: 1px; color: var(--tx); }
.modal-close { background: transparent; border: none; font-size: 20px; color: var(--mu); cursor: pointer; line-height: 1; padding: 4px; }
.modal-close:hover { color: var(--tx); }
.modal-body { padding: 1.5rem; }

/* ── Markdown (regulamento) ── */
.md-h2 { font-family: var(--font-display); font-size: 28px; letter-spacing: 1px; color: var(--tx); margin: 1.75rem 0 .75rem; }
.md-h2:first-child { margin-top: 0; }
.md-h3 { font-size: 16px; font-weight: 500; color: var(--ac); margin: 1.25rem 0 .5rem; }
.md-h4 { font-size: 13px; font-weight: 600; color: var(--tx); margin: 1rem 0 .35rem; text-transform: uppercase; letter-spacing: .5px; }
.md-p { font-size: 13px; color: var(--mu); line-height: 1.8; margin-bottom: .5rem; font-weight: 300; }
.md-list { padding-left: 1.25rem; margin-bottom: .5rem; }
.md-list li { font-size: 13px; color: var(--mu); line-height: 1.8; font-weight: 300; }

/* ── Footer ── */
footer { padding: 1.25rem 1.5rem; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--bd); flex-wrap: wrap; }
.footer-logo { font-family: var(--font-display); font-size: 16px; letter-spacing: 2px; color: var(--ac); }
.footer-info { font-size: 11px; color: var(--mu); }
.footer-links { display: flex; gap: 1rem; }
.footer-links a { font-size: 11px; color: var(--mu); letter-spacing: .5px; text-transform: uppercase; }
.footer-links a:hover { color: var(--ac); }
.footer-copy { width: 100%; font-size: 10px; color: var(--mu); text-align: center; padding-top: .6rem; border-top: 1px solid var(--bd); margin-top: .35rem; letter-spacing: .3px; }

/* ── Hamburger button ── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px; height: 36px;
  padding: 7px;
  background: none; border: none;
  cursor: pointer;
  border-radius: var(--radius);
  flex-shrink: 0;
}
.nav-hamburger:hover { background: var(--sf2); }
.nav-hamburger span {
  display: block; width: 100%; height: 2px;
  background: var(--tx); border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
  transform-origin: center;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile nav drawer + backdrop ── */
.mobile-nav-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 198;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.mobile-nav-backdrop.open { opacity: 1; pointer-events: auto; }

.mobile-nav-drawer {
  position: fixed;
  top: 52px; left: 0; right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--bd);
  z-index: 199;
  transform: translateY(-105%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.mobile-nav-drawer.open { transform: translateY(0); }
.mobile-nav-drawer ul { list-style: none; padding: .5rem 0 .75rem; }
.mobile-nav-drawer li a {
  display: flex; align-items: center;
  padding: .85rem 1.5rem; min-height: 48px;
  font-size: 11px; font-weight: 500;
  letter-spacing: .8px; text-transform: uppercase;
  color: var(--mu);
  border-left: 3px solid transparent;
  transition: color .15s, border-color .15s, background .15s;
}
.mobile-nav-drawer li a:hover,
.mobile-nav-drawer li a.active {
  color: var(--ac); border-left-color: var(--ac); background: var(--sf);
}

/* ── Responsive base ── */
@media (max-width: 768px) {
  /* Navigation */
  .navbar { padding: 0 1rem; }
  .navbar-links { display: none; }
  .nav-hamburger { display: flex; }

  /* Layout */
  .section { padding: 1.5rem 1rem; }
  .section-title { font-size: 26px; }

  /* Stats */
  .stats-row { grid-template-columns: repeat(2, auto); }

  /* Touch targets */
  .btn { min-height: 44px; }
  .btn-sm { min-height: 38px; }
  .btn-xs { min-height: 32px; }
  .tab { min-height: 44px; padding: 8px 12px; }
  .cal-day { min-height: 44px; }
  .cal-arrow { padding: 6px 12px; }

  /* Forms: prevent iOS auto-zoom on input focus */
  .form-input, .form-select, textarea { font-size: 16px; }

  /* Tables: horizontal scroll */
  .rank-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  /* V/D/P no celular: a tabela ja rolava na horizontal antes destas colunas,
     entao elas vao o mais estreitas possivel para nao empurrar mais nada
     para fora da tela. Sao numeros de um ou dois digitos. */
  .rank-table th.rec-col, .rank-table td.rec-col {
    width: 26px; padding-left: .2rem; padding-right: .2rem;
  }

  /* Grids */
  .courts-grid { grid-template-columns: 1fr; }
  .feats { grid-template-columns: 1fr; }

  /* Footer */
  footer { flex-direction: column; gap: .65rem; align-items: flex-start; }
  .footer-links { flex-wrap: wrap; gap: .75rem; }

  /* Modals → bottom sheet */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    max-width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 88vh;
  }
  .confirm-overlay { align-items: flex-end; padding: 0; }
  .confirm-box {
    max-width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin: 0; padding: 1.5rem;
  }

  /* Stats row */
  .stats-row .stat-cell { padding: .55rem .85rem; }
  .stat-num { font-size: 24px; }

}

@media (max-width: 480px) {
  .section-title { font-size: 22px; }
  .stat-num { font-size: 20px; }
  .navbar { padding: 0 .85rem; }
  .navbar-logo img { height: 32px; }
}

/* ============================================================
   Paginação genérica (números de página) — usada em qualquer lista
   que pode passar de uma certa quantidade: admin (jogadores, partidas)
   e páginas públicas (resultados).
   ============================================================ */
.pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
.pagination-arrow, .pagination-num {
  min-width: 32px; height: 32px; padding: 0 .5rem;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--bd); border-radius: var(--radius);
  background: var(--sf); color: var(--tx);
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.pagination-arrow:disabled { opacity: .4; cursor: default; }
.pagination-arrow:not(:disabled):hover, .pagination-num:not(.active):hover { border-color: var(--ac); }
.pagination-num.active { background: var(--ac); border-color: var(--ac); color: #fff; }
.pagination-ellipsis { color: var(--mu); font-size: 12px; padding: 0 .15rem; }
