:root {
  --ink: #fff8ee;
  --ink-soft: rgba(255,248,238,0.65);
  --accent: #ffb457;
  --accent-hot: #ff7a3c;
  --glass: rgba(255,255,255,0.08);
  --glass-border: rgba(255,255,255,0.18);
  --shadow: 0 8px 32px rgba(0,0,0,0.5);
}

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

html, body {
  width: 100%; min-height: 100%;
  overflow-x: hidden;
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: #0e0806;
}

/* ---- Page ---- */
.page {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100dvh;
  padding: 16px 16px 0;
  overflow: hidden;
}

/* ---- BG ---- */
.hero-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    url("assets/background.webp") center/cover no-repeat fixed,
    linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.15) 50%, rgba(0,0,0,0.4) 100%);
  filter: brightness(1.1) saturate(1.05);
}

/* ---- Topbar ---- */
.topbar {
  position: relative; z-index: 5;
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; max-width: 560px;
}

.clock {
  font-size: 12px; font-weight: 500; letter-spacing: 0.04em;
  color: var(--ink-soft); font-variant-numeric: tabular-nums;
}

.online-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; font-size: 11px; font-weight: 500;
  color: var(--ink-soft); border-radius: 999px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
}
#online-count { font-variant-numeric: tabular-nums; }

.dot { position: relative; display: inline-flex; width: 7px; height: 7px; }
.dot__ping, .dot__core { position: absolute; inset: 0; border-radius: 50%; background: #4ade80; }
.dot__ping { animation: ping 1.8s cubic-bezier(0,0,0.2,1) infinite; opacity: 0.6; }
.dot__core { box-shadow: 0 0 6px rgba(74,222,128,0.8); }
@keyframes ping { 75%,100% { transform: scale(2.2); opacity: 0; } }

/* ---- Wordmark ---- */
.wordmark {
  position: relative; z-index: 3;
  text-align: center;
  padding: clamp(20px, 10vh, 80px) 0 8px;
  width: 100%; max-width: 560px;
}

.wordmark__title {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700; font-size: clamp(56px, 14vw, 130px);
  line-height: 1.05; display: flex; flex-direction: column; align-items: center;
}

.wordmark__en {
  color: #fff;
  -webkit-text-stroke: 0.025em #e8c17a;
  paint-order: stroke fill;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

.wordmark__bn {
  font-family: "Noto Serif Bengali", serif;
  font-size: 0.88em; line-height: 1.1;
  margin-top: -0.1em; color: rgba(255,248,238,0.9);
}

/* ---- Player (fixed bottom) ---- */
.player-wrap {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  padding: 0 12px 14px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 70%, transparent 100%);
  pointer-events: none;
}
.player-wrap > * { pointer-events: auto; }

.player {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px 8px 8px; border-radius: 999px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 4px 24px rgba(0,0,0,0.6);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  width: 100%; max-width: 500px; min-width: 0;
}

/* ---- Disc ---- */
.player__art {
  position: relative; flex: 0 0 58px; width: 58px; height: 58px;
  padding: 0; border: none; background: none; cursor: pointer; color: #fff;
}

.disc {
  width: 100%; height: 100%; border-radius: 50%; position: relative;
  background: radial-gradient(circle, #1a1a1a 0%, #0d0d0d 28%, #181818 30%, #1a1a1a 58%, #0d0d0d 100%);
  box-shadow: 0 2px 10px rgba(0,0,0,0.6);
  animation: spin 3.5s linear infinite;
  animation-play-state: paused;
  overflow: hidden;
}
.disc.is-playing { animation-play-state: running; }

.disc__groove {
  position: absolute; inset: 0; border-radius: 50%; z-index: 1; pointer-events: none;
  background: repeating-radial-gradient(circle at 50% 50%,
    transparent 0px, transparent 2px, rgba(255,255,255,0.03) 2px, rgba(255,255,255,0.03) 3px);
}

.disc__hole {
  position: absolute; width: 8px; height: 8px;
  top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: #0a0a0a; border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.2);
  z-index: 2; pointer-events: none;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Meta ---- */
.player__meta { flex: 1 1 0; min-width: 0; overflow: hidden; }

.player__title {
  font-size: 13px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player__artist {
  margin-top: 1px; font-size: 11px; color: var(--ink-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---- Bar ---- */
.player__bar { margin-top: 6px; }

.bar {
  position: relative; height: 10px; width: 100%; cursor: pointer; outline: none;
}
.bar::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%;
  height: 3px; transform: translateY(-50%); border-radius: 999px;
  background: rgba(255,255,255,0.12);
}
.bar__fill {
  position: absolute; left: 0; top: 50%; height: 3px; width: 0%;
  transform: translateY(-50%); border-radius: 999px;
  background: linear-gradient(to right, var(--accent), var(--accent-hot));
  transition: width 0.15s linear;
}
.bar__thumb {
  position: absolute; top: 50%; left: 0%;
  width: 10px; height: 10px; border-radius: 50%;
  background: #fff; transform: translate(-50%,-50%);
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
  opacity: 0; transition: opacity 0.15s;
}
.bar:hover .bar__thumb { opacity: 1; }

.player__times {
  display: flex; justify-content: space-between;
  margin-top: 3px; font-size: 10px; color: rgba(255,248,238,0.4);
  font-variant-numeric: tabular-nums;
}

/* ---- Controls ---- */
.player__controls {
  display: flex; align-items: center; gap: 2px; flex: 0 0 auto;
}

.ctrl {
  display: grid; place-items: center;
  width: 32px; height: 32px; border: none; border-radius: 50%;
  background: none; color: rgba(255,255,255,0.8);
  cursor: pointer; transition: all 0.12s;
}
.ctrl:hover { background: rgba(255,255,255,0.1); color: #fff; }
.ctrl:active { transform: scale(0.92); }
.ctrl:disabled { opacity: 0.25; cursor: default; }

.ctrl--play {
  width: 38px; height: 38px;
  background: #fff; color: #111;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.ctrl--play:hover { background: #fff; color: #111; transform: scale(1.05); }
.ctrl--play:active { transform: scale(0.95); }

/* ---- Picker ---- */
.picker { position: relative; display: flex; justify-content: center; }

.picker__btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; max-width: 100%;
  border: 1px solid rgba(255,255,255,0.1); border-radius: 999px;
  background: rgba(255,255,255,0.05); color: var(--ink-soft);
  font: inherit; font-size: 11px; font-weight: 500; cursor: pointer;
  backdrop-filter: blur(12px); transition: background 0.15s;
}
.picker__btn:hover { background: rgba(255,255,255,0.1); }
.picker__btn > span {
  max-width: 36ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.picker__chev { opacity: 0.5; transition: transform 0.2s; flex-shrink: 0; }
.picker.is-open .picker__chev { transform: rotate(-180deg); }

.picker__panel {
  position: absolute; bottom: calc(100% + 6px);
  left: 50%; transform: translateX(-50%);
  width: min(460px, calc(100vw - 32px));
  max-height: min(50vh, 400px);
  display: flex; flex-direction: column;
  border-radius: 14px;
  background: rgba(14,8,6,0.92);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  overflow: hidden; z-index: 10;
  animation: pickerIn 0.15s ease both;
}
.picker__panel[hidden] { display: none; }

@keyframes pickerIn {
  from { opacity: 0; transform: translate(-50%, 6px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.picker__search-wrap { padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.picker__search {
  width: 100%; padding: 7px 10px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.04);
  color: var(--ink); font: inherit; font-size: 12px; outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.picker__search:focus { border-color: rgba(255,180,87,0.4); background: rgba(255,255,255,0.08); }
.picker__search::placeholder { color: rgba(255,248,238,0.4); }

.picker__list {
  margin: 0; padding: 4px; list-style: none;
  overflow-y: auto; overscroll-behavior: contain;
}
.picker__list::-webkit-scrollbar { width: 6px; }
.picker__list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 999px; }

.picker__item {
  width: 100%; display: grid;
  grid-template-columns: 24px 1fr auto; align-items: center; gap: 8px;
  padding: 6px 8px; border: none; border-radius: 8px;
  background: none; color: var(--ink); font: inherit;
  text-align: left; cursor: pointer; transition: background 0.1s;
}
.picker__item:hover { background: rgba(255,255,255,0.06); }
.picker__item.is-active { background: rgba(255,180,87,0.1); }

.picker__item-num {
  font-size: 10px; color: rgba(255,248,238,0.35);
  font-variant-numeric: tabular-nums; text-align: right;
}
.picker__item.is-active .picker__item-num { color: var(--accent); }

.picker__item-text { min-width: 0; display: flex; flex-direction: column; }
.picker__item-title {
  font-size: 12px; font-weight: 500; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.picker__item-artist {
  font-size: 10px; color: rgba(255,248,238,0.5);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.picker__item-dur { font-size: 10px; color: rgba(255,248,238,0.4); font-variant-numeric: tabular-nums; }

/* ---- Footer ---- */
.footer {
  position: relative; z-index: 3;
  margin-top: auto; padding-bottom: 130px;
  text-align: center; font-size: 12px;
  color: rgba(255,248,238,0.45);
}
.footer .heart {
  display: inline-block; vertical-align: -2px;
  animation: heartbeat 1.4s ease-in-out infinite;
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.25); }
  28% { transform: scale(1); }
  42% { transform: scale(1.25); }
  56% { transform: scale(1); }
}

/* ---- Spacer (push content above fixed player) ---- */
.spacer { height: 120px; }

/* ---- Mobile ---- */
@media (max-width: 480px) {
  .page { padding: 12px 12px 0; }
  .player-wrap { padding: 0 8px 10px; }
  .player { padding: 6px 10px 6px 6px; gap: 8px; }
  .player__art { flex: 0 0 50px; width: 50px; height: 50px; }
  .ctrl { width: 28px; height: 28px; }
  .ctrl--play { width: 34px; height: 34px; }
  .wordmark__title { font-size: clamp(48px, 12vw, 100px); }
}

:focus-visible { outline: 2px solid rgba(255,180,87,0.7); outline-offset: 2px; border-radius: 4px; }
