* { box-sizing: border-box; margin: 0; padding: 0; }

body { 
  font-family: 'Segoe UI', sans-serif; 
  background-color: #0c1014; 
  color: #ecfdf5; 
  height: 100vh;
  overflow: hidden;
}

canvas { 
  background-color: #ffffff; 
  border-radius: 1rem; 
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); 
  width: 100%;
  height: auto;
  max-width: min(70vh, 700px);
  aspect-ratio: 1/1;
}

.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

.left-panel {
  width: 380px;
  min-width: 300px;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: #1a4d3a;
  border-right: 1px solid #2d6a4f;
  scrollbar-width: thin;
  scrollbar-color: #40916c #1a4d3a;
}

.left-panel::-webkit-scrollbar { width: 8px; }
.left-panel::-webkit-scrollbar-track { background: #1a4d3a; }
.left-panel::-webkit-scrollbar-thumb { background: #40916c; border-radius: 4px; }

.right-panel {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #0c1014;
  padding: 20px;
  overflow: auto;
  position: relative;
}

.canvas-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  position: relative;
}

/* AVATAR/LOGO EN LUGAR DEL BOTÓN VIP */
.logo-avatar {
  position: fixed;
  top: 10px;
  right: 10px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #ac925a;
  box-shadow: 0 4px 15px rgba(172, 146, 90, 0.4);
  z-index: 100;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #0c1014;
}

.logo-avatar:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(172, 146, 90, 0.6);
  border-color: #d4af37;
}

.logo-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* BOTONES DE POSICIÓN FIJOS EN EL CANVAS */
.position-btn-canvas {
  position: absolute;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 11px;
  cursor: pointer;
  z-index: 20;
  border: 3px solid;
  background: rgba(0,0,0,0.8);
  transition: all 0.2s;
  user-select: none;
}

.position-btn-canvas:hover {
  transform: scale(1.1);
  box-shadow: 0 0 20px currentColor;
}

.position-btn-canvas.active {
  background: rgba(64, 145, 108, 0.4);
  box-shadow: 0 0 30px currentColor;
  transform: scale(1.15);
}

/* Posiciones correctas: IZQ=180°, DER=0°, ABJ=270° */
.position-btn-canvas.izquierda { 
  left: 50%; 
  top: 50%; 
  margin-left: -150px;
  margin-top: -25px;
  border-color: #ef4444; 
  color: #ef4444; 
}

.position-btn-canvas.derecha { 
  left: 50%; 
  top: 50%; 
  margin-left: 100px;
  margin-top: -25px;
  border-color: #22c55e; 
  color: #22c55e; 
}

.position-btn-canvas.abajo { 
  left: 50%; 
  top: 50%; 
  margin-left: -25px;
  margin-top: 100px;
  border-color: #3b82f6; 
  color: #3b82f6; 
}

.position-btn-canvas.izquierda:hover,
.position-btn-canvas.izquierda.active { background: rgba(239, 68, 68, 0.3); }

.position-btn-canvas.derecha:hover,
.position-btn-canvas.derecha.active { background: rgba(34, 197, 94, 0.3); }

.position-btn-canvas.abajo:hover,
.position-btn-canvas.abajo.active { background: rgba(59, 130, 246, 0.3); }

.position-btn-canvas.drag-over {
  animation: pulse-border 0.5s infinite;
}

@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 20px currentColor; }
  50% { box-shadow: 0 0 40px currentColor, 0 0 60px currentColor; }
}

@media (max-width: 768px) {
  .position-btn-canvas.izquierda { margin-left: -100px; }
  .position-btn-canvas.derecha { margin-left: 50px; }
  .position-btn-canvas.abajo { margin-top: 50px; }
}

@media (max-width: 1024px) {
  .left-panel { width: 320px; }
}

@media (max-width: 768px) {
  .app-container { flex-direction: column; }
  .left-panel { width: 100%; height: 50vh; min-height: 400px; border-right: none; border-bottom: 1px solid #2d6a4f; }
  .right-panel { height: 50vh; padding: 10px; }
  canvas { max-width: min(45vh, 500px); }
}

@media (max-width: 480px) {
  .left-panel { min-height: 350px; }
  .right-panel { padding: 5px; }
  .logo-avatar { width: 40px; height: 40px; top: 5px; right: 5px; }
}

.iconBtn {
  background: white;
  border: 2px solid #2d6a4f;
  border-radius: 10px;
  cursor: grab;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  padding: 6px;
  margin: 0 auto;
  overflow: hidden;
  user-select: none;
}

@media (max-width: 768px) {
  .iconBtn { width: 70px; height: 70px; }
}

@media (max-width: 480px) {
  .iconBtn { width: 60px; height: 60px; }
}

.iconBtn[draggable="true"] { -webkit-user-drag: element; }
.iconBtn:hover { border-color: #40916c; transform: scale(1.05); box-shadow: 0 8px 16px rgba(64, 145, 108, 0.3); background: #f8fafc; }
.iconBtn.dragging { opacity: 0.5; transform: scale(0.95); border-color: #40916c; }
.iconBtn img, .iconBtn svg { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }

#iconGrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  justify-items: center;
  align-items: center;
  padding: 10px;
}

.preview-container {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 10px 0;
  padding: 10px;
  background: #0c1014;
  border-radius: 10px;
  flex-wrap: wrap;
}

.preview-item {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
  padding: 5px;
  border-radius: 8px;
  width: 80px;
  position: relative;
}

@media (max-width: 480px) {
  .preview-item { width: 70px; }
}

.preview-item:hover { background: #1a4d3a; }
.preview-item.selected { background: #40916c30; border: 1px solid #40916c; }

.preview-icon {
  width: 60px;
  height: 60px;
  background: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 5px auto;
  padding: 5px;
  border: 2px solid #2d6a4f;
  overflow: hidden;
  transition: all 0.2s;
  position: relative;
}

@media (max-width: 480px) {
  .preview-icon { width: 50px; height: 50px; }
}

.preview-icon .delete-x {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  background: #ef4444;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 10;
}

.preview-icon:hover .delete-x,
.preview-icon.has-content .delete-x {
  opacity: 1;
}

.preview-icon .delete-x:hover {
  background: #dc2626;
  transform: scale(1.1);
}

.preview-icon.drop-zone { border-color: #40916c; background: #1a4d3a; box-shadow: 0 0 20px rgba(64, 145, 108, 0.3); }
.preview-icon.occupied { border-color: #10b981; background: #064e3b20; }
.preview-icon img, .preview-icon svg { width: 100%; height: 100%; object-fit: contain; display: block; }

.preview-label { font-size: 10px; font-weight: bold; text-align: center; color: #a7bcb0; }

.count-btn {
  background: #1a4d3a;
  border: 1px solid #2d6a4f;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  color: white;
  flex: 1;
}

.count-btn:hover { background: #40916c; border-color: #52b788; }
.count-btn.active { background: #40916c; border-color: #52b788; box-shadow: 0 0 0 3px rgba(64, 145, 108, 0.5); }

.collapsible-panel {
  background: #1a4d3a;
  border: 1px solid #2d6a4f;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  margin-bottom: 0.75rem;
}

.collapsible-header {
  background: #1a4d3a;
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #2d6a4f;
}

.collapsible-header:hover { background: #2d6a4f; }
.collapsible-header .header-content { display: flex; align-items: center; gap: 8px; }

.collapsible-header .switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  margin-right: 6px;
}

.collapsible-header .switch input { opacity: 0; width: 0; height: 0; }

.collapsible-header .slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #2d6a4f;
  transition: .3s;
  border-radius: 34px;
}

.collapsible-header .slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

.collapsible-header input:checked + .slider { background-color: #40916c; }
.collapsible-header input:checked + .slider:before { transform: translateX(20px); }

.collapsible-header .title {
  font-size: 11px;
  font-weight: bold;
  color: #a7bcb0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.collapsible-header .title.active { color: #52b788; }

.collapsible-header svg {
  width: 14px;
  height: 14px;
  color: #a7bcb0;
  transition: transform 0.3s;
}

.collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: #0c1014;
}

.collapsible-content.open { max-height: 350px; }
.collapsible-content .content-inner { padding: 15px; }

.mirror-text-panel {
  background: #1a4d3a;
  border: 1px solid #2d6a4f;
  border-radius: 12px;
  overflow: hidden;
  margin-top: 0.75rem;
}

.mirror-text-header {
  background: #1a4d3a;
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #2d6a4f;
}

.mirror-text-header:hover { background: #2d6a4f; }

.mirror-text-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: #0c1014;
}

.mirror-text-content.open { max-height: 400px; }

.mirror-toggle { display: flex; align-items: center; gap: 6px; }

.mirror-toggle input[type="checkbox"] {
  width: 36px;
  height: 18px;
  appearance: none;
  background: #2d6a4f;
  border-radius: 20px;
  position: relative;
  cursor: pointer;
}

.mirror-toggle input[type="checkbox"]:checked { background: #40916c; }

.mirror-toggle input[type="checkbox"]::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: 0.3s;
}

.mirror-toggle input[type="checkbox"]:checked::before { left: 20px; }

.observaciones-panel {
  background: #0c1014;
  border: 1px solid #2d6a4f;
  border-radius: 12px;
  overflow: hidden;
}

.observaciones-header {
  background: #1a4d3a;
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.observaciones-header:hover { background: #2d6a4f; }

.observaciones-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: #0c1014;
}

.observaciones-content.open { max-height: 200px; }

.observaciones-textarea {
  width: 100%;
  background: #1a4d3a;
  border: 1px solid #2d6a4f;
  border-radius: 6px;
  padding: 8px;
  color: white;
  font-size: 11px;
  min-height: 60px;
}

.whatsapp-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #25d366;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  z-index: 100;
  text-decoration: none;
  border: 2px solid white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: transform 0.3s;
}

.whatsapp-float:hover { transform: scale(1.1); }
.whatsapp-float svg { width: 28px; height: 28px; }

h1, h2, h3, .main-title { font-family: 'Bebas Neue', cursive; letter-spacing: 1px; }

.position-selector {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  background: #0c1014;
  padding: 6px;
  border-radius: 8px;
  flex-wrap: wrap;
}

.position-btn {
  flex: 1;
  min-width: 70px;
  background: #1a4d3a;
  border: 1px solid #2d6a4f;
  border-radius: 6px;
  padding: 6px;
  color: white;
  font-size: 11px;
  text-align: center;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
}

.position-btn:hover { background: #40916c; }
.position-btn.active { background: #40916c; box-shadow: 0 0 0 2px rgba(64, 145, 108, 0.5); }

.position-btn.izquierda { border-left: 3px solid #ef4444; }
.position-btn.derecha { border-right: 3px solid #22c55e; }
.position-btn.abajo { border-bottom: 3px solid #3b82f6; }

.slider-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.slider-label .label-text { font-size: 9px; color: #a7bcb0; }
.slider-label .value-display { font-size: 9px; font-weight: bold; color: #52b788; }

.knob-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #1a4d3a;
  border: 1px solid #2d6a4f;
  border-radius: 30px;
  padding: 3px 6px;
}

.knob-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #40916c, #1a4d3a);
  border: 2px solid #52b788;
  cursor: grab;
  position: relative;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .knob-circle { width: 28px; height: 28px; }
}

.knob-circle:active { cursor: grabbing; }

.knob-circle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 8px;
  background: white;
  border-radius: 2px;
}

.knob-value-display {
  font-size: 12px;
  font-weight: bold;
  color: #52b788;
  background: #0c1014;
  padding: 3px 6px;
  border-radius: 16px;
  min-width: 45px;
  text-align: center;
  font-family: monospace;
}

.knob-arrow {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #2d6a4f;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  user-select: none;
}

.knob-arrow:hover { background: #40916c; }
.knob-arrow.pressed { background: #40916c; transform: scale(0.95); }
.knob-label-small { font-size: 9px; color: #a7bcb0; margin-bottom: 2px; }

.icon-section-header {
  background: #1a4d3a;
  border: 1px solid #2d6a4f;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.icon-section-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: #0c1014;
}

.icon-section-content.open { max-height: 2000px; }
.icon-section-content .content-inner { padding: 15px; }

.number-input-container {
  display: flex;
  align-items: center;
  background: #0c1014;
  border: 1px solid #2d6a4f;
  border-radius: 6px;
  overflow: hidden;
}

.number-input-container input {
  width: 40px;
  background: #0c1014;
  border: none;
  color: white;
  font-size: 12px;
  text-align: center;
  padding: 4px 0;
  outline: none;
}

.number-arrows {
  display: flex;
  flex-direction: column;
  border-left: 1px solid #2d6a4f;
}

.number-arrow {
  width: 18px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a4d3a;
  color: white;
  cursor: pointer;
  font-size: 9px;
}

.number-arrow:hover { background: #40916c; }

.compact-row { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.compact-row > div { flex: 1; min-width: 120px; }

.notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: bold;
  z-index: 1000;
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
  animation: slideDown 0.3s ease;
}

.notification.success { background: #40916c; }
.notification.error { background: #ef4444; }

@keyframes slideDown {
  from { top: -100px; opacity: 0; }
  to { top: 20px; opacity: 1; }
}

@keyframes slideUp {
  from { top: 20px; opacity: 1; }
  to { top: -100px; opacity: 0; }
}

.reset-btn {
  background: #dc2626;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-weight: bold;
  cursor: pointer;
  width: 100%;
  margin: 20px 0 30px 0;
  transition: all 0.2s;
}

.reset-btn:hover { background: #b91c1c; }

@media (max-width: 768px) {
  .compact-row > div { min-width: 100%; }
  .knob-wrapper { width: 100%; }
}

/* Estilo para el control de tamaño individual */
.size-control-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.size-control-box {
  background: #0c1014;
  border: 1px solid #2d6a4f;
  border-radius: 6px;
  padding: 6px;
}

.size-control-label {
  font-size: 8px;
  color: #a7bcb0;
  text-transform: uppercase;
  margin-bottom: 2px;
  display: block;
}

.size-control-value {
  font-size: 11px;
  font-weight: bold;
  color: #52b788;
  text-align: right;
  display: block;
}

.personal-icon-tag {
  position: absolute;
  top: 2px;
  left: 2px;
  background: #40916c;
  color: white;
  font-size: 8px;
  padding: 1px 4px;
  border-radius: 4px;
  font-weight: bold;
}

/* Input ranges personalizados */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: #2d6a4f;
  border-radius: 2px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: #52b788;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  background: #74c69d;
  transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #52b788;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}