/* ==== POOL‑TABELL ==================================================== */
.table-wrapper {
  overflow-x: auto;
  margin-bottom: 30px;
}

.pool-results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
}

.pool-results-table th,
.pool-results-table td {
  border: 1px solid #ddd;
  padding: 8px 10px;
}

.pool-results-table th {
  background: #e9ecef;
  font-weight: 600;
  white-space: nowrap;
}

.pool-results-table tr:nth-child(even) {
  background: #f8f9fa;
}

.pool-results-table td:first-child,
.pool-results-table th:first-child {
  width: 40px;
  text-align: center;
}

.pool-results-table .center {
  text-align: center;
}

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

.player-club {
  font-size: .85rem;
  color: #555;
}

.player-click {
  cursor: pointer;
  font-weight: bold;
  color: #0056b3;
  border-radius: 6px;
}

.player-click:hover,
.player-click:focus {
  background: #e7f0fa;
  color: #007bff;
}

/* Loader & felmeddelande */
.loader {
  text-align: center;
  padding: 30px;
  font-style: italic;
  color: #666;
}

.error {
  color: red;
  font-weight: bold;
}

.pool-results-table {
  width: 100%;
}

/* Kolumnbredder */
.pool-results-table th:nth-child(1),
.pool-results-table td:nth-child(1) {
  width: 40px;   /* Nr */
}

/* Uppdaterade kolumnbredder efter borttagning av näst sista kolumn */
.pool-results-table th:nth-child(3),
.pool-results-table td:nth-child(3),
.pool-results-table th:nth-child(4),
.pool-results-table td:nth-child(4),
.pool-results-table th:nth-child(5),
.pool-results-table td:nth-child(5),
.pool-results-table th:nth-child(6),
.pool-results-table td:nth-child(6) {
  width: 60px;  /* K, V, T, Poäng */
}

/* Spelarkolumnen (kolumn 2) */
.pool-results-table td:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 0;
}

/* Animerad inladdning */
@keyframes fadeInRows {
  from { opacity: 0 }
  to { opacity: 1 }
}

.pool-results-table tbody.fade-in {
  animation: fadeInRows .25s ease;
}

/* Mobilvyer */
/* ==== POOL‑TABELL ==================================================== */
/* ... befintliga stilar för desktop behålls som de är ... */

@media (max-width: 600px) {
  .pool-results-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    table-layout: auto;
    background: #fff;
    box-sizing: border-box;
    padding-bottom: 1px;
  }

  .pool-results-table th,
  .pool-results-table td {
    white-space: nowrap;
    font-size: 0.85rem;
    padding: 8px 4px; /* Mindre padding på mobil */
    border: 1px solid #ddd;
    background: #fff;
  }

  /* Justera bredderna för kolumner utom spelarnamn */
  .pool-results-table th:nth-child(1),
  .pool-results-table td:nth-child(1) {
    width: 30px; /* Nr - smalare */
    min-width: 30px;
  }

  /* Statistik-kolumner (K, V, T, P) - hälften så breda */
  .pool-results-table th:nth-child(3),
  .pool-results-table td:nth-child(3),
  .pool-results-table th:nth-child(4),
  .pool-results-table td:nth-child(4),
  .pool-results-table th:nth-child(5),
  .pool-results-table td:nth-child(5),
  .pool-results-table th:nth-child(6),
  .pool-results-table td:nth-child(6) {
    width: 30px; /* Hälften av 60px */
    min-width: 30px;
  }

  /* Spelarnamn-kolumnen får mer utrymme */
  .pool-results-table td:nth-child(2) {
    max-width: none;
    min-width: 120px; /* Mer utrymme för namn */
  }

  /* Ändra "Poeng" till "P" i tabellhuvudet */
  .pool-results-table th:nth-child(6)::after {
    content: "P";
    display: inline;
  }
  .pool-results-table th:nth-child(6) span {
    display: none; /* Dölj originaltexten */
  }

  .pool-results-table thead,
  .pool-results-table tbody {
    display: table;
    width: 100%;
  }

  .pool-results-table tr {
    height: auto !important;
  }
}