body {
	min-height: 100vh;
	margin: 0;
	font-family: 'Permanent Marker', cursive;
	background: linear-gradient(135deg, #130f0a 0%, #0b0b0b 52%, #101b18 100%);
	color: #ffb338;
}

.global-wrapper {
	box-sizing: border-box;
	width: min(100%, 1120px);
	min-height: 100vh;
	margin: 0 auto;
	padding: 32px 24px 18px;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.header-wrapper {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	width: 100%;
	margin-bottom: 24px;
	text-align: center;
}

h1 {
	margin: 0;
	font-size: 4rem;
	line-height: 1;
	text-align: center;
	text-shadow: 0 4px 0 rgba(0, 0, 0, 0.55);
}

.restart-button {
	border: 2px solid #ffb338;
	border-radius: 6px;
	padding: 10px 22px;
	font: inherit;
	font-size: 1.1rem;
	line-height: 1;
	color: #130f0a;
	background: #ffb338;
	box-shadow: 0 5px 0 #7a3d08;
	cursor: pointer;
}

.restart-button:hover {
	background: #ffd37c;
}

.restart-button:active {
	transform: translateY(3px);
	box-shadow: 0 2px 0 #7a3d08;
}

.restart-button:focus {
	outline: 3px solid #ffffff;
	outline-offset: 4px;
}

.main-game-zone {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	width: 100%;
}

.gameControls {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 2rem;
	width: min(100%, 900px);
	margin: 0 0 18px;
}

.gameStats {
	display: flex;
	flex-direction: row;
	justify-content: center;
	align-items: center;
	gap: 2rem;
	box-sizing: border-box;
	flex: 1;
	margin: 0;
	padding: 10px 16px;
	border: 2px solid rgba(255, 179, 56, 0.5);
	border-radius: 8px;
	background: rgba(0, 0, 0, 0.42);
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
	text-align: center;
}

.gameStats p {
	margin: 0;
	white-space: nowrap;
	font-size: 1.15rem;
}

#board {
	display: grid;
	grid-template-columns: repeat(8, minmax(64px, 110px));
	justify-content: center;
	gap: 5px;
	position: relative;
	width: min(100%, 915px);
	margin: 0 auto;
}

#board div, #board div img {
	aspect-ratio: 1;
	height: auto;
	width: 100%;
	border-radius: 5px;
}

#board div {
	overflow: hidden;
	background-image: url("../assets/images/card_back_classic.png");
	background-size: cover;
	background-position: center;
	box-shadow: 0 5px 12px rgba(0, 0, 0, 0.35);
	cursor: pointer;
}

#board div img {
	display: block;
	object-fit: cover;
}

.matchMsg {
	position: absolute;
	font-size: 5em;
	font-family: 'Permanent Marker', arial;
	font-weight: bold;
	text-align: center;
	width: 100%;

	animation-duration: 2s;
	animation-timing-function: ease-out;
	animation-name: fadeup;
}

.finishMsg {
	position: absolute;
	z-index: 9999;
	top: 50%;
	left: 50%;
	box-sizing: border-box;
	margin: 0;
	padding: 14px 24px;
	border: 2px solid rgba(255, 179, 56, 0.5);
	border-radius: 8px;
	color: #ffb338;
	background: rgba(0, 0, 0, 0.88);
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.42);
	font-size: 1.4rem;
	text-align: center;
	transform: translate(-50%, -50%);
	white-space: nowrap;
}

footer {
	display: flex;
	align-items: center;
	gap: 2rem;
	width: min(100%, 915px);
	margin-top: auto;
	padding-top: 30px;
	text-align: center;
}

footer p {
	flex: 0 0 auto;
	margin: 0;
	font-size: 1rem;
	white-space: nowrap;
}

footer a {
	color: #ffffff;
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
}

marquee {
	display: block;
	box-sizing: border-box;
	flex: 1;
	min-width: 0;
	padding: 9px 0;
	border: 1px solid rgba(255, 179, 56, 0.55);
	font-family: "Courier New", Courier, monospace;
	font-weight: 700;
	color: #ffb338;
	background: #000000;
}

@keyframes fadeup {
	from {
		opacity: 1;
		bottom: 25%;
	}

	to {
		opacity: 0;
		bottom: 35%;
	}
}

@media (max-width: 760px) {
	.global-wrapper {
		padding: 22px 12px 12px;
	}

	.header-wrapper {
		margin-bottom: 18px;
	}

	h1 {
		font-size: 2.25rem;
	}

	.restart-button {
		font-size: 1rem;
	}

	.gameControls {
		align-items: stretch;
		gap: 2rem;
	}

	.gameStats {
		flex-wrap: wrap;
		gap: 8px 12px;
		padding: 9px 10px;
	}

	.gameStats p {
		font-size: 0.95rem;
	}

	#board {
		grid-template-columns: repeat(4, minmax(56px, 1fr));
		gap: 4px;
	}

	.matchMsg {
		font-size: 2.7em;
	}

	.finishMsg {
		width: min(90%, 320px);
		font-size: 1.05rem;
		white-space: normal;
	}
}

@media (max-width: 420px) {
	h1 {
		font-size: 1.9rem;
	}

	.gameControls {
		flex-direction: column;
		gap: 1rem;
	}

	footer {
		flex-direction: column;
		gap: 0.75rem;
	}
}
