/* =========================================
   TWISTED BLACK — Mini-Player + Full Player
   ========================================= */

/* --- Mini Player Bar (fixed bottom) --- */
.mini-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--mini-player-height);
  background: #08090C;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 900;
  padding-bottom: var(--safe-bottom);
  display: none;
}

.mini-player.visible {
  display: block;
}

/* Thin progress bar at top of mini-player */
.mini-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.04);
}

.mini-progress-fill {
  height: 100%;
  background: var(--blood-bright);
  width: 0%;
  transition: width 200ms linear, background 600ms ease;
}

.mini-player-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: var(--mini-player-height);
  max-width: var(--max-width);
  margin: 0 auto;
}

.mini-cover {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface);
  flex-shrink: 0;
  cursor: pointer;
}

.mini-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.mini-title {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-artist {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 1px;
}

.mini-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mini-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  transition: color var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.mini-btn:hover {
  color: rgba(255, 255, 255, 0.9);
}

.mini-btn:active {
  color: rgba(255, 255, 255, 1);
  transform: scale(0.9);
}

.mini-btn svg {
  width: 22px;
  height: 22px;
}

.mini-btn.play-pause svg {
  width: 28px;
  height: 28px;
}

/* --- Full Player Overlay --- */
.full-player {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 400ms cubic-bezier(0.32, 0.72, 0, 1), background 600ms ease;
  overflow: hidden;
}

.full-player.open {
  transform: translateY(0);
}

/* Scrollable content wrapper */
.fp-scroll-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  padding-top: calc(40px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(40px + var(--safe-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* When queue has content, shift to top alignment */
.fp-scroll-content:has(.fp-queue-card) {
  justify-content: flex-start;
}

/* Drag handle — iOS sheet pattern */
.fp-drag-handle {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.2);
  z-index: 10;
}

.full-player-close {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top, 0px));
  left: 16px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  padding: 8px;
  display: flex;
  transition: color var(--transition-fast);
  z-index: 10;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

.full-player-close:hover {
  color: rgba(255, 255, 255, 0.8);
}

.full-player-close svg {
  width: 28px;
  height: 28px;
}

.fp-art-container {
  position: relative;
  width: min(320px, 70vw);
  height: min(320px, 70vw);
  margin-bottom: 32px;
  flex-shrink: 0;
}

.fp-art-glow {
  position: absolute;
  inset: -6px;
  border-radius: 20px;
  background: rgba(185, 28, 28, 0.2);
  box-shadow: 0 0 60px rgba(185, 28, 28, 0.25), 0 0 120px rgba(185, 28, 28, 0.08);
  filter: blur(2px);
  transition: background 600ms ease, box-shadow 600ms ease;
}

.fp-art {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  z-index: 1;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  transition: opacity 300ms ease;
}

.fp-art.crossfading {
  opacity: 0;
}

.fp-track-info {
  text-align: center;
  width: 100%;
  max-width: 360px;
  margin-bottom: 24px;
}

.fp-title {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fp-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 4px;
}

/* Progress */
.fp-progress-section {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 360px;
  margin-bottom: 24px;
}

.fp-time {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.25);
  min-width: 36px;
  text-align: center;
}

.fp-progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  transition: height var(--transition-fast);
}

.fp-progress-bar:hover {
  height: 6px;
}

.fp-buffered {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  width: 0%;
  transition: width 300ms ease;
}

.fp-progress-fill {
  position: relative;
  height: 100%;
  border-radius: 2px;
  background: var(--blood-bright);
  width: 0%;
  z-index: 1;
  transition: width 100ms linear, background 600ms ease;
}

.fp-progress-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 8px;
  height: 8px;
  background: var(--blood-bright);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 6px rgba(220, 38, 38, 0.3);
  opacity: 1;
  z-index: 2;
  transition: width var(--transition-fast), height var(--transition-fast), background 600ms ease, box-shadow 600ms ease;
  pointer-events: none;
}

.fp-progress-bar:hover .fp-progress-thumb,
.fp-progress-bar:active .fp-progress-thumb {
  width: 14px;
  height: 14px;
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.5);
}

/* Controls */
.fp-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 24px;
}

.fp-ctrl {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  padding: 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 48px;
  transition: all var(--transition-fast);
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.fp-ctrl svg {
  width: 28px;
  height: 28px;
}

.fp-ctrl:hover {
  color: rgba(255, 255, 255, 0.9);
}

.fp-ctrl:active {
  transform: scale(0.88);
}

.fp-ctrl-sm {
  color: rgba(255, 255, 255, 0.25);
}

.fp-ctrl-sm svg {
  width: 22px;
  height: 22px;
}

.fp-ctrl-sm.active {
  color: var(--ember);
}

.fp-play-btn {
  width: 64px;
  height: 64px;
  background: rgba(185, 28, 28, 0.15);
  border: 1.5px solid rgba(185, 28, 28, 0.3);
  color: #fff;
  transition: all var(--transition-fast), background 600ms ease, border-color 600ms ease;
}

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

.fp-play-btn:hover {
  background: rgba(185, 28, 28, 0.25);
  color: #fff;
  transform: scale(1.05);
}

.fp-repeat-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  font-family: 'Space Mono', monospace;
  font-size: 0.5rem;
  font-weight: 700;
  color: var(--bg);
  background: var(--ember);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
}

/* Volume */
.fp-volume-section {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 200px;
  margin-bottom: 20px;
}

.fp-vol-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.25);
  padding: 4px;
  display: flex;
  transition: color var(--transition-fast);
}

.fp-vol-btn:hover {
  color: rgba(255, 255, 255, 0.7);
}

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

.fp-volume-bar {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}

.fp-volume-fill {
  height: 100%;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.4);
  width: 80%;
  transition: background 600ms ease;
}

.fp-volume-thumb {
  position: absolute;
  top: 50%;
  left: 80%;
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
}

.fp-volume-bar:hover .fp-volume-thumb {
  opacity: 1;
}

/* Share/action buttons in full player */
.fp-actions {
  display: flex;
  gap: 12px;
}

.fp-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.35);
  padding: 10px 20px;
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  transition: all var(--transition-fast);
}

.fp-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.12);
}

.fp-action-btn svg {
  width: 14px;
  height: 14px;
}

/* --- Queue Section --- */
.fp-queue {
  width: 100%;
  max-width: 360px;
  margin-top: 32px;
}

.fp-queue-label {
  font-family: 'Oswald', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.25);
  margin-bottom: 8px;
  padding-left: 4px;
}

.fp-queue-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.fp-queue-card:hover {
  background: rgba(255, 255, 255, 0.04);
}

.fp-queue-card:active {
  background: rgba(255, 255, 255, 0.06);
}

.fp-queue-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface);
  flex-shrink: 0;
}

.fp-queue-info {
  flex: 1;
  min-width: 0;
}

.fp-queue-title {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fp-queue-album {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fp-queue-duration {
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

/* --- Overflow Bottom Sheet --- */
.fp-overflow-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.fp-overflow-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.fp-overflow-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px 16px 0 0;
  padding: 12px 20px calc(20px + var(--safe-bottom));
  z-index: 11;
  transform: translateY(100%);
  transition: transform 300ms cubic-bezier(0.32, 0.72, 0, 1);
}

.fp-overflow-sheet.open {
  transform: translateY(0);
}

.fp-overflow-handle {
  width: 32px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 auto 16px;
}

.fp-overflow-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 4px;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 400;
  cursor: pointer;
  transition: background var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.fp-overflow-option:last-child {
  border-bottom: none;
}

.fp-overflow-option:hover {
  background: rgba(255, 255, 255, 0.04);
}

.fp-overflow-option:active {
  background: rgba(255, 255, 255, 0.06);
}

.fp-overflow-option svg {
  width: 20px;
  height: 20px;
  color: rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}
