:root {
  color-scheme: dark;
  --bg: #000;
  --panel: #15140f;
  --ink: #f3f1e6;
  --dim: #8d8a78;
  --y: #f2d90a;
  --accent: #f2d90a;
  --overlay-accent: #fff;
  --overlay-fill: #fff;
  --slider-thumb: #888888;
  --accent-ink: #000;
  --overlay-ink: #000;
  --accent-edge: transparent;
  --overlay-edge: transparent;
  --lbl-w: 100px;   /* label column shared by every slider / direction row */
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px)
}

* {
  box-sizing: border-box
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Montserrat, system-ui, sans-serif
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px clamp(8px, calc(13.333vw - 40px), 16px)   /* 8px at 360px wide, 16px from 420px up */
}

canvas {
  width: 100%;
  height: auto;
  display: block;
  background: #000;
  border: 1px solid #2a281c
}

.choose-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  align-items: end
}

.bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  align-items: end
}

.bar label {
  flex: 1;
  min-width: 150px;
}

.bar input[type=text] {
  width: 100%;
}

label {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  color: var(--dim);
  gap: 4px
}

input[type=text] {
  background: var(--panel);
  border: 1px solid #2f2d20;
  color: var(--ink);
  padding: 9px 10px;
  font: inherit;
  width: 220px
}

input[type=file] {
  display: none
}

.btn {
  background: var(--panel);
  border: 1px solid #2f2d20;
  color: var(--ink);
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
  cursor: pointer
}

.btn.go {
  background: var(--y);
  color: #000;
  border-color: var(--y);
  font-weight: 800
}

.btn:focus-visible,
input:focus-visible {
  outline: 2px solid var(--overlay-accent);
  outline-offset: 2px
}

#status {
  font-size: 13px;
  color: var(--dim);
  margin-top: 10px;
  min-height: 1.2em
}

.seekrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  flex-wrap: wrap
}

#time {
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  min-width: 130px
}

/* Slider rows: label | slider | value. Every slider in a settings group shares the same three columns
   (see .group-body), so the label column is only as wide as the longest label and everything lines up. */
.slider-col,
.sens {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
}

.slider-col {
  row-gap: 12px;
  margin-top: 12px;
  align-items: center
}

.slider-col>* {
  grid-column: 1 / -1
}

.slider-col>.settings-row {
  margin-top: 0
}

/* extra air above a toggle that follows other rows in a slider column (12px gap + 14px = 26px, same as the Direction block) */
.slider-col>.toggle:not(:first-child) {
  margin-top: 14px
}

.sens {
  column-gap: normal;   /* normal = inherit the group's column gap */
  row-gap: 0;
  align-items: center
}

/* numeric readout at the end of a slider row (created by script.js) */
.val {
  display: inline-flex;
  align-items: center;
  gap: 5px
}

.num-in,
.angle-in {
  width: 58px;
  height: auto;
  border-radius: 0;
  background: var(--panel);
  border: 1px solid #2f2d20;
  color: var(--ink);
  padding: 5px 6px;
  font: inherit;
  font-size: 12px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  appearance: textfield;
  -moz-appearance: textfield
}

.num-in::-webkit-inner-spin-button,
.num-in::-webkit-outer-spin-button,
.angle-in::-webkit-inner-spin-button,
.angle-in::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0
}

.num-in:disabled {
  cursor: default
}

.unit {
  font-size: 12px;
  color: var(--dim);
  white-space: nowrap
}

.round {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: var(--overlay-fill);
  color: var(--overlay-ink);
  box-shadow: inset 0 0 0 1px var(--overlay-edge);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  flex: none
}

.round:disabled {
  opacity: .4;
  cursor: default
}

.round svg {
  width: 18px;
  height: 18px;
  fill: currentColor
}

.round:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px
}

.color-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 18px clamp(6px, calc(50vw - 174px), 36px);   /* picker gap: 6px at 360px wide, grows smoothly to 36px at 420px */
  align-items: flex-start;
  margin-top: 16px
}

.settings-row {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  align-items: center;
  margin-top: 12px
}

.toggle {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  color: var(--dim);
  font-size: 13px
}

.direction-pickers {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center
}

.direction-axis {
  display: flex;
  align-items: center;
  gap: 8px
}

.palette-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 156px
}

.palette-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--dim);
  font-size: 13px
}

.swatch {
  width: 17px;
  height: 17px;
  border: 1px solid #ffffff66;
  border-radius: 50%;
  background: #f2d90a;
  display: inline-block
}

.hue-wheel {
  position: relative;
  width: 156px;
  height: 156px;
  border-radius: 50%;
  background: conic-gradient(red, #ff0, #0f0, #0ff, #00f, #f0f, red);
  touch-action: none;
  cursor: crosshair
}

.hue-wheel:after {
  content: "";
  position: absolute;
  inset: 17px;
  border-radius: 50%;
  background: #15140f;
  box-shadow: inset 0 0 0 1px #ffffff22
}

.hue-knob {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: 13px;
  height: 13px;
  margin: -6.5px;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 1px 4px #000;
  pointer-events: none
}

.sv-square {
  position: absolute;
  z-index: 3;
  left: 37px;
  top: 37px;
  width: 82px;
  height: 82px;
  border-radius: 5px;
  background: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, var(--hue));
  box-shadow: 0 1px 5px #0008;
  touch-action: none;
  cursor: crosshair
}

.sv-knob {
  position: absolute;
  width: 11px;
  height: 11px;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 0 2px #000;
  transform: translate(-50%, -50%);
  pointer-events: none
}

.palette-meta {
  font-size: 11px;
  color: var(--dim);
  font-variant-numeric: tabular-nums
}

.rgb-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 156px
}

.rgb-row input {
  width: 100%;
  min-width: 0;
  background: var(--panel);
  border: 1px solid #2f2d20;
  color: var(--ink);
  padding: 5px 4px;
  font: inherit;
  font-size: 12px;
  text-align: center;
  font-variant-numeric: tabular-nums
}

.rgb-row .hex-in {
  grid-column: 1 / -1;
  text-transform: uppercase;
  letter-spacing: .05em
}

.rgb-row input[type=number] {
  appearance: textfield;
  -moz-appearance: textfield
}

.rgb-row input::-webkit-inner-spin-button,
.rgb-row input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0
}

/* --- UNIFIED FORM INPUT CONTROLS --- */
input[type=checkbox] {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid #2f2d20;
  background: var(--panel);
  border-radius: 3px;
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  margin: 0;
  vertical-align: middle;
}

input[type=checkbox]:checked {
  background: var(--accent);
  border-color: var(--accent-edge);
}

/* Checkmark icon inside the checkbox */
input[type=checkbox]:checked::before {
  content: "";
  width: 8px;
  height: 5px;
  border-left: 2px solid var(--accent-ink);
  border-bottom: 2px solid var(--accent-ink);
  transform: rotate(-45deg) translate(1px, -0.5px);
}

input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  background-repeat: no-repeat;
}

input[type=range]:focus {
  outline: none;
}

input[type=range]:disabled {
  cursor: default !important;
}

/* Range Tracks */
#seek {
  flex: 1;
  min-width: 200px;
}

.sens input[type=range] {
  width: 100%;
  min-width: 0;
}

#seek,
#vol,
.sens input[type=range] {
  height: 6px;
  border-radius: 99px;
}

#seek::-webkit-slider-runnable-track,
#vol::-webkit-slider-runnable-track,
.sens input::-webkit-slider-runnable-track {
  background: transparent;
  height: 6px;
  border-radius: 99px;
}

#seek::-moz-range-track,
#vol::-moz-range-track,
.sens input::-moz-range-track {
  background: transparent;
  height: 6px;
  border-radius: 99px;
  border: none;
}

/* Range Thumbs */
#seek::-webkit-slider-thumb,
#vol::-webkit-slider-thumb,
.sens input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--slider-thumb) !important;
  border: 1.5px solid #000000;
  margin-top: -4px;
}

#seek::-moz-range-thumb,
#vol::-moz-range-thumb,
.sens input::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--slider-thumb) !important;
  border: 1.5px solid #000000;
}

input[type=range]:disabled::-webkit-slider-thumb,
input[type=range]:disabled::-moz-range-thumb {
  cursor: default !important;
}

/* --- stage: full screen + hover buttons --- */
.stage {
  position: relative;
  background: #000
}

.stage.fs {
  position: fixed;
  inset: 0;
  z-index: 9999;
  width: 100%;
  height: 100%
}

.stage.fs canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 0
}

.stage.fs .seekrow {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  z-index: 2;
  flex-wrap: nowrap;
  padding: 40px 24px calc(14px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, rgba(0, 0, 0, .8), transparent)
}

.stage.nobar .seekrow {
  display: none
}

.vbtns {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 3;
  opacity: 0;
  transition: opacity .2s
}

.stage:hover .vbtns {
  opacity: 1
}

.stage:has(.vbtn:focus-visible) .vbtns {
  opacity: 1
}

.stage.fs .vbtns {
  opacity: 0
}

.stage.fs.active .vbtns,
.stage.fs .vbtns:hover {
  opacity: 1
}

.stage.fs .vbtns:has(.vbtn:focus-visible) {
  opacity: 1
}

.stage.fs.idle {
  cursor: none
}

.vbtn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: rgba(0, 0, 0, .6);
  color: #fff;
  display: grid;
  place-items: center;
  backdrop-filter: blur(4px)
}

.vbtn:hover {
  background: rgba(0, 0, 0, .85)
}

.vbtn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round
}

/* --- collapsible groups --- */
.groups {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px
}

.group {
  border: 1px solid #2a281c;
  background: #0b0a07
}

.group>summary {
  list-style: none;
  cursor: pointer;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink);
  user-select: none
}

.group>summary::-webkit-details-marker {
  display: none
}

.group>summary::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--dim);
  border-bottom: 2px solid var(--dim);
  transform: rotate(-45deg);
  transition: transform .15s
}

.group[open]>summary::before {
  transform: rotate(45deg)
}

.group>summary:focus-visible {
  outline: 2px solid var(--overlay-accent);
  outline-offset: -2px
}

.group-body {
  display: grid;
  grid-template-columns: max-content minmax(60px, 300px) max-content 1fr;   /* label | slider | value | (rest) */
  column-gap: 10px;
  align-content: start;
  padding: 2px clamp(10px, calc(6.667vw - 14px), 14px) 16px
}

.group-body>* {
  grid-column: 1 / -1;
  min-width: 0
}

.group-body>:first-child {
  margin-top: 4px
}

.subhead {
  margin-top: 22px;
  padding-top: 12px;
  border-top: 1px solid #2a281c;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dim)
}

.hint {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--dim)
}

.sens:has(input:disabled) {
  opacity: .4
}

#starOpts.off,
#partOpts.off {
  opacity: .4
}

.seglabel {
  font-size: 13px;
  color: var(--dim)
}

/* The hidden attribute must win over display:flex/grid on classes (e.g. .palette-control, .settings-row) */
[hidden] {
  display: none !important;
}

/* --- background gradient direction dial --- */
.dir-dial {
  --angle: 180deg;
  position: relative;
  flex: none;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  border: 1px solid #ffffff55;
  cursor: grab;
  touch-action: none;
}

.dir-dial:active {
  cursor: grabbing;
}

.dir-dial:focus-visible {
  outline: 2px solid var(--overlay-accent);
  outline-offset: 3px;
}

/* tick marks at the 8 main directions */
.dir-dial::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  background: repeating-conic-gradient(from -1deg, #ffffffcc 0 2deg, transparent 2deg 45deg);
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 7px), #000 calc(100% - 7px));
  mask: radial-gradient(closest-side, transparent calc(100% - 7px), #000 calc(100% - 7px));
}

.dir-dial::after {
  content: "";
  position: absolute;
  left: calc(50% - 3px);
  top: calc(50% - 3px);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 3px #000;
  pointer-events: none;
}

.dial-line {
  position: absolute;
  left: calc(50% - 1px);
  top: 10px;
  width: 2px;
  height: calc(50% - 10px);
  background: #fff;
  box-shadow: 0 0 3px #000;
  transform-origin: 50% 100%;
  transform: rotate(var(--angle));
  pointer-events: none;
}

.dial-line::after {
  content: "";
  position: absolute;
  left: -5px;
  top: -6px;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #000;
  box-shadow: 0 0 3px #000;
}

.dir-row {
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-top: 26px;
}

.dir-body {
  display: flex;
  align-items: center;
  gap: 18px;
}

.dir-dial.arrow {
  background: var(--panel);
}

/* star dial: an arrow instead of a line + ring */
.dir-dial.arrow .dial-line {
  top: 13px;
  height: calc(50% - 13px);
}

.dir-dial.arrow .dial-line::after {
  left: -6px;
  top: -5px;
  width: 14px;
  height: 12px;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.angle-field {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.angle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* --- selects styled like buttons (not bold) --- */
select.btn {
  font-size: 13px;
  font-weight: 400;
  padding: 7px 10px
}

select option {
  background: #15140f;
  color: #f3f1e6
}

/* "Load Preset: <name>" on one line */
.preset-btn {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  color: var(--ink)
}

.preset-btn select {
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
  max-width: 200px
}

/* --- toast: messages and errors shown right where the user is looking --- */
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 20px);
  max-width: min(92vw, 560px);
  padding: 10px 16px;
  background: #15140f;
  border: 1px solid #2f2d20;
  color: var(--ink);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 10000
}

#toast.show {
  opacity: 1;
  transform: translate(-50%, 0)
}

#toast.err {
  border-color: #c33;
  color: #ffb4b4
}

/* --- recording indicator --- */
.vbtn.rec {
  background: #d11;
  animation: recpulse 1.2s infinite
}

.vbtn.rec.paused {
  background: #733;
  animation: none
}

@keyframes recpulse {
  50% {
    opacity: .55
  }
}


/* --- volume --- */
.volume {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none
}

#vol {
  width: 84px
}

/* dim a toggle whose control is switched off */
.toggle:has(:disabled) {
  opacity: .4
}

/* main/gradient pickers are unused while rainbow mode is on; the background colors are unused while an image is loaded */
#colorTools.off,
#bgColorOpts.off {
  opacity: .4
}

#starOpts,
#partOpts {
  transition: opacity .15s
}

/* fallback for browsers without CSS subgrid (before 2023): fixed label column per row */
@supports not (grid-template-columns: subgrid) {
  .group-body {
    display: block
  }

  .slider-col {
    display: flex;
    flex-direction: column;
    gap: 12px
  }

  .sens {
    grid-template-columns: var(--lbl-w) minmax(0, 1fr) auto;
    column-gap: 8px;
    width: min(100%, 460px)
  }
}

/* --- disabled buttons, song info, reset dialog, drop overlay --- */
.btn:disabled {
  opacity: .4;
  cursor: default
}

.info {
  white-space: pre-line;
  font-size: 12px;
  color: var(--dim);
  margin-top: 8px;
  overflow-wrap: anywhere
}

dialog {
  background: #15140f;
  color: var(--ink);
  border: 1px solid #2f2d20;
  padding: 18px 20px;
  max-width: min(92vw, 420px)
}

dialog::backdrop {
  background: rgba(0, 0, 0, .7)
}

dialog h3 {
  margin: 0 0 8px;
  font-size: 15px
}

dialog p {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--dim);
  line-height: 1.5
}

.dlg-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end
}

body.dragging::after {
  content: "Drop a song, a cover or background image or video, or a project file";
  position: fixed;
  inset: 12px;
  display: grid;
  place-items: center;
  border: 2px dashed var(--overlay-accent);
  background: rgba(0, 0, 0, .78);
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  padding: 20px;
  z-index: 10001;
  pointer-events: none
}

/* every button in a button row has the same height, whatever glyphs or fonts it contains */
.choose-bar {
  align-items: stretch
}

.choose-bar>.btn {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  line-height: 1.2
}

/* the preset dropdown button: let the 40px row height decide, not the select's own height */
.choose-bar>.preset-btn {
  padding-top: 0;
  padding-bottom: 0
}

/* native colour inputs (text and shadow colour) styled like the other controls */
input[type=color] {
  width: 34px;
  height: 26px;
  padding: 0;
  border: 1px solid #2f2d20;
  background: var(--panel);
  cursor: pointer
}

input[type=color]::-webkit-color-swatch-wrapper {
  padding: 2px
}

input[type=color]::-webkit-color-swatch {
  border: 0
}

input[type=color]::-moz-color-swatch {
  border: 0
}

input[type=color]:disabled {
  cursor: default
}
/* touch screens: larger checkboxes */
@media (pointer: coarse), (max-width: 700px) {
  input[type=checkbox] { width: 24px; height: 24px; }
  input[type=checkbox]:checked::before { width: 12px; height: 7px; }
}
/* frequency range graph: drag handles */
.band-graph {
  max-width: 640px;
  margin-top: 12px;
  touch-action: none;
  cursor: ew-resize
}

/* the Advanced section wraps several rows, so it joins the group's label | slider | value columns itself */
@supports (grid-template-columns: subgrid) {
  #bandAdv:not([hidden]) {
    display: grid;
    grid-template-columns: subgrid;
    grid-column: 1 / -1
  }

  #bandAdv>* {
    grid-column: 1 / -1
  }
}
/* ---- Layout: keep the preview on screen while editing settings ----
   Wide screens: preview + song fields stay pinned on the left, the settings scroll on the right.
   Narrower screens: the player (canvas + play bar) sticks to the top while the settings scroll beneath it. */
@media (min-width: 1100px) and (min-height: 560px) {
  main {
    max-width: 1680px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(400px, 34vw, 520px);
    gap: 0 24px;
    align-items: start
  }

  .preview {
    position: sticky;
    top: 12px;
    max-height: calc(100dvh - 12px);
    overflow-y: auto;
    scrollbar-width: thin
  }

  .preview .stage:not(.fs) {
    /* the whole pinned column (player + fields + buttons) must fit the window height */
    width: min(100%, calc((100dvh - 300px) * 16 / 9));
    min-width: min(100%, 480px)
  }

  .groups {
    margin-top: 0
  }

  .preview:has(.stage.fs) {
    z-index: 9999   /* keep full screen above the settings column */
  }
}

@media (max-width: 1099px) and (min-height: 560px) {
  .preview {
    display: contents
  }

  /* the sticky bar spans the full width with a solid background (settings never show through at the sides);
     the canvas and play bar are centred inside it and capped so the pinned player stays at roughly 40% of the window height or less */
  .stage:not(.fs) {
    --pw: min(100%, max(430px, calc(36dvh * 16 / 9)));   /* at least 430 px wide, so all the play-bar buttons and the time fit */
    position: sticky;
    top: 0;
    z-index: 20;
    padding-bottom: 8px;
    border-bottom: 1px solid #2a281c;
    box-shadow: 0 10px 14px -6px #000
  }

  .stage:not(.fs) canvas {
    width: var(--pw);
    margin: 0 auto
  }

  .stage:not(.fs) .vbtns {
    right: calc((100% - var(--pw)) / 2 + 12px)
  }

  /* compact play bar on a single row */
  .stage:not(.fs) .seekrow {
    width: var(--pw);
    margin: 8px auto 0;
    flex-wrap: nowrap;
    gap: 4px
  }

  /* the buttons on the pinned bar are a little smaller, so the time readout is never cut off */
  .stage:not(.fs) .vbtn {
    width: 32px;
    height: 32px
  }

  .stage:not(.fs) .round {
    width: 36px;
    height: 36px
  }

  .stage:not(.fs) #time {
    min-width: 0;
    flex: none;
    font-size: 12px;
    white-space: nowrap
  }

  .stage:not(.fs) #seek {
    min-width: 40px
  }
}

/* phones: the volume slider is hidden in the pinned bar (the mute button stays) */
@media (max-width: 700px) and (min-height: 560px) {
  .stage:not(.fs) #vol {
    display: none
  }
}

/* ---- Preset gallery ---- */
.preset-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 8px;
  margin-bottom: 12px
}

.preset-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  background: #0d0c08;
  border: 1px solid #2f2d20;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden
}

.preset-card .thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9
}

.preset-card .thumb svg {
  display: block;
  width: 100%;
  height: 100%
}

.preset-card .name {
  display: block;
  padding: 5px 7px;
  font-size: 11px;
  color: #b9b59f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.preset-card:hover,
.preset-card:focus-visible {
  border-color: #f2d90a
}

.preset-card:hover .name {
  color: #fff
}

/* --- playback skip buttons and playlist --- */
.vbtn:disabled {
  opacity: .4;
  cursor: default
}

.vbtn.skip svg {
  fill: currentColor;
  stroke: none
}

.queue-count {
  margin-top: 12px;
  font-size: 12px;
  color: var(--dim)
}

.queue-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid #2a281c
}

.queue-row {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid #2a281c
}

.queue-row:last-child {
  border-bottom: 0
}

.queue-name {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  background: none;
  border: 0;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer
}

.queue-row.now .queue-name {
  color: var(--overlay-accent);
  font-weight: 800
}

.queue-rm {
  padding: 0 12px;
  background: none;
  border: 0;
  color: var(--dim);
  font: inherit;
  cursor: pointer
}

.queue-rm:hover {
  color: #ffb4b4
}

.queue-name:focus-visible,
.queue-rm:focus-visible {
  outline: 2px solid var(--overlay-accent);
  outline-offset: -2px
}
/* --- demo link (empty state only), clickable time, queue reordering --- */
.link-btn {
  display: block;
  margin-top: 6px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--dim);
  font: inherit;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer
}

.link-btn[hidden] {
  display: none
}

.link-btn:hover {
  color: var(--ink)
}

.link-btn:focus-visible {
  outline: 2px solid var(--overlay-accent);
  outline-offset: 2px
}

#time {
  cursor: pointer;
  user-select: none
}

#time:hover {
  text-decoration: underline;
  text-underline-offset: 3px
}

#time:focus-visible {
  outline: 2px solid var(--overlay-accent);
  outline-offset: 2px
}

.queue-grip {
  flex: none;
  padding: 0 4px 0 10px;
  background: none;
  border: 0;
  color: var(--dim);
  font: inherit;
  font-size: 14px;
  letter-spacing: -2px;
  cursor: grab;
  touch-action: none
}

.queue-grip:hover {
  color: var(--ink)
}

.queue-grip:focus-visible {
  outline: 2px solid var(--overlay-accent);
  outline-offset: -2px
}

.queue-list.sorting,
.queue-list.sorting * {
  cursor: grabbing;
  user-select: none
}

.queue-row.dragging {
  opacity: .45
}

.queue-row {
  position: relative
}

.queue-row.drop-above::before,
.queue-row.drop-below::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--overlay-accent);
  z-index: 1
}

.queue-row.drop-above::before {
  top: -1px
}

.queue-row.drop-below::after {
  bottom: -1px
}

/* --- drag and drop targets: the cover spot while files are dragged over the page, and the panels that accept them --- */
.drop-spot {
  position: fixed;
  z-index: 10002;   /* above the dimmed page overlay (body.dragging::after, 10001) */
  pointer-events: none;
  box-sizing: border-box;
  border: 2px dashed var(--overlay-accent);
  border-radius: 10px;
  background: rgba(255, 255, 255, .08);
  transition: background .12s, box-shadow .12s
}

.drop-spot[hidden] {
  display: none
}

.drop-spot.over {
  background: rgba(255, 255, 255, .22);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .25)
}

body.dz-cover #coverGroup,
body.dz-background #backgroundGroup {
  outline: 2px dashed var(--overlay-accent);
  outline-offset: 4px
}
/* live input: the button stays lit while the shared audio drives the visualizer */
#liveBtn[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--overlay-accent)
}

/* short status line next to a toggle (media helper state) */
.info-note {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--dim)
}