:root {
  --bg: #191f2d;
  --surface: #191f2d;
  --list: #232c3d;
  --text: #ffffff;
  --secondary: #8d97aa;
  --separator: #2f3849;
  --blue: #4a8de6;
  --track: #4a5261;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button,
a,
.playlist-row {
  -webkit-tap-highlight-color: transparent;
}

.player {
  width: min(100%, 402px);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  user-select: none;
}

.titlebar {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
}

.titlebar h1 {
  overflow: hidden;
  font-size: 17px;
  font-weight: 590;
  line-height: 22px;
  letter-spacing: -0.43px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playlist {
  margin: 0 12px;
  overflow: hidden;
  border-radius: 24px;
  background: var(--list);
}

.playlist-row {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px 0 12px;
  color: var(--text);
  cursor: pointer;
  outline: none;
}

.playlist-row + .playlist-row .row-copy,
.playlist-row + .playlist-row .pl-handle {
  border-top: 1px solid var(--separator);
}

.row-artwork {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  position: relative;
  overflow: hidden;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.row-artwork img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.row-play {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.row-copy {
  min-width: 0;
  min-height: 52px;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
}

.pl-title {
  overflow: hidden;
  font-size: 17px;
  font-weight: 510;
  line-height: 22px;
  letter-spacing: -0.43px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pl-meta {
  overflow: hidden;
  margin-top: 2px;
  color: var(--secondary);
  font-size: 13px;
  line-height: 18px;
  letter-spacing: -0.08px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pl-handle {
  min-height: 52px;
  display: grid;
  place-items: center;
  align-self: stretch;
  flex: 0 0 22px;
  color: #778296;
  cursor: grab;
  font-size: 20px;
  font-weight: 300;
  touch-action: none;
  transform: scaleX(1.2);
}

.playlist.is-reordering,
.playlist.is-reordering .playlist-row {
  cursor: grabbing;
}

.playlist-row.dragging {
  position: relative;
  z-index: 2;
  background: #2c374a;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}

.bottom-player {
  margin-top: auto;
  padding: 18px 20px max(20px, env(safe-area-inset-bottom));
}

.now-playing {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 14px;
}

.current-cover {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 24px;
  font-weight: 700;
}

.current-copy {
  min-width: 0;
}

.current-title {
  overflow: hidden;
  font-size: 17px;
  font-weight: 590;
  line-height: 22px;
  letter-spacing: -0.43px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.current-artist {
  overflow: hidden;
  margin-top: 3px;
  color: var(--secondary);
  font-size: 15px;
  line-height: 20px;
  letter-spacing: -0.23px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seekbar-wrap {
  margin-top: 18px;
}

.seekbar {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  display: block;
  border: 0;
  border-radius: 99px;
  background: var(--track);
  cursor: pointer;
  outline: none;
}

.seekbar::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 99px;
  background: linear-gradient(
    90deg,
    #ffffff 0%,
    #ffffff var(--seek-progress, 0%),
    var(--track) var(--seek-progress, 0%),
    var(--track) 100%
  );
}

.seekbar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  margin-top: -4px;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
}

.seekbar::-moz-range-track {
  height: 5px;
  border-radius: 99px;
  background: var(--track);
}

.seekbar::-moz-range-progress {
  height: 5px;
  border-radius: 99px;
  background: #ffffff;
}

.seekbar::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
}

.time-row {
  display: flex;
  justify-content: space-between;
  margin-top: 9px;
  color: var(--secondary);
  font-size: 13px;
}

.transport {
  display: grid;
  grid-template-columns: 38px 1fr 1fr 1fr 38px;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.transport button {
  border: 0;
  background: transparent;
  cursor: pointer;
  outline: none;
}

.transport-button {
  min-width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -8px;
}

.play-button {
  font-size: 42px;
  letter-spacing: 0;
}

.mode-button {
  height: 48px;
  color: #778296;
  font-size: 25px;
  font-weight: 700;
}

.mode-button.active {
  color: var(--blue);
}

.transport button:active {
  opacity: 0.65;
  transform: scale(0.96);
}

.playlist-row:focus-visible,
.seekbar:focus-visible,
.transport button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

@media (min-width: 581px) {
  body {
    align-items: center;
    padding: 20px;
  }

  .player {
    min-height: min(852px, calc(100vh - 40px));
  }
}

@media (max-width: 420px) {
  .titlebar {
    padding-left: 14px;
    padding-right: 14px;
  }

  .playlist {
    margin-left: 12px;
    margin-right: 12px;
  }

  .playlist-row {
    padding-right: 14px;
  }

  .bottom-player {
    padding-left: 16px;
    padding-right: 16px;
  }

  .transport {
    grid-template-columns: 38px 1fr 1fr 1fr 38px;
    gap: 4px;
  }

}
