/* Softball public shell — header, nav, footer, page chrome */

:root {
	--sb-bg: #f4f6f8;
	--sb-surface: #ffffff;
	--sb-text: #1c2333;
	--sb-muted: #5c6578;
	--sb-border: #e2e6ed;
	--sb-top: #152238;
	--sb-top-hover: #243552;
	--sb-accent: #0d7a5f;
	--sb-accent-hover: #0a634d;
	--sb-link: #0b5cab;
	--sb-radius: 10px;
	--sb-shadow: 0 1px 3px rgba(22, 34, 51, 0.08);
	--sb-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body.sb-body {
	margin: 0;
	min-height: 100vh;
	font-family: var(--sb-font);
	font-size: 16px;
	line-height: 1.5;
	color: var(--sb-text);
	background: var(--sb-bg);
	background-image:
		radial-gradient(ellipse 120% 80% at 50% -20%, rgba(13, 122, 95, 0.06), transparent 55%);
	background-attachment: fixed;
}

.sb-skip {
	position: absolute;
	left: -9999px;
	z-index: 10000;
	padding: 0.5rem 1rem;
	background: var(--sb-accent);
	color: #fff;
}
.sb-skip:focus {
	left: 0.5rem;
	top: 0.5rem;
}

/* Top bar */
.sb-topbar {
	background: var(--sb-top);
	color: #e8ecf2;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
	position: sticky;
	top: 0;
	z-index: 1000;
}

.sb-topbar-inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 1.25rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: 3.5rem;
	flex-wrap: wrap;
}

.sb-brand {
	font-weight: 700;
	font-size: 1.15rem;
	letter-spacing: -0.02em;
	color: #fff !important;
	text-decoration: none;
	white-space: nowrap;
}
.sb-brand:hover,
.sb-brand:focus {
	color: #fff !important;
	opacity: 0.92;
	text-decoration: none;
}

.sb-brand span {
	color: #7dd3c0;
	font-weight: 600;
}

.sb-nav-primary {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25rem 0.5rem;
}

.sb-nav-primary a {
	color: #c5cdd8;
	text-decoration: none;
	font-size: 0.9375rem;
	font-weight: 500;
	padding: 0.45rem 0.75rem;
	border-radius: 6px;
	transition: background 0.15s, color 0.15s;
}
.sb-nav-primary a:hover,
.sb-nav-primary a:focus {
	background: var(--sb-top-hover);
	color: #fff;
	text-decoration: none;
}

.sb-nav-primary a.sb-nav-active {
	background: rgba(125, 211, 192, 0.15);
	color: #a8e6d4;
}

.sb-nav-sep {
	width: 1px;
	height: 1.25rem;
	background: rgba(255, 255, 255, 0.15);
	margin: 0 0.35rem;
	align-self: center;
}

/* Breadcrumb row */
.sb-subbar {
	background: var(--sb-surface);
	border-bottom: 1px solid var(--sb-border);
	box-shadow: var(--sb-shadow);
}

.sb-subbar-inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0.65rem 1.25rem;
}

.sb-breadcrumb {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.875rem;
	color: var(--sb-muted);
}

.sb-breadcrumb li {
	display: flex;
	align-items: center;
	gap: 0.35rem;
}

.sb-breadcrumb li:not(:last-child)::after {
	content: "/";
	color: var(--sb-border);
	font-weight: 300;
	margin-left: 0.35rem;
}

.sb-breadcrumb a {
	color: var(--sb-link);
	text-decoration: none;
}
.sb-breadcrumb a:hover {
	text-decoration: underline;
}

.sb-breadcrumb .sb-crumb-current {
	color: var(--sb-text);
	font-weight: 600;
}

/* Page title (optional, below breadcrumb) */
.sb-page-title {
	max-width: 1200px;
	margin: 0 auto;
	padding: 1.25rem 1.25rem 0;
}

.sb-page-title h1 {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var(--sb-text);
}

.sb-page-title .sb-tagline {
	margin: 0.35rem 0 0;
	font-size: 0.9rem;
	color: var(--sb-muted);
}

/* Main content */
.sb-main {
	max-width: 1200px;
	margin: 0 auto;
	padding: 1.25rem 1.25rem 2.5rem;
}

/*
 * index.cfm — schedule + team stats: about 30% narrower when the viewport has room.
 * Below the breakpoint, tables stay full width of the card (existing mobile rules unchanged).
 */
@media (min-width: 960px) {
	main#sb-main.sb-main.sb-index-constrain .sb-card {
		width: 100%;
		max-width: 70%;
		margin-left: auto;
		margin-right: auto;
		box-sizing: border-box;
	}

	/* Stats card can use full page width so all columns fit when viewport allows */
	main#sb-main.sb-main.sb-index-constrain .sb-stats-card.sb-card {
		max-width: 100%;
	}

	main#sb-main.sb-main.sb-index-constrain .sb-card > .container-fluid.table-responsive,
	main#sb-main.sb-main.sb-index-constrain .sb-stats-card.sb-card > .sb-datagrid-scroll,
	main#sb-main.sb-main.sb-index-constrain .sb-card > .container-fluid.table-responsive > .table,
	main#sb-main.sb-main.sb-index-constrain .sb-stats-card.sb-card > .sb-datagrid-scroll > .datagrid {
		width: 100% !important;
		max-width: 100% !important;
	}

}

/* Filter toolbar (index) */
.sb-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 1rem 1.5rem;
	background: var(--sb-surface);
	padding: 1rem 1.25rem;
	border-radius: var(--sb-radius);
	border: 1px solid var(--sb-border);
	box-shadow: var(--sb-shadow);
	margin-bottom: 1.5rem;
}

.sb-field {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.sb-field label {
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--sb-muted);
}

.sb-field select {
	min-width: 8rem;
	padding: 0.45rem 2rem 0.45rem 0.65rem;
	font-size: 0.9375rem;
	font-family: inherit;
	border: 1px solid var(--sb-border);
	border-radius: 8px;
	background: #fff;
	color: var(--sb-text);
	cursor: pointer;
}

.sb-field select:focus {
	outline: 2px solid rgba(13, 122, 95, 0.35);
	outline-offset: 1px;
	border-color: var(--sb-accent);
}

.sb-field .form-control {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	border-radius: 8px;
	font-family: inherit;
}

.sb-field .form-control:focus {
	border-color: var(--sb-accent);
	outline: 2px solid rgba(13, 122, 95, 0.35);
	outline-offset: 1px;
}

/* Admin login (softball/admin/login.cfm) */
.sb-main .sb-login-card {
	max-width: 30rem;
	margin-left: auto;
	margin-right: auto;
}

.sb-login-intro {
	margin-top: 0;
	max-width: none;
}

.sb-login-fields {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	margin-bottom: 1.25rem;
}

.sb-main .sb-login-actions.sb-btn-center-wrap {
	display: flex !important;
	justify-content: center;
	align-items: center;
	gap: 0.5rem;
	flex-wrap: nowrap;
}

/* Centered button rows: see EOF `.sb-btn-center-wrap` (used in markup + !important) */

/* Games table card */
.sb-card {
	background: var(--sb-surface);
	border-radius: var(--sb-radius);
	border: 1px solid var(--sb-border);
	box-shadow: var(--sb-shadow);
	overflow: hidden;
	margin-bottom: 1.5rem;
}

.sb-card-header {
	padding: 0.85rem 1.25rem;
	border-bottom: 1px solid var(--sb-border);
	font-weight: 600;
	font-size: 1rem;
	background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
}

.sb-card .table-responsive {
	margin: 0;
}

.sb-card .table {
	margin-bottom: 0;
}

.sb-datagrid-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	margin: 0 -1px;
}

.sb-stats-card {
	margin-top: 0.5rem;
}

.sb-stat-summary {
	background: var(--sb-surface);
	border-radius: var(--sb-radius);
	border: 1px solid var(--sb-border);
	padding: 1rem 1.25rem;
	margin-bottom: 1.5rem;
}

.sb-stat-summary h3 {
	margin: 0 0 0.5rem;
	font-size: 1.1rem;
}

.sb-stat-summary p {
	margin: 0;
	color: var(--sb-muted);
}

.sb-fair-note {
	font-size: 0.9rem;
	color: var(--sb-muted);
	max-width: 52rem;
	margin: 0 0 1rem;
	padding: 0.75rem 1rem;
	background: rgba(13, 122, 95, 0.06);
	border-radius: 8px;
	border-left: 3px solid var(--sb-accent);
}

.sb-muted-note {
	font-size: 0.9rem;
	color: var(--sb-muted);
	margin: 0 0 1rem;
	max-width: 48rem;
}

/* Admin game form (update_games) */
#sb-main.sb-main .sb-date-row {
	display: flex !important;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	align-content: center;
	justify-content: center;
	gap: 0.5rem;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

.sb-main .sb-date-input {
	max-width: 14.5rem;
	min-width: 0;
}

.sb-main .sb-char-hint {
	font-weight: 400;
	color: var(--sb-muted);
	font-size: 0.85em;
}

.sb-main .sb-char-meter {
	display: inline-block;
	width: auto;
	min-width: 2rem;
	border: none;
	box-shadow: none;
	background: transparent;
	padding: 0 0.15rem;
	font-weight: 600;
	color: var(--sb-text);
}

.sb-main .sb-admin-game-form .form-control.input-sm {
	min-width: 2.5rem;
	padding: 0.2rem 0.35rem;
	height: auto;
}

.sb-card-body {
	padding: 1rem 1.25rem;
}

.sb-card .sb-chart-wrap {
	padding: 0.75rem 1rem;
}

/* Site home (/) */
.sb-home-card .sb-card-body {
	padding: 1.75rem 1.5rem;
}

.sb-home-heading {
	margin: 0 0 0.5rem;
	font-size: 1.65rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var(--sb-text);
}

.sb-home-lead {
	margin: 0 0 1.25rem;
	font-size: 1.05rem;
	line-height: 1.55;
	color: var(--sb-muted);
	max-width: 36rem;
}

.sb-hidden {
	display: none !important;
}

/* view_game — optional long recap beside score */
.sb-game-summary-card .sb-game-recap {
	white-space: pre-wrap;
	line-height: 1.55;
	margin: 0;
	color: var(--sb-text);
}

/* AI lineup admin */
/* ExtJS roster grid (manage_players) — wide table; scroll on small viewports */
.sb-ext-grid-wrap {
	min-height: 280px;
}

.sb-manage-players-card .sb-ext-grid-wrap {
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.sb-manage-players-card .sb-ext-grid-host {
	display: block;
	width: 100%;
	min-width: 56rem;
}

@media (min-width: 769px) {
	.sb-manage-players-card .sb-ext-grid-host {
		min-width: 72rem;
	}
}

@media (min-width: 1200px) {
	.sb-manage-players-card .sb-ext-grid-host {
		min-width: 80rem;
	}
}

.sb-ai-recent-field {
	margin-bottom: 1rem;
}

.sb-ai-lineup-card .sb-ai-player-grid {
	max-width: 40rem;
}

.sb-ai-rule {
	border: 0;
	border-top: 1px dashed var(--sb-border);
	margin: 1.25rem 0;
}

.sb-ai-narrative {
	white-space: pre-wrap;
	line-height: 1.55;
	margin: 0 0 1rem;
	color: var(--sb-text);
	font-size: 0.9375rem;
}

.sb-ai-subhead {
	font-size: 1.15rem;
	font-weight: 600;
	margin: 1rem 0 0.75rem;
	color: var(--sb-text);
}

.sb-ai-results-wrap .sb-ai-footer {
	margin-top: 1rem;
	margin-bottom: 0;
}

.sb-ai-select {
	max-width: 12rem;
}

/* Pick team (/softball/pick_team.cfm) */
.sb-pick-team-card .sb-pick-team-intro {
	margin-top: 0;
}

.sb-pick-team-card .sb-team-list {
	margin-bottom: 0;
}

.sb-pick-team-filter {
	margin-bottom: 1rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--sb-border);
}

.sb-toggle-label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
	font-size: 0.9375rem;
	font-weight: 500;
	color: var(--sb-text);
	cursor: pointer;
	user-select: none;
}

.sb-toggle-label input[type="checkbox"] {
	width: 1.1rem;
	height: 1.1rem;
	margin: 0;
	cursor: pointer;
	flex-shrink: 0;
}

/* Buttons in tables */
.sb-main .btn.btn-sm {
	border-radius: 6px;
}

/* ----- Data tables: match shell type scale (main.css + Bootstrap inherit ~16px on cells) ----- */
.sb-main .table {
	font-size: 0.875rem;
	line-height: 1.4;
}

.sb-main .table > thead > tr > th,
.sb-main .table > tbody > tr > td,
.sb-main .table > tfoot > tr > td,
.sb-main .table > tbody > tr > th {
	padding: 0.4rem 0.55rem;
	font-size: inherit;
	font-weight: normal;
	vertical-align: middle;
}

.sb-main .table > thead > tr > th {
	font-weight: 600;
}

/* Schedule / admin tables: center cells with buttons (align= honors index.cfm; :has for others) */
#sb-main.sb-main .table > tbody > tr > td[align="center"],
#sb-main.sb-main .table > thead > tr > th[align="center"] {
	text-align: center !important;
}

#sb-main.sb-main .table > tbody > tr > td:has(.btn),
#sb-main.sb-main .table > thead > tr > th:has(.btn) {
	text-align: center !important;
}

/* Card body: center a paragraph used as a single-button row (e.g. site home CTA) */
#sb-main.sb-main .sb-card-body > p:has(.btn) {
	text-align: center !important;
}

/* All main-area forms (index edit_games, login, update_games, view_game, etc.): full width so sb-actions can center */
#sb-main.sb-main form {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

.sb-main .datagrid {
	font-size: 0.875rem;
	line-height: 1.4;
	width: 100%;
	max-width: 100%;
	table-layout: auto;
}

.sb-main .datagrid thead th,
.sb-main .datagrid tbody td,
.sb-main .datagrid tfoot td {
	font-size: 0.875rem;
	padding: 0.35rem 0.45rem;
}

.sb-main .datagrid thead th a {
	font-size: inherit;
}

.sb-main .datagrid tbody td,
.sb-main .datagrid tbody td a {
	word-break: break-word;
}

/* Leader board: chart + table side-by-side on wide screens */
.sb-main table.sb-leader-layout {
	width: 100%;
	max-width: 100%;
	border-collapse: collapse;
}

.sb-main table.sb-leader-layout > tbody > tr > td {
	vertical-align: top;
	padding: 0 0.5rem;
}

.sb-main table.sb-leader-layout > tbody > tr > td:first-child {
	padding-left: 0;
}

.sb-main table.sb-leader-layout > tbody > tr > td:last-child {
	padding-right: 0;
}

.sb-main .sb-leader-layout img,
.sb-main .sb-chart-wrap img {
	max-width: 100%;
	height: auto;
}

/* Horizontal scroll: momentum on iOS, stable gutters where supported */
.sb-card .table-responsive,
.sb-datagrid-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-gutter: stable;
}

/* Wide stats grid: keep columns readable; scroll horizontally on narrow viewports */
.sb-main .sb-datagrid-scroll .datagrid {
	min-width: max(100%, 48rem);
}

/* Footer */
.sb-footer {
	margin-top: auto;
	background: var(--sb-top);
	color: #9aa5b5;
	font-size: 0.875rem;
}

.sb-footer-inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 1.5rem 1.25rem;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.sb-footer-copy {
	margin: 0;
}

.sb-footer-links {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.sb-footer-links a {
	color: #c5cdd8;
	text-decoration: none;
}
.sb-footer-links a:hover {
	color: #fff;
	text-decoration: underline;
}

/* Layout wrapper for sticky footer */
.sb-page-wrap {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.sb-page-wrap > .sb-main {
	flex: 1;
}

/* Datagrid inside shell — soften row hover */
.sb-main .datagrid tbody tr:hover td {
	background-color: rgba(13, 122, 95, 0.06);
}

/* Desktop / tablet landscape: wider column + larger type (mobile breakpoints below are unchanged) */
@media (min-width: 769px) {
	.sb-topbar-inner,
	.sb-subbar-inner,
	.sb-page-title,
	.sb-main,
	.sb-footer-inner {
		max-width: 1440px;
	}

	body.sb-body {
		font-size: 17px;
	}

	.sb-brand {
		font-size: 1.2rem;
	}

	.sb-nav-primary a {
		font-size: 1rem;
	}

	.sb-breadcrumb {
		font-size: 0.9375rem;
	}

	.sb-page-title {
		padding-left: 1.75rem;
		padding-right: 1.75rem;
	}

	.sb-page-title h1 {
		font-size: 1.75rem;
	}

	.sb-main {
		padding: 1.5rem 1.75rem 2.75rem;
	}

	.sb-toolbar {
		padding: 1.1rem 1.35rem;
		gap: 1.1rem 1.65rem;
	}

	.sb-field label {
		font-size: 0.8125rem;
	}

	.sb-field select {
		font-size: 1rem;
		padding: 0.5rem 2rem 0.5rem 0.75rem;
	}

	.sb-card-header {
		font-size: 1.0625rem;
		padding: 0.95rem 1.35rem;
	}

	.sb-card-body {
		padding: 1.15rem 1.35rem;
	}

	.sb-stat-summary {
		padding: 1.1rem 1.35rem;
	}

	.sb-stat-summary h3 {
		font-size: 1.25rem;
	}

	.sb-fair-note,
	.sb-muted-note {
		font-size: 1rem;
		max-width: 62rem;
	}

	.sb-footer {
		font-size: 0.9375rem;
	}

	.sb-footer-inner {
		padding-left: 1.75rem;
		padding-right: 1.75rem;
	}

	.sb-main .table {
		font-size: 1rem;
		line-height: 1.45;
	}

	.sb-main .table > thead > tr > th,
	.sb-main .table > tbody > tr > td,
	.sb-main .table > tfoot > tr > td,
	.sb-main .table > tbody > tr > th {
		padding: 0.5rem 0.65rem;
	}

	.sb-main .datagrid {
		font-size: 1rem;
		line-height: 1.45;
	}

	.sb-main .datagrid thead th,
	.sb-main .datagrid tbody td,
	.sb-main .datagrid tfoot td {
		font-size: 1rem;
		padding: 0.45rem 0.55rem;
	}

	/* Let the stats grid span more of the content width before horizontal scroll */
	.sb-main .sb-datagrid-scroll .datagrid {
		min-width: max(100%, 58rem);
	}

	.sb-main .btn.btn-sm {
		font-size: 0.9375rem;
		padding: 0.3rem 0.65rem;
	}
}

@media (max-width: 768px) {
	.sb-main {
		padding-left: 0.75rem;
		padding-right: 0.75rem;
	}

	/* Footer: keep original compact size (main.css global `p` / link rules can inflate text on small screens) */
	.sb-footer {
		font-size: 0.875rem;
	}

	.sb-footer .sb-footer-copy,
	.sb-footer .sb-footer-links a {
		font-size: 0.875rem;
	}

	/* Schedule + stats: sub-desktop (phones in landscape often land here, not in 576px) */
	.sb-main .table,
	.sb-main .datagrid {
		font-size: 0.6875rem;
		line-height: 1.28;
	}

	.sb-main .table > thead > tr > th,
	.sb-main .table > tbody > tr > td,
	.sb-main .table > tfoot > tr > td {
		font-size: inherit;
		padding: 0.25rem 0.32rem;
	}

	.sb-main .datagrid thead th,
	.sb-main .datagrid tbody td,
	.sb-main .datagrid tfoot td {
		font-size: inherit;
		padding: 0.22rem 0.3rem;
	}

	/* Use full content width for scrollers (card padding otherwise shrinks viewport) */
	.sb-card > .container-fluid.table-responsive,
	.sb-stats-card > .sb-datagrid-scroll {
		margin-left: -0.75rem;
		margin-right: -0.75rem;
		width: calc(100% + 1.5rem);
		max-width: none;
		padding-left: 0;
		padding-right: 0;
	}

	/* index.cfm mobile: avoid left-edge clipping on first visible columns */
	main#sb-main.sb-main.sb-index-constrain .sb-card > .container-fluid.table-responsive,
	main#sb-main.sb-main.sb-index-constrain .sb-stats-card > .sb-datagrid-scroll {
		margin-left: 0 !important;
		margin-right: 0 !important;
		width: 100% !important;
	}

	/* Stack chart above leader table */
	.sb-main table.sb-leader-layout > tbody > tr,
	.sb-main table.sb-leader-layout > tbody > tr > td {
		display: block;
		width: 100% !important;
		max-width: 100%;
		box-sizing: border-box;
	}

	.sb-main table.sb-leader-layout > tbody > tr > td {
		padding-left: 0;
		padding-right: 0;
		text-align: center !important;
	}

	.sb-main table.sb-leader-layout > tbody > tr > td + td {
		margin-top: 1rem;
	}

	.sb-main table.sb-leader-layout .datagrid td,
	.sb-main table.sb-leader-layout .datagrid th {
		width: auto !important;
	}

	/* Mobile index.cfm stats grid: keep player names fully readable */
	#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid thead tr:nth-child(2) th:nth-child(1),
	#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid tbody td:nth-child(1),
	#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid tfoot td:nth-child(1) {
		min-width: 8rem !important;
		width: 8rem !important;
		padding-left: 0.45rem !important;
		padding-right: 0.45rem !important;
		white-space: normal !important;
		overflow: visible !important;
		text-overflow: clip !important;
		left: 1px !important;
	}

	#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid thead tr:nth-child(2) th:nth-child(1) a,
	#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid tbody td:nth-child(1) a {
		display: block !important;
		white-space: normal !important;
		word-break: normal !important;
		overflow-wrap: anywhere !important;
		overflow: visible !important;
		text-overflow: clip !important;
		max-width: none !important;
	}

	/* Mobile schedule table: keep "Game" column label/value visible */
	#sb-main.sb-main .sb-card > .container-fluid.table-responsive > .table thead th:first-child,
	#sb-main.sb-main .sb-card > .container-fluid.table-responsive > .table tbody td:first-child {
		min-width: 4.25rem !important;
		width: 4.25rem !important;
		white-space: nowrap !important;
		padding-left: 0.45rem !important;
	}
}

@media (max-width: 576px) {
	.sb-topbar-inner {
		flex-direction: column;
		align-items: flex-start;
		padding-top: 0.75rem;
		padding-bottom: 0.75rem;
	}

	.sb-nav-primary {
		width: 100%;
	}

	/* Phones: dense schedule + wide stats grid */
	.sb-main .table,
	.sb-main .datagrid {
		font-size: 0.625rem;
		line-height: 1.25;
	}

	.sb-main .table > thead > tr > th,
	.sb-main .table > tbody > tr > td,
	.sb-main .table > tfoot > tr > td {
		font-size: inherit;
		padding: 0.2rem 0.28rem;
	}

	.sb-main .datagrid thead th,
	.sb-main .datagrid tbody td,
	.sb-main .datagrid tfoot td {
		font-size: inherit;
		padding: 0.18rem 0.26rem;
	}

	.sb-main .table .btn-sm {
		font-size: 0.625rem;
		padding: 0.15rem 0.35rem;
		line-height: 1.2;
	}

	/* Keep tiny screens usable by allowing login buttons to stack if needed */
	.sb-main .sb-login-actions.sb-btn-center-wrap {
		flex-wrap: wrap;
	}
}

/*
 * index.cfm — team stats table only (.sb-stats-grid). Placed last so it wins over
 * .sb-main .datagrid, @media blocks, Bootstrap, and /css/table.css (.alt td, tr:hover).
 */
#sb-main.sb-main .sb-stats-card.sb-card > .sb-datagrid-scroll {
	display: block;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	min-width: 0;
}

#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid {
	width: 100% !important;
	max-width: none !important;
	min-width: 100% !important;
	table-layout: auto !important;
	border-collapse: collapse;
}

/* index.cfm roster: Name, AVG, SLUGG%, OB% stay on one line */
#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid thead tr:nth-child(2) th:nth-child(1),
#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid thead tr:nth-child(2) th:nth-child(14),
#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid thead tr:nth-child(2) th:nth-child(15),
#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid thead tr:nth-child(2) th:nth-child(16),
#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid tbody td:nth-child(1),
#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid tbody td:nth-child(14),
#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid tbody td:nth-child(15),
#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid tbody td:nth-child(16),
#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid tfoot td:nth-child(1),
#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid tfoot td:nth-child(14),
#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid tfoot td:nth-child(15),
#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid tfoot td:nth-child(16) {
	white-space: nowrap;
	word-break: normal;
}

#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid thead tr:nth-child(2) th:nth-child(14) a,
#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid thead tr:nth-child(2) th:nth-child(15) a,
#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid thead tr:nth-child(2) th:nth-child(16) a {
	white-space: nowrap;
}

#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid thead tr:nth-child(2) th:nth-child(1) a,
#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid tbody td:nth-child(1) a {
	display: inline-block;
	white-space: nowrap;
	word-break: normal;
	overflow-wrap: normal;
	text-overflow: clip;
	overflow: visible;
	max-width: none;
}

/* Player / totals label column: wider, sticky, and layered over stat columns */
#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid thead tr:nth-child(2) th:nth-child(1),
#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid tbody td:nth-child(1),
#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid tfoot td:nth-child(1) {
	position: sticky;
	left: 0;
	white-space: nowrap;
	overflow: visible;
	text-overflow: clip;
	min-width: 14rem;
	padding-left: 0.75rem;
	padding-right: 0.75rem;
}

#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid thead tr:nth-child(2) th:nth-child(1) {
	min-width: 16rem;
	width: 16rem;
	max-width: none;
	z-index: 6;
}

#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid tbody td:nth-child(1),
#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid tfoot td:nth-child(1) {
	z-index: 5;
}

#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid thead tr:nth-child(2) th:nth-child(1) {
	background-color: #006699;
}

#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid tbody tr td:nth-child(1),
#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid tfoot tr td:nth-child(1) {
	background-color: #ffffff;
}

#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid tbody tr.alt td:nth-child(1),
#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid tfoot tr.alt td:nth-child(1) {
	background-color: #e1eef4;
}

#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid tbody > tr.sb-fair-stats-separator,
#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid tbody > tr.sb-fair-stats-separator:hover {
	background-color: #000 !important;
}

#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid tbody > tr.sb-fair-stats-separator > td {
	background-color: #000 !important;
	border-color: #333 !important;
	border-left: 1px solid #333 !important;
	color: #000 !important;
	vertical-align: middle;
}

#sb-main.sb-main .sb-stats-card table.datagrid.sb-stats-grid tbody > tr.sb-fair-stats-separator:hover > td {
	background-color: #000 !important;
}

/* index.cfm schedule table date column: avoid wrapping on tablet/desktop widths */
@media (min-width: 769px) {
	main#sb-main.sb-main.sb-index-constrain .sb-schedule-card > .container-fluid.table-responsive > .table thead th:first-child,
	main#sb-main.sb-main.sb-index-constrain .sb-schedule-card > .container-fluid.table-responsive > .table tbody td:first-child {
		min-width: 10rem !important;
		width: 10rem !important;
		white-space: nowrap !important;
	}

	main#sb-main.sb-main.sb-index-constrain .sb-schedule-card > .container-fluid.table-responsive > .table tbody td:first-child a {
		display: inline-block !important;
		white-space: nowrap !important;
	}
}

/* view_player.cfm game log — match team stats width (avoid 48rem/58rem datagrid min-width) */
#sb-main.sb-main .sb-stats-card table.datagrid.sb-player-game-log {
	width: 100% !important;
	max-width: 100% !important;
	min-width: 100% !important;
	table-layout: auto !important;
	border-collapse: collapse;
}

#sb-main.sb-main .sb-stats-card table.datagrid.sb-player-game-log thead tr:first-child th {
	white-space: nowrap;
	word-break: normal;
}

/* AVG, SLUGG%, OB% — headers and cells */
#sb-main.sb-main .sb-stats-card table.datagrid.sb-player-game-log thead tr:nth-child(2) th:nth-child(16),
#sb-main.sb-main .sb-stats-card table.datagrid.sb-player-game-log thead tr:nth-child(2) th:nth-child(17),
#sb-main.sb-main .sb-stats-card table.datagrid.sb-player-game-log thead tr:nth-child(2) th:nth-child(18),
#sb-main.sb-main .sb-stats-card table.datagrid.sb-player-game-log tbody td:nth-child(16),
#sb-main.sb-main .sb-stats-card table.datagrid.sb-player-game-log tbody td:nth-child(17),
#sb-main.sb-main .sb-stats-card table.datagrid.sb-player-game-log tbody td:nth-child(18),
#sb-main.sb-main .sb-stats-card table.datagrid.sb-player-game-log tfoot td:nth-child(16),
#sb-main.sb-main .sb-stats-card table.datagrid.sb-player-game-log tfoot td:nth-child(17),
#sb-main.sb-main .sb-stats-card table.datagrid.sb-player-game-log tfoot td:nth-child(18) {
	white-space: nowrap;
	word-break: normal;
}

#sb-main.sb-main .sb-stats-card table.datagrid.sb-player-game-log thead tr:nth-child(2) th:nth-child(16) a,
#sb-main.sb-main .sb-stats-card table.datagrid.sb-player-game-log thead tr:nth-child(2) th:nth-child(17) a,
#sb-main.sb-main .sb-stats-card table.datagrid.sb-player-game-log thead tr:nth-child(2) th:nth-child(18) a {
	white-space: nowrap;
}

/* Totals row: possessive label uses player name */
#sb-main.sb-main .sb-stats-card table.datagrid.sb-player-game-log tfoot td:first-child {
	white-space: nowrap;
	word-break: normal;
}

/* view_player.cfm: keep "Game date" column wide enough on non-mobile */
@media (min-width: 769px) {
	#sb-main.sb-main .sb-stats-card table.datagrid.sb-player-game-log thead tr:nth-child(2) th:nth-child(2),
	#sb-main.sb-main .sb-stats-card table.datagrid.sb-player-game-log tbody td:nth-child(2),
	#sb-main.sb-main .sb-stats-card table.datagrid.sb-player-game-log tfoot td:nth-child(2) {
		min-width: 9.5rem !important;
		width: 9.5rem !important;
		white-space: nowrap !important;
	}

	#sb-main.sb-main .sb-stats-card table.datagrid.sb-player-game-log thead tr:nth-child(2) th:nth-child(2) a,
	#sb-main.sb-main .sb-stats-card table.datagrid.sb-player-game-log tbody td:nth-child(2) a {
		display: inline-block !important;
		white-space: nowrap !important;
	}
}

/*
 * Centered action rows — explicit class in markup (sb-btn-center-wrap) + main#sb-main + !important
 * so this wins over Bootstrap / load order. Login also sets inline text-align as a fallback.
 */
main#sb-main.sb-main .sb-btn-center-wrap {
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	box-sizing: border-box !important;
	text-align: center !important;
	clear: both;
}

main#sb-main.sb-main .sb-actions.sb-btn-center-wrap {
	margin-top: 1.25rem !important;
}

main#sb-main.sb-main .sb-login-actions.sb-btn-center-wrap {
	margin-top: 0.75rem !important;
}

main#sb-main.sb-main .sb-btn-center-wrap .btn,
main#sb-main.sb-main .sb-btn-center-wrap a.btn,
main#sb-main.sb-main .sb-btn-center-wrap button,
main#sb-main.sb-main .sb-btn-center-wrap input[type="button"],
main#sb-main.sb-main .sb-btn-center-wrap input[type="submit"] {
	float: none !important;
	display: inline-block !important;
	vertical-align: middle !important;
	margin: 0.35rem !important;
}
