/* ---------- BASE ---------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

:root {
	--c1: #dfe9f3;
	--c2: #e4d9ff;
	--c3: #ffd4d4;
	--brand: #6366f1;
	--cardBg: #ffffffee;
	--radius: 18px;
	font-size: 16px;
}

body {
	margin: 0;
	font-family: Poppins, Arial, sans-serif;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, var(--c1), var(--c2), var(--c3));
	background-size: 400% 400%;
	animation: bgMove 18s ease infinite;
	padding: 2rem;
}

@keyframes bgMove {
	0% {
		background-position: 0 50%;
	}
	50% {
		background-position: 100% 50%;
	}
	100% {
		background-position: 0 50%;
	}
}

.card {
	max-width: 780px;
	width: 100%;
	background: var(--cardBg);
	backdrop-filter: blur(8px);
	padding: 3rem 4rem;
	border-radius: var(--radius);
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
}

h1 {
	font-size: clamp(1.4rem, 3vw, 1.8rem);
	text-align: center;
	margin: 0 0 1.2rem;
}

.instructions {
	margin: 0 0 1.6rem;
	font-size: 0.95rem;
	color: #444;
}

/* ---------- GAPS ---------- */
p {
	line-height: 1.8;
	margin: 1.2rem 0;
	font-size: 1rem;
}

.blank {
	display: inline-block;
	position: relative;
	margin: 8px 0;
	vertical-align: middle;
}

.blank input {
	width: 8.5rem;
	max-width: 42vw;
	padding: 0.4rem 0.5rem;
	font-size: 1rem;
	text-align: center;
	border: 2px solid #c9d4ff;
	border-radius: 10px;
	transition: 0.25s;
}

.blank input:focus {
	outline: none;
	border-color: var(--brand);
}

.blank.correct input {
	border-color: #4ade80;
	background: #ecfdf5;
}

.blank.wrong input {
	border: 2px solid #f87171;
	background: linear-gradient(145deg, #ffeaea, #fff6f6);
	transition: 0.3s;
	animation: shake 0.3s ease-in-out;
}

/* ---------- TOOLTIP ---------- */
.tooltip {
	cursor: pointer;
	color: var(--brand);
	font-weight: 600;
	margin-left: 0.2rem;
}

.tipbox {
	position: absolute;
	bottom: calc(100% + 6px);
	left: 50%;
	transform: translateX(-50%);
	min-width: 200px;
	max-width: 230px;
	padding: 0.55rem 0.8rem;
	background: #111;
	color: #fff;
	font-size: 0.8rem;
	line-height: 1.3;
	border-radius: 8px;
	opacity: 0;
	pointer-events: none;
	transition: 0.22s;
	z-index: 20;
	text-align: center;
}

.tipbox::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%) rotate(45deg);
	width: 10px;
	height: 10px;
	background: #111;
}

.tooltip:hover + .tipbox,
.tooltip:focus + .tipbox {
	opacity: 1;
	transform: translate(-50%, -6px);
}

/* ---------- BUTTON ---------- */
button {
	display: block;
	margin: 2.4rem auto 0;
	padding: 0.9rem 2.6rem;
	font-size: 1rem;
	font-weight: 600;
	border: none;
	border-radius: 40px;
	background: var(--brand);
	color: #fff;
	cursor: pointer;
	transition: 0.25s;
}

button:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

/* ---------- SCORE ---------- */
#score {
	text-align: center;
	font-weight: 600;
	margin-top: 1rem;
	font-size: 1.1rem;
}

/* ---------- MEDIA ---------- */
@media (max-width: 900px) {
	.card {
		padding: 2.2rem;
	}
}

/* ---------- VIDEO BG ---------- */
#bg-video {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	object-fit: cover;
	z-index: -1;
	opacity: 0.7;
	pointer-events: none;
}

/* ---------- MODAL ---------- */
.modal {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100;
}

.modal.hidden {
	display: none;
}

.modal-content {
	background: white;
	padding: 2rem 2.5rem;
	border-radius: 16px;
	max-width: 90%;
	width: 400px;
	text-align: center;
	box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
	animation: popUp 0.3s ease-out;
}

.modal-content h2 {
	margin-top: 0;
}

#close-modal {
	margin-top: 1.2rem;
	padding: 0.6rem 1.8rem;
	background: var(--brand);
	color: white;
	border: none;
	border-radius: 40px;
	font-weight: 600;
	cursor: pointer;
}

#close-modal:hover {
	background: #4f46e5;
}

/* ---------- ANIMATIONS ---------- */
@keyframes popUp {
	from {
		transform: scale(0.85);
		opacity: 0;
	}

	to {
		transform: scale(1);
		opacity: 1;
	}
}

@keyframes shake {
	0% {
		transform: translateX(0);
	}
	25% {
		transform: translateX(-4px);
	}
	50% {
		transform: translateX(4px);
	}
	75% {
		transform: translateX(-4px);
	}
	100% {
		transform: translateX(0);
	}
}
