/* AudioPlayer v6 — WebView-safe baseline. Compositor-only animations.
 * Kept under 80 LOC per folder-structure budget.
 */

.audioplayer-press {
  transition: transform 80ms cubic-bezier(0.4, 0, 0.6, 1);
}
.audioplayer-press:active {
  transform: scale(0.97);
}

.audioplayer-shimmer {
  position: relative;
  overflow: hidden;
}
.audioplayer-shimmer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in oklab, var(--color-foreground, #fff) 8%, transparent) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: audioplayer-shimmer 1400ms linear infinite;
}

@keyframes audioplayer-shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

@keyframes audioplayer-bar {
  0%, 100% {
    height: 25%;
  }
  50% {
    height: 95%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .audioplayer-press,
  .audioplayer-shimmer::after,
  .audioplayer-bars span {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}

.audioplayer canvas {
  image-rendering: auto;
}

/* No hover on touch — also no time-tooltip nor hover-cursor on the waveform.
 * Avoids a stuck tip after a tap-and-release. */
@media (hover: none), (pointer: coarse) {
  .audioplayer .audioplayer-tip,
  .audioplayer .audioplayer-hover {
    display: none !important;
  }
}

/* Bigger tap targets on touch + small viewports (Apple HIG ≥ 44px). */
@media (pointer: coarse) {
  .audioplayer .audioplayer-press[aria-label] {
    min-width: 40px;
    min-height: 40px;
  }
}
