:root{
  --bg:#f5f6f7;
  --card:#ffffff;
  --text:#1f2937;
  --muted:#6b7280;
  --line:#e5e7eb;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.06);
  --blue:#2563eb;
  --green:#16a34a;
  --red:#dc2626;
  --gray:#6b7280;

  /* Team theming (primary only) — set by JS on player pages */
  --team-primary:#0b1220;
  --team-primary-rgb: 11,18,32;

  /* Player-page dark grey background ONLY */
  --player-bg:#0f1115;

  /* ConTrack brand bg */
  --brand-bg: #091324;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background:var(--bg);
  color:var(--text);
}

.container{max-width:1100px;margin:0 auto;padding:0 16px}
.muted{color:var(--muted)}
.hidden{display:none}

.topbar{
  background:var(--card);
  border-bottom:1px solid var(--line);
}
.topbar-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 0;
}
.brand-title{font-weight:800;letter-spacing:.2px}
.brand-sub{font-size:12px;color:var(--muted);margin-top:2px}
.brand-link{color:inherit;text-decoration:none}

.nav{display:flex;gap:12px}
.nav-link{
  font-size:14px;
  color:var(--muted);
  text-decoration:none;
  padding:8px 10px;
  border-radius:10px;
}
.nav-link:hover{background:#f3f4f6;color:var(--text)}
.nav-link.active{color:var(--text);font-weight:700}

.hero{padding:18px 0}
.hero h1{margin:0 0 6px 0;font-size:28px}
.hero p{margin:0}

.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:14px;
  box-shadow:var(--shadow);
  overflow:hidden;
}
.card-header{
  padding:14px 16px;
  border-bottom:1px solid var(--line);
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
}
.card-title{margin:0;font-size:16px;font-weight:800}
.card-subtitle{margin:4px 0 0 0;font-size:13px}
.card-body{padding:16px}

.table-wrap{overflow:auto}
.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  min-width:760px;
}
.table th, .table td{
  padding:12px 12px;
  border-bottom:1px solid var(--line);
  font-size:14px;
  vertical-align:middle;
}
.table th{
  text-align:left;
  color:var(--muted);
  font-weight:700;
  background:#fafafa;
}
.table tr:hover td{background:#fcfcfd}
.table td.num, .table th.num{text-align:right; font-variant-numeric: tabular-nums}
.table a{color:var(--blue);text-decoration:none;font-weight:700}
.table a:hover{text-decoration:underline}

.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  font-weight:800;
  font-size:12px;
  border:1px solid var(--line);
  background:#fafafa;
}
.badge.under{color:var(--green);border-color:rgba(22,163,74,.25);background:rgba(22,163,74,.08)}
.badge.fair{color:var(--gray);border-color:rgba(107,114,128,.25);background:rgba(107,114,128,.08)}
.badge.over{color:var(--red);border-color:rgba(220,38,38,.25);background:rgba(220,38,38,.08)}

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

.kv{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px 14px;
}
.kv .k{color:var(--muted);font-size:12px}
.kv .v{font-weight:800}

.btn-row{display:flex;gap:10px;align-items:center;margin-top:12px}
.btn{
  appearance:none;
  border:1px solid var(--line);
  background:var(--blue);
  color:white;
  border-radius:12px;
  padding:10px 12px;
  font-weight:800;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:13px;
}
.btn:hover{filter:brightness(.95)}
.btn-ghost{
  background:transparent;
  color:var(--text);
}
.btn-ghost:hover{background:#f3f4f6}

.footer{padding:18px 0; font-size:12px}

.prose h2{margin:0 0 10px 0}
.prose h3{margin:16px 0 8px 0}
.prose p{margin:8px 0; line-height:1.55}
.prose ul{margin:8px 0 8px 18px}
.prose li{margin:6px 0; line-height:1.5}

.share-card{
  border:1px solid var(--line);
  border-radius:16px;
  padding:16px;
  background:#fff;
  box-shadow:var(--shadow);
}
.share-top{display:flex;flex-direction:column;gap:2px}
.share-title{font-size:20px;font-weight:900}
.share-sub{font-size:13px;color:var(--muted);font-weight:700}
.share-mid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:12px;margin-top:14px}
.share-metric{
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px;
  background:#fafafa;
}
.share-label{font-size:12px}
.share-value{font-size:18px;font-weight:900;margin-top:6px; font-variant-numeric: tabular-nums}
.share-bottom{display:flex;gap:10px;align-items:center;margin-top:14px}
.share-take{font-size:13px;font-weight:700;color:var(--text)}
.share-foot{margin-top:12px;font-size:11px}

.prose h2 { margin: 0 0 12px 0; font-size: 18px; font-weight: 900; }
.prose h3 { margin: 18px 0 10px 0; font-size: 15px; font-weight: 900; }
.prose p { margin: 10px 0; line-height: 1.65; }
.prose ul { margin: 10px 0 10px 20px; }
.prose li { margin: 8px 0; line-height: 1.6; }
.prose strong { font-weight: 900; }
.prose em { font-style: italic; }
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  padding: 2px 6px;
  border-radius: 8px;
}

/* =========================
   Team accents (player page)
   Only: player name + left accents
   ========================= */

/* player pages: keep same light bg as site (clean) */
body.team-themed{
  background: var(--bg);
  color: var(--text);
}

/* Team color ONLY on the player's name */
body.team-themed #playerHero h1{
  color: var(--team-primary);
}

/* ✅ Team color on left accents of cards */
body.team-themed .card{
  border-left: 6px solid rgba(var(--team-primary-rgb), 0.85);
}

/* Share card left accent only */
body.team-themed .share-card{
  border-left: 6px solid rgba(var(--team-primary-rgb), 0.85);
}
body.team-themed .share-card .share-title{
  color: var(--team-primary);
}

/* =========================
   ConTrack brand topbar
   ========================= */

.topbar.topbar--brand{
  background: var(--brand-bg);
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.topbar.topbar--brand .brand-link{
  display:flex;
  align-items:center;
  text-decoration:none;
}

.topbar.topbar--brand .brand-logo{
  height: 34px;
  width: auto;
  display:block;
}

.topbar.topbar--brand .nav-link{
  color: rgba(255,255,255,0.82);
}

.topbar.topbar--brand .nav-link:hover{
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.95);
}

.topbar.topbar--brand .nav-link.active{
  color: rgba(255,255,255,0.95);
  font-weight:700;
}

/* =========================
   Player page: Percentile + Evaluation badge
   (supports --pct-color + --eval-color from JS)
   ========================= */

.eval-badge-lg{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 1000;
  font-size: 13px;
  letter-spacing:.3px;
  min-width: 84px;
  background: var(--eval-color, rgba(0,0,0,0.03));
  border: 1px solid rgba(0,0,0,0.12);
  color: #111827;
  text-transform: uppercase;
}
.eval-badge-lg.is-missing{
  background: rgba(107,114,128,.10);
  border-color: rgba(107,114,128,.18);
  color: rgba(17,24,39,.75);
}

.pct-track{
  position: relative;
  height: 14px;
  border-radius: 999px;
  margin-top: 10px;
  border: 1px solid rgba(0,0,0,0.10);
  overflow: visible;

  /* ✅ Red -> Neutral -> Green */
  background: linear-gradient(90deg,
    rgba(220, 38, 38, 0.95) 0%,
    rgba(245, 245, 245, 1.00) 50%,
    rgba(22, 163, 74, 0.95) 100%
  );
}

.pct-fill{
  position:absolute;
  left:0; top:0; bottom:0;
  width: var(--pct-fill, 0%);
  border-radius: 999px;
  background: var(--pct-color, rgba(107,114,128,0.35));
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
  transition: width 650ms cubic-bezier(.2,.9,.2,1);
}

.pct-marker{
  position:absolute;
  top:50%;
  left: var(--pct-left, 0%);
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #ffffff;
  border: 4px solid var(--pct-color, rgba(107,114,128,0.85));
  box-shadow: 0 10px 18px rgba(0,0,0,.24);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 1000;
  font-size: 14px;
  color: #111827;
  transition: left 650ms cubic-bezier(.2,.9,.2,1);
}
.pct-marker.is-missing{
  opacity: 0.78;
  border-color: rgba(107,114,128,0.9);
}
/* =========================
   News / Trending (Index)
   ========================= */

.news-strip{
  margin-top: 14px;
}

.news-head{
  display:flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.news-title{
  font-size: 14px;
  font-weight: 900;
  margin: 0;
}

.news-sub{
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.news-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

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

.news-card{
  display:flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow:hidden;
  background: #fff;
  box-shadow: var(--shadow);
  text-decoration:none;
  color: inherit;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.news-card:hover{
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(0,0,0,.12);
  border-color: rgba(0,0,0,0.16);
}

.news-img{
  width:100%;
  height: 130px;
  object-fit: cover;
  display:block;
  background: #f3f4f6;
}

.news-body{
  padding: 12px 12px 14px 12px;
}

.news-card-title{
  font-size: 13px;
  font-weight: 950;
  line-height: 1.2;
  margin: 0;
}

.news-card-desc{
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.35;
}

/* News article page */
.news-hero-img{
  width: 100%;
  height: 240px;
  border-radius: 16px;
  object-fit: cover;
  display:block;
  margin-bottom: 14px;
  border: 1px solid var(--line);
}
/* =========================
   Trending (Index) — Savant-ish
   ========================= */

.news-strip{
  margin-top: 14px;
}

.news-head-center{
  text-align:center;
  font-weight: 1000;
  letter-spacing: .28em;
  font-size: 12px;
  color: rgba(0,0,0,0.70);
  margin: 6px 0 12px 0;
}

.news-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

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

.news-card{
  display:flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow:hidden;
  background: #fff;
  box-shadow: var(--shadow);
  text-decoration:none;
  color: inherit;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.news-card:hover{
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(0,0,0,.12);
  border-color: rgba(0,0,0,0.16);
}

.news-img{
  width:100%;
  height: 130px;
  object-fit: cover;
  vertical-align: top;
  display:block;
  background: #f3f4f6;
}

.news-body{
  padding: 12px 12px 14px 12px;
}

.news-card-desc{
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}
/* Slightly raise image 2 and 3 in Trending */

.news-grid .news-card:nth-child(2) .news-img,
.news-grid .news-card:nth-child(3) .news-img{
  object-position: center -5px;
}
/* =========================
   INDEX PAGE – WIDER LAYOUT
   ========================= */

/* Reduce left/right margins ONLY on index */
.container-wide{
  max-width: 1440px;        /* was 1100px */
  padding-left: 8px;        /* was 16px */
  padding-right: 8px;
}

/* Filters layout cleanup */
.filters-row{
  display:grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr auto;
  gap:12px;
  align-items:end;
}

.filters-row label{
  display:block;
  font-size:12px;
  font-weight:800;
  color: var(--muted);
  margin-bottom:6px;
}

.filters-row input,
.filters-row select{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#fff;
}

/* Tighten hero spacing */
.hero-tight{
  padding: 10px 0 8px 0;
}

/* Mobile adjustments */
@media (max-width: 900px){
  .container-wide{
    padding-left: 6px;
    padding-right: 6px;
  }

  .filters-row{
    grid-template-columns: 1fr;
  }
}
/* =========================
   Index Table – Evaluation Column Spacing
   ========================= */

/* Give Evaluation its own visual lane */
.table th:last-child,
.table td:last-child{
  padding-left: 28px;   /* space from Contract Type */
  padding-right: 22px; /* space from right edge */
}

/* Ensure pills don’t feel cramped */
.table td:last-child .badge{
  margin-left: 2px;
}
/* =========================
   FORCE spacing for Evaluation column (8th column)
   ========================= */

/* Evaluation header + cells */
.table thead th:nth-child(8),
.table tbody td:nth-child(8){
  padding-left: 34px !important;   /* space away from Contract Type */
  padding-right: 26px !important;  /* space from right edge */
}

/* TEMP DEBUG: shows a divider so you can SEE it working */
.table thead th:nth-child(8),
.table tbody td:nth-child(8){
  border-left: 1px solid rgba(0,0,0,0.12) !important;
}
/* =========================
   SPOTRAC-ISH DENSE INDEX TABLE (A + B)
   index page only
   ========================= */

.page-index .hero-tight{
  padding: 6px 0 6px 0 !important;
}
.page-index .hero-tight h1{
  font-size: 20px;
  margin: 0 0 2px 0;
}
.page-index .hero-tight p{
  margin: 0;
  font-size: 12px;
}

/* tighter card chrome */
.page-index .card-header{ padding: 8px 10px; }
.page-index .card-body{ padding: 8px 10px; }

/* filters compact */
.page-index .filters-row{
  gap: 8px !important;
}
.page-index .filters-row label{
  font-size: 11px !important;
  margin-bottom: 3px !important;
  font-weight: 900 !important;
  letter-spacing: .02em;
}
.page-index .filters-row input,
.page-index .filters-row select{
  padding: 7px 10px !important;
  border-radius: 10px !important;
  font-size: 12.5px !important;
  height: 34px;
}
.page-index #clearFilters{
  height: 34px !important;
  padding: 7px 10px !important;
  border-radius: 10px !important;
  font-size: 12.5px !important;
}

/* table density */
.page-index .table{
  min-width: 980px;
}
.page-index .table th,
.page-index .table td{
  padding: 6px 10px !important;      /* tighter rows (A) */
  font-size: 12.5px !important;      /* smaller text (A) */
  line-height: 1.15 !important;
  border-bottom: 1px solid rgba(0,0,0,0.06) !important;
  vertical-align: middle;
}

/* sticky header like data sites */
.page-index .table th{
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc !important;
  color: rgba(0,0,0,0.62) !important;
  font-weight: 900 !important;
  letter-spacing: .02em;
  border-bottom: 1px solid rgba(0,0,0,0.12) !important;
  user-select: none;
  white-space: nowrap;
}

/* zebra */
.page-index .table tbody tr:nth-child(2n) td{
  background: rgba(0,0,0,0.012);
}

/* subtle hover */
.page-index .table tr:hover td{
  background: rgba(37,99,235,0.055) !important;
}

/* links: more “data-table” */
.page-index .table a{
  font-weight: 900 !important;
  text-decoration: none !important;
}
.page-index .table a:hover{
  text-decoration: underline !important;
}

/* numeric columns: tabular + tighter */
.page-index .table td.num,
.page-index .table th.num{
  text-align: right;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* compact evaluation pills */
.page-index .badge{
  padding: 3px 8px !important;
  font-size: 10.8px !important;
  font-weight: 950 !important;
  border-radius: 999px !important;
  line-height: 1 !important;
}

/* Sortable headers (C) */
.page-index .table th.sortable{
  cursor: pointer;
}
.page-index .table th.sortable:hover{
  color: rgba(0,0,0,0.80) !important;
}

/* tiny sort indicator */
.page-index .sort-icon{
  display: inline-block;
  width: 10px;
  margin-left: 6px;
  opacity: 0.55;
  transform: translateY(-1px);
}
.page-index .table th.sortable.is-sorted .sort-icon{
  opacity: 0.95;
}
.page-index .table th.sortable.sort-asc .sort-icon::before{
  content: "▲";
  font-size: 9px;
}
.page-index .table th.sortable.sort-desc .sort-icon::before{
  content: "▼";
  font-size: 9px;
}

/* mobile: stack filters but stay compact */
@media (max-width: 900px){
  .page-index .filters-row{ grid-template-columns: 1fr !important; }
  .page-index .table{ min-width: 820px; }
}
/* =========================
   Evaluation Pills (Spotrac-style)
   ========================= */

.eval-pill{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.10);
  font-weight: 900;
  font-size: 13px;
  color: #0b1220;
  white-space: nowrap;
}

/* Icon circle */
.eval-pill .icon{
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
}

/* Overpaid */
.eval-pill.over .icon{
  background: #f59e0b; /* amber */
}
.eval-pill.over .icon::before{
  content: "➜";
}

/* Significant / Underpaid */
.eval-pill.under .icon{
  background: #22c55e; /* green */
}
.eval-pill.under .icon::before{
  content: "↗";
}

/* Fair */
.eval-pill.fair .icon{
  background: #9ca3af; /* gray */
}
.eval-pill.fair .icon::before{
  content: "•";
  font-size: 18px;
}

/* Smaller version for dense tables */
.page-index .eval-pill{
  padding: 6px 12px 6px 8px;
  font-size: 12px;
}
.page-index .eval-pill .icon{
  width: 22px;
  height: 22px;
  font-size: 13px;
}
