html, body {
  height: 100%;
  position: relative;
  background-image: url("/star2.jpg");
  background-attachment: fixed;
  background-size: cover;
  background-position: center center;
  overflow: hidden;
}  
/* Раздельные медиазапросы */
@media (min-width: 500px) and (max-width: 1224px) {
  html, body {
    background-image: url("/star3.jpg");
  }
}

@media (max-width: 600px) and (max-height: 500px) {
  html, body {
    background-image: url("/star4.jpg");
  }
}

/* Альтернатива для iOS */
@supports (-webkit-touch-callout: none) {
  html, body {
    background-attachment: scroll;
  }
}

.wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.button {
  -webkit-appearance: none;
  appearance: none;
  width: 50vmin;
  height: 50vmin;
  max-width: 180px;
  max-height: 180px;
  min-width: 120px;
  min-height: 120px;
  font-family: 'Nunito', sans-serif;
  font-size: 3vmin;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  font-weight: 700;
  color: #FFE7FF;
  background: #4FD1C5;
  background: linear-gradient(90deg, rgba(129,230,217,1) 0%, rgba(95,170,199,1) 100%);
  border: none;
  border-radius: 1000px;
  box-shadow: 12px 12px 24px rgba(14,125,229,.64);
  transition: all 0.3s ease-in-out 0s;
  cursor: pointer;
  outline: none;
  position: relative;
  padding: 10px;
  -webkit-tap-highlight-color: transparent; /* Убирает подсветку при тапе */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Планшеты (горизонтальные и вертикальные) */
@media (min-width: 768px) and (max-width: 1024px) {
  .button {
    width: 45vmin !important;
    height: 45vmin !important;
    min-width: 220px !important;  /* Больший минимальный размер */
    min-height: 220px !important;
    font-size: 22px !important;  /* Фиксированный удобочитаемый размер */
  }
  
  .button::before {
    width: calc(45vmin + 12px) !important;
    height: calc(45vmin + 12px) !important;
  }
}

@media (min-width: 1024px) and (max-width: 4000px) {
  .button {
    width: 45vmin !important;
    height: 45vmin !important;
    min-width: 220px !important;  /* Больший минимальный размер */
    min-height: 220px !important;
    font-size: 22px !important;  /* Фиксированный удобочитаемый размер */
  }
  
  .button::before {
    width: calc(45vmin + 12px) !important;
    height: calc(45vmin + 12px) !important;
  }
}

/* Анимация при наведении (только для десктопов) */
@media (hover: hover) {
  .button:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(14,125,229,.8);
  }
  
  .button:hover::before {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05);
  }
}

/* Исправленные селекторы псевдоэлементов */
.button::before {
  content: '';
  border-radius: 1000px;
  width: calc(50vmin + 12px);
  height: calc(50vmin + 12px);
  max-width: calc(180px + 12px);
  max-height: calc(180px + 12px);
  border: 7px solid #5faac7;
  box-shadow: 0 0 60px rgba(95,170,199,.64);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: all .3s ease-in-out 0s;
  z-index: -1;
}

.button:active, .button:focus {
  color: #313133;
}

/* Активация при касании для мобильных */
.button:active::before, .button:focus::before {
  opacity: 1;
}

.button::after {
  content: '';
  width: 30px;
  height: 30px;
  border-radius: 100%;
  border: 6px solid #5faac7;
  position: absolute;
  z-index: -1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: ring 1.5s infinite;
}

/* Добавление определения анимации */
@keyframes ring {
  0% {
    width: 30px;
    height: 30px;
    opacity: 1;
  }
  100% {
    width: 180px;
    height: 180px;
    opacity: 0;
  }
}

/* Отключение анимации при активном состоянии */
.button:active::after, .button:focus::after {
  animation: none;
  display: none;
}

/* Медиазапрос для мобильных устройств */
@media (max-width: 768px) {
  .button {
    width: 150px !important; /* Чуть меньше на маленьких экранах */
    height: 150px !important;
	min-width: 150px !important;
	min-height: 150px !important;
    font-size: 18px !important; /* Увеличиваем текст */
  }
  
  .button::before {
    min-width: calc(100% + 12px) !important;
    min-height: calc(100% + 12px) !important;
  }
}
