:root {
	--bg-color: #f2f2f2;
	--ink-color: #000000;
	--swiss-red: #da291c;
	--canvas-white: #ffffff;
}

body {
	background-color: var(--bg-color);
	color: var(--ink-color);
	font-family: 'Inter', Helvetica, Arial, sans-serif;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	margin: 0;
	padding: 40px;
	box-sizing: border-box;
	position: relative;
}

header {
	position: relative;
	width: 100%;
	max-width: 600px;
	margin-bottom: 20px;
	z-index: 10;
}

h1 {
	font-weight: 900;
	font-size: 4rem;
	letter-spacing: -0.04em;
	margin: 0;
    margin-left: -2px;
	line-height: 1;
	text-transform: uppercase;
}

.meta-label {
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	margin-bottom: 1rem;
	display: block;
	padding-top: 10px;
	border-top: 4px solid var(--ink-color);
	width: 100px;
}

.layout-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
	max-width: 600px;
	width: 100%;
	margin-top: 0;
}

.canvas-wrapper {
	background-color: var(--canvas-white);
	padding: 0;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.05);
}

#canvas {
	width: 100%;
	aspect-ratio: 1/1;
	display: grid;
	cursor: crosshair;
	touch-action: none;
	box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}

.pixel {
	background-color: transparent;
	user-select: none;
	transition: background-color 0.05s ease;
}

.controls-bar {
	display: grid;
	grid-template-columns: auto 1fr auto;
	gap: 24px;
	align-items: center;
	margin-top: 10px;
	border-top: 1px solid #ccc;
	padding-top: 24px;
}

.color-group {
	position: relative;
	width: 48px;
	height: 48px;
}

#color-display {
	width: 100%;
	height: 100%;
	background-color: #000;
	border: 2px solid var(--ink-color);
	box-sizing: border-box;
}

input[type='color'] {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

.slider-group {
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.slider-label {
	font-size: 0.7rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-bottom: 8px;
	display: flex;
	justify-content: space-between;
}

input[type='range'] {
	-webkit-appearance: none;
	width: 100%;
	background: transparent;
}

input[type='range']::-webkit-slider-thumb {
	-webkit-appearance: none;
	height: 16px;
	width: 16px;
	background: var(--ink-color);
	cursor: pointer;
	margin-top: -7px;
	border-radius: 0;
}

input[type='range']::-webkit-slider-runnable-track {
	width: 100%;
	height: 2px;
	background: #d1d1d1;
}

button {
	background: transparent;
	color: var(--swiss-red);
	font-family: 'Inter', sans-serif;
	font-weight: 700;
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	border: 2px solid var(--swiss-red);
	padding: 0 24px;
	height: 48px;
	cursor: pointer;
	transition: all 0.2s ease;
}

button:hover {
	background-color: var(--swiss-red);
	color: white;
}

button:active {
	transform: translateY(1px);
}

@keyframes sharp-shake {
	0% {
		transform: translateX(0);
	}
	25% {
		transform: translateX(-8px);
	}
	50% {
		transform: translateX(8px);
	}
	75% {
		transform: translateX(-8px);
	}
	100% {
		transform: translateX(0);
	}
}

.shake-active {
	animation: sharp-shake 0.2s ease-in-out 2;
}

@media (max-width: 600px) {
	body {
		padding: 20px;
		display: block;
	}

	header {
		position: relative;
		top: 0;
		left: 0;
		margin-bottom: 20px;
		margin-top: 20px;
		transform: none;
	}

	.layout-grid {
		margin-top: 0;
	}

	h1 {
		font-size: 3rem;
	}

	.controls-bar {
		grid-template-columns: 1fr 1fr;
		grid-template-rows: auto auto;
	}
	.color-group {
		grid-column: 1 / 2;
	}
	button {
		grid-column: 2 / 3;
	}
	.slider-group {
		grid-column: 1 / 3;
		order: 3;
	}
}
