/* ==========================================================================
   Dhaka Saloon — stylesheet
   Design language: a small neighbourhood salon at dusk — string bulbs,
   a ceiling fan, a round mirror, a rexine barber chair — bordered in the
   flat, saturated florals of Dhaka rickshaw art. Warm ink background,
   marigold glow, rickshaw-red and teal as the two accent notes.
   ========================================================================== */

:root {
  /* Color tokens — overridden inline per-request from config.php */
  --ink:      #160D08;
  --maroon:   #8A1F3B;
  --teal:     #0F6E5C;
  --gold:     #E3A72E;
  --cream:    #F3E6C8;

  --ink-2:    #21140D;          /* lifted surface (cards) */
  --ink-3:    #2C1B12;          /* lifted surface, hover */
  --line:     rgba(243, 230, 200, 0.14);
  --shadow:   rgba(10, 5, 2, 0.55);

  /* Type */
  --font-display: 'Baloo Da 2', 'Hind Siliguri', system-ui, sans-serif;
  --font-body:    'Hind Siliguri', system-ui, sans-serif;
  --font-mono:    'Space Mono', ui-monospace, monospace;

  /* Rhythm */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 26px;
  --gap: clamp(1rem, 2.5vw, 1.75rem);
  --content-w: 640px;

  color-scheme: dark;
}

/* ---- Reset --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
a { color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, p { margin: 0; }

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

/* YouTube's iframe target — kept in the DOM and technically visible
   (display:none can make some browsers stall audio) but off-screen. */
#yt-player-wrap {
  position: fixed;
  top: 0; left: -9999px;
  width: 2px; height: 2px;
  overflow: hidden;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ==========================================================================
   Hero art — the illustrated salon interior, shared by splash + main view
   ========================================================================== */

.scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.scene svg {
  width: 100%;
  height: 100%;
  display: block;
}

.scene__vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 70% at 50% 38%, transparent 0%, transparent 40%, rgba(8,4,2,0.55) 100%),
    linear-gradient(to bottom, rgba(8,4,2,0.35) 0%, transparent 18%, transparent 72%, rgba(8,4,2,0.75) 100%);
}

.scene__grain {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (prefers-reduced-motion: no-preference) {
  .fan { animation: spin 9s linear infinite; transform-origin: 800px 118px; }
  .bulb-glow { animation: twinkle 3.6s ease-in-out infinite; }
  .bulb-glow:nth-child(2n) { animation-delay: .6s; }
  .bulb-glow:nth-child(3n) { animation-delay: 1.3s; }
  .bulb-glow:nth-child(5n) { animation-delay: 2s; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes twinkle {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}

/* ==========================================================================
   Splash / "enter the salon" gate
   Browsers block audio autoplay until a gesture — so this doubles as the
   moment that gesture happens. The player is pre-buffered underneath it
   (see app.js) so the instant it's dismissed, playback is immediate.
   ========================================================================== */

.splash {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  background: rgba(8, 4, 2, 0.55);
  transition: opacity .6s ease, visibility .6s ease;
}
.splash[hidden] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: flex; /* keep transition working with [hidden] override below */
}

.splash__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  padding: clamp(1.75rem, 5vw, 3rem) clamp(1.75rem, 6vw, 3.5rem);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(28,17,11,0.97), rgba(18,11,7,0.99));
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px var(--shadow);
  max-width: 30rem;
  animation: rise .7s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.splash__eyebrow {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: .9;
}
.splash__title-bn {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 6vw, 2.3rem);
  font-weight: 700;
  color: var(--cream);
}
.splash__title-en {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.05rem, 3.5vw, 1.25rem);
  color: var(--cream);
  opacity: .85;
}
.splash__sub {
  font-size: .92rem;
  line-height: 1.5;
  color: var(--cream);
  opacity: .68;
  max-width: 26rem;
}

.btn-enter {
  margin-top: .35rem;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .9rem 1.9rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), #c98420);
  color: #1a1006;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(227, 167, 46, 0.35);
  transition: transform .25s ease, box-shadow .25s ease;
}
.btn-enter:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(227, 167, 46, 0.45); }
.btn-enter:active { transform: translateY(0); }
.btn-enter svg { width: 18px; height: 18px; }

.splash__hint {
  font-size: .74rem;
  color: var(--cream);
  opacity: .45;
}

.splash__fallback {
  display: none;
  font-size: .8rem;
  opacity: .8;
}
.splash.is-waiting .splash__fallback { display: block; }
.splash__fallback a { color: var(--gold); }

/* ==========================================================================
   Page shell
   ========================================================================== */

.page {
  position: relative;
  z-index: 3;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: clamp(1rem, 3vw, 1.75rem) clamp(1rem, 4vw, 2.5rem) 0;
}

/* ---- Top bar --------------------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.online-pill {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .9rem .45rem .7rem;
  border-radius: 999px;
  background: rgba(22,13,8,0.55);
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
  font-size: .82rem;
}
.online-pill__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4ADE80;
  box-shadow: 0 0 0 0 rgba(74,222,128,.6);
  animation: pulse-dot 2s ease-out infinite;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(74,222,128,.55); }
  70% { box-shadow: 0 0 0 8px rgba(74,222,128,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}
.online-pill__count { font-family: var(--font-mono); font-weight: 700; color: var(--gold); }

.topbar__right {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}

.pill-link {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .85rem;
  border-radius: 999px;
  background: rgba(22,13,8,0.55);
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s ease, border-color .2s ease;
}
.pill-link:hover { background: rgba(22,13,8,0.8); border-color: rgba(227,167,46,.4); }
.pill-link svg { width: 15px; height: 15px; }

.lang-toggle {
  display: inline-flex;
  border-radius: 999px;
  background: rgba(22,13,8,0.55);
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
  padding: 3px;
  gap: 2px;
}
.lang-toggle button {
  border: none;
  background: transparent;
  color: var(--cream);
  opacity: .55;
  padding: .35rem .7rem;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s ease, opacity .2s ease;
}
.lang-toggle button[aria-pressed="true"] {
  background: var(--gold);
  color: #1a1006;
  opacity: 1;
}

/* ---- Brand / hero text ------------------------------------------------ */
.brand {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: .6rem;
  padding: clamp(1.5rem, 5vw, 3rem) 1rem;
  min-height: 26vh;
}
.brand__title-bn {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 9vw, 4.6rem);
  line-height: 1;
  letter-spacing: -.01em;
  background: linear-gradient(135deg, var(--cream) 20%, var(--gold) 65%, var(--cream) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 40px rgba(227,167,46,.25);
}
.brand__title-en {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-size: clamp(.85rem, 2.2vw, 1.05rem);
  opacity: .7;
}
.brand__tagline {
  max-width: 34rem;
  font-size: clamp(.88rem, 2vw, 1rem);
  line-height: 1.55;
  opacity: .68;
}

/* ==========================================================================
   Player card
   ========================================================================== */
.player-wrap {
  display: flex;
  justify-content: center;
  padding-bottom: 1rem;
}

.player-card {
  width: 100%;
  max-width: var(--content-w);
  border-radius: var(--radius-lg);
  padding: clamp(1.1rem, 3vw, 1.6rem);
  background: linear-gradient(180deg, rgba(33,20,13,0.82), rgba(22,13,8,0.88));
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px var(--shadow);
  backdrop-filter: blur(10px);
}

.player-card__top {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.player-art {
  position: relative;
  width: 76px;
  height: 76px;
  flex-shrink: 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--ink-2);
  border: 1px solid var(--line);
}
.player-art img {
  width: 100%; height: 100%;
  object-fit: cover;
}
@media (prefers-reduced-motion: no-preference) {
  .player-art img.is-playing { animation: pulse-art 2.4s ease-in-out infinite; }
}
@keyframes pulse-art {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.035); }
}

.player-meta { min-width: 0; flex: 1; }
.player-meta__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-meta__artist {
  font-size: .84rem;
  opacity: .6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: .15rem;
}
.player-meta__tag {
  display: inline-block;
  margin-top: .4rem;
  font-family: var(--font-mono);
  font-size: .65rem;
  letter-spacing: .06em;
  padding: .15rem .5rem;
  border-radius: 999px;
  background: rgba(227,167,46,.14);
  color: var(--gold);
}

.like-btn {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.2);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .15s ease;
}
.like-btn svg { width: 18px; height: 18px; stroke: var(--cream); fill: none; transition: fill .2s ease, stroke .2s ease; }
.like-btn:hover { transform: scale(1.06); border-color: rgba(227,167,46,.4); }
.like-btn.is-liked svg { fill: var(--maroon); stroke: var(--maroon); }

/* Progress */
.progress {
  margin-top: 1.1rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font-mono);
  font-size: .72rem;
  opacity: .75;
}
.progress__bar {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  position: relative;
  cursor: pointer;
}
.progress__fill {
  position: absolute; inset: 0 auto 0 0;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--maroon), var(--gold));
}
.progress__bar:hover .progress__fill::after,
.progress__fill::after {
  content: '';
  position: absolute;
  right: -5px; top: 50%;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--gold);
  transform: translateY(-50%) scale(0);
  transition: transform .15s ease;
  box-shadow: 0 0 0 3px rgba(227,167,46,.25);
}
.progress__bar:hover .progress__fill::after { transform: translateY(-50%) scale(1); }

/* Controls */
.controls {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}
.ctrl-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.18);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .2s ease, transform .15s ease, border-color .2s ease;
}
.ctrl-btn svg { width: 17px; height: 17px; }
.ctrl-btn:hover { background: rgba(227,167,46,.16); border-color: rgba(227,167,46,.4); transform: translateY(-1px); }
.ctrl-btn:active { transform: translateY(0); }
.ctrl-btn[aria-pressed="true"] { background: rgba(227,167,46,.22); border-color: var(--gold); }
.ctrl-btn--play {
  width: 54px; height: 54px;
  background: linear-gradient(135deg, var(--gold), #c98420);
  border: none;
}
.ctrl-btn--play svg { width: 20px; height: 20px; }
.ctrl-btn--play:hover { background: linear-gradient(135deg, #f0b53c, var(--gold)); }
.ctrl-btn--play .icon-pause { display: none; }
.ctrl-btn--play.is-playing .icon-play { display: none; }
.ctrl-btn--play.is-playing .icon-pause { display: block; }

.volume {
  display: none;
  align-items: center;
  gap: .5rem;
  margin-left: .35rem;
}
.volume svg { width: 16px; height: 16px; fill: none; stroke: var(--cream); stroke-width: 2; stroke-linecap: round; opacity: .7; flex-shrink: 0; }
#muteBtn .icon-muted { display: none; }
#muteBtn[aria-pressed="true"] .icon-on { display: none; }
#muteBtn[aria-pressed="true"] .icon-muted { display: block; }
.volume input[type="range"] {
  width: 70px;
  accent-color: var(--gold);
}
@media (min-width: 560px) { .volume { display: flex; } }

/* Queue toggle + drawer */
.queue-toggle {
  margin-top: 1.1rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  background: none;
  border: none;
  border-top: 1px dashed var(--line);
  padding-top: .8rem;
  color: var(--cream);
  opacity: .65;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .03em;
  cursor: pointer;
}
.queue-toggle:hover { opacity: .95; }
.queue-toggle svg { width: 13px; height: 13px; fill: currentColor; transition: transform .25s ease; }
.queue-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

.queue {
  max-width: var(--content-w);
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
  max-height: 0;
  transition: max-height .35s ease;
}
.queue.is-open { max-height: 60vh; }

.queue__inner {
  margin-top: .75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(12,7,4,0.88);
  backdrop-filter: blur(14px);
  overflow: hidden;
}
.queue__filter {
  display: flex;
  gap: .4rem;
  padding: .6rem;
  border-bottom: 1px solid var(--line);
}
.queue__filter button {
  flex: 1;
  border: none;
  background: rgba(255,255,255,.05);
  color: var(--cream);
  opacity: .6;
  padding: .4rem;
  border-radius: 8px;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
}
.queue__filter button[aria-pressed="true"] { background: rgba(227,167,46,.18); color: var(--gold); opacity: 1; }

.queue__list {
  max-height: 44vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) transparent;
}
.queue__item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem .7rem;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,.05);
  color: var(--cream);
  text-align: left;
  cursor: pointer;
}
.queue__item:hover { background: rgba(255,255,255,.04); }
.queue__item.is-active { background: rgba(227,167,46,.1); }
.queue__item.is-active .queue__item-title { color: var(--gold); }
.queue__item-index {
  font-family: var(--font-mono);
  font-size: .68rem;
  opacity: .4;
  width: 1.4rem;
  flex-shrink: 0;
  text-align: right;
}
.queue__item-thumb {
  width: 34px; height: 34px;
  border-radius: 7px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--ink-2);
}
.queue__item-text { min-width: 0; flex: 1; }
.queue__item-title {
  display: block;
  font-size: .84rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue__item-artist {
  display: block;
  font-size: .72rem;
  opacity: .5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue__item-heart { flex-shrink: 0; width: 14px; height: 14px; opacity: 0; transition: opacity .15s ease; }
.queue__item-heart.is-liked { opacity: 1; }
.queue__item-heart svg { width: 100%; height: 100%; fill: var(--maroon); }

.queue__empty {
  padding: 1.6rem 1rem;
  text-align: center;
  font-size: .82rem;
  opacity: .5;
}

/* ==========================================================================
   Contact strip
   ========================================================================== */
.contact-strip {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .5rem .8rem;
  padding: 1.1rem 1rem calc(1.1rem + env(safe-area-inset-bottom, 0px));
  margin-top: 1.5rem;
  border-top: 1px solid var(--line);
  background: rgba(10,6,3,0.55);
  backdrop-filter: blur(8px);
  font-size: .82rem;
}
.contact-strip a, .contact-strip span.static-item {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  opacity: .75;
  text-decoration: none;
  padding: .3rem .5rem;
}
.contact-strip a:hover { opacity: 1; }
.contact-strip svg { width: 15px; height: 15px; flex-shrink: 0; }
.contact-strip__dot { opacity: .3; }

/* ==========================================================================
   Toast (share / copy feedback)
   ========================================================================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translate(-50%, 12px);
  z-index: 50;
  background: var(--cream);
  color: var(--ink);
  font-size: .82rem;
  font-weight: 600;
  padding: .6rem 1.1rem;
  border-radius: 999px;
  box-shadow: 0 10px 30px var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   Responsive tweaks
   ========================================================================== */
@media (max-width: 480px) {
  .brand { min-height: 20vh; padding-block: 1.25rem; }
  .topbar { gap: .5rem; }
  .pill-link span { display: none; }
  .contact-strip { font-size: .76rem; }
}

@media (min-width: 900px) {
  .player-card { padding: 2rem; }
}
