body {
	margin: 0;
	overflow: hidden;
	background-color: #050505;
	font-family: 'Segoe UI', sans-serif;
	color: white;
	touch-action: none;
	-webkit-user-select: none;
	user-select: none;
}

#canvas-container {
	width: 100vw;
	height: 100vh;
	position: absolute;
	z-index: 1;
}

/* UI PANEL */
#control-panel {
	position: absolute;
	top: 20px;
	left: 20px;
	width: 280px;
	background: rgba(10, 10, 10, 0.85);
	border: 1px solid #444;
	padding: 20px;
	border-radius: 12px;
	z-index: 100;
	backdrop-filter: blur(8px);
	transition: transform 0.3s ease-out;
}

h3 {
	margin: 0 0 15px 0;
	color: #ff0055;
	font-size: 16px;
	text-transform: uppercase;
	border-bottom: 1px solid #444;
	padding-bottom: 10px;
}

/* Tab Navigation */
.tab-navigation {
	display: flex;
	gap: 8px;
	margin-bottom: 15px;
	position: relative;
	z-index: 10;
	pointer-events: auto;
}

.tab-btn {
	flex: 1;
	background: rgba(255, 255, 255, 0.05);
	color: #aaa;
	border: 1px solid #444;
	padding: 8px 12px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	transition: all 0.2s ease;
	-webkit-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	position: relative;
	z-index: 11;
	pointer-events: auto;
}

.tab-btn:hover {
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
}

.tab-btn.active {
	background: #ff0055 !important;
	color: #fff !important;
	border-color: #ff0055 !important;
}

/* Tab Content */
.tab-content {
	display: none !important;
}

.tab-content.active {
	display: block !important;
}

.control-group {
	margin-bottom: 12px;
}

label {
	display: block;
	font-size: 11px;
	color: #ccc;
	margin-bottom: 4px;
}

input[type="text"],
input[type="file"] {
	width: 100%;
	box-sizing: border-box;
	background: #222;
	border: 1px solid #555;
	color: #fff;
	padding: 6px;
	border-radius: 4px;
	font-size: 11px;
}

input[type="color"] {
	width: 100%;
	height: 40px;
	box-sizing: border-box;
	background: #222;
	border: 1px solid #555;
	border-radius: 4px;
	cursor: pointer;
	padding: 2px;
}

input[type="range"] {
	width: 100%;
	cursor: pointer;
	accent-color: #ff0055;
	margin: 0;
}

.btn {
	background: #ff0055;
	color: #fff;
	border: none;
	padding: 10px;
	border-radius: 4px;
	cursor: pointer;
	font-weight: bold;
	width: 100%;
	font-size: 12px;
	transition: 0.2s;
	text-transform: uppercase;
}

.btn:hover {
	background: #fff;
	color: #ff0055;
}

.btn-secondary {
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	border: 1px solid #555;
	padding: 10px;
	border-radius: 4px;
	cursor: pointer;
	font-weight: 600;
	width: 100%;
	font-size: 11px;
	transition: 0.2s;
	text-transform: uppercase;
}

.btn-secondary:hover {
	background: rgba(255, 255, 255, 0.15);
	border-color: #ff0055;
}

.status {
	font-size: 11px;
	color: #aaa;
	margin-top: 10px;
	text-align: right;
	font-style: italic;
}

/* WEBCAM */
#video-container {
	position: absolute;
	bottom: 20px;
	right: 20px;
	width: 160px;
	height: 120px;
	z-index: 10;
	border: 2px solid #555;
	border-radius: 8px;
	overflow: hidden;
	background: #000;
	transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

#input-video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transform: scaleX(-1);
}

/* Toggle button for mobile */
.toggle-btn {
	position: absolute;
	background: rgba(255, 0, 85, 0.9);
	color: white;
	border: none;
	border-radius: 50%;
	width: 50px;
	height: 50px;
	font-size: 24px;
	cursor: pointer;
	z-index: 150;
	display: none;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
	transition: all 0.3s ease;
}

.toggle-btn:active {
	transform: scale(0.95);
}

.toggle-btn.hidden {
	opacity: 0;
	pointer-events: none;
	transform: scale(0);
}

#camera-toggle {
	top: 20px;
	right: 20px;
}

/* Drag handle for panel */
.drag-handle {
	display: none;
	width: 40px;
	height: 4px;
	background: rgba(255, 255, 255, 0.3);
	border-radius: 2px;
	margin: -10px auto 15px;
	cursor: grab;
}

.drag-handle:active {
	cursor: grabbing;
}

/* MOBILE RESPONSIVE */
@media (max-width: 768px) {

	/* Control Panel - Bottom Sheet Style */
	#control-panel {
		position: fixed;
		top: auto;
		bottom: 0;
		left: 0;
		right: 0;
		width: 100%;
		max-width: 100vw;
		max-height: 70vh;
		border-radius: 20px 20px 0 0;
		border: none;
		border-top: 2px solid #ff0055;
		background: rgba(10, 10, 10, 0.95);
		backdrop-filter: blur(12px);
		padding: 15px 15px 20px;
		transform: translateY(calc(100% - 60px));
		overflow-y: auto;
		overflow-x: hidden;
		box-sizing: border-box;
		box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
	}

	#control-panel.expanded {
		transform: translateY(0);
	}

	.drag-handle {
		display: block;
	}

	h3 {
		font-size: 14px;
		margin-bottom: 12px;
		padding-bottom: 8px;
	}

	/* Camera - Top Right Corner */
	#video-container {
		position: fixed;
		top: 20px;
		right: 20px;
		bottom: auto;
		left: auto;
		width: 100px;
		height: 75px;
		border-radius: 12px;
		border: 2px solid #ff0055;
		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
	}

	#video-container.hidden {
		transform: scale(0);
		opacity: 0;
		pointer-events: none;
	}

	/* Show toggle buttons on mobile */
	.toggle-btn {
		display: flex;
	}

	/* Adjust controls for mobile */
	.control-group {
		margin-bottom: 15px;
		width: 100%;
		box-sizing: border-box;
	}

	label {
		font-size: 12px;
		margin-bottom: 6px;
	}

	input[type="text"],
	input[type="file"] {
		padding: 10px;
		font-size: 14px;
		border-radius: 8px;
		width: 100%;
		box-sizing: border-box;
	}

	input[type="range"] {
		height: 30px;
		width: 100%;
		box-sizing: border-box;
		margin: 0;
		padding: 0;
	}

	.btn {
		padding: 12px;
		font-size: 14px;
		border-radius: 8px;
		width: 100%;
		box-sizing: border-box;
	}

	.status {
		font-size: 12px;
		text-align: center;
	}
}

/* Extra small devices */
@media (max-width: 480px) {
	#control-panel {
		max-height: 75vh;
		padding: 12px 15px 15px;
	}

	#video-container {
		width: 80px;
		height: 60px;
		top: 15px;
		right: 15px;
	}

	.toggle-btn {
		width: 45px;
		height: 45px;
		font-size: 20px;
	}

	#camera-toggle {
		top: 15px;
		right: 15px;
	}
}