/* fair_elo.css */
/* === Elo, Power, Watchlist & Falling Tables (identiques) === */
#elo-table, #power-table, #watch-table, #falling-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  color: #e6f0ff;
  background: rgba(19, 46, 87, 0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 1rem;
  overflow: hidden;
  table-layout: fixed;
}

#elo-table thead, #power-table thead, #watch-table thead, #falling-table thead {
  background: rgba(37, 99, 235, 0.25);
}

#elo-table th, #power-table th, #watch-table th, #falling-table th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: .05em;
  color: #bfdbfe;
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  vertical-align: middle;
}

/* Largeurs fixes desktop */
#elo-table th:nth-child(1), #elo-table td:nth-child(1),
#power-table th:nth-child(1), #power-table td:nth-child(1),
#watch-table th:nth-child(1), #watch-table td:nth-child(1),
#falling-table th:nth-child(1), #falling-table td:nth-child(1) { width: 60px; text-align: center; }

#elo-table th:nth-child(2), #elo-table td:nth-child(2),
#power-table th:nth-child(2), #power-table td:nth-child(2),
#watch-table th:nth-child(2), #watch-table td:nth-child(2),
#falling-table th:nth-child(2), #falling-table td:nth-child(2) { width: 200px; text-align: left; }

#elo-table th:nth-child(3), #elo-table td:nth-child(3),
#power-table th:nth-child(3), #power-table td:nth-child(3),
#watch-table th:nth-child(3), #watch-table td:nth-child(3),
#falling-table th:nth-child(3), #falling-table td:nth-child(3) { width: 100px; text-align: center; }

#elo-table th:nth-child(4), #elo-table td:nth-child(4),
#power-table th:nth-child(4), #power-table td:nth-child(4),
#watch-table th:nth-child(4), #watch-table td:nth-child(4),
#falling-table th:nth-child(4), #falling-table td:nth-child(4) { width: 120px; text-align: center; }

#elo-table th:nth-child(5), #elo-table td:nth-child(5),
#power-table th:nth-child(5), #power-table td:nth-child(5),
#watch-table th:nth-child(5), #watch-table td:nth-child(5),
#falling-table th:nth-child(5), #falling-table td:nth-child(5) { width: 120px; text-align: center; }

#elo-table th:nth-child(6), #elo-table td:nth-child(6),
#power-table th:nth-child(6), #power-table td:nth-child(6),
#watch-table th:nth-child(6), #watch-table td:nth-child(6),
#falling-table th:nth-child(6), #falling-table td:nth-child(6) { width: 160px; text-align: left; }

#elo-table tbody tr, #power-table tbody tr, #watch-table tbody tr, #falling-table tbody tr {
  transition: background .25s ease;
}
#elo-table tbody tr:hover, #power-table tbody tr:hover, #watch-table tbody tr:hover, #falling-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.12);
}

#elo-table td, #power-table td, #watch-table td, #falling-table td {
  padding: 0.45rem 0.4rem;
  font-size: 0.82rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  vertical-align: middle;
  line-height: 1.2;
}

/* Colonne équipe */
#elo-table td.team-col div, #power-table td.team-col div, #watch-table td.team-col div, #falling-table td.team-col div {
  display: flex;
  align-items: center;
  gap: .35rem;
}
#elo-table td.team-col img, #power-table td.team-col img, #watch-table td.team-col img, #falling-table td.team-col img {
  height: 20px;
  width: 20px;
  object-fit: contain;
}
.team-name-full { display: inline; }
.team-name-short { display: none; font-weight: 600; }

/* Pagination */
#elo-toolbar {
  display:flex;
  gap:.5rem;
  justify-content:center;
  align-items:center;
  margin-bottom:1rem;
}
#elo-toolbar button {
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  border-radius: 0.5rem;
  padding: .35rem .7rem;
  color: #e2e8f0;
  font-weight: 600;
  transition: all 0.25s ease;
}
#elo-toolbar button:hover:not(:disabled) {
  background: rgba(255,255,255,0.15);
  color: #fff;
}
#elo-toolbar button:disabled { opacity: .35; cursor: not-allowed; }

#elo-pagination {
  display:flex; gap:.35rem; justify-content:center; margin-top:1rem;
}
#elo-pagination button {
  padding: .35rem .65rem;
  border-radius: .4rem;
  background: rgba(255,255,255,0.08);
  color: #cbd5e1;
  transition: all .2s ease;
}
#elo-pagination button:hover { background: rgba(255,255,255,0.15); color:#fff; }
#elo-pagination button.active {
  background: linear-gradient(135deg, var(--color-green), #16a34a);
  color:#fff;
  box-shadow: 0 0 8px rgba(34,197,94,0.35);
}

/* Search bar */
#search-container {
  position: relative;
  width: 100%;
  max-width: 340px;
  margin: 0 auto 1rem auto;
}
#elo-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  margin-top: .25rem;
  background: rgba(255,255,255,0.95);
  color: #000;
  border-radius: .5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  max-height: 250px;
  overflow-y: auto;
  display: none;
  z-index: 50;
}
#elo-search-results div {
  padding: .4rem .6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .5rem;
}
#elo-search-results div:hover { background: #e2e8f0; }

/* Mobile responsive */
@media (max-width: 640px) {
  #elo-table th:nth-child(1), #elo-table td:nth-child(1),
  #power-table th:nth-child(1), #power-table td:nth-child(1),
  #watch-table th:nth-child(1), #watch-table td:nth-child(1),
  #falling-table th:nth-child(1), #falling-table td:nth-child(1) { width: 35px; }

  #elo-table th:nth-child(2), #elo-table td:nth-child(2),
  #power-table th:nth-child(2), #power-table td:nth-child(2),
  #watch-table th:nth-child(2), #watch-table td:nth-child(2),
  #falling-table th:nth-child(2), #falling-table td:nth-child(2) { width: 70px; }

  #elo-table th:nth-child(3), #elo-table td:nth-child(3),
  #power-table th:nth-child(3), #power-table td:nth-child(3),
  #watch-table th:nth-child(3), #watch-table td:nth-child(3),
  #falling-table th:nth-child(3), #falling-table td:nth-child(3) { width: 70px; }

  #elo-table th:nth-child(4), #elo-table td:nth-child(4),
  #power-table th:nth-child(4), #power-table td:nth-child(4),
  #watch-table th:nth-child(4), #watch-table td:nth-child(4),
  #falling-table th:nth-child(4), #falling-table td:nth-child(4) { width: 70px; }

  #elo-table th:nth-child(5), #elo-table td:nth-child(5),
  #power-table th:nth-child(5), #power-table td:nth-child(5),
  #watch-table th:nth-child(5), #watch-table td:nth-child(5),
  #falling-table th:nth-child(5), #falling-table td:nth-child(5) { width: 70px; }

  #elo-table th:nth-child(6), #elo-table td:nth-child(6),
  #power-table th:nth-child(6), #power-table td:nth-child(6),
  #watch-table th:nth-child(6), #watch-table td:nth-child(6),
  #falling-table th:nth-child(6), #falling-table td:nth-child(6) { display: none; }

  .team-name-full { display: none; }
  .team-name-short { display: inline; }
}

/* Cache le tableau Power Ranking tant qu'il n'est pas rempli */
#power-table { display: none; }
#power-table.loaded { display: table; }