/* Home hero: tilted wall of game cards moving in rows (scripts/hero-games.js).
   Same size as the old event banner: 2120x742 picture, full page width. */
.hg {
	/* five card rows fill the frame, so the card size follows its height */
	--hg-h: clamp(340px, 35vw, 560px);
	--hg-gap: 10px;
	--hg-card-w: calc((var(--hg-h) / 5 - var(--hg-gap)) * 16 / 9);
	position: relative;
	overflow: hidden;
	height: var(--hg-h);
	background: #0c1018 url("/assets/hero/fallback.webp") center / cover no-repeat;
	isolation: isolate;
}
.hg.is-ready { background-image: none; }

/* The wall is bigger than the frame and turned, so no empty corners show */
.hg-wall {
	position: absolute;
	inset: -45% -20%;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: var(--hg-gap);
	transform: rotate(-9deg);
	z-index: 0;
}
/* there are more rows than fit (they fill the turned corners): no shrinking */
.hg-row { overflow: visible; flex: none; }
.hg-track {
	display: flex;
	gap: var(--hg-gap);
	width: max-content;
	animation: hg-move var(--hg-dur, 80s) linear infinite;
}
.hg-row--back .hg-track { animation-direction: reverse; }
.hg-row:hover .hg-track { animation-play-state: paused; }
@keyframes hg-move {
	from { transform: translateX(0); }
	to { transform: translateX(calc(-50% - var(--hg-gap) / 2)); }
}

.hg-card {
	position: relative;
	display: block;
	flex: none;
	width: var(--hg-card-w);
	aspect-ratio: 16 / 9;
	border-radius: 8px;
	overflow: hidden;
	background: #151c28;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
	filter: brightness(0.62) saturate(1.05);
	transition: filter 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.hg-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hg-card__name {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 18px 10px 7px;
	font: 600 13px/1.2 var(--gg-font, "Segoe UI", sans-serif);
	color: #fff;
	background: linear-gradient(to top, rgba(6, 10, 18, 0.9), transparent);
	opacity: 0;
	transform: translateY(6px);
	transition: opacity 0.2s ease, transform 0.2s ease;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.hg-card:hover,
.hg-card:focus-visible {
	filter: brightness(1.05) saturate(1.1);
	transform: scale(1.07);
	box-shadow: 0 0 0 2px var(--gg-accent, #5bc8f4), 0 10px 28px rgba(0, 0, 0, 0.6);
	z-index: 2;
	outline: none;
}
.hg-card:hover .hg-card__name,
.hg-card:focus-visible .hg-card__name { opacity: 1; transform: none; }

/* Dark left side for the text; it lets clicks through to the cards */
.hg-fade {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background:
		linear-gradient(90deg, rgba(9, 14, 24, 0.94) 0%, rgba(9, 14, 24, 0.9) 26%, rgba(9, 14, 24, 0.45) 52%, rgba(9, 14, 24, 0) 75%),
		linear-gradient(0deg, rgba(9, 14, 24, 0.75) 0%, rgba(9, 14, 24, 0) 30%),
		radial-gradient(60% 90% at 8% 60%, rgba(57, 154, 237, 0.22), transparent 70%);
}

.hg-text {
	position: relative;
	z-index: 2;
	height: 100%;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
	pointer-events: none;
}
.hg-text > * { pointer-events: auto; }
.hg-logo { width: clamp(150px, 13vw, 240px); height: auto; margin-bottom: clamp(10px, 1.4vw, 22px); }
.hg-title {
	font-family: var(--gg-font-display, "Bahnschrift", sans-serif);
	font-size: clamp(30px, 3.6vw, 62px);
	line-height: 1.08;
	font-weight: 700;
	color: #fff;
	margin: 0;
	text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
}
.hg-title span { display: block; color: var(--gg-accent, #5bc8f4); }
.hg-sub {
	margin: clamp(10px, 1.2vw, 18px) 0 clamp(14px, 1.6vw, 24px);
	color: #cdd6e2;
	font-size: clamp(13px, 1.05vw, 17px);
	max-width: 560px;
}

@media (max-width: 720px) {
	.hg { --hg-h: 420px; }
	.hg-fade {
		background:
			linear-gradient(90deg, rgba(9, 14, 24, 0.92), rgba(9, 14, 24, 0.7)),
			linear-gradient(0deg, rgba(9, 14, 24, 0.8), transparent 40%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.hg-track { animation: none; }
}
