/**
 * ScoreLive — board styles.
 * Themes: light / dark / auto (follows the visitor's system setting).
 */

.sl-board {
	--sl-bg: #ffffff;
	--sl-card: #ffffff;
	--sl-border: #e3e7ee;
	--sl-ink: #131722;
	--sl-muted: #68707f;
	--sl-accent: #0a7d43;
	--sl-live: #d92338;
	--sl-live-bg: #fdeef0;
	--sl-chip: #eef1f6;
	--sl-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);

	background: var(--sl-bg);
	color: var(--sl-ink);
	border: 1px solid var(--sl-border);
	border-radius: 14px;
	padding: 16px;
	margin: 0 0 24px;
	/* Text scale: the per-board `scale` attribute sets --sl-scale. */
	font-size: calc(15px * var(--sl-scale, 1));
	line-height: 1.4;
}

.sl-board[data-theme="dark"] {
	--sl-bg: #0b0e14;
	--sl-card: #131824;
	--sl-border: #232b3d;
	--sl-ink: #eef1f7;
	--sl-muted: #98a2b5;
	--sl-accent: #3ecf7a;
	--sl-live: #ff5468;
	--sl-live-bg: #2a1620;
	--sl-chip: #1c2333;
	--sl-shadow: none;
}

@media (prefers-color-scheme: dark) {
	.sl-board[data-theme="auto"] {
		--sl-bg: #0b0e14;
		--sl-card: #131824;
		--sl-border: #232b3d;
		--sl-ink: #eef1f7;
		--sl-muted: #98a2b5;
		--sl-accent: #3ecf7a;
		--sl-live: #ff5468;
		--sl-live-bg: #2a1620;
		--sl-chip: #1c2333;
		--sl-shadow: none;
	}
}

.sl-league + .sl-league {
	margin-top: 22px;
}

.sl-league-head {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin: 0 0 10px;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--sl-ink);
}

.sl-league-name {
	margin: 0;
	font-size: 1.13em;
	font-weight: 800;
	letter-spacing: 0.01em;
	text-transform: uppercase;
}

.sl-standings-link {
	margin-left: auto;
	font-size: 0.8em;
	font-weight: 700;
	color: var(--sl-accent);
	text-decoration: none;
	white-space: nowrap;
}

.sl-standings-link:hover {
	text-decoration: underline;
}

.sl-group {
	margin: 14px 0 8px;
	font-size: 0.87em;
	font-weight: 700;
	color: var(--sl-muted);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.sl-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.73em;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 3px 8px;
	border-radius: 999px;
}

.sl-pill-live {
	background: var(--sl-live-bg);
	color: var(--sl-live);
}

.sl-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--sl-live);
	display: inline-block;
	animation: sl-pulse 1.6s ease-in-out infinite;
}

@keyframes sl-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.25; }
}

.sl-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 10px;
}

.sl-card {
	background: var(--sl-card);
	border: 1px solid var(--sl-border);
	border-radius: 12px;
	box-shadow: var(--sl-shadow);
	padding: 10px 12px;
}

.sl-card.is-live {
	border-color: var(--sl-live);
}

.sl-card-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 8px;
	font-size: 0.8em;
}

.sl-status {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--sl-chip);
	color: var(--sl-muted);
	white-space: nowrap;
}

.sl-status.is-live {
	background: var(--sl-live-bg);
	color: var(--sl-live);
}

.sl-status.is-final {
	color: var(--sl-muted);
}

.sl-status.is-scheduled {
	color: var(--sl-accent);
}

.sl-when {
	color: var(--sl-muted);
	white-space: nowrap;
}

.sl-note {
	font-size: 0.8em;
	color: var(--sl-muted);
	margin: -2px 0 6px;
}

.sl-team {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 3px 0;
	min-width: 0;
}

.sl-logo {
	width: 24px;
	height: 24px;
	object-fit: contain;
	flex: none;
}

.sl-logo-sm {
	width: 18px;
	height: 18px;
	vertical-align: -4px;
}

.sl-badge {
	width: 24px;
	height: 24px;
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: var(--sl-chip);
	color: var(--sl-muted);
	font-size: 10px;
	font-weight: 800;
}

.sl-tname {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sl-team.is-winner .sl-tname,
.sl-team.is-winner .sl-score {
	font-weight: 800;
}

.sl-sets {
	color: var(--sl-muted);
	font-size: 0.83em;
	letter-spacing: 0.12em;
	white-space: nowrap;
}

.sl-score {
	font-size: 1.13em;
	font-weight: 700;
	min-width: 22px;
	text-align: right;
}

/* Board footer: the A3Q Global credit line + last update. */

.sl-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
	margin: 14px 0 0;
	font-size: 0.78em;
	color: var(--sl-muted);
}

.sl-credit a {
	color: var(--sl-muted);
	font-weight: 700;
	text-decoration: none;
}

.sl-credit a:hover {
	color: var(--sl-accent);
	text-decoration: underline;
}

.sl-updated {
	margin-left: auto;
}

.sl-empty {
	margin: 0;
	padding: 14px;
	border: 1px dashed var(--sl-border);
	border-radius: 12px;
	color: var(--sl-muted);
	text-align: center;
}

/* Standings */

.sl-table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.sl-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9em;
}

.sl-table th,
.sl-table td {
	padding: 6px 8px;
	border-bottom: 1px solid var(--sl-border);
	text-align: left;
	white-space: nowrap;
}

.sl-table thead th {
	font-size: 0.73em;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--sl-muted);
}

.sl-table .sl-num {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.sl-table th.sl-num {
	text-align: right;
}

.sl-table td.sl-team-col {
	font-weight: 600;
	white-space: normal;
	min-width: 130px;
}

.sl-table tbody tr:hover {
	background: var(--sl-chip);
}

@media (max-width: 480px) {
	.sl-board {
		padding: 12px;
	}
	.sl-grid {
		grid-template-columns: 1fr;
	}
	.sl-league-name {
		font-size: 1em;
	}
}

/* Density: compact (site setting or per-board attribute). */

.sl-density-compact {
	padding: 10px;
}

.sl-density-compact .sl-grid {
	gap: 7px;
}

.sl-density-compact .sl-card {
	padding: 7px 9px;
}

.sl-density-compact .sl-league + .sl-league {
	margin-top: 14px;
}

.sl-density-compact .sl-team {
	padding: 2px 0;
}

.sl-density-compact .sl-table th,
.sl-density-compact .sl-table td {
	padding: 4px 6px;
}

/* Sizes: medium (article columns), compact (sidebars). */

.sl-size-medium {
	padding: 14px;
}

.sl-size-medium .sl-grid {
	grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
}

.sl-size-compact {
	padding: 12px;
}

.sl-size-compact .sl-grid {
	grid-template-columns: 1fr;
}

.sl-size-compact .sl-card {
	padding: 8px 10px;
}

.sl-size-compact .sl-league-name {
	font-size: 1em;
}

/* Size: mini — a thin ticker strip of scores, made for page tops. */

.sl-size-mini {
	padding: 8px 10px;
	border-radius: 10px;
}

.sl-size-mini .sl-league {
	display: flex;
	align-items: center;
	gap: 10px;
}

.sl-size-mini .sl-league + .sl-league {
	margin-top: 6px;
}

.sl-size-mini .sl-league-head {
	margin: 0;
	padding: 0;
	border-bottom: none;
	flex: none;
}

.sl-size-mini .sl-league-name {
	font-size: 0.78em;
	white-space: nowrap;
}

.sl-size-mini .sl-grid {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	padding-bottom: 2px;
}

.sl-size-mini .sl-group,
.sl-size-mini .sl-note,
.sl-size-mini .sl-sets {
	display: none;
}

.sl-size-mini .sl-card {
	flex: 0 0 auto;
	padding: 5px 9px;
	border-radius: 9px;
}

.sl-size-mini .sl-card-top {
	margin-bottom: 3px;
	font-size: 0.7em;
}

.sl-size-mini .sl-team {
	gap: 6px;
	padding: 1px 0;
}

.sl-size-mini .sl-badge,
.sl-size-mini .sl-logo {
	width: 16px;
	height: 16px;
	font-size: 8px;
}

.sl-size-mini .sl-tname {
	max-width: 110px;
}

.sl-size-mini .sl-foot {
	margin-top: 6px;
}

/* On phones the ticker's league header takes its own line so the
   cards get the full width of the strip. */
@media (max-width: 560px) {
	.sl-size-mini .sl-league {
		flex-wrap: wrap;
	}
	.sl-size-mini .sl-grid {
		flex-basis: 100%;
	}
}

/* Single-match boards (posts and chronicles): one card, front and centre. */

.sl-single .sl-grid {
	grid-template-columns: 1fr;
}

.sl-single .sl-card {
	padding: 16px;
}

.sl-single .sl-tname {
	font-size: 1.07em;
	font-weight: 600;
}

.sl-single .sl-score {
	font-size: 1.5em;
}

.sl-single .sl-badge,
.sl-single .sl-logo {
	width: 30px;
	height: 30px;
	font-size: 12px;
}
