/* Reset and base styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
}

/* Background image with fallback color */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #1a1a1a;
  background-image: url('kenny-bg.jpg');
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Controls overlay - fixed at bottom-center with semi-transparent backdrop */
#controls {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  border-radius: 1rem;
  color: #fff;
}

/* Play/Pause button */
#play-pause-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

#play-pause-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

#play-pause-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Progress container */
#progress-container {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 200px;
}

/* Time display */
#time-display {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}

/* Progress bar wrapper */
#progress-bar-wrapper {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  overflow: hidden;
}

/* Progress bar inner - width set via JS as percentage */
#progress-bar {
  width: 0%;
  height: 100%;
  background: #fff;
  border-radius: 3px;
  transition: width 0.1s linear;
}

/* Error message */
#error-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  background: rgba(0, 0, 0, 0.8);
  padding: 1.5rem 2rem;
  border-radius: 0.5rem;
  font-size: 1.125rem;
}

/* Mobile responsive */
@media (max-width: 480px) {
  #controls {
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    transform: none;
    width: auto;
    padding: 0.75rem 1rem;
    gap: 0.75rem;
    border-radius: 0.75rem;
  }

  #play-pause-btn {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.25rem;
    flex-shrink: 0;
  }

  #progress-container {
    min-width: 0;
    flex: 1;
  }

  #time-display {
    font-size: 0.75rem;
  }

  #error-message {
    left: 1rem;
    right: 1rem;
    transform: translateY(-50%);
    text-align: center;
    padding: 1rem;
    font-size: 1rem;
  }
}

/* Prevent iOS zoom on button tap */
@media (hover: none) and (pointer: coarse) {
  #play-pause-btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
}
