/* ==========================================================================
   utilities.css — Star counter, mute button, back-to-top, progress, controls
   Mobile-first. Base = 320px.
   ========================================================================== */

/* ---------- Controls row (responsive flex container) ---------- */

.controls-row {
  position: fixed;
  bottom: 60px; /* Just above nav bar (~48px tall) + 12px padding */
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 100;
}

/* ---------- Star counter ---------- */

.star-counter {
  height: 36px;
  display: flex;
  align-items: center;
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  white-space: nowrap;
}

.star-counter.visible,
.star-counter.stars-depleted {
  opacity: 1;
  visibility: visible;
}

.star-counter-num {
  color: #ef4444;
  font-weight: bold;
}

/* ---------- Mute button ---------- */

.mute-btn {
  width: 36px;
  height: 36px;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
}

.mute-btn.visible {
  opacity: 1;
  visibility: visible;
}

.mute-btn:hover {
  border-color: #ffffff;
  color: #ffffff;
}

.mute-btn.muted {
  border-color: rgba(239, 68, 68, 0.5);
  color: rgba(239, 68, 68, 0.7);
}

.mute-btn.muted:hover {
  border-color: #ef4444;
  color: #ef4444;
}

/* ---------- Back to top button ---------- */

.back-to-top {
  width: 36px;
  height: 36px;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  border-color: #ffffff;
  color: #ffffff;
}

/* ---------- Progress indicator ---------- */

.progress {
  display: none;
}

.progress-track {
  width: 2px;
  height: 150px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.progress-dot {
  position: absolute;
  left: -3px;
  top: 0;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent);
  transition: top 0.3s ease;
}

/* ---------- sm: 640px+ ---------- */

@media (min-width: 640px) {
  .controls-row {
    gap: 1rem;
  }

  .star-counter {
    font-size: 1.2rem;
  }
}

/* ---------- md: 768px+ ---------- */

@media (min-width: 768px) {
  .controls-row {
    bottom: 72px; /* Just above nav bar on tablet+ */
    right: 54px;
  }

  .star-counter {
    height: 48px;
    font-size: 1.4rem;
  }

  .mute-btn {
    width: 48px;
    height: 48px;
  }

  .back-to-top {
    width: 48px;
    height: 48px;
  }

  /* Progress visible on md+ */
  .progress {
    display: block;
    position: fixed;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
  }

  .progress-track {
    height: 200px;
  }
}
