/* RESET */
* {
  box-sizing: border-box;
}

/* BASE */
body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: radial-gradient(circle at top, #111827, #05060a);
  color: white;
  overflow-x: hidden;
}

/* LAYOUT */
.app {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 40px 20px;
}

/* PANEL */
.panel {
  width: 100%;
  max-width: 480px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 28px;
  border-radius: 18px;
  backdrop-filter: blur(16px);
  box-shadow: 0 30px 80px rgba(0,0,0,0.65);
  transition: 0.3s;
}

.panel:hover {
  transform: translateY(-2px);
}

/* TITLES */
h1 {
  font-size: 20px;
  margin: 0;
  letter-spacing: 0.3px;
}

h1 span {
  color: #4ade80;
}

.subtitle {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 6px;
  margin-bottom: 18px;
}

/* DROPZONE */
.dropzone {
  border: 1px dashed rgba(255,255,255,0.25);
  padding: 24px;
  text-align: center;
  border-radius: 14px;
  cursor: pointer;
  transition: 0.25s;
  background: rgba(255,255,255,0.02);
}

.dropzone:hover {
  border-color: #4ade80;
  background: rgba(74,222,128,0.05);
  transform: scale(1.01);
}

/* PREVIEW GRID (IMPORTANTE PRA BATCH) */
.preview {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}

.preview img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
}

/* SELECT */
select {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: #111827;
  color: white;
  outline: none;
}

/* BUTTON */
button {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(90deg, #22c55e, #16a34a);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 10px 25px rgba(34,197,94,0.25);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(34,197,94,0.35);
}

button:active {
  transform: scale(0.97);
}

/* LOADER */
.loader {
  display: none;
  margin-top: 10px;
  font-size: 12px;
  opacity: 0.8;
  color: #facc15;
}

/* PROGRESS */
.progress {
  margin-top: 10px;
  font-size: 12px;
  opacity: 0.8;
  color: #93c5fd;
}

/* EDITOR */
.editor {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.editor h3 {
  font-size: 13px;
  opacity: 0.85;
  margin-bottom: 10px;
}

/* CANVAS WRAPPER (CRÍTICO) */
.canvas-wrapper {
  position: relative;
  width: 100%;
  height: 280px;
  border-radius: 12px;
  overflow: hidden;
  background: #0f172a;
  border: 1px solid rgba(255,255,255,0.08);
}

/* CANVAS */
canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* EMPTY STATE */
.empty-canvas {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  opacity: 0.5;
  pointer-events: none;
}

/* TOOLS */
.tools {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.tools button {
  flex: 1;
  background: rgba(255,255,255,0.08);
  box-shadow: none;
  border: 1px solid rgba(255,255,255,0.1);
}

.tools button:hover {
  background: rgba(255,255,255,0.12);
  transform: translateY(-1px);
}

/* RESPONSIVO */
@media (max-width: 480px) {
  .panel {
    padding: 20px;
  }

  .canvas-wrapper {
    height: 220px;
  }
}