/*
 * Shared styles for the entity blocks (tournament, season, standings, team, player,
 * stats-leaders, news-list, directory, search, profile, follow-button).
 * Colours come only from tokens.css. Sizes follow bin/scales.json. Controls are 44px.
 */

.m11e {
	display: block;
	max-width: 960px;
	/* The page already has its gutter: no side padding, and left-aligned with the page title. */
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	color: var(--text);
	font-family: var(--wp--preset--font-family--sans, "DM Sans", "Noto Sans Devanagari", system-ui, sans-serif);
	font-size: 14px;
	line-height: 20px;
}

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

.m11e a {
	color: inherit;
}

/* Buttons that are links keep their own colours (the rule above would otherwise win). */
.m11e a.m11e-btn {
	color: var(--text);
}

.m11e a.m11e-btn--solid,
.m11e a.m11e-btn[aria-pressed="true"] {
	color: var(--bg);
}

.m11e :focus-visible {
	outline: 2px solid var(--accent-text);
	outline-offset: 2px;
}

.m11e__h1,
.m11e__h2,
.m11e__h3,
.m11e__h4 {
	margin: 0;
	font-family: var(--wp--preset--font-family--display, "Barlow Condensed", "Noto Sans Devanagari", "Arial Narrow", sans-serif);
	font-weight: 700;
}

.m11e__h1 {
	font-size: 24px;
	line-height: 32px;
}

.m11e__h2 {
	margin: 24px 0 8px;
	font-size: 18px;
	line-height: 24px;
}

.m11e__h3 {
	margin: 16px 0 8px;
	font-size: 16px;
	line-height: 24px;
}

.m11e__h4 {
	margin: 12px 0 6px;
	font-size: 14px;
	line-height: 20px;
	color: var(--muted);
}

.m11e__muted {
	color: var(--muted);
	font-size: 13px;
}

.m11e__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 16px;
	padding: 16px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 16px;
}

.m11e__head-text {
	flex: 1 1 200px;
	min-width: 0;
}

.m11e__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 8px;
}

.m11e-chip {
	display: inline-flex;
	align-items: center;
	padding: 2px 10px;
	background: var(--surface-2);
	border: 1px solid var(--line-strong);
	border-radius: 999px;
	font-size: 12px;
	line-height: 16px;
	font-weight: 700;
}

/* Chips that are links get a 44px touch area without growing. */
a.m11e-chip {
	position: relative;
}

a.m11e-chip::after {
	content: "";
	position: absolute;
	inset: -12px -4px;
}

.m11e-badge {
	display: inline-block;
	align-self: flex-start;
	justify-self: start;
	width: fit-content;
	padding: 2px 8px;
	border: 1px solid var(--line-strong);
	border-radius: 999px;
	font-size: 12px;
	line-height: 16px;
	font-weight: 700;
	background: var(--surface-2);
}

.m11e-badge--live {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--on-accent);
}

.m11e-badge--paused {
	background: transparent;
	border-color: var(--accent-text);
	color: var(--accent-text);
}

.m11e-badge--breaking {
	background: var(--accent-tint-strong);
	border-color: var(--accent-text);
	color: var(--accent-text);
}

.m11e-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	min-width: 44px;
	padding: 0 16px;
	border: 1px solid var(--control-line);
	border-radius: 999px;
	background: var(--surface);
	color: var(--text);
	font: inherit;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
}

.m11e-btn:hover {
	border-color: var(--text);
}

.m11e-btn--solid,
.m11e-btn[aria-pressed="true"] {
	background: var(--text);
	border-color: var(--text);
	color: var(--bg);
}

.m11e-follow {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
}

.m11e-follow__note a {
	position: relative;
}

.m11e-follow__note a::after {
	content: "";
	position: absolute;
	inset: -14px -4px;
}

.m11e-follow__note {
	margin: 0;
	color: var(--muted);
	font-size: 12px;
	line-height: 16px;
}

/* Crest and avatar: initials always render, the image sits over them. */
.m11e-crest,
.m11e-avatar {
	position: relative;
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border-radius: 999px;
	background: var(--surface-2);
	color: var(--on-crest);
	font-family: var(--wp--preset--font-family--display, "Barlow Condensed", "Noto Sans Devanagari", "Arial Narrow", sans-serif);
	font-weight: 700;
	box-shadow: inset 0 0 0 2px var(--crest-ring);
}

.m11e-crest--s {
	width: 24px;
	height: 24px;
	font-size: 12px;
}

.m11e-crest--m {
	width: 40px;
	height: 40px;
	font-size: 12px;
}

.m11e-crest--l {
	width: 56px;
	height: 56px;
	font-size: 16px;
}

.m11e-avatar--s {
	width: 32px;
	height: 32px;
	font-size: 12px;
}

.m11e-avatar--l {
	width: 56px;
	height: 56px;
	font-size: 16px;
}

.m11e-crest img,
.m11e-avatar img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	background: var(--crest-disc);
}

.m11e-crest img {
	object-fit: contain;
	padding: 2px;
}

.m11-text-only .m11e-crest img,
.m11-text-only .m11e-avatar img,
.m11-text-only .m11e-news__img {
	display: none;
}

.m11-text-only .m11e * {
	animation: none;
	transition: none;
}

/* Lists and cards */
.m11e-list {
	display: grid;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.m11e-list__item {
	margin: 0;
}

.m11e-card,
.m11e-match {
	display: block;
	padding: 12px 16px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 14px;
	text-decoration: none;
}

a.m11e-match:hover,
a.m11e-card:hover {
	border-color: var(--line-strong);
}

a.m11e-match,
a.m11e-card {
	min-height: 44px;
}

.m11e-match {
	display: grid;
	gap: 8px;
}

.m11e-match__sides {
	display: grid;
	gap: 8px;
}

.m11e-match__team {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.m11e-match__name {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 600;
}

.m11e-match__score {
	font-family: var(--wp--preset--font-family--display, "Barlow Condensed", "Noto Sans Devanagari", "Arial Narrow", sans-serif);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.m11e-match__result {
	font-weight: 600;
}

.m11e-match__meta {
	color: var(--muted);
	font-size: 12px;
	line-height: 16px;
}

.m11e-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.m11e-tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 16px 12px;
	text-align: center;
	text-decoration: none;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 14px;
	font-weight: 600;
}

.m11e-tile:hover {
	border-color: var(--line-strong);
}

/* Tabs: real links, current one marked in words for assistive tech and by weight and underline. */
.m11e-tabs {
	display: flex;
	gap: 4px;
	margin: 16px 0 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	scrollbar-width: none;
	border-bottom: 1px solid var(--line-strong);
}

.m11e-tabs::-webkit-scrollbar {
	display: none;
}

.m11e-tabs a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 12px;
	border-bottom: 2px solid transparent;
	color: var(--muted);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.m11e-tabs a[aria-current="page"] {
	border-bottom-color: var(--text);
	color: var(--text);
	font-weight: 700;
}

.m11e-empty {
	margin: 8px 0;
	padding: 16px;
	background: var(--surface);
	border: 1px dashed var(--line-strong);
	border-radius: 14px;
	color: var(--muted);
	text-align: center;
}

/* Tables */
.m11e-table {
	width: 100%;
	border-collapse: collapse;
	background: var(--surface);
	font-variant-numeric: tabular-nums;
}

.m11e-table caption {
	padding: 8px 0;
	text-align: left;
	font-weight: 700;
}

.m11e-table th,
.m11e-table td {
	padding: 10px 6px;
	text-align: right;
	border-bottom: 1px solid var(--line);
	white-space: nowrap;
}

.m11e-table th {
	background: var(--surface-2);
	border-bottom: 1px solid var(--line-strong);
	font-size: 12px;
	line-height: 16px;
	font-weight: 700;
}

.m11e-table th:first-child,
.m11e-table td:first-child,
.m11e-table .m11e-table__left {
	text-align: left;
}

.m11e-table-wrap {
	overflow-x: auto;
	border: 1px solid var(--line);
	border-radius: 14px;
}

.m11e-teamcell {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	text-decoration: none;
}

/* Stat blocks */
.m11e-stats {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 8px;
	margin: 0;
	padding: 0;
}

.m11e-stats div {
	padding: 12px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 14px;
}

.m11e-stats dt {
	color: var(--muted);
	font-size: 12px;
	line-height: 16px;
}

.m11e-stats dd {
	margin: 0;
	font-family: var(--wp--preset--font-family--display, "Barlow Condensed", "Noto Sans Devanagari", "Arial Narrow", sans-serif);
	font-size: 24px;
	line-height: 32px;
	font-weight: 700;
}

.m11e-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.m11e-links a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 16px;
	background: var(--surface);
	border: 1px solid var(--line-strong);
	border-radius: 999px;
	font-weight: 600;
	text-decoration: none;
}

.m11e-links a:hover {
	border-color: var(--text);
}

@media (min-width: 720px) {
	.m11e__h1 {
		font-size: 28px;
		line-height: 36px;
	}

	.m11e-match__sides {
		grid-template-columns: 1fr 1fr;
		gap: 16px;
	}

	.m11e-table th,
	.m11e-table td {
		padding: 10px 12px;
	}
}
