/**
 * Player standings — chalksta-app companion
 * body.chalksta-app.chalksta-page-playerstats
 * Align with chalksta-teamstandings.css + player-specific toolbar controls.
 */

.chalksta-page-playerstats .chalksta-ts-main {
  padding-top: 1rem;
  padding-bottom: 2rem;
}

.chalksta-page-playerstats .chalksta-ts-toolbar--crossnav {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0 0 0.75rem 0;
  margin-bottom: 0.5rem;
}

.chalksta-page-playerstats .chalksta-ts-toolbar:not(.chalksta-ts-toolbar--crossnav) {
  background: var(--idx-surface);
  border: 1px solid var(--idx-border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.chalksta-page-playerstats .chalksta-ts-toolbar .custom-control-label {
  color: var(--idx-fg);
  font-size: 0.875rem;
}

.chalksta-page-playerstats .chalksta-ts-toolbar #datesel {
  color: var(--idx-fg) !important;
  background: var(--idx-surface-alt) !important;
  border: 1px solid var(--idx-border);
}

/* Keep the week picker above tabs/tables/sticky cells; Popper opens downward via data-flip="false". */
.chalksta-page-playerstats .chalksta-ts-toolbar .dropdown {
  position: relative;
  z-index: 1040;
}

.chalksta-page-playerstats .chalksta-ts-toolbar #datelist {
  background: var(--idx-surface) !important;
  border: 1px solid var(--idx-border);
  max-height: min(70vh, 28rem);
  overflow-x: hidden;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  z-index: 1040;
  box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.18);
  touch-action: pan-y;
}

/* Light theme: dark thumb on light track | Dark theme: light thumb on dark track */
body.chalksta-app:not(.dark-theme) .chalksta-page-playerstats .chalksta-ts-toolbar #datelist {
  scrollbar-width: auto;
  scrollbar-color: #1d1d1f #d8d8df;
}

body.dark-theme.chalksta-app .chalksta-page-playerstats .chalksta-ts-toolbar #datelist {
  scrollbar-color: rgba(255, 255, 255, 0.72) #141414;
  box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.45);
}

/* Date dropdown: visible vertical scrollbar (WebKit + theme contrast). */
.chalksta-page-playerstats .chalksta-ts-toolbar #datelist::-webkit-scrollbar {
  width: 10px;
}

.chalksta-page-playerstats .chalksta-ts-toolbar #datelist::-webkit-scrollbar-track {
  background: var(--idx-surface-alt);
  border-radius: 5px;
}

body.chalksta-app:not(.dark-theme) .chalksta-page-playerstats .chalksta-ts-toolbar #datelist::-webkit-scrollbar {
  width: 12px;
}

body.chalksta-app:not(.dark-theme) .chalksta-page-playerstats .chalksta-ts-toolbar #datelist::-webkit-scrollbar-track {
  background: #d8d8df;
  border-left: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
}

body.chalksta-app:not(.dark-theme) .chalksta-page-playerstats .chalksta-ts-toolbar #datelist::-webkit-scrollbar-thumb {
  background: #1d1d1f;
  border-radius: 6px;
  border: 2px solid #d8d8df;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

body.dark-theme.chalksta-app .chalksta-page-playerstats .chalksta-ts-toolbar #datelist::-webkit-scrollbar-track {
  background: #141414;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}

body.dark-theme.chalksta-app .chalksta-page-playerstats .chalksta-ts-toolbar #datelist::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.72);
  border-radius: 6px;
  border: 2px solid #141414;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

body.chalksta-app:not(.dark-theme) .chalksta-page-playerstats .chalksta-ts-toolbar #datelist::-webkit-scrollbar-thumb:hover {
  background: #000000;
}

body.dark-theme.chalksta-app .chalksta-page-playerstats .chalksta-ts-toolbar #datelist::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.9);
}

@media (max-width: 767.98px) {
  .chalksta-page-playerstats .chalksta-ts-toolbar #datelist::-webkit-scrollbar {
    width: 12px;
  }
}

.chalksta-page-playerstats .chalksta-ts-toolbar #datelist .dropdown-item {
  color: var(--idx-fg);
}

.chalksta-page-playerstats .chalksta-ts-toolbar #datelist .dropdown-item:hover {
  background: var(--idx-surface-alt);
  color: var(--espn-red);
}

.chalksta-page-playerstats #div_id_para {
  color: var(--idx-muted) !important;
  font-size: 0.75rem !important;
}

/* Statistics definitions trigger — inline text link (STYLES.md / CHALKSTA_DESIGN_RULES) */
.chalksta-page-playerstats .chalksta-stats-defs-link {
  font-family: "Roboto", "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--idx-muted);
  text-decoration: underline;
  text-decoration-color: rgba(227, 24, 55, 0.35);
  text-underline-offset: 0.15em;
}

.chalksta-page-playerstats .chalksta-stats-defs-link:hover {
  color: var(--espn-red);
  text-decoration-color: var(--espn-red);
}

.chalksta-page-playerstats .chalksta-stats-defs-link:focus {
  color: var(--espn-red);
  text-decoration-color: var(--espn-red);
  outline: 2px solid var(--espn-red);
  outline-offset: 2px;
}

.chalksta-page-playerstats .chalksta-stats-defs-modal__scope {
  font-size: 0.8125rem;
  color: var(--idx-muted);
  margin-bottom: 0.5rem;
}

/* Statistics definitions modal — top-level in DOM; flex column + overflow on body for vertical scroll */
.chalksta-page-playerstats #stats_defs_modal.chalksta-stats-defs-modal {
  z-index: 1060;
}

.chalksta-page-playerstats #stats_defs_modal.chalksta-stats-defs-modal .chalksta-stats-defs-modal__dialog {
  max-height: calc(100vh - 2rem);
  margin: 1rem auto;
}

.chalksta-page-playerstats #stats_defs_modal.chalksta-stats-defs-modal .modal-content {
  background: var(--idx-surface);
  color: var(--idx-fg);
  border: 1px solid var(--idx-border);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.dark-theme.chalksta-page-playerstats #stats_defs_modal.chalksta-stats-defs-modal .modal-content {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.chalksta-page-playerstats #stats_defs_modal.chalksta-stats-defs-modal .chalksta-stats-defs-modal__header {
  background: linear-gradient(105deg, var(--espn-red) 0%, var(--espn-red-dark, #c41230) 100%);
  color: #fff;
  border-bottom: none;
  padding: 1rem 1.25rem;
  flex-shrink: 0;
}

.chalksta-page-playerstats #stats_defs_modal.chalksta-stats-defs-modal .chalksta-stats-defs-modal__header .modal-title {
  font-family: "Oswald", sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  color: #fff;
}

.chalksta-page-playerstats #stats_defs_modal.chalksta-stats-defs-modal .chalksta-stats-defs-modal__close {
  color: #fff;
  opacity: 0.92;
  text-shadow: none;
}

.chalksta-page-playerstats #stats_defs_modal.chalksta-stats-defs-modal .chalksta-stats-defs-modal__close:hover {
  opacity: 1;
  color: #fff;
}

.chalksta-page-playerstats #stats_defs_modal.chalksta-stats-defs-modal .chalksta-stats-defs-modal__body {
  padding: 1rem 1.25rem;
  background: var(--idx-surface);
  color: var(--idx-fg);
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.chalksta-page-playerstats #stats_defs_modal.chalksta-stats-defs-modal .chalksta-stats-defs-modal__table-wrap {
  font-size: 0.8125rem;
  max-width: 100%;
}

.chalksta-page-playerstats #stats_defs_modal.chalksta-stats-defs-modal .chalksta-stats-defs-modal__table {
  color: var(--idx-fg);
  border-color: var(--idx-border);
}

.chalksta-page-playerstats #stats_defs_modal.chalksta-stats-defs-modal .chalksta-stats-defs-modal__table thead th {
  color: var(--idx-fg);
  border-color: var(--idx-border);
  background: var(--idx-surface-alt);
  font-family: "Oswald", sans-serif;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.chalksta-page-playerstats #stats_defs_modal.chalksta-stats-defs-modal .chalksta-stats-defs-modal__table td,
.chalksta-page-playerstats #stats_defs_modal.chalksta-stats-defs-modal .chalksta-stats-defs-modal__table th {
  border-color: var(--idx-border);
}

.chalksta-page-playerstats #stats_defs_modal.chalksta-stats-defs-modal .table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.03);
}

body.dark-theme.chalksta-page-playerstats #stats_defs_modal.chalksta-stats-defs-modal .table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(255, 255, 255, 0.04);
}

.chalksta-page-playerstats #stats_defs_modal.chalksta-stats-defs-modal .chalksta-stats-defs-modal__footer {
  border-top: 1px solid var(--idx-border);
  background: var(--idx-surface-alt);
  padding: 0.75rem 1.25rem;
  flex-shrink: 0;
}

.chalksta-page-playerstats #stats_defs_modal.chalksta-stats-defs-modal .chalksta-stats-defs-modal__footer-btn {
  font-family: "Oswald", sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.8rem;
  padding: 0.4rem 1rem;
  background: var(--idx-surface);
  color: var(--idx-fg);
  border: 1px solid var(--idx-border);
  border-radius: 4px;
}

.chalksta-page-playerstats #stats_defs_modal.chalksta-stats-defs-modal .chalksta-stats-defs-modal__footer-btn:hover {
  border-color: var(--espn-red);
  color: var(--espn-red);
}

.chalksta-page-playerstats .nav-tabs {
  border-bottom-color: var(--idx-border);
}

.chalksta-page-playerstats .nav-tabs .nav-link {
  color: var(--idx-muted);
  border: 1px solid transparent;
}

.chalksta-page-playerstats .nav-tabs .nav-link:hover {
  color: var(--idx-fg);
  border-color: var(--idx-border);
}

.chalksta-page-playerstats .nav-tabs .nav-link.active {
  color: var(--idx-fg);
  background: var(--idx-surface);
  border-color: var(--idx-border) var(--idx-border) var(--idx-surface);
}

.chalksta-page-playerstats .tab-content {
  background: var(--idx-surface);
  border: 1px solid var(--idx-border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 0.75rem;
}

.chalksta-page-playerstats .chalksta-ts-table {
  color: var(--idx-fg);
  background: var(--idx-surface);
}

.chalksta-page-playerstats .chalksta-ts-table thead th {
  color: var(--idx-fg);
  border-color: var(--idx-border);
  font-family: "Oswald", sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.chalksta-page-playerstats .chalksta-ts-table tbody td {
  border-color: var(--idx-border);
}

.chalksta-page-playerstats table.chalksta-data-table tbody td,
.chalksta-page-playerstats table.chalksta-data-table tbody th {
  font-size: 0.8125rem !important;
  line-height: 1.32 !important;
}

.chalksta-page-playerstats .chalksta-ts-table.table-hover tbody tr:hover {
  background: var(--idx-surface-alt);
}

.chalksta-page-playerstats #statstable,
.chalksta-page-playerstats #statstable-tourny-div {
  filter: none;
}

/*
 * Player standings: always use an inner scrollport so thead position:sticky works (every viewport / orientation).
 * Beats .table-responsive:has(#playerstable) overflow-y:visible from playerstats-player-avatars.css.
 */
.chalksta-page-playerstats #statstable.table-responsive,
.chalksta-page-playerstats #statstable-tourny-div.table-responsive {
  max-height: min(78vh, 36rem);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

@media (max-width: 767px) {
  .chalksta-page-playerstats .chalksta-ts-toolbar .row {
    flex-wrap: wrap;
  }
}

/*
 * Player standings #playerstable / #playerstable-tourny: sticky header + sticky rank (#) + sticky name.
 * Desktop: # stays visible (frozen with name). Mobile: # hidden; name sticks to left:0.
 * Requires border-collapse: separate for reliable sticky (Bootstrap .table is collapse).
 */
.chalksta-page-playerstats #playerstable,
.chalksta-page-playerstats #playerstable-tourny {
  --ps-sticky-rank-w: 2.75rem;
  max-width: none !important;
  width: max-content;
  min-width: 100%;
  margin-bottom: 0;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

/*
 * styleBootstrapTable() sets inline: thead { position:sticky; top:0; z-index:100 } and every th { position:relative }.
 * That prevents horizontal sticky on the name <th> and breaks the corner cell. Reset thead and re-stick per <th>.
 */
.chalksta-page-playerstats #playerstable thead,
.chalksta-page-playerstats #playerstable-tourny thead {
  position: static !important;
  top: auto !important;
  z-index: auto !important;
}

/*
 * Stacking: thead above tbody for vertical scroll; within each tbody row, isolation + z-index so
 * the sticky name <td> paints above later stat <td>s (horizontal scroll).
 * Ladder: NAME corner th (50) > RANK th (45) > stat th (28); inside row: name td (5) > rank td (4) > stat td (1).
 */
.chalksta-page-playerstats #playerstable thead th,
.chalksta-page-playerstats #playerstable-tourny thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 28;
  background-clip: padding-box !important;
  -webkit-background-clip: padding-box !important;
}

/* Non-name stat headers: opaque + above all body cells */
body.chalksta-app:not(.dark-theme).chalksta-page-playerstats #playerstable thead th:nth-child(n + 3),
body.chalksta-app:not(.dark-theme).chalksta-page-playerstats #playerstable-tourny thead th:nth-child(n + 3) {
  position: sticky !important;
  top: 0 !important;
  z-index: 28 !important;
  background-color: var(--espn-red-dark) !important;
  background-image: linear-gradient(105deg, var(--espn-red) 0%, var(--espn-red-dark) 100%) !important;
}

body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable thead th:nth-child(n + 3),
body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable-tourny thead th:nth-child(n + 3) {
  position: sticky !important;
  top: 0 !important;
  z-index: 28 !important;
  background-color: #7a0d1f !important;
  background-image: linear-gradient(105deg, var(--espn-red) 0%, #7a0d1f 100%) !important;
}

body.chalksta-app:not(.dark-theme).chalksta-page-playerstats #playerstable thead th:nth-child(n + 3).sorted-column,
body.chalksta-app:not(.dark-theme).chalksta-page-playerstats #playerstable-tourny thead th:nth-child(n + 3).sorted-column {
  background-color: #9e0d24 !important;
  background-image: linear-gradient(105deg, #c4102e 0%, #9e0d24 100%) !important;
}

body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable thead th:nth-child(n + 3).sorted-column,
body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable-tourny thead th:nth-child(n + 3).sorted-column {
  background-color: var(--espn-red-dark) !important;
  background-image: linear-gradient(105deg, #ff3b54 0%, var(--espn-red-dark) 100%) !important;
}


/* Rank (#) column — sticky left edge (hidden on mobile). */
.chalksta-page-playerstats #playerstable thead th:nth-child(1),
.chalksta-page-playerstats #playerstable tbody td:nth-child(1),
.chalksta-page-playerstats #playerstable-tourny thead th:nth-child(1),
.chalksta-page-playerstats #playerstable-tourny tbody td:nth-child(1) {
  position: sticky !important;
  left: 0 !important;
  min-width: var(--ps-sticky-rank-w);
  box-sizing: border-box;
  background-clip: padding-box !important;
  -webkit-background-clip: padding-box !important;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.chalksta-page-playerstats #playerstable thead th:nth-child(1),
.chalksta-page-playerstats #playerstable-tourny thead th:nth-child(1) {
  top: 0 !important;
  z-index: 45 !important;
  background-color: var(--espn-red-dark) !important;
  background-image: linear-gradient(105deg, var(--espn-red) 0%, var(--espn-red-dark) 100%) !important;
}

.chalksta-page-playerstats #playerstable tbody td:nth-child(1),
.chalksta-page-playerstats #playerstable-tourny tbody td:nth-child(1) {
  z-index: 4 !important;
  isolation: auto;
}

/*
 * Per-row stacking context: without this, many engines paint later <td>s in DOM order on top of the
 * sticky name cell even when name has a higher z-index (horizontal scroll bleed).
 */
.chalksta-page-playerstats #playerstable tbody tr,
.chalksta-page-playerstats #playerstable-tourny tbody tr {
  isolation: isolate;
}

/* Lift hovered row so avatar zoom paints over adjacent rows (thead th stay z-index 28+). */
.chalksta-page-playerstats #playerstable tbody tr:hover,
.chalksta-page-playerstats #playerstable-tourny tbody tr:hover {
  position: relative;
  z-index: 24;
}

@media (hover: none) {
  .chalksta-page-playerstats #playerstable tbody tr.row-selected,
  .chalksta-page-playerstats #playerstable-tourny tbody tr.row-selected {
    position: relative;
    z-index: 24;
  }
}

/* Stat body cells: below name column within the row */
.chalksta-page-playerstats #playerstable tbody td:nth-child(n + 3),
.chalksta-page-playerstats #playerstable-tourny tbody td:nth-child(n + 3) {
  position: relative;
  z-index: 1 !important;
}

/* Name column — sticky to the right of rank (#) on desktop; mobile override sets left:0 */
.chalksta-page-playerstats #playerstable thead th:nth-child(2),
.chalksta-page-playerstats #playerstable tbody td:nth-child(2),
.chalksta-page-playerstats #playerstable-tourny thead th:nth-child(2),
.chalksta-page-playerstats #playerstable-tourny tbody td:nth-child(2) {
  position: sticky !important;
  left: var(--ps-sticky-rank-w) !important;
  min-width: 8.5rem;
  box-shadow: 4px 0 8px -2px rgba(0, 0, 0, 0.12);
  background-clip: padding-box !important;
  -webkit-background-clip: padding-box !important;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.chalksta-page-playerstats #playerstable thead th:nth-child(2),
.chalksta-page-playerstats #playerstable-tourny thead th:nth-child(2) {
  z-index: 35;
}

/* NAME corner: above stat headers so horizontal + vertical scroll stay clean */
.chalksta-page-playerstats #playerstable thead th:nth-child(2),
.chalksta-page-playerstats #playerstable-tourny thead th:nth-child(2) {
  top: 0 !important;
  z-index: 50 !important;
  background-color: var(--espn-red-dark) !important;
  background-image: linear-gradient(105deg, var(--espn-red) 0%, var(--espn-red-dark) 100%) !important;
}

/* Sticky bleed fix: overflow hidden on name <td>; allow visible during row peek (avatar zoom). */
.chalksta-page-playerstats #playerstable tbody td:nth-child(2).playerstats-name-td,
.chalksta-page-playerstats #playerstable-tourny tbody td:nth-child(2).playerstats-name-td {
  position: sticky !important;
  overflow: hidden !important;
}

.chalksta-page-playerstats #playerstable tbody tr:hover td:nth-child(2).playerstats-name-td,
.chalksta-page-playerstats #playerstable-tourny tbody tr:hover td:nth-child(2).playerstats-name-td {
  overflow: visible !important;
}

@media (hover: none) {
  .chalksta-page-playerstats #playerstable tbody tr.row-selected td:nth-child(2).playerstats-name-td,
  .chalksta-page-playerstats #playerstable-tourny tbody tr.row-selected td:nth-child(2).playerstats-name-td {
    overflow: visible !important;
  }
}

/* Above sibling stat cells inside the same row (see tbody tr { isolation }) */
.chalksta-page-playerstats #playerstable tbody td:nth-child(2),
.chalksta-page-playerstats #playerstable-tourny tbody td:nth-child(2) {
  z-index: 5 !important;
  isolation: auto;
}

/*
 * Fill padding box with opaque paint (table-cell ::before sizing is unreliable).
 * Negate typical table-sm + mobile padding so inherit matches the full cell face.
 */
.chalksta-page-playerstats #playerstable tbody td:nth-child(2) .playerstats-name-cell,
.chalksta-page-playerstats #playerstable-tourny tbody td:nth-child(2) .playerstats-name-cell {
  position: relative;
  z-index: 1;
  background-color: inherit;
  margin: -6px -4px;
  padding: 6px 4px;
  box-sizing: border-box;
  align-self: stretch;
}

/* Favorite star may be a sibling before .playerstats-name-cell — keep it above the expanded fill */
.chalksta-page-playerstats #playerstable tbody td:nth-child(2) > a:first-child,
.chalksta-page-playerstats #playerstable-tourny tbody td:nth-child(2) > a:first-child {
  position: relative;
  z-index: 2;
}

/*
 * Within a row: keep rank + name above stat cells for horizontal sticky scroll.
 * Applies on any row hover / tap (row-selected), not only when the name link itself is hovered.
 */
.chalksta-page-playerstats #playerstable tbody tr:hover td:nth-child(n + 3),
.chalksta-page-playerstats #playerstable-tourny tbody tr:hover td:nth-child(n + 3) {
  z-index: 1 !important;
}

.chalksta-page-playerstats #playerstable tbody tr:hover td:nth-child(1),
.chalksta-page-playerstats #playerstable-tourny tbody tr:hover td:nth-child(1) {
  z-index: 4 !important;
}

.chalksta-page-playerstats #playerstable tbody tr:hover td:nth-child(2),
.chalksta-page-playerstats #playerstable-tourny tbody tr:hover td:nth-child(2) {
  z-index: 5 !important;
}

@media (hover: none) {
  .chalksta-page-playerstats #playerstable tbody tr.row-selected td:nth-child(n + 3),
  .chalksta-page-playerstats #playerstable-tourny tbody tr.row-selected td:nth-child(n + 3) {
    z-index: 1 !important;
  }

  .chalksta-page-playerstats #playerstable tbody tr.row-selected td:nth-child(1),
  .chalksta-page-playerstats #playerstable-tourny tbody tr.row-selected td:nth-child(1) {
    z-index: 4 !important;
  }

  .chalksta-page-playerstats #playerstable tbody tr.row-selected td:nth-child(2),
  .chalksta-page-playerstats #playerstable-tourny tbody tr.row-selected td:nth-child(2) {
    z-index: 5 !important;
  }
}

body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable thead th:nth-child(1),
body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable thead th:nth-child(2),
body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable-tourny thead th:nth-child(1),
body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable-tourny thead th:nth-child(2) {
  background-color: #7a0d1f !important;
  background-image: linear-gradient(105deg, var(--espn-red) 0%, #7a0d1f 100%) !important;
}

body.chalksta-app:not(.dark-theme).chalksta-page-playerstats #playerstable thead th:nth-child(1).sorted-column,
body.chalksta-app:not(.dark-theme).chalksta-page-playerstats #playerstable thead th:nth-child(2).sorted-column,
body.chalksta-app:not(.dark-theme).chalksta-page-playerstats #playerstable-tourny thead th:nth-child(1).sorted-column,
body.chalksta-app:not(.dark-theme).chalksta-page-playerstats #playerstable-tourny thead th:nth-child(2).sorted-column {
  background-color: #9e0d24 !important;
  background-image: linear-gradient(105deg, #c4102e 0%, #9e0d24 100%) !important;
}

body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable thead th:nth-child(1).sorted-column,
body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable thead th:nth-child(2).sorted-column,
body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable-tourny thead th:nth-child(1).sorted-column,
body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable-tourny thead th:nth-child(2).sorted-column {
  background-color: var(--espn-red-dark) !important;
  background-image: linear-gradient(105deg, #ff3b54 0%, var(--espn-red-dark) 100%) !important;
}

/* ---- Light: frozen name rail — fully opaque (color-mix, no translucent layers) ---- */
body.chalksta-app:not(.dark-theme).chalksta-page-playerstats #playerstable tbody tr.odd > td:nth-child(-n+2),
body.chalksta-app:not(.dark-theme).chalksta-page-playerstats #playerstable-tourny tbody tr.odd > td:nth-child(-n+2) {
  background-color: var(--idx-surface) !important;
  background: var(--idx-surface) !important;
}

body.chalksta-app:not(.dark-theme).chalksta-page-playerstats #playerstable tbody tr.even > td:nth-child(-n+2),
body.chalksta-app:not(.dark-theme).chalksta-page-playerstats #playerstable-tourny tbody tr.even > td:nth-child(-n+2) {
  background-color: var(--idx-surface-alt) !important;
  background: var(--idx-surface-alt) !important;
}

body.chalksta-app:not(.dark-theme).chalksta-page-playerstats #playerstable tbody tr.odd:hover > td:nth-child(-n+2),
body.chalksta-app:not(.dark-theme).chalksta-page-playerstats #playerstable-tourny tbody tr.odd:hover > td:nth-child(-n+2) {
  background-color: var(--idx-surface) !important;
  background: color-mix(in srgb, var(--idx-surface) 91%, var(--espn-red) 9%) !important;
}

body.chalksta-app:not(.dark-theme).chalksta-page-playerstats #playerstable tbody tr.even:hover > td:nth-child(-n+2),
body.chalksta-app:not(.dark-theme).chalksta-page-playerstats #playerstable-tourny tbody tr.even:hover > td:nth-child(-n+2) {
  background-color: var(--idx-surface-alt) !important;
  background: color-mix(in srgb, var(--idx-surface-alt) 91%, var(--espn-red) 9%) !important;
}

body.chalksta-app:not(.dark-theme).chalksta-page-playerstats #playerstable tbody tr.odd.row-selected > td:nth-child(-n+2),
body.chalksta-app:not(.dark-theme).chalksta-page-playerstats #playerstable-tourny tbody tr.odd.row-selected > td:nth-child(-n+2) {
  background-color: var(--idx-surface) !important;
  background: color-mix(in srgb, var(--idx-surface) 84%, var(--espn-red) 16%) !important;
}

body.chalksta-app:not(.dark-theme).chalksta-page-playerstats #playerstable tbody tr.even.row-selected > td:nth-child(-n+2),
body.chalksta-app:not(.dark-theme).chalksta-page-playerstats #playerstable-tourny tbody tr.even.row-selected > td:nth-child(-n+2) {
  background-color: var(--idx-surface-alt) !important;
  background: color-mix(in srgb, var(--idx-surface-alt) 84%, var(--espn-red) 16%) !important;
}

body.chalksta-app:not(.dark-theme).chalksta-page-playerstats
  #playerstable tbody tr.odd.playerhiglightfavoriterow > td:nth-child(-n+2),
body.chalksta-app:not(.dark-theme).chalksta-page-playerstats
  #playerstable-tourny tbody tr.odd.playerhiglightfavoriterow > td:nth-child(-n+2) {
  background-color: var(--idx-surface) !important;
  background: color-mix(in srgb, var(--idx-surface) 94%, var(--espn-red) 6%) !important;
  box-shadow:
    inset 0 0 16px rgba(227, 24, 55, 0.28),
    4px 0 8px -2px rgba(0, 0, 0, 0.12) !important;
}

body.chalksta-app:not(.dark-theme).chalksta-page-playerstats
  #playerstable tbody tr.even.playerhiglightfavoriterow > td:nth-child(-n+2),
body.chalksta-app:not(.dark-theme).chalksta-page-playerstats
  #playerstable-tourny tbody tr.even.playerhiglightfavoriterow > td:nth-child(-n+2) {
  background-color: var(--idx-surface-alt) !important;
  background: color-mix(in srgb, var(--idx-surface-alt) 94%, var(--espn-red) 6%) !important;
  box-shadow:
    inset 0 0 16px rgba(227, 24, 55, 0.28),
    4px 0 8px -2px rgba(0, 0, 0, 0.12) !important;
}

body.chalksta-app:not(.dark-theme).chalksta-page-playerstats #playerstable tbody tr.odd.playerhiglightrow > td:nth-child(-n+2),
body.chalksta-app:not(.dark-theme).chalksta-page-playerstats #playerstable-tourny tbody tr.odd.playerhiglightrow > td:nth-child(-n+2) {
  background-color: var(--idx-surface) !important;
  background: color-mix(in srgb, var(--idx-surface) 80%, rgb(100 190 130) 20%) !important;
  box-shadow:
    inset 0 0 0 1px rgba(60, 180, 90, 0.35),
    4px 0 8px -2px rgba(0, 0, 0, 0.12) !important;
}

body.chalksta-app:not(.dark-theme).chalksta-page-playerstats #playerstable tbody tr.even.playerhiglightrow > td:nth-child(-n+2),
body.chalksta-app:not(.dark-theme).chalksta-page-playerstats #playerstable-tourny tbody tr.even.playerhiglightrow > td:nth-child(-n+2) {
  background-color: var(--idx-surface-alt) !important;
  background: color-mix(in srgb, var(--idx-surface-alt) 80%, rgb(100 190 130) 20%) !important;
  box-shadow:
    inset 0 0 0 1px rgba(60, 180, 90, 0.35),
    4px 0 8px -2px rgba(0, 0, 0, 0.12) !important;
}

/* ---- Dark: frozen name rail — fully opaque color-mix (matches stripe + state tints) ---- */
body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable tbody tr.odd > td:nth-child(-n+2),
body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable-tourny tbody tr.odd > td:nth-child(-n+2) {
  background-color: var(--idx-surface) !important;
  background: color-mix(in srgb, var(--idx-surface) 96%, white 4%) !important;
}

body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable tbody tr.even > td:nth-child(-n+2),
body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable-tourny tbody tr.even > td:nth-child(-n+2) {
  background-color: var(--idx-surface) !important;
  background: color-mix(in srgb, var(--idx-surface) 92%, white 8%) !important;
}

body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable tbody tr.odd:hover > td:nth-child(-n+2),
body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable-tourny tbody tr.odd:hover > td:nth-child(-n+2) {
  background-color: var(--idx-surface) !important;
  background: color-mix(
    in srgb,
    color-mix(in srgb, var(--idx-surface) 96%, white 4%) 78%,
    var(--espn-red) 22%
  ) !important;
}

body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable tbody tr.even:hover > td:nth-child(-n+2),
body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable-tourny tbody tr.even:hover > td:nth-child(-n+2) {
  background-color: var(--idx-surface) !important;
  background: color-mix(
    in srgb,
    color-mix(in srgb, var(--idx-surface) 92%, white 8%) 78%,
    var(--espn-red) 22%
  ) !important;
}

body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable tbody tr.odd.row-selected > td:nth-child(-n+2),
body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable-tourny tbody tr.odd.row-selected > td:nth-child(-n+2) {
  background-color: var(--idx-surface) !important;
  background: color-mix(
    in srgb,
    color-mix(in srgb, var(--idx-surface) 96%, white 4%) 62%,
    rgb(60 160 255) 38%
  ) !important;
  box-shadow:
    inset 0 0 0 1px rgba(140, 215, 255, 0.55),
    4px 0 8px -2px rgba(0, 0, 0, 0.12) !important;
}

body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable tbody tr.even.row-selected > td:nth-child(-n+2),
body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable-tourny tbody tr.even.row-selected > td:nth-child(-n+2) {
  background-color: var(--idx-surface) !important;
  background: color-mix(
    in srgb,
    color-mix(in srgb, var(--idx-surface) 92%, white 8%) 62%,
    rgb(60 160 255) 38%
  ) !important;
  box-shadow:
    inset 0 0 0 1px rgba(140, 215, 255, 0.55),
    4px 0 8px -2px rgba(0, 0, 0, 0.12) !important;
}

body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable tbody tr.odd.row-selected:hover > td:nth-child(-n+2),
body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable-tourny tbody tr.odd.row-selected:hover > td:nth-child(-n+2) {
  background-color: var(--idx-surface) !important;
  background: color-mix(
    in srgb,
    color-mix(in srgb, var(--idx-surface) 96%, white 4%) 56%,
    rgb(80 175 255) 44%
  ) !important;
  box-shadow:
    inset 0 0 0 1px rgba(140, 215, 255, 0.55),
    4px 0 8px -2px rgba(0, 0, 0, 0.12) !important;
}

body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable tbody tr.even.row-selected:hover > td:nth-child(-n+2),
body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable-tourny tbody tr.even.row-selected:hover > td:nth-child(-n+2) {
  background-color: var(--idx-surface) !important;
  background: color-mix(
    in srgb,
    color-mix(in srgb, var(--idx-surface) 92%, white 8%) 56%,
    rgb(80 175 255) 44%
  ) !important;
  box-shadow:
    inset 0 0 0 1px rgba(140, 215, 255, 0.55),
    4px 0 8px -2px rgba(0, 0, 0, 0.12) !important;
}

body.dark-theme.chalksta-app.chalksta-page-playerstats
  #playerstable tbody tr.odd.playerhiglightfavoriterow > td:nth-child(-n+2),
body.dark-theme.chalksta-app.chalksta-page-playerstats
  #playerstable-tourny tbody tr.odd.playerhiglightfavoriterow > td:nth-child(-n+2) {
  background-color: var(--idx-surface) !important;
  background: color-mix(
    in srgb,
    color-mix(in srgb, var(--idx-surface) 96%, white 4%) 66%,
    rgb(255 176 0) 34%
  ) !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 210, 120, 0.75),
    4px 0 8px -2px rgba(0, 0, 0, 0.12) !important;
}

body.dark-theme.chalksta-app.chalksta-page-playerstats
  #playerstable tbody tr.even.playerhiglightfavoriterow > td:nth-child(-n+2),
body.dark-theme.chalksta-app.chalksta-page-playerstats
  #playerstable-tourny tbody tr.even.playerhiglightfavoriterow > td:nth-child(-n+2) {
  background-color: var(--idx-surface) !important;
  background: color-mix(
    in srgb,
    color-mix(in srgb, var(--idx-surface) 92%, white 8%) 66%,
    rgb(255 176 0) 34%
  ) !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 210, 120, 0.75),
    4px 0 8px -2px rgba(0, 0, 0, 0.12) !important;
}

body.dark-theme.chalksta-app.chalksta-page-playerstats
  #playerstable tbody tr.odd.playerhiglightfavoriterow:hover > td:nth-child(-n+2),
body.dark-theme.chalksta-app.chalksta-page-playerstats
  #playerstable-tourny tbody tr.odd.playerhiglightfavoriterow:hover > td:nth-child(-n+2) {
  background-color: var(--idx-surface) !important;
  background: color-mix(
    in srgb,
    color-mix(in srgb, var(--idx-surface) 96%, white 4%) 60%,
    rgb(255 190 30) 40%
  ) !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 210, 120, 0.75),
    4px 0 8px -2px rgba(0, 0, 0, 0.12) !important;
}

body.dark-theme.chalksta-app.chalksta-page-playerstats
  #playerstable tbody tr.even.playerhiglightfavoriterow:hover > td:nth-child(-n+2),
body.dark-theme.chalksta-app.chalksta-page-playerstats
  #playerstable-tourny tbody tr.even.playerhiglightfavoriterow:hover > td:nth-child(-n+2) {
  background-color: var(--idx-surface) !important;
  background: color-mix(
    in srgb,
    color-mix(in srgb, var(--idx-surface) 92%, white 8%) 60%,
    rgb(255 190 30) 40%
  ) !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 210, 120, 0.75),
    4px 0 8px -2px rgba(0, 0, 0, 0.12) !important;
}

body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable tbody tr.odd.playerhiglightrow > td:nth-child(-n+2),
body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable-tourny tbody tr.odd.playerhiglightrow > td:nth-child(-n+2) {
  background-color: var(--idx-surface) !important;
  background: color-mix(
    in srgb,
    color-mix(in srgb, var(--idx-surface) 96%, white 4%) 78%,
    rgb(72 220 160) 22%
  ) !important;
  box-shadow:
    inset 0 0 0 1px rgba(120, 235, 190, 0.55),
    4px 0 8px -2px rgba(0, 0, 0, 0.12) !important;
}

body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable tbody tr.even.playerhiglightrow > td:nth-child(-n+2),
body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable-tourny tbody tr.even.playerhiglightrow > td:nth-child(-n+2) {
  background-color: var(--idx-surface) !important;
  background: color-mix(
    in srgb,
    color-mix(in srgb, var(--idx-surface) 92%, white 8%) 78%,
    rgb(72 220 160) 22%
  ) !important;
  box-shadow:
    inset 0 0 0 1px rgba(120, 235, 190, 0.55),
    4px 0 8px -2px rgba(0, 0, 0, 0.12) !important;
}

body.dark-theme.chalksta-app.chalksta-page-playerstats
  #playerstable tbody tr.odd.playerhiglightfavoriterow.row-selected > td:nth-child(-n+2),
body.dark-theme.chalksta-app.chalksta-page-playerstats
  #playerstable-tourny tbody tr.odd.playerhiglightfavoriterow.row-selected > td:nth-child(-n+2) {
  background-color: var(--idx-surface) !important;
  background: color-mix(in srgb, rgb(190 140 50) 48%, rgb(55 130 190) 52%) !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 220, 140, 0.7),
    inset 0 -2px 0 0 rgba(100, 190, 255, 0.85),
    4px 0 8px -2px rgba(0, 0, 0, 0.12) !important;
}

body.dark-theme.chalksta-app.chalksta-page-playerstats
  #playerstable tbody tr.even.playerhiglightfavoriterow.row-selected > td:nth-child(-n+2),
body.dark-theme.chalksta-app.chalksta-page-playerstats
  #playerstable-tourny tbody tr.even.playerhiglightfavoriterow.row-selected > td:nth-child(-n+2) {
  background-color: var(--idx-surface) !important;
  background: color-mix(in srgb, rgb(190 140 50) 48%, rgb(55 130 190) 52%) !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 220, 140, 0.7),
    inset 0 -2px 0 0 rgba(100, 190, 255, 0.85),
    4px 0 8px -2px rgba(0, 0, 0, 0.12) !important;
}

/* Sorted name column — opaque color-mix */
body.chalksta-app:not(.dark-theme).chalksta-page-playerstats #playerstable tbody tr.odd > td.sorted-column:nth-child(2),
body.chalksta-app:not(.dark-theme).chalksta-page-playerstats #playerstable-tourny tbody tr.odd > td.sorted-column:nth-child(2) {
  background-color: var(--idx-surface) !important;
  background: color-mix(in srgb, var(--idx-surface) 86%, var(--espn-red) 14%) !important;
}

body.chalksta-app:not(.dark-theme).chalksta-page-playerstats #playerstable tbody tr.even > td.sorted-column:nth-child(2),
body.chalksta-app:not(.dark-theme).chalksta-page-playerstats #playerstable-tourny tbody tr.even > td.sorted-column:nth-child(2) {
  background-color: var(--idx-surface-alt) !important;
  background: color-mix(in srgb, var(--idx-surface-alt) 86%, var(--espn-red) 14%) !important;
}

body.chalksta-app:not(.dark-theme).chalksta-page-playerstats #playerstable tbody tr.odd:hover > td.sorted-column:nth-child(2),
body.chalksta-app:not(.dark-theme).chalksta-page-playerstats #playerstable-tourny tbody tr.odd:hover > td.sorted-column:nth-child(2) {
  background-color: var(--idx-surface) !important;
  background: color-mix(in srgb, var(--idx-surface) 80%, var(--espn-red) 20%) !important;
}

body.chalksta-app:not(.dark-theme).chalksta-page-playerstats #playerstable tbody tr.even:hover > td.sorted-column:nth-child(2),
body.chalksta-app:not(.dark-theme).chalksta-page-playerstats #playerstable-tourny tbody tr.even:hover > td.sorted-column:nth-child(2) {
  background-color: var(--idx-surface-alt) !important;
  background: color-mix(in srgb, var(--idx-surface-alt) 80%, var(--espn-red) 20%) !important;
}

body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable tbody tr.odd > td.sorted-column:nth-child(2),
body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable-tourny tbody tr.odd > td.sorted-column:nth-child(2) {
  background-color: var(--idx-surface) !important;
  background: color-mix(
    in srgb,
    color-mix(in srgb, var(--idx-surface) 96%, white 4%) 75%,
    var(--espn-red) 25%
  ) !important;
}

body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable tbody tr.even > td.sorted-column:nth-child(2),
body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable-tourny tbody tr.even > td.sorted-column:nth-child(2) {
  background-color: var(--idx-surface) !important;
  background: color-mix(
    in srgb,
    color-mix(in srgb, var(--idx-surface) 92%, white 8%) 75%,
    var(--espn-red) 25%
  ) !important;
}

body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable tbody tr.odd:hover > td.sorted-column:nth-child(2),
body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable-tourny tbody tr.odd:hover > td.sorted-column:nth-child(2) {
  background-color: var(--idx-surface) !important;
  background: color-mix(
    in srgb,
    color-mix(in srgb, var(--idx-surface) 96%, white 4%) 68%,
    var(--espn-red) 32%
  ) !important;
}

body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable tbody tr.even:hover > td.sorted-column:nth-child(2),
body.dark-theme.chalksta-app.chalksta-page-playerstats #playerstable-tourny tbody tr.even:hover > td.sorted-column:nth-child(2) {
  background-color: var(--idx-surface) !important;
  background: color-mix(
    in srgb,
    color-mix(in srgb, var(--idx-surface) 92%, white 8%) 68%,
    var(--espn-red) 32%
  ) !important;
}

@media (max-width: 767.98px) {
  .chalksta-page-playerstats #playerstable thead th:nth-child(1),
  .chalksta-page-playerstats #playerstable tbody td:nth-child(1),
  .chalksta-page-playerstats #playerstable-tourny thead th:nth-child(1),
  .chalksta-page-playerstats #playerstable-tourny tbody td:nth-child(1) {
    display: none !important;
  }

  .chalksta-page-playerstats #playerstable thead th:nth-child(2),
  .chalksta-page-playerstats #playerstable tbody td:nth-child(2),
  .chalksta-page-playerstats #playerstable-tourny thead th:nth-child(2),
  .chalksta-page-playerstats #playerstable-tourny tbody td:nth-child(2) {
    left: 0 !important;
  }
}

