﻿/* ---------- Mini player ---------- */

/* Mock look: a full-width flush black bar docked above the nav with transport
   controls and a thin white progress line along its bottom edge. */
#mini {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--nav-h) + var(--safe-bottom));
  background: #050506;
  border-top: 1px solid var(--border);
  border-radius: 0;
  z-index: 20;
  overflow: hidden;
  cursor: pointer;
  transform: translateY(0);
  transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.3, 1), opacity 0.2s ease;
}
#mini.hidden {
  transform: translateY(90px);
  opacity: 0;
  pointer-events: none;
}
.mini-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 10px 14px;
}
.mini-cover {
  width: 44px; height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background-color: var(--surface);
  flex-shrink: 0;
}
.mini-meta { flex: 1; min-width: 0; }
.mini-title { font-size: 13.5px; font-weight: 500; letter-spacing: 0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-sub { font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.mini-transport { display: flex; align-items: center; gap: 0; flex-shrink: 0; }
.mini-transport .iconbtn { width: 40px; height: 40px; color: var(--text); }
.mini-transport .iconbtn svg { width: 20px; height: 20px; }
.mini-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 18px; /* touch target overhanging the bar's bottom edge */
  touch-action: none;
  cursor: pointer;
}
.mini-progress::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.18);
}
.mini-progress i {
  position: absolute;
  left: 0; bottom: 0;
  display: block;
  height: 2px;
  width: 0;
  background: #fff;
  /* NO width transition here: the player tick writes a new width every
     250ms and a transition toward it would restart 4x/s - the bar never
     stops animating, invalidating style+layout ~15x/s on EVERY screen while
     music plays (measured: 200+ invalidations in a 4s scroll window, the
     main cause of janky list scrolling during playback). The 4Hz steps are
     invisible at this bar's 2px height. */
}

/* ---------- Full player ---------- */

.fullplayer {
  --fp-art-h: clamp(240px, 47vh, 520px);
  position: absolute;
  inset: 0;
  background: var(--bg);
  z-index: 52;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.3, 1), opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.fullplayer.open { transform: translateY(0); opacity: 1; }

/* Header controls float over the scrolling content (art scrolls away under
   them; drop-shadows keep them legible over bright artwork and lyrics). */
.fp-head {
  position: absolute;
  top: calc(var(--safe-top) + 4px);
  left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  z-index: 3;
  pointer-events: none;
}
.fp-head .iconbtn {
  width: 40px; height: 40px;
  color: #fff;
  background: rgba(10, 10, 16, 0.4); /* legible over scrolled lyrics/art */
  border-radius: 50%;
  flex-shrink: 0;
  pointer-events: auto;
}

.fp-scroll {
  flex: 1;
  min-height: 0;
  position: relative;
  z-index: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0 22px calc(26px + var(--safe-bottom));
}

/* Full-width artwork that SCROLLS with the content (like the old boxed art,
   but edge-to-edge per the Now Playing design). "Now Playing" is absolutely
   positioned inside so it scrolls away together with the art. */
.fp-artblock {
  position: relative;
  height: var(--fp-art-h);
  margin: 0 -22px; /* bleed over the scroll padding - edge to edge */
}
.fp-artblock::before {
  /* readability scrim under the fixed header buttons + title */
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 120px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent);
  pointer-events: none;
  z-index: 1;
}
.fp-artblock::after {
  /* blends the art's bottom edge into the meta area */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 130px;
  background: linear-gradient(180deg, transparent, var(--bg));
  pointer-events: none;
  z-index: 1;
}
.fp-artblock img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  animation: artfade 0.5s ease both; /* fade in once decoded - no flash */
}
@keyframes artfade { from { opacity: 0; } to { opacity: 1; } }
.fp-headtitle {
  position: absolute;
  top: calc(var(--safe-top) + 14px);
  left: 0; right: 0;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  z-index: 2;
}
/* Art placeholder: PURE BLACK + a slow diagonal sheen sweeping through and a
   small equalizer breathing at the center - monochrome, calm, music. */
.fp-artph {
  width: 100%; height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
}
.fp-artph::before {
  content: "";
  position: absolute;
  top: -25%; bottom: -25%;
  left: -75%;
  width: 55%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.07), transparent);
  transform: skewX(-12deg);
  animation: fpsheen 3.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  pointer-events: none;
}
@keyframes fpsheen {
  0% { left: -75%; }
  60%, 100% { left: 135%; }
}
.fp-eq {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 46px;
}
.fp-eq i {
  width: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.85);
  height: 30%;
  animation: fpeq 1.4s ease-in-out infinite;
}
.fp-eq i:nth-child(1) { animation-delay: -0.1s; }
.fp-eq i:nth-child(2) { animation-delay: -0.4s; }
.fp-eq i:nth-child(3) { animation-delay: -0.7s; }
.fp-eq i:nth-child(4) { animation-delay: -1s; }
.fp-eq i:nth-child(5) { animation-delay: -1.3s; }
@keyframes fpeq {
  0%, 100% { height: 20%; opacity: 0.55; }
  50% { height: 100%; opacity: 1; }
}
/* art still generating: quiet caption rides the placeholder's bottom edge */
.fp-artcap {
  position: absolute;
  bottom: 18px;
  left: 0; right: 0;
  text-align: center;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.fp-meta { margin-top: 10px; text-align: left; }
.fp-title { font-size: 24px; font-weight: 700; line-height: 1.1; }
.fp-sub { font-size: 14px; color: var(--text-2); margin-top: 5px; }
.fp-meta .fppill { margin-top: 14px; padding: 9px 22px; font-size: 13px; }

.fp-seek { margin-top: 18px; }
.fp-wave { width: 100%; height: 64px; display: block; touch-action: none; }
.fp-times {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-2);
  padding-top: 4px;
}

.fp-transport {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 6px 2px;
}
/* Shuffle/repeat state lives in the GLYPH, not color: slashed icon = off,
   repeat-one adds the "1" chip. Off buttons also FADE - glyph + fade together
   make the state unmistakable. All on-state icons stay full-white. */
.fp-transport .iconbtn {
  color: var(--text);
  transition: transform 0.16s cubic-bezier(0.34, 1.2, 0.64, 1), opacity 0.18s ease;
}
.fp-transport .fp-shuffle.off,
.fp-transport .fp-repeat.off { opacity: 0.45; }
.fp-transport .iconbtn:active { transform: scale(0.88); }
.fp-transport .fp-prev, .fp-transport .fp-next { width: 42px; height: 42px; }
/* Material filled glyphs run visually lighter than the old hand-drawn set -
   bump the player controls a notch. */
.fp-transport .iconbtn svg { width: 23px; height: 23px; }
.fp-transport .fp-prev svg, .fp-transport .fp-next svg { width: 27px; height: 27px; }
.fp-transport .fp-repeat { position: relative; }
.fp-transport .fp-repeat .one {
  position: absolute;
  top: 1px; right: 1px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  background: #fff;
  color: #000;
  border-radius: 7px;
  padding: 2px 4px;
  animation: modedot 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modedot {
  from { transform: scale(0); }
  to { transform: scale(1); }
}
.fp-toggle.main {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.fp-toggle.main svg { width: 34px; height: 34px; }

.fp-actionsrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 10px 2px;
}
.fp-actionsrow .iconbtn { color: var(--text); }
.fp-actionsrow .iconbtn.on { color: #fff; }
.fp-actionsrow .iconbtn:active { transform: scale(0.88); }
.fp-actionsrow .iconbtn svg { width: 21px; height: 21px; }
.fp-like { color: var(--text); }
.fp-like.hearted { color: var(--heart); }

.fppill {
  padding: 8px 18px;
  border-radius: 50px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
}
.fppill.on {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--text);
}

.fp-extra { min-height: 12px; }
.fp-empty { text-align: center; color: var(--text-2); font-size: 13px; padding: 22px 0; }

.fp-lyrics { padding: 10px 2px; }
.lyline {
  text-align: center;
  padding: 6px 8px;
  font-size: 15px;
  line-height: 1.45;
  color: rgba(244, 244, 248, 0.72);
  transition: color 0.2s ease;
}
.lyline.marker { font-size: 12px; font-weight: 700; color: var(--text-2); }
.lyline.active { color: #fff; font-weight: 700; }

.fp-queue { padding: 6px 0; }
.qitem {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
}
.qitem.current { background: var(--elevated); }
.qitem img, .qitem .ph {
  width: 36px; height: 36px;
  border-radius: 6px;
  object-fit: cover;
  background-color: var(--surface);
  flex-shrink: 0;
}
.qitem .qm { flex: 1; min-width: 0; }
.qitem .qt { font-size: 12px; font-weight: 500; letter-spacing: 0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qitem .qs { font-size: 11px; color: var(--text-2); }
.qitem svg { width: 16px; height: 16px; color: var(--text-2); }

/* Queue as a bottom-sheet modal over the full player (.bubblesheet base gives
   the swipe-up transition, 76vh cap, scrim, z-index above .fullplayer). */
.queuesheet .fp-queue { padding: 2px 4px 0; }
.queuesheet .qhead { display: flex; align-items: center; gap: 8px; padding: 4px 10px 10px; }
.queuesheet .qhead .bstitle { flex: 1; padding: 0; }
.queuesheet .qcount { font-size: 11px; color: var(--text-2); white-space: nowrap; }
.queuesheet .qclear {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  padding: 7px 12px;
  border-radius: 50px;
  background: var(--surface);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.queuesheet .qremove,
.queuesheet .qhandle {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  flex-shrink: 0;
}
.queuesheet .qremove svg { width: 15px; height: 15px; color: var(--text-2); }
.queuesheet .qremove:active svg { color: var(--danger); }
.queuesheet .qhandle svg { width: 16px; height: 16px; color: var(--text-2); }
.queuesheet .qhandle:active { color: var(--text); }
.queuesheet .qitem.dragging {
  position: relative;
  z-index: 2;
  background: var(--elevated);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}
