:root {
  --width: 100px;
  --height: calc(var(--width) / 2);
  --font-size: 24px;
  /* Größe des Textes */
  --font-weight: bold;
  /* Fettschrift */
  --font-family: 'Arial', sans-serif;
  /* Schriftart */
  --text-color: #333;
  /* Textfarbe */
}

body {
  background-color: rgb(255, 255, 255);
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.ball {
  width: var(--width);
  height: var(--height);
  background-size: contain;
  background-repeat: no-repeat;
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: var(--font-size);
  font-weight: var(--font-weight);
  font-family: var(--font-family);
  color: var(--text-color);
  animation: toRight linear 3.4s infinite alternate, bounce linear 8.5s infinite alternate;
  padding: 0.2em;
  margin: 0;
  border-style: solid;
  border-color: blueviolet;
  border-radius: 25px;
}

@keyframes bounce {
  0% {
    top: 0;
  }

  48% {}

  50% {
    top: calc(100% - var(--height));
  }

  52% {}

  100% {
    top: 0;
  }
}

@keyframes toRight {
  0% {
    left: 0;
  }

  100% {
    left: calc(100% - var(--width));
  }
}