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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
  color: #f1f5f9;
  padding: 1rem;
}

/* -- Overlay -- */
#overlay {
  width: 100%;
  max-width: 420px;
}

/* -- Card -- */
.card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  text-align: center;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

#overlay:not(.loading) .card {
  opacity: 1;
  transform: translateY(0);
}

/* -- Meta text -- */
.meta {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  letter-spacing: 0.01em;
  line-height: 1.4;
}

/* -- Player UI -- */
.player-ui {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

/* -- Progress row -- */
.progress-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.time {
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: rgba(241, 245, 249, 0.7);
  min-width: 2.5rem;
  user-select: none;
}

/* -- Seek bar -- */
.seek-bar {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
  cursor: pointer;
}

.seek-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f1f5f9;
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.seek-bar::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f1f5f9;
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.seek-bar::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
}

/* -- Play button -- */
.play-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.15s ease;
}

.play-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.play-btn:active {
  transform: scale(0.95);
}

.play-btn svg {
  width: 32px;
  height: 32px;
}

.play-btn svg[hidden] {
  display: none;
}

/* Shift play icon slightly right to visually center the triangle */
#icon-play {
  margin-left: 3px;
}

/* -- Error message -- */
#error {
  color: #fca5a5;
  font-size: 0.9rem;
  margin-top: 1rem;
}

/* -- Loading spinner -- */
#overlay.loading .card {
  opacity: 1;
  transform: translateY(0);
}

#overlay.loading .card::after {
  content: "";
  display: block;
  width: 28px;
  height: 28px;
  margin: 1rem auto 0;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #f1f5f9;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

#overlay.loading .meta,
#overlay.loading .player-ui {
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
