/* ═══ Player — light, clean ═══ */
.player-bar {
  position: fixed; bottom: 0; left: 0; right: 0; min-height: var(--player-h);
  background: var(--surface); border-top: 1px solid var(--border); z-index: 150;
  display: flex; flex-direction: column; padding: 0 var(--sp-6) var(--sp-3);
  transform: translateY(100%); transition: transform 0.3s var(--ease);
}
.player-bar.visible { transform: translateY(0); }
.player-bar.expanded { min-height: 280px; }

.player-main-row {
  display: flex; align-items: center; gap: var(--sp-4); padding-top: var(--sp-3); flex: 1;
  min-height: calc(var(--player-h) - var(--sp-3));
}
.player-scrub-row { width: 100%; }
#playerCoverWrap { flex-shrink: 0; }
.player-cover, .player-cover-placeholder {
  width: 48px; height: 48px; border-radius: var(--r-md); object-fit: cover; background: var(--elevated);
}
.player-cover-placeholder { display: flex; align-items: center; justify-content: center; color: var(--text-muted); }

.player-info { flex: 1; min-width: 0; }
.player-title { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-ep-label { font-size: 12px; font-family: var(--font-mono); color: var(--text-muted); }

.player-controls { display: flex; align-items: center; gap: var(--sp-2); flex-shrink: 0; }
.player-btn {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: var(--text-2); transition: background var(--t-fast) var(--ease);
}
.player-btn:hover { background: var(--elevated); color: var(--text); }
.player-btn.play-pause {
  width: 44px; height: 44px; border-radius: 50%; background: var(--black); color: var(--text-inverse);
}
.player-btn.play-pause:hover { background: #292929; }

.player-download-btn {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: none; align-items: center; justify-content: center;
  color: var(--text-2); text-decoration: none;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.player-download-btn:hover { background: var(--elevated); color: var(--accent); }

.player-progress-wrap { width: 100%; display: flex; flex-direction: column; gap: 4px; }
.player-progress {
  width: 100%; height: 4px; background: var(--elevated); border-radius: var(--r-full); cursor: pointer; overflow: hidden;
}
.player-progress-fill {
  height: 100%; background: var(--accent); border-radius: var(--r-full); pointer-events: none; transition: width 0.1s linear;
}
.player-times {
  display: flex; justify-content: space-between; font-size: 11px; font-family: var(--font-mono); color: var(--text-muted);
}

.player-volume-wrap {
  display: flex; align-items: center; gap: var(--sp-2); flex-shrink: 0;
  min-height: 24px; /* área estável para o range; evita thumb “caindo” fora da trilha */
}
.player-volume {
  width: 80px;
  height: 20px; /* > altura da trilha: WebKit centraliza trilha+thumb no eixo Y */
  margin: 0;
  padding: 0;
  background: transparent;
  border-radius: var(--r-full);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  vertical-align: middle;
  align-self: center;
}
/* Thumb alinhado ao centro da trilha (4px): (12 − 4) / 2 = 4px */
.player-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: none;
}
.player-volume::-webkit-slider-runnable-track {
  height: 4px;
  background: linear-gradient(to right, var(--accent) var(--vol, 80%), var(--elevated) var(--vol, 80%));
  border-radius: var(--r-full);
}
.player-volume::-moz-range-track {
  height: 4px;
  background: linear-gradient(to right, var(--accent) var(--vol, 80%), var(--elevated) var(--vol, 80%));
  border-radius: var(--r-full);
}
.player-volume::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.player-expand-btn {
  width: 36px; height: 36px; border-radius: var(--r-md); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.player-expand-btn:hover { background: var(--elevated); color: var(--text); }

.player-expanded-panel {
  display: none; flex-direction: column; gap: var(--sp-3); border-top: 1px solid var(--border);
  margin-top: var(--sp-2); padding-top: var(--sp-3); padding-bottom: var(--sp-2);
}
.player-bar.expanded .player-expanded-panel { display: flex; }
.player-chapters-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.player-chapters { display: flex; flex-wrap: wrap; gap: var(--sp-2); max-height: 160px; overflow-y: auto; }
.player-chapter {
  font-size: 12px; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-full); background: var(--elevated);
  border: 1px solid var(--border); color: var(--text-2);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.player-chapter:hover, .player-chapter.active {
  border-color: var(--border-hover); background: var(--surface); color: var(--text);
}
.player-chapters-empty { font-size: 13px; color: var(--text-muted); }

/* Trim UI */
.player-trim-section {
  border-top: 1px solid var(--border-subtle, var(--border));
  padding-top: var(--sp-3);
  margin-top: var(--sp-2);
}
.player-trim-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: var(--sp-2);
}
.player-trim-row {
  display: flex; gap: var(--sp-2); align-items: flex-end;
}
.player-trim-field {
  display: flex; flex-direction: column; gap: 2px;
}
.player-trim-field label {
  font-size: 10px; color: var(--text-muted); text-transform: uppercase;
}
.player-trim-input {
  width: 70px; padding: 6px 8px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--surface, var(--bg));
  color: var(--text); font-size: 13px; font-family: var(--font-mono, monospace);
  text-align: center;
}
.player-trim-input:focus { border-color: var(--accent); outline: none; }
.player-trim-btn { padding: 6px 16px; font-size: 13px; }
.player-trim-status { margin-top: var(--sp-2); font-size: 12px; }

@media (max-width: 768px) {
  .player-scrub-row { display: none; }
  .player-volume-wrap { display: none; }
  .player-bar { padding: 0 var(--sp-4) var(--sp-2); }
  .player-main-row { gap: var(--sp-3); }
}
