/* Omaya Club blocks. Colours follow the theme palette with safe fallbacks. */

:where([class*="omaya-"]) {
	--o-primary: var(--wp--preset--color--primary, #c8161d);
	--o-primary-dark: var(--wp--preset--color--primary-dark, #7d0c11);
	--o-accent: var(--wp--preset--color--accent, #1e8c4a);
	--o-night: var(--wp--preset--color--night, #140a0b);
	--o-ink: var(--wp--preset--color--ink, #161213);
	--o-muted: var(--wp--preset--color--muted, #6b6263);
	--o-surface: var(--wp--preset--color--surface, #fff);
	--o-surface-2: var(--wp--preset--color--surface-2, #f8f4f3);
	--o-line: var(--wp--preset--color--line, #ede5e4);
	--o-win: #1f9d55;
	--o-draw: #c28e0e;
	--o-loss: #d14343;
	--o-radius: 18px;
	--o-display: var(--wp--preset--font-family--display, inherit);
}

.omaya-empty {
	padding: 24px;
	border: 1px dashed var(--o-line);
	border-radius: var(--o-radius);
	text-align: center;
	color: var(--o-muted);
}

.omaya-icon {
	flex: none;
	vertical-align: -3px;
}

.omaya-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 12px;
	border-radius: 99px;
	background: var(--o-accent);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.2;
}

/* ---------- Team badges ---------- */

.omaya-badge {
	display: inline-grid;
	place-items: center;
	flex: none;
	width: 56px;
	height: 56px;
	object-fit: contain;
}

.omaya-badge--crest svg,
.omaya-site-crest svg {
	display: block;
	width: 100%;
	height: 100%;
}

.omaya-badge--initial {
	border-radius: 50%;
	background: linear-gradient(145deg, hsl(var(--badge-hue) 42% 42%), hsl(var(--badge-hue) 48% 26%));
	color: #fff;
	font-family: var(--o-display);
	font-size: 24px;
	font-weight: 800;
	box-shadow: inset 0 0 0 3px rgb(255 255 255 / 0.25);
}

.omaya-site-crest a {
	display: block;
	aspect-ratio: 120 / 140;
}

/* ---------- Next match ---------- */

.omaya-next {
	position: relative;
	padding: clamp(20px, 3vw, 32px);
	border: 1px solid rgb(255 255 255 / 0.14);
	border-radius: calc(var(--o-radius) + 6px);
	background:
		radial-gradient(120% 90% at 50% 0%, rgb(255 255 255 / 0.08), transparent 60%),
		linear-gradient(165deg, #2a1012, var(--o-night));
	color: #fff;
	box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.6);
	overflow: hidden;
}

.omaya-next.omaya-empty {
	color: rgb(255 255 255 / 0.8);
	border-style: solid;
}

.omaya-next__top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 22px;
}

.omaya-next__comp {
	font-size: 14px;
	color: rgb(255 255 255 / 0.7);
}

.omaya-next__teams {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 12px;
	color: inherit;
	text-decoration: none;
}

.omaya-next__team {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	text-align: center;
}

.omaya-next__team .omaya-badge {
	width: clamp(64px, 9vw, 92px);
	height: clamp(64px, 9vw, 92px);
}

.omaya-next__team .omaya-badge--initial {
	font-size: clamp(26px, 3vw, 36px);
}

.omaya-next__team strong {
	font-family: var(--o-display);
	font-size: clamp(16px, 1.8vw, 21px);
	line-height: 1.3;
}

.omaya-next__vs {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
}

.omaya-next__time {
	font-family: var(--o-display);
	font-size: clamp(28px, 4vw, 40px);
	font-weight: 800;
	line-height: 1;
	direction: ltr;
}

.omaya-next__vs-label {
	font-size: 12px;
	letter-spacing: 0.2em;
	color: #fff;
	opacity: 0.6;
	font-weight: 700;
}

.omaya-next__info {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px 22px;
	margin-top: 22px;
	padding-top: 18px;
	border-top: 1px solid rgb(255 255 255 / 0.12);
	font-size: 14px;
	color: rgb(255 255 255 / 0.8);
}

.omaya-next__info span {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.omaya-countdown {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 10px;
	margin-top: 18px;
	direction: rtl;
}

.omaya-countdown__unit {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	padding: 12px 4px 10px;
	border-radius: 14px;
	background: rgb(255 255 255 / 0.07);
}

.omaya-countdown__unit b {
	font-family: var(--o-display);
	font-size: clamp(22px, 3vw, 30px);
	font-variant-numeric: tabular-nums;
	line-height: 1.1;
}

.omaya-countdown__unit small {
	font-size: 12px;
	color: rgb(255 255 255 / 0.65);
}

/* ---------- Match rows ---------- */

.omaya-matches {
	container-type: inline-size;
}

.omaya-matches__list {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.omaya-match-row__link {
	display: grid;
	grid-template-columns: minmax(130px, 1fr) 3fr auto;
	align-items: center;
	gap: 16px;
	padding: 14px 18px;
	border: 1px solid var(--o-line);
	border-radius: 14px;
	background: var(--o-surface);
	color: var(--o-ink);
	text-decoration: none;
	transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.omaya-match-row__link:hover,
.omaya-match-row__link:hover * {
	text-decoration: none !important;
}

.omaya-match-row__link:hover {
	border-color: var(--o-primary);
	box-shadow: 0 12px 30px -18px rgb(200 22 29 / 0.45);
	transform: translateY(-1px);
}

.omaya-match-row__meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-size: 13px;
	color: var(--o-muted);
	line-height: 1.4;
}

.omaya-match-row__meta span:first-child {
	color: var(--o-ink);
	font-weight: 600;
}

.omaya-match-row__teams {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 12px;
}

.omaya-match-row__team {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	font-weight: 700;
}

.omaya-match-row__team.is-home {
	justify-content: flex-end;
}

.omaya-match-row__team .omaya-badge {
	width: 36px;
	height: 36px;
}

.omaya-match-row__team .omaya-badge--initial {
	font-size: 16px;
	box-shadow: inset 0 0 0 2px rgb(255 255 255 / 0.25);
}

.omaya-match-row__name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.omaya-match-row__score {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-width: 72px;
	justify-content: center;
	padding: 6px 12px;
	border-radius: 10px;
	background: var(--o-ink);
	color: #fff;
	font-family: var(--o-display);
	font-size: 18px;
	font-weight: 800;
	direction: rtl;
}

.omaya-match-row__score i {
	font-style: normal;
	opacity: 0.5;
}

.omaya-match-row__score.is-time {
	background: var(--o-surface-2);
	color: var(--o-primary);
	font-size: 16px;
	direction: ltr;
}

.omaya-result-pill {
	display: inline-flex;
	justify-content: center;
	min-width: 58px;
	padding: 5px 10px;
	border-radius: 99px;
	font-size: 12px;
	font-weight: 700;
	background: var(--o-surface-2);
	color: var(--o-muted);
}

.omaya-result-pill.is-win { background: rgb(31 157 85 / 0.12); color: var(--o-win); }
.omaya-result-pill.is-draw { background: rgb(194 142 14 / 0.14); color: var(--o-draw); }
.omaya-result-pill.is-loss { background: rgb(209 67 67 / 0.12); color: var(--o-loss); }

@container (max-width: 600px) {
	.omaya-match-row__link {
		grid-template-columns: 1fr auto;
		gap: 10px;
		padding: 12px 14px;
	}
	.omaya-match-row__meta {
		flex-direction: row;
		gap: 10px;
	}
	.omaya-match-row__teams {
		grid-column: 1 / -1;
		grid-row: 2;
		gap: 8px;
	}
	.omaya-match-row__team {
		font-size: 14px;
		gap: 6px;
	}
	/* Let long club names wrap instead of being cut off. */
	.omaya-match-row__name {
		white-space: normal;
		overflow-wrap: anywhere;
		line-height: 1.35;
	}
	.omaya-match-row__team .omaya-badge {
		width: 28px;
		height: 28px;
	}
	.omaya-match-row__score {
		min-width: 60px;
		font-size: 16px;
		padding: 5px 8px;
	}
}

/* ---------- Squad ---------- */

.omaya-squad__group {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 40px 0 18px;
	font-size: clamp(20px, 2.2vw, 26px);
}

.omaya-squad__group:first-child {
	margin-top: 0;
}

.omaya-squad__group span {
	display: inline-grid;
	place-items: center;
	min-width: 28px;
	height: 28px;
	padding: 0 8px;
	border-radius: 99px;
	background: var(--o-surface-2);
	color: var(--o-primary);
	font-size: 14px;
}

.omaya-squad {
	container-type: inline-size;
}

.omaya-squad__grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: clamp(12px, 2vw, 22px);
}

@container (min-width: 540px) {
	.omaya-squad__grid {
		grid-template-columns: repeat(3, 1fr);
	}
	/* Teasers (a fixed number of players) stay on one row. */
	.omaya-squad.is-teaser .omaya-squad__grid > :nth-child(n + 4) {
		display: none;
	}
}

@container (min-width: 880px) {
	.omaya-squad__grid {
		grid-template-columns: repeat(4, 1fr);
	}
	.omaya-squad.is-teaser .omaya-squad__grid > :nth-child(4) {
		display: flex;
	}
}

.omaya-player {
	display: flex;
	flex-direction: column;
	border-radius: var(--o-radius);
	background: var(--o-surface);
	color: var(--o-ink);
	text-decoration: none;
	overflow: hidden;
	box-shadow: 0 0 0 1px var(--o-line);
	transition: transform 0.25s, box-shadow 0.25s;
}

.omaya-player:hover {
	transform: translateY(-4px);
	box-shadow: 0 0 0 1px var(--o-primary), 0 24px 40px -24px rgb(125 12 17 / 0.5);
}

.omaya-player__media,
.omaya-profile__photo {
	position: relative;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	aspect-ratio: 4 / 5;
	background:
		repeating-linear-gradient(90deg, transparent 0 36px, rgb(255 255 255 / 0.035) 36px 72px),
		radial-gradient(90% 70% at 50% 100%, rgb(255 255 255 / 0.16), transparent 70%),
		linear-gradient(170deg, var(--o-primary), var(--o-primary-dark));
	overflow: hidden;
	isolation: isolate;
}

.omaya-player__bignum {
	position: absolute;
	inset-block-start: 6px;
	inset-inline-start: 12px;
	z-index: -1;
	font-family: var(--o-display);
	font-size: clamp(70px, 9vw, 110px);
	font-weight: 900;
	line-height: 1;
	color: rgb(255 255 255 / 0.12);
}

.omaya-player__photo,
.omaya-profile__photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top center;
	transition: transform 0.4s;
}

.omaya-player:hover .omaya-player__photo {
	transform: scale(1.04);
}

.omaya-player__silhouette {
	width: 72%;
	color: rgb(255 255 255 / 0.18);
}

.omaya-player__body {
	display: grid;
	grid-template-columns: auto 1fr;
	grid-template-rows: auto auto;
	column-gap: 12px;
	align-items: center;
	padding: 14px 16px 16px;
}

.omaya-player__num {
	grid-row: 1 / 3;
	font-family: var(--o-display);
	font-size: 30px;
	font-weight: 900;
	color: var(--o-accent);
	line-height: 1;
	min-width: 1.4em;
	text-align: center;
}

.omaya-player__name {
	font-family: var(--o-display);
	font-size: clamp(15px, 1.6vw, 18px);
	font-weight: 700;
	line-height: 1.35;
}

.omaya-player__pos {
	grid-column: 2;
	font-size: 12px;
	color: var(--o-primary);
	font-weight: 700;
	margin-top: 4px;
}

/* ---------- Season stats ---------- */

.omaya-stats__grid {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 1px;
	border-radius: var(--o-radius);
	overflow: hidden;
	background: color-mix(in srgb, currentColor 16%, transparent);
}

.omaya-stat {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: clamp(18px, 2.5vw, 30px) 10px;
	background: color-mix(in srgb, var(--o-primary-dark) 55%, var(--o-primary));
	text-align: center;
}

.omaya-stat b {
	font-family: var(--o-display);
	font-size: clamp(34px, 4.5vw, 56px);
	font-weight: 800;
	line-height: 1;
}

.omaya-stat span {
	font-size: 14px;
	opacity: 0.8;
}

.omaya-stat.is-win b { color: #8ef0b4; }
.omaya-stat.is-draw b { color: #ffd166; }
.omaya-stat.is-loss b { color: #ffc2c2; }

.omaya-form {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin-top: 22px;
	font-size: 14px;
}

.omaya-form__label {
	opacity: 0.8;
}

.omaya-form__dots {
	display: flex;
	gap: 8px;
}

.omaya-form__dot {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	color: #fff;
	font-weight: 800;
	font-size: 14px;
	text-decoration: none;
	box-shadow: 0 0 0 2px rgb(255 255 255 / 0.85);
}

.omaya-form__dot.is-win { background: var(--o-win); }
.omaya-form__dot.is-draw { background: var(--o-draw); }
.omaya-form__dot.is-loss { background: var(--o-loss); }

@media (max-width: 900px) {
	.omaya-stats__grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
	.omaya-stats__grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Player profile ---------- */

.omaya-profile {
	display: grid;
	grid-template-columns: minmax(240px, 380px) 1fr;
	gap: clamp(24px, 4vw, 56px);
	align-items: center;
}

.omaya-profile__photo {
	border-radius: calc(var(--o-radius) + 6px);
}

.omaya-profile__photo .omaya-player__bignum {
	font-size: clamp(120px, 16vw, 200px);
}

.omaya-profile__num {
	font-family: var(--o-display);
	font-size: 22px;
	font-weight: 800;
	color: var(--o-accent);
}

.omaya-profile__name {
	margin: 4px 0 24px;
	font-size: clamp(32px, 5vw, 56px);
	line-height: 1.15;
}

.omaya-profile__list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 12px;
	margin: 0;
}

.omaya-profile__list div {
	padding: 14px 16px;
	border-radius: 14px;
	background: var(--o-surface-2);
}

.omaya-profile__list dt {
	font-size: 13px;
	color: var(--o-muted);
}

.omaya-profile__list dd {
	margin: 2px 0 0;
	font-weight: 700;
	font-size: 17px;
}

.omaya-profile__stats {
	display: flex;
	gap: 12px;
	margin-top: 12px;
}

.omaya-profile__stats div {
	flex: 1;
	display: flex;
	flex-direction: column;
	padding: 16px 18px;
	border-radius: 14px;
	background: var(--o-primary);
	color: #fff;
}

.omaya-profile__stats b {
	font-family: var(--o-display);
	font-size: 36px;
	line-height: 1.1;
}

.omaya-profile__stats span {
	font-size: 13px;
	opacity: 0.85;
}

@media (max-width: 760px) {
	.omaya-profile {
		grid-template-columns: 1fr;
	}
	.omaya-profile__photo {
		max-width: 360px;
		width: 100%;
		margin-inline: auto;
	}
}

/* ---------- Scoreboard ---------- */

.omaya-scoreboard {
	padding: clamp(24px, 4vw, 44px);
	border-radius: calc(var(--o-radius) + 8px);
	background:
		radial-gradient(90% 80% at 50% 0%, rgb(255 255 255 / 0.1), transparent 60%),
		linear-gradient(165deg, var(--o-primary), var(--o-primary-dark));
	color: #fff;
	text-align: center;
}

.omaya-scoreboard__meta {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 12px;
	font-size: 14px;
	color: rgb(255 255 255 / 0.8);
}

.omaya-scoreboard__teams {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: clamp(12px, 3vw, 40px);
	margin: 28px 0;
}

.omaya-scoreboard__team {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
}

.omaya-scoreboard__team .omaya-badge {
	width: clamp(72px, 11vw, 120px);
	height: clamp(72px, 11vw, 120px);
}

.omaya-scoreboard__team .omaya-badge--initial {
	font-size: clamp(30px, 4vw, 48px);
}

.omaya-scoreboard__team h2 {
	margin: 0;
	color: inherit;
	font-size: clamp(18px, 2.4vw, 28px);
}

.omaya-scoreboard__score {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}

.omaya-scoreboard__digits {
	display: flex;
	align-items: center;
	gap: 10px;
	font-family: var(--o-display);
	font-size: clamp(48px, 8vw, 88px);
	font-weight: 900;
	line-height: 1;
}

.omaya-scoreboard__digits.is-time {
	direction: ltr;
	font-size: clamp(36px, 6vw, 60px);
}

.omaya-scoreboard__digits i {
	font-style: normal;
	opacity: 0.4;
}

.omaya-scoreboard .omaya-result-pill {
	background: rgb(255 255 255 / 0.14);
	color: #fff;
}

.omaya-scoreboard__info {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px 26px;
	padding-top: 20px;
	border-top: 1px solid rgb(255 255 255 / 0.15);
	font-size: 15px;
	color: rgb(255 255 255 / 0.85);
}

.omaya-scoreboard__info span {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

/* ---------- Contact ---------- */

.omaya-contact ul {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.omaya-contact li {
	display: flex;
	align-items: center;
	gap: 10px;
}

.omaya-contact .omaya-icon {
	color: var(--o-accent);
}

.omaya-contact a {
	color: inherit;
}

/* ---------- Team tag & light chip ---------- */

.omaya-squad-tag {
	display: inline-block;
	margin-inline-end: 4px;
	padding: 1px 8px;
	border-radius: 99px;
	background: rgb(200 22 29 / 0.1);
	color: var(--o-primary);
	font-style: normal;
	font-weight: 700;
	font-size: 12px;
}

.omaya-chip.is-light {
	background: #fff;
	color: var(--o-primary);
}

/* ---------- Featured image fallback ---------- */

.omaya-thumb-fallback {
	position: relative;
	width: 100%;
	flex: none;
	margin: 0;
	overflow: hidden;
	background:
		repeating-linear-gradient(135deg, rgb(255 255 255 / 0.04) 0 2px, transparent 2px 9px),
		radial-gradient(80% 80% at 70% 20%, rgb(255 255 255 / 0.12), transparent 70%),
		linear-gradient(160deg, var(--o-primary), var(--o-primary-dark));
}

.omaya-thumb-fallback a {
	position: absolute;
	inset: 0;
}

.omaya-thumb-fallback__crest {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
}

.omaya-thumb-fallback__crest img,
.omaya-thumb-fallback__crest svg {
	width: auto;
	height: 46%;
	max-width: 60%;
	opacity: 0.9;
	filter: drop-shadow(0 10px 20px rgb(0 0 0 / 0.35));
}
