@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --green: #1a6b3c;
  --green-light: #2d9155;
  --green-dark: #0f3d22;
  --clay: #c4622d;
  --clay-light: #e07a45;
  --white: #f8f9f4;
  --gray-light: #dde4d3;
  --gray: #c8d0c2;
  --gray-dark: #6b7a65;
  --text: #1c2419;
  --shadow: 0 4px 15px rgba(0,0,0,0.08);
  --radius: 12px;
  /* Superfície de cartão (era "white" hardcoded em todo lugar) e cor de
     texto de destaque (era var(--green-dark) reaproveitado tanto pra fundo
     escuro do header quanto pra texto sobre cartão claro) — separados em
     tokens próprios pra viabilizar o tema escuro sem quebrar o header. */
  --surface: #ffffff;
  --accent-text: #0f3d22;
  /* Identidade do clube (multi-tenant) — "cor da barra" e "cor de fundo"
     configuradas no painel do RacketSpot. Variáveis PRÓPRIAS (não
     reaproveitam --green-dark/--gray-light direto) de propósito: essas
     duas são usadas só aqui, deixando intactas todas as bordas/tabelas/
     estados que dependem de --gray-light continuar neutro, e os botões/
     badges que dependem de --green continuar consistente. Sobrescritas
     via JS (app.js: applyClubBranding) depois de ler clubs/{clubId}; o
     valor abaixo é só o fallback antes do fetch (ou se o clube não
     configurou cor nenhuma). */
  --bar-color: var(--green-dark);
  --page-bg: var(--gray-light);
  color-scheme: light;
}

/* Tema escuro automático (segue o SO) — só se o usuário não tiver forçado
   o tema claro manualmente via toggle (data-theme="light"). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --green: #22a35f;
    --green-light: #3ec27c;
    --clay: #d97a45;
    --clay-light: #f0955f;
    --gray-light: #141c17;
    --gray: #33403a;
    --gray-dark: #a3b3a8;
    --text: #e9efe9;
    --shadow: 0 4px 15px rgba(0,0,0,0.5);
    --surface: #1c231d;
    --accent-text: #4ade80;
    color-scheme: dark;
  }
}

/* Tema escuro forçado manualmente (toggle no header), independente do SO. */
:root[data-theme="dark"] {
  --green: #22a35f;
  --green-light: #3ec27c;
  --clay: #d97a45;
  --clay-light: #f0955f;
  --gray-light: #141c17;
  --gray: #33403a;
  --gray-dark: #a3b3a8;
  --text: #e9efe9;
  --shadow: 0 4px 15px rgba(0,0,0,0.5);
  --surface: #1c231d;
  --accent-text: #4ade80;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--page-bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#app-content { flex: 1; padding: 16px 20px; }

/* HEADER */
header {
  background: var(--bar-color);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  color: var(--white);
  display: flex; align-items: center; gap: 10px;
}
.logo span { color: var(--clay-light); }
.logo-img { height: 40px; }

/* NAV TABS (base — reaproveitado pelos ícones da Home, ver .icon-menu-item) */
.nav-tab {
  padding: 15px 20px;
  color: rgba(255,255,255,0.6);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 4px solid transparent;
  white-space: nowrap;
  transition: 0.2s;
}
.nav-tab:hover { color: white; }
.nav-tab.active {
  color: white;
  border-bottom-color: var(--clay-light);
  background: rgba(255,255,255,0.05);
}

/* GROUP TABS */
.group-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding: 5px 0;
}
.group-tab {
  padding: 8px 20px;
  background: var(--surface);
  border-radius: 30px;
  font-weight: 700;
  color: var(--accent-text);
  box-shadow: var(--shadow);
  cursor: pointer;
  border: 2px solid transparent;
  transition: 0.2s;
  white-space: nowrap;
}
.group-tab:hover { transform: translateY(-2px); }
.group-tab.active {
  background: var(--green);
  color: white;
  border-color: var(--green-light);
}

/* CARDS */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

/* MODALS */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  display: none; /* ESCONDIDO POR PADRÃO */
  align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-overlay.active { display: flex !important; }

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px;
  position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.modal-close {
  position: absolute; top: 15px; right: 15px;
  background: none; border: none; font-size: 24px; cursor: pointer; color: var(--gray-dark);
}
.modal-title { font-family: 'Bebas Neue', sans-serif; font-size: 24px; color: var(--accent-text); margin-bottom: 20px; }

/* TABLES */
.ranking-table-container { overflow-x: auto; border-radius: 8px; }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th { background: var(--gray-light); color: var(--gray-dark); text-align: left; padding: 12px; font-size: 12px; text-transform: uppercase; }
td { padding: 12px; border-bottom: 1px solid var(--gray-light); font-size: 14px; }

/* STATS */
.stats-grid-advanced {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 15px;
}
.stat-card-adv {
  background: var(--surface);
  padding: 20px;
  border-radius: var(--radius);
  text-align: center;
  border-top: 5px solid var(--green);
  box-shadow: var(--shadow);
}
.stat-card-adv label { font-size: 11px; color: var(--gray-dark); font-weight: 700; text-transform: uppercase; display: block; margin-bottom: 8px; }
.stat-card-adv .value { font-family: 'Bebas Neue', sans-serif; font-size: 32px; color: var(--accent-text); }

/* FORMS */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px; }
.form-group label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 5px; color: var(--gray-dark); }
.form-group input, .form-group select {
  width: 100%; padding: 10px; border: 2px solid var(--gray-light); border-radius: 8px; font-size: 14px; outline: none; background: var(--surface); color: var(--text);
}
.form-group input:focus { border-color: var(--green); }

/* BUTTONS */
.btn {
  padding: 10px 20px; border-radius: 8px; border: none; font-weight: 700; cursor: pointer; transition: 0.2s;
}
.btn-green { background: var(--green); color: white; }
.btn-green:hover { background: var(--green-light); transform: scale(1.02); }
.btn-outline { background: transparent; border: 2px solid var(--gray); color: var(--gray-dark); }
.btn-outline:hover { background: var(--gray-light); }
.btn-yellow { background: #F1C40F; color: #553C00; }
.btn-yellow:hover { background: #F7D51E; transform: scale(1.02); }
.w-full { width: 100%; }

/* UTILS */
.hidden { display: none !important; }
.section-title { font-family: 'Bebas Neue', sans-serif; font-size: 26px; color: var(--accent-text); margin-bottom: 20px; }

@media (max-width: 600px) {
  .form-grid-2 { grid-template-columns: 1fr; }
}

/* ============================================================
   SECTION HEADER / EMPTY STATE
   ============================================================ */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.empty { text-align: center; padding: 50px 20px; color: var(--gray-dark); font-size: 14px; }
.empty-icon { font-size: 42px; margin-bottom: 12px; }

/* ============================================================
   HEADER ACTIONS
   ============================================================ */
.header-actions { display: flex; align-items: center; gap: 12px; }

/* ============================================================
   BUTTON SIZES / VARIANTS
   ============================================================ */
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-xs { padding: 5px 10px; font-size: 12px; }
.btn-danger { background: #c0392b; color: white; }
.btn-danger:hover { background: #a93226; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Botões "← Voltar" (Ranking → Partidas/Histórico; Meu Painel → cada
   subpágina) — azul com texto branco, maiores que um btn-sm comum, pra
   ficarem bem visíveis em vez de se confundir com o resto dos botões. */
.back-to-ranking-btn,
.back-to-dashboard-btn {
  background: #2563eb;
  color: white;
  border: none;
  font-size: 15px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(37,99,235,0.35);
}
.back-to-ranking-btn:hover,
.back-to-dashboard-btn:hover {
  background: #1d4ed8;
  transform: scale(1.03);
}

/* ============================================================
   RANKING — mobile cards vs desktop table
   BUG CORRIGIDO: antes não existia nenhuma regra de exibição
   condicional, então os dois layouts (cards com nomes e a
   tabela) apareciam ao mesmo tempo, um acima do outro.
   ============================================================ */
.ranking-mobile-list { display: block; }
.ranking-desktop-table { display: none; }

@media (min-width: 769px) {
  .ranking-mobile-list { display: none; }
  .ranking-desktop-table { display: block; }
}

.ranking-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.ranking-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ranking-pos {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--gray-light);
  color: var(--gray-dark);
  flex-shrink: 0;
}
.ranking-pos.pos-1 { background: #f1c40f; color: #553c00; }
.ranking-pos.pos-2 { background: #cfd8dc; color: #37474f; }
.ranking-pos.pos-3 { background: #e0a877; color: #5c3a1e; }
.ranking-name { font-weight: 700; font-size: 15px; color: var(--text); }
.ranking-card-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.ranking-card-stats .stat-item { text-align: center; min-width: 0; }
.stat-item label { display: block; font-size: 8.5px; color: var(--gray-dark); text-transform: uppercase; font-weight: 700; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-item span { font-family: 'Bebas Neue', sans-serif; font-size: 15px; color: var(--accent-text); }
.stat-item span.plus { color: var(--green); }
.stat-item span.minus { color: var(--clay); }

.ranking-desktop-table tbody tr:hover { background: var(--gray-light); }
td.player-name { font-weight: 700; }
td.wins-cell { font-family: 'Bebas Neue', sans-serif; font-size: 17px; color: var(--accent-text); }
td.stat-cell { color: var(--gray-dark); font-weight: 600; }
td.pos-1, td.pos-2, td.pos-3 { font-family: 'Bebas Neue', sans-serif; font-size: 17px; }
td.pos-1 { color: #b8930a; }
td.pos-2 { color: #78909c; }
td.pos-3 { color: #a9652e; }

/* ============================================================
   MATCH CARDS (Partidas / Histórico)
   ============================================================ */
.match-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.match-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 6px; }
.match-group-badge { font-size: 11px; font-weight: 700; color: var(--accent-text); background: var(--gray-light); padding: 4px 10px; border-radius: 20px; text-transform: uppercase; }
.match-date { font-size: 12px; color: var(--gray-dark); }
.match-players { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.match-player-item { flex: 1; font-weight: 600; font-size: 14px; padding: 8px 10px; border-radius: 8px; background: var(--gray-light); text-align: center; }
.match-player-item.match-winner { background: rgba(26,107,60,0.12); color: var(--accent-text); font-weight: 700; border: 1.5px solid var(--green-light); }
.match-vs { font-family: 'Bebas Neue', sans-serif; color: var(--gray-dark); font-size: 14px; }
.match-score-wrap { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.match-score { font-family: 'Bebas Neue', sans-serif; font-size: 20px; color: var(--accent-text); letter-spacing: 1px; }

/* ============================================================
   PLAYER / GROUP LIST ITEMS (painel admin)
   ============================================================ */
.player-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: var(--gray-light); border-radius: 8px; margin-bottom: 8px; gap: 10px; flex-wrap: wrap; }
.player-item-name { font-weight: 700; font-size: 14px; color: var(--text); margin-right: 8px; }
.player-item-group { font-size: 12px; color: var(--gray-dark); }

/* ============================================================
   ADMIN LAYOUT
   ============================================================ */
.admin-badge { font-weight: 700; letter-spacing: 0.5px; }

/* ============================================================
   MATCH FORM — placar / tie-break
   Tabela de placar: Set nas colunas, jogador nas linhas. Cada "linha"
   usa display:contents pra suas células caírem direto nas colunas do
   grid do container (permite nº de sets dinâmico sem JS calcular largura).
   ============================================================ */
.score-table { display: grid; grid-template-columns: auto repeat(var(--num-sets), 1fr); gap: 6px 8px; align-items: center; margin-bottom: 10px; }
.score-table-row { display: contents; }
.score-table-header .score-table-setlabel { font-size: 11px; font-weight: 700; color: var(--accent-text); text-align: center; }
.score-table-corner { min-width: 40px; }
.score-table-playerlabel { font-size: 12px; font-weight: 700; color: var(--accent-text); white-space: nowrap; padding-right: 4px; }
.score-table-cell { display: flex; }
.score-table-input { width: 100%; min-width: 40px; padding: 8px 4px; border: 2px solid var(--gray-light); border-radius: 8px; text-align: center; font-size: 14px; outline: none; background: var(--surface); color: var(--text); }
.score-table-input:focus { border-color: var(--green); }
.score-row { display: flex; align-items: center; gap: 8px; }
.score-row input { width: 60px; padding: 8px; border: 2px solid var(--gray-light); border-radius: 8px; text-align: center; font-size: 14px; outline: none; background: var(--surface); color: var(--text); }
.score-row input:focus { border-color: var(--green); }
.score-sep { color: var(--gray-dark); font-weight: 700; }
.checkbox-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.checkbox-row input { width: 16px; height: 16px; }
.tiebreak-fields { margin: 8px 0 16px; }
.error-msg { color: #c0392b; font-size: 13px; font-weight: 600; padding: 6px 0; }

@media (max-width: 768px) {
  .match-players { flex-direction: column; }
  .match-vs { transform: rotate(90deg); }
}

/* ============================================================
   MEU PAINEL — barra de filtros (+ Adicionar Jogo / Tipo / Modo / Adversário)
   ============================================================ */
.dash-filters-bar {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 20px;
}
.dash-filters-bar .form-group { margin-bottom: 0; min-width: 140px; flex: 1; }
.dash-filters-bar select,
.dash-filters-bar input[type="date"] {
  width: 100%; padding: 9px 10px; border: 2px solid var(--gray-light); border-radius: 8px; font-size: 13px; outline: none; background: var(--surface); color: var(--text);
}
.dash-filters-bar select:focus,
.dash-filters-bar input[type="date"]:focus { border-color: var(--green); }

@media (max-width: 700px) {
  .dash-filters-bar { flex-direction: column; align-items: stretch; }
  .dash-filters-bar .form-group { min-width: 100%; }
}

/* ============================================================
   RODAPÉ
   ============================================================ */
.site-footer {
  margin-top: 30px;
  padding: 16px 20px;
  text-align: center;
  font-size: 12px;
  color: var(--gray-dark);
  background: var(--gray-light);
  border-top: 1px solid var(--gray);
}

@media (max-width: 600px) {
  .site-footer { line-height: 1.6; }
  .site-footer br { display: none; }
}

/* ============================================================
   MURAL / AVISO DO ADMIN
   ============================================================ */
#announcementBanner {
  background: var(--clay);
  color: white;
  text-align: center;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  border-radius: var(--radius);
  margin-bottom: 16px;
}

/* ============================================================
   CONQUISTAS (Meu Painel)
   ============================================================ */
.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 14px;
}
.badge-item {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
  user-select: none;
}
.badge-icon { font-size: 30px; margin-bottom: 6px; }
.badge-item.locked .badge-icon { filter: grayscale(1); opacity: 0.4; }
.badge-item.unlocked { border: 2px solid var(--green-light); }
.badge-name { font-size: 11px; font-weight: 700; color: var(--text); line-height: 1.3; }
.badge-item.locked .badge-name { color: var(--gray-dark); }

/* position/left/top/width são calculados via JS (achievements.js) e presos aos
   limites da tela, porque a posição fixa via CSS (ex: sempre centralizado
   acima do badge) estourava a viewport pros badges das bordas do grid. */
.badge-tooltip {
  display: none;
  position: fixed;
  background: var(--green-dark);
  color: white;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12px;
  text-align: left;
  z-index: 500;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}
.badge-tooltip strong { display: block; font-size: 13px; margin-bottom: 4px; }
.badge-tooltip p { margin: 0 0 8px; line-height: 1.4; color: var(--gray-light); }
.badge-tooltip .badge-tooltip-status { display: block; font-weight: 700; font-size: 11px; }
.badge-item.tooltip-open .badge-tooltip { display: block; }

/* ============================================================
   HOME — menu de ícones (substitui a antiga barra de abas fixa)
   ============================================================ */
.icon-menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 16px;
}
/* .icon-menu-item reaproveita a classe .nav-tab (pro listener de clique
   genérico em app.js), mas precisa neutralizar/sobrescrever todo estilo de
   .nav-tab pensado pra antiga barra escura — daí o white-space e o color
   explícitos abaixo, inclusive no estado .active. */
.icon-menu-item {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  white-space: normal;
  font-weight: 700;
  font-size: 14px;
  color: var(--accent-text);
  cursor: pointer;
  border: 2px solid transparent;
  transition: 0.2s;
}
.icon-menu-item:hover { color: var(--accent-text); transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.12); }
.icon-menu-item.active { color: var(--accent-text); border-color: var(--green-light); background: rgba(26,107,60,0.06); }
.icon-menu-emoji { font-size: 36px; line-height: 1; }

/* Partidas/Histórico como quadradinhos ao lado do título "Ranking"
   (também usam .nav-tab, mesma ideia de .icon-menu-item: sobrescreve tudo
   que .nav-tab define pra barra escura antiga). */
.ranking-subnav { display: flex; gap: 8px; }
.ranking-subnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 56px;
  height: 56px;
  background: var(--surface);
  border-radius: 10px;
  box-shadow: var(--shadow);
  cursor: pointer;
  color: var(--accent-text);
  font-size: 10px;
  font-weight: 700;
  white-space: normal;
  border: 2px solid transparent;
  transition: 0.2s;
}
.ranking-subnav-item:hover { color: var(--accent-text); transform: translateY(-2px); }
.ranking-subnav-item.active { color: var(--accent-text); border-color: var(--green-light); background: rgba(26,107,60,0.06); }
.ranking-subnav-emoji { font-size: 20px; line-height: 1; }

/* Botão "Início" no header (agora só a logo — o atalho textual foi pra
   sidebar/bottom nav, ver .sidebar-nav-item[data-page="home"] e
   .bottom-nav-item[data-page="home"]) */
#homeLogoBtn { cursor: pointer; }

/* ============================================================
   RESERVAS DE QUADRA
   ============================================================ */

/* Puxar a tela pra baixo pra atualizar */
#page-courts,
.pull-refresh-page { position: relative; overflow: hidden; }
.pull-refresh-indicator {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-60px);
  color: var(--gray-dark);
  opacity: 0.5;
  pointer-events: none;
}
.pull-refresh-indicator.active { color: var(--green); opacity: 1; }
.pull-refresh-spinner,
.refresh-btn-icon { font-size: 1em; display: inline-block; }
.pull-refresh-indicator.spinning .pull-refresh-spinner,
#refreshCourtsBtn.spinning .refresh-btn-icon {
  animation: spin 0.8s linear infinite;
}
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Manhã/tarde no cadastro de quadra (modalCourt) */
.schedule-day-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-text);
  margin: 14px 0 8px;
  padding-top: 10px;
  border-top: 1px solid var(--gray-light);
}
.schedule-day-label:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.schedule-period-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.schedule-period-tag {
  flex: 0 0 46px;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-dark);
  text-transform: uppercase;
}
.schedule-period-row .form-grid-2 { flex: 1; margin-bottom: 0; }

.court-photo {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}
.court-photo-placeholder {
  display: flex; align-items: center; justify-content: center;
  height: 100px; font-size: 32px;
  background: var(--gray-light); color: var(--gray-dark);
}
.court-booking-card { padding: 20px; }

/* Nome da quadra selecionada + seletor de fotos lado a lado */
.court-name-heading {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  color: var(--accent-text);
  margin-bottom: 10px;
}
.court-photo-selector {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0 10px;
  margin-bottom: 16px;
}
.court-photo-selector-item {
  flex: 0 0 auto;
  width: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  opacity: 0.6;
  transition: 0.2s;
}
.court-photo-selector-item:hover { opacity: 0.85; }
.court-photo-selector-item.active { opacity: 1; }
.court-photo-selector-item img,
.court-photo-selector-placeholder {
  width: 100px; height: 75px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid transparent;
}
.court-photo-selector-item.active img,
.court-photo-selector-item.active .court-photo-selector-placeholder {
  border-color: var(--green);
}
.court-photo-selector-placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  background: var(--gray-light); color: var(--gray-dark);
}
.court-photo-selector-item span {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

/* No celular, encolhe pra caber ~5 quadras na tela sem precisar rolar. */
@media (max-width: 600px) {
  .court-photo-selector { gap: 6px; }
  .court-photo-selector-item { width: 60px; gap: 3px; }
  .court-photo-selector-item img,
  .court-photo-selector-placeholder { width: 60px; height: 45px; }
  .court-photo-selector-placeholder { font-size: 16px; }
  .court-photo-selector-item span { font-size: 9px; max-width: 60px; }
}

/* Mês/ano + faixa de datas arrastável */
.month-year-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  color: var(--accent-text);
  margin-bottom: 10px;
}
.date-strip-wrap {
  overflow-x: auto;
  cursor: grab;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
}
.date-strip-wrap:active { cursor: grabbing; }
.date-strip { display: flex; gap: 8px; }
.date-strip-item {
  flex: 0 0 auto;
  width: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border-radius: 10px;
  background: var(--gray-light);
  color: var(--gray-dark);
  cursor: pointer;
  user-select: none;
  transition: 0.2s;
}
.date-strip-item:hover { background: rgba(26,107,60,0.12); }
.date-strip-item.active { background: var(--green); color: white; }
.date-strip-dow { font-size: 10px; font-weight: 700; text-transform: uppercase; }
.date-strip-num { font-family: 'Bebas Neue', sans-serif; font-size: 20px; }

/* ============================================================
   COPA ONE — página pública (cronograma/resultados por data).
   Mais compacta que o resto do app: título colado na faixa de datas,
   botões de data menores, e os cards de partida com o nome dos
   jogadores sempre lado a lado (mesmo no mobile), pra caber na tela.
   ============================================================ */
.copa-public .section-header { margin-bottom: 8px; }
.copa-public .section-title { margin-bottom: 0; font-size: 22px; }
.copa-public-datecard { padding: 10px 12px 6px; }
.copa-public-datecard .date-strip-item { width: 40px; padding: 6px 2px; gap: 2px; }
.copa-public-datecard .date-strip-num { font-size: 15px; }
.copa-public-datecard .date-strip-dow { font-size: 9px; }
.copa-public-class-filter { margin-top: 8px; margin-bottom: 0; }
.copa-public-match .match-players { gap: 6px; margin-bottom: 8px; }
.copa-public-match .match-player-item { font-size: 12px; padding: 6px 4px; }
.copa-public-match .match-vs { font-size: 11px; }
@media (max-width: 768px) {
  .copa-public-match .match-players { flex-direction: row; }
  .copa-public-match .match-vs { transform: none; }
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.slot-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 6px;
  border-radius: 8px;
  border: 2px solid transparent;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: 0.2s;
}
.slot-time { font-family: 'Bebas Neue', sans-serif; font-size: 15px; letter-spacing: 0.3px; }
.slot-label { font-size: 9px; text-transform: uppercase; font-weight: 700; }
.slot-available { background: rgba(26,107,60,0.1); color: var(--accent-text); border-color: var(--green-light); }
.slot-available:hover { background: var(--green); color: white; }
.slot-selected.slot-available { background: var(--green); color: white; border-color: var(--green-dark); }
.slot-mine { background: var(--green); color: white; cursor: default; }
.slot-other { background: var(--gray-light); color: var(--gray-dark); cursor: not-allowed; }
.slot-blocked { background: rgba(196,98,45,0.12); color: var(--clay); cursor: not-allowed; }
.slot-past { background: var(--gray-light); color: var(--gray); cursor: not-allowed; opacity: 0.6; }

.court-card {
  display: flex;
  gap: 14px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 14px;
}
.court-card .court-photo,
.court-card .court-photo-placeholder { width: 120px; height: 90px; flex-shrink: 0; }
.court-card-body { flex: 1; min-width: 0; }
.court-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

@media (max-width: 600px) {
  .court-card { flex-direction: column; }
  .court-card .court-photo,
  .court-card .court-photo-placeholder { width: 100%; height: 140px; }
}

/* Seleção de dias da semana (bloqueio recorrente de horário) */
.days-of-week-row { display: flex; gap: 6px; flex-wrap: wrap; }
.day-checkbox {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-dark);
}
.day-checkbox input { width: 16px; height: 16px; }
.day-checkbox input:checked ~ span { color: var(--accent-text); }

@media (max-width: 480px) {
  .badge-grid { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
}

/* ============================================================
   JOGOS DO CICLO A SEREM REALIZADOS (Meu Painel)
   Compacto e com fundo branco, no mesmo espírito dos cards de
   Minhas Estatísticas (.stat-card-adv) — em vez do .player-item
   cinza usado nas listas do admin.
   ============================================================ */
.cycle-matchup-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 6px 12px;
  margin-bottom: 6px;
}
.cycle-matchup-name { font-size: 12px; font-weight: 700; color: var(--text); white-space: nowrap; }
.cycle-matchup-status { font-size: 12px; color: var(--gray-dark); }

/* ============================================================
   MURAL — feed público de conquistas / ciclos / campeões
   ============================================================ */
.mural-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-bottom: 14px;
  border-left: 5px solid var(--green);
}
.mural-card.mural-cycle { border-left-color: #f1c40f; }
.mural-card.mural-tournament { border-left-color: var(--clay); }
.mural-card-title { font-weight: 700; font-size: 15px; color: var(--text); }
.mural-card-date { font-size: 11px; color: var(--gray-dark); margin-top: 4px; }
.mural-cycle-groups { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.mural-cycle-group-title { font-size: 12px; font-weight: 700; color: var(--accent-text); text-transform: uppercase; }
.mural-cycle-podium { font-size: 13px; color: var(--text); margin-top: 2px; }

/* ============================================================
   MARCA "ADMIN" NOS ÍCONES DE GESTÃO DO CLUBE (Home)
   Os ícones de admin ficam no mesmo grid dos ícones do atleta (só
   escondidos por role em app.js/setupUI) — esse detalhe visual distingue
   os dois grupos sem depender da posição no grid, porque a ordem é
   reconfigurável pelo admin em Gerenciar Site > Visualização.
   ============================================================ */
.icon-menu-item-admin { border-top: 3px solid var(--clay); position: relative; }
.icon-menu-item-admin::after {
  content: 'ADMIN';
  position: absolute;
  top: 8px; right: 10px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--clay);
  opacity: 0.85;
}

/* ============================================================
   SIDEBAR (desktop, >=1024px) e BOTTOM NAV (<1024px)
   Navegação persistente adicional — os cliques reaproveitam o mesmo
   listener genérico de .nav-tab (ver app.js/setupEventListeners), e a
   visibilidade por papel reaproveita setNavVisible (mesmo data-page dos
   ícones da Home). A Home continua existindo como o menu completo.
   ============================================================ */
body { padding-bottom: 68px; }

.sidebar-nav { display: none; }

.bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.12);
  z-index: 90;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
}
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 2px;
  border-radius: 10px;
  color: var(--gray-dark);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  white-space: normal;
}
.bottom-nav-item.active { color: var(--accent-text); background: rgba(26,107,60,0.1); }
.bottom-nav-icon { font-size: 20px; line-height: 1; }

@media (min-width: 1024px) {
  body { padding-bottom: 0; }
  .bottom-nav { display: none; }

  .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: fixed;
    top: 70px;
    left: 0;
    bottom: 0;
    width: 230px;
    padding: 16px 12px;
    background: var(--surface);
    box-shadow: 2px 0 10px rgba(0,0,0,0.06);
    overflow-y: auto;
    z-index: 80;
  }
  #app-content { margin-left: 230px; }
  .site-footer { margin-left: 230px; }
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  white-space: normal;
}
.sidebar-nav-item:hover { background: var(--gray-light); }
.sidebar-nav-item.active { background: rgba(26,107,60,0.1); color: var(--accent-text); font-weight: 700; }
.sidebar-nav-icon { font-size: 18px; width: 22px; text-align: center; }
.sidebar-nav-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--gray-light);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-nav-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--gray-dark);
  padding: 0 12px 6px;
  letter-spacing: 0.5px;
}
