/* ══════════════════════════════════════════════════════════════════════════
   WE88 DARK GOLD — "Obsidian & Molten Gold"
   Custom refinements layered on top of theme.json.

   Design system in three moves:
     1. DEPTH    — surfaces lit from above (top light-edge + soft shadow),
                   never flat fills bounded only by a hairline border.
     2. MATERIAL — gold is a material (metallic gradient + glow), not a flat
                   accent colour.
     3. ATMOSPHERE — the page sits in light: an ambient gold aura + fine grain
                   behind everything, so nothing floats on dead black.
   ══════════════════════════════════════════════════════════════════════════ */

html { scroll-behavior: smooth; }

body {
	position: relative;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	background-color: var(--wp--preset--color--background, #09090b);
}

/* ── Atmosphere: ambient aura + fine grain behind everything ──────────── */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -2;
	pointer-events: none;
	background:
		radial-gradient(58% 48% at 50% -6%, rgba(250, 204, 21, 0.12), transparent 60%),
		radial-gradient(38% 40% at 88% 8%,  rgba(124, 58, 237, 0.07), transparent 62%),
		radial-gradient(46% 44% at 6% 92%,  rgba(34, 211, 238, 0.05), transparent 60%);
}
body::after {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	opacity: 0.04;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
	background-size: 140px 140px;
}

::selection {
	background: rgba(250, 204, 21, 0.28);
	color: #fff;
}

/* ── Custom scrollbar (WebKit) ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--wp--preset--color--background); }
::-webkit-scrollbar-thumb {
	background: linear-gradient(180deg, rgba(250, 204, 21, 0.35), rgba(202, 138, 4, 0.25));
	border-radius: 999px;
	border: 2px solid var(--wp--preset--color--background);
}
::-webkit-scrollbar-thumb:hover { background: var(--wp--preset--color--gold); }

/* ── Headings: optional gradient-clip display style ────────────────────── */
/* Add class "is-style-gold-gradient" to any heading to make it molten gold. */
.is-style-gold-gradient,
h1.has-gold-gradient {
	background: var(--we88-gold-metal);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: var(--wp--preset--color--gold); /* solid fallback for non-clip engines */
}

/* ── Navigation ────────────────────────────────────────────────────────── */
.wp-block-navigation .wp-block-navigation-item__content {
	padding: 0.5rem 0.875rem;
	border-radius: 999px;
	transition: background 0.2s ease, color 0.2s ease;
}
.wp-block-navigation .wp-block-navigation-item__content:hover,
.wp-block-navigation .wp-block-navigation-item.current-menu-item .wp-block-navigation-item__content {
	background: rgba(250, 204, 21, 0.08);
	color: var(--wp--preset--color--gold) !important;
}

/* ══ GOLD AS MATERIAL — primary CTAs ══════════════════════════════════════
   Applies to core buttons AND the plugin's primary widget CTAs (theme skins
   the plugin classes directly here; the colour comes from the gold material
   above, which can't live in --we88-accent because that token is also read as
   a flat `color`/`border-color`). */
.wp-block-button:not(.is-style-outline) .wp-block-button__link,
.we88-btn-primary,
.we88-btn-play,
.we88-promo-cta,
.we88-fab-btn {
	background: var(--we88-gold-metal) !important;
	color: #0a0a0c !important;
	border: none !important;
	font-weight: 700;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 8px 22px rgba(202, 138, 4, 0.28);
	transition: transform 0.2s ease, box-shadow 0.28s ease, filter 0.2s ease;
	will-change: transform, box-shadow;
}
.wp-block-button:not(.is-style-outline) .wp-block-button__link:hover,
.we88-btn-primary:hover,
.we88-btn-play:hover,
.we88-promo-cta:hover,
.we88-fab-btn:hover {
	transform: translateY(-2px);
	filter: saturate(1.08);
	background: var(--we88-gold-metal-hi) !important;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), var(--we88-shadow-gold);
}
.wp-block-button:not(.is-style-outline) .wp-block-button__link:active,
.we88-btn-primary:active,
.we88-btn-play:active { transform: translateY(0); }

/* Outline buttons → gold ghost */
.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background-color: rgba(250, 204, 21, 0.08) !important;
	border-color: var(--wp--preset--color--gold) !important;
	color: var(--wp--preset--color--gold) !important;
}

/* ── Card-style groups: real elevation + gold-tinted hover ─────────────── */
.wp-block-group.has-surface-background-color,
.wp-block-group.has-background-raised-background-color {
	border-radius: var(--we88-radius);
	box-shadow: var(--we88-shadow-soft), var(--we88-edge-light);
	transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.3s ease;
}
.wp-block-group.has-surface-background-color:hover,
.wp-block-group.has-background-raised-background-color:hover {
	border-color: rgba(250, 204, 21, 0.30) !important;
	transform: translateY(-3px);
	box-shadow: var(--we88-shadow-lifted), 0 0 32px rgba(250, 204, 21, 0.10), var(--we88-edge-light);
}

/* ── Hero cover: deepen the gradient + ambient glow ────────────────────── */
.wp-block-cover {
	box-shadow: var(--we88-edge-light);
}
.wp-block-cover::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: radial-gradient(50% 60% at 50% 0%, rgba(250, 204, 21, 0.10), transparent 70%);
}

/* ══ GLASS — the login card / quick panels feel like frosted glass ════════ */
.we88-login-form,
.we88-popup-panel {
	position: relative;
	background: var(--we88-glass) !important;
	-webkit-backdrop-filter: blur(16px) saturate(1.2);
	backdrop-filter: blur(16px) saturate(1.2);
	border: 1px solid rgba(250, 204, 21, 0.16) !important;
	box-shadow: var(--we88-shadow-lifted), 0 0 50px rgba(250, 204, 21, 0.06), var(--we88-edge-light) !important;
}
/* Molten-gold hairline along the top edge of the glass card. */
.we88-login-form::before {
	content: "";
	position: absolute;
	top: -1px;
	left: 18%;
	right: 18%;
	height: 2px;
	background: var(--we88-gold-metal);
	border-radius: 0 0 3px 3px;
	box-shadow: 0 0 14px rgba(250, 204, 21, 0.5);
}

/* ── Game cards: lift + gold ring + image zoom on hover ────────────────── */
.we88-game-card {
	position: relative;
	transition: transform 0.28s ease, box-shadow 0.3s ease, border-color 0.25s ease;
	overflow: hidden;
}
.we88-game-card:hover {
	transform: translateY(-4px);
	border-color: rgba(250, 204, 21, 0.35) !important;
	box-shadow: var(--we88-shadow-lifted), 0 0 28px rgba(250, 204, 21, 0.12);
}
.we88-game-image { transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1); }
.we88-game-card:hover .we88-game-image { transform: scale(1.06); }

/* Lift HOT/NEW badges out of the body and onto the top-right of the art —
   the casino-standard placement; frees the body for provider/name/CTA. */
.we88-game-card .we88-game-badge {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 3;
	margin: 0;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
/* If a card is both HOT and NEW, stack the second below the first. */
.we88-game-card .we88-game-badge--hot ~ .we88-game-badge--new { top: 46px; }

/* ── Post / page titles: animated gold underline ───────────────────────── */
.wp-block-post-title a {
	color: inherit;
	text-decoration: none;
	background-image: linear-gradient(var(--wp--preset--color--gold), var(--wp--preset--color--gold));
	background-position: 0 100%;
	background-repeat: no-repeat;
	background-size: 0 1.5px;
	transition: background-size 0.3s ease, color 0.2s ease;
}
.wp-block-post-title a:hover {
	background-size: 100% 1.5px;
	color: var(--wp--preset--color--gold);
}

/* ── Featured image: gold ring on hover ────────────────────────────────── */
.wp-block-post-featured-image img {
	border-radius: var(--we88-radius);
	transition: transform 0.4s ease, box-shadow 0.3s ease;
}
.wp-block-post-featured-image:hover img {
	transform: scale(1.015);
	box-shadow: 0 0 0 1px var(--wp--preset--color--gold-wash), var(--we88-shadow-lifted);
}

/* ── Search form ───────────────────────────────────────────────────────── */
.wp-block-search__input {
	background: var(--wp--preset--color--surface) !important;
	color: var(--wp--preset--color--text) !important;
	border: 1px solid var(--wp--preset--color--border) !important;
	border-radius: var(--we88-radius-sm) !important;
}
.wp-block-search__input:focus {
	outline: none;
	border-color: var(--wp--preset--color--gold) !important;
	box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.15);
}

/* ── Code & pre ────────────────────────────────────────────────────────── */
pre.wp-block-code { overflow-x: auto; }
:not(pre) > code {
	font-family: var(--wp--preset--font-family--jetbrains-mono);
	font-size: 0.875em;
	padding: 0.15em 0.5em;
	background: var(--wp--preset--color--gold-wash);
	color: var(--wp--preset--color--gold);
	border-radius: 6px;
}

/* ── WE88 Portal plugin block wrappers — breathing room ────────────────── */
[class^="wp-block-we88-portal-"],
[class*=" wp-block-we88-portal-"] { display: block; }

/* ══ MOTION — orchestrated entrance for top-level sections ════════════════ */
@keyframes we88-rise {
	from { opacity: 0; transform: translateY(22px); }
	to   { opacity: 1; transform: translateY(0); }
}
@keyframes we88-pulse-gold {
	0%, 100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 8px 22px rgba(202, 138, 4, 0.28); }
	50%      { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 0 40px rgba(250, 204, 21, 0.30), 0 10px 28px rgba(202, 138, 4, 0.34); }
}

/* Staggered reveal of the main content sections on first paint. */
main.wp-block-group > .wp-block-cover,
main.wp-block-group > .wp-block-group,
main.wp-block-group > .wp-block-columns {
	animation: we88-rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
main.wp-block-group > *:nth-child(1) { animation-delay: 0.02s; }
main.wp-block-group > *:nth-child(2) { animation-delay: 0.10s; }
main.wp-block-group > *:nth-child(3) { animation-delay: 0.18s; }
main.wp-block-group > *:nth-child(4) { animation-delay: 0.26s; }
main.wp-block-group > *:nth-child(5) { animation-delay: 0.34s; }

/* Slow glow breathing on the hero's primary CTA. */
.wp-block-cover .wp-block-button:not(.is-style-outline) .wp-block-button__link,
.we88-login-form .we88-btn-primary {
	animation: we88-pulse-gold 3.2s ease-in-out infinite;
}

/* ── Reduced motion: disable everything decorative ─────────────────────── */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ── Mobile refinements ────────────────────────────────────────────────── */
@media (max-width: 781px) {
	.wp-block-cover {
		min-height: 480px !important;
		padding: 3.5rem 1.25rem !important;
	}
	.wp-block-columns { gap: 1.5rem; }
	.wp-block-post-template.is-flex-container.is-layout-grid {
		grid-template-columns: 1fr !important;
	}
}
