/* =========================================================================
   PLAYOFFS — Bracket + Series Modal
   Follows the PLVYOFF Glass Card design system.
   ========================================================================= */

.playoffs-page {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px 20px 80px;
  color: var(--text-primary, #e0e0e0);
}

/* ─── Header ───────────────────────────────────────────────────────────── */
.playoffs-header { margin-bottom: 28px; }
.playoffs-title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.playoffs-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin: 0;
  color: var(--text-primary, #e0e0e0);
}

/* ─── Custom season dropdown ───────────────────────────────────────────── */
.playoffs-season-selector {
  position: relative;
  display: inline-block;
  min-width: 130px;
}
.playoffs-season-btn {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.015) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text-primary, #e0e0e0);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 8px 14px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
  user-select: none;
}
.playoffs-season-btn:hover,
.playoffs-season-btn.open {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.06);
}
.playoffs-season-btn:focus-visible {
  border-color: rgba(255, 255, 255, 0.4);
}
.playoffs-season-caret {
  color: var(--text-muted, #8a8a8a);
  transition: transform 0.18s ease;
}
.playoffs-season-btn.open .playoffs-season-caret { transform: rotate(180deg); }

.playoffs-season-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: #161616;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 100;
  max-height: 260px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #2a2a2a transparent;
}
.playoffs-season-list[hidden] { display: none; }
.playoffs-season-item {
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary, #e0e0e0);
  cursor: pointer;
  letter-spacing: 0.3px;
  text-align: left;
}
.playoffs-season-item:hover {
  background: rgba(255, 255, 255, 0.06);
}
.playoffs-season-item.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.playoffs-loading,
.playoffs-empty {
  text-align: center;
  padding: 60px 16px;
  color: var(--text-muted, #8a8a8a);
  font-size: 0.75rem;
  letter-spacing: 0.4px;
}

/* ─── Bracket grid (desktop: horizontal mirror) ────────────────────────── */
.playoffs-bracket {
  display: grid;
  grid-template-columns:
    minmax(180px, 1fr)   /* East R1  */
    minmax(180px, 1fr)   /* East R2  */
    minmax(180px, 1fr)   /* East CF  */
    minmax(220px, 1.2fr) /* NBAF     */
    minmax(180px, 1fr)   /* West CF  */
    minmax(180px, 1fr)   /* West R2  */
    minmax(180px, 1fr);  /* West R1  */
  gap: 14px;
  align-items: stretch;
}

/* Bracket columns: CSS grid with equal-fraction rows for cards.
   R2 cards land exactly between R1 pairs thanks to 1fr rows.
   padding-top reserves space for the round label that sits above each card. */
.bracket-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 14px;
  min-height: 440px;
  padding-top: 22px;
}
.bracket-col.r2 { grid-template-rows: 1fr 1fr; }
.bracket-col.cf,
.bracket-col.nbaf { grid-template-rows: 1fr; }

.bracket-col > .series-card { align-self: center; }

/* Per-card round label — absolute above the card, so each card in each
   column has its own visible label directly on top. */
.card-round-label {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.58rem;
  font-weight: 700;
  color: #a8a8a8;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  pointer-events: none;
  white-space: nowrap;
}

.bracket-col-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: #a8a8a8;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  text-align: center;
  margin-bottom: 2px;
}

/* ─── Series card — proper glass with subtle gradient ──────────────────── */
.series-card {
  position: relative;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.025) 100%);
  /* saturate() lifts colours showing through the blur so the card really
     looks frosted instead of flat rgba overlay. */
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.series-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
}
.series-card.placeholder {
  cursor: default;
  opacity: 0.6;
  box-shadow: none;
  border-color: rgba(255, 255, 255, 0.14);
  background: linear-gradient(135deg, rgba(255,255,255,0.035) 0%, rgba(255,255,255,0.01) 100%);
}
.series-card.placeholder:hover {
  border-color: rgba(255, 255, 255, 0.14);
  transform: none;
  background: linear-gradient(135deg, rgba(255,255,255,0.035) 0%, rgba(255,255,255,0.01) 100%);
}

.series-card.nbaf {
  border-color: rgba(255, 255, 255, 0.2);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.06);
}
.series-card.completed .series-row.loser { opacity: 0.45; }

/* Virtual card: winner awaiting their next opponent. Non-clickable. */
.series-card.virtual { cursor: default; }
.series-card.virtual:hover { border-color: rgba(255,255,255,0.1); transform: none; }
.series-card.virtual .series-row:last-of-type { opacity: 0.35; }

.series-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-primary, #e0e0e0);
}
.series-row + .series-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Leading team = green wins count. Trailing / tied = white (default). */
.series-row.leading .series-wins { color: #00d6b4; }

/* "Facing Elimination · Win or Go Home" tag on a live series at 3-X.
   Always-scrolling horizontal marquee. Two duplicated items inside an
   inline-flex track let us animate translateX from 0 to -50% for a
   seamless infinite loop. Soft mask fades the text at the card edges. */
.series-elim {
  overflow: hidden;
  padding: 5px 0 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #ef4444;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
          mask-image: linear-gradient(to right, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
}
.series-elim-track {
  display: inline-flex;
  white-space: nowrap;
  animation: series-elim-scroll 14s linear infinite;
  will-change: transform;
}
.series-elim-item {
  flex-shrink: 0;
  padding-right: 40px;
}
.series-elim:hover .series-elim-track { animation-play-state: paused; }
.series-elim .series-elim-sep { color: rgba(239, 68, 68, 0.4); font-weight: 400; padding: 0 5px; }
.series-elim .series-elim-sub { color: rgba(239, 68, 68, 0.75); font-weight: 500; }
@keyframes series-elim-scroll {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

.series-team {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.series-team img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}
.series-team-name,
.series-team-initials {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}
/* Desktop: show short_name, hide initials */
.series-team-initials { display: none; }

.series-wins {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #ffffff;
  font-size: 0.85rem;
}

/* Desktop: hide per-column header (cards have their own labels) */
.bracket-col-header { display: none; }

/* Desktop: tabs bar is mobile-only */
.playoffs-mobile-tabs { display: none; }

/* ─── Mobile: 4 tabs (First Round / Semifinals / Conf Finals / Finals) ───
   Each tab shows BOTH East and West series of that round on the same page.
   No swipe, just a tap on the tab. Content centres vertically when short. */
@media (max-width: 1100px) {
  /* Pull up to compensate for .content's 80px top padding (navbar clearance).
     Navbar is ~50px on mobile, so we leave ~6px gap below it. */
  .playoffs-page { padding: 0 0 80px; margin-top: -24px; }
  .playoffs-header { padding: 0 14px; margin-bottom: 4px; }
  .playoffs-title {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.4px;
  }

  /* Smaller season selector on mobile */
  .playoffs-season-selector { min-width: 92px; }
  .playoffs-season-btn {
    padding: 4px 9px;
    font-size: 0.68rem;
    border-radius: 6px;
    gap: 6px;
  }
  .playoffs-season-caret { width: 8px; height: 8px; }
  .playoffs-season-item { padding: 6px 10px; font-size: 0.7rem; }

  /* Tabs bar — tighter, more minimalist */
  .playoffs-mobile-tabs {
    display: flex;
    gap: 4px;
    padding: 6px 12px 8px;
    margin: 0;
  }
  .playoffs-mobile-tab {
    flex: 1;
    padding: 6px 4px;
    border-radius: 7px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.5);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    cursor: pointer;
    text-align: center;
    line-height: 1.15;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  }
  .playoffs-mobile-tab:hover { color: #fff; }
  .playoffs-mobile-tab.active {
    color: #ffffff;
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.2);
  }

  /* Bracket becomes a single centred stack of only the cols matching the
     current tab. Other cols are hidden via data-tab selectors below. */
  .playoffs-bracket {
    display: flex !important;
    grid-template-columns: none;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    padding: 10px 22px 32px;
    margin: 0;
    min-height: calc(100dvh - 240px);
    overflow: visible;
  }
  .playoffs-bracket::-webkit-scrollbar { display: none; }

  /* Default: every col hidden, shown only when its round matches data-tab */
  .bracket-col { display: none; }
  .playoffs-bracket[data-tab="R1"]   .bracket-col.r1,
  .playoffs-bracket[data-tab="R2"]   .bracket-col.r2,
  .playoffs-bracket[data-tab="CF"]   .bracket-col.cf,
  .playoffs-bracket[data-tab="NBAF"] .bracket-col.nbaf {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: auto;
    padding: 0;
    animation: tab-fade 0.25s ease;
  }
  /* Reset desktop grid-row rules */
  .bracket-col > * {
    grid-column: auto !important;
    grid-row: auto !important;
    align-self: stretch !important;
    min-width: 0 !important;
  }
  .bracket-col > .series-card { width: 100%; }

  /* Per-card round label is redundant on mobile (tab already says it) */
  .card-round-label { display: none; }

  /* Show the column header (East · First Round / West · First Round) */
  .bracket-col-header {
    display: block;
    font-size: 0.64rem;
    font-weight: 700;
    color: #a0a0a0;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    padding: 2px 0 6px;
  }

  /* Narrow screens keep full short names (cards are full width now) */
  .series-team-name     { display: inline; }
  .series-team-initials { display: none; }

  @keyframes tab-fade {
    from { opacity: 0.2; transform: translateY(4px); }
    to   { opacity: 1;   transform: translateY(0);   }
  }
}

/* ─── Series modal (positioned below navbar) ──────────────────────────── */
.series-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  /* padding-bottom uses env(safe-area-inset-bottom) for iOS home indicator
     + a chunky fallback so mobile browser chrome (Chrome bottom bar,
     URL bar, tab switcher) doesn't hide the bottom of the modal. */
  padding: 80px 20px max(20px, env(safe-area-inset-bottom, 20px));
  box-sizing: border-box;
}
.series-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}
.series-modal-content {
  position: relative;
  width: 100%;
  max-width: 960px;
  /* 100dvh = dynamic viewport: shrinks when mobile browser UI (URL bar,
     tab switcher, …) is showing. Falls back to 100vh on old browsers. */
  max-height: calc(100vh - 100px);
  max-height: calc(100dvh - 100px);
  background: #121212;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
}

.series-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted, #8a8a8a);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 14px;
  z-index: 2;
  padding: 0;
  /* Hide any native text (e.g. &times;) — we draw a perfectly centred X
     with two pseudo-elements so font metrics never shift the cross. */
  font-size: 0;
  color: transparent;
}
.series-modal-close::before,
.series-modal-close::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 11px;
  height: 1.6px;
  background: var(--text-muted, #8a8a8a);
  border-radius: 1px;
  transform-origin: center;
}
.series-modal-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.series-modal-close::after  { transform: translate(-50%, -50%) rotate(-45deg); }
.series-modal-close:hover { border-color: rgba(255, 255, 255, 0.2); }
.series-modal-close:hover::before,
.series-modal-close:hover::after { background: #ffffff; }

/* Modal header */
.series-modal-header {
  padding: 18px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}
.series-modal-header .sm-round {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted, #8a8a8a);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  width: 100%;
  text-align: center;
}
.sm-team {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sm-team img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.sm-team-name {
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.sm-score {
  font-size: 1.55rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
}
.sm-score.leading { color: #00d6b4; }
.sm-score.winner  { color: #00d6b4; }
.sm-vs {
  font-size: 0.62rem;
  color: var(--text-dim, #777);
  font-weight: 700;
  letter-spacing: 1px;
}

/* Game tabs */
.series-modal-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 16px 0;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #2a2a2a transparent;
  flex-shrink: 0;
}
.series-modal-tabs::-webkit-scrollbar { height: 4px; }
.series-modal-tabs::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 2px; }

.sm-tab {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px 8px 0 0;
  color: var(--text-muted, #8a8a8a);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.sm-tab:hover { color: #fff; }
.sm-tab.active {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  border-bottom-color: transparent;
  background: rgba(255, 255, 255, 0.06);
}
.sm-tab:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Sub tabs (period + team filter) */
.series-modal-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.sm-subtab {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  color: var(--text-muted, #8a8a8a);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 5px 11px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.sm-subtab:hover { color: #fff; }
.sm-subtab.active {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
}

/* Modal body — no top padding so sticky header sits flush against subtabs.
   Smooth touch scrolling + contained overscroll for iOS. */
.series-modal-body {
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0 16px 20px;
  scrollbar-width: thin;
  scrollbar-color: #2a2a2a transparent;
}
.series-modal-body::-webkit-scrollbar { width: 4px; height: 4px; }
.series-modal-body::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 2px; }

/* ─── Box score table ──────────────────────────────────────────────────── */
.sm-boxscore-table {
  width: 100%;
  /* border-collapse: separate is REQUIRED for position:sticky on cells to work
     reliably on Safari/iOS. collapse defeats sticky on mobile. */
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.72rem;
  /* Own stacking context so sticky cells paint cleanly over row content. */
  isolation: isolate;
}
.sm-boxscore-table th,
.sm-boxscore-table td {
  padding: 8px 6px;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-variant-numeric: tabular-nums;
  /* All cells vertically centred so stats align with the photo+name in the
     sticky Player column (row height is driven by the 26-30px photo). */
  vertical-align: middle;
}
.sm-boxscore-table th {
  color: #a8a8a8;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  background: #121212;          /* solid to hide scrolled rows */
  position: sticky;
  top: 0;
  z-index: 2;
  padding-top: 14px;            /* visual breathing room inside header */
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sm-boxscore-table td.sm-player-name,
.sm-boxscore-table th.sm-player-name {
  text-align: left;
  color: var(--text-primary, #e0e0e0);
  font-weight: 600;
  text-transform: none;
  /* Frozen first column — stays visible while stats scroll.
     iOS/Safari needs !important + -webkit-sticky + GPU compositing to
     keep the sticky behavior on <td> cells. Without translate3d + will-change,
     cell contents slide on real iPhones (F12 desktop emulation lies). */
  position: -webkit-sticky !important;
  position: sticky !important;
  left: 0 !important;
  background: #121212 !important;
  z-index: 2;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.sm-boxscore-table th.sm-player-name {
  z-index: 4;  /* above sticky th row + sticky td column */
}
.sm-boxscore-table tr.totals td.sm-player-name {
  background: #1a1a1a !important;
}
.sm-boxscore-table td.sm-player-name {
  /* Keep default table-cell display — iOS Safari breaks sticky when the
     td itself is display:flex. Flex layout is on the inner wrapper below. */
  padding-left: 8px;
  min-width: 130px;
  max-width: 200px;
  width: 200px;               /* lock the column width so long names truncate */
  vertical-align: middle;
  overflow: hidden;            /* clip anything that tries to spill into stats */
}
.sm-player-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.sm-boxscore-table td.sm-player-name .sm-player-cell > span:not(.sm-player-photo-fallback),
.sm-boxscore-table td.sm-player-name .sm-player-link > span:not(.sm-player-photo-fallback) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;                /* allow the text to shrink inside its flex */
  flex: 1 1 auto;
}

/* Desktop only — enlarge the player name text without increasing row height
   or horizontal padding. Only the text span grows. */
@media (min-width: 701px) {
  .sm-boxscore-table td.sm-player-name .sm-player-cell > span,
  .sm-boxscore-table td.sm-player-name .sm-player-link > span {
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.1px;
    line-height: 1;
  }
}
/* Clickable player — open profile in a new tab without any color / underline
   change so the table styling stays pristine. */
.sm-player-link,
.sm-player-link:link,
.sm-player-link:visited,
.sm-player-link:hover,
.sm-player-link:active,
.sm-player-link:focus {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  outline: none;
  /* Allow child text to shrink + trigger ellipsis on overflow */
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.sm-player-link:hover { opacity: 0.85; }
.sm-player-photo {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: contain;
  background: #1a1a1a;
  flex-shrink: 0;
}
.sm-player-photo-fallback {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--text-muted, #8a8a8a);
  flex-shrink: 0;
}
.sm-team-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}
.sm-boxscore-table td.team-cell {
  text-align: left;
  font-weight: 700;
  color: var(--text-muted, #8a8a8a);
  letter-spacing: 0.4px;
  font-size: 0.66rem;
}

.sm-boxscore-table tr.totals td {
  font-weight: 700;
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}
.sm-boxscore-table tr.totals td.sm-player-name {
  color: #ffffff;
}

.sm-boxscore-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted, #8a8a8a);
  font-size: 0.72rem;
}

/* Period sub-tab (desktop / PC) — 2 lines: label on top, score row
   (logo + road — home + logo) on the bottom. "Full" tab has no score row;
   its label is vertically centered thanks to justify-content. */
.sm-subtab.sm-subtab-period {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  min-width: 96px;
  min-height: 66px;
}
.sm-subtab-label {
  font-size: 0.74rem;
  letter-spacing: 0.4px;
}
.sm-subtab-scores {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
}
.sm-qtr-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}
.sm-qtr-score {
  color: var(--text-muted, #8a8a8a);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.sm-qtr-score.sm-qtr-winner {
  color: #ffffff;
  font-weight: 800;
}
.sm-qtr-sep {
  color: var(--text-dim, #555);
  font-weight: 400;
  opacity: 0.7;
}
/* Mobile / narrow — revert to the compact stacked layout (no logos,
   scores one above the other), matching the pre-redesign mobile look. */
@media (max-width: 700px) {
  .sm-subtab.sm-subtab-period {
    min-width: 42px;
    min-height: 0;
    padding: 5px 11px;
    gap: 2px;
  }
  .sm-subtab-label { font-size: 0.62rem; letter-spacing: 0.3px; }
  .sm-subtab-scores {
    flex-direction: column;
    gap: 0;
    font-size: 0.6rem;
    font-weight: 600;
    line-height: 1.15;
    opacity: 0.8;
  }
  .sm-qtr-logo,
  .sm-qtr-sep { display: none; }
}

/* "Currently on court" legend displayed at the bottom of the modal. */
.bs-live-legend {
  position: absolute;
  bottom: 8px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.62rem;
  color: var(--text-muted, #8a8a8a);
  opacity: 0.8;
  letter-spacing: 0.3px;
  pointer-events: none;
}
.bs-live-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 5px #22c55e;
}

/* Bet outcome highlighting: cells colored based on whether the player's
   stat met the user's bet threshold for this game. */
.sm-boxscore-table td.bet-green {
  color: #22c55e !important;
  font-weight: 700;
}
.sm-boxscore-table td.bet-red {
  color: #ef4444 !important;
  font-weight: 700;
}

/* Live "on court" indicator — green vertical bar on the sticky Player cell
   of rows whose player is currently playing. */
.sm-boxscore-table tr.bs-row-on-court td.sm-player-name::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
  border-radius: 2px;
}
@media (max-width: 700px) {
  .sm-boxscore-table tr.bs-row-on-court td.sm-player-name::before {
    width: 2px;
    box-shadow: 0 0 4px rgba(34, 197, 94, 0.5);
  }
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ─── Modal responsive (mobile / narrow screens) ───────────────────────── */
@media (max-width: 700px) {
  .series-modal {
    padding: 70px 8px max(16px, env(safe-area-inset-bottom, 16px));
  }
  .series-modal-content {
    max-height: calc(100vh - 90px);
    max-height: calc(100dvh - 90px);
    border-radius: 10px;
  }
  .series-modal-header {
    padding: 14px 14px 10px;
    gap: 10px;
  }
  .series-modal-header .sm-round {
    font-size: 0.55rem;
    margin-bottom: 2px;
  }
  .sm-team { gap: 6px; }
  .sm-team img { width: 26px; height: 26px; }
  .sm-team-name { font-size: 0.7rem; }
  .sm-score { font-size: 1.1rem; }
  .sm-vs { font-size: 0.55rem; }

  .series-modal-tabs { padding: 8px 10px 0; gap: 3px; }
  .sm-tab {
    font-size: 0.6rem;
    padding: 6px 9px;
    letter-spacing: 0.3px;
  }

  .series-modal-subtabs { padding: 8px 10px; gap: 4px; }
  .sm-subtab {
    font-size: 0.58rem;
    padding: 4px 8px;
    letter-spacing: 0.3px;
  }

  .series-modal-body { padding: 0 0 16px; }
  .sm-boxscore-table { font-size: 0.68rem; }
  .sm-boxscore-table th,
  .sm-boxscore-table td { padding: 7px 5px; }
  .sm-boxscore-table td.sm-player-name,
  .sm-boxscore-table th.sm-player-name {
    padding-left: 10px;
    min-width: 120px;
    max-width: 150px;
    width: 150px;
  }
  .sm-player-photo,
  .sm-player-photo-fallback { width: 26px; height: 26px; }
  .sm-team-logo { width: 24px; height: 24px; }
}

