/* === Table Styles · Light Theme === */

.table-container {
  overflow-x: auto;
  margin: clamp(1rem, 2vw, 1.5rem) 0;
  position: relative;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #ebebeb;
}

thead {
  background: #f9f9fb;
  color: #0d0d0d;
  border-bottom: 1px solid #ebebeb;
}

th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  font-size: 0.82em;
  letter-spacing: 0.01em;
  color: #6e6e80;
}

th:hover {
  background: #f0f0f2;
}

th.sortable::after {
  content: ' ↕';
  opacity: 0.4;
  font-size: 0.85em;
  color: #999;
}

th.sort-asc::after {
  content: ' ↑';
  opacity: 1;
  color: #0d0d0d;
}

th.sort-desc::after {
  content: ' ↓';
  opacity: 1;
  color: #0d0d0d;
}

td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #f0f0f0;
  color: #0d0d0d;
}

tbody tr {
  transition: background 0.12s ease;
}

tbody tr:hover {
  background: #f9f9fb;
}

tbody tr:nth-child(even) {
  background: #fafafa;
}

tbody tr:nth-child(even):hover {
  background: #f5f5f5;
}

.rank-cell {
  font-weight: 600;
  color: #6e6e80;
  text-align: center;
  width: 60px;
}

.rank-cell.rank-1 {
  color: #b8a060;
  font-size: 1.05em;
}

.rank-cell.rank-2 {
  color: #8a8a8a;
  font-size: 1.02em;
}

.rank-cell.rank-3 {
  color: #b08d6b;
  font-size: 1.02em;
}

.score-cell {
  font-weight: 500;
  text-align: right;
}

.score-cell.high {
  color: #16a34a;
}

.score-cell.medium {
  color: #b8a060;
}

.score-cell.low {
  color: #dc2626;
}

.name-cell {
  font-weight: 500;
  color: #0d0d0d;
}

.empty-state {
  text-align: center;
  padding: clamp(2rem, 4vw, 3rem);
  color: #999;
  border: 1px dashed #d0d0d0;
  border-radius: 10px;
  background: #fafafa;
}

.empty-state p {
  font-size: 1em;
  margin-top: 0.75rem;
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.table-toolbar .search-box {
  flex: 1;
  min-width: 200px;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  font-size: 0.9em;
  background: #ffffff;
  color: #0d0d0d;
  font-family: inherit;
}

.table-toolbar .search-box::placeholder {
  color: #999;
}

.table-toolbar .search-box:focus {
  outline: none;
  border-color: #b8a060;
  box-shadow: 0 0 0 3px rgba(184, 160, 96, 0.12);
}

.table-toolbar .info {
  color: #999;
  font-size: 0.88em;
}

@media (max-width: 768px) {
  .table-container {
    font-size: 0.9em;
  }

  th, td {
    padding: 0.5rem 0.6rem;
  }

  th:first-child,
  td:first-child {
    position: sticky;
    left: 0;
    background: inherit;
    z-index: 1;
  }
}
