/* Match scoreboard — the full-time board on a match report (scoreboard.php).

   Flat, like every surface on the site: one surface fill and a hairline, no
   shadow. The only ornament is the pitch itself — a halfway line and a centre
   circle drawn in the border colour behind the score. The competition line
   takes its league's accent (--sa-match-accent, set inline), else the palette's. */

.sa-match {
	--sa-match-accent: var(--sa-violet-light);
	position: relative;
	margin: 0 0 1.75rem;
	padding: 14px clamp(14px, 3vw, 22px) 18px;
	border: 1px solid var(--sa-border);
	border-radius: var(--sa-radius);
	background: var(--sa-surface-1);
	overflow: hidden;
	isolation: isolate;
}

/* The pitch: a halfway line and a centre circle, centred on the score. */
.sa-match__board::before,
.sa-match__board::after {
	content: "";
	position: absolute;
	z-index: -1;
	pointer-events: none;
}
.sa-match__board::before {
	top: -14px;
	bottom: 0;
	left: 50%;
	width: 1px;
	background: var(--sa-border);
}
.sa-match__board::after {
	top: 50%;
	left: 50%;
	width: clamp(120px, 26vw, 168px);
	aspect-ratio: 1;
	border: 1px solid var(--sa-border);
	border-radius: 50%;
	transform: translate(-50%, -50%);
}

/* Top line: competition · round on the left, FULL TIME on the right. */
.sa-match__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 14px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .12em;
	line-height: 1.3;
	text-transform: uppercase;
}
.sa-match__comp {
	min-width: 0;
	color: var(--sa-match-accent);
	overflow-wrap: anywhere;
}
.sa-match__ft {
	flex: 0 0 auto;
	padding: 4px 9px;
	border: 1px solid var(--sa-gold);
	border-radius: var(--sa-radius-pill);
	color: var(--sa-gold);
	font-size: 11px;
	letter-spacing: .14em;
}

/* The board: side · score · side. Each side stacks crest, name, scorers. */
.sa-match__board {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: start;
	gap: clamp(10px, 3vw, 24px);
}
.sa-match__side {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	min-width: 0;
	text-align: center;
}
.sa-match__name {
	font-family: var(--sa-font-display, inherit);
	font-size: clamp(1rem, 3vw, 1.35rem);
	font-weight: 700;
	line-height: 1.15;
	color: var(--sa-text);
	overflow-wrap: break-word; /* whole words; "Manchest|er" only if one word cannot fit */
	hyphens: auto;
}
.sa-match__score {
	display: inline-flex;
	align-items: center;
	gap: .35em;
	align-self: center;
	padding: 6px 4px;
	font-family: var(--sa-font-display, inherit);
	font-size: clamp(2.4rem, 9vw, 3.6rem);
	font-weight: 800;
	line-height: 1;
	color: var(--sa-text);
	font-variant-numeric: tabular-nums;
	background: var(--sa-surface-1); /* masks the halfway line behind the digits */
}
.sa-match__score i {
	font-style: normal;
	font-weight: 600;
	color: var(--sa-text-dim);
}

/* Scorers, under their own side. `.entry-content ul` would otherwise give
   them bullets, a left indent and paragraph spacing. */
.sa-match .sa-match__scorers,
.entry-content .sa-match .sa-match__scorers {
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 13px;
	line-height: 1.45;
	color: var(--sa-text-muted);
}
.entry-content .sa-match .sa-match__scorers li {
	margin: 0;
	padding: 0;
}
/* The article's own list marker (a rotated diamond, absolutely placed) is
   replaced, at its specificity, by a ball that sits in the line. */
.sa-match .sa-match__scorers li::before,
.entry-content .sa-match .sa-match__scorers li::before {
	content: "⚽";
	position: static;
	display: inline;
	width: auto;
	height: auto;
	margin: 0 5px 0 0;
	border: 0;
	border-radius: 0;
	background: none;
	transform: none;
	font-size: 11px;
}

.sa-match__meta {
	margin: 14px 0 0;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .08em;
	text-align: center;
	text-transform: uppercase;
	color: var(--sa-text-dim);
}

/* The way out of the report and into the ballot. */
.sa-match__cta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px 14px;
	margin: 16px 0 0;
	padding: 14px 0 0;
	border-top: 1px solid var(--sa-border);
	text-align: center;
}
.sa-match__note {
	min-width: 0;
	font-size: 13px;
	color: var(--sa-text-muted);
	overflow-wrap: anywhere;
}
.sa-match__btn,
.entry-content a.sa-match__btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 20px;
	border: 0;
	border-radius: var(--sa-radius-pill);
	font-size: 13.5px;
	font-weight: 700;
	letter-spacing: .05em;
	line-height: 1;
	text-decoration: none;
	text-transform: uppercase;
	color: var(--sa-on-accent, #fff);
	background: var(--sa-gradient);
	box-shadow: var(--sa-button-depth);
}
#tie-wrapper a.sa-match__btn { color: var(--sa-on-accent, #fff); }
.sa-match__btn:hover,
.entry-content a.sa-match__btn:hover { filter: brightness(1.08); color: var(--sa-on-accent, #fff); }
.sa-match__btn:focus-visible {
	outline: 2px solid var(--sa-focus);
	outline-offset: 3px;
}

@media (max-width: 560px) {
	.sa-match__top { font-size: 11px; }
	.sa-match__board { gap: 8px; }
	.sa-match__name { font-size: .92rem; }
	.sa-match__score { font-size: 2.1rem; padding: 6px 0; }
	.sa-match__scorers { font-size: 12px; }
	.sa-match__btn { width: 100%; justify-content: center; }
}

/* ── Latest results: the homepage section (scoreboard.php) ──────────────────
   A results list, the way a scores app prints one: each side on its own row
   with its goals at the end, the winner in full strength and the loser dimmed.
   Cards are flat surfaces in a grid that becomes a swipe rail on phones. */

.sa-results {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 14px;
	margin-top: 1rem;
}

.sa-result {
	--sa-match-accent: var(--sa-violet-light);
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: 12px 14px 10px;
	border: 1px solid var(--sa-border);
	border-radius: var(--sa-radius-sm);
	background: var(--sa-surface-1);
	transition: border-color .15s ease;
}
.sa-result:hover { border-color: var(--sa-border-strong); }

.sa-result__top {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	margin: 0 0 10px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .1em;
	line-height: 1.3;
	text-transform: uppercase;
}
.sa-result__comp {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--sa-match-accent);
}
.sa-result__when {
	flex: 0 0 auto;
	color: var(--sa-text-dim);
	font-variant-numeric: tabular-nums;
}

.sa-result__score,
#tie-wrapper a.sa-result__score {
	display: flex;
	flex-direction: column;
	gap: 8px;
	color: var(--sa-text);
	text-decoration: none;
}
.sa-result__row {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 10px;
}
.sa-result .sa-crest { --sa-crest-size: 24px; font-size: 9px; }
.sa-result__team {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 15px;
	font-weight: 600;
}
.sa-result__goals {
	min-width: 1.4ch;
	font-family: var(--sa-font-display, inherit);
	font-size: 20px;
	font-weight: 800;
	line-height: 1;
	text-align: right;
	font-variant-numeric: tabular-nums;
}
.sa-result__row.is-win .sa-result__team { font-weight: 800; }
.sa-result__row.is-loss { color: var(--sa-text-muted); }
.sa-result__row.is-loss .sa-result__goals { color: var(--sa-text-dim); }
.sa-result__score:hover .sa-result__team { text-decoration: underline; text-decoration-color: var(--sa-border-strong); text-underline-offset: 3px; }
.sa-result__score:focus-visible {
	outline: 2px solid var(--sa-focus);
	outline-offset: 4px;
	border-radius: 6px;
}

.sa-result__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-top: 12px;
	padding-top: 10px;
	border-top: 1px solid var(--sa-border);
}
.sa-result__more,
#tie-wrapper a.sa-result__more {
	font-size: 13px;
	font-weight: 600;
	color: var(--sa-violet-light);
	text-decoration: none;
}
.sa-result__more:hover,
#tie-wrapper a.sa-result__more:hover { color: var(--sa-text); }
.sa-result__motm,
#tie-wrapper a.sa-result__motm {
	padding: 6px 11px;
	border-radius: var(--sa-radius-pill);
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: .06em;
	line-height: 1;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--sa-on-accent, #fff);
	background: var(--sa-gradient);
	box-shadow: var(--sa-button-depth-soft);
}
.sa-result__motm:hover { filter: brightness(1.08); }
.sa-result__more:focus-visible,
.sa-result__motm:focus-visible {
	outline: 2px solid var(--sa-focus);
	outline-offset: 3px;
}

/* Phones: a swipe rail rather than a tall stack of cards. */
@media (max-width: 640px) {
	.sa-results {
		grid-template-columns: none;
		grid-auto-flow: column;
		grid-auto-columns: 78%;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x mandatory;
		padding-bottom: 6px;
		scrollbar-width: none;
	}
	.sa-results::-webkit-scrollbar { display: none; }
	.sa-result { scroll-snap-align: start; }
}
