:root {
	--red-color: #e06666;
	--light-red-color: #e76e6e;
	--dark-red-color: #dc0a0a;
	--black-color: #204055;
	--light-black-color: #294e66;
	--dark-cell-color: #74ad5b;
	--light-cell-color: #8fc377;
	--light-highlight-color: #fad153;
	--dark-highlight-color: #ebb923;
	--selection-color: #ffcd56;
	--button-color: #d9d9d9;
	--light-button-color: #ebe7e7;
}

@font-face {
	font-family: "Martian Mono";
	src: url("/dependencies/fonts/Martian_Mono/MartianMono-VariableFont_wdth,wght.ttf");
}

@font-face {
	font-family: "Josefin Sans";
	src: url("/dependencies/fonts/Josefin_Sans/JosefinSans-VariableFont_wght.ttf");
}

html {
	height: 100%;
}

body {
	margin: 10px 40px;
	padding: 0;
	display: block;
}

#content-wrap {
	position: relative;
	display: block;
	margin: 0;
	width: 420px;
}

#game-wrap {
	background-color: var(--red-color);
	display: flex;
	flex-direction: column;
	flex-wrap: nowrap;
	justify-content: flex-start;
	align-items: center;
	padding: 10px;
	margin: 0;
	-webkit-box-shadow: 4px 5px 10px 2px rgba(0, 0, 0, 0.25);
	-moz-box-shadow: 4px 5px 10px 2px rgba(0, 0, 0, 0.25);
	box-shadow: 4px 5px 10px 2px rgba(0, 0, 0, 0.25);
	position: relative;
}

#board {
	display: grid;
	gap: 0;
	width: 400px;
	height: 400px;
	margin: 0;
	background-color: var(--dark-cell-color);
	position: relative;
}

#piece-selection-wrap {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	justify-content: space-evenly;
	align-items: center;
	background-color: #d9d9d9;
	padding: 12px 5px 8px 5px;
	width: calc(100% - 10px);
	margin: 10px 0 0 0;
}

.piece-selection {
	display: flex;
	flex-direction: column;
	flex-wrap: nowrap;
	justify-content: flex-start;
	align-items: center;
	gap: 4px;
	width: 36px;
	cursor: pointer;
	padding: 3px;
}

.piece-selection.selected {
	background-color: var(--selection-color);
}

.piece-selection-image {
	width: 36px;
	height: 36px;
}

.piece-selection-counter {
	font-family: "Martian Mono", monospace;
	font-size: 1rem;
	color: var(--black-color);
	margin: 0;
	text-align: center;
}

#icon-bar-wrap {
	visibility: hidden;
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	justify-content: space-between;
	align-items: center;
	width: calc(100% - 30px);
	height: 25px;
	margin: 0 0 6px 0;
	padding: 0 15px;
}

#icon-bar-right-wrap {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	justify-content: flex-end;
	align-items: center;
	gap: 16px;
	height: 100%;
	margin: 0;
	padding: 0;
}

.icon {
	margin: 0;
	padding: 0;
	height: 100%;
	width: 25px;
	cursor: pointer;
	background-color: var(--black-color);
	border: 0;
	outline: 0;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
	transition: background-color 0.2s, transform 0.3s;
}

.icon:hover {
	background-color: var(--light-black-color);
}

#back-button {
	-webkit-mask-image: url("images/chevron.svg");
	mask-image: url("images/chevron.svg");
}

#note-button {
	-webkit-mask-image: url("images/pencil.svg");
	mask-image: url("images/pencil.svg");
}

#hint-button {
	-webkit-mask-image: url("images/lightbulb.svg");
	mask-image: url("images/lightbulb.svg");
}

#safe-note-button {
	-webkit-mask-image: url("images/check.svg");
	mask-image: url("images/check.svg");
	background-color: var(--button-color);
	width: 21px;
	height: 21px;
	transition: background-color 0.2s;
}

#safe-note-button:hover {
	background-color: var(--light-button-color);
}

#safe-note-button.selected {
	background-color: var(--selection-color);
}

#flag-note-button {
	-webkit-mask-image: url("images/note-flag-solid.svg");
	mask-image: url("images/note-flag-solid.svg");
	background-color: var(--button-color);
	transition: background-color 0.2s;
}

#flag-note-button:hover {
	background-color: var(--light-button-color);
}

#flag-note-button.selected {
	background-color: var(--selection-color);
}

#note-buttons-wrap {
	display: flex;
	visibility: hidden;
	height: 100%;
	flex-direction: row;
	flex-wrap: nowrap;
	justify-content: flex-start;
	align-items: center;
	gap: 5px;
	background-color: var(--black-color);
	padding: 2px 5px;
	border-radius: 12px;
}

#timer {
	position: absolute;
	top: 0;
	left: 25%;
	width: 50%;
	height: 25px;
	line-height: 25px;
	margin: 0;
	font-size: 1.2rem;
	font-family: "Martian Mono", monospace;
	color: var(--black-color);
	text-align: center;
}

.cell {
	background-color: var(--dark-cell-color);
	margin: 0;
	padding: 0;
	width: 100%;
	height: 100%;
	max-width: 100%;
	max-height: 100%;
	overflow: hidden;
	position: relative;
	cursor: default;
}

.cell.selected {
	-webkit-box-shadow: inset 0 0 15px var(--selection-color);
	-moz-box-shadow: inset 0 0 15px var(--selection-color);
	box-shadow: inset 0 0 15px var(--selection-color);
}

.cell.menu-selected {
	-webkit-box-shadow: inset 0 0 15px var(--selection-color);
	-moz-box-shadow: inset 0 0 15px var(--selection-color);
	box-shadow: inset 0 0 15px var(--selection-color);
}

.hint-highlight {
	-webkit-box-shadow: inset 0 0 15px #0021ff;
	-moz-box-shadow: inset 0 0 15px #0021ff;
	box-shadow: inset 0 0 15px #0021ff;
}

.cell.highlight {
	background-color: var(--dark-highlight-color);
}

.light {
	background-color: var(--light-cell-color);
}

.light.highlight {
	background-color: var(--light-highlight-color);
}

.cell.mine {
	background-color: #c51919;
}

.piece-image {
	display: none;
	width: 92%;
	height: 92%;
	position: absolute;
	top: 4%;
	left: 4%;
	z-index: 5;
}

.piece-mine-number {
	z-index: 10;
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: 100%;
	margin: 0;
	font-family: "Martian Mono", monospace;
	font-weight: bold;
	text-align: center;
	color: var(--dark-red-color);
	text-shadow: 1px 1px 2px var(--black-color);
	opacity: 0.85;
	cursor: default;
	display: none;
}

.cell-mine-dot {
	display: none;
	width: 40%;
	height: 40%;
	background-color: var(--red-color);
	pointer-events: none;
	border-radius: 50%;
	position: absolute;
	top: 30%;
	left: 30%;
	z-index: 3;
}

#preview-piece {
	display: none;
	position: absolute;
	z-index: 50;
	pointer-events: none;
	margin: 0;
	filter: drop-shadow(1px 3px 4px rgba(0, 0, 0, 0.4));
}

#context-menu {
	display: none;
	flex-direction: column;
	justify-content: flex-start;
	align-items: flex-start;
	flex-wrap: nowrap;
	width: 145px;
	position: absolute;
	z-index: 100;
	margin: 0;
	filter: drop-shadow(2px 4px 5px rgba(0, 0, 0, 0.4));
	border-radius: 10px;
	overflow: hidden;
}

#context-menu:hover + #preview-piece {
	visibility: hidden;
}

.context-button {
	background-color: #d9d9d9;
	outline: none;
	border: none;
	width: 100%;
	height: 34px;
	margin: 0;
	padding: 0 3px;
	cursor: pointer;
	transition: background-color 0.2s;
	display: flex;
	flex-direction: row;
	justify-content: flex-start;
	align-items: center;
	flex-wrap: nowrap;
	gap: 6px;
	border-bottom: 1px solid var(--light-black-color);
}

.context-button:hover {
	background-color: #ebe7e7;
}

.context-button:last-child {
	border: none;
}

.context-button-image {
	height: 30px;
	width: auto;
}

.context-button-text {
	text-align: left;
	font-family: "Martian Mono", monospace;
	font-size: 0.8rem;
	color: var(--black-color);
}

#explosion-canvas {
	pointer-events: none;
	position: absolute;
	top: 0;
	left: 0;
	padding: 0;
	margin: 0;
	outline: 0;
	border: 0;
	z-index: 60;
	width: 420px;
	height: 420px;
}

#blocker {
	display: none;
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	z-index: 200;
}

#menu-wrap {
	display: none;
	position: absolute;
	top: 10px;
	left: 10px;
	width: calc(100% - 20px);
	height: calc(100% - 20px);
	margin: 0;
	z-index: 300;
	background-color: rgba(0, 0, 0, 0.4);
	overflow: hidden;
}

.menu {
	width: 60%;
	margin: 100px auto 0 auto;
	background-color: var(--red-color);
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	align-items: center;
	padding: 10px;
	gap: 10px;
	-webkit-box-shadow: 4px 5px 10px 2px rgba(0, 0, 0, 0.25);
	-moz-box-shadow: 4px 5px 10px 2px rgba(0, 0, 0, 0.25);
	box-shadow: 4px 5px 10px 2px rgba(0, 0, 0, 0.25);
	position: relative;
}

.menu-title {
	font-family: "Josefin Sans", sans-serif;
	color: #f3f3f3;
	margin: 0;
	font-size: 25px;
	height: 25px;
	line-height: 30px;
}

.menu-button {
	width: 100%;
	padding: 4px 6px;
	margin: 0;
	border: 0;
	outline: 0;
	font-family: "Martian Mono", monospace;
	font-size: 13px;
	cursor: pointer;
	color: var(--black-color);
	background-color: var(--button-color);
	transition: background-color 0.2s, color 0.2s;
}

.menu-button:hover {
	background-color: var(--light-button-color);
	color: var(--light-black-color);
}

.menu-close-button {
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-image: url("images/x.svg");
	mask-image: url("images/x.svg");
	position: absolute;
	top: 5px;
	right: 8px;
	width: 20px;
	height: 20px;
	cursor: pointer;
	margin: 0;
	outline: 0;
	border: 0;
	background-color: var(--black-color);
	transition: background-color 0.2s;
}

.menu-close-button:hover {
	background-color: var(--light-black-color);
}

#quit-menu {
	width: 50%;
	margin-top: 170px;
}

.game-over-menu {
	-webkit-box-shadow: none;
	-moz-box-shadow: none;
	box-shadow: none;
	background-color: transparent;
	gap: 30px;
	margin-top: 130px;
	width: 70%;
	transition: opacity 0.6s ease-in, margin-top 0.6s ease-out;
}

.game-over-menu-hidden {
	margin-top: 160px !important;
	opacity: 0;
}

.game-over-menu-title {
	font-family: "Josefin Sans", sans-serif;
	color: #f3f3f3;
	font-size: 3rem;
	text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
	margin: 0;
	text-align: center;
	width: 100%;
}

.game-over-menu-button-wrap {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	justify-content: space-between;
	align-items: center;
	width: 100%;
}

.game-over-menu-button {
	width: 120px;
	height: 34px;
	font-family: "Martian Mono", monospace;
	font-size: 0.8rem;
	color: var(--button-color);
	background-color: var(--red-color);
	margin: 0;
	text-align: center;
	border: 0;
	outline: 0;
	cursor: pointer;
	-webkit-box-shadow: 3px 3px 6px 1px rgba(0, 0, 0, 0.35);
	-moz-box-shadow: 3px 3px 6px 1px rgba(0, 0, 0, 0.35);
	box-shadow: 3px 3px 6px 1px rgba(0, 0, 0, 0.35);
	transition: background-color 0.2s, color 0.2s;
}

.game-over-menu-button:hover {
	color: var(--light-button-color);
	background-color: var(--light-red-color);
}

#win-menu {
	margin-top: 35px;
	gap: 10px;
}

#win-menu.game-over-menu-hidden {
	margin-top: 65px !important;
	opacity: 0;
}

#score-wrap {
	width: 85%;
	background-color: var(--red-color);
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	align-items: center;
	padding: 10px;
	gap: 12px;
	-webkit-box-shadow: 4px 5px 10px 2px rgba(0, 0, 0, 0.25);
	-moz-box-shadow: 4px 5px 10px 2px rgba(0, 0, 0, 0.25);
	box-shadow: 4px 5px 10px 2px rgba(0, 0, 0, 0.25);
	position: relative;
	margin: 0 0 10px 0;
}

#score-title {
	font-family: "Josefin Sans", sans-serif;
	color: #f3f3f3;
	font-size: 1.4rem;
	margin: 0 0 -5px 0;
	text-align: center;
	width: 100%;
}

.score-row {
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	align-items: center;
	font-family: "Martian Mono", monospace;
	font-size: 0.75rem;
	width: 100%;
	color: #12222d;
}

.score-row > p {
	margin: 0;
}

@keyframes pulse {
	from {
		text-shadow: none;
	}
	to {
		text-shadow: 1px 1px 4px var(--selection-color);
	}
}

#new-highscore-message {
	font-family: "Martian Mono", monospace;
	font-size: 0.75rem;
	font-weight: bold;
	color: #12222d;
	margin: 0;
	animation-name: pulse;
	animation-duration: 0.8s;
	animation-iteration-count: infinite;
	animation-direction: alternate;
}

#main-menu-wrap {
	background-color: var(--light-cell-color);
	display: flex;
	flex-direction: column;
	flex-wrap: nowrap;
	justify-content: center;
	align-items: center;
	width: 400px;
	height: 400px;
	gap: 20px;
	overflow: hidden;
}

#level-selection-wrap {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	justify-content: center;
	align-items: center;
	gap: 10px;
	width: 100%;
}

.level-selection-icon {
	font-family: "Josefin Sans", sans-serif;
	color: #f3f3f3;
	font-size: 2rem;
	margin: 0;
	text-align: center;
	width: 60px;
	height: 60px;
	line-height: 65px;
	border: 5px solid var(--red-color);
	-webkit-box-shadow: 3px 3px 6px 1px rgba(0, 0, 0, 0.35);
	-moz-box-shadow: 3px 3px 6px 1px rgba(0, 0, 0, 0.35);
	box-shadow: 3px 3px 6px 1px rgba(0, 0, 0, 0.35);
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

#current-level-icon {
	height: 90px;
	width: 90px;
	line-height: 100px;
	font-size: 3.5rem;
	margin: 0 5px;
}

.level-selection-arrow-button {
	width: 36px;
	height: 36px;
	background-color: var(--black-color);
	margin: 0;
	padding: 0;
	cursor: pointer;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-image: url("images/chevron.svg");
	mask-image: url("images/chevron.svg");
	transition: background-color 0.2s, transform 0.3s;
}

.level-selection-arrow-button:hover {
	background-color: var(--light-black-color);
}

#next-level-button {
	transform: scaleX(-1);
}

.level-selection-spacer {
	width: 116px;
}

#highscore {
	font-family: "Martian Mono", monospace;
	font-size: 0.8rem;
	color: var(--black-color);
	margin: 0;
}

@keyframes scroll {
	from {
		left: 0;
	}
	to {
		left: -240px;
	}
}

.scrolling-icon-wrap {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	justify-content: flex-start;
	align-items: center;
	gap: 3px;
	width: 400px;
	position: relative;
	animation-name: scroll;
	animation-duration: 5s;
	animation-iteration-count: infinite;
	animation-timing-function: linear;
}

.scroll-reverse {
	animation-direction: reverse;
}

.scrolling-icon {
	width: 37px;
	height: 37px;
}

#tutorial-wrap {
	display: flex;
	flex-direction: column;
	flex-wrap: nowrap;
	justify-content: flex-start;
	align-items: center;
	gap: 7px;
	width: 360px;
	height: 380px;
	padding: 10px 20px;
	background-color: var(--light-cell-color);
	position: relative;
}

.tutorial-text {
	font-family: "Martian Mono", monospace;
	font-size: 0.68rem;
	color: var(--black-color);
	margin: 0;
}

#tutorial-image {
	width: 94%;
	height: auto;
}
