/* Base page styles */
body {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	height: 100vh;
	margin: 0;
	background-color: #161616;
	overflow: hidden;
	/* Prevent text selection and touch callouts on mobile */
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	-webkit-touch-callout: none;
}

canvas {
	cursor: grab;
	max-width: 100vw;
	max-height: 100vh;
	/* Prevent image dragging on mobile */
	-webkit-user-drag: none;
	-khtml-user-drag: none;
	-moz-user-drag: none;
	-o-user-drag: none;
	/* Better touch handling */
	touch-action: none;
}

canvas:active {
	cursor: grabbing;
}

/* Control panel styles */
.controls {
	position: absolute;
	top: 20px;
	left: 20px;
	color: white;
	font-family: monospace;
	z-index: 100;
	background-color: rgba(0, 0, 0, 0.8);
	padding: 15px;
	border-radius: 5px;
	max-width: 300px;
}

/* DRY utility classes */
.section-divider {
	margin-top: 20px;
	border-top: 1px solid #555;
	padding-top: 15px;
}

.section-divider-small {
	margin-top: 15px;
	border-top: 1px solid #555;
	padding-top: 15px;
}

.link-primary {
	color: #4a90e2;
	text-decoration: none;
	font-size: 11px;
}

.link-primary:hover {
	text-decoration: underline;
}

.text-small {
	font-size: 11px;
}

.text-tiny {
	font-size: 9px;
}

.flex-col {
	display: flex;
	flex-direction: column;
}

.flex-row {
	display: flex;
	align-items: center;
}

.gap-small {
	gap: 5px;
}

.text-right {
	text-align: right;
}

.controls-title {
	margin-top: 0;
	margin-bottom: 15px;
}

.stats-table {
	width: 100%;
	font-size: 12px;
}

.mb-small {
	margin-bottom: 10px;
}

.icon-size {
	font-size: 14px;
}

.control-group {
	margin-bottom: 15px;
}

.controls label {
	display: block;
	margin-bottom: 5px;
	font-size: 12px;
}

.controls input[type='range'] {
	width: 200px;
}

.controls .value {
	display: inline-block;
	min-width: 60px;
	margin-left: 10px;
}

.controls button {
	background-color: #333;
	color: white;
	border: 1px solid #555;
	padding: 8px 15px;
	cursor: pointer;
	font-family: monospace;
	font-size: 12px;
	margin-top: 5px;
	border-radius: 3px;
	width: 100%;
}

.controls button:hover {
	background-color: #444;
}

.controls button:active {
	background-color: #222;
}

/* Info display */
.info {
	color: rgba(255, 255, 255, 0.7);
	font-family: monospace;
	font-size: 11px;
}

/* Scale indicator */
.scale-indicator {
	position: absolute;
	top: 20px;
	right: 20px;
	color: white;
	font-family: monospace;
	font-size: 11px;
	background-color: rgba(0, 0, 0, 0.8);
	padding: 10px;
	border-radius: 5px;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 15px;
}

.scale-item {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
}

.scale-label {
	font-size: 9px;
	color: rgba(255, 255, 255, 0.6);
	margin-bottom: 2px;
}

.scale-line {
	width: 100px;
	height: 2px;
	background-color: white;
	margin-top: 5px;
	margin-bottom: 3px;
}

/* Mobile menu toggle */
#menuToggleWrapper {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	pointer-events: none;
	z-index: 1001;
	display: none;
}

#menuToggle {
	position: absolute;
	bottom: 20px;
	left: 20px;
	width: 50px;
	height: 50px;
	background-color: rgba(0, 0, 0, 0.7);
	border: 2px solid white;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: auto;
}

#menuToggle span {
	width: 24px;
	height: 2px;
	background-color: white;
	display: block;
	position: relative;
	transition: all 0.3s ease;
}

#menuToggle span::before,
#menuToggle span::after {
	content: '';
	width: 24px;
	height: 2px;
	background-color: white;
	position: absolute;
	left: 0;
	transition: all 0.3s ease;
}

#menuToggle span::before {
	top: -8px;
}

#menuToggle span::after {
	bottom: -8px;
}

#menuToggle.active span {
	background-color: transparent;
}

#menuToggle.active span::before {
	top: 0;
	transform: rotate(45deg);
}

#menuToggle.active span::after {
	bottom: 0;
	transform: rotate(-45deg);
}

/* Show SVG export info only on desktop */
.control-group.desktop-only {
	display: none;
}

@media (min-width: 769px) {
	.control-group.desktop-only {
		display: block;
	}
}

/* Mobile responsive styles */
@media (max-width: 768px) {
	.controls {
		position: fixed;
		top: 0;
		left: -100%;
		width: 80%;
		max-width: 300px;
		height: 100vh;
		max-height: 100vh;
		overflow-y: auto;
		border-radius: 0;
		transition: left 0.3s ease;
		z-index: 999;
	}

	.controls.open {
		left: 0;
	}

	#menuToggleWrapper {
		display: block;
	}

	.scale-indicator {
		top: 10px;
		right: 10px;
		font-size: 10px;
		padding: 8px;
	}

	.scale-line {
		width: 80px;
	}

	.info {
		bottom: 10px;
		right: 10px;
		font-size: 9px;
	}
}
