I have this picture:

[![enter image description here](https://i.stack.imgur.com/jqqXP.png)](https://i.stack.imgur.com/jqqXP.png)

generated by:

```
\documentclass{standalone}

\usepackage{tikz}
\usetikzlibrary{calc, shapes, positioning}

\begin{document}
\begin{tikzpicture}
  \node (A) [draw, ellipse, minimum width=3cm, minimum height=6cm] at (0,0) {};
  \foreach \i in {0,...,3} {
    \node (A\i) [draw, circle, yshift=-0.5cm, outer sep=0.3cm] at ($(A.north)!\i/5!(A.south)$) {\i};
  }

  \node (B) [draw, ellipse, minimum width=3cm, minimum height=6cm] at (6,0) {};
  \foreach \i in {0,...,3} {
    \node (B\i) [draw, circle, yshift=-0.5cm, outer sep=0.3cm] at ($(B.north)!\i/5!(B.south)$) {\i};
  }

  \draw[rounded corners=0.5cm, thick, red] (A0.north west)--(B0.north east)--(B0.south east)--(A0.south west)--cycle;

  \draw[rounded corners=0.5cm, thick, red] (A0.north west)--(B2.north east)--(B2.south east)--(A0.south west)--cycle;

  \draw[rounded corners=0.5cm, thick, green] (A1.north west)--(B1.north east)--(B1.south east)--(A1.south west)--cycle;
  \draw[rounded corners=0.5cm, thick, green] (A1.north west)--(B3.north east)--(B3.south east)--(A1.south west)--cycle;

  \draw[rounded corners=0.5cm, thick, blue] (A3.north west)--(B1.north east)--(B1.south east)--(A3.south west)--cycle;
\end{tikzpicture}

\end{document}

```

Obviously, the lines do not really go nicely around the nodes. I tried to guide them around, by using (south east) -- (south west) control points, but still not really nice.

How can I make the lines flow nicely around the circles?

Thanks!