.stats-page {
  padding-bottom: 72px;
}

.stats-main {
  display: grid;
  gap: 24px;
}

.stats-glass {
  background:
    linear-gradient(145deg, rgba(255,255,255,.16), rgba(255,255,255,.04) 42%, rgba(0,0,0,.22)),
    rgba(7,17,31,.66);
  border: 1px solid var(--glass-line);
  border-radius: var(--card-radius);
  box-shadow: 0 22px 52px rgba(0,0,0,.38), inset 0 1px 0 rgba(255,255,255,.18);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.team-summary-card {
  padding: 22px 24px 24px;
}

.team-summary-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.team-season-label {
  color: rgba(255,255,255,.78);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: .10em;
  text-transform: uppercase;
  white-space: nowrap;
}

.section-kicker {
  color: rgba(255,255,255,.72);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.team-summary-card h1,
.stats-card-header h2 {
  margin: 2px 0 0;
  color: #fff;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-shadow: 0 3px 8px rgba(0,0,0,.58);
}

.team-stat-pills {
  display: grid;
  grid-template-columns: repeat(8, minmax(96px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.team-stat-pill {
  min-height: 74px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(0,83,155,.88), rgba(0,52,95,.76) 62%, rgba(244,125,48,.28));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16);
}

.team-stat-pill span {
  color: rgba(255,255,255,.72);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.team-stat-pill strong {
  color: #fff;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 2px 5px rgba(0,0,0,.42);
}

.player-stats-card {
  padding: 0;
}

.stats-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px;
  background:
    linear-gradient(90deg, rgba(0,83,155,.82), rgba(0,52,95,.48) 58%, rgba(244,125,48,.38));
  border-bottom: 1px solid rgba(255,255,255,.18);
}

.stats-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.stats-season-select {
  min-height: 38px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 999px;
  background: rgba(0,0,0,.24);
  color: #fff;
  padding: 8px 34px 8px 13px;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.stats-season-select option {
  color: #06111f;
}

.stats-scope-toggle {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 999px;
  background: rgba(0,0,0,.24);
}

.stats-scope-toggle button {
  min-width: 92px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255,255,255,.72);
  padding: 8px 13px;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
}

.stats-scope-toggle button.is-active {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: #fff;
  box-shadow: inset 0 -3px 0 var(--orange), 0 6px 16px rgba(0,0,0,.24);
}

.stats-table-wrap {
  overflow-x: auto;
}

.kraken-stats-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1120px;
}

.goalie-table {
  min-width: 1180px;
}

.kraken-stats-table thead th {
  padding: 13px 10px;
  background: rgba(3,10,18,.72);
  color: rgba(255,255,255,.86);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .08em;
  text-align: center;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255,255,255,.16);
  white-space: nowrap;
}

.sortable-header {
  cursor: pointer;
  user-select: none;
}

.sortable-header::after {
  content: "";
  display: inline-block;
  width: 0;
  margin-left: 6px;
  color: var(--orange);
}

.sortable-header.is-sorted-asc::after {
  content: "▲";
}

.sortable-header.is-sorted-desc::after {
  content: "▼";
}

.sortable-header:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: -4px;
}

.kraken-stats-table tbody td {
  padding: 10px;
  color: var(--blue);
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,.10);
  white-space: nowrap;
}

.kraken-stats-table tbody tr:nth-child(odd) {
  background: rgba(255,255,255,.045);
}

.kraken-stats-table tbody tr:nth-child(even) {
  background: rgba(0,83,155,.085);
}

.kraken-stats-table tbody tr:hover {
  background: rgba(244,125,48,.18);
}

.photo-col,
.photo-cell {
  width: 58px;
}

.number-col,
.number-cell {
  width: 58px;
}

.player-col,
.player-cell {
  min-width: 220px;
  text-align: left !important;
}

.photo-cell {
  position: relative;
  text-align: center;
}

.player-photo,
.photo-fallback {
  width: 42px;
  height: 42px;
  border-radius: 999px;
}

.player-photo {
  display: inline-block;
  object-fit: contain;
  object-position: center bottom;
  border: 1px solid rgba(255,255,255,.34);
  vertical-align: middle;
}

.player-photo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 22%, rgba(255,255,255,.24), transparent 34%),
    linear-gradient(145deg, var(--blue) 0%, var(--blue-dark) 58%, var(--orange) 100%);
  box-shadow: 0 0 0 2px rgba(0,83,155,.45), 0 8px 18px rgba(0,0,0,.32);
  overflow: hidden;
}

.photo-fallback {
  display: none;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  border: 1px solid rgba(244,125,48,.75);
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,.22), transparent 34%),
    linear-gradient(145deg, var(--blue) 0%, var(--blue-dark) 58%, var(--orange) 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16);
}

.photo-cell.photo-missing .photo-fallback {
  display: inline-flex;
}

.number-cell {
  color: var(--orange) !important;
  font-size: 18px !important;
}

.player-cell strong {
  display: block;
  color: var(--blue);
  font-size: 17px;
  line-height: 1.05;
}

.player-cell a {
  color: var(--blue);
  font-weight: 900;
}

.player-cell a:hover {
  color: var(--orange);
}

.goalie-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-shadow: 0 3px 8px rgba(0,0,0,.58);
}

.goalie-divider span {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
}

.stats-loading {
  padding: 24px !important;
  color: rgba(255,255,255,.76) !important;
  text-align: center !important;
}


.kraken-stats-table td:nth-child(5),
.kraken-stats-table td:nth-child(6),
.kraken-stats-table td:nth-child(7) {
  background: rgba(0,83,155,.10);
}


.kraken-stats-table td:nth-child(9),
.kraken-stats-table td:nth-child(10) {
  background: rgba(0,83,155,.10);
}


@media (max-width: 1200px) {
  .team-stat-pills {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
  }
}

@media (max-width: 760px) {
  .team-stat-pills {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-card-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats-controls {
    align-items: flex-start;
    flex-direction: column;
  }

  .number-col,
  .number-cell {
    display: none;
  }

/* Photo column */

.photo-col,
.photo-cell {
  position: sticky;
  left: 0;
  z-index: 15;
  width: 58px;
  min-width: 58px;
  max-width: 58px;
  background: #eef3f6;
}

/* Player column */

.player-col,
.player-cell {
  position: sticky;
  left: 58px;
  z-index: 14;

  width: 160px;
  min-width: 160px;
  max-width: 160px;

  background: #eef3f6;
  box-shadow: 8px 0 10px rgba(0,0,0,.18);
}

.player-cell a {
  display: block;
  width: 140px;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

  .kraken-stats-table th,
  .kraken-stats-table td {
    padding-left: 4px;
    padding-right: 4px;
  }

  .kraken-stats-table {
    min-width: 632px;
  }

  .goalie-table {
    min-width: 678px;
  }

  .kraken-stats-table th:nth-child(n+4),
  .kraken-stats-table td:nth-child(n+4) {
    width: 52px;
    min-width: 52px;
    max-width: 52px;
  }

.kraken-stats-table thead .photo-col,
.kraken-stats-table thead .player-col {
  position: sticky;
  z-index: 40;
  background: #07111f;
}

.kraken-stats-table thead .photo-col {
  left: 0;
}

.kraken-stats-table thead .player-col {
  left: 58px;
  box-shadow: 8px 0 10px rgba(0,0,0,.28);
}

.kraken-stats-table tbody .photo-cell,
.kraken-stats-table tbody .player-cell {
  z-index: 15;
}

.kraken-stats-table thead .player-col::after,
.kraken-stats-table tbody .player-cell::after {
  content: "";
  position: absolute;
  top: 0;
  right: -4px;
  width: 4px;
  height: 100%;
  background: inherit;
}

.kraken-stats-table th:nth-child(4),
.kraken-stats-table td:nth-child(4) {
  padding-left: 10px;
}

}
