/* ═══════════════════════════════════════════════════════════════════
   BEATS — AUDIO PLAYER  ✦  Obsidian Luxe Edition
   ═══════════════════════════════════════════════════════════════════ */

@keyframes wave-dance {
  0%   { transform: scaleY(0.15); }
  50%  { transform: scaleY(1.0);  }
  100% { transform: scaleY(0.25); }
}

/* ── Shell ─────────────────────────────────────────────────────────── */
.ap-shell {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  border-radius: 24px;
  overflow: hidden;
  padding: 0;
  background: #0c0c10;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    0 0 0 1px rgba(0, 247, 255, 0.04) inset,
    0 40px 100px rgba(0, 0, 0, 0.85),
    0 2px 0 rgba(255, 255, 255, 0.04) inset;
}

.ap-ambient {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  filter: blur(80px) saturate(2.2) brightness(0.22);
  transform: scale(1.35);
  transition: background-image 1.2s ease;
  will-change: filter;
}

.ap-ambient-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg,
    rgba(6,6,12,0.72) 0%,
    rgba(6,6,12,0.18) 35%,
    rgba(6,6,12,0.62) 70%,
    rgba(6,6,12,0.95) 100%
  );
}

.ap-ambient-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  opacity: 0.6;
  pointer-events: none;
}

.ap-shell > *:not(.ap-ambient):not(.ap-ambient-overlay) {
  position: relative;
  z-index: 2;
}

.ap-shell > .ap-top,
.ap-shell > .ap-wave-row,
.ap-shell > .ap-progress-wrap,
.ap-shell > .ap-controls,
.ap-shell > .ap-bottom-row {
  padding-left: 28px;
  padding-right: 28px;
}

.ap-top {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-top: 32px;
  padding-bottom: 28px;
}

.ap-vinyl-wrap {
  flex-shrink: 0;
  position: relative;
  width: 136px;
  height: 136px;
  filter: drop-shadow(0 16px 40px rgba(0,0,0,0.7));
}

.ap-vinyl-disc {
  width: 136px;
  height: 136px;
  border-radius: 50%;
  position: relative;
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,0.07) 0%, transparent 55%),
    conic-gradient(from 0deg,
      #111116 0deg, #18181e 20deg, #0e0e13 40deg, #1a1a20 60deg,
      #111116 80deg, #171720 100deg, #0d0d12 120deg, #191922 140deg,
      #111116 160deg, #17171d 180deg, #0e0e13 200deg, #1b1b21 220deg,
      #111116 240deg, #161620 260deg, #0d0d12 280deg, #181820 300deg,
      #111116 320deg, #17171d 340deg, #111116 360deg
    );
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.05),
    inset 0 0 0 1px rgba(0,0,0,0.5),
    0 8px 32px rgba(0,0,0,0.8);
  transition: box-shadow 0.5s ease;
}

.ap-vinyl-disc.spinning {
  animation: vinylSpin 2.8s linear infinite;
  box-shadow:
    0 0 0 1px rgba(0,247,255,0.15),
    inset 0 0 0 1px rgba(0,0,0,0.5),
    0 8px 32px rgba(0,0,0,0.8),
    0 0 50px rgba(0,247,255,0.12),
    0 0 100px rgba(181,55,255,0.06);
}

@keyframes vinylSpin {
  from { transform: rotate(0deg);   }
  to   { transform: rotate(360deg); }
}

.ap-vinyl-ring {
  position: absolute;
  border-radius: 50%;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  border: 1px solid rgba(255,255,255,0.028);
  pointer-events: none;
}
.ap-vinyl-ring-1 { width: 122px; height: 122px; }
.ap-vinyl-ring-2 { width: 105px; height: 105px; border-color: rgba(255,255,255,0.022); }
.ap-vinyl-ring-3 { width:  88px; height:  88px; border-color: rgba(255,255,255,0.035); }

.ap-vinyl-art {
  position: absolute;
  width: 68px; height: 68px;
  border-radius: 50%;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  object-fit: cover;
  border: 3px solid #1c1c24;
  outline: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 0 0 6px rgba(0,0,0,0.35);
}

.ap-vinyl-hole {
  position: absolute;
  width: 10px; height: 10px;
  background: #06060a;
  border-radius: 50%;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 0 6px rgba(0,247,255,0.25);
  z-index: 3;
}

.ap-vinyl-shadow {
  position: absolute;
  bottom: -10px; left: 50%;
  transform: translateX(-50%);
  width: 90px; height: 18px;
  background: rgba(0,0,0,0.45);
  border-radius: 50%;
  filter: blur(12px);
}

.ap-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ap-source-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--neon-blue);
  margin-bottom: 6px;
  opacity: 0.85;
}

.ap-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--neon-blue);
  box-shadow: 0 0 6px var(--neon-blue), 0 0 12px var(--neon-blue);
  animation: dotBlink 1.6s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes dotBlink {
  0%, 100% { opacity: 1;   transform: scale(1);    }
  50%       { opacity: 0.2; transform: scale(0.75); }
}

.ap-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #f0f0f8;
  line-height: 1.35;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: 0.3px;
  text-shadow: 0 0 30px rgba(0,247,255,0.15);
}

.ap-artist {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--neon-blue);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.5px;
  opacity: 0.9;
}

.ap-date {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.28);
  margin: 0;
  letter-spacing: 0.3px;
}

.ap-playlist-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(var(--apc, 0,247,255), 0.25);
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
  margin-top: 5px;
  width: fit-content;
  letter-spacing: 0.5px;
  backdrop-filter: blur(8px);
}

.ap-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.ap-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255,0,110,0.35);
  background: rgba(255,0,110,0.06);
  color: rgba(255,0,110,0.85);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ap-like-btn:hover {
  background: rgba(255,0,110,0.18);
  border-color: rgba(255,0,110,0.8);
  color: #ff006e;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(255,0,110,0.2);
}

.ap-like-btn.liked {
  background: rgba(231,76,60,0.18);
  border-color: #e74c3c;
  color: #e74c3c;
  box-shadow: 0 0 20px rgba(231,76,60,0.25);
}

.ap-like-btn.liked i { animation: heartPop 0.35s cubic-bezier(0.34,1.56,0.64,1); }

@keyframes heartPop {
  0%   { transform: scale(1);   }
  50%  { transform: scale(1.5); }
  100% { transform: scale(1);   }
}

.ap-ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(181,55,255,0.1);
  border: 1px solid rgba(181,55,255,0.3);
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--neon-purple);
  text-transform: uppercase;
  letter-spacing: 1px;
  animation: badgePulse 2.5s ease-in-out infinite;
}
.ap-ai-badge.hidden { display: none; }

@keyframes badgePulse {
  0%, 100% { opacity: 0.9; }
  50%       { opacity: 0.5; }
}

.ap-shell > .ap-wave-row {
  border-top: 1px solid rgba(255,255,255,0.04);
  padding-top: 18px;
}

.ap-wave-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2.5px;
  height: 40px;
  margin-bottom: 20px;
}

.ap-bar {
  width: 2.5px;
  border-radius: 2px;
  background: linear-gradient(to top, var(--neon-blue) 0%, var(--neon-purple) 60%, rgba(181,55,255,0.3) 100%);
  animation: apBarDance 1.0s ease-in-out infinite alternate;
  opacity: 0.65;
  transform-origin: bottom;
  min-height: 3px;
}

@keyframes apBarDance {
  from { transform: scaleY(0.12); opacity: 0.25; }
  to   { transform: scaleY(1.0);  opacity: 0.9;  }
}

.ap-progress-wrap { margin-bottom: 24px; }

.ap-progress-track {
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  overflow: visible;
  transition: height 0.15s ease;
}

.ap-progress-track:hover { height: 5px; }

.ap-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-blue), #7b42ff, var(--neon-purple));
  border-radius: 3px;
  position: relative;
  box-shadow: 0 0 12px rgba(0,247,255,0.4), 0 0 24px rgba(0,247,255,0.15);
  transition: width 0.1s linear;
}

.ap-progress-thumb {
  position: absolute;
  right: -7px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  width: 14px; height: 14px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(0,247,255,0.4), 0 0 16px rgba(0,247,255,0.7);
  transition: transform 0.18s cubic-bezier(0.34,1.56,0.64,1);
}

.ap-progress-track:hover .ap-progress-thumb { transform: translateY(-50%) scale(1); }

.ap-times {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255,255,255,0.3);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

.ap-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
}

.ap-ctrl {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 50%;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease,
              transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s ease;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.ap-ctrl-sm { width: 46px; height: 46px; font-size: 0.95rem; }

.ap-ctrl-sm:hover {
  background: rgba(0,247,255,0.08);
  border-color: rgba(0,247,255,0.35);
  color: var(--neon-blue);
  transform: scale(1.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 0 20px rgba(0,247,255,0.12);
}

.ap-ctrl-sm:active { transform: scale(0.94); }

.ap-ctrl--active {
  background: rgba(0,247,255,0.12) !important;
  border-color: rgba(0,247,255,0.5) !important;
  color: var(--neon-blue) !important;
  box-shadow: 0 0 20px rgba(0,247,255,0.2) !important;
}

.ap-ctrl-play {
  width: 68px; height: 68px;
  font-size: 1.35rem;
  position: relative;
  background: linear-gradient(145deg, #00e5ff 0%, #00b8ff 30%, #7b2fff 70%, #b537ff 100%);
  border: none;
  color: #fff;
  box-shadow:
    0 8px 32px rgba(0,200,255,0.35),
    0 2px 0 rgba(255,255,255,0.2) inset,
    0 -2px 0 rgba(0,0,0,0.3) inset;
}

.ap-ctrl-play:hover {
  transform: scale(1.1);
  box-shadow:
    0 12px 44px rgba(0,200,255,0.5),
    0 2px 0 rgba(255,255,255,0.2) inset,
    0 -2px 0 rgba(0,0,0,0.3) inset;
}

.ap-ctrl-play:active {
  transform: scale(0.95);
  box-shadow: 0 4px 16px rgba(0,200,255,0.3), 0 1px 0 rgba(255,255,255,0.15) inset;
}

.ap-play-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1.5px solid rgba(0,247,255,0.25);
  animation: playRing 2.2s ease-out infinite;
  pointer-events: none;
}

.ap-ctrl-play::before {
  content: '';
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  border: 1px solid rgba(0,247,255,0.1);
  animation: playRing 2.2s ease-out infinite 0.7s;
  pointer-events: none;
}

@keyframes playRing {
  0%   { transform: scale(1);   opacity: 0.7; }
  100% { transform: scale(1.6); opacity: 0;   }
}

.ap-bottom-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 24px;
  border-top: 1px solid rgba(255,255,255,0.04);
  padding-top: 18px;
}

.ap-vol {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.ap-vol-icon {
  color: rgba(255,255,255,0.35);
  font-size: 0.82rem;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.ap-vol-icon:hover { color: var(--neon-blue); transform: scale(1.15); }

.ap-vol-track { flex: 1; min-width: 0; position: relative; }

.ap-vol-slider {
  width: 100%;
  height: 2px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  accent-color: var(--neon-blue);
}

.ap-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--neon-blue);
  box-shadow: 0 0 10px rgba(0,247,255,0.7);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.ap-vol-slider::-webkit-slider-thumb:hover { transform: scale(1.3); }

.ap-vol-slider::-moz-range-thumb {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--neon-blue);
  border: none;
  box-shadow: 0 0 10px rgba(0,247,255,0.7);
  cursor: pointer;
}

.ap-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
}

.ap-toggle-input { display: none; }

.ap-toggle-pill {
  width: 32px; height: 16px;
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
  position: relative;
  transition: background 0.3s ease, box-shadow 0.3s ease;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.06);
}

.ap-toggle-pill::after {
  content: '';
  position: absolute;
  width: 10px; height: 10px;
  background: rgba(255,255,255,0.4);
  border-radius: 50%;
  top: 2px; left: 2px;
  transition: left 0.28s cubic-bezier(0.34,1.56,0.64,1), background 0.3s ease;
}

.ap-toggle-input:checked + .ap-toggle-pill {
  background: linear-gradient(90deg, #00b8ff, #7b2fff);
  border-color: transparent;
  box-shadow: 0 0 12px rgba(0,247,255,0.3);
}

.ap-toggle-input:checked + .ap-toggle-pill::after { left: 18px; background: #fff; }

.ap-toggle-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ap-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  border-radius: 6px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.38);
  font-size: 0.68rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.ap-back-btn:hover {
  background: rgba(0,247,255,0.06);
  border-color: rgba(0,247,255,0.3);
  color: var(--neon-blue);
  transform: translateX(-2px);
}

/* ── Audio responsive ───────────────────────────────────────────── */
@media (max-width: 520px) {
  .ap-shell > .ap-top,
  .ap-shell > .ap-wave-row,
  .ap-shell > .ap-progress-wrap,
  .ap-shell > .ap-controls,
  .ap-shell > .ap-bottom-row { padding-left: 18px; padding-right: 18px; }
  .ap-vinyl-wrap  { width: 108px; height: 108px; }
  .ap-vinyl-disc  { width: 108px; height: 108px; }
  .ap-vinyl-ring-1 { width: 96px; height: 96px; }
  .ap-vinyl-ring-2 { width: 82px; height: 82px; }
  .ap-vinyl-ring-3 { width: 68px; height: 68px; }
  .ap-vinyl-art    { width: 54px; height: 54px; }
  .ap-title        { font-size: 0.9rem; }
  .ap-artist       { font-size: 0.78rem; }
  .ap-ctrl-play    { width: 58px; height: 58px; font-size: 1.25rem; }
  .ap-ctrl-sm      { width: 42px; height: 42px; font-size: 0.9rem; }
  .ap-top          { gap: 16px; }
  .ap-controls     { gap: 14px; }
}

@media (max-width: 360px) {
  .ap-vinyl-wrap  { width: 84px; height: 84px; }
  .ap-vinyl-disc  { width: 84px; height: 84px; }
  .ap-vinyl-ring-1 { width: 74px; height: 74px; }
  .ap-vinyl-ring-2 { width: 62px; height: 62px; }
  .ap-vinyl-ring-3 { width: 50px; height: 50px; }
  .ap-vinyl-art    { width: 44px; height: 44px; }
  .ap-title        { font-size: 0.82rem; }
  .ap-ctrl-play    { width: 52px; height: 52px; font-size: 1.1rem; }
  .ap-ctrl-sm      { width: 38px; height: 38px; font-size: 0.82rem; }
}

/* ═══════════════════════════════════════════════════════════════════
   MOBILE ADDITIONS ONLY — original above is 100% untouched
   ═══════════════════════════════════════════════════════════════════ */

/* No double-tap zoom delay on interactive elements */
.ap-ctrl,
.ap-like-btn,
.ap-back-btn,
.ap-vol-icon,
.ap-toggle-wrap {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Progress bar — larger touch target on touch screens */
@media (pointer: coarse) {
  .ap-progress-track {
    /* Expand hit area without changing visual height */
    padding: 10px 0;
    margin-top: -10px;
    margin-bottom: -10px;
    box-sizing: content-box;
  }
  /* Always show thumb on touch, don't require hover */
  .ap-progress-thumb {
    transform: translateY(-50%) scale(1) !important;
    width: 18px;
    height: 18px;
  }
  /* Bigger vol slider thumb so fingers can grab it */
  .ap-vol-slider::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
  }
  .ap-vol-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
  }
  /* Minimum 44px tap targets for controls */
  .ap-ctrl-sm  { width: 48px; height: 48px; }
  .ap-ctrl-play { width: 70px; height: 70px; }
  /* Like + back button tap target */
  .ap-like-btn { min-height: 44px; padding: 8px 16px; }
  .ap-back-btn { min-height: 44px; padding: 8px 14px; }
}

/* Volume slider — always give bigger touch area via padding trick */
.ap-vol-slider {
  padding: 8px 0;
  margin: -8px 0;
}

/* iOS safe area — home indicator clearance */
.ap-shell {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Prevent iOS input zoom — not directly on player but kept here for completeness */
.ap-shell input { font-size: max(16px, 1em); }