/* ==========================================================================
  ErAudio CLASSIC SKIN & PITCHFORK PLUGIN STYLESHEET
   ========================================================================== */

:root {
  --bg-dark: #121214;
  --panel-bg: #27272f;
  --panel-bg-light: #383845;
  --panel-border-light: #525266;
  --panel-border-dark: #0f0f13;
  
  --titlebar-bg-start: #000080;
  --titlebar-bg-end: #1084d0;
  --titlebar-text: #ffffff;
  
  --lcd-bg: #0f1c0f;
  --lcd-green: #00ff33;
  --lcd-green-glow: #00ff3388;
  --lcd-yellow: #ccff00;
  --lcd-dim: #003300;

  --accent-gold: #ffcc00;
  --accent-orange: #ff6600;
  --accent-red: #ff3333;
  
  --font-digital: 'VT323', monospace, cursive;
  --font-mono: 'Share Tech Mono', monospace;
  --font-sans: 'Trebuchet MS', Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

button,
input {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
.title-bar-brand:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}

.tooltip-target {
  position: relative;
}

.tooltip-target::after {
  background: #050506;
  border: 1px solid var(--accent-gold);
  color: #ffffff;
  content: attr(data-tooltip);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: normal;
  left: 50%;
  max-width: 220px;
  opacity: 0;
  padding: 4px 6px;
  pointer-events: none;
  position: absolute;
  text-align: center;
  top: calc(100% + 7px);
  transform: translate(-50%, -3px);
  transition: opacity 120ms ease, transform 120ms ease;
  visibility: hidden;
  white-space: normal;
  width: max-content;
  z-index: 10;
}

.tooltip-target:hover::after,
.tooltip-target:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
  visibility: visible;
}

.transport-buttons .tooltip-target::after,
.title-bar-brand.tooltip-target::after {
  left: 0;
  transform: translate(0, -3px);
}

.toggle-buttons .tooltip-target::after {
  left: auto;
  right: 0;
  transform: translate(0, -3px);
}

.transport-buttons .tooltip-target:hover::after,
.transport-buttons .tooltip-target:focus-visible::after,
.title-bar-brand.tooltip-target:hover::after,
.title-bar-brand.tooltip-target:focus-visible::after,
.toggle-buttons .tooltip-target:hover::after,
.toggle-buttons .tooltip-target:focus-visible::after {
  transform: translate(0, 0);
}

.yt-host {
  height: 1px;
  left: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  position: fixed;
  top: 0;
  width: 1px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.open-dialog {
  width: min(420px, calc(100vw - 28px));
  margin: auto;
  padding: 4px;
  color: #cccccc;
  background: var(--panel-bg);
  border: 2px solid var(--panel-border-light);
  box-shadow: 4px 6px 24px #000000cc;
}

.open-dialog::backdrop {
  background: #000000b8;
}

.open-dialog-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.open-dialog .title-bar {
  cursor: default;
}

.open-dialog-body {
  display: grid;
  gap: 7px;
  padding: 4px 6px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.open-dialog-body input {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  color: var(--lcd-green);
  background: #080b08;
  border: 1px solid var(--panel-border-dark);
  font-family: var(--font-mono);
  user-select: text;
}

.open-dialog-body a {
  color: var(--accent-gold);
}

.open-dialog-error {
  min-height: 14px;
  color: #ff7777;
}

.open-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 6px 6px;
}

.open-dialog-actions .pl-btn {
  min-width: 74px;
  min-height: 26px;
}

.open-dialog-actions .open-submit {
  color: var(--accent-gold);
}

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(#1a1a24 15%, transparent 16%),
    radial-gradient(#1a1a24 15%, transparent 16%);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
  color: #cccccc;
  font-family: var(--font-sans);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 100vh;
}

/* ==========================================================================
  ErAudio CONTAINER & WINDOW SHELL
   ========================================================================== */

.winamp-container {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  gap: 12px;
  width: 100%;
}

.login-notice {
  padding: 8px;
  color: #ffffff;
  background: var(--panel-bg);
  border: 1px solid var(--accent-gold);
  font: 12px/1.5 var(--font-mono);
}

.login-notice a {
  color: var(--accent-gold);
}

.winamp-window[hidden] {
  display: none;
}

.winamp-window {
  background: var(--panel-bg);
  border-top: 2px solid var(--panel-border-light);
  border-left: 2px solid var(--panel-border-light);
  border-right: 2px solid var(--panel-border-dark);
  border-bottom: 2px solid var(--panel-border-dark);
  box-shadow: 4px 6px 16px rgba(0, 0, 0, 0.6);
  padding: 3px;
  border-radius: 2px;
}

/* TITLE BAR */
.title-bar {
  background: linear-gradient(90deg, #111e38 0%, #2b4980 40%, #172c54 100%);
  border-bottom: 1px solid var(--panel-border-dark);
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  cursor: move;
}

.title-bar-text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: bold;
  color: var(--accent-gold);
  letter-spacing: 1px;
  text-shadow: 1px 1px 0 #000000;
}

.pane-title {
  position: relative;
  padding-inline-end: 26px;
}

.pane-minimize {
  position: absolute;
  inset-inline-end: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 16px;
  padding: 0;
  border: 1px solid var(--panel-border-light);
  background: var(--panel-bg);
  color: var(--accent-gold);
  font: bold 14px/1 var(--font-mono);
  cursor: pointer;
}

.pane-minimize:hover {
  background: var(--panel-bg-light);
}

.title-bar-brand {
  flex-shrink: 0;
  margin-right: 8px;
}

.title-bar-login {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
}

.title-bar-login:hover {
  color: #ffffff;
}

#youtube-login {
  flex: 1 1 0;
  min-width: 0;
  text-align: left;
}

#youtube-login-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#youtube-settings {
  flex-shrink: 0;
  margin: 0 8px;
}

/* ==========================================================================
   MAIN PLAYER WINDOW
   ========================================================================== */

.main-window {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  min-height: 0;
  max-height: 100dvh;
  overflow-y: auto;
  gap: 6px;
  padding: 6px;
}

.main-window.panel-sized {
  flex: 0 0 auto;
}

/* LCD DISPLAY PANEL */
.display-panel {
  background: var(--lcd-bg);
  border: 2px solid var(--panel-border-dark);
  box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.9);
  padding: 6px;
  display: flex;
  flex: 1 0 auto;
  border-radius: 2px;
}

.display-overlay {
  position: absolute;
  inset: 0 0 auto;
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr) auto;
  gap: 8px;
  height: 38px;
  background: linear-gradient(180deg, #000000bb, #00000066 75%, transparent);
  pointer-events: none;
}

#playback-indicator {
  position: absolute;
  inset-inline-start: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  line-height: 1;
  letter-spacing: normal;
}

.timer-display {
  position: relative;
  cursor: pointer;
  font-family: var(--font-digital);
  font-size: 38px;
  color: var(--lcd-green);
  text-shadow: 0 0 3px #000000, 0 0 6px var(--lcd-green-glow);
  line-height: 32px;
  letter-spacing: 2px;
  background: transparent;
  padding: 2px 6px;
  border: 0;
  pointer-events: auto;
  text-align: center;
}

.audio-info {
  display: flex;
  gap: 4px;
  justify-content: space-between;
}

.info-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--lcd-dim);
  background: #061006;
  padding: 1px 3px;
  border: 1px solid #003300;
}

.info-badge.active {
  color: var(--lcd-yellow);
  text-shadow: 0 0 4px #ccff00aa;
}

.marquee-container {
  display: flex;
  align-items: center;
  padding: 3px 6px;
  overflow: hidden;
  white-space: nowrap;
  pointer-events: auto;
  cursor: grab;
  user-select: none;
}

.marquee-text {
  --marquee-duration: 12s;
  flex: none;
  font-family: var(--font-digital);
  font-size: 18px;
  color: var(--lcd-green);
  text-shadow: 0 0 3px #000000, 0 0 4px var(--lcd-green-glow);
  display: inline-block;
  animation: marquee var(--marquee-duration) linear infinite;
  animation-delay: calc(-1 * var(--marquee-duration) * var(--marquee-progress, 0));
}

.marquee-container.manual-scroll .marquee-text {
  animation: none;
  transform: translateX(var(--marquee-offset));
}

@keyframes marquee {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

.vis-container {
  flex: 1 1 0;
  min-width: 0;
  background: #040a04;
  border: 1px solid #003300;
  min-height: 36px;
  padding: 4px 6px;
  color: #a4baa4;
  font: 10px var(--font-mono);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(80px, 1fr) auto;
  gap: 3px;
}

.spectrum-area {
  min-height: 80px;
  position: relative;
}

.spectrum-area:fullscreen {
  background: #040a04;
}

#visualizer-fullscreen {
  align-self: center;
  margin-inline-end: 4px;
  width: 28px;
  height: 28px;
  padding: 0;
  font: 18px/1 system-ui, sans-serif;
  pointer-events: auto;
}

#visualizer-fullscreen:disabled {
  opacity: 0.5;
  cursor: default;
}

#live-spectrum {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 2px #ffffff40);
}

#visualizer-play {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

#visualizer-play:focus-visible {
  outline-offset: -2px;
}

.live-level-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 8px;
}

#live-level-share:disabled {
  opacity: 0.6;
  cursor: default;
}

/* SCRUBBER BAR */
.scrubber-panel {
  padding: 2px 0;
}

.scrubber-track {
  position: relative;
  padding-top: 12px;
}

.scrubber-track .scrubber {
  display: block;
}

.listen-heat {
  height: 5px;
  margin: 3px 6px 0;
  background-color: #080f08;
  border: 1px solid #003300;
  background-size: 100% 100%;
}

.marker-heat {
  flex: none;
  margin-left: auto;
  padding: 0 5px;
  border: 1px solid #111;
  color: #ffffff;
  font: 10px/1.6 var(--font-mono);
  text-shadow: 0 0 2px #000;
}

.playlist-item.has-heat {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.history-list {
  flex: 1 1 0;
  min-height: 54px;
  overflow-y: auto;
  padding: 6px;
  background: #080f08;
  border: 1px solid #003300;
  box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.9);
}

.history-window {
  height: 260px;
  min-height: min-content;
  max-height: 80vh;
}

.history-window.panel-sized {
  flex: 0 0 auto;
}

.history-window .playlist-body {
  flex: 1 1 0;
}

.history-help-panel {
  margin-top: 4px;
}

.history-help-panel .history-note {
  margin: 2px 0 0;
}

.panel-resize {
  flex: 0 0 10px;
  width: 100%;
  height: 10px;
  border: 0;
  border-top: 1px solid #666677;
  background: transparent;
  color: var(--accent-gold);
  cursor: ns-resize;
  touch-action: none;
}

.panel-resize::before {
  content: '\2195';
  display: block;
  font: 12px/8px var(--font-mono);
  opacity: 0;
  text-align: center;
  transition: opacity 120ms ease;
}

.main-window .panel-resize::before {
  opacity: 0.5;
}

.panel-resize:hover::before,
.panel-resize:focus-visible::before,
.panel-resize.resizing::before {
  opacity: 1;
}

.playlist-item.history-item {
  padding: 3px 6px;
  color: var(--lcd-green);
  font-family: var(--font-digital);
  font-size: 16px;
  border-bottom: 1px solid #0f1f0f;
  white-space: normal;
  overflow-wrap: anywhere;
}

.history-item .history-detail {
  display: block;
  color: var(--accent-gold);
  font: 10px var(--font-mono);
}

.history-note {
  margin: 4px 0 0;
  color: #aaaaaa;
  font: 10px/1.4 var(--font-mono);
}

.history-sync-actions:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 4px;
}

.history-sync-help {
  flex: 0 0 24px;
  min-width: 24px;
  padding-inline: 0;
  font-weight: bold;
}

.history-sync-help[aria-pressed="true"] {
  background: linear-gradient(180deg, #8a7a26 0%, #b89a24 100%);
  border-color: #f0d35a #665600 #665600 #f0d35a;
  color: #fff4b0;
  box-shadow: 0 0 5px #ccff0088, inset 1px 1px 2px #fff4a866;
  text-shadow: 0 0 3px #ffcc00;
}

.history-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
}

.history-actions label,
.history-actions select {
  color: var(--accent-gold);
  font: 10px var(--font-mono);
}

.history-actions select {
  background: #080f08;
  border: 1px solid #003300;
  padding: 2px 4px;
}

.history-view {
  display: inline-flex;
  padding: 1px;
  border: 1px solid #666677;
  border-radius: 999px;
  background: #202028;
}

.history-view label {
  position: relative;
  color: #cccccc;
}

.history-view input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.history-view span {
  display: block;
  padding: 2px 6px;
  border-radius: 999px;
}

.history-view input:checked + span {
  background: #ebcb69;
  color: #202028;
}

.history-view input:focus-visible + span {
  outline: 1px solid var(--lcd-yellow);
  outline-offset: 1px;
}

#history-clear:hover {
  background: #f5abab;
  border-color: #ffcccc;
  color: #3b1414;
}

.saved-locations {
  position: absolute;
  inset: 0 6px auto;
  height: 8px;
  pointer-events: none;
}

.saved-location {
  position: absolute;
  top: 0;
  width: 7px;
  height: 8px;
  padding: 0;
  border: 1px solid #111;
  background: var(--accent-gold);
  transform: translateX(-50%);
  cursor: pointer;
  pointer-events: auto;
}

.memory-message:not(:empty) {
  padding: 4px 6px;
  color: #ffffff;
  font: 11px/1.4 var(--font-mono);
}

.memory-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.live-bpm {
  margin-left: auto;
  margin-right: 7px;
  color: #a0a0a0;
  font: bold 12px var(--font-mono);
  white-space: nowrap;
}

.live-bpm.active {
  color: var(--accent-gold);
}

.locations-panel {
  border: 1px solid var(--panel-border-dark);
  background: #080f08;
}

.locations-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  color: var(--accent-gold);
  font: 10px var(--font-mono);
}

.locations-heading h2 {
  font: inherit;
}

.locations-hint {
  color: #aabb99;
  font: 10px var(--font-mono);
  padding: 0 6px;
}

.locations-list {
  display: flex;
  flex-direction: column;
  max-height: 160px;
  overflow-y: auto;
  padding: 4px;
}

.locations-actions {
  padding: 4px 6px;
}

.locations-actions .pl-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.location-editor:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  color: #cccccc;
  font: 11px var(--font-mono);
}

.location-editor input {
  background: #101810;
  border: 1px solid #557755;
  color: var(--lcd-green);
  padding: 4px;
  user-select: text;
}

.location-edit-error:not(:empty) {
  color: #ff9999;
}

.locations-entry {
  border: 0;
  background: transparent;
  color: var(--lcd-green);
  cursor: pointer;
  font: 14px var(--font-mono);
  padding: 3px 4px;
  text-align: left;
}

.locations-entry::before {
  content: '▶';
  display: inline-block;
  visibility: hidden;
  width: 1.4em;
}

.locations-entry[aria-current="true"]::before {
  visibility: visible;
}

.locations-entry:hover,
.locations-entry[aria-current="true"] {
  background: #004400;
}

/* CONTROL PANEL */
.control-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, #32323d 0%, #1f1f26 100%);
  border: 1px solid var(--panel-border-dark);
  padding: 6px;
  gap: 8px;
}

.transport-buttons {
  display: flex;
  gap: 2px;
}

.transport-btn {
  background: linear-gradient(180deg, #505060 0%, #252530 100%);
  border-top: 1px solid #75758a;
  border-left: 1px solid #75758a;
  border-right: 1px solid #111;
  border-bottom: 1px solid #111;
  color: #e0e0e0;
  font-size: 11px;
  width: 24px;
  height: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.transport-btn:active {
  border-top: 1px solid #111;
  border-left: 1px solid #111;
  border-right: 1px solid #75758a;
  border-bottom: 1px solid #75758a;
  background: #1a1a22;
}

.sliders-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  padding: 0 6px;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.slider-row label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: #aaaaaa;
  width: 24px;
}

/* CUSTOM RANGE SLIDERS */
.winamp-slider {
  appearance: none;
  -webkit-appearance: none;
  background: #111116;
  border: 1px solid #000;
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.8);
  height: 8px;
  width: 100%;
  border-radius: 2px;
  outline: none;
}

.winamp-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 14px;
  background: linear-gradient(180deg, #6e6e82 0%, #30303d 100%);
  border-top: 1px solid #9999b0;
  border-left: 1px solid #9999b0;
  border-right: 1px solid #111;
  border-bottom: 1px solid #111;
  cursor: pointer;
  border-radius: 1px;
}

.winamp-slider::-moz-range-thumb {
  width: 12px;
  height: 14px;
  background: linear-gradient(180deg, #6e6e82 0%, #30303d 100%);
  border-top: 1px solid #9999b0;
  border-left: 1px solid #9999b0;
  border-right: 1px solid #111;
  border-bottom: 1px solid #111;
  cursor: pointer;
  border-radius: 1px;
}

.toggle-buttons {
  display: flex;
  gap: 3px;
}

.toggle-btn {
  background: linear-gradient(180deg, #484857 0%, #202029 100%);
  border-top: 1px solid #6b6b7d;
  border-left: 1px solid #6b6b7d;
  border-right: 1px solid #111;
  border-bottom: 1px solid #111;
  color: #888888;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: bold;
  padding: 4px 6px;
  cursor: pointer;
}

.toggle-btn.active {
  color: var(--accent-gold);
  text-shadow: 0 0 3px #ffcc0088;
}

.transport-btn.play.playing {
  border: 2px solid var(--accent-gold);
}

.transport-btn.play.pulsing {
  animation: play-border-pulse 2.4s ease-in-out infinite;
}

@keyframes play-border-pulse {
  0%, 100% { border-color: var(--accent-gold); }
  50% { border-color: #806600; }
}

@media (prefers-reduced-motion: reduce) {
  .transport-btn.play.pulsing {
    animation: none;
  }
}

/* ==========================================================================
   PITCHFORK / PACEMAKER PLUGIN WINDOW
   ========================================================================== */

.pitchfork-window {
  width: 100%;
  background: #3b3c58;
  border-color: #6d6e8c #15151f #15151f #6d6e8c;
}

.pitchfork-title {
  justify-content: center;
  gap: 6px;
  padding-inline-start: 26px;
  background: #23243a;
}

.pitchfork-title::before,
.pitchfork-title::after {
  content: '';
  flex: 1;
  height: 8px;
  border-top: 1px solid #7f80a0;
  border-bottom: 1px solid #7f80a0;
  background: repeating-linear-gradient(0deg, transparent 0 1px, #7f80a0 1px 2px);
}

.pitchfork-title .title-bar-text {
  color: #d6d7ea;
}

.plugin-body {
  display: flex;
  gap: 8px;
  padding: 8px 6px;
  background: #23243a;
  height: 112px;
}

.pf-slider-row {
  background: #23243a;
  padding: 4px 6px 12px;
}

.pf-slider-scale {
  color: #d6d7ea;
  display: grid;
  font: 10px var(--font-mono);
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 10px;
}

.pf-slider-scale span:nth-child(2) { text-align: center; }
.pf-slider-scale span:last-child { text-align: right; }

.pf-slider-row .speed-slider {
  display: block;
  background: #121220;
}

.pf-slider-row .speed-slider::-webkit-slider-thumb {
  width: 10px;
  height: 22px;
  background: linear-gradient(180deg, #e3cf86 0%, #8a7330 100%);
  border: 1px solid #f3e7b4;
  border-bottom-color: #5a4a18;
  border-right-color: #5a4a18;
}

.pf-slider-row .speed-slider::-moz-range-thumb {
  width: 10px;
  height: 22px;
  background: linear-gradient(180deg, #e3cf86 0%, #8a7330 100%);
  border: 1px solid #f3e7b4;
}

.pf-left,
.pf-center,
.pf-right {
  display: grid;
  gap: 4px;
  grid-template-rows: repeat(4, 1fr);
}

.pf-left { grid-template-columns: 1fr 1fr; flex: 2; }
.pf-center { grid-template-columns: 1fr; flex: 1.2; }
.pf-right { grid-template-columns: repeat(8, 1fr); flex: 3; }

.pf-btn {
  min-width: 0;
  background: linear-gradient(180deg, #d4d5e0 0%, #9a9bb0 100%);
  border: 1px solid;
  border-color: #f2f2fa #4a4a5e #4a4a5e #f2f2fa;
  color: #1a1a28;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: bold;
  padding: 0;
  cursor: pointer;
  white-space: nowrap;
}

.pf-btn[data-step-size] {
  overflow: hidden;
  text-overflow: ellipsis;
}

.pf-btn[data-step-size]::after {
  content: " " attr(data-step-value);
}

@media (max-width: 360px) {
  .pf-btn[data-step-size] {
    font-size: 8px;
  }
}

.pf-btn:hover {
  background: linear-gradient(180deg, #e6e7f0 0%, #b0b1c4 100%);
}

.pf-btn:active,
.pf-btn.paused,
.pf-btn[aria-pressed="true"] {
  background: linear-gradient(180deg, #9a9bb0 0%, #c2c3d2 100%);
  border-color: #4a4a5e #f2f2fa #f2f2fa #4a4a5e;
}

.pf-btn.paused {
  background: var(--accent-gold);
  color: #000;
}

.pf-bpm-control {
  display: flex;
  gap: 2px;
  min-width: 0;
}

.pf-bpm-auto {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.pf-bpm-auto input {
  margin: 0;
  accent-color: var(--accent-gold);
}

.pf-bpm {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
}

.pf-bpm-reading {
  display: block;
}

.pf-bpm-mode {
  display: block;
  margin-top: 2px;
  color: #3f5b3f;
  font-size: 7px;
  letter-spacing: 0.08em;
}

.pf-bpm.manual .pf-bpm-mode {
  color: #725000;
}

.pf-step-editor {
  min-width: 0;
  width: 100%;
  color: #1a1a28;
  background: #e6e7f0;
  border: 1px solid #4a4a5e;
  font: bold 13px var(--font-mono);
  user-select: text;
}

.pf-message:not(:empty) {
  padding: 4px 6px;
  color: #ffffff;
  font: 11px/1.4 var(--font-mono);
}

.pf-r-plus { grid-column: 1 / 5; }
.pf-r-plus2 { grid-column: 5 / 9; }
.pf-mplus { grid-column: 1 / 7; }
.pf-ac { grid-column: 1 / 3; }
.pf-prev { grid-column: 3 / 5; }
.pf-next { grid-column: 5 / 7; }
.pf-pause { grid-column: 7 / 9; grid-row: 3 / 5; font-size: 14px; }

.pf-readout-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 4px;
  align-items: stretch;
}

.pf-readout {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-digital);
  font-size: 18px;
  color: #e8e8f4;
  text-shadow: 0 0 3px #ffffff66;
  white-space: nowrap;
}

/* ==========================================================================
   PLAYLIST WINDOW
   ========================================================================== */

.playlist-window {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  gap: 6px;
}

.playlist-body {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  padding: 6px;
}

.playlist-source:not([hidden]) {
  align-items: center;
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.playlist-source label,
.playlist-source select {
  color: var(--accent-gold);
  font-family: var(--font-mono);
  font-size: 10px;
}

.playlist-source select {
  background: #080f08;
  border: 1px solid #003300;
  flex: 1;
  min-width: 0;
  padding: 2px 4px;
}

.playlist-help-button {
  flex: 0 0 24px;
  min-width: 24px;
  padding-inline: 0;
  font-weight: bold;
}

.playlist-help-button[aria-expanded="true"] {
  background: linear-gradient(180deg, #8a7a26 0%, #b89a24 100%);
  border-color: #f0d35a #665600 #665600 #f0d35a;
  color: #fff4b0;
}

.playlist-source-status {
  color: #b6c8b6;
  font: 11px/1.4 var(--font-mono);
  margin: 4px 0;
}

.playlist-table {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  min-width: 0;
  overflow-x: auto;
}

.playlist-columns:not([hidden]),
#playlist-list.has-columns .playlist-item {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 100px 70px 90px;
  gap: 6px;
}

.playlist-columns:not([hidden]),
#playlist-list.has-columns {
  min-width: 490px;
}

.playlist-columns {
  padding: 0 12px;
}

.playlist-columns button {
  background: #080f08;
  border: 1px solid #003300;
  color: var(--accent-gold);
  cursor: pointer;
  font: 10px var(--font-mono);
  padding: 3px;
  text-align: left;
}

.playlist-track-title,
.playlist-metric {
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-metric {
  color: var(--accent-gold);
  font: 11px var(--font-mono);
  text-align: right;
}

.playlist-list {
  width: 100%;
  background: #080f08;
  border: 1px solid #003300;
  box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.9);
  padding: 6px;
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  gap: 3px;
  font-family: var(--font-digital);
  font-size: 16px;
  height: 130px;
  overflow-y: auto;
}

.playlist-item {
  width: 100%;
  flex: 0 0 auto;
  background: transparent;
  border: 0;
  text-align: left;
  font: inherit;
  color: var(--lcd-green);
  padding: 2px 6px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 1px;
}

#marker-list .playlist-item {
  white-space: normal;
  overflow-wrap: anywhere;
}

.event-status {
  color: #aaaaaa;
  font-family: var(--font-mono);
  font-size: 11px;
  margin: 0;
  text-align: center;
}

.copy-notice {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  padding: 6px 10px;
  border: 1px solid var(--accent-gold);
  background: #1e1e26;
  color: var(--accent-gold);
  font: 11px var(--font-mono);
  pointer-events: none;
}

.copy-menu {
  position: fixed;
  z-index: 30;
  padding: 3px;
  border: 1px solid var(--accent-gold);
  background: #1e1e26;
}

.copy-menu button:not([hidden]) {
  display: block;
  width: 100%;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: var(--accent-gold);
  font: 11px var(--font-mono);
  text-align: left;
  cursor: pointer;
}

.copy-menu button:hover,
.copy-menu button:focus-visible {
  background: #334433;
}

.spectrum-settings {
  position: fixed;
  z-index: 30;
  width: min(260px, calc(100vw - 16px));
  padding: 8px;
  border: 1px solid var(--accent-gold);
  background: #1e1e26;
  box-shadow: 3px 3px 12px #000000cc;
  color: var(--accent-gold);
  font: 11px var(--font-mono);
}

.spectrum-settings label {
  display: block;
  margin-bottom: 6px;
}

.spectrum-band-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.spectrum-band-control input[type="range"] {
  min-width: 0;
  accent-color: var(--lcd-green);
}

.spectrum-band-control input[type="number"] {
  width: calc(var(--band-digits, 3) * 1ch + 1.75rem);
  min-width: 4ch;
  padding: 2px 3px;
  border: 0;
  border-bottom: 1px solid var(--lcd-dim);
  background: transparent;
  color: var(--lcd-green);
  font: inherit;
  text-align: right;
  user-select: text;
}

.spectrum-band-control input[type="number"]:focus-visible {
  outline-offset: 1px;
}

.spectrum-settings p {
  margin-top: 6px;
  color: #aaaaaa;
  line-height: 1.3;
}

@media (max-width: 560px) {
  .control-panel,
  .playlist-footer {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .sliders-group {
    min-width: 140px;
  }

  .toggle-buttons {
    width: 100%;
    justify-content: flex-end;
  }
}

.playlist-empty {
  color: #557755;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 4px 6px;
}

.playlist-item.selected {
  background: #2d3a52;
  color: #ffffff;
}

.playlist-item:hover {
  background: #002200;
}

#marker-list .playlist-item:disabled {
  color: #777777;
  cursor: not-allowed;
}

.playlist-item.active {
  background: #004400;
  color: #ffffff;
}

.playlist-item.active.selected {
  background: #2d3a52;
  box-shadow: inset 3px 0 0 #00aa00;
}

.playlist-item.now-playing {
  background: #004400;
  color: #ffffff;
  box-shadow: inset 3px 0 0 var(--accent-gold);
}

.playlist-item.now-playing.selected {
  background: #2d3a52;
  box-shadow: inset 3px 0 0 var(--accent-gold);
}

.playlist-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1e1e26;
  border-top: 1px solid #000;
  padding: 4px 6px;
}

.pl-btn {
  background: linear-gradient(180deg, #444454 0%, #202028 100%);
  border: 1px solid #666677;
  color: #cccccc;
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 2px 6px;
  cursor: pointer;
}

#videos-window .pl-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.pl-info {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--accent-gold);
}
