:root {
	/* Let shared shell do most styling; these tune the stage/frame */
	--nh-frame-radius: 18px;
	--nh-glow: rgba(124, 92, 255, 0.45);
	--nh-glow2: rgba(46, 242, 255, 0.28);
	--nh-payline-stroke: rgba(255, 210, 92, 0.92);
	--nh-payline-dot-fill: rgba(255, 246, 214, 0.98);
	--nh-payline-dot-stroke: rgba(0, 0, 0, 0.55);
	--nh-payline-back-stroke: rgba(0, 0, 0, 0.60);
	--nh-payline-width: 9px;
}

/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
	.nh-cell,
	.nh-cell * {
		transition: none !important;
		animation: none !important;
	}
	.nh-payline,
	.nh-paylineDot,
	.nh-reels.dv-shake,
	.nh-reels.dv-winFlash::before,
	#reelSpinWinValue.dv-uiWinPop,
	#reelSpinWinValue.dv-uiWinBig,
	#reelMultiplierValue.dv-uiMultPop {
		transition: none !important;
		animation: none !important;
	}
}

.nh-frame {
	position: absolute;
	inset: 0;
	pointer-events: none;
	border-radius: calc(var(--ui-radius) - 10px);
	/* Fallback frame: visible if the SVG art fails to load */
	background:
		radial-gradient(120% 80% at 20% 10%, rgba(124, 92, 255, 0.22), transparent 55%),
		radial-gradient(120% 80% at 80% 90%, rgba(46, 242, 255, 0.14), transparent 55%);
	border: 1px solid rgba(255, 255, 255, 0.10);
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.06) inset,
		0 0 40px rgba(124, 92, 255, 0.08),
		0 0 40px rgba(46, 242, 255, 0.06);
}

.nh-frame::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: linear-gradient(180deg, rgba(255,255,255,0.06), transparent 35%, rgba(0,0,0,0.20));
	opacity: 0.65;
}

.nh-artWrap {
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 1;
}

/* Keep reels above background art across all breakpoints (desktop/mobile). */
#reelStageMount {
	isolation: isolate;
}

/* Mascot: desktop-only, behind the game board art, peeking from the left */
.nh-mascot{
	position: absolute;
	display: none;
	width: auto;
	object-fit: contain;
	transform: translate3d(0, 0, 0);
	filter: drop-shadow(0 18px 30px rgba(0,0,0,0.45));
	z-index: 0;
}


/* Mobile-only mascot tuning (edit these values per game as needed) */
@media (max-width: 920px) {
	.nh-mascot{
		display: block;
		left: -5%;
		bottom: -15%;
		height: 86%;
	}
	.nh-gameArt{ z-index: 1; }
	.nh-frame{ z-index: 2; }
}

/* Desktop-only mascot tuning (edit these values per game as needed) */
@media (min-width: 921px) {
	.nh-mascot{
		display: block;
		left: -5%;
		bottom: -15%;
		height: 86%;
	}
	.nh-gameArt{ z-index: 1; }
	.nh-frame{ z-index: 2; }
}

.nh-gameArt {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center;
	transform: translate3d(var(--reel-art-x, 0px), var(--reel-art-y, 0px), 0) scale(var(--reel-art-scale, 1));
	transform-origin: 50% 50%;
	filter: drop-shadow(0 18px 30px rgba(0,0,0,0.45));
}

/*
	The SVG has viewBox 1200x672 and includes a clipped rect:
	X: 211.33..988.33 (≈17.6% padding left/right)
	Y: 88.5..583.5 (≈13.2% padding top/bottom)
	We position reels in that safe "window" so the art visually contains the grid.
*/
.nh-artWindow {
	position: absolute;
	left: var(--reel-window-left, 17.6%);
	right: var(--reel-window-right, 17.6%);
	top: var(--reel-window-top, 13.2%);
	bottom: var(--reel-window-bottom, 13.2%);
	border-radius: var(--reel-window-radius, 16px);
	overflow: hidden;
	z-index: 2;
}

.nh-reels {
	position: absolute;
	inset: 0;
	display: grid;
	grid-template-columns: repeat(var(--reel-cols, 6), 1fr);
	grid-template-rows: repeat(var(--reel-rows, 4), 1fr);
	gap: var(--reel-grid-gap, 8px);
	padding: var(--reel-grid-padding, 12px);
}

/* Payline overlay (SVG) */
.nh-paylines {
	position: absolute;
	inset: 0;
	z-index: 4;
	pointer-events: none;
}

.nh-payline {
	fill: none;
	stroke: var(--nh-payline-stroke, rgba(46, 242, 255, 0.78));
	stroke-width: var(--nh-payline-width, 8px);
	stroke-linecap: round;
	stroke-linejoin: round;
	opacity: 0.9;
	filter: drop-shadow(0 10px 16px rgba(0,0,0,0.35)) drop-shadow(0 0 18px rgba(46, 242, 255, 0.12));
	/* JS sets dash values so we can animate the line drawing */
	animation: dvPaylineDraw 380ms cubic-bezier(0.1, 0.9, 0.2, 1) both, dvPaylineGlow 900ms ease-in-out 2;
}

@keyframes dvPaylineDraw {
	from { stroke-dashoffset: var(--dv-dashoffset, 0); opacity: 0.15; }
	to { stroke-dashoffset: 0; opacity: 0.95; }
}

@keyframes dvPaylineGlow {
	0% { filter: drop-shadow(0 10px 16px rgba(0,0,0,0.35)) drop-shadow(0 0 18px rgba(46, 242, 255, 0.12)); }
	45% { filter: drop-shadow(0 12px 18px rgba(0,0,0,0.35)) drop-shadow(0 0 26px rgba(46, 242, 255, 0.22)); }
	100% { filter: drop-shadow(0 10px 16px rgba(0,0,0,0.35)) drop-shadow(0 0 18px rgba(46, 242, 255, 0.12)); }
}

.nh-payline--back {
	stroke: var(--nh-payline-back-stroke, rgba(0, 0, 0, 0.55));
	stroke-width: calc(var(--nh-payline-width, 8px) + 6px);
	opacity: 0.55;
	filter: none;
}

.nh-paylineDot {
	fill: var(--nh-payline-dot-fill, rgba(255, 255, 255, 0.95));
	stroke: var(--nh-payline-dot-stroke, rgba(0, 0, 0, 0.55));
	stroke-width: 2px;
	opacity: 0.95;
	filter: drop-shadow(0 8px 12px rgba(0,0,0,0.35)) drop-shadow(0 0 16px rgba(255,255,255,0.18));
	transform-origin: center;
	animation: dvDotPop 520ms cubic-bezier(0.15, 0.9, 0.2, 1) both;
}

@keyframes dvDotPop {
	0% { transform: scale(0.86); opacity: 0.3; }
	45% { transform: scale(1.22); opacity: 1; }
	100% { transform: scale(1); opacity: 0.95; }
}

/* Reel spin effect (per-column) */
@keyframes nhReelSpin {
	0% { transform: translate3d(0, -90%, 0) scale(1.02); filter: blur(2.0px) saturate(1.14) brightness(1.08); opacity: 0.90; }
	100% { transform: translate3d(0, 90%, 0) scale(1.02); filter: blur(2.0px) saturate(1.14) brightness(1.08); opacity: 0.90; }
}

.nh-cell.is-spinning .nh-symbolImg {
	animation: nhReelSpin var(--nh-spin-ms, 120ms) linear infinite;
	will-change: transform, filter, opacity;
}

/* Reel strip motion (more realistic than per-tile swapping)
   The renderer toggles .dv-stripSpin on cells while spinning. */
.dv-stripViewport {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
	opacity: 0;
	z-index: 2;
}

.dv-strip {
	position: absolute;
	inset: 0;
	will-change: transform;
}

.dv-stripSlot {
	height: 100%;
	width: 100%;
	display: grid;
	place-items: center;
}

.dv-stripImg {
	width: min(76%, 92px);
	height: min(76%, 92px);
	object-fit: contain;
	filter: blur(1.6px) saturate(1.14) brightness(1.08) drop-shadow(0 10px 16px rgba(0,0,0,0.35));
	opacity: 0.92;
}

.nh-cell.dv-stripSpin .dv-stripViewport {
	opacity: 1;
}

.nh-cell.dv-stripSpin .nh-symbolImg {
	opacity: 0;
	animation: none;
}

/* Anticipation glow: when a BONUS pair lands, keep later reels "hot" while they spin */
.nh-cell.is-anticipation {
	border-color: rgba(255, 210, 92, 0.32);
	box-shadow: 0 0 0 1px rgba(255, 210, 92, 0.10) inset, 0 0 18px rgba(255, 210, 92, 0.08);
	animation: dvAnticipationPulse 640ms ease-in-out infinite;
}

@keyframes dvAnticipationPulse {
	0%, 100% { filter: brightness(1); }
	50% { filter: brightness(1.08); }
}

/* Grid-level anticipation glow (renderer toggles .dv-anticipation on the reels grid). */
.nh-reels.dv-anticipation::after {
	content: "";
	position: absolute;
	inset: -12%;
	pointer-events: none;
	z-index: 2;
	border-radius: 24px;
	background:
		radial-gradient(62% 52% at 50% 40%, rgba(255, 210, 92, 0.18), transparent 64%),
		radial-gradient(70% 60% at 50% 55%, rgba(46, 242, 255, 0.10), transparent 68%);
	opacity: 0.2;
	transform: scale(0.995);
	animation: dvAnticipationGlow 860ms ease-in-out infinite;
}

@keyframes dvAnticipationGlow {
	0%, 100% { opacity: 0.18; transform: scale(0.992); filter: saturate(1) brightness(1); }
	50% { opacity: 0.42; transform: scale(1.01); filter: saturate(1.15) brightness(1.06); }
}

@media (max-width: 560px) {
	.nh-reels { padding: 10px; gap: 7px; }
}

.nh-cell {
	position: relative;
	z-index: 1;
	border-radius: var(--reel-cell-radius, 14px);
	background: rgba(0, 0, 0, 0.20);
	border: 1px solid rgba(255, 255, 255, 0.10);
	overflow: hidden;
	display: grid;
	place-items: center;
	transform: translate3d(0, 0, 0);
}

.nh-cell::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background-image: url('../assets/images/bandicoot-diamond-vault-reel-tile-BG.svg');
	/* Default to a true fill; editor can switch to cover/contain if preferred */
	background-size: var(--reel-tile-bg-size, 100% 100%);
	background-position: center;
	background-repeat: no-repeat;
	opacity: var(--reel-tile-bg-opacity, 0.95);
	transform: scale(var(--reel-tile-bg-scale, 1));
	transform-origin: 50% 50%;
}

.nh-cell::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background:
		linear-gradient(180deg, rgba(255,255,255,0.08), transparent 30%, rgba(0,0,0,0.22));
	opacity: 0.75;
}

.nh-symbolImg {
	position: relative;
	z-index: 1;
	width: min(76%, 92px);
	height: min(76%, 92px);
	object-fit: contain;
	transform: scale(var(--reel-symbol-scale, 1));
	filter: drop-shadow(0 10px 16px rgba(0,0,0,0.35));
}

/* Cluster feature intro: big symbol shrinks into a tile */
.dv-clusterIntro {
	position: fixed;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	z-index: 70;
}

.dv-clusterIntro[aria-hidden="false"] {
	display: flex;
}

.dv-clusterIntroImg {
	width: min(64vmin, 420px);
	height: auto;
	object-fit: contain;
	filter: drop-shadow(0 18px 30px rgba(0,0,0,0.45));
	transform: translate3d(0, 0, 0) scale(1.55);
	will-change: transform, opacity;
}

.nh-fallbackText {
	position: relative;
	z-index: 1;
	font-weight: 900;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	font-size: 12px;
	color: rgba(255,255,255,0.86);
	text-shadow: 0 2px 10px rgba(0,0,0,0.6);
}

.nh-cell.is-win {
	border-color: rgba(46, 242, 255, 0.65);
	box-shadow: 0 0 0 2px rgba(46, 242, 255, 0.16) inset, 0 0 24px rgba(46, 242, 255, 0.12);
	animation: nhWinPop 900ms cubic-bezier(0.15, 0.9, 0.2, 1) both;
}

.nh-cell.is-win .nh-symbolImg {
	animation: dvSymbolWin 900ms cubic-bezier(0.15, 0.9, 0.2, 1) both;
	filter: drop-shadow(0 10px 16px rgba(0,0,0,0.35)) drop-shadow(0 0 18px rgba(46, 242, 255, 0.14));
}

@keyframes dvSymbolWin {
	0% { transform: scale(var(--reel-symbol-scale, 1)); }
	22% { transform: scale(calc(var(--reel-symbol-scale, 1) * 1.08)); }
	60% { transform: scale(calc(var(--reel-symbol-scale, 1) * 1.05)); }
	100% { transform: scale(var(--reel-symbol-scale, 1)); }
}

/* Grid-level win flash + big win shake */
.nh-reels {
	will-change: transform;
}

.nh-reels.dv-winFlash::before {
	content: "";
	position: absolute;
	inset: -10%;
	pointer-events: none;
	z-index: 3;
	border-radius: 22px;
	background:
		radial-gradient(60% 50% at 50% 50%, rgba(46, 242, 255, 0.18), transparent 60%),
		radial-gradient(70% 60% at 50% 40%, rgba(255, 210, 92, 0.16), transparent 65%);
	opacity: 0;
	transform: scale(0.98);
	animation: dvWinFlash 420ms ease-out both;
}

.nh-reels.dv-bigWin::before {
	background:
		radial-gradient(62% 52% at 50% 50%, rgba(46, 242, 255, 0.24), transparent 62%),
		radial-gradient(76% 64% at 50% 40%, rgba(255, 210, 92, 0.22), transparent 68%);
	animation-duration: 560ms;
}

@keyframes dvWinFlash {
	0% { opacity: 0; transform: scale(0.98); }
	30% { opacity: 1; transform: scale(1.02); }
	100% { opacity: 0; transform: scale(1.04); }
}

.nh-reels.dv-shake {
	animation: dvShake 420ms cubic-bezier(0.15, 0.9, 0.2, 1) both;
}

@keyframes dvShake {
	0% { transform: translate3d(0, 0, 0); }
	18% { transform: translate3d(-0.6%, 0.2%, 0); }
	36% { transform: translate3d(0.5%, -0.2%, 0); }
	54% { transform: translate3d(-0.4%, 0.15%, 0); }
	72% { transform: translate3d(0.3%, -0.1%, 0); }
	100% { transform: translate3d(0, 0, 0); }
}

/* Shared Reel UI: punch up the win readouts (game-specific, non-invasive). */
#reelSpinWinValue.dv-uiWinPop {
	display: inline-block;
	animation: dvUiWinPop 520ms cubic-bezier(0.15, 0.9, 0.2, 1) both;
}

#reelSpinWinValue.dv-uiWinBig {
	display: inline-block;
	animation: dvUiWinBig 820ms cubic-bezier(0.15, 0.9, 0.2, 1) both;
}

#reelMultiplierValue.dv-uiMultPop {
	display: inline-block;
	animation: dvUiMultPop 460ms cubic-bezier(0.15, 0.9, 0.2, 1) both;
}

@keyframes dvUiWinPop {
	0% { transform: translate3d(0, 0, 0) scale(1); text-shadow: none; filter: brightness(1); }
	28% { transform: translate3d(0, -8%, 0) scale(1.14); text-shadow: 0 0 18px rgba(46, 242, 255, 0.24); filter: brightness(1.12); }
	70% { transform: translate3d(0, 0, 0) scale(1.06); text-shadow: 0 0 12px rgba(46, 242, 255, 0.18); }
	100% { transform: translate3d(0, 0, 0) scale(1); text-shadow: none; filter: brightness(1); }
}

@keyframes dvUiWinBig {
	0% { transform: translate3d(0, 0, 0) scale(1); text-shadow: none; filter: brightness(1); }
	20% { transform: translate3d(0, -10%, 0) scale(1.22); text-shadow: 0 0 26px rgba(255, 210, 92, 0.25), 0 0 18px rgba(46, 242, 255, 0.18); filter: brightness(1.18); }
	55% { transform: translate3d(0, 0, 0) scale(1.08); text-shadow: 0 0 18px rgba(255, 210, 92, 0.18), 0 0 12px rgba(46, 242, 255, 0.14); }
	100% { transform: translate3d(0, 0, 0) scale(1); text-shadow: none; filter: brightness(1); }
}

@keyframes dvUiMultPop {
	0% { transform: translate3d(0, 0, 0) scale(1); }
	40% { transform: translate3d(0, -6%, 0) scale(1.12); }
	100% { transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes nhWinPop {
	0% { transform: translate3d(0, 0, 0) scale(1); }
	22% { transform: translate3d(0, -3%, 0) scale(1.08); }
	60% { transform: translate3d(0, 0, 0) scale(1.05); }
	100% { transform: translate3d(0, 0, 0) scale(1); }
}

.nh-cell.is-remove {
	animation: nhFadeOut 220ms ease-out forwards;
}

@keyframes nhFadeOut {
	to { opacity: 0; transform: scale(0.96); }
}

.nh-cell.is-drop {
	animation: nhDrop var(--nh-drop-ms, 360ms) cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

.nh-cell.is-highlight {
	animation: dvClusterPulse 220ms ease-out;
}

/* Reel stop micro-pop */
.nh-cell.is-stop {
	animation: dvStopPop 160ms cubic-bezier(0.15, 0.9, 0.2, 1) both;
}

@keyframes dvStopPop {
	0% { transform: translate3d(0, 0, 0) scale(1); filter: brightness(1); }
	50% { transform: translate3d(0, -1.2%, 0) scale(1.03); filter: brightness(1.08); }
	100% { transform: translate3d(0, 0, 0) scale(1); filter: brightness(1); }
}

@keyframes nhDrop {
	from { transform: translate3d(0, var(--nh-drop-from, -22%), 0); }
	to { transform: translate3d(0, 0, 0); }
}

@keyframes dvClusterPulse {
	0% { transform: translate3d(0, 0, 0) scale(1); }
	50% { transform: translate3d(0, 0, 0) scale(1.06); }
	100% { transform: translate3d(0, 0, 0) scale(1); }
}

/* Reel Editor export for /games/bandicoot-diamond-vault-reel/index.html */
.reel-app[data-reel-game="bandicoot-diamond-vault-reel"] {
  --reel-art-scale: 1.3;
  --reel-art-x: 0px;
  --reel-art-y: 2px;
  --reel-cell-radius: 14px;
  --reel-grid-gap: 0px;
  --reel-grid-padding: 4px;
  --reel-stage-aspect: 2.19;
  --reel-symbol-scale: 1.3;
  --reel-tile-bg-opacity: 1;
  --reel-tile-bg-scale: 1.55;
  --reel-window-bottom: 20.2%;
  --reel-window-left: 26.7%;
  --reel-window-radius: 31px;
  --reel-window-right: 26.7%;
  --reel-window-top: 17.4%;
}

/* Diamond Vault Reel: side-controls need slightly different horizontal offsets */
@media (max-width: 920px) and (max-height: 520px) and (orientation: landscape) and (pointer: coarse) {
	.reel-app .reel-sideControls__col{
		/* Left column: move right a bit (increase inset). */
		--reel-side-left-inset: 125px;
		/* Right column: move left a bit (increase inset). */
		--reel-side-right-inset: 120px;
	}
}