/* RotoBaller — NFL Player Stats: addon on top of the reused rankings stylesheet (rankings-mobile-cards.css).
 * The rankings CSS styles #rb-mc, the grid rows, header, controls and the .rb-card modal. This file adds
 * the stats-tool specifics: full-width sizing, the top bar, search pill, control sizing, team logos
 * (TEAM column + mobile sub-line) and the modal stat tiles.
 */

/* The full-width template injects a player-search bar (.div_player_search / #psearch) and WP's default
 * #searchform above the content — irrelevant here and overly wide. Hide them on the tool page only. */
body.rb-nps-on #searchform,
body.rb-nps-on .div_player_search { display: none !important; }

/* ── width: fill the viewport, then cap + center the tool at the rankings page's ~1320px column ── */
body.rb-nps-on .grid_960,
body.rb-nps-on .grid_16,
body.rb-nps-on .entry-content,
body.rb-nps-on .entry,
body.rb-nps-on .post,
body.rb-nps-on article,
body.rb-nps-on main {
	width: 100% !important; max-width: 100% !important;
	margin: 0 !important; padding: 0 !important; float: none !important;
}
body.rb-nps-on #rb-mc {
	max-width: 1320px !important;
	margin-left: auto !important;
	margin-right: auto !important;
	padding-left: 16px !important;
	padding-right: 16px !important;
	box-sizing: border-box !important;
}
/* tighter side gutters on phones */
@media (max-width: 600px) {
	body.rb-nps-on #rb-mc { padding-left: 6px !important; padding-right: 6px !important; }
}

/* ── top bar: page title + subtext (the rankings tool has no hero) ── */
#rb-mc .rb-nps-top {
	display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
	padding: 12px 0 8px;
}
#rb-mc .rb-nps-top-tx { min-width: 0; }
#rb-mc .rb-nps-top-h {
	display: block; font-family: 'Anton', 'Anton SC', 'Outfit', sans-serif !important; font-weight: 400 !important;
	font-size: 28px; line-height: 1.05 !important; letter-spacing: .4px; color: #15202b; text-transform: uppercase;
}
#rb-mc .rb-nps-top-c { display: block; font-size: 13px; line-height: 1.25 !important; color: #6b7280; margin-top: 3px; }

/* ── controls row: search pill ── */
#rb-mc .rb-nps-search {
	flex: 0 1 200px; min-width: 120px; max-width: 200px;
	font-family: 'Outfit', sans-serif; font-size: 13px; font-weight: 500; color: #15202b;
	padding: 8px 13px; border: 1px solid #d8dce1; border-radius: 20px; background: #fff;
	-webkit-appearance: none; appearance: none;
}
#rb-mc .rb-nps-opp { color: #6b7280; font-weight: 600; }

/* light vertical dividers between stat sections (passing | rushing | receiving | red zone …), like the
 * rankings tool. box-shadow (not border) so the fixed grid tracks never shift. */
/* The reused rankings CSS draws its own lines on shared keys (rus_td, ypc, __rectar); on this page the
 * only lines are ours. */
body.rb-nps-on #rb-mc .rb-mc-h-c,
body.rb-nps-on #rb-mc .rb-mc-c { box-shadow: none; }
body.rb-nps-on #rb-mc .rb-mc-h-c.rb-mc-sep,
body.rb-nps-on #rb-mc .rb-mc-c.rb-mc-sep { box-shadow: inset -1px 0 0 0 #e6e9ed; }

/* red-zone headers wrap to two lines (RZ / stat) */
#rb-mc .rb-mc-h-c[data-key^="rz_"] { white-space: pre-line !important; line-height: 1.04; }
/* ── name column width ──
 * The rankings tool sizes the frozen name column at 280px (long projection-tool content). Our player
 * names are short "F.Last" strings, so 280px left a big empty gap before the POS column. Narrow it on
 * desktop; the sticky POS/TEAM offsets are calc()'d off --rb-nameW so they follow automatically. */
@media (min-width: 601px) {
	body.rb-nps-on #rb-mc .rb-mc-list,
	body.rb-nps-on #rb-mc .rb-mc-head { --rb-nameW: 212px; }
}

/* ── header "PLAYER" alignment ──
 * The shared rankings stylesheet styles the frozen header name cell with align-items:center on a
 * COLUMN-direction flex box, which centers the "PLAYER" label horizontally inside the wide name
 * column — while the player names in the rows below are left-aligned. The label looked shoved to the
 * right. Pin it left (and keep it vertically centered like the other labels). Scoped to the tool. */
body.rb-nps-on #rb-mc .rb-mc-head .rb-mc-name {
	align-items: flex-start !important;
	justify-content: center !important;
}

/* ── team logos: TEAM column (desktop) + a small logo in the mobile sub-line ── */
#rb-mc .rb-mc-tlogo { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
#rb-mc .rb-mc-tlogo img { width: 26px; height: 26px; object-fit: contain; display: block; }
#rb-mc .rb-mc-tlogo b { display: none; }
#rb-mc .rb-mc-tlogo--fb b { display: inline; line-height: normal; }
#rb-mc .rb-mc-sub .rb-nps-sublogo { width: 16px; height: 16px; object-fit: contain; vertical-align: middle; margin-right: 3px; }
#rb-mc .rb-mc-sub .rb-mc-subteam { display: inline-flex; align-items: center; }

/* ── modal stat tiles (rankings .rb-card shell provides the rest) ── */
.rb-nps-cardstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 16px 4px; }
.rb-nps-cs { background: #f6f7f9; border: 1px solid #eef1f4; border-radius: 9px; padding: 8px 6px; text-align: center; }
.rb-nps-cs span { display: block; font-size: 9.5px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; color: #9aa0a8; white-space: nowrap; }
.rb-nps-cs b { display: block; font-size: 16px; font-weight: 600; color: #1a2027; margin-top: 3px; font-variant-numeric: tabular-nums; }

@media (max-width: 600px) {
	#rb-mc .rb-nps-top { padding: 10px 0 6px; }
	#rb-mc .rb-nps-top-h { font-size: 22px; }
	#rb-mc .rb-nps-top-c { font-size: 12px; }
}

/* ── controls: one row on desktop, left to right: position buttons, search, view switch, By Week stat
 * pickers, settings icon (season, weeks, min games, scoring and totals are in the settings sheet); it
 * wraps on narrow windows. Phones: positions, then search + switch + icon, then the stat pickers. ── */
#rb-mc .rb-mc-controls { flex-wrap: wrap; align-items: center; gap: 8px; }
#rb-mc .rb-nps-posbar { display: flex; gap: 4px; flex: 0 0 auto; min-width: 0; }
#rb-mc .rb-nps-pb {
	flex: 0 0 auto; min-width: 0; padding: 9px 14px; margin: 0;
	font-family: 'Outfit', sans-serif; font-size: 13px; font-weight: 600; line-height: 1; color: #374151;
	background: #f1f3f6; border: 0; border-radius: 16px; cursor: pointer;
}
#rb-mc .rb-nps-pb:hover { background: #e6e9ed; }
#rb-mc .rb-nps-pb.on { background: #1e7fd6; color: #fff; }
#rb-mc .rb-nps-viewtg { flex: 0 0 auto; }
#rb-mc .rb-nps-gear {
	flex: 0 0 34px; width: 34px; height: 34px; padding: 0; margin: 0;
	display: inline-flex; align-items: center; justify-content: center;
	color: #15202b; background: #fff; border: 1px solid #d8dce1; border-radius: 50%; cursor: pointer;
}
@media (max-width: 600px) {
	#rb-mc .rb-mc-controls { gap: 6px; padding: 8px 4px; }
	#rb-mc .rb-nps-posbar {
		flex: 1 1 100%; gap: 2px;
		overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
	}
	#rb-mc .rb-nps-posbar::-webkit-scrollbar { display: none; }
	#rb-mc .rb-nps-pb { flex: 1 1 auto; padding: 8px 4px; font-size: 12px; }
	/* 16px: iOS zooms the page into a smaller input when it gets focus */
	#rb-mc .rb-nps-search { flex: 1 1 0; min-width: 0; max-width: none; font-size: 16px; }
	#rb-mc .rb-nps-viewtg .rb-mc-tg { padding-left: 8px; padding-right: 8px; font-size: 12px; white-space: nowrap; }
	/* The PLAYER header label scrolls away with the stat labels (names stay frozen in the rows), so a
	 * stat's label stays readable while its column slides under the names. */
	#rb-mc .rb-mc-head .rb-mc-name { position: static; }
}

/* the sheet lives on <body> (above the fixed header), so it carries its own type */
html.rb-nps-lock,
html.rb-nps-lock body { overflow: hidden !important; }
/* above the site's chat widget layer (z 2000000000) while open; the ad-blocker notice (max int) stays on top */
.rb-nps-sheet { position: fixed; inset: 0; z-index: 2147483000; display: none; font-family: 'Outfit', sans-serif; }
.rb-nps-sheet.open { display: block; }
.rb-nps-sheet-bg { position: absolute; inset: 0; background: rgba(15, 23, 42, .45); opacity: 0; transition: opacity .22s ease; }
.rb-nps-sheet-p {
	position: absolute; left: 0; right: 0; bottom: 0; max-height: 85vh; overflow-y: auto;
	padding: 0 18px calc(20px + env(safe-area-inset-bottom)); box-sizing: border-box;
	background: #fff; border-radius: 16px 16px 0 0;
	transform: translateY(100%); transition: transform .22s ease;
}
.rb-nps-sheet.shown .rb-nps-sheet-bg { opacity: 1; }
.rb-nps-sheet.shown .rb-nps-sheet-p { transform: none; }
/* desktop: a centered panel rather than a bottom sheet */
@media (min-width: 601px) {
	.rb-nps-sheet-p {
		left: 50%; right: auto; top: 50%; bottom: auto; width: 440px; max-height: 90vh;
		border-radius: 16px; padding-bottom: 20px;
		transform: translate(-50%, -46%); opacity: 0; transition: transform .22s ease, opacity .22s ease;
	}
	.rb-nps-sheet.shown .rb-nps-sheet-p { transform: translate(-50%, -50%); opacity: 1; }
}
.rb-nps-sheet-hd {
	display: flex; align-items: center; justify-content: space-between;
	margin: 0 -18px; padding: 14px 18px 12px; border-bottom: 3px solid #1e7fd6;
}
.rb-nps-sheet-hd b {
	font-family: 'Anton', 'Anton SC', 'Outfit', sans-serif; font-weight: 400; font-size: 22px; line-height: 1;
	letter-spacing: .4px; text-transform: uppercase; color: #15202b;
}
.rb-nps-sheet .rb-nps-sheet-x {
	width: 32px; height: 32px; padding: 0; margin: 0; border: 0; border-radius: 50%; cursor: pointer;
	background: #f1f3f6; color: #374151; font-size: 22px; line-height: 32px; text-align: center;
}
.rb-nps-sheet .rb-nps-s-f { min-width: 0; }
.rb-nps-sheet .rb-nps-s-row { display: flex; gap: 12px; }
.rb-nps-sheet .rb-nps-s-row > .rb-nps-s-f { flex: 1 1 0; }
.rb-nps-sheet .rb-nps-s-lbl {
	display: block; margin: 16px 0 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .6px;
	text-transform: uppercase; color: #6b7280;
}
/* 16px text: iOS zooms the page into anything smaller when it gets focus */
.rb-nps-sheet select.rb-nps-s-sel {
	display: block; width: 100%; height: 44px; margin: 0; padding: 0 30px 0 12px; box-sizing: border-box;
	font-family: 'Outfit', sans-serif; font-size: 16px; font-weight: 600; color: #15202b;
	background: #f6f8fa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%231e7fd6' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 11px center;
	border: 1px solid #d8dce1; border-radius: 22px; -webkit-appearance: none; appearance: none;
}
.rb-nps-sheet .rb-nps-s-wk { display: flex; align-items: center; gap: 10px; }
.rb-nps-sheet .rb-nps-s-wk select.rb-nps-s-sel { flex: 1 1 0; min-width: 0; }
.rb-nps-sheet .rb-nps-s-wk span { color: #6b7280; font-size: 14px; font-weight: 600; }
.rb-nps-sheet .rb-nps-s-seg { display: flex; height: 44px; padding: 3px; box-sizing: border-box; background: #eef1f5; border-radius: 22px; }
.rb-nps-sheet .rb-nps-s-seg button {
	flex: 1 1 0; min-width: 0; margin: 0; padding: 0 4px; border: 0; border-radius: 19px; cursor: pointer;
	background: transparent; color: #4b5563; white-space: nowrap;
	font-family: 'Outfit', sans-serif; font-size: 14px; font-weight: 600;
}
.rb-nps-sheet .rb-nps-s-seg button.on { background: #fff; color: #1e7fd6; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.rb-nps-sheet .rb-nps-sheet-go {
	display: block; width: 100%; height: 48px; margin: 22px 0 0; border: 0; border-radius: 24px; cursor: pointer;
	background: #1e7fd6; color: #fff; font-family: 'Outfit', sans-serif; font-size: 16px; font-weight: 700;
}

/* ── By Week grid: stat pickers, two-line week cells ── */
#rb-mc .rb-nps-bwbar { display: none; align-items: center; gap: 8px; flex: 0 1 auto; min-width: 0; }
#rb-mc.rb-nps-wk .rb-nps-bwbar { display: flex; }
#rb-mc .rb-nps-bwbar label { font-family: 'Outfit', sans-serif; font-size: 12.5px; font-weight: 600; color: #6b7280; }
/* the pill shows the picked stat at the labels' size; the real select covers it, invisible, at 16px */
#rb-mc .rb-nps-bwpick {
	position: relative; display: inline-flex; align-items: center; flex: 0 1 auto; min-width: 0;
	height: 34px; padding: 0 28px 0 12px; box-sizing: border-box;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%231e7fd6' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center;
	border: 1px solid #d8dce1; border-radius: 17px;
}
/* the invisible select carries focus, so show it on the pill */
#rb-mc .rb-nps-bwpick:focus-within { border-color: #1e7fd6; box-shadow: 0 0 0 3px rgba(30, 127, 214, .25); }
#rb-mc .rb-nps-bwtx {
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
	font-family: 'Outfit', sans-serif; font-size: 12.5px; font-weight: 600; color: #15202b;
}
#rb-mc select.rb-nps-bwsel {
	position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0;
	font-size: 16px; opacity: 0; cursor: pointer; -webkit-appearance: none; appearance: none;
}
#rb-mc .rb-mc-c.rb-nps-wcell { flex-direction: column; justify-content: center; gap: 2px; line-height: 1.1; }
#rb-mc .rb-nps-bw1,
#rb-mc .rb-nps-bw2 { display: block; text-align: center; }
#rb-mc .rb-nps-bw1 { font-weight: 600; color: #15202b; }
#rb-mc .rb-nps-bw2 { font-size: .86em; font-weight: 600; color: #6b7280; }
#rb-mc .rb-nps-wtot .rb-nps-bw1 { font-weight: 700; color: #1e7fd6; }
#rb-mc .rb-nps-bwnone { color: #c3c8cf; }
@media (max-width: 600px) {
	#rb-mc .rb-nps-bwbar { order: 1; flex: 1 1 100%; }   /* after the settings icon: a row of its own */
	#rb-mc .rb-nps-bwpick { flex: 1 1 0; }
}
