* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --accent: #ffc021;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.55);
  --glass: rgba(14, 14, 16, 0.72);
  --glass-soft: rgba(18, 18, 20, 0.45);
  --stroke: rgba(255, 255, 255, 0.12);
}

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

body {
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  background: #050505;
}

body.locked {
  overflow: hidden;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-color: #050505;
  background-image: url("assets/background.jpg?v=3");
  background-size: cover;
  background-position: center 28%;
  background-repeat: no-repeat;
  transform: scale(1.04);
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 140, 40, 0.16), transparent 55%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.62) 0%, rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0) 46%, rgba(0, 0, 0, 0.55) 72%, rgba(0, 0, 0, 0.9) 100%);
}

.yt-stage {
  position: fixed;
  top: -9999px;
  left: -9999px;
  width: 300px;
  height: 300px;
  overflow: hidden;
  pointer-events: none;
  z-index: -3;
}

.yt-stage iframe {
  width: 300px;
  height: 300px;
}

.app {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 18px 22px;
}

/* ---------- top bar ---------- */
.topbar {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--glass-soft);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text);
  font-size: 0.86rem;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
}

.pill strong {
  font-weight: 700;
}

.pill-ghost {
  flex: 1;
  height: 42px;
  cursor: default;
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #24e07a;
  box-shadow: 0 0 12px #24e07a;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.pill-support {
  margin-left: auto;
}

.pill-support svg {
  width: 17px;
  height: 17px;
  fill: #ff4d6d;
}

/* ---------- hero ---------- */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 22px;
  padding: 20px 0;
}

.hero-title {
  font-size: clamp(3rem, 11vw, 6.5rem);
  font-weight: 800;
  line-height: 0.94;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  text-shadow: 0 10px 50px rgba(0, 0, 0, 0.8);
}

.now-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(20, 20, 22, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 0.85rem;
}

.now-pill svg {
  width: 16px;
  height: 16px;
  fill: var(--accent);
}

/* ---------- bottom ---------- */
.bottom {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chips {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #f2f2f2;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.chip svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.16);
}

.chip:active {
  transform: scale(0.96);
}

.chip.active {
  background: var(--accent);
  color: #141414;
  border-color: transparent;
}

/* ---------- player bar ---------- */
.playerbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 28px;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}

.thumb {
  position: relative;
  flex-shrink: 0;
  width: 58px;
  height: 58px;
  border-radius: 15px;
  overflow: hidden;
  background: #232326;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.thumb-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.thumb:hover .thumb-play {
  opacity: 1;
}

.thumb-play svg {
  width: 22px;
  height: 22px;
  fill: #fff;
}

.pb-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pb-title {
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pb-credits {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}

.pb-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.time {
  font-size: 0.7rem;
  color: var(--muted);
  min-width: 32px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px rgba(255, 192, 33, 0.9);
}

input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: none;
  border-radius: 50%;
  background: #fff;
}

.pb-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.rbtn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.rbtn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.rbtn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.rbtn:active {
  transform: scale(0.92);
}

.play-btn {
  width: 54px;
  height: 54px;
  background: var(--accent);
  color: #141414;
  box-shadow: 0 10px 26px rgba(255, 192, 33, 0.45);
}

.play-btn:hover {
  background: #ffce4d;
}

.play-btn svg {
  width: 26px;
  height: 26px;
}

.hidden {
  display: none !important;
}

/* ---------- playlist sheet ---------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 40;
}

.sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 105%);
  width: min(560px, 100%);
  max-height: 78dvh;
  display: flex;
  flex-direction: column;
  padding: 10px 18px 22px;
  border-radius: 26px 26px 0 0;
  background: rgba(16, 16, 18, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: none;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.7);
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 50;
}

.sheet.open {
  transform: translate(-50%, 0);
}

.sheet-grip {
  width: 44px;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.22);
  margin: 4px auto 14px;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.sheet-head h2 {
  font-size: 1.05rem;
  font-weight: 700;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
}

.playlist {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  margin: 4px 0 12px;
}

.playlist::-webkit-scrollbar {
  width: 6px;
}

.playlist::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 99px;
}

.playlist li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.playlist li:hover {
  background: rgba(255, 255, 255, 0.07);
}

.playlist li.active {
  background: rgba(255, 192, 33, 0.16);
}

.playlist li .idx {
  width: 20px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.playlist li.active .idx {
  color: var(--accent);
}

.playlist li .info {
  flex: 1;
  min-width: 0;
}

.playlist li .name {
  font-size: 0.86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist li .sub {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}

.playlist li img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.sheet-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.vol-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.vol-row svg {
  width: 20px;
  height: 20px;
  fill: var(--muted);
  flex-shrink: 0;
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 110px;
  transform: translate(-50%, 16px);
  padding: 11px 22px;
  border-radius: 999px;
  background: rgba(20, 20, 22, 0.95);
  border: 1px solid var(--stroke);
  font-size: 0.82rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 60;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 10px;
}

.pb-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pb-title-row .pb-title {
  flex: 1;
  min-width: 0;
}

.like-btn {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.15s ease, color 0.2s ease;
}

.like-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
}

.like-btn:hover {
  color: #fff;
  transform: scale(1.12);
}

.like-btn.liked {
  color: #ff4d6d;
}

.like-btn.liked svg {
  fill: #ff4d6d;
  stroke: #ff4d6d;
}

.like-btn.pop {
  animation: like-pop 0.35s ease;
}

@keyframes like-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

.visualizer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.visualizer.on {
  opacity: 1;
}

.eq-panel {
  position: fixed;
  left: 50%;
  bottom: 104px;
  transform: translate(-50%, 14px);
  width: min(440px, calc(100% - 28px));
  padding: 16px 18px;
  border-radius: 22px;
  background: rgba(16, 16, 18, 0.96);
  border: 1px solid var(--stroke);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 55;
}

.eq-panel.open {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.eq-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.eq-head h3 {
  font-size: 0.95rem;
  font-weight: 700;
}

.eq-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.eq-preset {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.07);
  color: #eaeaea;
  font-size: 0.76rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.eq-preset:hover {
  background: rgba(255, 255, 255, 0.16);
}

.eq-preset.active {
  background: var(--accent);
  color: #141414;
  border-color: transparent;
}

.eq-sliders {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.eq-row {
  display: grid;
  grid-template-columns: 52px 1fr 28px;
  align-items: center;
  gap: 10px;
  font-size: 0.76rem;
  color: var(--muted);
}

.eq-row output {
  text-align: right;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.eq-note {
  margin-top: 12px;
  font-size: 0.68rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.42);
}

.playlist li .fav {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  fill: #ff4d6d;
  opacity: 0;
}

.playlist li.liked .fav {
  opacity: 1;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  position: relative;
  width: min(340px, 100%);
  background: rgba(18, 18, 20, 0.98);
  border: 1px solid var(--stroke);
  border-radius: 24px;
  padding: 22px 22px 18px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
  transform: translateY(14px) scale(0.97);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal.open .modal-card {
  transform: translateY(0) scale(1);
}

.qr-img {
  display: block;
  width: 100%;
  border-radius: 16px;
}

.modal-caption {
  margin-top: 14px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
}

/* ---------- responsive ---------- */
@media (max-width: 620px) {
  .app {
    padding: 14px 14px 16px;
  }

  .pill-ghost {
    display: none;
  }

  .topbar {
    justify-content: space-between;
  }

  .pill-support {
    margin-left: 0;
  }

  .hero-title {
    font-size: clamp(2.6rem, 15vw, 4.5rem);
  }

  .thumb {
    width: 50px;
    height: 50px;
    border-radius: 13px;
  }

  .rbtn {
    width: 38px;
    height: 38px;
  }

  .rbtn svg {
    width: 19px;
    height: 19px;
  }

  .play-btn {
    width: 48px;
    height: 48px;
  }

  .play-btn svg {
    width: 23px;
    height: 23px;
  }

  .pb-controls {
    gap: 7px;
  }

  .time {
    min-width: 28px;
    font-size: 0.66rem;
  }
}

@media (max-width: 420px) {
  .vol-btn {
    display: none;
  }

  .chip {
    padding: 9px 14px;
    font-size: 0.78rem;
  }

  .chip svg {
    width: 14px;
    height: 14px;
  }
}
