* {
  font-family: 'Rubik', sans-serif;
}

/* ======================
   BASE BODY STYLES
   ====================== */
body {
  background: whitesmoke;
  margin: 0;
  padding: 50px;
  padding-top: 100px;
}

/* ======================
   HEADER & NAVIGATION
   ====================== */
header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  width: 100%;
  margin: 0px;
}

header a {
  margin-left: 50px;
  color: darkgray;
  text-decoration: none;
}

header a:hover { 
  color: black; 
}

header h1 { 
  font-size: 45px; 
}

header p {
  position: absolute;
  top: 5px;
  right: 50px;
  font-size: 12px;
}

header p:hover { 
  color: black; 
}

header select {
  position: absolute;
  right: 50px;
  top: 50px;
  z-index: 10;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

header select:hover {
  border-color: #4a9eff;
  box-shadow: 0 3px 8px rgba(74, 158, 255, 0.15);
  background-color: #fafbfc;
}

header select:focus {
  outline: none;
  border-color: #4a9eff;
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
}


nav {
  position: absolute;
  width: 100%;
  margin: 0;
  text-align: center;
  z-index: 100;
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 12px;
}

nav a {
  color: darkgray;
  text-decoration: none;
  font-size: 18px;
  margin-left: 50px;
  margin-right: 50px;
}

nav a:hover { 
  color: black; 
}

/* ======================
   SEARCH CONTAINER
   Base styles + state transitions
   ====================== */
.search-container {
  display: flex;
  background: #f8f9fa;
  align-items: center;
  gap: 15px;
  z-index: 20;
  border: 3px solid rgb(232, 232, 232);
  border-radius: 10px;
}

.search-container h4 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.search-container select {
  min-height: 40px;
  text-align: center;
  border-radius: 10px;
  min-width: 200px;
}

/* Search Container Tab Styles */


.search-header {
  background-color: #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
  border-radius: 5px;
}

.search-tabs {
  display: flex;
  background: #e0e0e0;
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
}

.search-tab {
  flex: 1;
  padding: 16px 24px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 15px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.search-tab:hover {
  background: rgba(0, 0, 0, 0.02);
  color: #333;
}

.search-tab.active {
  color: #2563eb;
  background: white;
}

.search-tab-content {
  display: none;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

.search-tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-dropdowns {
  display: flex;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
}

.search-dropdowns select {
  width: 70%;
  padding: 12px 16px;
  font-size: 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Rubik', sans-serif;
}

.search-dropdowns select:hover {
  border-color: #2563eb;
}

.search-dropdowns select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-dropdowns select:disabled {
  background: #f5f5f5;
  color: #999;
  cursor: not-allowed;
  border-color: #e0e0e0;
}

/* Filter Toggle Group (lightswitch style) */
.filter-toggle-group {
  display: flex;
  background: #e0e0e0;
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
}

.filter-toggle {
  flex: 1;
  padding: 10px 20px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Rubik', sans-serif;
}

.filter-toggle:hover {
  color: #333;
}

.filter-toggle.active {
  background: white;
  color: #2563eb;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .search-tab {
    padding: 12px 16px;
    font-size: 14px;
  }
  
  .search-tab-content {
    padding: 16px;
  }
  
  .search-dropdowns select {
    font-size: 14px;
    padding: 10px 12px;
  }
}

/* PREGAME: hide sidebar search (we'll use the popup instead) */


body.pregame #asideColumn .search-container {
  display: none;
}

body.pregame #asideColumn {
  display: none;
}

/* Hide DNP section during pre-game */
body.pregame .dnp-section {
  display: none !important;
}



body.pregame .search-container h3 {
  color: #000;
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

body.pregame .search-container .search-dropdowns{
  display: flex;
  flex-direction: row;
  gap: 20px;
  flex-wrap: wrap;
}

body.pregame #asideColumn {
  display: block;       /* allow container to exist */
  visibility: visible;   /* hide contents by default */
  position: relative;
}

/* Popup search container styles */
.search-popup .search-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    flex-direction: column;
    padding: 20px;
    background: white;
    border: none;
    box-shadow: none;
}


/* IN-GAME STATE: Search container as compact sidebar */
body.in-game .search-container {
  grid-column-start: 2;
  transform: none;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.9);
  padding: 15px;
  gap: 10px;
  justify-content: center;
  justify-items: center;
  align-items: center;
  align-content: center;
  text-align: center;
}

body.in-game .search-container select {
  align-self: center;
  width: 90%;
  font-size: 14px;
  min-height: 35px;
  margin-bottom: 20px;
}

body.in-game #floatingSearchBtn {
  display: none !important;
}


/* Hide aside during loading */
body.in-game #asideColumn.loading {
  display: none;
}


/* ======================
   PREGAME LAYOUT
   ====================== */
body.pregame {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Show only pregame elements */
body.pregame #preGameScreen {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 1200px;
}


/* Tagline */
#tagline {
  width: 100%;
  margin-top: 150px;
  text-align: center;
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #111;
  position: relative;
}

#tagline::after {
  content: "";
  display: block;
  width: 140px;            /* slightly wider looks more balanced */
  height: 5px;             /* a little thicker for impact */
  margin: 14px auto 0;
  border-radius: 3px;

  /* Half green, half red */
  background: linear-gradient(
    to right,
    #2ecc71 0%,
    #2ecc71 50%,
    #e74c3c 50%,
    #e74c3c 100%
  );
}

/* Top Outliers of the Day */
.top-outliers-section {
  width: 100%;
  margin-top: 50px;
}

.top-outliers-container {
  background: #f8f9fa;
  padding: 20px;
  border: 3px solid rgb(232, 232, 232);
  border-radius: 10px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Header */
.top-outliers-header {
  text-align: center;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.top-outliers-header h3 {
  color: #000;
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.top-outliers-date {
  color: #6c757d;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.top-outliers-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nav-arrow {
  background: none;
  border: 2px solid darkgray;
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.nav-arrow svg {
  width: 24px;
  height: 24px;
  pointer-events: none;
}

.nav-arrow:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.nav-arrow:not(:disabled):hover {
  border-color: #007bff;
  color: #007bff;
  transform: translateY(-1px);
}

.top-outliers-title {
  flex: 1;
}

.top-outliers-filters {
  display: flex;
  justify-content: center;
}

.top-outliers-filters select {
  padding: 6px 8px;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  background: white;
  font-weight: 600;
  min-width: 180px;
}

/* Scrollable list like recent games */
.top-outliers-list {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 10px 0;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.top-outliers-list::-webkit-scrollbar {
  height: 8px;
}

.top-outliers-list::-webkit-scrollbar-track {
  background: #e9ecef;
  border-radius: 4px;
}

.top-outliers-list::-webkit-scrollbar-thumb {
  background: #6c757d;
  border-radius: 4px;
}

.top-outliers-list::-webkit-scrollbar-thumb:hover {
  background: #495057;
}

/* Cards */
.top-outlier-item {
  flex-shrink: 0;
  width: 180px;
  background: #fff;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  align-items: center;
}

.top-outlier-item:hover {
  border-color: #007bff;
  transform: translateY(-2px);
}

/* Ranked highlight borders */
.top-outlier-item.rank-1 {
  border-color: #d4af37;
}

.top-outlier-item.rank-2 {
  border-color: #c0c0c0;
}

.top-outlier-item.rank-3 {
  border-color: #cd7f32;
}

.top-outlier-item.rank-3:hover {
  border-color: #007bff;
  transform: translateY(-2px);
}


.top-outlier-item.rank-1:hover {
  border-color: #007bff;
  transform: translateY(-2px);
}


.top-outlier-item.rank-2:hover {
  border-color: #007bff;
  transform: translateY(-2px);
}

.stat-positive {
  color: #28a745; /* green */
  font-weight: 700;
}

.stat-negative {
  color: #d11a2a; /* red */
  font-weight: 700;
}


/* Rank */
.outlier-rank {
  font-size: 1.4rem;
  font-weight: 800;
  margin-right: 8px;
  color: darkgray;
}

.top-outlier-item.rank-1 .outlier-rank { color: #d4af37; }
.top-outlier-item.rank-2 .outlier-rank { color: #c0c0c0; }
.top-outlier-item.rank-3 .outlier-rank { color: #cd7f32; }

/* Content */
.outlier-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

/* Circle mask (square container) */
.outlier-img-wrapper {
  width: 40px;         
  height: 40px;         
  border-radius: 50%;    /* makes it a circle */
  overflow: hidden;      /* crop inner image to circle */
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #e0e0e0;
}

/* Actual image inside  */
.outlier-item-img {
  width: 55px;        
  height: 40px;
  object-fit: cover;
  object-position: center;
}


.outlier-info {
  flex: 1;
  min-width: 0;
}

.outlier-name {
  font-size: 12px;
  color: #333;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.outlier-stat {
  font-weight: 600;
  color: #000;
  font-size: 0.8rem;
  background: rgba(102, 126, 234, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 10px;
  text-align: center;
}

.outlier-game {
  font-size: 0.7rem;
  color: darkgray;
  font-weight: 800;
}


/* Recent Games Section */
.recent-games-section {
  width: 100%;
}


.recent-games-container {
  background: #f8f9fa;
  padding: 20px;
  border: 3px solid rgb(232, 232, 232);
  border-radius: 10px;
  max-width: 1200px;
  margin: 0 auto;
}

.recent-games-header{
    text-align: center;
    margin-bottom: 16px;
}

.recent-games-header h3 {
  color: #000;
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.recent-games-header h2{
  color: black;
  font-size: 15px;
}

.recent-games-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 10px 0;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.recent-games-scroll::-webkit-scrollbar {
  height: 8px;
}

.recent-games-scroll::-webkit-scrollbar-track {
  background: #e9ecef;
  border-radius: 4px;
}

.recent-games-scroll::-webkit-scrollbar-thumb {
  background: #6c757d;
  border-radius: 4px;
}

.recent-games-scroll::-webkit-scrollbar-thumb:hover {
  background: #495057;
}

.recent-game-item {
  flex-shrink: 0;
  width: 180px;
  background: white;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.recent-game-item:hover {
  border-color: #007bff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.season-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 0.6rem;
  padding: 3px 6px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
}

.season-badge.playoffs {
  background: #ffeaa7;
  color: #d63031;
  border: 1px solid #fab1a0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.game-date {
  text-align: center;
  font-size: 0.7rem;
  color: #6c757d;
  font-weight: 500;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.game-matchup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.team {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: center;
}

.team-logo-small {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.team-abbr {
  font-weight: 600;
  font-size: 0.9rem;
  color: #333;
}

.at-symbol {
  font-size: 0.8rem;
  color: #6c757d;
  font-weight: 500;
}

.loading-message {
  text-align: center;
  color: #6c757d;
  font-style: italic;
  padding: 40px 20px;
}

/* ======================
   IN-GAME LAYOUT
   ====================== */
body.in-game {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 20px;
  padding: 100px 0px 50px 0px;
  align-items: start;
}

/* Hide pregame elements */
body.in-game #preGameScreen {
  display: none;
}

body.in-game #gameLayout {
  display: contents;
}

/* Table Section (left column) */
#tableSection {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 50px;
  padding: 20px;
}

/* Aside Column (right column) - contains search and DNP */
#asideColumn {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
  margin-top: 50px;
}

/* ======================
   OUTLIER TABLE
   ====================== */
.outlier-wrapper {
  background-color: white;
  border: 3px solid rgb(232, 232, 232);
  border-radius: 10px;
  padding: 20px;
}

.team-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: nowrap;
}

.score-separator {
  margin: 0 50px;
  display: inline-block;
}


.team-logo {
  width: 80px;
  height: 80px;
}

.boxscore-btn {
  background: whitesmoke;
  border: white;
  border-bottom: 2px solid rgb(170, 169, 169);
  border-left: 2px solid rgb(170, 169, 169);
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 16px;
}

.boxscore-btn:hover {
  transform: translateY(-2px);
  transition: transform 0.2s ease;
}

.outlier-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 17px;
}

.outlier-table th {
  border-top: 2px solid #333;
  border-bottom: 2px solid #333;
  font-weight: 700;
  padding: 12px 8px;
  text-align: center;
}

.outlier-table td {
  padding: 10px 8px;
  vertical-align: middle;
  text-align: center;
}

.outlier-table tr:not(:first-child) {
  border-top: 1px solid #ddd;
  text-align: center;
}

.outlier-table tr:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

.outlier-table img {
  border: 2px solid darkgray;
  width: 60px;
  height: 65px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
}

.player-cell-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0px;
  margin: 0;
  align-items: center;
  gap: 8px;
}

.rank-cell {
  font-weight: 600;
  font-size: 14px;
  text-align: center;
}

.rank-1 {
  color: #d4af37;
  font-size: 20px;
  font-weight: 800;
  background: rgba(212, 175, 55, 0.12);
}

.rank-2 {
  color: #c0c0c0;
  font-size: 18px;
  font-weight: 750;
  background: rgba(192, 192, 192, 0.12);
}

.rank-3 {
  color: #cd7f32;
  font-size: 17px;
  font-weight: 700;
  background: rgba(205, 127, 50, 0.12);
}

.score-positive {
  color: #5cb85c;
  font-weight: bold;
}

.score-negative {
  color: #d9534f;
  font-weight: bold;
}

.team-logo-mini {
  width: 60px;
  height: 60px;
}

/* ======================
   DNP SECTION
   ====================== */
.dnp-section {
  background-color: white;
  border: 3px solid rgb(232, 232, 232);
  border-radius: 10px;
  padding: 20px;
  grid-column-start: 2;
}

.dnp-section h3 {
  color: rgba(255, 107, 107, 0.8);
  font-size: 1.2em;
  margin-bottom: 12px;
  text-align: center;
  font-weight: 500;
}

.dnp-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.dnp-team {
  color: black;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.02);
}

.dnp-team-header {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dnp-team-name {
  font-weight: 600;
  font-size: 1.1em;
  color: black;
}

.dnp-count {
  margin-left: auto;
  background: rgba(255, 107, 107, 0.15);
  color: rgba(255, 107, 107, 0.8);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 0.8em;
  font-weight: 500;
}

.dnp-players-container {
  position: relative;
}

.dnp-players {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: calc((50px + 8px) * 3); /* 3 players tall */
  overflow-y: auto;
  scrollbar-width: thin;
}


.dnp-players::-webkit-scrollbar {
  width: 6px;
}

.dnp-players::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.dnp-players::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.dnp-player {
  display: flex;
  align-items: center;
  padding: 4px 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
  border-left: 2px solid transparent;
  color: black;
}

.dnp-player:hover {
  background: rgba(255, 255, 255, 0.02);
}

.dnp-starter {
  border-left-color: rgba(255, 71, 87, 0.6);
}

.dnp-rotation {
  border-left-color: rgba(255, 165, 2, 0.6);
}

.dnp-bench {
  border-left-color: rgba(116, 125, 140, 0.4);
}

.dnp-player-headshot {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin-right: 6px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.dnp-player-info {
  flex: 1;
  min-width: 0;
}

.dnp-player-name {
  font-weight: 500;
  font-size: 1em;
  margin-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: black;
}

.dnp-player-stats {
  display: flex;
  gap: 4px;
  font-size: 0.9em;
  flex-wrap: wrap;
  color: black;
}

.dnp-avg-min {
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 500;
  font-size: 0.75em;
}

.dnp-last-played {
  font-size: 0.7em;
  color: black;
}

/* ======================
   BOXSCORE STYLES
   ====================== */
#boxscore-section {
  grid-column: 1;
}

.boxscore-window {
  position: fixed;
  background: white;
  border: 2px solid #333;
  border-radius: 8px;
  box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.2);
  width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  z-index: 1000;
}

.boxscore-header {
  flex-shrink: 0;
  background: #eee;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  border-bottom: 2px solid #ccc;
}

.boxscore-drag-handle {
  cursor: move;
}

.boxscore-table-container {
  flex: 1;
  overflow: auto;
}

.close-btn {
  background: red;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 16px;
  cursor: pointer;
}

.boxscore-table {
  background-color: whitesmoke;
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 800px;
}

.boxscore-table th {
  background: whitesmoke;
  color: black;
  padding: 12px 8px;
  text-align: center;
  font-weight: 600;
  border-bottom: 2px solid rgba(79, 70, 229, 0.3);
  top: 0;
  z-index: 10;
}

.boxscore-table th:first-child {
  text-align: left;
  padding-left: 15px;
  min-width: 180px;
}

.boxscore-table td {
  padding: 10px 8px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: black;
}

.boxscore-table tbody tr:hover {
  background: rgba(79, 70, 229, 0.1);
}

.player-name-cell {
  display: flex !important;
  align-items: center;
  gap: 10px;
  text-align: left !important;
  padding-left: 15px !important;
  min-width: 180px;
}

.boxscore-player-headshot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #324C5E;
  flex-shrink: 0;
}

.player-name {
  font-weight: 600;
  white-space: nowrap;
  color: black;
}

.team-totals-row {
  background: rgba(0, 0, 0, 0.05);
  border-top: 2px solid rgba(79, 70, 229, 0.3);
  border-bottom: 2px solid rgba(79, 70, 229, 0.3);
}

.team-totals-row:hover {
  background: rgba(79, 70, 229, 0.15) !important;
}

.stat-highlight {
  font-weight: 700;
  color: #fbbf24 !important;
}

.plus-minus-positive {
  color: #10b981 !important;
  font-weight: 600;
}

.plus-minus-negative {
  color: #ef4444 !important;
  font-weight: 600;
}

/* Hide elements by default based on state */
body.pregame #output,
body.pregame .dnp-section,
body.pregame #boxscore-section {
  display: none;
}


/* -------------------------------------------------
   PREGAME VISIBILITY RULES
---------------------------------------------------*/

/* Hide the sidebar search container during pregame */
body.pregame #asideColumn .search-container {
  display: none !important;
}

/* Hide the popup search container during in-game */
body.in-game .pregame-search {
  display: none !important;
}




/* ======================
   RESPONSIVE DESIGN
   ====================== */
@media (max-width: 1024px) {
  body.in-game {
    grid-template-columns: 1fr;
    padding-right: 20px;
  }

  #asideColumn {
    grid-column: 1;
  }

  body.in-game .search-container {
    position: relative;
    top: 0;
    right: 0;
    margin-bottom: 20px;
  }
  
}

/* Hide outlier count selector for now */
#outlierCountSelector {
  display: none;
}

/* Floating circular search button (pregame) */
.floating-search-btn {
  background: white;
  cursor: pointer;
  border: 2px solid #e0e0e0;
  border-radius: 50%;
  padding: 10px 10px;
  z-index: 120;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  display: flex;
  text-align: center;
  align-content: center;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-left: 90%;
  margin-bottom: 20px;
}

.floating-search-btn:hover {
  border-color: #4a9eff;
  box-shadow: 0 3px 8px rgba(74, 158, 255, 0.15);
  background: #fafbfc;
}

.floating-search-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Dark overlay behind popup */
.search-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;              /* JS toggles to flex */
  justify-content: center;
  align-items: center;
  z-index: 110;
}

/* Popup card */
.search-popup {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  max-width: 900px;
  width: 90%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  position: relative;
}

/* X button in popup */
.close-search-popup {
  position: absolute;
  top: 10px;
  right: 12px;
  cursor: pointer;
  font-size: 20px;
  color: #666;
}

.close-search-popup:hover {
  color: #000;
}

/* Popup search container layout */
.search-popup .search-container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  flex-direction: column;
  padding: 20px;
  background: white;
  border: none;
  box-shadow: none;
}

.scroll-hint {
  display: none;
}

.team {
  display: flex;
  align-items: center;
  gap: 6px;
}

.win-bar {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 7px solid transparent;
  margin-right: 6px;
}

.win-bar.visible {
  border-right-color: black;
  border-radius: 25%;
}

.team-abbr.loser {
  opacity: 0.6;
}

@media (max-width: 800px) {

  /* ===============================
     BODY / GLOBAL
  ================================ */
  body {
    overflow-x: hidden;
    padding: 20px;
  }

  body.in-game {
    padding: 20px;
    margin: 0px;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
  }

  body.in-game .search-container {
    display: none;
  }

  /* ===============================
     HEADER / NAV / HAMBURGER
  ================================ */
  header {
    display: flex;
    width: 100%;
    padding: 0;
    margin: 0;
    position: relative;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  header h1 {
    font-size: 35px;
    margin: 20px 0 20px -50px;
  }


  .site-header{
    flex-direction: column;
    flex-wrap: wrap;
  }
  .site-header::after {
    content: "";
    display: flex;
    width: 140px;            /* slightly wider looks more balanced */
    height: 5px;             /* a little thicker for impact */
    margin-top: 0px;
    margin-bottom: 20px;
    border-radius: 3px;

    /* Half green, half red */
    background: linear-gradient(
      to right,
      #2ecc71 0%,
      #2ecc71 50%,
      #e74c3c 50%,
      #e74c3c 100%
    );
  } 

  header select,
  .social {
    display: none;
  }

  .hamburger {
    display: inline-block;
    position: absolute;
    top: 0px;
    left: 0px;
    font-size: large;
    background: none;
    color: darkgray;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease;
  }

  nav {
    position: relative;
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
  }

  .main-nav {
    display: none;
    flex-direction: column;
    gap: 10px;
    padding: 5px;
    border-radius: 10px;
    z-index: 1000;
  }

  .main-nav.open {
    position: absolute;
    top: 50px;
    left: 20px;
    display: flex;
    background-color: white;
    width: 15%;
    align-items: center;
  }

  .main-nav a {
    font-size: 8px;
  }

  /* ===============================
     TAGLINE / BUTTONS
  ================================ */
  #tagline {
    display: none;
  }

  #floatingSearchBtn {
    color: darkgray;
    height: 25px;
    width: 25px;
    font-size: 10px;
    position: absolute;
    border-radius: 50%;
    top: 15px;
    right: 20px;
    padding: 10px;
    justify-content: center;
    align-items: center;
    text-align: center;
  }

  /* ===============================
     LAYOUT COLUMNS
  ================================ */
  #asideColumn,
  .outlier-wrapper {
    width: 100% !important;
    padding: 0 !important;
  }

  #asideColumn {
    margin-top: 20px;
    padding: 0 !important;
  }

  .outlier-wrapper {
    padding: 0 !important;
    box-sizing: border-box;
  }

  #tableSection {
    margin-top: -20px;
    margin-bottom: -30px;
    padding: 0 !important;
  }

  /* ===============================
     RECENT GAMES
  ================================ */
  .recent-games-section,
  .top-outliers-section {
    margin-top: 20px !important;
  }

  .recent-games-container {
    padding: 12px;
    padding-bottom: 0px;
    max-height: 600px;
    overflow: scroll;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    overflow-anchor: none;
  }


  .recent-games-list{
    justify-content: center;
  }
  .recent-games-list,
  .recent-games-scroll {
    display: flex;
    gap: 20px;
    flex-direction: row;
    width: 100%;
    align-items: center;
    text-align: center;
  }

  .recent-games-header{
    text-align: center;
    margin-bottom: 0px;
  }

  .recent-game-item {
    width: 85px;
    height: 80px;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
  }

  .game-date {
    text-align: center;
    font-size: 0.45rem;
    color: #6c757d;
    font-weight: 400;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .game-matchup {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
  }

  .team {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    justify-content: center;
  }

  .win-bar {
    width: 0;
    height: 0;
    border-top: 3px solid transparent;
    border-bottom: 3px solid transparent;
    border-right: 5px solid transparent;
    margin-right: 4px;
  }

  .team-logo-small {
    width: 20px;
    height: 20px;
    object-fit: contain;
  }

  .team-abbr {
    font-weight: 600;
    font-size: 0.7rem;
    color: #333;
  }

  .at-symbol {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
  }

  /* ===============================
     TOP OUTLIERS
  ================================ */
  .top-outliers-container {
    max-height: 700px;
    overflow: scroll;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-anchor: none;
    margin-bottom: 20px;
    padding-left: 40px;
    padding-right: 40px;
    padding-bottom: 0px;
  }

  .top-outliers-list {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
  }

  .top-outlier-item {
    flex-shrink: 0;
    flex-direction: column;
    width: 100px;
    background: #fff;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
  }


  .outlier-content {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
  }

/* Circle mask (square container) */
  .outlier-img-wrapper {
    width: 36px;         
    height: 36px;         
    border-radius: 50%;    /* makes it a circle */
    overflow: hidden;      /* crop inner image to circle */
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e0e0e0;
  }

/* Actual image inside  */
  .outlier-item-img {
    width: 36px;        
    height: 36px;
    object-fit: cover;
    object-position: center;
  }


  .outlier-content{
    text-overflow: ellipsis;
  }

  .outlier-info{
    text-overflow: ellipsis;
  }

  .top-outlier-item{
    text-align: center;
  }
  .outlier-rank {
    font-size: 1rem;
    margin-bottom: 4px;
    margin-right: 0px;
    text-align: center;
    align-items: center;
  }

  .outlier-name {
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .outlier-stat {
    font-size: 0.75rem;
    text-overflow: ellipsis;
  }

  .stat-label{
    text-overflow: ellipsis;
  }

  .top-outliers-date {
    font-size: 10px;
  }

  .nav-arrow svg {
    width: 12px;
    height: 12px;
  }

  /* ===============================
     SCROLL HINT
  ================================ */
  .scroll-hint {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    margin-top: 6px;
    display: block;
  }

  /* ===============================
     OUTLIER TABLE
  ================================ */

  .outlier-wrapper {
    padding: 0px;
    margin: 0px;
  }
  .outlier-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 13px;
  }

  .outlier-table th {
    font-size: 8px;
    text-overflow: ellipsis;
  }

  .outlier-table td {
    font-size: 9px;
  }

  .outlier-table td,
  .outlier-table th {
    padding: 6px 4px;
    text-align: center;
  }

  .outlier-table thead th {
    position: sticky;
    top: 0;
    background: #ffffff;
    z-index: 5;
    border-bottom: 2px solid #ddd;
  }

  .outlier-table tbody tr:nth-child(odd) {
    background-color: #fafafa;
  }

  .outlier-table tbody tr:nth-child(even) {
    background-color: #f1f1f1;
  }

  .rank-1 { background-color: #fff7dc !important; }
  .rank-2 { background-color: #f3f5f7 !important; }
  .rank-3 { background-color: #fef1e6 !important; }

  .outlier-table img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
  }

  .player-cell-content span {
    font-size: 6px;
    text-align: center;
    text-wrap: wrap;
  }

  /* ===============================
     TEAM HEADER
  ================================ */
  .team-header {
    display: flex;
    gap: 5px;
    flex-wrap: nowrap;
    font-size: 15px;
    margin-bottom: 0px;
  }

  .team-header span {
    font-size: 10px;
  }

  .team-header img {
    width: 40px;
    height: 40px;
  }

  .score-separator {
    margin: 0 20px !important;
  }

  /* ===============================
     BOXSCORE
  ================================ */
  .boxscore-window {
    position: fixed;
    width: 80%;
    max-height: 70vh;
    background: white;
    border: 2px solid #333;
    border-radius: 8px;
    box-shadow: 4px 4px 12px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    z-index: 1000;
  }

  .boxscore-btn {
    font-size: 7px;
    padding: 5px;
    margin: 5px;
    background: whitesmoke;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
  }

  /* ===============================
     DNP SECTION
  ================================ */
  .dnp-section {
    padding: 10px;
  }

  .dnp-player-headshot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 6px;
    object-fit: cover;
  }

  .dnp-player-name {
    font-size: 0.8em;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: black;
  }

}




