/* 1) Отладка — вырубить жёстко, чтобы не «возрождалась» ниже по каскаду */
.slide .debug-midline,
.slide .debug-pivot-dot { display:none !important; visibility:hidden !important; height:0 !important; border:0 !important; }
.slide::before,
.slide::after { content:none !important; display:none !important; }

/* 2) Класс на один кадр: все переходы выключены (для финальной перекладки) */
.slide.freeze { transition:none !important; }

/* 3) Страховка композитинга */
.slide { will-change:transform,opacity; backface-visibility:hidden; transform-style:preserve-3d; }
.slide .debug-midline,
.slide .debug-pivot-dot { display: none !important; visibility: hidden !important; }
.slide .debug-midline,
.slide .debug-pivot-dot { display: none !important; }
/* === Единый блок .carousel-wrapper === */
/* 2️⃣ Уточнить .carousel-wrapper - расширяем область видимости */
.carousel-wrapper {
  position: absolute;
  top: 50%; 
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70vw;
  height: 65vh;         /* компактнее сцена */
  perspective: 1000px;
  transform-style: preserve-3d;
  overflow: visible;    /* не обрезать 3D-слайды */
  touch-action: none;
  pointer-events: auto;
}

/* Удалены конфликтующие блоки .slide */

/* === Pointer Events Hierarchy === */
.carousel-wrapper { pointer-events: auto; touch-action: none; }
.omnibar, .artist-card { pointer-events: none; }
.omnibar button, .omnibar a, .artist-card button { pointer-events: auto; }
.edge-arrow { pointer-events: auto; }

/* === 2) Верхняя панель — light liquid glass === */
/* (переопределяется блоком ниже, этот блок оставлен для порядка) */

/* === 3) Нижняя «пилюля» — то же стекло с обводкой === */
.artist-card {
  background: rgba(255,255,255,0.05) !important;
  border: 1px solid rgba(255,255,255,0.3) !important;
  backdrop-filter: blur(20px) saturate(120%) !important;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3) !important;
}

/* === 4) Обеспечим, чтобы интерфейс всегда над слайдами === */
.edge-arrow,
.omnibar,
.artist-card {
  position: relative;    /* для z-index */
  z-index: 20 !important; 
}

/* === 5) Центрируем карусель в 70vw, чтобы не залезать за края === */
/* УДАЛЕНО: конфликтующий блок .carousel-wrapper */

/* Reset & body */
* { margin:0; padding:0; box-sizing:border-box; }

/* 1️⃣ Критически важно: снимаем ограничения обрезки на всех родителях */
body, html, main, .page-wrapper {
  overflow: visible !important;       /* снимаем любые ограничения обрезки */
}

body {
  background: #f0ede8;
  min-height:100vh; overflow:visible; font-family:sans-serif;
}

/* === Omnibar — light liquid glass === */
.omnibar {
  position: absolute; top: 20px; left: 50%;
  width: 90vw; max-width: 1200px; height: 56px;
  transform: translateX(-50%);
  border-radius: 28px; padding: 0 24px;
  background: rgba(255,255,255,0.58);
  border: 1px solid rgba(255,255,255,0.78);
  backdrop-filter: blur(28px) saturate(160%);
  box-shadow: 0 2px 20px rgba(0,0,0,0.07), inset 0 1px 0 rgba(255,255,255,0.95);
  display: flex; align-items: center; justify-content: space-between;
  z-index: 20;
}

/* Left nav */
.omnibar-left {
  display: flex; align-items: center; gap: 8px;
  flex: 1;
}
.nav-link {
  color: rgba(20,20,20,0.75);
  text-decoration: none;
  font-size: 14px; font-weight: 500;
  padding: 6px 10px;
  border-radius: 10px;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.nav-link:hover {
  background: rgba(0,0,0,0.06);
  color: rgba(20,20,20,1);
}

/* Center logo */
.omnibar-logo {
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  text-decoration: none;
}
.logo-img {
  height: 26px; width: auto;
  display: block;
}

/* Right nav */
.omnibar-right {
  display: flex; align-items: center; gap: 6px;
  flex: 1; justify-content: flex-end;
}
.nav-action {
  display: flex; align-items: center; gap: 6px;
  color: rgba(20,20,20,0.75);
  text-decoration: none;
  font-size: 14px; font-weight: 500;
  padding: 6px 12px;
  border-radius: 10px;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.nav-action:hover {
  background: rgba(0,0,0,0.06);
  color: rgba(20,20,20,1);
}
/* Favourites receive pop */
@keyframes fav-receive {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  70%  { transform: scale(0.92); }
  100% { transform: scale(1); }
}
.nav-fav.fav-receive {
  animation: fav-receive 0.36s cubic-bezier(.4,0,.2,1);
}
/* Cart receive pop */
@keyframes cart-receive {
  0%   { transform: scale(1) rotate(0deg); }
  30%  { transform: scale(1.3) rotate(-8deg); }
  60%  { transform: scale(0.94) rotate(4deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.nav-cart.cart-receive {
  animation: cart-receive 0.38s cubic-bezier(.4,0,.2,1);
}

.nav-login {
  background: rgba(15,15,15,0.85);
  color: rgba(255,255,255,0.92);
  border-radius: 20px;
  padding: 6px 16px;
}
.nav-login:hover {
  background: rgba(15,15,15,1);
  color: #fff;
}

/* Удалён конфликтующий блок .carousel-wrapper */

/* === Единый блок .slide === */
/* 3️⃣ Убедиться в правильной точке вращения и origin */
.slide {
  --card-size: 48vh; /* компактнее карта, без глобального scale */
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--card-size);
  height: var(--card-size);
  border-radius: 24px;
  transform-origin: var(--origin, center center); /* управление осью через переменную */
  /* opacity чуть опережает движение для маскировки пересечений */
  transition: transform var(--t-move, 500ms) var(--ease-move, cubic-bezier(.22,.7,.2,1)),
              opacity   var(--t-fade, 420ms) var(--ease-fade, cubic-bezier(.4,0,.2,1));
  will-change: transform, opacity;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  backdrop-filter: blur(30px) saturate(130%);
  /* Критически важные стили для 3D-эффектов */
  transform-style: preserve-3d;
  backface-visibility: hidden;
}
.slide img {
  width:100%; height:100%; object-fit:cover;
  display:block; pointer-events:none; -webkit-user-drag:none;
}

/* Debug overlays for Stage 0 (can be removed later) */
.slide .debug-midline {
  position:absolute; left:0; right:0; top:50%; height:0;
  border-top: 2px dashed rgba(255,255,255,0.5);
  pointer-events:none; z-index:5;
}
.slide .debug-pivot-dot {
  position:absolute; top:50%; transform:translateY(-50%);
  width:10px; height:10px; border-radius:50%;
  background:#ff4d4f; opacity:0.9;
  pointer-events:none; z-index:6;
}

/* Book-mode axis: классы управляют осью вращения у боковых */
.slide.left  { --origin: right center; }
.slide.right { --origin: left center; }
.slide.center{ --origin: center center; }

/* Разные тайминги для входа/выхода — окно прозрачности легче синхронизировать */
.slide.incoming {
  --t-move: 500ms; --t-fade: 480ms;
  --ease-move: cubic-bezier(.22,.7,.2,1);
  --ease-fade: cubic-bezier(.4,0,.2,1);
}
.slide.outgoing {
  --t-move: 500ms; --t-fade: 360ms; /* уходящая гаснет раньше */
  --ease-move: cubic-bezier(.22,.7,.2,1);
  --ease-fade: cubic-bezier(.4,0,.2,1);
}

/* Удаляем возможные отладочные оверлеи/псевдо-элементы */
.slide::before,
.slide::after,
.debug-line,
.debug-dot { content: none !important; display: none !important; }

/* Режим без анимации на один кадр (для стейджинга) */
.slide.noanim { --dur: 0ms !important; --odur: 0ms !important; transition: none !important; }

/* Гарантия GPU-композитинга */
.slide { will-change: transform, opacity; backface-visibility: hidden; transform-style: preserve-3d; }

/* Edge Arrows */
.edge-arrow {
  position:absolute; top:50%; transform:translateY(-50%);
  width:64px; height:64px; border-radius:50%;
  background: rgba(255,255,255,0.65);
  border: 1px solid rgba(0,0,0,0.09);
  backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  cursor:pointer; z-index: 200 !important;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.edge-arrow:hover {
  background: rgba(255,255,255,0.88);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}
.edge-arrow.prev { left:32px; }
.edge-arrow.next { right:32px;}
.edge-arrow::before {
  content:''; position:absolute; top:50%; left:50%;
  width:11px; height:11px;
  border-top: 2.5px solid rgba(20,20,20,0.7);
  border-right: 2.5px solid rgba(20,20,20,0.7);
  transform:translate(-50%,-50%);
}
.edge-arrow.prev::before { transform:translate(-35%,-50%) rotate(225deg); }
.edge-arrow.next::before { transform:translate(-65%,-50%) rotate(45deg); }

/* === 3) Glass Artist-Card === */
.artist-card {
  position:absolute; bottom:20px; left:50%;
  transform:translateX(-50%);
  width:40vw; max-width:600px; height:80px;
  border-radius:40px; display:flex; align-items:center;
  padding:0 20px;
  background: rgba(255,255,255,0.05) !important;
  border: 1px solid rgba(255,255,255,0.3) !important;
  backdrop-filter: blur(20px) saturate(120%);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  z-index:10;
}
.artist-card button { border:none; background:none; width:40px; height:40px; border-radius: 50%; }
.artist-card .avatar {
  width:56px; height:56px; border-radius:50%; margin:0 16px;
}
.artist-card .meta h3 { color:#fff; font-size:18px; }
.artist-card .meta p  { color:#ddd; font-size:14px; margin-top:4px; }

/* Accessibility */
@media (prefers-reduced-motion) {
  * { transition:none !important; animation:none !important; }
}

/* 7️⃣ Финальный ручной тест без анимаций - временно раскомментировать для отладки */
/* 4️⃣ ВРЕМЕННО ОТКЛЮЧАЕМ АНИМАЦИИ ДЛЯ ТЕСТИРОВАНИЯ */
/* * { transition: none !important; } */


/* ===== YM-STYLE PLAYER ===== */

/* Register color vars so CSS transitions work on them */
@property --player-accent-1 { syntax: '<color>'; inherits: true; initial-value: #e55020; }
@property --player-accent-2 { syntax: '<color>'; inherits: true; initial-value: #f07040; }
@property --player-accent-3 { syntax: '<color>'; inherits: true; initial-value: #ffd54a; }
@property --progress-color  { syntax: '<color>'; inherits: true; initial-value: #e55020; }
@property --player-bg       { syntax: '<color>'; inherits: true; initial-value: #0e0e16; }

:root {
  --player-accent-1: #e55020;
  --player-accent-2: #f07040;
  --player-accent-3: #ffd54a;
  --progress-color:  #e55020;
  --seek-pct: 0%;
  --vol: 1;
  --player-bg: #0e0e16;
}

/* Smooth color transitions when switching tracks */
#player {
  transition:
    --player-accent-1 0.7s ease,
    --player-accent-2 0.7s ease,
    --player-accent-3 0.7s ease,
    --progress-color  0.7s ease,
    --player-bg       0.7s ease;
}

/* Outer shell — overflow:hidden clips the seek fill at rounded corners */
.ym-player {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(92vw, 960px);
  z-index: 400;
  pointer-events: auto;
  isolation: isolate;

  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: visible; /* thumb + tooltip can float above player; fill clipped inside .player-bg */
}

/* Glass background — lives here so it gets rounded + blurred cleanly */
.player-bg {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden; /* clips backdrop-filter blur to rounded corners */
  pointer-events: none;
  z-index: 0;

  /* YM fill: played part slightly lighter */
  background:
    linear-gradient(90deg,
      rgba(255,255,255,.07) 0 var(--seek-pct),
      rgba(0,0,0,0)         var(--seek-pct)),
    var(--player-bg);
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  border: 1px solid rgba(255,255,255,.13);
  box-shadow: 0 14px 44px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.06);
}

/* ── SEEK AREA ─────────────────────────────────── */
/* Absolutely positioned at top of player; expands on hover (grows upward) */
.seek-area {
  position: absolute;
  bottom: calc(100% - 3px);
  left: 0; right: 0;
  height: 9px;
  z-index: 10;
  cursor: pointer;
  transition: height .18s ease;
}

@media (pointer: fine) {
  .seek-area:hover { height: 28px; }
}

@media (pointer: coarse) {
  .seek-area { height: 20px; }
}

/* .seek-track — lives inside .player-bg (overflow:hidden clips it to player's rounded corners) */
.seek-track {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(255,255,255,.14);
  overflow: hidden;
}

/* .seek-fill — the colored progress fill */
.seek-fill {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: var(--seek-pct, 0%);
  background: var(--progress-color, #ffd54a);
}

/* .seek-thumb — dot that floats above player on hover */
.seek-thumb {
  position: absolute;
  bottom: 0;
  left: var(--seek-pct, 0%);
  transform: translateX(-50%) translateY(50%);
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--progress-color, #ffd54a);
  border: 2px solid rgba(255,255,255,.65);
  box-shadow: 0 2px 10px rgba(0,0,0,.55);
  opacity: 0;
  transition: opacity .12s ease;
  z-index: 12;
  pointer-events: none;
}

@media (pointer: fine) {
  .seek-area:hover .seek-thumb { opacity: 1; }
}

/* Time labels — float above the player on hover */
.seek-cur, .seek-end {
  position: absolute;
  bottom: calc(100% + 4px);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  padding: 3px 7px;
  border-radius: 5px;
  background: rgba(0,0,0,.65);
  color: #fff;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s ease;
  z-index: 16;
}

.seek-cur {
  left: var(--seek-pct, 0%);
  transform: translateX(-50%);
}

.seek-end {
  right: 8px;
}

@media (pointer: fine) {
  .seek-area:hover .seek-cur,
  .seek-area:hover .seek-end { opacity: 1; }
}

/* #seek — transparent overlay, interaction only */
#seek {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 15;
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

/* ── PLAYER ROW — 3-column grid: [left | center | right] ── */
.player-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 13px 20px 11px;
  position: relative;
  z-index: 1;
}

.row-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.row-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: relative;
}

/* ── FX BUTTON ──────────────────────────────── */
.ym-player .fx-btn {
  color: rgba(255,255,255,.55);
  margin-left: 4px;
}
.ym-player .fx-btn svg {
  width: 16px; height: 16px;
}
.ym-player .fx-btn:hover {
  color: rgba(255,255,255,.9);
}
.ym-player .fx-btn[aria-expanded="true"] {
  color: var(--progress-color, #e55020);
}

/* ── FX PANEL ───────────────────────────────── */
.fx-panel {
  position: absolute;
  bottom: calc(100% + 14px);
  right: 0;
  width: 280px;
  background: rgba(252, 250, 248, 0.88);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.82);
  border-radius: 18px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.16), inset 0 1px 0 rgba(255,255,255,0.95);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 200;

  opacity: 0;
  transform: translateY(10px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(.25,.8,.25,1);
  transform-origin: bottom right;
}
.fx-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.fx-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 8px;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}
.fx-title {
  font-size: 11px;
  font-weight: 700;
  color: rgba(20,20,20,0.5);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.fx-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: rgba(20,20,20,0.4);
  padding: 0 2px;
  transition: color 0.15s;
}
.fx-close:hover { color: rgba(20,20,20,0.8); }

.fx-row {
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fx-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.fx-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(20,20,20,0.45);
  text-transform: uppercase;
}
.fx-value {
  font-size: 13px;
  font-weight: 600;
  color: rgba(20,20,20,0.75);
  font-variant-numeric: tabular-nums;
  min-width: 70px;
  text-align: right;
}

/* FX sliders */
.fx-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(0,0,0,0.1);
  outline: none;
  cursor: pointer;
  /* accent fill via gradient updated by JS */
  background: linear-gradient(
    to right,
    var(--progress-color, #e55020) 0%,
    var(--progress-color, #e55020) var(--fx-pct, 50%),
    rgba(0,0,0,0.1) var(--fx-pct, 50%),
    rgba(0,0,0,0.1) 100%
  );
}
.fx-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0,0,0,0.22), 0 0 0 2px var(--progress-color, #e55020);
  cursor: grab;
  transition: box-shadow 0.15s;
}
.fx-slider::-webkit-slider-thumb:active { cursor: grabbing; }
.fx-slider::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid var(--progress-color, #e55020);
  background: #fff;
  box-shadow: 0 1px 6px rgba(0,0,0,0.2);
  cursor: grab;
}

.fx-divider {
  height: 1px;
  background: rgba(0,0,0,0.07);
  margin: 0 16px;
}

.fx-footer {
  padding: 10px 16px 14px;
  display: flex;
  justify-content: flex-end;
}
.fx-reset {
  background: rgba(15,15,15,0.08);
  color: rgba(20,20,20,0.6);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.fx-reset:hover {
  background: rgba(15,15,15,0.15);
  color: rgba(20,20,20,0.85);
}
.fx-reset:active { transform: scale(0.96); }

/* ── NOTES BUTTON ───────────────────────────── */
.ym-player .notes-btn {
  color: rgba(255,255,255,.55);
  margin-left: 4px;
}
.ym-player .notes-btn svg {
  width: 16px; height: 16px;
}
.ym-player .notes-btn:hover {
  color: rgba(255,255,255,.9);
}
.ym-player .notes-btn[aria-expanded="true"] {
  color: var(--progress-color, #e55020);
}

/* ── NOTES PANEL ────────────────────────────── */
.notes-panel {
  position: absolute;
  bottom: calc(100% + 14px);
  right: 0;
  width: 300px;
  background: rgba(252, 250, 248, 0.88);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.82);
  border-radius: 18px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.16), inset 0 1px 0 rgba(255,255,255,0.95);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 200;

  opacity: 0;
  transform: translateY(10px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(.25,.8,.25,1);
  transform-origin: bottom right;
}
.notes-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 8px;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}
.notes-title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(20,20,20,0.75);
  letter-spacing: 0.02em;
}
.notes-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: rgba(20,20,20,0.4);
  padding: 0 2px;
  transition: color 0.15s;
}
.notes-close:hover {
  color: rgba(20,20,20,0.8);
}

.notes-area {
  flex: 1;
  min-height: 180px;
  resize: none;
  border: none;
  background: transparent;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(20,20,20,0.85);
  font-family: inherit;
  outline: none;
}
.notes-area::placeholder {
  color: rgba(20,20,20,0.3);
}

.notes-footer {
  padding: 10px 16px 14px;
  border-top: 1px solid rgba(0,0,0,0.07);
  display: flex;
  justify-content: flex-end;
}
.notes-save {
  background: rgba(15,15,15,0.82);
  color: rgba(255,255,255,0.92);
  border: none;
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.15s, transform 0.1s;
}
.notes-save:hover {
  background: rgba(15,15,15,1);
}
.notes-save:active {
  transform: scale(0.96);
}

.ym-player .cover {
  width: 48px; height: 48px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.13);
  box-shadow: 0 4px 18px rgba(0,0,0,.45);
}

.ym-player .meta {
  min-width: 0;
}

.ym-player #track-title {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── CONTROLS ───────────────────────────────────── */
.player-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ym-player .icon-btn {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: none;
  border: none;
  cursor: pointer;
  transition: transform .15s, opacity .15s;
  opacity: .7;
}

.ym-player .icon-btn:hover {
  transform: translateY(-1px);
  opacity: 1;
}

.ym-player .icon-btn svg {
  width: 20px; height: 20px;
  fill: rgba(255,255,255,.9);
  display: block;
}

.ym-player .play-pause {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px; height: 54px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.22);
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.1);
  transition: transform .15s, box-shadow .15s;
}

.ym-player .play-pause:hover {
  transform: scale(1.06);
  box-shadow: 0 10px 28px rgba(0,0,0,.55);
}

.ym-player .play-pause .ring {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  /* Colors split into many small alternating sections + heavy blur = aurora effect.
     c1 dominates (~70%), c2 appears twice (~20% total), c3 appears twice (~10% total). */
  background: conic-gradient(
    var(--player-accent-1)  0%,
    var(--player-accent-2) 12%,
    var(--player-accent-1) 25%,
    var(--player-accent-3) 35%,
    var(--player-accent-1) 48%,
    var(--player-accent-2) 60%,
    var(--player-accent-1) 72%,
    var(--player-accent-3) 82%,
    var(--player-accent-1) 100%
  );
  filter: blur(10px) saturate(1.6);
  -webkit-mask: radial-gradient(farthest-side, #0000 74%, #000 76%);
          mask: radial-gradient(farthest-side, #0000 74%, #000 76%);
  animation: spin 4.5s linear infinite;
  opacity: .9;
}

#player.is-playing .play-pause .ring {
  animation-duration: 1.8s;
  opacity: .92;
}

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

.ym-player .play-pause .icon-play,
.ym-player .play-pause .icon-pause {
  width: 24px; height: 24px;
  fill: #fff;
}

#player.is-playing  .play-pause .icon-play  { display: none; }
#player:not(.is-playing) .play-pause .icon-pause { display: none; }

/* ── VOLUME ─────────────────────────────────────── */
.ym-player .volume {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: 4px;
}

/* Volume button */
/* ── SHUFFLE BUTTON ─────────────────────────── */
.ym-player .shuffle-btn {
  color: rgba(255,255,255,.45);
}
.ym-player .shuffle-btn svg {
  width: 16px; height: 16px;
}
.ym-player .shuffle-btn[aria-pressed="true"] {
  color: var(--progress-color, #e55020);
  background: rgba(255,255,255,.07);
}
.ym-player .shuffle-btn.roulette-active {
  color: var(--progress-color, #e55020);
  animation: roulette-pulse 0.4s ease-in-out infinite alternate;
}
@keyframes roulette-pulse {
  from { opacity: 0.5; transform: scale(0.9); }
  to   { opacity: 1;   transform: scale(1.1); }
}

/* ── REPEAT BUTTON ──────────────────────────── */
.ym-player .repeat-btn {
  color: rgba(255,255,255,.45);
}
.ym-player .repeat-btn[aria-pressed="true"] {
  color: var(--progress-color, #e55020);
  background: rgba(255,255,255,.07);
}
.ym-player .repeat-btn svg {
  width: 16px; height: 16px;
}

/* ── CART BUTTON (player) ────────────────────── */
.ym-player .cart-btn {
  color: rgba(255,255,255,.65);
  transition: color .15s;
}
.ym-player .cart-btn:hover {
  color: rgba(255,255,255,.95);
}
.ym-player .cart-btn svg {
  width: 18px; height: 18px;
  transition: fill .15s;
}
.ym-player .cart-btn[aria-pressed="true"] {
  color: #4fd18a;
  opacity: 1;
}
.ym-player .cart-btn[aria-pressed="true"] svg {
  fill: #4fd18a;
}

/* ── FAV BUTTON (player) ─────────────────────── */
.ym-player .fav-btn {
  color: rgba(255,255,255,.65);
}
.ym-player .fav-btn:hover {
  color: rgba(255,255,255,.9);
}
.ym-player .fav-btn[aria-pressed="true"] {
  color: #ff4d6a;
  opacity: 1;
}
.ym-player .fav-btn[aria-pressed="true"] .fav-ico {
  fill: #ff4d6a;
  stroke: #ff4d6a;
}
.fav-ico {
  width: 18px; height: 18px;
  display: block;
  pointer-events: none;
  transition: fill .15s, stroke .15s;
}

.ym-player .vol {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: none;
  border: none;
  cursor: pointer;
  transition: opacity .15s;
  flex-shrink: 0;
  opacity: .7;
}
.ym-player .vol:hover {
  opacity: 1;
}
.ym-player .vol-ico {
  width: 20px; height: 20px;
  fill: rgba(255,255,255,.9);
  display: block;
  pointer-events: none;
}

/* Popup — appears above the button */
.vol-popup {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) scaleY(0);
  transform-origin: bottom center;
  width: 40px;
  padding: 14px 0;
  background: rgba(18, 18, 28, 0.94);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: transform .22s cubic-bezier(.34,1.4,.64,1), opacity .15s ease;
  z-index: 500;
}
.volume.open .vol-popup {
  transform: translateX(-50%) scaleY(1);
  opacity: 1;
  pointer-events: auto;
}

/* Vertical range slider inside popup */
.vol-popup #volume {
  -webkit-appearance: none;
  appearance: none;
  writing-mode: vertical-lr;
  direction: rtl;
  width: 4px;
  height: 96px;
  cursor: pointer;
  border: none;
  outline: none;
  border-radius: 999px;
  background: linear-gradient(to bottom,
    rgba(255,255,255,.15) calc((1 - var(--vol)) * 100%),
    var(--progress-color, #e55020) 0);
}
.vol-popup #volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--progress-color, #e55020);
  border: none;
  box-shadow: 0 1px 6px rgba(0,0,0,.4);
  cursor: grab;
}
.vol-popup #volume::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--progress-color, #e55020);
  border: none;
}

/* ── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 700px) {
  .ym-player {
    width: calc(100vw - 24px);
    bottom: max(12px, env(safe-area-inset-bottom));
    border-radius: 12px;
  }
  .player-row {
    padding: 8px 12px 10px;
    gap: 8px;
  }
  .ym-player .cover { width: 40px; height: 40px; }
  .ym-player .play-pause { width: 46px; height: 46px; }
  .ym-player #volume { width: 70px; }
}

/* ── CAROUSEL STABILITY ─────────────────────────── */
.carousel-wrapper.is-shifting .slide:hover .slide-info { transform: translateY(100%) !important; }
.slide.just-spawned { animation: none !important; }
.slide.freeze       { transition: none !important; }

/* ── HIDDEN UTIL ─────────────────────────────────── */
[hidden] { display: none !important; }

/* ── BROWSE VIEW ─────────────────────────────────── */
#browse-view {
  position: fixed;
  top: 90px;
  left: 0; right: 0; bottom: 0;
  overflow-y: auto;
  padding: 32px 5% 120px;
  z-index: 10;
}

.browse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.beat-tile {
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  background: rgba(0,0,0,.04);
  transition: transform .18s, box-shadow .18s;
}
.beat-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,.14);
}

.tile-img-wrap {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
}
.tile-cover {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .22s;
}
.beat-tile:hover .tile-cover {
  transform: scale(1.04);
}

.tile-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .18s;
}
.beat-tile:hover .tile-overlay,
.beat-tile.is-active .tile-overlay {
  background: rgba(0,0,0,.38);
}

.tile-play-btn {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: scale(.75);
  transition: opacity .18s, transform .18s;
  pointer-events: none;
}
.beat-tile:hover .tile-play-btn,
.beat-tile.is-active .tile-play-btn {
  opacity: 1;
  transform: scale(1);
}
.tile-play-btn svg {
  width: 22px; height: 22px;
  fill: #111;
  margin-left: 3px;
}

.tile-info {
  padding: 10px 12px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
}
.tile-title {
  font-size: 13px;
  font-weight: 600;
  color: #111;
}
.tile-bpm {
  font-size: 11px;
  font-weight: 500;
  color: rgba(0,0,0,.45);
}

.beat-tile.is-active .tile-info {
  background: var(--progress-color, #e55020);
}
.beat-tile.is-active .tile-title,
.beat-tile.is-active .tile-bpm {
  color: #fff;
}

.nav-link--active {
  background: rgba(0,0,0,.08) !important;
  color: rgba(20,20,20,1) !important;
}

/* Info button on tile */
.tile-info-btn {
  position: absolute;
  top: 8px; right: 8px;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .18s, background .15s;
  z-index: 2;
  line-height: 1;
}
.beat-tile:hover .tile-info-btn,
.beat-tile.is-active .tile-info-btn {
  opacity: 1;
}
.tile-info-btn:hover {
  background: rgba(0,0,0,.75);
}

/* ── BEAT PAGE ───────────────────────────────────── */
#beat-view {
  position: fixed;
  top: 90px; left: 0; right: 0; bottom: 0;
  overflow-y: auto;
  padding: 28px 5% 120px;
  z-index: 10;
}

.beat-page {
  max-width: 860px;
  margin: 0 auto;
}

.beat-page-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: rgba(0,0,0,.55);
  padding: 6px 0;
  margin-bottom: 28px;
  transition: color .15s;
}
.beat-page-back:hover { color: rgba(0,0,0,.9); }
.beat-page-back svg {
  width: 18px; height: 18px;
  stroke: currentColor;
}

.beat-page-body {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.beat-page-cover-wrap {
  position: relative;
  flex-shrink: 0;
  width: 280px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,.18);
}
.beat-page-cover {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
.beat-page-play {
  position: absolute;
  bottom: 12px; right: 12px;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.22);
  transition: transform .15s, background .15s;
}
.beat-page-play:hover { transform: scale(1.08); background: #fff; }
.beat-page-play svg {
  width: 22px; height: 22px;
  fill: #111;
  margin-left: 3px;
}

.beat-page-info {
  flex: 1;
  min-width: 0;
  padding-top: 4px;
}

.beat-page-title {
  font-size: 32px;
  font-weight: 700;
  color: #111;
  letter-spacing: -.5px;
  margin-bottom: 20px;
}

.beat-page-meta {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}
.beat-meta-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: rgba(0,0,0,.05);
  border-radius: 10px;
  padding: 10px 18px;
  min-width: 80px;
}
.beat-meta-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  color: rgba(0,0,0,.4);
  text-transform: uppercase;
}
.beat-meta-value {
  font-size: 18px;
  font-weight: 700;
  color: #111;
}

.beat-page-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 20px;
}
.beat-tag {
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(0,0,0,.07);
  color: rgba(0,0,0,.65);
}

.beat-page-desc {
  font-size: 15px;
  line-height: 1.65;
  color: rgba(0,0,0,.65);
  margin-bottom: 28px;
}

.beat-page-actions {
  display: flex;
  gap: 12px;
}

.beat-page-cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 12px;
  border: none;
  background: #111;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .12s;
}
.beat-page-cart-btn:hover {
  background: #222;
  transform: translateY(-1px);
}
.beat-page-cart-btn.in-cart {
  background: #16a34a;
  pointer-events: none;
}

@media (max-width: 640px) {
  .beat-page-body { flex-direction: column; }
  .beat-page-cover-wrap { width: 100%; }
  .beat-page-title { font-size: 24px; }
}

@media (max-width: 600px) {
  .browse-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }
  #browse-view { padding: 20px 4% 110px; }
}

/* ── Auth Modal ─────────────────────────────────────────── */
.auth-modal { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; }
.auth-modal[hidden] { display: none; }

.auth-modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
}

.auth-modal__box {
  position: relative; z-index: 1;
  background: var(--bg, #fff);
  border-radius: 16px;
  padding: 36px 32px 32px;
  width: 100%; max-width: 380px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.25);
}

.auth-modal__close {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none; font-size: 22px;
  cursor: pointer; color: inherit; opacity: 0.5;
  line-height: 1; padding: 4px;
}
.auth-modal__close:hover { opacity: 1; }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 24px; }

.auth-tab {
  flex: 1; padding: 8px;
  border: none; border-radius: 8px;
  background: transparent;
  font-size: 15px; font-weight: 500;
  cursor: pointer; opacity: 0.45;
  transition: opacity .15s, background .15s;
}
.auth-tab.active { opacity: 1; background: rgba(0,0,0,0.07); }

.auth-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.auth-field label { font-size: 13px; opacity: 0.6; }
.auth-field input {
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 8px;
  font-size: 15px;
  background: transparent;
  outline: none;
  transition: border-color .15s;
}
.auth-field input:focus { border-color: rgba(0,0,0,0.4); }

.auth-error {
  color: #e03;
  font-size: 13px;
  margin-bottom: 10px;
}
.auth-error[hidden] { display: none; }

.auth-submit {
  width: 100%; padding: 12px;
  border: none; border-radius: 10px;
  background: #111; color: #fff;
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
  margin-top: 4px;
}
.auth-submit:hover { opacity: 0.85; }
.auth-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.nav-login[data-logged-in="true"] { font-weight: 600; }

.nav-profile-wrap { position: relative; }

.nav-profile-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--bg, #fff);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  padding: 6px;
  min-width: 120px;
  z-index: 8000;
}
.nav-profile-menu[hidden] { display: none; }

.nav-profile-menu button {
  width: 100%; padding: 9px 12px;
  border: none; background: none;
  text-align: left; font-size: 14px;
  cursor: pointer; border-radius: 7px;
}
.nav-profile-menu button:hover { background: rgba(0,0,0,0.06); }
}

/* ── Profile menu extras ────────────────────────────────── */
.profile-menu-divider {
  height: 1px;
  background: rgba(0,0,0,0.08);
  margin: 4px 0;
}
.profile-menu-logout { color: #c00; }
.profile-menu-logout:hover { background: rgba(200,0,0,0.06) !important; }

/* ── Settings / Purchases Modal ─────────────────────────── */
.settings-modal { position: fixed; inset: 0; z-index: 9100; display: flex; align-items: center; justify-content: center; }
.settings-modal[hidden] { display: none; }

.settings-modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
}

.settings-modal__box {
  position: relative; z-index: 1;
  background: var(--bg, #fff);
  border-radius: 16px;
  padding: 36px 32px 32px;
  width: 100%; max-width: 360px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.25);
}

.settings-modal__close {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none; font-size: 22px;
  cursor: pointer; color: inherit; opacity: 0.5;
  line-height: 1; padding: 4px;
}
.settings-modal__close:hover { opacity: 1; }

.settings-title {
  font-size: 18px; font-weight: 700;
  margin-bottom: 24px;
}

.settings-section { margin-bottom: 20px; }

.settings-label {
  display: block;
  font-size: 13px; opacity: 0.55;
  margin-bottom: 8px;
}

.settings-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 8px;
  font-size: 15px;
  background: transparent;
  outline: none;
  transition: border-color .15s;
}
.settings-input:focus { border-color: rgba(0,0,0,0.4); }

.settings-hint {
  display: block;
  font-size: 12px;
  opacity: 0.4;
  margin-top: 5px;
}

.currency-toggle {
  display: flex;
  gap: 8px;
}
.cur-opt {
  flex: 1;
  padding: 9px;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 8px;
  background: transparent;
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  opacity: 0.5;
  transition: all .15s;
}
.cur-opt.active {
  opacity: 1;
  background: rgba(0,0,0,0.07);
  border-color: rgba(0,0,0,0.3);
}
.cur-opt:hover { opacity: 0.8; }

.settings-save {
  width: 100%; padding: 12px;
  border: none; border-radius: 10px;
  background: #111; color: #fff;
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
  margin-top: 4px;
}
.settings-save:hover { opacity: 0.85; }
.settings-save:disabled { opacity: 0.5; cursor: not-allowed; }

.settings-msg {
  text-align: center;
  font-size: 13px;
  margin-top: 10px;
  color: #080;
}
.settings-msg[hidden] { display: none; }

.purchases-list { padding-top: 8px; }
.purchases-empty { font-size: 14px; opacity: 0.45; text-align: center; padding: 20px 0; }
