/* ════════════════════════════════════════════════════════════════════════
   GLOBAL PLAYER SHEET — true-glass bottom-up overlay
   Neutral tones (no purple); rises to mid-screen.
   ════════════════════════════════════════════════════════════════════════ */

/* ── Floating FABs (right = player, see menu.css for left = nav) ── */
.player-fab {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.20);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  color: rgba(236, 232, 244, 0.92);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s, color 0.2s;
  z-index: 850;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.12),
              inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}
.player-fab svg {
  width: 1.7rem;
  height: 1.7rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.player-fab .fab-play-poly {
  fill: currentColor;
  stroke: none;
}
.player-fab:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.40);
  transform: scale(1.06);
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.30),
              inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}
.player-fab.open {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.50);
  color: #fff;
  transform: scale(1.04);
}
/* Pulse ring when audio playing — neutral white */
.player-fab.playing::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid currentColor;
  opacity: 0.4;
  animation: fab-pulse 2s ease-out infinite;
  pointer-events: none;
}
@keyframes fab-pulse {
  0%   { transform: scale(1);    opacity: 0.4; }
  100% { transform: scale(1.35); opacity: 0; }
}

/* ── Sheet overlay base ────────────────────────────────────────── */
.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
}
.sheet-overlay.open { pointer-events: all; }

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.08);
  opacity: 0;
  transition: opacity 0.30s ease;
}
.sheet-overlay.open .sheet-backdrop { opacity: 1; }

/* The glass sheet — half-screen, very glassy, neutral.
   We use a low-opacity dark tint + heavy backdrop blur so whatever is
   behind (painting backdrop, flow ribbons) becomes a soft frosted wash. */
.sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 50vh;
  background: rgba(12, 12, 18, 0.18);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 1.25rem 1.25rem 0 0;
  padding: 0.5rem 1.1rem 1.3rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateY(100%);
  transition: transform 0.30s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  color: #f0f0f4;
  box-shadow: 0 -1rem 2.5rem rgba(0, 0, 0, 0.28),
              inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
}
.sheet::-webkit-scrollbar { width: 2px; }
.sheet::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 2px; }
.sheet-overlay.open .sheet { transform: translateY(0); }

.sheet-handle {
  width: 2.5rem;
  height: 3px;
  background: rgba(255, 255, 255, 0.30);
  border-radius: 2px;
  align-self: center;
  flex-shrink: 0;
  margin: 0.1rem 0 0.2rem;
}

/* "now playing" label removed visually — handle alone is enough. */
.sheet-header { display: none; }

/* ── Player content inside sheet ───────────────────────────────── */
.player-sheet-body {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.player-now {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}
.player-thumb {
  width: 3.25rem;
  height: 3.25rem;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  opacity: 1;
  background: rgba(255, 255, 255, 0.06);
}
.player-thumb-placeholder {
  width: 3.25rem;
  height: 3.25rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  flex-shrink: 0;
}
.player-now-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.player-now-title {
  font-size: 0.875rem;
  font-weight: 300;
  color: #f4f4f6;
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-now-album {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.08em;
  margin-top: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}
.ctrl-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s, transform 0.15s;
  color: #f0f0f4;
}
.ctrl-btn:hover { opacity: 0.7; transform: scale(1.05); }
.ctrl-btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none; }
.ctrl-btn svg {
  stroke: currentColor;
  fill: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ctrl-btn.skip svg { width: 1.5rem; height: 1.5rem; }
.ctrl-btn.play  svg { width: 2.5rem; height: 2.5rem; }

.player-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.player-progress .progress-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  user-select: none;
  touch-action: none;
}
.player-progress .progress-fill {
  height: 100%;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 3px;
  width: 0%;
  pointer-events: none;
  transition: width 80ms linear;
}
.player-progress .time-label {
  font-size: 0.625rem;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.05em;
  min-width: 2rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.player-vol {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.player-vol svg {
  width: 0.875rem;
  height: 0.875rem;
  stroke: rgba(255, 255, 255, 0.55);
  fill: none;
  stroke-width: 1.5;
}
.player-vol input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 2px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.player-vol input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.90);
  cursor: pointer;
  border: none;
}
.player-vol input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.90);
  cursor: pointer;
  border: none;
}

/* ── Tracklist inside sheet ────────────────────────────────────── */
/* Toggle is gone — tracklist is always visible and the sheet body
   itself scrolls when content overflows. */
.player-tracklist-toggle { display: none; }

.player-tracklist {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  padding-top: 0.4rem;
}

.pt-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.4rem 0.31rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}
.pt-row:hover { background: rgba(255, 255, 255, 0.06); }
.pt-row.active { background: rgba(255, 255, 255, 0.12); }
.pt-row.active .pt-name { color: #f4f4f6; }
.pt-num {
  font-size: 0.625rem;
  color: rgba(255, 255, 255, 0.45);
  min-width: 1.25rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.pt-name {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.70);
  letter-spacing: 0.06em;
  font-weight: 300;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-empty {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
  padding: 1.5rem 1rem;
  letter-spacing: 0.08em;
  font-weight: 300;
  font-style: italic;
}

/* ── Mobile ─────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .player-fab {
    bottom: calc(1.25rem + env(safe-area-inset-bottom));
    right: 1.25rem;
    width: 4rem;
    height: 4rem;
  }
  .sheet { max-height: 70vh; padding: 0.5rem 0.9rem 1.2rem; }
  .player-controls { gap: 1.6rem; }
}
