/**
 * Fixes mirror homepage images/layout: extracted stake CSS omits some Tailwind
 * @container variants; scoped overrides beat Tailwind preflight where needed.
 */

/* Stake wordmark (header + footer); parent uses w-full so preflight max-width:100% blows up the SVG */
#stake-mirror-home a[data-testid='home-button'] [data-content],
#stake-mirror-home footer [data-content]:has(img[alt='Stake logo']) {
	width: auto;
}

#stake-mirror-home img[alt='Stake logo'] {
	height: 2.5rem;
	width: auto;
	max-width: min(12rem, 100%);
	max-height: 2.5rem;
	object-fit: contain;
}

/* Hero / promo width cap (class in snapshot, not in bundled utilities) */
#stake-mirror-home .max-w-\[calc\(1200px\+6vw\)\] {
	max-width: calc(1200px + 6vw);
}

#stake-mirror-home .min-h-\[550px\] {
	min-height: 550px;
}

/* Promotion row thumbnails (--max-width on inline style) */
#stake-mirror-home .svelte-xxoerf[style*='--max-width'] {
	width: var(--max-width);
	max-width: var(--max-width);
	max-height: var(--max-height);
	flex: 0 0 var(--max-width);
	align-self: stretch;
}

#stake-mirror-home .svelte-xxoerf img {
	width: 100%;
	height: 100%;
	max-width: var(--max-width, 100%);
	max-height: var(--max-height, 100%);
	object-fit: cover;
}

/* Game tiles: absolute cover inside aspect-ratio box */
#stake-mirror-home .img-wrap.svelte-1byrcnp img {
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

/* Hero banners (preflight height:auto breaks h-full + cover) */
#stake-mirror-home .min-h-\[550px\] img,
#stake-mirror-home img[style*='aspect-ratio'] {
	max-width: none;
}

/* Load More height animation (bundled CSS references an undefined duration) */
#stake-mirror-home .expandable-grid.svelte-lrjd55 {
	--transition-duration: 450ms;
}

#stake-mirror-home .load-more-container[hidden] {
	display: none;
}

/* Responsive hero art (parent has class="@container") */
@container (min-width: 768px) {
	#stake-mirror-home .\@min-\[768px\]\:hidden {
		display: none !important;
	}

	#stake-mirror-home .\@min-\[768px\]\:block {
		display: block !important;
	}
}

@container (min-width: 1200px) {
	#stake-mirror-home .\@min-\[1200px\]\:hidden {
		display: none !important;
	}

	#stake-mirror-home .\@min-\[1200px\]\:block {
		display: block !important;
	}
}

/* Casino game page (/casino/games/:id) */
#stake-game-page {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	width: 100%;
	padding-top: 0.75rem;
	color: var(--edge-color-surface-fg-default);
	font-family: var(--edge-font-family-regular);
}

#stake-game-page [hidden] {
	display: none !important;
}

#stake-game-page .gp-stage {
	position: absolute;
	inset: 0;
	background: var(--color-game-grey-900, #071824);
	overflow: hidden;
}

#stake-game-page .gp-stage-bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: blur(22px) saturate(1.15);
	transform: scale(1.12);
}

#stake-game-page .gp-poster {
	width: 168px;
	height: 220px;
	object-fit: cover;
	border-radius: var(--edge-radius-md);
	box-shadow: var(--shadows-lg);
}

#stake-game-page .gp-poster-fallback,
#stake-game-page .gp-card-fallback {
	display: grid;
	place-items: center;
	border-radius: var(--edge-radius-md);
	background: linear-gradient(160deg, #214e8f, #0b1c2c);
	color: #fff;
	font-weight: 700;
}

#stake-game-page .gp-poster-fallback {
	width: 168px;
	height: 220px;
	font-size: 3rem;
}

#stake-game-page .gp-card-fallback {
	position: absolute;
	inset: 0;
	font-size: 1.5rem;
}

#stake-game-page .gp-splash-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.75rem;
}

#stake-game-page .gp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 8.5rem;
	border: 0;
	border-radius: var(--edge-radius-md);
	padding: 0.625rem 1.25rem;
	font-family: inherit;
	font-size: var(--edge-scale-14, 14px);
	font-weight: var(--edge-font-weight-semiBold, 600);
	box-shadow: var(--shadows-md);
	cursor: pointer;
}

#stake-game-page .gp-btn:active {
	transform: scale(0.98);
}

#stake-game-page .gp-btn-brand {
	background: var(--edge-color-brand-bg-default);
	color: var(--edge-color-brand-fg-default);
}

#stake-game-page .gp-btn-neutral {
	background: var(--edge-color-neutral-bg-default);
	color: var(--edge-color-neutral-fg-default);
}

#stake-game-page .gp-live {
	position: absolute;
	inset: 0;
}

#stake-game-page .gp-game-frame {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	background: #071824;
}

#stake-game-page .gp-frame-error {
	position: relative;
	z-index: 1;
	margin: 1rem;
	color: #fff;
}

#stake-game-page .gp-features,
#stake-game-page .gp-challenges {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0.9rem 0 0;
	padding: 0;
	list-style: none;
}

#stake-game-page .gp-features li {
	border-radius: 999px;
	background: var(--edge-color-surface-bg-sunken);
	padding: 0.25rem 0.65rem;
	font-size: 12px;
	font-weight: 600;
}

#stake-game-page .gp-challenges {
	flex-direction: column;
}

#stake-game-page .gp-challenge {
	border-radius: var(--edge-radius-md);
	background: var(--edge-color-surface-bg-sunken);
	padding: 0.75rem 0.9rem;
}

#stake-game-page .gp-challenge-top {
	display: flex;
	justify-content: space-between;
	gap: 0.75rem;
}

#stake-game-page .gp-challenge p,
#stake-game-page .gp-challenge small {
	display: block;
	margin: 0.3rem 0 0;
	color: var(--edge-color-surface-fg-subtle);
}

#stake-game-page .gp-wins-wrap {
	overflow-x: auto;
}

#stake-game-page .gp-wins {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

#stake-game-page .gp-wins th,
#stake-game-page .gp-wins td {
	padding: 0.65rem 0.4rem;
	border-bottom: 1px solid var(--edge-color-surface-fg-decorative);
	text-align: left;
	white-space: nowrap;
}

#stake-game-page .gp-wins th {
	color: var(--edge-color-surface-fg-subtle);
	font-weight: 600;
}

#stake-game-page .gp-missing {
	padding: 2rem 0;
}

#stake-game-page .gp-missing a {
	color: var(--edge-color-brand-bg-default);
}

#stake-game-page .gp-live-shade {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgb(7 24 36 / 45%), transparent 32%);
	pointer-events: none;
}

#stake-game-page .gp-live-badge {
	position: relative;
	z-index: 1;
	display: inline-flex;
	margin: 1rem;
	border-radius: 999px;
	background: rgb(7 18 28 / 72%);
	padding: 0.4rem 0.75rem;
	font-size: 13px;
	font-weight: 600;
}

#stake-game-page .gp-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1rem;
	flex-wrap: wrap;
}

#stake-game-page .gp-ident,
#stake-game-page .gp-actions,
#stake-game-page .gp-sub,
#stake-game-page .gp-playing {
	display: flex;
	align-items: center;
}

#stake-game-page .gp-ident {
	gap: 0.5rem;
	min-width: 0;
}

#stake-game-page .gp-heading {
	min-width: 0;
}

#stake-game-page .gp-title {
	margin: 0;
	font-size: 1rem;
	line-height: 1.3;
	font-weight: var(--edge-font-weight-semiBold, 600);
}

#stake-game-page .gp-sub,
#stake-game-page .gp-playing {
	gap: 0.4rem;
	margin: 0.15rem 0 0;
	color: var(--edge-color-surface-fg-subtle);
	font-size: 13px;
}

#stake-game-page .gp-sub a {
	color: inherit;
	text-decoration: none;
}

#stake-game-page .gp-sub a:hover {
	text-decoration: underline;
}

#stake-game-page .gp-live-dot {
	width: 6px;
	height: 6px;
	flex: none;
	border-radius: 50%;
	background: var(--edge-color-positive-bg-default, #1ad672);
}

#stake-game-page .gp-actions {
	gap: 0.35rem;
	margin-left: auto;
}

#stake-game-page .gp-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	border: 0;
	border-radius: var(--edge-radius-md);
	background: transparent;
	color: var(--edge-color-surface-fg-default);
	cursor: pointer;
	text-decoration: none;
}

#stake-game-page .gp-icon:hover {
	background: var(--edge-color-surface-bg-highest);
}

#stake-game-page .gp-icon[aria-pressed='true'] {
	color: var(--edge-color-brand-bg-default);
}

#stake-game-page .gp-modes {
	display: flex;
	gap: 2px;
	border-radius: 999px;
	background: var(--edge-color-surface-bg-sunken);
	padding: 0.25rem;
}

#stake-game-page .gp-modes button {
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--edge-color-surface-fg-subtle);
	padding: 0.35rem 0.8rem;
	font: 600 13px var(--edge-font-family-regular);
	cursor: pointer;
}

#stake-game-page .gp-modes button[aria-pressed='true'] {
	background: var(--edge-color-neutral-bg-default);
	color: var(--edge-color-neutral-fg-default);
}

#stake-game-page .gp-panel {
	border-radius: var(--edge-radius-md);
	background: var(--edge-color-surface-bg-highest);
	padding: 0.25rem 1rem 1rem;
}

#stake-game-page .gp-tabs {
	display: flex;
	gap: 0.25rem;
	overflow-x: auto;
	scrollbar-width: none;
	border-bottom: 1px solid var(--edge-color-surface-fg-decorative);
}

#stake-game-page .gp-tabs::-webkit-scrollbar {
	display: none;
}

#stake-game-page .gp-tabs button {
	border: 0;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
	background: none;
	color: var(--edge-color-surface-fg-subtle);
	padding: 0.85rem 0.9rem;
	font: 600 14px var(--edge-font-family-regular);
	white-space: nowrap;
	cursor: pointer;
}

#stake-game-page .gp-tabs button[aria-selected='true'] {
	color: var(--edge-color-surface-fg-default);
	border-bottom-color: var(--edge-color-brand-bg-default);
}

#stake-game-page .gp-tab-panel {
	padding-top: 1rem;
	font-size: 14px;
	line-height: 1.55;
}

#stake-game-page .gp-tab-panel p {
	margin: 0;
}

#stake-game-page .gp-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 1rem;
}

#stake-game-page .gp-stat {
	min-width: 7.5rem;
	border-radius: var(--edge-radius-md);
	background: var(--edge-color-surface-bg-sunken);
	padding: 0.65rem 0.85rem;
}

#stake-game-page .gp-stat span {
	display: block;
	color: var(--edge-color-surface-fg-subtle);
	font-size: 12px;
}

#stake-game-page .gp-stat strong {
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
}

#stake-game-page .gp-empty {
	color: var(--edge-color-surface-fg-subtle);
	padding: 1.25rem 0 0.5rem;
}

#stake-game-page .gp-rec-title {
	margin: 0;
	font-size: 1.05rem;
	font-weight: var(--edge-font-weight-semiBold, 600);
}

#stake-game-page .gp-rec-all {
	display: inline-flex;
	align-items: center;
	gap: 0.15rem;
	color: var(--edge-color-surface-fg-subtle);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}

#stake-game-page .gp-rec-all:hover {
	color: var(--edge-color-surface-fg-default);
}

#stake-game-page .gp-playing {
	gap: 0.35rem;
	margin-top: 0.4rem;
	font-size: 12px;
}

#stake-game-page.is-theatre .game-content.svelte-azwiru:before {
	padding-top: min(68vh, 760px);
}

#stake-game-frame:fullscreen {
	display: flex;
	border-radius: 0;
	background: #000;
}

#stake-game-frame:fullscreen .game-content.svelte-azwiru {
	flex: 1;
	height: 100%;
}

#stake-game-frame:fullscreen .game-content.svelte-azwiru:before {
	height: 100%;
	padding-top: 0;
}

@media (max-width: 720px) {
	#stake-game-page:not(.is-theatre) .game-content.svelte-azwiru:before {
		padding-top: 112%;
	}

	#stake-game-page .gp-poster,
	#stake-game-page .gp-poster-fallback {
		width: 132px;
		height: 172px;
	}

	#stake-game-page .gp-tabs {
		flex-wrap: wrap;
		overflow: visible;
	}

	#stake-game-page .gp-tabs button {
		padding: 0.7rem 0.55rem;
		font-size: 13px;
	}
}

/* Logged-in header: balance + Wallet, then search / account / notifications */
#navigation-container-header.authenticated > section:has([data-testid='login-link']) {
	display: none !important;
}

#navigation-container-header > [data-stake-session] {
	display: flex;
	justify-content: center;
	width: max-content;
	max-width: 100%;
	justify-self: center;
	min-width: 0;
}

#navigation-container-header > [data-stake-session-tools] {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	margin: 0;
	min-width: 0;
}

#navigation-container-header .balance-toggle {
	display: grid;
	grid-template-columns: minmax(100px, max-content) max-content;
	align-items: stretch;
}

#navigation-container-header .stake-coin-toggle,
#navigation-container-header .stake-wallet-btn,
#navigation-container-header [data-stake-nav-icon] {
	border: 0;
	cursor: pointer;
	font-family: inherit;
	font-weight: 600;
	font-size: 14px;
	line-height: 1.2;
	font-variant-numeric: lining-nums tabular-nums;
}

#navigation-container-header .stake-coin-toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	max-width: 100%;
	min-height: 44px;
	padding: 0.75rem 1.25rem;
	border-radius: var(--edge-radius-md, 0.5rem) 0 0 var(--edge-radius-md, 0.5rem);
	background: var(--edge-color-surface-bg-sunken, #0f212e);
	color: var(--edge-color-neutral-fg-default, #fff);
	box-shadow: var(--shadows-md, 0 4px 6px rgb(0 0 0 / 0.16));
}

#navigation-container-header .stake-coin-toggle__amount {
	max-width: 16ch;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#navigation-container-header .stake-coin-toggle__mark {
	display: inline-flex;
	align-items: center;
	flex: none;
}

#navigation-container-header .stake-currency-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	border-radius: 999px;
	background: #26a17b;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
}

#navigation-container-header .stake-wallet-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 0.75rem 1.25rem;
	border-radius: 0 var(--edge-radius-md, 0.5rem) var(--edge-radius-md, 0.5rem) 0;
	background: var(--edge-color-brand-bg-default, #1475e1);
	color: var(--edge-color-brand-fg-default, #fff);
	box-shadow: var(--shadows-md, 0 4px 6px rgb(0 0 0 / 0.16));
}

#navigation-container-header .stake-coin-toggle:hover,
#navigation-container-header .stake-wallet-btn:hover {
	filter: brightness(1.08);
}

#navigation-container-header .stake-coin-toggle:active,
#navigation-container-header .stake-wallet-btn:active,
#navigation-container-header [data-stake-nav-icon]:active {
	transform: scale(0.98);
}

#navigation-container-header .wallet-text {
	display: inline;
}

#navigation-container-header .wallet-icon {
	display: none;
}

#navigation-container-header .stake-auth-tools {
	display: grid;
	grid-auto-flow: column;
	align-items: center;
	justify-content: end;
}

#navigation-container-header .hoverable.svelte-bft4ul {
	cursor: pointer;
}

#navigation-container-header [data-stake-nav-icon] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.75rem;
	border-radius: var(--edge-radius-sm, 4px);
	background: transparent;
	color: var(--edge-color-surface-fg-default, #fff);
}

#navigation-container-header [data-stake-nav-icon]:hover {
	color: var(--edge-color-surface-fg-subtle, #b1bad3);
}

#navigation-container-header [data-stake-account] {
	position: relative;
}

#navigation-container-header .stake-account-menu {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	z-index: 30;
	min-width: 180px;
	padding: 8px;
	border-radius: var(--edge-radius-md, 8px);
	background: var(--color-surface-bg-overlay, #1a2c38);
	box-shadow: 0 16px 40px rgb(0 0 0 / 0.45);
	color: var(--edge-color-surface-fg-default, #fff);
}

#navigation-container-header .stake-account-menu[hidden] {
	display: none !important;
}

#navigation-container-header .stake-account-menu__name {
	margin: 0;
	padding: 8px 10px 6px;
	font-size: 13px;
	font-weight: 600;
	color: var(--edge-color-surface-fg-subtle, #b1bad3);
}

#navigation-container-header .stake-account-menu button {
	width: 100%;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: inherit;
	text-align: left;
	padding: 8px 10px;
	font: 600 14px inherit;
	cursor: pointer;
}

#navigation-container-header .stake-account-menu button:hover {
	background: var(--edge-color-state-hovered, rgb(255 255 255 / 0.06));
}

@media (max-width: 849px) {
	#navigation-container-header .stake-coin-toggle,
	#navigation-container-header .stake-wallet-btn {
		padding-inline: 0.875rem;
	}

	#navigation-container-header .wallet-text {
		display: none;
	}

	#navigation-container-header .wallet-icon {
		display: inline-flex;
	}

	#navigation-container-header .stake-auth-tools__search,
	#navigation-container-header .stake-auth-tools__sidebar {
		display: none;
	}
}

/* Continue Playing (/casino/recent) */
#stake-mirror-home a[aria-current='page'] > button.sidebar-item-button {
	background: var(--edge-color-surface-bg-highest, #2f4553);
	color: var(--edge-color-surface-fg-default, #fff);
}

#stake-mirror-home a[aria-current='page'] > button.sidebar-item-button svg {
	color: var(--edge-color-surface-fg-default, #fff);
}

#stake-recent-page {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	width: 100%;
	padding-bottom: 2rem;
}

#stake-recent-page .recent-heading h1 {
	margin: 0;
}

#stake-recent-page .recent-heading p {
	margin: 0.4rem 0 0;
	max-width: 40rem;
	color: var(--edge-color-surface-fg-subtle, #b1bad3);
}

#stake-recent-page .recent-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
}

#stake-recent-page .recent-sorts {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

#stake-recent-page .recent-sort {
	display: inline-flex;
	align-items: center;
	min-height: 2.5rem;
	padding: 0 0.9rem;
	border-radius: 999px;
	background: var(--edge-color-surface-bg-sunken, #0f212e);
	color: var(--edge-color-surface-fg-default, #fff);
	font-weight: 600;
	text-decoration: none;
}

#stake-recent-page .recent-sort.is-active {
	background: var(--edge-color-surface-bg-highest, #2f4553);
}

#stake-recent-page .recent-count {
	color: var(--edge-color-surface-fg-subtle, #b1bad3);
}

#stake-recent-page .recent-fallback {
	display: grid;
	place-items: center;
	width: 100%;
	aspect-ratio: 180 / 236;
	border-radius: var(--edge-radius-md, 8px);
	background: #213743;
	color: #fff;
	font-size: 2rem;
	font-weight: 700;
}

#stake-recent-page .game-card-wrap:hover .info-wrap,
#stake-recent-page .game-card-wrap:focus-within .info-wrap,
#stake-recent-page .game-card-wrap:hover .info-wrap:before,
#stake-recent-page .game-card-wrap:focus-within .info-wrap:before {
	opacity: 1;
}

#stake-recent-page .empty-list .large-icon svg {
	width: 4.5rem;
	height: 4.5rem;
}

#stake-recent-page .empty-list p {
	margin: 0;
	text-align: center;
}

#stake-recent-page .recent-browse {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.75rem;
	padding: 0 1.1rem;
	border-radius: 8px;
	background: var(--edge-color-brand-bg-default, #1475e1);
	color: #fff;
	font-weight: 700;
	text-decoration: none;
}
