/* Responsive scaling and alignment for muted small text next to logo */
@media (max-width: 600px) {
  .muted.small.text-end {
    font-size: 0.95em;
    text-align: center !important;
    display: block;
    margin: 0.5em auto 0 auto;
    width: 100%;
  }
}
/* Theme Management */
:root {
  /* Dark Theme (Default) */
  --bg-primary: #0b1220;
  --bg-secondary: #21262d;
  --bg-tertiary: #30363d;
  --text-primary: rgba(255, 255, 255, 0.92);
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.5);
  --border-color: rgba(255, 255, 255, 0.1);
  --accent-color: rgba(99, 102, 241, 0.9);
}

[data-theme="light"] {
  /* Light Theme */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #e9ecef;
  --text-primary: rgba(0, 0, 0, 0.9);
  --text-secondary: rgba(0, 0, 0, 0.7);
  --text-muted: rgba(0, 0, 0, 0.6);
  --border-color: rgba(0, 0, 0, 0.15);
  --accent-color: rgba(99, 102, 241, 0.9);
}

/* Theme toggle icons */
.theme-icon {
  width: 18px;
  height: 18px;
  stroke: rgba(255, 255, 255, 0.9);
  transition: stroke 0.2s ease, transform 0.2s ease;
}

.theme-icon:hover {
  transform: scale(1.1);
}

/* Sun icon in light mode - use golden/orange color */
[data-theme="light"] .theme-icon {
  stroke: #f59e0b;
}

    html, body {
      height: 100%;
    }

    body {
      position: relative;
      background: var(--bg-primary); /* Use theme variable */
      color: var(--text-primary);
      font-size: 0.9375rem;
      min-height: 100vh;
      overflow-x: hidden;
      display: flex;
      flex-direction: column;
    }

    /* Gradient background layer */
    body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;

    /* Backpack-style soft gradient */
    background:
        radial-gradient(1200px 600px at 10% 10%, rgba(99,102,241,0.25), transparent 60%),
        radial-gradient(900px 500px at 90% 20%, rgba(236,72,153,0.20), transparent 60%),
        radial-gradient(800px 500px at 50% 90%, rgba(14,165,233,0.20), transparent 60%),
        linear-gradient(180deg, #0b1220 0%, #0b1220 100%);
    }

    .card {
        background: #0f1a2d;
        border: 1px solid rgba(255,255,255,.08);
      }

    /* Make cards fill available height inside grid cells */
    .h-fill {
      height: 100%;
      display: flex;
      flex-direction: column;
    }
    .h-fill .card-body {
      flex: 1 1 auto;
      overflow-x: hidden;
      overflow-y: auto;
    }
    /* Ensure bootstrap h-100 cards also stretch and their body scrolls */
    .card.h-100 {
      display: flex;
      flex-direction: column;
    }
    .card.h-100 .card-body {
      flex: 1 1 auto;
      overflow-x: hidden;
      overflow-y: auto;
    }

    /* Prevent nested horizontal scrollbars inside cards (tables/lists). */
    .card-body {
      overflow-x: hidden;
    }

    /* Let tables fit the card width without creating inner horizontal scrollbars. */
    .table-responsive {
      overflow-x: hidden;
    }

    /* Allow long player names to truncate rather than forcing horizontal scrolling. */
    #boards table td, #boards table th {
      white-space: nowrap;
    }
    #boards table td:nth-child(2),
    #boards table th:nth-child(2) {
      max-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .card-header {
      border-bottom: 1px solid rgba(255,255,255,.08);
      font-size: 0.875rem;
    }

    .card-header > div:first-child {
      color: #ffffff;
    }

    [data-theme="light"] .card-header,
    [data-theme="light"] .card-header *,
    [data-theme="light"] .card-header > div:first-child,
    [data-theme="light"] .card-header .fw-semibold,
    [data-theme="light"] .card-header .text-white,
    [data-theme="light"] .card-header div,
    [data-theme="light"] .card-header span {
      color: rgba(0, 0, 0, 0.9) !important;
    }

    [data-theme="light"] .card-header .muted {
      color: rgba(0, 0, 0, 0.6) !important;
    }

    /* Light mode: table and card body text */
    [data-theme="light"] .table {
      --bs-table-bg: var(--bg-secondary) !important;
      --bs-table-color: var(--text-primary) !important;
      --bs-table-border-color: var(--border-color) !important;
      --bs-table-striped-bg: var(--bg-tertiary) !important;
      --bs-table-hover-bg: var(--bg-tertiary) !important;
      color: var(--text-primary) !important;
    }

    [data-theme="light"] .table td,
    [data-theme="light"] .table th {
      color: var(--text-primary) !important;
    }

    /* Light mode: injury status pills */
    [data-theme="light"] .injury-status {
      color: rgba(0, 0, 0, 0.85) !important;
      border-color: rgba(0, 0, 0, 0.2) !important;
    }

    [data-theme="light"] .injury-status.out {
      background: rgba(239, 68, 68, 0.25);
      color: rgba(0, 0, 0, 0.85) !important;
    }

    [data-theme="light"] .injury-status.doubtful {
      background: rgba(245, 158, 11, 0.25);
      color: rgba(0, 0, 0, 0.85) !important;
    }

    [data-theme="light"] .injury-status.dtd {
      background: rgba(59, 130, 246, 0.25);
      color: rgba(0, 0, 0, 0.85) !important;
    }

    [data-theme="light"] .injury-status.questionable {
      background: rgba(168, 85, 247, 0.25);
      color: rgba(0, 0, 0, 0.85) !important;
    }

    .muted {
      color: rgba(255,255,255,.65);
      font-size: 0.8125rem;
    }

    .table {
      --bs-table-bg: #0f1a2d;
      --bs-table-striped-bg: rgba(255,255,255,.03);
      --bs-table-hover-bg: rgba(255,255,255,.05);
      --bs-table-color: rgba(255,255,255,.92);
      --bs-table-border-color: rgba(255,255,255,.08);
      font-size: 0.875rem;
    }
    
    .table tbody {
      transition: opacity 0.15s ease;
    }

      /* Season leaders: progressively smaller typography by rank.
         Rank 1 stays at the default table font-size. */
      .leaders-season .leader-text {
        line-height: 1.05;
      }
      .leaders-season tr.leader-rank-2 .leader-text { font-size: 0.95em; }
      .leaders-season tr.leader-rank-3 .leader-text { font-size: 0.90em; }
      .leaders-season tr.leader-rank-rest .leader-text { font-size: 0.85em; }

    /* Highlight players from selected game teams */
    tr.selected-team-player {
      background: rgba(99, 102, 241, 0.1) !important;
      border-left: 3px solid rgba(99, 102, 241, 0.6);
      transition: background 0.3s ease, border-left 0.3s ease;
    }
    
    tr.selected-team-player:hover {
      background: rgba(99, 102, 241, 0.15) !important;
    }

    /* Small toggle styling */
    .form-switch {
      padding-left: 2.25rem;
    }
    .form-switch .form-check-input {
      width: 34px;
      height: 16px;
      margin-top: 0;
      cursor: pointer;
    }

    /* Header toggles: keep switches + labels vertically centered. */
    .board-toggles {
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }
    .board-toggles .form-check.form-switch {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      padding-left: 0; /* avoid Bootstrap's default left padding since we use flex */
      margin-bottom: 0;
    }
    .board-toggles .form-check-input {
      margin-left: 0;
      margin-top: 0;
    }
    .board-toggles .form-check-label {
      margin-bottom: 0;
      line-height: 1;
    }
    /* Smaller season sub-toggle so it matches the label sizing */
    .board-toggles .mini-switch .form-check-input {
      width: 28px;
      height: 14px;
    }
    .mode-label {
      font-size: 0.75rem;
      letter-spacing: 0.02em;
      text-transform: uppercase;
      display: inline-flex;
      align-items: center;
      line-height: 1;
    }

    /* Same sizing as .mode-label, but preserves original casing. */
    .mode-label-size {
      font-size: 0.75rem;
      letter-spacing: 0.02em;
      display: inline-flex;
      align-items: center;
      line-height: 1;
    }

    .board-title {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      line-height: 1;
    }

    /* Apply theme variables to major components */
    .card {
      background-color: var(--bg-secondary) !important;
      border-color: var(--border-color) !important;
    }

    .card-header {
      background-color: var(--bg-tertiary) !important;
      border-color: var(--border-color) !important;
      color: var(--text-primary) !important;
    }

    .table-dark {
      --bs-table-bg: var(--bg-secondary) !important;
      --bs-table-color: var(--text-primary) !important;
      --bs-table-border-color: var(--border-color) !important;
      --bs-table-striped-bg: var(--bg-tertiary) !important;
      --bs-table-hover-bg: var(--bg-tertiary) !important;
    }

    .text-white {
      color: var(--text-primary) !important;
    }

    .muted {
      color: var(--text-muted) !important;
    }

    /* Modal theming */
    .modal-content {
      background-color: var(--bg-secondary) !important;
      border-color: var(--border-color) !important;
    }

    .modal-header {
      background-color: var(--bg-tertiary) !important;
      border-color: var(--border-color) !important;
    }

    .modal-body {
      background-color: var(--bg-secondary) !important;
      color: var(--text-primary) !important;
    }

    /* Light mode modal overrides */
    [data-theme="light"] .modal-content {
      box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    }

    [data-theme="light"] .modal-header,
    [data-theme="light"] .modal-header *,
    [data-theme="light"] .modal-title {
      color: var(--text-primary) !important;
    }

    [data-theme="light"] .modal-body,
    [data-theme="light"] .modal-body * {
      color: var(--text-primary);
    }

    [data-theme="light"] .modal-close-btn {
      background: rgba(0, 0, 0, 0.08);
      border: 1px solid rgba(0, 0, 0, 0.15);
    }

    [data-theme="light"] .modal-close-btn:hover {
      background: rgba(0, 0, 0, 0.12);
      border-color: rgba(0, 0, 0, 0.25);
    }

    [data-theme="light"] .modal-close-btn::before,
    [data-theme="light"] .modal-close-btn::after {
      background: rgba(0, 0, 0, 0.7);
    }

    [data-theme="light"] .modal-footer-btn {
      background: rgba(0, 0, 0, 0.06);
      border: 1px solid rgba(0, 0, 0, 0.15);
      color: var(--text-primary);
    }

    [data-theme="light"] .modal-footer-btn:hover {
      background: rgba(0, 0, 0, 0.1);
      border-color: rgba(0, 0, 0, 0.25);
      color: var(--text-primary);
    }

    [data-theme="light"] .btn-close {
      filter: none;
    }

    /* Light mode play-by-play styles */
    [data-theme="light"] .play-time {
      color: rgba(99, 102, 241, 1);
    }

    [data-theme="light"] .play-score {
      color: var(--text-secondary);
    }

    [data-theme="light"] .play-center {
      border-left-color: rgba(99, 102, 241, 0.4);
      border-right-color: rgba(99, 102, 241, 0.4);
    }

    [data-theme="light"] .quarter-section {
      border-left-color: rgba(99, 102, 241, 0.5);
    }

    [data-theme="light"] .quarter-title {
      color: var(--text-primary);
    }

    [data-theme="light"] .play-item {
      background: var(--bg-tertiary);
      border: 1px solid var(--border-color);
    }

    [data-theme="light"] .play-text {
      color: var(--text-secondary);
    }

    [data-theme="light"] .play-item.scoring {
      background: rgba(34, 197, 94, 0.1);
      border-color: rgba(34, 197, 94, 0.3);
    }

    [data-theme="light"] .play-item.scoring .play-text {
      color: rgba(22, 101, 52, 1);
    }
    
    /* Light mode defensive plays (red) */
    [data-theme="light"] .play-item.defensive-play .play-text {
      color: rgba(127, 29, 29, 1);
    }
    
    [data-theme="light"] .play-item.defensive-play .play-type {
      color: rgba(185, 28, 28, 1);
    }
    
    /* Light mode positive plays (green) */
    [data-theme="light"] .play-item.positive-play .play-text {
      color: rgba(22, 101, 52, 1);
    }
    
    [data-theme="light"] .play-item.positive-play .play-type {
      color: rgba(21, 128, 61, 1);
    }

    /* Light mode quarter tabs */
    [data-theme="light"] #playsQuarterTabs .nav-link {
      color: var(--text-secondary);
      background: var(--bg-tertiary);
      border: 1px solid var(--border-color);
    }

    [data-theme="light"] #playsQuarterTabs .nav-link:hover {
      color: var(--text-primary);
      background: var(--bg-primary);
    }

    [data-theme="light"] #playsQuarterTabs .nav-link.active {
      color: #ffffff;
      background: rgba(99, 102, 241, 0.8);
      border-color: rgba(99, 102, 241, 0.9);
    }

    /* Play-By-Play Button Styling */
    #play-by-play-btn {
      font-weight: 600;
      padding: 0.375rem 0.75rem;
      font-size: 0.875rem;
    }

    [data-theme="light"] #play-by-play-btn {
      background: rgba(234, 179, 8, 1);
      border-color: rgba(234, 179, 8, 1);
      color: #000000;
      font-weight: 700;
    }

    [data-theme="light"] #play-by-play-btn:hover {
      background: rgba(202, 138, 4, 1);
      border-color: rgba(202, 138, 4, 1);
    }

    [data-theme="light"] #play-by-play-btn:active {
      background: rgba(161, 98, 7, 1) !important;
      border-color: rgba(161, 98, 7, 1) !important;
    }

    /* Light mode rank badges */
    [data-theme="light"] .rank-badge {
      color: var(--text-muted);
    }

    [data-theme="light"] .rank-badge.rank-4,
    [data-theme="light"] .rank-badge.rank-5,
    [data-theme="light"] .rank-badge.rank-6,
    [data-theme="light"] .rank-badge.rank-7,
    [data-theme="light"] .rank-badge.rank-8,
    [data-theme="light"] .rank-badge.rank-9,
    [data-theme="light"] .rank-badge.rank-10 {
      color: var(--text-muted);
    }

    /* Button theming */
    .btn-outline-light {
      border-color: var(--border-color) !important;
      color: var(--text-secondary) !important;
    }

    .btn-outline-light:hover {
      background-color: var(--bg-tertiary) !important;
      border-color: var(--text-muted) !important;
    }

    /* Page header text stays white in light mode (dark background gradient) */
    [data-theme="light"] .container-fluid > .d-flex.align-items-center.justify-content-between > h1,
    [data-theme="light"] .container-fluid > .d-flex.align-items-center.justify-content-between > h1 *,
    [data-theme="light"] .container-fluid > .d-flex.align-items-center.justify-content-between > .muted,
    [data-theme="light"] .container-fluid > .d-flex.align-items-center.justify-content-between > .muted *,
    [data-theme="light"] .container-fluid > .d-flex.align-items-center.justify-content-between .form-check-label {
      color: rgba(255, 255, 255, 0.9) !important;
    }

    /* Games section light theme styling */
    [data-theme="light"] .games-nav-btn {
      color: var(--text-primary);
    }

    [data-theme="light"] .game-card {
      background: linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.01));
      border: 1px solid var(--border-color);
    }

    [data-theme="light"] .game-card:hover {
      background: linear-gradient(180deg, rgba(0,0,0,0.06), rgba(0,0,0,0.04));
      border-color: var(--accent-color);
      box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }

    [data-theme="light"] .team-logo {
      background: var(--bg-primary);
      color: var(--text-primary);
      border: 1px solid var(--border-color);
      box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    }

    [data-theme="light"] .score-main {
      color: var(--text-primary);
    }

    [data-theme="light"] .status-live {
      background: linear-gradient(90deg,#22c55e,#16a34a);
      color: #ffffff;
    }

    [data-theme="light"] .status-fin {
      background: var(--bg-tertiary);
      color: var(--text-secondary);
    }

    [data-theme="light"] .lineup-row {
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
    }

    [data-theme="light"] .lineup-header {
      color: var(--text-primary);
      border-bottom: 1px solid var(--border-color);
    }

    [data-theme="light"] .lineup-section-title {
      color: var(--text-primary);
    }

    [data-theme="light"] .lineup-player-card {
      background: var(--bg-tertiary);
      border: 1px solid var(--border-color);
    }

    [data-theme="light"] .lineup-player-card:hover {
      background: var(--bg-primary);
      border-color: var(--accent-color);
    }

    [data-theme="light"] .lineup-player-name {
      color: var(--text-primary);
    }

    [data-theme="light"] .lineup-player-pos {
      color: var(--text-muted);
    }

    [data-theme="light"] .lineup-player-stats {
      color: var(--text-secondary);
    }

    [data-theme="light"] .lineup-player-stats .stat-label {
      color: var(--text-muted);
    }

    [data-theme="light"] .lineup-player-stats .stat-value {
      color: var(--text-primary);
    }

    [data-theme="light"] .injury-list .injury-item {
      background: var(--bg-tertiary);
      border: 1px solid var(--border-color);
    }

    [data-theme="light"] .injury-item:hover {
      background: var(--bg-primary);
      border-color: var(--accent-color);
    }

    [data-theme="light"] .injury-name {
      color: var(--text-primary);
    }

    [data-theme="light"] .injury-note {
      color: var(--text-muted);
    }

    [data-theme="light"] .injury-probable {
      background: rgba(34, 197, 94, 0.15);
      color: rgba(22, 101, 52, 1);
      border-color: rgba(34, 197, 94, 0.3);
    }

    /* Display box (leaderboard filter) light theme styling */
    [data-theme="light"] #leaderboardFilterControl {
      background-color: var(--bg-secondary);
      border: 1px solid var(--border-color);
    }

    [data-theme="light"] #leaderboardFilterControl label {
      color: var(--text-primary);
      font-weight: 600;
    }

    [data-theme="light"] #limitSelector {
      background: linear-gradient(135deg, rgba(99,102,241,0.15) 0%, rgba(14,165,233,0.10) 100%) !important;
      border: 1px solid rgba(99,102,241,0.3) !important;
      color: var(--text-primary) !important;
    }

    [data-theme="light"] #limitSelector:hover {
      background: linear-gradient(135deg, rgba(99,102,241,0.25) 0%, rgba(14,165,233,0.18) 100%) !important;
      border-color: rgba(99,102,241,0.5) !important;
    }

    [data-theme="light"] #limitSelector:focus {
      background: linear-gradient(135deg, rgba(99,102,241,0.25) 0%, rgba(14,165,233,0.18) 100%) !important;
      border-color: rgba(99,102,241,0.6) !important;
      box-shadow: 0 0 0 3px rgba(99,102,241,0.1) !important;
    }

    [data-theme="light"] #limitSelector option {
      background: var(--bg-primary);
      color: var(--text-primary);
    }
    
    /* Player profile modal styles */
    .player-profile-section-title {
      font-size: 1.4rem;
      font-weight: 600;
    }
    
    .season-selector {
      width: auto;
      background-color: rgba(255,255,255,.1);
      color: rgba(255,255,255,.9);
      border-color: rgba(255,255,255,.2);
    }
    
    [data-theme="light"] .season-selector {
      background-color: rgba(0,0,0,.05);
      color: var(--text-primary);
      border-color: var(--border-color);
    }
    
    [data-theme="light"] .season-selector option {
      background: var(--bg-primary);
      color: var(--text-primary);
    }
    
    .game-log-container {
      max-height: 320px;
      overflow-y: auto;
      border: 1px solid rgba(255,255,255,.08);
      border-radius: 4px;
    }
    
    [data-theme="light"] .game-log-container {
      border-color: var(--border-color);
    }
    
    #gameLogTable {
      background: rgba(0,0,0,0.3);
      border: none;
      margin-bottom: 0;
    }
    
    [data-theme="light"] #gameLogTable {
      background: var(--bg-secondary);
    }
    
    #gameLogTable tr {
      border: none !important;
    }
    
    #gameLogTable td {
      border: none !important;
      padding: 0.5rem !important;
    }
    
    #gameLogTable tbody tr.game-log-row-even td {
      background-color: rgba(0,0,0,0.4) !important;
    }
    
    #gameLogTable tbody tr.game-log-row-odd td {
      background-color: rgba(255,255,255,0.08) !important;
    }
    
    #gameLogTable tbody tr.game-log-row-even:hover td {
      background-color: rgba(0,0,0,1) !important;
    }
    
    #gameLogTable tbody tr.game-log-row-odd:hover td {
      background-color: rgba(0,0,0,1) !important;
    }
    
    [data-theme="light"] #gameLogTable tbody tr.game-log-row-even td {
      background-color: rgba(0,0,0,0.03) !important;
    }
    
    [data-theme="light"] #gameLogTable tbody tr.game-log-row-odd td {
      background-color: rgba(0,0,0,0.06) !important;
    }
    
    [data-theme="light"] #gameLogTable tbody tr.game-log-row-even:hover td {
      background-color: rgba(99,102,241,0.15) !important;
    }
    
    [data-theme="light"] #gameLogTable tbody tr.game-log-row-odd:hover td {
      background-color: rgba(99,102,241,0.15) !important;
    }

    /* Advanced Stats Table - Same styling as Game Log */
    #advancedStatsTable {
      background: rgba(0,0,0,0.3);
      border: none;
      margin-bottom: 0;
    }
    
    [data-theme="light"] #advancedStatsTable {
      background: var(--bg-secondary);
    }
    
    #advancedStatsTable tr {
      border: none !important;
    }
    
    #advancedStatsTable td {
      border: none !important;
      padding: 0.5rem !important;
    }
    
    #advancedStatsTable tbody tr.advanced-stats-row-even td {
      background-color: rgba(0,0,0,0.4) !important;
    }
    
    #advancedStatsTable tbody tr.advanced-stats-row-odd td {
      background-color: rgba(255,255,255,0.08) !important;
    }
    
    #advancedStatsTable tbody tr.advanced-stats-row-even:hover td {
      background-color: rgba(0,0,0,1) !important;
    }
    
    #advancedStatsTable tbody tr.advanced-stats-row-odd:hover td {
      background-color: rgba(0,0,0,1) !important;
    }
    
    [data-theme="light"] #advancedStatsTable tbody tr.advanced-stats-row-even td {
      background-color: rgba(0,0,0,0.03) !important;
    }
    
    [data-theme="light"] #advancedStatsTable tbody tr.advanced-stats-row-odd td {
      background-color: rgba(0,0,0,0.06) !important;
    }
    
    [data-theme="light"] #advancedStatsTable tbody tr.advanced-stats-row-even:hover td {
      background-color: rgba(99,102,241,0.15) !important;
    }
    
    [data-theme="light"] #advancedStatsTable tbody tr.advanced-stats-row-odd:hover td {
      background-color: rgba(99,102,241,0.15) !important;
    }

    #advancedStatsTable thead {
      position: sticky;
      top: 0;
      background: rgba(0,0,0,0.8);
      z-index: 10;
      box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }
    
    [data-theme="light"] #advancedStatsTable thead {
      background: rgba(255,255,255,0.95);
    }

    #advancedStatsTable thead tr {
      font-size: 0.8rem;
    }

    #advancedStatsTable th.text-center {
      text-align: center;
    }

    #advancedStatsTable th {
      font-weight: 700;
      padding: 0.6rem 0.5rem !important;
      border-bottom: 2px solid rgba(255,255,255,0.2) !important;
      color: rgba(255,255,255,0.95);
      text-transform: uppercase;
      font-size: 0.7rem;
      letter-spacing: 0.5px;
    }

    [data-theme="light"] #advancedStatsTable th {
      font-weight: 700;
      border-bottom: 2px solid var(--border-color) !important;
      color: rgba(0,0,0,0.85);
    }

    #gameLogTable thead {
      position: sticky;
      top: 0;
      background: rgba(0,0,0,0.8);
      z-index: 10;
      box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }

    [data-theme="light"] #gameLogTable thead {
      background: rgba(240,240,240,1);
      border-bottom: 2px solid var(--border-color);
      box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    #gameLogTable thead tr {
      font-size: 0.8rem;
    }

    #gameLogTable th.text-center {
      text-align: center;
    }

    #gameLogTable th {
      font-weight: 700;
      padding: 0.6rem 0.5rem !important;
      border-bottom: 2px solid rgba(255,255,255,0.2) !important;
      color: rgba(255,255,255,0.95);
      text-transform: uppercase;
      font-size: 0.7rem;
      letter-spacing: 0.5px;
    }

    [data-theme="light"] #gameLogTable th {
      font-weight: 700;
      border-bottom: 2px solid var(--border-color) !important;
      color: rgba(0,0,0,0.85);
    }

    /* Injuries Section */
    .injuries-section {
      margin-top: 1rem;
    }

    .injuries-container {
      background: rgba(255,255,255,0.02);
      border: 1px solid rgba(255,255,255,0.15);
      border-radius: 4px;
      padding: 0.75rem;
      min-height: 60px;
    }

    [data-theme="light"] .injuries-container {
      background: rgba(0,0,0,0.02);
      border: 1px solid var(--border-color);
      color: var(--text-color);
    }

    .injury-status-text {
      color: rgba(255,255,255,0.9);
    }

    .injury-description-text {
      color: rgba(255,255,255,0.65);
    }

    .injury-return-text {
      color: rgba(255,255,255,0.55);
    }

    [data-theme="light"] .injury-status-text {
      color: rgba(0,0,0,0.9);
    }

    [data-theme="light"] .injury-description-text {
      color: rgba(0,0,0,0.65);
    }

    [data-theme="light"] .injury-return-text {
      color: rgba(0,0,0,0.55);
    }

    .contracts-section {
      margin-top: 1rem;
    }

    .contracts-container {
      background: rgba(255,255,255,0.02);
      border: 1px solid rgba(255,255,255,0.15);
      border-radius: 4px;
      padding: 0.75rem;
      min-height: 60px;
    }

    [data-theme="light"] .contracts-container {
      background: rgba(0,0,0,0.02);
      border: 1px solid var(--border-color);
    }

    .contracts-table-wrapper {
      overflow-x: auto;
    }

    .contracts-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.875rem;
    }

    .contracts-table thead th {
      text-transform: uppercase;
      font-size: 0.7rem;
      font-weight: 700;
      letter-spacing: 0.5px;
      color: rgba(255,255,255,0.5);
      padding: 0.5rem 0.75rem;
      text-align: left;
      border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    [data-theme="light"] .contracts-table thead th {
      color: rgba(0,0,0,0.6);
      border-bottom: 1px solid rgba(0,0,0,0.1);
    }

    .contracts-table tbody td {
      padding: 0.5rem 0.75rem;
      color: rgba(255,255,255,0.9);
      border-bottom: 1px solid rgba(255,255,255,0.05);
    }

    [data-theme="light"] .contracts-table tbody td {
      color: rgba(0,0,0,0.9);
      border-bottom: 1px solid rgba(0,0,0,0.05);
    }

    .contracts-table tbody tr:hover {
      background: rgba(99,102,241,0.1);
    }

    [data-theme="light"] .contracts-table tbody tr:hover {
      background: rgba(99,102,241,0.08);
    }

    /* Leaderboard filter control styling */
    #leaderboardFilterControl {
      background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.02) 100%);
      border: 1px solid rgba(255,255,255,0.08);
      border-radius: 8px;
      padding: 1rem;
      margin-bottom: 1.5rem;
    }

    #leaderboardFilterControl label {
      color: rgba(255,255,255,0.7);
      font-size: 0.8125rem;
      font-weight: 500;
      letter-spacing: 0.05em;
      text-transform: uppercase;
      margin: 0;
    }

    #limitSelector {
      background: linear-gradient(135deg, rgba(99,102,241,0.15) 0%, rgba(14,165,233,0.10) 100%) !important;
      border: 1px solid rgba(99,102,241,0.3) !important;
      color: rgba(255,255,255,0.95) !important;
      font-weight: 500;
      padding: 0.5rem 2.25rem 0.5rem 0.75rem !important;
      border-radius: 6px;
      font-size: 0.875rem;
      transition: all 0.2s ease;
    }

    #limitSelector:hover {
      background: linear-gradient(135deg, rgba(99,102,241,0.25) 0%, rgba(14,165,233,0.18) 100%) !important;
      border-color: rgba(99,102,241,0.5) !important;
    }

    #limitSelector:focus {
      background: linear-gradient(135deg, rgba(99,102,241,0.25) 0%, rgba(14,165,233,0.18) 100%) !important;
      border-color: rgba(99,102,241,0.6) !important;
      box-shadow: 0 0 0 3px rgba(99,102,241,0.1) !important;
    }

    #limitSelector option {
      background: #0f1a2d;
      color: rgba(255,255,255,0.95);
    }

    .blowoutalert-logo {
    height: 60px;     
    width: auto;
    display: inline-block;
    }

    .insightdfs-logo {
    height: 110px;     
    width: auto;
    display: inline-block;
    margin-left: 50px;
    }

  /* Responsive logo scaling for mobile */
  @media (max-width: 600px) {
    .blowoutalert-logo,
    .insightdfs-logo {
      max-width: 80vw;
      width: 100%;
      height: auto;
      display: block;
      margin-left: auto;
      margin-right: auto;
    }
    .insightdfs-logo {
      margin-left: 0;
    }
  }

    .app-title {
      flex-grow: 1;
      font-size: 2.5rem;     
      font-weight: 700;      
      letter-spacing: 0.02em;
      font-family: 'Roboto', Arial, sans-serif; 
      text-shadow: 0 2px 8px rgba(0,0,0,0.18); 
    }
  /* Games strip styles */
  .games-strip {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap; /* allow cards to wrap onto multiple rows instead of scrolling */
    align-items: center;
    align-content: flex-start; /* ensure wrapped rows start at top */
    gap: 0.32rem; /* reduced spacing between cards */
    justify-content: center; /* center cards horizontally instead of left-align */
    overflow-x: visible; /* avoid horizontal scrollbar */
    padding: 0.30rem 0.18rem;
    margin: 0;
    list-style: none; /* avoid default list styles */
    flex: 1 1 auto;
    min-width: 0;
  }

  .games-strip-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }
  .games-nav-btn {
    border: none;
    background: transparent;
    color: #ffffff;
    padding: 0.35rem 0.5rem;
    opacity: 0.65;
    user-select: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
  }
  .games-nav-btn:hover:not(:disabled) {
    opacity: 1;
  }
  .games-nav-btn:disabled {
    opacity: 0.2;
    cursor: default;
  }
  .games-nav-btn svg {
    width: 32px;
    height: 32px;
    stroke: currentColor;
    stroke-width: 3;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .game-card {
    /* Slightly larger tiles (~5%) so scores don't wrap/collapse */
    min-width: 150px;
    max-width: 175px;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 8px;
  padding: 0.34rem;
   box-sizing: border-box;
   overflow: hidden;

   /* Use a 3-column grid: team / center / team so spacing is consistent
     and the center (time/score) stays compact in the middle. */
   display: grid;
   grid-template-columns: auto 1fr auto;
   align-items: center;
   gap: 0.32rem;
   /* equal horizontal padding so left team sits the same distance from left border
     as the right team does from the right border */
   cursor: pointer;
   transition: all 0.2s ease;
  }
  
  .game-card:hover {
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.04));
    border-color: rgba(99,102,241,0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  }
  
  .game-card.selected {
    background: linear-gradient(180deg, rgba(99,102,241,0.15), rgba(99,102,241,0.1));
    border-color: rgba(99,102,241,0.6);
    box-shadow: 0 0 0 2px rgba(99,102,241,0.3);
  }
  
  .game-card.selected:hover {
    background: linear-gradient(180deg, rgba(99,102,241,0.18), rgba(99,102,241,0.12));
    border-color: rgba(99,102,241,0.7);
  }
  padding-left: 0.60rem;
  padding-right: 0.60rem;
  }
  /* Make each list item act as a compact horizontal tile and allow wrapping */
  .games-strip > li {
    flex: 0 0 auto;
    width: auto;
    background: transparent;
    border: none;
    padding: 0;
  }
  /* Neutralize list-group-item borders which cause the tall separators */
  .games-strip .list-group-item {
    border: none !important;
    background: transparent !important;
  }
  .team-block { display:flex; flex-direction:column; align-items:center; gap:0.16rem; min-width:44px; max-width:72px }
  .team-block.text-end { align-items:flex-end; text-align:right; justify-self:end; padding-right:0.45rem }
  .team-block.text-start { align-items:flex-start; text-align:left; justify-self:start; padding-left:0.45rem }
  .team-block .muted.small { max-width:72px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:0.58rem }
  /* White circular background behind team logos; dark abbrev text for contrast when image missing */
  .team-logo { width:34px; height:34px; border-radius:50%; background:#ffffff; display:inline-flex; align-items:center; justify-content:center; font-weight:700; color:#0b1220; position:relative; border: 1px solid rgba(11,18,32,0.06); box-shadow: 0 1px 2px rgba(0,0,0,0.06); cursor: pointer; transition: transform 0.2s ease; }
  .team-logo:hover { transform: scale(1.08); }
  .team-logo img { width:100%; height:100%; object-fit:cover; border-radius:50% }
  .team-logo img { display:block }
  .team-abbr { font-size:0.7rem; letter-spacing:0.02em }
  /* center column should be compact and centered */
  .score-block { text-align:center; min-width:52px; justify-self:center }
  .score-main { font-weight:800; font-size:0.80rem; color: #ffffff; white-space: nowrap; }
  .status-badge { display:inline-block; padding:0.11rem 0.32rem; border-radius:999px; font-size:0.56rem; font-weight:700 }
  .status-live { background: linear-gradient(90deg,#22c55e,#16a34a); color:#06270b }
  .status-fin { background: rgba(255,255,255,0.03); color:rgba(255,255,255,0.85) }
  .muted.small { font-size:0.72rem }

  /* Lineup row styles */
  .lineup-row {
    display: none;
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
    animation: slideDown 0.3s ease-out;
  }
  .lineup-row.show {
    display: block;
  }
  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  .lineup-header {
    font-weight: 600;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .lineup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
  }
  .lineup-player {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
  }
  .lineup-player-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 6px;
    padding: 0.5rem 0.6rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .lineup-player-card:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(99,102,241,0.3);
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    z-index: 10;
  }
  
  .lineup-player-card.clickable {
    background: rgba(255,255,255,0.03);
  }
  
  .lineup-player-card.clickable:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(99,102,241,0.4);
    transform: translateY(-2px) scale(1.03);
  }
  .lineup-player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
  }
  .lineup-player-name {
    font-weight: 600;
    color: rgba(255,255,255,0.95);
    flex: 1;
    min-width: 0; /* Allow text to shrink */
  }

  /* Analytics icon button */
  .analytics-icon {
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .analytics-icon:hover {
    opacity: 1;
    transform: scale(1.1);
  }

  .analytics-icon svg {
    stroke: rgba(99, 102, 241, 0.9);
  }

  [data-theme="light"] .analytics-icon svg {
    stroke: rgba(99, 102, 241, 1);
  }

  /* Matchup Profile */
  .matchup-profile {
    margin-top: 1rem;
    animation: slideDown 0.3s ease;
  }

  @keyframes slideDown {
    from {
      opacity: 0;
      max-height: 0;
    }
    to {
      opacity: 1;
      max-height: 1000px;
    }
  }

  .matchup-breakdown {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 1rem;
    font-size: 0.85rem;
  }

  [data-theme="light"] .matchup-breakdown {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.1);
  }

  .matchup-breakdown > h6,
  .matchup-breakdown h6 {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #ffffff !important;
    margin: 0 0 0.75rem 0;
    text-transform: uppercase;
  }

  [data-theme="light"] .matchup-breakdown > h6,
  [data-theme="light"] .matchup-breakdown h6 {
    color: rgba(0, 0, 0, 0.85) !important;
  }

  .matchup-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
  }

  [data-theme="light"] .matchup-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
  }

  .matchup-header h6 {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.5);
    margin: 0 0 0.25rem 0;
    text-transform: uppercase;
  }

  [data-theme="light"] .matchup-header h6 {
    color: rgba(0, 0, 0, 0.6);
  }

  .matchup-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
  }

  [data-theme="light"] .matchup-title {
    color: rgba(0, 0, 0, 0.9);
  }

  .matchup-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0.75rem;
  }

  @media (max-width: 768px) {
    .matchup-stats-grid {
      grid-template-columns: 1fr;
    }
  }

  .matchup-column {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
  }

  .matchup-column-title {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.5);
    margin: 0 0 0.25rem 0;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.25rem;
  }

  [data-theme="light"] .matchup-column-title {
    color: rgba(0, 0, 0, 0.6);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  }

  .matchup-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
  }

  .matchup-stat-row.projection-summary {
    background: rgba(99, 102, 241, 0.08);
    border-left: 3px solid rgba(99, 102, 241, 0.5);
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    border-radius: 4px;
  }

  [data-theme="light"] .matchup-stat-row.projection-summary {
    background: rgba(99, 102, 241, 0.06);
    border-left-color: rgba(99, 102, 241, 0.6);
  }

  .matchup-stat-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
  }

  [data-theme="light"] .matchup-stat-label {
    color: rgba(0, 0, 0, 0.7);
  }

  .matchup-stat-value {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
    font-size: 0.8rem;
  }

  [data-theme="light"] .matchup-stat-value {
    color: rgba(0, 0, 0, 0.9);
  }

  .stat-diff {
    font-size: 0.7rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    margin-left: 0.25rem;
  }

  [data-theme="light"] .stat-diff {
    color: rgba(0, 0, 0, 0.55);
  }

  .stat-diff-positive {
    color: #4ade80 !important;
  }

  .stat-diff-negative {
    color: #f87171 !important;
  }

  .stat-diff-neutral {
    color: rgba(255, 255, 255, 0.6) !important;
  }

  [data-theme="light"] .stat-diff-positive {
    color: #16a34a !important;
  }

  [data-theme="light"] .stat-diff-negative {
    color: #dc2626 !important;
  }

  [data-theme="light"] .stat-diff-neutral {
    color: rgba(0, 0, 0, 0.55) !important;
  }

  /* Sparkline styling */
  .sparkline {
    font-family: monospace;
    font-size: 0.85rem;
    letter-spacing: -0.05em;
    color: rgba(99, 102, 241, 0.8);
    margin: 0 0.4rem;
    display: inline-block;
    white-space: nowrap;
  }

  [data-theme="light"] .sparkline {
    color: rgba(99, 102, 241, 1);
  }

  .matchup-factors {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 0.75rem;
    margin-top: 0.75rem;
  }

  [data-theme="light"] .matchup-factors {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
  }

  .matchup-factor {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
  }

  [data-theme="light"] .matchup-factor {
    color: rgba(0, 0, 0, 0.85);
  }

  .matchup-factor-icon {
    font-weight: bold;
    font-size: 1rem;
    min-width: 1.2rem;
    text-align: center;
  }

  .matchup-factor-positive .matchup-factor-icon {
    color: #22c55e;
  }

  .matchup-factor-negative .matchup-factor-icon {
    color: #ef4444;
  }

  .matchup-factor-neutral .matchup-factor-icon {
    color: #f59e0b;
  }

  /* Archetype Badge Styles */
  .archetype-badge-container {
    margin-bottom: 1rem;
  }

  .archetype-badge {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(147, 51, 234, 0.15) 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  [data-theme="light"] .archetype-badge {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(147, 51, 234, 0.08) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
  }

  .archetype-icon {
    font-size: 1.5rem;
    line-height: 1;
    opacity: 0.9;
  }

  .archetype-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
  }

  .archetype-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 0.3px;
  }

  [data-theme="light"] .archetype-label {
    color: rgba(0, 0, 0, 0.9);
  }

  .archetype-description {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.3;
  }

  [data-theme="light"] .archetype-description {
    color: rgba(0, 0, 0, 0.65);
  }

  /* Shot Profile & Play Style Section */
  .shot-profile-container {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.85rem;
  }

  [data-theme="light"] .shot-profile-container {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.08);
  }

  .shot-profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }

  @media (max-width: 600px) {
    .shot-profile-grid {
      grid-template-columns: 1fr;
      gap: 1rem;
    }
  }

  .shot-profile-section {
    min-width: 0;
  }

  .shot-profile-title {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
  }

  [data-theme="light"] .shot-profile-title {
    color: rgba(0, 0, 0, 0.5);
  }

  /* Shot Zone Bars */
  .shot-zone-bars {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
  }

  .shot-zone-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
  }

  .shot-zone-label {
    width: 55px;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
  }

  [data-theme="light"] .shot-zone-label {
    color: rgba(0, 0, 0, 0.7);
  }

  .shot-zone-bar-container {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
  }

  [data-theme="light"] .shot-zone-bar-container {
    background: rgba(0, 0, 0, 0.08);
  }

  .shot-zone-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
  }

  .shot-zone-rim {
    background: linear-gradient(90deg, #ef4444, #f87171);
  }

  .shot-zone-mid {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
  }

  .shot-zone-three {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
  }

  .shot-zone-value {
    width: 32px;
    text-align: right;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
  }

  [data-theme="light"] .shot-zone-value {
    color: rgba(0, 0, 0, 0.85);
  }

  .shot-zone-efficiency {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.5);
    margin-left: 0.25rem;
  }

  [data-theme="light"] .shot-zone-efficiency {
    color: rgba(0, 0, 0, 0.5);
  }

  /* Shot Creation Split */
  .shot-creation-split {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    padding-top: 0.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.65rem;
  }

  [data-theme="light"] .shot-creation-split {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
  }

  .shot-creation-item {
    color: rgba(255, 255, 255, 0.8);
  }

  [data-theme="light"] .shot-creation-item {
    color: rgba(0, 0, 0, 0.75);
  }

  .shot-creation-label {
    color: rgba(255, 255, 255, 0.5);
    margin-right: 0.25rem;
  }

  [data-theme="light"] .shot-creation-label {
    color: rgba(0, 0, 0, 0.5);
  }

  /* Play Style Stats */
  .playstyle-stats {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
  }

  .playstyle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    padding: 0.2rem 0;
  }

  .playstyle-label {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
  }

  [data-theme="light"] .playstyle-label {
    color: rgba(0, 0, 0, 0.7);
  }

  .playstyle-value {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
  }

  [data-theme="light"] .playstyle-value {
    color: rgba(0, 0, 0, 0.85);
  }

  .playstyle-unit {
    font-weight: 400;
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.5);
    margin-left: 0.2rem;
  }

  [data-theme="light"] .playstyle-unit {
    color: rgba(0, 0, 0, 0.5);
  }

  /* Matchup Insights Styles */
  .matchup-insights {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 0.75rem;
    margin-top: 0.75rem;
  }

  [data-theme="light"] .matchup-insights {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
  }

  .matchup-insights-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
  }

  .matchup-advantage-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
  }

  @media (max-width: 768px) {
    .matchup-advantage-grid {
      grid-template-columns: 1fr;
    }
  }

  .matchup-summary {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1rem;
  }

  [data-theme="light"] .matchup-summary {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.08);
  }

  .matchup-summary-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  [data-theme="light"] .matchup-summary-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  }

  .matchup-summary-icon {
    font-size: 0.9rem;
  }

  .matchup-summary-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.9);
  }

  [data-theme="light"] .matchup-summary-title {
    color: rgba(0, 0, 0, 0.8);
  }

  .matchup-summary-table {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
  }

  .matchup-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
  }

  .matchup-summary-row:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
  }

  [data-theme="light"] .matchup-summary-row:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
  }

  .matchup-summary-header-row {
    background: rgba(255, 255, 255, 0.05) !important;
    font-weight: 600;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.6);
  }

  [data-theme="light"] .matchup-summary-header-row {
    background: rgba(0, 0, 0, 0.05) !important;
    color: rgba(0, 0, 0, 0.5);
  }

  .matchup-summary-factor {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
  }

  [data-theme="light"] .matchup-summary-factor {
    color: rgba(0, 0, 0, 0.7);
  }

  .matchup-summary-impact {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
  }

  .matchup-impact-positive {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
  }

  .matchup-impact-neutral {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
  }

  .matchup-impact-negative {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
  }

  [data-theme="light"] .matchup-impact-positive {
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
  }

  [data-theme="light"] .matchup-impact-neutral {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
  }

  [data-theme="light"] .matchup-impact-negative {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
  }

  .matchup-verdict {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .matchup-verdict-very-positive {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.4);
  }

  .matchup-verdict-positive {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
  }

  .matchup-verdict-neutral {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
  }

  .matchup-verdict-negative {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
  }

  .matchup-verdict-very-negative {
    background: rgba(220, 38, 38, 0.2);
    color: #ef4444;
    border: 1px solid rgba(220, 38, 38, 0.4);
  }

  .matchup-insights-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
  }

  @media (max-width: 768px) {
    .matchup-insights-grid {
      grid-template-columns: 1fr;
    }
  }

  .matchup-insight-section {
    margin-bottom: 0;
  }

  .matchup-insight-section:last-child {
    margin-bottom: 0;
  }

  .matchup-insight-category {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .matchup-insight-icon {
    font-weight: bold;
    font-size: 0.9rem;
    min-width: 1rem;
    text-align: center;
  }

  .matchup-insight-positive {
    color: #22c55e;
  }

  .matchup-insight-negative {
    color: #ef4444;
  }

  .matchup-insight-neutral {
    color: #f59e0b;
  }

  .matchup-insight-title {
    opacity: 0.9;
  }

  .matchup-insight-item {
    padding: 0.4rem 0.75rem;
    margin-bottom: 0.35rem;
    border-radius: 4px;
    font-size: 0.75rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.85);
  }

  [data-theme="light"] .matchup-insight-item {
    color: rgba(0, 0, 0, 0.85);
  }

  .matchup-insight-item-positive {
    background: rgba(34, 197, 94, 0.08);
    border-left: 2px solid rgba(34, 197, 94, 0.4);
  }

  [data-theme="light"] .matchup-insight-item-positive {
    background: rgba(34, 197, 94, 0.05);
  }

  .matchup-insight-item-negative {
    background: rgba(239, 68, 68, 0.08);
    border-left: 2px solid rgba(239, 68, 68, 0.4);
  }

  [data-theme="light"] .matchup-insight-item-negative {
    background: rgba(239, 68, 68, 0.05);
  }

  .matchup-insight-item-neutral {
    background: rgba(245, 158, 11, 0.08);
    border-left: 2px solid rgba(245, 158, 11, 0.4);
  }

  [data-theme="light"] .matchup-insight-item-neutral {
    background: rgba(245, 158, 11, 0.05);
  }

  .lineup-player-right {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-shrink: 0;
  }
  .lineup-player-pos {
    color: rgba(255,255,255,0.6);
    font-size: 0.65rem;
    flex-shrink: 0;
  }
  .injury-probable {
    background: rgba(34, 197, 94, 0.2);
    color: rgba(34, 197, 94, 1);
    font-size: 0.55rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    border: 1px solid rgba(34, 197, 94, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    flex-shrink: 0;
  }
  .lineup-player-stats {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.75);
    line-height: 1.4;
  }
  .lineup-player-stats .stat-line {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
  }
  .lineup-player-stats .stat-label {
    color: rgba(255,255,255,0.6);
    flex-shrink: 0;
  }
  .lineup-player-stats .stat-value {
    color: rgba(255,255,255,0.9);
    font-weight: 500;
    text-align: right;
  }

  .lineup-section-title {
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.85);
  }

  /* Smooth lineup section animation */
  #lineup-compare-row {
    transition: all 0.5s ease-in-out;
    transform-origin: top;
  }

  #lineup-compare-row.lineup-expanding {
    animation: expandLineup 0.5s ease-in-out forwards;
  }

  #lineup-compare-row.lineup-collapsing {
    animation: collapseLineup 0.5s ease-in-out forwards;
  }

  @keyframes expandLineup {
    0% {
      opacity: 0;
      transform: scaleY(0) translateY(-20px);
      max-height: 0;
    }
    50% {
      opacity: 0.5;
      transform: scaleY(0.5) translateY(-10px);
    }
    100% {
      opacity: 1;
      transform: scaleY(1) translateY(0);
      max-height: 5000px;
    }
  }

  @keyframes collapseLineup {
    0% {
      opacity: 1;
      transform: scaleY(1) translateY(0);
      max-height: 5000px;
    }
    50% {
      opacity: 0.5;
      transform: scaleY(0.5) translateY(-10px);
    }
    100% {
      opacity: 0;
      transform: scaleY(0) translateY(-20px);
      max-height: 0;
    }
  }

  .injury-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.5rem;
  }

  .injury-item {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 6px;
    padding: 0.45rem 0.6rem;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.6rem;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  
  .injury-item:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(99,102,241,0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  }
  
  .injury-item.clickable {
    background: rgba(255,255,255,0.03);
  }
  
  .injury-item.clickable:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(99,102,241,0.4);
  }

  .injury-name {
    font-weight: 600;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.95);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .injury-note {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.6);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .injury-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.12rem 0.35rem;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1;
    border: 1px solid rgba(255,255,255,0.08);
    white-space: nowrap;
  }
  .injury-status.out { background: rgba(239,68,68,0.20); color: rgba(255,255,255,0.92); border-color: rgba(239,68,68,0.35); }
  .injury-status.doubtful { background: rgba(245,158,11,0.18); color: rgba(255,255,255,0.92); border-color: rgba(245,158,11,0.30); }
  .injury-status.dtd { background: rgba(59,130,246,0.18); color: rgba(255,255,255,0.92); border-color: rgba(59,130,246,0.30); }
  .injury-status.questionable { background: rgba(168,85,247,0.18); color: rgba(255,255,255,0.92); border-color: rgba(168,85,247,0.30); }

  .lineup-compare-close {
    --bs-btn-padding-y: 0.18rem;
    --bs-btn-padding-x: 0.55rem;
    --bs-btn-font-size: 0.75rem;
  }

/* ================================
   SCOREBOARD RANKS WITH RIBBONS
   ================================ */

/* ================================
   SCOREBOARD RANK BADGES (RIBBONS)
   ================================ */

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.875rem;
  line-height: 1;
  color: rgba(255,255,255,.70);
  position: relative;
}

/* default ranks 4+ look like your existing style */
.rank-badge.rank-4,
.rank-badge.rank-5,
.rank-badge.rank-6,
.rank-badge.rank-7,
.rank-badge.rank-8,
.rank-badge.rank-9,
.rank-badge.rank-10 {
  background: transparent;
  border: none;
  font-weight: 600;
  color: rgba(255,255,255,.65);
}

/* Shared ribbon look for top 3 */
.rank-badge.rank-1,
.rank-badge.rank-2,
.rank-badge.rank-3 {
  color: #0b1220;            /* dark text on bright ribbon */
  box-shadow: 0 6px 12px rgba(0,0,0,.25);
}

/* Ribbon "tails" */
.rank-badge.rank-1::after,
.rank-badge.rank-2::after,
.rank-badge.rank-3::after {
  content: "";
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 10px;
  clip-path: polygon(0 0, 50% 100%, 100% 0);
  opacity: 0.95;
}

/* ≡ƒÑç 1st */
.rank-badge.rank-1 {
  background: linear-gradient(180deg, #fde047 0%, #eab308 100%);
  font-size: 1.05rem;
  width: 30px;
  height: 30px;
}
.rank-badge.rank-1::after {
  background: linear-gradient(180deg, #facc15 0%, #d97706 100%);
}

/* ≡ƒÑê 2nd */
.rank-badge.rank-2 {
  background: linear-gradient(180deg, #f3f4f6 0%, #9ca3af 100%);
  font-size: 0.98rem;
  width: 29px;
  height: 29px;
}
.rank-badge.rank-2::after {
  background: linear-gradient(180deg, #e5e7eb 0%, #6b7280 100%);
}

/* ≡ƒÑë 3rd */
.rank-badge.rank-3 {
  background: linear-gradient(180deg, #f0b58c 0%, #b45309 100%);
  font-size: 0.92rem;
  width: 28px;
  height: 28px;
}
.rank-badge.rank-3::after {
  background: linear-gradient(180deg, #f0b58c 0%, #92400e 100%);
}

/* Modern close button for modals */
.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 1;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.modal-close-btn::before,
.modal-close-btn::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 2px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 1px;
}

.modal-close-btn::before {
  transform: rotate(45deg);
}

.modal-close-btn::after {
  transform: rotate(-45deg);
}

/* Variant for card headers - no absolute positioning */
.modal-close-btn.card-close {
  position: static;
  margin: 0;
}

/* Modern modal footer button */
.modal-footer-btn {
  padding: 0.5rem 1.5rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.modal-footer-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 1);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.modal-footer-btn:active {
  transform: translateY(0);
}

/* Play-by-Play Styles */
.plays-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.plays-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.play-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  padding: 0.5rem 0;
}

.play-left {
  display: flex;
  justify-content: flex-end;
}

.play-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 120px;
  padding: 0 1rem;
  border-left: 2px solid rgba(99, 102, 241, 0.3);
  border-right: 2px solid rgba(99, 102, 241, 0.3);
}

.play-right {
  display: flex;
  justify-content: flex-start;
}

.play-time {
  font-weight: 600;
  font-size: 0.9rem;
  color: rgba(99, 102, 241, 0.9);
}

.play-score {
  font-weight: 700;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

.quarter-section {
  border-left: 3px solid rgba(99, 102, 241, 0.5);
  padding-left: 1rem;
}

.quarter-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.play-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  line-height: 1.4;
  max-width: 400px;
}

.play-left .play-item {
  text-align: right;
}

.play-right .play-item {
  text-align: left;
}

.play-text {
  color: rgba(255, 255, 255, 0.75);
  word-break: break-word;
  clear: both;
  margin-top: 0.3rem;
}

.play-item.scoring {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.2);
}

.play-item.scoring .play-text {
  color: rgba(34, 197, 94, 0.9);
  font-weight: 500;
}

.play-item.defensive-play {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
}

.play-item.defensive-play .play-type {
  color: rgba(239, 68, 68, 0.95);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.play-item.defensive-play .play-text {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

/* Positive defensive plays (steals, blocks made by defender) */
.play-item.positive-play {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.2);
}

.play-item.positive-play .play-type {
  color: rgba(34, 197, 94, 0.95);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.play-item.positive-play .play-text {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

/* Quarter Tabs Styles */
#playsQuarterTabs {
  list-style: none;
  padding: 0;
  margin: 0;
}

#playsQuarterTabs .nav-link {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#playsQuarterTabs .nav-link:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.08);
}

#playsQuarterTabs .nav-link.active {
  color: rgba(255, 255, 255, 0.95);
  background: rgba(99, 102, 241, 0.3);
  border-color: rgba(99, 102, 241, 0.5);
}

  /* Full-screen loading overlay */
  .app-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 18, 32, 0.95);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
  }
  
  .app-loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
  
  .app-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: rgba(99, 102, 241, 0.8);
    border-radius: 50%;
    animation: app-loading-spin 1s linear infinite;
    margin-bottom: 1rem;
  }
  
  .app-loading-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.5px;
  }
  
  @keyframes app-loading-spin {
    to { transform: rotate(360deg); }
  }
  
  /* Disable interactions while loading */
  .app-loading .container-fluid,
  .app-loading .main-content {
    pointer-events: none;
    opacity: 0.3;
  }

