/* Reset & base */
* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html,
body {
	height: 100%;
}

body {
	font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
	background: linear-gradient(-45deg,
			#2a0f45,
			#420b1c,
			#0b2242,
			#3a0b4a,
			#1a0b2f,
			#2a0f45,
			#420b1c);
	background-size: 600% 600%;
	animation: gradientMix 90s ease infinite;
	/* slightly dim primary text to better fit the dark theme */
	color: rgba(255, 255, 255, 0.74);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	min-height: 100vh; /* ensure vertical centering on mobile */
}

/* Smooth, mixed, looping gradient */
@keyframes gradientMix {
	0% {
		background-position: 0% 50%;
	}

	20% {
		background-position: 50% 70%;
	}

	40% {
		background-position: 100% 50%;
	}

	60% {
		background-position: 70% 30%;
	}

	80% {
		background-position: 30% 0%;
	}

	100% {
		background-position: 0% 50%;
	}
}

/* Card container */
.rps-card {
	width: 95%;
	max-width: 540px;
	background: linear-gradient(180deg,
			rgba(109, 49, 133, 0.95),
			rgba(36, 26, 82, 0.95) 55%,
			rgba(94, 12, 37, 0.95));
	border-radius: 16px;
	padding: 2rem;
	backdrop-filter: blur(6px) saturate(120%);
	overflow: hidden;
	position: relative;
	margin: 0 auto;
}

.rps-title {
	position: relative;
	top: -15px;
	font-family: 'Poppins', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	font-size: 2rem;
	font-weight: 600;
	letter-spacing: 0.4px;
	text-align: center;
	margin-bottom: 1.25rem;
	background: linear-gradient(135deg, #a78bfa, #60a5fa, #f472b6);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	text-shadow: 0 2px 8px rgba(18, 10, 26, 0.15);
	padding: 0.25rem 0;
}

.rps-row {
	display: flex;
	gap: 0.75rem;
	justify-content: center;
	flex-wrap: wrap;
	margin-bottom: 1rem;
}

/* Buttons */
.rps-btn {
	--btn-size: 120px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--btn-size);
	height: var(--btn-size);
	border-radius: 12px;
	border: none;
	cursor: pointer;
	color: rgba(255, 255, 255, 0.74);
	font-family: 'Poppins', 'Inter', system-ui, -apple-system, sans-serif;
	font-weight: 700;
	letter-spacing: 0.6px;
	font-size: 1.1rem;
	transition: transform 180ms cubic-bezier(.22, .9, .32, 1);
	box-shadow: 0 8px 24px rgba(3, 10, 30, 0.5);
	position: relative;
	overflow: hidden;
}

.rps-btn:active {
	transform: translateY(2px) scale(0.995);
}

.rps-btn:hover {
	transform: translateY(-2px);
}

/* Button specific styles */
.rps-btn.rock {
	position: relative;
	top: -20px;
	background: linear-gradient(135deg, #6a46bd, #9b3065, #754e09);
	box-shadow: 0 8px 24px rgba(88, 59, 151, 0.3);
}

.rps-btn.paper {
	position: relative;
	top: -20px;
	background: linear-gradient(135deg, #2b38ac, #41058f, #6b3697);
	box-shadow: 0 8px 24px rgba(75, 124, 202, 0.3);
}

.rps-btn.scissors {
	position: relative;
	top: -20px;
	background: linear-gradient(135deg, #c53737, #743909, #83067d);
	box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
}

/* Result container */
.result-container {
	position: relative;
	top: 10px;
	min-height: 60px;
	margin-bottom: 10px;
	text-align: center;
	display: flex;
	align-items: center;
	justify-content: center;
}

.result-text {
	font-family: 'Poppins', sans-serif;
	font-size: 1.4rem;
	font-weight: 600;
	background: linear-gradient(135deg, #a78bfa, #60a5fa, #f472b6);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	padding: 0.5rem 0;
}

/* Reset button */
.rps-btn.reset {
	position: relative;
	top: 25px;
	background: linear-gradient(135deg, #8721a7, #46106e, #871c45);
	width: auto;
	min-width: 130px;
	height: 44px;
	padding: 0 20px;
	border-radius: 12px;
	font-family: 'Poppins', 'Inter', system-ui, -apple-system, sans-serif;
	font-weight: 600;
	font-size: 1rem;
	box-shadow: 0 6px 20px rgba(171, 29, 184, 0.25);
	letter-spacing: 0.5px;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto;
	color: rgba(255, 255, 255, 0.74);
}

.rps-btn.reset span {
	background: linear-gradient(135deg, #a78bfa, #60a5fa, #f472b6);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}

.rps-btn.reset:hover {
	transform: translateY(-2px);
}

.rps-btn:focus {
	outline: 3px solid rgba(255, 255, 255, 0.06);
}

.muted {
	display: block;
	text-align: center;
	margin-top: 0.5rem;
	color: rgba(230, 238, 248, 0.72);
	font-size: 0.95rem;
}

/* Improved responsive design */
@media (max-width: 600px) {
	body {
		padding: 0.5rem;
		/* keep the card centered vertically on small screens */
		align-items: center;
		justify-content: center;
		padding-top: 0.75rem;
		padding-bottom: 0.75rem;
	}

	.rps-card {
		width: 100%;
		padding: 1.5rem;
		border-radius: 12px;
		margin: auto;
	}

	.rps-title {
		font-size: 1.7rem;
		top: -10px;
		margin-bottom: 1rem;
	}

	.rps-btn {
		--btn-size: 100px;
		font-size: 1rem;
		top: -15px !important;
	}

	.result-container {
		top: 5px;
		min-height: 50px;
	}

	.result-text {
		font-size: 1.2rem;
	}

	.rps-btn.reset {
		top: 20px;
		height: 40px;
		font-size: 0.9rem;
		padding: 0 16px;
		min-width: 120px;
	}
}

@media (max-width: 420px) {
	.rps-card {
		padding: 1.25rem;
	}

	.rps-title {
		font-size: 1.5rem;
	}

	.rps-btn {
		--btn-size: 90px;
		font-size: 0.9rem;
	}

	.rps-row {
		gap: 0.5rem;
	}

	.result-container {
		top: 0;
		min-height: 40px;
		margin-bottom: 5px;
	}

	.result-text {
		font-size: 1.1rem;
	}

	.rps-btn.reset {
		top: 15px;
		height: 38px;
		font-size: 0.85rem;
		min-width: 110px;
	}
}

/* subtle pulse on win */
@keyframes pulseWin {
	0% {
		box-shadow: 0 8px 30px rgba(2, 150, 123, 0.06);
		transform: translateY(-2px);
	}

	100% {
		box-shadow: 0 6px 18px rgba(2, 150, 123, 0.02);
		transform: translateY(0);
	}
}

.pulse {
	animation: pulseWin 420ms ease-out 1;
}

/* Remove generic body styles that might conflict */
body>p:first-of-type,
body>button {
	display: none;
}

/* Result area shown above reset button */
.result-area {
	width: 100%;
	text-align: center;
	padding: 0.5rem 1rem;
	margin: 0.5rem 0;
	background: rgba(255, 255, 255, 0.03);
	border-radius: 10px;
	/* Gradient text effect */
	background: linear-gradient(135deg, #a78bfa, #60a5fa, #f472b6);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
	font-weight: 600;
	/* Optional: Add a subtle border to maintain the container visibility */
	border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Toggle button visual tweak (smaller than reset) */
#toggle-result {
	min-width: 120px;
	height: 44px;
	padding: 0 14px;
	margin-left: 0.5rem;
}
