: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(140, 236, 255, 0.92);
	--nh-payline-dot-fill: rgba(220, 252, 255, 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-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;
}

/* 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: 0%;
		bottom: -25%;
		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: 0%;
		bottom: -25%;
		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;
}

.nh-reels {
	position: absolute;
	inset: 0;
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	grid-template-rows: repeat(3, 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));
}

.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));
}

/* Reel spin effect (per-column) */
@keyframes nhReelSpin {
	0% { transform: translate3d(0, -34%, 0) scale(1.02); filter: blur(1.6px) saturate(1.1) brightness(1.06); opacity: 0.92; }
	50% { transform: translate3d(0, 34%, 0) scale(1.02); filter: blur(2.1px) saturate(1.18) brightness(1.10); opacity: 0.86; }
	100% { transform: translate3d(0, -34%, 0) scale(1.02); filter: blur(1.6px) saturate(1.1) brightness(1.06); opacity: 0.92; }
}

.nh-cell.is-spinning .nh-symbolImg {
	animation: nhReelSpin 120ms linear infinite;
}

@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-icebound-riches-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));
}

.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;
}

@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;
}

.nh-cell.is-crack {
	animation: nhCrackShake 280ms ease-in-out both;
	border-color: rgba(46, 242, 255, 0.35);
	box-shadow: 0 0 0 2px rgba(46, 242, 255, 0.10) inset;
}

.nh-cell.is-crack .nh-symbolImg {
	animation: nhCrackPop 280ms ease-in-out both;
}

@keyframes nhCrackShake {
	0% { transform: translate3d(0, 0, 0) rotate(0deg); filter: saturate(1.05) brightness(1.02); }
	20% { transform: translate3d(-1%, 0.6%, 0) rotate(-0.6deg); }
	45% { transform: translate3d(1.2%, -0.8%, 0) rotate(0.7deg); filter: saturate(1.25) brightness(1.12); }
	70% { transform: translate3d(-0.8%, 0.5%, 0) rotate(-0.4deg); }
	100% { transform: translate3d(0, 0, 0) rotate(0deg); filter: saturate(1.05) brightness(1.02); }
}

/* Icebound Riches Reel: mobile landscape only
	Move BET/+ and AUTO/TURBO so they sit inside the stage wrap,
	just above the mascot area. Desktop/tablet remains unchanged.
*/
@media (max-width: 920px) and (max-height: 520px) and (orientation: landscape) and (pointer: coarse) {
	body[data-reel-game="bandicoot-icebound-riches-reel"] .reel-app[data-reel-side-controls-enabled="1"] .reel-sideControls__col--left{
		/* Push the left control column inward so it aligns with the centered stage wrap */
		--reel-side-left-inset: clamp(96px, 12vw, 170px);
		/* Lift the controls so they sit above the mascot */
		--reel-side-top: 52px;
		--reel-side-bottom: 118px;
		--reel-side-left-nudge: 0px;
		align-content: end;
	}

	/* Make the left controls a bit smaller for this game */
	body[data-reel-game="bandicoot-icebound-riches-reel"] .reel-app[data-reel-side-controls-enabled="1"] .reel-sideControls__col--left{ gap: 8px; }
	body[data-reel-game="bandicoot-icebound-riches-reel"] .reel-app[data-reel-side-controls-enabled="1"] .reel-sideControls__col--left .reel-sideControls__panel{
		gap: 8px;
		padding: 7px;
		border-radius: 16px;
	}
	body[data-reel-game="bandicoot-icebound-riches-reel"] .reel-app[data-reel-side-controls-enabled="1"] .reel-sideControls__col--left .reel-sideControls__panel .reel-btn{
		min-width: 46px;
		padding: 7px 8px;
		font-size: 12.5px;
	}
	body[data-reel-game="bandicoot-icebound-riches-reel"] .reel-app[data-reel-side-controls-enabled="1"] .reel-sideControls__col--left .reel-sideControls__bet{
		min-width: 68px;
		padding: 5px 7px;
	}
	body[data-reel-game="bandicoot-icebound-riches-reel"] .reel-app[data-reel-side-controls-enabled="1"] .reel-sideControls__col--left .reel-sideControls__betLabel{ font-size: 10px; }
	body[data-reel-game="bandicoot-icebound-riches-reel"] .reel-app[data-reel-side-controls-enabled="1"] .reel-sideControls__col--left .reel-sideControls__betValue{ font-size: 12.5px; }
}

@keyframes nhCrackPop {
	0% { transform: scale(var(--reel-symbol-scale, 1)); }
	45% { transform: scale(calc(var(--reel-symbol-scale, 1) * 1.08)); filter: drop-shadow(0 14px 18px rgba(0,0,0,0.38)); }
	100% { transform: scale(var(--reel-symbol-scale, 1)); }
}

.nh-cell.is-scatterMark {
	border-color: rgba(46, 242, 255, 0.40);
	box-shadow:
		0 0 0 2px rgba(46, 242, 255, 0.10) inset,
		0 0 18px rgba(46, 242, 255, 0.10);
}

.nh-cell.is-scatterMark .nh-symbolImg {
	animation: irScatterMarkPop 240ms cubic-bezier(0.15, 0.9, 0.2, 1) both;
}

@keyframes irScatterMarkPop {
	0% { transform: scale(calc(var(--reel-symbol-scale, 1) * 0.92)); filter: saturate(1.1) brightness(1.05); }
	45% { transform: scale(calc(var(--reel-symbol-scale, 1) * 1.10)); filter: saturate(1.25) brightness(1.12); }
	100% { transform: scale(var(--reel-symbol-scale, 1)); filter: saturate(1.05) brightness(1.02); }
}

/* Scatter initiation intro (center symbol zoom) */
.ir-scatterIntro {
	position: fixed;
	inset: 0;
	z-index: 200;
	pointer-events: none;
	display: grid;
	place-items: center;
	opacity: 0;
}

/* Bonus trigger sequence: flash bonus tiles + center symbol pop */
.nh-cell.is-bonusFlash{
	border-color: var(--nh-payline-stroke);
	box-shadow:
		0 0 0 2px rgba(46, 242, 255, 0.18) inset,
		0 0 26px rgba(46, 242, 255, 0.16);
	animation: irBonusFlash 150ms ease-in-out infinite alternate;
}

.nh-cell.is-bonusFlash .nh-symbolImg{
	animation: irBonusBounce 420ms cubic-bezier(0.15, 0.9, 0.2, 1) infinite;
}

@keyframes irBonusFlash{
	from {
		box-shadow:
			0 0 0 2px rgba(46, 242, 255, 0.16) inset,
			0 0 18px rgba(46, 242, 255, 0.10);
		filter: saturate(1.05) brightness(1.02);
	}
	to {
		box-shadow:
			0 0 0 2px rgba(46, 242, 255, 0.30) inset,
			0 0 34px rgba(46, 242, 255, 0.20);
		filter: saturate(1.25) brightness(1.10);
	}
}

@keyframes irBonusBounce{
	0% { transform: scale(var(--reel-symbol-scale, 1)) translate3d(0, 0, 0); filter: saturate(1.05) brightness(1.02); }
	40% { transform: scale(calc(var(--reel-symbol-scale, 1) * 1.08)) translate3d(0, -1.5%, 0); filter: saturate(1.25) brightness(1.12); }
	100% { transform: scale(var(--reel-symbol-scale, 1)) translate3d(0, 0, 0); filter: saturate(1.05) brightness(1.02); }
}

.ir-bonusIntro{
	position: fixed;
	inset: 0;
	z-index: 210;
	pointer-events: none;
	display: none;
	place-items: center;
}

.ir-bonusIntro[aria-hidden="false"]{
	display: grid;
}

.ir-bonusIntro__symbol{
	position: fixed;
	left: 50%;
	top: 50%;
	width: min(56vmin, 420px);
	height: auto;
	opacity: 0;
	transform: translate(-50%, -50%) scale(0.60);
	filter: drop-shadow(0 22px 34px rgba(0,0,0,0.62)) drop-shadow(0 0 24px rgba(46, 242, 255, 0.18));
}

.ir-bonusIntro.is-show .ir-bonusIntro__symbol{
	animation: irBonusSymbolPop 900ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

@keyframes irBonusSymbolPop{
	0% { opacity: 0; transform: translate(-50%, -50%) scale(0.60); }
	20% { opacity: 1; transform: translate(-50%, -50%) scale(1.18); }
	55% { opacity: 1; transform: translate(-50%, -50%) scale(1.04); }
	100% { opacity: 0; transform: translate(-50%, -50%) scale(1.0); }
}

.ir-scatterIntro.is-show {
	opacity: 1;
}

.ir-scatterIntro__symbol {
	width: min(56vmin, 420px);
	height: auto;
	transform-origin: 50% 50%;
	filter: drop-shadow(0 10px 28px rgba(0,0,0,0.55));
	opacity: 0;
	transform: scale(0.55);
}

.ir-scatterIntro.is-show .ir-scatterIntro__symbol {
	animation: irScatterIntroPop 0.7s ease-out forwards;
}

@keyframes irScatterIntroPop {
	0% { opacity: 0; transform: scale(0.55); }
	30% { opacity: 1; transform: scale(1.06); }
	60% { opacity: 1; transform: scale(0.98); }
	100% { opacity: 0; transform: scale(1.02); }
}

@media (prefers-reduced-motion: reduce) {
	.ir-scatterIntro.is-show .ir-scatterIntro__symbol {
		animation: none !important;
		opacity: 1;
		transform: scale(1);
	}
	.nh-cell.is-bonusFlash{
		animation: none !important;
	}
	.nh-cell.is-bonusFlash .nh-symbolImg{
		animation: none !important;
	}
	.ir-bonusIntro.is-show .ir-bonusIntro__symbol{
		animation: none !important;
		opacity: 1;
		transform: translate(-50%, -50%) scale(1);
		filter: none;
	}
}

@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;
}

@keyframes nhDrop {
	from { transform: translate3d(0, var(--nh-drop-from, -22%), 0); }
	to { transform: translate3d(0, 0, 0); }
}

/* Bonus overlay (game-local, does not depend on shared modal) */
.nh-bonusOverlay {
	position: fixed;
	inset: 0;
	z-index: 60;
	display: none;
	place-items: center;
}

.nh-bonusOverlay[aria-hidden="false"] {
	display: grid;
}

.nh-bonusBackdrop {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.72);
}

.nh-bonusPanel {
	position: relative;
	width: min(92vw, 820px);
	border-radius: var(--ui-radius);
	border: 1px solid rgba(255,255,255,0.12);
	background: rgba(12, 14, 30, 0.92);
	backdrop-filter: blur(12px);
	padding: 14px;
	display: grid;
	gap: 12px;
	grid-template-rows: auto auto 1fr auto;
}

.nh-bonusTop {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 10px;
}

.nh-bonusTitle {
	margin: 0;
	font-size: 18px;
}

.nh-bonusClose {
	appearance: none;
	border: 1px solid rgba(255,255,255,0.18);
	background: rgba(255,255,255,0.06);
	color: rgba(255,255,255,0.92);
	border-radius: 12px;
	padding: 8px 10px;
	cursor: pointer;
}

.nh-bonusInfo {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	color: rgba(255,255,255,0.86);
}

.nh-bonusInfo .label {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: rgba(255,255,255,0.64);
}

.nh-bonusInfo .value {
	font-weight: 900;
	font-size: 18px;
}

.nh-panels {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
}

@media (max-width: 560px) {
	.nh-panels { grid-template-columns: repeat(2, 1fr); }
	.nh-bonusInfo { grid-template-columns: 1fr; }
}

.nh-panelBtn {
	appearance: none;
	cursor: pointer;
	border-radius: 16px;
	border: 1px solid rgba(255,255,255,0.12);
	background:
		radial-gradient(120% 90% at 30% 20%, rgba(124, 92, 255, 0.24), transparent 55%),
		radial-gradient(120% 90% at 70% 80%, rgba(46, 242, 255, 0.16), transparent 55%),
		rgba(0,0,0,0.18);
	color: rgba(255,255,255,0.92);
	padding: 16px 10px;
	min-height: 74px;
	font-weight: 900;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.nh-panelBtn[disabled] {
	opacity: 0.55;
	cursor: not-allowed;
}

.nh-panelBtn.is-revealed {
	border-color: rgba(46, 242, 255, 0.55);
	box-shadow: 0 0 0 2px rgba(46, 242, 255, 0.16) inset;
}

.nh-bonusBottom {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 10px;
}

.nh-bonusMsg {
	color: rgba(255,255,255,0.78);
	font-weight: 700;
}

.nh-continueBtn {
	appearance: none;
	cursor: pointer;
	border-radius: 14px;
	border: 1px solid rgba(255,255,255,0.20);
	background: linear-gradient(90deg, rgba(124, 92, 255, 0.95), rgba(46, 242, 255, 0.80));
	color: rgba(255,255,255,0.96);
	padding: 12px 14px;
	font-weight: 900;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

/* Reel Editor export for /games/bandicoot-icebound-riches-reel/index.html */
.reel-app[data-reel-game="bandicoot-icebound-riches-reel"] {
  --reel-art-scale: 1.28;
  --reel-art-x: 0px;
  --reel-cell-radius: 0px;
  --reel-grid-gap: 0px;
  --reel-stage-aspect: 2.4;
  --reel-symbol-scale: 1.3;
  --reel-tile-bg-scale: 1.09;
  --reel-window-bottom: 12%;
  --reel-window-left: 25%;
  --reel-window-radius: 7px;
  --reel-window-right: 25.6%;
  --reel-window-top: 15.4%;
}

