body {
	align-items: center;
	background-color: #1a1a1a;
	color: #e0e0e0;
	display: flex;
	flex-direction: column;
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	margin: 0;
	padding: 20px;
}

#ui-overlay {
	margin-bottom: 20px;
	text-align: center;
}

h1 {
	font-weight: 300;
	letter-spacing: 2px;
	margin: 10px 0;
}

.controls {
	align-items: center;
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 15px;
}

.control-group {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 15px;
	justify-content: center;
	margin: 5px 0;
}

.advanced-settings {
	background: #222;
	border: 1px solid #444;
	border-radius: 8px;
	max-width: 600px;
	transition: background .2s;
	width: 100%;
}

.advanced-settings:hover {
	background: #2a2a2a;
}

.advanced-settings summary {
	color: #aaa;
	cursor: pointer;
	font-weight: bold;
	outline: none;
	padding: 5px;
	user-select: none;
}

.advanced-settings summary:hover {
	color: #e0e0e0;
}

select,
button {
	background: #333;
	border: 1px solid #555;
	border-radius: 4px;
	color: white;
	cursor: pointer;
	font-size: 16px;
	padding: 8px 15px;
}

button:hover {
	background: #444;
}

#status-message {
	color: #aaa;
	font-size: 18px;
	height: 1.5em;
}

#game-container {
	align-items: center;
	background-color: #222;
	border-radius: 12px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
	display: flex;
	justify-content: center;
	margin: 0 auto;
	max-width: 95vw;
	overflow: hidden;
	padding: 20px;
	position: relative;
}

#game-canvas {
	cursor: crosshair;
	display: block;
	height: auto;
	max-width: 100%;
}

#custom-overlay-canvas {
	left: 0;
	position: absolute;
	top: 0;
	z-index: 2;
}

#event-log-container {
	background: #222;
	border: 1px solid #444;
	border-radius: 8px;
	font-family: monospace;
	font-size: 12px;
	margin-top: 15px;
	max-width: 600px;
	padding: 10px;
	width: 100%;
}

#event-log-title {
	border-bottom: 1px solid #333;
	color: #aaa;
	font-weight: bold;
	margin-bottom: 5px;
	padding-bottom: 2px;
}

#event-log {
	color: #0f0;
	display: flex;
	flex-direction: column;
	height: 80px;
	overflow-y: auto;
}

.log-entry {
	margin-bottom: 2px;
}

.instructions {
	background: #2a2a2a;
	border: 1px solid #333;
	border-radius: 8px;
	line-height: 1;
	margin-top: 30px;
	max-width: 600px;
	padding: 20px;
	text-align: left;
}

.instructions strong {
	color: #4db8ff;
}

ul {
	margin-top: 10px;
	padding-left: 20px;
}

li {
	margin-bottom: 5px;
}

#copyright {
	font-size: 12px;
	margin-top: 12px;
	opacity: .35;
	user-select: none;
}

#copyright a {
	color: #aaa;
	text-decoration: none;
	transition: opacity .2s ease, color .2s ease;
}

#copyright a:hover {
	color: #4db8ff;
	opacity: 1;
	text-decoration: underline;
}

@media (max-width: 500px) {
	body {
		padding: 10px;
	}

	#game-container {
		padding: 0;
	}
}

input[type="color"] {
	background: #333;
	border: 1px solid #555;
	border-radius: 4px;
	height: 36px;
	padding: 2px;
	width: 44px;
}

#filter-switcher {
	margin-top: 10px;
}

.hidden {
	display: none !important;
}

#filter-switcher button.active {
	border-color: #4db8ff;
	box-shadow: 0 0 0 1px #4db8ff inset;
}

textarea {
	background: #111;
	border: 1px solid #444;
	border-radius: 6px;
	box-sizing: border-box;
	color: #ddd;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
	font-size: 12px;
	max-width: 700px;
	padding: 8px;
	width: 100%;
}

.custom-editor-group {
	align-items: stretch;
	flex-direction: column;
	width: 100%;
}

@media (max-width: 768px) {

	select,
	button,
	input {
		font-size: 15px;
	}

	.control-group {
		gap: 8px;
	}

	#status-message {
		font-size: 16px;
		height: auto;
		min-height: 1.5em;
	}
}

#custom-create-tools {
	box-sizing: border-box;
	max-width: 100%;
	overflow-x: hidden;
	width: 100%;
}

.custom-tool.active {
	border-color: #4db8ff;
	box-shadow: 0 0 0 1px #4db8ff inset;
}

.custom-editor-group {
	max-width: 100%;
	width: 100%;
}

.custom-editor-group label {
	width: 100%;
}

#custom-tool-indicator {
	color: #8ec7ff;
	font-size: 12px;
}

.color-swatch {
	border: 2px solid #666;
	height: 30px;
	min-width: 30px;
	padding: 0;
	width: 30px;
}

.color-swatch[data-color="0"] {
	background: #222;
	color: #ccc;
}

.color-swatch[data-color="1"] {
	background: #000;
}

.color-swatch[data-color="2"] {
	background: #fff;
	color: #111;
}

.color-swatch[data-color="3"] {
	background: #d44;
}

.color-swatch[data-color="4"] {
	background: #36f;
}

.color-swatch.active {
	border-color: #4db8ff;
	box-shadow: 0 0 0 2px rgba(77, 184, 255, .35);
}

.custom-hint {
	color: #b5cbe3;
	font-size: 13px;
	max-width: 700px;
	text-align: left;
}

#game-container.custom-mode-active {
	overflow: visible;
	padding-bottom: 220px;
}

.mark-toggle-group {
	align-items: center;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.ratio-slider {
	width: 60px;
}
