:root {
  --saffron: #ff6f3c;
  --pink: #e8437a;
  --gold: #ffd166;
  --text: #fff7ec;
  --muted: rgba(255, 247, 236, 0.72);
  --glass: rgba(24, 8, 22, 0.5);
  --glass-border: rgba(255, 255, 255, 0.18);
  --tint: rgba(255, 255, 255, 0.1);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  font-family: 'Segoe UI', Tahoma, Verdana, sans-serif;
  color: var(--text);
  background-color: #120a10;
  background-image: url("../images/bg9-clean.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.bg-art { display: none; }

.load-veil {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #120a10;
  transition: opacity 0.35s ease;
}
.load-veil.hidden {
  opacity: 0;
  pointer-events: none;
}
.load-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--gold);
  animation: load-spin 0.8s linear infinite;
}
.load-text {
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}
@keyframes load-spin {
  to { transform: rotate(360deg); }
}

.hero-wrap {
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  pointer-events: none;
  text-align: center;
}

.hero-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(90vw, 1000px);
  height: 220px;
  background: radial-gradient(ellipse at center, rgba(255, 183, 3, 0.55) 0%, rgba(255, 111, 60, 0.25) 45%, transparent 75%);
  filter: blur(6px);
  z-index: -1;
}

.hero-title {
  margin: 0;
  font-family: 'Baloo Bhai 2', 'Nirmala UI', 'Segoe UI', sans-serif;
  font-weight: 800;
  font-size: clamp(3rem, 8.5vw, 7.5rem);
  line-height: 1.3;
  letter-spacing: 1px;
  background: linear-gradient(180deg, #fff9ec 0%, #ffe8a3 35%, #ffb703 70%, #ff6f3c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter:
    drop-shadow(0 0 18px rgba(255, 183, 3, 0.85))
    drop-shadow(0 0 36px rgba(255, 111, 60, 0.55))
    drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6));
}

.hero-rule {
  width: min(60vw, 420px);
  height: 4px;
  margin: 6px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--gold), var(--saffron), var(--gold), transparent);
  box-shadow: 0 0 12px rgba(255, 183, 3, 0.8);
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(10, 3, 8, 0.55) 0%, rgba(10, 3, 8, 0) 22%),
    linear-gradient(to top, rgba(10, 3, 8, 0.6) 0%, rgba(10, 3, 8, 0) 30%),
    rgba(10, 3, 8, 0.15);
}

/* top bar */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

.clock-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.clock {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
}

.online {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.9rem;
  font-weight: 600;
}

.online[hidden] { display: none; }

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px 2px rgba(34, 197, 94, 0.6);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse { 50% { opacity: 0.4; } }

.ext-links {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 6px 18px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.ext-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  background: none;
  border: none;
  padding: 4px 2px;
  cursor: pointer;
  text-decoration: none;
}

.ext-link .arrow { opacity: 0.5; font-size: 0.8rem; }
.ext-link:hover { color: var(--gold); }

.streaming-via {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.yt-badge {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* hero title */
/* songs drawer */
.drawer {
  position: fixed;
  top: 70px;
  right: 20px;
  bottom: 140px;
  width: min(360px, calc(100% - 40px));
  z-index: 7;
  padding: 16px;
  display: flex;
  flex-direction: column;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
  transform-origin: top right;
  transform: translateY(-10px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.drawer.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

#searchBox {
  width: 100%;
  padding: 10px 16px;
  font-size: 0.9rem;
  color: var(--text);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  outline: none;
  background: rgba(0, 0, 0, 0.3);
}

#searchBox::placeholder { color: var(--muted); }
#searchBox:focus { border-color: var(--gold); }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 6px;
}

.filter-btn {
  border: 1px solid var(--glass-border);
  background: var(--tint);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.filter-btn:hover { background: rgba(255, 255, 255, 0.2); }

.filter-btn.active {
  background: linear-gradient(135deg, var(--saffron), var(--pink));
  border-color: transparent;
  color: #fff;
}

.sub-filters {
  margin: -2px 0 8px;
  padding-left: 10px;
  border-left: 2px solid var(--glass-border);
}

.sub-filters[hidden] { display: none; }

.sub-filters .filter-btn {
  padding: 4px 12px;
  font-size: 0.74rem;
  opacity: 0.92;
}

.song-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.song-list::-webkit-scrollbar {
  width: 6px;
}

.song-list::-webkit-scrollbar-track {
  background: transparent;
}

.song-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
}

.song-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

.song-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--glass-border);
  cursor: pointer;
  border-radius: 10px;
}

.song-item:hover { background: var(--tint); }
.song-item.playing { background: rgba(255, 209, 102, 0.16); }
.song-item.playing .si-title { color: var(--gold); }

.si-num {
  width: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.si-text { flex: 1; min-width: 0; }

.si-title {
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.si-artist {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty-message { text-align: center; color: var(--muted); padding: 24px 0; }

.playlist-info {
  font-size: 0.76rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 8px 12px;
  margin: 0 0 8px;
  line-height: 1.35;
}

.si-duration {
  flex-shrink: 0;
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.si-playlist {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.si-playlist:hover { background: rgba(255, 255, 255, 0.18); }

.si-playlist.added {
  background: linear-gradient(135deg, var(--saffron), var(--pink));
  border-color: transparent;
  color: #fff;
}

.song-item.drag-ghost { opacity: 0.4; }

/* pill player */
.player {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  width: min(620px, calc(100% - 24px));
  z-index: 8;
  overflow: hidden;
  display: grid;
  grid-template-columns: 68px 1fr auto;
  grid-template-areas:
    "cover info controls"
    "cover line controls";
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
  align-items: center;
  column-gap: 16px;
  row-gap: 4px;
  padding: 10px 22px 10px 10px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
  text-align: left;
}

.player.drag-over {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold), 0 14px 36px rgba(0, 0, 0, 0.5);
}

.cover {
  grid-area: cover;
  position: relative;
  isolation: isolate;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--saffron), var(--pink) 60%, #4a1e5c);
  border: 2px solid rgba(255, 255, 255, 0.35);
}

#ytPlayer {
  position: absolute;
  inset: 0;
  z-index: -1;
}

#ytPlayer iframe {
  width: 100%;
  height: 100%;
}

.cover img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.cover.has-img img { display: block; }
.cover.has-img .cover-placeholder { display: none; }

.cover-placeholder {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--saffron), var(--pink) 60%, #4a1e5c);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-align: center;
}

.now-playing { grid-area: info; min-width: 0; align-self: end; }

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

.np-artist {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline { grid-area: line; align-self: start; padding-top: 4px; }

#seekSlider {
  --val: 0%;
  width: 100%;
  height: 16px;
  display: block;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

#seekSlider::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--saffron) 0%, var(--pink) var(--val), rgba(255, 255, 255, 0.25) var(--val), rgba(255, 255, 255, 0.25) 100%);
}

#seekSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
}

#seekSlider::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
}

#seekSlider::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--saffron), var(--pink));
}

#seekSlider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: none;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
}

.time {
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.controls {
  grid-area: controls;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ctrl {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  border: none;
  background: none;
  color: var(--text);
  font-size: 1.15rem;
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: 50%;
}

.ctrl:hover { background: var(--tint); }

.ctrl svg {
  width: 46%;
  height: 46%;
  fill: currentColor;
  flex-shrink: 0;
}

.ctrl.main svg { width: 42%; height: 42%; margin-left: 2px; }

.ctrl.main {
  width: 48px;
  height: 48px;
  font-size: 1.15rem;
  color: #fff;
  background: linear-gradient(135deg, var(--saffron), var(--pink));
  box-shadow: 0 6px 16px rgba(232, 67, 122, 0.4);
}

.ctrl.main:hover {
  background: linear-gradient(135deg, var(--saffron), var(--pink));
  filter: brightness(1.08);
}

.volume {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
  padding-left: 8px;
  border-left: 1px solid var(--glass-border);
}

.volume .ctrl {
  width: 30px;
  height: 30px;
  font-size: 0.95rem;
}

#mobileSongsTab { display: none; }
#mobileSongsTab.active { color: var(--gold); }

#volumeSlider {
  --val: 100%;
  width: 70px;
  height: 16px;
  accent-color: var(--gold);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

#volumeSlider::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--gold) 0%, var(--gold) var(--val), rgba(255, 255, 255, 0.25) var(--val), rgba(255, 255, 255, 0.25) 100%);
}

#volumeSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
}

#volumeSlider::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
}

#volumeSlider::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: var(--gold);
}

#volumeSlider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: none;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
}

.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 9px;
  z-index: 8;
  text-align: center;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  pointer-events: none;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

@media (max-width: 760px), (max-height: 480px) {
  .topbar { padding: 14px 16px; }
  .ext-links { gap: 14px; }
  .ext-link .lbl, .ext-link .arrow { display: none; }
  .streaming-via { display: none; }
  .online { font-size: 0.72rem; gap: 5px; }
  .live-dot { width: 6px; height: 6px; }
  .ext-links { display: none; }
  .yt-badge { top: 14px; bottom: auto; right: 16px; padding: 6px 10px; gap: 6px; }

  .hero-wrap { top: 68px; }
  .hero-title { font-size: clamp(1.5rem, 6.5vw, 2.4rem); letter-spacing: 0; }
  .hero-glow { height: 110px; }
  .hero-rule { width: min(50vw, 220px); height: 3px; margin-top: 4px; }

  /* full-screen songs sheet, toggled by the Songs icon in the player */
  .drawer {
    left: 0;
    right: 0;
    top: 178px;
    bottom: 176px;
    width: auto;
    border-radius: 20px 20px 0 0;
    background: rgba(14, 5, 12, 0.88);
    transform-origin: bottom center;
    transform: translateY(16px);
  }

  #searchBox { display: none; }
  .filter-btn { font-size: 0.82rem; }
  .si-title { font-size: 0.95rem; }
  .si-artist { font-size: 0.8rem; }
  .si-duration { font-size: 0.78rem; }
  .song-item { padding: 12px 8px; }

  .player {
    width: calc(100% - 24px);
    bottom: max(14px, env(safe-area-inset-bottom, 0px));
    padding: 6px 12px;
    border-radius: 18px;
    grid-template-columns: 38px 1fr;
    grid-template-areas:
      "cover info"
      "line line"
      "controls controls";
    row-gap: 4px;
    column-gap: 10px;
  }

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

  .now-playing { align-self: center; }

  .np-title, .np-artist { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .np-title { font-size: 0.85rem; }
  .np-artist { font-size: 0.72rem; }

  .timeline { padding-top: 0; }

  .controls { justify-content: center; gap: 8px; }

  .ctrl { width: 30px; height: 30px; }
  .ctrl.main { width: 38px; height: 38px; }

  .volume { flex: 0 0 auto; }

  #volumeSlider { display: none; }

  #mobileSongsTab { display: flex; }

  .site-footer { display: none; }
}

/* short screens (phone landscape) */
@media (max-height: 480px) {
  .hero-wrap { top: 14px; }
  .hero-title { font-size: clamp(1.1rem, 4.5vw, 1.6rem); }
  .hero-glow { height: 60px; }
  .hero-rule { display: none; }

  .drawer { display: none !important; }
  #mobileSongsTab { display: none !important; }
  .yt-badge { top: 10px; bottom: auto; right: 14px; }

  .player {
    width: min(420px, calc(100% - 20px));
    bottom: 14px;
    padding: 6px 16px 6px 8px;
    border-radius: 999px;
    background: rgba(14, 5, 12, 0.96);
    grid-template-columns: 34px 1fr auto;
    grid-template-areas:
      "cover info controls"
      "cover line controls";
    row-gap: 2px;
    column-gap: 10px;
  }

  .cover { width: 34px; height: 34px; }
  .cover-placeholder { font-size: 0.46rem; }

  .now-playing { align-self: end; }
  .np-title { font-size: 0.74rem; }
  .np-artist { display: none; }

  .timeline { align-self: start; padding-top: 0; }
  .timeline .time { margin-top: 2px; font-size: 0.56rem; }
  #seekSlider { height: 12px; }
  #seekSlider::-webkit-slider-thumb { width: 10px; height: 10px; margin-top: -3px; }
  #seekSlider::-moz-range-thumb { width: 10px; height: 10px; }

  .controls { gap: 4px; }
  .ctrl { width: 24px; height: 24px; font-size: 0.8rem; }
  .ctrl.main { width: 30px; height: 30px; }

  .volume { margin-left: 2px; padding-left: 6px; }
  .volume .ctrl { width: 18px; height: 18px; font-size: 0.7rem; }

  .site-footer { display: none; }
}
