.to-top {
  position: fixed;
  right: 28px;
  bottom: 36px;
  z-index: 100;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 1px solid rgba(233, 181, 75, 0.52);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 18%, rgba(246, 205, 112, 0.16), transparent 42%),
    linear-gradient(145deg, rgba(32, 35, 38, 0.98), rgba(10, 12, 14, 0.98));
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.38),
    inset 0 0 0 1px rgba(255, 255, 255, 0.035);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.94);
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.25s ease,
    visibility 0.25s ease,
    transform 0.25s ease;
}

.to-top--visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.to-top img {
  display: block;
  width: 100%;
  height: 100%;
}

@media (hover: hover) {
  .to-top--visible:hover {
    border-color: #f0c45e;
    background:
      radial-gradient(circle at 50% 18%, rgba(255, 222, 143, 0.24), transparent 44%),
      linear-gradient(145deg, #25282b, #111315);
    box-shadow:
      0 14px 34px rgba(0, 0, 0, 0.46),
      0 0 18px rgba(233, 181, 75, 0.16),
      inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    transform: translateY(-3px) scale(1);
  }
}

.to-top--visible:active {
  transform: translateY(0) scale(0.96);
}

.to-top:focus-visible {
  outline: 2px solid #f4c967;
  outline-offset: 4px;
}

@media (max-width: 768px) {
  .to-top {
    right: max(16px, env(safe-area-inset-right, 0px));
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }
  .to-top img {
    width: 40px;
    height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .to-top {
    transition: none;
  }
}
