@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --bg-dark: #0f1419;
  --bg-card: #1a2329;
  --bg-elevated: #242d35;
  --accent: #2196f3;
  --accent-dim: #1976d2;
  --blue: #2196f3;
  --text: #e7e9ea;
  --text-muted: #8b98a5;
  --border: #38444d;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(0,0,0,0.3);
}

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

*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', -apple-system, sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* Nav */
.nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav .logo {
  justify-self: center;
  grid-column: 2;
}

.nav-links {
  justify-self: end;
}

.nav-toggle {
  justify-self: start;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--accent);
  text-decoration: none;
  background: transparent;
}

.logo-mark {
  width: 1.5rem;
  height: 1.5rem;
  object-fit: contain;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
  list-style: none;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.nav-links a span[aria-hidden="true"] {
  display: none;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  background: rgba(33, 150, 243, 0.1);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
}

@media (max-width: 600px) {
  .nav-toggle { display: block; }
  .nav-links a span[aria-hidden="true"] {
    display: inline;
  }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 50%;
    right: auto;
    width: 100vw;
    transform: translateX(-50%);
    flex-direction: column;
    background: var(--bg-card);
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) scaleY(0.92);
    transform-origin: top center;
    transition: opacity 0.28s ease, transform 0.42s ease, visibility 0.42s ease;
  }
  .nav-links.open {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scaleY(1);
  }
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.page-header {
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 600;
  text-align: center;
}

/* Hero */
.hero {
  text-align: center;
  padding: 4rem 1.5rem;
  max-width: 600px;
  margin: 0 auto;
}

.hero-logo {
  display: block;
  max-width: 160px;
  height: auto;
  margin: 0 auto 1.5rem;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.hero p {
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.hero p:last-of-type {
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.about-section {
  max-width: 760px;
  margin: 0 auto;
}

.about-page {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.about-avatar {
  width: 144px;
  height: 144px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--accent);
  display: block;
  margin: 0 auto 1.25rem;
}

.about-greeting {
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
}

.about-text {
  text-align: left;
  color: var(--text);
  margin-bottom: 1.75rem;
}

.about-text p {
  margin-bottom: 1rem;
  text-align: justify;
  text-justify: inter-word;
}

.about-social-line {
  display: block;
}

.about-social-links {
  display: grid;
  gap: 0.75rem;
  justify-content: start;
  margin-bottom: 1.5rem;
}

.about-social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  text-decoration: none;
  width: fit-content;
}

.about-social-link:hover {
  color: var(--text);
}

.about-social-link .footer-icon {
  color: var(--accent);
}

.about-social-link .footer-icon:hover {
  color: var(--accent-dim);
}

.about-privacy-title {
  text-align: left;
  font-size: 1.1rem;
  margin-top: 2.75rem;
  margin-bottom: 0.75rem;
}

.about-privacy-text {
  text-align: left;
  margin-bottom: 2rem;
  text-align: justify;
  text-justify: inter-word;
}

.about-copyright {
  text-align: right;
  color: var(--text-muted);
}

.mensalistas-list {
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.mensalistas-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text);
}

.mensalista-name {
  font-weight: 500;
}

.mensalista-icons {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.mensalista-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.34rem 0.62rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(33, 150, 243, 0.08);
  color: var(--accent);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.mensalista-action-btn:hover {
  background: rgba(33, 150, 243, 0.16);
  border-color: var(--accent);
  color: var(--accent);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.2s;
  -webkit-tap-highlight-color: rgba(33, 150, 243, 0.2);
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-dark);
}

.btn-primary:hover {
  background: var(--accent-dim);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.875rem;
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  position: relative;
  overflow: visible;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.info-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  align-self: center;
  z-index: 30;
}

.info-tooltip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.info-tooltip-trigger:hover,
.info-tooltip-trigger:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.info-tooltip-bubble {
  position: fixed;
  left: var(--tooltip-x, 1rem);
  top: var(--tooltip-y, 1rem);
  width: min(320px, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.4;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 20;
}

.info-tooltip-bubble::after {
  content: '';
  position: absolute;
  top: var(--tooltip-arrow-top, 0.85rem);
  right: 100%;
  transform: none;
  border-width: 6px;
  border-style: solid;
  border-color: transparent var(--bg-elevated) transparent transparent;
}

.info-tooltip.is-open .info-tooltip-bubble,
.info-tooltip:hover .info-tooltip-bubble,
.info-tooltip:focus-within .info-tooltip-bubble {
  opacity: 1;
  visibility: visible;
}

/* Filters */
.filters-section {
  margin-bottom: 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: visible;
}

.filters-toggle {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  border-radius: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}

.filters-toggle:hover {
  background: rgba(255, 255, 255, 0.03);
}

.filters-toggle-text {
  flex-shrink: 0;
}

.filters-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: nowrap;
  white-space: nowrap;
  padding: 0.2rem 0.4rem;
  background: var(--accent);
  color: var(--bg-dark);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.filters-badge-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  background: var(--text-muted);
  color: var(--bg-dark);
  border: none;
  border-radius: 50%;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.9;
}

.filters-badge-clear:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.filters-badge-clear:hover {
  opacity: 1;
  background: var(--text);
}

.filters-toggle-icon {
  font-size: 0.75rem;
  transition: transform 0.2s;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: auto;
}

.filters-section.open .filters-toggle-icon {
  transform: rotate(180deg);
}

.filters-content {
  display: none;
  padding: 1rem 1rem 1rem;
  border-top: 1px solid var(--border);
}

.filters-section.open .filters-content {
  display: block;
}

/* Métricas - seção expansível */
.metric-expand-section {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  overflow: visible;
}

.metric-expand-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.5rem 0;
  background: transparent;
  border: none;
  color: var(--accent);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}

.metric-expand-toggle:hover {
  color: var(--accent-dim);
}

.metric-expand-icon {
  font-size: 0.7rem;
  transition: transform 0.2s;
  color: var(--text-muted);
}

.metric-expand-section.open .metric-expand-icon {
  transform: rotate(180deg);
}

.metric-expand-content {
  padding-top: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease, padding-top 0.3s ease;
}

.metric-expand-section.open .metric-expand-content {
  padding-top: 0.5rem;
  max-height: 600px;
  opacity: 1;
}

#artilhariaExpandSection.open .metric-expand-content,
#comparecimentoExpandSection.open .metric-expand-content,
#aproveitamentoExpandSection.open .metric-expand-content {
  max-height: none;
  overflow: visible;
}

#artilhariaCard.artilharia-expanded #artilhariaPreviewWrap {
  display: none;
}

#comparecimentoCard.comparecimento-expanded #comparecimentoPreviewWrap {
  display: none;
}

#aproveitamentoCard.aproveitamento-expanded #aproveitamentoPreviewWrap {
  display: none;
}

#goleirosCard.goleiros-expanded #goleirosPreviewWrap {
  display: none;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0;
}

.filters input,
.filters select {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

.filters input[type="number"] {
  width: 90px;
}

.filter-date-wrap {
  position: relative;
  display: inline-flex;
}

/* Placeholder customizado: substitui dd/mm/yyyy truncado do Chrome e falta no Safari */
.filter-date-placeholder {
  position: absolute;
  left: 1px;
  top: 1px;
  right: 2.5rem;
  bottom: 1px;
  display: flex;
  align-items: center;
  padding-left: 1rem;
  pointer-events: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-family: inherit;
  line-height: 1;
  white-space: nowrap;
  background: var(--bg-elevated);
  border-radius: calc(var(--radius-sm) - 1px);
}
.filter-date-wrap.has-value .filter-date-placeholder {
  display: none;
}

.filter-date-wrap input {
  padding-right: 2.25rem;
}

.filter-date-wrap.has-value input {
  padding-right: 3rem;
}

.filter-date-calendar-icon {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  pointer-events: none;
  opacity: 0.9;
}
.filter-date-wrap.has-value .filter-date-calendar-icon {
  display: none;
}

/* Calendário customizado - só preenche ao clicar na data */
.filter-date-picker {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 0.25rem;
  width: 280px;
  padding: 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 100;
}
.filter-date-picker.is-open {
  display: block;
}
.filter-date-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.filter-date-picker-nav {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  font-size: 1.1rem;
  line-height: 1;
  border-radius: var(--radius-sm);
}
.filter-date-picker-nav:hover {
  background: rgba(255, 255, 255, 0.08);
}
.filter-date-picker-title {
  font-size: 0.95rem;
  font-weight: 500;
}
.filter-date-picker-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 0.25rem;
}
.filter-date-picker-weekday {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.filter-date-picker-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.filter-date-picker-day {
  aspect-ratio: 1;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.filter-date-picker-day:hover {
  background: var(--accent);
  color: var(--bg-dark);
}
.filter-date-picker-day.other-month {
  color: var(--text-muted);
  opacity: 0.6;
}
.filter-date-picker-day.today {
  font-weight: 600;
  color: var(--accent);
}

.filter-date-clear {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  background: var(--text-muted);
  color: var(--bg-dark);
  border: none;
  border-radius: 50%;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
}

.filter-date-clear:hover {
  opacity: 1;
  background: var(--text);
}

.filter-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  align-self: center;
}

.filter-tipo-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-tipo-toggle {
  display: inline-flex;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.filter-tipo-btn {
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  font-family: inherit;
  background: transparent;
  color: var(--text);
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.filter-tipo-btn:first-child {
  border-right: 1px solid var(--border);
}

.filter-tipo-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.filter-tipo-btn.active {
  background: var(--accent);
  color: var(--bg-dark);
}

.filter-tipo-toggle.is-disabled {
  opacity: 0.7;
  pointer-events: none;
  cursor: not-allowed;
}

.games-count,
.players-count {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

.players-view-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.view-toggle {
  display: inline-flex;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.view-toggle-btn {
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  font-family: inherit;
  background: transparent;
  color: var(--text);
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.view-toggle-btn:first-child {
  border-right: 1px solid var(--border);
}

.view-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.view-toggle-btn.active {
  background: var(--accent);
  color: var(--bg-dark);
}

.players-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 1200px) {
  .players-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .players-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.player-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.player-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.player-card-name {
  font-weight: 600;
  font-size: 1.08rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.player-card-badge {
  font-size: 0.52rem;
  font-weight: 500;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-tipo-mensalista {
  background: rgba(76, 175, 80, 0.25);
  color: #81c784;
  border: 1px solid rgba(76, 175, 80, 0.4);
}

.badge-tipo-convidado {
  background: rgba(255, 193, 7, 0.2);
  color: #ffca28;
  border: 1px solid rgba(255, 193, 7, 0.4);
}

.player-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.player-card-stat {
  display: flex;
  flex-direction: column;
}

.player-card-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.player-card-stat-value {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.95rem;
}

.player-card-actions {
  flex-shrink: 0;
}

.comparacao-table th:first-child,
.comparacao-table td:first-child {
  font-weight: 500;
  color: var(--text-muted);
  min-width: 120px;
  width: 120px;
  position: sticky;
  left: 0;
  z-index: 4;
  background: var(--bg-dark);
  border-right: 1px solid var(--border);
  overflow: visible;
}

.comparacao-table th:first-child::before,
.comparacao-table td:first-child::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  right: 100%;
  width: 24px;
  background: var(--bg-dark);
  pointer-events: none;
}

.comparacao-table th:first-child::after,
.comparacao-table td:first-child::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 100%;
  width: 8px;
  background: var(--bg-dark);
  pointer-events: none;
}

.comparacao-table thead th:first-child {
  background: var(--bg-card);
  z-index: 5;
}

.comparacao-table thead th:first-child::before,
.comparacao-table thead th:first-child::after {
  background: var(--bg-card);
}

.comparacao-table tbody tr:hover td:first-child {
  background: #121a22;
}

.comparacao-table tbody tr:hover td:first-child::before,
.comparacao-table tbody tr:hover td:first-child::after {
  background: #121a22;
}

.comparacao-table th {
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comparacao-player-header {
  cursor: pointer;
  user-select: none;
}

.comparacao-player-header:hover {
  color: var(--accent);
}

.comparacao-click-hint {
  font-size: 0.75em;
  opacity: 0.7;
  margin-left: 0.2rem;
}

.comparacao-player-header:hover .comparacao-click-hint {
  opacity: 1;
}

.comparacao-cell-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.comp-icon {
  font-size: 0.85em;
  font-weight: bold;
  flex-shrink: 0;
}

.comparacao-table th.comparacao-ref-col,
.comparacao-table td.comparacao-ref-col {
  background: #152736;
  min-width: 130px;
  width: 130px;
  position: sticky;
  left: 128px;
  z-index: 3;
  overflow: visible;
}

.comparacao-table th.comparacao-ref-col::before,
.comparacao-table td.comparacao-ref-col::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  right: 100%;
  width: 8px;
  background: #152736;
  pointer-events: none;
}

.comparacao-table th.comparacao-ref-col::after,
.comparacao-table td.comparacao-ref-col::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 100%;
  width: 8px;
  background: #152736;
  pointer-events: none;
}

.comparacao-table thead th.comparacao-ref-col {
  background: #182d42;
  z-index: 4;
}

.comparacao-table thead th.comparacao-ref-col::before,
.comparacao-table thead th.comparacao-ref-col::after {
  background: #182d42;
}

.comparacao-table tbody tr:hover td.comparacao-ref-col {
  background: #1a3350;
}

.comparacao-table tbody tr:hover td.comparacao-ref-col::before,
.comparacao-table tbody tr:hover td.comparacao-ref-col::after {
  background: #1a3350;
}

.comp-icon.comp-up {
  color: #4caf50;
}

.comp-icon.comp-down {
  color: #f44336;
}

.comp-icon.comp-equal {
  color: #888;
}

.comp-icon.comp-ref {
  color: rgba(255, 255, 255, 0.7);
}

.filters input:focus,
.filters select:focus {
  outline: none;
  border-color: var(--accent);
}

.filter-jogador-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 200px;
}

.filter-jogador-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.5rem;
  background: var(--accent);
  color: var(--bg-dark);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
}

.filter-chip-remove {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 0.1rem;
  opacity: 0.8;
}

.filter-chip-remove:hover {
  opacity: 1;
}

.filter-jogador-input-wrap {
  flex: 1;
  min-width: 140px;
  position: relative;
  cursor: text;
}
.filter-jogador-input-wrap input {
  width: 100%;
  box-sizing: border-box;
}
.filter-jogador-dropdown {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 0.25rem;
  max-height: 200px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.filter-jogador-dropdown.is-open {
  display: block;
}
.filter-jogador-option {
  padding: 0.5rem 1rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.filter-jogador-option-label {
  min-width: 0;
  flex: 1;
}
.filter-jogador-option-check {
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}
.filter-jogador-option:hover,
.filter-jogador-option:focus {
  background: var(--accent);
  color: var(--bg-dark);
}
.filter-jogador-option.is-selected {
  color: var(--text-muted);
  background: rgba(33, 150, 243, 0.08);
  cursor: default;
}
.filter-jogador-option.is-selected:hover,
.filter-jogador-option.is-selected:focus {
  background: rgba(33, 150, 243, 0.08);
  color: var(--text-muted);
}

.filter-jogador-error {
  font-size: 0.8rem;
  color: #c62828;
  margin-top: 0.25rem;
  width: 100%;
}

.filter-column-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 200px;
}

.filter-column-wrap .filter-column-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.filter-column-wrap input {
  flex: 1;
  min-width: 140px;
}

.filter-column-error {
  font-size: 0.8rem;
  color: #c62828;
  margin-top: 0.25rem;
  width: 100%;
}

/* Game card - estilo similar ao layout da imagem (modo escuro) */
.game-card {
  padding: 1.25rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}

.game-card:hover {
  border-color: rgba(33, 150, 243, 0.3);
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.game-date {
  font-weight: 500;
}

.game-date-emoji {
  margin-right: 0.4em;
}

.game-winner-label {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: capitalize;
  color: #fff;
}

.game-winner-label.winner-badge-preto {
  background: #2d2d2d;
}

.game-winner-label.winner-badge-azul {
  background: #1976d2;
}

.game-winner-label.winner-badge-empate {
  background: #6d6d6d;
  color: #fff;
}

.game-winner-label.winner-badge-cancelado {
  background: #c62828;
  color: #fff;
}

.game-main {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.game-side {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.game-preto {
  flex-direction: row;
  justify-content: flex-end;
  text-align: right;
}

.game-azul {
  flex-direction: row;
  justify-content: flex-start;
  text-align: left;
}

.game-preto .game-team {
  align-items: flex-end;
}

.game-azul .game-team {
  align-items: flex-start;
}

.game-team {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.game-emoji {
  font-size: 1.75rem;
  line-height: 1;
}

.game-team-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.game-score-num {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
}

.game-sep {
  font-size: 1.25rem;
  color: var(--text-muted);
  font-weight: 400;
  text-align: center;
}

.game-lineup {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.game-lineup-side {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.game-lineup-side.game-lineup-preto {
  align-items: flex-end;
  text-align: right;
}

.game-lineup-side.game-lineup-azul {
  align-items: flex-start;
  text-align: left;
}

.game-lineup-side.game-lineup-winner .game-lineup-title,
.game-lineup-side.game-lineup-winner .game-lineup-name {
  color: #2e7d32;
}

.game-lineup-side.game-lineup-loser .game-lineup-title,
.game-lineup-side.game-lineup-loser .game-lineup-name {
  color: #c62828;
}

.game-lineup-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.game-lineup-player {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--text);
}

.game-lineup-azul .game-lineup-player {
  justify-content: flex-start;
}

.game-lineup-player.game-lineup-player-highlight-winner {
  background: rgba(46, 125, 50, 0.25);
  border: 1px solid rgba(46, 125, 50, 0.6);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  margin: 0 -0.5rem;
}

.game-lineup-player.game-lineup-player-highlight-loser {
  background: rgba(198, 40, 40, 0.2);
  border: 1px solid rgba(198, 40, 40, 0.5);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  margin: 0 -0.5rem;
}

.game-lineup-player.game-lineup-player-highlight-empate {
  background: rgba(109, 109, 109, 0.25);
  border: 1px solid rgba(109, 109, 109, 0.5);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  margin: 0 -0.5rem;
}

.game-lineup-gols {
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

/* Jogo cancelado - vermelho esbranquiçado */
.game-card.canceled {
  background: rgba(255, 235, 235, 0.25);
  border-color: rgba(200, 80, 80, 0.6);
}

.game-card.canceled:hover {
  border-color: rgba(220, 100, 100, 0.6);
}

.game-card.canceled .game-score-num { opacity: 0.6; }

@media (max-width: 600px) {
  .game-main {
    gap: 0.5rem;
  }

  .game-side {
    min-width: 0;
  }

  .game-score-num {
    font-size: 1.5rem;
  }

}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin-top: 0.5rem;
}

#playersComparacao.table-wrap {
  background: var(--bg-dark);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.85rem;
}

tr:hover td { background: rgba(255,255,255,0.02); }

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stats-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.stats-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.stat-box {
  background: var(--bg-elevated);
  padding: 1rem;
  border-radius: var(--radius-sm);
  text-align: center;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-pct {
  font-size: 0.75rem;
  font-weight: 500;
  color: #2196f3;
  margin-top: 0.15rem;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Charts */
.chart-container {
  position: relative;
  height: 250px;
  margin: 1rem 0;
}

/* Loading & Error */
.loading, .error {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

.error { color: #f44336; }

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Refresh btn */
.refresh-btn {
  margin-left: auto;
}

/* ========== Mobile / Responsivo ========== */
@media (max-width: 600px) {
  html {
    font-size: 15px;
  }

  .container {
    padding: 1rem;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .nav {
    padding: 0.75rem 1rem;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .nav-toggle {
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem;
  }

  .page-title {
    font-size: 1.4rem;
  }

  .hero {
    padding: 2rem 1rem;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }

  /* Filtros - empilhar em coluna no mobile */
  .filters {
    flex-direction: column;
    gap: 0.75rem;
  }

  .filters input,
  .filters select {
    width: 100%;
    min-height: 44px;
    font-size: 16px; /* Evita zoom no iOS ao focar */
  }

  .filter-label {
    width: 100%;
  }

  .filter-tipo-wrap {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
  }

  .filter-tipo-toggle {
    width: 100%;
    display: flex;
  }

  .filter-tipo-btn {
    flex: 1;
    min-height: 44px;
  }

  .filter-jogador-wrap {
    width: 100%;
    min-width: 0;
    flex-direction: column;
    align-items: stretch;
  }

  .filter-jogador-input-wrap {
    min-width: 0;
    width: 100%;
  }
  .filter-jogador-input-wrap input {
    min-height: 44px;
    font-size: 16px; /* Evita zoom no iOS ao focar */
  }

  .filters .btn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }

  /* View toggle - ocupa a linha toda no celular */
  .view-toggle {
    width: 100%;
    display: flex;
  }
  .view-toggle-btn {
    flex: 1;
    min-height: 44px;
  }

  .players-cards {
    grid-template-columns: 1fr;
  }

  /* Game cards mobile */
  .game-card {
    padding: 1rem;
    margin-bottom: 0.75rem;
  }

  .game-header {
    flex-wrap: nowrap;
    gap: 0.5rem;
    font-size: 0.8rem;
  }

  .game-winner-label {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .game-main {
    gap: 0.5rem;
  }

  .game-side {
    min-width: 0;
  }

  .game-score-num {
    font-size: 1.5rem;
  }

  .game-emoji {
    font-size: 1.5rem;
  }

  .game-lineup {
    gap: 0.75rem;
    padding-top: 1rem;
  }

  .game-lineup-player {
    font-size: 0.85rem;
  }

  /* Tables - scroll horizontal */
  .table-wrap {
    margin: 0 -1rem;
    padding: 0 1rem;
  }

  table {
    font-size: 0.85rem;
  }

  th, td {
    padding: 0.5rem 0.6rem;
    white-space: nowrap;
  }

  /* Stats grid - 2 colunas em telas pequenas */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .stats-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .stat-box {
    padding: 0.75rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .stat-label {
    font-size: 0.75rem;
  }

  /* Charts */
  .chart-container {
    height: 220px;
  }

  /* Cards */
  .card {
    padding: 1rem;
  }

  .card-title {
    font-size: 0.95rem;
  }

  /* Chips e botões - área de toque maior */
  .filter-chip {
    padding: 0.4rem 0.6rem;
    min-height: 32px;
  }

  .filter-chip-remove {
    min-width: 28px;
    min-height: 28px;
  }

  .btn-sm {
    min-height: 44px;
  }
}

/* Extra pequeno (< 400px) */
@media (max-width: 400px) {
  .game-lineup-side {
    gap: 0.25rem;
  }

  .game-lineup-title {
    font-size: 0.7rem;
  }

  .stats-grid {
    gap: 0.5rem;
  }

  .stat-value {
    font-size: 1.25rem;
  }
}

/* Footer */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem 1rem;
  margin-top: 2rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-muted);
}
.site-footer span {
  color: var(--text);
}
.footer-about-link {
  cursor: pointer;
}
.site-footer .footer-icon {
  color: var(--accent);
  transition: color 0.2s;
}
.site-footer .footer-icon:hover {
  color: var(--accent-dim);
}

/* Touch - remover highlight azul em dispositivos touch */
@media (hover: none) {
  .btn:active,
  .nav-links a:active,
  .filter-chip:active {
    opacity: 0.9;
  }
}

/* Safe area para iPhone com notch */
@supports (padding: env(safe-area-inset-bottom)) {
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }
}
