/* ==========================================================================
   musypassyt - YouTube Music PWA Design System & iOS Safari Styling
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-color: #030303;
  --surface-dark: #0d0d0d;
  --surface-card: #121212;
  --surface-hover: #1e1e1e;
  --surface-active: #282828;
  --border-subtle: #242424;
  --border-focus: #3d3d3d;
  
  --accent-red: #ff0033;
  --accent-red-hover: #ff2a4f;
  --accent-red-glow: rgba(255, 0, 51, 0.4);
  
  --text-primary: #ffffff;
  --text-secondary: #aaaaaa;
  --text-muted: #717171;
  
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);

  /* iOS Safe Areas */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

/* --------------------------------------------------------------------------
   Reset & iOS Safari Native Constraints
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  /* Prevent accidental text selection during music browsing */
  -webkit-user-select: none;
  user-select: none;
  /* Eliminate iOS Safari tap highlight gray/blue box */
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  /* Prevent iOS Safari elastic rubber-banding & pull-to-refresh */
  overscroll-behavior-y: none;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Form inputs allow text selection for typing */
input, textarea {
  -webkit-user-select: text;
  user-select: text;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
  color: inherit;
}

.hidden,
.app-modal.hidden,
.ios-sheet-modal.hidden,
.expanded-player-modal.hidden {
  display: none !important;
}

/* --------------------------------------------------------------------------
   App Root Layout
   -------------------------------------------------------------------------- */
.app-root {
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* --------------------------------------------------------------------------
   1. AUTHENTICATION VIEW
   -------------------------------------------------------------------------- */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  padding-top: max(24px, var(--sat));
  padding-bottom: max(24px, var(--sab));
  background: radial-gradient(circle at top center, rgba(255, 0, 51, 0.08) 0%, transparent 60%), #030303;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  padding: 36px 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.4s ease-out;
}

.auth-brand {
  text-align: center;
  margin-bottom: 28px;
}

.brand-disc {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff0033 0%, #cc0029 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 25px var(--accent-red-glow);
}

.brand-icon {
  width: 32px;
  height: 32px;
  color: #fff;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
  margin-bottom: 6px;
}

.brand-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.auth-tabs {
  display: flex;
  background-color: var(--surface-dark);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 24px;
  border: 1px solid var(--border-subtle);
}

.tab-btn {
  flex: 1;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 8px;
  transition: all var(--transition-fast);
}

.tab-btn.active {
  background-color: var(--surface-active);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.input-wrapper input {
  width: 100%;
  padding: 14px 14px 14px 44px;
  background-color: var(--surface-dark);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  color: #fff;
  font-size: 15px;
  transition: border-color var(--transition-fast);
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--accent-red);
}

#passcode {
  letter-spacing: 2.5px;
  font-weight: 700;
  font-family: inherit;
}

.passcode-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.35;
  padding-left: 2px;
}

.primary-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent-red) 0%, #d8002b 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 6px 20px var(--accent-red-glow);
  transition: transform var(--transition-fast), filter var(--transition-fast);
}

.primary-btn:active {
  transform: scale(0.98);
  filter: brightness(0.9);
}

.error-banner {
  padding: 12px 14px;
  background-color: rgba(255, 68, 68, 0.15);
  border: 1px solid rgba(255, 68, 68, 0.3);
  border-radius: 10px;
  color: #ff6b6b;
  font-size: 13px;
  text-align: center;
}

/* --------------------------------------------------------------------------
   2. MAIN APPLICATION VIEW
   -------------------------------------------------------------------------- */
.main-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: calc(100px + var(--sab)); /* Space for persistent bottom player */
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(12px, var(--sat)) 20px 12px;
  background-color: rgba(3, 3, 3, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo-disc {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-red);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px var(--accent-red-glow);
}

.header-logo-disc svg {
  width: 18px;
  height: 18px;
  color: #fff;
}

.header-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
}

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

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  padding: 4px 12px 4px 4px;
  border-radius: 20px;
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--accent-red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}

.username-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.icon-btn:hover, .icon-btn:active {
  color: #fff;
  background-color: var(--surface-hover);
}

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

/* Search Bar Section */
.search-section {
  padding: 16px 20px 8px;
  background-color: var(--bg-color);
}

.search-form {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.search-input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input-wrapper input {
  width: 100%;
  padding: 13px 40px 13px 44px;
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 28px;
  color: #fff;
  font-size: 15px;
  transition: all var(--transition-fast);
}

.search-input-wrapper input:focus {
  outline: none;
  border-color: var(--accent-red);
  background-color: var(--surface-dark);
  box-shadow: 0 0 15px rgba(255, 0, 51, 0.15);
}

.clear-btn {
  position: absolute;
  right: 12px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

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

.search-submit-btn {
  padding: 0 20px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 28px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.search-submit-btn:hover, .search-submit-btn:active {
  background-color: var(--accent-red);
  border-color: var(--accent-red);
  box-shadow: 0 0 15px var(--accent-red-glow);
}

/* Search Section Header (Latest Releases Today & Live Results) */
.search-section-header {
  margin-top: 6px;
  margin-bottom: 16px;
  padding: 0 4px;
  animation: fadeIn 0.2s ease-out;
}

.search-section-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.search-section-title {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.search-section-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 12px;
  background: rgba(255, 0, 51, 0.16);
  color: var(--accent-red);
  border: 1px solid rgba(255, 0, 51, 0.28);
  transition: all var(--transition-fast);
}

.search-section-badge.live-badge {
  background: rgba(0, 230, 118, 0.14);
  color: #00e676;
  border-color: rgba(0, 230, 118, 0.3);
}

.search-section-desc {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Category Filter Chips / Tabs */
.filter-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar {
  display: none;
}

.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.chip svg {
  width: 15px;
  height: 15px;
}

.chip.active {
  background-color: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

.chip-count {
  background-color: var(--accent-red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

.chip.active .chip-count {
  background-color: #000;
  color: #fff;
}

/* --------------------------------------------------------------------------
   Content Area & Track Lists
   -------------------------------------------------------------------------- */
.content-container {
  padding: 14px 16px calc(120px + var(--sab));
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.tab-pane {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}

/* Quick Picks Section */
.welcome-section {
  margin-top: 10px;
  margin-bottom: 24px;
}

/* Continue Listening Hero Card */
.continue-card {
  margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(255, 0, 51, 0.12) 0%, rgba(26, 26, 26, 0.9) 100%);
  border: 1px solid rgba(255, 0, 51, 0.25);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.continue-card:active {
  transform: scale(0.98);
  border-color: var(--accent-red);
}

.continue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.continue-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--accent-red);
}

.continue-badge svg {
  width: 13px;
  height: 13px;
}

.continue-time {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.continue-body {
  display: flex;
  align-items: center;
  gap: 12px;
}

.continue-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background-color: var(--surface-card);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

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

.continue-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.continue-artist {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.continue-play-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-red) 0%, #d8002b 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 15px var(--accent-red-glow);
  transition: transform var(--transition-fast);
}

.continue-play-btn svg {
  width: 20px;
  height: 20px;
  margin-left: 2px;
}

.continue-play-btn:active {
  transform: scale(0.92);
}

.quick-picks-header {
  margin-bottom: 14px;
}

.quick-picks-header h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.quick-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.genre-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.genre-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 80px;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--surface-card) 0%, var(--surface-hover) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  text-align: left;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.genre-card:active {
  transform: scale(0.96);
  border-color: var(--accent-red);
}

.genre-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.genre-tag {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Track List Items (YouTube Music Inspired) */
.track-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.track-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background-color: transparent;
  border-radius: 12px;
  transition: background-color var(--transition-fast);
  cursor: pointer;
}

.track-item:hover, .track-item:active {
  background-color: var(--surface-card);
}

.track-item.playing {
  background-color: var(--surface-hover);
  border-left: 3px solid var(--accent-red);
}

.track-main-info {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.track-thumb-container {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
  background-color: var(--surface-card);
  flex-shrink: 0;
}

.track-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.track-play-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.track-item:hover .track-play-overlay,
.track-item:active .track-play-overlay,
.track-item.playing .track-play-overlay {
  opacity: 1;
}

.track-play-overlay svg {
  width: 22px;
  height: 22px;
  color: #fff;
}

.track-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.track-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.track-item.playing .track-title {
  color: var(--accent-red);
}

.track-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-artist {
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-dot {
  font-size: 8px;
  color: var(--text-muted);
}

.track-duration {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.track-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}

.track-fav-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.track-fav-btn:hover, .track-fav-btn:active {
  color: #fff;
}

.track-fav-btn.is-fav {
  color: var(--accent-red);
}

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

/* Empty & Loading States */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.empty-icon {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 260px;
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 0;
  gap: 16px;
  color: var(--text-secondary);
  font-size: 14px;
}

.equalizer-loader {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 24px;
}

.equalizer-loader span {
  width: 4px;
  height: 100%;
  background-color: var(--accent-red);
  border-radius: 2px;
  animation: eqBounce 1s ease-in-out infinite alternate;
}

.equalizer-loader span:nth-child(1) { animation-delay: 0.1s; }
.equalizer-loader span:nth-child(2) { animation-delay: 0.3s; }
.equalizer-loader span:nth-child(3) { animation-delay: 0.5s; }
.equalizer-loader span:nth-child(4) { animation-delay: 0.2s; }

@keyframes eqBounce {
  0% { height: 4px; }
  100% { height: 24px; }
}

/* Favorites Header */
.favorites-header {
  margin-bottom: 16px;
}

.favorites-header h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

.favorites-header p {
  font-size: 13px;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   3. PERSISTENT STICKY BOTTOM PLAYER
   -------------------------------------------------------------------------- */
.bottom-player {
  position: fixed;
  bottom: calc(56px + var(--sab));
  left: 0;
  right: 0;
  z-index: 999;
  background-color: rgba(20, 20, 20, 0.96);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid var(--border-subtle);
  padding-bottom: 0;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.7);
  animation: slideUp 0.3s ease-out;
}

.player-progress-bar {
  width: 100%;
  height: 3px;
  background-color: rgba(255, 255, 255, 0.1);
  position: relative;
  cursor: pointer;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background-color: var(--accent-red);
  transition: width 0.1s linear;
}

.bottom-player-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  gap: 12px;
  height: 64px;
}

.player-track-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.player-thumb-wrapper {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  overflow: hidden;
  background-color: #000;
  flex-shrink: 0;
}

.player-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.playing-indicator {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.playing-indicator.active {
  display: flex;
}

.playing-indicator span {
  width: 3px;
  height: 12px;
  background-color: var(--accent-red);
  border-radius: 2px;
  animation: eqBounce 0.8s ease-in-out infinite alternate;
}

.playing-indicator span:nth-child(1) { animation-delay: 0.1s; }
.playing-indicator span:nth-child(2) { animation-delay: 0.3s; }
.playing-indicator span:nth-child(3) { animation-delay: 0.2s; }

.player-text-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.player-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-artist {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ctrl-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.ctrl-btn:active {
  transform: scale(0.9);
}

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

.play-main-btn {
  width: 44px;
  height: 44px;
  background-color: #ffffff;
  color: #000000;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.play-main-btn:hover, .play-main-btn:active {
  background-color: #f0f0f0;
}

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

.heart-btn {
  color: var(--text-muted);
}

.heart-btn.is-fav {
  color: var(--accent-red);
}

.heart-btn.is-fav svg {
  fill: var(--accent-red);
}

/* --------------------------------------------------------------------------
   4. FULL-SCREEN EXPANDED NOW PLAYING SHEET
   -------------------------------------------------------------------------- */
.expanded-player-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.expanded-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.expanded-content {
  position: relative;
  z-index: 1001;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 30%, #1f080c 0%, #080808 60%, #030303 100%);
  display: flex;
  flex-direction: column;
  padding: max(16px, var(--sat)) 28px max(24px, var(--sab));
  overflow-y: auto;
  animation: modalSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.collapse-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

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

.modal-header-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

.header-placeholder {
  width: 40px;
}

/* Glowing Vinyl Artwork */
.expanded-art-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto 0;
  padding: 10px 0;
}

.vinyl-record {
  position: relative;
  width: min(72vw, 320px);
  height: min(72vw, 320px);
  border-radius: 50%;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.9), 0 0 60px var(--accent-red-glow);
  background: #0d0d0d;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vinyl-record.spinning {
  animation: rotateVinyl 24s linear infinite;
}

.vinyl-record.spinning.paused {
  animation-play-state: paused;
}

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

.expanded-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.vinyl-grooves {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, rgba(255,255,255,0.03) 0px, transparent 2px, transparent 8px);
  pointer-events: none;
}

.vinyl-center-hole {
  position: absolute;
  width: 44px;
  height: 44px;
  background-color: var(--bg-color);
  border: 4px solid #1a1a1a;
  border-radius: 50%;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.9);
}

/* Expanded Metadata Row */
.expanded-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
  margin-bottom: 20px;
}

.expanded-text {
  min-width: 0;
  flex: 1;
}

.expanded-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.expanded-artist {
  font-size: 15px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.expanded-heart-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-radius: 50%;
  flex-shrink: 0;
}

.expanded-heart-btn.is-fav {
  color: var(--accent-red);
}

.expanded-heart-btn.is-fav svg {
  fill: var(--accent-red);
}

.expanded-heart-btn svg {
  width: 24px;
  height: 24px;
}

/* Scrubber Slider */
.expanded-scrubber-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.seek-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
  cursor: pointer;
}

.seek-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
  transition: transform var(--transition-fast);
}

.seek-slider::-webkit-slider-thumb:active {
  transform: scale(1.3);
  background: var(--accent-red);
}

.scrubber-times {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Controls */
.expanded-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-ctrl-btn {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  border-radius: 50%;
}

.modal-ctrl-btn.active {
  color: var(--accent-red);
}

.modal-ctrl-btn.icon-lg svg {
  width: 30px;
  height: 30px;
  color: #fff;
}

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

.modal-play-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background-color: #ffffff;
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(255, 255, 255, 0.25);
  transition: transform var(--transition-fast);
}

.modal-play-btn:active {
  transform: scale(0.92);
}

.modal-play-btn svg {
  width: 36px;
  height: 36px;
}

/* Safari Screen-Off Hint */
.safari-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: center;
}

.safari-hint svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--text-secondary);
}

/* Spinners */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.mini-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 0, 0, 0.3);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes modalSlideUp {
  from { transform: translateY(100%); opacity: 0.8; }
  to { transform: translateY(0); opacity: 1; }
}

/* --------------------------------------------------------------------------
   5. PLAYLISTS MANAGEMENT & HERO STYLES
   -------------------------------------------------------------------------- */

/* Header Install Badge */
.ios-install-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(255, 0, 51, 0.2) 0%, rgba(255, 0, 51, 0.08) 100%);
  border: 1px solid rgba(255, 0, 51, 0.4);
  color: #fff;
  padding: 6px 12px;
  border-radius: 18px;
  font-size: 12px;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.ios-install-badge svg {
  width: 14px;
  height: 14px;
  color: var(--accent-red);
}

.ios-install-badge:hover, .ios-install-badge:active {
  background: var(--accent-red);
  border-color: var(--accent-red);
}

.ios-install-badge:hover svg, .ios-install-badge:active svg {
  color: #fff;
}

/* Playlists Tab Header */
.playlists-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}

.playlists-header h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

.playlists-header p {
  font-size: 13px;
  color: var(--text-muted);
}

.playlists-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

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

.header-action-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 20px;
  transition: all var(--transition-fast);
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.header-action-pill-btn:hover {
  background: var(--surface-hover);
  border-color: rgba(255, 255, 255, 0.25);
}

.header-action-pill-btn:active {
  transform: scale(0.95);
}

.header-action-pill-btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
}

.create-playlist-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-red);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 20px;
  box-shadow: 0 4px 14px var(--accent-red-glow);
  transition: transform var(--transition-fast);
  white-space: nowrap;
}

.create-playlist-trigger-btn:active {
  transform: scale(0.95);
}

.create-playlist-trigger-btn svg {
  width: 16px;
  height: 16px;
}

/* Playlists Grid */
.playlists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.playlist-card {
  display: flex;
  flex-direction: column;
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.playlist-card:hover, .playlist-card:active {
  transform: translateY(-2px);
  border-color: var(--border-focus);
}

.playlist-card-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: #1a1a1a;
  overflow: hidden;
}

/* 4-Thumbnail Collage */
.cover-collage {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  background: #111;
}

.cover-collage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-collage-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #181818 0%, #0d0d0d 100%);
  color: var(--text-muted);
}

.cover-collage-placeholder svg {
  width: 44px;
  height: 44px;
}

.playlist-card-play-overlay {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--accent-red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px var(--accent-red-glow);
  opacity: 0;
  transform: translateY(6px);
  transition: all var(--transition-fast);
}

.playlist-card:hover .playlist-card-play-overlay,
.playlist-card:active .playlist-card-play-overlay {
  opacity: 1;
  transform: translateY(0);
}

.playlist-card-play-overlay svg {
  width: 20px;
  height: 20px;
}

.playlist-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.playlist-card-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.playlist-card-count {
  font-size: 12px;
  color: var(--text-muted);
}

/* Playlist Detail Hero */
.detail-nav-bar {
  margin-bottom: 16px;
}

.back-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.back-pill-btn:hover, .back-pill-btn:active {
  color: #fff;
  background-color: var(--surface-hover);
}

.back-pill-btn svg {
  width: 16px;
  height: 16px;
}

.playlist-hero {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
  background: radial-gradient(circle at 10% 20%, rgba(255, 0, 51, 0.12) 0%, transparent 70%), var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  margin-bottom: 24px;
}

@media (min-width: 600px) {
  .playlist-hero {
    flex-direction: row;
    align-items: center;
  }
}

.playlist-hero-cover {
  width: 140px;
  height: 140px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  flex-shrink: 0;
  background: #111;
}

.playlist-hero-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.playlist-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--accent-red);
  margin-bottom: 4px;
}

.playlist-hero-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
  line-height: 1.2;
}

.playlist-hero-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.playlist-hero-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.playlist-hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  color: #000000;
  padding: 10px 22px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
  transition: transform var(--transition-fast);
}

.hero-play-btn:active {
  transform: scale(0.96);
}

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

.hero-play-btn-small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  color: #000000;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.hero-play-btn-small svg {
  width: 16px;
  height: 16px;
}

.hero-shuffle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--surface-dark);
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  transition: background-color var(--transition-fast);
}

.hero-shuffle-btn:active {
  background-color: var(--surface-hover);
}

.hero-shuffle-btn svg {
  width: 16px;
  height: 16px;
}

.hero-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--surface-dark);
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 10px 16px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.hero-export-btn:hover {
  background-color: var(--surface-hover);
  border-color: rgba(255, 255, 255, 0.25);
}

.hero-export-btn:active {
  transform: scale(0.95);
}

.hero-export-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.hero-delete-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background-color: var(--surface-dark);
  border: 1px solid var(--border-subtle);
  margin-left: auto;
  transition: all var(--transition-fast);
}

.hero-delete-btn:hover, .hero-delete-btn:active {
  color: #ff4444;
  border-color: #ff4444;
  background-color: rgba(255, 68, 68, 0.1);
}

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

/* Track Actions (+ Playlist Button) */
.track-add-btn, .track-remove-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.track-add-btn:hover, .track-add-btn:active {
  color: #fff;
  background-color: var(--surface-hover);
}

.track-remove-btn:hover, .track-remove-btn:active {
  color: #ff4444;
  background-color: rgba(255, 68, 68, 0.1);
}

.track-add-btn svg, .track-remove-btn svg {
  width: 18px;
  height: 18px;
}

/* Expanded Player Actions Group */
.expanded-actions-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.expanded-icon-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-radius: 50%;
  transition: color var(--transition-fast);
}

.expanded-icon-btn:hover, .expanded-icon-btn:active {
  color: #fff;
}

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

/* --------------------------------------------------------------------------
   6. APP MODALS (Create Playlist, Add To Playlist, iOS Guide)
   -------------------------------------------------------------------------- */
.app-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.modal-dialog {
  position: relative;
  z-index: 2001;
  width: 100%;
  max-width: 440px;
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
  animation: fadeIn 0.25s ease-out;
  display: flex;
  flex-direction: column;
}

.modal-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-dialog-header h3 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: #fff;
}

.close-modal-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-radius: 50%;
}

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

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-form input, .modal-form textarea {
  width: 100%;
  padding: 12px 14px;
  background-color: var(--surface-dark);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
}

.modal-form input:focus, .modal-form textarea:focus {
  outline: none;
  border-color: var(--accent-red);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.btn-secondary {
  padding: 10px 18px;
  background-color: var(--surface-dark);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
}

.btn-primary {
  padding: 10px 20px;
  background: var(--accent-red);
  color: #fff;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 12px var(--accent-red-glow);
}

.primary-btn-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  background: var(--accent-red);
  color: #fff;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 14px var(--accent-red-glow);
}

/* Add To Playlist Dialog List */
.add-playlist-target-track {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background-color: var(--surface-dark);
  border-radius: 12px;
  margin-bottom: 16px;
}

.add-playlist-target-track img {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
}

.selector-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 8px;
}

.modal-playlists-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 16px;
}

.modal-playlist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background-color: var(--surface-dark);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-playlist-item:hover, .modal-playlist-item:active {
  border-color: var(--accent-red);
  background-color: var(--surface-hover);
}

.modal-playlist-item-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.modal-playlist-item-count {
  font-size: 12px;
  color: var(--text-muted);
}

.quick-new-playlist-box {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.quick-new-playlist-box input {
  flex: 1;
  padding: 10px 14px;
  background-color: var(--surface-dark);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
}

.quick-add-btn {
  padding: 10px 14px;
  background-color: var(--surface-hover);
  border: 1px solid var(--border-subtle);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border-radius: 10px;
  white-space: nowrap;
}

.quick-add-btn:active {
  background-color: var(--accent-red);
}

/* iOS Installation Guide Dialog */
.ios-guide-dialog {
  max-width: 420px;
}

.ios-guide-intro {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 18px;
}

.ios-steps-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ios-step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background-color: var(--surface-dark);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
}

.step-num-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: var(--accent-red);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-desc {
  font-size: 13px;
  color: #e0e0e0;
  line-height: 1.45;
}

.share-icon-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  vertical-align: middle;
  margin: 0 3px;
  color: #3b82f6;
}

.share-icon-preview svg {
  width: 18px;
  height: 18px;
}

/* --------------------------------------------------------------------------
   iOS Styled Delete Playlist Confirmation Sheet
   -------------------------------------------------------------------------- */
.sheet-grabber-bar {
  display: none;
  width: 38px;
  height: 5px;
  background-color: rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  margin: 0 auto 16px auto;
}

.delete-playlist-dialog {
  width: 100%;
  max-width: 390px;
  text-align: center;
  padding: 26px 22px 22px 22px;
  background: rgba(26, 26, 26, 0.96);
  backdrop-filter: blur(32px) saturate(190%);
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.88);
  animation: slideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.delete-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 0, 51, 0.14);
  border: 1px solid rgba(255, 0, 51, 0.32);
  color: #ff3b5c;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px auto;
  box-shadow: 0 0 26px rgba(255, 0, 51, 0.28);
}

.delete-icon-wrap svg {
  width: 26px;
  height: 26px;
}

.delete-dialog-title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 6px;
  letter-spacing: -0.4px;
}

.delete-playlist-preview-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  padding: 12px 14px;
  margin: 14px 0;
  text-align: left;
}

.delete-playlist-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 0, 51, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ff3b5c;
  flex-shrink: 0;
}

.delete-playlist-icon svg {
  width: 22px;
  height: 22px;
}

.delete-playlist-info {
  flex: 1;
  min-width: 0;
}

.delete-playlist-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.delete-playlist-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.delete-dialog-message {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 22px;
  padding: 0 4px;
}

.delete-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.destructive-btn {
  width: 100%;
  height: 52px;
  background: linear-gradient(135deg, #ff1a40 0%, #d60029 100%);
  color: #ffffff;
  border: none;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 0, 51, 0.38);
  transition: transform var(--transition-fast), filter var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

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

.destructive-btn:active {
  transform: scale(0.98);
  filter: brightness(0.9);
}

.cancel-sheet-btn {
  width: 100%;
  height: 52px;
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.cancel-sheet-btn:active {
  background-color: rgba(255, 255, 255, 0.15);
  transform: scale(0.98);
}

@keyframes sheetSlideUp {
  from {
    transform: translateY(100%);
    opacity: 0.85;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 600px) {
  /* Safe Area Header on iPhone */
  .app-header {
    padding: max(14px, calc(var(--sat) + 8px)) 16px 10px;
  }

  .header-title {
    font-size: 18px;
    letter-spacing: -0.4px;
  }

  .header-user-section {
    gap: 8px;
    flex-shrink: 0;
  }

  /* Compact User Avatar on iPhone - hides text, displays sleek avatar */
  .user-badge {
    padding: 2px;
    background: transparent;
    border: none;
  }

  .user-avatar {
    width: 28px;
    height: 28px;
    font-size: 12px;
    box-shadow: 0 0 10px rgba(255, 0, 51, 0.35);
  }

  .username-text {
    display: none;
  }

  .ios-install-badge {
    padding: 5px 10px;
    font-size: 11px;
    border-radius: 16px;
    gap: 5px;
  }

  .ios-install-badge svg {
    width: 13px;
    height: 13px;
  }

  .icon-btn#logout-btn {
    width: 32px;
    height: 32px;
  }

  /* Bottom Player on iPhone: Give title/artist maximum breathing room */
  .bottom-player-inner {
    padding: 8px 12px;
    gap: 10px;
    height: 60px;
  }

  .player-thumb-wrapper {
    width: 40px;
    height: 40px;
  }

  .player-title {
    font-size: 13px;
  }

  .player-artist {
    font-size: 11px;
  }

  .player-controls {
    gap: 4px;
    flex-shrink: 0;
  }

  /* Hide + and prev button on mini player to avoid title truncation on mobile */
  #player-add-playlist-btn,
  #player-prev-btn {
    display: none;
  }

  .ctrl-btn {
    width: 34px;
    height: 34px;
  }

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

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

  .ios-sheet-modal {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  .ios-sheet-modal .sheet-grabber-bar {
    display: block;
  }

  .delete-playlist-dialog {
    max-width: 100%;
    margin: 0;
    border-radius: 28px 28px 0 0;
    border-bottom: none;
    border-left: none;
    border-right: none;
    padding: 16px 22px calc(24px + env(safe-area-inset-bottom, 16px)) 22px;
    animation: sheetSlideUp 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  }
}

/* --------------------------------------------------------------------------
   Desktop-Specific UI Elements (Hidden on mobile by default)
   -------------------------------------------------------------------------- */
.desktop-sidebar {
  display: none;
}

.desktop-search-bar {
  display: none;
}

.desktop-ctrl-only {
  display: none !important;
}

.desktop-scrubber-row {
  display: none !important;
}

.player-right-block {
  display: none !important;
}

/* --------------------------------------------------------------------------
   DESKTOP PC & TABLET BROWSER ADAPTATIONS (>= 769px)
   -------------------------------------------------------------------------- */
@media (min-width: 769px) {
  /* 1. Left Sidebar Navigation (Spotify / YouTube Music PC Style) */
  .desktop-sidebar {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 84px;
    width: 250px;
    background: #0a0a0a;
    border-right: 1px solid var(--border-subtle);
    z-index: 950;
    user-select: none;
  }

  .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 22px 20px 22px;
  }

  .sidebar-logo-disc {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-red);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 16px var(--accent-red-glow);
    flex-shrink: 0;
  }

  .sidebar-logo-disc svg {
    width: 20px;
    height: 20px;
    color: #fff;
  }

  .sidebar-title {
    font-family: var(--font-display);
    font-size: 21px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
  }

  .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px;
  }

  .sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
    width: 100%;
    text-align: left;
    height: auto;
  }

  .sidebar-nav-item svg {
    width: 21px;
    height: 21px;
    color: inherit;
    flex-shrink: 0;
  }

  .sidebar-nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
  }

  .sidebar-nav-item.active {
    background: rgba(255, 0, 51, 0.14);
    color: #ffffff;
    font-weight: 700;
  }

  .sidebar-nav-item.active svg {
    color: var(--accent-red);
  }

  .sidebar-section-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 18px 16px 14px 16px;
  }

  .sidebar-playlists-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 0 12px 14px 12px;
  }

  .sidebar-playlists-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px 10px 8px;
  }

  .sidebar-playlists-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.2px;
    color: var(--text-muted);
  }

  .sidebar-create-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
  }

  .sidebar-create-btn:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
    transform: scale(1.1);
  }

  .sidebar-create-btn svg {
    width: 16px;
    height: 16px;
  }

  .sidebar-playlists-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow-y: auto;
    flex: 1;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
  }

  .sidebar-playlist-item {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 500;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
  }

  .sidebar-playlist-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
  }

  .sidebar-empty-hint {
    font-size: 12px;
    color: var(--text-muted);
    padding: 8px 12px;
  }

  /* 2. Hide Mobile Bottom Navigation Bar on Desktop */
  .bottom-nav-bar {
    display: none !important;
  }

  /* 3. Desktop Top Header */
  .app-header {
    margin-left: 250px;
    width: calc(100% - 250px);
    padding: 16px 36px;
    background: rgba(10, 10, 10, 0.94);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 900;
  }

  .app-header .header-brand {
    display: none;
  }

  .desktop-search-bar {
    display: flex !important;
    align-items: center;
    gap: 12px;
    background: #161616;
    border: 1px solid var(--border-subtle);
    border-radius: 28px;
    padding: 8px 18px;
    width: 440px;
    max-width: 50vw;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
  }

  .desktop-search-bar:focus-within {
    border-color: rgba(255, 255, 255, 0.35);
    background: #1c1c1c;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
  }

  .desktop-search-icon {
    width: 19px;
    height: 19px;
    color: var(--text-muted);
    flex-shrink: 0;
  }

  .desktop-search-bar input {
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 14.5px;
    width: 100%;
    font-family: inherit;
  }

  .desktop-search-bar input::placeholder {
    color: var(--text-muted);
  }

  .header-user-section {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
  }

  .user-badge {
    display: flex !important;
    align-items: center;
    gap: 10px;
    background: #161616;
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    padding: 4px 14px 4px 5px;
  }

  .user-avatar {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .username-text {
    display: block !important;
    font-size: 13.5px;
    font-weight: 600;
    color: #fff;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* 4. Desktop Content Container */
  .content-container {
    margin-left: 250px;
    width: calc(100% - 250px);
    max-width: 1600px;
    padding: 30px 42px calc(110px + var(--sab)) 42px;
    overflow-x: hidden;
  }

  .search-section {
    max-width: 100%;
    margin: 0;
  }

  .search-section-title {
    font-size: 23px;
  }

  .search-section-desc {
    font-size: 14px;
  }

  /* 5. Desktop Playlists Grid */
  .playlists-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)) !important;
    gap: 22px !important;
  }

  .playlist-card {
    padding: 14px;
    border-radius: 18px;
    background: #141414;
    transition: transform 0.2s cubic-bezier(0.2, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.2, 0, 0.2, 1), border-color 0.2s ease;
  }

  .playlist-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7);
  }

  /* 6. Desktop Shelf & Horizontal Carousels */
  .shelf-scroll {
    gap: 18px !important;
    padding: 8px 4px 18px 4px !important;
  }

  .shelf-card {
    flex: 0 0 172px !important;
    width: 172px !important;
    min-width: 172px !important;
    max-width: 172px !important;
    padding: 12px !important;
    border-radius: 16px !important;
    background: #141414;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  }

  .shelf-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.65);
  }

  .shelf-card-thumb-wrap {
    height: 148px !important;
    border-radius: 12px !important;
    margin-bottom: 10px !important;
  }

  .shelf-card-title {
    font-size: 13.5px !important;
    margin-bottom: 3px !important;
  }

  .shelf-card-artist {
    font-size: 12px !important;
  }

  .shelf-skeleton {
    flex: 0 0 172px !important;
    width: 172px !important;
    min-width: 172px !important;
    max-width: 172px !important;
    height: 215px !important;
    border-radius: 16px !important;
  }

  /* 6.1 Desktop Shelf Navigation Controls (Horizontal Scroll Buttons) */
  .shelf-nav-controls {
    display: flex !important;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }

  .shelf-nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    outline: none;
    transition: background-color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast), opacity var(--transition-fast), box-shadow var(--transition-fast);
    padding: 0;
    -webkit-tap-highlight-color: transparent;
  }

  .shelf-nav-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2.2;
    transition: transform var(--transition-fast);
  }

  .shelf-nav-btn:hover:not(:disabled):not(.disabled) {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
    transform: scale(1.08);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  }

  .shelf-nav-btn:active:not(:disabled):not(.disabled) {
    transform: scale(0.94);
  }

  .shelf-nav-btn:disabled,
  .shelf-nav-btn.disabled {
    opacity: 0.22;
    cursor: default;
    pointer-events: none;
    transform: none;
    box-shadow: none;
    border-color: rgba(255, 255, 255, 0.06);
  }

  /* 7. Desktop Continue Listening Card */
  .continue-card {
    padding: 16px 22px !important;
    border-radius: 18px !important;
    margin-bottom: 28px !important;
  }

  .continue-thumb {
    width: 58px !important;
    height: 58px !important;
    border-radius: 10px !important;
  }

  .continue-title {
    font-size: 15px !important;
  }

  .continue-artist {
    font-size: 13px !important;
  }

  .continue-play-btn {
    width: 44px !important;
    height: 44px !important;
  }

  /* 8. Desktop Bottom Music Player (Full-width 3-column Spotify/YouTube Music style) */
  .bottom-player {
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 84px !important;
    background: rgba(16, 16, 16, 0.98) !important;
    backdrop-filter: blur(28px) !important;
    -webkit-backdrop-filter: blur(28px) !important;
    border-top: 1px solid var(--border-subtle) !important;
    z-index: 1000 !important;
    box-shadow: 0 -10px 36px rgba(0, 0, 0, 0.8) !important;
  }

  #mini-progress-container {
    display: none !important;
  }

  .bottom-player-inner {
    max-width: 100% !important;
    height: 100% !important;
    padding: 0 32px !important;
    display: grid !important;
    grid-template-columns: 280px 1fr 280px !important;
    align-items: center !important;
    gap: 20px !important;
  }

  /* Left Column: Track Info + Heart */
  .player-track-info {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    min-width: 0 !important;
  }

  .player-thumb-wrapper {
    width: 52px !important;
    height: 52px !important;
    border-radius: 10px !important;
  }

  .player-title {
    font-size: 14.5px !important;
    font-weight: 700 !important;
  }

  .player-artist {
    font-size: 12.5px !important;
  }

  #player-fav-btn {
    display: flex !important;
    margin-left: 6px !important;
    flex-shrink: 0 !important;
  }

  /* Center Column: Controls + Continuous Interactive Scrubber */
  .player-center-block {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 640px !important;
    margin: 0 auto !important;
  }

  .player-controls {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
  }

  .desktop-ctrl-only {
    display: flex !important;
  }

  #player-prev-btn {
    display: flex !important;
  }

  .ctrl-btn {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    color: var(--text-secondary) !important;
    cursor: pointer !important;
    transition: transform var(--transition-fast), color var(--transition-fast) !important;
  }

  .ctrl-btn:hover {
    color: #ffffff !important;
    transform: scale(1.1) !important;
  }

  .ctrl-btn.active {
    color: var(--accent-red) !important;
  }

  .play-main-btn {
    width: 40px !important;
    height: 40px !important;
    background: #ffffff !important;
    color: #000000 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: transform var(--transition-fast), background-color var(--transition-fast) !important;
  }

  .play-main-btn:hover {
    transform: scale(1.1) !important;
    background: #f0f0f0 !important;
  }

  .play-main-btn svg {
    width: 20px !important;
    height: 20px !important;
    color: #000000 !important;
  }

  .desktop-scrubber-row {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .desktop-time {
    font-size: 11.5px !important;
    color: var(--text-muted) !important;
    font-weight: 500 !important;
    min-width: 36px !important;
    text-align: center !important;
  }

  .desktop-scrubber-track {
    flex: 1 !important;
    height: 4px !important;
    background: rgba(255, 255, 255, 0.16) !important;
    border-radius: 4px !important;
    position: relative !important;
    cursor: pointer !important;
    transition: height 0.15s ease !important;
  }

  .desktop-scrubber-track:hover {
    height: 6px !important;
  }

  .desktop-scrubber-fill {
    height: 100% !important;
    width: 0% !important;
    background: var(--accent-red) !important;
    border-radius: 4px !important;
    position: relative !important;
  }

  .desktop-scrubber-track:hover .desktop-scrubber-fill::after {
    content: '' !important;
    position: absolute !important;
    right: -5px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 10px !important;
    height: 10px !important;
    background: #ffffff !important;
    border-radius: 50% !important;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.5) !important;
  }

  /* Right Column: Volume Slider + Actions */
  .player-right-block {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 14px !important;
  }

  #player-add-playlist-btn {
    display: flex !important;
  }

  .desktop-volume-control {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }

  #desktop-volume-btn {
    width: 34px !important;
    height: 34px !important;
    color: var(--text-secondary) !important;
    cursor: pointer !important;
  }

  #desktop-volume-btn:hover {
    color: #ffffff !important;
  }

  #desktop-volume-btn svg {
    width: 19px !important;
    height: 19px !important;
  }

  .volume-slider {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 95px !important;
    height: 4px !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 4px !important;
    outline: none !important;
    cursor: pointer !important;
    transition: background 0.15s ease !important;
  }

  .volume-slider:hover {
    background: rgba(255, 255, 255, 0.35) !important;
  }

  .volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    width: 12px !important;
    height: 12px !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    cursor: pointer !important;
    transition: transform var(--transition-fast) !important;
  }

  .volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.25) !important;
    background: var(--accent-red) !important;
  }

  /* 9. Desktop Modals: Centered floating dialogs */
  .app-modal {
    align-items: center !important;
    justify-content: center !important;
    padding: 24px !important;
  }

  .app-modal:not(.hidden) {
    display: flex !important;
  }

  .app-modal.hidden,
  .hidden {
    display: none !important;
  }

  .modal-dialog {
    max-width: 440px !important;
    border-radius: 24px !important;
    animation: fadeIn 0.22s ease-out !important;
  }

  .delete-playlist-dialog {
    max-width: 420px !important;
    border-radius: 24px !important;
    padding: 28px 24px 22px 24px !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
  }

  .import-modal-dialog {
    max-width: 480px !important;
    border-radius: 24px !important;
  }

  .sheet-grabber-bar {
    display: none !important;
  }

  .expanded-content {
    max-width: 520px;
    height: 88vh;
    margin: auto;
    border-radius: 28px;
    border: 1px solid var(--border-subtle);
  }
}

/* --------------------------------------------------------------------------
   iPhone Native Bottom Navigation Bar
   -------------------------------------------------------------------------- */
.bottom-nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(56px + var(--sab));
  padding-bottom: var(--sab);
  background: rgba(14, 14, 14, 0.94);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1000;
  user-select: none;
  -webkit-user-select: none;
}

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 56px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-fast), transform var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
  padding: 4px 0;
}

.nav-tab svg {
  width: 22px;
  height: 22px;
  transition: transform 0.15s ease, color 0.15s ease;
}

.nav-tab span {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.nav-tab.active {
  color: #ffffff;
}

.nav-tab.active svg {
  transform: scale(1.08);
  color: var(--accent-red);
}

.nav-tab:active {
  transform: scale(0.92);
}

/* --------------------------------------------------------------------------
   Home Tab, Trending Shelves & Personalized Suggestions
   -------------------------------------------------------------------------- */
.home-section {
  margin-bottom: 30px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}

.section-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Genre Pills (Horizontal Scroll) */
.genre-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.genre-scroll::-webkit-scrollbar {
  display: none;
}

.genre-pill {
  flex-shrink: 0;
  padding: 7px 15px;
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.genre-pill:active, .genre-pill:hover {
  background-color: var(--surface-hover);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

/* Shelf Scroll (Horizontal Carousel for Tracks) */
.shelf-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px 14px 2px;
  width: 100%;
  max-width: 100%;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}

.shelf-scroll::-webkit-scrollbar {
  display: none;
}

.shelf-card {
  flex: 0 0 138px;
  width: 138px;
  min-width: 138px;
  max-width: 138px;
  scroll-snap-align: start;
  cursor: pointer;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.shelf-card:active {
  transform: scale(0.96);
  border-color: var(--accent-red);
}

.shelf-card-thumb-wrap {
  position: relative;
  width: 100%;
  height: 122px;
  border-radius: 10px;
  overflow: hidden;
  background-color: #000;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.shelf-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.shelf-card:hover .shelf-card-thumb {
  transform: scale(1.04);
}

.shelf-card-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.shelf-card:hover .shelf-card-play-overlay,
.shelf-card:active .shelf-card-play-overlay {
  opacity: 1;
}

.shelf-card-play-overlay svg {
  width: 28px;
  height: 28px;
  color: #fff;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6));
}

.shelf-card-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.shelf-card-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.shelf-card-artist {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shelf-skeleton {
  flex: 0 0 138px;
  width: 138px;
  min-width: 138px;
  max-width: 138px;
  height: 175px;
  border-radius: 14px;
  background: linear-gradient(90deg, #181818 25%, #252525 50%, #181818 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

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

/* Recommendations Container */
.recommendations-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.recommendation-shelf-block {
  background: rgba(25, 25, 25, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 14px 14px 4px 14px;
}

.rec-shelf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.rec-shelf-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.rec-shelf-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(255, 0, 51, 0.15);
  color: var(--accent-red);
  font-weight: 600;
}

.rec-shelf-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

/* Shelf Navigation Controls (Strictly hidden on mobile / iPhone to preserve touch native UX) */
.shelf-nav-controls {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Import Playlist Modal (Spotify, YouTube Music, JSON Backup)
   -------------------------------------------------------------------------- */
.import-modal-dialog {
  max-width: 480px;
  width: 100%;
}

.import-modal-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 18px;
}

.import-tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.import-tab-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.import-tab-btn.active {
  background: #ffffff;
  color: #000000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.import-tab-btn.active svg {
  stroke: #000000;
}

.import-panel {
  display: flex;
  flex-direction: column;
}

.input-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
  width: 100%;
}

.input-group label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: #e0e0e0;
  margin-bottom: 8px;
  letter-spacing: 0.2px;
}

.import-input-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.import-panel input[type="text"],
.import-panel input[type="url"],
.input-group input[type="text"],
.input-group input[type="url"] {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  color: #ffffff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
}

.import-panel input[type="text"]::placeholder,
.import-panel input[type="url"]::placeholder,
.input-group input[type="text"]::placeholder,
.input-group input[type="url"]::placeholder {
  color: rgba(255, 255, 255, 0.35);
  font-size: 13.5px;
}

.import-panel input[type="text"]:hover,
.import-panel input[type="url"]:hover,
.input-group input[type="text"]:hover,
.input-group input[type="url"]:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
}

.import-panel input[type="text"]:focus,
.import-panel input[type="url"]:focus,
.input-group input[type="text"]:focus,
.input-group input[type="url"]:focus {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px rgba(255, 0, 51, 0.22);
}

.import-input-wrapper input {
  padding-right: 100px;
}

.input-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 7px;
  line-height: 1.4;
}

.platform-badge {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 20px;
  pointer-events: none;
  animation: fadeIn 0.2s ease-out;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.platform-badge.spotify {
  background: rgba(29, 185, 84, 0.2);
  color: #1ed760;
  border: 1px solid rgba(29, 185, 84, 0.4);
}

.platform-badge.youtube {
  background: rgba(255, 0, 51, 0.2);
  color: var(--accent-red);
  border: 1px solid rgba(255, 0, 51, 0.4);
}

.platform-badge.json {
  background: rgba(0, 229, 255, 0.18);
  color: #00e5ff;
  border: 1px solid rgba(0, 229, 255, 0.35);
}

.import-preview-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 10px;
  margin-bottom: 4px;
  animation: fadeIn 0.2s ease-out;
}

.import-preview-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background-color: #111;
  flex-shrink: 0;
}

.import-preview-info {
  flex: 1;
  min-width: 0;
}

.import-preview-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.import-preview-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.import-status-box {
  background: rgba(25, 25, 25, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  margin-top: 14px;
  animation: fadeIn 0.2s ease-out;
}

.import-status-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

/* File / Drag & Drop Zone */
.json-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.json-drop-zone:hover,
.json-drop-zone.dragover {
  border-color: var(--accent-red);
  background: rgba(255, 0, 51, 0.06);
}

.drop-zone-icon {
  width: 32px;
  height: 32px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.drop-zone-text {
  font-size: 13.5px;
  color: #ffffff;
  font-weight: 600;
  margin-bottom: 2px;
}

.drop-zone-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.selected-file-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 10px 14px;
  margin-top: 12px;
  animation: fadeIn 0.2s ease-out;
}

.file-preview-content {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.file-preview-content svg {
  width: 18px;
  height: 18px;
  color: var(--accent-red);
  flex-shrink: 0;
}

.file-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-remove-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.file-remove-btn:hover {
  color: #ffffff;
}

.raw-json-input {
  width: 100%;
  height: 84px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 12px 14px;
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
  color: var(--text-primary);
  resize: vertical;
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
}

.raw-json-input:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
}

.raw-json-input:focus {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px rgba(255, 0, 51, 0.22);
}

/* --------------------------------------------------------------------------
   Definitive .hidden override (Always takes precedence)
   -------------------------------------------------------------------------- */
.hidden,
.app-modal.hidden,
.ios-sheet-modal.hidden,
.expanded-player-modal.hidden,
.mini-spinner.hidden {
  display: none !important;
}

