:root {
  --color-background: #F4EBD0;
  --color-surface: rgba(255, 255, 255, 0.6);
  --color-primary: #45969B;
  --color-secondary: #F6A89E;
  --color-foreground: #2D283E;
}

body {
  background-color: var(--color-surface);
  color: var(--color-foreground);
  font-family: 'Google Sans Code', ui-monospace, monospace;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

.glass {
  background-color: var(--color-surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

[x-cloak] {
  display: none !important;
}

/* Volume slider */

.volume__slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2px;
  background: #000;
  outline: none;
  cursor: pointer;
}

.volume__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  background: #000;
  border: none;
  border-radius: 0;
  cursor: pointer;
}

.volume__slider::-moz-range-track {
  height: 2px;
  background: #000;
}

.volume__slider::-moz-range-thumb {
  width: 10px;
  height: 10px;
  background: #000;
  border: none;
  border-radius: 0;
  cursor: pointer;
}

/* Playlist */

.playlist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(0px, 0.5vh, 4px);
  container-type: inline-size;
}

.track {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto 0fr;
  align-items: center;
  min-width: 0;
  transition: grid-template-rows 0.35s ease;
}

.track.is-playing {
  grid-template-rows: auto 1fr;
}

.track__links {
  grid-column: 2 / -1;
  grid-row: 2;
  align-self: stretch;
  min-height: 0;
  overflow: hidden;
  display: flex;
  justify-content: flex-start;
  gap: 16px;
  margin-left: clamp(20px, 7cqw, 56px);
  padding-top: 16px;
  opacity: 0;
  transition: opacity 0.3s;
}

.track.is-playing .track__links {
  opacity: 1;
}

.track:last-child .track__links {
  padding-top: 0;
}

.track__media {
  --block: clamp(75px, 13cqw, 110px);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
}

.track__volume {
  position: absolute;
  top: 0;
  right: calc(100% + 12px);
  height: var(--block);
  width: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s;
}

.track.is-playing .track__volume {
  opacity: 1;
  visibility: visible;
}

.track__volume .volume__slider {
  width: var(--block);
  transform: rotate(-90deg);
  flex-shrink: 0;
}

.track__play {
  width: var(--block);
  height: var(--block);
  border: 1px solid #000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #000;
  position: relative;
}

.track__play:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.track.is-playing .track__play {
  border-color: #000;
  color: #fff;
  background-color: #000;
  background-image: var(--track-cover);
  background-size: cover;
  background-position: center;
}

.track.is-playing .track__play::before {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 45%;
  aspect-ratio: 1;
  background: #000;
  border-radius: 50%;
}

.track.is-playing .track__icon {
  position: relative;
}

.track__icon {
  width: calc(var(--block) * 0.1);
  height: auto;
}

.track__bar {
  width: var(--block);
  height: calc(var(--block) * 0.1);
  background: #000;
  position: relative;
  overflow: hidden;
}

.track__progress {
  position: absolute;
  inset: 0;
  background: var(--color-primary);
  transform: scaleX(0);
  transform-origin: left;
}

.track__title {
  margin-left: clamp(20px, 7cqw, 56px);
  font-size: clamp(12px, 2.4cqw, 15px);
  font-weight: 500;
  letter-spacing: 0.22em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  color: #000;
}

.track__duration {
  margin-left: auto;
  padding-left: 16px;
  font-size: clamp(12px, 2.4cqw, 15px);
  font-weight: 500;
  letter-spacing: 0.22em;
  color: #000;
}
