body {
	background: #121212;
	color: #e0e0e0;
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	width: 100%;
	padding: 20px;
}

.editor-topbar {
	width: min(1480px, calc(100vw - 40px));
	min-height: 44px;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 12px;
	margin-bottom: 10px;
	padding: 6px 8px;
	box-sizing: border-box;
	background: rgba(7, 10, 15, 0.88);
	border: 1px solid rgba(255, 255, 255, 0.10);
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.30);
}

.editor-topbar-left,
.editor-topbar-right {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.editor-topbar-right {
	justify-content: flex-end;
}

.editor-topbar-center {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 320px;
}

.editor-topbar-center label {
	font-size: 12px;
	color: rgba(255, 255, 255, 0.72);
}

#modeloTopbarSelect {
	min-width: 230px;
	height: 34px;
	background-color: #10161c;
	color: rgba(255, 255, 255, 0.92);
	border-color: rgba(255, 255, 255, 0.14);
}

#modeloTopbarSelect option {
	background: #10161c;
	color: rgba(255, 255, 255, 0.92);
}

.editor-topbar-btn {
	min-height: 34px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 12px;
	border-radius: 7px;
	background: #242424;
	color: rgba(255, 255, 255, 0.9);
	border: 1px solid #444;
	text-decoration: none;
	cursor: pointer;
	font-size: 13px;
	white-space: nowrap;
}

.editor-topbar-btn:hover {
	background: #333;
}

.editor-topbar-btn.danger {
	border-color: rgba(255, 96, 96, 0.32);
	color: rgba(255, 200, 200, 0.96);
}

.editor-menu {
	position: relative;
}

.editor-menu-dropdown {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	z-index: 1200;
	min-width: 180px;
	padding: 6px;
	background: rgba(7, 10, 15, 0.97);
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 8px;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.48);
}

.editor-menu-item {
	display: block;
	padding: 9px 10px;
	border-radius: 6px;
	color: rgba(255, 255, 255, 0.9);
	text-decoration: none;
	font-size: 13px;
}

.editor-menu-item:hover {
	background: rgba(255, 255, 255, 0.10);
}

.panel {
	background: #1e1e1e;
	padding: 15px;
	border-radius: 8px;
	margin-bottom: 10px;
	display: flex;
	gap: 10px;
	align-items: center;
	border: 1px solid #333;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.stack-container {
	position: relative;
	width: 100%;
	max-width: 900px;
	aspect-ratio: 1 / 1;
	border: 2px solid #444;
	background: #000;
	box-sizing: border-box;
}

@keyframes blink {
	0% { opacity: 1; }
	50% { opacity: 0.3; }
	100% { opacity: 1; }
}

#saveIndicator {
	animation: blink 1s infinite;
}

#bg-image {
	position: absolute;
	width: 100%;
	height: 100%;
	object-fit: cover;
	image-rendering: high-quality;
	z-index: 1;
}

.grid {
	display: grid;
	grid-template-columns: repeat(10, 1fr);
	grid-template-rows: repeat(10, 1fr);
	position: absolute;
	width: 100%;
	height: 100%;
	z-index: 2;
}

.tile {
	border: 1px solid rgba(255, 255, 255, 0.05);
	cursor: crosshair;
}

.tile:hover {
	background: rgba(255, 255, 255, 0.1);
}

.tile.passage {
	background: rgba(0, 255, 255, 0.6);
	border: 1px solid #00ffff;
	box-shadow: inset 0 0 10px #00ffff;
}

select, button {
	padding: 6px 8px;
	border-radius: 4px;
	background: #2d2d2d;
	color: white;
	border: 1px solid #444;
	cursor: pointer;
	font-size: 12px;
}

button:hover {
	background: #3d3d3d;
}

/* Animação do brilho neon */
@keyframes neonPulse {
	0% { box-shadow: 0 0 5px rgba(0, 255, 255, 0.2); border-color: #333; }
	50% { box-shadow: 0 0 15px rgba(0, 255, 255, 0.6); border-color: #00ffff; }
	100% { box-shadow: 0 0 5px rgba(0, 255, 255, 0.2); border-color: #333; }
}

/* Container de cada item na lista */
.item-container-neon {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	margin-bottom: 15px;
	padding: 5px;
	transition: transform 0.2s;
}

.item-container-neon:hover {
	transform: scale(1.05); /* Leve aumento ao passar o mouse */
}

/* A imagem com o efeito */
.img-neon {
	width: 80px;
	height: 80px;
	object-fit: contain;
	border: 1px solid #444;
	cursor: grab;
	image-rendering: pixelated;
	background: #000;
	border-radius: 4px;
	/* Aplica a animação */
	animation: neonPulse 10s infinite ease-in-out;
}

@keyframes neonPulse {
	0% {
		box-shadow: 0 0 2px rgba(0, 255, 255, 0.2);
		border-color: #444;
	}
	50% {
		box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
		border-color: #00ffff;
	}
	100% {
		box-shadow: 0 0 2px rgba(0, 255, 255, 0.2);
		border-color: #444;
	}
}

@keyframes neonPulseBorda {
	0% {
		border-color: #333;
		box-shadow: 0 0 2px rgba(0, 255, 255, 0.2);
	}
	50% {
		border-color: #00ffff;
		/* Brilho interno e externo combinados */
		box-shadow: 0 0 8px rgba(0, 255, 255, 0.6), inset 0 0 4px rgba(0, 255, 255, 0.3);
	}
	100% {
		border-color: #333;
		box-shadow: 0 0 2px rgba(0, 255, 255, 0.2);
	}
}

#listaItens img.item-excluir-ativo {
	border: 2px solid rgba(255, 230, 80, 0.95) !important;
	box-shadow:
			0 0 6px rgba(255, 230, 80, 0.9),
			0 0 14px rgba(255, 230, 80, 0.75),
			0 0 24px rgba(255, 230, 80, 0.55) !important;
	filter: none !important;
	opacity: 1 !important;
	cursor: pointer !important;
	position: relative;
	z-index: 2;
}

#listaItens img.item-excluir-ativo:hover {
	border-color: rgba(255, 70, 70, 0.95) !important;
	box-shadow:
			0 0 6px rgba(255, 70, 70, 0.95),
			0 0 14px rgba(255, 70, 70, 0.8),
			0 0 26px rgba(255, 70, 70, 0.6) !important;
	filter: none !important;
}
.editor-layout {
	display: grid;
	grid-template-columns: 260px minmax(500px, 900px) 320px;
	gap: 16px;
	align-items: start;
	width: 100%;
	max-width: 1700px;
}
.left-panel {
	width: 260px;
}

.right-panel {
	width: 320px;
}

.side-panel {
	flex-direction: column;
	align-items: stretch;
	gap: 10px;
	min-width: 0;
	width: 100%;
}

.center-panel {
	justify-content: center;
	align-items: center;
	padding: 20px 18px 10px 22px;
}
#editorStack {
	position: relative;
	width: 100%;
	max-width: 900px;
	aspect-ratio: 1 / 1;
	box-sizing: border-box;
}

#camadasOverlay {
	position: absolute;
	inset: 0;
	z-index: 30;
	pointer-events: none;
}
.camada-resize-handle {
	position: absolute;
	right: -6px;
	bottom: -6px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #00e5ff;
	border: 2px solid #06232a;
	box-shadow: 0 0 8px rgba(0, 229, 255, 0.9);
	cursor: nwse-resize;
	pointer-events: auto;
	z-index: 5;
}

@media (max-width: 1400px) {
	.editor-layout {
		grid-template-columns: 300px minmax(420px, 1fr) 300px;
	}
}

@media (max-width: 1100px) {
	.editor-layout {
		grid-template-columns: 1fr;
	}

	#editorStack {
		width: 100%;
		max-width: 900px;
	}
}

#grid .tile.snap-preview {
	background: rgba(0, 229, 255, 0.18) !important;
	border: 1px solid rgba(0, 229, 255, 0.95) !important;
	box-shadow:
			inset 0 0 10px rgba(0, 229, 255, 0.75),
			0 0 10px rgba(0, 229, 255, 0.55),
			0 0 18px rgba(0, 229, 255, 0.35) !important;
}

#gridLabelsTop,
#gridLabelsLeft {
	position: absolute;
	pointer-events: none;
	z-index: 40;
	color: rgba(255,255,255,0.55);
	font-size: 10px;
	font-weight: 600;
	text-shadow: 0 0 4px rgba(0,0,0,0.8);
}

#gridLabelsTop {
	top: -14px;
	left: 0;
	width: 100%;
	height: 12px;
}

#gridLabelsLeft {
	top: 0;
	left: -14px;
	width: 12px;
	height: 100%;
}

#backgroundDropZone.drag-over {
	border-color: #00e5ff !important;
	box-shadow:
			0 0 8px rgba(0, 229, 255, 0.85),
			0 0 18px rgba(0, 229, 255, 0.75),
			0 0 30px rgba(0, 229, 255, 0.55),
			inset 0 0 12px rgba(0, 229, 255, 0.25);
	background: rgba(0, 229, 255, 0.08) !important;
	outline: 2px solid rgba(0, 229, 255, 0.95);
	outline-offset: 2px;
}

#backgroundDropZone.bg-excluir-ativo {
	border: 2px solid rgba(255, 230, 80, 0.95) !important;
	box-shadow:
			0 0 6px rgba(255, 230, 80, 0.9),
			0 0 14px rgba(255, 230, 80, 0.75),
			0 0 24px rgba(255, 230, 80, 0.55) !important;
	cursor: pointer !important;
}

#backgroundDropZone.bg-excluir-ativo:hover {
	border-color: rgba(255, 70, 70, 0.95) !important;
	box-shadow:
			0 0 6px rgba(255, 70, 70, 0.95),
			0 0 14px rgba(255, 70, 70, 0.8),
			0 0 26px rgba(255, 70, 70, 0.6) !important;
}

/* ================= UPLOAD OVERLAY ================= */
#uploadOverlay {
	display: none; /* estado inicial */
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.72);
	backdrop-filter: blur(3px);
	z-index: 10050;

	align-items: center;
	justify-content: center;
}

/* quando ativo */
#uploadOverlay.active {
	display: flex;
}

/* Caixa central */
#uploadOverlay .upload-box {
	min-width: 320px;
	max-width: 420px;
	background: #111;
	border: 1px solid #00e5ff;
	border-radius: 14px;
	padding: 22px 20px;
	box-shadow: 0 0 24px rgba(0, 229, 255, 0.35);
	text-align: center;
}

/* Título */
.upload-title {
	font-size: 22px;
	margin-bottom: 10px;
	color: #00e5ff;
	text-shadow: 0 0 10px rgba(0, 229, 255, 0.35);
}

/* Texto principal */
.upload-text {
	font-size: 14px;
	color: #d7faff;
	line-height: 1.5;
	opacity: 0.95;
}

/* Texto secundário */
.upload-hint {
	margin-top: 16px;
	font-size: 12px;
	color: #8ec9d6;
	opacity: 0.8;
}
/* ================= MODAIS PADRÃO ================= */

.modal-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.7);
	z-index: 9999;

	align-items: center;
	justify-content: center;
}

.modal-overlay.active {
	display: flex;
}

.modal-box {
	background: #1e1e1e;
	padding: 20px;
	border-radius: 8px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-width: 300px;
	border: 1px solid #333;
}

.modal-box.modal-danger {
	border: 1px solid #c62828;
}

.modal-title {
	margin: 0;
}

.modal-title.danger {
	color: #c62828;
}

.modal-label {
	font-size: 12px;
	opacity: 0.7;
}

.modal-select {
	width: 100%;
	padding: 8px;
	background: #2d2d2d;
	color: white;
	border: 1px solid #444;
}

.modal-warning {
	background: #331111;
	padding: 10px;
	border-radius: 4px;
	font-size: 11px;
	color: #ff8a80;
	border-left: 4px solid #c62828;
}

.modal-actions {
	display: flex;
	gap: 10px;
	margin-top: 5px;
}

.btn-danger {
	background: #c62828;
	flex: 1;
	padding: 10px;
	border: none;
	color: white;
	cursor: pointer;
	border-radius: 4px;
}

.btn-default {
	flex: 1;
	padding: 10px;
	border: 1px solid #444;
	background: #2d2d2d;
	color: white;
	cursor: pointer;
	border-radius: 4px;
}

.editor-exit-btn {
	text-decoration: none;
	background: #c62828;
	color: white;
	padding: 8px;
	border-radius: 4px;
	text-align: center;
	display: block;
	margin-bottom: 8px;
}

.editor-title {
	margin: 2px 0 4px 0;
	font-size: 18px;
	line-height: 1.15;
	letter-spacing: 0.2px;
	white-space: normal;
	word-break: break-word;
	overflow-wrap: anywhere;
	max-width: 100%;
}

.editor-model-name {
	font-weight: bold;
	color: #4caf50;
	text-align: center;
	font-size: 13px;
	line-height: 1.2;
	margin-bottom: 6px;
	word-break: break-word;
	overflow-wrap: anywhere;
}
.itens-header {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
}

.itens-title-center {
	font-size: 18px;
	opacity: 0.78;
	letter-spacing: 1px;
	margin: 0;
	text-align: center;
	width: 100%;
}

.itens-preview-row {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	gap: 12px;
	width: 100%;
}

.editor-preview-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
}

.editor-preview-box {
	width: 88px;
	height: 88px;
	border: 1px dashed #666;
	border-radius: 6px;
	background: #111;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	position: relative;
	box-shadow: inset 0 0 8px rgba(0,0,0,0.35);
}

.editor-preview-box img {
	display: none;
	width: 100%;
	height: 100%;
	object-fit: cover;
	image-rendering: pixelated;
}

.editor-preview-label {
	font-size: 10px;
	color: #888;
	text-align: center;
	letter-spacing: 0.4px;
}

#celulaThumbZone {
	border-style: solid;
	border-color: #3a3a3a;
}

#celulaThumbZone.tem-thumb {
	border-color: #00e5ff66;
	box-shadow:
			inset 0 0 8px rgba(0,0,0,0.35),
			0 0 10px rgba(0,229,255,0.12);
}

#celulaThumbHint,
#backgroundDropHint {
	font-size: 16px;
	color: #666;
	pointer-events: none;
	user-select: none;
}

.editor-preview-box-bg {
	cursor: pointer;
}
