/*
 * RotoBaller — NFL Fantasy Strength of Schedule grid.
 * One table: 32 teams × 18 weeks filling the full desktop width, 30px rows. Same palette and
 * Outfit type as the Matchup Ratings tool. The toolbar and the header row stick to the top of
 * the page while it scrolls (offset by --sos-stick, whatever the site keeps fixed up there, and
 * --sos-tb, the toolbar's height — both set from JS). Below 1200px the table scrolls sideways
 * inside its own wrapper with the team column pinned, and the header row scrolls with it.
 */

#rb-nflsos {
	--sos-bg: #F3F5F9; --sos-surface: #fff; --sos-surface-2: #EDF1F7; --sos-ink: #142238; --sos-muted: #64748B;
	--sos-line: #DDE3EC; --sos-accent: #1E5EA8; --sos-accent-soft: #E3ECF8; --sos-accent-soft-ink: #174A85; --sos-cell-ink: #101B2E;
	--sos-font: 'Outfit', -apple-system, "Helvetica Neue", Arial, sans-serif;
	font-family: var(--sos-font); font-size: 13px; line-height: 1.4; color: var(--sos-ink);
	-webkit-text-size-adjust: 100%; margin: 0 0 30px;
}
#rb-nflsos *, #rb-nflsos *::before, #rb-nflsos *::after { box-sizing: border-box; }
#rb-nflsos button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; margin: 0; box-shadow: none; text-transform: none; letter-spacing: 0; border-radius: 0; }
#rb-nflsos select { font: inherit; color: inherit; margin: 0; box-shadow: none; }
#rb-nflsos button:focus-visible, #rb-nflsos select:focus-visible { outline: 2px solid var(--sos-accent); outline-offset: 2px; }
#rb-nflsos p { margin: 0; }
#rb-nflsos img { border: 0; box-shadow: none; }

/* The tool page runs full width: no sidebar, content column stretched (theme uses a fixed 960 grid). */
body.rb-nflsos-on #content.grid_10 { width: auto !important; max-width: none !important; margin: 0 !important; }
body.rb-nflsos-on #sb-container { display: none !important; }
body.rb-nflsos-on #rb-nflsos { margin-top: 14px; max-width: calc(100vw - 24px); }
/* The theme's overflow-x:hidden on html/body makes body the scroll container that sticky
   descendants track, and body never scrolls. clip hides the same overflow without becoming one. */
html:has(#rb-nflsos), body:has(#rb-nflsos) { overflow-x: clip !important; overflow-y: visible !important; }
/* With body no longer a scroll container, the first block's top margin collapses through body and
   pushes the fixed mobile nav's static position down 32px: a blank band above the nav on phones.
   flow-root keeps the margin inside (same fix as Matchup Ratings). */
body:has(#rb-nflsos) { display: flow-root; }
/* Raptive's video reserve near the tool, still empty after a few seconds (see the JS). Its
   min-height is inline, hence !important. */
.rb-nflsos-empty { min-height: 0 !important; height: 0 !important; margin: 0 !important; padding: 0 !important; overflow: hidden; }

/* Reader-facing intro: small, italic, scrolls away above the sticky toolbar. */
#rb-nflsos .sos-intro { font-size: 12px; font-style: italic; color: var(--sos-muted); margin: 0 0 6px; line-height: 1.45; text-align: center; }

/* ---------- controls (sticky) ---------- */
#rb-nflsos .sos-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 4px 0 8px; position: sticky; top: var(--sos-stick, 0px); z-index: 6; background: var(--sos-surface); }
#rb-nflsos .sos-sel { display: inline-flex; align-items: center; height: 34px; border-radius: 6px; background: var(--sos-surface-2); padding: 0 8px 0 10px; position: relative; }
#rb-nflsos .sos-sel select { appearance: none; -webkit-appearance: none; border: 0; background: none; font-weight: 700; font-size: 14px; padding: 0 18px 0 0; height: 100%; line-height: 1; cursor: pointer; }
#rb-nflsos .sos-sel svg { position: absolute; right: 8px; color: var(--sos-muted); pointer-events: none; }
#rb-nflsos .sos-legend { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--sos-muted); }
#rb-nflsos .sos-legend .sw { width: 22px; height: 14px; border-radius: 3px; border: 1px solid var(--sos-line); margin-left: 8px; }
#rb-nflsos .sos-legend .sw:first-child { margin-left: 0; }
#rb-nflsos .sos-loading, #rb-nflsos .sos-err { padding: 30px 0; color: var(--sos-muted); text-align: center; }

/* ---------- grid ---------- */
/* Not a scroll container on desktop (the fixed-layout table never overflows), so the header can stick to the page. */
#rb-nflsos .sos-wrap { overflow: visible; overflow-x: clip; border: 1px solid var(--sos-line); border-radius: 8px; background: var(--sos-surface); }
/* The theme's DOM-ready script wraps every content table in an overflow:auto .table-wrapper, which
   would become the header row's scroll container; neutralise it (the sideways scroll lives on .sos-wrap). */
#rb-nflsos .table-wrapper { overflow: visible !important; overflow-x: clip !important; margin: 0 !important; padding: 0 !important; }
#rb-nflsos table.sos { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; margin: 0; font-size: 12px; }
#rb-nflsos table.sos th, #rb-nflsos table.sos td { padding: 0; border: 0; border-bottom: 1px solid var(--sos-line); border-right: 1px solid var(--sos-line); text-align: center; vertical-align: middle; height: 30px; line-height: 1; white-space: nowrap; }
#rb-nflsos table.sos th:last-child, #rb-nflsos table.sos td:last-child { border-right: 0; }
#rb-nflsos table.sos tbody tr:last-child td { border-bottom: 0; }
#rb-nflsos table.sos th { background: var(--sos-surface-2); font-size: 11px; font-weight: 700; color: var(--sos-muted); text-transform: uppercase; letter-spacing: .04em; position: sticky; top: calc(var(--sos-stick, 0px) + var(--sos-tb, 0px)); z-index: 5; }
#rb-nflsos table.sos th button { width: 100%; height: 32px; display: inline-flex; align-items: center; justify-content: center; gap: 3px; font-weight: 700; }
#rb-nflsos table.sos th button:hover { color: var(--sos-ink); }
#rb-nflsos table.sos th.on button { color: var(--sos-accent-soft-ink); }
#rb-nflsos table.sos th .arr { font-size: 8px; }
#rb-nflsos table.sos th.cur { background: var(--sos-accent-soft); color: var(--sos-accent-soft-ink); }
/* Team column is fixed; the 18 week columns share whatever width is left. */
#rb-nflsos table.sos th.team { width: 96px; text-align: left; }
#rb-nflsos table.sos th.team button { justify-content: flex-start; padding-left: 10px; }

#rb-nflsos table.sos td.team { text-align: left; background: var(--sos-surface); position: sticky; left: 0; z-index: 1; }
#rb-nflsos table.sos td.team .w { display: flex; align-items: center; gap: 7px; height: 30px; padding-left: 10px; }
#rb-nflsos table.sos td.team .logo { width: 20px; height: 20px; object-fit: contain; flex: none; display: block; }
#rb-nflsos table.sos td.team b { font-weight: 700; font-size: 13px; }
#rb-nflsos table.sos td.c { color: var(--sos-cell-ink); cursor: default; }
#rb-nflsos table.sos td.c .o { display: inline-block; font-size: 10.5px; font-weight: 500; color: var(--sos-muted); margin-right: 4px; letter-spacing: -.01em; }
#rb-nflsos table.sos td.c b { font-weight: 800; font-size: 13.5px; letter-spacing: -.01em; }
/* Dark fills (deep end of the teal ramp) carry white text; the opponent tag softens to match. */
#rb-nflsos table.sos td.c.dk { color: #fff; }
#rb-nflsos table.sos td.c.dk .o { color: rgba(255,255,255,.78); }
#rb-nflsos table.sos td.c.bye { background: var(--sos-surface-2); }
#rb-nflsos table.sos td.c.bye b { font-weight: 800; font-size: 12px; color: var(--sos-ink); }
#rb-nflsos table.sos td.c.na b { color: var(--sos-muted); }
#rb-nflsos table.sos tbody tr:hover td { filter: brightness(.96); }

@media (max-width: 1200px) {
	/* Sideways scroll takes over; a scroll container can't host a page-sticky header, so it scrolls too. */
	#rb-nflsos .sos-wrap { overflow: auto; overflow-x: auto; }
	/* When the theme has wrapped the table, that wrapper holds the overflow, so it must be the scroller. */
	#rb-nflsos .table-wrapper { overflow: auto !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
	#rb-nflsos table.sos { width: auto; min-width: 1160px; }
	#rb-nflsos table.sos th { position: static; }
	/* …but the Team header still pins to the left edge, like the team cells beneath it. */
	#rb-nflsos table.sos th.team { position: sticky; left: 0; top: auto; z-index: 3; }
	#rb-nflsos table.sos th.wk { width: 58px; }
	#rb-nflsos .sos-legend { margin-left: 0; }
}
@media (max-width: 600px) {
	#rb-nflsos table.sos { min-width: 1150px; }   /* 70 + 18 × 60 */
	#rb-nflsos table.sos th.team { width: 70px; }
	#rb-nflsos table.sos td.team .logo { display: none; }
	#rb-nflsos table.sos th.wk { width: 60px; }
}
