:root {
  --primary: #6c63ff;
  --secondary: #4cc9f0;
  --accent: #7209b7;
  --dark: #0f0c29;
  --darker: #0a071a;
  --light: #f8f9fa;
  --gray: #adb5bd;
  --success: #4ade80;
  --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --radius: 20px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--darker);
  color: var(--light);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
}

/* Фон с анимацией частиц */
.background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}

.particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(108, 99, 255, 0.1) 0%, transparent 20%),
    radial-gradient(circle at 90% 80%, rgba(76, 201, 240, 0.15) 0%, transparent 25%),
    radial-gradient(circle at 50% 50%, rgba(114, 9, 183, 0.08) 0%, transparent 35%);
  animation: pulse 15s infinite alternate;
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

.gradient-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--darker) 0%, var(--dark) 100%);
  z-index: -1;
}

/* Контейнер плеера */
.player-container {
  width: 100%;
  max-width: 480px;
  padding: 20px;
  z-index: 10;
}

.player-card {
  background: rgba(25, 20, 45, 0.85);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(108, 99, 255, 0.2);
}

/* Шапка */
.header {
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo i {
  font-size: 1.8rem;
}

.mood-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(114, 9, 183, 0.2);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.85rem;
}

.mood-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.9); }
}

/* Обложка трека */
.cover-art {
  position: relative;
  height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  text-align: center;
  padding: 30px;
  overflow: hidden;
  background: linear-gradient(120deg, #1a162d 0%, #2a2444 100%);
}

.cover-gradient {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(108, 99, 255, 0.15) 0%, transparent 70%);
  animation: rotate 25s linear infinite;
}

.cover-wave {
  position: absolute;
  bottom: -60px;
  width: 300%;
  height: 120px;
  background: 
    radial-gradient(circle at 20% 50%, rgba(76, 201, 240, 0.2) 0%, transparent 60%),
    radial-gradient(circle at 80% 50%, rgba(114, 9, 183, 0.25) 0%, transparent 60%);
  border-radius: 50%;
  animation: wave 18s linear infinite;
}

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

@keyframes wave {
  0% { transform: translateX(0) translateY(0); }
  50% { transform: translateX(-25%) translateY(10px); }
  100% { transform: translateX(-50%) translateY(0); }
}

.cover-title {
  font-size: 1.1rem;
  opacity: 0.8;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.cover-artist {
  font-size: 1.8rem;
  font-weight: 700;
  margin-top: 8px;
  background: linear-gradient(45deg, var(--light), var(--gray));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: var(--transition);
}

/* Прогресс-бар */
.progress-section {
  padding: 20px 24px 15px;
}

.time-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  opacity: 0.85;
  margin-bottom: 8px;
  font-family: monospace;
}

.progress-container {
  position: relative;
  height: 6px;
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  cursor: pointer;
  overflow: hidden;
}

.progress-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  opacity: 0.3;
  border-radius: 3px;
}

.progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 3px;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px rgba(108, 99, 255, 0.5);
}

/* Управление */
.controls {
  display: flex;
  justify-content: center;
  gap: 25px;
  padding: 25px 0 20px;
}

.btn-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--light);
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(5px);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

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

.btn-play {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none;
  color: white;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 5px 25px rgba(108, 99, 255, 0.4);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-play::after {
  content: '';
  position: absolute;
  width: 120%;
  height: 120%;
  background: linear-gradient(45deg, var(--accent), var(--secondary));
  border-radius: 50%;
  animation: rotate 4s linear infinite;
  opacity: 0.2;
}

.btn-play:hover {
  transform: scale(1.08);
  box-shadow: 0 5px 30px rgba(108, 99, 255, 0.6);
}

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

.play-icon, .pause-icon {
  position: absolute;
  opacity: 1;
  transition: opacity 0.3s;
}

.pause-icon {
  opacity: 0;
}

.playing .play-icon { opacity: 0; }
.playing .pause-icon { opacity: 1; }

/* Громкость */
.volume-section {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0 24px 20px;
}

.volume-btn {
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
}

.volume-container {
  flex: 1;
  height: 4px;
  position: relative;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  cursor: pointer;
  overflow: hidden;
}

.volume-bar-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  opacity: 0.2;
}

#volume-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

#volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--secondary);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(76, 201, 240, 0.7);
}

.volume-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 85%;
  background: var(--secondary);
  border-radius: 2px;
  transition: width 0.2s ease;
}

/* Плейлист */
.playlist {
  padding: 20px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  max-height: 300px;
  overflow-y: auto;
}

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

.playlist-header h3 {
  font-size: 1.2rem;
  font-weight: 600;
}

.playlist-count {
  background: rgba(108, 99, 255, 0.15);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
}

.playlist-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.track-item {
  padding: 12px 15px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.track-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(5px);
}

.track-item.active {
  background: rgba(108, 99, 255, 0.25);
  border-left: 3px solid var(--primary);
}

.track-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: -1;
}

.track-item.active::before {
  opacity: 0.15;
}

.track-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.track-info {
  flex: 1;
}

.track-title {
  font-weight: 500;
  margin-bottom: 2px;
  display: block;
}

.track-artist {
  font-size: 0.75rem;
  opacity: 0.7;
  display: block;
}

/* Футер */
.footer {
  padding: 20px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.info {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.8;
}

.links a {
  color: var(--gray);
  font-size: 1.4rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.links a:hover {
  color: var(--secondary);
  background: rgba(76, 201, 240, 0.15);
  transform: translateY(-2px);
}

/* Всплывающее сообщение */
.floating-message {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30, 25, 50, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(108, 99, 255, 0.3);
  color: var(--light);
  padding: 10px 22px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  opacity: 0.95;
  animation: float-up 8s ease-in-out infinite;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
  z-index: 100;
}

@keyframes float-up {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-8px); }
}

.floating-message kbd {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

/* Адаптивность */
@media (max-width: 480px) {
  .player-card {
    margin: 10px;
    border-radius: 18px;
  }
  
  .cover-art {
    height: 240px;
  }
  
  .controls {
    gap: 15px;
  }
  
  .btn-play {
    width: 60px;
    height: 60px;
    font-size: 1.6rem;
  }
  
  .btn-icon {
    width: 42px;
    height: 42px;
    font-size: 1.2rem;
  }
  
  .volume-section {
    padding: 0 20px 20px;
  }
  
  .floating-message {
    bottom: 15px;
    padding: 8px 18px;
    font-size: 0.85rem;
  }
}

/* Скроллбар */
.playlist-items::-webkit-scrollbar {
  width: 6px;
}

.playlist-items::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.playlist-items::-webkit-scrollbar-thumb {
  background: rgba(108, 99, 255, 0.5);
  border-radius: 10px;
}

.playlist-items::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Анимации для интерфейса */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.player-card {
  animation: fadeIn 0.6s ease-out forwards;
}

.cover-artist, .progress-container, .controls {
  animation: fadeIn 0.6s ease-out 0.2s forwards;
  animation-fill-mode: forwards;
}

.playlist {
  animation: fadeIn 0.6s ease-out 0.4s forwards;
  animation-fill-mode: forwards;
}

/* Состояние при наведении на трек */
.track-item:hover .track-title {
  color: var(--secondary);
}

/* Анимация для активного трека */
@keyframes glow {
  0%, 100% { box-shadow: 0 0 15px rgba(108, 99, 255, 0.6); }
  50% { box-shadow: 0 0 25px rgba(76, 201, 240, 0.8); }
}

.btn-play.playing {
  animation: glow 2s infinite;
}