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

:root {
  --bg:           #0c0909;
  --card:         #120e0e;
  --gold:         #c49a3c;
  --gold-dim:     #7a5e25;
  --gold-faint:   #3a2c12;
  --text:         #ede0c8;
  --text-sub:     #a08870;
  --text-muted:   #6a5040;
  --border:       #231618;
  --progress-bg:  #231618;
}

html {
  font-size: 16px;
  background-color: var(--bg);
  background-image: url('bg.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

html, body {
  height: 100%;
  min-height: 100vh;
  color: var(--text);
  font-family: 'EB Garamond', Georgia, serif;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

/* dark tint over the photo so text stays readable */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(0,0,0,0.88), rgba(0,0,0,0.88)),
    radial-gradient(ellipse 70% 70% at 50% 50%, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
  z-index: 0;
}

/* subtle grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

/* ── Player ── */
.player {
  position: relative;
  z-index: 1;
  width: min(480px, 92vw);
  text-align: center;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1.5rem, 5vw, 2.5rem) 2.5rem;
}

/* ── Action row (playlist + parwana) ── */
.action-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 1.2rem;
}

.action-divider {
  width: 1px;
  align-self: stretch;
  background: var(--border);
  flex-shrink: 0;
}

.action-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: var(--text-sub);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: clamp(0.82rem, 2vw, 0.9rem);
  letter-spacing: 0.15em;
  cursor: pointer;
  padding: 0.7rem 1rem;
  transition: background 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.action-btn svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
  flex-shrink: 0;
}

.action-btn:hover {
  background: rgba(196,154,60,0.07);
  color: var(--text);
}

.action-btn--parwana {
  color: var(--gold-dim);
}

.action-btn--parwana:hover {
  color: var(--gold);
  background: rgba(196,154,60,0.1);
}

/* ── Humnashin counter ── */
.humnashin-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: clamp(0.72rem, 1.8vw, 0.78rem);
  color: var(--text-sub);
  letter-spacing: 0.15em;
  font-style: italic;
  margin-bottom: 0.8rem;
  min-height: 1.1rem;
  opacity: 0.5;
  transition: opacity 0.6s;
}

.humnashin-row.visible { opacity: 1; }

.humnashin-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
  box-shadow: 0 0 6px var(--gold);
  animation: hum-pulse 2.5s ease-in-out infinite;
}

@keyframes hum-pulse {
  0%, 100% { opacity: 0.5; transform: scale(1);   box-shadow: 0 0 4px var(--gold); }
  50%       { opacity: 1;   transform: scale(1.4); box-shadow: 0 0 10px var(--gold); }
}

/* ── Brand ── */
.brand {
  font-size: clamp(0.65rem, 1.5vw, 0.75rem);
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.4rem;
}

.brand-urdu {
  font-size: clamp(1.3rem, 4vw, 1.6rem);
  color: var(--gold-dim);
  margin-bottom: 0.3rem;
  line-height: 1;
}

.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.2rem auto 2rem;
  width: 60%;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gold-faint);
}

.divider-gem {
  font-size: 0.5rem;
  color: var(--gold-dim);
}

/* ── Track info ── */
.track-title {
  font-size: clamp(1.4rem, 4.5vw, 1.9rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 0.4rem;
  min-height: 2.5rem;
  transition: opacity 0.4s;
}

.track-artist {
  font-size: clamp(0.75rem, 1.8vw, 0.82rem);
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-bottom: clamp(1.8rem, 4vw, 2.8rem);
  min-height: 1.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
  position: relative;
}

.track-artist[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1c1515;
  border: 1px solid var(--border);
  color: var(--text-sub);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  padding: 0.4rem 0.8rem;
  white-space: nowrap;
  border-radius: 2px;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

/* ── Progress ── */
.progress-wrap {
  padding: 10px 0;
  margin: -10px 0 0;
  cursor: pointer;
}

.progress-bar {
  height: 2px;
  background: var(--progress-bg);
  border-radius: 1px;
  position: relative;
  margin-bottom: 0.6rem;
  transition: height 0.15s;
}

.progress-wrap:hover .progress-bar { height: 3px; }

.progress-fill {
  height: 100%;
  background: linear-gradient(to right, var(--gold-dim), var(--gold));
  border-radius: 1px;
  width: 0%;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0;
  transition: opacity 0.2s;
  box-shadow: 0 0 8px var(--gold);
}

.progress-wrap:hover .progress-fill::after { opacity: 1; }

.time-row {
  display: flex;
  justify-content: space-between;
  font-size: clamp(0.72rem, 1.8vw, 0.8rem);
  color: var(--text-sub);
  font-family: 'Courier New', monospace;
  letter-spacing: 0.04em;
  margin-bottom: clamp(1.6rem, 4vw, 2.2rem);
}

/* ── Controls ── */
.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1.8rem, 5vw, 2.8rem);
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.ctrl-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
}

.ctrl-btn:hover  { color: var(--gold); }
.ctrl-btn:active { transform: scale(0.88); }
.ctrl-btn svg    { width: 1.3em; height: 1.3em; fill: currentColor; }

.play-btn {
  color: var(--text);
  width: clamp(3.4rem, 9vw, 4rem);
  height: clamp(3.4rem, 9vw, 4rem);
  border: 1px solid var(--border) !important;
  border-radius: 50%;
  background: var(--card) !important;
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.1s;
}

.play-btn:hover {
  color: var(--gold);
  border-color: var(--gold-dim) !important;
  box-shadow: 0 0 20px rgba(196,154,60,0.14);
}

/* ── Hints ── */
.hints {
  font-size: clamp(0.68rem, 1.6vw, 0.74rem);
  color: var(--text-muted);
  letter-spacing: 0.1em;
  opacity: 0.65;
  line-height: 1.9;
}


/* ── Loading state ── */
.loading .track-title,
.loading .track-artist { opacity: 0.3; }

@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 0.55; }
}

.loading .track-title,
.loading .track-artist { animation: pulse 2s ease-in-out infinite; }

/* ── Playlist backdrop ── */
.playlist-backdrop {
  position: fixed;
  inset: 0;
  z-index: 19;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.playlist-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

/* ── Playlist panel (right drawer) ── */
.playlist-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(380px, 100vw);
  z-index: 20;
  background: #100c0c;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.playlist-panel.open { transform: translateX(0); }

.playlist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.playlist-heading {
  font-size: clamp(0.7rem, 1.8vw, 0.78rem);
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: var(--gold);
}

.playlist-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.playlist-close:hover { color: var(--text); }
.playlist-close svg   { width: 1.2em; height: 1.2em; fill: currentColor; }

.playlist-list {
  overflow-y: auto;
  flex: 1;
  padding: 0.5rem 0 2rem;
}

.playlist-list::-webkit-scrollbar       { width: 3px; }
.playlist-list::-webkit-scrollbar-track { background: transparent; }
.playlist-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.playlist-item {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  cursor: pointer;
  transition: background 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: 'EB Garamond', Georgia, serif;
}

.playlist-item:hover { background: rgba(196,154,60,0.06); }

.playlist-item.active .pi-num,
.playlist-item.active .pi-title { color: var(--gold); }

.pi-num {
  font-size: clamp(0.72rem, 1.6vw, 0.78rem);
  color: var(--text-muted);
  font-style: italic;
  min-width: 2rem;
  flex-shrink: 0;
  letter-spacing: 0.05em;
}

.pi-title {
  font-size: clamp(0.95rem, 2.5vw, 1.05rem);
  font-style: italic;
  color: var(--text-sub);
  line-height: 1.4;
}

.pi-artist {
  font-size: clamp(0.75rem, 1.8vw, 0.82rem);
  color: var(--text-muted);
  margin-top: 0.15rem;
  font-style: normal;
  letter-spacing: 0.04em;
}


/* ── Parwana backdrop ── */
.parwana-backdrop {
  position: fixed;
  inset: 0;
  z-index: 29;
  background: rgba(0, 0, 0, 0.88);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.parwana-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

/* ── Parwana modal ── */
.parwana-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  pointer-events: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s, transform 0.3s;
}

.parwana-modal.open {
  pointer-events: all;
  opacity: 1;
  transform: translateY(0);
}

.parwana-modal-close {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem;
  display: flex;
  transition: color 0.2s;
}

.parwana-modal-close:hover { color: var(--text); }
.parwana-modal-close svg   { width: 1.2em; height: 1.2em; fill: currentColor; }

/* ── Parwana card ── */
.parwana-card {
  width: min(400px, 92vw);
  background: #0f0b0b;
  border: 1px solid var(--gold-faint);
  box-shadow: 0 0 60px rgba(196,154,60,0.08), 0 20px 60px rgba(0,0,0,0.6);
  padding: 2.5rem 2rem 2rem;
  text-align: center;
  border-radius: 2px;
}

.pc-brand-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.2rem;
}

.pc-brand {
  font-size: 0.65rem;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--gold);
}

.pc-brand-urdu {
  font-size: 1.1rem;
  color: var(--gold-dim);
  line-height: 1;
}

.pc-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.2rem 0;
  color: var(--gold-faint);
}

.pc-divider::before,
.pc-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gold-faint);
}

.pc-divider span { font-size: 0.45rem; color: var(--gold-dim); }

.pc-couplet { margin-bottom: 0; }

.pc-urdu {
  font-size: clamp(1rem, 3vw, 1.2rem);
  color: var(--text-sub);
  line-height: 1.9;
  direction: rtl;
  font-style: italic;
}

.pc-translation {
  font-size: clamp(0.75rem, 2vw, 0.82rem);
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.9rem;
  line-height: 1.7;
  letter-spacing: 0.03em;
}

.pc-message {
  font-size: clamp(0.72rem, 1.8vw, 0.78rem);
  color: var(--gold-dim);
  letter-spacing: 0.2em;
  font-style: italic;
  margin-top: 0.4rem;
}

.pc-track-row {
  font-size: clamp(0.8rem, 2vw, 0.88rem);
  color: var(--text-sub);
  font-style: italic;
  margin-top: 0.5rem;
  min-height: 1.2rem;
}

/* ── Parwana actions ── */
.parwana-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.2rem;
  width: min(400px, 92vw);
}

.pa-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: clamp(0.78rem, 2vw, 0.84rem);
  letter-spacing: 0.12em;
  cursor: pointer;
  padding: 0.65rem 1rem;
  transition: color 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.pa-btn svg { width: 0.9em; height: 0.9em; fill: currentColor; }

.pa-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.pa-btn-share {
  border-color: var(--gold-faint);
  color: var(--gold-dim);
}

.pa-btn-share:hover {
  color: var(--gold);
  border-color: var(--gold-dim);
}

/* ── Touch devices ── */
@media (pointer: coarse) {
  .ctrl-btn    { padding: 0.8rem; }
  .action-btn  { padding: 0.8rem 1rem; }
  .hints       { display: none; }
}

/* ── Small screens (≤ 480px) ── */
@media (max-width: 480px) {
  .player          { width: 96vw; }
  .controls        { gap: 2rem; }
  .playlist-panel  { width: 100vw; border-left: none; }
  .playlist-item   { padding: 0.9rem 1.2rem; }
  .playlist-header { padding: 1.2rem 1.2rem 0.8rem; }
  .hints           { display: none; }
}

/* ── Very small screens (≤ 340px) ── */
@media (max-width: 340px) {
  .divider  { width: 80%; }
  .controls { gap: 1.5rem; }
}
