/* Base reset */

html, body { margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif; background: #0b1020; color: #f5f7ff; line-height: 1.5; }

/* Layout */

main { max-width: 900px; margin: 0 auto; padding: 1.5rem; }

/* Headings */

h1 { font-size: 2.5rem; margin: 0 0 0.25rem 0; color: #ffe66d; }
h2 { font-size: 1.75rem; margin: 1.5rem 0 0.75rem 0; color: #7bdff2; }

/* Home content */

#homeContent details { margin-bottom: 1.25rem; }
#homeContent summary { cursor: pointer; font-weight: 600; color: #cdb4ff; }
#homeContent ol { margin-left: 1.25rem; }
#homeContent li { margin-bottom: 0.5rem; }

/* Buttons */

button { font-size: 1rem; padding: 0.6rem 1rem; border-radius: 0.5rem; border: none; cursor: pointer; background: #ff6f91; color: #0b1020; }
button:hover { background: #ff8fab; }
button:focus { outline: 3px solid #7bdff2; outline-offset: 2px; }

/* Game area */

#gameArea { text-align: center; }

#gameBoard { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; margin-top: 2rem; }

.mole { height: 120px; border-radius: 1rem; background: radial-gradient(circle at top, #6c63ff, #3a2dbf); box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.4); }

/* Results */

#resultsActions { display: flex; gap: 1rem; margin-top: 1.5rem; justify-content: center; }

/* Footer */

footer {
	background: linear-gradient(180deg, #0b1020, #050814);
	color: #e6e6e6;
	padding: 1.25rem 1rem;
	border-top: 4px solid #ffbe0b;
}
.footer-links a {
	color: #7bdff2;
	text-decoration: none;
	font-weight: 600;
}

.footer-links a:hover,
.footer-links a:focus {
	color: #ffbe0b;
	text-decoration: underline;
	outline: none;
}

.footer-links {
	list-style: none;
	padding: 0;
	margin: 0 0 0.75rem 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1.25rem;
}

.footer-copy {
	margin: 0;
}

.small {
	font-size: 0.875rem;
}

.muted {
	color: #a0a0a0;
}


/* Screen reader live region */

#srLiveRegion { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Hidden braille input */


/* State-based visibility */

body[data-game-state="playing"] #homeContent,
body[data-game-state="playing"] footer,
body[data-game-state="results"] #homeContent,
body[data-game-state="results"] footer { display: none; }

body[data-game-state="home"] #gameArea,
body[data-game-state="home"] #resultsArea { display: none; }

body[data-game-state="playing"] #gameArea { display: block; }
body[data-game-state="results"] #resultsArea { display: block; }
#brailleInput {
	position: absolute;
	left: -9999px;
	top: 0;
	width: 1px;
	height: 1px;
	opacity: 0.01;
}

#scoreDisplay {
	margin-top: 1rem;
	display: inline-block;
	padding: 0.5rem 1rem;
	border-radius: 0.75rem;
	background: linear-gradient(135deg, #ffbe0b, #fb5607);
	box-shadow: 0 0.4rem 0 rgba(0,0,0,0.4);
}

#scoreDisplay:focus {
	outline: 3px solid #7bdff2;
	outline-offset: 3px;
}

#scoreText {
	font-size: 1.25rem;
	font-weight: 700;
	color: #0b1020;
	letter-spacing: 0.05em;
}


#resultsSummary p {
	margin: 0 0 0.75rem 0;
	font-size: 1.1rem;
	letter-spacing: 0.03em;
}

#resultsSummary p:last-child {
	margin-bottom: 0;
}

#resultsSummary [role="text"] {
	margin: 0 0 0.75rem 0;
}

#resultsSummary [role="text"]:last-child {
	margin-bottom: 0;
}

#resultsSummary p {
	margin: 0;
	font-size: 1.1rem;
	letter-spacing: 0.03em;
}
/* Cash Out */

#cashOutArea {
	margin-top: 2rem;
}

#cashOutPrizeList {
	list-style: none;
	padding: 0;
	margin: 1.5rem 0;
	display: grid;
	gap: 1rem;
}

.cashOutPrize {
	padding: 1rem;
	border-radius: 0.75rem;
	background: linear-gradient(135deg, #3a2dbf, #6c63ff);
	cursor: pointer;
}

.cashOutPrize:focus {
	outline: 3px solid #7bdff2;
	outline-offset: 2px;
}

.cashOutPrize[data-selected="true"] {
	background: linear-gradient(135deg, #ffbe0b, #fb5607);
	color: #0b1020;
}

#cashOutActions {
	display: flex;
	gap: 1rem;
	justify-content: center;
}
/* Mole visuals with coordinated label and motion */

.mole {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	user-select: none;
	transform: translateY(22px) scale(0.98);
	opacity: 0.15;
	filter: saturate(0.9);
	transition:
		transform 140ms cubic-bezier(0.2, 0.8, 0.2, 1),
		opacity 120ms linear,
		filter 120ms linear,
		box-shadow 140ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mole::after {
	content: attr(data-label);
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0.75rem;
	text-align: center;

	font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
	font-weight: 800;
	font-size: 2.25rem;
	line-height: 1;
	letter-spacing: 0.02em;

	color: #f5f7ff;
	text-shadow: 0 2px 10px rgba(0,0,0,0.55);

	transform: translateY(4px) scale(0.92);
	opacity: 0;
	transition:
		transform 140ms cubic-bezier(0.2, 0.8, 0.2, 1),
		opacity 110ms linear,
		color 110ms linear,
		text-shadow 110ms linear;
}

/* Up state: mole pops up and label appears with it */

.mole.isUp {
	transform: translateY(0) scale(1);
	opacity: 1;
	filter: saturate(1);
	box-shadow: 0 0.65rem 1.15rem rgba(0,0,0,0.5);
}

.mole.isUp::after {
	transform: translateY(0) scale(1);
	opacity: 1;
}

/* Make longer strings (like chords) fit better */

.mole[data-label][data-label*="+"]::after,
.mole[data-label][data-label*=" "]::after {
	font-size: 1.7rem;
	letter-spacing: 0.01em;
}

/* Hit state: quick squash + flash */

.mole.isHit {
	animation: moleHit 170ms cubic-bezier(0.2, 0.8, 0.2, 1) 1;
}

.mole.isHit::after {
	color: #0b1020;
	text-shadow: none;
}

.mole.isHit::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: radial-gradient(circle at 35% 25%, rgba(255,190,11,0.95), rgba(251,86,7,0.85));
	opacity: 0.95;
	mix-blend-mode: screen;
	animation: moleFlash 170ms linear 1;
	pointer-events: none;
}

@keyframes moleHit {
	0% { transform: translateY(0) scale(1); }
	45% { transform: translateY(2px) scale(0.92); }
	100% { transform: translateY(0) scale(1); }
}

@keyframes moleFlash {
	0% { opacity: 0.95; }
	100% { opacity: 0; }
}

/* Optional miss/escape state: cool down the label slightly */

.mole.isMiss::after {
	color: #a0a0a0;
	text-shadow: 0 2px 10px rgba(0,0,0,0.35);
}

/* Reduced motion: keep state changes without bounce/flash */

@media (prefers-reduced-motion: reduce) {
	.mole {
		transition: none;
		transform: none;
	}
	.mole::after {
		transition: none;
		transform: none;
	}
	.mole.isHit,
	.mole.isHit::before {
		animation: none;
	}
}
