/**
 * FFToolbox Responsive CSS Framework
 * ==================================
 * 
 * A modular, reusable CSS framework for making FFToolbox pages responsive.
 * Include this file at the end of any page to apply responsive styles.
 * 
 * USAGE:
 *   <link rel="stylesheet" href="/css/responsive.css">
 *   OR inject via JavaScript at end of </body>
 * 
 * COMPONENTS:
 *   1. Base/Reset styles
 *   2. Layout containers
 *   3. Data Tables (.grid, .schedule, .stats)
 *   4. Team Cards (.team)
 *   5. Navigation
 *   6. Forms
 *   7. Ads/Footer handling
 *   8. Typography
 *   9. Utilities
 */

/* ============================================
   1. BASE / RESET
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

img,
video,
iframe {
  max-width: 100%;
  height: auto;
}

/* ============================================
   2. LAYOUT CONTAINERS
   ============================================ */

/* Main page wrapper */
#wrapper,
.page-wrapper {
  width: 100% !important;
  max-width: 1400px !important;
  margin: 0 auto !important;
  padding: 0 15px !important;
  box-sizing: border-box !important;
}

/* Container - holds sidebar + content side by side on desktop */
#container {
  width: 100% !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: row !important;
  gap: 20px;
}

/* Sidebar - left column on desktop */
#side-a,
.leftnav {
  width: 200px !important;
  min-width: 200px !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
}

/* Content - right column on desktop, takes remaining space */
#content,
#content_wide,
#content_nosky,
.main-content {
  flex: 1 !important;
  min-width: 0 !important; /* Allow flex item to shrink below content size */
  box-sizing: border-box !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}

/* Inner content wrapper */
#startcontent {
  width: 100% !important;
  box-sizing: border-box !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}

/* Right sidebar if present */
#side-b,
.rightnav,
.sidebar {
  box-sizing: border-box;
}

/* ============================================
   3. DATA TABLES - The Main Component
   ============================================ */

/**
 * Responsive Data Table
 * 
 * Classes: .grid, .schedule, .stats, .rankings, .data-table
 * 
 * Behavior:
 *   - Desktop: Full table, cells expand to fill width
 *   - Tablet: Full width, slightly smaller text
 *   - Mobile: Horizontal scroll with visible scroll hint
 */

/* Base table styles - DESKTOP AND ALL VIEWPORTS */
table.grid,
table.schedule,
table.stats,
table.rankings,
table.data-table,
.responsive-table,
table[cellpadding],
table[align="center"] {
  width: 100% !important;
  max-width: 100% !important;
  border-collapse: collapse;
  table-layout: auto;
  background: #fff;
  margin: 0 auto !important;
}

/* Table headers */
table.grid th,
table.schedule th,
table.stats th,
table.rankings th,
.responsive-table th {
  background: #454545;
  color: #fff;
  font-weight: bold;
  padding: 8px 10px;
  text-align: center;
  white-space: nowrap;
  border: 1px solid #e5e5e5;
}

/* Table cells */
table.grid td,
table.schedule td,
table.stats td,
table.rankings td,
.responsive-table td {
  padding: 10px 12px; /* Increased padding for touch targets */
  text-align: center;
  border: 1px solid #e5e5e5;
  vertical-align: middle;
  font-size: 14px !important; /* Minimum legible size */
}

/* Desktop override for larger screens */
@media (min-width: 1024px) {
  table.grid td,
  table.schedule td,
  table.stats td,
  table.rankings td,
  .responsive-table td {
    font-size: 16px !important; /* Larger for desktop */
    padding: 12px 15px;
  }
}

/* First column (usually team/player name) - left align */
table.grid td:first-child,
table.grid th:first-child,
table.schedule td:first-child,
table.stats td:first-child,
.responsive-table td:first-child,
.responsive-table th:first-child {
  text-align: left;
  font-weight: 500;
}

/* Alternating row colors */
table.grid tr:nth-child(even),
table.schedule tr:nth-child(even),
.responsive-table tr:nth-child(even) {
  background: #f9f9f9;
}

/* Hover effect */
table.grid tr:hover,
table.schedule tr:hover,
.responsive-table tr:hover {
  background: #f0f7ff;
}

/* Links in tables */
table.grid a,
table.schedule a,
table.stats a,
.responsive-table a {
  color: #0066cc;
  text-decoration: none;
}

table.grid a:hover,
.responsive-table a:hover {
  text-decoration: underline;
}

/* Colored cells (best/worst indicators) */
.best,
.good,
.positive {
  background: #caf99b !important;
}

.worst,
.bad,
.negative {
  background: #ff8285 !important;
}

.neutral,
.average {
  background: #ffffcc !important;
}

/* ============================================
   4. TEAM CARDS
   ============================================ */

/**
 * Team Card Grid
 * 
 * Classes: .team, .team-card, .player-card
 * 
 * Behavior:
 *   - Desktop: 4-5 columns
 *   - Tablet: 3 columns
 *   - Mobile: 1-2 columns
 */

.teams-container,
.cards-container {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: flex-start;
}

div.team,
.team-card,
.player-card {
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 10px;
  text-align: center;
}

/* ============================================
   5. NAVIGATION
   ============================================ */

/**
 * Site Navigation
 * Hidden on mobile, replaced with hamburger menu
 */

.site-menu-parent,
.main-nav,
#main-navigation {
  /* Will be hidden on mobile via media query */
}

/* ============================================
   6. FORMS
   ============================================ */

/**
 * Responsive Forms
 * 
 * Form elements stack vertically on mobile
 */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
select,
textarea {
  max-width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  font-size: 16px; /* Prevents zoom on iOS */
  border: 1px solid #ccc;
  border-radius: 4px;
}

button,
input[type="submit"],
input[type="button"],
.btn {
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 4px;
}

/* ============================================
   7. ADS & FOOTER
   ============================================ */

/**
 * Ad containers - hidden on small screens
 * Footer - stacked on mobile
 */

.FooterBox {
  box-sizing: border-box;
}

/* ============================================
   8. TYPOGRAPHY
   ============================================ */

/* Using explicit pixel values because legacy html font-size is 10px (not 16px) */
h1.newpagetitle,
.page-title {
  font-size: 28px !important;
  margin: 15px 0 25px 0 !important; /* Added bottom margin */
  line-height: 1.3;
  font-weight: 800;
}

@media (min-width: 1024px) {
  h1.newpagetitle,
  .page-title {
    font-size: 32px !important; /* Larger for desktop */
  }
}

h2,
.section-title {
  font-size: 22px !important;
  margin: 12px 0;
}

/* ============================================
   9. UTILITIES
   ============================================ */

/* Hide on specific breakpoints */
.hide-mobile {
}
.hide-tablet {
}
.hide-desktop {
}
.show-mobile {
  display: none;
}
.show-tablet {
  display: none;
}

.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}

/* Scroll hint for tables */
.scroll-hint {
  position: relative;
}

.scroll-hint::after {
  content: "→ Scroll";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 5px 10px;
  border-radius: 3px;
  font-size: 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.scroll-hint:hover::after {
  opacity: 1;
}

/* ============================================
   MEDIA QUERIES - TABLET (768px and below)
   ============================================ */
@media (max-width: 768px) {
  /* --- FIX FOR ACCELERATE TAG WRAPPER --- */
  /* ColdFusion accelerate tag becomes root element in browser, must expand */
  accelerate {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 100vh !important;
    overflow: visible !important;
  }

  /* --- LAYOUT --- */
  #side-a,
  #side-b,
  .leftnav,
  .rightnav,
  .sidebar,
  .site-menu-parent,
  .sub2links,
  .skyscraper,
  .sky {
    display: none !important;
  }

  /* --- NAVIGATION - Hide LEGACY nav, but keep FftNewMenu --- */
  .main-nav,
  #main-navigation,
  .site-menu-parent {
    display: none !important;
  }

  /* Ensure FftNewMenu is visible */
  .new-menu,
  #menu {
    display: block !important;
    width: 100% !important;
  }

  body,
  html,
  #wrapper {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    /* FIXED: Keep overflow-x hidden on body to prevent page-level horizontal scroll */
    overflow-x: hidden !important;
    overflow-y: visible !important;
    height: auto !important;
    min-height: 100vh !important;
  }

  /* Switch container to single column on tablet/mobile */
  #container {
    flex-direction: column !important;
    padding: 0 !important;
    gap: 0 !important;
  }

  #content,
  #content_wide,
  #content_nosky,
  .main-content {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 10px !important;
    /* FIX C5/C8: overflow-x:clip clips the container without creating a new scroll context,
       so inner .sos-table-wrap / .schedule-grid-wrap / .sos-details-wrap scrollbars stay visible
       and touch-scroll works. 'hidden' was killing the inner scroll containers. */
    overflow-x: clip !important;
  }

  /* Inner content wrapper allows horizontal scroll for tables */
  #startcontent {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important; /* Allow horizontal scrolling */
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch !important; /* Smooth scrolling on iOS */
    /* Ensure scrollbar visibility */
    -ms-overflow-style: scrollbar !important;
    scrollbar-width: auto !important;
  }

  /* Visible scroll indicator for tablet */
  #startcontent::-webkit-scrollbar {
    height: 10px !important;
  }

  /* --- HEADER ELEMENTS --- */
  /* Header wrapper needs to allow content to flow - don't clip */
  /* CRITICAL FIX: Reset zoom and min-width that blow up header on mobile */
  #header-stronga-wrapper,
  #header-stronga,
  #header,
  header.stronga,
  header {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow: visible !important; /* CRITICAL: Don't clip content */
    height: auto !important; /* Allow full height */
    display: block !important;
    zoom: 1 !important; /* CRITICAL: Reset zoom that causes header blowup */
    transform: none !important; /* Reset any transforms */
  }

  /* Specific fix for header-stronga inner element */
  #header-stronga {
    zoom: 1 !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    position: relative !important;
  }

  /* Outer container (around accelerate tag) - must also expand */
  accelerate + *,
  accelerate ~ *,
  body > #container,
  html > body > div#container {
    height: auto !important;
    min-height: 100vh !important;
    overflow: visible !important;
  }

  .headlinksBar,
  .headlinks,
  .logoBar,
  .bannerBox {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    display: block !important;
  }

  /* Collapse the logoBar on mobile — ad-adapex injects inline height:250px
     for a video ad that often renders empty (1px/opacity:0), creating a
     giant white gap. height:auto lets it collapse when the ad is empty. */
  .logoBar {
    height: auto !important;
    max-height: 120px !important;
    margin: 5px 0 !important;
  }

  .logoBar img,
  .bannerBox img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* --- DATA TABLES --- */
  table.grid,
  table.schedule,
  table.stats,
  table.rankings,
  .responsive-table {
    width: 100% !important;
    display: table !important;
    /* table-layout: fixed !important; REMOVED to allow expansion */
  }

  table.grid th,
  table.grid td,
  .responsive-table th,
  .responsive-table td {
    padding: 5px 4px !important;
    font-size: 13px !important; /* Improved readability */
  }

  /* NFL Schedule table - needs smaller text for 19 columns on tablet */
  table.schedule th,
  table.schedule td {
    padding: 3px 2px !important;
    font-size: 11px !important; /* Smaller for many-column tables */
    white-space: nowrap !important;
  }

  table.schedule span {
    font-size: 11px !important;
  }

  table.schedule a {
    font-size: 11px !important;
  }

  /* --- TEAM CARDS --- */
  div.team,
  .team-card,
  .player-card {
    width: calc(50% - 10px) !important;
    margin: 5px !important;
  }

  /* --- TYPOGRAPHY --- */
  h1.newpagetitle,
  .page-title {
    font-size: 22px !important;
    padding: 0 10px !important;
  }

  h2,
  .section-title {
    font-size: 18px !important;
  }

  /* --- ADS/FOOTER --- */
  .ad,
  .advertisement,
  [id*="usmg_ad"],
  [id*="google_ads"],
  #footer,
  #footer-wrapper,
  .FooterBox,
  .headlinks {
    display: none !important;
  }

  /* --- EMPTY FILTER FIX (Rankings Page) --- */
  /* Hide empty qb-touchdowns containers and empty filter headers */
  .scoring-method + .qb-touchdowns,
  .qb-touchdowns:empty,
  header#qb-filter:empty,
  #qb-filter:empty {
    display: none !important;
  }

  /* Hide any qb-touchdowns that only contains an empty header */
  .qb-touchdowns:has(header:only-child:empty) {
    display: none !important;
  }

  /* Hide empty bordered headers in filter sections */
  #qb-filter,
  header#qb-filter {
    border: none !important;
    background: transparent !important;
    min-height: 0 !important;
    height: auto !important;
  }

  /* Hide ad wrapper divs between filters and Last Updated */
  .topic-finder.compact > header + div:has([id*="usmg_ad"]) {
    display: none !important;
  }

  /* Reduce margin-top: 60px on Last Updated div */
  div[style*="margin-top: 60px"],
  div[style*="margin-top:60px"],
  header + div > div[style*="margin-top: 60px"],
  header + div > div[style*="margin-top:60px"] {
    margin-top: 10px !important;
  }

  /* --- UTILITIES --- */
  .hide-tablet {
    display: none !important;
  }
  .show-tablet {
    display: block !important;
  }
}

/* ============================================
   HEADER FIX - 601px to 800px range
   Overrides zoom: 150% from maincache.css
   ============================================ */
@media only screen and (min-width: 601px) and (max-width: 800px) {
  #header-stronga-wrapper,
  #header-stronga,
  #header,
  header.stronga,
  header {
    zoom: 1 !important; /* CRITICAL: Reset zoom that causes header blowup */
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    transform: none !important;
  }

  #toggle-menu {
    font-size: 18px !important; /* Reset oversized font */
    width: 100% !important;
  }
}

/* ============================================
   ZOOM RESET - Fix ALL zoom from maincache.css
   These selectors blow up content on mobile/tablet
   ============================================ */
@media (max-width: 800px) {
  /* Reset ALL zoom on topic-finder components */
  .topic-finder.compact h1,
  .fantasy-finder .topic-finder.compact h1,
  .player-finder-table .topic-finder.compact h1 {
    zoom: 90% !important;
    font-size: 22px !important;
  }

  .topic-finder.compact header,
  .fantasy-finder .topic-finder.compact header,
  .player-finder-table .topic-finder.compact header {
    zoom: 90% !important;
  }

  .topic-finder.compact #filterbar .scoringmethod-row,
  .topic-finder.compact header > .toggle-filters,
  .topic-finder.compact header > .toggle-filters.closed,
  .fantasy-finder .topic-finder.compact header > .toggle-filters.closed,
  .player-finder-table .topic-finder.compact header > .toggle-filters.closed {
    zoom: 90% !important;
  }

  .topic-finder.compact #filterbar #filters .filter,
  .topic-finder.compact #filterbar #filters .filter.fantasy-week,
  .fantasy-finder .topic-finder.compact #filterbar #filters .filter,
  .player-finder-table .topic-finder.compact #filterbar #filters .filter,
  .ppr-filter {
    zoom: 90% !important;
  }

  /* Universal zoom reset for any element */
  .toggle-filters,
  #filter-btn,
  .filter {
    zoom: 70% !important;
  }

  /* Reset header-stronga zoom at this breakpoint too */
  #header-stronga {
    zoom: 1 !important;
  }

  .topic-finder.compact img#hamburger {
    height: 15px !important;
    width: 15px !important;
  }

  .fantasy-finder .topic-finder.compact #filterbar #filters .filter h6 {
    padding-left: 35px;
  }

  .fantasy-finder
    .topic-finder.compact
    #filterbar
    #filters
    .filter
    h6
    + .icon:before,
  .fantasy-finder
    .topic-finder.compact
    #filterbar
    #filters
    .filter
    h6
    + label
    + .icon:before {
    position: absolute;
    top: 29px;
    padding-right: 10px !important;
  }

  /* ================================================
       ADDITIONAL ZOOM FIXES - "Members Get Downloadable" 
       and "Last Updated" sections + filter buttons
       ================================================ */

  /* Fix the "Members Get Downloadable" and "Last Updated" divs 
       These have zoom: 4 and zoom: 5 in maincache.css! */
  .topic-finder.compact > div,
  .topic-finder.compact > div > div,
  .topic-finder.compact.visible-responsive > div,
  .topic-finder.compact.visible-responsive > div > div,
  .fantasy-finder .topic-finder.compact > div,
  .fantasy-finder .topic-finder.compact > div > div,
  .fantasy-finder .topic-finder.compact.visible-responsive > div,
  .fantasy-finder .topic-finder.compact.visible-responsive > div > div {
    zoom: 90% !important;
  }

  /* Fix position filter buttons (Top 200, QB, RB, etc.) */
  .filter.button-list .buttons,
  .filter.button-list.positions-filter .buttons,
  .filter.positions-filter .buttons,
  #top200-dropdown .buttons,
  .positions-filter.drop-down .buttons {
    zoom: 90% !important;
  }

  /* Fix week filter dropdown */
  .filter.fantasy-week select,
  .filter.fantasy-week .rf-combobox-input,
  #week-dropdown select,
  .week-filter select {
    zoom: 90% !important;
  }

  /* Fix QB touchdowns filter */
  .filter.fantasy-qb-td select,
  #qb-dropdown select,
  .qbTouchdowns-filter select,
  .td-count select {
    zoom: 90% !important;
  }

  /* Nuclear option: Reset zoom on ALL direct children of topic-finder */
  .topic-finder * {
    zoom: 1 !important;
  }

  /* ================================================
       RANKINGS PAGE TABLE SCROLL FIX
       The rankings page uses a different structure:
       .fantasy-finder > .topic-finder > #results > table
       We need to allow horizontal scroll on the table container
       ================================================ */

  /* Allow scroll on the results container */
  #results,
  #results.table-responsive,
  .table-responsive {
    overflow-x: hidden !important; /* Prevent page-level horizontal scroll */
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch !important;
    max-width: 100% !important;
    width: 100% !important; /* Force to viewport width */
    min-width: 0 !important; /* Override Foundation grid minWidth: 100% */
  }

  /* CRITICAL: Override Foundation grid width calculation on mobile #results */
  /* The .columns.medium-8.large-8 classes calculate percentage-based widths that overflow */
  /* Use maximum specificity with attribute selectors to beat Foundation */
  .topic-finder.compact #results,
  .topic-finder.compact #results.columns,
  .topic-finder.compact #results.medium-8,
  .topic-finder.compact #results.large-8,
  .fantasy-finder .topic-finder.compact #results,
  .fantasy-finder #results.medium-8,
  .fantasy-finder #results.columns.medium-8.large-8,
  div[id="results"].columns,
  div[id="results"].medium-8,
  div[id="results"].large-8,
  div.topic-finder.compact div[id="results"],
  .fantasy-finder #results.medium-8,
  .fantasy-finder .topic-finder.compact #results.medium-8 {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  /* FLEX FIX: Keep flex layout but constrain width */
  /* Use maximum specificity to beat rankings.css */
  .fantasy-finder #results,
  .fantasy-finder #results.medium-8,
  .fantasy-finder #results.columns.medium-8.large-8,
  .fantasy-finder .topic-finder.compact #results,
  #results.players {
    display: flex !important; /* Keep flex for side-by-side layout */
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    float: none !important; /* Override Foundation .columns float:left */
    box-sizing: border-box !important;
    position: relative !important;
    overflow: visible !important; /* Allow content to be visible */
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Names column - fixed width, no shrink */
  .names-row {
    flex: 0 0 120px !important; /* Fixed 120px for player names */
    width: 120px !important;
    max-width: 120px !important;
    min-width: 120px !important;
    overflow: hidden !important;
  }

  /* Names table should fit within its container */
  .names-row table,
  .names-row .table {
    width: 100% !important;
    max-width: 120px !important;
    table-layout: fixed !important;
  }

  /* Fix Player header - smaller padding, truncate if needed */
  .names-row th.nameHeader,
  .names-row table th.nameHeader,
  .names-row th,
  .names-row table th {
    padding: 5px 3px !important;
    text-align: left !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  /* Player rank column - minimal width */
  .names-row th.playerRank,
  .names-row td.playerRank {
    width: 25px !important;
    min-width: 25px !important;
    max-width: 25px !important;
    padding: 5px 2px !important;
  }

  /* Player name cells */
  .names-row td.name {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 90px !important;
  }

  /* Stats column - takes remaining space, scrolls internally */
  .stats-col {
    flex: 1 1 auto !important; /* Grow to fill remaining space */
    min-width: 0 !important; /* Allow shrinking below content size */
    width: auto !important;
    margin-left: 0 !important; /* Remove float-based margin */
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Allow names to wrap */
  .names-row td.name {
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  /* Keep .players (legacy) styling */
  .players {
    width: auto !important;
    max-width: 140px !important;
    overflow-x: hidden !important;
  }
  /* FIXED: Parent containers should clip overflow to prevent page-level scroll */
  /* The scrolling happens INSIDE .stats-col and .players, not at page level */
  .fantasy-finder,
  .topic-finder,
  #main,
  #content-area {
    overflow-x: hidden !important;
    overflow-y: visible !important;
  }

  /* ONLY the stats-col table should expand for scrolling - NOT the player names table */
  /* The .players table should fit naturally within its container */
  .stats-col table,
  .stats-col .table,
  div.stats-col table {
    min-width: 500px !important;
    width: auto !important;
    max-width: none !important;
  }

  /* The player names table (.players) should NOT have min-width - it should fit the left column */
  .players table {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    table-layout: auto !important;
  }

  /* Ensure the # column and player name columns are reasonably sized */
  .players table th:first-child,
  .players table td:first-child {
    width: 30px !important;
    min-width: 30px !important;
    max-width: 40px !important;
  }

  /* ================================================
       MOBILE CLEANUP FIXES - December 2025
       Reduces whitespace, compacts filters, improves layout
       ================================================ */

  /* TASK 1: Reduce .fantasy-finder margin-top from 50px to 10px */
  .fantasy-finder {
    margin-top: 10px !important;
    margin-bottom: 0 !important;
  }

  /* CRITICAL: Reset zoom on all filter elements to prevent layout collapse */
  .topic-finder.compact.visible-responsive {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    zoom: 1 !important;
  }

  .topic-finder.compact.visible-responsive *,
  .topic-finder.compact.visible-responsive > div,
  .topic-finder.compact.visible-responsive > div > div,
  .fantasy-finder .topic-finder.compact.visible-responsive > div,
  .fantasy-finder .topic-finder.compact.visible-responsive > div > div {
    zoom: 1 !important;
  }

  /* TASK 2: Collapse .topic-finder.compact header height */
  .topic-finder.compact header {
    height: auto !important;
    max-height: none !important;
    padding: 5px 0 !important;
  }

  /* TASK 3: Tighter padding on #content for mobile */
  #content,
  #content_wide,
  #content_nosky {
    padding: 5px !important;
  }

  /* TASK 4-9: Compact filters for mobile */
  /* Reduce individual filter section heights */
  /* Use maximum specificity to override maincache.css */
  .filter,
  .filter.button-list,
  .filter.fantasy-week,
  .filter.fantasy-ppr,
  .filter.fantasy-qb-td,
  .filter.fantasy-scoring-method,
  .filter.selected,
  .positions .filter,
  .week .filter,
  .ppr .filter,
  .topic-finder .filter,
  .topic-finder.compact .filter,
  .topic-finder.compact.visible-responsive .filter,
  .fantasy-finder .topic-finder .filter,
  .fantasy-finder .topic-finder.compact .filter {
    /* display: block !important; REMOVED to allow JS toggling */
    height: auto !important;
    max-height: none !important; /* Allow expansion */
    padding: 0 !important; /* Remove padding from container */
    margin: 0 !important;
    background: transparent !important; /* Remove background from container */
    border: none !important; /* Remove border from container */
    border-radius: 0 !important;
    box-sizing: border-box !important;
    box-shadow: none !important; /* Remove any shadows */
  }

  /* Style the Header specifically to look like a button */
  .filter header,
  .filter h6,
  .positions header,
  .week header,
  .ppr header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    font-size: 14px !important;
    padding: 12px 15px !important; /* Comfortable touch target */
    margin: 0 0 5px 0 !important;
    height: auto !important;
    line-height: 1.4 !important;
    background: #f8f9fa !important; /* Light gray background */
    border: 1px solid #e9ecef !important; /* Subtle border */
    border-radius: 6px !important;
    color: #333 !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
  }

  /* Fix the arrow icon alignment */
  .filter header .icon,
  .filter header span.icon {
    float: none !important;
    margin: 0 !important;
    position: static !important;
  }

  /* Style the Dropdown Content specifically */
  .filter.button-list,
  .filter.fantasy-week,
  .filter.fantasy-ppr,
  .filter.fantasy-qb-td,
  .filter.fantasy-scoring-method,
  .filter.expanded,
  .filter.drop-down {
    background: #fff !important;
    border: 1px solid #e9ecef !important;
    border-radius: 6px !important;
    padding: 15px !important;
    margin-top: 5px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
  }

  /* Remove the blue bar from .selected */
  .filter.selected {
    border-left: none !important;
    padding-left: 0 !important;
  }

  /* CRITICAL FIX: Remove the 100px height pseudo-element from maincache.css */
  .fantasy-finder
    .topic-finder.compact
    #filterbar
    #filters
    .filter.selected:before,
  .player-finder-table
    .topic-finder.compact
    #filterbar
    #filters
    .filter.selected:before,
  .topic-finder.compact.visible-responsive .filter.selected:before,
  .filter.selected:before {
    content: none !important;
    display: none !important;
    height: 0 !important;
    width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Make .ppr, .positions, .week sections compact but allow expansion */
  .ppr,
  .positions,
  .week,
  .qb-touchdowns,
  .scoring-method {
    display: block !important;
    float: none !important;
    clear: both !important;
    height: auto !important;
    max-height: none !important; /* Allow dropdowns to expand */
    padding: 0 !important;
    margin: 0 0 5px 0 !important; /* Reduced from 12px */
    flex: 1 1 100% !important; /* Force full width */
    width: 100% !important;
    min-width: 0 !important;
  }

  /* Hide <br> tags inside filter sections - they add whitespace */
  .ppr br,
  .positions br,
  .week br,
  .qb-touchdowns br,
  .scoring-method br,
  #filterbar br,
  #filters br,
  .filterwrapper br {
    display: none !important;
  }

  /* Ensure the filter inner div fills the container */
  .ppr .filter,
  .positions .filter,
  .week .filter {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Make filter buttons/inputs smaller on mobile */
  .filter select,
  .filter input,
  .filter button,
  #filterbar select,
  #filterbar input,
  #filters select,
  #filters input {
    font-size: 16px !important; /* Prevents iOS zoom */
    padding: 12px !important;
    height: auto !important; /* Allow auto height */
    min-height: 44px !important; /* Standard touch target */
    max-height: none !important;
    width: 100% !important; /* Full width inputs */
    box-sizing: border-box !important;
    zoom: 1 !important; /* Reset zoom to prevent layout issues */
  }

  /* Ensure forms inside filters are full width */
  .filter form,
  #week-dropdown form,
  .week-filter form,
  .filter div {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
  }

  /* Force select visibility */
  .filter select {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    appearance: menulist !important;
    -webkit-appearance: menulist !important;
    background-color: #fff !important;
    color: #000 !important;
    border: 1px solid #ccc !important;
    z-index: 100 !important;
    position: relative !important;
  }

  /* Filter button styling */
  .filter .buttons,
  .button-list .buttons {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    justify-content: flex-start !important;
  }

  .filter .buttons button,
  .button-list .buttons button {
    font-size: 14px !important;
    padding: 10px 14px !important;
    min-width: 44px !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
  }

  /* Stack filter sections efficiently */
  .filterwrapper,
  #filterbar,
  #filters,
  #filters .basic {
    display: block !important; /* Use block instead of flex to avoid grid conflicts */
    padding: 0 !important;
    width: 100% !important;
  }

  /* Filter headers compact - REMOVED OLD RULE TO AVOID CONFLICT */
  /* See new rule above */

  /* TASK 10 & 11: Reduce h1 title padding and height */
  /* Override maincache.css .fantasy-finder .topic-finder header h1 with higher specificity */
  .topic-finder.compact h1,
  .topic-finder h1,
  .fantasy-finder h1,
  .fantasy-finder .topic-finder header h1,
  .fantasy-finder .topic-finder.compact header h1,
  .player-finder-table .topic-finder header h1,
  .player-finder-table .topic-finder.compact header h1 {
    padding: 5px 0 !important;
    margin: 10px 0 5px 0 !important;
    font-size: 18px !important;
    line-height: 1.2 !important;
    height: auto !important;
    text-align: center !important;
    width: 100% !important;
  }

  /* Hide the second H1 (Customize These Rankings) to save space */
  .topic-finder.compact.visible-responsive a h1,
  .topic-finder.compact.visible-responsive a[href*="CustomScoring"] {
    display: none !important;
  }

  /* TASK 12: Hide "Print My One Pager" on mobile */
  .printmyonepagericon,
  .printmyonepager {
    display: none !important;
  }

  /* TASK 13: Compact table header row */
  .players table th,
  .stats-col table th,
  .topic-finder table th {
    padding: 4px 3px !important;
    font-size: 11px !important;
    height: auto !important;
  }

  /* TASK 14: Touch targets for table cells (min 44px) */
  .players table td,
  .stats-col table td,
  .topic-finder table td {
    padding: 8px 4px !important;
    font-size: 12px !important;
    min-height: 44px !important;
    vertical-align: middle !important;
  }

  /* TASK 15: Table row alternating colors */
  .players table tr:nth-child(even),
  .stats-col table tr:nth-child(even),
  .topic-finder table tr:nth-child(even) {
    background-color: #f8f9fa !important;
  }

  .players table tr:nth-child(odd),
  .stats-col table tr:nth-child(odd),
  .topic-finder table tr:nth-child(odd) {
    background-color: #ffffff !important;
  }

  /* Toggle filters button styling */
  .toggle-filters,
  button.toggle-filters {
    display: block !important;
    width: 100% !important;
    padding: 8px 10px !important;
    font-size: 14px !important;
    background: #f0f0f0 !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    margin: 5px 0 !important;
  }

  /* Scoring method row compact */
  .scoringmethod-row {
    padding: 3px !important;
    margin: 2px 0 !important;
    font-size: 11px !important;
  }
}

/* ============================================
   SCROLLBAR VISIBILITY & TOUCH IMPROVEMENTS
   ============================================ */

/* Custom scrollbar for webkit browsers (Chrome, Safari, Edge) */
#startcontent::-webkit-scrollbar,
#results::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar,
.stats-col::-webkit-scrollbar,
.players::-webkit-scrollbar {
  height: 10px !important; /* Thicker scrollbar for visibility */
  background: #f0f0f0;
}

#startcontent::-webkit-scrollbar-track,
#results::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track,
.stats-col::-webkit-scrollbar-track,
.players::-webkit-scrollbar-track {
  background: #e0e0e0;
  border-radius: 5px;
}

#startcontent::-webkit-scrollbar-thumb,
#results::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb,
.stats-col::-webkit-scrollbar-thumb,
.players::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #666, #888);
  border-radius: 5px;
  border: 1px solid #ddd;
}

#startcontent::-webkit-scrollbar-thumb:hover,
#results::-webkit-scrollbar-thumb:hover,
.table-responsive::-webkit-scrollbar-thumb:hover,
.stats-col::-webkit-scrollbar-thumb:hover,
.players::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #555, #777);
}

/* Firefox scrollbar styling */
#startcontent,
#results,
.table-responsive,
.stats-col,
.players {
  scrollbar-width: auto;
  scrollbar-color: #666 #e0e0e0;
}

/* Scroll shadow indicators - show when content can scroll */
.scroll-container,
#startcontent {
  background: 
        /* Shadow on left */
    linear-gradient(to right, white 30%, rgba(255, 255, 255, 0)),
    linear-gradient(to right, rgba(255, 255, 255, 0), white 70%),
    /* Shadow reveals */
    linear-gradient(to right, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0)),
    linear-gradient(to left, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0));
  background-position:
    left center,
    right center,
    left center,
    right center;
  background-repeat: no-repeat;
  background-size:
    40px 100%,
    40px 100%,
    15px 100%,
    15px 100%;
  background-attachment: local, local, scroll, scroll;
}

/* ============================================
   MEDIA QUERIES - MOBILE (480px and below)
   ============================================ */
@media (max-width: 480px) {
  /* --- SCROLL CONTAINER FOR TABLES --- */
  /* Make #startcontent the scroll container for wide tables */
  #startcontent {
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 10px !important;
    /* Ensure scrollbar is always visible on mobile */
    -ms-overflow-style: scrollbar !important;
  }

  /* More prominent scrollbar on mobile */
  #startcontent::-webkit-scrollbar {
    height: 12px !important; /* Even thicker for touch */
  }

  #startcontent::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #0066cc, #0088ff) !important;
    min-width: 60px; /* Easier to grab */
  }

  /* --- DATA TABLES - Horizontal Scroll --- */
  /* Tables expand to fit content, parent container scrolls */
  table.grid,
  table.schedule,
  table.stats,
  table.rankings,
  .responsive-table,
  table[cellpadding],
  table[align="center"] {
    display: table !important;
    width: auto !important; /* Let table size to content */
    min-width: 600px !important; /* Force horizontal scroll on narrow screens */
    max-width: none !important;
    table-layout: auto !important; /* Allow columns to size naturally */
  }

  /* Inner table structure - Reset to defaults */
  table.grid tbody,
  table.grid thead,
  table.schedule tbody,
  table.schedule thead,
  .responsive-table tbody,
  .responsive-table thead {
    display: table-row-group !important;
    width: auto !important;
    min-width: 0 !important;
  }
  table.grid thead,
  table.schedule thead,
  .responsive-table thead {
    display: table-header-group !important;
  }

  table.grid th,
  table.grid td,
  .responsive-table th,
  .responsive-table td {
    padding: 5px 3px !important;
    font-size: 13px !important; /* Improved readability */
  }

  /* NFL Schedule table - needs extra small text for 19 columns */
  table.schedule th,
  table.schedule td {
    padding: 2px 1px !important;
    font-size: 10px !important; /* Smaller for many columns */
    white-space: nowrap !important;
  }

  table.schedule span {
    font-size: 10px !important;
  }

  table.grid a,
  .responsive-table a {
    font-size: 13px !important;
  }

  table.schedule a {
    font-size: 10px !important;
  }

  /* Fix nowrap cells that cause overflow */
  td[nowrap],
  th[nowrap] {
    white-space: normal !important;
  }

  /* --- HEADER FIX FOR MOBILE --- */
  /* CRITICAL: Reset zoom and min-width on header elements */
  #header-stronga-wrapper,
  #header-stronga,
  #header,
  header.stronga,
  header {
    zoom: 1 !important;
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  /* --- TEAM CARDS - Single Column --- */
  div.team,
  .team-card,
  .player-card {
    width: 100% !important;
    margin: 8px 0 !important;
  }

  /* --- TYPOGRAPHY --- */
  h1.newpagetitle,
  .page-title {
    font-size: 19px !important;
  }

  h2,
  .section-title {
    font-size: 16px !important;
  }

  body {
    font-size: 14px !important;
  }

  /* --- UTILITIES --- */
  .hide-mobile {
    display: none !important;
  }
  .show-mobile {
    display: block !important;
  }
}

/* ============================================
   CATCH-ALL: Pages Without Standard Containers
   Handles pages that don't use #wrapper/#content/#startcontent
   (e.g., all-time-leaderboard.cfm, draftchart.cfm, error pages)
   These pages have tables/content directly in <body>.
   ============================================ */

/* --- Tablet and below (768px) --- */
@media (max-width: 768px) {
  /* Tables outside standard containers: make horizontally scrollable.
       display:block allows overflow-x:auto to create a scroll container. */
  body > table,
  body > center > table,
  body > form > table,
  body > div:not(#wrapper) > table,
  body > div:not(#wrapper) > div > table,
  body > div:not(#wrapper) > center > table {
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-width: 100vw !important;
  }

  /* Override inline width styles that exceed viewport (e.g., draftchart.cfm) */
  body > div > div[style*="width:"],
  body > div[style*="width:"],
  body > center > div[style*="width:"],
  body > center div[style*="width:"] {
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Constrain images in non-standard layout pages (e.g., error page yellow-flag) */
  body > table img,
  body > center > table img,
  body > center img,
  body > div:not(#wrapper) > table img,
  body > div:not(#wrapper) img[width],
  body > div:not(#wrapper) img[style*="width:"] {
    max-width: 100% !important;
    height: auto !important;
  }
}

/* --- Phone screens (480px) --- */
@media (max-width: 480px) {
  /* Tighter scroll rules + smaller font for phone */
  body > table,
  body > center > table,
  body > form > table,
  body > div:not(#wrapper) > table,
  body > div:not(#wrapper) > div > table,
  body > div:not(#wrapper) > center > table {
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-width: 100vw !important;
    font-size: 12px !important;
  }

  /* Compact table cells on phone */
  body > table td,
  body > center > table td,
  body > div:not(#wrapper) > table td,
  body > div:not(#wrapper) > div > table td {
    padding: 4px 2px !important;
  }

  body > table th,
  body > center > table th,
  body > div:not(#wrapper) > table th,
  body > div:not(#wrapper) > div > table th {
    padding: 3px 2px !important;
    font-size: 11px !important;
  }
}

/* Scrollbar styling for body-level scrollable tables */
body > table::-webkit-scrollbar,
body > center > table::-webkit-scrollbar,
body > div:not(#wrapper) > table::-webkit-scrollbar,
body > div:not(#wrapper) > div > table::-webkit-scrollbar {
  height: 10px !important;
  background: #f0f0f0;
}

body > table::-webkit-scrollbar-thumb,
body > center > table::-webkit-scrollbar-thumb,
body > div:not(#wrapper) > table::-webkit-scrollbar-thumb,
body > div:not(#wrapper) > div > table::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #666, #888);
  border-radius: 5px;
  border: 1px solid #ddd;
}

body > table::-webkit-scrollbar-track,
body > center > table::-webkit-scrollbar-track,
body > div:not(#wrapper) > table::-webkit-scrollbar-track,
body > div:not(#wrapper) > div > table::-webkit-scrollbar-track {
  background: #e0e0e0;
  border-radius: 5px;
}

/* Firefox scrollbar for body-level tables */
body > table,
body > center > table,
body > div:not(#wrapper) > table,
body > div:not(#wrapper) > div > table {
  scrollbar-width: auto;
  scrollbar-color: #666 #e0e0e0;
}

/* ============================================
   MEDIA QUERIES - LARGE DESKTOP (1200px+)
   ============================================ */
@media (min-width: 1200px) {
  /* --- LAYOUT --- */
  #wrapper,
  #container,
  .page-wrapper {
    max-width: 1400px;
  }

  /* --- TEAM CARDS --- */
  div.team,
  .team-card,
  .player-card {
    width: calc(20% - 12px);
  }

  /* --- UTILITIES --- */
  .hide-desktop {
    display: none !important;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  #side-a,
  #side-b,
  .sidebar,
  .site-menu-parent,
  .ad,
  .advertisement,
  #footer,
  .FooterBox,
  nav,
  .navigation {
    display: none !important;
  }

  #content,
  #content_wide,
  .main-content {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  table.grid,
  table.schedule,
  .responsive-table {
    font-size: 10px !important;
  }

  a {
    text-decoration: none;
    color: black;
  }
}

/* ============================================
   STRENGTH OF SCHEDULE TOOL
   ============================================ */
.sos-toolbar {
  display: grid;
  grid-template-columns: minmax(210px, 2fr) minmax(160px, 1fr) minmax(210px, 2fr) minmax(150px, 1fr);
  gap: 10px;
  align-items: stretch;
  margin: 16px auto 12px;
  max-width: 1040px;
}

.sos-toolbar-title {
  grid-column: 1 / -1;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: #4a5568;
}

.sos-control-group {
  border: 1px solid #cfd8e3;
  background: #f8fafc;
  padding: 9px;
  min-width: 0;
}

.sos-control-label {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: #1f2937;
}

.sos-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sos-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid #b8c3cf;
  background: #ffffff;
  color: #1f2937 !important;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none !important;
  white-space: nowrap;
}

.sos-option:hover,
.sos-option:focus {
  border-color: #475569;
  background: #eef2f7;
  color: #111827 !important;
}

.sos-option.is-active {
  border-color: #143d6b;
  background: #143d6b;
  color: #ffffff !important;
}

.sos-control-group-compact .sos-options {
  height: calc(100% - 22px);
}

.sos-control-group-compact .sos-option {
  width: 100%;
  min-height: 62px;
  white-space: normal;
  text-align: center;
}

.sos-context {
  margin: 12px 0 14px;
}

.sos-context p {
  margin-bottom: 8px;
}

body.fft-data-tool .logoBar {
  height: auto !important;
  min-height: 0 !important;
  max-height: 44px !important;
  margin: 4px 0 !important;
  overflow: hidden !important;
}

body.fft-data-tool .bannerBox {
  min-height: 0 !important;
  max-height: 44px !important;
  overflow: hidden !important;
}

body.fft-data-tool .bannerBox:empty {
  display: none !important;
}

#content.no-leftnav,
#content_nosky.no-leftnav,
#content_wide.no-leftnav {
  float: none !important;
  width: 100% !important;
  max-width: 965px !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
}

.sos-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #374151;
}

.sos-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.sos-legend-swatch {
  display: inline-block;
  width: 16px;
  height: 10px;
  border: 1px solid rgba(0, 0, 0, 0.18);
}

.sos-best-swatch {
  background: #c6f6d5;
}

.sos-worst-swatch {
  background: #fed7d7;
}

.sos-playoff-swatch {
  background: #1a365d;
}

.sos-details-legend {
  margin: 8px 0 10px;
}

.sos-table-wrap {
  display: block;
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow-x: auto !important;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: auto !important;
  scrollbar-color: #667085 #eef2f7;
}

.schedule-grid-wrap,
.sos-details-wrap {
  display: block;
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow-x: auto !important;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: auto !important;
  scrollbar-color: #667085 #eef2f7;
  padding-bottom: 8px;
}

.sos-table-wrap::-webkit-scrollbar,
.schedule-grid-wrap::-webkit-scrollbar,
.sos-details-wrap::-webkit-scrollbar {
  height: 10px;
}

.sos-table-wrap::-webkit-scrollbar-track,
.schedule-grid-wrap::-webkit-scrollbar-track,
.sos-details-wrap::-webkit-scrollbar-track {
  background: #eef2f7;
}

.sos-table-wrap::-webkit-scrollbar-thumb,
.schedule-grid-wrap::-webkit-scrollbar-thumb,
.sos-details-wrap::-webkit-scrollbar-thumb {
  background: #667085;
  border-radius: 999px;
}

.sos-table-wrap::after,
.schedule-grid-wrap::after,
.sos-details-wrap::after {
  content: "";
  position: sticky;
  right: 0;
  display: block;
  width: 36px;
  height: 1px;
  margin-top: -1px;
  margin-left: auto;
  pointer-events: none;
  box-shadow: inset -18px 0 16px -16px rgba(20, 61, 107, 0.65);
}

.sos-rankings-grid {
  min-width: 760px;
}

@media (max-width: 800px) {
  .sos-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .sos-control-group-compact .sos-option {
    min-height: 36px;
  }
}

@media (max-width: 520px) {
  .sos-toolbar {
    grid-template-columns: 1fr;
  }

  .sos-option {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* Mobile header: keep login helper copy from overlapping the menu/login bar. */
@media (max-width: 600px) {
  #header-stronga #user-menu-stronga,
  #user-menu-stronga {
    top: 7px !important;
    right: 8px !important;
    width: auto !important;
    max-width: 104px !important;
    min-width: 0 !important;
    line-height: 1 !important;
    text-align: right !important;
  }

  #header-stronga .lgn-btn-msg,
  #user-menu-stronga .lgn-btn-msg {
    position: static !important;
    display: none !important;
  }

  #header-stronga #user-menu-stronga .button-reset,
  #user-menu-stronga .button-reset {
    min-width: 0 !important;
    padding: 0 !important;
    font-size: 12px !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
  }
}

/* SoS rankings table — remove per-cell inline styles */
.sos-rankings-grid {
  min-width: 760px;
  border-collapse: collapse;
}

.sos-rankings-grid th {
  background: #454545;
  color: #ffffff;
  border: 1px solid #e5e5e5;
  padding: 6px 8px;
  white-space: nowrap;
}

.sos-rankings-grid th a {
  color: #ffffff !important;
  text-decoration: none;
}

.sos-rankings-grid th a:hover {
  color: #a8d4ff !important;
  text-decoration: underline;
}

/* Active sort column: highlight with arrow indicator */
.sos-rankings-grid th.sorted {
  background: #2c5282;
}

.sos-rankings-grid td {
  padding: 5px 8px;
  border: 1px solid #e5e5e5;
  text-align: center;
}

.sos-rankings-grid td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #ffffff;
  text-align: left;
}

.sos-rankings-grid tr:nth-child(even) td:first-child {
  background: #f8fafc;
}

.sos-rankings-grid th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
}

.sos-rankings-grid .best a,
.sos-rankings-grid .worst a {
  color: inherit !important;
  font-weight: 700;
}

.sos-details-grid {
  min-width: 980px;
}

.sos-details-grid th,
.sos-details-grid td {
  white-space: nowrap;
}

.sos-details-grid th:first-child,
.sos-details-grid td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #ffffff;
}

.sos-details-grid th:first-child {
  z-index: 2;
}

.nfl-schedule-grid {
  min-width: 1120px;
}

.schedule-grid-wrap .schedule th,
.schedule-grid-wrap .schedule td {
  white-space: nowrap;
}

.schedule-grid-wrap .schedule th:first-child,
.schedule-grid-wrap .schedule td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #ffffff;
}

.schedule-grid-wrap .schedule th:first-child {
  z-index: 2;
  background: #454545;
}

.schedule-grid-wrap .schedule tr:nth-child(even) td:first-child {
  background: #f6f6f6;
}

/* Best/Worst highlighting — modernized but still clearly green/red */
.best {
  background: #c6f6d5 !important;
  color: #1a4731;
}

.worst {
  background: #fed7d7 !important;
  color: #5a1a1a;
}


/* ─── NFL Schedule Grid: full styling ─── */
.nfl-schedule-grid {
  border-collapse: collapse;
  font-size: 12px !important;
  line-height: 1.35 !important;
  width: 100%;
}
.nfl-schedule-grid th,
.nfl-schedule-grid td {
  padding: 4px 6px;
  height: 24px;
  font-size: 12px !important;
  line-height: 1.35 !important;
  text-align: center;
  border: 1px solid #d1d5db;
  white-space: nowrap;
}

table.schedule.nfl-schedule-grid th,
table.schedule.nfl-schedule-grid td,
table.schedule.nfl-schedule-grid a,
table.grid.sos-details-grid th,
table.grid.sos-details-grid td,
table.grid.sos-details-grid a {
  font-size: 12px !important;
  line-height: 1.35 !important;
}
.nfl-schedule-grid thead tr {
  background: #454545;
  color: #fff;
}
.nfl-schedule-grid thead th {
  color: #fff;
  font-weight: 700;
}
.nfl-schedule-grid tbody tr:nth-child(even) {
  background: #f7f8fa;
}
.nfl-schedule-grid tbody tr:hover {
  background: #eff6ff;
}
.nfl-schedule-grid td:first-child,
.nfl-schedule-grid th:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  z-index: 1;
}
.nfl-schedule-grid tbody tr:nth-child(odd) td:first-child {
  background: #fff;
}
.nfl-schedule-grid tbody tr:nth-child(even) td:first-child {
  background: #f7f8fa;
}
.nfl-schedule-grid tbody tr:hover td:first-child {
  background: #eff6ff;
}
.nfl-schedule-grid thead th:first-child {
  background: #454545;
  z-index: 2;
}
/* BYE week: bold red */
.nfl-schedule-grid td.bye {
  color: #dc2626;
  font-weight: 700;
}
/* Away game: muted */
.nfl-schedule-grid td.away {
  color: #4b5563;
}
/* Playoff weeks 14-18: dark blue header */
.nfl-schedule-grid th.playoff-col {
  background: #1a365d !important;
}
@media (max-width: 600px) {
  .nfl-schedule-grid {
    font-size: 12px !important;
  }
  .nfl-schedule-grid th,
  .nfl-schedule-grid td {
    padding: 4px 6px;
    height: 24px;
    font-size: 12px !important;
  }

  table.schedule.nfl-schedule-grid th,
  table.schedule.nfl-schedule-grid td,
  table.schedule.nfl-schedule-grid a {
    font-size: 12px !important;
    line-height: 1.35 !important;
  }
}

/* ─── SoS Details Grid: full styling + heat map ─── */
.sos-details-grid {
  border-collapse: collapse;
  font-size: 12px !important;
  line-height: 1.35 !important;
  width: 100%;
}

/* ─── Season hub: controlled annual launch page ─── */
.season-hub {
  margin: 0 auto 28px;
  max-width: 980px;
}

.season-hub-header p,
.season-hub-status p {
  color: #3f4a59;
  font-size: 15px;
  line-height: 1.55;
  margin: 8px 0 18px;
}

.season-hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 22px;
}

.season-hub-link {
  background: #ffffff;
  border: 1px solid #d7e0ea;
  border-radius: 8px;
  color: #172033 !important;
  display: block;
  min-height: 112px;
  padding: 14px 16px;
  text-decoration: none !important;
}

.season-hub-link:hover,
.season-hub-link:focus {
  border-color: #1f6fb2;
  box-shadow: 0 2px 8px rgba(25, 77, 126, 0.15);
}

.season-hub-link strong {
  display: block;
  font-size: 18px;
  line-height: 1.25;
  margin: 6px 0;
}

.season-hub-link span:last-child {
  color: #4c5968;
  display: block;
  font-size: 14px;
  line-height: 1.35;
}

.season-hub-kicker {
  color: #086a3b;
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.season-hub-status {
  border-top: 1px solid #d7e0ea;
  padding-top: 16px;
}

.season-hub-status h2 {
  color: #172033 !important;
  font-size: 20px;
  margin: 0 0 6px;
}

/* Controlled data-review fallback for public pages whose source table is not approved. */
.controlled-unavailable {
  max-width: 860px;
  margin: 20px auto 36px;
  padding: 22px;
  border: 1px solid #d9e2ea;
  background: #f8fbfd;
}

.controlled-unavailable p {
  max-width: 720px;
  font-size: 16px;
  line-height: 1.55;
}

.controlled-unavailable-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.controlled-unavailable-actions a {
  display: inline-block;
  padding: 9px 13px;
  border: 1px solid #b9c8d5;
  background: #fff;
  color: #174c78;
  font-weight: 700;
  text-decoration: none !important;
}

.controlled-unavailable-actions a:hover,
.controlled-unavailable-actions a:focus {
  border-color: #174c78;
  background: #eef6fb;
}

@media (max-width: 640px) {
  .season-hub {
    margin-bottom: 20px;
  }

  .season-hub-grid {
    grid-template-columns: 1fr;
  }

  .season-hub-link {
    min-height: 0;
  }

  .controlled-unavailable {
    margin: 14px 0 28px;
    padding: 16px;
  }

  .controlled-unavailable-actions {
    display: block;
  }

  .controlled-unavailable-actions a {
    display: block;
    margin-bottom: 10px;
    text-align: center;
  }
}
.sos-details-grid th,
.sos-details-grid td {
  padding: 5px 7px;
  height: 24px;
  font-size: 12px !important;
  line-height: 1.35 !important;
  text-align: center;
  border: 1px solid #d1d5db;
}
.sos-details-grid thead tr:first-child th {
  background: #454545;
  color: #fff;
  font-weight: 700;
}
.sos-details-grid thead tr:nth-child(2) th {
  background: #2d3748;
  color: #e2e8f0;
  font-size: 0.88em;
}
.sos-details-grid tbody tr:nth-child(even) {
  background: #f7f8fa;
}
.sos-details-grid tbody tr:hover {
  background: #eff6ff;
}
.sos-details-grid td:first-child {
  font-weight: 700;
  text-align: left;
  background: #fff;
  border-right: 2px solid #d1d5db;
}
.sos-details-grid tbody tr:nth-child(even) td:first-child {
  background: #f7f8fa;
}
/* Away game week header */
.sos-details-grid thead tr:nth-child(2) th.week-away {
  background: #374151;
}
/* BYE week header */
.sos-details-grid thead tr:nth-child(2) th.week-bye {
  background: #7f1d1d;
  color: #fef2f2;
}
/* Playoff week headers 14-18 */
.sos-details-grid thead tr:nth-child(2) th.playoff-col {
  background: #1a365d !important;
  color: #93c5fd;
}
/* Heat map: high pts allowed = easy matchup = green */
.sos-details-grid td.pts-easy {
  background: #c6f6d5 !important;
  color: #1a4731;
  font-weight: 700;
}
/* Heat map: low pts allowed = hard matchup = red */
.sos-details-grid td.pts-hard {
  background: #fed7d7 !important;
  color: #5a1a1a;
  font-weight: 700;
}
@media (max-width: 600px) {
  .sos-details-grid {
    font-size: 12px !important;
  }
  .sos-details-grid th,
  .sos-details-grid td {
    padding: 4px 6px;
    height: 24px;
    font-size: 12px !important;
  }

  table.grid.sos-details-grid th,
  table.grid.sos-details-grid td,
  table.grid.sos-details-grid a {
    font-size: 12px !important;
    line-height: 1.35 !important;
  }
}

/* ─── WCAG floor at 375px: schedule + details grids must stay ≥12px / ≥22px row ─── */
@media (max-width: 480px) {
  /* FIX C7: Schedule grid — WCAG minimum font/row-height */
  table.schedule.nfl-schedule-grid,
  table.schedule.nfl-schedule-grid th,
  table.schedule.nfl-schedule-grid td,
  table.schedule.nfl-schedule-grid a {
    font-size: 12px !important;
    line-height: 1.4 !important;
  }
  table.schedule.nfl-schedule-grid th,
  table.schedule.nfl-schedule-grid td {
    min-height: 22px !important;
    height: auto !important;
    padding: 3px 5px !important;
  }
  /* FIX C7: SoS details grid — same WCAG floor */
  table.grid.sos-details-grid,
  table.grid.sos-details-grid th,
  table.grid.sos-details-grid td,
  table.grid.sos-details-grid a {
    font-size: 12px !important;
    line-height: 1.4 !important;
  }
  table.grid.sos-details-grid th,
  table.grid.sos-details-grid td {
    min-height: 22px !important;
    height: auto !important;
    padding: 3px 5px !important;
  }
}
