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

:root {
	--color-primary: rgb(87, 30, 76);
	--color-secondary: rgb(255, 186, 219);
	--color-text: rgb(39, 9, 42);
	--color-text-light: rgb(255, 232, 249);
	--border-radius-small: 5px;
	--border-radius-medium: 10px;
	--border-radius-big: 20px;
	--border-color: rgb(63, 3, 39);
	--border-color-light: white;
}

body {
	background-color: var(--color-secondary);
	width: 100svw;
	height: 100svh;
	font-family: "DynaPuff", system-ui;
}

/* -------------------- HEADER -------------------- */

header {
	background-color: var(--color-primary);
	width: 100%;
	padding: 25px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 70px;
}

h1 {
	font-size: 50px;
	color: var(--color-text-light);
}

.button {
	background-color: var(--color-secondary);
	padding: 10px;
	cursor: pointer;
	border: 2px solid var(--border-color-light);
	border-radius: var(--border-radius-small);
	box-shadow: 0px 3px 1px 0px black;
	transition: transform 0.4s ease;
	font-weight: 600;
}

.button:hover {
	transform: translateY(-2px);
	box-shadow: 0px 4px 2px 0px black;
}

#difficulty-buttons {
	display: flex;
	gap: 10px;
}

#sound-setting {
	display: flex;
	gap: 20px;
}

/* -------------------- MAIN -------------------- */

main {
	width: 100svw;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

/* -------------------- Stats -------------------- */

#stats {
	display: flex;
	flex-direction: column;
	padding: 10px 40px;
	gap: 50px;
}

.stat-container {
	background-color: aliceblue;
	border: 4px solid var(--border-color);
	border-radius: var(--border-radius-medium);
	padding: 5px;
	text-align: center;
	width: 200px;
	box-shadow: 0px 5px 2px 1px rgba(0, 0, 0, 0.801);
}

.stats-label {
	font-size: 25px;
}

.stats-value {
	font-size: 20px;
}

/* -------------------- Gameboard -------------------- */

#game-board {
	background-color: var(--color-primary);
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	grid-template-rows: repeat(3, 1fr);
	gap: 20px;
	padding: 30px;
	border-radius: var(--border-radius-big);
	border: 5px solid white;
	box-shadow: 0px 3px 1px 0px black;
	margin: 10px;
}

.card {
	cursor: pointer;
	position: relative;
	width: 120px;
	height: 120px;
	transform-style: preserve-3d;
	transition: transform 0.3s;
	box-shadow: 0px 4px 2px 0px rgba(0, 0, 0, 0.801);
}

.card:hover {
	transform: translateY(-4px) scale(1.02);
	box-shadow: 0px 6px 4px 0px rgba(0, 0, 0, 0.801);
}

.card.flipped {
	transform: rotateY(180deg);
	pointer-events: none;
}

.card.matched img {
	animation: bounce 0.5s ease;
}

.card-front,
.card-back {
	position: absolute;
	backface-visibility: hidden;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--border-radius-small);
	border: 3px solid white;
}

.card-front {
	background-color: rgb(255, 140, 173);
	background-image: url("./assets/images/cardback.png");
	background-size: cover;
}

.card-back {
	background-color: rgb(255, 255, 255);
	transform: rotateY(180deg);
}

img {
	width: 100px;
	height: 100px;
}

/* -------------------- Modal -------------------- */

.modal {
	position: absolute;
	display: none;
}

.modal.show {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
}

.modal-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	bottom: 90px;
	background-color: rgb(255, 159, 186);
	padding: 30px;
	width: 600px;
	height: 400px;
	gap: 40px;
	border: 5px solid white;
	border-radius: var(--border-radius-big);
	box-shadow: 0px 6px 4px 1px rgba(0, 0, 0, 0.801);
	animation: bounce 0.6s;
}

#win-label {
	font-size: 50px;
	animation: bounce 0.6s;
	transition: transform 0.3s ease;
	display: flex;
	position: relative;
	color: var(--color-text);
}

#win-label::after {
	content: "";
	width: 100%;
	border-radius: 2px;
	height: 4px;
	background-color: var(--color-primary);
	bottom: 0px;
	position: absolute;
	display: inline-block;
}

#final-score {
	background-color: var(--color-secondary);
	border-radius: var(--border-radius-medium);
	border: 3px solid white;
	box-shadow: 0px 6px 4px 1px rgba(0, 0, 0, 0.801);
	width: 300px;
	height: 150px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

#win-score,
#win-difficulty {
	font-size: 20px;
}

#final-turns,
#difficulty-type {
	font-size: 30px;
	font-weight: bold;
	margin-left: 20px;
}

/* -------------------- FOOTER -------------------- */

footer {
	background-color: var(--color-primary);
	width: 100svw;
	height: 100px;
	text-align: center;
	font-size: 20px;
	font-weight: 600;
	padding-top: 20px;
	color: var(--color-text-light);
}

a {
	text-decoration: none;
	color: var(--color-secondary);
}

/* -------------------- ANIMATION -------------------- */

@keyframes bounce {
	0%,
	100% {
		transform: scale(1);
	}

	50% {
		transform: scale(1.15);
	}
}
