/**
 * Audio Player Bar
 *
 * Collapsible audio player strip below the game header.
 * Toggle button lives in the header-right area.
 * Includes station suggestion chips for the current game's teams.
 */

/* Toggle button in the header */
.audio-toggle-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.85rem;
  min-height: 36px;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.15s ease, color 0.15s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.audio-toggle-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.audio-toggle-btn.playing {
  border-color: var(--green);
  color: var(--green);
}

/* Audio player bar — vertical stack: controls row + station suggestions */
.audio-bar {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 8px calc(16px + env(safe-area-inset-right, 0px)) 8px calc(16px + env(safe-area-inset-left, 0px));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.audio-bar.visible {
  display: flex;
}

/* Top row: play button + URL input + volume + status */
.audio-controls-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Play / pause button */
.audio-play-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.audio-play-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.audio-play-btn.playing {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-glow);
}

/* URL input */
.audio-url-input {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  padding: 6px 10px;
  outline: none;
  transition: border-color 0.15s ease;
}

.audio-url-input::placeholder {
  color: var(--text-dim);
  opacity: 0.6;
}

.audio-url-input:focus {
  border-color: var(--accent);
}

/* Volume slider */
.audio-volume-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.audio-volume-icon-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--text-dim);
  cursor: pointer;
  min-width: 24px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 0;
}

.audio-volume-icon-btn:hover {
  color: var(--accent);
}

.audio-volume-icon-btn:focus-visible {
  border-color: var(--accent);
}

.audio-volume-icon {
  font-size: 0.85rem;
  min-width: 20px;
  text-align: center;
}

.audio-volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 60px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.audio-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
}

.audio-volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* Status label */
.audio-status {
  font-size: 0.68rem;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-status.error {
  color: var(--red);
}

.audio-status.live {
  color: var(--green);
}

/* ─── Station Suggestions ────────────────────────────────────────────────── */

.audio-stations {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Hidden when empty */
.audio-stations:empty {
  display: none;
}

.audio-stations-label {
  font-size: 0.68rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.audio-station-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg);
  text-decoration: none;
  font-size: 0.72rem;
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.audio-station-chip:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.audio-station-team {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.7rem;
}

.audio-station-name {
  color: var(--text);
}

.audio-station-freq {
  color: var(--text-dim);
  font-size: 0.65rem;
}

/* Responsive: small phones */
@media (max-width: 390px) {
  .audio-volume-slider { width: 40px; }
  .audio-status { display: none; }
  .audio-station-freq { display: none; }
}
