html {
    font-family: sans-serif;
  }

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  background-color: #f0f0f0;
}

header {
  background: rgb(52, 206, 142);
  height: 100px;
  width: 100%;
}

h1 {
  text-align: center;
  color: white;
  line-height: 100px;
  margin: 0;
}

button {
  margin: 50px;
  font-size: 20px;
  background-color: red;
  animation: vibrate;
  animation-duration: 0.05s;
  animation-iteration-count: infinite;
  animation-direction: alternate;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  outline: none;
  transition: background-color 0.3s;
}

button:hover {
  animation: none; /* Останавливаем анимацию при наведении */
  background-color: green; /* Меняем цвет на зеленый */
}

@keyframes vibrate {
  0% {
    transform: translateX(0); /* Начальная позиция */
  }
  50% {
    transform: translateX(7px); /* Сдвиг вправо */
  }
  100% {
    transform: translateX(-7px); /* Сдвиг влево */
  }
}

.animated-link {
  font-size: 20px;
  color: black;
  text-decoration: none; /* без подчеркивание */
  position: relative;
}

.animated-link:hover {
  color: green;
}

.animated-link::after {
  content: '';
  position: absolute;
  left: 50%; /* начало с центра */
  bottom: -2px;
  height: 2px; /* высота подчеркивания */
  width: 0;
  background: green;
  transition: width 0.4s ease, left 0.4s ease; /* плавный переход */
}

.animated-link:hover::after {
  width: 100%; /* ширина подчеркивания при наведении */
  left: 0; /* Сдвигаем влево, чтобы растянуть подчеркивание */
}

a {
  font-size: 20px;
}

.ball {
  position: absolute;
  animation: ball 1s;
  width: 50px;
  height: 50px;
  background-color: red;
  border-radius: 50%;
  left: 200px;
  animation: drop 4s infinite; /* Запускаем анимацию */
}

@keyframes drop {
  0% {
    top: 50px;
  }
  50% {
    top: calc(100vh - 50px);
    transform: scaleY(0.8); /* упругая деформация */
  }
  75%{
    top: calc(50vh - 50px);
    transform: scaleY(1)
  }
  100%{
    top: calc(100vh - 50px);
    transform: scaleY(0.9);
  }
}