/*
  NBA Stats Hub - styles.

  This file is loaded by index.html via <link rel="stylesheet" href="/static/style.css">.
  Flask serves anything in the /static folder automatically at the /static URL.

  CSS organisation here, top to bottom:
    1. Variables (colors/spacing in one place via :root custom properties)
    2. Base/reset + layout (header, container, tabs)
    3. Scores grid + game cards (the main feature this round)
    4. Status badges (live / final / scheduled)
    5. Empty + loading + error states
    6. Standings table
    7. "Coming soon" placeholders
    8. Small responsive tweaks
*/

/* 1. Design tokens ------------------------------------------------------- */
/* Defining colors once as variables means we can re-theme the whole site by
   editing a few lines, instead of hunting for every hex code. */
:root {
  --bg: #140a20;         /* deep arcade purple-black */
  --surface: #1e1232;
  --surface-2: #2b1b47;
  --border: #3f2a63;
  --text: #f2eefb;
  --text-dim: #a89bc7;
  --accent: #ff5f1f;     /* jam-fire orange */
  --accent-2: #00d4ff;   /* electric cyan */
  --gold: #ffd60a;       /* NBA Jam title yellow */
  --live: #3dfc7b;
  --radius: 10px;
  --shadow: 4px 4px 0 rgba(0, 0, 0, 0.45);       /* hard 90s drop shadow */
  --fire: linear-gradient(90deg, #ffd60a, #ff5f1f, #ff1e56);  /* he's on fire */
  --display: "Bungee", "Inter", sans-serif;      /* chunky arcade display font */
}

/* 2. Base + layout ------------------------------------------------------- */
* {
  box-sizing: border-box;   /* width includes padding+border - far easier math */
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", system-ui, sans-serif;
  /* Arcade glow: cyan haze from the top, fire haze from the bottom. */
  background:
    radial-gradient(1100px 480px at 50% -10%, rgba(0, 212, 255, 0.10), transparent 60%),
    radial-gradient(900px 420px at 50% 112%, rgba(255, 95, 31, 0.12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* CRT scanline overlay, same trick as the portfolio site. It's fixed and
   ignores the mouse, so it just tints every other pixel row slightly. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 2px,
    rgba(0, 0, 0, 0.10) 2px 4px
  );
}

.container {
  max-width: 1100px;
  margin: 0 auto;        /* center the content */
  padding: 0 20px;
}

.header {
  background: var(--surface);
  /* border-image lets the bottom border be a gradient instead of one color. */
  border-bottom: 3px solid;
  border-image: var(--fire) 1;
  position: sticky;       /* keep the nav visible while scrolling */
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* NBA Jam title treatment: yellow-to-fire gradient clipped to the letters. */
.logo-text {
  background: var(--fire);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.6));
}

.logo-ball {
  font-size: 1.4rem;
}

/* Tab buttons in the header */
.nav-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.tab-btn {
  background: transparent;
  border: 2px solid transparent;
  color: var(--text-dim);
  font-family: var(--display);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}

.tab-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* Active tab = lit arcade button: fire gradient, dark text, hard shadow. */
.tab-btn.active {
  background: var(--fire);
  color: #1a0b00;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5);
  transform: translateY(-1px);
}

.main {
  padding: 28px 0 60px;
}

/* Only the active tab's content is shown; the rest are hidden.
   script.js toggles the "active" class to switch tabs. */
.tab-content {
  display: none;
}

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

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.section-header h2 {
  font-family: var(--display);
  font-size: 1.35rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transform: skewX(-6deg);            /* slight italic lean, very 90s */
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.55);
}

.refresh-btn {
  background: var(--surface-2);
  color: var(--text);
  border: 2px solid var(--border);
  font-family: var(--display);
  font-size: 0.72rem;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.45);
  transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.1s;
}

.refresh-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Pressing the button "pushes it in": it moves into its own shadow. */
.refresh-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.45);
}

/* 3. Scores grid + game cards ------------------------------------------- */
/* CSS Grid with auto-fill makes a responsive card grid with zero media
   queries: cards are at least 300px wide and wrap to new rows as needed. */
.scores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.game-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}

/* Live games are ON FIRE: orange edge + glow so they pop out of the grid. */
.game-card.is-live {
  border-left: 4px solid var(--accent);
  box-shadow: var(--shadow), 0 0 14px rgba(255, 95, 31, 0.35);
}

.game-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

/* One row per team: logo + name (+ record) on the left, score on the right. */
.team-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}

.team-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex-shrink: 0;
}

.team-meta {
  flex: 1;            /* take remaining width so the score sits at the far right */
  min-width: 0;
}

.team-name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;   /* long names get "..." instead of breaking layout */
}

.team-record {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.team-score {
  font-family: var(--display);          /* scoreboard digits */
  font-size: 1.35rem;
  min-width: 48px;
  text-align: right;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

/* Dim the loser's score on finished games for a subtle visual cue. */
.team-row.loser .team-name,
.team-row.loser .team-score {
  color: var(--text-dim);
}

.game-card-footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* 4. Status badges ------------------------------------------------------- */
.status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 999px;
}

.status-badge.live {
  background: rgba(255, 95, 31, 0.18);
  color: var(--gold);
  border: 1px solid rgba(255, 95, 31, 0.5);
}

/* The little blinking dot next to "LIVE". */
.status-badge.live .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  margin-right: 5px;
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.status-badge.final {
  background: var(--surface-2);
  color: var(--text-dim);
}

.status-badge.scheduled {
  background: rgba(29, 66, 138, 0.25);
  color: #7aa2e3;
}

/* 5. Empty / loading / error states ------------------------------------- */
.loading,
.empty-state {
  text-align: center;
  color: var(--text-dim);
  padding: 40px 20px;
  grid-column: 1 / -1;   /* span the full grid width even inside .scores-grid */
}

.empty-state h3 {
  color: var(--text);
  font-size: 1.2rem;
  margin-bottom: 6px;
}

.error-state {
  grid-column: 1 / -1;
  text-align: center;
  color: #ff8a8a;
  background: rgba(200, 16, 46, 0.1);
  border: 1px solid rgba(200, 16, 46, 0.3);
  border-radius: var(--radius);
  padding: 24px;
}

/* A subheading used to separate "upcoming" day groups in the scores grid. */
.day-heading {
  grid-column: 1 / -1;
  font-weight: 700;
  color: var(--text);
  margin: 8px 0 0;
  font-size: 1.05rem;
}

/* 6. Standings table ----------------------------------------------------- */
.standings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.conference-title {
  font-family: var(--display);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 3px solid var(--border);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

.conference-title.east { border-color: var(--accent-2); }
.conference-title.west { border-color: var(--accent); }

table.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.standings-table th {
  text-align: left;
  color: var(--text-dim);
  font-weight: 600;
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

.standings-table td {
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

.standings-table .team-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.standings-table .mini-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.standings-table .num {
  text-align: center;
  white-space: nowrap;
}

/* 7. Coming-soon placeholders ------------------------------------------- */
.coming-soon {
  text-align: center;
  color: var(--text-dim);
  padding: 60px 20px;
}

.coming-soon .big {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

/* Stat selector + search input keep their hooks even if not wired yet. */
.stat-selector { display: flex; gap: 6px; flex-wrap: wrap; }
.stat-btn {
  background: var(--surface-2);
  color: var(--text-dim);
  border: 1px solid var(--border);
  font: inherit;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.stat-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font: inherit;
  padding: 12px 16px;
  border-radius: 8px;
}

.hidden { display: none; }

/* 8. Players tab (search + season table) -------------------------------- */
/* The search box and its dropdown of results sit in a relatively-positioned
   wrapper so the results can float just below the input. */
.search-wrap {
  position: relative;
  max-width: 520px;
  margin-bottom: 24px;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* The dropdown list of matching players, layered over the page content. */
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 5;
  max-height: 360px;
  overflow-y: auto;
}

.search-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font: inherit;
  padding: 10px 14px;
  cursor: pointer;
}

.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--surface-2); }

.search-item-name { font-weight: 700; }

.search-item-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.search-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-dim);
}

/* Little gold "HOF" badge next to Hall-of-Famers. */
.hof-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  vertical-align: middle;
  color: #1a1205;
  background: #f4c430;
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 6px;
}

/* Player profile header (photo + name + bio + career span). */
.player-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border);
}

.player-header-main { min-width: 0; }

/* Trading-card style headshot: portrait crop, chunky border, hard shadow.
   Basketball-Reference photos are roughly 2:3 portrait, so height > width. */
.player-photo {
  width: 66px;
  height: 92px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--surface-2);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.45);
  flex-shrink: 0;
}

.player-photo-lg {
  width: 84px;
  height: 116px;
}

/* Same footprint as the photo, shown when a player has no picture. */
.player-photo-blank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

/* Photo + name/years side by side on the legend spotlight card. */
.legend-id-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 4px;
}

.player-name {
  font-family: var(--display);
  font-size: 1.45rem;
  text-transform: uppercase;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.55);
}

.player-bio,
.player-span {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* The season-by-season stat table. Horizontal scroll on small screens so the
   columns never get crushed. */
.season-table-wrap {
  overflow-x: auto;
}

table.season-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  white-space: nowrap;
}

.season-table th {
  position: sticky;
  top: 0;
  text-align: right;
  color: var(--text-dim);
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

/* First two columns (Season, Team) read left-aligned like labels. */
.season-table th:first-child,
.season-table th:nth-child(2),
.season-table td:first-child,
.season-table td:nth-child(2) {
  text-align: left;
}

.season-table td {
  text-align: right;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
}

.season-table tbody tr:hover { background: var(--surface-2); }

/* Emphasize the points-per-game column - the headline stat. */
.season-table td.strong { font-weight: 700; color: var(--text); }

/* 9. Liveliness: animations, charts, spotlight, leaders, compare -------- */

/* --- Keyframes --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
/* Bars "grow" up from their baseline. transform-box: fill-box makes the
   transform-origin relative to the bar itself (not the whole SVG). */
@keyframes growBar {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}
/* Line charts draw themselves in by animating the dashed stroke. */
@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}

/* Utility: fade-and-rise in. JS sets an inline animation-delay to stagger
   sibling elements (cards, rows) for a cascading reveal. */
.fade-in-up {
  opacity: 0;
  animation: fadeInUp 0.45s ease forwards;
}

/* Active tab content gently fades/rises in when you switch tabs. */
.tab-content.active {
  animation: fadeInUp 0.35s ease;
}

/* Cards lift slightly on hover for a tactile feel. */
.game-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s;
}
.game-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-2);
}

/* --- Skeleton loaders --- */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface) 25%,
    var(--surface-2) 50%,
    var(--surface) 75%
  );
  background-size: 800px 100%;
  animation: shimmer 1.3s infinite linear;
  border-radius: 8px;
}
.skeleton-row { height: 14px; margin: 10px 0; }
.skeleton-card { height: 120px; border-radius: var(--radius); }

/* --- SVG charts (career + compare) --- */
.chart { width: 100%; display: block; }

.chart-bar {
  transform-box: fill-box;
  transform-origin: bottom;
  animation: growBar 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
  transition: opacity 0.15s;
}
.chart-bar:hover { opacity: 0.7; }

.chart-baseline { stroke: var(--border); stroke-width: 1; }
.chart-xlabel { fill: var(--text-dim); font-size: 9px; }
.chart-ylabel { fill: var(--text-dim); font-size: 10px; }

/* The polyline carries pathLength="1", so normalizing the dash to 1 makes the
   draw-in animation length-independent. */
.spark-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: drawLine 1.1s ease forwards;
}
.spark-dot { transition: r 0.15s; }

.leader-row { cursor: pointer; transition: border-color 0.15s, transform 0.15s; }
.leader-row:hover { border-color: var(--accent-2); transform: translateX(2px); }

/* Toggle buttons that switch which stat the career chart shows. */
.chart-toggle { display: flex; gap: 6px; margin: 18px 0 8px; flex-wrap: wrap; }
.chart-toggle-btn {
  background: var(--surface-2);
  color: var(--text-dim);
  border: 1px solid var(--border);
  font: inherit;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.chart-toggle-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 18px;
}

/* Legend used by the compare chart. */
.chart-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px; }
.legend-item { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 0.85rem; }
.legend-dot { width: 12px; height: 12px; border-radius: 3px; }

/* --- All-time leaders (bars) --- */
.leaders-grid { display: flex; flex-direction: column; gap: 8px; }

.leader-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
}
.leader-rank {
  font-weight: 800;
  color: var(--text-dim);
  text-align: center;
  font-size: 0.95rem;
}
.leader-row.rank-1 .leader-rank { color: #f4c430; }   /* gold */
.leader-row.rank-2 .leader-rank { color: #c7ccd4; }   /* silver */
.leader-row.rank-3 .leader-rank { color: #cd7f32; }   /* bronze */
.leader-row.rank-1 { border-color: rgba(244, 196, 48, 0.5); }

.leader-main { min-width: 0; }
.leader-name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.leader-sub { font-size: 0.75rem; color: var(--text-dim); }
.leader-bar-track {
  margin-top: 6px;
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.leader-bar-fill {
  height: 100%;
  background: var(--fire);   /* stat bars literally fill with fire */
  border-radius: 999px;
  width: 0;
  transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.leader-value { font-weight: 800; font-size: 1.05rem; white-space: nowrap; }

/* --- Home spotlight (offseason) --- */
.spotlight { grid-column: 1 / -1; }
.spotlight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.spotlight-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.spotlight-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.spotlight-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent);
}
.shuffle-btn {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  font: inherit;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, transform 0.4s;
}
.shuffle-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.shuffle-btn.spin { transform: rotate(360deg); }

.legend-name {
  font-family: var(--display);
  font-size: 1.3rem;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.55);
}
.legend-years { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 14px; }
.legend-statline {
  display: flex;
  gap: 22px;
  margin: 16px 0;
}
.legend-statline .ls { text-align: center; }
.legend-statline .ls-num { font-family: var(--display); font-size: 1.5rem; line-height: 1; text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5); }
.legend-statline .ls-lab { font-size: 0.72rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; }
.legend-peak { font-size: 0.85rem; color: var(--text-dim); }
.legend-peak strong { color: var(--text); }
.legend-link {
  display: inline-block;
  margin-top: 12px;
  color: #7aa2e3;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}
.legend-link:hover { text-decoration: underline; }

/* --- Favorites --- */
.fav-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}
.fav-strip-label { font-size: 0.8rem; color: var(--text-dim); font-weight: 600; }
.fav-chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.fav-chip:hover { border-color: var(--accent); }

.fav-star {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--text-dim);
  transition: transform 0.15s, color 0.15s;
}
.fav-star:hover { transform: scale(1.2); }
.fav-star.active { color: #f4c430; }

.player-name-row { display: flex; align-items: center; gap: 10px; }

/* --- Compare tab --- */
.compare-pickers {
  display: grid;
  grid-template-columns: 1fr 40px 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 22px;
}
.compare-vs {
  align-self: center;
  text-align: center;
  font-family: var(--display);
  font-size: 1.3rem;
  color: var(--gold);
  transform: skewX(-8deg);
  text-shadow: 3px 3px 0 rgba(255, 30, 86, 0.6);   /* red offset, fight-screen style */
}
.compare-slot { position: relative; }
.compare-slot .search-results { max-height: 280px; }
.compare-chosen {
  margin-top: 8px;
  font-weight: 700;
  color: var(--text);
}
.compare-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.compare-table th, .compare-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); }
.compare-table td:first-child { text-align: left; color: var(--text-dim); font-weight: 600; }
.compare-table td.cval { text-align: center; font-weight: 700; font-size: 1.05rem; }
.compare-table td.cwin { color: var(--live); }
.compare-table th { color: var(--text-dim); font-weight: 700; }
.compare-a { color: #4aa3ff; }
.compare-b { color: #ff6b6b; }

/* 11. Teams tab ----------------------------------------------------------- */
/* The 30-team directory. Each tile gets --team-color from an inline style so
   one CSS rule here can accent all 30 tiles in their own colors. */
.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.team-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-bottom: 4px solid var(--team-color, var(--accent));
  border-radius: var(--radius);
  padding: 16px 10px 12px;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s, border-color 0.15s;
}

.team-tile:hover {
  transform: translateY(-3px);
  border-color: var(--team-color, var(--accent));
}

.team-tile-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  margin-bottom: 8px;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.4));
}

.team-tile-loc {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.team-tile-name {
  font-family: var(--display);
  font-size: 0.8rem;
  text-transform: uppercase;
}

/* Single-team page: header banner, then roster table + history side panel. */
.back-btn { margin-bottom: 16px; }

.team-page-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 3px solid var(--team-color, var(--border));
}

.team-page-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, 0.45));
}

.team-page-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;   /* roster wider than the history panel */
  gap: 24px;
  align-items: start;
}

/* Tables can be wider than a phone screen; scroll sideways instead of
   crushing the columns. */
.standings-table-wrap { overflow-x: auto; }

/* Spelled-out positions ("SF - Small Forward") stay on one line. */
.roster-table .pos { white-space: nowrap; }

/* Red injury tag next to a player's name: DTD (day-to-day) or OUT. */
.injury-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  vertical-align: middle;
  color: #fff;
  background: #c8102e;
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 6px;
}

/* Player identity photos in the roster. Circle-cropped like a trading card. */
.roster-headshot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  flex-shrink: 0;
}

.roster-headshot-blank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.history-panel {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.history-facts {
  flex-wrap: wrap;
  gap: 16px;
  margin: 12px 0 20px;
}

/* 12. Titles tab ---------------------------------------------------------- */
/* Any small team logo, wherever it appears (leaderboards, table cells, the
   dashboard's standings snapshot). Without a size cap the raw ESPN logo file
   (500x500) fills whatever container it lands in - so the cap is GLOBAL, and
   places that want a different size (like the standings table's 22px) win by
   being more specific. */
.mini-logo {
  width: 26px;
  height: 26px;
  object-fit: contain;
  justify-self: center;
  flex-shrink: 0;
}

/* Banner-count board on the left, full Finals timeline on the right. */
.titles-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 24px;
  align-items: start;
}

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

/* 13. Home dashboard ------------------------------------------------------ */
/* Reigning-champion hero banner, tinted with the champ's own team color. */
.champ-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  background:
    linear-gradient(100deg, var(--team-color, var(--accent)) -60%, var(--surface) 55%);
  border: 2px solid var(--team-color, var(--border));
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s;
}
.champ-banner:hover { transform: translateY(-2px); }

.champ-logo {
  width: 76px;
  height: 76px;
  object-fit: contain;
  filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, 0.5));
}

.champ-name {
  font-family: var(--display);
  font-size: 1.6rem;
  text-transform: uppercase;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.55);
  margin: 2px 0;
}

/* Panel grid: two columns; "wide" panels (games, favorites) span both. */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.dash-wide { grid-column: 1 / -1; }

/* Mini scoreboards inside the games strip. */
.dash-games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.mini-game {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.mini-game.is-live {
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(255, 95, 31, 0.3);
}

.mini-team {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
}
.mini-team img { width: 20px; height: 20px; object-fit: contain; }
.mini-team strong {
  margin-left: auto;
  font-family: var(--display);
  font-size: 0.9rem;
}

.mini-status {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Top-3 standings snapshot: East and West side by side. */
.dash-standings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.mini-standings-title {
  font-family: var(--display);
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.mini-rank-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
}
.mini-rank-row .leader-rank { font-size: 0.85rem; min-width: 16px; }
.mini-rank-name { font-weight: 700; }
.mini-rank-rec { margin-left: auto; color: var(--text-dim); font-size: 0.85rem; }

/* Born-today cards: small photo + name, clickable. */
.bday-list { display: flex; flex-direction: column; gap: 10px; }

.bday-card {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  border-radius: 8px;
  padding: 4px 6px;
  transition: background 0.15s;
}
.bday-card:hover { background: var(--surface-2); }

.bday-photo { width: 40px; height: 54px; font-size: 1.2rem; }

.bday-name { font-weight: 700; }

/* Stat of the day: one huge gold number, then the story under it. */
.stat-day-num {
  font-family: var(--display);
  font-size: 2.4rem;
  color: var(--gold);
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.55);
  line-height: 1.1;
}
.stat-day-num span { font-size: 1.1rem; }

.stat-day-text {
  margin-top: 10px;
  color: var(--text-dim);
  line-height: 1.5;
}

/* 10. Responsive --------------------------------------------------------- */
@media (max-width: 700px) {
  .standings-grid,
  .spotlight-grid {
    grid-template-columns: 1fr;   /* stack on phones */
  }
  .compare-pickers { grid-template-columns: 1fr; }
  .compare-vs { display: none; }
  .dash-grid { grid-template-columns: 1fr; }   /* stack dashboard panels */
}

@media (max-width: 900px) {
  .team-page-grid { grid-template-columns: 1fr; }  /* history below roster */
}
