:root{
  color-scheme: dark;
  --radius-xl: 30px;
  --radius-lg: 20px;
  --radius-md: 12px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 22px;
  --ease-spring: cubic-bezier(.32,1.35,.5,1);
  --ease-out: cubic-bezier(.22,1,.36,1);
  --dur-fast: 130ms;
  --dur-med: 280ms;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --panel-fill: rgba(12, 10, 8, 0.52);
  --panel-border: rgba(255, 255, 255, 0.13);
  --panel-highlight: rgba(255, 255, 255, 0.09);
  --panel-shadow: rgba(0, 0, 0, 0.7);

  --text-primary: rgba(252, 250, 248, 0.97);
  --text-secondary: rgba(252, 250, 248, 0.65);
  --text-tertiary: rgba(252, 250, 248, 0.40);

  --track-inactive: rgba(255, 255, 255, 0.18);
  --track-active: rgba(255, 255, 255, 0.92);

  --play-fill: rgba(255, 255, 255, 0.90);
  --play-fill-hover: rgba(255, 255, 255, 0.98);
  --play-border: rgba(255, 255, 255, 0.60);
  --play-icon: rgba(14, 12, 10, 0.92);

  --focus-ring: rgba(255, 205, 150, 0.85);
  --row-active: rgba(255, 255, 255, 0.10);
  --accent-active: rgba(255, 210, 160, 0.95);
}

*{ box-sizing: border-box; }
html, body{ height: 100%; margin: 0; }
body{
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  color: var(--text-primary);
  overflow: hidden;
  min-height: 100vh;
  position: relative;
  background: #050505;
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------------- DEVICE-ADAPTIVE BACKGROUND IMAGES ---------------- */
.media-bg{
  position: fixed;
  inset: -28px;
  width: calc(100vw + 56px);
  height: calc(100vh + 56px);
  background-size: cover;
  background-position: center center;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
  transform: translate3d(0, 0, 0) scale(1.05);
}
.media-bg.active{
  opacity: 1;
}

/* Default Landscape Assets (Desktop / Tablet / Landscape Phone) */
/* WebP: ~90% smaller than original PNGs, same visual quality */
.media-bg.night-bg{
  background-image: url('file_00000000e0788211a56c630b38332e60.webp');
}
.media-bg.day-bg{
  background-image: url('file_00000000cd848207a1e3b85b6c84d365.webp');
}

/* Mobile Portrait Screen Overrides (Portrait Phone <= 767px) */
@media (max-width: 767px) and (orientation: portrait) {
  .media-bg.night-bg{
    background-image: url('mobile-night.webp');
  }
  .media-bg.day-bg{
    background-image: url('mobile-day.webp');
  }
}

.media-scrim{
  position: fixed; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.1) 30%, rgba(0,0,0,0) 65%),
              linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, transparent 40%);
  z-index: 1;
  pointer-events: none;
}
.media-caption{
  position: fixed;
  top: 16px;
  left: 20px;
  line-height: 36px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  font-weight: 600;
  z-index: 10;
}

/* ============================================================
   AMBIENT DISCO LIGHTS & FLOATING BHOJPURI TYPOGRAPHY
   Z-INDEX HIERARCHY:
   Background (0) -> Scrim (1) -> Disco Lights (2) -> Floating Text (4) -> Media HUD (10)
============================================================ */
.disco-ambience-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
  opacity: 1;
  transition: opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.disco-ambience-layer.fade-out {
  opacity: 0;
}
.disco-light-spot {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  mix-blend-mode: screen;
  will-change: transform, opacity;
}
.disco-light-spot.spot-1 {
  top: -10%;
  left: 10%;
  width: 45vw;
  height: 45vw;
  max-width: 600px;
  max-height: 600px;
  background: radial-gradient(circle, rgba(255, 0, 128, 0.22) 0%, rgba(255, 0, 128, 0.05) 55%, transparent 70%);
  animation: discoPulse1 7s ease-in-out infinite alternate;
}
.disco-light-spot.spot-2 {
  top: 20%;
  right: -5%;
  width: 50vw;
  height: 50vw;
  max-width: 650px;
  max-height: 650px;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.18) 0%, rgba(0, 150, 255, 0.04) 55%, transparent 70%);
  animation: discoPulse2 9s ease-in-out infinite alternate;
}
.disco-light-spot.spot-3 {
  bottom: 15%;
  left: 30%;
  width: 40vw;
  height: 40vw;
  max-width: 550px;
  max-height: 550px;
  background: radial-gradient(circle, rgba(255, 230, 0, 0.14) 0%, rgba(255, 120, 0, 0.03) 55%, transparent 70%);
  animation: discoPulse3 8s ease-in-out infinite alternate;
}

@keyframes discoPulse1 {
  0%   { transform: translate3d(0, 0, 0) scale(0.9); opacity: 0.6; }
  100% { transform: translate3d(5vw, 4vh, 0) scale(1.15); opacity: 0.95; }
}
@keyframes discoPulse2 {
  0%   { transform: translate3d(0, 0, 0) scale(1.1); opacity: 0.85; }
  100% { transform: translate3d(-6vw, 5vh, 0) scale(0.9); opacity: 0.55; }
}
@keyframes discoPulse3 {
  0%   { transform: translate3d(0, 0, 0) scale(0.85); opacity: 0.5; }
  100% { transform: translate3d(4vw, -4vh, 0) scale(1.2); opacity: 0.9; }
}

/* ---------------- FLOATING DISCO CONTAINER ---------------- */
.floating-disco-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  overflow: hidden;
  opacity: 1;
  transition: opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1);
  -webkit-user-select: none;
  user-select: none;
}
.floating-disco-container.fade-out {
  opacity: 0;
}

/* ---------------- FLOATING TEXT ELEMENT (PLAIN WHITE ON LIQUID GLASS) ---------------- */
.floating-disco-text {
  position: absolute;
  top: 0;
  left: 0;
  white-space: nowrap;
  pointer-events: none;
  font-family: var(--font-ui), 'Inter', -apple-system, sans-serif;
  font-weight: 700;
  letter-spacing: 0.015em;
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
  background: rgba(14, 11, 9, 0.55);
  -webkit-backdrop-filter: blur(28px) saturate(1.8);
  backdrop-filter: blur(28px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 9999px;
  padding: 8px 18px;
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.24) inset,
    0 12px 32px -8px rgba(0, 0, 0, 0.7);
  will-change: transform, opacity;
  transform: translate3d(var(--start-x, 0), var(--start-y, 0), 0) rotate(var(--rot-start, 0deg)) scale(var(--scale-start, 1));
  animation: discoFloat var(--anim-dur, 6.5s) cubic-bezier(0.22, 1, 0.36, 1) forwards;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1.2;
}

@media (max-width: 767px) {
  .floating-disco-text {
    padding: 6px 14px;
    border-radius: 9999px;
  }
}

/* ---------------- SIZES (DESKTOP DEFAULT — COMPACT & SLEEK) ---------------- */
.floating-disco-text.size-lg {
  font-size: clamp(17px, 1.7vw, 22px);
}
.floating-disco-text.size-md {
  font-size: clamp(14px, 1.35vw, 17px);
}
.floating-disco-text.size-sm {
  font-size: clamp(12px, 1.1vw, 14.5px);
}

/* ---------------- DEPTH EFFECT ---------------- */
.floating-disco-text.depth-near {
  --target-opacity: 0.96;
  filter: drop-shadow(0 4px 14px rgba(0,0,0,0.75));
}
.floating-disco-text.depth-mid {
  --target-opacity: 0.85;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.6));
}
.floating-disco-text.depth-far {
  --target-opacity: 0.68;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

/* ---------------- DISCO FLOAT KEYFRAMES (6-7S LIVE DURATION) ---------------- */
@keyframes discoFloat {
  0% {
    opacity: 0;
    transform: translate3d(var(--start-x), var(--start-y), 0) rotate(var(--rot-start)) scale(var(--scale-start));
  }
  8% {
    opacity: var(--target-opacity, 0.96);
  }
  88% {
    opacity: var(--target-opacity, 0.96);
  }
  100% {
    opacity: 0;
    transform: translate3d(calc(var(--start-x) + var(--drift-x)), calc(var(--start-y) + var(--drift-y)), 0) rotate(var(--rot-end)) scale(var(--scale-end));
  }
}

/* ---------------- RESPONSIVE MOBILE SIZING (COMPACT) ---------------- */
@media (max-width: 767px) {
  .floating-disco-text.size-lg {
    font-size: clamp(13px, 3.5vw, 16px);
  }
  .floating-disco-text.size-md {
    font-size: clamp(11.5px, 3.0vw, 13.5px);
  }
  .floating-disco-text.size-sm {
    font-size: clamp(10.5px, 2.6vw, 12px);
  }
}

/* ---------------- TOP RIGHT LIQUID GLASS ACTION CLUSTER ---------------- */
.top-header-cluster {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10000;
}

/* ---------------- INSTAGRAM PROFILE BADGE ---------------- */
.instagram-btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 20px;
  background: var(--panel-fill);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--panel-border);
  box-shadow: 
    0 1px 0 0 rgba(255,255,255,0.08) inset,
    0 8px 24px -4px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  outline: none;
  transition: transform var(--dur-fast) var(--ease-spring), background var(--dur-fast) var(--ease-out), border-color 0.2s ease, box-shadow 0.2s ease;
}

.instagram-btn .ig-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f43f5e;
  transition: transform 0.2s var(--ease-spring);
}

.instagram-btn:hover {
  background: rgba(225, 48, 108, 0.16);
  border-color: rgba(225, 48, 108, 0.5);
  color: #ffffff;
  box-shadow: 0 0 18px -2px rgba(225, 48, 108, 0.45), 0 8px 24px -4px rgba(0,0,0,0.6);
  transform: translateY(-1px) scale(1.04);
}

.instagram-btn:hover .ig-icon-wrap {
  transform: scale(1.15) rotate(-6deg);
  color: #ff3377;
}

.instagram-btn:active {
  transform: scale(0.97);
}

.instagram-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

/* ---------------- REAL-TIME ONLINE USERS BADGE ---------------- */
.online-users-badge{
  position: static;
  height: 36px;
  padding: 0 14px;
  border-radius: 20px;
  background: var(--panel-fill);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--panel-border);
  box-shadow: 
    0 1px 0 0 rgba(255,255,255,0.08) inset,
    0 8px 24px -4px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  user-select: none;
}
.pulse-dot{
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: greenPulse 1.8s infinite cubic-bezier(0.66, 0, 0, 1);
  flex-shrink: 0;
}
@keyframes greenPulse{
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.8);
    transform: scale(0.95);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    transform: scale(1.1);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    transform: scale(0.95);
  }
}
.online-count{
  font-weight: 700;
  font-size: 13px;
  color: #10b981;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.online-label{
  color: var(--text-primary);
  font-weight: 500;
  font-size: 12px;
}

/* ---------------- FULL SCREEN RIPPLE OVERLAY ---------------- */
.ripple-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #0b0908;
  clip-path: circle(0% at var(--ripple-x, 95%) var(--ripple-y, 5%));
  transition: clip-path 0.85s cubic-bezier(0.77, 0, 0.175, 1);
  pointer-events: none;
}
.ripple-overlay.active {
  clip-path: circle(150% at var(--ripple-x, 95%) var(--ripple-y, 5%));
  pointer-events: auto;
}

/* ---------------- TOP RIGHT THEME TOGGLE ---------------- */
.theme-toggle {
  position: static !important;
  height: 36px;
  padding: 0 14px;
  border-radius: 20px;
  background: var(--panel-fill);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--panel-border);
  box-shadow: 
    0 1px 0 0 rgba(255,255,255,0.08) inset,
    0 8px 24px -4px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-spring), background var(--dur-fast) var(--ease-out);
}
.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px) scale(1.05);
}
.theme-icon-wrap {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle svg {
  width: 16px;
  height: 16px;
  color: var(--text-primary);
}

/* ---------------- VIBING CAT COMPONENT ---------------- */
.vibing-cat-wrap {
  position: absolute;
  bottom: 100%; /* Sits directly on the top edge of the media controller */
  right: 36px;
  height: 125px; /* Desktop target: 110–150px */
  width: auto;
  aspect-ratio: 1 / 1;
  pointer-events: none;
  z-index: 5;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  margin-bottom: -3px; /* Seamless integration with the HUD top border */
}

.vibing-cat-img,
.vibing-cat-canvas {
  height: 100%;
  width: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
  pointer-events: none;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.45));
}

.vibing-cat-canvas {
  display: none;
}

/* ---------------- HUD WRAPPER & MAIN CARD ---------------- */
.hud-wrap{
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: min(900px, calc(100vw - 32px));
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.hud{
  width: 100%;
  padding: 16px 20px 14px;
  border-radius: var(--radius-xl);
  background: var(--panel-fill);
  -webkit-backdrop-filter: blur(34px) saturate(1.65);
  backdrop-filter: blur(34px) saturate(1.65);
  border: 1px solid var(--panel-border);
  box-shadow:
    0 1px 0 0 var(--panel-highlight) inset,
    0 -1px 0 0 rgba(255, 255, 255, 0.04) inset,
    0 24px 54px -18px var(--panel-shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hud-main{
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

/* ---------------- MEDIA INFO (left) ---------------- */
.media-info{
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}
.thumb{
  flex-shrink: 0;
  width: 48px; height: 48px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  background-color: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 4px 10px -4px rgba(0,0,0,0.6);
  transition: opacity var(--dur-med) var(--ease-out), transform var(--dur-med) var(--ease-spring);
}
.thumb:hover { transform: scale(1.05); }
.info-text{
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.info-source{
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.info-title{
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
  transition: opacity var(--dur-med) var(--ease-out);
}
.info-sub-row{
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.info-subtitle{
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  transition: opacity var(--dur-med) var(--ease-out);
}

/* waveform activity indicator */
.waveform{
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 11px;
  flex-shrink: 0;
}
.waveform .bar{
  width: 2.2px;
  border-radius: 2px;
  background: var(--text-tertiary);
  height: 3px;
  animation: waveMove 900ms ease-in-out infinite;
  animation-play-state: paused;
}
.waveform.playing .bar{ animation-play-state: running; background: var(--text-secondary); }
.waveform .bar:nth-child(1){ animation-delay: 0ms; }
.waveform .bar:nth-child(2){ animation-delay: 120ms; }
.waveform .bar:nth-child(3){ animation-delay: 240ms; }
.waveform .bar:nth-child(4){ animation-delay: 90ms; }
.waveform .bar:nth-child(5){ animation-delay: 200ms; }
@keyframes waveMove{
  0%, 100%{ height: 3px; }
  50%{ height: 11px; }
}

/* Transport groups */
.transport{
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.secondary-controls{
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* ---- universal pop-capable control ---- */
.pop-btn{
  background: transparent;
  border: none;
  color: var(--text-primary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  position: relative;
  outline: none;
  transition: transform var(--dur-fast) var(--ease-spring), background 140ms var(--ease-out), box-shadow 160ms var(--ease-out), color 140ms var(--ease-out);
}
.pop-btn:hover{ background: rgba(255,255,255,0.10); box-shadow: 0 4px 14px -6px rgba(0,0,0,0.5); transform: translateY(-1px) scale(1.07); }
.pop-btn:focus-visible{ outline: 2px solid var(--focus-ring); outline-offset: 3px; }

@keyframes popRun{
  0%{ transform: scale(1); }
  28%{ transform: scale(0.92); }
  62%{ transform: scale(1.04); }
  100%{ transform: scale(1); }
}
.pop-btn.springing { animation: popRun 260ms var(--ease-out); }

.ctrl-btn{
  width: 32px; height: 32px;
  border-radius: 50%;
}
.ctrl-btn svg{ width: 16px; height: 16px; }

.ctrl-btn[aria-pressed="true"]{ color: var(--accent-active); background: rgba(255,255,255,0.08); }
.ctrl-btn[aria-pressed="true"]::after{
  content: "";
  position: absolute;
  bottom: 4px;
  width: 3.5px; height: 3.5px;
  border-radius: 50%;
  background: var(--accent-active);
}

.skip-btn{ position: relative; width: 32px; height: 32px; border-radius: 50%; }
.skip-btn svg{
  width: 24px;
  height: 24px;
  opacity: 0.85;
  transition: transform 0.2s var(--ease-spring);
}
.skip-btn:hover svg{
  opacity: 1;
}
.skip-btn .skip-label{
  position: absolute;
  font-size: 8px;
  font-weight: 700;
  top: 52%; left: 50%;
  transform: translate(-50%,-50%);
  pointer-events: none;
  letter-spacing: -0.02em;
  color: var(--text-secondary);
}

@keyframes skipspin-rewind{
  0% { transform: rotate(0deg); }
  50% { transform: rotate(-30deg); }
  100% { transform: rotate(0deg); }
}
@keyframes skipspin-forward{
  0% { transform: scaleX(-1) rotate(0deg); }
  50% { transform: scaleX(-1) rotate(-30deg); }
  100% { transform: scaleX(-1) rotate(0deg); }
}
.skip-btn.springing #rewindSvg { animation: skipspin-rewind 260ms var(--ease-out); }
.skip-btn.springing #forwardSvg { animation: skipspin-forward 260ms var(--ease-out); }
.skip-btn.springing .skip-label { animation: skipLabelFlash 260ms var(--ease-out); }
@keyframes skipLabelFlash{
  0%{ color: var(--accent-active); }
  100%{ color: var(--text-secondary); }
}

.play-btn-wrap{
  position: relative;
  width: 54px; height: 54px;
  flex-shrink: 0;
}
.buffer-ring{
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0%, rgba(255,255,255,0.85) 18%, transparent 40%);
  opacity: 0;
  animation: spin 900ms linear infinite;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  pointer-events: none;
}
.play-btn-wrap.buffering .buffer-ring { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

.play-btn{
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 1px solid var(--play-border);
  background: var(--play-fill);
  box-shadow:
    0 1px 0 0 rgba(255,255,255,0.6) inset,
    0 10px 24px -8px rgba(0,0,0,0.55);
  color: var(--play-icon);
}
.play-btn svg{ width: 20px; height: 20px; }
.play-btn:hover{ background: var(--play-fill-hover); transform: scale(1.08); }

@keyframes popRunStrong{
  0%{ transform: scale(1); }
  28%{ transform: scale(0.93); }
  62%{ transform: scale(1.04); }
  100%{ transform: scale(1); }
}
.play-btn.springing { animation: popRunStrong 300ms var(--ease-out); }
.play-btn svg { transition: opacity 160ms var(--ease-out); }

.divider{
  width: 1px;
  height: 24px;
  background: rgba(255,255,255,0.14);
  flex-shrink: 0;
}

/* Volume (collapsible expand on hover) */
.volume-group{
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  width: 32px;
  overflow: hidden;
  transition: width 0.3s var(--ease-spring), gap 0.3s var(--ease-spring);
}
.volume-group:hover, .volume-group:focus-within {
  width: 110px;
  gap: 6px;
}
.icon-toggle{
  width: 32px; height: 32px;
  border-radius: 50%;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.icon-toggle svg{ width: 16px; height: 16px; }
.icon-toggle:hover{ color: var(--text-primary); }

.mini-slider{
  position: relative;
  width: 0;
  opacity: 0;
  height: 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
  pointer-events: none;
  transition: width 0.3s var(--ease-spring), opacity 0.2s ease;
}
.volume-group:hover .mini-slider, .volume-group:focus-within .mini-slider {
  width: 66px;
  opacity: 1;
  pointer-events: auto;
}
.mini-slider .rail{
  position: absolute; left: 0; right: 0; top: 50%;
  height: 3px; border-radius: 2px;
  background: var(--track-inactive);
  transform: translateY(-50%);
}
.mini-slider .fill{
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 70%;
  background: var(--track-active);
  border-radius: 2px;
}
.mini-slider .vol-thumb{
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
  transform: translate(-50%, -50%);
  top: 50%;
  left: 70%;
  pointer-events: none;
}
.mini-slider input[type=range] {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
  margin: 0; padding: 0;
}
.mini-slider input[type=range]:focus-visible ~ .rail {
  outline: 2px solid var(--focus-ring);
  outline-offset: 4px;
}

/* ---------------- PROGRESS ROW & SEEK ---------------- */
.progress-row{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.time-label{
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text-tertiary);
  font-weight: 500;
  flex-shrink: 0;
  min-width: 32px;
}
.time-label.end { text-align: right; }

.seek{
  position: relative;
  flex: 1;
  height: 20px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}
.seek .rail{
  position: absolute; left: 0; right: 0; top: 50%;
  height: 3px; border-radius: 2px;
  background: var(--track-inactive);
  transform: translateY(-50%);
  transition: height 150ms var(--ease-out);
}
.seek:hover .rail { height: 5px; }
.seek .fill{
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 0%;
  background: var(--track-active);
  border-radius: 2px;
}
.seek-thumb{
  position: absolute;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
  transform: translate(-50%, -50%) scale(0);
  top: 50%; left: 0%;
  transition: transform 150ms var(--ease-spring);
  pointer-events: none;
}
.seek:hover .seek-thumb, .seek.dragging .seek-thumb { transform: translate(-50%, -50%) scale(1.3); }
.seek input[type=range] {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
  margin: 0; padding: 0;
}
.seek input[type=range]:focus-visible ~ .rail {
  outline: 2px solid var(--focus-ring);
  outline-offset: 4px;
  height: 5px;
}
.seek input[type=range]:focus-visible ~ .seek-thumb {
  transform: translate(-50%, -50%) scale(1.3);
}

.status-line{
  font-size: 11px;
  color: var(--text-tertiary);
  text-align: center;
  min-height: 15px;
}
.status-line.is-error{ color: rgba(255, 160, 140, 0.9); }

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

/* ---------------- PLAYLIST PANEL ---------------- */
.playlist-panel{
  position: absolute;
  bottom: calc(100% + 14px);
  right: 0;
  width: min(380px, 92vw);
  max-height: min(58vh, 460px);
  transform: translateY(10px) scale(0.94);
  transform-origin: bottom right;
  opacity: 0;
  pointer-events: none;
  border-radius: var(--radius-lg);
  background: var(--panel-fill);
  -webkit-backdrop-filter: blur(34px) saturate(1.65);
  backdrop-filter: blur(34px) saturate(1.65);
  border: 1px solid var(--panel-border);
  box-shadow:
    0 1px 0 0 var(--panel-highlight) inset,
    0 24px 54px -18px var(--panel-shadow);
  display: flex;
  flex-direction: column;
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-spring);
}
.playlist-panel.open{
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.playlist-header{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 16px 18px 10px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.playlist-title{
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.playlist-count{
  font-size: 11px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}
.playlist-list{
  overflow-y: auto;
  padding: 2px 8px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.25) transparent;
}
.playlist-list::-webkit-scrollbar{ width: 6px; }
.playlist-list::-webkit-scrollbar-thumb{ background: rgba(255,255,255,0.22); border-radius: 4px; }
.playlist-list::-webkit-scrollbar-track{ background: transparent; }

.song-row{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  color: var(--text-primary);
  font-family: inherit;
  transition: background 140ms var(--ease-out), transform 140ms var(--ease-spring);
}
.song-row:hover{ background: rgba(255,255,255,0.08); transform: translateY(-1px) scale(1.01); }
.song-row:hover .song-thumb{ transform: scale(1.04); }
.song-row:active{ transform: scale(0.99); }
.song-row:focus-visible{ outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.song-row.active{ background: var(--row-active); }
.song-thumb{
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  background-color: rgba(255,255,255,0.08);
  transition: transform 160ms var(--ease-spring);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.song-meta{
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.song-title{
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
}
.song-row.active .song-title{ color: var(--text-primary); font-weight: 600; }
.song-artist{
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.song-dur{
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text-tertiary);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.active-dot{
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-active);
  box-shadow: 0 0 6px var(--accent-active);
  flex-shrink: 0;
  display: none;
  animation: pulseDot 1.2s infinite ease-in-out;
}
.song-row.active .active-dot{ display: block; }
@keyframes pulseDot {
  0% { transform: scale(0.8); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.8); opacity: 0.5; }
}

.new-tag{
  display: inline-block;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 1px 5px;
  border-radius: 5px;
  margin-left: 6px;
  vertical-align: middle;
  transition: opacity 0.3s ease;
}

.playlist-skel{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
}
.skel-box{
  background: linear-gradient(100deg, rgba(255,255,255,0.06) 30%, rgba(255,255,255,0.14) 50%, rgba(255,255,255,0.06) 70%);
  background-size: 200% 100%;
  animation: skelShimmer 1.3s ease-in-out infinite;
  border-radius: 8px;
}
@keyframes skelShimmer{
  0%{ background-position: 200% 0; }
  100%{ background-position: -200% 0; }
}

/* ---------------- RESPONSIVE BREAKPOINTS ---------------- */

/* TABLET BREAKPOINT (768px – 1199px) */
@media (min-width: 768px) and (max-width: 1199px) {
  .hud-wrap { width: min(840px, calc(100vw - 32px)); bottom: max(20px, env(safe-area-inset-bottom)); }
  .vibing-cat-wrap { right: 28px; height: 110px; }
  .info-title { max-width: 180px; }
  .info-subtitle { max-width: 130px; }
  .playlist-panel { width: min(380px, calc(100vw - 32px)); }
}

/* MOBILE BREAKPOINT (<= 767px) */
@media (max-width: 767px) {
  .top-header-cluster {
    top: 10px;
    right: 10px;
    left: 10px;
    justify-content: space-between;
    gap: 6px;
  }
  .instagram-btn {
    padding: 0 10px;
    font-size: 10.5px;
    height: 32px;
  }
  .online-users-badge {
    padding: 0 10px;
    height: 32px;
    font-size: 11px;
  }
  .online-label {
    display: none;
  }
  .theme-toggle {
    padding: 0 10px;
    height: 32px;
  }
  .theme-label-text {
    display: none;
  }
  .hud-wrap {
    width: calc(100vw - 20px);
    bottom: max(12px, env(safe-area-inset-bottom));
  }
  .vibing-cat-wrap {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    bottom: 100%;
    height: 82px;
    margin-bottom: -2px;
  }
  .hud {
    padding: 12px 14px;
    border-radius: 24px;
    gap: 8px;
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    backdrop-filter: blur(20px) saturate(1.4);
  }
  .hud-main {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .media-info {
    width: 100%;
    order: 1;
    flex-basis: 100%;
    gap: 10px;
  }
  .thumb {
    width: 42px;
    height: 42px;
    border-radius: 8px;
  }
  .info-title {
    max-width: calc(100vw - 120px);
    font-size: 13.5px;
  }
  .info-subtitle {
    max-width: calc(100vw - 170px);
    font-size: 11.5px;
  }
  .transport {
    order: 2;
    margin: 0 auto;
    gap: 4px;
  }
  .secondary-controls {
    order: 3;
    width: 100%;
    justify-content: center;
    margin: 4px auto 0;
    gap: 12px;
  }
  .divider { display: none; }
  
  /* Touch target sizes (min 44px x 44px) */
  .pop-btn {
    min-width: 44px;
    min-height: 44px;
  }
  .ctrl-btn {
    width: 44px;
    height: 44px;
  }
  .skip-btn {
    width: 44px;
    height: 44px;
  }
  .play-btn-wrap {
    width: 48px;
    height: 48px;
  }
  .play-btn svg {
    width: 18px;
    height: 18px;
  }
  
  /* Playlist Panel on Mobile */
  .playlist-panel {
    width: calc(100vw - 20px);
    max-height: min(65vh, 420px);
    right: 50%;
    transform: translateX(50%) translateY(12px) scale(0.95);
    transform-origin: bottom center;
  }
  .playlist-panel.open {
    transform: translateX(50%) translateY(0) scale(1);
  }

  /* Header Controls Safe Area & Alignment */
  .theme-toggle {
    top: max(12px, env(safe-area-inset-top)) !important;
    right: max(12px, env(safe-area-inset-right)) !important;
    left: auto !important;
    padding: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    justify-content: center;
  }
  .theme-label-text {
    display: none;
  }
  .online-users-badge {
    right: calc(max(12px, env(safe-area-inset-right)) + 52px);
    top: max(12px, env(safe-area-inset-top));
    height: 44px;
    padding: 0 12px;
    font-size: 11px;
    gap: 6px;
  }
  .online-count {
    font-size: 11.5px;
  }
  .online-label {
    font-size: 11px;
  }
  .media-caption {
    top: max(12px, env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
    line-height: 44px;
    font-size: 10px;
  }
}

/* PHONE LANDSCAPE (max-height: 500px) */
@media (max-height: 500px) and (orientation: landscape) {
  .hud-wrap {
    bottom: max(6px, env(safe-area-inset-bottom));
    width: min(720px, calc(100vw - 20px));
  }
  .hud {
    padding: 6px 12px;
    gap: 4px;
  }
  .media-info { width: auto; order: 1; flex-basis: auto; }
  .transport { order: 2; margin: 0; }
  .secondary-controls { order: 3; margin-left: auto; }
  .thumb { width: 34px; height: 34px; }
  .info-title { max-width: 140px; font-size: 12px; }
  .info-subtitle { max-width: 90px; font-size: 10px; }
  .play-btn-wrap { width: 40px; height: 40px; }
  .ctrl-btn, .skip-btn { width: 36px; height: 36px; min-width: 36px; min-height: 36px; }
  .waveform { display: none; }
}

@media (max-width: 360px) {
  .waveform { display: none; }
  .online-label { display: none; }
}

/* ---------------- YOUTUBE AUDIO ENGINE WRAPPER ---------------- */
/*
 * IMPORTANT: Do NOT use CSS transform on this element.
 * CSS transforms on a parent container break YouTube's internal
 * ResizeObserver / IntersectionObserver, causing the player to
 * silently fail initialization on Chromium browsers (Vercel/prod).
 * Use left: -9999px for safe offscreen placement instead.
 */
#youtubePlayerWrap {
  position: fixed;
  top: -9999px;
  left: -9999px;
  width: 320px;
  height: 240px;
  opacity: 0;
  pointer-events: none;
  z-index: -999;
  visibility: visible; /* must stay visible for browser to allow playback */
}
#youtubePlayerWrap iframe,
#youtubePlayerWrap > div {
  width: 320px !important;
  height: 240px !important;
}
