/* PLAYER_PUBLIC3_V1_RECOVERY5_FIXED1 — presentation-only overlay. */
:root {
  --pp3-anchor-clearance: 104px;
  --pp3-sticky-bg: #ffffff;
}
[id], h1, h2, h3, h4, .pp3-anchor-target {
  scroll-margin-top: var(--pp3-anchor-clearance) !important;
}

.pp3-hero .pp3-hero-pill {
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  min-height: 28px !important;
  height: auto !important;
  padding: 5px 10px !important;
  margin: 0 !important;
  line-height: 1.15 !important;
  white-space: nowrap !important;
  flex: 0 0 auto !important;
}
.pp3-hero .pp3-hero-pill-group {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 7px !important;
}

.pp3-fallback-portrait {
  font-size: clamp(24px, 3.2vw, 38px) !important;
  font-weight: 650 !important;
  letter-spacing: 0.02em !important;
}

.pp3-duplicate-below300 { display: none !important; }
.pp3-raw-only-badge {
  white-space: nowrap !important;
  letter-spacing: 0.01em !important;
}
.pp3-regular-season-only {
  font-weight: 600 !important;
  opacity: 0.86 !important;
}

tr.pp3-season-total-row > * {
  font-weight: 650 !important;
}
tr.pp3-season-total-row > td:first-child,
tr.pp3-season-total-row > th:first-child {
  padding-top: 0.68rem !important;
  padding-bottom: 0.68rem !important;
}

.pp3-team-column {
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  min-width: 120px !important;
  max-width: 190px !important;
  line-height: 1.22 !important;
}

/* P0 Impact closure: freeze only SEASON + TEAM. */
.pp3-impact-table {
  --pp3-col1-w: 92px;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}
.pp3-impact-scroller {
  overflow-x: auto !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch;
  position: relative !important;
  scrollbar-gutter: stable;
}
.pp3-impact-table :is(th, td):nth-child(n+3) {
  position: static !important;
  left: auto !important;
  right: auto !important;
  z-index: auto !important;
  transform: none !important;
}
.pp3-impact-table :is(th, td):nth-child(1) {
  position: sticky !important;
  left: 0 !important;
  z-index: 12 !important;
  background-color: var(--pp3-sticky-bg) !important;
  background-clip: padding-box !important;
}
.pp3-impact-table :is(th, td):nth-child(2) {
  position: sticky !important;
  left: var(--pp3-col1-w) !important;
  z-index: 11 !important;
  background-color: var(--pp3-sticky-bg) !important;
  background-clip: padding-box !important;
  box-shadow: 1px 0 0 rgba(0,0,0,.08);
}
.pp3-impact-table th:nth-child(1),
.pp3-impact-table td:nth-child(1) { min-width: 86px !important; }
.pp3-impact-table th:nth-child(2),
.pp3-impact-table td:nth-child(2) {
  min-width: 126px !important;
  max-width: 190px !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  line-height: 1.2 !important;
}
.pp3-impact-table thead th:nth-child(1),
.pp3-impact-table thead th:nth-child(2) { z-index: 16 !important; }

@media (max-width: 700px) {
  :root { --pp3-anchor-clearance: 92px; }
  .pp3-impact-table th:nth-child(2),
  .pp3-impact-table td:nth-child(2) {
    min-width: 112px !important;
    max-width: 156px !important;
  }
  .pp3-hero .pp3-hero-pill {
    padding: 4px 8px !important;
    min-height: 26px !important;
  }
}

/* ============================================================================
   PLAYER_PUBLIC3_V1_RECOVERY6 — authoritative Player presentation layer
   D1/D2/D3/D4/D5 closure. Scope is intentionally limited to Players.html.
   ============================================================================ */

/* Shared longitudinal-table contract. The #content id intentionally outranks the
   legacy Public2 [data-pp2-wide-table] !important selectors. */
#content .tablewrap table.longtable {
  --pp3-col1-w: var(--season-col, 104px);
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

#content .tablewrap table.longtable :is(th, td):nth-child(1) {
  box-sizing: border-box !important;
  width: var(--season-col, 104px) !important;
  min-width: var(--season-col, 104px) !important;
  max-width: var(--season-col, 104px) !important;
  position: sticky !important;
  left: 0 !important;
  right: auto !important;
  z-index: 12 !important;
  transform: none !important;
  background-clip: padding-box !important;
}

#content .tablewrap table.longtable :is(th, td):nth-child(2) {
  box-sizing: border-box !important;
  width: var(--team-col, 184px) !important;
  min-width: var(--team-col, 184px) !important;
  max-width: var(--team-col, 184px) !important;
  position: sticky !important;
  left: var(--pp3-col1-w) !important;
  right: auto !important;
  z-index: 11 !important;
  transform: none !important;
  background-clip: padding-box !important;
  box-shadow: 1px 0 0 rgba(0, 0, 0, .08);
}

/* AGE/POS/MIN and every metric column must move with the horizontal scroller. */
#content .tablewrap table.longtable :is(th, td):nth-child(n+3) {
  position: static !important;
  left: auto !important;
  right: auto !important;
  z-index: auto !important;
  transform: none !important;
}

/* Opaque shared frozen surfaces. Do not depend on stale data-pp2-wide-table state. */
#content .tablewrap table.longtable thead tr > :is(th, td):nth-child(1),
#content .tablewrap table.longtable thead tr > :is(th, td):nth-child(2) {
  z-index: 16 !important;
  background: #f7f5f1 !important;
  background-color: #f7f5f1 !important;
  background-clip: padding-box !important;
}

#content .tablewrap table.longtable tbody tr > :is(th, td):nth-child(1),
#content .tablewrap table.longtable tbody tr > :is(th, td):nth-child(2) {
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-clip: padding-box !important;
}

#content .tablewrap table.longtable tbody tr[data-season-total="1"] > :is(th, td):nth-child(1),
#content .tablewrap table.longtable tbody tr[data-season-total="1"] > :is(th, td):nth-child(2),
#content .tablewrap table.longtable tbody tr.pp3-season-total-row > :is(th, td):nth-child(1),
#content .tablewrap table.longtable tbody tr.pp3-season-total-row > :is(th, td):nth-child(2) {
  background: #fbf9f6 !important;
  background-color: #fbf9f6 !important;
}

#content .tablewrap table.longtable tbody tr.stint > :is(th, td):nth-child(1),
#content .tablewrap table.longtable tbody tr.stint > :is(th, td):nth-child(2) {
  background: #fbfbfc !important;
  background-color: #fbfbfc !important;
}

/* Preserve the previously observed 156px TEAM track on <=700px layouts. */
@media (max-width: 700px) {
  #content .tablewrap table.longtable :is(th, td):nth-child(2) {
    width: 156px !important;
    min-width: 156px !important;
    max-width: 156px !important;
  }
}

/* D2: deliberate mobile exception. Below 430 CSS px, SEASON remains frozen and
   TEAM becomes a normal moving column. 430px itself keeps both columns frozen. */
@media (max-width: 429.999px) {
  #content .tablewrap table.longtable :is(th, td):nth-child(2) {
    position: static !important;
    left: auto !important;
    right: auto !important;
    z-index: auto !important;
    transform: none !important;
    box-shadow: none !important;
  }
  #content .tablewrap table.longtable thead tr > :is(th, td):nth-child(2) {
    z-index: auto !important;
  }
}

/* D3 + D5: actual mobile containers, not the misleading Public2 marker. */
@media (max-width: 650px) {
  .snapshot-head {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  .snapshot-head > div {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  .snapshot-controls {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  .snapshot-context {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    text-align: left !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  .snapshot-season-field,
  .snapshot-select {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .topin {
    height: auto !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding-top: 8px !important;
    padding-bottom: 10px !important;
  }
  .topin > .brand,
  .topin .brand {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  .topin > .nav,
  .topin .nav {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    gap: 4px !important;
    margin: 0 !important;
    overflow: visible !important;
  }
  .topin .nav a {
    box-sizing: border-box !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 7px 3px !important;
    text-align: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: clip !important;
  }
  .topin > .search,
  .topin .search {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .topin .search input {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
}
