/* MÉTRONOME DE POITRINE
   Palette after the band's own rules: strict black-and-white polka dots
   (the stage panel IS the costume — papier-mâché paper, black dots),
   triangle/pyramid accents, and a single functional color: the gold of
   their sign / chest triangle / Vol. II cover, reserved for what is live. */

:root {
  /* Sampled from band photos (KEXP + Great Escape, casts cancelled), then
     locked as EXACT complements so invert(1) maps each onto the other and
     whites/blacks match pixel-for-pixel across the split. */
  /* pure neutral greys: exactly preserved by both invert(1) and the
     hue-rotate(180) that keeps gold from turning blue on the right half */
  --paper: #f1f1f1;      /* whiter white; exactly 255 - ink */
  --ink: #0e0e0e;        /* blacker black */
  --bg: #0e0e0e;         /* = ink, so the right half's ground inverts to paper */
  --panel: #0e0e0e;      /* panels use the exact background black */
  --panel2: #0e0e0e;     /* rows/inputs too — borders do the separating */
  --line: #535353;
  --white: #f1f1f1;      /* text on dark = the exact background white */
  --muted: #c7c7c7;
  --faint: #989898;
  --paper2: #c0c0c0;
  --ink-soft: #474747;   /* secondary text on paper */
  --phos: #fcba4c;       /* AdP gold — sampled from the Vol. II cover; also the
                            sign + chest-triangle color at KEXP (tungsten-dimmed
                            there to #c89060 / #b16f2d). Inverts to cobalt. */
  --phos-dark: #7d591c;  /* gold legible on paper */
  --err: #ff6b52;
  --radius: 10px;
  /* Helvetica-style heavy caps, like the cassette cover lettering */
  --display: "Helvetica Neue", Helvetica, "Inter", "Arial Black", Arial, sans-serif;
  --body: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  --mono: "Space Mono", ui-monospace, "Cascadia Mono", monospace;
}

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

html { color-scheme: dark; }

body {
  font-family: var(--body);
  background-color: var(--bg);
  /* white dots in the dark — the backdrop */
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'276'%20height%3D'276'%20viewBox%3D'0%200%20276%20276'%3E%3Cellipse%20cx%3D'24.7'%20cy%3D'20.5'%20rx%3D'7.1'%20ry%3D'6.1'%20transform%3D'rotate(58%2024.7%2020.5)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.81'%2F%3E%3Cellipse%20cx%3D'73.2'%20cy%3D'16.7'%20rx%3D'9.3'%20ry%3D'10.1'%20transform%3D'rotate(127%2073.2%2016.7)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.81'%2F%3E%3Cellipse%20cx%3D'119.4'%20cy%3D'22.6'%20rx%3D'7.1'%20ry%3D'7.7'%20transform%3D'rotate(133%20119.4%2022.6)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.79'%2F%3E%3Cellipse%20cx%3D'167.3'%20cy%3D'19.3'%20rx%3D'9.0'%20ry%3D'9.0'%20transform%3D'rotate(152%20167.3%2019.3)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.82'%2F%3E%3Cellipse%20cx%3D'202.6'%20cy%3D'25.8'%20rx%3D'7.6'%20ry%3D'7.9'%20transform%3D'rotate(66%20202.6%2025.8)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.86'%2F%3E%3Cellipse%20cx%3D'258.1'%20cy%3D'28.3'%20rx%3D'11.5'%20ry%3D'11.9'%20transform%3D'rotate(116%20258.1%2028.3)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.91'%2F%3E%3Cellipse%20cx%3D'20.6'%20cy%3D'69.2'%20rx%3D'10.3'%20ry%3D'9.2'%20transform%3D'rotate(161%2020.6%2069.2)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.93'%2F%3E%3Cellipse%20cx%3D'66.7'%20cy%3D'74.2'%20rx%3D'10.8'%20ry%3D'10.9'%20transform%3D'rotate(36%2066.7%2074.2)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.84'%2F%3E%3Cellipse%20cx%3D'117.3'%20cy%3D'74.1'%20rx%3D'10.8'%20ry%3D'9.5'%20transform%3D'rotate(139%20117.3%2074.1)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.78'%2F%3E%3Cellipse%20cx%3D'164.2'%20cy%3D'67.2'%20rx%3D'9.6'%20ry%3D'9.4'%20transform%3D'rotate(52%20164.2%2067.2)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.79'%2F%3E%3Cellipse%20cx%3D'208.9'%20cy%3D'63.7'%20rx%3D'6.7'%20ry%3D'6.0'%20transform%3D'rotate(103%20208.9%2063.7)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.93'%2F%3E%3Cellipse%20cx%3D'248.8'%20cy%3D'72.0'%20rx%3D'10.2'%20ry%3D'9.1'%20transform%3D'rotate(99%20248.8%2072.0)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.83'%2F%3E%3Cellipse%20cx%3D'26.0'%20cy%3D'119.4'%20rx%3D'7.0'%20ry%3D'7.4'%20transform%3D'rotate(127%2026.0%20119.4)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.78'%2F%3E%3Cellipse%20cx%3D'70.7'%20cy%3D'111.4'%20rx%3D'7.5'%20ry%3D'7.6'%20transform%3D'rotate(74%2070.7%20111.4)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.82'%2F%3E%3Cellipse%20cx%3D'121.4'%20cy%3D'108.9'%20rx%3D'7.8'%20ry%3D'7.7'%20transform%3D'rotate(126%20121.4%20108.9)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.86'%2F%3E%3Cellipse%20cx%3D'162.0'%20cy%3D'117.3'%20rx%3D'7.2'%20ry%3D'7.9'%20transform%3D'rotate(176%20162.0%20117.3)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.91'%2F%3E%3Cellipse%20cx%3D'201.4'%20cy%3D'118.7'%20rx%3D'11.0'%20ry%3D'9.8'%20transform%3D'rotate(111%20201.4%20118.7)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.87'%2F%3E%3Cellipse%20cx%3D'254.3'%20cy%3D'116.2'%20rx%3D'10.2'%20ry%3D'10.5'%20transform%3D'rotate(40%20254.3%20116.2)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.90'%2F%3E%3Cellipse%20cx%3D'25.8'%20cy%3D'155.7'%20rx%3D'7.7'%20ry%3D'8.4'%20transform%3D'rotate(26%2025.8%20155.7)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.93'%2F%3E%3Cellipse%20cx%3D'63.4'%20cy%3D'158.0'%20rx%3D'7.4'%20ry%3D'7.1'%20transform%3D'rotate(2%2063.4%20158.0)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.91'%2F%3E%3Cellipse%20cx%3D'116.1'%20cy%3D'166.3'%20rx%3D'9.5'%20ry%3D'8.6'%20transform%3D'rotate(26%20116.1%20166.3)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.82'%2F%3E%3Cellipse%20cx%3D'160.9'%20cy%3D'160.9'%20rx%3D'9.4'%20ry%3D'8.1'%20transform%3D'rotate(108%20160.9%20160.9)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.85'%2F%3E%3Cellipse%20cx%3D'208.7'%20cy%3D'159.9'%20rx%3D'6.7'%20ry%3D'5.8'%20transform%3D'rotate(89%20208.7%20159.9)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.86'%2F%3E%3Cellipse%20cx%3D'258.3'%20cy%3D'157.7'%20rx%3D'7.2'%20ry%3D'7.6'%20transform%3D'rotate(141%20258.3%20157.7)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.87'%2F%3E%3Cellipse%20cx%3D'22.5'%20cy%3D'206.5'%20rx%3D'8.5'%20ry%3D'7.7'%20transform%3D'rotate(96%2022.5%20206.5)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.81'%2F%3E%3Cellipse%20cx%3D'73.2'%20cy%3D'204.4'%20rx%3D'7.3'%20ry%3D'6.4'%20transform%3D'rotate(130%2073.2%20204.4)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.91'%2F%3E%3Cellipse%20cx%3D'116.7'%20cy%3D'211.4'%20rx%3D'10.6'%20ry%3D'9.2'%20transform%3D'rotate(119%20116.7%20211.4)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.94'%2F%3E%3Cellipse%20cx%3D'156.7'%20cy%3D'210.7'%20rx%3D'7.2'%20ry%3D'7.4'%20transform%3D'rotate(145%20156.7%20210.7)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.83'%2F%3E%3Cellipse%20cx%3D'209.1'%20cy%3D'212.1'%20rx%3D'9.4'%20ry%3D'9.4'%20transform%3D'rotate(51%20209.1%20212.1)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.78'%2F%3E%3Cellipse%20cx%3D'255.5'%20cy%3D'212.9'%20rx%3D'7.1'%20ry%3D'7.6'%20transform%3D'rotate(34%20255.5%20212.9)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.81'%2F%3E%3Cellipse%20cx%3D'18.2'%20cy%3D'249.1'%20rx%3D'11.1'%20ry%3D'10.1'%20transform%3D'rotate(107%2018.2%20249.1)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.78'%2F%3E%3Cellipse%20cx%3D'74.6'%20cy%3D'251.6'%20rx%3D'11.3'%20ry%3D'10.3'%20transform%3D'rotate(12%2074.6%20251.6)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.82'%2F%3E%3Cellipse%20cx%3D'110.4'%20cy%3D'252.2'%20rx%3D'11.1'%20ry%3D'11.1'%20transform%3D'rotate(80%20110.4%20252.2)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.83'%2F%3E%3Cellipse%20cx%3D'159.0'%20cy%3D'252.7'%20rx%3D'8.7'%20ry%3D'9.1'%20transform%3D'rotate(69%20159.0%20252.7)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.91'%2F%3E%3Cellipse%20cx%3D'211.6'%20cy%3D'249.5'%20rx%3D'9.0'%20ry%3D'8.3'%20transform%3D'rotate(103%20211.6%20249.5)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.80'%2F%3E%3Cellipse%20cx%3D'258.8'%20cy%3D'248.9'%20rx%3D'10.9'%20ry%3D'10.0'%20transform%3D'rotate(66%20258.8%20248.9)'%20fill%3D'%23f1f1f1'%20opacity%3D'0.78'%2F%3E%3C%2Fsvg%3E");
  background-size: 276px 276px;
  color: var(--white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.4rem 1rem 3rem;
}

/* THE SPLIT: one site, cut down the middle, right half fully colour-inverted
   — like the band's half-black/half-white KEXP backdrop panels */
body::after {
  content: "";
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  right: 0;
  /* hue-rotate flips the hue back after inversion: blacks/whites still mirror
     exactly, but gold renders as dark amber on this side instead of blue */
  backdrop-filter: invert(1) hue-rotate(180deg);
  -webkit-backdrop-filter: invert(1) hue-rotate(180deg);
  pointer-events: none;
  z-index: 999;
}

.app {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ---------- header ---------- */
header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px dotted var(--faint);
}

.wordmark .eyebrow {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.wordmark .eyebrow::before { content: "▲ "; color: var(--phos); }

/* the cassette-cover lettering: black rim at the edge, gold line inset,
   dark core — built as three stacked strokes over the same text */
.wordmark h1 {
  position: relative;
  font-family: var(--display);
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(1.3rem, 3.4vw, 1.9rem);
  letter-spacing: 0.05em;
  line-height: 1.1;
  color: var(--ink);
  -webkit-text-stroke: 5px #15120a;  /* bottom layer: the black rim */
}

.wordmark h1::before,
.wordmark h1::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
}

.wordmark h1::before {
  color: transparent;
  -webkit-text-stroke: 2.2px var(--phos);  /* the inset gold line */
}

.wordmark h1::after {
  color: var(--ink);                        /* the dark core */
  -webkit-text-stroke: 0;
}

.song-controls { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

/* ---------- shared controls ---------- */
select, input[type="text"], input[type="number"], button {
  font-family: var(--body);
  font-size: 0.85rem;
  color: var(--white);
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.42rem 0.6rem;
}

select { max-width: 15rem; }

button { cursor: pointer; transition: border-color 120ms, background 120ms, color 120ms; }
button:hover { border-color: var(--muted); }
:focus-visible { outline: 2px solid var(--phos); outline-offset: 2px; }

input.invalid { border-color: var(--err); background: rgba(255, 107, 82, 0.08); }

/* frosted glass over the dot fabric */
#btn-generate, #btn-save {
  background: rgba(28, 36, 36, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
#btn-generate { border-color: var(--phos); color: var(--phos); }
#btn-generate:hover { background: rgba(252, 186, 76, 0.16); }
#btn-save:hover { background: rgba(28, 36, 36, 0.55); }

/* ---------- stage: the costume itself — paper with black polka dots ---------- */
#stage {
  background-color: var(--paper);
  /* the costume dots: jittered grid, elliptical, hand-stamped (gen-dots.js) */
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'276'%20height%3D'276'%20viewBox%3D'0%200%20276%20276'%3E%3Cellipse%20cx%3D'24.4'%20cy%3D'24.2'%20rx%3D'9.3'%20ry%3D'9.1'%20transform%3D'rotate(153%2024.4%2024.2)'%20fill%3D'%230e0e0e'%20opacity%3D'0.83'%2F%3E%3Cellipse%20cx%3D'70.4'%20cy%3D'22.4'%20rx%3D'7.0'%20ry%3D'6.9'%20transform%3D'rotate(86%2070.4%2022.4)'%20fill%3D'%230e0e0e'%20opacity%3D'0.87'%2F%3E%3Cellipse%20cx%3D'117.3'%20cy%3D'18.6'%20rx%3D'8.8'%20ry%3D'8.9'%20transform%3D'rotate(32%20117.3%2018.6)'%20fill%3D'%230e0e0e'%20opacity%3D'0.78'%2F%3E%3Cellipse%20cx%3D'162.1'%20cy%3D'18.2'%20rx%3D'8.7'%20ry%3D'8.1'%20transform%3D'rotate(107%20162.1%2018.2)'%20fill%3D'%230e0e0e'%20opacity%3D'0.83'%2F%3E%3Cellipse%20cx%3D'210.9'%20cy%3D'26.5'%20rx%3D'8.8'%20ry%3D'9.3'%20transform%3D'rotate(57%20210.9%2026.5)'%20fill%3D'%230e0e0e'%20opacity%3D'0.84'%2F%3E%3Cellipse%20cx%3D'256.1'%20cy%3D'29.2'%20rx%3D'7.9'%20ry%3D'6.8'%20transform%3D'rotate(53%20256.1%2029.2)'%20fill%3D'%230e0e0e'%20opacity%3D'0.76'%2F%3E%3Cellipse%20cx%3D'23.7'%20cy%3D'70.0'%20rx%3D'10.5'%20ry%3D'9.7'%20transform%3D'rotate(152%2023.7%2070.0)'%20fill%3D'%230e0e0e'%20opacity%3D'0.76'%2F%3E%3Cellipse%20cx%3D'67.5'%20cy%3D'62.9'%20rx%3D'11.0'%20ry%3D'11.6'%20transform%3D'rotate(13%2067.5%2062.9)'%20fill%3D'%230e0e0e'%20opacity%3D'0.87'%2F%3E%3Cellipse%20cx%3D'112.0'%20cy%3D'69.0'%20rx%3D'9.2'%20ry%3D'9.0'%20transform%3D'rotate(132%20112.0%2069.0)'%20fill%3D'%230e0e0e'%20opacity%3D'0.75'%2F%3E%3Cellipse%20cx%3D'160.3'%20cy%3D'70.7'%20rx%3D'9.9'%20ry%3D'8.5'%20transform%3D'rotate(177%20160.3%2070.7)'%20fill%3D'%230e0e0e'%20opacity%3D'0.81'%2F%3E%3Cellipse%20cx%3D'201.2'%20cy%3D'72.0'%20rx%3D'9.0'%20ry%3D'8.4'%20transform%3D'rotate(75%20201.2%2072.0)'%20fill%3D'%230e0e0e'%20opacity%3D'0.86'%2F%3E%3Cellipse%20cx%3D'251.0'%20cy%3D'73.4'%20rx%3D'8.2'%20ry%3D'8.0'%20transform%3D'rotate(28%20251.0%2073.4)'%20fill%3D'%230e0e0e'%20opacity%3D'0.76'%2F%3E%3Cellipse%20cx%3D'18.2'%20cy%3D'113.3'%20rx%3D'9.9'%20ry%3D'9.9'%20transform%3D'rotate(67%2018.2%20113.3)'%20fill%3D'%230e0e0e'%20opacity%3D'0.89'%2F%3E%3Cellipse%20cx%3D'67.9'%20cy%3D'120.4'%20rx%3D'11.0'%20ry%3D'11.1'%20transform%3D'rotate(105%2067.9%20120.4)'%20fill%3D'%230e0e0e'%20opacity%3D'0.81'%2F%3E%3Cellipse%20cx%3D'108.7'%20cy%3D'119.9'%20rx%3D'8.2'%20ry%3D'8.0'%20transform%3D'rotate(54%20108.7%20119.9)'%20fill%3D'%230e0e0e'%20opacity%3D'0.81'%2F%3E%3Cellipse%20cx%3D'164.2'%20cy%3D'115.6'%20rx%3D'7.3'%20ry%3D'6.2'%20transform%3D'rotate(92%20164.2%20115.6)'%20fill%3D'%230e0e0e'%20opacity%3D'0.76'%2F%3E%3Cellipse%20cx%3D'212.0'%20cy%3D'120.9'%20rx%3D'9.5'%20ry%3D'9.5'%20transform%3D'rotate(107%20212.0%20120.9)'%20fill%3D'%230e0e0e'%20opacity%3D'0.84'%2F%3E%3Cellipse%20cx%3D'247.8'%20cy%3D'117.0'%20rx%3D'9.6'%20ry%3D'9.3'%20transform%3D'rotate(117%20247.8%20117.0)'%20fill%3D'%230e0e0e'%20opacity%3D'0.90'%2F%3E%3Cellipse%20cx%3D'18.3'%20cy%3D'162.9'%20rx%3D'10.3'%20ry%3D'9.0'%20transform%3D'rotate(174%2018.3%20162.9)'%20fill%3D'%230e0e0e'%20opacity%3D'0.79'%2F%3E%3Cellipse%20cx%3D'72.4'%20cy%3D'163.0'%20rx%3D'11.4'%20ry%3D'10.7'%20transform%3D'rotate(12%2072.4%20163.0)'%20fill%3D'%230e0e0e'%20opacity%3D'0.79'%2F%3E%3Cellipse%20cx%3D'116.6'%20cy%3D'157.5'%20rx%3D'10.0'%20ry%3D'9.7'%20transform%3D'rotate(129%20116.6%20157.5)'%20fill%3D'%230e0e0e'%20opacity%3D'0.79'%2F%3E%3Cellipse%20cx%3D'159.5'%20cy%3D'156.9'%20rx%3D'7.1'%20ry%3D'7.0'%20transform%3D'rotate(146%20159.5%20156.9)'%20fill%3D'%230e0e0e'%20opacity%3D'0.89'%2F%3E%3Cellipse%20cx%3D'206.1'%20cy%3D'165.5'%20rx%3D'10.5'%20ry%3D'8.8'%20transform%3D'rotate(102%20206.1%20165.5)'%20fill%3D'%230e0e0e'%20opacity%3D'0.85'%2F%3E%3Cellipse%20cx%3D'252.9'%20cy%3D'160.9'%20rx%3D'9.9'%20ry%3D'8.3'%20transform%3D'rotate(29%20252.9%20160.9)'%20fill%3D'%230e0e0e'%20opacity%3D'0.87'%2F%3E%3Cellipse%20cx%3D'29.4'%20cy%3D'208.5'%20rx%3D'7.0'%20ry%3D'6.0'%20transform%3D'rotate(126%2029.4%20208.5)'%20fill%3D'%230e0e0e'%20opacity%3D'0.87'%2F%3E%3Cellipse%20cx%3D'63.2'%20cy%3D'202.7'%20rx%3D'11.4'%20ry%3D'12.4'%20transform%3D'rotate(107%2063.2%20202.7)'%20fill%3D'%230e0e0e'%20opacity%3D'0.80'%2F%3E%3Cellipse%20cx%3D'109.2'%20cy%3D'201.3'%20rx%3D'8.8'%20ry%3D'8.6'%20transform%3D'rotate(83%20109.2%20201.3)'%20fill%3D'%230e0e0e'%20opacity%3D'0.78'%2F%3E%3Cellipse%20cx%3D'159.9'%20cy%3D'204.9'%20rx%3D'8.8'%20ry%3D'9.0'%20transform%3D'rotate(105%20159.9%20204.9)'%20fill%3D'%230e0e0e'%20opacity%3D'0.80'%2F%3E%3Cellipse%20cx%3D'206.3'%20cy%3D'203.7'%20rx%3D'11.6'%20ry%3D'10.7'%20transform%3D'rotate(123%20206.3%20203.7)'%20fill%3D'%230e0e0e'%20opacity%3D'0.79'%2F%3E%3Cellipse%20cx%3D'246.6'%20cy%3D'202.2'%20rx%3D'9.5'%20ry%3D'9.6'%20transform%3D'rotate(29%20246.6%20202.2)'%20fill%3D'%230e0e0e'%20opacity%3D'0.87'%2F%3E%3Cellipse%20cx%3D'19.1'%20cy%3D'254.7'%20rx%3D'7.3'%20ry%3D'7.7'%20transform%3D'rotate(148%2019.1%20254.7)'%20fill%3D'%230e0e0e'%20opacity%3D'0.86'%2F%3E%3Cellipse%20cx%3D'63.7'%20cy%3D'256.1'%20rx%3D'10.8'%20ry%3D'9.4'%20transform%3D'rotate(38%2063.7%20256.1)'%20fill%3D'%230e0e0e'%20opacity%3D'0.76'%2F%3E%3Cellipse%20cx%3D'119.9'%20cy%3D'254.8'%20rx%3D'8.4'%20ry%3D'7.3'%20transform%3D'rotate(129%20119.9%20254.8)'%20fill%3D'%230e0e0e'%20opacity%3D'0.83'%2F%3E%3Cellipse%20cx%3D'159.5'%20cy%3D'256.4'%20rx%3D'10.5'%20ry%3D'10.8'%20transform%3D'rotate(40%20159.5%20256.4)'%20fill%3D'%230e0e0e'%20opacity%3D'0.77'%2F%3E%3Cellipse%20cx%3D'200.7'%20cy%3D'253.8'%20rx%3D'7.3'%20ry%3D'7.4'%20transform%3D'rotate(173%20200.7%20253.8)'%20fill%3D'%230e0e0e'%20opacity%3D'0.88'%2F%3E%3Cellipse%20cx%3D'247.3'%20cy%3D'253.4'%20rx%3D'9.3'%20ry%3D'9.9'%20transform%3D'rotate(138%20247.3%20253.4)'%20fill%3D'%230e0e0e'%20opacity%3D'0.78'%2F%3E%3C%2Fsvg%3E");
  background-size: 276px 276px;
  border: 1px solid var(--paper2);
  border-radius: var(--radius);
  padding: 1.6rem 1.4rem 1.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  color: var(--ink);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

#sig-readout {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

#sig-big {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(3rem, 11vw, 5.4rem);
  line-height: 0.95;
  color: var(--ink);
}

#sig-grouping {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1.1rem, 3.4vw, 1.7rem);
  /* gold on black, like the cover's eye/pyramid marks */
  color: var(--phos);
  background: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 0.1em 0.6em;
}

#sig-bpm {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* the polka-dot pulse field */
#pulse-display {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: clamp(1.1rem, 4vw, 2rem);
  min-height: 64px;
  /* solid paper band so the live dots read against the costume texture */
  background: var(--paper);
  border-radius: 14px;
  box-shadow: 0 0 0 1px var(--paper2);
  padding: 0.7rem 1.2rem;
}

#pulse-display .group {
  display: flex;
  gap: clamp(0.45rem, 1.6vw, 0.8rem);
  align-items: center;
}

.dot {
  width: clamp(20px, 4.2vw, 34px);
  height: clamp(20px, 4.2vw, 34px);
  border-radius: 50%;
  border: 2.5px solid var(--ink);
  background: transparent;
  transition: transform 60ms ease-out, background-color 60ms, border-color 60ms, box-shadow 60ms;
}

.dot.db { width: clamp(26px, 5.2vw, 42px); height: clamp(26px, 5.2vw, 42px); border-width: 3px; }
.dot.gs { border-style: dashed; }

/* hand-painted wobble: every dot squashed on its own axis, like the costume */
.dot { border-radius: 51% 49% 52% 48% / 48% 52% 47% 53%; }
.dot:nth-child(2n) { border-radius: 47% 53% 49% 51% / 53% 46% 54% 47%; transform: rotate(14deg); }
.dot:nth-child(3n) { border-radius: 53% 47% 46% 54% / 49% 53% 47% 51%; transform: rotate(-11deg); }
.dot:nth-child(3n+1) { border-radius: 49% 51% 54% 46% / 52% 48% 51% 49%; transform: rotate(23deg); }

.dot.lit { background: rgba(20, 20, 18, 0.3); }

.dot.active { transform: scale(1.22); border-style: solid; }
.dot.active.on-section {
  background: var(--ink); border-color: var(--ink);
  box-shadow: 0 0 0 5px var(--phos), 0 0 26px 6px rgba(168, 245, 113, 0.8);
}
.dot.active.on-down {
  background: var(--ink); border-color: var(--ink);
  box-shadow: 0 0 0 4px var(--phos), 0 0 14px rgba(168, 245, 113, 0.6);
}
.dot.active.on-group {
  background: var(--ink); border-color: var(--ink);
  box-shadow: 0 0 10px rgba(20, 20, 18, 0.4);
}
.dot.active.on-sub { background: var(--ink-soft); border-color: var(--ink-soft); }
.dot.active.on-countin { background: var(--phos-dark); border-color: var(--phos-dark); }

/* cross-accent voice: the other meter cutting across the barline */
.dot.active.x-hit { outline: 3px dashed var(--phos-dark); outline-offset: 4px; }
/* muted pulse (tacet / low-density build): time passes, no click */
.dot.active.ghost { opacity: 0.35; }

/* now-playing row */
#now-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
}

/* solid paper chips over the dots — like the band's sign panel at KEXP,
   with the cassette cover's fat black outlines */
#now-row > span, #sig-bpm {
  background: var(--paper);
  padding: 0.18em 0.6em;
  border-radius: 8px;
  border: 3px solid var(--ink);
}

#current-section { color: var(--ink); font-weight: 600; }
#bar-counter { font-family: var(--mono); font-weight: 700; color: var(--ink); }
#next-section { color: var(--ink-soft); }

body.countin #current-section { color: var(--phos-dark); }

/* transport */
#transport { display: flex; align-items: center; gap: 1rem; }

#btn-start {
  font-family: var(--display);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 1.15rem;
  padding: 0.7rem 2.6rem;
  border-radius: 999px;
  /* cassette gold with the fat black outline */
  background: var(--phos);
  color: var(--ink);
  border: 3px solid var(--ink);
  letter-spacing: 0.03em;
}

#btn-start:hover { background: #ffcc70; }
/* playing: flip to gold-on-black */
body.playing #btn-start { background: var(--ink); color: var(--phos); border-color: var(--phos); }

#edit-hint {
  font-size: 0.75rem;
  color: var(--phos-dark);
  opacity: 0;
  transition: opacity 200ms;
}
#edit-hint.show { opacity: 1; }

/* ---------- timeline ---------- */
#timeline-wrap {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.55rem;
}

#timeline { display: flex; gap: 3px; min-height: 52px; }

.tl-block {
  position: relative;
  flex-basis: 0;
  min-width: 30px;
  background: var(--panel2);
  border-radius: 5px;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  overflow: hidden;
  padding: 2px;
}

.tl-block .tl-sig { font-family: var(--mono); font-size: 0.72rem; color: var(--white); }
.tl-block .tl-grouping { font-family: var(--mono); font-size: 0.58rem; color: var(--muted); white-space: nowrap; }

.tl-block.tl-active { border-color: var(--phos); background: var(--ink); }
.tl-block.tl-active .tl-sig { color: var(--phos); }

.tl-block.tl-tacet { border-style: dashed; opacity: 0.55; }

/* seamless-reframe seam glyph: same pulse stream flows through */
.tl-block.seam::before {
  content: "∿";
  position: absolute;
  left: -7px;
  top: 50%;
  transform: translateY(-58%);
  color: var(--phos);
  font-size: 0.8rem;
  z-index: 2;
  text-shadow: 0 0 6px var(--bg);
}

#tl-playhead {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0.55rem;
  width: 2px;
  background: var(--phos);
  box-shadow: 0 0 8px rgba(168, 245, 113, 0.7);
  border-radius: 2px;
  pointer-events: none;
  transition: left 80ms linear;
}

/* ---------- editor ---------- */
#editor {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

#editor h2 {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

#section-list { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }

.section-row {
  display: grid;
  grid-template-columns: auto minmax(5.5rem, 1.2fr) minmax(5.5rem, 1fr) 3rem 3.4rem 4.2rem 4rem 3.2rem 3.2rem 3.6rem 3.6rem auto;
  gap: 0.35rem;
  align-items: center;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0.4rem 0.5rem;
}

.section-row .f-cross, .section-row .f-ramp { font-family: var(--mono); }
button.mini.t.on { background: var(--phos); color: var(--ink); border-color: var(--phos); }

.section-row input, .section-row select { padding: 0.32rem 0.45rem; font-size: 0.8rem; width: 100%; }
.section-row .f-grouping, .section-row .f-bpm, .section-row .f-bars { font-family: var(--mono); }

.f-sig, .f-qbpm {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}
.f-sig { color: var(--white); }

.row-order, .row-actions { display: flex; gap: 0.25rem; }

button.mini {
  padding: 0.22rem 0.5rem;
  font-size: 0.78rem;
  line-height: 1;
  border-radius: 5px;
}
.row-actions [data-act="reframe"] { color: var(--phos); border-color: rgba(168, 245, 113, 0.45); }
.row-actions [data-act="delete"]:hover { color: var(--err); border-color: var(--err); }

.editor-footer { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }

label.check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
}

/* ---------- settings footer ---------- */
#settings {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--muted);
}

#settings .knobs { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }

input[type="range"] { accent-color: var(--phos); width: 8rem; }
input[type="checkbox"] { accent-color: var(--phos); }

.credit { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.06em; }
.credit .k { color: var(--phos); }
.credit::before { content: "▲ "; color: var(--faint); }

/* ---------- KEXP video sync ---------- */
#kexp {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
}

#kexp-toggle {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--phos);
  padding: 0.3rem 0;
}

#kexp-body { display: none; flex-direction: column; gap: 0.8rem; padding-top: 0.6rem; }
#kexp-body.open { display: flex; }

/* z-index above the invert pane: the band appears in true color on both halves */
#kexp-video-wrap { position: relative; z-index: 1000; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 8px; overflow: hidden; }
#kexp-video-wrap iframe, #kexp-video { width: 100%; height: 100%; }

#kexp-load {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 12rem;
  height: 3rem;
  border-color: var(--phos);
  color: var(--phos);
  z-index: 2;
}

#kexp-status { font-family: var(--mono); font-size: 0.78rem; color: var(--white); }

#kexp-dots { display: flex; gap: 1rem; align-items: center; min-height: 30px; }
#kexp-dots .group { display: flex; gap: 0.4rem; }
#kexp-dots .dot { width: 16px; height: 16px; border-color: var(--muted); }
#kexp-dots .dot.db { width: 22px; height: 22px; }
#kexp-dots .dot.lit { background: rgba(241, 241, 241, 0.3); }
#kexp-dots .dot.active.on-down { background: var(--phos); border-color: var(--phos); }
#kexp-dots .dot.active.on-group { background: var(--white); border-color: var(--white); }
#kexp-dots .dot.active.on-sub { background: var(--faint); border-color: var(--faint); }

#kexp-chart { display: flex; flex-direction: column; gap: 0.3rem; }
.kexp-row {
  display: grid;
  grid-template-columns: 7rem 6rem auto auto auto auto auto 5.4rem;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.78rem;
}
.kexp-row .kr-name { color: var(--white); font-weight: 600; }
.kexp-row .kr-at { font-family: var(--mono); color: var(--muted); font-size: 0.7rem; }
.kexp-row .kr-bpm { font-family: var(--mono); padding: 0.25rem 0.4rem; }

.kexp-controls { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.kexp-controls .val { font-family: var(--mono); font-size: 0.7rem; color: var(--white); }

/* ---------- tuner page ---------- */
#tuner-video-wrap {
  position: relative;
  z-index: 1000;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}
#tuner-video-wrap iframe, #tuner-video { width: 100%; height: 100%; }
#tuner-load {
  position: absolute; inset: 0; margin: auto;
  width: 14rem; height: 3rem;
  border-color: var(--phos); color: var(--phos); z-index: 2;
}

#tuner-wave-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.5rem;
  position: relative;
  z-index: 1000; /* above the invert pane: colors mean the same on both halves */
}
#tuner-wave { display: block; width: 100%; height: 140px; cursor: grab; touch-action: none; }
#tuner-wave.dragging { cursor: grabbing; }
#tuner-wave-hint { font-size: 0.62rem; color: var(--muted); font-family: var(--mono); margin-top: 0.3rem; }

#tuner-howto {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.2rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  line-height: 1.6;
}
#tuner-howto b { color: var(--phos); font-weight: 700; }
#tuner-howto em { color: var(--white); font-style: normal; }

#tuner-songs { display: flex; flex-direction: column; gap: 0.3rem; }
.tuner-row { grid-template-columns: 10rem 6.5rem 4.5rem 6rem auto auto auto auto auto; }
.tuner-row .kr-grp { font-family: var(--mono); padding: 0.25rem 0.4rem; width: 100%; }
.tuner-row .kr-sel { text-align: left; }
.tuner-row.sel { outline: 2px solid var(--phos); border-radius: 6px; }

#tuner-pad-wrap { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
#tuner-pad {
  width: 11rem; height: 11rem;
  border-radius: 50%;
  background: var(--phos);
  color: var(--ink);
  border: 4px solid var(--ink);
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.6rem;
  line-height: 1.2;
  flex-shrink: 0;
  transition: transform 60ms;
}
#tuner-pad span { display: block; font-family: var(--mono); font-weight: 400; font-size: 0.6rem; letter-spacing: 0.1em; }
#tuner-pad.hit { transform: scale(0.93); background: #ffcc70; }

#tuner-stats { display: flex; flex-direction: column; gap: 0.5rem; min-width: 16rem; flex: 1; }
#tuner-stats .mono { font-family: var(--mono); font-size: 0.75rem; color: var(--white); line-height: 1.7; }
#tuner-stats .good { color: var(--phos); }
#tuner-stats .ok { color: var(--muted); }
#tuner-stats .bad { color: var(--err); }
.tuner-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.btn-link {
  display: inline-block;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.42rem 0.6rem;
  color: var(--white);
  text-decoration: none;
  font-size: 0.85rem;
}
.btn-link:hover { border-color: var(--muted); }

/* ---------- fabric debug panel ---------- */
#dots-debug {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 15rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.8rem 0.9rem;
  display: none;
  flex-direction: column;
  gap: 0.45rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  z-index: 998; /* below the invert pane: the panel obeys the split too */
}

#dots-debug.open { display: flex; }

#dots-debug h3 {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}

#dots-debug .close { cursor: pointer; color: var(--faint); }
#dots-debug .close:hover { color: var(--err); }

#dots-debug label {
  display: grid;
  grid-template-columns: 5.2rem 1fr 2.4rem;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--muted);
}

#dots-debug input[type="range"] { width: 100%; accent-color: var(--phos); }
#dots-debug .val { font-family: var(--mono); font-size: 0.66rem; color: var(--white); text-align: right; }
#dots-debug .row { display: flex; gap: 0.4rem; margin-top: 0.2rem; }
#dots-debug .row button { flex: 1; font-size: 0.72rem; padding: 0.3rem; }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .section-row {
    grid-template-columns: auto 1fr 1fr auto;
    grid-auto-rows: auto;
  }
  .section-row .f-name { grid-column: 2 / 4; }
  #sig-readout { gap: 0.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .dot, #tl-playhead, button { transition: none; }
}
