/* ============================================================
   SORARE MLS DATA — Design System
   Terminal CLI Aesthetic / Cyber-Industrial
   ============================================================ */

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0a0a0a;
  --primary: #33ff00;
  --secondary: #ffb000;
  --muted: #1f521f;
  --error: #ff3333;
  --border: #1f521f;
  --text-glow: 0 0 5px rgba(51, 255, 0, 0.5);
  --text-glow-amber: 0 0 5px rgba(255, 176, 0, 0.4);
  --font: "JetBrains Mono", "Fira Code", "Courier New", monospace;

  /* Status colors */
  --status-starter-bg: #abd8ff;
  --status-starter-text: #2291f5;
  --status-sub-bg: #ffd89e;
  --status-sub-text: #f2994a;
  --status-bench-bg: #ffc7ba;
  --status-bench-text: #e73107;
  --status-dnp-bg: #ffc7ba;
  --status-dnp-text: #e73107;

  /* Venue colors */
  --venue-home-bg: #1481ec;
  --venue-away-bg: #eab532;
}

html {
  font-size: 14px;
  scrollbar-color: var(--muted) var(--bg);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* --- CRT Scanline Overlay --- */
/* COMMENTED OUT - Removed scanline effect
.crt-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
}

/* Exclude player photo and score badges from CRT overlay */
/* .page-player .crt-overlay {
  mask-image:
    radial-gradient(circle at center, transparent 280px, black 280px),
    radial-gradient(circle 35px at 15% 25%, transparent 35px, black 35px),
    radial-gradient(circle 35px at 25% 25%, transparent 35px, black 35px),
    radial-gradient(circle 35px at 35% 25%, transparent 35px, black 35px);
  mask-position:
    center,
    0 0,
    0 0,
    0 0;
  mask-repeat: no-repeat;
  mask-composite: intersect;
}
*/

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--muted);
  border: 1px solid var(--border);
}

/* --- Typography --- */
h1,
h2,
h3,
h4 {
  font-family: var(--font);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: var(--text-glow);
}

h1 {
  font-size: 1.5rem;
}
h2 {
  font-size: 1.2rem;
}
h3 {
  font-size: 1rem;
}

a {
  color: var(--primary);
  text-decoration: none;
  text-shadow: var(--text-glow);
}
a:hover {
  color: var(--bg);
  background: var(--primary);
}

.text-muted {
  color: var(--muted);
  text-shadow: none;
}
.text-amber {
  color: var(--secondary);
  text-shadow: var(--text-glow-amber);
}
.text-error {
  color: var(--error);
}

/* --- Top Bar --- */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-bar__left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.top-bar__right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.top-bar__logo {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-shadow: var(--text-glow);
  white-space: nowrap;
}
.top-bar__logo:hover {
  background: none;
  color: var(--secondary);
  text-shadow: var(--text-glow-amber);
}

.top-bar__link {
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
  text-shadow: var(--text-glow);
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--primary);
  transition: all 0.1s;
  white-space: nowrap;
}
.top-bar__link:hover {
  color: var(--bg);
  background: var(--primary);
  text-shadow: none;
}

.top-bar__search {
  position: relative;
  width: 320px;
}
.top-bar__search-input {
  width: 100%;
  background: rgba(51, 255, 0, 0.05);
  border: 2px solid var(--primary);
  outline: none;
  color: var(--primary);
  font-family: var(--font);
  font-size: 0.8rem;
  padding: 0.4rem 0.6rem;
  caret-color: var(--primary);
  text-shadow: var(--text-glow);
  box-shadow: 0 0 8px rgba(51, 255, 0, 0.2);
}
.top-bar__search-input::placeholder {
  color: var(--primary);
  opacity: 0.6;
  text-shadow: var(--text-glow);
}
.top-bar__search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(51, 255, 0, 0.4);
  background: rgba(51, 255, 0, 0.08);
}
.top-bar__search .search-dropdown {
  top: 100%;
  left: 0;
  right: 0;
  position: absolute;
  border: 2px solid var(--primary);
  border-top: none;
  background: var(--bg);
  max-height: 280px;
  overflow-y: auto;
  z-index: 200;
  display: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
}
.top-bar__search .search-dropdown.active {
  display: block;
}

.top-bar__status {
  font-size: 0.75rem;
  color: var(--primary);
  text-shadow: var(--text-glow);
  animation: blink 2s step-end infinite;
  white-space: nowrap;
}

/* --- Main Content --- */
#app {
  max-width: 90%;
  margin: 0 auto;
  padding: 1.5rem;
  min-height: calc(100vh - 120px);
}

/* Page-specific widths */
#app.page-home {
  max-width: 960px;
}

#app.page-transactions {
  max-width: 95%;
}

#app.page-player {
  max-width: 90%;
}

/* --- Footer --- */
.footer {
  padding: 0.5rem 1.5rem 1rem;
  max-width: 90%;
  margin: 0 auto;
  overflow: hidden;
}
.footer span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
}
.footer__content {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.25rem;
  font-size: 0.7rem;
}

/* --- Terminal Window (Card/Pane) --- */
.terminal-window {
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.terminal-window__header {
  border-bottom: 1px solid var(--border);
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: rgba(31, 82, 31, 0.15);
}

.terminal-window__body {
  padding: 1rem;
}

/* --- Search --- */
.search-container {
  margin: 2rem 0;
  position: relative;
}

.search-prompt {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  padding: 0.6rem 0.75rem;
  gap: 0.5rem;
  transition: border-color 0.15s;
}
.search-prompt:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 8px rgba(51, 255, 0, 0.15);
}

.search-prompt__label {
  color: var(--primary);
  white-space: nowrap;
  font-size: 0.85rem;
  text-shadow: var(--text-glow);
}

.search-prompt__input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--primary);
  font-family: var(--font);
  font-size: 0.85rem;
  caret-color: var(--primary);
  text-shadow: var(--text-glow);
}
.search-prompt__input::placeholder {
  color: var(--muted);
  text-shadow: none;
}

.search-prompt__cursor {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  background: var(--primary);
  animation: blink 1s step-end infinite;
}

/* --- Search Dropdown --- */
.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  border: 2px solid var(--primary);
  border-top: none;
  background: var(--bg);
  max-height: 280px;
  overflow-y: auto;
  z-index: 50;
  display: none;
  box-shadow: 0 10px 12px rgba(0, 0, 0, 0.8);
}
.search-dropdown.active {
  display: block;
}

.search-dropdown__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.8rem;
  border-bottom: 1px solid rgba(31, 82, 31, 0.3);
  transition:
    background 0.1s,
    color 0.1s;
}
.search-dropdown__item:last-child {
  border-bottom: none;
}
.search-dropdown__item:hover,
.search-dropdown__item.highlighted {
  background: var(--primary);
  color: var(--bg);
  text-shadow: none;
}
.search-dropdown__item:hover .search-dropdown__meta,
.search-dropdown__item.highlighted .search-dropdown__meta {
  color: var(--bg);
}

.search-dropdown__name {
  font-weight: 700;
}
.search-dropdown__meta {
  color: var(--muted);
  font-size: 0.75rem;
}

.search-dropdown__empty {
  padding: 0.75rem;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}
.search-dropdown__request {
  color: var(--secondary);
  text-shadow: var(--text-glow-amber);
}
.search-dropdown__request:hover {
  color: var(--bg);
  background: var(--secondary);
  text-shadow: none;
}

/* --- ASCII Logo --- */
.ascii-logo {
  font-size: 0.55rem;
  line-height: 1.15;
  color: var(--primary);
  text-shadow: var(--text-glow);
  white-space: pre;
  margin-bottom: 0.5rem;
  text-align: center;
  overflow-x: auto;
}

/* --- Info Grid --- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* --- Stat Row --- */
.stat-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.3rem 0;
  font-size: 0.8rem;
  border-bottom: 1px dashed rgba(31, 82, 31, 0.3);
}
.stat-row:last-child {
  border-bottom: none;
}
.stat-row__label {
  color: var(--muted);
  white-space: nowrap;
}
.stat-row__label::after {
  content: ":";
}
.stat-row__value {
  text-shadow: var(--text-glow);
  white-space: nowrap;
}

/* --- Sales Ticker --- */
.ticker-item {
  padding: 0.35rem 0;
  font-size: 0.8rem;
  border-bottom: 1px dashed rgba(31, 82, 31, 0.2);
}
.ticker-item:last-child {
  border-bottom: none;
}
.ticker-item__price {
  color: var(--secondary);
  text-shadow: var(--text-glow-amber);
}

/* --- Player Page --- */
.player-header {
  margin-bottom: 1rem;
}
.player-header__back {
  font-size: 0.8rem;
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.15rem 0.3rem;
}

/* Player Hero Section - Centered large photo with team logo background */
.player-hero {
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  align-items: flex-end;
  margin-bottom: 0;
  position: relative;
}

.player-hero__info-stack {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-bottom: 1rem;
  padding-top: 0.5rem;
  grid-column: 1;
}

.player-hero__name {
  font-size: 1.8rem;
  margin-bottom: 0.25rem;
  line-height: 1.1;
}

.player-hero__meta-item {
  font-size: 0.8rem;
  color: var(--primary);
  line-height: 1.3;
  padding: 0.1rem 0;
}

.player-hero__performance {
  margin-top: 0.75rem;
}

.player-hero__performance .terminal-window {
  margin-bottom: 0;
}

.player-hero__performance .terminal-window__body {
  padding: 0.75rem;
}

.player-hero__label {
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 1px;
  margin-right: 0.5rem;
}

.player-hero__photo-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 280px;
  grid-column: 2;
}

.player-hero__team-logo-bg {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 350px;
  height: 350px;
  background-size: contain;
  background-position: center bottom;
  background-repeat: no-repeat;
  opacity: 0.08;
  filter: blur(8px);
  z-index: 0;
}

.player-hero__photo {
  position: relative;
  z-index: 1;
  width: 325px;
  height: 325px;
  overflow: hidden;
  isolation: isolate;
}

.player-hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: none;
}

.player-hero__flag,
.player-hero__team-logo {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  margin-right: 4px;
  object-fit: contain;
}

/* --- Player Page Tabs --- */
.player-tabs {
  display: flex;
  border: 1px solid var(--border);
  margin-top: 0;
  margin-bottom: 1.5rem;
}

.player-tab-btn {
  padding: 0.45rem 1rem;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  color: var(--muted);
  background: var(--bg);
  border: none;
  border-right: 1px solid var(--border);
  transition:
    background 0.1s,
    color 0.1s;
}
.player-tab-btn:last-child {
  border-right: none;
}
.player-tab-btn:hover {
  color: var(--primary);
  background: rgba(31, 82, 31, 0.12);
}
.player-tab-btn.active {
  color: var(--bg);
  background: var(--primary);
  text-shadow: none;
}

/* --- Score Badges (L5 / L10 / L40) --- */
.score-l-grid {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.score-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.score-badge__label {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
}

.score-badge__value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  padding: 1rem;
  border: none;
  width: 3.5rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 8px;
}

.score-badge__percentage {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  text-shadow: var(--text-glow);
}

/* Score tiers — colors match Sorare score ranges */
.score-badge--elite .score-badge__value {
  color: #ffffff;
  background: #00a749;
  text-shadow: none;
}
.score-badge--good .score-badge__value {
  color: #ffffff;
  background: #24c792;
  text-shadow: none;
}
.score-badge--decent .score-badge__value {
  color: #ffffff;
  background: #b0c623;
  text-shadow: none;
}
.score-badge--average .score-badge__value {
  color: #ffffff;
  background: #d6b614;
  text-shadow: none;
}
.score-badge--poor .score-badge__value {
  color: #ffffff;
  background: #f09b1b;
  text-shadow: none;
}
.score-badge--terrible .score-badge__value {
  color: #ffffff;
  background: #dc1a0f;
  text-shadow: none;
}

/* --- Controls Row (Filter Rows) --- */
.controls-row {
  margin-bottom: 1.5rem;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.filter-group {
  display: flex;
  flex: 1;
  align-items: center;
  border: 1px solid var(--border);
}

.filter-divider {
  width: 1px;
  height: 1.5rem;
  background: var(--muted);
  opacity: 0.5;
}

/* --- Shared Filter Button --- */
.filter-btn {
  flex: 1;
  padding: 0.4rem 0.5rem;
  text-align: center;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  color: var(--muted);
  background: var(--bg);
  border: none;
  border-right: 1px solid var(--border);
  transition:
    background 0.1s,
    color 0.1s;
  white-space: nowrap;
}
.filter-btn:last-child {
  border-right: none;
}
.filter-btn:hover {
  color: var(--primary);
  background: rgba(31, 82, 31, 0.15);
}
.filter-btn.active {
  color: var(--bg);
  background: var(--primary);
  text-shadow: none;
}

/* Scarcity-specific active colors */
.filter-btn.active[data-scarcity="limited"] {
  background: var(--secondary);
}
.filter-btn.active[data-scarcity="rare"] {
  background: #ff3333;
}
.filter-btn.active[data-scarcity="super_rare"] {
  background: #3b82f6;
}
.filter-btn.active[data-scarcity="unique"] {
  background: #a855f7;
}

/* --- Chart Container --- */
.chart-container {
  border: 1px solid var(--border);
  padding: 1rem;
  margin-bottom: 1.5rem;
  position: relative;
  height: 350px;
  overflow: hidden;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
  cursor: crosshair;
}

/* Drag-to-zoom selection overlay */
.chart-zoom-selection {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(51, 255, 0, 0.07);
  border-left: 1px solid rgba(51, 255, 0, 0.45);
  border-right: 1px solid rgba(51, 255, 0, 0.45);
  pointer-events: none;
  z-index: 5;
}

/* Reset button in time-range filter group */
.filter-btn--reset {
  border-left: 1px solid var(--border);
  font-size: 0.85rem;
  line-height: 1;
  transition:
    background 0.1s,
    color 0.1s,
    box-shadow 0.2s,
    text-shadow 0.2s;
}
.filter-btn--reset:hover {
  color: var(--secondary) !important;
  background: rgba(255, 176, 0, 0.1) !important;
}
.filter-btn--reset.zoom-active {
  color: var(--secondary);
  box-shadow:
    0 0 6px rgba(255, 176, 0, 0.35),
    inset 0 0 6px rgba(255, 176, 0, 0.08);
  text-shadow: 0 0 8px rgba(255, 176, 0, 0.6);
}

/* --- Sales Table --- */
.sales-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.sales-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.75rem;
  color: var(--primary);
  text-shadow: var(--text-glow);
}
.sales-table td {
  padding: 0.4rem 0.75rem;
  border-bottom: 1px dashed rgba(31, 82, 31, 0.3);
}
.sales-table tr:hover td {
  background: rgba(31, 82, 31, 0.1);
}

/* --- Top Auctions Quadrants --- */
.auction-quadrants {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.auction-quadrant {
  border: 1px solid;
  padding: 0.75rem;
  text-align: center;
}

.auction-quadrant__header {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.4rem;
}

.auction-quadrant__player {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auction-quadrant__price {
  font-size: 1rem;
  font-weight: 700;
}

.auction-quadrant__usd {
  font-size: 0.7rem;
  margin-top: 0.1rem;
}

.auction-quadrant__meta {
  font-size: 0.7rem;
  margin-top: 0.25rem;
}

/* --- Progress Bar (ASCII style) --- */
.progress-bar {
  font-size: 0.8rem;
}
.progress-bar__fill {
  color: var(--primary);
}
.progress-bar__empty {
  color: var(--muted);
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 0.4rem 1rem;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
  background: var(--bg);
  border: 1px solid var(--primary);
  cursor: pointer;
  transition:
    background 0.1s,
    color 0.1s;
}
.btn:hover {
  background: var(--primary);
  color: var(--bg);
  text-shadow: none;
}
.btn--submit {
  margin-top: 0.5rem;
}

/* --- Filter Sections --- */
.filter-section {
  margin-bottom: 1rem;
}
.filter-section:last-child {
  margin-bottom: 0;
}

.filter-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.filter-checkboxes {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.8rem;
}

.checkbox-label input[type="checkbox"] {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  position: relative;
  transition:
    background 0.1s,
    border-color 0.1s;
}

.checkbox-label input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox-label input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--bg);
  font-size: 12px;
  font-weight: 700;
}

.checkbox-text {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.timeframe-input-wrapper {
  display: flex;
  align-items: center;
}

.timeframe-input {
  width: 100px;
  background: none;
  border: 1px solid var(--border);
  outline: none;
  color: var(--primary);
  font-family: var(--font);
  font-size: 0.85rem;
  padding: 0.4rem 0.5rem;
  caret-color: var(--primary);
  text-shadow: var(--text-glow);
}

.timeframe-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 6px rgba(51, 255, 0, 0.15);
}

/* --- No Data Message --- */
.no-data {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* --- Loading Overlay --- */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.loading-terminal {
  text-align: center;
  font-size: 0.8rem;
}

.loading-terminal__text {
  color: var(--primary);
  text-shadow: var(--text-glow);
  margin-bottom: 0.5rem;
}

.loading-terminal__bar {
  color: var(--muted);
  letter-spacing: 2px;
}

.loading-terminal__bar .filled {
  color: var(--primary);
  text-shadow: var(--text-glow);
}

.loading-terminal__cursor {
  display: inline-block;
  width: 8px;
  background: var(--primary);
  animation: blink 0.6s step-end infinite;
}

/* Wrapper for chart + loading overlay */
.chart-wrapper {
  position: relative;
}

/* --- Animations --- */
@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

/* --- Responsive --- */

/* Tablet breakpoint */
@media (max-width: 1024px) {
  .player-hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .player-hero__info-stack {
    grid-column: 1;
    padding-bottom: 0;
    align-items: center;
    text-align: center;
  }

  .player-hero__photo-container {
    grid-column: 1;
    order: -1;
  }

  .score-l-grid {
    justify-content: center;
  }

  .auction-quadrants {
    grid-template-columns: 1fr;
  }
}

/* Small tablet breakpoint */
@media (max-width: 768px) {
  html {
    font-size: 13px;
  }

  .top-bar {
    padding: 0.5rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .top-bar__left {
    flex: 1;
    min-width: 0;
  }

  .top-bar__logo {
    font-size: 0.85rem;
    letter-spacing: 2px;
  }

  .top-bar__right {
    gap: 0.5rem;
  }

  .top-bar__link {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
  }

  #app {
    padding: 1rem;
    max-width: 100%;
  }

  .terminal-window__body {
    padding: 0.75rem;
  }

  .player-tabs {
    flex-wrap: wrap;
  }

  .player-tab-btn {
    flex: 1 1 auto;
    min-width: 80px;
    font-size: 0.7rem;
    padding: 0.4rem 0.5rem;
  }

  .controls-row {
    margin-bottom: 1rem;
  }

  .filter-group {
    flex-wrap: wrap;
  }

  .chart-container {
    height: 280px;
    padding: 0.5rem;
  }

  .sales-table {
    font-size: 0.75rem;
    display: block;
    overflow-x: auto;
  }

  .sales-table thead {
    display: none;
  }

  .sales-table tbody,
  .sales-table tr {
    display: block;
  }

  .sales-table tr {
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    padding: 0.75rem;
  }

  .sales-table td {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border: none;
  }

  .sales-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    font-size: 0.7rem;
  }

  .next-games-wrapper {
    flex-direction: column;
  }

  #next-games-averages {
    width: 100%;
    flex-direction: row;
    justify-content: space-around;
  }
}

/* Mobile breakpoint */
@media (max-width: 640px) {
  html {
    font-size: 12px;
  }

  .top-bar {
    padding: 0.5rem 0.75rem;
  }

  .top-bar__logo {
    font-size: 0.75rem;
    letter-spacing: 1px;
  }

  #app {
    padding: 0.75rem;
  }

  .ascii-logo {
    font-size: 0.35rem;
  }

  .info-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .filter-row {
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .filter-btn {
    font-size: 0.65rem;
    padding: 0.3rem 0.4rem;
    letter-spacing: 0;
  }

  .filter-divider {
    display: none;
  }

  .chart-container {
    height: 240px;
    padding: 0.5rem;
  }

  .footer {
    padding: 0.5rem 0.75rem 0.75rem;
  }

  .footer__content {
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.65rem;
  }

  .top-bar__search {
    display: none;
  }

  .top-bar__status {
    display: none;
  }

  .player-hero {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
  }

  .player-hero__info-stack {
    grid-column: 1;
    width: 100%;
    padding-bottom: 0;
    align-items: center;
    text-align: center;
  }

  .player-hero__name {
    font-size: 1.3rem;
  }

  .player-hero__meta-item {
    font-size: 0.75rem;
  }

  .player-hero__photo-container {
    grid-column: 1;
    min-height: 180px;
    order: -1;
  }

  .player-hero__photo {
    width: 180px;
    height: 180px;
  }

  .player-hero__team-logo-bg {
    width: 220px;
    height: 220px;
  }

  .score-l-grid {
    gap: 1rem;
    justify-content: center;
  }

  .score-badge__value {
    width: 3rem;
    height: 3rem;
    font-size: 1.3rem;
  }

  .player-tab-btn {
    font-size: 0.65rem;
    padding: 0.35rem 0.4rem;
  }

  h1 {
    font-size: 1.3rem;
  }

  h2 {
    font-size: 1.1rem;
  }

  h3 {
    font-size: 0.9rem;
  }

  .terminal-window__header {
    font-size: 0.75rem;
    padding: 0.35rem 0.6rem;
  }

  .terminal-window__body {
    padding: 0.75rem;
  }

  .stat-row {
    font-size: 0.75rem;
    flex-wrap: wrap;
  }

  .btn {
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
  }
}

/* ============================================================
   BACKFILL COMPONENT
   ============================================================ */

.backfill-prompt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  background: rgba(31, 82, 31, 0.2);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.backfill-prompt__text {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.backfill-prompt__btn {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 0.4rem 1rem;
  font-family: var(--font);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.backfill-prompt__btn:hover {
  background: var(--primary);
  color: var(--bg);
  text-shadow: none;
  box-shadow: 0 0 10px rgba(51, 255, 0, 0.5);
}

/* Backfill Modal */
.backfill-modal {
  max-width: 600px;
}

.backfill-modal .terminal-window__header {
  color: #1a1a1a;
}

.backfill-modal__info {
  font-size: 0.9rem;
}

.backfill-modal__info ul {
  list-style-type: none;
}

.backfill-modal__info ul li {
  position: relative;
  padding-left: 1rem;
  margin-bottom: 0.5rem;
}

.backfill-modal__info ul li::before {
  content: ">";
  position: absolute;
  left: 0;
  color: #1a1a1a;
}

.backfill-modal__actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.backfill-modal__btn {
  flex: 1;
  padding: 0.75rem 1.5rem;
  font-family: var(--font);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid;
}

.backfill-modal__btn--primary {
  background: var(--primary);
  color: var(--bg);
  border-color: var(--primary);
}

.backfill-modal__btn--primary:hover:not(:disabled) {
  box-shadow: 0 0 15px rgba(51, 255, 0, 0.6);
  transform: translateY(-1px);
}

.backfill-modal__btn--primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.backfill-modal__btn--secondary {
  background: transparent;
  color: var(--muted);
  border-color: var(--muted);
}

.backfill-modal__btn--secondary:hover:not(:disabled) {
  background: rgba(31, 82, 31, 0.2);
  color: var(--primary);
  border-color: var(--primary);
}

.backfill-modal__btn--secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.backfill-modal__status {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* Backfill Status States */
.backfill-status {
  text-align: center;
  padding: 1.5rem;
}

.backfill-status__icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.backfill-status__title {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: #1a1a1a;
}

.backfill-status__message {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.backfill-status__detail {
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
}

.backfill-status--loading {
  color: #1a1a1a;
}

.backfill-status--loading .backfill-status__icon {
  display: none;
}

.backfill-status--loading .loading-terminal__text {
  color: #1a1a1a;
}

.backfill-status--success .backfill-status__icon {
  color: #1a1a1a;
}

.backfill-status--error .backfill-status__icon {
  color: var(--error);
}

.backfill-status--error .backfill-status__title {
  color: var(--error);
}

.backfill-status__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
  padding: 1rem;
  background: rgba(31, 82, 31, 0.1);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.backfill-stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.backfill-stat__label {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.backfill-stat__value {
  color: #1a1a1a;
  font-size: 1.5rem;
  font-weight: bold;
}

@media (max-width: 768px) {
  .backfill-modal {
    max-width: 90vw;
  }

  .backfill-modal__actions {
    flex-direction: column;
  }

  .backfill-status__stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Team Filter Dropdown (Custom) --- */
.team-filter-dropdown {
  min-width: 200px;
  flex: 0 0 auto;
  position: relative;
}

.team-filter-custom {
  position: relative;
  width: 100%;
}

.team-filter-selected {
  width: 100%;
  background: rgba(84, 84, 84, 0.15);
  border: none;
  outline: none;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.4rem 0.5rem;
  padding-right: 2rem;
  cursor: pointer;
  text-shadow: none;
  transition:
    background 0.1s,
    color 0.1s;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-filter-selected::after {
  content: "";
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid var(--muted);
  transition:
    border-color 0.1s,
    transform 0.2s;
}

.team-filter-selected:hover {
  color: var(--primary);
  background-color: rgba(31, 82, 31, 0.3);
}

.team-filter-selected:hover::after {
  border-top-color: var(--primary);
}

.team-filter-custom.open .team-filter-selected {
  color: var(--primary);
  text-shadow: var(--text-glow);
}

.team-filter-custom.open .team-filter-selected::after {
  border-top-color: var(--primary);
  transform: translateY(-50%) rotate(180deg);
}

.team-filter-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: none;
  max-height: 300px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.team-filter-custom.open .team-filter-options {
  display: block;
}

.team-filter-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  text-shadow: var(--text-glow);
  border-bottom: 1px solid rgba(31, 82, 31, 0.3);
  transition:
    background 0.1s,
    color 0.1s;
}

.team-filter-option:last-child {
  border-bottom: none;
}

.team-filter-option:hover {
  background: var(--primary);
  color: var(--bg);
  text-shadow: none;
}

.team-filter-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

@media (max-width: 640px) {
  .team-filter-dropdown {
    min-width: 150px;
  }

  .team-filter-selected {
    font-size: 0.65rem;
    padding: 0.3rem 0.4rem;
    padding-right: 1.5rem;
  }

  .team-filter-option {
    font-size: 0.65rem;
    padding: 0.4rem 0.5rem;
  }
}

/* --- Compact Filter Box --- */
.compact-filter-box {
  display: inline-flex;
  background: rgba(31, 82, 31, 0.15);
  border: 1px solid var(--primary);
  box-shadow: 0 0 8px rgba(51, 255, 0, 0.15);
  padding: 0.25rem;
  width: fit-content;
}

.compact-filter-group {
  display: flex;
  align-items: center;
  gap: 0;
}

.compact-filter-btn {
  padding: 0.35rem 0.75rem;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  border: none;
  transition:
    background 0.1s,
    color 0.1s;
  white-space: nowrap;
}

.compact-filter-btn:hover {
  color: var(--primary);
  background: rgba(31, 82, 31, 0.2);
}

.compact-filter-btn.active {
  color: var(--bg);
  background: var(--primary);
  text-shadow: none;
}

.compact-filter-separator {
  width: 1px;
  height: 1.2rem;
  background: var(--primary);
  opacity: 0.3;
  margin: 0 0.5rem;
}

@media (max-width: 640px) {
  .compact-filter-box {
    padding: 0.2rem;
  }

  .compact-filter-btn {
    font-size: 0.65rem;
    padding: 0.3rem 0.5rem;
  }

  .compact-filter-separator {
    margin: 0 0.3rem;
  }
}

/* --- Score Summary Section --- */
.score-summary-container {
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1.5rem;
  align-items: stretch;
}

.score-summary-card {
  display: flex;
  flex-direction: column;
  background: rgba(105, 105, 105, 0.15);
  border: none;
  padding: 1.5rem;
  gap: 1rem;
  min-height: 140px;
  flex: 0 0 33%;
}

.score-summary-left {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  background: rgba(105, 105, 105, 0.15);
  padding: 0.5rem;
  border-radius: 8px;
}

.score-summary-label {
  font-size: 0.85rem;
  color: #cfcfcf;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.score-summary-games {
  font-size: 0.75rem;
  color: #a0a0a0;
  text-shadow: none;
  font-weight: 700;
}

.score-summary-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  text-align: center;
}

.score-summary-gauge-svg {
  width: 140px;
  height: 80px;
  display: block;
}

.score-summary-gauge-bg {
  fill: none;
  stroke: rgba(31, 82, 31, 0.3);
  stroke-width: 8;
  stroke-linecap: round;
}

.score-summary-gauge-fill {
  fill: none;
  stroke: #2e7d32;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
}

.score-summary-gauge-text {
  font-size: 2rem;
  font-weight: 700;
  color: #ffffff;
  /* text-shadow: var(--text-glow); */
  margin: -40px 0 4px;
  position: relative;
  z-index: 1;
}

.score-summary-gauge-subtext {
  font-size: 0.7rem;
  color: #a0a0a0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.score-summary-top-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 2rem;
}

.score-summary-bottom-row {
  display: flex;
  align-items: center;
  justify-content: center;
}

.score-summary-events {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #a0a0a0;
  text-shadow: none;
  font-weight: 700;
}

.score-summary-event-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
}

.score-summary-event-item--starter {
  background: var(--status-starter-bg);
  color: var(--status-starter-text);
}

.score-summary-event-item--sub {
  background: var(--status-sub-bg);
  color: var(--status-sub-text);
}

.score-summary-event-item--bench {
  background: var(--status-bench-bg);
  color: var(--status-bench-text);
}

.score-summary-event-item--dnp {
  background: var(--status-dnp-bg);
  color: var(--status-dnp-text);
}

.score-summary-events img {
  width: 16px;
  height: 16px;
}

/* Apply icon colors using CSS filters */
.score-summary-event-item--starter img {
  filter: brightness(0) saturate(100%) invert(47%) sepia(98%) saturate(1234%)
    hue-rotate(188deg) brightness(98%) contrast(93%);
}

.score-summary-event-item--sub img {
  filter: brightness(0) saturate(100%) invert(65%) sepia(53%) saturate(1066%)
    hue-rotate(340deg) brightness(98%) contrast(92%);
}

.score-summary-event-item--bench img,
.score-summary-event-item--dnp img {
  filter: brightness(0) saturate(100%) invert(26%) sepia(96%) saturate(3318%)
    hue-rotate(356deg) brightness(95%) contrast(95%);
}

.score-summary-right {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: center;
  justify-content: center;
  background: rgba(105, 105, 105, 0.15);
  padding: 0.2rem;
  border-radius: 8px;
}

.score-summary-score-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.score-summary-score-label {
  font-size: 1rem;
  color: #cfcfcf;
  font-weight: 700;
  text-transform: uppercase;
}

.score-summary-score-value {
  font-size: 1rem;
  font-weight: 700;
  color: #c7c7c7;
  text-shadow: none;
}

.score-summary-decisive {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: rgba(105, 105, 105, 0.15);
  padding: 1rem;
  border-radius: 8px;
  flex: 0 0 25%;
  justify-content: center;
  align-items: center;
}

.score-summary-decisive-title {
  font-size: 0.75rem;
  color: #cfcfcf;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  margin-bottom: 0.25rem;
}

.score-summary-decisive-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  column-gap: 2rem;
  row-gap: 1rem;
  align-items: center;
}

.decisive-action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

/* Top row items - each spans 2 columns */
.decisive-action-item:nth-child(1) {
  grid-column: 1 / 3;
}
.decisive-action-item:nth-child(2) {
  grid-column: 3 / 5;
}
.decisive-action-item:nth-child(3) {
  grid-column: 5 / 7;
}
.decisive-action-item:nth-child(4) {
  grid-column: 7 / 9;
}
.decisive-action-item:nth-child(5) {
  grid-column: 9 / 11;
}

/* Bottom row items - each spans 2 columns, offset to center */
.decisive-action-item:nth-child(6) {
  grid-column: 2 / 4;
}
.decisive-action-item:nth-child(7) {
  grid-column: 4 / 6;
}
.decisive-action-item:nth-child(8) {
  grid-column: 6 / 8;
}
.decisive-action-item:nth-child(9) {
  grid-column: 8 / 10;
}

.decisive-action-item img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  padding: 0.2rem;
  box-sizing: content-box;
}

.decisive-action-count {
  font-size: 0.85rem;
  font-weight: 700;
  color: #c7c7c7;
}

.score-distribution {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: rgba(105, 105, 105, 0.15);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  flex: 1;
}

.score-distribution-title {
  font-size: 0.75rem;
  color: #cfcfcf;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  margin-bottom: 0.25rem;
}

.score-distribution-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  height: 120px;
}

.score-bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
}

.score-bar-wrapper {
  width: 100%;
  height: 100px;
  display: flex;
  align-items: flex-end;
  position: relative;
}

.score-bar {
  width: 100%;
  transition: height 0.3s ease;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.score-bar-dnp {
  background: #888888;
}

.score-bar-0-10 {
  background: #dc1a0f;
}

.score-bar-10-20 {
  background: #dc1a0f;
}

.score-bar-20-30 {
  background: #f09b1b;
}

.score-bar-30-40 {
  background: #d6b614;
}

.score-bar-40-50 {
  background: #b0c623;
}

.score-bar-50-60 {
  background: #b0c623;
}

.score-bar-60-70 {
  background: #24c792;
}

.score-bar-70-80 {
  background: #24c792;
}

.score-bar-80-90 {
  background: #00a749;
}

.score-bar-90-100 {
  background: #00a749;
}

.score-bar-label {
  font-size: 0.65rem;
  color: #cfcfcf;
  text-align: center;
  white-space: nowrap;
}

.score-bar-count {
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
  position: absolute;
  width: 100%;
}

@media (max-width: 768px) {
  .score-summary-container {
    flex-direction: column;
  }

  .score-summary-card {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1rem;
  }

  .score-summary-left,
  .score-summary-right {
    align-items: center;
    text-align: center;
  }

  .score-summary-right {
    flex-direction: row;
    justify-content: center;
  }

  .score-summary-decisive {
    width: 100%;
  }

  .score-summary-decisive-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .score-distribution {
    width: 100%;
  }

  .score-distribution-chart {
    gap: 0.15rem;
  }
}

/* --- Icon Filter Group (Status & Venue) --- */
.icon-filter-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(105, 105, 105, 0.15);
  padding: 0.5rem;
  border-radius: 4px;
}

.icon-filter-btn {
  padding: 0.2rem 0.3rem;
  cursor: pointer;
  background: transparent;
  border: none;
  transition: opacity 0.1s;
  white-space: nowrap;
  opacity: 0.1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

/* Starter button - blue background */
.icon-filter-btn[data-status="starter"] {
  background: var(--status-starter-bg);
}

/* Sub button - orange background */
.icon-filter-btn[data-status="sub"] {
  background: var(--status-sub-bg);
}

/* Bench button - light red/pink background */
.icon-filter-btn[data-status="bench"] {
  background: var(--status-bench-bg);
}

/* DNP button - light red/pink background */
.icon-filter-btn[data-status="dnp"] {
  background: var(--status-dnp-bg);
}

/* Home button - blue background */
.icon-filter-btn[data-venue="home"] {
  background: var(--venue-home-bg);
}

/* Away button - yellow/gold background */
.icon-filter-btn[data-venue="away"] {
  background: var(--venue-away-bg);
}

.icon-filter-img {
  width: 16px;
  height: 16px;
  display: block;
  object-fit: contain;
}

/* Apply icon colors using CSS filters */
.icon-filter-btn[data-status="starter"] .icon-filter-img {
  filter: brightness(0) saturate(100%) invert(47%) sepia(98%) saturate(1234%)
    hue-rotate(188deg) brightness(98%) contrast(93%);
}

.icon-filter-btn[data-status="sub"] .icon-filter-img {
  filter: brightness(0) saturate(100%) invert(65%) sepia(53%) saturate(1066%)
    hue-rotate(340deg) brightness(98%) contrast(92%);
}

.icon-filter-btn[data-status="bench"] .icon-filter-img,
.icon-filter-btn[data-status="dnp"] .icon-filter-img {
  filter: brightness(0) saturate(100%) invert(26%) sepia(96%) saturate(3318%)
    hue-rotate(356deg) brightness(95%) contrast(95%);
}

.icon-filter-btn[data-venue="home"] .icon-filter-img,
.icon-filter-btn[data-venue="away"] .icon-filter-img {
  filter: brightness(0) invert(1);
}

.icon-filter-btn {
  opacity: 0.2;
}

.icon-filter-btn:hover {
  opacity: 0.5;
}

.icon-filter-btn.active {
  opacity: 1;
}

.icon-filter-btn.active:hover {
  opacity: 0.85;
}

.icon-filter-separator {
  width: 1px;
  height: 1.2rem;
  background: var(--muted);
  opacity: 0.3;
  margin: 0 0.5rem;
}

@media (max-width: 640px) {
  .icon-filter-group {
    gap: 0.2rem;
  }

  .icon-filter-btn {
    font-size: 0.6rem;
    padding: 0.3rem 0.4rem;
  }

  .icon-filter-separator {
    margin: 0 0.3rem;
  }
}

/* ============================================================
   NEXT GAMES - Horizontal Scrollable Layout
   ============================================================ */

.next-games-wrapper {
  display: flex;
  gap: 2rem;
  align-items: stretch;
}

#next-games-container {
  flex: 1;
  min-width: 0;
  border-radius: 4px;
  overflow: hidden;
}

#next-games-averages {
  flex: 0 0 auto;
  width: 15%;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: rgba(105, 105, 105, 0.15);
  padding: 1rem;
  border-radius: 4px;
  justify-content: center;
  align-items: center;
  align-self: stretch;
}

.next-games-average-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.next-games-average-label {
  font-size: 0.65rem;
  color: #cfcfcf;
  text-align: center;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.next-games-scroll {
  display: flex;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.next-games-scroll::-webkit-scrollbar {
  display: none;
}

.next-game-card {
  flex: 0 0 auto;
  width: 230px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: rgba(105, 105, 105, 0.15);
  border: none;
  border-radius: 0;
  font-family: var(--font-mono);
}

.next-game-header {
  font-size: 0.7rem;
  color: #cfcfcf;
  text-align: center;
  line-height: 1;
  min-height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(105, 105, 105, 0.2);
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
}

.next-game-logo {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.next-game-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.next-game-team {
  font-size: 0.85rem;
  font-weight: 700;
  color: #cfcfcf;
  text-align: center;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.next-game-venue-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  padding: 1px;
  border-radius: 3px;
}

.next-game-venue-icon[src*="home_game"] {
  background: var(--venue-home-bg);
}

.next-game-venue-icon[src*="away_game"] {
  background: var(--venue-away-bg);
}

.next-game-power-rank {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid;
  border-radius: 4px;
  font-size: 1.2rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.2);
}
