/**
 * Live Scores styles.
 *
 * The board deliberately inherits your theme's typeface and text colour and
 * only supplies structure plus one accent, so it looks like part of the site
 * rather than a widget dropped on top of it. Override any variable below in
 * your theme to reskin it.
 */

.ls-board {
	--ls-accent: #0f8a55;
	--ls-warn: #a8620a;
	--ls-rule: color-mix( in srgb, currentColor 14%, transparent );
	--ls-muted: color-mix( in srgb, currentColor 62%, transparent );
	--ls-rail: color-mix( in srgb, currentColor 5%, transparent );
	--ls-flash: color-mix( in srgb, var( --ls-accent ) 18%, transparent );
	--ls-status-width: 4rem;
	/* A fixture list stops being readable when the score drifts far from the
	   team name. Override --ls-max-width to let the board fill its column. */
	--ls-max-width: 40rem;

	max-width: var( --ls-max-width );
	margin: 0 0 1.5rem;
	font-variant-numeric: tabular-nums;
}

/* Fallbacks for browsers without color-mix. */
@supports not ( color: color-mix( in srgb, currentColor 10%, transparent ) ) {
	.ls-board {
		--ls-rule: rgba( 128, 128, 128, 0.28 );
		--ls-muted: rgba( 128, 128, 128, 0.95 );
		--ls-rail: rgba( 128, 128, 128, 0.08 );
		--ls-flash: rgba( 15, 138, 85, 0.18 );
	}
}

.ls-board__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.5rem 1rem;
	padding-bottom: 0.5rem;
}

.ls-board__title {
	margin: 0;
	font-size: 1.25rem;
	line-height: 1.2;
}

.ls-board__meta {
	margin: 0;
	font-size: 0.8125rem;
	color: var( --ls-muted );
}

.ls-list {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var( --ls-rule );
}

.ls-match {
	display: grid;
	grid-template-columns: var( --ls-status-width ) 1fr;
	align-items: center;
	gap: 0 1rem;
	padding: 0.75rem 0;
	border-bottom: 1px solid var( --ls-rule );
}

/* The status rail: kick-off time, minute clock, or FT. */
.ls-match__status {
	display: flex;
	align-items: center;
	gap: 0.375rem;
	align-self: stretch;
	padding-right: 0.75rem;
	border-right: 1px solid var( --ls-rule );
	background: var( --ls-rail );
	font-size: 0.8125rem;
	color: var( --ls-muted );
}

.ls-match--live .ls-match__status,
.ls-match--halftime .ls-match__status {
	color: var( --ls-accent );
	font-weight: 600;
}

.ls-match--postponed .ls-match__statustext {
	text-decoration: line-through;
}

.ls-pulse {
	flex: none;
	width: 0.5rem;
	height: 0.5rem;
	border-radius: 50%;
	background: var( --ls-accent );
	animation: ls-pulse 2s ease-in-out infinite;
}

@keyframes ls-pulse {
	0%,
	100% {
		opacity: 1;
		transform: scale( 1 );
	}
	50% {
		opacity: 0.35;
		transform: scale( 0.7 );
	}
}

.ls-match__teams {
	display: grid;
	gap: 0.25rem;
	min-width: 0;
}

.ls-team {
	display: grid;
	grid-template-columns: auto minmax( 0, 1fr ) auto;
	align-items: center;
	gap: 0.5rem;
}

.ls-team__crest {
	width: 20px;
	height: 20px;
	object-fit: contain;
}

.ls-team__name {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* The one loud element on the board. */
.ls-team__score {
	min-width: 1.25em;
	text-align: right;
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1;
	border-radius: 3px;
	transition: background-color 0.4s ease;
}

.ls-match--scheduled .ls-team__score {
	font-weight: 400;
	color: var( --ls-muted );
}

.ls-team__score.is-changed {
	background-color: var( --ls-flash );
	box-shadow: 0 0 0 4px var( --ls-flash );
}

/* Dim the loser once a match is done, so results scan at a glance. */
.ls-match--finished .ls-team.is-loser .ls-team__name,
.ls-match--finished .ls-team.is-loser .ls-team__score {
	color: var( --ls-muted );
}

.ls-match__competition {
	grid-column: 2;
	margin: 0.25rem 0 0;
	font-size: 0.75rem;
	color: var( --ls-muted );
}

.ls-board--single-comp .ls-match__competition {
	display: none;
}

.ls-empty,
.ls-note {
	margin: 0.75rem 0 0;
	font-size: 0.875rem;
	color: var( --ls-muted );
}

.ls-note {
	color: var( --ls-warn );
}

.ls-board.is-offline .ls-board__meta::after {
	content: " \00b7 " attr( data-offline-label );
}

/* Sidebar and narrow columns. */
.ls-board--compact {
	--ls-status-width: 3rem;
	--ls-max-width: none;
}

.ls-board--compact .ls-match {
	padding: 0.625rem 0;
	gap: 0 0.625rem;
}

.ls-board--compact .ls-match__status {
	padding-right: 0.5rem;
	font-size: 0.75rem;
}

.ls-board--compact .ls-team__name {
	font-size: 0.9375rem;
}

.ls-board--compact .ls-team__score {
	font-size: 1rem;
}

.ls-board--compact .ls-team__crest {
	width: 16px;
	height: 16px;
}

@media ( max-width: 480px ) {
	.ls-board {
		--ls-status-width: 3.25rem;
	}

	.ls-board__title {
		font-size: 1.125rem;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.ls-pulse {
		animation: none;
	}

	.ls-team__score {
		transition: none;
	}
}
