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

html,
body {
  min-height: 100vh;
  min-height: 100dvh;
}

body {
  font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("cover.jpeg") center / cover no-repeat;
  height: 100%;
  width: 100%;
}

.clock {
  position: fixed;
  top: 70px;
  left: 20px;
  display: flex;
  align-items: baseline;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
  user-select: none;
}

.clock-h,
.clock-m {
  font-size: 20px;
  font-weight: 500;
  color: #fff;
}

.clock-colon {
  font-size: 20px;
  font-weight: 500;
  padding: 0 0.06em;
  animation: blink 1s step-end infinite;
}

.clock-ap {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.65;
  margin-left: 0.35em;
}

.spotify {
  position: fixed;
  top: 24px;
  right: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-decoration: none;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
  user-select: none;
}

.spotify-logo path {
  fill: #1DB954;
}

.spotify-arrow {
  stroke: #1DB954;
}

.spotify-logo {
  width: 18px;
  height: 18px;
}

.spotify span {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
}

.spotify-arrow {
  width: 12px;
  height: 12px;
  opacity: 0.65;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.spotify:hover .spotify-arrow {
  transform: translate(3px, -3px);
  opacity: 1;
}

/* ---- player ---- */

.player {
  position: fixed;
  bottom: 42px;
  left: 50%;
  transform: translateX(-50%);
  width: min(560px, calc(100vw - 48px));
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px 14px 12px;
  border-radius: 20px;
  background: rgba(15, 18, 22, 0.62);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.player-art {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.player-meta {
  flex: 1;
  min-width: 0;
  color: #fff;
}

.player-title {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-artist {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.6;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.player-seek {
  display: flex;
  align-items: center;
  gap: 6px;
}

.player-t-cur,
.player-t-dur {
  font-size: 10px;
  opacity: 0.55;
  min-width: 24px;
  text-align: center;
}

.player-bar {
  flex: 1;
  appearance: none;
  -webkit-appearance: none;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  outline: none;
}

.player-bar::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.player-bar::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.player-bar:hover::-webkit-slider-thumb,
.player-bar:active::-webkit-slider-thumb {
  opacity: 1;
}

.player-bar:hover::-moz-range-thumb,
.player-bar:active::-moz-range-thumb {
  opacity: 1;
}

/* ---- controls ---- */

.player-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.pc-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.pc-btn:hover {
  opacity: 1;
}

.pc-btn:active {
  transform: scale(0.92);
}

.pc-btn svg {
  width: 18px;
  height: 18px;
}

.pc-shuffle {
  opacity: 0.35;
}

.pc-shuffle.on {
  opacity: 1;
}

.pc-play {
  width: 38px;
  height: 38px;
  background: #fff;
  color: #fff;
  opacity: 1;
}

.pc-play:hover {
  transform: scale(1.05);
}

.pc-play svg {
  width: 20px;
  height: 20px;
}

.ic-pause {
  display: none;
}

.playing .ic-pause {
  display: block;
}

.playing .ic-play {
  display: none;
}

@keyframes blink {

  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

/* ---- mobile ---- */

@media (max-width: 480px) {
  .clock {
    top: 50px;
    left: 16px;
    font-size: 16px;
  }

  .clock-h,
  .clock-m {
    font-size: 16px;
  }

  .clock-colon {
    font-size: 16px;
  }

  .clock-ap {
    font-size: 10px;
  }

  .spotify {
    top: 16px;
    right: 16px;
    gap: 6px;
  }

  .spotify-logo {
    width: 16px;
    height: 16px;
  }

  .spotify span {
    font-size: 12px;
  }

  .player {
    bottom: 24px;
    width: calc(100vw - 24px);
    gap: 10px;
    padding: 10px 12px 10px 10px;
    border-radius: 16px;
    bottom: max(24px, env(safe-area-inset-bottom, 0px));
  }

  .player-art {
    width: 48px;
    height: 48px;
    border-radius: 10px;
  }

  .player-title {
    font-size: 13px;
  }

  .player-artist {
    font-size: 11px;
    margin-bottom: 4px;
  }

  .player-seek {
    gap: 4px;
  }

  .player-t-cur,
  .player-t-dur {
    font-size: 9px;
    min-width: 20px;
  }

  .player-controls {
    gap: 0;
  }

  .pc-btn {
    width: 30px;
    height: 30px;
  }

  .pc-btn svg {
    width: 16px;
    height: 16px;
  }

  .pc-play {
    width: 34px;
    height: 34px;
  }

  .pc-play svg {
    width: 18px;
    height: 18px;
  }

  /* Always show seek thumb on touch */
  .player-bar::-webkit-slider-thumb {
    opacity: 1;
    width: 14px;
    height: 14px;
  }

  .player-bar::-moz-range-thumb {
    opacity: 1;
    width: 14px;
    height: 14px;
  }

  .player-bar {
    height: 4px;
  }
}

/* Very small screens (iPhone SE, etc.) */
@media (max-width: 360px) {
  .player {
    width: calc(100vw - 16px);
    padding: 8px 10px 8px 8px;
    gap: 8px;
  }

  .player-art {
    width: 42px;
    height: 42px;
    border-radius: 8px;
  }

  .player-title {
    font-size: 12px;
  }

  .player-artist {
    font-size: 10px;
  }

  .pc-btn {
    width: 28px;
    height: 28px;
  }

  .pc-play {
    width: 32px;
    height: 32px;
  }
}