@font-face {
    font-family: 'ZeroCool';
    src: url('/zerocool.woff') format('woff'), /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
        url('/zerocool.ttf') format('truetype'); /* Chrome 4+, Firefox 3.5, Opera 10+, Safari 3—5 */
}  

body {
  margin: 0;
  padding: 0;
  font-family: "ZeroCool", Arial, sans-serif;
  background-color: black;
  background-image: url('/back.jpg');
  color: azure;
  overflow: hidden;
}

#oz-player {
  width: calc(100% - 40px); 
  max-width: 400px;
  margin: 0 auto;
  padding: 20px;
  background-color: rgba(0, 0, 0, 0.8);
  position : absolute;
  bottom: 20px;
  right : 20px;
  overflow: auto;
  cursor: pointer;
  user-select: none;
}

/* Stopped state - grey out title and waveform */
#oz-player.stopped h1 {
  opacity: 0.7;
}

#oz-player.stopped #now-playing .title {
  opacity: 0.7;
}

#oz-player h1 {
    font-size: 2em;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}

/* Header with title, waveform and time */
.player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.player-header .time {
  font-size: 0.9em;
  opacity: 0.7;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Waveform animation */
.waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 30px;
  flex: 1;
}

/* Now Playing styles */
#now-playing {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#now-playing .track-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

#now-playing .artist,
#now-playing .title {
  white-space: nowrap;
  display: inline-block;
}

#now-playing .artist.scrolling,
#now-playing .title.scrolling {
  animation: marquee var(--marquee-duration, 8s) linear infinite;
}

@keyframes marquee {
  0%, 10% {
    transform: translateX(0);
  }
  45%, 55% {
    transform: translateX(var(--marquee-offset, -50%));
  }
  90%, 100% {
    transform: translateX(0);
  }
}

#now-playing .artist {
  font-size: 1em;
  opacity: 0.7;
}

#now-playing .title {
  font-size: 1em;
  font-weight: bold;
}

.waveform .bar {
  width: 4px;
  background-color: azure;
  border-radius: 2px;
  height: 10px;
  opacity: 0.3;
  transition: opacity 0.3s ease;
}

.waveform.playing .bar {
  opacity: 1;
  animation: waveform 1s ease-in-out infinite;
}

.waveform .bar:nth-child(1) { animation-delay: 0s; }
.waveform .bar:nth-child(2) { animation-delay: 0.1s; }
.waveform .bar:nth-child(3) { animation-delay: 0.2s; }
.waveform .bar:nth-child(4) { animation-delay: 0.3s; }
.waveform .bar:nth-child(5) { animation-delay: 0.4s; }
.waveform .bar:nth-child(6) { animation-delay: 0.5s; }
.waveform .bar:nth-child(7) { animation-delay: 0.6s; }
.waveform .bar:nth-child(8) { animation-delay: 0.7s; }
.waveform .bar:nth-child(9) { animation-delay: 0.8s; }
.waveform .bar:nth-child(10) { animation-delay: 0.9s; }
.waveform .bar:nth-child(11) { animation-delay: 0.15s; }
.waveform .bar:nth-child(12) { animation-delay: 0.25s; }
.waveform .bar:nth-child(13) { animation-delay: 0.35s; }
.waveform .bar:nth-child(14) { animation-delay: 0.45s; }
.waveform .bar:nth-child(15) { animation-delay: 0.55s; }

@keyframes waveform {
  0%, 100% {
    height: 8px;
  }
  25% {
    height: 25px;
  }
  50% {
    height: 12px;
  }
  75% {
    height: 20px;
  }
}

@media (max-width: 580px) {
  #oz-player {
    left : 0px;
    right : 0px;
  }
}

/* Progressive waveform hiding to maintain margins */
@media (max-width: 480px) {
  .waveform .bar:nth-child(n+13) { display: none; }
}

@media (max-width: 420px) {
  .waveform .bar:nth-child(n+10) { display: none; }
}

@media (max-width: 360px) {
  .waveform .bar:nth-child(n+7) { display: none; }
}

@media (max-width: 330px) {
  .waveform .bar:nth-child(n+4) { display: none; }
}

@media (max-width: 300px) {
  .waveform { display: none; }
}

@media (max-height: 160px) {
  #oz-player {
    top: 0px;
    bottom: 0px;
  }
}

/* Overlay styles */
#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

#overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

#overlay h1 {
  font-size: 4em;
  margin: 0;
  padding: 0;
  text-align: center;
}

.overlay-content {
  display: flex;
  align-items: center;
  gap: 30px;
}

#play-button {
  width: 50px;
  height: 50px;
  border: 4px solid azure;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

#play-button:hover {
  transform: scale(1.1);
  background-color: rgba(255, 255, 255, 0.1);
}

#play-button svg {
  width: 32px;
  height: 32px;
  margin-left: 6px;
}

@media (max-width: 580px) {
  #overlay h1 {
    font-size: 2.5em;
  }
  .overlay-content {
    gap: 20px;
  }
  #play-button {
    width: 60px;
    height: 60px;
  }
  #play-button svg {
    width: 24px;
    height: 24px;
    margin-left: 4px;
  }
}