/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  /* Fix blue tap flash on iOS */
}

audio {
  display: none !important;
}

button {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: none;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
}

:root {
  --bg: #0e0c0a;
  /* Deep Espresso */
  --bg2: #181410;
  /* Warm Dark Brown */
  --surface: rgba(255, 230, 200, 0.04);
  --surface-hover: rgba(255, 230, 200, 0.08);
  --border: rgba(244, 148, 28, 0.12);
  --accent: #f4941c;
  /* Warm Saffron */
  --accent2: #f9b93e;
  /* Goldenrod */
  --accent-glow: rgba(244, 148, 28, 0.3);
  --text: #fefaf2;
  /* Ivory/Cream */
  --text-muted: #8c7b6c;
  /* Warm Taupe */
  --text-dim: #b8a898;
  --player-h: 100px;
  --sidebar-w: 260px;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
}

html {
  font-size: 17px;
}

/* ── View: Player (body acts as grid) ────────────────────────────────────── */
body.view-player {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 1fr 0px;
  grid-template-areas:
    "sidebar main"
    "player  player";
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

body.view-player.has-played {
  grid-template-rows: 1fr var(--player-h);
}

/* #player-view is transparent to the body grid in player mode */
body.view-player #player-view  { display: contents; }
body.view-player #landing-view { display: none; }

/* ── View: Landing (normal scrollable page) ───────────────────────────────── */
body.view-landing {
  font-family: 'Outfit', sans-serif;
  background: #1a1108;
  color: #f0e6d0;
  display: block;
  height: auto;
  min-height: 100vh;
  overflow-y: auto;
}

body.view-landing #player-view  { display: none; }

/* Player bar: fixed to the bottom of the screen on landing page */
body.view-landing .player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 500;
}

/* Add bottom padding to landing content so player bar doesn't overlap */
body.view-landing #landing-view {
  padding-bottom: 20px;
}

body.view-landing.has-played #landing-view {
  padding-bottom: calc(var(--player-h) + 10px);
}

/* Fade transition between views */
#landing-view, #player-view {
  transition: opacity 0.2s ease;
}

/* ── Base body fallback (overridden by .view-player / .view-landing) ────── */
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 1fr var(--player-h);
  grid-template-areas:
    "sidebar main"
    "player  player";
  overflow: hidden;
  /* Account for iOS/Android bottom safe area */
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar {
  grid-area: sidebar;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  transition: transform var(--transition);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}


.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--accent);
  filter: drop-shadow(0 0 10px var(--accent-glow));
}

.logo-text {
  font-size: 1.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
}

.sidebar-close:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 0 8px;
  margin-bottom: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 1.05rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition), color var(--transition);
}

.nav-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.nav-item.active {
  background: rgba(244, 148, 28, 0.1);
  color: var(--accent2);
}

.nav-icon {
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
}

.nav-icon svg {
  fill: currentColor;
}

/* ── Folder Tree ──────────────────────────────────────────────────────────── */
.folder-tree {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.folder-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background var(--transition), color var(--transition);
}

.folder-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.folder-item.active {
  background: rgba(244, 148, 28, 0.1);
  color: var(--accent2);
}

.folder-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  flex-shrink: 0;
  color: var(--accent2);
}

.folder-icon svg {
  fill: currentColor;
}

/* ── Overlay (mobile) ─────────────────────────────────────────────────────── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 40;
  backdrop-filter: blur(2px);
}

/* ── Main ─────────────────────────────────────────────────────────────────── */
.main {
  grid-area: main;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  min-height: 0; /* prevent flex overflow */
}

/* ── Top Bar ──────────────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0; /* never collapse — always stay visible */
  z-index: 30;
}

.menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color var(--transition);
  flex-shrink: 0;
}

.menu-btn:hover {
  color: var(--text);
}

.search-wrapper {
  flex: 1;
  position: relative;
  max-width: 480px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  pointer-events: none;
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 9px 38px 9px 38px;
  color: var(--text);
  font-family: inherit;
  font-size: 1.05rem;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: var(--accent);
  background: rgba(244, 148, 28, 0.05);
}

.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 6px;
  border-radius: 50%;
  display: none;
  transition: color var(--transition);
}

.search-clear:hover {
  color: var(--text);
}

.search-clear.visible {
  display: block;
}

.song-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Content ──────────────────────────────────────────────────────────────── */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 16px;
  overscroll-behavior-y: contain; /* prevent rubber-band scroll past the list */
}

/* ── Breadcrumb ───────────────────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  font-size: 0.85rem;
}

.breadcrumb-item {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: inherit;
  font-size: inherit;
  transition: color var(--transition);
}

.breadcrumb-item:hover {
  color: var(--accent2);
}

.breadcrumb-item.current {
  color: var(--text);
  font-weight: 600;
  cursor: default;
}

.breadcrumb-sep {
  color: var(--text-muted);
}

/* ── Song List ────────────────────────────────────────────────────────────── */
.song-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Section headers (folders or "Songs" label) */
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

/* Sort toggle button inside section header */
.sort-btn {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(244, 148, 28, 0.1);
  border: 1px solid rgba(244, 148, 28, 0.25);
  border-radius: 20px;
  padding: 3px 10px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

.sort-btn:hover {
  background: rgba(244, 148, 28, 0.2);
}

/* "NEW" badge on recently added songs */
.badge-new {
  display: inline-block;
  flex-shrink: 0;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #0e0c0a;
  background: var(--accent);
  border-radius: 4px;
  padding: 1px 5px;
  vertical-align: middle;
  margin-right: 5px;
  line-height: 1.6;
}


/* Folder cards */
.folder-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  margin-bottom: 4px;
}

.folder-card:hover {
  background: var(--surface-hover);
  border-color: rgba(244, 148, 28, 0.3);
  transform: translateX(3px);
}

.folder-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.folder-card-info {
  flex: 1;
  min-width: 0;
}

.folder-card-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-card-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.folder-card-arrow {
  color: var(--text-muted);
  font-size: 1rem;
}

/* Song rows */
.song-row {
  display: grid;
  grid-template-columns: 36px 40px 1fr auto 80px 32px;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
}

/* ── Favorite Heart Button ────────────────────────────────────────────────── */
.fav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: color 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.fav-btn:hover {
  color: var(--accent);
  transform: scale(1.15);
}

.fav-btn.active {
  color: var(--accent);
  animation: heartPop 0.3s ease;
}

@keyframes heartPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.song-row:hover {
  background: var(--surface);
}

.song-row.playing {
  background: rgba(244, 148, 28, 0.14);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
}

.song-row.playing .song-title {
  color: var(--accent2);
  font-weight: 600;
}

.song-num {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.song-row.playing .song-num {
  display: none;
}

.song-playing-icon {
  display: none;
  text-align: center;
  color: var(--accent);
}

.song-row.playing .song-playing-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: playingPulse 1.0s ease-in-out infinite;
}

@keyframes playingPulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(0.85);
  }
}

.song-art {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  overflow: hidden;
  flex-shrink: 0;
}

.song-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.song-meta {
  min-width: 0;
}

.song-title {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-artist {
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.song-year {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.song-duration {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* ── Play All / Shuffle Bar ───────────────────────────────────────────────── */
.play-all-bar {
  display: flex;
  gap: 10px;
  padding: 4px 0 16px;
}

.play-all-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 50px;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: #1a1a1a;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.play-all-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 24px var(--accent-glow);
}

.shuffle-all-btn {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-hover);
  box-shadow: none;
}

.shuffle-all-btn:hover {
  background: var(--surface-hover);
  box-shadow: none;
}

/* ── Loading Skeleton ─────────────────────────────────────────────────────── */
.skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
}

.skeleton-row {
  display: grid;
  grid-template-columns: 36px 40px 1fr 80px;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
}

.skeleton-bone {
  background: rgba(255, 230, 200, 0.06);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.skeleton-bone::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(244, 148, 28, 0.06) 40%,
    rgba(244, 148, 28, 0.10) 50%,
    rgba(244, 148, 28, 0.06) 60%,
    transparent 100%
  );
  animation: shimmer 1.8s ease-in-out infinite;
}

@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.skeleton-num {
  height: 12px;
  width: 16px;
}

.skeleton-art {
  height: 40px;
  width: 40px;
  border-radius: 6px;
}

.skeleton-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-title {
  height: 14px;
  border-radius: 4px;
}

.skeleton-artist {
  height: 10px;
  width: 60%;
  border-radius: 4px;
}

.skeleton-dur {
  height: 12px;
  width: 40px;
  margin-left: auto;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 0.9rem;
}

/* ── Queue View ───────────────────────────────────────────────────────────── */
.queue-view {
  padding: 0;
}

.queue-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hidden {
  display: none !important;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}

.queue-item:hover {
  background: var(--surface);
}

.queue-item.current {
  background: rgba(244, 148, 28, 0.12);
}

.queue-item.current .qi-title {
  color: var(--accent2);
}

.queue-item-num {
  font-size: 0.8rem;
  color: var(--text-muted);
  width: 24px;
  text-align: right;
  flex-shrink: 0;
}

.qi-meta {
  flex: 1;
  min-width: 0;
}

.qi-title {
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qi-artist {
  font-size: 0.77rem;
  color: var(--text-muted);
}

.qi-dur {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Favorites View ──────────────────────────────────────────────────────── */
.favorites-view {
  padding: 0;
}

.favorites-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.favorites-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fav-count-badge {
  background: rgba(244, 148, 28, 0.15);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: auto;
}

/* ── Player Bar ───────────────────────────────────────────────────────────── */
body:not(.has-played) .player {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

.player {
  grid-area: player;
  display: grid;
  grid-template-columns: 280px 1fr 220px;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: var(--bg2);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  height: var(--player-h);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.player-info {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.player-art {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: linear-gradient(135deg, #181410, #2a1b10);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.player-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.player-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.player-title-marquee {
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  mask-image: linear-gradient(to right, black, black calc(100% - 16px), transparent);
  -webkit-mask-image: linear-gradient(to right, black, black calc(100% - 16px), transparent);
}

.player-title {
  display: inline-block;
  font-size: 1.05rem;
  font-weight: 600;
  white-space: nowrap;
}

.player-artist {
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.player-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.control-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ctrl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1.4rem;
  padding: 8px 10px;
  border-radius: 10px;
  transition: color var(--transition), background var(--transition), transform var(--transition);
  line-height: 1;
}

.ctrl-btn svg {
  fill: currentColor;
  stroke: currentColor;
}

/* Play button and others use fill; specific ones use stroke */
#btnShuffle svg,
#fsShuffle svg,
#btnRepeat svg,
#fsRepeat svg,
#btnSleep svg,
#fsSleepBtn svg {
  fill: none;
}

#btnPrev svg,
#fsPrev svg,
#btnPlay svg,
#fsPlay svg,
#btnNext svg,
#fsNext svg,
.vol-btn svg {
  stroke: none;
}

.ctrl-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
  transform: scale(1.1);
}

.ctrl-btn.active {
  color: var(--accent2);
}

.play-btn {
  color: var(--text) !important;
  background: var(--accent) !important;
  width: 54px;
  height: 54px;
  border-radius: 50% !important;
  font-size: 1.4rem !important;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 24px var(--accent-glow);
  transition: transform var(--transition), box-shadow var(--transition) !important;
}

.play-btn:hover {
  transform: scale(1.1) !important;
  box-shadow: 0 0 36px var(--accent-glow) !important;
  background: var(--accent) !important;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.time-label {
  font-size: 0.73rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  width: 36px;
  flex-shrink: 0;
}

#timeDuration {
  text-align: right;
}

.progress-bar-wrapper {
  flex: 1;
  position: relative;
  height: 16px;
  display: flex;
  align-items: center;
}

.progress-bar-bg {
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  overflow: hidden;
  pointer-events: none;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
}

.progress-range {
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  height: 16px;
  opacity: 0;
  cursor: pointer;
  margin: 0;
}

/* Volume */
.player-volume {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

.vol-btn {
  font-size: 1.2rem !important;
}

.volume-bar-wrapper {
  width: 90px;
  position: relative;
  height: 16px;
  display: flex;
  align-items: center;
}

/* ── Fullscreen Player Overlay (Mobile) ───────────────────────────────────── */
.fs-player {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100dvh;
  background: var(--bg);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top, 20px) 24px calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  /* Hidden on desktop by default */
  display: none;
}

body.fs-open .fs-player {
  transform: translateY(0);
}

.fs-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.fs-spacer {
  width: 44px; /* matches button width approx to center handle */
}

.fs-handle {
  flex: 1;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  /* Touch action to allow our JS swipe detection */
  touch-action: pan-x;
}

.fs-handle:active {
  cursor: grabbing;
}

.fs-sleep {
  width: 44px;
  height: 44px;
  padding: 10px;
}

.fs-handle-bar {
  width: 40px;
  height: 5px;
  border-radius: 3px;
  background: var(--border-hover);
}

.fs-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.fs-art {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  background: linear-gradient(135deg, #181410, #2a1b10);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  margin-bottom: 40px;
  flex-shrink: 0;
}

.fs-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fs-info {
  margin-bottom: 30px;
}

.fs-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fs-artist {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.fs-progress {
  margin-bottom: 40px;
}

.fs-progress .progress-bar-wrapper {
  margin-bottom: 8px;
}

.fs-times {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.fs-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  margin-bottom: 20px;
}

.fs-ctrl {
  padding: 12px;
}

.fs-play-btn {
  width: 72px;
  height: 72px;
}

/* ── Toast Notification ────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: var(--bg);
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 0.95rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Responsive / Mobile ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  body, body.view-player, body.view-player.has-played {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    /* player is fixed; remove its grid row */
    grid-template-areas: "main";
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100dvh;
    z-index: 50;
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: block;
  }

  .overlay.show {
    display: block;
  }

  .menu-btn {
    display: block;
  }

  .player {
    /* Fixed above Safari's bottom address bar */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    grid-area: unset;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    height: auto;
    /* extra bottom padding = home indicator */
    padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px)) 16px;
    gap: 8px;
    background: var(--bg2);
    border-top: 1px solid var(--border);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
  }

  .player-info {
    gap: 10px;
  }

  .player-art {
    width: 48px;
    height: 48px;
  }

  .ctrl-btn {
    font-size: 1.4rem !important;
    /* Matches Desktop */
    padding: 8px 10px !important;
  }

  .play-btn {
    width: 56px !important;
    height: 56px !important;
    font-size: 1.4rem !important;
  }

  .control-buttons {
    gap: 12px;
    /* Matches Desktop */
  }

  .player-volume {
    justify-content: center;
  }

  .song-row {
    grid-template-columns: 20px 30px 1fr 38px 52px 24px;
  }

  .song-num {
    display: block;
    font-size: 0.68rem;
  }

  .song-title {
    font-size: 0.88rem;
  }

  .song-artist {
    font-size: 0.73rem;
  }

  .song-art {
    width: 28px;
    height: 28px;
    border-radius: 4px;
  }

  .song-year {
    font-size: 0.70rem;
  }

  .content {
    /* Push content above the fixed player bar */
    padding: 14px 14px calc(170px + env(safe-area-inset-bottom, 0px));
    overscroll-behavior-y: contain;
  }

  .player-volume {
    display: none;
  }

  .fs-player {
    display: flex;
  }

  .topbar {
    padding: 10px 14px;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  :root {
    --sidebar-w: 85vw;
  }

  .player-volume {
    display: none;
  }

  .song-row {
    grid-template-columns: 18px 28px 1fr 32px 46px 22px;
    gap: 7px;
    padding: 9px 10px;
  }
}


/* ════════════════════════════════════════════════════════════════════════════
   LANDING PAGE STYLES  (scoped to #landing-view)
   ════════════════════════════════════════════════════════════════════════════ */

#landing-view {
  --bg: #1a1108;
  --surface: #231a0d;
  --surface2: #2d2110;
  --border: rgba(244, 148, 28, 0.15);
  --accent: #f4941c;
  --accent2: #e8b84b;
  --text: #f0e6d0;
  --text-muted: #a08560;
  --radius: 14px;
}

/* ── Landing Nav ── */
.landing-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(26, 17, 8, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent2);
}

.nav-logo img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 28px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--accent2);
}

/* ── Landing Hero ── */
.lhero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  position: relative;
  overflow: hidden;
}

.lhero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(244, 148, 28, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-logo {
  width: 140px;
  height: 140px;
  margin-bottom: 24px;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(244, 148, 28, 0.25));
}

.hero-tag {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(244, 148, 28, 0.1);
  border: 1px solid rgba(244, 148, 28, 0.25);
  border-radius: 20px;
  padding: 5px 16px;
  margin-bottom: 24px;
}

.lhero h1 {
  font-size: clamp(2.4rem, 7vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--text) 40%, var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-muted);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 28px;
}

.waheguru {
  font-size: 1.2rem;
  color: var(--accent2);
  opacity: 0.7;
  font-weight: 300;
  letter-spacing: 1px;
  margin-bottom: 40px;
}

.lbtn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent), #e8a020);
  color: #1a1108;
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 32px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 30px rgba(244, 148, 28, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.lbtn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 40px rgba(244, 148, 28, 0.5);
}

.lbtn-secondary {
  display: inline-flex;
  align-items: center;
  background: transparent;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 1rem;
  padding: 14px 28px;
  border-radius: 50px;
  border: 1px solid rgba(244, 148, 28, 0.2);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
  margin-left: 8px;
}

.lbtn-secondary:hover {
  color: var(--accent2);
  border-color: rgba(244, 148, 28, 0.4);
}

.hero-btns {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* ── Sections ── */
.lsection {
  max-width: 1000px;
  margin: 0 auto;
  padding: 80px 24px;
}

.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 0 auto;
  max-width: 800px;
}

.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.lsection-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
  background: linear-gradient(135deg, var(--text) 50%, var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 40px;
}

/* ── About Grid ── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.about-text p {
  color: var(--text-muted);
  line-height: 1.8;
  font-size: 1rem;
  margin-bottom: 16px;
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  transition: border-color 0.2s;
}

.stat-card:hover {
  border-color: rgba(244, 148, 28, 0.35);
}

.stat-num {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent2);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Announcements ── */
.announcements-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 60px 24px;
}

.announcements-inner {
  max-width: 1000px;
  margin: 0 auto;
}

.announce-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
  transition: border-color 0.2s;
}

.announce-card:hover {
  border-color: rgba(244, 148, 28, 0.4);
}

.announce-type {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(244, 148, 28, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.announce-body {
  flex: 1;
}

.announce-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.announce-text {
  font-size: 0.87rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 8px;
}

.announce-date {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 500;
}

/* ── Events ── */
.events-section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 80px 24px;
}

.event-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 16px;
  transition: border-color 0.2s, transform 0.2s;
}

.event-card:hover {
  border-color: rgba(244, 148, 28, 0.45);
  transform: translateX(3px);
}

.event-card.type-smagam { border-left-color: #f4941c; }
.event-card.type-weekly  { border-left-color: #e8b84b; }
.event-card.type-special { border-left-color: #c0392b; }

.event-date-badge {
  flex-shrink: 0;
  width: 54px;
  background: rgba(244, 148, 28, 0.15);
  border: 1px solid rgba(244, 148, 28, 0.25);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
}

.event-date-month {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1;
}

.event-date-day {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}

.event-body { flex: 1; min-width: 0; }

.event-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.event-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.event-today-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #1a1108;
  background: var(--accent);
  border-radius: 20px;
  padding: 2px 10px;
  box-shadow: 0 0 10px rgba(244, 148, 28, 0.5);
  animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%, 100% { box-shadow: 0 0 8px rgba(244, 148, 28, 0.4); }
  50%       { box-shadow: 0 0 18px rgba(244, 148, 28, 0.75); }
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.event-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.event-desc {
  font-size: 0.87rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.events-empty {
  color: var(--text-muted);
  font-size: 0.95rem;
  padding: 24px 0;
}

/* ── CTA Section ── */
.cta-section {
  text-align: center;
  padding: 80px 24px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.cta-section h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--text) 50%, var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.cta-section p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 40px;
}

/* ── Landing Footer ── */
.landing-footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.landing-footer strong {
  color: var(--accent2);
}

/* ── Landing Responsive ── */
@media (max-width: 640px) {
  .landing-nav { padding: 14px 18px; }
  .nav-links { display: none; }
  .about-grid { grid-template-columns: 1fr; }
  .lbtn-secondary { margin-left: 0; }

  .lhero {
    padding: 75px 20px 40px;
  }

  .hero-logo {
    width: 130px;
    height: 130px;
    margin-bottom: 16px;
  }

  .hero-tag { margin-bottom: 16px; }
  .lhero h1 { margin-bottom: 12px; }

  .hero-subtitle {
    margin-bottom: 24px;
    font-size: 0.95rem;
  }

  .waheguru {
    font-size: 1.15rem;
    margin-bottom: 28px;
  }
}

/* ── PWA Standalone Mode — iPhone Notch / Dynamic Island Fix ──────────────── */
@media (display-mode: standalone) {
  .topbar {
    padding-top: calc(16px + env(safe-area-inset-top, 47px));
  }

  .sidebar-header {
    padding-top: calc(22px + env(safe-area-inset-top, 47px));
  }

  .landing-nav {
    padding-top: calc(16px + env(safe-area-inset-top, 47px));
  }

  .lhero {
    padding-top: calc(120px + env(safe-area-inset-top, 47px));
  }
}