@import url('https://fonts.googleapis.com/css2?family=Bangers&family=Nunito:wght@500;700;800;900&display=swap');

:root {
	--sky-top: #64c8ff;
	--sky-bottom: #1b78d6;
	--sun: #ffd84d;
	--panel-top: #fff9eb;
	--panel-bottom: #ffe8b6;
	--line: #1d3660;
	--text-main: #2d1b10;
	--text-soft: #5b3b20;
	--accent: #ff9e2f;
	--danger: #bb2d23;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	color: var(--text-main);
	font-family: 'Nunito', sans-serif;
	background:
		radial-gradient(circle at 10% 14%, rgba(255, 255, 255, 0.55) 0 10%, transparent 12%),
		radial-gradient(circle at 84% 20%, rgba(255, 255, 255, 0.45) 0 8%, transparent 11%),
		radial-gradient(circle at 50% -8%, var(--sun) 0 22%, transparent 30%),
		linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 100%);
}

.box {
	width: min(920px, 100%);
	padding: 22px;
	border-radius: 26px;
	background: linear-gradient(180deg, var(--panel-top) 0%, var(--panel-bottom) 100%);
	border: 3px solid var(--line);
	box-shadow: 0 14px 0 #143868, 0 28px 36px rgba(11, 35, 76, 0.45);
	text-align: center;
	animation: reveal 500ms ease-out;
}

#cabecera {
	border: 2px solid rgba(29, 54, 96, 0.35);
	border-radius: 18px;
	padding: 24px;
	background:
		radial-gradient(circle at 50% -40%, rgba(255, 171, 53, 0.36) 0 66%, transparent 68%),
		linear-gradient(180deg, #fffefa 0%, #ffeec9 100%);
}

#titulo {
	margin: 0 0 12px;
	font-family: 'Bangers', cursive;
	font-size: clamp(2rem, 4.5vw, 3.3rem);
	letter-spacing: 1.2px;
	line-height: 1.05;
	color: #e96100;
	text-shadow: 2px 2px 0 #fff6cc, 5px 5px 0 rgba(24, 20, 14, 0.2);
}

.h2 {
	margin: 8px 0;
	color: var(--text-soft);
	font-weight: 900;
}

#scoreboard {
	display: inline-block;
	margin-top: 2px;
	padding: 8px 16px;
	border-radius: 999px;
	border: 2px solid #1c64b5;
	background: linear-gradient(180deg, #8fd4ff 0%, #53a8ef 100%);
	color: #07386b;
	font-size: clamp(1rem, 2.4vw, 1.2rem);
}

#resultado {
	display: block;
	min-height: 28px;
	margin: 10px 0 6px;
	color: var(--danger);
	font-weight: 800;
}

#personaje {
	margin-bottom: 14px;
}

#imagen {
	width: min(300px, 72vw);
	height: min(300px, 72vw);
	object-fit: contain;
	border-radius: 16px;
	padding: 12px;
	border: 2px solid rgba(26, 81, 149, 0.65);
	background:
		radial-gradient(circle at 50% 18%, rgba(255, 201, 108, 0.7) 0 30%, transparent 62%),
		linear-gradient(180deg, #fff8e2 0%, #ffe3af 100%);
	box-shadow: inset 0 0 0 1px rgba(26, 81, 149, 0.2), 0 10px 20px rgba(23, 64, 116, 0.28);
}

form {
	margin-top: 16px;
	border: 2px solid rgba(29, 54, 96, 0.35);
	border-radius: 18px;
	padding: 18px;
	background: linear-gradient(180deg, #fffdf5 0%, #ffefcb 100%);
}

.contenedortext {
	padding: 8px 0 14px;
}

#error_nombre {
	display: block;
	min-height: 22px;
	color: #7f7f7f;
	font-weight: 700;
}

#error_nombre.error {
	color: var(--danger);
}

.input {
	width: min(300px, 100%);
	border: 2px solid #4b78b4;
	border-radius: 12px;
	padding: 12px 14px;
	font-size: 1rem;
	font-weight: 700;
	text-align: center;
	color: var(--text-main);
	background: #fffef9;
	transition: border-color 180ms ease, box-shadow 180ms ease;
}

.input:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 4px rgba(255, 158, 47, 0.24);
}

.controles {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
}

.boton {
	border: none;
	color: #ffffff;
	text-align: center;
	text-decoration: none;
	display: inline-block;
	cursor: pointer;
	margin: 0;
	transition: transform 120ms ease, filter 140ms ease;
}

.boton:hover {
	transform: translateY(-1px);
	filter: saturate(1.08);
}

#enviar {
	box-shadow: 0px 10px 14px -7px #3dc21b;
	background: linear-gradient(to bottom, #44c767 5%, #5cbf2a 100%);
	background-color: #44c767;
	border-radius: 8px;
	display: inline-block;
	cursor: pointer;
	color: #ffffff;
	font-family: 'Nunito', sans-serif;
	font-size: 20px;
	font-weight: 800;
	padding: 13px 32px;
	text-decoration: none;
	text-shadow: 0px 1px 0px #2f6627;
}

#enviar:hover {
	background: linear-gradient(to bottom, #5cbf2a 5%, #44c767 100%);
	background-color: #5cbf2a;
}

#enviar:active {
	position: relative;
	top: 1px;
}

#reintentar,
#rendirse {
	box-shadow: 0px 10px 14px -7px #8a2a21;
	background: linear-gradient(to bottom, #c62d1f 5%, #f24437 100%);
	background-color: #c62d1f;
	border-radius: 8px;
	display: inline-block;
	cursor: pointer;
	color: #ffffff;
	font-family: 'Nunito', sans-serif;
	font-size: 20px;
	font-weight: 800;
	padding: 13px 32px;
	text-decoration: none;
	text-shadow: 0px 1px 0px #810e05;
}

#reintentar:hover,
#rendirse:hover {
	background: linear-gradient(to bottom, #f24437 5%, #c62d1f 100%);
	background-color: #f24437;
}

#reintentar:active,
#rendirse:active {
	position: relative;
	top: 1px;
}

@keyframes reveal {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (max-width: 768px) {
	body {
		padding: 14px;
	}

	.box {
		padding: 14px;
		border-radius: 16px;
	}

	#cabecera,
	form {
		padding: 14px;
		border-radius: 16px;
	}

	#titulo {
		font-size: 1.7rem;
		letter-spacing: 1px;
	}

	#enviar,
	#reintentar,
	#rendirse {
		width: 100%;
		font-size: 1.05rem;
		padding: 12px 16px;
	}
}