.factory-window {
  width: 800px;
  max-width: 90vw;
  height: 600px;
  max-height: 80vh;
}

.factory-window .window-body {
  display: flex;
  height: calc(100% - 120px);
  padding: 20px;
  gap: 20px;
}

.avatar-preview-container {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 20px;
  border: 1px solid rgba(255, 0, 198, 0.3);
}

.avatar-preview {
  position: relative;
  width: 200px;
  height: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.avatar-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: all 0.3s ease;
}

.base-layer {
  z-index: 1;
}

.eye-layer {
  z-index: 2;
}

.mouth-layer {
  z-index: 3;
}

.hat-layer {
  z-index: 4;
}

.outfit-layer {
  z-index: 5;
}

.avatar-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
  overflow-y: auto;
  padding-right: 10px;
}

.control-section {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 15px;
  border: 1px solid rgba(255, 0, 198, 0.2);
}

.control-section h3 {
  margin: 0 0 10px 0;
  color: #ff80ff;
  font-size: 16px;
  font-weight: bold;
}

.component-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
  gap: 8px;
  max-height: 120px;
  overflow-y: auto;
}

.component-btn {
  background: rgba(255, 0, 198, 0.2);
  border: 1px solid rgba(255, 0, 198, 0.4);
  color: #ff80ff;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  min-width: 40px;
  text-align: center;
  font-family: 'Courier New', monospace;
}

.component-btn:hover {
  background: rgba(255, 0, 198, 0.4);
  border-color: #ff00c6;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(255, 0, 198, 0.3);
}

.component-btn.active {
  background: #ff00c6;
  color: white;
  border-color: #6b32b2;
  box-shadow: 0 0 10px rgba(255, 0, 198, 0.5);
}

.avatar-notification {
  animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.avatar-controls::-webkit-scrollbar,
.component-selector::-webkit-scrollbar {
  width: 6px;
}

.avatar-controls::-webkit-scrollbar-track,
.component-selector::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.avatar-controls::-webkit-scrollbar-thumb,
.component-selector::-webkit-scrollbar-thumb {
  background: rgba(255, 0, 198, 0.5);
  border-radius: 3px;
}

.avatar-controls::-webkit-scrollbar-thumb:hover,
.component-selector::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 0, 198, 0.7);
}

.avatar-preview.loading {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .factory-window {
    width: 95vw;
    height: 80vh;
  }
  
  .factory-window .window-body {
    flex-direction: column;
    height: calc(100% - 140px);
  }
  
  .avatar-preview-container {
    flex: none;
    height: 200px;
  }
  
  .avatar-controls {
    flex: 1;
    overflow-y: auto;
  }
  
  .component-selector {
    grid-template-columns: repeat(auto-fit, minmax(35px, 1fr));
  }
  
  .component-btn {
    padding: 6px 10px;
    font-size: 14px;
  }
} 