.mhs-ao,
.mhs-ao *,
.mhs-ao *::before,
.mhs-ao *::after {
	box-sizing: border-box;
}

.mhs-ao {
	--mhs-ao-gold: #e6bd72;
	--mhs-ao-gold-light: #ffe3a2;
	--mhs-ao-navy: #080d24;
	--mhs-ao-panel: #111735;
	--mhs-ao-teal: #4ce5e2;
	--mhs-ao-muted: #adb7d4;
	width: min(100%, 1180px);
	margin: 1.5rem auto;
	color: #fff;
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	isolation: isolate;
}

.mhs-ao button {
	font: inherit;
}

.mhs-ao__viewport {
	position: relative;
	width: 100%;
	aspect-ratio: 1816 / 1014;
	overflow: hidden;
	background: #070b1d;
	border-radius: clamp(8px, 1.25vw, 18px);
	box-shadow:
		0 1.2rem 3rem rgba(4, 7, 22, 0.42),
		0 0 0 1px rgba(230, 189, 114, 0.24);
}

.mhs-ao__scene {
	position: absolute;
	top: 0;
	left: 50%;
	width: 100%;
	height: 100%;
	aspect-ratio: 1816 / 1014;
	transform: translateX(-50%);
	transform-origin: 50% 50%;
}

.mhs-ao__stage {
	position: absolute;
	inset: 0;
	z-index: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: fill;
	user-select: none;
	-webkit-user-drag: none;
}

.mhs-ao__reels {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
}

.mhs-ao__reel {
	position: absolute;
	top: 41.3%;
	width: 9.6%;
	aspect-ratio: 1;
	overflow: hidden;
	border-radius: 5%;
	contain: paint;
	filter: drop-shadow(0 0.18rem 0.2rem rgba(3, 6, 20, 0.66));
}

.mhs-ao__reel::after {
	position: absolute;
	inset: 0;
	z-index: 2;
	content: "";
	pointer-events: none;
	box-shadow:
		inset 0 0.25rem 0.7rem rgba(3, 6, 20, 0.58),
		inset 0 -0.2rem 0.55rem rgba(3, 6, 20, 0.48);
}

.mhs-ao__reel--1 {
	left: 28.6%;
}

.mhs-ao__reel--2 {
	left: 39.6%;
}

.mhs-ao__reel--3 {
	left: 50.6%;
}

.mhs-ao__reel--4 {
	left: 61.6%;
}

.mhs-ao__track {
	position: absolute;
	top: 0;
	left: 0;
	display: flex;
	width: 100%;
	flex-direction: column;
	transform: translate3d(0, 0, 0);
	transform-origin: 50% 0;
}

.mhs-ao__track.is-spinning {
	will-change: transform;
}

.mhs-ao__track.is-spinning .mhs-ao__tile {
	filter: saturate(1.08) blur(0.45px);
}

.mhs-ao__tile {
	width: 100%;
	max-width: none;
	aspect-ratio: 1;
	flex: 0 0 auto;
	background-image: url("../images/chords-v1.webp");
	background-repeat: no-repeat;
	background-size: 300% 200%;
	transform: translateZ(0);
}

.mhs-ao__tile--c {
	background-position: 0 0;
}

.mhs-ao__tile--dm {
	background-position: 50% 0;
}

.mhs-ao__tile--em {
	background-position: 100% 0;
}

.mhs-ao__tile--f {
	background-position: 0 100%;
}

.mhs-ao__tile--g {
	background-position: 50% 100%;
}

.mhs-ao__tile--am {
	background-position: 100% 100%;
}

.mhs-ao__spin {
	position: absolute;
	top: 71.7%;
	left: 43.6%;
	z-index: 4;
	width: 12.8%;
	min-width: 44px;
	aspect-ratio: 1;
	padding: 0;
	border: 0;
	border-radius: 50%;
	outline: 0;
	background-color: transparent;
	background-image: url("../images/button-states-v1.webp");
	background-repeat: no-repeat;
	background-position: 0 0;
	background-size: 400% 100%;
	box-shadow: none;
	cursor: pointer;
	filter: drop-shadow(0 0.45rem 0.38rem rgba(3, 5, 18, 0.5));
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
	transition: filter 140ms ease, transform 100ms ease;
}

.mhs-ao.is-ready .mhs-ao__spin:hover:not(:disabled),
.mhs-ao.is-ready .mhs-ao__spin:focus-visible:not(:disabled) {
	background-position: 33.333% 0;
	filter:
		drop-shadow(0 0.45rem 0.38rem rgba(3, 5, 18, 0.5))
		drop-shadow(0 0 0.45rem rgba(76, 229, 226, 0.72));
}

.mhs-ao.is-ready .mhs-ao__spin:active:not(:disabled) {
	background-position: 66.666% 0;
	transform: scale(0.965);
}

.mhs-ao.is-ready .mhs-ao__spin:disabled {
	background-position: 66.666% 0;
	cursor: wait;
}

.mhs-ao:not(.is-ready) .mhs-ao__spin {
	background-position: 100% 0;
	cursor: default;
}

.mhs-ao__spin:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 4px;
}

.mhs-ao__fx {
	position: absolute;
	z-index: 3;
	display: block;
	max-width: none;
	height: auto;
	opacity: 0;
	pointer-events: none;
	user-select: none;
	mix-blend-mode: screen;
}

.mhs-ao__fx--star {
	top: 48%;
	left: 27%;
	width: 46%;
	transform: translateX(-24%) scaleX(0.75);
}

.mhs-ao__fx--sparkles {
	top: 17%;
	left: 32.5%;
	width: 35%;
	transform: scale(0.72) rotate(-4deg);
}

.mhs-ao__fx--star.is-active {
	animation: mhs-ao-star 560ms cubic-bezier(0.16, 0.68, 0.3, 1) both;
}

.mhs-ao__fx--sparkles.is-active {
	animation: mhs-ao-sparkles 760ms ease-out both;
}

@keyframes mhs-ao-star {
	0% {
		opacity: 0;
		transform: translateX(-24%) scaleX(0.75);
	}
	25% {
		opacity: 0.95;
	}
	100% {
		opacity: 0;
		transform: translateX(24%) scaleX(1.05);
	}
}

@keyframes mhs-ao-sparkles {
	0% {
		opacity: 0;
		transform: scale(0.72) rotate(-4deg);
	}
	35% {
		opacity: 0.9;
	}
	100% {
		opacity: 0;
		transform: scale(1.08) rotate(2deg);
	}
}

.mhs-ao__panel {
	position: relative;
	z-index: 5;
	width: min(94%, 900px);
	margin: clamp(12px, 1.7vw, 22px) auto 0;
	padding: clamp(14px, 2.2vw, 24px);
	border: 1px solid rgba(230, 189, 114, 0.54);
	border-radius: 16px;
	background:
		radial-gradient(circle at 50% 0, rgba(54, 201, 204, 0.12), transparent 50%),
		linear-gradient(145deg, rgba(17, 23, 53, 0.98), rgba(8, 13, 36, 0.98));
	box-shadow:
		0 0.75rem 1.8rem rgba(4, 7, 22, 0.24),
		inset 0 1px rgba(255, 255, 255, 0.06);
	text-align: center;
}

.mhs-ao__result-line {
	display: flex;
	margin: 0;
	align-items: baseline;
	justify-content: center;
	gap: 0.55rem;
	flex-wrap: wrap;
	color: var(--mhs-ao-muted);
	font-size: clamp(0.95rem, 1.8vw, 1.12rem);
	line-height: 1.4;
}

.mhs-ao__result {
	color: var(--mhs-ao-gold-light);
	font-family: Georgia, "Times New Roman", serif;
	font-size: clamp(1.28rem, 3vw, 2rem);
	font-weight: 700;
	letter-spacing: 0.045em;
	text-shadow: 0 0 0.75rem rgba(230, 189, 114, 0.28);
}

.mhs-ao__result.is-updated {
	animation: mhs-ao-result 420ms ease-out both;
}

@keyframes mhs-ao-result {
	0% {
		opacity: 0.45;
		transform: translateY(0.18em) scale(0.96);
	}
	100% {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.mhs-ao__controls {
	display: flex;
	margin-top: 1rem;
	align-items: stretch;
	justify-content: center;
	gap: 0.65rem;
	flex-wrap: wrap;
}

.mhs-ao__control {
	min-width: 9.5rem;
	min-height: 44px;
	padding: 0.65rem 1rem;
	border: 1px solid rgba(230, 189, 114, 0.58);
	border-radius: 999px;
	background: linear-gradient(180deg, rgba(37, 48, 92, 0.96), rgba(15, 21, 54, 0.98));
	box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
	color: #f7f3e8;
	font-size: 0.9rem;
	font-weight: 650;
	line-height: 1.2;
	cursor: pointer;
	touch-action: manipulation;
	transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease, transform 100ms ease;
}

.mhs-ao__control:hover,
.mhs-ao__control:focus-visible,
.mhs-ao__control[aria-pressed="true"] {
	border-color: var(--mhs-ao-teal);
	background: linear-gradient(180deg, rgba(29, 93, 110, 0.98), rgba(12, 43, 66, 0.98));
	color: #fff;
}

.mhs-ao__control:active {
	transform: translateY(1px);
}

.mhs-ao__control:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
}

.mhs-ao__control:disabled {
	cursor: progress;
	opacity: 0.62;
}

.mhs-ao__noscript {
	width: min(94%, 900px);
	margin: 0.75rem auto 0;
	padding: 0.75rem 1rem;
	border-radius: 8px;
	background: #331b2d;
	color: #fff;
	text-align: center;
}

.mhs-ao__sr-only {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.mhs-ao.is-data-saver .mhs-ao__fx {
	display: none;
}

@media (max-width: 899px) {
	.mhs-ao__viewport {
		aspect-ratio: 4 / 3;
	}

	.mhs-ao__scene {
		width: auto;
		min-width: 100%;
		height: 100%;
	}
}

@media (max-width: 599px) {
	.mhs-ao {
		margin-block: 1rem;
	}

	.mhs-ao__viewport {
		aspect-ratio: 1;
		border-radius: 8px;
	}

	.mhs-ao__panel {
		width: 100%;
		border-radius: 12px;
	}

	.mhs-ao__controls {
		gap: 0.5rem;
	}

	.mhs-ao__control {
		min-width: calc(50% - 0.25rem);
		flex: 1 1 calc(50% - 0.25rem);
	}

	.mhs-ao__control:first-child {
		flex-basis: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mhs-ao *,
	.mhs-ao *::before,
	.mhs-ao *::after {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}

	.mhs-ao__track.is-spinning .mhs-ao__tile {
		filter: none;
	}
}

@media (forced-colors: active) {
	.mhs-ao__spin,
	.mhs-ao__control {
		border: 2px solid ButtonText;
	}

	.mhs-ao__spin:focus-visible,
	.mhs-ao__control:focus-visible {
		outline: 3px solid Highlight;
	}
}
