/**
 * برگه‌ی «بازی‌های اینترلن» (`/games/`) — پیشوند `ilg-`. سردر و نوار پایانی از قاب
 * مشترک (`assets/frame/frame.css`، پیشوند `ilf-`) می‌آیند؛ این فایل پس از آن بار
 * می‌شود (وابستگی `interlan-frame`)، پس قاعده‌ی هم‌ویژگی این‌جا می‌برد.
 *
 * ⚠️ تیلویند نه — بیلدش روی تولید ساختنی نیست (کلاس تازه بی‌صدا ساخته نمی‌شود).
 */

.ilg {
	--ilg-green: #00843D;
	--ilg-forest: #0F3A2E;
	--ilg-ink: #16241D;
	--ilg-muted: #5B6B62;
	--ilg-line: rgba(18, 38, 29, .10);
	--ilg-card: #FFFFFF;
	--ilg-mint: #EAF5EE;
	--ilg-ease: cubic-bezier(.2, .7, .2, 1);
}

/* کاورهای بازی مربع‌اند، نه ۳:۴ جلد کتاب */
.ilf-page--games .ilf-cover {
	aspect-ratio: 1;
}

.ilg .ilg-main {
	width: min(1180px, 100% - 32px);
	margin-inline: auto;
	padding-block: 12px 56px;
}

/* ---------- فهرست ---------- */

.ilg .ilg-head {
	margin-bottom: 22px;
}

.ilg .ilg-head h2 {
	margin: 0;
	font-size: clamp(20px, 14px + 1.2vw, 28px);
	font-weight: 800;
	line-height: 1.5;
	color: var(--ilg-ink);
}

.ilg .ilg-head p {
	margin: 6px 0 0;
	font-size: 15px;
	line-height: 1.9;
	color: var(--ilg-muted);
}

.ilg .ilg-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
	gap: 22px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ilg a.ilg-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	border: 1px solid var(--ilg-line);
	border-radius: 22px;
	background: var(--ilg-card);
	box-shadow: 0 16px 36px -30px rgba(18, 38, 29, .55);
	color: var(--ilg-ink);
	text-decoration: none;
	transition: translate .3s var(--ilg-ease), box-shadow .3s var(--ilg-ease), border-color .3s;
}

.ilg a.ilg-card:hover,
.ilg a.ilg-card:focus-visible {
	translate: 0 -4px;
	border-color: rgba(0, 132, 61, .35);
	box-shadow: 0 26px 44px -28px rgba(18, 38, 29, .5);
	color: var(--ilg-ink);
}

.ilg .ilg-card__cover {
	display: block;
	aspect-ratio: 1;
	overflow: hidden;
	background: var(--ilg-mint);
}

.ilg .ilg-card__cover img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: scale .5s var(--ilg-ease);
}

.ilg a.ilg-card:hover .ilg-card__cover img {
	scale: 1.04;
}

.ilg .ilg-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 8px;
	padding: 18px 20px 20px;
}

.ilg .ilg-card__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.ilg .ilg-card__tags span {
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--ilg-mint);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.7;
	color: var(--ilg-green);
}

.ilg .ilg-card__title {
	font-size: 19px;
	font-weight: 800;
	line-height: 1.5;
}

.ilg .ilg-card__text {
	flex: 1;
	font-size: 14px;
	line-height: 1.9;
	color: var(--ilg-muted);
}

.ilg .ilg-card__go {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 4px;
	font-size: 15px;
	font-weight: 700;
	color: var(--ilg-green);
}

.ilg .ilg-card__go svg {
	width: 18px;
	height: 18px;
	transition: translate .25s var(--ilg-ease);
}

.ilg a.ilg-card:hover .ilg-card__go svg {
	translate: -4px 0;
}

/* ---------- بازی باز ---------- */

.ilg .ilg-player {
	display: grid;
	grid-template-columns: minmax(0, 480px) minmax(0, 1fr);
	gap: 28px;
	align-items: start;
	margin: 18px 0 44px;
	scroll-margin-top: 90px;
}

/**
 * قاب بازی: بازی‌ها برای ستون میانی چت ساخته شده‌اند (باریک و بلند).
 * ⚠️ `height` صریح لازم است؛ بازی‌ها با `height: 100%` خود را به قاب می‌چسبانند
 * و بدون آن iframe روی ۱۵۰px پیش‌فرض می‌ماند.
 */
.ilg .ilg-player__frame {
	overflow: hidden;
	height: min(820px, calc(100svh - 120px));
	min-height: 560px;
	border: 1px solid var(--ilg-line);
	border-radius: 24px;
	background: #fff;
	box-shadow: 0 30px 60px -40px rgba(18, 38, 29, .6);
}

.ilg .ilg-player__frame iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

.ilg .ilg-player__side {
	position: sticky;
	top: 100px;
	padding-top: 8px;
}

.ilg .ilg-eyebrow {
	margin: 0;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--ilg-green);
}

.ilg .ilg-player__side h1 {
	margin: 6px 0 10px;
	font-size: clamp(24px, 16px + 1.5vw, 34px);
	font-weight: 800;
	line-height: 1.4;
	color: var(--ilg-ink);
}

.ilg .ilg-player__side > p {
	margin: 0 0 18px;
	font-size: 15px;
	line-height: 2;
	color: var(--ilg-muted);
}

.ilg .ilg-note {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
	padding: 16px 18px;
	border: 1px solid rgba(0, 132, 61, .18);
	border-radius: 18px;
	background: var(--ilg-mint);
	font-size: 14px;
	line-height: 1.9;
	color: var(--ilg-ink);
}

.ilg .ilg-note strong {
	font-weight: 800;
}

.ilg a.ilg-btn--solid {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 20px;
	border-radius: 12px;
	background: var(--ilg-green);
	box-shadow: 0 8px 20px rgba(0, 132, 61, .2);
	font-size: 14px;
	font-weight: 700;
	color: #fff;
	text-decoration: none;
	transition: background-color .2s, translate .2s;
}

.ilg a.ilg-btn--solid:hover {
	background: #006B31;
	color: #fff;
	translate: 0 -1px;
}

.ilg a.ilg-back {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 18px;
	font-size: 14px;
	font-weight: 700;
	color: var(--ilg-muted);
	text-decoration: none;
}

.ilg a.ilg-back:hover {
	color: var(--ilg-green);
}

.ilg a.ilg-back svg {
	width: 16px;
	height: 16px;
}

/* ---------- واکنش‌گرا ---------- */

@media (max-width: 900px) {
	.ilg .ilg-player {
		grid-template-columns: minmax(0, 1fr);
		gap: 18px;
	}

	/* روی موبایل خودِ بازی اول می‌آید؛ توضیح و پیام مهمان زیرش — بازی عنوان خودش را دارد */
	.ilg .ilg-player__side {
		position: static;
		padding-top: 0;
	}

	.ilg .ilg-player__side > p {
		margin-bottom: 12px;
	}

	.ilg .ilg-player__frame {
		height: calc(100svh - 90px);
		min-height: 520px;
		border-radius: 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ilg *,
	.ilg *::before,
	.ilg *::after {
		transition: none !important;
	}
}
