/* ═══════════════════════════════════════════════════════════
   बजा दो (Baja Do) — Party Music Player
   Neon nightclub vibes. Hot pink, cyan, gold accents.
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg-deep:    #0a0a14;
  --bg-card:    rgba(16, 12, 28, 0.75);
  --neon-pink:  #ff2d8a;
  --neon-cyan:  #00e5ff;
  --neon-gold:  #ffd700;
  --neon-purple:#b44dff;
  --text:       #f0eaff;
  --text-dim:   #9a8fc0;
  --glass:      rgba(255,255,255,0.06);
  --glass-line: rgba(255,255,255,0.12);
  --body:       'Outfit', 'Baloo 2', sans-serif;
  --display:    'Baloo 2', 'Outfit', sans-serif;
  --mono:       'JetBrains Mono', monospace;
  --swift:      0.22s cubic-bezier(0.4, 0, 0.2, 1);

  /* responsive sizing */
  --logo-size:  clamp(4rem, 12vw, 8rem);
  --logo-top:   clamp(10vh, 16vh, 22vh);
  --logo-x:     0px;
  --dock-bottom: max(1.2rem, env(safe-area-inset-bottom, 0px));
}

* { 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: var(--text);
  background: var(--bg-deep);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ── Background ──────────────────────────────────────────── */

.bg {
  position: fixed; inset: 0; z-index: -1;
  background-color: var(--bg-deep);
  background-image: url('./bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.bg__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom,
    rgba(10, 10, 20, 0.78) 0%,
    rgba(10, 10, 20, 0.55) 30%,
    rgba(10, 10, 20, 0.50) 55%,
    rgba(10, 10, 20, 0.88) 100%);
  pointer-events: none;
}

/* Confetti canvas */
#confetti {
  position: fixed; inset: 0; z-index: 100;
  pointer-events: none;
}

/* ── Hidden YT player ───────────────────────────────────── */

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

/* ── Top bar ─────────────────────────────────────────────── */

.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.8rem 1.4rem;
  font-family: var(--body); font-size: 0.8rem;
}

.clock {
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
}

.presence {
  display: flex; align-items: center; gap: 0.4rem;
  color: var(--text);
}

.presence__dot {
  width: 10px; height: 10px; flex: none;
  border-radius: 50%;
  background: var(--neon-pink);
  box-shadow: 0 0 10px rgba(255, 45, 138, 0.8);
  position: relative;
}

.presence__dot::after {
  content: ""; position: absolute; inset: 0;
  border-radius: 50%; background: var(--neon-pink);
  opacity: 0.75;
  animation: ping 1.8s cubic-bezier(0,0,0.2,1) infinite;
}

@keyframes ping {
  75%, 100% { transform: scale(2.2); opacity: 0; }
}

.presence__count { font-variant-numeric: tabular-nums; font-weight: 600; }
.presence__label { color: var(--text-dim); }

/* ── Party Shuru Button ──────────────────────────────────── */

.party-horn {
  position: fixed; left: 1.2rem;
  top: 50%; transform: translateY(-50%);
  z-index: 40;
}

.horn-btn {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.9rem 0.4rem 0.5rem;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 0 24px rgba(255, 45, 138, 0.15), inset 0 1px 0 rgba(255,255,255,0.1);
  color: #fff; font-family: var(--body);
  cursor: pointer;
  transition: background var(--swift), transform var(--swift), border-color var(--swift), box-shadow var(--swift);
}

.horn-btn:hover {
  background: rgba(255, 45, 138, 0.15);
  border-color: var(--neon-pink);
  box-shadow: 0 0 30px rgba(255, 45, 138, 0.3);
}

.horn-btn:active { transform: translateY(-50%) scale(0.94); }

.horn-btn.is-active {
  background: rgba(255, 45, 138, 0.25);
  border-color: var(--neon-pink);
  box-shadow: 0 0 20px rgba(255, 45, 138, 0.5);
}

.horn-btn__emoji { font-size: 1.4rem; }

.horn-btn__text {
  display: flex; flex-direction: column;
  line-height: 1.15; text-align: left;
}

.horn-btn__hi { font-size: 0.78rem; font-weight: 700; }
.horn-btn__en { font-size: 0.58rem; color: var(--text-dim); letter-spacing: 0.04em; }

/* ── Logo ────────────────────────────────────────────────── */

main {
  position: relative; z-index: 10;
  display: flex; flex-direction: column; align-items: center;
  height: 100%; padding: 0 1rem;
}

.logo {
  margin: var(--logo-top) 0 0;
  display: flex; align-items: baseline; gap: 0.2em;
  font-family: var(--display); font-weight: 800;
  font-size: var(--logo-size);
  line-height: 1; letter-spacing: -0.01em;
  color: var(--text);
  filter: drop-shadow(0 0 40px rgba(255, 45, 138, 0.4)) drop-shadow(0 4px 16px rgba(0,0,0,0.8));
  user-select: none;
}

.logo__line--accent {
  color: var(--neon-pink);
  text-shadow: 0 0 30px rgba(255, 45, 138, 0.6), 0 0 60px rgba(255, 45, 138, 0.3);
}

.tagline {
  margin-top: 0.4rem;
  font-size: clamp(0.85rem, 2.5vw, 1.1rem);
  color: var(--text-dim);
  text-align: center;
  font-weight: 500;
}

.tagline__hi {
  color: var(--neon-gold);
  font-weight: 700;
}

/* ── Category pills ──────────────────────────────────────── */

.categories {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  justify-content: center;
  margin-top: 1.2rem;
  padding: 0 1rem;
}

.cat-pill {
  padding: 0.35rem 1rem;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  color: var(--text-dim);
  font-family: var(--body); font-size: 0.78rem; font-weight: 600;
  cursor: pointer;
  transition: all var(--swift);
  white-space: nowrap;
}

.cat-pill:hover {
  background: rgba(255, 45, 138, 0.1);
  border-color: rgba(255, 45, 138, 0.4);
  color: var(--text);
}

.cat-pill.is-active {
  background: linear-gradient(135deg, rgba(255, 45, 138, 0.25), rgba(180, 77, 255, 0.2));
  border-color: var(--neon-pink);
  color: #fff;
  box-shadow: 0 0 16px rgba(255, 45, 138, 0.25);
}

/* ── Dock (bottom player area) ───────────────────────────── */

.dock {
  position: fixed; bottom: var(--dock-bottom);
  left: 50%; translate: -50% 0;
  width: min(96%, 640px);
  z-index: 30;
  display: flex; flex-direction: column; gap: 0.5rem;
}

/* ── Playlist ────────────────────────────────────────────── */

.list {
  max-height: 0; overflow: hidden auto;
  transition: max-height 0.4s var(--swift);
  border-radius: 16px;
  background: var(--bg-card);
  backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid var(--glass-line);
}

.list.is-open { max-height: min(50vh, 360px); }

.list ol {
  list-style: none; margin: 0; padding: 0.5rem 0;
}

.list li + li { border-top: 1px solid rgba(255,255,255,0.06); }

.list li button {
  display: flex; align-items: center; gap: 0.6rem;
  width: 100%; padding: 0.6rem 1rem;
  background: none; border: none; color: var(--text-dim);
  font-family: var(--body); font-size: 0.85rem;
  cursor: pointer; text-align: left;
  transition: background var(--swift), color var(--swift);
}

.list li button:hover { background: rgba(255,255,255,0.05); color: #fff; }

.list li.is-current button {
  color: var(--neon-pink);
  background: rgba(255, 45, 138, 0.08);
}

.list .t-title { font-weight: 600; flex: 1; }
.list .t-artist { font-size: 0.72rem; color: var(--text-dim); }
.list .t-cat {
  font-size: 0.65rem; padding: 0.15rem 0.4rem;
  background: rgba(255,255,255,0.08); border-radius: 4px;
  color: var(--text-dim); flex-shrink: 0;
}

/* ── Bumper ──────────────────────────────────────────────── */

.bumper {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0; margin: 0;
  font-size: 0.82rem; font-weight: 600;
  color: var(--neon-gold);
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
  text-align: center;
  min-height: 1.6rem;
}

.bumper__text {
  transition: opacity 0.25s ease;
}

.bumper__text.is-swapping { opacity: 0; }

.bumper__next {
  flex-shrink: 0; background: none; border: none;
  color: var(--text-dim); cursor: pointer;
  padding: 0.2rem; border-radius: 50%;
  transition: color var(--swift);
}

.bumper__next:hover { color: var(--neon-gold); }

/* ── Player ──────────────────────────────────────────────── */

.player {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 0 0.8rem;
  padding: 0.65rem 1rem;
  border-radius: 20px;
  background: var(--bg-card);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid var(--glass-line);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 80px rgba(255, 45, 138, 0.08);
}

.disc {
  grid-row: 1 / 3;
  align-self: center;
  width: 3.6rem; height: 3.6rem;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}

.disc__ring {
  width: 100%; height: 100%;
  border-radius: 50%; overflow: hidden;
  border: 2px solid rgba(255,255,255,0.1);
  animation: spin 4s linear infinite paused;
}

.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;
  border-radius: 50%;
}

.disc__art.is-letterboxed { object-fit: contain; background: #111; }

.disc__hub {
  position: absolute;
  top: 50%; left: 50%; translate: -50% -50%;
  width: 0.6rem; height: 0.6rem;
  background: var(--bg-deep);
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  z-index: 2;
}

/* Meta */
.meta { min-width: 0; }

.meta__title {
  font-size: 0.92rem; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: #fff;
}

.meta__artist {
  font-size: 0.72rem; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 0.25rem;
}

/* Seek bar */
.seek {
  position: relative; height: 20px;
  display: flex; align-items: center;
  cursor: pointer; touch-action: none;
}

.seek__rail {
  width: 100%; height: 3px;
  background: rgba(255,255,255,0.12);
  border-radius: 2px; overflow: hidden;
}

.seek__fill {
  height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, var(--neon-pink), var(--neon-cyan));
  transform-origin: left; transform: scaleX(0);
  will-change: transform;
}

.seek__knob {
  position: absolute; top: 50%; left: 0;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px rgba(255, 45, 138, 0.6);
  transform: translate(-50%, -50%);
  will-change: transform;
  pointer-events: none;
}

.time {
  display: flex; justify-content: space-between;
  font-size: 0.62rem; color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  margin-top: -2px;
}

/* Controls */
.controls {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: center;
  gap: 0.3rem; padding-top: 0.2rem;
}

.btn {
  background: none; border: none; color: var(--text-dim);
  cursor: pointer; padding: 0.45rem; border-radius: 50%;
  display: grid; place-items: center;
  transition: color var(--swift), background var(--swift);
}

.btn:hover { color: #fff; background: rgba(255,255,255,0.08); }

.btn--play {
  width: 3rem; height: 3rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
  color: #fff;
  box-shadow: 0 0 24px rgba(255, 45, 138, 0.4);
  transition: transform var(--swift), box-shadow var(--swift);
}

.btn--play:hover {
  transform: scale(1.08);
  box-shadow: 0 0 36px rgba(255, 45, 138, 0.6);
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
  color: #fff;
}

.btn--play:disabled { opacity: 0.4; cursor: default; }

.btn--play .i-pause { display: none; }
.is-playing .btn--play .i-play { display: none; }
.is-playing .btn--play .i-pause { display: block; }

.btn--toggle.is-on { color: var(--neon-cyan); }

/* ── Animations ──────────────────────────────────────────── */

@keyframes party-pulse {
  0%, 100% { box-shadow: 0 0 24px rgba(255, 45, 138, 0.3); }
  50% { box-shadow: 0 0 48px rgba(255, 45, 138, 0.6), 0 0 80px rgba(0, 229, 255, 0.2); }
}

.is-playing .player {
  animation: party-pulse 3s ease-in-out infinite;
}

@keyframes horn-bounce {
  0% { transform: translateY(-50%) scale(1); }
  20% { transform: translateY(-50%) scale(1.15) rotate(-5deg); }
  40% { transform: translateY(-50%) scale(0.95) rotate(3deg); }
  60% { transform: translateY(-50%) scale(1.05) rotate(-2deg); }
  100% { transform: translateY(-50%) scale(1); }
}

.horn-btn.is-bouncing {
  animation: horn-bounce 0.5s ease;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 640px) {
  :root {
    --logo-size: clamp(3rem, 14vw, 5rem);
    --logo-top: 8vh;
  }

  .party-horn { left: 0.6rem; }
  .horn-btn__text { display: none; }
  .horn-btn { padding: 0.4rem 0.5rem; }

  .categories { margin-top: 0.8rem; gap: 0.35rem; }
  .cat-pill { font-size: 0.7rem; padding: 0.3rem 0.7rem; }

  .dock { width: 98%; }

  .player { padding: 0.5rem 0.7rem; border-radius: 16px; }
  .disc { width: 2.8rem; height: 2.8rem; }
}

@media (max-width: 380px) {
  .controls { gap: 0.15rem; }
  .btn { padding: 0.35rem; }
  .btn--play { width: 2.6rem; height: 2.6rem; }
}
