:root {
	--plate-color: #c6ccd1;
	--plate-face-color: #e2e6e9;
	--plate-metalness: 0.86;
	--plate-roughness: 0.24;
	--plate-clearcoat: 0.45;
	--plate-env-intensity: 1.35;

	/* Front text controls */
	--front-font-family: Orbitron;
	--front-font-weight: 700;
	--front-font-size: 124;
	--front-text-color: #111111;
	--front-text-x: 50;
	--front-text-y: 50;

	/* Back text controls */
	--back-font-family: Cinzel;
	--back-font-weight: 600;
	--back-font-size: 98;
	--back-text-color: #1a1a1a;
	--back-text-x: 50;
	--back-text-y: 50;
}

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	background: radial-gradient(circle at 30% 20%, #111 0%, #000 55%);
	font-family: "Rajdhani", sans-serif;
}

#app {
	width: 100%;
	height: 100%;
}

#panel {
	position: fixed;
	top: 16px;
	right: 16px;
	bottom: 96px;
	width: 320px;
	max-height: none;
	overflow: auto;
	padding: 14px;
	border: 1px solid #3c3c3c;
	background: rgba(8, 8, 8, 0.85);
	backdrop-filter: blur(8px);
	color: #f2f2f2;
	border-radius: 12px;
	z-index: 5;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

#panel h1 {
	margin: 0 0 10px;
	font-size: 1.2rem;
	font-family: "Orbitron", sans-serif;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

#panel h2 {
	margin: 8px 0 6px;
	font-size: 0.95rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #cbcbcb;
}

#panel h3 {
	margin: 0 0 6px;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #bcbcbc;
}

.side-section {
	margin-bottom: 12px;
	padding: 10px;
	border: 1px solid #303030;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.01);
}

#panel label {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 6px 10px;
	font-size: 0.92rem;
	margin-bottom: 8px;
}

#panel input,
#panel select {
	grid-column: 1 / -1;
	width: 100%;
	height: 34px;
	border-radius: 8px;
	border: 1px solid #444;
	background: #171717;
	color: #f2f2f2;
	padding: 0 10px;
	font-family: "Rajdhani", sans-serif;
	font-size: 1rem;
}

#panel input[type="range"] {
	padding: 0;
	height: 28px;
	accent-color: #e2e2e2;
}

#panel output {
	font-size: 0.85rem;
	color: #b8b8b8;
	font-family: "Orbitron", sans-serif;
	letter-spacing: 0.03em;
}

.margin-grid {
	padding: 8px;
	border-radius: 10px;
	border: 1px solid #353535;
	background: rgba(255, 255, 255, 0.02);
}

canvas {
	display: block;
	width: 100%;
	height: 100%;
	touch-action: none;
}

/* Toggle switch */
.toggle-label {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 0.92rem;
	margin-bottom: 8px;
	cursor: default;
}

.toggle {
	position: relative;
	display: inline-block;
	width: 46px;
	height: 26px;
	flex-shrink: 0;
}

.toggle input {
	opacity: 0;
	width: 0;
	height: 0;
}

.toggle-slider {
	position: absolute;
	inset: 0;
	background: #333;
	border-radius: 26px;
	cursor: pointer;
	transition: background 0.2s;
}

.toggle-slider::before {
	content: "";
	position: absolute;
	height: 20px;
	width: 20px;
	left: 3px;
	bottom: 3px;
	background: #ccc;
	border-radius: 50%;
	transition: transform 0.2s, background 0.2s;
}

.toggle input:checked + .toggle-slider {
	background: #4a9eff;
}

.toggle input:checked + .toggle-slider::before {
	transform: translateX(20px);
	background: #fff;
}

/* Bottom export bar */
#exportBar {
	position: fixed;
	left: 16px;
	right: 16px;
	bottom: 16px;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	padding: 8px;
	border: 1px solid #3c3c3c;
	border-radius: 12px;
	background: rgba(8, 8, 8, 0.82);
	backdrop-filter: blur(8px);
	z-index: 6;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

.export-btn {
	padding: 8px 10px;
	border-radius: 8px;
	border: 1px solid #444;
	background: #181818;
	color: #ddd;
	font-family: "Rajdhani", sans-serif;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	text-align: center;
	transition: background 0.15s, border-color 0.15s;
}

.export-btn:hover {
	background: #242424;
	border-color: #666;
	color: #fff;
}

.export-btn:active {
	background: #2c2c2c;
}

@media (max-width: 900px) {
	#panel {
		left: 12px;
		right: 12px;
		bottom: 84px;
		top: auto;
		width: auto;
		max-height: min(45vh, calc(100vh - 150px));
	}

	#exportBar {
		left: 10px;
		right: 10px;
		bottom: 10px;
		padding: 7px;
		gap: 6px;
	}

	#exportBar .export-btn {
		font-size: 0.82rem;
		padding: 7px 8px;
	}
}
