/* --- Вертикальный плеер для millionskazok.ru --- */
.ms-audio-player {
  --ms-white: #ffffff;
  --ms-purple: #480477;
  --ms-purple-light: #e8d9f5;
  --ms-gray: #f4f4f4;
  --ms-orange: #ff7a00;
  --ms-orange-hover: #e66e00;

  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  background: var(--ms-white);
  border: 1px solid var(--ms-purple-light);
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(72, 4, 119, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  max-width: 560px; /* Идеально для узких колонок */
  width: 100%;
  margin: 0 auto 20px;
  box-sizing: border-box;
}

/* Защита иконок Font Awesome */
.ms-audio-player .fa {
  display: inline-block !important;
  font-size: 16px !important;
  line-height: 1 !important;
  color: inherit !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* 1. Заголовок */
.ms-header { text-align: center; }
.ms-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ms-purple);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ms-artist {
  font-size: 13px;
  color: #888888;
  margin-top: 4px;
}

/* 2. Центральные кнопки */
.ms-center-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.ms-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.ms-btn:active { transform: scale(0.92); }
.ms-btn:focus-visible { outline: 2px solid var(--ms-orange); outline-offset: 2px; }

/* Главная кнопка Play (Оранжевая, крупная) */
.ms-btn-play {
  width: 56px;
  height: 56px;
  background: var(--ms-orange) !important;
  color: var(--ms-white) !important;
  box-shadow: 0 4px 10px rgba(255, 122, 0, 0.3);
}
.ms-btn-play:hover { background: var(--ms-orange-hover) !important; }
.ms-btn-play .fa { font-size: 24px !important; margin-left: 3px; }
.ms-audio-player.is-playing .ms-btn-play .fa { margin-left: 0; }

/* Кнопки перемотки (Фиолетовые) */
.ms-btn-nav {
  width: 40px;
  height: 40px;
  background: var(--ms-purple-light) !important;
  color: var(--ms-purple) !important;
}
.ms-btn-nav:hover { background: #d4c0ea !important; }
.ms-btn-nav .fa { font-size: 18px !important; }

/* 3. Прогресс-секция */
.ms-progress-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 4px;
}

.ms-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--ms-gray);
  border-radius: 3px;
  position: relative;
  cursor: pointer;
}

.ms-progress-filled {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 0%;
  background: var(--ms-orange);
  border-radius: 3px;
  pointer-events: none;
}

.ms-progress-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 14px;
  height: 14px;
  background: var(--ms-white);
  border: 2px solid var(--ms-purple);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.2s ease;
  pointer-events: none;
  z-index: 2;
}
.ms-progress-bar:hover .ms-progress-thumb,
.ms-audio-player.is-dragging .ms-progress-thumb {
  transform: translate(-50%, -50%) scale(1);
}

.ms-time-display {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--ms-purple);
  font-variant-numeric: tabular-nums;
}

/* 4. Нижняя панель */
.ms-bottom-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--ms-gray);
}

.ms-volume-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ms-btn-icon {
  width: 32px;
  height: 32px;
  background: transparent !important;
  color: var(--ms-purple) !important;
  border-radius: 50%;
}
.ms-btn-icon:hover { background: var(--ms-purple-light) !important; }
.ms-btn-icon .fa { font-size: 16px !important; }

.ms-volume-slider {
  width: 50px; /* Короткий ползунок для узкого дизайна */
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--ms-gray);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.ms-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: var(--ms-purple);
  border-radius: 50%;
  cursor: pointer;
}
.ms-volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: var(--ms-purple);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.ms-features-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Кнопки-таблетки (Светло-фиолетовые) */
.ms-btn-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  height: 32px;
  background: var(--ms-purple-light) !important;
  color: var(--ms-purple) !important;
  border: 1px solid transparent !important;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.ms-btn-pill:hover { background: #d4c0ea !important; }
.ms-btn-pill .fa { font-size: 13px !important; }

/* Активное состояние таблеток (Тёмно-фиолетовые) */
.ms-btn-pill.is-active {
  background: var(--ms-purple) !important;
  color: var(--ms-white) !important;
}

/* Логика иконок */
.ms-btn-play .fa-pause { display: none !important; }
.ms-audio-player.is-playing .ms-btn-play .fa-play { display: none !important; }
.ms-audio-player.is-playing .ms-btn-play .fa-pause { display: inline-block !important; }

.ms-btn-icon .fa-volume-off { display: none !important; }
.ms-audio-player.is-muted .ms-btn-icon .fa-volume-up { display: none !important; }
.ms-audio-player.is-muted .ms-btn-icon .fa-volume-off { display: inline-block !important; }