:root {
  color-scheme: dark;
  --bg: #160d07;
  --bg-deep: #0b0502;
  --text: #fff2d5;
  --text-strong: #fff8ea;
  --muted: rgba(255, 236, 204, 0.78);
  --muted-soft: rgba(255, 225, 176, 0.62);
  --panel: rgba(55, 28, 11, 0.84);
  --panel-strong: rgba(38, 17, 7, 0.9);
  --wood-line: rgba(255, 216, 157, 0.22);
  --paper: rgba(249, 226, 185, 0.88);
  --paper-soft: rgba(229, 186, 112, 0.3);
  --cover-url: url("assets/cover.svg");
  --accent: rgb(232 171 76);
  --accent-soft: rgba(232, 171, 76, 0.36);
  --accent2: rgb(255 220 149);
  --accent2-soft: rgba(255, 220, 149, 0.28);
  --accent-r: 232;
  --accent-g: 171;
  --accent-b: 76;
  --accent2-r: 255;
  --accent2-g: 220;
  --accent2-b: 149;
  --shadow: rgba(13, 5, 2, 0.56);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  min-height: 100%;
  overscroll-behavior: none;
}

body {
  position: relative;
  margin: 0;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background:
    radial-gradient(circle at top, rgba(196, 122, 54, 0.22), transparent 42%),
    linear-gradient(180deg, #3c2212 0%, #1b0f08 100%);
  color: var(--text);
  font-family: "Alegreya Sans", "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 3, 1, 0.08) 0%, rgba(7, 3, 1, 0.34) 100%),
    url("assets/bg.png") center -28px / cover no-repeat;
  filter: blur(14px) saturate(1.02) brightness(1.06);
  transform: scale(1.06);
  opacity: 0.58;
  pointer-events: none;
}

button,
input,
select,
textarea {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

button:focus {
  outline: none;
}

button:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}

img,
svg {
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

.app {
  position: relative;
  z-index: 1;
  width: min(100vw, 430px);
  height: 100vh;
  min-height: 100%;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(10, 4, 1, 0.02) 0%, rgba(10, 4, 1, 0.1) 54%, rgba(10, 4, 1, 0.2) 100%),
    url("assets/bg.png") center -44px / cover no-repeat;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.42);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

@supports (height: 100dvh) {
  .app {
    height: 100dvh;
    min-height: 100dvh;
  }
}

.app::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 22% at 50% 18%, rgba(255, 235, 193, 0.1) 0%, rgba(255, 235, 193, 0) 100%),
    radial-gradient(80% 34% at 50% 74%, rgba(var(--accent-r), var(--accent-g), var(--accent-b), 0.09) 0%, rgba(var(--accent-r), var(--accent-g), var(--accent-b), 0) 72%),
    linear-gradient(180deg, rgba(18, 7, 2, 0) 0%, rgba(18, 7, 2, 0.08) 52%, rgba(64, 26, 10, 0.12) 82%, rgba(32, 12, 4, 0.18) 100%);
  pointer-events: none;
}

.details,
.art,
.controls {
  position: relative;
  z-index: 2;
}

.details {
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
  padding:
    calc(26px + env(safe-area-inset-top))
    clamp(18px, 5vw, 26px)
    calc(18px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  position: relative;
}

.meta--overlay {
  position: absolute;
  top: clamp(108px, 15.1svh, 144px);
  left: 50%;
  transform: translateX(-50%);
  width: min(82%, 318px);
  min-height: clamp(76px, 10svh, 104px);
  margin: 0;
  padding: 8px 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.42);
  animation: stage-in 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.meta--overlay.meta--with-timer {
  padding-bottom: 28px;
}

.title {
  width: 100%;
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  font-family: "Bree Serif", serif;
  font-size: clamp(24px, 5.9vw, 31px);
  line-height: 1.14;
  padding-bottom: 0.1em;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}

.title__text {
  display: inline-block;
  white-space: nowrap;
  will-change: transform;
}

.title.title--marquee .title__text {
  animation: title-marquee var(--title-marquee-duration, 10s) ease-in-out infinite;
}

.title.title--marquee {
  width: calc(100% - 10px);
  font-size: clamp(22px, 5.4vw, 28px);
}

.title.title--marquee.title--short {
  font-size: clamp(23px, 5.6vw, 29px);
}

.title.title--marquee.title--tiny {
  font-size: clamp(24px, 5.8vw, 30px);
}

.title.title--short {
  font-size: clamp(25px, 6.1vw, 33px);
}

.title.title--tiny {
  font-size: clamp(26px, 6.3vw, 34px);
}

@keyframes title-marquee {
  0%,
  16% {
    transform: translateX(0);
  }

  50%,
  66% {
    transform: translateX(calc(-1 * var(--title-marquee-distance, 0px)));
  }

  100% {
    transform: translateX(0);
  }
}

.artist {
  margin: 5px 0 0;
  font-size: clamp(13px, 3.4vw, 16px);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.artist:empty {
  display: none;
}

.sleep-timer {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 15px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255, 236, 204, 0.96);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.sleep-timer.sleep-timer--active {
  font-size: 17px;
}

.sleep-timer:empty {
  visibility: hidden;
}

.art {
  position: absolute;
  top: clamp(240px, 31.8svh, 346px);
  left: 50%;
  transform: translateX(-50%);
  width: min(62vw, 272px);
  max-width: 248px;
  aspect-ratio: 1 / 1;
  margin: 0;
  padding: 2px;
  border-radius: 6px;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  animation: stage-in 0.68s cubic-bezier(0.22, 1, 0.36, 1);
}

.art::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(246, 226, 189, 0.12) 0%, rgba(168, 113, 58, 0.08) 100%),
    radial-gradient(circle at 18% 16%, rgba(120, 67, 31, 0.12) 0%, rgba(120, 67, 31, 0) 24%),
    radial-gradient(circle at 84% 82%, rgba(120, 67, 31, 0.14) 0%, rgba(120, 67, 31, 0) 28%);
  mix-blend-mode: multiply;
  opacity: 0.42;
  pointer-events: none;
}

.cover {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
  opacity: 0.94;
  filter: sepia(0.18) saturate(0.82) contrast(0.94) brightness(0.98);
  -webkit-mask-image: none;
  mask-image: none;
  transition: filter 0.22s ease, opacity 0.22s ease;
}

.cover.cover--fade-in {
  animation: cover-soft-fade 0.4s ease both;
}

.controls {
  position: absolute;
  left: 50%;
  bottom: calc(82px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(100%, 344px);
  margin-top: 0;
  display: grid;
  justify-items: center;
  gap: 10px;
  animation: stage-in 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.meta-row {
  width: min(100%, 344px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.spectrum {
  width: 100%;
  height: 60px;
  position: relative;
  margin: 0 auto;
  border-radius: 999px;
  border: 1px solid rgba(255, 225, 173, 0.2);
  background:
    linear-gradient(180deg, rgba(70, 35, 14, 0.8), rgba(38, 18, 7, 0.88));
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 213, 0.06),
    0 12px 24px rgba(15, 6, 2, 0.24);
  isolation: isolate;
  overflow: hidden;
}

.spectrum::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(80% 90% at 50% 0%, rgba(var(--accent2-r), var(--accent2-g), var(--accent2-b), 0.14), transparent 72%);
  pointer-events: none;
}

.spectrum::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 10px;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(255, 245, 219, 0) 0%,
    rgba(255, 235, 195, 0.24) 15%,
    rgba(255, 235, 195, 0.54) 50%,
    rgba(255, 235, 195, 0.24) 85%,
    rgba(255, 245, 219, 0) 100%
  );
  opacity: 0.9;
  z-index: 1;
}

.spectrum__bars {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(var(--spectrum-bars, 36), minmax(0, 1fr));
  align-items: end;
  gap: 2px;
  padding: 10px 12px 11px;
  z-index: 2;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 4%, #000 96%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 4%, #000 96%, transparent 100%);
}

.spectrum__bar {
  width: 100%;
  min-height: 5px;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(255, 251, 240, 0.95) 0%,
    rgba(var(--accent2-r), var(--accent2-g), var(--accent2-b), 0.94) 35%,
    rgba(var(--accent-r), var(--accent-g), var(--accent-b), 0.98) 100%
  );
  box-shadow: 0 0 10px rgba(var(--accent-r), var(--accent-g), var(--accent-b), 0.16);
  transform-origin: 50% 100%;
  transform: scaleY(0.06);
  opacity: 0.28;
  transition: transform 0.06s linear, opacity 0.08s linear;
  will-change: transform, opacity;
}

.spectrum.is-fallback .spectrum__bar {
  opacity: 0.18;
}

.player-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 4vw, 22px);
}

.like,
.sleep {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 229, 183, 0.28);
  background:
    linear-gradient(180deg, rgba(101, 56, 25, 0.9), rgba(54, 25, 10, 0.96));
  color: rgba(255, 241, 216, 0.95);
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 213, 0.08),
    0 14px 24px rgba(22, 8, 3, 0.24);
  cursor: pointer;
  pointer-events: auto;
}

.like[aria-pressed="true"] {
  color: rgba(255, 248, 236, 0.98);
}

.like:focus-visible,
.sleep:focus-visible {
  outline: 2px solid rgba(255, 228, 175, 0.4);
  outline-offset: 4px;
}

.like__icon svg,
.sleep__icon svg {
  width: 26px;
  height: 26px;
  display: block;
}

.player {
  position: relative;
  width: 118px;
  height: 118px;
  display: grid;
  place-items: center;
  contain: layout paint;
}

.play {
  position: relative;
  z-index: 1;
  width: 92px;
  height: 92px;
  padding: 0;
  border: 1px solid rgba(255, 238, 206, 0.55);
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #3f1807;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 245, 224, 0.96) 0%, rgba(255, 228, 170, 0.94) 18%, rgba(var(--accent2-r), var(--accent2-g), var(--accent2-b), 0.96) 34%, rgba(var(--accent-r), var(--accent-g), var(--accent-b), 0.98) 64%, rgba(118, 63, 22, 0.98) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 252, 246, 0.34),
    0 16px 30px rgba(23, 8, 2, 0.3);
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.play:focus-visible {
  outline: 2px solid rgba(255, 232, 183, 0.44);
  outline-offset: 6px;
}

.play:active {
  transform: translateY(1px) scale(0.98);
}

.play.is-playing {
  color: #331306;
  filter: saturate(1.04);
}

.play__icon {
  display: grid;
  line-height: 0;
}

.play__icon svg {
  width: 42px;
  height: 42px;
}

.play__icon--pause {
  display: none;
}

.play.is-playing .play__icon--play {
  display: none;
}

.play.is-playing .play__icon--pause {
  display: grid;
}

.ring {
  position: absolute;
  inset: 0;
  display: block;
  transform: translateZ(0) rotate(-90deg);
  transform-origin: 50% 50%;
  pointer-events: none;
  backface-visibility: hidden;
  will-change: transform;
}

.ring__track {
  fill: none;
  stroke: rgba(255, 244, 225, 0.24);
  stroke-width: 4;
}

.ring__snake {
  display: none;
}

.play.is-playing ~ .ring {
  animation: none;
}

.play.is-playing ~ .ring .ring__snake {
  opacity: 0;
}

.status {
  min-height: 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 228, 180, 0.78);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.status:empty {
  visibility: hidden;
}

.ad-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background:
    linear-gradient(180deg, rgba(95, 55, 26, 0.94), rgba(50, 25, 11, 0.98));
  border: 1px solid rgba(255, 219, 152, 0.2);
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255, 243, 217, 0.05),
    0 18px 34px rgba(14, 6, 2, 0.22);
}

.ad-slot.ad-slot--ready .ad-slot__content {
  opacity: 0.02;
}

.ad-slot.ad-slot--native-enabled .ad-slot__label {
  opacity: 0.8;
}

.ad-slot[data-ad-format="native"] {
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
}

.ad-banner {
  position: absolute;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(calc(100% - 36px), 364px);
  min-height: var(--ad-height, 56px);
  margin: 0;
  border-radius: 20px;
  z-index: 2;
  overflow: visible;
}

.ad-banner::before {
  content: "";
  position: absolute;
  inset: -12px -6px -8px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(149, 64, 22, 0.22) 0%, rgba(109, 42, 13, 0.28) 46%, rgba(58, 22, 8, 0.18) 100%);
  filter: blur(18px);
  opacity: 0.88;
  pointer-events: none;
  z-index: -1;
}

.modal-ad {
  width: 100%;
  height: var(--ad-height, 50px);
  margin-top: 14px;
  border-radius: 18px;
}

.modal-ad[data-ad-format="native"] {
  margin-top: 16px;
}

.ad-slot__label {
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 226, 173, 0.2);
  background: rgba(255, 217, 151, 0.12);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 233, 195, 0.92);
}

.ad-slot__content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ad-slot[data-ad-format="native"] .ad-slot__content {
  gap: 4px;
}

.ad-slot__title {
  font-size: 12px;
  font-weight: 800;
}

.ad-slot[data-ad-format="native"] .ad-slot__title {
  font-size: 13px;
}

.ad-slot__meta {
  font-size: 10px;
  color: rgba(255, 229, 184, 0.72);
}

.ad-slot__size {
  display: none;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 225, 176, 0.6);
}

.ad-slot[data-ad-format="native"] .ad-slot__meta,
.ad-slot[data-ad-format="native"] .ad-slot__size {
  font-size: 10px;
}

.library-page {
  --library-page-side-padding: 18px;
  position: fixed;
  inset: 0;
  z-index: 18;
  padding:
    calc(18px + env(safe-area-inset-top))
    18px
    calc(22px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
  background:
    linear-gradient(180deg, rgba(18, 8, 3, 0.92), rgba(9, 4, 1, 0.96)),
    url("assets/bg.png") center / cover no-repeat;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.46);
  transform: translateY(18px) scale(0.986);
  transform-origin: 50% 100%;
  opacity: 0;
  transition:
    transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 0.24s ease;
}

.library-page[hidden] {
  display: none;
}

.library-page.is-open {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.library-page.is-closing {
  pointer-events: none;
  transform: translateY(32px) scale(0.972);
  opacity: 0;
  transition:
    transform 0.32s cubic-bezier(0.4, 0, 1, 1),
    opacity 0.18s ease;
}

.library-page__header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.library-page__back {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: rgba(95, 55, 26, 0.5);
  color: var(--text-strong);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
}

.library-page__back svg {
  width: 28px;
  height: 28px;
  display: block;
}

.library-page__title {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-family: "Bree Serif", serif;
  font-size: 22px;
  color: var(--text-strong);
}

.library-page__likes,
.library-page__share-row {
  width: 100%;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  border-radius: 18px;
  border: 1px solid rgba(255, 223, 165, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 244, 217, 0.12), rgba(145, 91, 40, 0.12)),
    rgba(67, 35, 14, 0.5);
  color: rgba(255, 244, 217, 0.96);
  cursor: pointer;
  text-align: left;
  box-shadow: 0 12px 24px rgba(10, 4, 1, 0.14);
}

.library-page__share-row {
  margin-top: 0;
}

.library-page__likes:focus-visible,
.library-page__share-row:focus-visible {
  outline: 2px solid rgba(255, 224, 166, 0.28);
  outline-offset: 3px;
}

.library-page__likes-icon,
.library-page__share-row-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
}

.library-page__likes-icon svg,
.library-page__share-row-icon svg {
  width: 24px;
  height: 24px;
  display: block;
}

.library-page__likes-label,
.library-page__share-row-label {
  font-size: 15px;
  font-weight: 700;
}

.library-page--likes #libraryLikes,
.library-page--likes #libraryShare {
  display: none;
}

.likes-panel {
  width: 100%;
  margin-top: 4px;
  flex: 1;
  min-height: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.likes-panel--library {
  overflow: hidden;
}

.likes-panel[hidden] {
  display: none;
}

.likes-panel__list {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding-right: 4px;
}

.likes-panel__item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 223, 165, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 247, 231, 0.1), rgba(120, 71, 31, 0.08)),
    rgba(73, 37, 14, 0.48);
}

.likes-panel__cover {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  background: rgba(148, 163, 184, 0.2);
}

.likes-panel__meta {
  min-width: 0;
}

.likes-panel__title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.likes-panel__artist {
  margin: 4px 0 0;
  font-size: 12px;
  color: rgba(255, 228, 180, 0.68);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.likes-panel__empty {
  margin: 4px 2px 0;
  font-size: 13px;
  color: rgba(255, 225, 176, 0.64);
}

.likes-panel__ad {
  margin-top: auto;
}

.likes-panel__actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: end;
}

.likes-panel__action {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 244, 217, 0.95);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
}

.likes-panel__action:focus-visible {
  outline: 2px solid rgba(255, 228, 175, 0.35);
  outline-offset: 2px;
}

.likes-panel__action--share {
  color: rgba(255, 228, 180, 0.76);
}

.likes-panel__action svg {
  width: 22px;
  height: 22px;
  display: block;
}

.likes-panel__action--remove svg {
  width: 24px;
  height: 24px;
}

.library-mini {
  margin-top: auto;
  width: 100%;
  display: grid;
  grid-template-columns: 62px 1fr auto;
  align-items: center;
  gap: 12px;
  position: relative;
  padding: 16px 0 0;
  border: 0;
  background: transparent;
  color: rgba(255, 248, 236, 0.98);
  cursor: pointer;
  text-align: left;
}

.library-mini::before {
  content: "";
  position: absolute;
  top: 0;
  left: calc(-1 * var(--library-page-side-padding));
  width: calc(100% + (var(--library-page-side-padding) * 2));
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(255, 234, 194, 0) 0%,
    rgba(255, 234, 194, 0.2) 20%,
    rgba(255, 234, 194, 0.32) 50%,
    rgba(255, 234, 194, 0.2) 80%,
    rgba(255, 234, 194, 0) 100%
  );
}

.library-mini:focus-visible {
  outline: 2px solid rgba(255, 228, 175, 0.35);
  outline-offset: 4px;
}

.library-mini__cover {
  width: 62px;
  height: 62px;
  border-radius: 14px;
  object-fit: cover;
  background: transparent;
}

.library-mini__meta {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.library-mini__label-row {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.library-mini__label-icon {
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  color: rgba(255, 229, 182, 0.7);
}

.library-mini__label-icon svg {
  width: 17px;
  height: 17px;
}

.library-mini__label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 229, 182, 0.66);
}

.library-mini__title {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.library-mini__artist {
  font-size: 12px;
  color: rgba(255, 228, 180, 0.68);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.library-mini__controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.library-mini__like,
.library-mini__toggle {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.library-mini__like:focus-visible,
.library-mini__toggle:focus-visible {
  outline: 2px solid rgba(255, 228, 175, 0.32);
  outline-offset: 4px;
}

.library-mini__like-icon,
.library-mini__state-icon {
  display: grid;
  line-height: 0;
}

.library-mini__like-icon svg,
.library-mini__state-icon svg {
  width: 28px;
  height: 28px;
  display: block;
}

.library-mini__like.is-active {
  color: rgba(255, 177, 137, 0.98);
}

.like-modal,
.sleep-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 20;
}

.like-modal[hidden],
.sleep-modal[hidden] {
  display: none;
}

.like-modal__backdrop,
.sleep-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 3, 1, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.like-modal__card,
.sleep-modal__card {
  position: relative;
  z-index: 1;
  width: min(420px, 92vw);
  border-radius: 24px;
  border: 1px solid rgba(255, 219, 152, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 246, 228, 0.12), rgba(140, 86, 39, 0.1)),
    rgba(52, 24, 10, 0.94);
  padding: 22px;
  color: var(--text);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
}

.like-modal__card h2,
.sleep-modal__card h2 {
  margin: 0 0 8px;
  font-family: "Bree Serif", serif;
  font-size: 22px;
  color: var(--text-strong);
}

.like-modal__card p,
.sleep-modal__card p {
  margin: 0 0 16px;
  font-size: 14px;
  color: rgba(255, 228, 180, 0.74);
}

.like-modal__actions,
.sleep-modal__actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.like-modal__btn,
.sleep-modal__btn {
  padding: 9px 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 231, 186, 0.98), rgba(226, 179, 97, 0.98));
  color: #341507;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.sleep-modal__btn--ghost {
  background: rgba(255, 233, 195, 0.12);
  color: rgba(255, 244, 217, 0.9);
}

.sleep-modal__picker {
  display: grid;
  gap: 12px;
}

.sleep-modal__range {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  appearance: none;
  background: linear-gradient(
    90deg,
    rgba(255, 233, 195, 0.95) 0%,
    rgba(255, 233, 195, 0.95) var(--sleep-fill, 30%),
    rgba(255, 233, 195, 0.2) var(--sleep-fill, 30%),
    rgba(255, 233, 195, 0.08) 100%
  );
}

.sleep-modal__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 233, 195, 0.95);
  border: 0;
}

.sleep-modal__range::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(255, 233, 195, 0.95) 0%,
    rgba(255, 233, 195, 0.95) var(--sleep-fill, 30%),
    rgba(255, 233, 195, 0.2) var(--sleep-fill, 30%),
    rgba(255, 233, 195, 0.08) 100%
  );
}

.sleep-modal__range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 233, 195, 0.95);
  border: 0;
}

.sleep-modal__inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sleep-modal__minutes {
  width: 72px;
  padding: 7px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 219, 152, 0.16);
  background: rgba(32, 14, 6, 0.42);
  color: var(--text);
  font-size: 13px;
}

.sleep-modal__unit {
  font-size: 13px;
  color: rgba(255, 228, 180, 0.72);
}

@keyframes stage-in {
  0% {
    opacity: 0;
    transform: translateY(14px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ring-spin {
  to {
    transform: translateZ(0) rotate(270deg);
  }
}

@keyframes cover-soft-fade {
  0% {
    opacity: 0.68;
    filter: sepia(0.28) saturate(0.7) contrast(0.9) brightness(0.92);
  }

  100% {
    opacity: 0.94;
    filter: sepia(0.18) saturate(0.82) contrast(0.94) brightness(0.98);
  }
}

@media (max-width: 380px) {
  .details {
    padding:
      calc(22px + env(safe-area-inset-top))
      14px
      calc(16px + env(safe-area-inset-bottom));
  }

  .meta--overlay {
    top: clamp(98px, 13.8svh, 128px);
    width: min(82%, 290px);
    min-height: 74px;
    padding: 6px 10px 8px;
  }

  .title {
    font-size: clamp(21px, 6.2vw, 28px);
  }

  .title.title--short {
    font-size: clamp(22px, 6.5vw, 29px);
  }

  .title.title--tiny {
    font-size: clamp(23px, 6.8vw, 30px);
  }

  .title.title--marquee {
    font-size: clamp(20px, 5.8vw, 26px);
  }

  .title.title--marquee.title--short {
    font-size: clamp(21px, 6vw, 27px);
  }

  .title.title--marquee.title--tiny {
    font-size: clamp(22px, 6.2vw, 28px);
  }

  .artist {
    font-size: 12px;
  }

  .art {
    top: clamp(224px, 30.6svh, 326px);
    width: min(61vw, 224px);
    max-width: 224px;
    border-radius: 5px;
  }

  .cover {
    border-radius: 3px;
  }

  .player-row {
    gap: 10px;
  }

  .like,
  .sleep {
    width: 50px;
    height: 50px;
  }

  .like__icon svg,
  .sleep__icon svg {
    width: 24px;
    height: 24px;
  }

  .player {
    width: 108px;
    height: 108px;
  }

  .play {
    width: 84px;
    height: 84px;
  }

  .play__icon svg {
    width: 38px;
    height: 38px;
  }

  .library-page {
    --library-page-side-padding: 14px;
    padding:
      calc(16px + env(safe-area-inset-top))
      14px
      calc(18px + env(safe-area-inset-bottom));
  }

  .library-mini {
    grid-template-columns: 56px 1fr auto;
    gap: 10px;
    padding-top: 14px;
  }

  .library-mini__cover {
    width: 56px;
    height: 56px;
  }
}

@media (max-height: 760px) {
  .details {
    padding-top: calc(20px + env(safe-area-inset-top));
    gap: 0;
  }

  .meta--overlay {
    top: clamp(88px, 13.3svh, 116px);
    min-height: 68px;
  }

  .art {
    top: clamp(194px, 28.8svh, 266px);
    width: min(54vw, 206px);
    max-width: 206px;
  }

  .controls {
    bottom: calc(76px + env(safe-area-inset-bottom));
    gap: 8px;
  }

  .spectrum {
    height: 54px;
  }

  .spectrum__bars {
    padding: 8px 10px 10px;
  }

  .player {
    width: 106px;
    height: 106px;
  }

  .play {
    width: 82px;
    height: 82px;
  }

  .ad-banner {
    bottom: calc(12px + env(safe-area-inset-bottom));
  }
}

@media (orientation: landscape) and (min-width: 700px) {
  body {
    justify-content: stretch;
  }

  body::before {
    background: url("assets/bg.png") center bottom / cover no-repeat;
    filter: blur(18px) saturate(1.02) brightness(1.12);
    transform: scale(1.08);
    opacity: 0;
  }

  .app {
    width: 100vw;
    min-width: 100vw;
    max-width: none;
    background: transparent;
    box-shadow: none;
  }

  .app::before {
    background: url("assets/bg.png") center bottom / cover no-repeat;
    filter: blur(18px) saturate(1.04) brightness(1.12);
    transform: scale(1.08);
    opacity: 0.96;
  }

  .details {
    width: 100%;
    max-width: min(100%, 1120px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(240px, 34%) minmax(320px, 1fr);
    grid-template-rows: auto 1fr auto;
    column-gap: clamp(24px, 4vw, 52px);
    align-items: center;
    padding:
      calc(18px + env(safe-area-inset-top))
      clamp(20px, 4vw, 44px)
      calc(18px + env(safe-area-inset-bottom));
  }

  .art,
  .meta--overlay,
  .controls,
  .ad-banner {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    transform: none;
    margin: 0;
  }

  .meta--overlay,
  .art,
  .controls,
  .ad-banner,
  .cover.cover--fade-in {
    animation: none;
  }

  .play,
  .play.is-playing,
  .ring,
  .ring * {
    transition: none;
    filter: none;
    animation: none;
  }

  .art {
    grid-column: 1;
    grid-row: 1 / span 3;
    width: min(34vw, 290px);
    max-width: 290px;
    align-self: center;
    justify-self: center;
    transform: translateY(-18px);
  }

  .meta--overlay {
    grid-column: 2;
    grid-row: 1;
    width: min(100%, 440px);
    min-height: 96px;
    padding: 0 4px 0 0;
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
  }

  .meta--overlay.meta--with-timer {
    padding-bottom: 0;
  }

  .title,
  .artist {
    text-align: left;
  }

  .title {
    width: 100%;
  }

  .controls {
    grid-column: 2;
    grid-row: 2;
    width: min(100%, 460px);
    justify-items: center;
    align-self: center;
    gap: 12px;
  }

  .meta-row,
  .player-row {
    width: 100%;
    justify-content: center;
  }

  .spectrum {
    width: min(100%, 460px);
    max-width: none;
  }

  .status {
    width: 100%;
    text-align: center;
  }

  .ad-banner {
    grid-column: 2;
    grid-row: 3;
    width: min(100%, 460px);
    margin-top: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .title.title--marquee .title__text,
  .play.is-playing ~ .ring {
    animation: none;
  }

  .meta--overlay,
  .art,
  .controls,
  .library-page {
    animation: none;
    transition: none;
  }
}
