* {
	box-sizing: border-box;
}

html {
	padding: 0px;
	margin: 0px;
}

body {
	padding: 0px;
	margin: 0px;
	color: #00FF00;
	background-color: black;
	font-family: monospace;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	margin-left: 250px;
}

a:link {
	color: #00FF00;
	text-decoration: none;
}

a:visited {
	color: #00FF00;
	text-decoration: none;
}

a:link:hover {
	text-decoration: underline;
}

header#header {
	border: 1px solid black;
	border-bottom: 20px solid green;
	padding: 1.5cm;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1cm;
}

.header-container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	gap: 1cm;
}

.header-content {
	flex: 1;
}

header h1 {
	margin: 0px;
	padding: 0px;
}

.logo {
	display: inline-block;
}

.tagline {
	margin: 0.5cm 0px 0px 0px;
	padding: 0px;
	font-size: 0.9em;
}

.menu-toggle {
	display: none;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0.25cm;
	color: #00FF00;
	font-size: 1.8em;
	line-height: 1;
	position: relative;
	z-index: 101;
}

nav#nav-menu {
	background-color: black;
	position: fixed;
	left: 0;
	top: 0;
	width: 250px;
	height: 100%;
	border-right: 1px solid green;
	margin-top: 0;
	padding-top: 0;
	overflow-y: auto;
	z-index: 100;
}

nav#nav-menu ul {
	list-style: none;
	margin: 0px;
	padding: 0px;
	display: flex;
	flex-direction: column;
}

nav#nav-menu li {
	border-bottom: 1px solid green;
}

nav#nav-menu li:last-child {
	border-bottom: none;
}

nav#nav-menu a {
	display: block;
	padding: 0.5cm 1cm;
}

nav#nav-menu a:hover {
	background-color: #001a00;
}

.menu-item-with-submenu {
	position: relative;
}

nav#nav-menu .submenu {
	display: flex;
	flex-direction: column;
	position: static;
	background-color: black;
	border: none;
	border-top: 1px solid green;
	border-left: 3px solid green;
	list-style: none;
	margin: 0px;
	margin-top: 0.25cm;
	padding-left: 0.5cm;
	z-index: 10;
}

.submenu li {
	border-bottom: 1px solid green;
}

.submenu li:last-child {
	border-bottom: none;
}

.submenu a {
	padding: 0.3cm 0.75cm;
	font-size: 0.9em;
}

.main-content {
	flex: 1;
	padding: 1cm;
	margin: 0px;
	max-width: 900px;
}

.main-content:has(#gameContainer) {
	max-width: none;
	width: 100%;
}

footer#foot {
	border: 1px solid black;
	border-top: 20px solid green;
	margin: 0px;
	padding: 1.5cm;
	text-align: center;
	margin-top: auto;
}

footer p {
	margin: 0px;
	padding: 0px;
}

.contact-link {
	font-style: italic;
}

table.level {
	font: monospace;
	color: #00FF00;
	background-color: black;
	font-size: small;
	border: none;
}

/* Game styles */
#gameContainer {
	background-color: #000;
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	margin: 1cm 0;
	max-height: 100vh;
	aspect-ratio: 4 / 3;
}

canvas {
	display: block;
	background-color: #000;
	width: 100%;
	height: 100%;
}

.controls h3 {
	margin: 0 0 5px 0;
}

.controls div {
	margin: 2px 0;
}

#startButton {
	padding: 12px 30px;
	font-size: 18px;
	min-width: 150px;
}


select {
	display: block;
	padding: 5px;
	font-size: 14px;
	color: #0f0;
	background-color: #000;
	border: 1px solid #0f0;
	cursor: pointer;
}

button {
	color: #0f0;
	background-color: #000;
	border: 1px solid #0f0;
	cursor: pointer;
	padding: 5px 10px;
}

button:disabled {
	color: #555;
	border-color: #555;
	cursor: not-allowed;
}

select:disabled {
	color: #555;
	border-color: #555;
	cursor: not-allowed;
}

.game-settings {
	display: flex;
	flex-direction: row;
	gap: 20px;
	flex-wrap: wrap;
	padding: 10px;
	align-items: flex-start;
	justify-content: center;
}

.difficulty-select, .level-select {
	display: flex;
	flex-direction: column;
	gap: 5px;
	align-items: center;
}

.difficulty-select label, .level-select label {
	font-size: 0.9em;
}

#startButton {
	flex-shrink: 0;
}

.controls {
	text-align: center;
	font-size: 14px;
	flex-shrink: 0;
	margin-left: auto;
	margin-right: auto;
}

.controls h3 a {
	color: #0f0;
	text-decoration: underline;
	cursor: pointer;
}

.controls h3 a:hover {
	color: #0f0;
	text-decoration: underline;
}

#fullscreenButton {
	flex-shrink: 0;
}

/* Controls Modal Styles */
.modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.85);
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	z-index: 200;
	visibility: hidden;
	opacity: 0;
	transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.open {
	display: flex;
	visibility: visible;
	opacity: 1;
}

.modal-content {
	background-color: #000;
	border: 1px solid #0f0;
	color: #0f0;
	padding: 20px;
	min-width: 400px;
	max-width: 600px;
	max-height: 80vh;
	overflow-y: auto;
	box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

.modal-content h3 {
	margin: 0 0 20px 0;
	text-align: center;
}

.controls-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 20px;
}

.controls-table td {
	padding: 10px;
	border-bottom: 1px solid #0f0;
	text-align: left;
}

.controls-table td:first-child {
	width: 30%;
	font-weight: bold;
}

.controls-table td:last-child {
	width: 70%;
}

.key-bindings {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.key-binding {
	display: inline-block;
	background-color: #0f0;
	color: #000;
	padding: 4px 8px;
	border-radius: 3px;
	font-weight: bold;
	font-size: 0.85em;
	position: relative;
	padding-right: 24px;
}

.key-binding .remove-key {
	position: absolute;
	right: 4px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	color: #000;
	cursor: pointer;
	padding: 0;
	font-size: 1.1em;
	line-height: 1;
	width: 20px;
	height: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.key-binding .remove-key:hover {
	color: #f00;
}

.add-key-btn {
	background-color: #000;
	border: 1px solid #0f0;
	color: #0f0;
	padding: 4px 10px;
	cursor: pointer;
	font-weight: bold;
	font-size: 0.85em;
}

.add-key-btn:hover {
	background-color: #001a00;
}

.add-key-btn.capturing {
	animation: capture-pulse 1s infinite;
	background-color: #0f0;
	color: #000;
}

@keyframes capture-pulse {
	0%, 100% {
		background-color: #0f0;
	}
	50% {
		background-color: #00b300;
	}
}

.modal-buttons {
	display: flex;
	gap: 10px;
	margin-top: 20px;
	justify-content: center;
}

.modal-buttons button {
	padding: 8px 15px;
	font-size: 14px;
	min-width: 120px;
}


/* Responsive design */
@media (max-width: 1000px) {
	body {
		margin-left: 0;
	}

	header#header {
		padding: 0.75cm;
	}

	.header-content {
		min-width: 0;
	}

	header h1 {
		font-size: 1.2em;
	}

	.tagline {
		font-size: 0.8em;
		margin-top: 0.25cm;
	}

	.menu-toggle {
		display: block;
	}

	nav#nav-menu {
		position: fixed;
		left: 0;
		top: 0;
		width: 100%;
		height: auto;
		max-height: 0;
		overflow: hidden;
		transition: max-height 0.3s ease;
		border-right: none;
		border-bottom: 1px solid green;
	}

	nav#nav-menu.open {
		max-height: 100vh;
		overflow-y: auto;
	}

	nav#nav-menu ul {
		flex-direction: column;
	}

	nav#nav-menu li {
		border-bottom: 1px solid green;
	}

	nav#nav-menu li:last-child {
		border-bottom: none;
	}

	nav#nav-menu a {
		padding: 0.75cm 1cm;
	}

	.submenu {
		display: none;
		border-left: 3px solid green;
		margin-left: 0.5cm;
	}

	.menu-item-with-submenu.open .submenu {
		display: flex;
	}

	.main-content {
		padding: 0.75cm;
	}

	footer#foot {
		padding: 0.75cm;
	}
}
