/* Reset */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

/* Main screen */
html,
body {
	width: 100%;
	height: 100%;
	overflow: hidden;
	background: #111;
	font-family: Arial, sans-serif;
}

#screen {
	position: relative;
	width: 100%;
	height: 100%;
	overflow: hidden;
	background: #111;
}

/* Webcam background */
#camera {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: 0;
	transform: scaleX(-1);
}

/* Grid overlay */
#grid {
	--grid-size: 50px;

	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;

	background-image:
			repeating-linear-gradient(
				to right,
				rgba(255, 255, 255, 0.15) 0 1px,
				transparent 1px var(--grid-size)
			),
			repeating-linear-gradient(
				to bottom,
				rgba(255, 255, 255, 0.15) 0 1px,
				transparent 1px var(--grid-size)
			);

	background-size:
		var(--grid-size) 100%,
		100% var(--grid-size);

	background-position:
		50% 0,
		0 50%;
}

/* Horizontal and vertical rulers */
#ruler-horizontal,
#ruler-vertical {
	position: absolute;
	background: rgba(255, 255, 255, 0.08);
}

#ruler-horizontal {
	top: 0;
	left: 0;
	width: 100%;
	height: 20px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.35);

	background-image:
		repeating-linear-gradient(
			to right,
			rgba(255, 255, 255, 0.7) 0,
			rgba(255, 255, 255, 0.7) 1px,
			transparent 1px,
			transparent 10px
		);
}

#ruler-vertical {
	top: 0;
	left: 0;
	width: 20px;
	height: 100%;
	border-right: 1px solid rgba(255, 255, 255, 0.35);

	background-image:
		repeating-linear-gradient(
			to bottom,
			rgba(255, 255, 255, 0.7) 0,
			rgba(255, 255, 255, 0.7) 1px,
			transparent 1px,
			transparent 10px
		);
}

/* Center lines */
#center-horizontal,
#center-vertical {
	position: absolute;
	background: rgba(220, 220, 220, 0.75);

}

#center-horizontal {
	top: 50%;
	left: 0;
	width: 100%;
	height: 1px;
}

#center-vertical {
	top: 0;
	left: 50%;
	width: 1px;
	height: 100%;
}

/* Center marker */
#center-marker {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 12px;
	height: 12px;
	border: 1px solid white;
	border-radius: 50%;
	transform: translate(-50%, -50%);
}

/* Camera controls */
#controls {
	position: absolute;
	top: 32px;
	right: 32px;
	z-index: 2;
}

#camera-toggle {
	padding: 10px 16px;
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 4px;
	background: rgba(20, 20, 20, 0.85);
	color: white;
	font-size: 14px;
	cursor: pointer;
}

#camera-toggle:hover {
	background: rgba(60, 60, 60, 0.95);
}
