body,
html {
	margin: 0;
	padding: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	font-family: 'Segoe UI', sans-serif;
	background-color: #f4f4f4;
	overscroll-behavior: none;
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
}

.canvas-container {
	background-image: radial-gradient(#aaa 1.5px, transparent 1.5px);
	background-size: 24px 24px;
	background-color: #f4f4f4;
}

canvas {
	background: transparent;
}

#ui-container {
	position: absolute;
	top: 100px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	width: 95%;
	max-width: 850px;
	z-index: 100;
	pointer-events: none;
	transition: top 0.5s ease;
}

#ui-container.fullscreen-active {
    top: 20px !important;
}

#toolbar {
	pointer-events: auto;
	background: white;
	padding: 8px 15px;
	border-radius: 12px;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
	border: 1px solid #ddd;
	display: flex;
	gap: 8px;
	align-items: center;
	width: auto;
	max-width: 100%;
	overflow-x: auto;
	white-space: nowrap;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

#toolbar::-webkit-scrollbar {
	display: none;
}

.separator {
	width: 1px;
	height: 24px;
	background: #eee;
	margin: 0 4px;
	flex-shrink: 0;
}

.tool-btn {
	border: none;
	background: none;
	cursor: pointer;
	padding: 10px;
	border-radius: 8px;
	font-size: 1.2rem;
	color: #555;
	transition: 0.2s;
	flex-shrink: 0;
	position: relative;
	min-width: 48px;
}

.tool-btn:hover {
	background-color: #f7f7f7;
}

.tool-btn.active {
	background: #e0eaff;
	color: #007bff;
}

.color-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	position: absolute;
	bottom: 6px;
	left: 50%;
	transform: translateX(-50%);
	border: 1px solid rgba(0, 0, 0, 0.1);
}

/* --- OPTIONS BAR --- */
#options-bar {
	pointer-events: auto;
	background: rgba(255, 255, 255, 0.98);
	padding: 10px 20px;
	border-radius: 16px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
	display: none;
	flex-wrap: wrap;
	justify-content: center;
	gap: 15px;
	align-items: center;
	animation: slideDown 0.2s cubic-bezier(0.25, 1, 0.5, 1);
	max-width: 95vw;
}

#options-bar.show {
	display: flex;
}

input[type=range] {
	width: 100px;
	height: 6px;
	-webkit-appearance: none;
	background: #ddd;
	border-radius: 3px;
	cursor: pointer;
}

input[type=range]::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 18px;
	height: 18px;
	background: #007bff;
	border-radius: 50%;
}

.palette-group {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
}

.palette-btn {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 2px solid #fff;
	box-shadow: 0 0 0 1px #ccc;
	cursor: pointer;
}

.palette-btn.selected {
	box-shadow: 0 0 0 2px #007bff;
	transform: scale(1.1);
}

input[type=color] {
	width: 34px;
	height: 34px;
	border: none;
	background: transparent;
	padding: 0;
	border-radius: 50%;
	cursor: pointer;
}

#imgInput {
	display: none;
}

.shape-control-group {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	border: 1px solid #eee;
	padding: 5px 10px;
	border-radius: 8px;
}

.shape-label {
	font-size: 0.7rem;
	color: #666;
	font-weight: 600;
	text-transform: uppercase;
}

.row {
	display: flex;
	align-items: center;
	gap: 8px;
}

.mini-range {
	width: 60px !important;
}

/* --- FOOTER --- */
#footer-bar {
	position: absolute;
	bottom: 15px;
	left: 15px;
	right: 15px;
	display: flex;
	justify-content: space-between;
	pointer-events: none;
}

.status-pill {
	background: rgba(255, 255, 255, 0.9);
	padding: 8px 16px;
	border-radius: 20px;
	font-size: 0.9rem;
	color: #444;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
	pointer-events: auto;
	backdrop-filter: blur(5px);
}

#zoom-val {
	cursor: pointer;
	font-weight: bold;
	color: #007bff;
}

@keyframes slideDown {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}