:root {
  --bg-color: #000000;
  --surface-color: #121212;
  --surface-color-light: #282828;
  --text-primary: #ffffff;
  --text-secondary: #a7a7a7;
  --accent-color: #ffffff;
  --accent-hover: #e0e0e0;
  --danger-color: #e63946;
  --nav-base-height: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-height: calc(var(--nav-base-height) + var(--safe-bottom));
  --mini-player-height: 60px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent !important;
}

*:focus, *:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

button, input, select, textarea {
  outline: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  overflow: hidden; /* Prevent body scroll, handle scroll in views */
  user-select: none;
}

/* Dynamic Background */
.dynamic-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-size: cover;
  background-position: center;
  filter: blur(80px) brightness(0.3);
  z-index: -1;
  transition: background-image 0.5s ease;
}

/* App Container */
#app-container {
  width: 100vw;
  height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Views */
.view {
  flex: 1;
  overflow-y: auto;
  padding-bottom: calc(var(--nav-height) + var(--mini-player-height) + 20px);
  display: none;
  animation: fadeIn 0.3s ease;
}
.view.active {
  display: block;
}

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

/* Typography & Headers */
.top-header {
  padding: 45px 20px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
  z-index: 10;
}

.top-header h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

/* Settings View UI */
.settings-content {
  padding: 0 20px calc(var(--nav-height) + var(--mini-player-height) + 40px);
}

.settings-card {
  background: rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 25px;
  display: flex;
  flex-direction: column;
}

.account-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  margin-right: 15px;
}

.account-info h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.account-info p {
  font-size: 14px;
  color: var(--text-secondary);
}

.settings-section {
  background: rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 0 15px;
  margin-bottom: 25px;
}

.settings-section h3 {
  font-size: 13px;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 15px 0 5px;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 16px;
}
.setting-item:last-child {
  border-bottom: none;
}

/* Custom Color Picker */
.color-picker {
  display: flex;
  gap: 12px;
}
.color-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.1);
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.color-btn.active {
  transform: scale(1.2);
  border-color: rgba(255, 255, 255, 1);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* iOS Style Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}
.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255,255,255,0.2);
  transition: .4s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 24px;
  width: 24px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
input:checked + .slider {
  background-color: var(--accent-color);
}
input:checked + .slider:before {
  transform: translateX(22px);
}
.slider.round {
  border-radius: 34px;
}
.slider.round:before {
  border-radius: 50%;
}


/* Buttons */
.icon-btn {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 24px;
  cursor: pointer;
  padding: 10px;
  opacity: 0.6;
  border-radius: 50%;
  outline: none !important;
  -webkit-tap-highlight-color: transparent !important;
  user-select: none;
  -webkit-user-select: none;
  transition: opacity 0.2s, color 0.2s, transform 0.1s;
}
.icon-btn:hover {
  opacity: 1;
}
.icon-btn.active {
  color: var(--accent-color);
  opacity: 1;
  text-shadow: 0 0 10px var(--accent-color);
}
.icon-btn:active {
  transform: scale(0.9);
  background: transparent !important;
}
/* The lyrics button toggles via .hidden. Without this it stayed in the flex
   row and held ~44px of width, which pushed .full-player-context off centre
   even when the button showed nothing (its glyph name did not exist either). */
.icon-btn.hidden {
  display: none;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  box-sizing: border-box;
  background: rgba(18, 18, 18, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding-top: 4px;
  padding-bottom: var(--safe-bottom);
  border-top: 1px solid rgba(255,255,255,0.05);
  z-index: 100;
}

.nav-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: calc(var(--nav-base-height) - 6px);
  cursor: pointer;
  transition: color 0.2s;
}
.nav-btn i {
  font-size: 20px;
  margin-bottom: 3px;
}
.nav-btn span {
  font-size: 10px;
  font-weight: 500;
}
.nav-btn.active {
  color: var(--accent-color);
}

/* Mini Player */
.mini-player {
  position: fixed;
  bottom: calc(var(--nav-height) + 8px);
  left: 10px;
  right: 10px;
  height: var(--mini-player-height);
  background: rgba(30, 30, 34, 0.95);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 99;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  transform: translate3d(0, 0, 0);
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.38s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
  user-select: none;
  -webkit-user-select: none;
}
.mini-player.hidden {
  transform: translateY(150%);
  opacity: 0;
  pointer-events: none;
}

.mini-progress-bar {
  height: 2px;
  background: var(--accent-color);
  width: 0%;
}

.mini-player-content {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 10px;
  transform: translate3d(0, 0, 0);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}
.mini-cover {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  margin-right: 12px;
}

.mini-info {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.mini-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

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

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

/* Full Screen Player */

/* Full Player Dynamic Ambient Cover Backdrop */
.full-player {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #0d0d11;
  z-index: 200;
  display: flex;
  flex-direction: column;
  padding: 55px 20px 25px;
  transform: translate3d(0, 0, 0);
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.38s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent !important;
  user-select: none;
  -webkit-user-select: none;
}

.full-player-bg {
  position: absolute;
  top: -20%;
  left: -20%;
  width: 140%;
  height: 140%;
  background-size: cover;
  background-position: center;
  filter: blur(50px) saturate(2.0) brightness(0.85);
  -webkit-filter: blur(50px) saturate(2.0) brightness(0.85);
  transform: scale(1.05) translateZ(0);
  transition: background-image 0.6s ease, opacity 0.5s ease;
  z-index: 0;
  pointer-events: none;
  will-change: transform, opacity;
  opacity: 0.88;
}

.full-player-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(10,10,14,0.3) 0%, rgba(10,10,14,0.1) 40%, rgba(10,10,14,0.55) 75%, rgba(10,10,14,0.92) 100%);
  z-index: 1;
  pointer-events: none;
}

.full-player-header,
.full-cover-container,
.full-info,
.progress-container,
.full-controls {
  position: relative;
  z-index: 2;
}

.full-player * {
  -webkit-tap-highlight-color: transparent !important;
  outline: none !important;
}
.translateY-100 {
  transform: translate3d(0, 100%, 0) !important;
  pointer-events: none !important;
}

/* Three-column header. The two flanks each take an equal share of the free
   space and the title sizes to its content, which is what keeps the title
   genuinely centred. Plain space-between cannot do that: the right flank holds
   two buttons (lyrics + menu) while the left holds one, so the title was pushed
   off centre by half a button width whenever the lyrics button was visible. */
.full-player-header {
  display: grid;
  grid-template-columns: var(--control-height) minmax(0, 1fr) auto;
  column-gap: 8px;
  align-items: center;
  padding: 16px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.full-player-header > .icon-btn,
.full-player-header > .full-player-header-actions {
  min-width: 0;
}

/* The flank expands but its icon must stay pinned to the outer edge. */
.full-player-header > .icon-btn {
  flex: 0 0 var(--control-height);
  width: var(--control-height);
  height: var(--control-height);
  min-width: var(--control-height);
  min-height: var(--control-height);
  padding: 0;
  text-align: center;
  justify-self: start;
  opacity: 1;
}

.full-player-context {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  padding: 0 10px;
  text-align: center;
}

.full-player-context .context-subtitle {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-secondary, #9e9e9e);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.full-player-context .context-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary, #ffffff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  margin-top: 1px;
}

.full-cover-container {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
}
.full-cover {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1/1;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 12px 28px rgba(0,0,0,0.45);
  transform: scale(0.92);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
  will-change: transform, box-shadow;
}

.full-player.lyrics-mode .full-cover {
  visibility: hidden;
  opacity: 0;
}

.full-cover.playing {
  transform: scale(1.0);
  box-shadow: 0 24px 50px rgba(0,0,0,0.65), 0 0 30px rgba(255,255,255,0.06);
}

/* Lyrics: the header keeps the menu button and the lyrics toggle side by side.
   Without the wrapper the two buttons would become separate flex children and
   space-between would spread them apart. */
.full-player-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

.full-player-header-actions .icon-btn {
  flex: 0 0 var(--control-height);
  width: var(--control-height);
  height: var(--control-height);
  min-width: var(--control-height);
  min-height: var(--control-height);
  padding: 0;
}

/* Overlays the cover art in place, so opening lyrics never changes the player
   layout. The cover stays mounted behind it to keep the ambient backdrop.
   Needs its own .hidden rule — see the note on .vibe-sync-warning.hidden.
   Without it the panel sat over the artwork permanently, which is the dark
   translucent square that covered the cover art. */
.full-lyrics.hidden {
  display: none;
}
.full-lyrics {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: 16px;
  overflow: hidden;
  z-index: 3;
  transition: opacity 0.25s ease;
}

.full-lyrics-lines {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  scrollbar-width: none;
  overscroll-behavior: contain;
  padding: 42% 22px;
  text-align: center;
  scroll-behavior: smooth;
  scroll-padding-block: 45%;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 17%, #000 83%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 17%, #000 83%, transparent 100%);
}
.full-lyrics-lines::-webkit-scrollbar {
  display: none;
}

.lyric-line {
  width: 100%;
  max-width: 30em;
  margin: 0 auto;
  padding: 10px 0;
  font-size: 21px;
  line-height: 1.35;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.34);
  opacity: 0.72;
  transform: scale(0.94);
  transform-origin: center center;
  will-change: transform, opacity, color, filter;
  transition:
    color 0.72s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.72s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.72s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.72s cubic-bezier(0.22, 1, 0.36, 1);
}

.lyric-line.active {
  color: #fff;
  font-weight: 800;
  opacity: 1;
  filter: drop-shadow(0 2px 14px rgba(0, 0, 0, 0.25));
  transform: scale(1.08);
}

.lyric-line[data-index].active ~ .lyric-line[data-index] {
  opacity: 0.5;
}

.lyric-line.meta {
  opacity: 0.45;
  transform: none;
}

.as-btn.download-active {
  --download-progress: 0%;
  position: relative;
  overflow: hidden;
}

.as-btn.download-active::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 50%;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: conic-gradient(
    var(--accent-color, #fed42b) var(--download-progress),
    rgba(255, 255, 255, 0.16) var(--download-progress)
  );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 0);
  pointer-events: none;
}

/* Instrumental gaps and empty lines still need spacing, or two sung lines
   would visually collide. */
.lyric-line.empty {
  min-height: 22px;
}

.lyric-line.meta {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  text-transform: uppercase;
  padding: 4px 0;
}

.lyrics-loading,
.lyrics-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
  color: var(--text-secondary);
  font-size: 14px;
  text-align: center;
  padding: 0 24px;
}

.lyrics-loading i {
  font-size: 22px;
  animation: spin 1s linear infinite;
}

.full-info {
  margin-bottom: 20px;
}
.full-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.full-title-row > div {
  flex: 1;
  min-width: 0;
}
.full-title-row .like-btn {
  flex: 0 0 var(--control-height);
  width: var(--control-height);
  height: var(--control-height);
  min-width: var(--control-height);
  min-height: var(--control-height);
  padding: 0;
  font-size: 22px;
  opacity: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.full-title-row .like-btn i {
  display: block;
  line-height: 1;
}
#full-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
}
#full-artist {
  font-size: 16px;
  color: var(--text-secondary);
}

.progress-container {
  margin-bottom: 30px;
}
input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
  height: 24px;
  outline: none;
}
/* -webkit-appearance:none removes Blink's built-in played-segment fill, so the
   track paints it itself from --progress. Defaults to 0 so an untouched slider
   is fully "empty" instead of falling back to the gradient's unset value. */
input[type=range] {
  --progress: 0%;
}
input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  background: linear-gradient(to right,
    var(--accent-color, #ffdb4d) 0%,
    var(--accent-color, #ffdb4d) var(--progress),
    rgba(255,255,255,0.2) var(--progress),
    rgba(255,255,255,0.2) 100%);
  border-radius: 2px;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 12px;
  width: 12px;
  border-radius: 50%;
  background: #fff;
  margin-top: -4px;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

.home-hub {
  width: min(100% - 36px, 620px);
  margin: 18px auto 22px;
  text-align: left;
}
.home-hub h2 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 750;
}
.home-hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.home-hub-card {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  color: #fff;
  background: rgba(255,255,255,.08);
  text-align: left;
  font: inherit;
  font-weight: 650;
}
.home-hub-card i { font-size: 21px; color: var(--accent-color, #fed42b); }
.home-hub-continue { background: linear-gradient(120deg, rgba(252,63,29,.32), rgba(255,255,255,.08)); }
.collection-tag-filters {
  padding: 8px 16px 12px;
}
.collection-tag-filters[hidden] { display: none; }
.collection-tag-caption {
  margin: 0 0 8px 2px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.collection-tag-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.collection-tag-row::-webkit-scrollbar { display: none; }
.collection-tag-chip {
  flex: 0 0 auto;
  padding: 8px 13px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  color: var(--text-secondary);
  background: rgba(255,255,255,.07);
  font: inherit;
  font-size: 13px;
}
.collection-tag-chip.active {
  color: #111;
  border-color: var(--accent-color, #fed42b);
  background: var(--accent-color, #fed42b);
}
.track-download-art {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--accent-color, #fed42b);
  background: linear-gradient(145deg, rgba(252,63,29,.22), rgba(255,255,255,.08));
  font-size: 24px;
}
.downloaded-track-action {
  flex: 0 0 38px;
  width: 38px;
  height: 42px;
  border: 0;
  border-radius: 10px;
  color: var(--text-secondary);
  background: transparent;
  font-size: 19px;
}
.downloaded-track-action[data-action="play"] { color: var(--accent-color, #fed42b); }
.downloaded-track-action:active { background: rgba(255,255,255,.1); }

/* Place the Wave action in the visual center of the usable first screen, with
   the title and play control reading as one primary action. */
.vibe-container { padding-top: 0; }
.vibe-hero {
  isolation: isolate;
  position: relative;
  width: 100%;
  min-height: clamp(350px, 57vh, 520px);
  box-sizing: border-box;
  padding: 80px 16px 12px;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  align-items: center;
  justify-content: center;
  column-gap: 8px;
}
.vibe-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: min(90vw, 500px);
  height: min(54vh, 440px);
  left: 50%;
  top: 57%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse, rgba(255,255,255,.2), transparent 68%);
  filter: blur(62px);
  opacity: .28;
  border-radius: 50%;
  pointer-events: none;
  animation: waveGlowDrift 16s ease-in-out infinite alternate;
}
@keyframes waveGlowDrift {
  0% { transform: translate(-52%, -48%) rotate(-8deg) scale(.94); }
  50% { transform: translate(-48%, -52%) rotate(7deg) scale(1.06, .98); }
  100% { transform: translate(-51%, -49%) rotate(15deg) scale(1.02, 1.08); }
}
@media (prefers-reduced-motion: reduce) {
  .vibe-hero::before { animation: none; }
}

.vibe-hero .vibe-animation {
  width: 38px;
  height: 48px;
  flex: 0 0 38px;
  margin: 0;
}
.vibe-hero .vibe-play-btn {
  width: 38px;
  height: 44px;
  border-radius: 12px;
  color: #fff;
  background: transparent;
  box-shadow: none;
  font-size: 38px;
}
.vibe-hero .vibe-title {
  margin: 0;
  font-size: clamp(28px, 8vw, 42px);
  line-height: 1.15;
  letter-spacing: -.04em;
}
.vibe-hero .vibe-subtitle {
  flex: 0 0 100%;
  text-align: center;
  margin: 12px 0 0;
  font-size: 14px;
  color: rgba(255,255,255,.8);
}
.vibe-mood-chips { position: relative; z-index: 1; }
@media (max-height: 700px) {
  .vibe-hero { min-height: 300px; }
}
.time-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

.full-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}
.full-controls .icon-btn {
  font-size: 28px;
}
.play-circle-btn {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--accent-color);
  color: #000000;
  border: none;
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none !important;
  -webkit-tap-highlight-color: transparent !important;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.1s;
}
.play-circle-btn:focus, .play-circle-btn:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}
.play-circle-btn:active {
  transform: scale(0.95);
}

#view-vibe {
  position: relative;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  height: 100%;
}

.vibe-ambient-wrap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 560px;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  isolation: isolate;
  opacity: 0.98;
  transition: opacity 0.6s ease;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 74%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 74%, transparent 100%);
}

.vibe-ambient-wrap::before {
  content: none;
}

.vibe-ambient-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  transform: translateZ(0);
  pointer-events: none;
  opacity: .9;
  mix-blend-mode: screen;
}
.vibe-container {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: auto;
  padding-top: 35px;
  padding-bottom: calc(var(--nav-height) + var(--mini-player-height) + 35px);
  box-sizing: border-box;
  overflow: visible;
}
.vibe-animation {
  position: relative;
  width: 150px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 30px;
}
.vibe-play-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent-color);
  color: #000000;
  border: none;
  font-size: 36px;
  z-index: 2;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}
.blob {
  display: none !important;
}
.blob1 {
  background: linear-gradient(135deg, #444, #888);
}
.blob2 {
  background: linear-gradient(135deg, #666, #aaa);
  animation-direction: reverse;
  animation-duration: 10s, 15s;
  opacity: 0.6;
}

@keyframes morph {
  0% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
  34% { border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%; }
  67% { border-radius: 100% 60% 60% 100% / 100% 100% 60% 60%; }
  100% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
}

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

.vibe-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 6px;
}
.vibe-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 15px;
}

/* Vibe Mood Chips */
.vibe-mood-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  max-width: 100%;
  padding: 6px 20px 16px 20px;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.vibe-mood-chips::-webkit-scrollbar {
  display: none;
}
.vibe-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  user-select: none;
}
.vibe-chip i {
  font-size: 12px;
}
.vibe-chip.active {
  background: var(--accent-color);
  color: #000000;
  border-color: var(--accent-color);
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.18);
}
.vibe-chip:active {
  transform: scale(0.96);
}

/* Vibe Stats Panel (Top 3 Cards) */
.vibe-stats-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: calc(100% - 32px);
  max-width: 440px;
  margin-top: 5px;
  margin-bottom: 10px;
}
.vibe-stat-card {
  background: rgba(30, 30, 34, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.2s, background 0.2s;
}
.vibe-stat-card:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.08);
}
.stat-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  margin-bottom: 8px;
}
.stat-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.stat-value {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.stat-label {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

/* Vibe Total Stats (Separate Cards Below) */
.vibe-total-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: calc(100% - 32px);
  max-width: 440px;
  margin-bottom: 24px;
}
.vibe-total-card {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.2s, background 0.2s;
}
.vibe-total-card:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.07);
}
.vibe-total-card .stat-icon-wrap {
  margin-bottom: 0;
  width: 30px;
  height: 30px;
  font-size: 14px;
  flex-shrink: 0;
}
.vibe-total-card .stat-content {
  align-items: flex-start;
  text-align: left;
}
.vibe-total-card .stat-value {
  font-size: 14px;
  font-weight: 800;
}
.vibe-total-card .stat-label {
  font-size: 9px;
  margin-top: 1px;
}

/* Library View */
.library-content {
  padding: 0 20px;
}
.playlist-header {
  display: flex;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 10px;
}
.playlist-cover {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #ff416c, #ff4b2b);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-right: 15px;
}
.playlist-info flex {
  flex: 1;
}
.playlist-info h2 {
  font-size: 18px;
  margin-bottom: 4px;
}
.playlist-info p {
  color: var(--text-secondary);
  font-size: 14px;
}
/* Sits left of the play button and takes the auto margin, so the pair stays
   pinned to the right edge of .playlist-header. Giving both buttons
   margin-left:auto would split the free space and strand this one mid-row. */
.play-all-btn {
  background: var(--accent-color);
  color: #000;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  flex-shrink: 0;
}

.empty-state {
  text-align: center;
  padding: 50px 0;
  color: var(--text-secondary);
}
.empty-state i {
  font-size: 48px;
  margin-bottom: 15px;
  display: block;
  opacity: 0.5;
}

/* Auth Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.8);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-overlay.hidden {
  display: none;
}
.modal-content {
  background: var(--surface-color);
  width: 90%;
  max-width: 400px;
  border-radius: 16px;
  padding: 20px;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
.form-input {
  width: 100%;
  background: var(--surface-color-light);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  padding: 12px;
  border-radius: 8px;
  margin-top: 10px;
  outline: none;
}
.form-input:focus {
  border-color: var(--accent-color);
}
.btn-primary {
  background: var(--accent-color);
  color: #000;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}
.btn-control.active {
  color: var(--accent-color);
  opacity: 1;
}
.explicit-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 15px;
  padding: 0 3px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.88);
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1;
  border-radius: 3px;
  margin-left: 6px;
  flex-shrink: 0;
  box-sizing: border-box;
  text-transform: uppercase;
  letter-spacing: -0.2px;
}
.liberty-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 16px;
  padding: 0 4px;
  background: rgba(255, 75, 43, 0.16);
  border: 1px solid rgba(255, 75, 43, 0.45);
  color: #ff5252;
  border-radius: 4px;
  margin-left: 6px;
  flex-shrink: 0;
  box-sizing: border-box;
}
#full-title .explicit-badge {
  min-width: 19px;
  height: 18px;
  font-size: 11px;
  margin-left: 8px;
  border-radius: 4px;
}
#full-title .liberty-badge {
  min-width: 20px;
  height: 18px;
  margin-left: 8px;
}
.liberty-badge i {
  font-size: 10px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.track-item {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
}
.track-item img {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  margin-right: 15px;
  object-fit: cover;
}
.track-info {
  flex: 1;
  overflow: hidden;
  min-width: 0;
}
.track-title {
  display: flex;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  max-width: 100%;
}
.track-title-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex-shrink: 1;
}
.track-artist {
  font-size: 14px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.track-dots {
  padding: 10px;
  margin: -6px -6px -6px 4px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s, transform 0.1s;
  flex-shrink: 0;
}
.track-dots:active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  transform: scale(0.92);
}

/* Optical compensation for Play Triangle icon inside circular buttons */
.vibe-play-btn i.bi-play-fill,
.play-circle-btn i.bi-play-fill,
.play-all-btn i.bi-play-fill {
  margin-left: 3px;
}
#mini-btn-play i.bi-play-fill {
  margin-left: 2px;
}

/* Custom select */
.custom-select {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  cursor: pointer;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}
.custom-select option {
  background: #1e1e1e;
  color: #ffffff;
}

/* Equalizer Card */
.eq-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 18px 16px;
  margin-top: 14px;
}
.eq-controls {
  transition: opacity 0.25s, pointer-events 0.25s;
}
.eq-controls.disabled {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(0.5);
}
.eq-preset-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.eq-sliders-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 4px;
  gap: 10px;
}
.eq-slider-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
}
.eq-val {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 3px 6px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
  min-width: 44px;
  white-space: nowrap;
  text-align: center;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.eq-val.boost {
  color: var(--accent-color, #fc3f1d);
  background: rgba(252, 63, 29, 0.14);
  border-color: rgba(252, 63, 29, 0.35);
}
.eq-val.cut {
  color: #4da3ff;
  background: rgba(77, 163, 255, 0.14);
  border-color: rgba(77, 163, 255, 0.35);
}
.eq-slider-track {
  height: 140px;
  width: 34px;
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 17px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
}
.eq-slider-track::before {
  content: '';
  position: absolute;
  left: 6px;
  right: 6px;
  top: 70px;
  height: 2px;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.3);
  border-radius: 1px;
  z-index: 1;
  pointer-events: none;
}
.eq-track-line {
  position: absolute;
  left: 50%;
  top: 11px;
  bottom: 11px;
  width: 4px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  pointer-events: none;
  z-index: 1;
}
.eq-slider-fill {
  position: absolute;
  left: 50%;
  width: 4px;
  transform: translateX(-50%);
  border-radius: 2px;
  background: var(--accent-color, #fc3f1d);
  pointer-events: none;
  z-index: 2;
  transition: height 0.05s ease, top 0.05s ease;
}
.eq-slider-thumb {
  position: absolute;
  left: 50%;
  top: 70px;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(255, 255, 255, 0.2);
  pointer-events: none;
  z-index: 3;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.eq-slider-track:active .eq-slider-thumb,
.eq-slider-track.dragging .eq-slider-thumb {
  transform: translate(-50%, -50%) scale(1.18);
  box-shadow: 0 4px 14px rgba(252, 63, 29, 0.6), 0 0 0 3px var(--accent-color, #fc3f1d);
}
.eq-slider-hidden {
  display: none;
}
.eq-freq-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 10px;
  text-align: center;
}
.eq-freq {
  font-size: 11px;
  color: #ffffff;
  font-weight: 700;
  white-space: nowrap;
}
.eq-freq-sub {
  font-size: 9px;
  color: var(--text-secondary, #888888);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Global Toast Notification */
.global-toast {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--mini-player-height) + 16px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30, 30, 30, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  color: #ffffff;
  padding: 12px 22px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 2000;
  transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  pointer-events: none;
}
.global-toast i {
  color: var(--accent-color);
  font-size: 18px;
}
.global-toast.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(15px);
}

/* Update Modal Styles */
.update-modal-card {
  max-width: 420px;
  background: #1c1c1e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  border-radius: 20px;
}
.update-icon-badge {
  font-size: 26px;
  color: var(--accent-color, #fc3f1d);
  display: flex;
  align-items: center;
  justify-content: center;
}
.update-version-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(252, 63, 29, 0.15);
  color: var(--accent-color, #fc3f1d);
  margin-top: 3px;
}
.update-changelog-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.update-changelog-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  max-height: 160px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.5;
  color: #e0e0e0;
}
.update-changelog-box ul {
  margin: 0;
  padding-left: 18px;
}
.update-changelog-box li {
  margin-bottom: 4px;
}
.update-progress-container {
  margin-top: 15px;
}
.update-progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.update-progress-fill {
  width: 0%;
  height: 100%;
  background: var(--accent-color, #fc3f1d);
  border-radius: 4px;
  transition: width 0.15s ease;
}
.update-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.update-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.update-actions button {
  flex: 1;
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: none;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-secondary:active {
  background: rgba(255, 255, 255, 0.18);
}

/* About Section & App Version Styling */
.about-section {
  margin-top: 15px;
  margin-bottom: 25px;
}
.about-app-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0 16px;
  border-bottom: none !important;
}
.about-app-info {
  display: flex;
  align-items: center;
  gap: 14px;
}
.about-app-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}
.about-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.about-app-name {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.2px;
  line-height: 1.2;
}
.about-app-version {
  font-size: 12px;
  color: var(--text-secondary, #888888);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.btn-check-update {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  outline: none;
  white-space: nowrap;
}
.btn-check-update:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
}
.btn-check-update:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.2);
}
.btn-check-update i {
  font-size: 15px;
  color: var(--accent-color, #fc3f1d);
  transition: transform 0.3s ease;
}

/* ==========================================
   Home Screen: New Releases (Новинки и премьеры)
   ========================================== */
.vibe-new-releases {
  margin-top: 24px;
  width: 100%;
  padding-bottom: 20px;
}

.releases-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 0 4px;
}

.releases-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.releases-title {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.2px;
}

.releases-subtitle {
  font-size: 12px;
  color: var(--text-secondary, #8e8e93);
}

.releases-refresh-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary, #aaaaaa);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.releases-refresh-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.releases-refresh-btn:active {
  transform: scale(0.92);
}

.releases-refresh-btn.spinning i {
  animation: spin 0.8s linear infinite;
}

.releases-carousel {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px 14px 2px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}

.releases-carousel::-webkit-scrollbar {
  display: none; /* Chrome, Safari */
}

.release-card {
  flex: 0 0 142px;
  width: 142px;
  scroll-snap-align: start;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 10px;
  transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), background 0.2s ease, border-color 0.2s ease;
  user-select: none;
  position: relative;
}

.release-card:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.08);
}

.release-cover-wrap {
  width: 122px;
  height: 122px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: #1e1e24;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
  margin-bottom: 10px;
}

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

.release-card:hover .release-cover-img {
  transform: scale(1.04);
}

.release-play-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ffffff !important;
  color: #000000 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  opacity: 0.95;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.release-card:active .release-play-btn {
  transform: scale(1.1);
  opacity: 1;
}

.release-play-btn i {
  font-size: 16px;
  color: #000000 !important;
  margin-left: 2px;
}

.release-badge-tag {
  position: absolute;
  top: 6px;
  left: 6px;
  max-width: 82%;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffd700;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 2px 6px;
  border-radius: 6px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.release-liberty-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: linear-gradient(135deg, #00c6ff, #0072ff);
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(0, 114, 255, 0.4);
}

.release-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.release-title {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.release-artist {
  font-size: 11px;
  color: var(--text-secondary, #8e8e93);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

/* Skeleton Loading Cards */
.release-card-skeleton {
  pointer-events: none;
}

.skeleton-box {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 37%, rgba(255, 255, 255, 0.05) 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  border-radius: 8px;
}

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

/* Crossfade Settings styling */

.crossfade-slider-input {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
  margin: 8px 0;
}

.crossfade-slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-color, #ffd700);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease;
}

.crossfade-slider-input::-webkit-slider-thumb:active {
  transform: scale(1.2);
}





/* 120Hz Acceleration & Gestures for Views */
#view-artist, #view-album {
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

/* Vibe Top Header & Search Relocation */
.vibe-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 45px 20px 0;
  width: 100%;
  box-sizing: border-box;
}
.vibe-logo-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.vibe-logo-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-color);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 0 14px rgba(254, 212, 43, 0.35);
}
.vibe-logo-text {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #fff;
}
.vibe-search-btn {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.2s, transform 0.15s;
}
.vibe-search-btn:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.15);
}

/* Search Suggestions Chips */
.search-suggestions-wrap {
  margin-top: 22px;
  margin-bottom: 10px;
}
.search-suggestions-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 12px;
}
.search-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.search-tag-chip {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.search-tag-chip:active {
  transform: scale(0.95);
  background: var(--accent-color);
  color: #000;
}

/* Top Search Button (Spotify & Yandex Music style) */
.top-search-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.top-search-btn:active {
  transform: scale(0.9);
  background: rgba(255, 255, 255, 0.2);
}

/* Vibe Top Bar & Search Safe Zone */
.vibe-top-bar {
  position: absolute;
  top: max(50px, calc(env(safe-area-inset-top, 0px) + 22px));
  right: 20px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.search-header-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: max(50px, calc(env(safe-area-inset-top, 0px) + 22px)) 20px 14px !important;
}

.search-header-row h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
}

.search-back-btn {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 20px;
  transition: transform 0.15s ease, background 0.2s ease;
}

.search-back-btn:active {
  transform: scale(0.9);
  background: rgba(255, 255, 255, 0.2);
}

/* --- Loading spinner (Bootstrap's .spinner-border is not loaded: only
   bootstrap-icons is, so the markup used to render an empty invisible div) --- */
.spinner-border {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  vertical-align: -0.125em;
  border: 0.25em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: ym-spinner 0.75s linear infinite;
}

.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.2em;
}

@keyframes ym-spinner {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .spinner-border { animation-duration: 1.5s; }
}

/* Text colour helpers referenced from JS markup */
.text-light { color: #f8f9fa; }
.text-danger { color: #ff3333; }
.text-center { text-align: center; }
/* --- Account stats sync warning ------------------------------------------ */
.vibe-sync-warning {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 4px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(230, 57, 70, 0.12);
  border: 1px solid rgba(230, 57, 70, 0.35);
  color: #ff8a95;
  font-size: 12.5px;
  line-height: 1.35;
}

.vibe-sync-warning i {
  font-size: 16px;
  flex-shrink: 0;
}

/* There is deliberately NO generic ".hidden { display: none }" in this sheet:
   .mini-player.hidden and .global-toast.hidden animate out via transform and
   opacity, and a global display:none would cut those animations off and leave
   the mini player vanishing instantly. So every element that hides via the
   .hidden class needs its own rule. This one was missing, which is why the
   sync warning stayed on screen permanently. */
.vibe-sync-warning.hidden {
  display: none;
}
/* === custom dropdown === */
/* --- Custom dropdown (replaces the OS-rendered native <select> popup) ------- */
.ym-select {
  position: relative;
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 11px 40px 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  box-sizing: border-box;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.ym-select:active,
.ym-select.is-open {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.ym-select-value {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ym-select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--text-secondary, #aaa);
  pointer-events: none;
  transition: transform 0.2s ease;
}

.ym-select.is-open .ym-select-arrow {
  transform: translateY(-50%) rotate(180deg);
}

/* The menu floats above the sheet instead of pushing the layout around. */
.ym-select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 50;
  background: #1c1c1e;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  max-height: 260px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.ym-select-menu.hidden {
  display: none;
}

.ym-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  text-align: left;
  padding: 11px 12px;
  border-radius: 8px;
  cursor: pointer;
  box-sizing: border-box;
}

.ym-select-option:active {
  background: rgba(255, 255, 255, 0.1);
}

.ym-select-option.is-selected {
  color: var(--accent-color, #fed42b);
  font-weight: 600;
}

.ym-select-option.is-selected::after {
  content: "";
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-color, #fed42b);
  box-shadow: inset 0 0 0 4px #1c1c1e;
}

/* Keep the Wave hero visually centered below the safe-area search control. */
#view-vibe .vibe-container { padding-top: 0; }
#view-vibe .vibe-ambient-wrap {
  height: 580px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 78%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 78%, transparent 100%);
}

/* ==========================================================================
   YM Liberty visual system
   This layer intentionally lives last: older screens contain legacy inline
   styles and are kept for JS compatibility. The rules below unify the
   presentation without changing the application state or playback logic.
   ========================================================================== */
:root {
  --bg-color: #08090c;
  --surface-color: #111318;
  --surface-color-light: #1b1e25;
  --surface-raised: rgba(24, 27, 34, .82);
  --surface-soft: rgba(255, 255, 255, .055);
  --surface-strong: rgba(255, 255, 255, .095);
  --text-primary: #f7f8fb;
  --text-secondary: #969ba8;
  --text-tertiary: #6d7280;
  --accent-color: #f4f6fb;
  --accent-hover: #ffffff;
  --danger-color: #ff5364;
  --line-color: rgba(255, 255, 255, .085);
  --line-soft: rgba(255, 255, 255, .055);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --control-height: 44px;
  --nav-base-height: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-height: calc(var(--nav-base-height) + var(--safe-bottom));
  --mini-player-height: 64px;
  --shadow-card: 0 14px 36px rgba(0, 0, 0, .24);
  --shadow-float: 0 18px 48px rgba(0, 0, 0, .42);
  --ease-standard: cubic-bezier(.2, .7, .2, 1);
}

html {
  background: var(--bg-color);
  color-scheme: dark;
}

body {
  font-family: Inter, "SF Pro Display", "SF Pro Text", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(ellipse 80% 45% at 50% -10%, rgba(80, 88, 116, .12), transparent 72%),
    var(--bg-color);
  color: var(--text-primary);
  letter-spacing: -.01em;
  overscroll-behavior-y: none;
}

button, input, select, textarea {
  font: inherit;
}

button {
  min-width: 44px;
  min-height: 44px;
}

button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent-color) !important;
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .12) !important;
}

button:disabled {
  cursor: default;
  opacity: .42;
  filter: saturate(.55);
}

.view {
  padding-bottom: calc(var(--nav-height) + var(--mini-player-height) + 28px);
  scrollbar-width: none;
}

.view::-webkit-scrollbar,
.tracks-list::-webkit-scrollbar {
  display: none;
}

.top-header,
.search-header-row {
  min-height: 76px;
  padding: calc(var(--safe-top) + 18px) 18px 14px !important;
  background: linear-gradient(180deg, rgba(8, 9, 12, .96), rgba(8, 9, 12, .72) 72%, transparent);
}

.top-header h1,
.search-header-row h1 {
  font-size: clamp(25px, 7vw, 31px);
  line-height: 1.1;
  letter-spacing: -.045em;
}

.icon-btn,
.top-search-btn,
.search-back-btn {
  width: var(--control-height);
  height: var(--control-height);
  padding: 0;
  min-width: var(--control-height);
  min-height: var(--control-height);
  border: 1px solid var(--line-color);
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .18s var(--ease-standard), background .18s ease, border-color .18s ease;
}

.icon-btn:hover,
.top-search-btn:hover,
.search-back-btn:hover {
  background: var(--surface-strong);
  border-color: rgba(255, 255, 255, .16);
}

.icon-btn:active,
.top-search-btn:active,
.search-back-btn:active,
.nav-btn:active,
.track-dots:active,
.vibe-chip:active,
.play-circle-btn:active {
  transform: scale(.94);
}

/* My Wave */
#view-vibe {
  background: linear-gradient(180deg, rgba(16, 18, 24, .2), transparent 38%);
}

.vibe-top-bar {
  top: calc(var(--safe-top) + 14px);
  right: 18px;
}

.vibe-container {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  padding: calc(var(--safe-top) + 78px) 0 28px;
}

.vibe-animation {
  flex: 0 0 auto;
  width: min(48vw, 168px);
  height: min(48vw, 168px);
  margin: 0 0 14px;
}

.vibe-container > .vibe-animation,
.vibe-container > .vibe-title,
.vibe-container > .vibe-subtitle,
.vibe-container > .vibe-mood-chips,
.vibe-container > .vibe-stats-panel,
.vibe-container > .vibe-total-stats-row,
.vibe-container > .vibe-sync-warning,
.vibe-container > .vibe-new-releases {
  grid-column: 1;
}

.vibe-animation::before {
  content: "";
  position: absolute;
  inset: 15%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .15), transparent 67%);
  filter: blur(14px);
  opacity: .65;
}

.vibe-play-btn {
  width: 76px !important;
  height: 76px !important;
  min-width: 76px;
  min-height: 76px;
  padding: 0;
  border-radius: 50% !important;
  border: 1px solid rgba(255,255,255,.45);
  box-shadow: 0 12px 38px rgba(0, 0, 0, .32), 0 0 0 8px rgba(255,255,255,.045);
  transition: transform .18s var(--ease-standard), box-shadow .18s ease;
}

.vibe-title {
  margin: 0 18px 7px;
  font-size: clamp(30px, 9vw, 40px);
  line-height: 1.05;
  letter-spacing: -.06em;
}

.vibe-subtitle {
  margin: 0 20px 18px;
  color: var(--text-secondary);
  font-size: 14px;
}

.vibe-mood-chips {
  width: 100%;
  gap: 8px;
  padding: 5px 18px 18px;
  overscroll-behavior-x: contain;
}

.vibe-chip {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--line-color);
  border-radius: 999px;
  background: rgba(255,255,255,.045);
  color: var(--text-secondary);
  font-size: 13px;
  transition: transform .18s var(--ease-standard), background .18s ease, color .18s ease;
}

.vibe-chip.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #0a0b0e;
  box-shadow: 0 6px 18px rgba(0,0,0,.2);
}

.vibe-stats-panel {
  width: calc(100% - 36px);
  margin: 2px 18px 14px;
  padding: 4px;
  gap: 2px;
  border: 1px solid var(--line-color);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.045);
  box-shadow: var(--shadow-card);
}

.vibe-stat-card {
  min-width: 0;
  padding: 13px 9px;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
}

.vibe-stat-card + .vibe-stat-card {
  border-left: 1px solid var(--line-soft);
}

.stat-icon-wrap {
  width: 30px;
  height: 30px;
  margin-bottom: 7px;
  border-radius: 9px;
  background: rgba(255,255,255,.08);
  color: var(--accent-color);
}

.stat-value {
  max-width: 100%;
  font-size: clamp(15px, 4.2vw, 20px);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.035em;
}

.stat-label {
  color: var(--text-tertiary);
  font-size: 10px;
}

.vibe-total-stats-row {
  width: calc(100% - 36px);
  margin: 0 18px 22px;
  gap: 8px;
}

.vibe-total-card {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: rgba(255,255,255,.028);
}

/* Shared sections and lists */
.section-title {
  padding: 0 18px;
  margin: 22px 0 10px;
  font-size: 17px;
  letter-spacing: -.025em;
}

.library-content,
.settings-content,
.search-container {
  padding-left: 18px !important;
  padding-right: 18px !important;
}

.playlist-header,
.settings-card,
.settings-section,
.eq-card {
  border: 1px solid var(--line-color);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: var(--shadow-card);
}

.playlist-header {
  margin: 5px 0 14px;
  padding: 14px;
  border-bottom: 1px solid var(--line-color);
}

.playlist-cover {
  width: 56px;
  height: 56px;
  border-radius: 13px;
  margin-right: 12px;
}

.playlist-info h2 {
  font-size: 16px;
  letter-spacing: -.025em;
}

.playlist-info p,
.account-info p {
  color: var(--text-secondary);
}

.track-item {
  min-height: 64px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line-soft);
  transition: background .18s ease, transform .18s var(--ease-standard);
}

.track-item:active {
  transform: scale(.985);
  background: rgba(255,255,255,.045);
}

.track-item img {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  box-shadow: 0 5px 14px rgba(0,0,0,.22);
}

.track-title {
  font-size: 14px;
  font-weight: 650;
}

.track-artist {
  color: var(--text-secondary);
  font-size: 12px;
}

.track-dots {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
}

.release-card {
  border: 1px solid var(--line-color);
  border-radius: 15px;
  background: rgba(255,255,255,.045);
  box-shadow: 0 10px 28px rgba(0,0,0,.16);
}

.release-cover-wrap,
.release-cover-img {
  border-radius: 13px;
}

.release-play-btn {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  border: 1px solid rgba(255,255,255,.3);
  box-shadow: 0 8px 20px rgba(0,0,0,.35);
}

/* Forms and settings */
.settings-content {
  padding-bottom: calc(var(--nav-height) + var(--mini-player-height) + 26px);
}

.settings-card,
.settings-section {
  padding: 16px;
  margin-bottom: 12px;
}

.settings-section {
  padding: 0 15px;
}

.settings-section h3 {
  padding: 17px 0 7px;
  color: var(--text-tertiary);
  font-size: 11px;
  letter-spacing: .1em;
}

.setting-item {
  min-height: 60px;
  padding: 13px 0;
  border-bottom-color: var(--line-soft);
}

.btn-primary,
.btn-secondary,
.play-all-btn {
  min-height: 44px;
  border-radius: 12px;
  transition: transform .18s var(--ease-standard), filter .18s ease, background .18s ease;
}

.btn-primary,
.play-all-btn {
  background: var(--accent-color);
  color: #0a0b0e;
}

.btn-primary:active,
.btn-secondary:active,
.play-all-btn:active {
  transform: scale(.96);
}

.btn-secondary {
  background: var(--surface-strong);
  border: 1px solid var(--line-color);
  color: var(--text-primary);
}

.form-input,
.search-input,
#library-search-input {
  min-height: 46px;
  border: 1px solid var(--line-color) !important;
  border-radius: 13px !important;
  background: rgba(255,255,255,.055) !important;
  color: var(--text-primary) !important;
}

.form-input:focus,
.search-input:focus,
#library-search-input:focus {
  border-color: rgba(255,255,255,.34) !important;
  background: rgba(255,255,255,.075) !important;
}

.switch {
  width: 48px;
  height: 28px;
}

.slider {
  background: rgba(255,255,255,.14);
}

.color-btn {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
}

/* Navigation and player chrome */
.bottom-nav {
  height: var(--nav-height);
  padding: 5px 8px var(--safe-bottom);
  background: rgba(12, 14, 18, .88);
  border-top: 1px solid var(--line-color);
  box-shadow: 0 -10px 30px rgba(0,0,0,.18);
}

.nav-btn {
  height: calc(var(--nav-base-height) - 5px);
  min-height: 44px;
  border-radius: 13px;
  color: var(--text-tertiary);
}

.nav-btn i {
  font-size: 19px;
}

.nav-btn span {
  font-size: 10px;
}

.nav-btn.active {
  color: var(--accent-color);
  background: rgba(255,255,255,.06);
}

.mini-player {
  left: 12px;
  right: 12px;
  bottom: calc(var(--nav-height) + 4px);
  height: var(--mini-player-height);
  border: 1px solid var(--line-color);
  border-radius: 15px;
  background: rgba(24, 27, 34, .93);
  box-shadow: var(--shadow-float);
}

.mini-controls {
  gap: 8px;
}

.mini-cover {
  width: 44px;
  height: 44px;
  border-radius: 9px;
}

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

.full-player {
  padding: calc(var(--safe-top) + 12px) 20px calc(var(--safe-bottom) + 18px);
  background: #090a0e;
}

.full-player-bg {
  opacity: .62;
  filter: blur(58px) saturate(1.35) brightness(.62);
}

.full-player-gradient {
  background: linear-gradient(180deg, rgba(9,10,14,.78) 0%, rgba(9,10,14,.18) 38%, rgba(9,10,14,.44) 68%, rgba(9,10,14,.98) 100%);
}

.full-cover-container {
  padding: 14px 0 22px;
}

.full-cover {
  width: min(82vw, 360px);
  max-width: 360px;
  border-radius: 20px;
  box-shadow: 0 22px 55px rgba(0,0,0,.5);
}

.full-info {
  padding: 0 2px;
}

.full-title {
  letter-spacing: -.035em;
}

.full-controls {
  margin-bottom: 14px;
}

/* Overlays: the markup retains inline styles for JS, but appearance is
   centralized here so action sheets, chooser, toast and auth modal match. */
.modal-overlay {
  background: rgba(3,4,6,.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.modal-content,
#action-sheet-content,
#playlist-chooser-content {
  border: 1px solid var(--line-color);
  background: rgba(20,23,29,.96) !important;
  box-shadow: var(--shadow-float);
}

#action-sheet-content,
#playlist-chooser-content {
  padding: 18px !important;
  border-radius: 22px 22px 0 0 !important;
  padding-bottom: calc(18px + var(--safe-bottom)) !important;
}

#action-sheet-bg,
#playlist-chooser-bg {
  background: rgba(3,4,6,.68) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.as-btn {
  min-height: 48px;
  border: 1px solid transparent !important;
  border-radius: 12px !important;
  transition: background .18s ease, transform .18s var(--ease-standard);
}

.as-btn:active {
  background: rgba(255,255,255,.09) !important;
  transform: scale(.985);
}

#as-btn-cancel,
#playlist-chooser-cancel {
  min-height: 48px;
  background: rgba(255,255,255,.08) !important;
  border: 1px solid var(--line-color) !important;
}

.global-toast {
  left: 50%;
  right: auto;
  bottom: calc(var(--nav-height) + var(--mini-player-height) + 20px);
  width: max-content;
  max-width: calc(100vw - 36px);
  justify-content: center;
  min-height: 46px;
  padding: 10px 15px;
  border: 1px solid var(--line-color);
  border-radius: 14px;
  background: rgba(28,31,38,.94);
  box-shadow: var(--shadow-float);
  transform: translateX(-50%);
}

.global-toast span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.global-toast.hidden {
  transform: translateX(-50%) translateY(15px);
}

@media (max-width: 380px) {
  .vibe-stat-card {
    padding-left: 5px;
    padding-right: 5px;
  }
  .stat-label {
    font-size: 9px;
  }
  .full-player {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (min-width: 431px) {
  #app-container,
  .full-player {
    max-width: none;
    margin: 0 auto;
  }

  .vibe-container {
    max-width: 920px;
    margin: 0 auto;
    padding-top: 92px;
  }

  .vibe-animation {
    width: 184px;
    height: 184px;
    margin-bottom: 18px;
  }

  .vibe-title {
    font-size: clamp(34px, 4vw, 48px);
  }

  .vibe-mood-chips,
  .vibe-stats-panel,
  .vibe-total-stats-row,
  .vibe-new-releases,
  .vibe-sync-warning {
    max-width: 860px;
  }

  .vibe-mood-chips {
    justify-content: center;
  }

  .vibe-stats-panel {
    margin-left: auto;
    margin-right: auto;
  }

  .vibe-total-stats-row {
    margin-left: auto;
    margin-right: auto;
  }

  .bottom-nav {
    padding-left: max(18px, calc((100vw - 900px) / 2));
    padding-right: max(18px, calc((100vw - 900px) / 2));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}

/* Repair the actual hero node created by app.js. The play control, title and
   subtitle are children of .vibe-hero (not direct children of .vibe-container). */
.vibe-hero {
  min-height: clamp(340px, 52vh, 480px);
  padding: 26px 18px 20px;
  flex-direction: row;
  flex-wrap: wrap;
  align-content: center;
  align-items: center;
  justify-content: center;
  column-gap: 8px;
  row-gap: 0;
}

.vibe-hero .vibe-animation {
  width: 38px !important;
  height: 48px !important;
  flex: 0 0 auto;
  margin: 0;
}

.vibe-hero .vibe-play-btn {
  width: 38px !important;
  height: 44px !important;
  min-width: 38px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0 !important;
  background: transparent;
  color: var(--text-primary);
  box-shadow: none;
  font-size: 38px;
}

.vibe-hero .vibe-title {
  max-width: 100%;
  margin: 0;
  text-align: left;
  line-height: 1.08;
}

.vibe-hero .vibe-subtitle {
  flex: 0 0 auto;
  width: 100%;
  margin: 8px 0 0;
  text-align: center;
}

.vibe-hero::before {
  width: min(100vw, 560px);
  height: min(62vh, 500px);
  background: radial-gradient(ellipse, rgba(111, 137, 216, .34), rgba(107, 83, 174, .12) 42%, transparent 74%);
  filter: blur(48px);
  opacity: .72;
}

.vibe-ambient-canvas {
  opacity: 1;
}

.vibe-mood-chips {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start !important;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 18px 16px;
  gap: 8px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.vibe-mood-chips::-webkit-scrollbar {
  display: none;
}

.vibe-chip {
  display: inline-flex;
  flex: 0 0 auto;
  width: auto;
  min-width: max-content;
  min-height: 44px;
  white-space: nowrap;
  padding: 0 14px;
  line-height: 1;
  border-radius: 999px;
}

.collection-tag-filters {
  width: calc(100% + 36px);
  margin-left: -18px;
  margin-right: -18px;
  padding: 8px 18px 12px;
  overflow: hidden;
}

.collection-tag-row {
  width: 100%;
  min-width: 0;
  flex-wrap: nowrap;
  overscroll-behavior-x: contain;
  scroll-padding-inline: 18px;
}

.collection-tag-chip {
  flex: 0 0 auto;
  min-height: 44px;
  white-space: nowrap;
}

@media (min-width: 431px) {
  .vibe-hero {
    min-height: clamp(420px, 55vh, 540px);
  }

  .vibe-mood-chips {
    justify-content: center !important;
  }
}

@media (max-height: 700px) {
  .vibe-hero {
    min-height: 330px;
    padding-top: 18px;
  }
}

/* Crossfade has its own explicit track: the generic range rule is optimized
   for playback progress and browser defaults can otherwise hide this rail. */
.crossfade-slider-input {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 100%;
  height: 24px !important;
  margin: 0 !important;
  padding: 0;
  background: transparent !important;
  cursor: pointer;
  touch-action: pan-y;
}

.crossfade-slider-input::-webkit-slider-runnable-track {
  height: 4px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,.78), rgba(255,255,255,.24));
}

.crossfade-slider-input::-moz-range-track {
  height: 4px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,.78), rgba(255,255,255,.24));
}

.crossfade-slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -7px;
  border: 3px solid #111318;
  border-radius: 50%;
  background: var(--accent-color);
  box-shadow: 0 0 0 1px rgba(255,255,255,.55), 0 3px 10px rgba(0,0,0,.35);
}

.crossfade-slider-input::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 3px solid #111318;
  border-radius: 50%;
  background: var(--accent-color);
  box-shadow: 0 0 0 1px rgba(255,255,255,.55), 0 3px 10px rgba(0,0,0,.35);
}

/* Keep the WebView viewport fixed while each view owns its vertical scroll.
   Width-based sizing avoids the extra horizontal pixel some WebViews add for
   100vw when a scrollbar or system inset is present. */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

html {
  scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}

#app-container {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.view {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: none;
}

.view,
.tracks-list,
.ym-select-menu,
.releases-carousel,
.vibe-mood-chips,
.collection-tag-row,
#artist-albums-list {
  scrollbar-width: none;
}

.view::-webkit-scrollbar,
.tracks-list::-webkit-scrollbar,
.ym-select-menu::-webkit-scrollbar,
.releases-carousel::-webkit-scrollbar,
.vibe-mood-chips::-webkit-scrollbar,
.collection-tag-row::-webkit-scrollbar,
#artist-albums-list::-webkit-scrollbar {
  display: none;
}

/* The Wave hero replaces the normal page header, so give it the same top
   safe-area clearance. Other tab headers already include this inset. */
#view-vibe .vibe-container {
  padding-top: calc(var(--safe-top) + 78px);
}

@media (min-width: 431px) {
  #view-vibe .vibe-container {
    padding-top: calc(var(--safe-top) + 92px);
  }
}
