* {
	padding: 0;
	margin: 0;
	box-sizing: border-box;
}

button,
input,
select,
textarea {
	all: unset;
}

body {
	display: flex;
	justify-content: center;
	align-items: center;
	height: 100vh;
	margin: 0;
	background: url(./assets/classroom.png) no-repeat center
		center;
	background-size: cover;
	font-family: "Patrick Hand", cursive;
	font-size: 16px;
}

.board-container {
	width: 400px;
	height: 50vh;
	overflow: hidden;
	container: board / inline-size;
}

.board {
	display: grid;
	justify-content: center;
	align-items: start;
	grid-template-columns: repeat(3, auto);
	grid-template-rows: repeat(3, min-content);
	gap: 10px;
	padding: 15px;
}

.question {
	display: inline-flex;
	gap: 5px;
	width: 200px;
	grid-column: 1 / 3;
}

.question-label {
	color: white;
	font-size: 2rem;
	white-space: pre;
}

.question-input {
	color: white;
	font-family: "Patrick Hand", cursive;
	font-size: 2rem;
	background-color: transparent;
	border: none;
	max-width: 50%;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
	-webkit-appearance: none;
}

.btn {
	font-size: 1rem;
	color: white;
	text-align: center;
	background-color: #2c3e50;
	border: 3px solid white;
	border-radius: 8px;
	padding: 12px 32px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.btn:hover {
	background-color: #34495e;
	transform: scale(1.05);
	box-shadow: 0 0 10px white;
}

.btn-left {
	grid-column: 1 / 2;
}

.btn-right {
	grid-column: 2 / 3;
}

.level {
	grid-column: 1;
	grid-row-start: 3;
	text-align-last: center;
}

.flip-card {
	perspective: 1000px;
	width: 163px;
	height: 70px;
}

.flip-inner {
	position: relative;
	width: 100%;
	height: 100%;
	transform-style: preserve-3d;
	transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.flip-card.flipped .flip-inner {
	transform: rotateY(180deg);
}

.flip-front,
.flip-back {
	position: absolute;
	backface-visibility: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	border: 2px solid #fff;
}

.flip-front {
	background-color: #2c3e50;
	color: white;
}

.flip-back {
	width: 100%;
	background-color: #fff;
	color: #000;
	transform: rotateY(180deg);
	padding: 12px 32px;
	font-size: 1rem;
	cursor: pointer;
}

.correct {
	color: green;
	transition: color 0.5s ease-in;
}

.wrong {
	color: red;
	transition: color 0.5s ease-in, transform 0.5s ease;
	animation: bounce 500ms;
}

.slide-out {
	transform: translateX(-100%);
	opacity: 0;
	transition: transform 700ms ease-in-out,
		opacity 500ms ease-in;
}

.slide-in {
	transform: translateX(0);
	opacity: 100;
	transition: transform 700ms ease-in-out,
		opacity 500ms ease-in;
}

@media (min-width: 768px) {
	.question-label,
	.question-input {
		font-size: 4rem;
	}

	.btn {
		font-size: 2rem;
	}

	.flip-back {
		font-size: 2rem;
	}

	.board-container {
		width: 600px;
	}
}

@container board (min-width: 600px) {
	.question {
		width: 440px;
	}
}

@keyframes bounce {
	0% {
		transform: translateX(0);
	}
	25% {
		transform: translateX(-10px);
	}
	50% {
		transform: translateX(0);
	}
	75% {
		transform: translateX(-5px);
	}
	100% {
		transform: translateX(0);
	}
}
