.noselect {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: #181818;
  overflow: hidden;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  transition: background-color 0.5s ease;
}

.background-image {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  filter: blur(50px);
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: -1;
}

.carousel-container {
  position: relative;
  width: 600px;
  height: 400px;
  cursor: grab;
  top: 50%;
  perspective: 1000px;
  touch-action: none;
}

.carousel-container:active,
.carousel-container.dragging {
  cursor: grabbing;
}

.drag-area {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 250px;
  cursor: grab;
  z-index: 100;
}

.drag-area:active {
  cursor: grabbing;
}

.card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 250px;
  height: 250px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  box-shadow: 0 0px 10px rgba(0, 0, 0, 0.15);
  transform-origin: center;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              box-shadow 0.3s ease,
              opacity 0.5s ease,
              filter 0.5s ease;
  opacity: 0.7;
  pointer-events: none;
  z-index: 1;
  backdrop-filter: blur(0px);
  background-size: cover;
  background-position: center;
}

.card.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.3) !important;
  z-index: 10;
  pointer-events: auto;
  filter: blur(0px) !important;
}

.card:not(.active) {
  filter: blur(4px);
}

.card-img {
  width: calc(100% - 10px);
  height: 60%;
  object-fit: cover;
  border-radius: 12px;
  margin: 45px 5px 0 5px;
  transition: transform 0.3s ease;
}

/* === БАРЫ === */

.top-bar, .bottom-bar {
  filter: saturate(1.3);
  position: fixed;
  left: 0;
  width: 100%;
  height: 130px;
  display: flex;
  align-items: center;
  padding: 0 30px;
  box-sizing: border-box;
  backdrop-filter: blur(100px);
  z-index: 100;
}

.top-bar {
  top: 0px;
  justify-content: flex-end;
  padding-top: 20px;
}

.bottom-bar {
  bottom: 0px;
  justify-content: space-between;
  gap: 15px;
  padding-bottom: 30px;
}

/* === TOGGLE SWITCH === */
.toggle-switch {
  position: relative;
  width: 100px;
  height: 50px;
  --light: #d8dbe0;
  --dark: #28292c;
  --link: rgb(27, 129, 112);
  --link-hover: rgb(24, 94, 82);
}

.switch-label {
  position: absolute;
  width: 100%;
  height: 50px;
  background-color: #28292c7a;
  border-radius: 25px;
  cursor: pointer;
}

.checkbox {
  position: absolute;
  display: none;
}

.slider {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 25px;
  -webkit-transition: 0.3s;
  transition: 0.3s;
}

.checkbox:checked ~ .slider {
  background-color: var(--light);
}

.slider::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 10px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  -webkit-box-shadow: inset 12px -4px 0px 0px var(--light);
  box-shadow: inset 12px -4px 0px 0px var(--light);
  background-color: var(--dark);
  -webkit-transition: 0.3s;
  transition: 0.3s;
}

.checkbox:checked ~ .slider::before {
  -webkit-transform: translateX(50px);
  -ms-transform: translateX(50px);
  transform: translateX(50px);
  background-color: var(--dark);
  -webkit-box-shadow: none;
  box-shadow: none;
}

.album-container {
  position: relative;
  width: fit-content;
  height: fit-content;
}

.album-cover {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.album-cover img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.track-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: white;
  min-width: 0;
  max-width: calc(100% - 140px);
}

.track-title {
  font-weight: 600;
  font-size: 16px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-artist {
  font-size: 14px;
  opacity: 0.8;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* === PLAY/PAUSE BUTTON === */
.play-pause-btn {
  width: 50px;
  height: 50px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.play-pause-btn img {
  width: 85%;
  height: 100%;
  object-fit: contain;
}

.play-pause-btn:hover {
  transform: scale(1.1);
}

/* === NAVIGATION ARROWS === */
.nav-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 60px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 200;
  opacity: 0.4;
  transition: opacity 0.3s ease;
}

.nav-arrow:hover {
  opacity: 0.8;
}

.nav-arrow img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.prev-arrow {
  left: 20px;
}

.next-arrow {
  right: 20px;
}

/* === WAVE ANIMATION === */
.waves {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 50%;
  height: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.3s ease;
  z-index: -1;
}

.wave {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  animation: waveExpand 2s infinite linear;
  opacity: 0;
  transform: translate(-50%, -50%);
}

.wave:nth-child(1) { animation-delay: 0s; }
.wave:nth-child(2) { animation-delay: 0.5s; }
.wave:nth-child(3) { animation-delay: 1s; }

@keyframes waveExpand {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0.8;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.5);
    opacity: 0;
  }
}

.bottom-bar.playing .waves {
  opacity: 1;
}

/* === NIGHT MODE === */
body.night-mode {
  background: #000000;
}

body.night-mode .background-image {
  filter: blur(50px) grayscale(100%);
}

body.night-mode .card {
  filter: grayscale(100%) !important;
}

body.night-mode .card.active {
  filter: grayscale(100%) !important;
}

body.night-mode .card:not(.active) {
  filter: blur(2px) grayscale(100%) !important;
}

body.night-mode .album-cover {
  filter: grayscale(100%);
}

body.night-mode .top-bar,
body.night-mode .bottom-bar {
  background: rgba(0, 0, 0, 0.8);
}

/* === PLAY OVERLAY (центральная иконка при удержании) === */
.play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: 100px;
  height: 100px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.play-overlay.holding {
  opacity: 0.4;
  transform: translate(-50%, -50%) scale(1);
  transition:
    opacity 1s linear,
    transform 1s ease-out;
}

.play-overlay.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.2);
  transition: all 0.2s ease;
}

.toggle-wrapper {
  font-size: 16px;
}

@media (max-width: 650px) {
  .toggle-wrapper {
    font-size: 12px;
  }

  .nav-arrow {
    display: none;
  }

  .play-pause-btn {
    width: 40px;
    height: 40px;
  }
}

@media (max-height: 660px) {
  .carousel-container {
    top: 0px;
  }

  .card {
    width: 200px;
    height: 150px;
  }

  .card-img {
    width: calc(100% - 10px);
    height: 80%;
    margin: 14px 5px 0 5px;
  }
}

@media (max-height: 490px) {
  .carousel-container {
    top: 0px;
  }

  .top-bar, .bottom-bar {
    height: 70px;
  }

  .bottom-bar {
    padding-bottom: 0px;
  }

  .top-bar {
    padding-top: 0px;
  }

  .card {
    width: 200px;
    height: 150px;
  }

  .card-img {
    width: calc(100% - 10px);
    height: 80%;
    margin: 14px 5px 0 5px;
  }
}