/* 7B League Manager: navy and light blue theme (clean, no smoke or glow). */

.sbl {
	--sbl-bg: #0a1530;
	--sbl-row: #0d1b3a;
	--sbl-row-alt: #102247;
	--sbl-line: rgba(140, 170, 220, 0.22);
	--sbl-text: #f3f5fa;
	--sbl-muted: #a9b5cf;
	--sbl-accent: #78cbf9;
	--sbl-accent-light: #b8e4fd;
	--sbl-accent-dark: #3f9fd6;
	--sbl-accent-fill: linear-gradient(180deg, #a9defc 0%, #78cbf9 50%, #5cb8ec 100%);
	--sbl-accent-text: #0a1530;
	--sbl-green: #6cc04a;
	--sbl-blue: #5ab4e5;
	--sbl-red: #d0574f;
	--sbl-head-font: "Cinzel", "Trajan Pro", Georgia, serif;
	--sbl-body-font: "Barlow", "Helvetica Neue", Arial, sans-serif;

	margin: 0 0 2em;
	container-type: inline-size;
	container-name: sbl;
	font-family: var(--sbl-body-font);
	color: var(--sbl-text);
	line-height: 1.3;
}

.sbl *,
.sbl *::before,
.sbl *::after {
	box-sizing: border-box;
}

/* Panel: plain navy, no outer frame. */
.sbl-panel {
	position: relative;
	background: var(--sbl-bg);
	border-radius: 6px;
	padding: 22px 22px 24px;
}

/* Title: serif caps between two rules. */
.sbl-head {
	display: flex;
	align-items: center;
	gap: 18px;
	margin: 4px 0 6px;
}

.sbl-rule {
	flex: 1;
	height: 2px;
	background: linear-gradient(90deg, transparent, var(--sbl-accent) 30%, var(--sbl-accent));
}

.sbl-rule:last-child {
	background: linear-gradient(90deg, var(--sbl-accent), var(--sbl-accent) 70%, transparent);
}

.sbl .sbl-title {
	margin: 0;
	padding: 0;
	font-family: var(--sbl-head-font);
	font-weight: 700;
	font-size: clamp(1.4rem, 3.6vw, 2.4rem);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-align: center;
	line-height: 1.1;
	color: var(--sbl-accent);
	background: linear-gradient(180deg, var(--sbl-accent-light) 0%, var(--sbl-accent) 55%, var(--sbl-accent-dark) 100%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}

.sbl .sbl-season {
	margin: 0 0 16px;
	text-align: center;
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--sbl-muted);
}

.sbl-empty {
	margin: 1em 0 0;
	text-align: center;
	color: var(--sbl-muted);
}

/* ---------------------------------------------------------------- Table */

.sbl-scroll {
	overflow-x: auto;
	border: 1.5px solid var(--sbl-accent);
	border-radius: 4px;
}

.sbl .sbl-table {
	width: 100%;
	margin: 0;
	border-collapse: collapse;
	border: 0;
	font-size: 1.05rem;
	background: var(--sbl-row);
	color: var(--sbl-text);
}

.sbl .sbl-table th,
.sbl .sbl-table td {
	padding: 10px 12px;
	border: 0;
	border-bottom: 1px solid var(--sbl-line);
	background: transparent;
	color: inherit;
	vertical-align: middle;
	text-align: left;
}

.sbl .sbl-table thead th {
	padding-top: 12px;
	padding-bottom: 12px;
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--sbl-text);
	background: #081128;
	border-bottom: 1.5px solid var(--sbl-accent);
}

.sbl .sbl-table abbr {
	text-decoration: none;
	border: 0;
	cursor: help;
}

.sbl .sbl-table tbody tr:nth-child(even) {
	background: var(--sbl-row-alt);
}

.sbl .sbl-table tbody tr:last-child > * {
	border-bottom: 0;
}

.sbl .sbl-c-num {
	width: 1%;
	min-width: 56px;
	text-align: center;
	font-variant-numeric: tabular-nums;
	border-left: 1px solid var(--sbl-line);
}

.sbl .sbl-c-pos {
	width: 1%;
	min-width: 48px;
	text-align: center;
	font-weight: 700;
	border-right: 1px solid var(--sbl-line);
}

.sbl .sbl-c-logo {
	width: 1%;
	padding-right: 4px;
}

.sbl .sbl-c-team {
	font-weight: 600;
	white-space: nowrap;
}

.sbl .sbl-table tbody .sbl-c-pts {
	font-weight: 700;
}

.sbl .sbl-c-form {
	white-space: nowrap;
	border-left: 1px solid var(--sbl-line);
}

/* First place: light blue row. */
.sbl .sbl-table tbody tr.sbl-leader {
	background: var(--sbl-accent-fill);
	color: var(--sbl-accent-text);
}

.sbl .sbl-table tbody tr.sbl-leader > * {
	font-weight: 700;
	font-size: 1.12em;
	border-color: rgba(10, 21, 48, 0.25);
}

.sbl .sbl-table tbody tr.sbl-leader .sbl-form {
	font-size: 0.7rem;
}

/* Logos */
.sbl .sbl-logo {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	max-width: none;
	max-height: none;
	border-radius: 0;
	box-shadow: none;
	object-fit: contain;
	object-position: center;
	vertical-align: middle;
	flex: none;
}

/* Placeholder initials (team has no logo yet) stay round. */
.sbl .sbl-logo--blank {
	border-radius: 50%;
	background: #1b2f5c;
	border: 1.5px solid var(--sbl-accent);
	color: var(--sbl-accent-light);
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.04em;
}

/* Form chips */
.sbl-form {
	display: inline-block;
	width: 22px;
	height: 22px;
	margin-right: 3px;
	border-radius: 3px;
	font-size: 0.7rem;
	font-weight: 700;
	line-height: 22px;
	text-align: center;
	color: #fff;
}

.sbl-form--w { background: var(--sbl-green); color: #0a1a05; }
.sbl-form--d { background: #6b7895; }
.sbl-form--l { background: var(--sbl-red); }

/* ------------------------------------------------ Results and schedule */

.sbl-day + .sbl-day {
	margin-top: 18px;
}

.sbl .sbl-day-title {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	margin: 0 0 8px;
	padding: 0 0 6px;
	font-family: var(--sbl-body-font);
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--sbl-accent);
	border-bottom: 1px solid rgba(120, 203, 249, 0.5);
}

.sbl-round {
	color: var(--sbl-muted);
	font-weight: 600;
	letter-spacing: 0.1em;
}

.sbl .sbl-list {
	list-style: none;
	margin: 0;
	padding: 0;
	border: 1.5px solid var(--sbl-accent);
	border-radius: 4px;
	overflow: hidden;
}

.sbl .sbl-match {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 6px 14px;
	margin: 0;
	padding: 12px 14px;
	background: var(--sbl-row);
	border-bottom: 1px solid var(--sbl-line);
}

.sbl .sbl-match:nth-child(even) {
	background: var(--sbl-row-alt);
}

.sbl .sbl-match:last-child {
	border-bottom: 0;
}

.sbl-side {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	font-weight: 600;
	font-size: 1.02rem;
}

.sbl-side--home {
	justify-content: flex-end;
	text-align: right;
}

.sbl-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sbl-match--played .sbl-side:not(.sbl-win) .sbl-name {
	color: var(--sbl-muted);
}

.sbl-win .sbl-name {
	color: var(--sbl-text);
	font-weight: 700;
}

.sbl-score {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 84px;
	padding: 6px 10px;
	border-radius: 4px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.sbl-match--played .sbl-score {
	background: var(--sbl-accent-fill);
	color: var(--sbl-accent-text);
	font-size: 1.15rem;
}

.sbl-dash {
	margin: 0 8px;
}

.sbl-vs {
	padding: 4px 10px;
	border: 1.5px solid var(--sbl-accent);
	border-radius: 4px;
	color: var(--sbl-accent-light);
	font-size: 0.9rem;
	letter-spacing: 0.04em;
	white-space: nowrap;
}

.sbl-meta {
	grid-column: 1 / -1;
	text-align: center;
	font-size: 0.78rem;
	letter-spacing: 0.06em;
	color: var(--sbl-muted);
}

/* -------------------------------------------------------------- Tabs */

.sbl-tabs {
	display: flex;
	justify-content: center;
	gap: 8px;
	flex-wrap: wrap;
	margin: 0 0 18px;
}

.sbl-league:not(.sbl-js) .sbl-tabs {
	display: none;
}

.sbl .sbl-tab {
	margin: 0;
	padding: 8px 20px;
	background: transparent;
	border: 1.5px solid var(--sbl-accent);
	border-radius: 999px;
	color: var(--sbl-accent-light);
	font-family: var(--sbl-body-font);
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	cursor: pointer;
	box-shadow: none;
	text-shadow: none;
}

.sbl .sbl-tab:hover {
	background: rgba(120, 203, 249, 0.12);
}

.sbl .sbl-tab[aria-selected="true"] {
	background: var(--sbl-accent-fill);
	color: var(--sbl-accent-text);
}

.sbl .sbl-tab:focus-visible {
	outline: 2px solid #ffffff;
	outline-offset: 2px;
}

.sbl-js .sbl-tabpanel:not(.is-active) {
	display: none;
}

.sbl-league:not(.sbl-js) .sbl-tabpanel + .sbl-tabpanel {
	margin-top: 24px;
}

.sbl .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ------------------------------------------------------------ Mobile */

@container sbl (max-width: 760px) {
	.sbl .sbl-hide-md {
		display: none;
	}
}

@container sbl (max-width: 520px) {
	.sbl-panel {
		padding: 16px 10px 16px;
	}

	.sbl-head {
		gap: 10px;
	}

	.sbl .sbl-hide-sm {
		display: none;
	}

	.sbl .sbl-table {
		font-size: 0.95rem;
	}

	.sbl .sbl-table th,
	.sbl .sbl-table td {
		padding: 9px 6px;
	}

	.sbl .sbl-c-num {
		min-width: 38px;
	}

	.sbl .sbl-c-pos {
		min-width: 30px;
	}

	.sbl .sbl-c-team {
		white-space: normal;
	}

	.sbl .sbl-logo {
		width: 30px;
		height: 30px;
	}

	.sbl .sbl-match {
		gap: 6px 8px;
		padding: 10px 8px;
	}

	.sbl-side,
	.sbl-side--home {
		flex-direction: column;
		justify-content: flex-start;
		gap: 4px;
		text-align: center;
		font-size: 0.88rem;
	}

	.sbl-side--home .sbl-logo {
		order: -1;
	}

	.sbl-name {
		white-space: normal;
		overflow-wrap: break-word;
		line-height: 1.15;
	}

	.sbl .sbl-day-title {
		font-size: 0.75rem;
		letter-spacing: 0.1em;
	}

	.sbl-score {
		min-width: 64px;
		padding: 5px 6px;
	}

	.sbl-dash {
		margin: 0 5px;
	}
}

/* ------------------------------------------------------- Logo banner */
/*
 * --sbl-banner-size is the logo size chosen in the plugin settings (or size="" on the shortcode).
 * Logos shrink with the space available (cqi = 1% of the widget width), never past that size.
 */

.sbl-banner {
	--sbl-banner-size: 54px;
	--sbl-banner-logo: var(--sbl-banner-size);
	--sbl-banner-gap: clamp(8px, 2.5cqi, 22px);
	margin: 0 0 18px;
	padding: 0 0 16px;
	border-bottom: 1px solid rgba(120, 203, 249, 0.35);
}

.sbl-teams-banner .sbl-banner {
	margin: 0;
	padding: 0;
	border: 0;
}

.sbl .sbl-banner-list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--sbl-banner-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.sbl .sbl-banner-team {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	width: max(var(--sbl-banner-logo), 64px);
	margin: 0;
	text-align: center;
}

.sbl .sbl-banner-logo {
	width: var(--sbl-banner-logo);
	height: var(--sbl-banner-logo);
	font-size: calc(var(--sbl-banner-logo) * 0.28);
}

.sbl-banner-name {
	font-size: 0.78rem;
	font-weight: 600;
	line-height: 1.2;
	color: var(--sbl-text);
	overflow-wrap: break-word;
	max-width: 100%;
}

/* Logos only: no name column, so items are just the logo. */
.sbl .sbl-banner--logos .sbl-banner-team {
	width: auto;
}

/* Scrolling version: a slow, continuous strip at full size. */
.sbl-banner--scroll {
	--sbl-banner-logo: var(--sbl-banner-size);
	overflow: hidden;
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
	mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.sbl-banner-track {
	display: flex;
	width: max-content;
	animation: sbl-banner-scroll 40s linear infinite;
}

.sbl-banner--scroll:hover .sbl-banner-track {
	animation-play-state: paused;
}

.sbl .sbl-banner--scroll .sbl-banner-list {
	flex-wrap: nowrap;
	padding-right: var(--sbl-banner-gap);
}

@keyframes sbl-banner-scroll {
	from { transform: translateX(0); }
	to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
	.sbl-banner-track {
		animation: none;
	}

	.sbl-banner--scroll {
		overflow-x: auto;
	}
}

/* Narrow spaces (phones, sidebars): shrink logos so more fit per line. */
@container sbl (max-width: 640px) {
	.sbl-banner:not(.sbl-banner--scroll) {
		--sbl-banner-logo: clamp(28px, 11cqi, var(--sbl-banner-size));
	}
}

/* Very narrow (small phones): drop the logo column from the table so nothing scrolls sideways. */
@container sbl (max-width: 320px) {
	.sbl-panel {
		padding-left: 6px;
		padding-right: 6px;
	}

	.sbl .sbl-table {
		font-size: 0.88rem;
	}

	/* Collapse rather than remove the logo cell, so the header's colspan still lines up. */
	.sbl .sbl-table .sbl-c-logo {
		width: 0;
		padding: 0;
	}

	.sbl .sbl-table .sbl-c-logo > * {
		display: none;
	}

	.sbl .sbl-table th,
	.sbl .sbl-table td {
		padding-left: 4px;
		padding-right: 4px;
	}

	.sbl .sbl-c-num {
		min-width: 30px;
	}
}

@container sbl (max-width: 520px) {
	.sbl-banner-name {
		font-size: 0.72rem;
	}
}
