/**
 * Sonora Web Player — Obsidian Glass & Aurora Design System
 * File: website/player.css
 *
 * Architecture:
 * 1. Fonts & CSS Design Tokens (Palette, Surfaces, Typography, Glass, Shadows)
 * 2. Aurora Mesh Background & Visual Profiles (Immersive, Balanced, Classic)
 * 3. Base Reset & Glassmorphic Surfaces
 * 4. Micro-Typography & Tabular Numerics
 * 5. Modern Scrollbars (Standard Baseline + WebKit Fallbacks)
 * 6. TopBar, Sidebar & Spacial Navigation
 * 7. Bento Grid Dashboard System (Discover, Wrapped, Settings, DSP)
 * 8. Player Bar, Scrubber Timeline & Floating Tooltips
 * 9. Skeleton Loaders (Zero CLS) & View Transitions
 * 10. Micro-Interactions (Heart Burst, Click Ripple, Floating Tooltips)
 * 11. Synced Lyrics (LRC Karaoke with Depth Blur & Dual Mask)
 * 12. FFT Audio Visualizer (Neon Bars & Symmetrical Waveform Canvas)
 * 13. Modals & Dialogs (Auth 2FA, Party Sync, Lightbox Vinyl)
 * 14. Responsive Layout Breakpoints
 */

/* =============================================================================
   1. FONTS & CSS DESIGN TOKENS (Fonts preconnected & loaded via <link> in player.html)
   ============================================================================= */

:root {
  /* Surface Palette */
  --bg-void: #060608;
  --bg-surface: #0d0e13;
  --bg-surface-elevated: #14151c;
  --bg-surface-high: #1a1b24;
  --bg-recessed: #0a0b0e;

  /* Glassmorphism System */
  --glass-1st: rgba(18, 18, 22, 0.75);
  --glass-1st-border: rgba(255, 255, 255, 0.08);
  --glass-2nd: rgba(255, 255, 255, 0.03);
  --glass-2nd-hover: rgba(255, 255, 255, 0.06);
  --glass-2nd-border: rgba(255, 255, 255, 0.07);
  --glass-2nd-border-hover: rgba(255, 255, 255, 0.16);
  --glass-blur-1: 24px;
  --glass-blur-2: 16px;
  --glass-saturate: 180%;

  /* Sonora Brand Accents */
  --accent-green: #1DB954;
  --accent-green-bright: #1ED760;
  --accent-green-glow: rgba(29, 185, 84, 0.28);
  --accent-green-deep: rgba(29, 185, 84, 0.12);

  --accent-cyan: #06B6D4;
  --accent-cyan-bright: #22D3EE;
  --accent-cyan-glow: rgba(6, 182, 212, 0.28);

  --accent-purple: #A855F7;
  --accent-purple-bright: #C084FC;
  --accent-purple-glow: rgba(168, 85, 247, 0.28);

  --accent-emerald: #10B981;
  --accent-rose: #F43F5E;
  --accent-amber: #F59E0B;

  /* Hierarchical Text Tokens (WCAG AA Compliant Contrast) */
  --text-primary: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.78);
  --text-muted: rgba(255, 255, 255, 0.65);
  --text-sub: rgba(255, 255, 255, 0.50);
  --text-disabled: rgba(255, 255, 255, 0.35);

  /* Typography Font Stack */
  --font-sans: 'Satoshi', 'Inter', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Dynamic Aurora Colors (Overridden dynamically from cover art via JS) */
  --aurora-c1: rgba(29, 185, 84, 0.22);
  --aurora-c2: rgba(168, 85, 247, 0.18);
  --aurora-c3: rgba(6, 182, 212, 0.14);

  /* Shadows & Depth */
  --shadow-subtle: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-card-hover: 0 16px 40px -4px rgba(0, 0, 0, 0.7), 0 0 24px -4px var(--accent-green-glow);
  --shadow-floating: 0 24px 64px -8px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.12);
  --shadow-neon-green: 0 0 28px rgba(29, 185, 84, 0.35);

  /* Easing Curves */
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

  /* Scrollbar Theme Variables */
  --scrollbar-thumb: rgba(255, 255, 255, 0.14);
  --scrollbar-thumb-hover: rgba(255, 255, 255, 0.28);
  --scrollbar-track: transparent;
}

/* =============================================================================
   2. AURORA MESH BACKGROUND & VISUAL PROFILES
   ============================================================================= */
.aurora-backdrop {
  contain: strict;
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: clip !important;
  clip-path: inset(0);
  background-color: var(--bg-void);
  background-image: 
    radial-gradient(1200px 900px at 50% -120px, rgba(20, 24, 35, 0.75) 0%, transparent 70%),
    radial-gradient(1000px 700px at 100% 100%, rgba(12, 13, 18, 0.8) 0%, transparent 60%);
}

.aurora-mesh-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Ambient Mesh Canvas con sfocatura GPU */
.ambient-mesh-canvas {
  position: absolute;
  inset: -12%;
  width: 124%;
  height: 124%;
  pointer-events: none;
  filter: blur(85px) saturate(140%);
  opacity: 0.85;
  transform: translateZ(0);
  will-change: transform, filter;
  z-index: 0;
}

/* Vignettatura perimetrale: protegge il contrasto WCAG della Topbar e della Player Bar */
.aurora-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at 50% 50%,
    transparent 15%,
    rgba(6, 6, 8, 0.45) 70%,
    rgba(6, 6, 8, 0.90) 100%
  );
  z-index: 1;
}

.aurora-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  opacity: 0.85;
  mix-blend-mode: screen;
  contain: layout style;
}

.aurora-orb-1,
.aurora-orb-2,
.aurora-orb-3 {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.aurora-orb-1 {
  width: min(680px, 90vw);
  height: min(680px, 90vw);
  top: -100px;
  left: 0;
  background: radial-gradient(circle, var(--aurora-c1) 0%, transparent 70%);
}

.aurora-orb-2 {
  width: min(760px, 92vw);
  height: min(760px, 92vw);
  top: 18%;
  right: 0;
  background: radial-gradient(circle, var(--aurora-c2) 0%, transparent 70%);
}

.aurora-orb-3 {
  width: min(640px, 85vw);
  height: min(640px, 85vw);
  bottom: 0;
  left: 5vw;
  background: radial-gradient(circle, var(--aurora-c3) 0%, transparent 70%);
}

/* Profile 1: Immersivo (Default - Fluid Oscillating Animation) */
[data-theme-profile="immersive"] .aurora-orb-1 {
  animation: auroraFlow1 18s var(--ease-in-out) infinite alternate;
}
[data-theme-profile="immersive"] .aurora-orb-2 {
  animation: auroraFlow2 24s var(--ease-in-out) infinite alternate;
}
[data-theme-profile="immersive"] .aurora-orb-3 {
  animation: auroraFlow3 28s var(--ease-in-out) infinite alternate;
}

@keyframes auroraFlow1 {
  0% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.75; }
  50% { transform: translate3d(80px, 60px, 0) scale(1.12); opacity: 0.95; }
  100% { transform: translate3d(-40px, 110px, 0) scale(0.92); opacity: 0.70; }
}

@keyframes auroraFlow2 {
  0% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.65; }
  50% { transform: translate3d(-100px, -70px, 0) scale(1.15); opacity: 0.90; }
  100% { transform: translate3d(60px, 90px, 0) scale(0.88); opacity: 0.60; }
}

@keyframes auroraFlow3 {
  0% { transform: translate3d(0, 0, 0) scale(0.95); opacity: 0.55; }
  50% { transform: translate3d(120px, -80px, 0) scale(1.18); opacity: 0.85; }
  100% { transform: translate3d(-90px, 50px, 0) scale(1.02); opacity: 0.60; }
}

/* Profile 2: Bilanciato (Static Smooth Radial Gradient, 0% CPU overhead) */
[data-theme-profile="balanced"] .aurora-orb {
  animation: none !important;
  opacity: 0.60 !important;
  filter: blur(140px) !important;
}

/* Profile 3: Classico (Obsidian Monolith scuro minimale ad alto contrasto) */
[data-theme-profile="classic"] .aurora-orb {
  display: none !important;
}
[data-theme-profile="classic"] .aurora-backdrop {
  background-image: none !important;
  background-color: var(--bg-void) !important;
}

/* =============================================================================
   3. BASE RESET & GLASSMORPHIC SURFACES
   ============================================================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  background-color: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background-color: transparent;
  color: #E4E2E0;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
}

/* =============================================================================
   GLOBAL ACCESSIBILITY & FOCUS-VISIBLE SYSTEM (WCAG AA)
   ============================================================================= */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent-green-bright) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 12px var(--accent-green-glow) !important;
}

/* Explicit high-contrast focus rings on interactive elements */
button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 2px solid var(--accent-green-bright) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 14px var(--accent-green-glow) !important;
}

/* Input, search and textarea focus indicator */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  border-color: var(--accent-green-bright) !important;
  outline: 2px solid var(--accent-green-bright) !important;
  outline-offset: 1px !important;
  box-shadow: 0 0 12px var(--accent-green-glow) !important;
}

/* Navigation items focus */
.nav-link-btn:focus-visible {
  outline: 2px solid var(--accent-green-bright) !important;
  outline-offset: 1px !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

/* First-Level Glass (Sidebar, TopBar, Bottom Bar, Floating Panels) */
.glass-panel {
  background: var(--glass-1st);
  backdrop-filter: blur(var(--glass-blur-1)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur-1)) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-1st-border);
}

/* Secondary Glass (Cards, Modules, Bento Containers) */
.glass-card {
  background: var(--glass-2nd);
  backdrop-filter: blur(var(--glass-blur-2));
  -webkit-backdrop-filter: blur(var(--glass-blur-2));
  border: 1px solid var(--glass-2nd-border);
  box-shadow: var(--shadow-subtle);
  transition: all 0.24s var(--ease-smooth);
}

.glass-card:hover {
  background: var(--glass-2nd-hover);
  border-color: var(--glass-2nd-border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.glass-floating {
  background: rgba(18, 19, 25, 0.88);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-floating);
}

/* =============================================================================
   4. MICRO-TIPOGRAFIA & TABULAR NUMERICS
   ============================================================================= */
.tabular-nums,
.font-mono,
#time-current,
#time-total,
.metric-num,
.bitrate-badge,
.eq-gain-label,
.party-code-badge {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

/* Sleek Pill Badges with Positive Tracking */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1;
}

.badge-pro {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25) 0%, rgba(6, 182, 212, 0.25) 100%);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #E9D5FF;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.2);
}

.badge-lossless {
  background: rgba(29, 185, 84, 0.15);
  border: 1px solid rgba(29, 185, 84, 0.35);
  color: var(--accent-green-bright);
}

.badge-live {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #FCA5A5;
}

/* =============================================================================
   5. MODERN SCROLLBARS (Baseline Standard + WebKit Fallbacks)
   ============================================================================= */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

@supports not (scrollbar-color: auto) {
  ::-webkit-scrollbar {
    width: 5px;
    height: 5px;
  }
  ::-webkit-scrollbar-track {
    background: transparent;
  }
  ::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 9999px;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
  }
}

.no-scrollbar {
  scrollbar-width: none !important;
}
.no-scrollbar::-webkit-scrollbar {
  display: none !important;
}

/* =============================================================================
   6. TOPBAR, SIDEBAR & SPATIAL NAVIGATION
   ============================================================================= */
/* TopBar Navigation */
.header-topbar {
  height: 64px;
  background: var(--glass-1st);
  backdrop-filter: blur(var(--glass-blur-1)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur-1)) saturate(var(--glass-saturate));
  border-bottom: 1px solid var(--glass-1st-border);
  position: relative;
  z-index: 30;
}

/* Centered Search Bar with Shimmer Loading Line */
.search-wrapper {
  position: relative;
  width: 100%;
  max-width: 480px;
}

.search-input {
  width: 100%;
  height: 40px;
  padding-left: 2.75rem;
  padding-right: 5.75rem;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  font-size: 0.875rem;
  color: var(--text-primary);
  transition: all 0.2s var(--ease-smooth);
}

.search-input:focus {
  outline: none;
  background: rgba(0, 0, 0, 0.65);
  border-color: rgba(29, 185, 84, 0.5);
  box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.15), 0 0 16px rgba(29, 185, 84, 0.1);
}

.search-clear-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  z-index: 5;
}

.search-clear-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  transform: translateY(-50%) scale(1.08);
}

.search-clear-btn.hidden {
  display: none !important;
}

.search-kbd-badge {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.15rem 0.45rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-secondary);
  pointer-events: none;
  transition: opacity 0.15s ease;
}

/* Automatically hide Ctrl+K shortcut badge when clear button is active or input is filled */
.search-wrapper:has(#search-clear-btn:not(.hidden)) .search-kbd-badge,
.search-wrapper.has-value .search-kbd-badge {
  display: none !important;
}

/* Linear Shimmer Loading Indicator below Search Input */
.search-loading-shimmer {
  position: absolute;
  bottom: -2px;
  left: 1.25rem;
  right: 1.25rem;
  height: 2px;
  border-radius: 9999px;
  background: linear-gradient(90deg, transparent, var(--accent-green), var(--accent-cyan), transparent);
  background-size: 200% 100%;
  animation: searchShimmerMove 1.4s ease-in-out infinite;
  display: none;
}
.search-loading-shimmer.active {
  display: block;
}

@keyframes searchShimmerMove {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* User Profile with Glowing Pro Ring */
.profile-avatar-wrapper {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  padding: 1.5px;
  background: rgba(255, 255, 255, 0.15);
  transition: all 0.2s var(--ease-smooth);
}

.profile-avatar-wrapper.is-pro {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-green));
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.45);
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* Sidebar Styling & Nav Items */
.sidebar-wrapper {
  width: 260px;
  background: var(--glass-1st);
  backdrop-filter: blur(var(--glass-blur-1)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur-1)) saturate(var(--glass-saturate));
  border-right: 1px solid var(--glass-1st-border);
}

.nav-link-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.18s var(--ease-smooth);
  position: relative;
  text-align: left;
}

.nav-link-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link-btn.active {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.10);
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.nav-link-btn.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  bottom: 25%;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green);
}

/* =============================================================================
   7. BENTO GRID DASHBOARD SYSTEM
   ============================================================================= */
.bento-container {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.25rem;
}

.bento-card {
  border-radius: 20px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  background: var(--glass-2nd);
  backdrop-filter: blur(var(--glass-blur-2));
  -webkit-backdrop-filter: blur(var(--glass-blur-2));
  border: 1px solid var(--glass-2nd-border);
  box-shadow: var(--shadow-card);
  transition: all 0.28s var(--ease-smooth);
}

.bento-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  pointer-events: none;
}

.bento-card:hover {
  background: var(--glass-2nd-hover);
  border-color: var(--glass-2nd-border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.bento-col-3 { grid-column: span 3 / span 3; }
.bento-col-4 { grid-column: span 4 / span 4; }
.bento-col-6 { grid-column: span 6 / span 6; }
.bento-col-8 { grid-column: span 8 / span 8; }
.bento-col-9 { grid-column: span 9 / span 9; }
.bento-col-12 { grid-column: span 12 / span 12; }

/* Viewport media query fallbacks */
@media (max-width: 1024px) {
  .bento-col-3, .bento-col-4 { grid-column: span 6 / span 6; }
  .bento-col-8, .bento-col-9 { grid-column: span 12 / span 12; }
}

@media (max-width: 768px) {
  .bento-container { grid-template-columns: 1fr; }
  .bento-col-3, .bento-col-4, .bento-col-6, .bento-col-8, .bento-col-9, .bento-col-12 {
    grid-column: span 1 / span 1;
  }
}

/* Container Queries for Bento Grid: adapt when sidebar or drawer changes viewport width */
@container main-viewport (max-width: 1024px) {
  .bento-col-3, .bento-col-4 { grid-column: span 6 / span 6; }
  .bento-col-8, .bento-col-9 { grid-column: span 12 / span 12; }
}

@container main-viewport (max-width: 680px) {
  .bento-container { grid-template-columns: 1fr; }
  .bento-col-3, .bento-col-4, .bento-col-6, .bento-col-8, .bento-col-9, .bento-col-12 {
    grid-column: span 1 / span 1;
  }
}

/* Hero Discover Banner */
.hero-glass-banner {
  border-radius: 24px;
  padding: 2rem;
  position: relative;
  overflow: clip !important;
  contain: paint !important;
  background: linear-gradient(135deg, rgba(29, 185, 84, 0.08) 0%, rgba(6, 182, 212, 0.05) 50%, rgba(168, 85, 247, 0.06) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.hero-glass-banner::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(29, 185, 84, 0.25) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

/* Track Card (Charts & Search) */
.track-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.85rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
}

.track-card-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* =============================================================================
   8. PLAYER BAR, SCRUBBER TIMELINE & FLOATING TOOLTIPS
   ============================================================================= */
.master-player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100vw;
  height: 94px;
  background: var(--glass-1st);
  backdrop-filter: blur(var(--glass-blur-1)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur-1)) saturate(var(--glass-saturate));
  border-top: 1px solid var(--glass-1st-border);
  z-index: 50;
  flex-shrink: 0;
  overflow-x: clip !important;
}

#main-content-viewport {
  container-type: inline-size;
  container-name: main-viewport;
  padding-bottom: 116px !important;
}

/* Artwork Box with Dynamic Glow & Expand Trigger */
.player-cover-box {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
  box-shadow: 0 8px 24px -4px var(--aurora-c1), 0 4px 12px rgba(0, 0, 0, 0.5);
  transition: all 0.25s var(--ease-smooth);
}

.player-cover-box:hover {
  transform: scale(1.04);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6), 0 0 20px var(--accent-green-glow);
}

.cover-expand-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  cursor: pointer;
}

.player-cover-box:hover .cover-expand-overlay {
  opacity: 1;
}

/* Master Play/Pause Circular Glass Button */
.btn-play-pause-master {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #FFFFFF;
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.35), 0 4px 12px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s var(--ease-bounce), box-shadow 0.2s ease, background 0.2s ease;
  cursor: pointer;
}

.btn-play-pause-master:hover {
  transform: scale(1.08);
  background: #F8FAFC;
  box-shadow: 0 0 32px rgba(255, 255, 255, 0.55), 0 6px 16px rgba(0, 0, 0, 0.6);
}

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

/* Buffering / Loading Ring Indicator (Block 5) */
.btn-play-pause-master.is-buffering {
  box-shadow: 0 0 28px var(--accent-green-glow), 0 4px 12px rgba(0, 0, 0, 0.5);
}

.btn-play-pause-master.is-buffering::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  border-top-color: var(--accent-green-bright);
  border-right-color: rgba(29, 185, 84, 0.35);
  animation: son-spinner 0.8s linear infinite;
  box-shadow: 0 0 14px var(--accent-green-glow);
  pointer-events: none;
  z-index: 10;
}

@keyframes son-spinner {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Controls Active Neon Dot Indicator (Shuffle, Repeat) */
.btn-player-action {
  position: relative;
  padding: 0.5rem;
  color: var(--text-muted);
  border-radius: 50%;
  transition: all 0.18s var(--ease-smooth);
  cursor: pointer;
}

.btn-player-action:hover {
  color: var(--text-primary);
  transform: scale(1.05);
}

.btn-player-action:active {
  transform: scale(0.94);
}

.btn-player-action.active,
.btn-player-action.has-active-dot {
  color: var(--accent-green-bright) !important;
}

.btn-player-action.has-active-dot::after {
  content: '';
  position: absolute;
  bottom: 0px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

/* Scrubber Timeline Container & Expanding Track */
.scrubber-track-container {
  position: relative;
  width: 100%;
  height: 18px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}

.scrubber-track-bg {
  position: relative;
  width: 100%;
  height: 3.5px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  overflow: visible;
  transition: height 0.2s var(--ease-smooth);
}

.scrubber-track-container:hover .scrubber-track-bg {
  height: 6px;
}

/* Audio Pre-buffer Bar */
.scrubber-buffer-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 9999px;
  pointer-events: none;
  transition: width 0.3s ease;
}

/* Audio Playback Current Fill Bar */
.scrubber-fill-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-green) 0%, var(--accent-green-bright) 100%);
  border-radius: 9999px;
  pointer-events: none;
  box-shadow: 0 0 10px var(--accent-green-glow);
}

/* Scrubber Thumb */
.scrubber-thumb-handle {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 0 12px var(--accent-green), 0 2px 6px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  transition: transform 0.16s var(--ease-bounce);
}

.scrubber-track-container:hover .scrubber-thumb-handle,
.scrubber-track-container.dragging .scrubber-thumb-handle {
  transform: translate(-50%, -50%) scale(1.15);
}

/* Floating Exact Timestamp Tooltip */
.scrubber-hover-tooltip {
  position: absolute;
  bottom: 22px;
  transform: translateX(-50%);
  padding: 0.25rem 0.55rem;
  background: rgba(14, 15, 20, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
  z-index: 60;
}

.scrubber-track-container:hover .scrubber-hover-tooltip,
.scrubber-track-container.dragging .scrubber-hover-tooltip {
  opacity: 1;
  visibility: visible;
}

/* Volume Slider Bar */
.volume-slider-container {
  position: relative;
  width: 90px;
  height: 18px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}

.volume-slider-bg {
  position: relative;
  width: 100%;
  height: 3.5px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 9999px;
  overflow: visible;
  transition: height 0.18s ease;
}

.volume-slider-container:hover .volume-slider-bg,
.volume-slider-container.dragging .volume-slider-bg {
  height: 5px;
}

.volume-slider-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--text-primary);
  border-radius: 9999px;
  transition: background-color 0.15s ease;
  pointer-events: none;
}

.volume-slider-container:hover .volume-slider-fill,
.volume-slider-container.dragging .volume-slider-fill {
  background: var(--accent-green-bright);
}

.volume-slider-thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 0 8px var(--accent-green), 0 2px 4px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  transition: transform 0.15s var(--ease-bounce);
}

.volume-slider-container:hover .volume-slider-thumb,
.volume-slider-container.dragging .volume-slider-thumb {
  transform: translate(-50%, -50%) scale(1.1);
}

/* Master Player Accessibility Focus Visible */
.btn-player-action:focus-visible,
.btn-play-pause-master:focus-visible,
.scrubber-track-container:focus-visible,
.volume-slider-container:focus-visible,
.cover-expand-overlay:focus-visible,
#bottom-heart-btn:focus-visible,
#btn-volume-icon:focus-visible,
.player-bar-right button:focus-visible {
  outline: 2px solid var(--accent-green-bright) !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 14px var(--accent-green-glow) !important;
}

.scrubber-track-container:focus-visible .scrubber-thumb-handle {
  transform: translate(-50%, -50%) scale(1.2) !important;
  box-shadow: 0 0 16px var(--accent-green-bright), 0 0 0 2px #ffffff !important;
}

.volume-slider-container:focus-visible .volume-slider-thumb {
  transform: translate(-50%, -50%) scale(1.2) !important;
  box-shadow: 0 0 16px var(--accent-green-bright), 0 0 0 2px #ffffff !important;
}

/* Touch Device Thumb Handle Visibility */
@media (pointer: coarse) {
  .scrubber-thumb-handle {
    transform: translate(-50%, -50%) scale(0.9) !important;
  }
  .volume-slider-thumb {
    transform: translate(-50%, -50%) scale(0.9) !important;
  }
}

/* Ultra-Wide Layout Balance */
@media (min-width: 1440px) {
  .player-bar-left {
    max-width: 340px;
    flex: 1 0 auto;
  }
  .player-bar-center {
    max-width: 680px;
    flex: 2 1 auto;
  }
  .player-bar-right {
    max-width: 360px;
    flex: 1 0 auto;
  }
}

/* Responsive 2-Tier Player Bar for Mobile & Compact Screens (< 768px) */
@media (max-width: 767px) {
  .master-player-bar {
    height: calc(74px + env(safe-area-inset-bottom, 0px)) !important;
    padding: 0 0.875rem max(0.4rem, env(safe-area-inset-bottom, 0px)) !important;
    gap: 0.5rem !important;
  }

  #main-content-viewport {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
  }

  /* Tier 1: Scrubber timeline stretched across top edge of bar with finger-friendly touch target */
  .player-timeline-wrapper {
    position: absolute !important;
    top: -12px !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    padding: 0 !important;
    gap: 0 !important;
    z-index: 60 !important;
  }

  .player-timeline-wrapper #time-current,
  .player-timeline-wrapper #time-total {
    display: none !important;
  }

  .player-timeline-wrapper .scrubber-track-container {
    height: 24px !important;
    display: flex !important;
    align-items: center !important;
    cursor: pointer !important;
    touch-action: none !important;
  }

  .player-timeline-wrapper .scrubber-track-bg {
    height: 3.5px !important;
    border-radius: 0 !important;
    background: rgba(255, 255, 255, 0.18) !important;
  }

  .player-timeline-wrapper .scrubber-thumb-handle {
    width: 12px !important;
    height: 12px !important;
    transform: translate(-50%, -50%) scale(1) !important;
  }

  /* Tier 2 Left: Track Metadata */
  .player-bar-left {
    width: auto !important;
    min-width: 0 !important;
    flex: 1 1 0% !important;
    max-width: calc(100% - 130px) !important;
    gap: 0.5rem !important;
  }

  .player-cover-box {
    width: 44px !important;
    height: 44px !important;
    border-radius: 8px !important;
  }

  #bottom-track-title {
    font-size: 0.8125rem !important;
    max-width: 100% !important;
  }

  #bottom-track-artist {
    font-size: 0.6875rem !important;
    max-width: 100% !important;
  }

  #bottom-heart-btn {
    padding: 0.35rem !important;
  }

  /* Tier 2 Right: Grouped Playback Controls */
  .player-bar-center {
    width: auto !important;
    max-width: none !important;
    flex: 0 0 auto !important;
    align-items: center !important;
  }

  .player-controls-group {
    gap: 0.5rem !important;
  }

  #btn-shuffle,
  #btn-repeat,
  #btn-prev {
    display: none !important;
  }

  .btn-play-pause-master {
    width: 42px !important;
    height: 42px !important;
  }

  .btn-play-pause-master svg {
    width: 1.25rem !important;
    height: 1.25rem !important;
  }

  /* Right secondary panels hidden on mobile */
  .player-bar-right {
    display: none !important;
  }
}

/* =============================================================================
   9. SKELETON LOADERS (Zero CLS) & CONTINUOUS ANGULAR SHIMMER
   ============================================================================= */
@keyframes shimmerPulse {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes shimmerAngularSweep {
  0% { background-position: -200% -200%; }
  100% { background-position: 200% 200%; }
}

.skeleton-shimmer {
  background: linear-gradient(
    115deg, 
    rgba(255, 255, 255, 0.02) 0%, 
    rgba(255, 255, 255, 0.04) 28%,
    rgba(255, 255, 255, 0.12) 50%, 
    rgba(255, 255, 255, 0.04) 72%,
    rgba(255, 255, 255, 0.02) 100%
  );
  background-size: 250% 250%;
  animation: shimmerAngularSweep 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  border-radius: 12px;
  will-change: background-position;
}

.skeleton-track-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

/* =============================================================================
   TRACK ROWS: 60/120 FPS STAGGERED ENTRANCE & MICROSCOPIC LIFT
   ============================================================================= */
@keyframes trackRowFadeIn {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.track-row {
  opacity: 0;
  animation: trackRowFadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, box-shadow 0.2s ease;
  will-change: transform, opacity;
}

.track-row:nth-child(1)  { animation-delay: 0ms; }
.track-row:nth-child(2)  { animation-delay: 20ms; }
.track-row:nth-child(3)  { animation-delay: 40ms; }
.track-row:nth-child(4)  { animation-delay: 60ms; }
.track-row:nth-child(5)  { animation-delay: 80ms; }
.track-row:nth-child(6)  { animation-delay: 100ms; }
.track-row:nth-child(7)  { animation-delay: 120ms; }
.track-row:nth-child(8)  { animation-delay: 140ms; }
.track-row:nth-child(9)  { animation-delay: 160ms; }
.track-row:nth-child(10) { animation-delay: 180ms; }
.track-row:nth-child(11) { animation-delay: 200ms; }
.track-row:nth-child(12) { animation-delay: 220ms; }
.track-row:nth-child(13) { animation-delay: 240ms; }
.track-row:nth-child(14) { animation-delay: 260ms; }
.track-row:nth-child(15) { animation-delay: 280ms; }
.track-row:nth-child(16) { animation-delay: 300ms; }
.track-row:nth-child(17) { animation-delay: 320ms; }
.track-row:nth-child(18) { animation-delay: 340ms; }
.track-row:nth-child(19) { animation-delay: 360ms; }
.track-row:nth-child(20) { animation-delay: 380ms; }
.track-row:nth-child(n+21) {
  opacity: 1;
  animation: none;
}

.track-row:hover {
  transform: translateY(-1px) !important;
  background-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.track-row:active {
  transform: translateY(0) !important;
}

/* Hit bridge to prevent hover-thrashing and cursor flicker at borders during translateY transitions */
.track-row,
.track-card-row,
.search-chip,
.glass-card {
  position: relative;
}

.track-row {
  overflow: visible !important;
}

.track-row::after,
.track-card-row::after,
.search-chip::after,
.glass-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: -4px;
  pointer-events: auto;
  z-index: 0;
}

.track-row > *,
.track-card-row > *,
.search-chip > * {
  position: relative;
  z-index: 1;
}

/* Ensure consistent pointer cursor across all card elements, buttons and action icons */
button,
[role="button"],
.track-row,
.track-row button,
.track-card-row,
.track-card-row button,
.search-chip,
.search-chip button,
.glass-card button {
  cursor: pointer;
}

#search-recent-chips .glass-card:hover {
  transform: translateY(-1px);
}

/* =============================================================================
   VIEW TRANSITIONS API & CSS FALLBACK (Cinema-grade 60/120 FPS SPA Navigation)
   ============================================================================= */
#main-content-viewport {
  view-transition-name: main-viewport;
}

::view-transition-group(main-viewport) {
  animation-duration: 240ms;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

/* 1. Standard Section Transition (Cross-fade + subtle vertical slide) */
html:not([data-nav-direction="forward"]):not([data-nav-direction="backward"]):active-view-transition-type(standard)::view-transition-old(main-viewport),
html[data-nav-direction="standard"]::view-transition-old(main-viewport),
html:not([data-nav-direction])::view-transition-old(main-viewport) {
  animation: viewStandardFadeOut 200ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

html:not([data-nav-direction="forward"]):not([data-nav-direction="backward"]):active-view-transition-type(standard)::view-transition-new(main-viewport),
html[data-nav-direction="standard"]::view-transition-new(main-viewport),
html:not([data-nav-direction])::view-transition-new(main-viewport) {
  animation: viewStandardSlideUp 200ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes viewStandardFadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-4px); }
}

@keyframes viewStandardSlideUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 2. Detail Navigation: Forward (Slide right-to-left + fade) */
html:active-view-transition-type(forward)::view-transition-old(main-viewport),
html[data-nav-direction="forward"]::view-transition-old(main-viewport) {
  animation: viewSlideToLeft 240ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

html:active-view-transition-type(forward)::view-transition-new(main-viewport),
html[data-nav-direction="forward"]::view-transition-new(main-viewport) {
  animation: viewSlideFromRight 240ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes viewSlideToLeft {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(-35px); }
}

@keyframes viewSlideFromRight {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

/* 3. Detail Navigation: Backward (Slide left-to-right reverse) */
html:active-view-transition-type(backward)::view-transition-old(main-viewport),
html[data-nav-direction="backward"]::view-transition-old(main-viewport) {
  animation: viewSlideToRight 240ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

html:active-view-transition-type(backward)::view-transition-new(main-viewport),
html[data-nav-direction="backward"]::view-transition-new(main-viewport) {
  animation: viewSlideFromLeft 240ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes viewSlideToRight {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(50px); }
}

@keyframes viewSlideFromLeft {
  from { opacity: 0; transform: translateX(-35px); }
  to { opacity: 1; transform: translateX(0); }
}

/* CSS Fallback Classes for View Transitions */
.view-enter-standard {
  animation: viewStandardSlideUp 200ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.view-enter-forward {
  animation: viewSlideFromRight 240ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.view-enter-backward {
  animation: viewSlideFromLeft 240ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Legacy entry class preserved */
.view-enter-active {
  animation: viewStandardSlideUp 200ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* =============================================================================
   10. MICRO-INTERACTIONS & TOOLTIPS
   ============================================================================= */
/* Heart Burst Elastic Pop (scale 0.8 -> 1.25 -> 1.0 with emerald color) */
@keyframes heartBurstPop {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(0.8);
  }
  60% {
    transform: scale(1.25);
    color: #10b981;
  }
  100% {
    transform: scale(1);
    color: #10b981;
  }
}

.heart-burst {
  animation: heartBurstPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards !important;
  will-change: transform;
}

/* Play/Pause Button Outer Ripple & Subtle Morph Rotation */
@keyframes playPauseRipple {
  0% {
    transform: scale(0.92);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6), 0 0 24px rgba(255, 255, 255, 0.4);
  }
  50% {
    transform: scale(1.06);
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0.25), 0 0 32px rgba(16, 185, 129, 0.4);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 14px rgba(16, 185, 129, 0), 0 0 24px rgba(255, 255, 255, 0.35);
  }
}

.btn-play-pause-master.state-pulse {
  animation: playPauseRipple 0.36s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.btn-play-pause-master svg,
#play-pause-icon,
#now-playing-play-pause-icon {
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.18s ease;
  will-change: transform;
}

.btn-play-pause-master.state-pulse svg,
.btn-play-pause-master.state-pulse #play-pause-icon,
.btn-play-pause-master.state-pulse #now-playing-play-pause-icon {
  transform: rotate(12deg) scale(0.94);
}

/* Universal Button Click Feedback */
.btn-press:active {
  transform: scale(0.96);
}

/* Studio Tooltip System */
/* Studio Tooltip System (400ms Delay) */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  max-width: 0;
  max-height: 0;
  padding: 0;
  border: 0 solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  background: rgba(14, 15, 20, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 6px;
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease 0.4s, transform 0.2s ease 0.4s;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
  z-index: 100;
}

[data-tooltip]:hover::before {
  max-width: 320px;
  max-height: 60px;
  padding: 0.35rem 0.65rem;
  border-width: 1px;
  overflow: visible;
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Header TopBar tooltips: flip downwards into viewport so they are never clipped or outside screen */
.header-topbar [data-tooltip]::before,
[data-tooltip-pos="bottom"]::before {
  bottom: auto;
  top: calc(100% + 8px);
  transform: translateX(-50%) translateY(-4px);
}

.header-topbar [data-tooltip]:hover::before,
[data-tooltip-pos="bottom"]:hover::before {
  transform: translateX(-50%) translateY(0);
}

/* Header right-aligned controls: prevent horizontal clipping on the right edge */
.header-topbar .flex-shrink-0 [data-tooltip]::before,
.header-topbar [data-tooltip-align="right"]::before {
  left: auto;
  right: 0;
  transform: translateY(-4px);
}

.header-topbar .flex-shrink-0 [data-tooltip]:hover::before,
.header-topbar [data-tooltip-align="right"]:hover::before {
  transform: translateY(0);
}

@media (hover: none), (pointer: coarse) {
  [data-tooltip]::before {
    display: none !important;
  }
}

/* Neon Glow for Liked Heart State */
#bottom-heart-btn.is-liked i,
#bottom-heart-btn svg.fill-emerald-400,
.track-card-row svg.fill-emerald-400 {
  filter: drop-shadow(0 0 8px rgba(29, 185, 84, 0.7));
}

/* Drag & Drop Visual Cue for Queue Reordering */
.draggable-track-item {
  cursor: grab;
  transition: background 0.18s, transform 0.18s, box-shadow 0.18s;
}
.draggable-track-item:active {
  cursor: grabbing;
}
.draggable-track-item.is-dragging {
  opacity: 0.45;
  transform: scale(0.98);
  border: 1px dashed rgba(255, 255, 255, 0.3);
}
.drag-placeholder-drop {
  border: 2px dashed var(--accent-green);
  background: rgba(29, 185, 84, 0.08);
  border-radius: 12px;
  height: 52px;
  margin: 4px 0;
}

/* =============================================================================
   11. SYNCED LYRICS (LRC Karaoke with Depth Blur & Dual Mask)
   ============================================================================= */
.lyrics-stage-container {
  position: relative;
  max-width: 780px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
  overflow-y: auto;
  max-height: calc(100vh - 210px);
  scroll-behavior: smooth;
  
  /* Baseline Dual Fade Linear Gradient Mask */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
}

.lyric-row,
.lyric-line {
  padding: 1.15rem 1rem;
  font-size: 1.35rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  border-radius: 16px;
  line-height: 1.45;
  
  /* Inactive Lines: progressive depth blur and 30% opacity */
  color: rgba(255, 255, 255, 0.35);
  filter: blur(1.5px);
  transform: scale(0.96);
  transition: all 0.32s var(--ease-smooth);
}

.lyric-row:hover,
.lyric-line:hover {
  color: rgba(255, 255, 255, 0.75);
  filter: blur(0px);
  background: rgba(255, 255, 255, 0.02);
}

/* Active Lyric Line: enlarged, white, ambient neon text glow */
.lyric-row.active,
.lyric-active {
  color: #FFFFFF !important;
  font-size: 1.75rem !important;
  font-weight: 800 !important;
  filter: blur(0px) !important;
  transform: scale(1.04) !important;
  text-shadow: 
    0 0 24px rgba(29, 185, 84, 0.55),
    0 0 48px rgba(29, 185, 84, 0.25);
  background: rgba(255, 255, 255, 0.04);
}

.lyric-row.passed {
  color: rgba(255, 255, 255, 0.22);
  filter: blur(1.8px);
}

/* =============================================================================
   12. FFT AUDIO VISUALIZER (Neon Bars & Symmetrical Waveform Canvas)
   ============================================================================= */
.fft-canvas-card {
  position: relative;
  width: 100%;
  height: 200px;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.fft-canvas-card canvas {
  width: 100%;
  height: 100%;
  display: block;
  /* Mask gradient for soft edge blend */
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
}

.fft-mode-pills {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.fft-mode-btn {
  padding: 4px 10px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 7px;
  color: var(--text-secondary);
  transition: all 0.16s ease;
}

.fft-mode-btn.active {
  background: var(--accent-green);
  color: #000000;
}

/* =============================================================================
   13. MODALS & DIALOGS
   ============================================================================= */
.modal-backdrop-blur {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 1rem;
  animation: modalFadeIn 0.22s var(--ease-smooth);
}

.modal-content-glass {
  width: 100%;
  max-width: 440px;
  background: rgba(18, 19, 25, 0.9);
  backdrop-filter: blur(36px) saturate(200%);
  -webkit-backdrop-filter: blur(36px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  padding: 2rem;
  box-shadow: var(--shadow-floating);
  animation: modalScaleUp 0.26s var(--ease-bounce);
}

@media (max-width: 640px) {
  .modal-backdrop-blur {
    padding: 0.75rem !important;
    align-items: flex-end sm:align-items-center !important;
  }
  .modal-content-glass {
    padding: 1.5rem 1.15rem !important;
    border-radius: 24px 24px 16px 16px !important;
    max-height: 88dvh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* Profile Dropdown Context Menu (cubic-bezier(0.16, 1, 0.3, 1)) */
.profile-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 250px;
  background: rgba(18, 19, 25, 0.95);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 0.6rem;
  box-shadow: var(--shadow-floating);
  animation: dropdownSlideDown 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transform-origin: top right;
  z-index: 100;
}

.profile-dropdown-menu.hidden {
  display: none !important;
}

@keyframes dropdownSlideDown {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.profile-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.16s ease;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
}

.profile-menu-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #FFFFFF;
  transform: translateX(2px);
}

.profile-menu-item.danger:hover {
  background: rgba(244, 63, 94, 0.15);
  color: #FDA4AF;
}

/* Lyrics Empty State */
.lyrics-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-style: italic;
  text-align: center;
}

/* =============================================================================
   14. RESPONSIVE LAYOUT BREAKPOINTS
   ============================================================================= */
@media (max-width: 1024px) {
  .sidebar-wrapper {
    width: 220px;
  }
}

/* Tablet Layout Adjustments (768px to 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .sidebar-wrapper {
    width: 200px !important;
  }

  .master-player-bar {
    padding: 0 0.75rem !important;
    gap: 0.5rem !important;
    max-width: 100vw !important;
    overflow: hidden !important;
  }

  .player-bar-left {
    min-width: 0 !important;
    max-width: 175px !important;
    flex: 0 1 175px !important;
    gap: 0.4rem !important;
  }

  .player-bar-left .player-cover-box {
    width: 42px !important;
    height: 42px !important;
  }

  #bottom-track-title {
    max-width: 90px !important;
    font-size: 0.8125rem !important;
  }

  #bottom-track-artist {
    max-width: 90px !important;
    font-size: 0.6875rem !important;
  }

  .player-bar-center {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    max-width: 320px !important;
  }

  .player-timeline-wrapper {
    gap: 0.4rem !important;
  }

  .player-timeline-wrapper #time-current,
  .player-timeline-wrapper #time-total {
    font-size: 0.6875rem !important;
    min-width: 30px !important;
  }

  .player-bar-right {
    min-width: 0 !important;
    flex: 0 1 auto !important;
    gap: 0.15rem !important;
  }

  .player-bar-right .volume-slider-container {
    width: 48px !important;
  }

  #btn-bottom-quality,
  #btn-bottom-visualizer {
    display: none !important;
  }
}

.glass-card {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

#italian-charts-grid {
  min-width: 0 !important;
  max-width: 100% !important;
}

#italian-charts-grid > * {
  min-width: 0 !important;
  max-width: 100% !important;
}

@media (max-width: 767px) {
  /* Sidebar come drawer off-canvas: navigazione primaria accessibile anche su telefono. */
  .sidebar-wrapper {
    display: flex !important;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    height: 100dvh;
    width: 270px;
    max-width: 85vw;
    z-index: 60;
    background: #121414;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    padding-top: max(1rem, env(safe-area-inset-top, 0px)) !important;
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px)) !important;
  }
  .sidebar-wrapper.mobile-open {
    transform: translateX(0);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
  }
  .search-wrapper {
    max-width: 100%;
  }
}

/* Mobile-only helpers: nascosti su desktop, visibili <=768px. */
.mobile-only {
  display: none !important;
}
#mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 55;
  border: 0;
  padding: 0;
}
#mobile-nav-backdrop.hidden {
  display: none !important;
}
@media (max-width: 768px) {
  .mobile-only {
    display: flex !important;
  }
}

/* Sonora Toast notifications */
#sonora-toast-host {
  position: fixed;
  left: 50%;
  bottom: 110px;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: min(92vw, 420px);
}
.sonora-toast {
  pointer-events: auto;
  max-width: 100%;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: rgba(25, 28, 27, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.sonora-toast--info { border-color: rgba(255, 255, 255, 0.18); }
.sonora-toast--success { border-color: rgba(16, 185, 129, 0.5); }
.sonora-toast--error { border-color: rgba(244, 63, 94, 0.5); }
.sonora-toast--out { opacity: 0; transform: translateY(10px); }

/* Reduced Motion Accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .aurora-orb {
    animation: none !important;
  }
}

/* YouTube IFrame Anti-Throttling Container & Responsive Embed */
#yt-player-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 200px;
  height: 200px;
  opacity: 0.001;
  pointer-events: none;
  z-index: -50;
  overflow: hidden;
}

#yt-player-wrapper iframe {
  width: 100% !important;
  height: 100% !important;
}

/* =============================================================================
   15. PARITY EXTENSIONS: SEARCH, DEEZER DETAILS & FULLSCREEN LYRICS
   ============================================================================= */

/* Search Filter Chips */
.search-chip {
  padding: 0.45rem 1.15rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8125rem;
  font-weight: 700;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  white-space: nowrap;
}

.search-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.search-chip.active {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.25);
}

/* Category Browse Cards (Generi, Moods, Decadi) */
.category-browse-card {
  position: relative;
  overflow: hidden;
  border-radius: 1.25rem;
  padding: 1.15rem;
  min-height: 104px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.category-browse-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
  border-color: rgba(255, 255, 255, 0.2);
}

.category-browse-card h4 {
  font-size: 1.1rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.02em;
  z-index: 2;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.category-browse-card .category-icon {
  position: absolute;
  bottom: -4px;
  right: -4px;
  opacity: 0.25;
  transform: rotate(12deg);
  pointer-events: none;
  transition: all 0.3s ease;
}

.category-browse-card:hover .category-icon {
  transform: rotate(4deg) scale(1.15);
  opacity: 0.45;
}

/* Search Top Result Card */
#search-top-result-card {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#search-top-result-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}

.top-result-play-btn {
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#search-top-result-card:hover .top-result-play-btn {
  opacity: 1;
  transform: translateY(0);
}

/* Fullscreen Lyrics Karaoke Modal: Fade-in from bottom with progressive reveal */
#lyrics-fullscreen-modal {
  animation: lyricsModalSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform, opacity;
}

@keyframes lyricsModalSlideUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lyrics-stage-scroll {
  scroll-behavior: smooth;
  mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
}

@keyframes lyricLineStagger {
  0% {
    opacity: 0;
    transform: translateY(14px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

#lyrics-fullscreen-lines .lyric-row {
  font-size: var(--lyrics-font-size, 2rem) !important;
  font-weight: 800;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  padding: 0.75rem 1.25rem;
  border-radius: 1.25rem;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              color 0.25s ease,
              background 0.25s ease !important;
  will-change: transform, filter;
  animation: lyricLineStagger 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(min(var(--line-index, 0), 20) * 20ms);
}

#lyrics-fullscreen-lines .lyric-row:hover {
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.04);
}

#lyrics-fullscreen-lines .lyric-row.active {
  color: #ffffff !important;
  font-size: calc(var(--lyrics-font-size, 2rem) * 1.15) !important;
  font-weight: 900 !important;
  transform: scale(1.03) !important;
  filter: brightness(1.2) !important;
  opacity: 1 !important;
  text-shadow: 
    0 0 24px rgba(255, 255, 255, 0.45),
    0 0 48px rgba(16, 185, 129, 0.3);
  background: rgba(255, 255, 255, 0.06);
}

#lyrics-fullscreen-lines .lyric-row.passed {
  color: rgba(255, 255, 255, 0.45);
  filter: blur(0.5px);
}

/* Enable text selection for inputs, editable elements, and lyrics */
input, textarea, select, [contenteditable="true"], .lyrics-line, .lyric-row, #full-lyrics-container, #lyrics-container, #lyrics-fullscreen-lines {
  user-select: text !important;
  -webkit-user-select: text !important;
}

/* Z-Index Hierarchy Standardization & Drawer 60/120 FPS Fluid Slide */
@keyframes drawerSlideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes drawerSlideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

#right-side-drawer {
  z-index: 40 !important;
  will-change: transform;
}

#right-side-drawer:not(.hidden) {
  animation: drawerSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#right-side-drawer.drawer-closing {
  animation: drawerSlideOut 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

.drawer-backdrop {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity;
}

.drawer-backdrop.active,
.drawer-backdrop:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 767px) {
  #right-side-drawer {
    position: fixed !important;
    top: 64px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: calc(74px + env(safe-area-inset-bottom, 0px)) !important;
    width: 100% !important;
    max-width: 100% !important;
    height: calc(100vh - 138px) !important;
    height: calc(100dvh - 138px - env(safe-area-inset-bottom, 0px)) !important;
    z-index: 65 !important;
    background: rgba(14, 15, 20, 0.96) !important;
    backdrop-filter: blur(28px) !important;
    -webkit-backdrop-filter: blur(28px) !important;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.8) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
  }
}

#lyrics-fullscreen-modal {
  z-index: 900 !important;
}

/* Responsive drawer for narrow viewports */
@media (max-width: 400px) {
  #right-side-drawer {
    width: 100vw !important;
    max-width: 100vw !important;
  }
}

/* Device Current Badge */
.device-current-badge {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Avatar Edit Overlay */
.avatar-edit-overlay {
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Track Downloaded Indicator */
.track-downloaded {
  color: #10b981 !important;
}

/* =============================================================================
   15. ACCESSIBILITY: PREFERS-REDUCED-MOTION (Vestibular Protection)
   ============================================================================= */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }

  /* Disable continuous ambient motion in Aurora mesh background */
  .ambient-mesh-canvas {
    filter: blur(95px) saturate(115%);
    opacity: 0.65;
  }

  .aurora-orb,
  [data-theme-profile="immersive"] .aurora-orb-1,
  [data-theme-profile="immersive"] .aurora-orb-2,
  [data-theme-profile="immersive"] .aurora-orb-3 {
    animation: none !important;
    transform: none !important;
    opacity: 0.55 !important;
  }

  /* Disable skeleton loaders infinite pulse */
  .skeleton-shimmer,
  .search-loading-shimmer {
    animation: none !important;
    background-position: 0 0 !important;
  }

  /* Tone down transforms and rapid scale/bounces */
  .btn-play-pause-master:hover,
  .player-cover-box:hover,
  .track-card-row:hover,
  #search-top-result-card:hover,
  .btn-player-action:hover,
  .category-browse-card:hover .category-icon {
    transform: none !important;
  }

  /* Static display instead of bouncing or scale modals */
  #lyrics-fullscreen-modal,
  .modal-content-glass,
  .view-enter-active {
    animation: none !important;
    transform: none !important;
  }

  /* Lyrics active line scale disable */
  #lyrics-fullscreen-lines .lyric-row.active {
    transform: none !important;
  }

  /* Buffering indicator ring rotation disable (Vestibular Protection) */
  .btn-play-pause-master.is-buffering::after {
    animation: none !important;
    border-color: var(--accent-green-bright) !important;
    opacity: 0.85 !important;
  }
}

/* =============================================================================
   16. CONTAINER QUERIES FOR MAIN VIEWPORT (Size-Aware Responsive Grids)
   Dynamically reorganizes grids based on container inline-size, ensuring smooth
   layouts when sidebars or the right-side drawer (Coda, Party, Lyrics) are opened.
   ============================================================================= */

/* Track lists: Deezer charts & Search tracks list */
@container main-viewport (max-width: 620px) {
  #main-content-viewport #italian-charts-grid,
  #main-content-viewport #search-tracks-list {
    grid-template-columns: 1fr !important;
  }
}

@container main-viewport (min-width: 621px) and (max-width: 960px) {
  #main-content-viewport #italian-charts-grid,
  #main-content-viewport #search-tracks-list {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@container main-viewport (min-width: 961px) {
  #main-content-viewport #italian-charts-grid,
  #main-content-viewport #search-tracks-list {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* Daily Mixes Bento Cards */
@container main-viewport (max-width: 520px) {
  #main-content-viewport #daily-mixes-grid {
    grid-template-columns: 1fr !important;
  }
}

@container main-viewport (min-width: 521px) and (max-width: 800px) {
  #main-content-viewport #daily-mixes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@container main-viewport (min-width: 801px) and (max-width: 1140px) {
  #main-content-viewport #daily-mixes-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@container main-viewport (min-width: 1141px) {
  #main-content-viewport #daily-mixes-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

/* Media Cards: Search Artists, Search Albums, Discography, Library Playlists/Albums */
@container main-viewport (max-width: 440px) {
  #main-content-viewport #search-artists-grid,
  #main-content-viewport #search-albums-grid,
  #main-content-viewport #artist-albums-grid,
  #main-content-viewport #library-playlists-grid,
  #main-content-viewport #library-albums-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@container main-viewport (min-width: 441px) and (max-width: 680px) {
  #main-content-viewport #search-artists-grid,
  #main-content-viewport #search-albums-grid,
  #main-content-viewport #artist-albums-grid,
  #main-content-viewport #library-playlists-grid,
  #main-content-viewport #library-albums-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@container main-viewport (min-width: 681px) and (max-width: 960px) {
  #main-content-viewport #search-artists-grid,
  #main-content-viewport #search-albums-grid,
  #main-content-viewport #artist-albums-grid,
  #main-content-viewport #library-playlists-grid,
  #main-content-viewport #library-albums-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

@container main-viewport (min-width: 961px) and (max-width: 1240px) {
  #main-content-viewport #search-artists-grid,
  #main-content-viewport #search-albums-grid,
  #main-content-viewport #artist-albums-grid,
  #main-content-viewport #library-playlists-grid,
  #main-content-viewport #library-albums-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }
}

@container main-viewport (min-width: 1241px) {
  #main-content-viewport #search-artists-grid,
  #main-content-viewport #search-albums-grid,
  #main-content-viewport #artist-albums-grid,
  #main-content-viewport #library-playlists-grid,
  #main-content-viewport #library-albums-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  }
}

/* Artists Followed & Moods Grid */
@container main-viewport (max-width: 440px) {
  #main-content-viewport #library-artists-grid,
  #main-content-viewport #search-moods-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@container main-viewport (min-width: 441px) and (max-width: 680px) {
  #main-content-viewport #library-artists-grid,
  #main-content-viewport #search-moods-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@container main-viewport (min-width: 681px) and (max-width: 920px) {
  #main-content-viewport #library-artists-grid,
  #main-content-viewport #search-moods-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

@container main-viewport (min-width: 921px) {
  #main-content-viewport #library-artists-grid,
  #main-content-viewport #search-moods-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  }
}

/* Genres Grid */
@container main-viewport (max-width: 480px) {
  #main-content-viewport #search-genres-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@container main-viewport (min-width: 481px) and (max-width: 760px) {
  #main-content-viewport #search-genres-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@container main-viewport (min-width: 761px) and (max-width: 1040px) {
  #main-content-viewport #search-genres-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

@container main-viewport (min-width: 1041px) {
  #main-content-viewport #search-genres-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }
}

/* Decades Grid */
@container main-viewport (max-width: 420px) {
  #main-content-viewport #search-decades-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@container main-viewport (min-width: 421px) and (max-width: 640px) {
  #main-content-viewport #search-decades-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@container main-viewport (min-width: 641px) and (max-width: 860px) {
  #main-content-viewport #search-decades-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

@container main-viewport (min-width: 861px) and (max-width: 1120px) {
  #main-content-viewport #search-decades-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  }
}

@container main-viewport (min-width: 1121px) {
  #main-content-viewport #search-decades-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
  }
}

/* =============================================================================
   12. ENHANCED PLAYER BAR, MARQUEE & NOW PLAYING FULLSCREEN MODAL
   ============================================================================= */

/* Track Title Marquee Scroll on Long Titles */
.track-title-marquee-wrapper {
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  mask-image: linear-gradient(90deg, #000 0%, #000 88%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 88%, transparent 100%);
}

.track-title-marquee-wrapper.is-overflowing #bottom-track-title,
.track-title-marquee-wrapper:hover #bottom-track-title {
  display: inline-block;
  animation: titleMarquee 9s linear infinite alternate;
}

@keyframes titleMarquee {
  0% { transform: translateX(0); }
  20% { transform: translateX(0); }
  100% { transform: translateX(calc(-100% + 140px)); }
}

/* Cover Shimmer on Bottom Bar & Now Playing */
.player-cover-shimmer {
  border-radius: 10px;
}

/* Offline Cache Indicator Badge */
#bottom-offline-indicator,
#now-playing-offline-indicator {
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

/* Now Playing Fullscreen Modal (Mobile Sheet & Desktop Expanded Screen) */
#now-playing-modal {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  z-index: 100 !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
  transition: opacity 0.35s cubic-bezier(0.32, 0.72, 0, 1),
              transform 0.35s cubic-bezier(0.32, 0.72, 0, 1),
              visibility 0.35s;
  will-change: transform, opacity;
  transform: translateY(100%);
}

#now-playing-modal.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transform: translateY(100%);
}

#now-playing-modal.closing {
  opacity: 0;
  pointer-events: none;
  transform: translateY(100%) !important;
  transition: transform 280ms cubic-bezier(0.32, 0.72, 0, 1), opacity 200ms ease !important;
}

#now-playing-modal:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transform: translateY(0);
}

/* Hide bottom player bar completely when Now Playing modal is active to eliminate bottom bleed */
body.has-now-playing-open .master-player-bar,
body:has(#now-playing-modal:not(.hidden)) .master-player-bar {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* Now Playing Dedicated Volume Control Styles */
.now-playing-volume-wrapper {
  touch-action: none;
}

#now-playing-volume-container {
  touch-action: none;
  cursor: pointer;
}

#now-playing-volume-container:hover .volume-slider-bg {
  background: rgba(255, 255, 255, 0.35);
}

#now-playing-volume-container:hover #now-playing-volume-thumb,
#now-playing-volume-container.dragging #now-playing-volume-thumb {
  transform: translateY(-50%) translateX(-50%) scale(1.25);
  box-shadow: 0 0 12px rgba(29, 185, 84, 0.9), 0 0 6px #fff;
}

@media (max-height: 700px) {
  .now-playing-cover-wrapper {
    max-height: 24vh !important;
    max-width: 24vh !important;
  }
  #now-playing-modal main {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    gap: 0.5rem !important;
  }
}

/* Shared element transition for cover artwork expansion */
::view-transition-old(shared-cover-artwork),
::view-transition-new(shared-cover-artwork) {
  height: 100%;
  width: 100%;
  object-fit: cover;
  border-radius: 1.5rem;
}

::view-transition-group(shared-cover-artwork) {
  animation-duration: 350ms;
  animation-timing-function: cubic-bezier(0.32, 0.72, 0, 1);
}

.now-playing-cover-wrapper {
  transition: transform 0.4s var(--ease-bounce), box-shadow 0.4s ease, filter 0.4s ease;
}

.now-playing-cover-wrapper.is-playing {
  transform: scale(1.02);
  box-shadow: 0 25px 65px -10px rgba(0, 0, 0, 0.85), 0 0 35px var(--accent-green-glow);
}

.now-playing-cover-wrapper:not(.is-playing) {
  transform: scale(0.95);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7);
  opacity: 0.92;
}

#now-playing-timeline-container {
  touch-action: none;
}

#now-playing-play-pause {
  transition: transform 0.2s var(--ease-bounce), box-shadow 0.2s ease, background-color 0.2s ease;
}

#now-playing-play-pause:hover {
  transform: scale(1.06);
  box-shadow: 0 0 35px rgba(255, 255, 255, 0.65), 0 8px 24px rgba(0, 0, 0, 0.7);
}

#now-playing-play-pause:active {
  transform: scale(0.94);
}

#now-playing-play-pause.is-buffering::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--accent-green-bright);
  border-right-color: rgba(29, 185, 84, 0.35);
  animation: son-spinner 0.8s linear infinite;
  box-shadow: 0 0 18px var(--accent-green-glow);
  pointer-events: none;
  z-index: 10;
}

/* Mobile Tap Target Safeguards (WCAG AA: min 48x48px) */
@media (max-width: 767px) {
  #now-playing-modal button {
    min-width: 44px;
    min-height: 44px;
  }

  .player-bar-left {
    cursor: pointer;
  }
}



