:root{
  --top-safe: env(safe-area-inset-top, 0px);
  --bottom-safe: env(safe-area-inset-bottom, 0px);
  --side-safe: env(safe-area-inset-left, 0px);
  --hero-image-mobile: url('../assets/hero.png');
  --hero-image-desktop: url('../assets/hero-desktop.png');
}

*{box-sizing:border-box;}
html,body{
  margin:0; padding:0; width:100%; height:100%;
  overflow:hidden;
  background:#0a0a0c;
  font-family:'Segoe UI', -apple-system, BlinkMacSystemFont, 'Noto Sans Devanagari', Arial, sans-serif;
  color:#fff;
  -webkit-tap-highlight-color:transparent;
}

.hero{
  position:fixed; inset:0;
  width:100vw; height:100vh; height:100dvh;
  overflow:hidden;
  opacity:0;
  animation:heroFadeIn 1.1s ease forwards;
}
@keyframes heroFadeIn{ to{opacity:1;} }

.hero-bg{
  position:absolute; inset:0;
  background-image:var(--hero-image-mobile);
  background-size:cover;
  background-position:center 38%;
  background-repeat:no-repeat;
  background-color:#111;
  transform:scale(1.001);
}

@media (min-width:769px){
  .hero-bg{
    background-image:var(--hero-image-desktop);
  }
}

.hero-gradient{
  position:absolute; left:0; right:0; pointer-events:none; z-index:1;
}
.hero-gradient-top{
  top:0; height:26%;
  background:linear-gradient(to bottom, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.28) 55%, rgba(0,0,0,0) 100%);
}
.hero-gradient-bottom{
  bottom:0; height:32%;
  background:linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.35) 55%, rgba(0,0,0,0) 100%);
}

/* Corners */
.corner{
  position:absolute; z-index:5;
  display:flex; flex-direction:column; align-items:flex-start;
  gap:8px;
}
.corner-top-left{
  top:calc(18px + var(--top-safe));
  left:calc(16px + var(--side-safe));
  align-items:flex-start;
}
.corner-top-right{
  top:calc(18px + var(--top-safe));
  right:calc(16px + var(--side-safe));
  align-items:flex-end;
}
.corner-top-center{
  position:absolute; z-index:5;
  top:calc(18px + var(--top-safe));
  left:50%;
  transform:translateX(-50%);
}

.pill{
  display:flex; align-items:center; gap:6px;
  background:rgba(20,20,24,0.45);
  backdrop-filter:blur(14px) saturate(140%);
  -webkit-backdrop-filter:blur(14px) saturate(140%);
  border:1px solid rgba(255,255,255,0.14);
  border-radius:999px;
  padding:8px 14px;
  font-size:12.5px;
  font-weight:600;
  letter-spacing:0.02em;
  color:#fff;
  white-space:nowrap;
  text-decoration:none;
  box-shadow:0 4px 14px rgba(0,0,0,0.25);
}

.clock-pill{
  min-width:96px;
  justify-content:center;
  font-variant-numeric:tabular-nums;
}

.icon-row{ display:flex; gap:8px; }
.circle-btn{
  width:34px; height:34px;
  border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:rgba(20,20,24,0.45);
  backdrop-filter:blur(14px) saturate(140%);
  -webkit-backdrop-filter:blur(14px) saturate(140%);
  border:1px solid rgba(255,255,255,0.14);
  color:#fff;
  cursor:pointer;
  box-shadow:0 4px 14px rgba(0,0,0,0.25);
  transition:transform 0.15s ease;
}
.circle-btn:active{ transform:scale(0.9); }

.listeners-pill{
  font-weight:600; font-size:11.5px;
  gap:6px;
}
.live-dot{
  width:7px; height:7px; border-radius:50%;
  background:#ff3b30;
  box-shadow:0 0 0 0 rgba(255,59,48,0.6);
  animation:pulseDot 1.6s infinite;
  flex-shrink:0;
}
@keyframes pulseDot{
  0%{ box-shadow:0 0 0 0 rgba(255,59,48,0.55); }
  70%{ box-shadow:0 0 0 6px rgba(255,59,48,0); }
  100%{ box-shadow:0 0 0 0 rgba(255,59,48,0); }
}
#listenerCount{ display:inline-block; transition:opacity 0.25s ease, transform 0.25s ease; }
#listenerCount.tick{ opacity:0; transform:translateY(-3px); }

/* Center stage */
.center-stage{
  position:absolute; inset:0; z-index:4;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  text-align:center;
  padding:0 24px;
  gap:10px;
}
.tap-start{
  margin-top:22px;
  display:flex; align-items:center; gap:10px;
  background:rgba(255,255,255,0.95);
  color:#111;
  border:none;
  border-radius:999px;
  padding:14px 26px;
  font-size:14.5px;
  font-weight:700;
  cursor:pointer;
  box-shadow:0 8px 24px rgba(0,0,0,0.35);
  transition:opacity 0.5s ease, transform 0.3s ease, visibility 0.5s;
}
.tap-start:active{ transform:scale(0.96); }
.tap-start.hidden{
  opacity:0;
  pointer-events:none;
  visibility:hidden;
}

/* Player bar */
.player-bar{
  position:absolute; z-index:6;
  left:50%;
  bottom:calc(20px + var(--bottom-safe));
  transform:translateX(-50%) translateY(18px);
  width:min(94vw, 460px);
  background:rgba(18,18,22,0.55);
  backdrop-filter:blur(22px) saturate(160%);
  -webkit-backdrop-filter:blur(22px) saturate(160%);
  border:1px solid rgba(255,255,255,0.14);
  border-radius:26px;
  padding:12px 14px 10px;
  box-shadow:0 16px 40px rgba(0,0,0,0.45), 0 2px 8px rgba(0,0,0,0.3);
  opacity:0;
  pointer-events:none;
  transition:opacity 0.5s ease, transform 0.5s ease;
}
.player-bar.visible{
  opacity:1;
  transform:translateX(-50%) translateY(0);
  pointer-events:auto;
}

.player-inner{
  display:flex; align-items:center; gap:12px;
}

.art-wrap{
  width:50px; height:50px;
  border-radius:50%;
  flex-shrink:0;
  overflow:hidden;
  border:1.5px solid rgba(255,255,255,0.25);
  background:#222;
  box-shadow:0 2px 8px rgba(0,0,0,0.4);
}
.art{
  width:100%; height:100%;
  object-fit:cover;
  border-radius:50%;
  animation:spinArt 17s linear infinite;
  animation-play-state:paused;
}
.art.spinning{ animation-play-state:running; }

@keyframes spinArt{ from{transform:rotate(0deg);} to{transform:rotate(360deg);} }

.track-info{ flex:1; min-width:0; }
.track-title{
  font-size:13.5px; font-weight:700;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.track-artist{
  font-size:11.5px; color:rgba(255,255,255,0.65);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  margin-top:1px;
}

.progress-row{
  display:flex; align-items:center; gap:6px;
  margin-top:5px;
}
.time{
  font-size:9.5px; color:rgba(255,255,255,0.6);
  font-variant-numeric:tabular-nums;
  flex-shrink:0;
}
.seek{
  flex:1; height:14px;
  -webkit-appearance:none; appearance:none;
  background:transparent;
  cursor:pointer;
}
.seek::-webkit-slider-runnable-track{
  height:3px; border-radius:2px;
  background:rgba(255,255,255,0.28);
}
.seek::-webkit-slider-thumb{
  -webkit-appearance:none;
  width:11px; height:11px; border-radius:50%;
  background:#fff; margin-top:-4px;
  box-shadow:0 1px 4px rgba(0,0,0,0.4);
}
.seek::-moz-range-track{
  height:3px; border-radius:2px;
  background:rgba(255,255,255,0.28);
}
.seek::-moz-range-thumb{
  width:11px; height:11px; border-radius:50%;
  background:#fff; border:none;
}

.controls-row{
  display:flex; align-items:center; justify-content:center;
  gap:26px;
  margin-top:8px;
}
.ctrl-btn{
  background:none; border:none; color:#fff;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; padding:6px;
  opacity:0.85;
  transition:transform 0.15s ease, opacity 0.15s ease;
}
.ctrl-btn:active{ transform:scale(0.88); opacity:1; }
.ctrl-play{
  width:42px; height:42px;
  border-radius:50%;
  background:rgba(255,255,255,0.95);
  color:#111;
  opacity:1;
}
.ctrl-play:active{ transform:scale(0.9); }

/* Toast */
.toast{
  position:fixed;
  bottom:calc(120px + var(--bottom-safe));
  left:50%; transform:translateX(-50%) translateY(10px);
  background:rgba(20,20,24,0.9);
  color:#fff;
  padding:10px 18px;
  border-radius:999px;
  font-size:13px; font-weight:600;
  z-index:50;
  opacity:0;
  pointer-events:none;
  transition:opacity 0.3s ease, transform 0.3s ease;
  box-shadow:0 8px 24px rgba(0,0,0,0.4);
}
.toast.show{
  opacity:1;
  transform:translateX(-50%) translateY(0);
}

@media (min-width:900px){
  .corner-top-left{ left:calc(32px + var(--side-safe)); top:calc(28px + var(--top-safe)); }
  .corner-top-right{ right:calc(32px + var(--side-safe)); top:calc(28px + var(--top-safe)); }
  .corner-top-center{ top:calc(28px + var(--top-safe)); }
  .player-bar{ bottom:calc(32px + var(--bottom-safe)); }
}

@media (max-height:640px){
  .player-bar{ padding:10px 12px 8px; }
  .art-wrap{ width:42px; height:42px; }
}
