:root {
  --pill: #e59ab8;
  --wave-idle: #c4477a;
  --wave-played: #ffffff;
  --btn: #ffffff;
  --icon: #c4477a;
  --text: #ffffff;
  --player-h: 52px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
  height: var(--player-h);
  max-height: var(--player-h);
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: transparent;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

.audio {
  width: 100%;
  max-width: 100%;
  height: var(--player-h);
  max-height: var(--player-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 4px 16px;
  background: var(--pill);
  border-radius: 999px;
  direction: ltr;
  overflow: hidden;
}

.audio-time {
  flex: 0 0 auto;
  min-width: 2.8em;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.audio-wave {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  height: 22px;
  cursor: pointer;
  overflow: hidden;
}

.audio-wave-idle,
.audio-wave-played {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}

.audio-wave-idle span,
.audio-wave-played span {
  flex: 1 1 0;
  min-width: 2px;
  max-width: 4px;
  border-radius: 99px;
  transform-origin: center;
}

.audio-wave-idle span {
  background: var(--wave-idle);
}

.audio-wave-played {
  width: 100%;
  clip-path: inset(0 100% 0 0);
  will-change: clip-path;
}

.audio-wave-played span {
  background: var(--wave-played);
}

.audio.is-playing .audio-wave-idle span,
.audio.is-playing .audio-wave-played span {
  animation: wavePulse 1.15s ease-in-out infinite;
}

.audio-play {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--btn);
  color: var(--icon);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.audio-play svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.audio-play .icon-pause {
  display: none;
}

.audio.is-playing .icon-play {
  display: none;
}

.audio.is-playing .icon-pause {
  display: block;
}

@keyframes wavePulse {
  0%,
  100% {
    transform: scaleY(0.82);
  }
  50% {
    transform: scaleY(1);
  }
}

@media (max-width: 480px) {
  :root {
    --player-h: 48px;
  }

  .audio {
    gap: 8px;
    padding: 3px 5px 3px 12px;
  }

  .audio-time {
    font-size: 15px;
    min-width: 2.2em;
  }

  .audio-wave {
    height: 18px;
  }

  .audio-play {
    width: 36px;
    height: 36px;
  }
}
