/* =============================================================
   RTSports — Shared Stylesheet  (HTML-file design language)
   ============================================================= */

/* ── DESIGN TOKENS — DARK MODE (default) ── */
:root {
  --red:      #C8102E;
  --red-dark: #9B0C22;
  --red-glow: rgba(200,16,46,0.25);
  --green:    #22c55e;

  --bg:       #0d0f14;
  --surface:  #13161e;
  --surface2: #1a1e28;
  --border:   rgba(255,255,255,0.07);
  --border2:  rgba(255,255,255,0.13);

  --text:  #f0f2f8;
  --text2: #9aa3b8;
  --text3: #5c6478;

  --shadow: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.55);
}

/* ── LIGHT MODE ── */
html.light {
  --bg:      #f4f5f7;
  --surface: #ffffff;
  --surface2:#eef0f4;
  --border:  rgba(0,0,0,0.07);
  --border2: rgba(0,0,0,0.13);
  --text:    #111318;
  --text2:   #4a5268;
  --text3:   #9099b0;
  --red-glow: rgba(200,16,46,0.18);
  --shadow:   0 8px 32px rgba(0,0,0,0.12);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.14);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', 'Barlow', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar       { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 3px; }

/* =============================================================
   THEME TOGGLE
   ============================================================= */
.theme-toggle {
  width: 34px; height: 34px;
  border-radius: 7px;
  background: transparent;
  border: none;
  color: var(--text2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--surface2); color: var(--text); }
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun  { display: none; }
html.light .theme-toggle .icon-moon { display: none; }
html.light .theme-toggle .icon-sun  { display: block; }

/* =============================================================
   NAV  (HTML file style)
   ============================================================= */
.topnav {
  display: flex; align-items: center;
  padding: 0 24px; height: 60px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  transition: background 0.2s; overflow: visible;
}
html.light .topnav { background: var(--surface); }

/* Logo area */
.logo {
  display: flex; align-items: center; gap: 6px;
  margin-right: 28px; cursor: pointer; flex-shrink: 0;
}
.nav-logo-img {
  height: 38px; width: auto; display: block;
  mix-blend-mode: screen;
  filter: contrast(1.1) brightness(1.05);
  border-radius: 4px;
}
html.light .nav-logo-img { mix-blend-mode: multiply; filter: contrast(1.1) brightness(0.95); }

/* Nav links */
.nav-links { display: flex; gap: 2px; flex: 1; }
.nav-link {
  padding: 8px 16px;
  color: var(--text2); text-decoration: none;
  font-weight: 500; font-size: 14px; border-radius: 6px;
  transition: all 0.15s; position: relative;
  cursor: pointer; background: none; border: none;
  font-family: 'Inter', sans-serif;
}
.nav-link:hover { color: var(--text); background: var(--surface2); }
.nav-link.active { color: var(--text); }
.nav-link.active::after {
  content: ''; position: absolute;
  bottom: -1px; left: 16px; right: 16px;
  height: 2px; background: var(--red);
  border-radius: 2px 2px 0 0;
}

/* Nav right cluster */
.nav-right { display: flex; align-items: center; gap: 14px; margin-left: auto; }

/* icon-btn: theme toggle */
.icon-btn {
  width: 36px; height: 36px;
  background: transparent; border: none;
  color: var(--text2); border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.icon-btn:hover { background: var(--surface2); color: var(--text); }
.theme-icon-sun { display: none; }
html.light .theme-icon-moon { display: none; }
html.light .theme-icon-sun  { display: block; }

/* Bell / notifications */
.bell-wrap {
  position: relative; cursor: pointer;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; transition: background 0.15s;
  border: none; background: transparent; color: var(--text2);
}
.bell-wrap:hover { background: var(--surface2); color: var(--text); }
.bell-dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red); border: 2px solid var(--bg);
}
html.light .bell-dot { border-color: var(--surface); }

/* Notification dropdown */
.notif-dropdown {
  position: absolute; top: 48px; right: 0;
  width: 290px; background: var(--surface);
  border: 1px solid var(--border2); border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5); z-index: 300;
  overflow: hidden; display: none;
}
.notif-dropdown.open { display: block; }
.notif-header {
  padding: 11px 14px 9px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.notif-title { font-size: 13px; font-weight: 700; color: var(--text); }
.notif-clear { font-size: 11px; color: var(--red); cursor: pointer; font-weight: 600; }
.notif-item {
  padding: 9px 14px; border-bottom: 1px solid var(--border);
  display: flex; gap: 10px; align-items: flex-start;
  cursor: pointer; transition: background 0.12s;
}
.notif-item:hover { background: var(--surface2); }
.notif-item:last-child { border-bottom: none; }
.notif-pip { width: 7px; height: 7px; border-radius: 50%; background: var(--red); flex-shrink: 0; margin-top: 4px; }
.notif-pip.read { background: var(--text3); }
.notif-text { font-size: 12px; color: var(--text2); line-height: 1.4; }
.notif-text strong { color: var(--text); font-weight: 600; }
.notif-time { font-size: 10px; color: var(--text3); margin-top: 2px; }

/* Avatar */
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; cursor: pointer;
}

/* =============================================================
   LAYOUT
   ============================================================= */
.layout {
  display: flex;
  min-height: calc(100vh - 60px);
}

/* =============================================================
   SIDEBAR
   ============================================================= */
aside {
  width: 240px;
  min-width: 240px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition:
    width 0.25s cubic-bezier(0.4,0,0.2,1),
    min-width 0.25s cubic-bezier(0.4,0,0.2,1),
    transform 0.25s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  z-index: 50;
  max-height: calc(100vh - 60px);
}
html.light aside { background: #fff; }
/* Collapsed: icon-only rail (48px) */
aside.collapsed {
  width: 48px; min-width: 48px;
  overflow-x: hidden;   /* clip text that would bleed right */
  overflow-y: visible;  /* allow icons to remain visible */
}
aside.collapsed .sidebar-inner {
  width: 48px;
  overflow-x: hidden;
  overflow-y: visible;  /* no scrollbar — icons only, no scroll needed */
  min-width: unset;
}
aside.collapsed .team-header,
aside.collapsed .search-wrap,
aside.collapsed .nav-section-label,
aside.collapsed .nav-divider { display: none; }
/* Show only icon, hide text span */
aside.collapsed .nav-item {
  justify-content: center; padding: 9px 0;
  border-left: none; gap: 0; width: 48px;
}
aside.collapsed .nav-item.active {
  background: var(--surface2); border-left: none;
  border-radius: 6px; margin: 0 4px; width: 40px;
}
aside.collapsed .nav-item:hover {
  background: var(--surface2); border-radius: 6px;
  margin: 0 4px; width: 40px;
}
aside.collapsed .nav-item svg {
  opacity: 0.6; width: 18px; height: 18px;
  flex-shrink: 0; display: block;
}
aside.collapsed .nav-item.active svg { opacity: 1; color: var(--red); }
aside.collapsed .nav-item span,
aside.collapsed .nav-item-text { display: none; }
aside.collapsed .nav-section { padding: 1px 0; }
aside.collapsed .sidebar-toggle-row { justify-content: center; }

/* Mobile: slide-in overlay */
@media (max-width: 768px) {
  aside {
    position: fixed;
    top: 60px; left: 0;
    height: calc(100vh - 60px);
    z-index: 200;
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.4);
  }
  aside.collapsed {
    width: 240px; min-width: 240px;
    transform: translateX(-100%);
  }
  .sidebar-overlay { display: block; }
  .nav-links { display: none; }
}

/* Sidebar overlay (mobile backdrop) */
.sidebar-overlay {
  display: none; position: fixed; inset: 60px 0 0 0;
  background: rgba(0,0,0,0.55); z-index: 199;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.sidebar-overlay.visible { opacity: 1; pointer-events: all; }

/* Hamburger */
.hamburger {
  width: 36px; height: 36px; border-radius: 7px;
  background: transparent; border: none;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 5px;
  cursor: pointer; transition: background 0.15s;
  padding: 0; flex-shrink: 0;
}
.hamburger:hover { background: var(--surface2); }
.hamburger span {
  display: block; width: 17px; height: 2px;
  background: var(--text2); border-radius: 2px;
  transition: transform 0.22s ease, opacity 0.22s ease, width 0.22s ease;
  transform-origin: center;
}
.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; width: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Sidebar collapse arrow button */
.sidebar-toggle-row {
  display: flex; justify-content: flex-end;
  padding: 8px 8px 4px; flex-shrink: 0;
}
.sidebar-toggle {
  width: 30px; height: 30px;
  background: transparent; border: 1px solid var(--border2);
  color: var(--text2); border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.sidebar-toggle:hover { background: var(--surface2); color: var(--text); }
.sidebar-toggle svg { transition: transform 0.25s ease; }
aside.collapsed .sidebar-toggle svg { transform: rotate(180deg); }

.sidebar-inner {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  min-width: 240px;
  display: flex; flex-direction: column;
}

/* Team / league header */
.team-header {
  padding: 10px 14px 12px;
  display: flex; align-items: center; gap: 9px;
  border-bottom: 1px solid var(--border);
}
.team-icon {
  width: 34px; height: 34px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0; overflow: hidden;
}
.team-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px; font-weight: 700; letter-spacing: 0.5px;
  color: var(--text); line-height: 1.2;
}
.league-name {
  font-size: 18px; letter-spacing: 0.3px;
}
.team-sub {
  font-size: 11px; color: var(--text3); margin-top: 2px;
  display: flex; align-items: center; gap: 4px;
}
.status-dot {
  width: 5px; height: 5px; background: var(--green);
  border-radius: 50%; box-shadow: 0 0 5px var(--green);
}

/* Search */
.search-wrap {
  padding: 6px 12px 8px;
  border-bottom: 1px solid var(--border);
}
.search-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  display: flex; align-items: center; gap: 7px;
  padding: 6px 10px;
  transition: border-color 0.15s;
}
.search-box:focus-within { border-color: var(--border2); }
.search-box input {
  background: transparent; border: none; outline: none;
  font-size: 12px; color: var(--text);
  font-family: 'Inter', sans-serif; width: 100%;
}
.search-box input::placeholder { color: var(--text3); }

/* Sidebar nav sections (HTML file style) */
.nav-section { padding: 2px 0; }
.nav-section-label {
  padding: 8px 14px 3px;
  font-size: 10px; font-weight: 700; color: var(--text3);
  letter-spacing: 1px; text-transform: uppercase;
}
.nav-item {
  padding: 6px 14px;
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 500; color: var(--text2);
  cursor: pointer; transition: all 0.12s;
  border-left: 2px solid transparent; white-space: nowrap;
}
.nav-item:hover { color: var(--text); background: var(--surface2); }
.nav-item.active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(200,16,46,0.1), transparent);
  border-left-color: var(--red);
}
.nav-item svg { opacity: 0.5; flex-shrink: 0; stroke: currentColor; width: 16px; height: 16px; }
.nav-item.active svg { opacity: 1; }
.nav-divider { height: 1px; background: var(--border); margin: 4px 12px; }

/* =============================================================
   MAIN CONTENT
   ============================================================= */
main {
  flex: 1;
  padding: 18px 22px;
  background: var(--bg);
  transition: background 0.2s;
  min-width: 0;
  overflow: hidden;
}

/* =============================================================
   PAGE HEADER
   ============================================================= */
.page-header {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 14px;
}
.page-header-row {
  display: flex; align-items: center;
  justify-content: space-between; gap: 14px;
}
.page-header-sub {
  min-height: 24px;
}
.page-title-group {
  display: flex; flex-direction: column; gap: 2px;
}
.page-eyebrow {
  font-size: 11px; font-weight: 600; color: var(--text3);
  letter-spacing: 1px; text-transform: uppercase;
}
.page-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 27px; font-weight: 700; letter-spacing: 0.5px;
  color: var(--text); display: flex; align-items: center; gap: 8px;
}
.week-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(200,16,46,0.13);
  border: 1px solid rgba(200,16,46,0.3);
  border-radius: 5px; padding: 3px 9px;
  font-size: 11px; font-weight: 700; color: var(--red);
  letter-spacing: 0.5px; vertical-align: middle;
}
.deadline-row {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text3); margin-top: 0;
}
.deadline-row svg { flex-shrink: 0; }
.deadline-row strong { color: var(--text2); font-weight: 600; }
.deadline-group {
  display: flex; align-items: center; gap: 14px;
}

/* Set Lineup button */
.btn-set-lineup {
  background: var(--red); color: #fff; border: none;
  border-radius: 8px; padding: 8px 18px;
  font-size: 13px; font-weight: 700; cursor: pointer;
  font-family: 'Inter', sans-serif; letter-spacing: 0.3px;
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap; transition: background 0.15s;
}
.btn-set-lineup:hover { background: var(--red-dark); }
.btn-set-lineup:disabled, .btn-set-lineup[disabled] {
  background: var(--surface2); color: var(--text3);
  cursor: not-allowed; pointer-events: none;
}

/* =============================================================
   STATUS BANNERS
   ============================================================= */
.locked-banner {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.25);
  border-radius: 7px; padding: 6px 12px;
  font-size: 12px; font-weight: 600; color: var(--green);
  margin-bottom: 14px; letter-spacing: 0.3px;
}

/* =============================================================
   GAMECAST BAR
   ============================================================= */
.gamecast {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 18px; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.gc-team { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 88px; }
.gc-team-name { font-family: 'Barlow Condensed', sans-serif; font-size: 13px; font-weight: 700; letter-spacing: 0.5px; color: var(--text); text-transform: uppercase; }
.gc-team-icon { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; margin-bottom: 1px; }
.gc-record { font-size: 10px; color: var(--text3); }
.gc-winprob { font-size: 10px; font-weight: 700; color: var(--text2); margin-top: 2px; letter-spacing: 0.3px; }
.gc-winprob.favored { color: var(--green); }
.gc-score { font-family: 'Barlow Condensed', sans-serif; font-size: 40px; font-weight: 700; color: var(--text); letter-spacing: -1.5px; line-height: 1; }
.gc-proj { font-size: 10px; color: var(--green); font-weight: 700; margin-top: 1px; }
.gc-vs { font-size: 10px; font-weight: 800; color: var(--text3); letter-spacing: 1.2px; text-transform: uppercase; padding: 2px 8px; background: var(--surface2); border-radius: 4px; border: 1px solid var(--border); }
.gc-status { background: rgba(200,16,46,0.15); border: 1px solid rgba(200,16,46,0.3); border-radius: 5px; padding: 2px 9px; font-size: 10px; font-weight: 700; color: var(--red); letter-spacing: 0.5px; text-transform: uppercase; }
.gc-spread { font-size: 10px; font-weight: 700; color: var(--text3); }
.gc-spread strong { color: var(--text2); font-family: 'Barlow Condensed', sans-serif; font-size: 12px; }
.gc-scores-wrap { display: flex; align-items: center; gap: 14px; }
.gc-score-block { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 70px; }
.gc-center { display: flex; flex-direction: column; align-items: center; gap: 5px; flex: 1; max-width: 280px; }
.gc-progress { width: 100%; height: 6px; background: var(--surface2); border-radius: 3px; overflow: hidden; border: 1px solid var(--border); }
.gc-progress-fill { height: 100%; background: var(--red); border-radius: 2px 0 0 2px; transition: width 0.4s; }
.gc-progress-labels { display: flex; justify-content: space-between; width: 100%; font-size: 9px; color: var(--text3); font-weight: 700; }
.gc-progress-labels .left { color: var(--red); }

/* =============================================================
   LINEUP HINT BAR
   ============================================================= */
.lineup-hint {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  background: rgba(59,130,246,0.07);
  border-bottom: 1px solid rgba(59,130,246,0.18);
  font-size: 13px; color: var(--text2); line-height: 1.4;
  flex-wrap: wrap;
}
html.light .lineup-hint {
  background: rgba(59,130,246,0.06);
  border-bottom-color: rgba(59,130,246,0.2);
}
.lineup-hint strong { color: var(--text); font-weight: 600; }
.hint-sep { color: var(--text3); margin: 0 2px; }
.hint-drag-pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 4px; padding: 1px 6px;
  font-size: 11px; font-weight: 600; color: var(--text2);
  vertical-align: middle; margin: 0 2px;
}
.hint-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 16px; border-radius: 4px;
  font-size: 9px; font-weight: 800; letter-spacing: 0.3px;
  margin: 0 1px; vertical-align: middle;
}

/* =============================================================
   LINEUP TABLE
   ============================================================= */
.lineup-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  transition: background 0.2s;
}

/* 10 columns: handle | POS | Player | PTS | PROJ | OPP | RK | ST% | WX | GAMETIME */
.table-head {
  display: grid;
  grid-template-columns: 18px 52px 1fr 80px 66px 76px 86px 54px 54px 120px;
  padding: 8px 14px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.th {
  font-size: 10px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.8px;
}
.th.right  { text-align: right; }
.th.center { text-align: center; }

/* Player row */
.player-row {
  display: grid;
  grid-template-columns: 18px 52px 1fr 80px 66px 76px 86px 54px 54px 120px;
  padding: 7px 14px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s, opacity 0.15s;
  cursor: pointer;
  animation: fadeSlideIn 0.3s ease forwards;
  opacity: 0;
}
.player-row:last-child { border-bottom: none; }
.player-row:hover { background: var(--surface2); }

/* Even row tint */
.player-row:nth-child(even) { background: rgba(255,255,255,0.02); }
html.light .player-row:nth-child(even) { background: rgba(0,0,0,0.02); }
.player-row:hover { background: var(--surface2) !important; }

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* Stagger */
.player-row:nth-child(1) { animation-delay: 0.04s; }
.player-row:nth-child(2) { animation-delay: 0.08s; }
.player-row:nth-child(3) { animation-delay: 0.12s; }
.player-row:nth-child(4) { animation-delay: 0.16s; }
.player-row:nth-child(5) { animation-delay: 0.20s; }
.player-row:nth-child(6) { animation-delay: 0.24s; }
.player-row:nth-child(7) { animation-delay: 0.28s; }
.player-row:nth-child(8) { animation-delay: 0.32s; }

/* =============================================================
   POSITION BADGES
   ============================================================= */
.pos-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 20px; border-radius: 5px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.3px;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
}
.pos-badge:hover { filter: brightness(1.3); transform: scale(1.08); }

.pos-QB   { background: rgba(200,16,46,0.15);  color: #e8284a; border: 1px solid rgba(200,16,46,0.35); }
.pos-RB   { background: rgba(37,99,235,0.15);  color: #60a5fa; border: 1px solid rgba(37,99,235,0.35); }
.pos-WR   { background: rgba(22,163,74,0.15);  color: #4ade80; border: 1px solid rgba(22,163,74,0.35); }
.pos-TE   { background: rgba(147,51,234,0.15); color: #c084fc; border: 1px solid rgba(147,51,234,0.35); }
.pos-K    { background: rgba(217,119,6,0.15);  color: #fb923c; border: 1px solid rgba(217,119,6,0.35); }
.pos-D    { background: rgba(120,80,50,0.18);  color: #c8966a; border: 1px solid rgba(120,80,50,0.35); }
.pos-FLEX { background: rgba(8,145,178,0.15);  color: #22d3ee; border: 1px solid rgba(8,145,178,0.35); }

/* FLEX indicator under badge */
.flex-row .pos-badge {
  display: flex; flex-direction: column; align-items: center; gap: 2px; height: auto;
}
.flex-row .pos-badge::after {
  content: 'FLEX';
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 8px; font-weight: 800; letter-spacing: 1px; color: #22d3ee;
  background: rgba(8,145,178,0.15); border: 1px solid rgba(8,145,178,0.3);
  border-radius: 3px; padding: 1px 4px; line-height: 1.2;
}

/* =============================================================
   PLAYER INFO
   ============================================================= */
.player-info {
  display: flex; align-items: center; gap: 9px;
}
.player-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface2); border: 1px solid var(--border2);
  flex-shrink: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.player-avatar img {
  width: 100%; height: 100%; object-fit: cover; object-position: top center;
  display: block; border-radius: 50%;
}
.av-initials { font-size: 11px; font-weight: 700; color: var(--text3); }

/* Avatar colour cycle */
.av-1 { background: linear-gradient(135deg,#1e3a5f,#0a1a30); }
.av-2 { background: linear-gradient(135deg,#2d1a3a,#120810); }
.av-3 { background: linear-gradient(135deg,#1a3a22,#081508); }
.av-4 { background: linear-gradient(135deg,#3a2a0a,#1a1005); }
.av-5 { background: linear-gradient(135deg,#3a1a1a,#1a0808); }
.av-6 { background: linear-gradient(135deg,#1a2a3a,#0a1020); }
.av-7 { background: linear-gradient(135deg,#1a1a3a,#080818); }
.av-8 { background: linear-gradient(135deg,#2a1a0a,#100805); }

html.light .av-1 { background: linear-gradient(135deg,#c8d8e8,#b0c4d8); }
html.light .av-2 { background: linear-gradient(135deg,#d8c8e0,#c0a8d0); }
html.light .av-3 { background: linear-gradient(135deg,#c8e0cc,#a8d0b0); }
html.light .av-4 { background: linear-gradient(135deg,#e0d8c0,#d0c898); }
html.light .av-5 { background: linear-gradient(135deg,#e0c8c8,#d0a8a8); }
html.light .av-6 { background: linear-gradient(135deg,#c8d4e0,#a8c0d0); }
html.light .av-7 { background: linear-gradient(135deg,#c8c8e0,#a8a8d0); }
html.light .av-8 { background: linear-gradient(135deg,#e0d0c0,#d0b898); }

.player-name {
  font-size: 13px; font-weight: 700; color: var(--text);
  letter-spacing: -0.1px; line-height: 1.2;
}
.player-name-link {
  cursor: pointer; transition: color 0.12s;
}
.player-name-link:hover { color: var(--red); }
/* ── Table column value styles ── */
.pts-col  { font-family: 'Barlow Condensed', sans-serif; font-size: 15px; font-weight: 700; color: var(--text); text-align: right; }
.prt-col  { font-family: 'Barlow Condensed', sans-serif; font-size: 15px; font-weight: 800; color: var(--green); text-align: right; letter-spacing: 0.2px; }
.opp-col  { font-size: 12px; font-weight: 600; color: var(--text2); text-align: center; }
.rk-col   { font-size: 11px; color: var(--text2); text-align: center; }
.st-col   { font-family: 'Barlow Condensed', sans-serif; font-size: 12px; font-weight: 600; text-align: center; color: var(--text2); }
.wx-col   { text-align: center; }
.wx-col img { width: 22px; height: 22px; vertical-align: middle; cursor: pointer; filter: brightness(1.3); }
.game-col { text-align: right; display: flex; align-items: center; justify-content: flex-end; }

/* Player name row — name + injury tag on same flex line */
.player-name-row { display: flex; align-items: center; gap: 5px; flex-wrap: nowrap; }

/* Injury tag — standalone badge, HTML file style */
.injury-tag { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 14px; padding: 0 4px; border-radius: 3px; font-size: 9px; font-weight: 800; letter-spacing: 0.3px; flex-shrink: 0; }
.injury-Q   { background: rgba(217,119,6,0.2);   color: #fbbf24; border: 1px solid rgba(217,119,6,0.4); }
.injury-OUT { background: rgba(220,38,38,0.2);   color: #f87171; border: 1px solid rgba(220,38,38,0.4); }
.injury-IR  { background: rgba(127,29,29,0.35);  color: #fca5a5; border: 1px solid rgba(220,38,38,0.4); }
.injury-D   { background: rgba(220,38,38,0.2);   color: #f87171; border: 1px solid rgba(220,38,38,0.4); }
.injury-P   { background: rgba(34,197,94,0.13);  color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
/* Light mode — use fully opaque dark text so badges are readable on white backgrounds */
html.light .injury-Q   { background: rgba(217,119,6,0.15);  color: #92580a; border-color: rgba(217,119,6,0.5); }
html.light .injury-OUT { background: rgba(220,38,38,0.12);  color: #b91c1c; border-color: rgba(220,38,38,0.45); }
html.light .injury-IR  { background: rgba(127,29,29,0.12);  color: #991b1b; border-color: rgba(153,27,27,0.55); }
html.light .injury-D   { background: rgba(220,38,38,0.12);  color: #b91c1c; border-color: rgba(220,38,38,0.45); }
html.light .injury-P   { background: rgba(34,197,94,0.12);  color: #15803d; border-color: rgba(21,128,61,0.45); }

/* Game status pills */
.status-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.status-upcoming { background: var(--surface2); color: var(--text3); border: 1px solid var(--border); }
.status-live     { background: rgba(34,197,94,0.13); color: #4ade80; border: 1px solid rgba(34,197,94,0.33); }
.status-live::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #22c55e; animation: livepulse 1.2s infinite; flex-shrink: 0; }
.status-final    { background: rgba(100,116,139,0.13); color: var(--text3); border: 1px solid var(--border2); }
@keyframes livepulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* Bye week */
.bye-span {
  grid-column: 5 / -1;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px; font-weight: 800; letter-spacing: 4px; color: var(--text3);
}

/* =============================================================
   TEAM LOGO CHIP
   ============================================================= */
.team-logo { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; font-size: 8px; font-weight: 800; color: #fff; letter-spacing: -0.3px; flex-shrink: 0; border: 1px solid #ffffff18; vertical-align: middle; margin-right: 4px; }
html.light .team-logo { border-color: #00000018; }
/* player-meta: circle + team name inline */
/* NFL team logo colors */
.team-logo-NE { background: #002244; }
.team-logo-CIN { background: #FB4F14; }
.team-logo-ATL { background: #A71930; }
.team-logo-TB { background: #D50A0A; }
.team-logo-DET { background: #0076B6; }
.team-logo-SF { background: #AA0000; }
.team-logo-BUF { background: #00338D; }
.team-logo-JAX { background: #006778; }
.team-logo-CHI { background: #0B162A; }
.team-logo-LV { background: #a5acaf; }
.team-logo-CLE { background: #311D00; }
.team-logo-KC { background: #E31837; }
.team-logo-SEA { background: #002244; }
.team-logo-BAL { background: #241773; }
.team-logo-CAR { background: #0085CA; }
.team-logo-MIN { background: #4F2683; }
.team-logo-PHI { background: #004C54; }
.team-logo-NYG { background: #0B2265; }
.team-logo-NYJ { background: #125740; }
.team-logo-MIA { background: #008E97; }
.team-logo-PIT { background: #FFB612; }
.team-logo-IND { background: #002C5F; }
.team-logo-HOU { background: #03202F; }
.team-logo-TEN { background: #0C2340; }
.team-logo-JAC { background: #006778; }
.team-logo-DEN { background: #FB4F14; }
.team-logo-LAC { background: #0080C6; }
.team-logo-LVR { background: #a5acaf; }
.team-logo-ARI { background: #97233F; }
.team-logo-LAR { background: #003594; }
.team-logo-NO { background: #9f8958; }
.team-logo-GB { background: #203731; }
.team-logo-WAS { background: #5A1414; }
.team-logo-DAL { background: #003594; }

.player-meta { font-size: 11px; color: var(--text3); margin-top: 1px; display: flex; align-items: center; gap: 0; }

/* =============================================================
   SECTION DIVIDER (Starters / Bench header)
   ============================================================= */
.section-divider {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px 7px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.section-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px; font-weight: 800; letter-spacing: 2px;
  text-transform: uppercase; color: var(--text2);
}
.section-divider-line { flex: 1; height: 1px; background: var(--border2); }

/* Bench rows */
.bench-row { opacity: 0.72; }
.bench-row:hover { opacity: 1; }
.bench-row .pts-col { color: var(--text2); }

/* Empty roster */
.empty-roster-msg {
  grid-column: 1 / -1; padding: 40px 24px; text-align: center;
  font-family: 'Barlow Condensed', sans-serif; font-size: 14px;
  font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--text3);
}

/* =============================================================
   DRAG & DROP
   ============================================================= */
.drag-handle {
  display: flex; align-items: center; justify-content: center;
  width: 16px; height: 100%;
  cursor: grab; color: var(--text3); flex-shrink: 0;
}
.drag-handle:active { cursor: grabbing; }

.lock-icon-cell {
  display: flex; align-items: center; justify-content: center;
  width: 16px; height: 100%; flex-shrink: 0;
  color: #fbbf24; opacity: 0.9; cursor: default;
}

.player-row.dragging { opacity: 0.3; background: var(--surface2); outline: 1px dashed var(--border2); }
.player-row.drag-over-above { box-shadow: inset 0 2px 0 0 var(--red); background: rgba(200,16,46,0.07); }
.player-row.drag-over-below { box-shadow: inset 0 -2px 0 0 var(--red); background: rgba(200,16,46,0.07); }
.section-divider.drag-over-divider { background: rgba(200,16,46,0.1); box-shadow: inset 0 2px 0 0 var(--red), inset 0 -2px 0 0 var(--red); }

/* Drag toast */
.drag-toast {
  position: fixed; bottom: 22px; left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 10px; padding: 9px 18px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px; font-weight: 600; letter-spacing: 0.3px;
  color: var(--text);
  box-shadow: var(--shadow); z-index: 999;
  display: flex; align-items: center; gap: 9px;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), opacity 0.25s;
  opacity: 0; pointer-events: none;
}
.drag-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast-icon { font-size: 15px; }
.toast-type {
  font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
  padding: 2px 7px; border-radius: 4px;
  background: rgba(200,16,46,0.18); color: var(--red); border: 1px solid rgba(200,16,46,0.3);
}
.toast-type.bench-type { background: rgba(37,99,235,0.15); color: #60a5fa; border-color: rgba(37,99,235,0.3); }
.toast-type.swap-type  { background: rgba(217,119,6,0.15);  color: #fb923c; border-color: rgba(217,119,6,0.3); }

/* =============================================================
   SUBSTITUTION MODAL
   ============================================================= */
.sub-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.65); z-index: 500; opacity: 0; pointer-events: none; transition: opacity 0.18s; backdrop-filter: blur(2px); }
.sub-overlay.open { opacity: 1; pointer-events: all; }
.sub-modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-46%); width: 480px; max-width: calc(100vw - 32px); max-height: 82vh; background: var(--surface); border: 1px solid var(--border2); border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 501; display: flex; flex-direction: column; opacity: 0; transition: opacity 0.2s, transform 0.2s; }
.sub-overlay.open .sub-modal { opacity: 1; transform: translate(-50%,-50%); }
.sub-modal-header { padding: 15px 17px 11px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.sub-modal-title { font-family: 'Barlow Condensed', sans-serif; font-size: 18px; font-weight: 800; color: var(--text); letter-spacing: 0.3px; }
.sub-modal-sub { font-size: 11px; color: var(--text3); margin-top: 2px; }
.sub-modal-close { width: 27px; height: 27px; border-radius: 6px; border: 1px solid var(--border2); background: transparent; color: var(--text2); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.15s; flex-shrink: 0; }
.sub-modal-close:hover { background: var(--surface2); color: var(--text); }
.sub-modal-body { overflow-y: auto; padding: 10px 12px 14px; flex: 1; }
.sub-current-label { font-size: 10px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 6px; }
.sub-divider { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; color: var(--text3); font-size: 10px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; }
.sub-divider::before,.sub-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.sub-card { display: flex; align-items: center; gap: 11px; padding: 9px 13px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; transition: all 0.15s; margin-bottom: 6px; }
.sub-card:hover { border-color: var(--red); background: var(--surface2); }
.sub-card:hover .sub-swap-btn { opacity: 1; }
.sub-card.current-player { border-color: var(--border2); cursor: default; opacity: 0.6; }
.sub-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--surface2); border: 1px solid var(--border2); flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--text3); }
.sub-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.sub-info { flex: 1; min-width: 0; }
.sub-name { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub-meta { font-size: 11px; color: var(--text3); margin-top: 2px; display: flex; align-items: center; gap: 5px; }
.sub-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.sub-pts  { font-family: 'Barlow Condensed', sans-serif; font-size: 15px; font-weight: 800; color: var(--text); }
.sub-proj { font-size: 11px; font-weight: 700; color: var(--green); }
.sub-rank { font-size: 10px; color: var(--text3); }
.sub-swap-btn { margin-left: 6px; padding: 5px 12px; background: var(--red); color: #fff; border: none; border-radius: 6px; font-size: 11px; font-weight: 700; cursor: pointer; opacity: 0; transition: opacity 0.15s; font-family: 'Inter', sans-serif; flex-shrink: 0; }
.sub-no-options { padding: 22px; text-align: center; color: var(--text3); font-size: 13px; }

/* =============================================================
   COMMISSIONER FORM
   ============================================================= */
.commissioner-form { display: flex; flex-direction: column; gap: 8px; padding: 0 14px 14px !important; }
.commissioner-form label { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text3); display: block; margin-bottom: 3px; }
.comm-select-group { margin-bottom: 3px; }
.comm-select-wrap { position: relative; display: flex; align-items: center; }
.comm-select-wrap select { width: 100%; appearance: none; -webkit-appearance: none; background: var(--surface2); border: 1px solid var(--border2); border-radius: 7px; padding: 7px 28px 7px 11px; font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer; outline: none; transition: border-color 0.15s; }
.comm-select-wrap select:hover { border-color: var(--text3); }
.comm-select-wrap select:focus { border-color: var(--red); }
.comm-select-wrap select option { background: var(--surface2); color: var(--text); }
.comm-chevron { position: absolute; right: 9px; pointer-events: none; color: var(--text3); flex-shrink: 0; }
.commissioner-form .btn-commissioner { background: var(--red); color: white; border: none; border-radius: 7px; padding: 8px 13px; font-family: 'Barlow Condensed', sans-serif; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; cursor: pointer; transition: background 0.15s; width: 100%; }
.commissioner-form .btn-commissioner:hover { background: var(--red-dark); }

/* Inline commissioner selects in page header */
.comm-inline-form {
  display: flex; align-items: center; gap: 10px;
}
.comm-inline-field {
  display: flex; align-items: center; gap: 6px;
}
.comm-inline-field label {
  font-size: 11px; font-weight: 600; color: var(--text3);
  letter-spacing: 0.5px; text-transform: uppercase; white-space: nowrap;
}
.comm-inline-field .comm-select-wrap select {
  padding: 5px 24px 5px 9px;
  font-size: 12px; border-radius: 6px;
  width: auto;
}

/* =============================================================
   HOW IT WORKS BUTTON & MODAL
   ============================================================= */
.btn-how-it-works {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px; border-radius: 7px;
  border: 1px solid var(--border2); background: transparent;
  color: var(--text2); font-family: 'Inter', sans-serif;
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-how-it-works:hover { background: var(--surface2); color: var(--text); }

.hiw-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 900; align-items: center; justify-content: center; padding: 20px; }
.hiw-backdrop.open { display: flex; }
.hiw-modal { background: var(--surface); border: 1px solid var(--border2); border-radius: 14px; width: 100%; max-width: 550px; max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-lg); animation: hiwIn 0.18s ease; }
@keyframes hiwIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
.hiw-header { display: flex; align-items: center; justify-content: space-between; padding: 17px 19px 14px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; border-radius: 14px 14px 0 0; }
.hiw-title { font-family: 'Barlow Condensed', sans-serif; font-size: 19px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text); }
.hiw-close { width: 27px; height: 27px; border-radius: 6px; border: 1px solid var(--border2); background: transparent; color: var(--text2); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 15px; line-height: 1; transition: background 0.12s; }
.hiw-close:hover { background: var(--surface2); color: var(--text); }
.hiw-body { padding: 18px; }
.hiw-section-label { font-family: 'Barlow Condensed', sans-serif; font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text3); margin-bottom: 10px; margin-top: 18px; }
.hiw-section-label:first-child { margin-top: 0; }
.hiw-step { display: flex; gap: 12px; align-items: flex-start; padding: 10px 13px; border-radius: 8px; background: var(--surface2); border: 1px solid var(--border); margin-bottom: 7px; transition: border-color 0.12s; }
.hiw-step:hover { border-color: var(--border2); }
.hiw-icon { width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: rgba(200,16,46,0.15); color: var(--red); }
.hiw-icon.green { background: rgba(34,197,94,0.12); color: var(--green); }
.hiw-icon.red   { background: rgba(200,16,46,0.12); color: var(--red); }
.hiw-icon.blue  { background: rgba(37,99,235,0.12);  color: #60a5fa; }
.hiw-step-label { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 2px; line-height: 1.3; }
.hiw-step-desc  { font-size: 12px; color: var(--text2); line-height: 1.5; }
.hiw-step-desc strong { color: var(--text); font-weight: 600; }
.hiw-badge-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.hiw-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 4px; font-family: 'Barlow Condensed', sans-serif; letter-spacing: 0.5px; }
.hiw-badge-RB   { background: rgba(37,99,235,0.15);  color: #60a5fa; }
.hiw-badge-WR   { background: rgba(22,163,74,0.15);  color: #4ade80; }
.hiw-badge-TE   { background: rgba(147,51,234,0.15); color: #c084fc; }
.hiw-badge-flex { background: rgba(8,145,178,0.15);  color: #22d3ee; }
.hiw-divider { height: 1px; background: var(--border); margin: 16px 0; }
.hiw-tip { display: flex; gap: 9px; align-items: flex-start; padding: 9px 12px; border-radius: 7px; border: 1px solid rgba(200,16,46,0.2); background: rgba(200,16,46,0.07); margin-bottom: 7px; font-size: 12px; color: var(--text2); line-height: 1.5; }
.hiw-tip svg { flex-shrink: 0; margin-top: 1px; color: var(--red); }
.hiw-tip strong { color: var(--text); font-weight: 600; }
.hiw-footer { padding: 13px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; position: sticky; bottom: 0; background: var(--surface); border-radius: 0 0 14px 14px; }
.hiw-btn-got-it { padding: 7px 22px; border-radius: 7px; border: none; background: var(--red); color: #fff; font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 700; cursor: pointer; transition: background 0.15s; }
.hiw-btn-got-it:hover { background: var(--red-dark); }

/* =============================================================
   MOBILE — narrow table + layout tweaks
   ============================================================= */
@media (max-width: 600px) {
  .table-head,
  .player-row {
    grid-template-columns: 18px 46px 1fr 68px 110px;
  }
  /* Hide PROJ, OPP, RK, ST%, WX on small screens */
  .player-row > *:nth-child(5),
  .player-row > *:nth-child(6),
  .player-row > *:nth-child(7),
  .player-row > *:nth-child(8),
  .player-row > *:nth-child(9),
  .table-head > *:nth-child(5),
  .table-head > *:nth-child(6),
  .table-head > *:nth-child(7),
  .table-head > *:nth-child(8),
  .table-head > *:nth-child(9) { display: none; }
  main { padding: 12px 12px; }
  .page-header { gap: 8px; }
  .page-header-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .deadline-group { flex-wrap: wrap; gap: 8px; }
  .gamecast { flex-direction: column; }
  .gc-team { min-width: unset; }
  .gc-score { font-size: 30px; }
  .gc-center { width: 100%; }
}
