.player-stats-panel {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.player-stats-body {
  padding: 14px 0 0;
}

.stats-controls-card,
.stats-card {
  margin-inline: 0;
  border: 0;
  border-radius: 7px;
  background: var(--card-bg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  overflow: hidden;
  padding: 0;
}

.stats-controls-card {
  margin-bottom: 24px;
}

.stats-content {
  border-radius: 7px;
  background: transparent;
  overflow: hidden;
}

.stats-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 0 16px;
  border-bottom: 0;
}

.stats-view-title {
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 800;
}

.stats-summary {
  color: var(--muted);
  font-size: var(--text-normal);
}

.stats-toggle,
.stats-scope-toggle {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  border: 0;
  border-radius: 6px;
  overflow: hidden;
}

.stats-scope-toggle {
  grid-template-columns: repeat(5, minmax(68px, 1fr));
}

.stats-toolbar-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.qualified-filter {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  color: #aebfe5;
  background: #1b222d;
  display: inline-flex;
  align-items: center;
  padding: 4px;
  font-size: var(--text-small);
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.qualified-filter input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.qualified-filter span {
  position: relative;
  min-height: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px 0 11px;
}

.qualified-filter span::before {
  content: "";
  width: 30px;
  height: 18px;
  border-radius: 999px;
  background: #4f5a6c;
  transition: background-color 160ms ease;
}

.qualified-filter span::after {
  content: "";
  position: absolute;
  left: 14px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #d7dde1;
  transition: background-color 160ms ease, transform 160ms ease;
}

.qualified-filter input:checked + span {
  color: #fff;
  background: #101720;
  box-shadow: inset 0 0 0 1px rgba(196, 206, 211, 0.08);
}

.qualified-filter input:checked + span::before {
  background: var(--control-active-border);
}

.qualified-filter input:checked + span::after {
  background: #67e8a2;
  transform: translateX(12px);
}

.qualified-filter:hover span {
  color: #fff;
}

.qualified-filter input:focus-visible + span {
  outline: 2px solid var(--line-bright);
  outline-offset: 2px;
}

.stats-toggle-button,
.stats-scope-button {
  min-height: 38px;
  border: 0;
  color: var(--ink);
  background: var(--card-bg-strong);
  padding: 0 16px;
  font-size: var(--text-small);
  font-weight: 800;
}

.stats-toggle-button:hover,
.stats-toggle-button:focus,
.stats-scope-button:hover,
.stats-scope-button:focus {
  color: #fff;
  background: rgba(196, 206, 211, 0.12);
}

.stats-toggle-button.active,
.stats-scope-button.active {
  color: var(--control-active-ink);
  background: var(--control-active-bg);
}

.stats-table-shell {
  width: 100%;
  overflow-x: auto;
  border-radius: 7px;
  background: transparent;
  padding-inline: 0;
  scrollbar-color: var(--line-bright) var(--card-bg-strong);
}

.mobile-stat-leaderboard {
  display: none;
}

.player-stats-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: auto;
}

.player-stats-table th,
.player-stats-table td {
  border-bottom: 0;
  padding: 10px 9px;
  text-align: center;
  white-space: nowrap;
}

.player-stats-table th {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: var(--text-small);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.player-stats-table td {
  color: #dfe4f4;
  font-size: var(--text-normal);
}

.player-stats-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.018);
}

.player-stats-table tbody tr.is-yankees-row {
  background: rgba(29, 79, 120, 0.24);
}

.player-stats-table tbody tr.is-yankees-row .player-cell :is(a, strong),
.player-stats-table tbody tr.is-yankees-row .team-code {
  color: #a8caff !important;
}

.player-stats-table tbody tr:hover td {
  background: rgba(196, 206, 211, 0.06);
}

.player-stats-table th.is-sort-column {
  color: #f1b434;
  background: rgba(241, 180, 52, 0.14);
}

.player-stats-table td.is-sort-column {
  color: #fff;
  background: rgba(241, 180, 52, 0.08);
  font-weight: 800;
}

.player-stats-table tbody tr:hover td.is-sort-column {
  background: rgba(241, 180, 52, 0.14);
}

.player-stats-table tr:last-child td {
  border-bottom: 0;
}

.player-stats-table th:first-child,
.player-stats-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 1%;
  min-width: 0;
  padding-right: 50px;
  text-align: left;
  background: #0e1419;
}

.player-stats-table th:first-child {
  z-index: 3;
  background: #12191f;
}

.player-stats-table tbody tr:nth-child(even) td:first-child {
  background: #11181e;
}

.player-stats-table tbody tr.is-yankees-row td:first-child {
  background: #102235;
}

.player-cell {
  display: flex;
  align-items: center;
  gap: 9px;
}

.player-cell a {
  overflow: hidden;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  text-overflow: ellipsis;
}

.player-cell a:hover,
.player-cell a:focus {
  color: #fff;
}

.team-code {
  color: var(--yankees-silver) !important;
  font-size: var(--text-small);
  font-weight: 800;
  letter-spacing: 0.06em;
}

.sort-button {
  width: 100%;
  border: 0;
  color: inherit;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

.sort-button:hover,
.sort-button:focus,
.sort-button.active {
  color: var(--control-active-ink);
}

.sort-icon {
  color: #77889a;
  font-size: .68rem;
  font-weight: 900;
  line-height: 1;
}

.sort-button.active .sort-icon {
  color: var(--control-active-ink);
  font-size: .78rem;
}

.stats-pagination {
  width: 100%;
  min-height: 46px;
  border-top: 0;
  display: grid;
  grid-template-columns: 36px minmax(0, 180px) 36px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px;
}

.stats-pagination[hidden] {
  display: none;
}

.stats-pagination .pagination-summary {
  min-width: 0;
  min-height: 36px;
  display: grid;
  place-items: center;
  padding: 0 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

@media (min-width: 576px) {
  .stats-pagination {
    width: fit-content;
    margin: 10px auto;
  }
}

.page-button {
  width: 36px;
  min-width: 36px;
  height: 36px;
  border: 0;
  color: var(--muted);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 3px;
  font-size: 1.45rem;
  line-height: 1;
  font-weight: 800;
}

.page-button:hover,
.page-button:focus {
  color: #fff;
}

.page-button:disabled {
  color: rgba(167, 174, 196, 0.35);
  cursor: default;
}

.stats-message {
  padding: 30px !important;
  color: var(--muted) !important;
  text-align: center !important;
}

@media (max-width: 767.98px) {
  .stats-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .stats-toggle {
    width: 100%;
  }

  .stats-scope-toggle {
    width: 100%;
  }

  .stats-toolbar-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .qualified-filter {
    justify-content: center;
  }
}

@media (max-width: 575.98px) {
  .player-stats-body {
    padding-inline: 0;
  }

  .stats-card {
    overflow: hidden;
  }

  .stats-table-shell {
    display: none;
  }

  .mobile-stat-leaderboard {
    display: block;
  }

  .mobile-stat-list {
    margin: 0;
    padding: 0 0 8px;
    list-style: none;
  }

  .mobile-stat-row {
    min-height: 64px;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    border-bottom: 0;
  }

  .mobile-stat-row:nth-child(even) {
    background: rgba(255, 255, 255, 0.018);
  }

  .mobile-stat-row.is-yankees-row {
    background: rgba(29, 79, 120, 0.24);
  }

  .mobile-stat-row.is-yankees-row .mobile-player-identity strong {
    color: #a8caff;
  }

  .mobile-stat-rank {
    color: var(--muted);
    font-size: var(--text-small);
    font-weight: 800;
    text-align: right;
  }

  .mobile-player-link {
    min-width: 0;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
  }

  .mobile-player-link img {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border: 0;
    border-radius: 0;
    background: none;
    object-fit: contain;
    object-position: center bottom;
  }

  .mobile-player-link img.team-logo-image {
    object-fit: contain;
    object-position: center;
    padding: 4px;
  }

  .mobile-player-link img.is-missing {
    visibility: hidden;
  }

  .mobile-player-identity {
    min-width: 0;
    display: grid;
    line-height: 1.2;
  }

  .mobile-player-identity strong {
    overflow: hidden;
    color: #fff;
    font-size: var(--text-normal);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-player-identity small {
    color: var(--muted);
    font-size: var(--text-small);
    font-weight: 700;
  }

  .mobile-stat-value {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 800;
    text-align: right;
  }

  .mobile-stat-categories {
    border: 0;
    background: rgba(20, 23, 26, 0.97);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 9px;
    backdrop-filter: blur(10px);
  }

  .mobile-stat-category {
    min-width: 0;
    min-height: 34px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: transparent;
    padding: 0 7px;
    font-size: var(--text-small);
    font-weight: 800;
  }

  .mobile-stat-category.active {
    border-color: var(--control-active-border);
    color: var(--control-active-ink);
    background: var(--control-active-bg);
  }

  .player-stats-table {
    min-width: 0;
  }

  .player-stats-table thead,
  .player-stats-table thead tr {
    display: block;
  }

  .player-stats-table thead tr {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    padding: 10px;
    background: #111522;
  }

  .player-stats-table thead th {
    display: block;
    border: 0;
    padding: 7px 3px;
  }

  .player-stats-table thead th:first-child,
  .player-stats-table thead th:nth-child(2) {
    display: none;
  }

  .player-stats-table tbody {
    display: grid;
    gap: 10px;
    padding: 10px;
  }

  .player-stats-table tbody tr {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    border: 0;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.035);
    padding: 10px;
  }

  .player-stats-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.055);
  }

  .player-stats-table tbody td {
    display: block;
    border: 0;
    padding: 4px 2px;
    white-space: normal;
  }

  .player-stats-table tbody td:first-child {
    position: static;
    grid-column: 1 / span 3;
    min-width: 0;
    padding: 4px 2px;
    background: transparent;
  }

  .player-stats-table tbody td:nth-child(2) {
    align-self: center;
    text-align: right;
  }

  .player-stats-table tbody td:nth-child(n + 3)::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.06em;
  }

  .player-stats-table tbody td.is-sort-column {
    border-radius: 4px;
  }

  .header-actions,
  .status-pill {
    width: 100%;
  }
}
