.container {
	padding: 20px;
	font-family: system-ui, -apple-system, sans-serif;
	background: #1e1e1e;
	color: white;
	max-width: 90vw;
	max-height: 90vh;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.palette {
	display: flex;
	gap: 10px;
	margin-bottom: 20px;
}

.palette-item {
	width: 40px;
	height: 40px;
	border: 2px solid #ccc;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: bold;
	color: white;
	text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}

.palette-item.selected {
	border-color: #000;
	box-shadow: 0 0 0 2px #000;
}

.grid-controls {
	margin-bottom: 20px;
	display: flex;
	gap: 20px;
	align-items: center;
	flex-wrap: wrap;
}

.grid-controls label {
	display: flex;
	align-items: center;
	gap: 8px;
}

.grid-controls input {
	width: 60px;
	padding: 4px;
}

.grid-wrapper {
	position: relative;
	display: inline-block;
	overflow: auto;
	scrollbar-width: thin;
	scrollbar-color: #4f4f4f #1e1e1e;
}

.background-image {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	opacity: 0.5;
}

.grid-container {
	display: inline-grid;
	gap: 1px;
	background: rgba(204, 204, 204, 0.8);
	padding: 1px;
	position: relative;
}

.grid-cell {
	width: 10px;
	height: 10px;
	cursor: pointer;
	transition: background-color 0.1s;
	background-color: rgba(255, 255, 255, 0.7);
}

button {
	padding: 8px 16px;
	cursor: pointer;
	background-color: #282c34;
	color: #abb2bf;
	border: 1px solid #3e4451;
	border-radius: 4px;
	font-size: 14px;
	transition: all 0.2s ease;
}

button:hover {
	background-color: #3e4451;
	border-color: #3e4451;
	transition: all 0.0s ease;
}

button:active {
	background-color: #2c313c;
	transform: translateY(1px);
}

button:focus {
	outline: none;
	box-shadow: 0 0 0 2px #528bff40;
}

button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	background-color: #21252b;
	border-color: #3b4048;
}

/* Primary button variant */
button.primary {
	background-color: #61afef;
	color: #282c34;
	border-color: #61afef;
}

button.primary:hover {
	background-color: #528bff;
	border-color: #528bff;
}

/* Secondary button variant */
button.secondary {
	background-color: #98c379;
	color: #282c34;
	border-color: #98c379;
}

button.secondary:hover {
	background-color: #89b369;
	border-color: #89b369;
}

.matrix-output {
	margin-top: 20px;
	font-family: monospace;
	white-space: pre;
	display: none;
}

.image-controls {
	margin-top: 10px;
	display: flex;
	gap: 10px;
	align-items: center;
}

#imageOpacity {
	width: 100px;
}

.layer-info {
	margin: 10px 0;
	font-weight: bold;
}

#layerSelect {
	width: 100px;
	margin-right: 10px;
}
