/**
 * Varzeshi Sports — استایل فرانت‌اند
 *
 * از متغیرهای قالب ورزشی استفاده می‌کند و اگر قالب دیگری فعال باشد
 * به مقادیر جایگزین برمی‌گردد — پس با هر قالبی کار می‌کند.
 */

.vz-standings,
.vz-fixtures,
.vz-feed,
.vz-scorers,
.vz-match-card {
	--c-bg: var(--vz-bg, #fff);
	--c-surface: var(--vz-surface, #f4f6f8);
	--c-text: var(--vz-text, #16202a);
	--c-soft: var(--vz-text-soft, #5a6b7a);
	--c-faint: var(--vz-text-faint, #8b9aa8);
	--c-border: var(--vz-border, #e3e8ed);
	--c-primary: var(--vz-primary, #0a6c3c);
	--c-accent: var(--vz-accent, #e63946);
	--c-radius: var(--vz-r3, 12px);

	direction: rtl;
	font-family: inherit;
	color: var(--c-text);
	background: var(--c-bg);
	border-radius: var(--c-radius);
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(22, 32, 42, .06);
}

/* ============================================================
   جدول رده‌بندی
   ============================================================ */

.vz-standings__head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 16px;
	border-bottom: 1px solid var(--c-border);
}

.vz-standings__logo {
	width: 28px;
	height: 28px;
	object-fit: contain;
	flex-shrink: 0;
}

.vz-standings__title {
	margin: 0;
	font-size: 1rem;
	font-weight: 800;
	line-height: 1.4;
}

.vz-standings__season {
	margin-inline-start: auto;
	font-size: .8125rem;
	color: var(--c-faint);
}

.vz-standings__group {
	margin: 0;
	padding: 10px 16px;
	font-size: .875rem;
	font-weight: 700;
	background: var(--c-surface);
	color: var(--c-soft);
}

.vz-table-wrap {
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.vz-table {
	width: 100%;
	border-collapse: collapse;
	font-size: .875rem;
	font-variant-numeric: tabular-nums;
	font-feature-settings: "tnum";
	text-align: center;
}

.vz-table thead th {
	padding: 10px 6px;
	font-size: .75rem;
	font-weight: 700;
	color: #fff;
	background: var(--c-primary);
	white-space: nowrap;
	border: 0;
}

.vz-table thead th abbr {
	text-decoration: none;
	border: 0;
	cursor: help;
}

.vz-table tbody td {
	padding: 9px 6px;
	border-bottom: 1px solid var(--c-border);
	white-space: nowrap;
}

.vz-table tbody tr:last-child td {
	border-bottom: 0;
}

.vz-table tbody tr:hover {
	background: var(--c-surface);
}

.vz-col-rank {
	width: 36px;
	color: var(--c-faint);
	font-size: .8125rem;
}

.vz-col-team {
	text-align: start;
	min-width: 150px;
	white-space: normal;
}

.vz-col-pts {
	/* fallback برای مرورگرهایی که color-mix ندارند */
	background: rgba(10, 108, 60, .07);
	background: color-mix(in srgb, var(--c-primary) 7%, transparent);
	font-weight: 800;
}

.vz-col-gd {
	color: var(--c-soft);
}

.vz-team {
	display: flex;
	align-items: center;
	gap: 8px;
}

.vz-team__logo,
.vz-player__photo {
	width: 22px;
	height: 22px;
	object-fit: contain;
	flex-shrink: 0;
}

.vz-player__photo {
	border-radius: 50%;
}

.vz-team__name {
	font-weight: 600;
	line-height: 1.4;
}

/* نوار رنگی منطقه جدول — سهمیه قاره‌ای یا سقوط */
.vz-zone .vz-col-rank {
	position: relative;
}

.vz-zone .vz-col-rank::before {
	content: "";
	position: absolute;
	inset-inline-start: 0;
	top: 0;
	bottom: 0;
	width: 3px;
}

.vz-zone--ucl .vz-col-rank::before { background: #1e88e5; }
.vz-zone--uel .vz-col-rank::before { background: #fb8c00; }
.vz-zone--conf .vz-col-rank::before { background: #26a69a; }
.vz-zone--po .vz-col-rank::before { background: #8e24aa; }
.vz-zone--rel .vz-col-rank::before { background: var(--c-accent); }

/* فرم ۵ بازی اخیر */
.vz-form {
	display: inline-flex;
	gap: 3px;
}

.vz-form__dot {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	display: inline-block;
}

.vz-form__dot--win { background: #2e7d32; }
.vz-form__dot--draw { background: #9e9e9e; }
.vz-form__dot--lose { background: var(--c-accent); }

.vz-standings__note {
	margin: 0;
	padding: 10px 16px;
	font-size: .75rem;
	color: var(--c-faint);
	border-top: 1px solid var(--c-border);
}

.vz-standings--compact .vz-table {
	font-size: .8125rem;
}

.vz-standings--compact .vz-col-team {
	min-width: 110px;
}

/* ============================================================
   بازی‌ها
   ============================================================ */

.vz-fixtures__title,
.vz-feed__title,
.vz-scorers__title {
	margin: 0;
	padding: 14px 16px;
	font-size: 1rem;
	font-weight: 800;
	border-bottom: 1px solid var(--c-border);
}

.vz-fixtures__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.vz-match {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 12px 16px;
	border-bottom: 1px solid var(--c-border);
}

.vz-match:last-child {
	border-bottom: 0;
}

.vz-match--live {
	background: rgba(230, 57, 70, .05);
	background: color-mix(in srgb, var(--c-accent) 5%, transparent);
}

.vz-match__teams {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 10px;
}

.vz-match__team {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: .9375rem;
	min-width: 0;
}

.vz-match__team span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.vz-match__team img {
	width: 24px;
	height: 24px;
	object-fit: contain;
	flex-shrink: 0;
}

.vz-match__team--away {
	flex-direction: row-reverse;
	text-align: start;
}

.vz-match__team.is-winner {
	font-weight: 800;
}

.vz-match__score {
	min-width: 64px;
	padding: 3px 10px;
	text-align: center;
	font-weight: 800;
	font-size: .9375rem;
	background: var(--c-surface);
	border-radius: 6px;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.vz-match--live .vz-match__score {
	background: var(--c-accent);
	color: #fff;
}

.vz-match__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 10px;
	font-size: .75rem;
	color: var(--c-faint);
}

.vz-badge {
	padding: 1px 8px;
	font-size: .6875rem;
	font-weight: 700;
	border-radius: 999px;
	background: var(--c-surface);
	color: var(--c-soft);
}

.vz-badge--live {
	background: var(--c-accent);
	color: #fff;
	animation: vz-pulse 2s ease-in-out infinite;
}

@keyframes vz-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: .55; }
}

@media (prefers-reduced-motion: reduce) {
	.vz-badge--live {
		animation: none;
	}
}

/* ============================================================
   کارت بازی در خبر
   ============================================================ */

.vz-match-card {
	margin: 24px 0;
	border: 1px solid var(--c-border);
}

.vz-match-card__league {
	padding: 10px 16px;
	font-size: .8125rem;
	font-weight: 700;
	color: #fff;
	background: var(--c-primary);
	text-align: center;
}

.vz-match-card--live .vz-match-card__league {
	background: var(--c-accent);
}

.vz-match-card__body {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 12px;
	padding: 20px 16px;
}

.vz-match-card__team {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	text-align: center;
	font-weight: 700;
	font-size: .9375rem;
}

.vz-match-card__team img {
	width: 48px;
	height: 48px;
	object-fit: contain;
}

.vz-match-card__score {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	min-width: 90px;
}

.vz-match-card__score strong {
	font-size: 1.6rem;
	font-weight: 900;
	font-variant-numeric: tabular-nums;
	line-height: 1;
}

.vz-match-card__score span {
	font-size: .75rem;
	color: var(--c-faint);
}

.vz-match-card__venue {
	padding: 10px 16px;
	font-size: .8125rem;
	color: var(--c-faint);
	text-align: center;
	border-top: 1px solid var(--c-border);
}

/* ============================================================
   خبرخوان
   ============================================================ */

.vz-feed__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.vz-feed__item {
	padding: 12px 16px;
	border-bottom: 1px solid var(--c-border);
}

.vz-feed__item:last-child {
	border-bottom: 0;
}

.vz-feed__link {
	display: block;
	font-size: .9375rem;
	font-weight: 700;
	line-height: 1.6;
	color: var(--c-text);
	text-decoration: none;
}

.vz-feed__link:hover {
	color: var(--c-primary);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* نشانه بیرونی بودن لینک — بازدیدکننده باید بداند از سایت خارج می‌شود */
.vz-feed__link::after {
	content: " ↗";
	font-size: .75em;
	color: var(--c-faint);
}

.vz-feed__excerpt {
	margin: 4px 0 0;
	font-size: .8125rem;
	line-height: 1.7;
	color: var(--c-soft);
}

.vz-feed__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 6px;
	font-size: .75rem;
	color: var(--c-faint);
}

.vz-feed__source {
	font-weight: 700;
	color: var(--c-primary);
}

.vz-feed__disclaimer {
	margin: 0;
	padding: 10px 16px;
	font-size: .75rem;
	line-height: 1.6;
	color: var(--c-faint);
	background: var(--c-surface);
	border-top: 1px solid var(--c-border);
}

/* ============================================================
   وضعیت‌ها
   ============================================================ */

.vz-notice {
	padding: 14px 16px;
	font-size: .875rem;
	color: var(--vz-text-soft, #5a6b7a);
	background: var(--vz-surface, #f4f6f8);
	border-radius: var(--vz-r2, 8px);
	border-inline-start: 3px solid var(--vz-accent, #e63946);
}

.vz-empty {
	margin: 0;
	padding: 24px 16px;
	text-align: center;
	font-size: .875rem;
	color: var(--c-faint);
}

/* ============================================================
   موبایل
   ============================================================ */

@media (max-width: 560px) {
	.vz-table {
		font-size: .8125rem;
	}

	.vz-col-team {
		min-width: 120px;
	}

	.vz-match__teams {
		gap: 6px;
	}

	.vz-match__team {
		font-size: .8125rem;
	}

	.vz-match__team img {
		width: 20px;
		height: 20px;
	}

	.vz-match-card__team img {
		width: 40px;
		height: 40px;
	}

	.vz-match-card__score strong {
		font-size: 1.35rem;
	}
}

/* ============================================================
   حالت تاریک
   ============================================================ */

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .vz-standings,
	:root:not([data-theme="light"]) .vz-fixtures,
	:root:not([data-theme="light"]) .vz-feed,
	:root:not([data-theme="light"]) .vz-scorers,
	:root:not([data-theme="light"]) .vz-match-card {
		--c-bg: var(--vz-bg, #1b242e);
		--c-surface: var(--vz-surface, #121a22);
		--c-text: var(--vz-text, #eaf0f5);
		--c-soft: var(--vz-text-soft, #a8b7c4);
		--c-faint: var(--vz-text-faint, #7e8f9d);
		--c-border: var(--vz-border, #2c3844);
	}
}
