/* ============================================
   LEAN EDGE SPORTS — Team Detail Page
   team.css
============================================ */

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* --- LOADING / ERROR --- */
.team-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 160px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,0.08);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.team-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 140px 20px;
  text-align: center;
}

.team-error .ti-building { font-size: 48px; color: var(--text-muted); opacity: 0.4; }
.team-error h2 { font-family: 'Barlow Condensed', sans-serif; font-size: 26px; font-weight: 700; color: var(--white); }
.team-error p  { font-size: 14px; color: var(--text-muted); max-width: 360px; line-height: 1.6; }
.team-error a  { color: var(--red); text-decoration: none; font-weight: 600; font-size: 13px; }

/* --- PAGE LAYOUT --- */
.team-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 130px 40px 80px;
}

/* --- BACK LINK --- */
.back-link {
  position: relative;
  z-index: 101;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 28px;
  transition: color 0.2s;
}

.back-link:hover { color: var(--white); }


/* --- HERO --- */
.team-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 28px;
  margin-bottom: 32px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-wrap: wrap;
}

.team-hero-left { flex: 1; min-width: 240px; }

.team-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 52px;
  font-weight: 900;
  color: var(--white);
  line-height: 1;
  margin-bottom: 10px;
  letter-spacing: -1px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.team-name .fav-star-btn { font-size: 28px; }

.team-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.team-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-muted);
}

.team-meta-sep {
  width: 1px;
  height: 14px;
  background: rgba(255,255,255,0.12);
}

.team-meta-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted rgba(255,255,255,0.3);
  transition: color 0.2s, border-color 0.2s;
}

.team-meta-link:hover {
  color: var(--white);
  border-bottom-color: rgba(255,255,255,0.7);
}

.team-hero-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  flex-shrink: 0;
}

.team-record-block { text-align: right; }

.team-record-num {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 64px;
  font-weight: 900;
  color: var(--white);
  line-height: 1;
}

.team-record-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.season-select-hero {
  padding: 10px 32px 10px 20px;
  background-color: rgba(255,255,255,0.05);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23ff6b6b' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 1px solid rgba(196,18,48,0.3);
  border-radius: 9px;
  color: #ff6b6b;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Barlow', sans-serif;
  cursor: pointer;
}

.season-select-hero option { background: var(--dark-navy); color: var(--white); }

.team-season-compare-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.team-season-compare-row .season-select-hero,
.team-season-compare-row .compare-this-btn {
  flex: 1 1 0;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compare-this-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 9px;
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  font-family: 'Barlow', sans-serif;
  text-decoration: none;
  transition: background 0.2s;
}

.compare-this-btn:hover { background: rgba(255,255,255,0.12); }

/* --- SECTION TITLES --- */
.section-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  margin: 0 0 14px;
}

.section-title-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.section-title-row .section-title { margin-bottom: 0; }

.section-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.section-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 36px 0;
}

/* --- TWO-COLUMN LAYOUT --- */
.team-two-col {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

.team-two-col > div {
  min-width: 0;
}

/* --- STAT TABLE --- */
.stats-table-wrap {
  background: var(--dark-navy);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  overflow: hidden;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Barlow', sans-serif;
}

.stats-table thead th {
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.stats-table thead th:nth-child(3),
.stats-table thead th:nth-child(4),
.stats-table thead th:nth-child(5) { text-align: center; }

.stats-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.1s;
}

.stats-table tbody tr:last-child { border-bottom: none; }
.stats-table tbody tr:hover { background: rgba(255,255,255,0.03); }

.stats-table tbody td { padding: 11px 16px; font-size: 14px; color: var(--grey-font); }

.td-stat-name { font-size: 12px; font-weight: 700; color: var(--text-muted); letter-spacing: 0.06em; text-transform: uppercase; }
.td-stat-full { font-size: 12px; color: var(--text-muted); padding-left: 0 !important; }

/* --- MOBILE-ONLY ABBREVIATIONS KEY --- */
.stats-key-section-mobile {
  display: none;
}

.stats-key-section-mobile .stats-key-section {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
}

.stats-key-section-mobile .key-toggle {
  width: 100%;
  padding: 14px 20px;
  background: var(--darkest-navy);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-family: 'Barlow', sans-serif;
  font-weight: 500;
  color: var(--grey-font);
  transition: color 0.2s, background 0.2s;
}

.stats-key-section-mobile .key-toggle:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.03);
}

.stats-key-section-mobile .key-toggle .ti-help {
  font-size: 15px;
  vertical-align: -2px;
  margin-right: 8px;
  color: var(--red);
}

.stats-key-section-mobile .key-chevron {
  font-size: 15px;
  transition: transform 0.25s ease;
}

.stats-key-section-mobile .key-chevron.open {
  transform: rotate(180deg);
}

.stats-key-section-mobile .stats-key-content {
  padding: 16px 20px 20px;
  background: rgba(13, 24, 48, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.stats-key-section-mobile .key-item {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.stats-key-section-mobile .key-item:last-child {
  border-bottom: none;
}

.stats-key-section-mobile .key-abbr {
  font-size: 12px;
  font-weight: 700;
  color: var(--white);
  min-width: 44px;
  flex-shrink: 0;
}

.stats-key-section-mobile .key-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.td-val {
  text-align: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  padding-bottom: 8px !important;
}

.stat-num { display: block; margin-bottom: 5px; }

.td-prev { text-align: center; font-size: 13px; color: var(--text-muted); }
.td-trend { text-align: center; }

.trend { font-size: 13px; font-weight: 700; margin-left: 4px; }
.trend-up   { color: #4ade80; }
.trend-down { color: #ff6b6b; }
.trend-flat { color: var(--text-muted); }

/* --- PERCENTILE BARS --- */
.pct-bar-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

.pct-bar-track {
  width: 64px;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
}

.pct-bar-fill {
  height: 100%;
  border-radius: 2px;
}

.pct-label {
  font-size: 10px;
  font-weight: 700;
  font-family: 'Barlow', sans-serif;
  white-space: nowrap;
  min-width: 34px;
  text-align: left;
}

/* --- RADAR CARD --- */
.radar-card {
  background: var(--dark-navy);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 22px;
}

.radar-svg { width: 100%; max-width: 260px; display: block; margin: 0 auto; }

/* --- SEASON HISTORY --- */
.history-strip {
  display: flex;
  background: rgba(17,29,66,0.5);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  overflow: hidden;
}

.history-season {
  flex: 1;
  padding: 14px 10px;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  transition: background 0.15s;
}

.history-season:last-child { border-right: none; }
.history-season:hover { background: rgba(255,255,255,0.04); }
.history-season.hs-active { background: rgba(196,18,48,0.08); }

.hs-label  { font-size: 10px; font-weight: 600; color: var(--text-muted); letter-spacing: 0.06em; margin-bottom: 8px; display: block; }
.hs-record { font-family: 'Barlow Condensed', sans-serif; font-size: 20px; font-weight: 800; color: var(--white); display: block; margin-bottom: 5px; }
.hs-rank   { font-size: 11px; color: var(--text-muted); display: block; margin-bottom: 5px; }
.hs-ppg    { font-size: 11px; color: var(--text-muted); display: block; margin-bottom: 5px; }
.hs-no-data { font-size: 12px; color: var(--text-muted); font-style: italic; padding-top: 8px; display: block; }

/* --- RESULTS SECTION --- */
.results-month { margin-bottom: 24px; }

.results-month-heading {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  background: var(--dark-navy);
  border-radius: 8px;
  margin-bottom: 2px;
  font-size: 13px;
  font-family: 'Barlow', sans-serif;
  cursor: pointer;
  transition: background 0.15s;
}

.result-row:hover {
  background: rgba(255,255,255,0.04);
}

.result-date  { color: var(--text-muted); min-width: 80px; font-size: 12px; }
.result-ha    { font-size: 10px; font-weight: 700; color: var(--text-muted); min-width: 20px; text-align: center; }

.result-opponent { flex: 1; color: var(--grey-font); }
.result-score {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px;
  font-weight: 700;
  min-width: 70px;
  text-align: right;
}

.result-wl {
  font-size: 11px;
  font-weight: 800;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wl-w { background: rgba(74,222,128,0.15); color: #4ade80; }
.wl-l { background: rgba(255,107,107,0.15); color: #ff6b6b; }

.box-score-chevron {
  font-size: 14px;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.result-row.expanded .box-score-chevron {
  transform: rotate(180deg);
}

.box-score-panel {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.07);
  border-top: none;
  border-radius: 0 0 8px 8px;
  margin-top: -6px;
  margin-bottom: 6px;
  padding: 16px;
}

.box-score-loading,
.box-score-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  color: var(--text-muted);
  font-size: 13px;
  font-family: 'Barlow', sans-serif;
}

.box-score-teams {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.box-score-team {
  min-width: 0;
}

.bs-team-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.bs-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.bs-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Barlow', sans-serif;
  font-size: 12px;
}

.bs-table thead th {
  padding: 6px 8px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.bs-table thead th:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--darkest-navy);
}

.bs-table tbody td {
  padding: 6px 8px;
  text-align: center;
  color: var(--white);
  white-space: nowrap;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.bs-player {
  text-align: left !important;
  font-weight: 600;
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--darkest-navy);
  box-shadow: 2px 0 4px rgba(0,0,0,0.3);
}

.bs-pos {
  display: inline-block;
  margin-left: 6px;
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
}

.bs-player-link {
  color: var(--white);
  text-decoration: none;
}

.bs-player-link:hover {
  text-decoration: underline;
}

.bs-legend-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'Barlow', sans-serif;
  font-size: 12px;
  cursor: pointer;
}

.bs-legend-toggle:hover {
  color: var(--white);
}

.bs-legend-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.bs-legend-item {
  font-family: 'Barlow', sans-serif;
  font-size: 11px;
  color: var(--text-muted);
}

.bs-legend-item strong {
  color: var(--white);
  margin-right: 4px;
}

.bs-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}

.bs-tab {
  padding: 5px 14px;
  background: none;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  color: var(--text-muted);
  font-family: 'Barlow', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.bs-tab:hover {
  color: var(--white);
  border-color: rgba(255,255,255,0.24);
}

.bs-tab.active {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.24);
  color: var(--white);
}

.bs-net-pos {
  color: #4ade80;
}

.bs-net-neg {
  color: #f87171;
}

@media (max-width: 768px) {
  .box-score-teams {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* --- RESPONSIVE --- */






.standings-team-link,
.result-opp-link,
.card-team-link,
.draft-team-link,
.chc-name-link,
.pp-name.standings-team-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}

.standings-team-link:hover,
.result-opp-link:hover,
.card-team-link:hover,
.draft-team-link:hover,
.pp-name.standings-team-link:hover {
  color: var(--white);
}

.chc-name-link { display: block; }
.chc-name-link:hover .chc-name { color: var(--grey-font); }

/* --- BIGGER TREND ARROWS WITH DIFF --- */
.trend-cell {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.trend { font-size: 18px; font-weight: 700; line-height: 1; }
.trend-diff { font-size: 11px; font-weight: 700; font-family: 'Barlow', sans-serif; }
.trend-up   { color: #4ade80; }
.trend-down { color: #ff6b6b; }
.trend-flat { color: var(--text-muted); font-size: 16px; }

/* --- TABLE INNER HEADER (title now inside the card) --- */
.table-inner-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-wrap: wrap;
}

/* --- HISTORY SECTION (above stats) --- */
.history-section {
  margin-bottom: 28px;
}

.history-section .section-title {
  margin-bottom: 12px;
}

/* --- HISTORY STRIP OUTCOME --- */
.hs-outcome {
  display: block;
  font-size: 10px;
  font-weight: 700;
  margin-top: 3px;
  letter-spacing: 0.03em;
}

/* --- TEAM HERO AREA (full width, above sidebar) --- */
.team-hero-area {
  padding: 160px 40px 0 260px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* --- TEAM DETAIL LAYOUT (sidebar + content) --- */
.team-detail-layout {
  display: flex;
  min-height: calc(100vh - 300px);
}

.team-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--darkest-navy);
  border-right: 1px solid rgba(255,255,255,0.06);
  overflow-y: auto;
  position: sticky;
  top: 0;
  max-height: 100vh;
}

.team-detail-layout #team-main {
  flex: 1;
  min-width: 0;
}

.team-detail-layout .team-page {
  padding: 28px 40px 80px;
  max-width: 1100px;
}

/* --- QUICK FACTS STRIP --- */
.team-quick-facts {
  display: flex;
  gap: 0;
  background: rgba(17,29,66,0.5);
  border: 1px solid rgba(74,222,128,0.3);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 20px;
  margin-bottom: 24px;
}

.tqf-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 16px;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.06);
}

.tqf-item:last-child { border-right: none; }

.tqf-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.tqf-value {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: #4ade80;
  line-height: 1;
  margin-bottom: 4px;
}

.tqf-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.team-sidebar .sidebar-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 12px 16px 8px;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 20px 16px 8px;
}

.sidebar-conf-toggle {
  display: flex;
  gap: 4px;
  padding: 0 12px 8px;
}

.scf-btn {
  flex: 1;
  padding: 6px 4px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  background: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  font-family: 'Barlow', sans-serif;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.scf-btn:hover { color: var(--white); background: rgba(255,255,255,0.05); }
.scf-btn.active { background: var(--red); color: var(--white); border-color: var(--red); }

.sidebar-conf-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--red);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 12px 16px 6px;
}

.team-sidebar-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 9px 16px;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  font-size: 13px;
  font-family: 'Barlow', sans-serif;
  color: var(--grey-font);
  text-align: left;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.team-name-full {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-sidebar-record {
  flex-shrink: 0;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.team-sidebar-btn.active .team-sidebar-record {
  color: rgba(255,255,255,0.75);
}

.team-sidebar-btn:hover {
  background: rgba(255,255,255,0.04);
  color: var(--white);
}

.team-sidebar-btn.active {
  background: rgba(196,18,48,0.08);
  border-left: 3px solid var(--red);
  padding-left: 13px;
  color: var(--white);
  font-weight: 600;
}

.mobile-team-nav {
  display: contents;
}

.team-name-abbr {
  display: none;
}

/* --- ROSTER GRID --- */
.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.roster-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 14px 12px 12px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.roster-card:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.14);
  transform: translateY(-2px);
}

/* Row 1: score / tier tag / position -- a true 3-column layout
   (1fr auto 1fr) so the tag is genuinely centered regardless of how
   wide the score number or position badge are, rather than an
   approximate centering that drifts with content width. */
.roster-top-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  width: 100%;
}

.roster-score {
  justify-self: start;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
}

.roster-tier {
  justify-self: center;
  margin-top: 4px;
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  border: 0.5px solid;
  white-space: nowrap;
}

.roster-pos-badge {
  justify-self: end;
  margin-top: 1px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255,255,255,0.06);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Row 2: player name -- reserves space for 2 lines regardless of
   whether this particular name actually needs a second line, so
   every card in the grid ends up the same height rather than only
   matching its own row (grid rows only stretch to their own tallest
   card by default). */
.roster-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--white);
  line-height: 1.3;
  text-align: center;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Row 3: PTS / REB / AST, centered */
.roster-stats {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.roster-stats span {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  padding: 2px 5px;
  border-radius: 4px;
}

/* --- RESULTS TABS --- */
.results-tabs {
  display: flex;
  gap: 6px;
}

.results-tab {
  padding: 5px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  background: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  font-family: 'Barlow', sans-serif;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.results-tab:hover { color: var(--white); background: rgba(255,255,255,0.06); }
.results-tab.active { background: var(--red); color: var(--white); border-color: var(--red); }

/* --- NO PLAYOFFS MESSAGE --- */
.no-playoffs-msg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  font-family: 'Barlow', sans-serif;
}

/* ============================================
   RESPONSIVE (moved to end of file so mobile
   rules always cascade after base/desktop rules)
============================================ */

@media (max-width: 900px) {
  .team-two-col  { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .team-page          { padding: 30px 24px 60px; }
  .team-hero-area     { padding: 30px 20px 0; }
  .team-detail-layout { flex-direction: column; }
  .team-sidebar {
    width: 100%;
    max-height: none;
    position: static;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 8px;
  }

  .sidebar-title,
  .sidebar-section-label,
  .sidebar-conf-label {
    display: none;
  }

  .sidebar-conf-toggle {
    padding: 10px 10px 8px;
  }

  .team-sidebar-links {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    padding: 0 10px 10px;
    gap: 6px;
  }

  .team-sidebar-btn {
    display: block;
    width: auto;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.08);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-align: center;
  }

  .team-sidebar-btn.active {
    border: 1px solid var(--red);
    border-left: 1px solid var(--red);
    background: rgba(196, 18, 48, 0.12);
    padding-left: 10px;
  }

  .team-detail-layout .team-page { padding: 24px 20px 60px; }

  .td-stat-full,
  .season-stats-table thead th:nth-child(2) {
    display: none;
  }

  .stats-key-section-mobile {
    display: block;
    margin-bottom: 12px;
  }

  .stats-table thead th {
    white-space: nowrap;
    padding: 12px 8px;
    font-size: 10px;
  }

  .stats-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: calc(100% + 40px);
    margin: 0 -20px;
  }

  /* --- QUICK FACTS: SCROLL INSTEAD OF CLIPPING --- */
  .team-quick-facts {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tqf-item {
    flex: 0 0 140px;
    width: 140px;
  }

  #mobile-team-nav-slot {
    position: relative;
    z-index: 1;
    padding-top: 98px;
    background: var(--darkest-navy);
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
}

@media (max-width: 600px) {
  .team-name     { font-size: 38px; }
  .team-hero     { flex-direction: column; }
  .team-hero-right { align-items: flex-start; }
  .team-record-block { text-align: left; }
  .history-strip { flex-wrap: wrap; }
  .history-season { flex: 1 0 30%; }
}
