:root {
  --bg-dark: #07090e;
  --bg-card: rgba(18, 22, 36, 0.72);
  --bg-card-hover: rgba(28, 34, 54, 0.88);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 245, 255, 0.25);
  --text-primary: #f3f4f6;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --neon-cyan: #00f5ff;
  --neon-magenta: #f72585;
  --neon-purple: #7209b7;
  --neon-gold: #ffb703;
  --accent-gradient: linear-gradient(135deg, #00f5ff 0%, #7209b7 50%, #f72585 100%);
  --glow-shadow: 0 8px 32px 0 rgba(0, 245, 255, 0.18);
  --card-radius: 16px;
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-code: 'Space Grotesk', monospace;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Dynamic Ambient Glow Backdrop */
.ambient-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 20%, rgba(114, 9, 183, 0.25) 0%, rgba(0, 245, 255, 0.12) 35%, transparent 70%),
              radial-gradient(circle at 80% 80%, rgba(247, 37, 133, 0.18) 0%, transparent 60%);
  filter: blur(80px);
  transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: filter, transform;
}

#bgParticleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
  opacity: 0.55;
}

.app-wrapper {
  position: relative;
  z-index: 10;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 20px 80px 20px;
}

/* Glass Card Core */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-glass);
  border-radius: var(--card-radius);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Main Header */
.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo-icon {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(0, 245, 255, 0.4);
}

.brand-logo-icon svg {
  width: 26px;
  height: 26px;
  color: #fff;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.pulsing-disc {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  border: 2px solid var(--neon-cyan);
  opacity: 0.6;
  animation: discPulse 3s infinite;
}

@keyframes discPulse {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 0; }
  100% { transform: scale(1); opacity: 0.8; }
}

.collection-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--neon-cyan);
  text-transform: uppercase;
}

.brand-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, #ffffff 0%, #d1d5db 60%, var(--neon-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.action-pill-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 999px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.action-pill-btn svg {
  width: 18px;
  height: 18px;
  stroke: var(--neon-cyan);
}

.action-pill-btn:hover {
  background: rgba(0, 245, 255, 0.12);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 16px rgba(0, 245, 255, 0.3);
  transform: translateY(-1px);
}

.action-pill-btn.icon-only {
  padding: 10px;
  border-radius: 50%;
}

/* Hero Stage & Visualizer */
.hero-stage {
  padding: 24px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0, 245, 255, 0.2);
}

.visualizer-container {
  position: relative;
  width: 100%;
  height: 200px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(6, 9, 16, 0.85) 0%, rgba(13, 17, 28, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 12px;
}

#audioVisualizerCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.visualizer-overlay-info {
  position: absolute;
  top: 12px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  pointer-events: none;
}

.live-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(0, 245, 255, 0.3);
  border-radius: 999px;
  font-size: 0.72rem;
  font-family: var(--font-code);
  font-weight: 600;
  color: var(--neon-cyan);
  letter-spacing: 1px;
  white-space: nowrap;
  max-width: 100%;
}

.live-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neon-cyan);
  box-shadow: 0 0 10px var(--neon-cyan);
  animation: liveBlink 1.5s infinite;
}

@keyframes liveBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.viz-quick-modes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-width: 640px;
  margin: 0 auto 24px;
}

.viz-mode-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  padding: 8px 6px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.viz-mode-chip:hover {
  border-color: var(--neon-cyan);
  color: var(--text-primary);
}

.viz-mode-chip.active {
  background: var(--accent-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 12px rgba(0, 245, 255, 0.4);
}

/* Hero Player Layout */
.hero-player-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  align-items: center;
}

@media (max-width: 900px) {
  .hero-player-layout {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
}

/* 3D Vinyl Deck */
.vinyl-deck-wrapper {
  --vinyl-shift: 45px;
  position: relative;
  width: 250px;
  height: 250px;
  perspective: 1000px;
}

.vinyl-sleeve {
  position: absolute;
  top: 0;
  left: 0;
  width: 220px;
  height: 220px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: -8px 12px 30px rgba(0, 0, 0, 0.65);
  z-index: 4;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #111;
  transition: transform 0.4s ease;
}

.hero-cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sleeve-sheen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
  pointer-events: none;
}

/* The Vinyl Record */
.vinyl-record {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, #0e0e0e 0%, #1a1a1a 40%, #080808 70%, #151515 100%);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.08);
  z-index: 3;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.vinyl-grooves {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: repeating-radial-gradient(
    circle at center,
    transparent 0,
    transparent 4px,
    rgba(255, 255, 255, 0.03) 5px,
    rgba(0, 0, 0, 0.4) 6px
  );
}

.vinyl-reflection {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(
    from 45deg,
    transparent 0deg,
    rgba(255, 255, 255, 0.08) 45deg,
    transparent 90deg,
    rgba(255, 255, 255, 0.08) 225deg,
    transparent 270deg
  );
  pointer-events: none;
}

.vinyl-label {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #222;
  box-shadow: 0 0 8px rgba(0,0,0,0.8);
}

.vinyl-label-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.center-hole {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: #08090d;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Vinyl Playing State */
.is-playing .vinyl-record {
  transform: translateX(var(--vinyl-shift));
  animation: vinylSpin 4s linear infinite;
}

@keyframes vinylSpin {
  from { transform: translateX(var(--vinyl-shift)) rotate(0deg); }
  to { transform: translateX(var(--vinyl-shift)) rotate(360deg); }
}

/* Tonearm */
.tonearm {
  position: absolute;
  top: -15px;
  right: -5px;
  width: 70px;
  height: 120px;
  z-index: 5;
  pointer-events: none;
  transform-origin: 50px 10px;
  transform: rotate(-35deg);
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tonearm-base {
  position: absolute;
  top: 0;
  right: 15px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle, #e2e8f0 30%, #475569 100%);
  box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

.tonearm-arm {
  position: absolute;
  top: 18px;
  right: 25px;
  width: 4px;
  height: 90px;
  background: linear-gradient(to bottom, #94a3b8, #cbd5e1);
  border-radius: 2px;
  transform: rotate(-10deg);
  transform-origin: top center;
}

.tonearm-head {
  position: absolute;
  bottom: 0;
  left: 18px;
  width: 16px;
  height: 22px;
  background: #ef4444;
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.is-playing .tonearm {
  transform: rotate(5deg);
}

/* Track Details */
.hero-track-details {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.track-header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.genre-badge {
  background: rgba(0, 245, 255, 0.1);
  border: 1px solid rgba(0, 245, 255, 0.3);
  color: var(--neon-cyan);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.track-number-badge {
  font-family: var(--font-code);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hero-track-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.hero-track-tags {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* Scrubber */
.scrubber-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.time-readout {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-code);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.progress-bar-container {
  position: relative;
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  cursor: pointer;
  overflow: visible;
  transition: height 0.2s ease;
}

.progress-bar-container:hover {
  height: 10px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-gradient);
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(0, 245, 255, 0.6);
  pointer-events: none;
  transition: width 0.1s linear;
}

.progress-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 10px var(--neon-cyan);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.progress-bar-container:hover .progress-handle {
  opacity: 1;
}

/* Hero Controls Row */
.hero-controls-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
}

.ctrl-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  position: relative;
}

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

.ctrl-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  transform: scale(1.08);
}

.ctrl-btn.active {
  color: var(--neon-cyan);
}

.repeat-indicator {
  position: absolute;
  bottom: 4px;
  right: 4px;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--neon-cyan);
}

.play-btn-main {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--accent-gradient);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 24px rgba(0, 245, 255, 0.5);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.play-btn-main svg {
  width: 26px;
  height: 26px;
  color: #fff;
}

.play-btn-main:hover {
  transform: scale(1.1);
  box-shadow: 0 0 32px rgba(0, 245, 255, 0.8);
}

.volume-slider-group {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  border: 1px solid var(--border-glass);
}

.custom-range {
  -webkit-appearance: none;
  width: 80px;
  height: 5px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}

.custom-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--neon-cyan);
  box-shadow: 0 0 8px var(--neon-cyan);
  cursor: pointer;
}

.secondary-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  border-radius: 999px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.favorite-btn.active svg {
  fill: var(--neon-magenta);
  stroke: var(--neon-magenta);
  filter: drop-shadow(0 0 8px var(--neon-magenta));
}

/* Explorer Section */
.explorer-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.explorer-toolbar {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-box svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  padding: 14px 44px 14px 48px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  color: #fff;
  font-family: var(--font-main);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-box input:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 16px rgba(0, 245, 255, 0.25);
}

.clear-search-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
}

.toolbar-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.filter-tab-group {
  display: flex;
  gap: 8px;
}

.filter-tab {
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.filter-tab.active {
  background: rgba(0, 245, 255, 0.15);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

.badge {
  background: rgba(0, 245, 255, 0.2);
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
}

.sort-select-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.sort-select-wrapper select {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 8px;
  font-family: var(--font-main);
  outline: none;
  cursor: pointer;
}

/* Genre Tags Scroller */
.genre-tags-scroller {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 245, 255, 0.3) transparent;
}

.tag-chip {
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tag-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.tag-chip.active {
  background: rgba(114, 9, 183, 0.3);
  border-color: var(--neon-purple);
  color: #fff;
  box-shadow: 0 0 10px rgba(114, 9, 183, 0.4);
}

/* Grid Header */
.track-grid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.tip-shortcut {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Music Card Grid */
.music-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.music-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--card-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.music-card:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 245, 255, 0.35);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 245, 255, 0.15);
}

.music-card.is-active {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 24px rgba(0, 245, 255, 0.35);
  background: rgba(24, 30, 48, 0.9);
}

.card-cover-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #0d111a;
}

.card-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.music-card:hover .card-cover-img {
  transform: scale(1.06);
}

.card-overlay-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--accent-gradient);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 0 20px rgba(0, 245, 255, 0.6);
}

.card-overlay-btn svg {
  width: 22px;
  height: 22px;
  color: #fff;
}

.music-card:hover .card-overlay-btn {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.card-fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.card-fav-btn.favorited svg {
  fill: var(--neon-magenta);
  stroke: var(--neon-magenta);
}

.card-duration-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.75);
  font-family: var(--font-code);
  font-size: 0.72rem;
  color: #e2e8f0;
}

.card-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-genre {
  font-size: 0.8rem;
  color: var(--neon-cyan);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.card-lyrics-preview-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-lyrics-preview-btn:hover {
  color: var(--neon-cyan);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open .modal-content {
  transform: translateY(0);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.badge-mini {
  font-size: 0.7rem;
  color: var(--neon-cyan);
  font-weight: 700;
  letter-spacing: 1px;
}

.modal-title-group h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin: 4px 0;
}

.modal-title-group p {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-code);
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  color: #fff;
  font-size: 0.8rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  border-color: var(--neon-cyan);
  background: rgba(0, 245, 255, 0.15);
}

.close-modal-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
}

.close-modal-btn:hover {
  color: #fff;
}

.lyrics-body {
  padding: 24px;
  overflow-y: auto;
  font-size: 1rem;
  line-height: 1.8;
  color: #e2e8f0;
  white-space: pre-wrap;
  font-family: var(--font-main);
  background: rgba(0, 0, 0, 0.2);
}

/* EQ Modal */
.eq-presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  padding: 20px 24px;
}

.eq-preset-btn {
  display: flex;
  flex-direction: column;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.eq-preset-btn.active {
  background: rgba(0, 245, 255, 0.12);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0, 245, 255, 0.25);
}

.preset-name {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.preset-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.eq-sliders-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 10px 24px 24px 24px;
}

.eq-slider-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.eq-slider-col label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.eq-slider-col input[type="range"] {
  width: 100%;
  accent-color: var(--neon-cyan);
}

.eq-val {
  font-family: var(--font-code);
  font-size: 0.85rem;
  color: var(--neon-cyan);
}

/* Theater / Fullscreen Mode */
body.theater-active .hero-stage {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  margin: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: rgba(6, 8, 14, 0.98);
}

body.theater-active .visualizer-container {
  height: calc(100vh - 340px);
}

body.theater-active .explorer-section,
body.theater-active .main-header {
  display: none;
}

/* Utilities */
.hidden {
  display: none !important;
}

/* Security & Anti-Rip: Disable drag-and-drop & long-press on images and media */
img, audio {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* ==========================================================
   MOBILE RESPONSIVENESS & TOUCH OPTIMIZATION (iPhone & Android)
   ========================================================== */

/* Prevent any accidental horizontal scrolling */
html, body {
  max-width: 100vw;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* Tablet & Mobile (<= 768px) */
@media (max-width: 768px) {
  .app-wrapper {
    padding: 16px 12px max(40px, env(safe-area-inset-bottom)) 12px;
  }

  /* Header */
  .main-header {
    margin-bottom: 16px;
    gap: 12px;
  }

  .brand-title {
    font-size: 1.25rem;
  }

  .brand-logo-icon {
    width: 40px;
    height: 40px;
  }

  .brand-logo-icon svg {
    width: 22px;
    height: 22px;
  }

  .collection-tag {
    font-size: 0.65rem;
  }

  .action-pill-btn {
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  /* Hide lengthy visualizer label text on mobile, keep icon */
  #visualizerModeLabel {
    display: none;
  }

  /* Hero Stage */
  .hero-stage {
    padding: 16px 12px;
    margin-bottom: 20px;
    border-radius: 14px;
  }

  .visualizer-container {
    height: 150px;
    margin-bottom: 12px;
  }

  .visualizer-overlay-info {
    top: 8px;
    left: 10px;
    right: 10px;
  }

  .live-status-pill {
    padding: 3px 8px;
    font-size: 0.6rem;
    letter-spacing: 0.5px;
  }

  .viz-quick-modes {
    gap: 6px;
    margin-bottom: 28px;
  }

  .viz-mode-chip {
    min-height: 42px;
    padding: 6px 4px;
    font-size: 0.7rem;
    border-radius: 8px;
  }

  /* Hero Player Layout */
  .hero-player-layout {
    grid-template-columns: 1fr;
    gap: 20px;
    text-align: center;
  }

  /* Vinyl Deck scaled for mobile */
  .vinyl-deck-wrapper {
    --vinyl-shift: 58px;
    width: 290px;
    height: 250px;
    margin: 0 auto;
  }

  .vinyl-sleeve {
    width: 240px;
    height: 240px;
  }

  .vinyl-record {
    width: 216px;
    height: 216px;
    top: 12px;
    left: 12px;
  }

  .vinyl-label {
    width: 78px;
    height: 78px;
  }

  /* Track Title & Badges */
  .track-header-meta {
    justify-content: center;
  }

  .hero-track-title {
    font-size: 1.35rem;
  }

  .hero-track-tags {
    font-size: 0.85rem;
  }

  /* Mobile Touch Scrubber */
  .progress-bar-container {
    height: 10px;
    margin: 6px 0;
  }

  .progress-handle {
    opacity: 1; /* Always visible on mobile touch */
    width: 18px;
    height: 18px;
  }

  /* Controls Row on Mobile */
  .hero-controls-row {
    justify-content: center;
    gap: 12px;
  }

  .play-btn-main {
    width: 54px;
    height: 54px;
  }

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

  .ctrl-btn svg {
    width: 20px;
    height: 20px;
  }

  .volume-slider-group {
    order: 10;
    width: 100%;
    max-width: 260px;
    justify-content: center;
    margin-top: 4px;
  }

  .custom-range {
    width: 120px;
  }

  .secondary-btn {
    padding: 7px 14px;
    font-size: 0.82rem;
  }

  /* Explorer & Search */
  .explorer-toolbar {
    padding: 12px;
    gap: 10px;
  }

  .search-box input {
    font-size: 16px; /* Prevents iOS auto-zoom */
    padding: 12px 38px 12px 42px;
  }

  .toolbar-filters {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .filter-tab-group {
    width: 100%;
  }

  .filter-tab {
    flex: 1;
    justify-content: center;
    padding: 8px 12px;
    font-size: 0.82rem;
  }

  .sort-select-wrapper {
    justify-content: space-between;
    width: 100%;
  }

  .sort-select-wrapper select {
    flex: 1;
  }

  /* 2-Column Grid on Mobile (Spotify-style) */
  .music-card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .music-card {
    border-radius: 12px;
  }

  .card-content {
    padding: 10px;
    gap: 4px;
  }

  .card-title {
    font-size: 0.88rem;
    -webkit-line-clamp: 2;
  }

  .card-genre {
    font-size: 0.7rem;
  }

  .card-overlay-btn {
    opacity: 1; /* Show play button directly on touch screens */
    width: 38px;
    height: 38px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(0, 245, 255, 0.4);
    transform: translate(-50%, -50%) scale(0.9);
  }

  .card-overlay-btn svg {
    width: 16px;
    height: 16px;
  }

  .card-fav-btn {
    width: 28px;
    height: 28px;
    top: 6px;
    right: 6px;
  }

  .card-duration-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    bottom: 6px;
    right: 6px;
  }

  /* Modals on Mobile */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .modal-content {
    max-width: 100%;
    max-height: 88vh;
    border-radius: 20px 20px 0 0;
    margin: 0;
  }

  .modal-header {
    padding: 16px;
  }

  .modal-title-group h3 {
    font-size: 1.15rem;
  }

  .lyrics-body {
    padding: 16px;
    font-size: 0.92rem;
    line-height: 1.7;
  }

  .eq-presets-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 14px 16px;
    gap: 8px;
  }

  .eq-sliders-row {
    padding: 8px 16px 20px 16px;
    gap: 12px;
  }

  .tip-shortcut {
    display: none; /* Hide keyboard tips on mobile */
  }
}

/* Extra Small Phones (<= 380px) */
@media (max-width: 380px) {
  .music-card-grid {
    gap: 8px;
  }

  .card-content {
    padding: 8px;
  }

  .card-title {
    font-size: 0.82rem;
  }

  .hero-track-title {
    font-size: 1.15rem;
  }

  .vinyl-deck-wrapper {
    --vinyl-shift: 52px;
    width: 262px;
    height: 228px;
  }

  .vinyl-sleeve {
    width: 214px;
    height: 214px;
  }

  .vinyl-record {
    width: 192px;
    height: 192px;
    top: 11px;
    left: 11px;
  }

  .vinyl-label {
    width: 68px;
    height: 68px;
  }
}

