/* GameX Ads — public styles */

/* ── Slot wrapper ─────────────────────────────────── */
.gxa-slot {
	margin: var(--gx-sp-4, 16px) auto;
	max-width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--gx-sp-2, 8px);
}
.gxa-slot:empty {
	display: none;
}
.gxa-slot img {
	max-width: 100%;
	height: auto;
}

/* Mid-grid ads sit inside a CSS Grid container as a single cell — they
   line up with the card grid like an extra "card" slot. The slot is flex-
   centered so smaller ads (300x250 / 336x280) sit centered inside the cell.
   For wide leaderboards (728x90, 970x90), use listing_above_grid or
   listing_before_pagination instead — those slots are full-width. */
.gxa-slot--listing-in-grid {
	margin: 0;
	min-width: 0;
	min-height: 0;
	justify-content: center;
}
.gxa-slot--listing-in-grid > * {
	max-width: 100%;
}

/* In list view, the listing container isn't a grid — let the slot fall back
   to spanning the row width like the list cards do. */
html.gxa-view-list .gxa-slot--listing-in-grid {
	width: 100%;
	margin: var(--gx-sp-2, 8px) 0;
}

/* On mobile the grid is only 2 columns, so a 250x300 / 300x250 ad would
   overflow its single cell. Let it span the full grid row instead. */
@media (max-width: 767px) {
	.gxa-slot--listing-in-grid {
		grid-column: 1 / -1;
		width: 100%;
	}
}

/* ── View targeting (archive list vs grid) ─────────── */
html.gxa-view-list .gxa-view-grid,
html:not(.gxa-view-list) .gxa-view-list {
	display: none !important;
}

/* ── Device targeting via viewport width (CSS, not UA) ──
   Server can't reliably detect device under page caching, so we render
   both variants and let the viewport pick. Breakpoint matches the theme's
   navbar/sidebar transition at 768px. */
@media (max-width: 767px) {
	.gxa-device-desktop { display: none !important; }
}
@media (min-width: 768px) {
	.gxa-device-mobile { display: none !important; }
}

/* ── Sponsored tabs bar ───────────────────────────── */
.gxa-tabs-bar {
	margin: var(--gx-sp-4, 16px) 0;
}

.gxa-tabs-bar__inner {
	display: flex;
	flex-wrap: nowrap;
	align-items: stretch;
	justify-content: center;
	gap: 8px;
	padding: 0 16px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}
.gxa-tabs-bar__inner::-webkit-scrollbar { display: none; }

.gxa-tab {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
	padding: 6px 14px;
	background: var(--gx-bg-tertiary, rgba(255, 255, 255, 0.06));
	color: var(--gx-text-primary, #e6e6e6);
	border-radius: 6px;
	font-size: 0.85rem;
	font-weight: 600;
	text-decoration: none;
	border: 1px solid var(--gx-border, rgba(255, 255, 255, 0.1));
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
	white-space: nowrap;
}
.gxa-tab:hover {
	background: var(--gx-bg-card-hover, rgba(255, 255, 255, 0.1));
	border-color: var(--gx-accent, #0084ff);
	color: var(--gx-accent, #0084ff);
}

.gxa-tab__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 1.05em;
	line-height: 1;
	flex-shrink: 0;
}

/* ── Tab style presets ────────────────────────────── */

/* Live: blinking red dot prefix */
.gxa-tab--live::before {
	content: '';
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #ff2d2d;
	box-shadow: 0 0 8px rgba(255, 45, 45, 0.85);
	margin-right: 2px;
	animation: gxa-blink 1.2s ease-in-out infinite;
}
@keyframes gxa-blink {
	0%, 100% { opacity: 1; transform: scale(1); }
	50%      { opacity: 0.4; transform: scale(0.85); }
}

/* Glow: soft pulsing accent halo */
.gxa-tab--glow {
	animation: gxa-glow 2.4s ease-in-out infinite;
}
@keyframes gxa-glow {
	0%, 100% { box-shadow: 0 0 0 rgba(110, 58, 255, 0); }
	50%      { box-shadow: 0 0 14px rgba(110, 58, 255, 0.55); }
}

/* Hot: animated gradient — overrides custom bg color */
.gxa-tab--hot {
	background: linear-gradient(135deg, #ff3b6f, #ff8c3b, #ff3b6f) !important;
	background-size: 220% 220%;
	color: #fff !important;
	border-color: transparent !important;
	animation: gxa-hot-shift 3.5s ease infinite;
}
@keyframes gxa-hot-shift {
	0%, 100% { background-position: 0% 50%; }
	50%      { background-position: 100% 50%; }
}

/* Shimmer: a sheen that sweeps across the tab every few seconds */
.gxa-tab--shimmer {
	position: relative;
	overflow: hidden;
}
.gxa-tab--shimmer::after {
	content: '';
	position: absolute;
	top: 0;
	left: -50%;
	width: 50%;
	height: 100%;
	background: linear-gradient(
		90deg,
		transparent,
		rgba(255, 255, 255, 0.18),
		transparent
	);
	transform: skewX(-20deg);
	animation: gxa-shimmer 3.5s ease-in-out infinite;
	pointer-events: none;
}
@keyframes gxa-shimmer {
	0%   { left: -50%; }
	60%  { left: 110%; }
	100% { left: 110%; }
}

/* Reduced-motion users: kill the animations, keep the static styling */
@media (prefers-reduced-motion: reduce) {
	.gxa-tab--live::before,
	.gxa-tab--glow,
	.gxa-tab--hot,
	.gxa-tab--shimmer::after {
		animation: none;
	}
}

.gxa-tab__label {
	display: inline-block;
	max-width: 200px;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Compact on mobile so 3-4 tabs fit in a single row */
@media (max-width: 480px) {
	.gxa-tabs-bar__inner {
		gap: 6px;
		padding: 6px 12px;
	}
	.gxa-tab {
		padding: 5px 10px;
		font-size: 0.78rem;
	}
	.gxa-tab__icon {
		width: 16px;
		height: 16px;
	}
	.gxa-tab__label {
		max-width: 120px;
	}
}

/* ── Game player preroll overlay ──────────────────── */
.gxa-preroll {
	position: absolute;
	inset: 0;
	z-index: 5;
	background: rgba(0, 0, 0, 0.92);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
}
.gxa-preroll[hidden] { display: none; }

.gxa-preroll__square {
	width: min(80%, 400px);
	max-height: calc(100% - 80px);
	aspect-ratio: 1;
	background: #0a0a0a;
	border-radius: 8px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.gxa-preroll__ad {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}
.gxa-preroll__ad > * {
	max-width: 100%;
	max-height: 100%;
}
.gxa-preroll__ad img,
.gxa-preroll__ad iframe,
.gxa-preroll__ad video {
	max-width: 100%;
	max-height: 100%;
	display: block;
}

.gxa-preroll__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: min(80%, 400px);
	margin-top: 14px;
	color: rgba(255, 255, 255, 0.65);
	font-size: 0.8rem;
}

.gxa-preroll__hint {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.gxa-preroll__skip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.15);
	font-size: 0.85rem;
	font-weight: 600;
	font-family: inherit;
	cursor: not-allowed;
	opacity: 0.7;
	transition: opacity 0.15s ease, background 0.15s ease;
	flex-shrink: 0;
}
.gxa-preroll__skip:not(:disabled),
.gxa-preroll__skip.is-ready {
	cursor: pointer;
	opacity: 1;
}
.gxa-preroll__skip:not(:disabled):hover,
.gxa-preroll__skip.is-ready:hover {
	background: rgba(255, 255, 255, 0.16);
}

.gxa-preroll__skip-counter {
	font-variant-numeric: tabular-nums;
	font-weight: 400;
	opacity: 0.7;
	min-width: 1.5em;
	text-align: right;
}

@media (max-width: 480px) {
	.gxa-preroll {
		padding: 10px;
	}
	.gxa-preroll__square,
	.gxa-preroll__bar {
		width: min(92%, 320px);
	}
	.gxa-preroll__hint {
		display: none;
	}
	.gxa-preroll__bar {
		justify-content: flex-end;
	}
}
