/* League Fixtures Hub — frontend styles.
   Themeable via --lfh-accent and --lfh-scale (set from plugin settings). */

.lfh {
	--lfh-accent-default: #0b6e3f;
	--lfh-border: rgba(0, 0, 0, 0.12);
	--lfh-muted: rgba(0, 0, 0, 0.55);
	font-size: calc(1rem * var(--lfh-scale, 1));
	line-height: 1.4;
	margin: 0 0 1.5em;
}

.lfh__title {
	font-size: 1.15em;
	margin: 0 0 0.75em;
}

.lfh__subtitle {
	font-size: 1em;
	margin: 1.25em 0 0.5em;
}

.lfh__empty {
	color: var(--lfh-muted);
	font-style: italic;
}

/* ---------- Fixture rows ---------- */

.lfh-fixture-list {
	border: 1px solid var(--lfh-border);
	border-radius: 8px;
	overflow: hidden;
}

.lfh-fixture {
	padding: 0.6em 0.8em;
	border-bottom: 1px solid var(--lfh-border);
}

.lfh-fixture:last-child {
	border-bottom: 0;
}

.lfh-fixture__meta {
	display: flex;
	justify-content: space-between;
	gap: 0.5em;
	font-size: 0.78em;
	color: var(--lfh-muted);
	margin-bottom: 0.25em;
}

.lfh-fixture__teams {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 0.6em;
}

.lfh-team {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	min-width: 0;
}

.lfh-team--home {
	justify-content: flex-end;
	text-align: right;
}

.lfh-team__name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.lfh-team__logo,
.lfh-player__photo {
	flex: 0 0 auto;
	width: calc(24px * var(--lfh-scale, 1));
	height: calc(24px * var(--lfh-scale, 1));
	object-fit: contain;
	border-radius: 3px;
}

.lfh-fixture__center {
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 4.5em;
}

.lfh-fixture__time,
.lfh-fixture__score {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.lfh-fixture__score-sep {
	margin: 0 0.15em;
	color: var(--lfh-muted);
}

.lfh-fixture__status {
	font-size: 0.72em;
	color: var(--lfh-muted);
	min-height: 1em;
}

.lfh-fixture--live .lfh-fixture__status {
	color: var(--lfh-accent, var(--lfh-accent-default));
	font-weight: 700;
}

.lfh-fixture--live .lfh-fixture__score {
	color: var(--lfh-accent, var(--lfh-accent-default));
}

/* ---------- Tables ---------- */

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

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

.lfh-table th,
.lfh-table td {
	padding: 0.45em 0.5em;
	border-bottom: 1px solid var(--lfh-border);
	text-align: left;
	vertical-align: middle;
}

.lfh-table thead th {
	font-size: 0.78em;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--lfh-muted);
}

.lfh-num {
	text-align: right;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.lfh-pts {
	color: var(--lfh-accent, var(--lfh-accent-default));
}

.lfh-team-col {
	white-space: nowrap;
}

.lfh-team-col .lfh-team__logo {
	width: calc(20px * var(--lfh-scale, 1));
	height: calc(20px * var(--lfh-scale, 1));
	vertical-align: -4px;
	margin-right: 0.35em;
}

/* Zones (configurable positions from settings) */

.lfh-zone-champ td:first-child {
	box-shadow: inset 3px 0 0 var(--lfh-accent, var(--lfh-accent-default));
}

.lfh-zone-playin td:first-child {
	box-shadow: inset 3px 0 0 #e6a817;
}

.lfh-zone-releg td:first-child {
	box-shadow: inset 3px 0 0 #c0392b;
}

.lfh-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 1em;
	font-size: 0.78em;
	color: var(--lfh-muted);
	margin-top: 0.5em;
}

.lfh-legend__item {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
}

.lfh-dot {
	width: 0.7em;
	height: 0.7em;
	border-radius: 50%;
	display: inline-block;
}

.lfh-dot--champ {
	background: var(--lfh-accent, var(--lfh-accent-default));
}

.lfh-dot--playin {
	background: #e6a817;
}

.lfh-dot--releg {
	background: #c0392b;
}

/* Form pills */

.lfh-pill {
	display: inline-block;
	width: 1.5em;
	line-height: 1.5em;
	text-align: center;
	border-radius: 4px;
	font-size: 0.72em;
	font-weight: 700;
	color: #fff;
	margin-right: 2px;
}

.lfh-pill--w {
	background: #2e9e5b;
}

.lfh-pill--d {
	background: #9aa0a6;
}

.lfh-pill--l {
	background: #c0392b;
}

/* ---------- Match sheet ---------- */

.lfh-match__round,
.lfh-match__venue {
	font-size: 0.82em;
	color: var(--lfh-muted);
	margin: 0.25em 0;
	text-align: center;
}

.lfh-events {
	list-style: none;
	margin: 0;
	padding: 0;
	border: 1px solid var(--lfh-border);
	border-radius: 8px;
}

.lfh-event {
	display: grid;
	grid-template-columns: 3em 8em 1fr auto;
	gap: 0.5em;
	padding: 0.4em 0.7em;
	border-bottom: 1px solid var(--lfh-border);
	font-size: 0.85em;
	align-items: baseline;
}

.lfh-event:last-child {
	border-bottom: 0;
}

.lfh-event__min {
	font-variant-numeric: tabular-nums;
	font-weight: 700;
}

.lfh-event--goal .lfh-event__detail {
	color: var(--lfh-accent, var(--lfh-accent-default));
	font-weight: 700;
}

.lfh-event__team {
	color: var(--lfh-muted);
	font-size: 0.85em;
}

.lfh-stat-type {
	text-align: center;
	color: var(--lfh-muted);
}

.lfh-table--stats .lfh-num {
	width: 5em;
	font-weight: 700;
}

.lfh-lineups {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
	gap: 1.25em;
}

.lfh-lineup__team {
	margin: 0 0 0.25em;
	font-size: 1em;
}

.lfh-lineup__formation {
	font-weight: 400;
	color: var(--lfh-muted);
	font-size: 0.85em;
	margin-left: 0.4em;
}

.lfh-lineup__coach,
.lfh-lineup__subs-title {
	font-size: 0.82em;
	color: var(--lfh-muted);
	margin: 0.35em 0;
}

.lfh-lineup__list {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 0.88em;
}

.lfh-lineup__list li {
	padding: 0.15em 0;
}

.lfh-lineup__number {
	display: inline-block;
	width: 1.9em;
	color: var(--lfh-muted);
	font-variant-numeric: tabular-nums;
}

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
	.lfh-fixture__teams {
		gap: 0.35em;
	}

	.lfh-event {
		grid-template-columns: 2.5em 1fr;
	}

	.lfh-event__player {
		grid-column: 2;
	}

	.lfh-event__team {
		grid-column: 2;
	}
}
