
:root {
  --logo-x: 0vw;
  --logo-top: 10vh;
  --logo-size: clamp(2.4rem, 8vw, 6rem);
  --edge: clamp(1rem, 2.2vw, 1.75rem);
  --glass: rgba(255, 255, 255, 0.12);
  --glass-line: rgba(255, 255, 255, 0.22);
  --shadow-glass: 0 10px 44px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  --text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
  --body: "Baloo 2", "Kohinoor Devanagari", "Nirmala UI", "Noto Sans Devanagari", ui-rounded, system-ui, sans-serif;
  --ui: "Poppins", ui-sans-serif, -apple-system, "Segoe UI", system-ui, sans-serif;
  --swift: 140ms cubic-bezier(0.4, 0, 0.2, 1);
  --glide: 320ms cubic-bezier(0.4, 0, 0.2, 1);
  --settle: 620ms cubic-bezier(0.16, 1, 0.3, 1);
  --ease-settle: cubic-bezier(0.16, 1, 0.3, 1);
  --accent: #f472b6;
}

* { box-sizing: border-box; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--body);
  color: #fff;
  background: #0a1416;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

@keyframes rise {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to { opacity: 1; transform: none; }
}
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.topbar, .logo, .dock { animation: rise var(--settle) both; }
.topbar { animation-delay: 0.28s; }
.logo { animation-delay: 0.06s; }
.dock { animation-delay: 0.16s; }

.bg {
  position: fixed; inset: 0; z-index: -1;
  background-color: #0a1416;
}
.bg__layer {
  position: absolute; inset: 0;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0;
  transition: opacity 1.1s var(--ease-settle);
}
.bg__layer.is-active { opacity: 1; }
.bg__layer--1 {
  background-image: url("../img/bg-1.jpg");
}
.bg__layer--3 {
  background-image: url("../img/bg-3.jpg");
}
.bg__layer--4 {
  background-image: url("../img/bg-4.jpg");
}
.bg__layer--5 {
  background-image: url("../img/bg-5.jpg");
}
.bg__layer--6 {
  background-image: url("../img/bg-6.jpg");
}
.bg__layer--7 {
  background-image: url("../img/bg-7.jpg");
}
.bg__layer--8 {
  background-image: url("../img/bg-8.jpg");
}



.bg__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.28) 0%,
    rgba(0, 0, 0, 0.06) 26%,
    rgba(0, 0, 0, 0.1) 58%,
    rgba(0, 0, 0, 0.48) 100%
  );
  pointer-events: none;
}

.yt-host {
  position: fixed; top: 0; left: 0;
  width: 1px; height: 1px;
  overflow: hidden; opacity: 0; pointer-events: none;
}

main {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: max(var(--edge), env(safe-area-inset-top)) var(--edge)
    max(var(--edge), env(safe-area-inset-bottom));
}

.topbar {
  position: fixed;
  top: max(1.15rem, env(safe-area-inset-top));
  left: var(--edge); right: var(--edge);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  text-shadow: var(--text-shadow);
}
.clock {
  font-family: var(--ui);
  font-size: 0.9rem; font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: 0.02em;
}

.links { display: flex; align-items: center; gap: 0.35rem; }
.link {
  display: grid; place-items: center;
  width: 2rem; height: 2rem; border-radius: 50%;
  color: rgba(255, 255, 255, 0.92); text-decoration: none;
  transition: background var(--swift), transform var(--swift);
}
.link:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }

.logo {
  margin: var(--logo-top) 0 0;
  translate: var(--logo-x) 0;
  display: flex; flex-direction: column; align-items: center;
  font-family: var(--body); font-weight: 800;
  font-size: var(--logo-size); line-height: 1.05;
  letter-spacing: -0.01em; color: #fff;
  text-align: center;
  filter: drop-shadow(0 4px 24px rgba(0, 0, 0, 0.5));
  user-select: none;
}
.logo__sub {
  font-size: 0.28em; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7); margin-top: 0.35em;
}

.dock {
  position: relative;
  width: 100%; max-width: 30rem;
  margin-bottom: clamp(0.5rem, 7vh, 4.5rem);
}

.list {
  position: absolute;
  left: 0; right: 0; bottom: calc(100% + 0.6rem);
  max-height: 0; overflow: hidden;
  border-radius: 1.1rem;
  border: 1px solid transparent;
  background: rgba(12, 18, 22, 0.72);
  backdrop-filter: blur(28px) saturate(150%);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  transition: max-height var(--glide), border-color var(--swift), opacity var(--swift);
  opacity: 0; pointer-events: none;
  z-index: 5;
}
.list.is-open {
  max-height: min(42vh, 320px);
  border-color: var(--glass-line);
  opacity: 1; pointer-events: auto;
  overflow-y: auto;
}
.list ol { list-style: none; margin: 0; padding: 0.4rem; }
.list li button {
  width: 100%; display: flex; flex-direction: column; align-items: flex-start;
  gap: 0.1rem; padding: 0.55rem 0.75rem;
  border: none; border-radius: 0.7rem;
  background: transparent; color: #fff;
  font-family: var(--body); text-align: left; cursor: pointer;
  transition: background var(--swift);
}
.list li button:hover { background: rgba(255, 255, 255, 0.1); }
.list li.is-current button { background: rgba(255, 255, 255, 0.14); }
.list .t-title {
  font-size: 0.92rem; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
.list .t-dur {
  font-size: 0.72rem; font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
}

.bumper {
  margin: 0 0 0.55rem;
  text-align: center;
  font-size: 0.95rem; font-weight: 700;
  text-shadow: var(--text-shadow);
  color: rgba(255, 255, 255, 0.9);
}

.player {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.5rem 1rem 0.5rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--glass-line);
  background: var(--glass);
  backdrop-filter: blur(28px) saturate(150%);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
  box-shadow: var(--shadow-glass);
  transition: opacity 120ms ease;
}
.player.is-swapping { opacity: 0.55; }

.disc {
  position: relative; flex: none;
  width: 3.4rem; height: 3.4rem;
}
.disc__ring {
  width: 100%; height: 100%;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  animation: spin 8s linear infinite;
  animation-play-state: paused;
}
.player.is-playing .disc__ring { animation-play-state: running; }
@keyframes spin { to { transform: rotate(360deg); } }
.disc__art {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  background: #1a2430;
}
.disc__hub {
  position: absolute; top: 50%; left: 50%;
  width: 0.55rem; height: 0.55rem;
  margin: -0.275rem 0 0 -0.275rem;
  border-radius: 50%;
  background: #0a1416;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
  pointer-events: none;
}

.meta { flex: 1; min-width: 0; }
.meta__title {
  margin: 0; font-size: 0.88rem; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.25;
}
.meta__artist {
  margin: 0 0 0.35rem;
  font-size: 0.72rem; font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.seek {
  position: relative; height: 1.1rem;
  display: flex; align-items: center; cursor: pointer;
  touch-action: none;
}
.seek__rail {
  width: 100%; height: 3px; border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}
.seek__fill {
  height: 100%; width: 0%;
  background: #fff; border-radius: 2px;
  transition: width 80ms linear;
}
.seek.is-scrubbing .seek__fill { transition: none; }
.seek__knob {
  position: absolute; top: 50%;
  width: 11px; height: 11px;
  margin: -5.5px 0 0 -5.5px;
  border-radius: 50%; background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  left: 0%; pointer-events: none;
  opacity: 0; transform: scale(0.6);
  transition: opacity var(--swift), transform var(--swift);
}
.seek:hover .seek__knob,
.seek.is-scrubbing .seek__knob {
  opacity: 1; transform: scale(1);
}

.time {
  display: flex; justify-content: space-between;
  font-family: var(--ui); font-size: 0.65rem;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.55); margin-top: 0.15rem;
}

.controls {
  display: flex; align-items: center; gap: 0.15rem; flex: none;
}
.btn {
  display: grid; place-items: center;
  width: 2.15rem; height: 2.15rem;
  border: none; border-radius: 50%;
  background: transparent; color: #fff;
  cursor: pointer;
  transition: background var(--swift), transform var(--swift), color var(--swift);
}
.btn:hover { background: rgba(255, 255, 255, 0.14); }
.btn:active { transform: scale(0.92); }
.btn:disabled { opacity: 0.35; pointer-events: none; }
.btn--play {
  width: 2.5rem; height: 2.5rem;
  background: rgba(255, 255, 255, 0.18);
}
.btn--play:hover { background: rgba(255, 255, 255, 0.28); }
.btn--play .i-pause { display: none; }
.player.is-playing .btn--play .i-play { display: none; }
.player.is-playing .btn--play .i-pause { display: block; }
.btn--toggle.is-on { color: #4ade80; }

.empty-msg {
  text-align: center; padding: 2rem 1rem;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: var(--text-shadow);
  font-size: 1rem;
}

@media (max-width: 420px) {
  .meta__artist { display: none; }
  .btn:not(.btn--play):not(#listBtn):not(#shuffle) { display: none; }
}
