/* Базовые стили и сброс */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

body {
  background: #f0eee9;
}

a {
  color: #2b2a27;
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: #1f1e1c;
}

*:focus-visible {
  outline: 1px solid #57544e;
  outline-offset: 4px;
}

::selection {
  background: rgba(43, 42, 39, 0.14);
}

@keyframes sr-fade {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.sr-scroll {
  scrollbar-width: none;
}

.sr-scroll::-webkit-scrollbar {
  width: 3px;
}

.sr-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.sr-scroll::-webkit-scrollbar-button {
  display: none;
  height: 0;
  width: 0;
}

.sr-scroll::-webkit-scrollbar-thumb {
  background: rgba(43, 42, 39, 0.13);
  border-radius: 3px;
}

.sr-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(43, 42, 39, 0.22);
}

/* Страница */
.sr-page {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  background: linear-gradient(
    180deg,
    #f0eee9 0%,
    #eae7e1 38%,
    #d9d7d2 72%,
    #c9c7c2 100%
  );
  font-family: 'EB Garamond', Georgia, serif;
  color: #2b2a27;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(12px, 2.5vh, 40px) 24px clamp(12px, 2.5vh, 48px);
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

.sr-top {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 720px;
  min-height: 0;
  margin-bottom: clamp(20px, 6vh, 64px);
}

.sr-header {
  display: flex;
  justify-content: center;
  align-self: stretch;
  width: 100%;
}

.sr-title {
  display: block;
  width: 100%;
  margin: 0;
  padding-right: 0.12em;
  box-sizing: border-box;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
  font-size: clamp(32px, 8.6vw, 56px);
  line-height: 1.143;
  letter-spacing: 0.12em;
  font-variant: all-small-caps;
  text-align: center;
  color: rgba(0, 0, 0, 0.4);
}

.sr-main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 3vh, 24px);
  padding-bottom: clamp(20px, 6vh, 64px);
}

/* Круглый плеер */
.sr-player-wrap {
  position: relative;
  flex: none;
  width: 246px;
  height: 246px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sr-player-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid #cdccc5;
  pointer-events: none;
}

.sr-player-btn {
  position: relative;
  flex: none;
  width: 230px;
  height: 230px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #dedbd5;
  cursor: pointer;
  overflow: hidden;
  box-shadow: inset 0 0 0 2px #cdccc5;
}

.sr-player-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.6;
  transition: opacity 240ms ease;
}

.sr-player-btn.is-playing img {
  opacity: 1;
}

.sr-player-btn img.is-hidden {
  display: none;
}

/* Заглушка вместо фото артиста */
.sr-avatar-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #e8e5df 0%, #dedbd5 55%, #d4d1cb 100%);
  color: #a9a6a0;
}

.sr-player-btn .sr-avatar-placeholder {
  opacity: 0.6;
  transition: opacity 240ms ease;
}

.sr-player-btn.is-playing .sr-avatar-placeholder {
  opacity: 1;
}

.sr-avatar-placeholder svg {
  width: 42%;
  height: 42%;
}

.sr-avatar-placeholder.is-hidden {
  display: none;
}

.sr-list-avatar .sr-avatar-placeholder {
  position: static;
  width: 100%;
  height: 100%;
}

.sr-list-avatar .sr-avatar-placeholder svg {
  width: 62%;
  height: 62%;
}

.sr-player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(141, 139, 139, 0.6);
  transition: background 240ms ease;
  pointer-events: none;
}

.sr-player-btn.is-playing .sr-player-overlay {
  background: rgba(240, 238, 233, 0);
}

.sr-player-btn.is-playing.is-hover .sr-player-overlay {
  background: rgba(240, 238, 233, 0.34);
}

.sr-icon-play,
.sr-icon-pause {
  transition: opacity 200ms ease;
}

.sr-icon-play {
  width: 48px;
  height: 48px;
  opacity: 1;
}

.sr-icon-play path,
.sr-icon-pause path {
  fill: #e6e6e6;
  stroke: #a9a6a0;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
}

.sr-icon-pause {
  position: absolute;
  width: 48px;
  height: 48px;
  opacity: 0;
}

.sr-player-btn.is-playing .sr-icon-play {
  opacity: 0;
}

.sr-player-btn.is-playing.is-hover .sr-icon-pause {
  opacity: 1;
}

/* Now playing текст */
.sr-now-playing {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 1vh, 8px);
  flex: none;
  min-height: 0;
}

.sr-artist {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 700;
  font-size: clamp(28px, 7.4vw, 48px);
  line-height: 1.167;
  color: rgba(0, 0, 0, 0.8);
}

.sr-track {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 700;
  font-size: clamp(22px, 4.9vw, 32px);
  font-style: italic;
  line-height: 1.25;
  color: rgba(0, 0, 0, 0.6);
}

.sr-status {
  margin-top: clamp(8px, 2vh, 16px);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #6b6862;
}

.sr-status.is-live {
  color: #3a3833;
}

/* Навигация */
.sr-nav {
  flex: none;
  display: flex;
  gap: clamp(18px, 6vw, 34px);
  align-items: center;
}

.sr-nav-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1px solid #a9a6a0;
  background: rgba(240, 238, 233, 0.35);
  color: #3a3833;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background 180ms ease,
    border-color 180ms ease;
}

.sr-nav-btn:hover {
  background: rgba(240, 238, 233, 0.85);
  border-color: #57544e;
}

.sr-nav-btn svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Модальное окно */
.sr-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  background: rgba(43, 42, 39, 0.18);
  animation: sr-fade 220ms ease both;
}

.sr-modal-backdrop[hidden] {
  display: none;
}

.sr-modal {
  position: relative;
  width: 100%;
  max-width: 500px;
  max-height: 78vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flow-root;
  box-sizing: border-box;
  background:
    linear-gradient(rgba(240, 238, 233, 1) 40%, rgba(240, 238, 233, 0)) top /
      100% 26px local no-repeat,
    linear-gradient(rgba(240, 238, 233, 0), rgba(43, 42, 39, 0.09)) bottom /
      100% 26px scroll no-repeat,
    rgba(240, 238, 233, 0.96);
  backdrop-filter: blur(14px) saturate(115%);
  -webkit-backdrop-filter: blur(14px) saturate(115%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  padding: 26px 26px 24px;
  animation: sr-fade 260ms ease both;
}

.sr-modal-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(43, 42, 39, 0.16);
}

.sr-modal-title {
  margin: 0;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
  font-size: 22px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #1f1e1c;
}

.sr-modal-close {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  border: 1px solid rgba(43, 42, 39, 0.25);
  background: transparent;
  color: #3a3833;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sr-modal-close:hover {
  background: rgba(255, 255, 255, 0.5);
}

.sr-modal-close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
}

/* Список треков в модалке */
.sr-list {
  display: flex;
  flex-direction: column;
}

.sr-list-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid rgba(43, 42, 39, 0.12);
}

.sr-list-avatar {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  background: #dedbd5;
  box-shadow: 0 0 0 1px rgba(43, 42, 39, 0.08) inset;
}

.sr-list-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sr-list-avatar img.is-hidden {
  display: none;
}

.sr-list-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sr-list-artist {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 700;
  font-size: 20px;
  color: #1f1e1c;
  line-height: 1.2;
}

.sr-list-track {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 700;
  font-size: 15px;
  font-style: italic;
  color: #4a4742;
}

.sr-list-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 2px;
}

.sr-list-year,
.sr-list-time {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: #57544e;
  line-height: 1.2;
}

.sr-list-time {
  font-style: normal;
}

/* About */
.sr-about {
  padding-top: 18px;
  padding-bottom: 2px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 17px;
  line-height: 1.6;
  color: #2b2a27;
  max-width: 44ch;
}

.sr-about p {
  margin: 0;
}

.sr-about-tag {
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #57544e;
}

.sr-list-loading,
.sr-list-empty {
  padding: 24px 0;
  text-align: center;
  font-size: 15px;
  color: #57544e;
  font-style: italic;
}

.sr-list-panel[hidden],
.sr-about-panel[hidden] {
  display: none;
}

@media (max-height: 640px) {
  .sr-title {
    font-size: clamp(24px, 7vw, 48px);
  }

  .sr-artist {
    font-size: clamp(22px, 6vw, 40px);
  }

  .sr-track {
    font-size: clamp(18px, 4.5vw, 28px);
  }

  .sr-nav-btn {
    width: 52px;
    height: 52px;
  }
}
