/* Контейнер: две отдельные части */
.ap {
  display: flex;
  gap: 16px;
  box-sizing: border-box;
  width: min(100%, 1100px);
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  color: #ffffff;
  font-family: Calibri, Carlito, "Segoe UI", Arial, sans-serif;
  font-size: 18px;
}

/* Левая часть: плейлист */
.ap__list {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  border-radius: 10px;
  background: rgba(25, 45, 53, 0.5);
  scrollbar-width: thin;
  scrollbar-color: #ffffff transparent;
}
.ap__list::-webkit-scrollbar { width: 10px; }
.ap__list::-webkit-scrollbar-track { background: transparent; }
.ap__list::-webkit-scrollbar-thumb { background: #ffffff; border-radius: 5px; }

.ap__row {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  height: 50px;
  padding: 0 14px 0 12px;
  border-bottom: 1px solid rgba(160, 160, 160, 0.2);
  cursor: pointer;
  transition: background 0.15s;
}
.ap__row:hover { background: rgba(255, 255, 255, 0.08); }
.ap__row.is-active { background: rgba(255, 255, 255, 0.05); }

.ap__rowbtn {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  margin-right: 12px;
  border: 0;
  background: none;
  cursor: pointer;
}
.ap__rowbtn svg { display: block; width: 100%; height: 100%; }

.ap__info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  text-align: left;
}
.ap__info b,
.ap__info span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ap__info b { font-weight: 700; }
.ap__info span { font-weight: 400; }

.ap__dur {
  flex: 0 0 auto;
  margin-left: 10px;
  font-variant-numeric: tabular-nums;
}

/* Иконки пауза / воспроизведение */
.i-pause { display: none; }
.is-playing .i-play { display: none; }
.is-playing .i-pause { display: block; }

/* Правая часть: обложка и управление */
.ap__side {
  flex: 1 1 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 16px 20px 14px;
  border-radius: 10px;
  background: rgba(25, 45, 53, 0.5);
}

.ap__cover {
  flex: 1 1 auto;
  min-height: 0;
}
.ap__cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
}

.ap__time {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.ap__seek {
  --p: 0%;
  flex: 1 1 auto;
  min-width: 0;
  height: 18px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.ap__seek::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, #ffffff var(--p), #b8b8b8 var(--p));
}
.ap__seek::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, #ffffff var(--p), #b8b8b8 var(--p));
}
.ap__seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4px;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
}
.ap__seek::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
}

.ap__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-top: 8px;
}

.ap__btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: none;
  color: #ffffff;
  cursor: pointer;
}
.ap__btn svg { display: block; width: 100%; height: 100%; }
.ap__main { width: 48px; height: 48px; }

.ap__shuffle,
.ap__repeat { opacity: 0.45; transition: opacity 0.15s; }
.ap__shuffle.is-on,
.ap__repeat.is-on { opacity: 1; }

.ap__btn:focus-visible,
.ap__rowbtn:focus-visible,
.ap__seek:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* Вертикальный экран: части друг под другом */
@media (orientation: portrait), (max-width: 700px) {
  .ap {
    flex-direction: column;
    aspect-ratio: auto;
  }
  .ap__list {
    flex: 0 0 auto;
    max-height: 330px; /* ~6,5 строк, дальше прокрутка */
  }
  .ap__side {
    flex: 0 0 auto;
  }
  .ap__cover {
    flex: 0 0 auto;
    aspect-ratio: 1 / 1;
  }
}
