:root {
  color-scheme: light;
  background: #f5f3ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: #f5f3ff;
}

body {
  touch-action: none;
  cursor: crosshair;
}

canvas {
  display: block;
  width: 100vw;
  height: 100vh;
}

.wave-button {
  position: fixed;
  right: clamp(18px, 2.4vw, 34px);
  bottom: clamp(18px, 2.4vw, 34px);
  z-index: 2;
  display: grid;
  width: clamp(58px, 5.8vw, 76px);
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(57, 47, 105, 0.22);
  border-radius: 50%;
  color: #393069;
  background: rgba(255, 255, 255, 0.58);
  box-shadow:
    0 10px 34px rgba(73, 59, 130, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
  transition:
    transform 220ms ease,
    background-color 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
}

.wave-button:hover,
.wave-button:focus-visible {
  transform: translateY(-3px) scale(1.035);
  border-color: rgba(94, 74, 198, 0.4);
  background: rgba(255, 255, 255, 0.78);
  box-shadow:
    0 16px 42px rgba(73, 59, 130, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  outline: none;
}

.wave-button:focus-visible {
  box-shadow:
    0 0 0 4px rgba(255, 215, 74, 0.34),
    0 16px 42px rgba(73, 59, 130, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.wave-icon {
  width: 61%;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wave-hand {
  transform-box: fill-box;
  transform-origin: 48% 92%;
}

.wave-marks {
  opacity: 0;
}

.wave-button:hover .wave-hand,
.wave-button:focus-visible .wave-hand {
  animation: hand-wave 620ms ease-in-out 1;
}

.wave-button:hover .wave-marks,
.wave-button:focus-visible .wave-marks {
  animation: wave-marks 620ms ease-in-out 1;
}

@keyframes hand-wave {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(12deg); }
  65% { transform: rotate(-10deg); }
}

@keyframes wave-marks {
  0%, 100% { opacity: 0; transform: translate(0, 1px); }
  28%, 70% { opacity: 0.85; transform: translate(1px, -1px); }
}

@media (pointer: coarse) {
  body {
    cursor: default;
  }

  .wave-button {
    width: 64px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wave-button,
  .wave-hand,
  .wave-marks {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}
