/* ==================== VARIÁVEIS CSS ==================== */
:root {
  /* Cores primárias - paleta modernizada */
  --color-primary: #0f172a;
  --color-primary-dark: #0b1220;
  --color-primary-light: #2563eb;
  --color-secondary: #f97316;

  /* Gradientes */
  --gradient-primary: linear-gradient(135deg, #0b1220, #0f172a, #2563eb);
  --gradient-primary-reverse: linear-gradient(135deg, #2563eb, #0f172a);
  --gradient-accent: linear-gradient(135deg, #f97316, #f59e0b);

  /* Cores de estado */
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #0ea5e9;

  /* Cores neutras */
  --color-text: #0f172a;
  --color-text-muted: #475569;
  --color-border: #e2e8f0;
  --color-bg-light: #f8fafc;

  /* Sombras */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

  /* Transições */
  --transition-default: all 0.3s ease;
}

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

/* Transições globais suaves */
html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  font-family:
    "Inter",
    "Segoe UI",
    "SF Pro Display",
    system-ui,
    -apple-system,
    sans-serif;
  background:
    radial-gradient(
      circle at 20% 20%,
      rgba(37, 99, 235, 0.14),
      transparent 25%
    ),
    radial-gradient(
      circle at 80% 10%,
      rgba(249, 115, 22, 0.14),
      transparent 25%
    ),
    linear-gradient(135deg, #0b1220 0%, #0f172a 45%, #111827 100%);
  min-height: 100vh;
  padding: 20px 20px 0;
  overflow-x: hidden;
  max-width: 100vw;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1400px;
  margin: 0 auto 28px;
  width: 100%;
  flex: 1 0 auto;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(10px);
}

.header {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 2px solid #2a5298;
  position: relative;
}

.header h1 {
  color: #333;
  font-size: 2.5em;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #1e3c72, #2a5298);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header p {
  color: #666;
  font-size: 1.1em;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  margin-bottom: 30px;
  max-width: 100%;
  overflow-x: hidden;
}

.quick-filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 5px;
  /* Firefox scrollbar styling */
  scrollbar-width: thin;
  scrollbar-color: #2a5298 #f1f1f1;
}

/* WebKit scrollbar styling (Chrome, Safari, Edge) */
.quick-filters::-webkit-scrollbar {
  height: 8px;
}

.quick-filters::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.quick-filters::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #1e3c72, #2a5298);
  border-radius: 4px;
}

.quick-filters::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #2a5298, #1e3c72);
}

.filter-btn {
  padding: 6px 12px;
  flex-shrink: 0;
  border: 2px solid #2a5298;
  background: white;
  color: #2a5298;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 0.8em;
  height: fit-content;
}

.filter-btn:hover {
  background: linear-gradient(135deg, #1e3c72, #2a5298);
  color: white;
}

.filter-btn:focus-visible {
  outline: 3px solid #2a5298;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(42, 82, 152, 0.2);
}

.card {
  background: white;
  border-radius: 6px;
  padding: 25px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  border: 1px solid rgba(42, 82, 152, 0.1);
}

/* Card discreto para a Liguinha de Manutenção */
#secondaryBracketCard {
  background: #f9fafb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid #e5e7eb;
}

.card-title {
  font-size: 1.3em;
  color: #333;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title::before {
  content: "";
  width: 4px;
  height: 25px;
  background: linear-gradient(135deg, #1e3c72, #2a5298);
  border-radius: 2px;
}

.chart-wrapper {
  position: relative;
  margin-top: 20px;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Estilo para botão colapsável */
/* Ícone de tooltip informativo */
.tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e0e7ff;
  color: #4f46e5;
  font-size: 0.75em;
  font-weight: 700;
  cursor: help;
  margin-left: 6px;
  transition: all 0.2s ease;
}

.tooltip-icon:hover {
  background: #4f46e5;
  color: white;
  transform: scale(1.1);
}

.collapse-btn {
  margin-left: auto;
  background: linear-gradient(135deg, #e0e7ff, #f0f4ff);
  border: 2px solid #c7d2fe;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
  flex-shrink: 0;
}

.collapse-btn:hover {
  background: linear-gradient(135deg, #c7d2fe, #e0e7ff);
  border-color: #a5b4fc;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.collapse-btn:active {
  transform: scale(0.95);
}

.collapse-btn:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}

.collapse-icon {
  width: 20px;
  height: 20px;
  color: #4f46e5;
  transition: transform 0.3s ease;
}

.collapse-btn[aria-expanded="true"] .collapse-icon {
  transform: rotate(180deg);
}

/* Conteúdo colapsável */
.chart-content {
  max-height: 1100px;
  overflow: visible;
  transition:
    max-height 0.4s ease,
    opacity 0.4s ease;
  opacity: 1;
}

.chart-content.collapsed {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0;
  border: none;
}

.chart-container {
  position: relative;
  margin-top: 10px;
  margin-bottom: 20px;
  padding-left: 30px;
  padding-top: 20px;
  overflow: visible;
  height: clamp(360px, 60vh, 640px);
}

#eloChart {
  height: 100%;
  width: 100%;
}

/* Tooltip do ApexCharts */
.apexcharts-tooltip {
  position: absolute !important;
  z-index: 9999 !important;
  max-width: 400px;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.zoom-controls {
  position: static;
  display: flex;
  gap: 8px;
}

.zoom-btn {
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #2a5298;
  border-radius: 4px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
  color: #2a5298;
}

.zoom-btn:hover {
  background: #2a5298;
  color: white;
  transform: scale(1.05);
}

.zoom-btn.active {
  background: #2a5298;
  color: white;
}

.zoom-btn:focus-visible {
  outline: 3px solid #667eea;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
}

.team-selector {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-top: 10px;
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 0 0 auto;
}

/* Scrollbar personalizada para o seletor */
.team-selector::-webkit-scrollbar {
  width: 6px;
}

.team-selector::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.team-selector::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #c7d2fe, #e0e7ff);
  border-radius: 3px;
}

.team-selector::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #a5b4fc, #c7d2fe);
}

/* Estilos para seletor de equipas com colapsáveis por divisão */
.team-division-group {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: white;
  overflow: visible;
  margin-bottom: 8px;
}

.team-division-header {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 10px;
  background: linear-gradient(135deg, #f0f4ff 0%, #f8fafc 100%);
  border-bottom: 1px solid #e2e8f0;
  transition:
    background 0.2s ease,
    box-shadow 0.2s ease;
  user-select: none;
}

.team-division-header:hover {
  background: linear-gradient(135deg, #e0e7ff 0%, #f0f4ff 100%);
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.1);
}

.team-division-title {
  font-weight: 600;
  color: #1e293b;
  font-size: 0.85em;
}

.team-division-chevron {
  display: inline-block;
  width: 14px;
  text-align: center;
  color: #4f46e5;
  font-size: 0.7em;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.team-groups-container {
  padding: 8px 8px 12px 8px;
  display: block;
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.35s ease,
    padding 0.35s ease;
}

.team-groups-container[data-state="expanded"] {
  max-height: none !important;
  overflow: visible !important;
}

.team-group {
  margin-bottom: 8px;
}

.team-group:last-child {
  margin-bottom: 0;
}

.team-group-header {
  font-size: 0.7em;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 6px;
}

.team-group-teams {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  padding-left: 0;
}

.team-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #e9ecef;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
  pointer-events: all;
  backdrop-filter: blur(5px);
  font-size: 0.75em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  min-height: 26px;
  white-space: nowrap;
  flex-shrink: 0;
  margin: 1px;
}

.team-checkbox:hover {
  border-color: #2a5298;
  transform: translateY(-2px) scale(1.05);
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.team-checkbox.active {
  background: rgba(42, 82, 152, 0.95);
  color: white;
  border-color: transparent;
  font-weight: 500;
}

.team-checkbox.active:hover {
  background: rgba(42, 82, 152, 1);
}

.team-checkbox input {
  display: none;
}

.team-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.team-emblem {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  flex-shrink: 0;
  object-fit: contain;
  padding: 2px;
  box-sizing: border-box;
}

.team-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Layouts adaptativos para diferentes números de equipas */
.team-selector.many-teams .team-checkbox {
  font-size: 0.8em;
  padding: 4px 8px;
  min-height: 26px;
}

.team-selector.many-teams .team-dot {
  width: 10px;
  height: 10px;
}

/* Controles de seleção rápida */
.quick-selection-controls {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 8px;
}

.quick-control-btn {
  padding: 6px 12px;
  border: 2px solid #2a5298;
  background: white;
  color: #2a5298;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.8em;
  font-weight: 500;
}

.quick-control-btn:hover {
  background: #2a5298;
  color: white;
  transform: translateY(-2px);
}

.quick-control-btn:focus-visible {
  outline: 3px solid #2a5298;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(42, 82, 152, 0.2);
}

.team-count-indicator {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 15;
  color: white;
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 0.85em;
  font-weight: 500;
  display: inline-block;
  transition: all 0.3s ease;
}

.team-count-indicator--header {
  position: static;
}

.season-nav-btn {
  color: white;
  padding: 6px 16px;
  border-radius: 15px;
  font-size: 0.85em;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  pointer-events: auto;
  background: rgba(102, 126, 234, 0.9);
}

.season-nav-btn--prev,
.season-nav-btn--next {
  box-shadow: 0 4px 12px rgba(42, 82, 152, 0.4);
}

.season-nav-btn--next {
  margin-left: auto;
}

.season-nav-btn:hover {
  transform: scale(1.05);
}

.season-nav-btn:active {
  transform: scale(0.98);
}

.season-nav-btn--prev:hover,
.season-nav-btn--next:hover {
  background: rgba(102, 126, 234, 1);
  box-shadow: 0 6px 16px rgba(42, 82, 152, 0.6);
}

/* Labels dinâmicos posicionados no final das linhas */
.team-end-labels {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 5;
}

.team-end-label {
  position: absolute;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.75em;
  font-weight: 500;
  white-space: nowrap;
  backdrop-filter: blur(5px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-50%);
  transition: all 0.3s ease;
  display: none;
  z-index: 10;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-end-label.visible {
  display: block;
}

.team-end-label.group-label {
  background: rgba(255, 255, 255, 0.98);
  font-weight: 600;
  border-width: 3px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
  max-width: 200px;
}

.team-end-label:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-50%) scale(1.05);
  z-index: 20;
  max-width: none;
  overflow: visible;
}

.previous-season-btn {
  position: absolute;
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 0.85em;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(42, 82, 152, 0.4);
  transition: all 0.3s ease;
  z-index: 1000;
  white-space: nowrap;
  pointer-events: auto;
}

#chartjs-tooltip {
  position: absolute;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  border: 2px solid #2a5298;
  border-radius: 4px;
  padding: 12px;
  pointer-events: none;
  transition: all 0.1s ease;
  z-index: 9999;
  font-size: 0.9em;
  line-height: 1.5;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#chartjs-tooltip .tooltip-title {
  font-weight: 600;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

#chartjs-tooltip .tooltip-body {
  margin: 6px 0;
}

#chartjs-tooltip .tooltip-body div {
  margin: 4px 0;
}

#chartjs-tooltip .tooltip-footer {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  color: #ccc;
  font-size: 0.9em;
}

.next-season-btn {
  position: absolute;
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 0.85em;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  transition: all 0.3s ease;
  z-index: 1000;
  white-space: nowrap;
  pointer-events: auto;
}

.season-nav-btn:hover {
  transform: scale(1.05);
}

.season-nav-btn:active {
  transform: scale(0.98);
}

.previous-season-btn:hover {
  box-shadow: 0 6px 16px rgba(42, 82, 152, 0.6);
  background: linear-gradient(135deg, #2a5298 0%, #1e3c72 100%);
}

.next-season-btn:hover {
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.6);
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
}

.previous-season-btn:focus-visible,
.next-season-btn:focus-visible {
  outline: 3px solid #2a5298;
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(42, 82, 152, 0.25);
}

.rankings-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 0.9em;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  overflow: hidden;
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.rankings-table th {
  padding: 4px 4px;
}
.rankings-table td {
  padding: 0px 4px;
  text-align: center;
  height: auto;
  min-height: 46px;
  box-sizing: border-box;
  margin: 0;
  position: relative;
  vertical-align: middle;
}

.rankings-table th:nth-child(2),
.rankings-table td:nth-child(2) {
  text-align: left;
  white-space: nowrap;
  height: auto;
  min-height: 46px;
  box-sizing: border-box;
  position: relative;
  padding: 0;
  vertical-align: middle;
}

.rankings-table th:nth-child(2) {
  text-align: center;
  padding: 1px 4px;
}

.rankings-table tbody tr:last-child td {
  border-bottom: none;
  padding-bottom: 3px;
}

.rankings-table th {
  background: linear-gradient(135deg, #1e3c72, #2a5298);
  color: white;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.9em;
}

.rankings-table th:first-child {
  border-top-left-radius: 10px;
}

.rankings-table th:last-child {
  border-top-right-radius: 10px;
}

.rankings-table tr:hover {
  background: rgba(42, 82, 152, 0.08);
  cursor: pointer;
}

/* Zonas de progressão com fundo subtil */
.rankings-table tbody tr.zone-playoff {
  background: rgba(34, 197, 94, 0.03);
}

.rankings-table tbody tr.zone-safe {
  background: rgba(59, 130, 246, 0.03);
}

.rankings-table tbody tr.zone-relegation {
  background: rgba(239, 68, 68, 0.03);
}

/* Separadores entre zonas */
.rankings-table tbody tr.zone-separator td {
  border-top: 2px solid rgba(42, 82, 152, 0.3) !important;
  padding-top: 15px;
  padding-bottom: 15px;
}

.sparkline-cell {
  min-width: 100px;
  line-height: 1.2;
  padding: 2px 4px;
}

.sparkline {
  width: 90px;
  height: 32px;
}

.sparkline-path {
  fill: none;
  stroke: #2a5298;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.sparkline-area {
  fill: rgba(42, 82, 152, 0.12);
  stroke: none;
}

.sparkline-dot {
  fill: #2a5298;
  stroke: #fff;
  stroke-width: 1;
}

.sparkline-range {
  font-size: 0.75em;
  color: #666;
  line-height: 1.2;
  margin-top: -4px;
}

.sparkline-empty {
  color: #999;
  font-size: 0.85em;
}

/* Novos badges com indicadores de progressão integrados */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: white;
  font-weight: bold;
  font-size: 0.9em;
  position: relative;
  border: 2px solid transparent;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.rank-badge:hover {
  transform: scale(1.1);
}

.tiebreak-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  color: #334155;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  border: 1px solid #94a3b8;
  cursor: help;
  vertical-align: middle;
  position: relative;
  outline: none;
}

.tiebreak-indicator:hover {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  border-color: #60a5fa;
  color: #1e3a8a;
}

.tiebreak-indicator:focus-visible {
  box-shadow: 0 0 0 2px #93c5fd;
}

.tiebreak-tooltip-panel {
  position: fixed;
  z-index: 9999;
  width: min(520px, 94vw);
  max-height: min(68vh, 520px);
  overflow: auto;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.25);
  padding: 12px;
}

.tb-header {
  margin-bottom: 8px;
}

.tb-title {
  font-size: 0.92em;
  font-weight: 700;
  color: #0f172a;
}

.tb-subtitle {
  margin-top: 2px;
  font-size: 0.8em;
  color: #334155;
}

.tb-table-wrap {
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.tb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75em;
  table-layout: auto;
}

.tb-table th,
.tb-table td {
  padding: 5px 6px;
  border-bottom: 1px solid #eef2f7;
  white-space: normal;
}

.tb-table th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: #334155;
  font-weight: 700;
  z-index: 1;
}

.tb-row.is-current {
  background: rgba(191, 219, 254, 0.35);
}

.tb-rank,
.tb-value {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.tb-team {
  text-align: left;
  color: #0f172a;
  font-weight: 600;
  max-width: 120px;
}

.tb-criterion.is-deciding,
.tb-value.is-deciding {
  background: rgba(16, 185, 129, 0.12);
  color: #065f46;
  font-weight: 700;
}

@media (max-width: 768px) {
  .tiebreak-tooltip-panel {
    width: 94vw;
    max-height: 62vh;
    padding: 10px;
  }

  .tb-title {
    font-size: 0.88em;
  }

  .tb-subtitle {
    font-size: 0.76em;
  }

  .tb-table {
    font-size: 0.7em;
  }

  .tb-table th,
  .tb-table td {
    padding: 4px 5px;
  }

  .tb-team {
    max-width: 96px;
  }
}

/* Cores base dos rankings removidas - agora usamos apenas as cores de progressão */

/* Indicadores de progressão com cores completas de fundo */
.rank-badge.progression-playoffs {
  background: linear-gradient(135deg, #28a745, #20c997);
  border: 2px solid #1e7e34;
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.4);
}

.rank-badge.progression-maintenance-playoffs {
  background: linear-gradient(135deg, #ffc107, #ff9800);
  border: 2px solid #e68900;
  box-shadow: 0 2px 8px rgba(255, 193, 7, 0.4);
}

.rank-badge.progression-maintenance-league {
  background: linear-gradient(135deg, #ff9800, #ff6f00);
  border: 2px solid #e65100;
  box-shadow: 0 2px 8px rgba(255, 152, 0, 0.4);
}

/* Playoff/Liguilha de Promoção (2ª divisão) - Azul claro */
.rank-badge.progression-promotion-playoffs {
  background: linear-gradient(135deg, #17a2b8, #138496);
  border: 2px solid #0f6674;
  box-shadow: 0 2px 8px rgba(23, 162, 184, 0.4);
}

.rank-badge.progression-promotion-league {
  background: linear-gradient(135deg, #20c997, #17a085);
  border: 2px solid #0e7c68;
  box-shadow: 0 2px 8px rgba(32, 201, 151, 0.4);
}

.rank-badge.progression-promotion {
  background: linear-gradient(135deg, #007bff, #0056b3);
  border: 2px solid #004085;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.4);
}

.rank-badge.progression-relegation {
  background: linear-gradient(135deg, #dc3545, #c82333);
  border: 2px solid #a71e2a;
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
  animation: pulse-danger 2s infinite;
}

.rank-badge.progression-safe {
  background: linear-gradient(135deg, #6c757d, #5a6268);
  border: 2px solid #495057;
  box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

/* Forma (últimos 5 jogos) */
.form-badges {
  display: inline-flex;
  gap: 4px;
  justify-content: center;
  align-items: center;
  min-height: 24px;
}

.form-badge {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.form-badge.win {
  background: linear-gradient(135deg, #28a745, #20c997);
}

.form-badge.draw {
  background: linear-gradient(135deg, #ffc107, #ff9800);
  color: #3a2a00;
}

.form-badge.loss {
  background: linear-gradient(135deg, #dc3545, #c82333);
}

.form-badges.empty {
  color: #999;
  font-size: 0.85em;
}

/* Animação para zona de descida */
@keyframes pulse-danger {
  0%,
  100% {
    box-shadow:
      0 0 0 2px rgba(220, 53, 69, 0.2),
      0 2px 8px rgba(0, 0, 0, 0.15);
  }
  50% {
    box-shadow:
      0 0 0 4px rgba(220, 53, 69, 0.3),
      0 4px 12px rgba(0, 0, 0, 0.2);
  }
}

.progression-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.9),
    rgba(248, 249, 250, 0.8)
  );
  border-radius: 10px;
  font-size: 0.87em;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  color: #495057;
}

.legend-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: white;
  font-size: 0.7em;
  font-weight: bold;
  border: 2px solid transparent;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.legend-badge.legend-playoffs {
  background: linear-gradient(135deg, #28a745, #20c997);
  border: 2px solid #1e7e34;
}

.legend-badge.legend-maintenance-playoffs {
  background: linear-gradient(135deg, #ffc107, #ff9800);
  border: 2px solid #e68900;
}

.legend-badge.legend-maintenance-league {
  background: linear-gradient(135deg, #ff9800, #ff6f00);
  border: 2px solid #e65100;
}

/* Playoff/Liguilha de Promoção (2ª divisão) - Azul claro */
.legend-badge.legend-promotion-playoffs {
  background: linear-gradient(135deg, #17a2b8, #138496);
  border: 2px solid #0f6674;
}

.legend-badge.legend-promotion-league {
  background: linear-gradient(135deg, #20c997, #17a085);
  border: 2px solid #0e7c68;
}

.legend-badge.legend-promotion {
  background: linear-gradient(135deg, #007bff, #0056b3);
  border: 2px solid #004085;
}

.legend-badge.legend-relegation {
  background: linear-gradient(135deg, #dc3545, #c82333);
  border: 2px solid #a71e2a;
}

.legend-badge.legend-safe {
  background: linear-gradient(135deg, #6c757d, #5a6268);
  border: 2px solid #495057;
}

.team-emblem-table {
  width: 68px;
  height: 68px;
  border-radius: 6px;
  object-fit: contain;
  vertical-align: middle;
  box-sizing: border-box;
  display: inline-block;
}

/* Ajuste específico para o emblema EGI que não tem margens internas */
.team-emblem[src*="EGI-07.png"],
.team-emblem-table[src*="EGI-07.png"] {
  padding: 17px;
}

/* Ajuste específico do EGI para emblemas pequenos nos seletores */
.team-checkbox .team-emblem[src*="EGI-07.png"] {
  padding: 6px;
}

.team-color-indicator {
  width: 4px;
  height: 28px;
  border-radius: 2px;
  margin-right: 8px;
  display: inline-block;
  vertical-align: middle;
}

.team-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left !important;
  padding: 8px 4px;
  width: 100%;
}

.team-name-table {
  font-weight: bold;
  white-space: normal;
  word-wrap: break-word;
  line-height: 1.3;
  max-width: 300px;
}

.team-info-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.team-elo-info {
  font-size: 0.8em;
  color: #999;
  font-weight: normal;
  white-space: nowrap;
  margin-top: 2px;
}

.division-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.group-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
  flex-wrap: wrap;
  border-top: 1px solid #e0e0e0;
  padding-top: 15px;
}

.division-btn,
.group-btn {
  padding: 10px 20px;
  border: 2px solid #2a5298;
  background: white;
  color: #2a5298;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.group-btn {
  padding: 8px 16px;
  font-size: 0.9em;
  border-color: #1e3c72;
  color: #1e3c72;
}

.division-btn.active,
.division-btn:hover {
  background: linear-gradient(135deg, #1e3c72, #2a5298);
  color: white;
  transform: translateY(-2px);
}

.group-btn.active,
.group-btn:hover {
  background: linear-gradient(135deg, #2a5298, #1e3c72);
  color: white;
  transform: translateY(-2px);
}

.division-btn:focus-visible,
.group-btn:focus-visible {
  outline: 3px solid #2a5298;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(42, 82, 152, 0.2);
}

.bracket-container {
  overflow-x: auto;
  padding: 20px;
  background: white;
  border-radius: 8px;
  margin-top: 20px;
}

.bracket {
  display: flex;
  gap: 120px;
  min-width: 900px;
  position: relative;
  padding: 10px;
}

.bracket-round {
  display: flex;
  flex-direction: column;
  gap: 40px;
  min-width: 280px;
  position: relative;
}

.bracket-round h3 {
  text-align: center;
  color: #475569;
  margin-bottom: 30px;
  padding: 10px;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  font-size: 1.1em;
  font-weight: 600;
}

.bracket-match {
  background: white;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  border-left: 4px solid #e5e7eb;
  position: relative;
  border: 1px solid #e5e7eb;
}

.bracket-match:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-left-color: #2a5298;
}

.bracket-team {
  padding: 10px 12px;
  margin: 2px 0;
  border-radius: 4px;
  background: #f9fafb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
  transition: all 0.3s ease;
  border-left: 4px solid #dee2e6;
  position: relative;
}

.bracket-team.winner {
  color: white;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  border-left-width: 6px;
}

.bracket-team:not(.winner):hover {
  background: #e9ecef;
  transform: translateX(2px);
}

/* Destaque para equipa favorita no bracket */
.bracket-team.favorite-team-bracket {
  border-left-color: #fbbf24;
  border-left-width: 5px;
  background: rgba(251, 191, 36, 0.1);
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.2);
}

.bracket-team.favorite-team-bracket::after {
  content: "★";
  color: #fbbf24;
  font-size: 1.1em;
  margin-left: 8px;
  position: absolute;
  right: 55px;
}

.bracket-team.favorite-team-bracket.winner::after {
  color: white;
  text-shadow: 0 0 4px rgba(251, 191, 36, 0.8);
}

/* Estilo especial para a final */
.bracket-round:last-of-type .bracket-match {
  background: linear-gradient(135deg, #fefce8, #fff);
  border: 2px solid #f59e0b;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.2);
  padding: 5px;
}

.bracket-round:last-of-type .bracket-match .bracket-team {
  background: #fffbeb;
  border-left-color: #f59e0b;
  min-height: 40px;
  padding: 4px 4px;
}

.bracket-team-content {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
}

.bracket-team-emblem {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: contain;
  flex-shrink: 0;
}

.bracket-team-emblem[src*="EGI-07.png"] {
  padding: 10px;
  box-sizing: border-box;
}

.score {
  font-weight: bold;
  font-size: 0.9em;
}

/* Indicadores de ELO no bracket */
.bracket-elo-change {
  font-size: 0.75em;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 3px;
  white-space: nowrap;
  margin-left: 8px;
}

.bracket-elo-change.positive {
  color: #28a745;
  background: rgba(40, 167, 69, 0.15);
}

.bracket-elo-change.negative {
  color: #dc3545;
  background: rgba(220, 53, 69, 0.15);
}

.unknown-result-indicator {
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: 4px;
  padding: 4px 8px;
  margin-top: 5px;
  text-align: center;
}

.unknown-result-indicator small {
  color: #856404 !important;
  font-size: 0.75em;
  font-weight: 500;
}

/* Labels de qualificação nos brackets */
.qualification-label {
  font-size: 0.7em;
  color: #666;
  font-style: italic;
  padding: 2px 8px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 3px;
  text-align: center;
  margin: 2px 0;
}

.qualification-label-top {
  margin-bottom: 5px;
  margin-top: -5px;
}

.qualification-label-bottom {
  margin-top: 5px;
  margin-bottom: -5px;
}

.bracket-legend {
  background: white;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 20px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.bracket-legend h4 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 0.95em;
  text-align: center;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 10px;
}

.bracket-legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.bracket-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 6px;
  font-size: 0.85em;
  border-left: 4px solid #667eea;
}

.bracket-legend-item.playoff {
  border-left-color: #28a745;
}

.bracket-legend-item.promotion-playoff,
.bracket-legend-item.promotion-league {
  border-left-color: #17a2b8;
}

.bracket-legend-item.maintenance-playoff,
.bracket-legend-item.maintenance-league {
  border-left-color: #ffc107;
}

.bracket-legend-badge {
  font-weight: bold;
  background: white;
  padding: 4px 8px;
  border-radius: 4px;
  min-width: 30px;
  text-align: center;
}

.maintenance-league-table {
  background: white;
  border-radius: 8px;
  padding: 8px;
  margin-top: 20px;
  width: 100%;
  border: 1px solid #e5e7eb;
  box-sizing: border-box;
}

.maintenance-league-table h3 {
  text-align: center;
  color: #666;
  margin-bottom: 10px;
  font-size: 1.1em;
  font-weight: 600;
}

.maintenance-league-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  table-layout: auto;
}

.maintenance-league-table th {
  background: #e2e8f0;
  color: #475569;
  padding: 6px 4px;
  text-align: center;
  font-weight: 600;
  font-size: 0.85em;
}

.maintenance-league-table td {
  padding: 6px 4px;
  border-bottom: 1px solid #f1f5f9;
  text-align: center;
  font-size: 0.9em;
}

.maintenance-league-table td.team-cell {
  text-align: left;
}

.maintenance-league-table tr:hover {
  background: #f8fafc;
}

.maintenance-league-table .position {
  font-weight: bold;
  text-align: center;
  width: 30px;
}

.maintenance-league-table .team-cell {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.maintenance-league-table .team-emblem {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.maintenance-league-table .team-qualification-label {
  display: inline-block;
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.maintenance-league-table .qual-1div {
  background: #e3f2fd;
  color: #1976d2;
  border: 1px solid #1976d2;
}

.maintenance-league-table .qual-2div {
  background: #fff3e0;
  color: #f57c00;
  border: 1px solid #f57c00;
}

@media (max-width: 768px) {
  .dashboard-grid {
    gap: 12px;
    width: 100%;
    box-shadow: none;
    margin-right: 0;
    padding: 0;
    box-sizing: border-box;
  }

  .card {
    padding: 15px;
    margin-bottom: 0;
  }

  .ranking-card {
    min-height: auto;
  }

  .chart-card,
  .bracket-container {
    grid-column: span 1;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
  }

  .chart-wrapper {
    height: auto;
    min-height: 0;
    overflow: visible;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  .chart-container {
    height: clamp(280px, 50vh, 400px);
    margin-bottom: 15px;
    padding-left: 5px;
    padding-right: 5px;
    padding-top: 15px;
    max-width: 100%;
    width: 100%;
    overflow: visible;
    box-sizing: border-box;
  }

  .team-selector {
    position: relative;
    width: 100%;
    height: auto;
    max-height: 40vh !important;
    overflow-y: auto !important;
    overflow-x: hidden;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-top: 15px;
    margin-bottom: 20px;
    right: auto;
    top: auto;
    bottom: auto;
    min-width: auto;
    max-width: 100%;
    justify-content: center;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    border: 2px solid #e0e0e0;
    box-shadow: inset 0 -10px 10px -10px rgba(0, 0, 0, 0.1);
  }

  .team-selector::after {
    content: "⬍ Scroll para ver mais ⬍";
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, #f8f9fa 80%, transparent);
    text-align: center;
    font-size: 0.7em;
    color: #666;
    pointer-events: none;
    font-weight: 500;
    z-index: 5;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    display: var(--show-scroll-indicator, block);
  }

  .team-checkbox {
    transform: none !important;
    font-size: 0.75em;
    padding: 3px 6px;
    min-height: 24px;
    margin: 1px;
    flex-shrink: 0;
  }

  .team-checkbox .team-emblem {
    width: 16px;
    height: 16px;
  }

  .team-dot {
    width: 10px;
    height: 10px;
  }

  .team-end-labels {
    display: none;
    /* Ocultar labels dinâmicos no mobile */
  }

  .quick-selection-controls {
    flex-direction: column;
    gap: 5px !important;
  }

  .quick-control-btn {
    font-size: 0.75em !important;
    padding: 4px 8px !important;
  }

  .team-selector.many-teams {
    max-height: none;
  }

  .division-selector {
    display: flex; /* Ensure flexbox is used */
    flex-wrap: nowrap; /* Prevent wrapping initially */
    overflow-x: auto; /* Allow scrolling if many divisions */
    padding-bottom: 5px; /* Space for scrollbar */
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    margin-bottom: 15px; /* Add some space below */
  }

  /* Hide scrollbar for cleaner look but keep functionality */
  .division-selector::-webkit-scrollbar {
    height: 4px;
  }
  .division-selector::-webkit-scrollbar-thumb {
    background: rgba(42, 82, 152, 0.3);
    border-radius: 4px;
  }

  /* Ajustes para emblemas do calendário de jogos */
  .game-team-emblem {
    width: 42px !important;
    height: 42px !important;
  }

  .game-team-emblem[src*="EGI-07.png"] {
    width: 40px !important;
    height: 40px !important;
    padding: 8px !important;
  }

  /* Ajustar navegação de jornadas para alinhar verticalmente */
  /* Ajustes para a navegação de jornadas */
  .jornada-navigation {
    gap: 8px !important;
    flex-wrap: nowrap !important;
  }

  /* Ajustes para o bracket dos playoffs */
  .bracket-team {
    padding: 4px 4px;
    flex-wrap: nowrap;
    gap: 0px;
    min-height: 36px;
  }

  .bracket-team-content {
    gap: 6px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
  }

  .bracket-team-emblem {
    width: 28px !important;
    height: 28px !important;
    flex-shrink: 0;
  }

  .bracket-team-emblem[src*="EGI-07.png"] {
    padding: 5px !important;
  }

  .bracket-team-content span {
    font-size: 0.75em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
  }

  .score {
    font-size: 0.8em;
    flex-shrink: 0;
    margin-left: auto;
    min-width: 20px;
    text-align: right;
  }

  .bracket-elo-change {
    font-size: 0.6em;
    padding: 2px 3px;
    margin-left: 3px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Ajustes específicos para bracket */
  .bracket {
    min-width: 450px;
    gap: 10px;
    padding: 00px;
  }

  .bracket-round {
    min-width: 140px;
    gap: 25px;
  }

  .bracket-round h3 {
    font-size: 0.9em;
    margin-bottom: 15px;
    padding: 6px;
  }

  .bracket-match {
    padding: 8px;
  }

  .bracket-container {
    padding: 10px;
  }

  /* Ajustes para a liguinha/bracket secundário */
  .bracket-league-table {
    font-size: 0.85em;
    padding: 12px;
    overflow-x: auto;
  }

  .bracket-league-table h3 {
    font-size: 0.95em;
    margin-bottom: 8px;
  }

  .bracket-league-table table {
    font-size: 0.8em;
    min-width: 100%;
  }

  .bracket-league-table th {
    padding: 4px 2px;
    font-size: 0.75em;
  }

  .bracket-league-table td {
    padding: 4px 2px;
    font-size: 0.85em;
  }

  .bracket-league-table {
    padding: 4px;
  }

  .bracket-league-table td.team-cell {
    min-width: 0;
  }

  .bracket-league-table .team-cell {
    gap: 2px;
  }

  .bracket-league-table .team-emblem {
    width: 28px;
    height: 28px;
  }

  .bracket-league-table .team-qualification-label {
    font-size: 8px;
    padding: 2px 3px;
  }

  .bracket-league-table .position {
    width: 24px;
  }

  .maintenance-league-table {
    padding: 4px;
  }

  .maintenance-league-table th {
    padding: 4px 2px;
    font-size: 0.75em;
  }

  .maintenance-league-table td {
    padding: 4px 2px;
  }

  .maintenance-league-table td.team-cell {
    min-width: 0;
  }

  .maintenance-league-table .team-cell {
    gap: 2px;
  }

  .maintenance-league-table .team-emblem {
    width: 28px;
    height: 28px;
  }

  .maintenance-league-table .team-qualification-label {
    font-size: 8px;
    padding: 2px 3px;
  }

  .maintenance-league-table .position {
    width: 24px;
  }

  .maintenance-league-table h3 {
    font-size: 0.95em;
    margin-bottom: 8px;
  }

  /* Ajuste para o card do bracket secundário */
  #secondaryBracketCard {
    overflow-x: auto;
  }

  #secondaryBracketCard .bracket-container {
    min-width: 100%;
  }

  /* Estilos de calendário de jogos */
  .game-item {
    flex-direction: column;
    gap: 10px;
    padding: 12px 8px;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
  }

  .game-date {
    font-size: 0.8em;
    min-width: 100%;
    width: 100%;
    text-align: center;
    margin-bottom: 5px;
    text-transform: uppercase;
  }

  .game-teams {
    flex-direction: column;
    width: 100%;
    gap: 0 !important;
    margin-right: 0;
    align-items: stretch;
  }

  .game-team {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    gap: 6px;
    justify-content: flex-start;
    box-sizing: border-box;
  }

  .game-team.home,
  .game-team.away {
    justify-content: flex-start;
    flex-direction: row;
    text-align: left;
  }

  .game-team.home .game-team-name {
    text-align: left;
  }

  .game-team-name {
    font-size: 0.8em;
    width: auto;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .game-team-emblem {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
  }

  .game-team-emblem[src*="EGI-07.png"] {
    width: 30px;
    height: 30px;
    padding: 6px;
  }

  .game-elo-change {
    font-size: 0.7em;
    padding: 2px 4px;
    flex-shrink: 0;
    margin-left: auto;
  }

  .game-score,
  .game-vs {
    min-width: auto;
    font-size: 1em;
    flex-shrink: 0;
    margin: 8px 0;
    text-align: center;
  }

  /* Estilos gerais */
  body {
    padding: 8px; /* Reduced padding */
    overflow-x: hidden;
  }

  .container {
    padding: 6px; /* Reduced container padding */
    border-radius: 8px;
    max-width: 100%;
    overflow-x: hidden;
  }

  .header h1 {
    font-size: 1.5em; /* Smaller font for title */
    line-height: 1.2;
    margin-bottom: 8px;
  }

  .header p {
    font-size: 0.95em;
  }

  .modalidade-selector {
    flex-direction: column;
    gap: 10px;
  }

  .modalidade-selector select {
    width: 100%;
    max-width: 300px;
  }

  .card {
    padding: 15px;
    margin-bottom: 20px;
    max-width: 100%;
    width: 100%;
    overflow-x: hidden;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
  }

  .chart-card {
    margin-bottom: 30px;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
  }

  .ranking-card {
    margin-top: 30px;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
  }

  .card-title {
    font-size: 1.1em;
  }

  /* Tabela de classificação */
  .table-wrapper {
    overflow-x: auto;
    margin: 0 0px;
    padding: 0px 0px;
    max-width: calc(100% + 24px);
    -webkit-overflow-scrolling: touch;
    background:
      linear-gradient(to right, white 30%, rgba(255, 255, 255, 0)),
      linear-gradient(to right, rgba(255, 255, 255, 0), white 70%) 0 100%,
      radial-gradient(
        farthest-side at 0 50%,
        rgba(0, 0, 0, 0.2),
        rgba(0, 0, 0, 0)
      ),
      radial-gradient(
          farthest-side at 100% 50%,
          rgba(0, 0, 0, 0.2),
          rgba(0, 0, 0, 0)
        )
        0 100%;
    background-repeat: no-repeat;
    background-color: white;
    background-size:
      40px 100%,
      40px 100%,
      14px 100%,
      14px 100%;
    background-position:
      0 0,
      100% 0,
      0 0,
      100% 0;
    background-attachment: local, local, scroll, scroll;
  }

  .rankings-table {
    font-size: 0.75em;
    white-space: nowrap;
    width: 100%;
    min-width: 100%;
  }

  .rankings-table th,
  .rankings-table td {
    padding: 6px 2px;
    line-height: 1.3;
    height: auto;
    min-height: 36px;
  }

  .rankings-table .team-emblem {
    width: 22px;
    height: 22px;
    margin-right: 4px;
  }

  .rank-badge {
    width: 22px;
    height: 22px;
    font-size: 0.65em;
  }

  .team-emblem-table {
    width: 40px !important;
    height: 40px !important;
    margin-right: 0 !important;
    padding: 0px !important;
  }

  .team-emblem-table[src*="EGI-07.png"] {
    padding: 9px !important;
    width: 40px !important;
    height: 40px !important;
  }

  .rankings-table td:first-child {
    padding-right: 0px !important;
  }

  .team-color-indicator {
    margin-right: 0px !important;
  }

  .team-cell {
    gap: 4px !important;
  }

  .division-selector,
  .group-selector {
    display: flex;
    flex-wrap: nowrap; /* Prevent wrapping for better horizontal scroll feel */
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  /* Make buttons larger touch targets */
  .division-btn,
  .group-btn {
    flex-shrink: 0;
  }

  .division-btn,
  .group-btn {
    font-size: 0.85em;
    padding: 8px 12px; /* Larger touch area */
    white-space: nowrap;
  }

  .calendar-controls {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .jornada-navigation {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .jornada-title {
    order: 0;
    flex: 1;
    text-align: center;
    font-size: 1.2em;
    min-width: 0;
  }

  .jornada-arrow-container {
    flex-shrink: 0;
    justify-content: center;
  }

  .jornada-arrow {
    background: transparent;
    color: #2a5298;
    border: none;
    width: 45px;
    height: 45px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0.8;
  }

  .jornada-arrow svg {
    width: 100%;
    height: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .calendar-card {
    margin-top: 20px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
    margin-left: 0;
    margin-right: 0;
    grid-column: span 1;
  }

  .games-list {
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    margin-left: 0;
    margin-right: 0;
  }

  .bracket-container {
    overflow-x: auto;
  }

  .bracket {
    min-width: 600px;
  }

  .bracket-round {
    min-width: 140px;
  }

  .match {
    min-height: 60px;
    margin: 8px 0;
  }

  .match-team {
    font-size: 0.75em;
    padding: 6px;
  }

  .zoom-controls {
    flex-wrap: wrap;
    gap: 5px;
    align-self: flex-end;
  }

  .zoom-btn {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  .filter-btn {
    font-size: 0.75em;
    padding: 5px 10px;
  }

  .progression-legend {
    flex-wrap: wrap;
    gap: 8px;
    font-size: 1em;
  }

  .legend-item {
    font-size: 0.7em;
  }

  .chart-container {
    height: 350px;
    padding-left: 10px;
  }

  .chart-container canvas {
    max-width: 100%;
    height: auto !important;
  }

  .chart-header {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .chart-header .card-title {
    width: 100%;
  }
}

.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  font-size: 1.1em;
  color: #666;
}

.spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #667eea;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin-right: 10px;
}

.modalidade-selector {
  text-align: center;
  margin-bottom: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.modalidade-selector label {
  font-weight: 600;
  margin-right: 8px;
  font-size: 1.1em;
  color: #333;
}

.modalidade-selector select {
  padding: 10px 16px;
  border: 2px solid #667eea;
  border-radius: 12px;
  font-size: 1em;
  cursor: pointer;
  background: white;
  transition: all 0.3s ease;
}

.modalidade-selector select:hover {
  border-color: #764ba2;
  background: #f7f7ff;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Skeleton loader para transições */
.skeleton-loader {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 4px;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.chart-loading {
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

/* Estilos do Calendário de Jogos */
.calendar-card {
  margin-top: 30px;
  grid-column: 1 / -1;
  /* Ocupa toda a largura do grid */
}

.calendar-controls {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.calendar-sort-toggle {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.calendar-sort-btn {
  padding: 8px 14px;
  border: 2px solid #2a5298;
  background: white;
  color: #2a5298;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85em;
  cursor: pointer;
  transition: all 0.25s ease;
}

.calendar-sort-btn:hover {
  background: rgba(42, 82, 152, 0.08);
  transform: translateY(-1px);
}

.calendar-sort-btn.active {
  background: linear-gradient(135deg, #1e3c72, #2a5298);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(42, 82, 152, 0.25);
}

.calendar-sort-btn:focus-visible {
  outline: 3px solid #2a5298;
  outline-offset: 2px;
}

.jornada-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  margin-bottom: 20px;
}

.jornada-arrow-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.jornada-arrow {
  background: transparent;
  color: #2a5298;
  border: none;
  width: 45px;
  height: 45px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0.8;
}

.jornada-arrow svg {
  width: 100%;
  height: 100%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.jornada-arrow:hover:not(:disabled) {
  opacity: 1;
  transform: scale(1.15);
}

.jornada-arrow:hover:not(:disabled) svg {
  filter: drop-shadow(0 2px 4px rgba(42, 82, 152, 0.3));
}

.jornada-arrow:disabled {
  color: #ccc;
  cursor: not-allowed;
  opacity: 0.3;
}

.jornada-arrow:focus-visible {
  outline: 2px solid #2a5298;
  outline-offset: 4px;
  border-radius: 4px;
}

.epoca-switch-label {
  font-size: 0.75em;
  color: #667eea;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(102, 126, 234, 0.1);
  transition: all 0.3s ease;
  white-space: nowrap;
}

.epoca-switch-label:hover {
  background: rgba(102, 126, 234, 0.2);
  transform: translateY(-2px);
}

.jornada-title {
  font-size: 1.5em;
  font-weight: 700;
  color: #333;
  min-width: 180px;
  text-align: center;
}

.games-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.game-item {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 0px 16px;
  display: flex;
  justify-content: space-between;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.game-item:hover {
  background: #e9ecef;
  border-color: #667eea;
  transform: translateX(2px);
}

.game-item.played {
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.game-item.not-played {
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Destaque para jogo da equipa favorita */
.game-item.favorite-team-game {
  border-left: 4px solid #fbbf24;
  background: rgba(251, 191, 36, 0.08);
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.25);
}

.game-item.favorite-team-game:hover {
  background: rgba(251, 191, 36, 0.15);
  border-color: #fbbf24;
  box-shadow: 0 6px 16px rgba(251, 191, 36, 0.35);
}

.game-date {
  min-width: 160px;
  font-size: 0.9em;
  color: #666;
  font-weight: 600;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}

.game-meta {
  min-width: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
}

.game-location {
  font-size: 0.8em;
  color: #4b5563;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
}

.game-warning {
  font-size: 0.72em;
  font-weight: 700;
  color: #b91c1c;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-align: center;
}

.game-location-label {
  color: #111827;
}

.placeholder-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 4px;
  border-radius: 50%;
  font-size: 0.75em;
  font-weight: 700;
  color: #ffffff;
  background: #d97706;
  vertical-align: middle;
}

.game-teams {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-right: 135px;
}

.game-team {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 320px;
}

.game-team.home {
  justify-content: flex-end;
  text-align: right;
}

.game-team.away {
  justify-content: flex-start;
  text-align: left;
}

.game-team-emblem {
  width: 72px;
  height: 72px;
  object-fit: contain;
  flex-shrink: 0;
}

.game-team-emblem[src*="EGI-07.png"] {
  width: 66px;
  height: 66px;
  padding: 15px;
}

.game-team-name {
  font-weight: 700;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-team.home .game-team-name {
  text-align: right;
}

.game-team.away .game-team-name {
  text-align: left;
}

.game-elo-change {
  font-size: 0.85em;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.game-elo-change.positive {
  color: #28a745;
  background: rgba(40, 167, 69, 0.1);
}

.game-elo-change.negative {
  color: #dc3545;
  background: rgba(220, 53, 69, 0.1);
}

.game-score {
  font-size: 1.3em;
  font-weight: bold;
  color: #333;
  min-width: 80px;
  text-align: center;
}

.game-vs {
  color: #999;
  font-weight: 600;
  font-size: 0.9em;
}

.no-games-message {
  text-align: center;
  color: #666;
  padding: 40px;
  font-size: 1.1em;
}

/* Media queries para tablets (landscape) */
@media (min-width: 769px) and (max-width: 1024px) {
  .container {
    padding: 20px;
  }

  .dashboard-grid {
    gap: 20px;
  }

  .card {
    padding: 20px;
  }

  .rankings-table {
    font-size: 0.85em;
  }

  .chart-container {
    height: 450px;
  }

  /* Slider usa CSS base - sem overrides de tamanho */

  .team-slider-name {
    width: 180px;
    height: 3.6em;
    top: -75px;
  }
}

/* Slider de Equipas - CSS Base (Desktop) */
.team-slider-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  border-radius: 12px;
  --gap1: 90px;
  --gap2: 155px;
  --gap3: 200px;
}

.team-slider-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  position: relative;
  width: 100%;
  max-width: 400px;
  height: 220px;
  overflow: visible;
}

.slider-arrow {
  background: transparent;
  color: #2a5298;
  border: none;
  width: 45px;
  height: 45px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 10;
  opacity: 0.7;
  position: absolute;
  top: calc(50% - 80px);
  transform: translateY(-50%);
}

.slider-prev {
  left: calc(50% - 220px);
}

.slider-next {
  right: calc(50% - 220px);
}

.slider-arrow svg {
  width: 100%;
  height: 100%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.slider-arrow:hover:not(:disabled) {
  opacity: 1;
  transform: translateY(-50%) scale(1.15);
}

.slider-arrow:hover:not(:disabled) svg {
  filter: drop-shadow(0 2px 4px rgba(42, 82, 152, 0.3));
}

.slider-arrow:active:not(:disabled) {
  transform: translateY(-50%) scale(0.9);
}

.slider-arrow:disabled {
  color: #ccc;
  cursor: not-allowed;
  opacity: 0.3;
}

.slider-arrow:focus-visible {
  outline: 2px solid #2a5298;
  outline-offset: 4px;
  border-radius: 4px;
}

.team-slider-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0px;
  flex: 0 0 auto;
  z-index: 5;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.team-slider-emblem {
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  position: absolute;
  left: 50%;
  top: calc(50% + 40px);
  transform: translate(-50%, -50%) scale(1);
  z-index: 5;
  --start-x: -50%;
  --start-scale: 1;
  --end-x: -50%;
  --end-scale: 1;
}

.team-slider-emblem.slide-left {
  animation: slideToLeft 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.team-slider-emblem.slide-right {
  animation: slideToRight 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.team-slider-emblem.enter-from-left {
  animation: slideFromLeft 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.team-slider-emblem.enter-from-right {
  animation: slideFromRight 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.team-slider-emblem img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
  transition: all 0.3s ease;
  opacity: 1;
}

.team-slider-emblem img[src*="EGI-07.png"] {
  padding: 45px;
  box-sizing: border-box;
}

.team-slider-fallback {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

.team-slider-ghost {
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  position: absolute;
  top: calc(50% + 40px);
  pointer-events: none;
  filter: grayscale(100%);
  transition: opacity 0.3s ease;
}

/* Posicionamento e tamanhos dos ghosts */
.ghost-left-3 {
  left: 50%;
  transform: translate(calc(-50% - var(--gap3)), -50%) scale(0.35);
  opacity: 0.2;
  z-index: 1;
}

.ghost-left-2 {
  left: 50%;
  transform: translate(calc(-50% - var(--gap2)), -50%) scale(0.5);
  opacity: 0.35;
  z-index: 2;
}

.ghost-left-1 {
  left: 50%;
  transform: translate(calc(-50% - var(--gap1)), -50%) scale(0.7);
  opacity: 0.5;
  z-index: 3;
}

.ghost-right-1 {
  left: 50%;
  transform: translate(calc(-50% + var(--gap1)), -50%) scale(0.7);
  opacity: 0.5;
  z-index: 3;
}

.ghost-right-2 {
  left: 50%;
  transform: translate(calc(-50% + var(--gap2)), -50%) scale(0.5);
  opacity: 0.35;
  z-index: 2;
}

.ghost-right-3 {
  left: 50%;
  transform: translate(calc(-50% + var(--gap3)), -50%) scale(0.35);
  opacity: 0.2;
  z-index: 1;
}

.team-slider-ghost img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.team-slider-ghost img[src*="EGI-07.png"] {
  padding: 45px;
  box-sizing: border-box;
}

.team-slider-ghost-emblem {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
  opacity: 1;
}

.team-slider-ghost-emblem[src*="EGI-07.png"] {
  padding: 45px;
  box-sizing: border-box;
}

.team-slider-name {
  font-size: 1.3em;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  width: 250px;
  line-height: 1.2;
  color: #2a5298;
  margin-bottom: 10px;
  height: 3.6em;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  z-index: 10;
  top: -115px;
  left: 50%;
  transform: translateX(-50%);
}

.favorite-star-btn {
  position: absolute;
  right: -35px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 1.2em;
  transition: all 0.2s ease;
  z-index: 11;
}

.favorite-star-btn:hover {
  transform: translateY(-50%) scale(1.2);
}

.predictions-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 5px 15px;
  padding: 0px 15px;
}

.stat-card {
  background: white;
  border: 2px solid rgba(42, 82, 152, 0.1);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(42, 82, 152, 0.15);
  border-color: rgba(42, 82, 152, 0.3);
}

/* Media queries para telas muito pequenas */
@media (max-width: 480px) {
  body {
    overflow-x: hidden;
  }

  .container {
    max-width: 100%;
    overflow-x: hidden;
  }

  .header h1 {
    font-size: 1.5em;
  }

  .card {
    padding: 6px 3px;
    margin-bottom: 5px;
    max-width: 100%;
    width: 100%;
    overflow-x: hidden;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
  }

  .chart-card {
    margin-bottom: 25px;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
  }

  .ranking-card {
    margin-top: 25px;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
  }

  .chart-container {
    padding-left: 5px;
    padding-right: 5px;
    padding-top: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    height: clamp(250px, 45vh, 360px);
    overflow: visible;
  }

  .chart-container canvas {
    max-width: 100%;
  }

  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    box-sizing: border-box;
  }

  .rankings-table {
    font-size: 0.7em;
    width: 100%;
    min-width: auto;
  }

  .rankings-table th,
  .rankings-table td {
    padding: 4px 1px;
    min-height: 32px;
  }

  .rankings-table .team-emblem {
    width: 20px;
    height: 20px;
  }

  .rank-badge {
    width: 20px;
    height: 20px;
    font-size: 0.6em;
  }

  .division-btn,
  .group-btn {
    font-size: 0.75em;
    padding: 5px 8px;
  }

  .team-selector {
    max-height: 180px;
    padding: 10px;
    gap: 4px;
  }

  .team-checkbox {
    font-size: 0.7em;
    padding: 2px 5px;
    min-height: 22px;
  }

  .team-checkbox .team-emblem {
    width: 14px;
    height: 14px;
  }

  .team-dot {
    width: 8px;
    height: 8px;
  }

  .game-item {
    padding: 0px 24px;
    gap: 0px;
    width: 100%;
    box-sizing: border-box;
  }

  .game-date {
    font-size: 0.75em;
    width: 100%;
    text-align: center;
  }

  .game-team-emblem {
    width: 28px;
    height: 28px;
  }

  .game-team-emblem[src*="EGI-07.png"] {
    width: 26px;
    height: 26px;
    padding: 5px;
  }

  .game-score,
  .game-vs {
    font-size: 0.95em;
    margin: 6px 0;
  }

  .game-team-name {
    font-size: 0.75em;
  }

  .game-elo-change {
    font-size: 0.65em;
    padding: 1px 3px;
  }

  .jornada-arrow {
    width: 40px;
    height: 40px;
    font-size: 1.2em;
  }

  .jornada-title {
    font-size: 1.1em;
  }

  .bracket-league-table {
    padding: 3px !important;
  }

  .bracket-league-table h3 {
    font-size: 0.85em !important;
    margin-bottom: 6px !important;
  }

  .bracket-league-table th {
    padding: 3px 1px !important;
    font-size: 0.7em !important;
  }

  .bracket-league-table td {
    padding: 3px 1px !important;
    font-size: 0.8em !important;
  }

  .bracket-league-table .team-cell {
    gap: 1px !important;
    font-size: 0.8em !important;
  }

  .bracket-league-table td.team-cell {
    min-width: 0 !important;
  }

  .bracket-league-table .team-emblem {
    width: 20px !important;
    height: 20px !important;
  }

  .bracket-league-table .team-qualification-label {
    font-size: 7px !important;
    padding: 1px 2px !important;
  }

  .maintenance-league-table {
    padding: 0px !important;
  }

  .maintenance-league-table h3 {
    font-size: 0.85em !important;
    margin-bottom: 6px !important;
  }

  .maintenance-league-table th {
    padding: 3px 1px !important;
    font-size: 0.7em !important;
  }

  .maintenance-league-table td {
    padding: 3px 1px !important;
    font-size: 0.8em !important;
  }

  .maintenance-league-table .team-cell {
    gap: 1px !important;
    font-size: 0.8em !important;
  }

  .maintenance-league-table td.team-cell {
    min-width: 0 !important;
  }

  .maintenance-league-table .team-emblem {
    width: 20px !important;
    height: 20px !important;
  }

  .maintenance-league-table .team-qualification-label {
    font-size: 7px !important;
    padding: 1px 2px !important;
  }

  .bracket {
    min-width: 300px;
  }

  .bracket-round {
    min-width: 180px;
  }

  .match-team {
    font-size: 0.7em;
    padding: 4px;
  }

  .modalidade-selector label {
    font-size: 1em;
  }

  .modalidade-selector select {
    font-size: 0.9em;
  }

  .stat-label {
    font-size: 0.85em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    font-weight: 600;
  }

  .stat-value {
    font-size: 2em;
    font-weight: 700;
    color: #2a5298;
    margin-bottom: 5px;
  }

  .stat-description {
    font-size: 0.75em;
    color: #999;
    font-style: italic;
  }

  /* ========== AJUSTES PREVISÕES MOBILE ========== */

  /* Container do slider */
  .team-slider-container {
    padding: 15px 10px;
    --gap1: 55px;
    --gap2: 95px;
    --gap3: 120px;
  }

  .team-slider-display {
    max-width: 100%;
    height: 150px;
  }

  /* Emblema principal */
  .team-slider-emblem {
    width: 120px;
    height: 120px;
    top: calc(50% + 20px);
  }

  .team-slider-emblem img[src*="EGI-07.png"] {
    padding: 25px;
  }

  /* Ghosts menores */
  .team-slider-ghost {
    width: 120px;
    height: 120px;
    top: calc(50% + 20px);
  }

  .ghost-left-3 {
    left: 50%;
    transform: translate(calc(-50% - var(--gap3)), -50%) scale(0.25);
    opacity: 0.15;
  }

  .ghost-left-2 {
    left: 50%;
    transform: translate(calc(-50% - var(--gap2)), -50%) scale(0.4);
    opacity: 0.25;
  }

  .ghost-left-1 {
    left: 50%;
    transform: translate(calc(-50% - var(--gap1)), -50%) scale(0.6);
    opacity: 0.4;
  }

  .ghost-right-1 {
    left: 50%;
    transform: translate(calc(-50% + var(--gap1)), -50%) scale(0.6);
    opacity: 0.4;
  }

  .ghost-right-2 {
    left: 50%;
    transform: translate(calc(-50% + var(--gap2)), -50%) scale(0.4);
    opacity: 0.25;
  }

  .ghost-right-3 {
    left: 50%;
    transform: translate(calc(-50% + var(--gap3)), -50%) scale(0.25);
    opacity: 0.15;
  }

  .team-slider-ghost img[src*="EGI-07.png"] {
    padding: 10px;
  }

  .team-slider-ghost-emblem[src*="EGI-07.png"] {
    padding: 12px;
  }

  /* Nome da equipa */
  .team-slider-name {
    font-size: 0.85em;
    width: 140px;
    height: 3em;
    top: -65px;
    letter-spacing: 0.5px;
  }

  /* Setas maiores e mais visíveis no mobile */
  .slider-arrow {
    width: 35px;
    height: 35px;
    opacity: 0.85;
    top: calc(50% - 60px);
  }

  .slider-prev {
    left: 15px;
  }

  .slider-next {
    right: 15px;
  }

  .slider-arrow:hover:not(:disabled) {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
  }

  /* Estrela favorito */
  .favorite-star-btn {
    right: -25px;
    font-size: 1em;
  }

  /* Animações ajustadas para mobile */
  @keyframes slideToLeft {
    0% {
      transform: translate(var(--start-x), -50%) scale(var(--start-scale));
      opacity: 1;
      filter: grayscale(0%);
    }
    100% {
      transform: translate(var(--end-x), -50%) scale(var(--end-scale));
      opacity: 0.5;
      filter: grayscale(100%);
    }
  }

  @keyframes slideToRight {
    0% {
      transform: translate(var(--start-x), -50%) scale(var(--start-scale));
      opacity: 1;
      filter: grayscale(0%);
    }
    100% {
      transform: translate(var(--end-x), -50%) scale(var(--end-scale));
      opacity: 0.5;
      filter: grayscale(100%);
    }
  }

  @keyframes slideFromLeft {
    0% {
      transform: translate(calc(-50% - 8px), -50%) scale(0.9);
      opacity: 0.6;
      filter: grayscale(100%);
    }
    100% {
      transform: translate(-50%, -50%) scale(1);
      opacity: 1;
      filter: grayscale(0%);
    }
  }

  @keyframes slideFromRight {
    0% {
      transform: translate(calc(-50% + 8px), -50%) scale(0.9);
      opacity: 0.6;
      filter: grayscale(100%);
    }
    100% {
      transform: translate(-50%, -50%) scale(1);
      opacity: 1;
      filter: grayscale(0%);
    }
  }

  @keyframes ghostToMain {
    0% {
      transform: translate(var(--start-x), -50%) scale(var(--start-scale));
      opacity: var(--start-opacity);
      filter: grayscale(100%);
    }
    100% {
      transform: translate(-50%, -50%) scale(1);
      opacity: 1;
      filter: grayscale(0%);
    }
  }

  @keyframes mainToGhost {
    0% {
      transform: translate(-50%, -50%) scale(1);
      opacity: 1;
      filter: grayscale(0%);
    }
    100% {
      transform: translate(var(--end-x), -50%) scale(var(--end-scale));
      opacity: var(--end-opacity);
      filter: grayscale(100%);
    }
  }

  @keyframes ghostShiftLeft {
    0% {
      opacity: var(--start-opacity);
      transform: translate(var(--start-x), -50%) scale(var(--start-scale));
      filter: grayscale(100%);
    }
    100% {
      opacity: var(--end-opacity);
      transform: translate(var(--end-x), -50%) scale(var(--end-scale));
      filter: grayscale(100%);
    }
  }

  @keyframes ghostShiftRight {
    0% {
      opacity: var(--start-opacity);
      transform: translate(var(--start-x), -50%) scale(var(--start-scale));
      filter: grayscale(100%);
    }
    100% {
      opacity: var(--end-opacity);
      transform: translate(var(--end-x), -50%) scale(var(--end-scale));
      filter: grayscale(100%);
    }
  }

  @keyframes fadeOut {
    0% {
      opacity: var(--start-opacity, 0.2);
    }
    100% {
      opacity: 0;
    }
  }

  @keyframes fadeIn {
    0% {
      opacity: 0;
    }
    100% {
      opacity: var(--end-opacity, 0.2);
    }
  }

  /* Stats grid */
  .predictions-stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px 10px;
    padding: 10px;
  }

  .stat-card {
    padding: 12px 8px;
  }

  .stat-value {
    font-size: 1.4em;
  }

  /* Tabela de previsões */
  .predictions-table {
    font-size: 0.7em;
  }

  .predictions-table th,
  .predictions-table td {
    padding: 6px 3px;
    min-height: 36px;
  }

  .prediction-opponent-emblem {
    width: 32px;
    height: 32px;
  }

  .prediction-opponent-emblem[src*="EGI-07.png"] {
    padding: 8px;
  }

  .prediction-opponent-name {
    font-size: 0.9em;
  }

  .prediction-prob {
    font-size: 0.8em;
    padding: 4px 6px;
    min-width: 50px;
  }

  /* Títulos das seções */
  .predictions-section-title {
    font-size: 1.1em;
    letter-spacing: 1px;
    margin-bottom: 12px;
  }

  .predictions-section-title::after {
    width: 60px;
  }

  /* Sim count */
  .predictions-sim-count {
    font-size: 0.65em;
    padding: 4px 8px;
  }
}

/* Media query para dispositivos móveis em modo paisagem */
@media (max-width: 932px) and (orientation: landscape) {
  .chart-card {
    width: 100%;
    max-width: 100%;
    padding: 8px;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: visible;
  }

  .chart-wrapper {
    width: 100%;
    max-width: 100%;
    overflow: visible;
  }

  .chart-container {
    position: relative;
    width: 100%;
    padding-left: 5px;
    padding-right: 5px;
    margin-bottom: 10px;
    box-sizing: border-box;
    overflow: visible;
  }

  #eloChart {
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible;
  }

  /* Forçar SVG do ApexCharts a respeitar limites de largura */
  .apexcharts-canvas {
    max-width: 100% !important;
    width: 100% !important;
    overflow: visible;
  }

  .apexcharts-canvas svg {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  /* Ajustar team selector para landscape */
  .team-selector {
    max-height: 100px;
    overflow-y: auto;
  }

  /* Ajustar quick filters */
  .quick-filters {
    padding: 5px;
    gap: 5px;
    flex-wrap: wrap;
  }

  .quick-filters button {
    padding: 6px 10px;
    font-size: 0.85em;
  }

  /* Calendário de jogos em landscape */
  .calendar-card {
    width: 100%;
    max-width: 100%;
    padding: 8px;
    box-sizing: border-box;
    overflow: visible;
  }

  .games-list {
    max-height: 50vh;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
  }

  .game-item {
    padding: 8px;
  }

  /* Slider usa CSS base - sem overrides de tamanho */

  /* ========== AJUSTES PREVISÕES LANDSCAPE ========== */

  .team-slider-container {
    padding: 18px 12px;
    --gap1: 65px;
    --gap2: 115px;
    --gap3: 150px;
  }

  .team-slider-display {
    height: 170px;
  }

  .team-slider-emblem {
    width: 150px;
    height: 150px;
    top: calc(50% + 25px);
  }

  .team-slider-emblem img[src*="EGI-07.png"] {
    padding: 32px;
  }

  .team-slider-ghost {
    width: 150px;
    height: 150px;
    top: calc(50% + 25px);
  }

  .ghost-left-3 {
    left: 50%;
    transform: translate(calc(-50% - var(--gap3)), -50%) scale(0.28);
    opacity: 0.18;
  }

  .ghost-left-2 {
    left: 50%;
    transform: translate(calc(-50% - var(--gap2)), -50%) scale(0.43);
    opacity: 0.28;
  }

  .ghost-left-1 {
    left: 50%;
    transform: translate(calc(-50% - var(--gap1)), -50%) scale(0.63);
    opacity: 0.43;
  }

  .ghost-right-1 {
    left: 50%;
    transform: translate(calc(-50% + var(--gap1)), -50%) scale(0.63);
    opacity: 0.43;
  }

  .ghost-right-2 {
    left: 50%;
    transform: translate(calc(-50% + var(--gap2)), -50%) scale(0.43);
    opacity: 0.28;
  }

  .ghost-right-3 {
    left: 50%;
    transform: translate(calc(-50% + var(--gap3)), -50%) scale(0.28);
    opacity: 0.18;
  }

  .team-slider-ghost img[src*="EGI-07.png"] {
    padding: 13px;
  }

  .team-slider-ghost-emblem[src*="EGI-07.png"] {
    padding: 15px;
  }

  .team-slider-name {
    font-size: 0.95em;
    width: 170px;
    height: 3.4em;
    top: -72px;
  }

  .slider-arrow {
    width: 38px;
    height: 38px;
    top: calc(50% - 68px);
  }

  .slider-prev {
    left: calc(50% - 190px);
  }

  .slider-next {
    right: calc(50% - 190px);
  }

  /* Animações ajustadas para landscape - gaps menores */
  @keyframes slideToLeft {
    0% {
      transform: translate(var(--start-x), -50%) scale(var(--start-scale));
      opacity: 1;
      filter: grayscale(0%);
    }
    100% {
      transform: translate(var(--end-x), -50%) scale(var(--end-scale));
      opacity: 0.5;
      filter: grayscale(100%);
    }
  }

  @keyframes slideToRight {
    0% {
      transform: translate(var(--start-x), -50%) scale(var(--start-scale));
      opacity: 1;
      filter: grayscale(0%);
    }
    100% {
      transform: translate(var(--end-x), -50%) scale(var(--end-scale));
      opacity: 0.5;
      filter: grayscale(100%);
    }
  }

  @keyframes slideFromLeft {
    0% {
      transform: translate(calc(-50% - 18px), -50%) scale(0.78);
      opacity: 0.5;
      filter: grayscale(100%);
    }
    100% {
      transform: translate(-50%, -50%) scale(1);
      opacity: 1;
      filter: grayscale(0%);
    }
  }

  @keyframes slideFromRight {
    0% {
      transform: translate(calc(-50% + 18px), -50%) scale(0.78);
      opacity: 0.5;
      filter: grayscale(100%);
    }
    100% {
      transform: translate(-50%, -50%) scale(1);
      opacity: 1;
      filter: grayscale(0%);
    }
  }

  @keyframes ghostToMain {
    0% {
      transform: translate(var(--start-x), -50%) scale(var(--start-scale));
      opacity: var(--start-opacity);
      filter: grayscale(100%);
    }
    100% {
      transform: translate(-50%, -50%) scale(1);
      opacity: 1;
      filter: grayscale(0%);
    }
  }

  @keyframes mainToGhost {
    0% {
      transform: translate(-50%, -50%) scale(1);
      opacity: 1;
      filter: grayscale(0%);
    }
    100% {
      transform: translate(var(--end-x), -50%) scale(var(--end-scale));
      opacity: var(--end-opacity);
      filter: grayscale(100%);
    }
  }

  @keyframes ghostShiftLeft {
    0% {
      opacity: var(--start-opacity);
      transform: translate(var(--start-x), -50%) scale(var(--start-scale));
      filter: grayscale(100%);
    }
    100% {
      opacity: var(--end-opacity);
      transform: translate(var(--end-x), -50%) scale(var(--end-scale));
      filter: grayscale(100%);
    }
  }

  @keyframes ghostShiftRight {
    0% {
      opacity: var(--start-opacity);
      transform: translate(var(--start-x), -50%) scale(var(--start-scale));
      filter: grayscale(100%);
    }
    100% {
      opacity: var(--end-opacity);
      transform: translate(var(--end-x), -50%) scale(var(--end-scale));
      filter: grayscale(100%);
    }
  }

  @keyframes fadeOut {
    0% {
      opacity: var(--start-opacity, 0.2);
    }
    100% {
      opacity: 0;
    }
  }

  @keyframes fadeIn {
    0% {
      opacity: 0;
    }
    100% {
      opacity: var(--end-opacity, 0.2);
    }
  }
}

/* ==================== DEBUG PANEL ==================== */
.debug-panel {
  display: none;
  position: fixed;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 10px;
  border-radius: 5px;
  z-index: 10000;
  font-family: monospace;
  font-size: 12px;
}

.debug-panel-title {
  margin-bottom: 10px;
  font-weight: bold;
}

.debug-btn {
  margin: 2px;
  padding: 5px;
  font-size: 11px;
  cursor: pointer;
  border: 1px solid #555;
  background: #333;
  color: white;
  border-radius: 3px;
  transition: var(--transition-default);
}

.debug-btn:hover {
  background: #555;
}

/* ==================== SECÇÃO DE PREVISÕES ==================== */

.predictions-card {
  margin-top: 20px;
}

.predictions-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.predictions-sim-count {
  font-size: 0.75em;
  color: #666;
  font-weight: 500;
  background: rgba(42, 82, 152, 0.1);
  padding: 6px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

.predictions-filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 -5px;
}

/* Slider de Equipas */
.team-slider-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  border-radius: 12px;
  --gap1: 90px;
  --gap2: 155px;
  --gap3: 200px;
}

.team-slider-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  position: relative;
  width: 100%;
  max-width: 400px;
  height: 220px;
  overflow: visible;
}

.slider-arrow {
  background: transparent;
  color: #2a5298;
  border: none;
  width: 45px;
  height: 45px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 10;
  opacity: 0.7;
  position: absolute;
  top: calc(50% - 80px);
  transform: translateY(-50%);
}

.slider-prev {
  left: calc(50% - 220px);
}

.slider-next {
  right: calc(50% - 220px);
}

.slider-arrow svg {
  width: 100%;
  height: 100%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.slider-arrow:hover:not(:disabled) {
  opacity: 1;
  transform: translateY(-50%) scale(1.15);
}

.slider-arrow:hover:not(:disabled) svg {
  filter: drop-shadow(0 2px 4px rgba(42, 82, 152, 0.3));
}

.slider-arrow:active:not(:disabled) {
  transform: translateY(-50%) scale(0.9);
}

.slider-arrow:disabled {
  color: #ccc;
  cursor: not-allowed;
  opacity: 0.3;
}

.slider-arrow:focus-visible {
  outline: 2px solid #2a5298;
  outline-offset: 4px;
  border-radius: 4px;
}

.team-slider-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0px;
  flex: 0 0 auto;
  z-index: 5;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* Animações de deslizamento suaves */
@keyframes slideToLeft {
  0% {
    transform: translate(var(--start-x), -50%) scale(var(--start-scale));
    opacity: 1;
    filter: grayscale(0%);
  }
  100% {
    transform: translate(var(--end-x), -50%) scale(var(--end-scale));
    opacity: 0.5;
    filter: grayscale(100%);
  }
}

@keyframes slideToRight {
  0% {
    transform: translate(var(--start-x), -50%) scale(var(--start-scale));
    opacity: 1;
    filter: grayscale(0%);
  }
  100% {
    transform: translate(var(--end-x), -50%) scale(var(--end-scale));
    opacity: 0.5;
    filter: grayscale(100%);
  }
}

@keyframes slideFromLeft {
  0% {
    transform: translate(calc(-50% - 80px), -50%) scale(0.7);
    opacity: 0.5;
    filter: grayscale(100%);
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    filter: grayscale(0%);
  }
}

@keyframes slideFromRight {
  0% {
    transform: translate(calc(-50% + 80px), -50%) scale(0.7);
    opacity: 0.5;
    filter: grayscale(100%);
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    filter: grayscale(0%);
  }
}

/* Animações dos ghosts entre posições */
/* Classe para ghosts tempor\u00e1rios que come\u00e7am invis\u00edveis */
.temp-ghost-invisible {
  opacity: 0;
}

@keyframes ghostShiftLeft {
  0% {
    opacity: var(--start-opacity);
    transform: translate(var(--start-x), -50%) scale(var(--start-scale));
    filter: grayscale(100%);
  }
  100% {
    opacity: var(--end-opacity);
    transform: translate(var(--end-x), -50%) scale(var(--end-scale));
    filter: grayscale(100%);
  }
}

@keyframes ghostShiftRight {
  0% {
    opacity: var(--start-opacity);
    transform: translate(var(--start-x), -50%) scale(var(--start-scale));
    filter: grayscale(100%);
  }
  100% {
    opacity: var(--end-opacity);
    transform: translate(var(--end-x), -50%) scale(var(--end-scale));
    filter: grayscale(100%);
  }
}

@keyframes ghostToMain {
  0% {
    transform: translate(var(--start-x), -50%) scale(var(--start-scale));
    opacity: var(--start-opacity);
    filter: grayscale(100%);
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    filter: grayscale(0%);
  }
}

@keyframes mainToGhost {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    filter: grayscale(0%);
  }
  100% {
    transform: translate(var(--end-x), -50%) scale(var(--end-scale));
    opacity: var(--end-opacity);
    filter: grayscale(100%);
  }
}

@keyframes fadeOut {
  0% {
    opacity: var(--start-opacity, 0.2);
  }
  100% {
    opacity: 0;
  }
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: var(--end-opacity, 0.2);
  }
}

.team-slider-emblem {
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  position: absolute;
  left: 50%;
  top: calc(50% + 40px);
  transform: translate(-50%, -50%) scale(1);
  z-index: 5;
  --start-x: -50%;
  --start-scale: 1;
  --end-x: -50%;
  --end-scale: 1;
}

.team-slider-emblem.slide-left {
  animation: slideToLeft 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.team-slider-emblem.slide-right {
  animation: slideToRight 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.team-slider-emblem.enter-from-left {
  animation: slideFromLeft 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.team-slider-emblem.enter-from-right {
  animation: slideFromRight 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.team-slider-emblem img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
  transition: all 0.3s ease;
  opacity: 1;
}

.team-slider-emblem img[src*="EGI-07.png"] {
  padding: 45px;
  box-sizing: border-box;
}

.team-slider-fallback {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

.team-slider-ghost {
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  position: absolute;
  top: calc(50% + 40px);
  pointer-events: none;
  filter: grayscale(100%);
  transition: opacity 0.3s ease;
}

/* Posicionamento e tamanhos dos ghosts */
.ghost-left-3 {
  left: 50%;
  transform: translate(calc(-50% - var(--gap3)), -50%) scale(0.35);
  opacity: 0.2;
  z-index: 1;
}

.ghost-left-2 {
  left: 50%;
  transform: translate(calc(-50% - var(--gap2)), -50%) scale(0.5);
  opacity: 0.35;
  z-index: 2;
}

.ghost-left-1 {
  left: 50%;
  transform: translate(calc(-50% - var(--gap1)), -50%) scale(0.7);
  opacity: 0.5;
  z-index: 3;
}

.ghost-right-1 {
  left: 50%;
  transform: translate(calc(-50% + var(--gap1)), -50%) scale(0.7);
  opacity: 0.5;
  z-index: 3;
}

.ghost-right-2 {
  left: 50%;
  transform: translate(calc(-50% + var(--gap2)), -50%) scale(0.5);
  opacity: 0.35;
  z-index: 2;
}

.ghost-right-3 {
  left: 50%;
  transform: translate(calc(-50% + var(--gap3)), -50%) scale(0.35);
  opacity: 0.2;
  z-index: 1;
}

.team-slider-ghost img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.team-slider-ghost img[src*="EGI-07.png"] {
  padding: 45px;
  box-sizing: border-box;
}

.team-slider-ghost-emblem {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
  opacity: 1;
}

@keyframes emblemFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.team-slider-ghost-emblem[src*="EGI-07.png"] {
  padding: 45px;
  box-sizing: border-box;
}

.team-slider-name {
  font-size: 1.3em;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  width: 250px;
  line-height: 1.2;
  color: #2a5298;
  margin-bottom: 10px;
  height: 3.6em;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  z-index: 10;
  top: -115px;
  left: 50%;
  transform: translateX(-50%);
}

.favorite-star-btn {
  position: absolute;
  right: -20px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 1.2em;
  transition: all 0.2s ease;
  z-index: 11;
}

.favorite-star-btn:hover {
  transform: translateY(-50%) scale(1.2);
}

/* Estatísticas Gerais */
.predictions-stats-section {
  margin-bottom: 40px;
}

.predictions-section-title {
  font-size: 1.4em;
  font-weight: 700;
  color: #2a5298;
  text-align: center;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 2px;
  position: relative;
  padding-bottom: 12px;
}

.predictions-section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #2a5298, transparent);
}

.predictions-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 5px 15px;
  padding: 0px 15px;
}

.stat-card {
  background: white;
  border: 2px solid rgba(42, 82, 152, 0.1);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(42, 82, 152, 0.15);
  border-color: rgba(42, 82, 152, 0.3);
}

.stat-label {
  font-size: 0.85em;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  font-weight: 600;
}

.stat-value {
  font-size: 2em;
  font-weight: 700;
  color: #2a5298;
  margin-bottom: 5px;
}

.stat-description {
  font-size: 0.75em;
  color: #999;
  font-style: italic;
}

/* Tabela de Previsões */
.predictions-table-section {
  margin-top: -20px;
}

.team-history-section {
  margin-top: 6px;
  margin-bottom: 20px;
}

.predictions-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.predictions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1em;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  overflow: hidden;
}

.predictions-table th {
  padding: 3px 3px;
  background: linear-gradient(135deg, #1e3c72, #2a5298);
  color: white;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85em;
  letter-spacing: 0.5px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 10;
  border: none;
}

.predictions-table th:first-child {
  border-top-left-radius: 6px;
}

.predictions-table th:last-child {
  border-top-right-radius: 6px;
}

.predictions-table th:nth-child(3) {
  text-align: left;
}

.predictions-table th:first-child,
.predictions-table td:first-child {
  width: 70px;
  max-width: 70px;
}

.predictions-table td {
  padding: 1px 1px;
  text-align: center;
  border-bottom: 1px solid #e2e8f0;
  height: auto;
  min-height: 46px;
  vertical-align: middle;
  background: white;
}

.predictions-table td:nth-child(3) {
  text-align: left;
}

.predictions-table tbody tr {
  transition: background-color 0.2s ease;
}

.predictions-table tbody tr:hover {
  background-color: rgba(42, 82, 152, 0.08);
  cursor: pointer;
}

.predictions-table tbody tr:last-child td {
  border-bottom: none;
}

.prediction-opponent {
  display: flex;
  align-items: center;
  gap: 10px;
}

.prediction-opponent-emblem {
  width: 62px;
  height: 50px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}

.prediction-opponent-emblem[src*="EGI-07.png"] {
  padding: 11px;
  box-sizing: border-box;
}

.prediction-opponent-name {
  font-weight: 500;
  text-align: left;
}

.team-history-table th:nth-child(2),
.team-history-table td:nth-child(2) {
  width: 62px;
  max-width: 62px;
  text-align: center;
}

.team-history-table th:nth-child(3),
.team-history-table td:nth-child(3) {
  width: 100px;
  max-width: 100px;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-history-table th:nth-child(4),
.team-history-table td:nth-child(4) {
  text-align: left;
}

.team-history-table th:first-child,
.team-history-table td:first-child {
  width: 110px;
  max-width: 110px;
}

.team-history-location {
  font-size: 0.92em;
  color: #475569;
}

.team-history-result-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
  font-weight: 700;
}

.team-history-result-unknown {
  background: rgba(245, 158, 11, 0.14);
  color: #92400e;
}

.team-history-elo-delta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.12);
  color: #475569;
}

.team-history-elo-delta.positive {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.team-history-elo-delta.negative {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.team-history-elo-delta.neutral {
  background: rgba(148, 163, 184, 0.12);
  color: #475569;
}

/* Compact mode on mobile: keep full-data tables in normal mode (with horizontal scroll) */
@media (max-width: 600px) {
  body.compact-mode .team-history-table th:nth-child(3),
  body.compact-mode .team-history-table td:nth-child(3),
  body.compact-mode .team-history-table th:nth-child(6),
  body.compact-mode .team-history-table td:nth-child(6) {
    display: none;
  }

  body.compact-mode .team-history-result-badge,
  body.compact-mode .team-history-elo-delta {
    min-width: 52px;
    padding: 4px 7px;
    font-size: 0.88em;
  }
}

@media (max-width: 400px) {
  body.compact-mode .team-history-table th:nth-child(2),
  body.compact-mode .team-history-table td:nth-child(2) {
    display: none;
  }

  body.compact-mode .team-history-table th:first-child,
  body.compact-mode .team-history-table td:first-child {
    width: 80px;
    max-width: 80px;
  }
}

.prediction-prob {
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  display: inline-block;
  min-width: 60px;
  text-align: center;
  font-size: 0.9em;
}

.prediction-prob.high {
  background-color: rgba(76, 175, 80, 0.15);
  color: #4caf50;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.prediction-prob.medium {
  background-color: rgba(255, 193, 7, 0.15);
  color: #f57c00;
  border: 1px solid rgba(255, 193, 7, 0.3);
}

.prediction-prob.low {
  background-color: rgba(244, 67, 54, 0.15);
  color: #f44336;
  border: 1px solid rgba(244, 67, 54, 0.3);
}

.no-predictions-message {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  font-size: 1.1em;
}

/* Tooltip das Previsões */
.predictions-tooltip {
  position: fixed !important;
  z-index: 99999 !important;
  pointer-events: none !important;
  animation: tooltipFadeIn 0.2s ease;
  display: none !important;
}

.predictions-tooltip[style*="display: block"] {
  display: block !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.predictions-tooltip > div {
  background: white;
  border-radius: 8px;
  padding: 10px;
  width: 300px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  border: 1px solid #e2e8f0;
  max-height: 600px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

[id^="predictions-tooltip-chart"] {
  flex-shrink: 0;
}

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
/* Responsividade */
@media (max-width: 768px) {
  /* ========== AJUSTES PREVISÕES TABLET ========== */

  .team-slider-container {
    padding: 20px 15px;
    --gap1: 70px;
    --gap2: 125px;
    --gap3: 165px;
  }

  .calendar-sort-toggle {
    gap: 8px;
  }

  .calendar-sort-btn {
    width: calc(50% - 6px);
    min-width: 150px;
  }

  .team-slider-display {
    height: 180px;
  }

  /* Emblema principal */
  .team-slider-emblem {
    width: 160px;
    height: 160px;
    top: calc(50% + 30px);
  }

  .team-slider-emblem img[src*="EGI-07.png"] {
    padding: 35px;
  }

  /* Ghosts */
  .team-slider-ghost {
    width: 160px;
    height: 160px;
    top: calc(50% + 30px);
  }

  .ghost-left-3 {
    left: 50%;
    transform: translate(calc(-50% - var(--gap3)), -50%) scale(0.3);
    opacity: 0.2;
  }

  .ghost-left-2 {
    left: 50%;
    transform: translate(calc(-50% - var(--gap2)), -50%) scale(0.45);
    opacity: 0.3;
  }

  .ghost-left-1 {
    left: 50%;
    transform: translate(calc(-50% - var(--gap1)), -50%) scale(0.65);
    opacity: 0.45;
  }

  .ghost-right-1 {
    left: 50%;
    transform: translate(calc(-50% + var(--gap1)), -50%) scale(0.65);
    opacity: 0.45;
  }

  .ghost-right-2 {
    left: 50%;
    transform: translate(calc(-50% + var(--gap2)), -50%) scale(0.45);
    opacity: 0.3;
  }

  .ghost-right-3 {
    left: 50%;
    transform: translate(calc(-50% + var(--gap3)), -50%) scale(0.3);
    opacity: 0.2;
  }

  .team-slider-ghost img[src*="EGI-07.png"] {
    padding: 35px;
    box-sizing: border-box;
  }

  .team-slider-ghost-emblem[src*="EGI-07.png"] {
    padding: 16px;
    box-sizing: border-box;
  }

  /* Nome da equipa */
  .team-slider-name {
    font-size: 0.95em;
    width: 180px;
    height: 3.4em;
    top: -95px;
  }

  /* Setas */
  .slider-arrow {
    width: 40px;
    height: 40px;
    top: calc(50% - 70px);
  }

  .slider-prev {
    left: calc(50% - 140px);
  }

  .slider-next {
    right: calc(50% - 140px);
  }

  /* Animações ajustadas para tablet */
  @keyframes slideFromLeft {
    0% {
      transform: translate(calc(-50% - 20px), -50%) scale(0.75);
      opacity: 0.5;
      filter: grayscale(100%);
    }
    100% {
      transform: translate(-50%, -50%) scale(1);
      opacity: 1;
      filter: grayscale(0%);
    }
  }

  @keyframes slideFromRight {
    0% {
      transform: translate(calc(-50% + 20px), -50%) scale(0.75);
      opacity: 0.5;
      filter: grayscale(100%);
    }
    100% {
      transform: translate(-50%, -50%) scale(1);
      opacity: 1;
      filter: grayscale(0%);
    }
  }

  /* Stats e tabela */
  .predictions-stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px 12px;
    padding: 12px;
  }

  .stat-card {
    padding: 15px;
  }

  .stat-value {
    font-size: 1.6em;
  }

  .predictions-table {
    font-size: 0.85em;
  }

  .predictions-table th,
  .predictions-table td {
    padding: 8px 5px;
    min-height: 42px;
  }

  .prediction-opponent-emblem {
    width: 42px;
    height: 42px;
  }

  .prediction-opponent-emblem[src*="EGI-07.png"] {
    padding: 10px;
  }

  /* Animações restantes */
  @keyframes slideToLeft {
    0% {
      transform: translate(var(--start-x), -50%) scale(var(--start-scale));
      opacity: 1;
      filter: grayscale(0%);
    }
    100% {
      transform: translate(var(--end-x), -50%) scale(var(--end-scale));
      opacity: 0.5;
      filter: grayscale(100%);
    }
  }

  @keyframes slideToRight {
    0% {
      transform: translate(var(--start-x), -50%) scale(var(--start-scale));
      opacity: 1;
      filter: grayscale(0%);
    }
    100% {
      transform: translate(var(--end-x), -50%) scale(var(--end-scale));
      opacity: 0.5;
      filter: grayscale(100%);
    }
  }

  @keyframes slideFromLeft {
    0% {
      transform: translate(calc(-50% - 40px), -50%) scale(0.7);
      opacity: 0.5;
      filter: grayscale(100%);
    }
    100% {
      transform: translate(-50%, -50%) scale(1);
      opacity: 1;
      filter: grayscale(0%);
    }
  }

  @keyframes slideFromRight {
    0% {
      transform: translate(calc(-50% + 40px), -50%) scale(0.7);
      opacity: 0.5;
      filter: grayscale(100%);
    }
    100% {
      transform: translate(-50%, -50%) scale(1);
      opacity: 1;
      filter: grayscale(0%);
    }
  }

  @keyframes ghostToMain {
    0% {
      transform: translate(var(--start-x), -50%) scale(var(--start-scale));
      opacity: var(--start-opacity);
      filter: grayscale(100%);
    }
    100% {
      transform: translate(-50%, -50%) scale(1);
      opacity: 1;
      filter: grayscale(0%);
    }
  }

  @keyframes mainToGhost {
    0% {
      transform: translate(-50%, -50%) scale(1);
      opacity: 1;
      filter: grayscale(0%);
    }
    100% {
      transform: translate(var(--end-x), -50%) scale(var(--end-scale));
      opacity: var(--end-opacity);
      filter: grayscale(100%);
    }
  }

  @keyframes ghostShiftLeft {
    0% {
      opacity: var(--start-opacity);
      transform: translate(var(--start-x), -50%) scale(var(--start-scale));
      filter: grayscale(100%);
    }
    100% {
      opacity: var(--end-opacity);
      transform: translate(var(--end-x), -50%) scale(var(--end-scale));
      filter: grayscale(100%);
    }
  }

  @keyframes ghostShiftRight {
    0% {
      opacity: var(--start-opacity);
      transform: translate(var(--start-x), -50%) scale(var(--start-scale));
      filter: grayscale(100%);
    }
    100% {
      opacity: var(--end-opacity);
      transform: translate(var(--end-x), -50%) scale(var(--end-scale));
      filter: grayscale(100%);
    }
  }

  @keyframes fadeOut {
    0% {
      opacity: var(--start-opacity, 0.2);
    }
    100% {
      opacity: 0;
    }
  }

  @keyframes fadeIn {
    0% {
      opacity: 0;
    }
    100% {
      opacity: var(--end-opacity, 0.2);
    }
  }

  .predictions-stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 5px 15px;
    padding: 15px;
  }

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

  .predictions-table {
    font-size: 0.8em;
  }

  .predictions-table th,
  .predictions-table td {
    padding: 8px 6px;
    min-height: 40px;
  }

  .prediction-opponent-emblem {
    width: 36px;
    height: 36px;
  }
}

/* ==================== FAVORITE TEAM STYLES ==================== */
.favorite-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2em;
  color: #cbd5e1;
  transition: all 0.2s ease;
  padding: 0 4px;
  margin-right: 4px;
  line-height: 1;
}

.favorite-btn:hover {
  color: #fbbf24;
  transform: scale(1.2);
}

.favorite-btn.active {
  color: #fbbf24;
  text-shadow: 0 0 2px rgba(251, 191, 36, 0.5);
}

.favorite-team-row {
  background-color: rgba(251, 191, 36, 0.05) !important;
  border-left: 3px solid #fbbf24 !important;
}

.favorite-team-row:hover {
  background-color: rgba(251, 191, 36, 0.1) !important;
}

/* Selector no Gráfico */
.team-checkbox.favorite-team-selected {
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.2);
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
}

.team-checkbox.favorite-team-selected::after {
  content: "★";
  color: #fbbf24;
  margin-left: auto;
  font-size: 0.9em;
}

/* Garantir contraste do texto quando favorita e ativa */
.team-checkbox.favorite-team-selected.active {
  color: white;
  font-weight: 600;
  background: rgba(42, 82, 152, 0.95);
  border-color: #fbbf24;
}

.team-checkbox.favorite-team-selected.active .team-name {
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Highlight no Calendário */
.game-card.favorite-team-game {
  border: 2px solid #fbbf24;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.2);
}

/* Highlight na Tabela de Previsões */
.predictions-table tbody tr.favorite-team-prediction {
  background: rgba(251, 191, 36, 0.08);
  border-left: 3px solid #fbbf24;
}

.predictions-table tbody tr.favorite-team-prediction:hover {
  background: rgba(251, 191, 36, 0.15);
}

/* Toast Notification */
#notification-toast {
  visibility: hidden;
  min-width: 250px;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 8px;
  padding: 12px 16px;
  position: fixed;
  z-index: 10000;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  font-size: 0.95em;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition:
    opacity 0.3s,
    bottom 0.3s;
}

#notification-toast.show {
  visibility: visible;
  opacity: 1;
  bottom: 50px;
}

/* Estilo para célula de golos esperados com tooltip */
.expected-goals-cell {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: #4f46e5;
  text-underline-offset: 4px;
  cursor: help;
  color: #4f46e5;
  font-weight: 500;
  transition: all 0.2s ease;
}

.expected-goals-cell:hover {
  background-color: rgba(79, 70, 229, 0.1);
  color: #3730a3;
}
/* ==================== TOOLTIP HISTÓRICO DE CLASSIFICAÇÕES ==================== */
.historical-tooltip {
  position: fixed;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  padding: 0;
  z-index: 10001;
  min-width: 400px;
  max-width: 500px;
  font-family: "Segoe UI", sans-serif;
  pointer-events: auto;
  opacity: 0;
  animation: fadeInTooltip 0.2s ease forwards;
}

@keyframes fadeInTooltip {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.historical-tooltip.fixed {
  border: 2px solid #2563eb;
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.25);
}

.historical-tooltip-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 12px 16px;
  border-bottom: 2px solid #e2e8f0;
  background: linear-gradient(135deg, #f8fafc, #ffffff);
}

.historical-tooltip-emblem {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.historical-tooltip-title {
  font-size: 1.1em;
  font-weight: 600;
  color: #0f172a;
  flex: 1;
}

.historical-tooltip-subtitle {
  font-size: 0.85em;
  color: #64748b;
  padding: 8px 16px;
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.historical-tooltip-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
}

.historical-tooltip-table thead {
  background-color: #f1f5f9;
  border-bottom: 2px solid #cbd5e1;
}

.historical-tooltip-table th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: #475569;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.historical-tooltip-table tbody tr {
  border-bottom: 1px solid #e2e8f0;
  transition: background-color 0.15s ease;
}

.historical-tooltip-table tbody tr:hover {
  background-color: #f8fafc;
}

.historical-tooltip-table tbody tr:last-child {
  border-bottom: none;
  font-weight: 600;
  background-color: #fef3c7;
}

.historical-tooltip-table tbody tr:last-child:hover {
  background-color: #fde68a;
}

.historical-tooltip-table td {
  padding: 10px 12px;
  color: #334155;
}

.historical-tooltip-table td:first-child {
  font-weight: 500;
  color: #1e293b;
}

.historical-general-col {
  font-size: 0.85em;
  color: #475569;
}

.historical-progression-col {
  text-align: center;
  width: 40px;
}

.progression-icon {
  font-size: 1.3em;
  font-weight: bold;
  display: inline-block;
}

.progression-up {
  color: #22c55e;
}

.progression-down {
  color: #ef4444;
}

.progression-same {
  color: #94a3b8;
}

.historical-tooltip-footer {
  padding: 10px 16px;
  text-align: center;
  font-size: 0.8em;
  color: #94a3b8;
  background-color: #f8fafc;
  border-top: 1px solid #e2e8f0;
  border-radius: 0 0 12px 12px;
  font-style: italic;
}

/* Estilo para épocas onde a equipa não participou */
.historical-tooltip-table tbody tr.no-participation {
  opacity: 0.6;
  background-color: #f8fafc;
}

.historical-tooltip-table tbody tr.no-participation:hover {
  background-color: #f1f5f9;
}

/* Cursor para indicar que a célula é clicável */
.team-cell {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.team-cell:hover {
  background-color: rgba(37, 99, 235, 0.05);
}

/* Responsivo */
@media (max-width: 768px) {
  .historical-tooltip {
    min-width: 320px;
    max-width: calc(100vw - 40px);
  }

  .historical-tooltip-table {
    font-size: 0.85em;
  }

  .historical-tooltip-table th,
  .historical-tooltip-table td {
    padding: 8px 6px;
  }

  .historical-tooltip-emblem {
    width: 32px;
    height: 32px;
  }

  .historical-tooltip-title {
    font-size: 1em;
  }

  .progression-icon {
    font-size: 1.1em;
  }
}

/* ==================== LANGUAGE SELECTOR ==================== */
.language-selector {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  gap: 6px;
  z-index: 10;
}

.navbar-language-selector {
  display: flex;
  gap: 4px;
  margin-left: auto;
  padding-left: 10px;
}

.lang-btn {
  background: rgba(42, 82, 152, 0.08);
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 1.3em;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
  opacity: 0.6;
}

.lang-btn:hover {
  opacity: 0.9;
  background: rgba(42, 82, 152, 0.15);
  transform: scale(1.05);
}

.lang-btn.active {
  opacity: 1;
  border-color: #2a5298;
  background: rgba(42, 82, 152, 0.12);
  box-shadow: 0 2px 8px rgba(42, 82, 152, 0.2);
}

@media (max-width: 768px) {
  .language-selector {
    position: static;
    justify-content: center;
    margin-bottom: 10px;
  }

  .navbar-language-selector {
    display: flex;
    gap: 4px;
    margin-left: 8px;
  }

  .lang-btn {
    padding: 4px 8px;
    font-size: 1.1em;
  }
}

/* ==================== NAVBAR ==================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: calc(100% + 40px);
  margin: -20px -20px 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 0 0 14px 14px;
  transition: all 0.3s ease;
}

.navbar-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-primary);
  font-weight: 700;
  font-size: 1.25em;
  letter-spacing: -0.02em;
  margin-right: 20px;
}

.navbar-logo img {
  height: 54px;
  width: 54px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.navbar-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 28px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 10;
}

.navbar-toggle span {
  width: 100%;
  height: 3px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.navbar-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.navbar-toggle.active span:nth-child(2) {
  opacity: 0;
}

.navbar-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

.navbar-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 4px;
}

.navbar-menu li a {
  display: block;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
  font-size: 0.9em;
  position: relative;
}

.navbar-menu li a:hover {
  background: var(--color-bg-light);
  color: var(--color-primary);
  transform: translateY(-1px);
}

.navbar-menu li a:active,
.navbar-menu li a.active {
  background: linear-gradient(
    135deg,
    rgba(37, 99, 235, 0.1),
    rgba(37, 99, 235, 0.05)
  );
  color: var(--color-primary-light);
  font-weight: 600;
}

/* Ajuste do container principal para compensar navbar fixa */
body {
  padding-top: 0;
}

.container {
  margin-top: 25px;
}

/* Mobile responsivo */
@media (max-width: 768px) {
  .navbar-toggle {
    display: flex;
  }

  .navbar-container {
    padding: 0 20px;
    height: 54px;
  }

  .navbar-menu {
    position: fixed;
    top: 54px;
    right: -100%;
    width: 75%;
    max-width: 320px;
    height: calc(100vh - 54px);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    padding: 20px 0;
    gap: 0;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    border-left: 1px solid var(--color-border);
  }

  .navbar-menu.active {
    right: 0;
  }

  .navbar-menu li {
    width: 100%;
  }

  .navbar-menu li a {
    padding: 16px 24px;
    border-radius: 0;
    font-size: 1em;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
  }

  .navbar-menu li a:hover {
    background: var(--color-bg-light);
    transform: none;
    padding-left: 28px;
  }

  .navbar-logo span {
    font-size: 0.95em;
  }

  .navbar-logo img {
    height: 30px;
    width: 30px;
  }

  .container {
    margin-top: 22px;
  }
}

@media (max-width: 480px) {
  .navbar-container {
    padding: 0 15px;
  }

  .navbar-logo {
    gap: 2px;
    font-size: 1em;
  }

  .navbar-logo img {
    height: 36px;
    width: 36px;
  }

  .container {
    margin-top: 22px;
  }
}

/* Smooth scroll para toda a página */
html {
  scroll-behavior: smooth;
}

/* Ajuste das seções para o scroll suave com navbar fixa */
#rankings,
#elo,
#calendar,
#bracket,
#predictions {
  scroll-margin-top: 72px;
}

/* ==================== FOOTER ==================== */
.footer {
  background: #f9f9f9;
  border-top: 1px solid #e0e0e0;
  padding: 16px 20px;
  margin-top: auto;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  text-align: center;
}

.footer-content {
  font-size: 0.85em;
  color: #666;
  max-width: 1200px;
  margin: 0 auto;
  line-height: 1.6;
}

.footer-separator {
  margin: 0 10px;
  color: #999;
}

.footer-link {
  color: #2a5298;
  text-decoration: none;
  font-weight: 600;
}

.footer-link:hover,
.footer-link:focus-visible {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .footer {
    padding: 12px 15px;
  }

  .footer-content {
    font-size: 0.8em;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .footer-separator {
    display: none;
  }
}

/* ==================== MOBILE TOOLTIPS (Alt-texts ao clicar) ==================== */
.mobile-tooltip {
  position: fixed;
  background-color: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  z-index: 10001;
  max-width: 280px;
  word-wrap: break-word;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  transform: translate(-50%, -100%);
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  white-space: pre-wrap;
  text-align: center;
  line-height: 1.4;
  margin-top: -8px;
}

.mobile-tooltip.show {
  opacity: 1;
}
