:root {
  --bg: #05030c;
  --ink: #f4f0ff;
  --muted: #a49cc4;
  --line: rgba(244, 240, 255, 0.16);
  --panel: rgba(9, 6, 22, 0.74);
  --hot: #ff3fa4;
  --cool: #3fd2ff;
  --accent: var(--hot);
  --error: #ff9fb6;
  --warn-ink: #ffe3b8;
  --warn-line: rgba(255, 214, 150, 0.3);
  --display: Unbounded, 'Space Grotesk', system-ui, sans-serif;
  --sans: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--cool); outline-offset: 2px; }

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

#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

button { font: inherit; cursor: pointer; }

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: 6px;
  user-select: all;
}

/* ---- start & loading ---- */

.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  text-align: center;
  overflow-y: auto;
  animation: arrive 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

@keyframes arrive {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: none; }
}

h1 {
  margin: 0 0 14px;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(48px, 11vw, 104px);
  letter-spacing: -0.02em;
  line-height: 1;
  background: linear-gradient(100deg, var(--hot), #ffd23f 45%, var(--cool));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 28px rgba(255, 63, 164, 0.45));
}

.lede {
  max-width: 32em;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  text-wrap: pretty;
}

#repo-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: min(780px, 100%);
}

.deck-inputs {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.vs-tag {
  flex-shrink: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 15px;
  background: linear-gradient(100deg, var(--hot), var(--cool));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

#repo-url, #repo-url-b {
  flex: 1;
  min-width: 0;
  padding: 15px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#repo-url::placeholder, #repo-url-b::placeholder { color: rgba(244, 240, 255, 0.38); }

#repo-url:focus {
  border-color: var(--hot);
  box-shadow: 0 0 0 4px rgba(255, 63, 164, 0.15), 0 0 24px rgba(255, 63, 164, 0.25);
}

#repo-url-b:focus {
  border-color: var(--cool);
  box-shadow: 0 0 0 4px rgba(63, 210, 255, 0.15), 0 0 24px rgba(63, 210, 255, 0.25);
}

#go {
  min-width: 180px;
  padding: 14px 30px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(100deg, var(--hot), #ff7a3f);
  color: #12001a;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
  box-shadow: 0 0 24px rgba(255, 63, 164, 0.4);
  transition: transform 0.15s, box-shadow 0.2s;
}

#go:hover { transform: scale(1.04); box-shadow: 0 0 34px rgba(255, 63, 164, 0.6); }
#go:active { transform: scale(0.97); }

.chip.pair { border-color: rgba(63, 210, 255, 0.35); }

.checks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 22px;
  margin-top: 14px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.check input { accent-color: var(--hot); margin: 0; }

.recent {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 560px;
  margin-top: 18px;
}

.chip, .ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  transition: background 0.2s, border-color 0.2s;
}

.chip:hover, .ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(244, 240, 255, 0.34);
}

.ghost[aria-expanded="true"] {
  border-color: var(--hot);
  background: rgba(255, 63, 164, 0.14);
}

.error {
  max-width: 36em;
  margin: 20px 0 0;
  color: var(--error);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.notice {
  max-width: 36em;
  margin-top: 20px;
  padding: 12px 18px;
  border: 1px solid var(--warn-line);
  border-radius: 14px;
  background: rgba(255, 200, 120, 0.06);
  color: var(--warn-ink);
  font-size: 14px;
  line-height: 1.6;
}

.notice p { margin: 0; }
.notice p + p { margin-top: 6px; }

.hint {
  margin: 28px 0 0;
  color: rgba(244, 240, 255, 0.42);
  font-size: 12.5px;
}

/* the loading screen's equaliser */
.eq {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  height: 90px;
  margin-bottom: 28px;
}

.eq span {
  width: 10px;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(to top, var(--hot), #ffd23f, var(--cool));
  box-shadow: 0 0 14px rgba(255, 63, 164, 0.5);
  transform-origin: bottom;
  animation: bounce 0.94s ease-in-out infinite;  /* 128 bpm */
}

.eq span:nth-child(2) { animation-delay: -0.12s; }
.eq span:nth-child(3) { animation-delay: -0.47s; }
.eq span:nth-child(4) { animation-delay: -0.24s; }
.eq span:nth-child(5) { animation-delay: -0.7s; }
.eq span:nth-child(6) { animation-delay: -0.35s; }
.eq span:nth-child(7) { animation-delay: -0.59s; }

@keyframes bounce {
  0%, 100% { transform: scaleY(0.18); }
  50% { transform: scaleY(1); }
}

#step {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.5;
  white-space: pre-line;
}

#log {
  width: min(640px, 100%);
  max-height: 9.6em;
  margin: 16px 0 0;
  overflow: hidden;
  color: rgba(244, 240, 255, 0.36);
  font: 11.5px/1.6 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  mask-image: linear-gradient(to bottom, transparent, #000 45%);
}

/* ---- the show ---- */

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

#hud > * { pointer-events: auto; }
#hud > .phrase { pointer-events: none; }

.fade { transition: opacity 1s ease; }

body.idle { cursor: none; }
body.idle .fade { opacity: 0; pointer-events: none; }

/* how far through the current phrase */
.phrase {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
}

#phrase-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cool), var(--hot));
  box-shadow: 0 0 12px var(--hot);
  transform-origin: left;
  transform: scaleX(0);
}

.hud-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 8px 16px;
  padding: 20px 22px;
}

.deck-a { grid-column: 1; grid-row: 1; min-width: 0; }
.deck-state { grid-column: 3; grid-row: 1; justify-self: end; }

/* a battle: deck A on the left, deck B on the right, the fight in the middle */
body.battle .deck-b { grid-column: 3; grid-row: 1; justify-self: end; min-width: 0; text-align: right; }
body.battle .vs { grid-column: 2; grid-row: 1; }
body.battle .deck-state { grid-column: 2; grid-row: 2; justify-self: center; align-items: center; text-align: center; }
body.battle #repo-name { color: #ffc2e2; }
body.battle #repo-name-b { color: #c2f0ff; }
body.battle .deck-a, body.battle .deck-b { transition: opacity 0.25s; }
body.battle[data-deck="1"] .deck-a, body.battle[data-deck="0"] .deck-b { opacity: 0.5; }
body.battle[data-deck="0"] #repo-name { text-shadow: 0 0 18px var(--hot); }
body.battle[data-deck="1"] #repo-name-b { text-shadow: 0 0 18px var(--cool); }

.vs { padding-top: 10px; }

.meter {
  position: relative;
  width: min(300px, 30vw);
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, #1b8fb5, var(--cool));
  box-shadow: 0 0 16px rgba(63, 210, 255, 0.35);
}

#meter-a {
  position: absolute;
  inset: 0 auto 0 0;
  width: 50%;
  background: linear-gradient(90deg, #b51f6f, var(--hot));
  box-shadow: 0 0 16px var(--hot);
  transition: width 0.25s ease-out;
}

/* in sync, the two halves become one */
.vs.synced .meter { background: linear-gradient(90deg, var(--hot), #ffe066, var(--cool)); }
.vs.synced #meter-a { opacity: 0; }

#bpm {
  margin: 0;
  color: rgba(244, 240, 255, 0.6);
  font-family: var(--mono);
  font-size: 11px;
}

#repo-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 22px;
  color: var(--ink);
  text-decoration: none;
  overflow-wrap: break-word;
  text-shadow: 0 0 18px rgba(0, 0, 0, 0.8);
}

#repo-name:hover { text-decoration: underline; text-underline-offset: 4px; }

#mood {
  margin: 4px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.deck-state {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
  text-align: right;
}

#section {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  text-shadow: 0 0 18px var(--section-glow, rgba(63, 210, 255, 0.6));
  transition: color 0.2s;
}

body[data-section="drop"] #section { color: #ffe066; --section-glow: rgba(255, 63, 164, 0.9); }
body[data-section="build"] #section { color: #ff9fd2; --section-glow: rgba(255, 63, 164, 0.7); }
body[data-section="break"] #section { color: #a9e8ff; }

#beats { display: flex; gap: 6px; }

#beats span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  transition: background 0.08s, box-shadow 0.08s;
}

#beats span.on { background: var(--hot); box-shadow: 0 0 10px var(--hot); }
#beats span:first-child.on { background: #ffe066; box-shadow: 0 0 12px #ffe066; }

#countdown {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
}

.panel {
  position: absolute;
  top: 120px;
  right: 22px;
  width: min(390px, calc(100% - 32px));
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  font-size: 13.5px;
  line-height: 1.6;
  z-index: 5;  /* above the caption */
  max-height: calc(100vh - 210px);
  overflow-y: auto;
}

.panel ul { margin: 0; padding-left: 18px; }
.panel li + li { margin-top: 8px; }

.panel.mixer {
  top: auto;
  right: auto;
  bottom: 74px;
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, calc(100% - 32px));
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}

.mixer section + section { margin-top: 16px; }

.mixer h2 {
  margin: 0 0 9px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mixer h2 span {
  margin-left: 6px;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.genre-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 12.5px;
  transition: background 0.2s, border-color 0.2s;
}

.genre-chip:has(.swatch) { padding-left: 6px; }
.genre-chip:hover { background: rgba(255, 255, 255, 0.08); }

.genre-chip[aria-pressed="true"] {
  border-color: var(--hot);
  background: rgba(255, 63, 164, 0.16);
  box-shadow: 0 0 14px rgba(255, 63, 164, 0.25);
}

.swatch {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.inst {
  display: grid;
  grid-template-columns: 1fr 120px;
  align-items: center;
  column-gap: 12px;
  padding: 7px 0;
  border-top: 1px solid rgba(244, 240, 255, 0.07);
}

.inst:first-child { border-top: 0; }

.inst-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  cursor: pointer;
}

.inst input[type=range], .visual-row input[type=range] {
  width: 100%;
  accent-color: var(--hot);
}

.inst.off .inst-name,
.inst.off input[type=range] { opacity: 0.45; }

.inst-sub {
  grid-column: 1 / -1;
  min-height: 1em;
  margin: 2px 0 0 42px;
  color: var(--muted);
  font-size: 12px;
}

.visual-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  align-items: center;
  column-gap: 12px;
  padding: 6px 0;
  font-size: 13.5px;
}

.visual-row .switch { justify-self: end; }

.switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex-shrink: 0;
  width: 32px;
  height: 18px;
  margin: 0;
  border-radius: 999px;
  background: rgba(244, 240, 255, 0.18);
  cursor: pointer;
  transition: background 0.2s;
}

.switch::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink);
  transition: transform 0.2s;
}

.switch:checked { background: var(--hot); }
.switch:checked::before { transform: translateX(14px); background: #1a0012; }

#reset-mix { margin-top: 16px; }

.deck-label {
  margin: 10px 0 6px;
  font-family: var(--mono);
  font-size: 11.5px;
}

.deck-label:first-of-type { margin-top: 0; }
.deck-label.a { color: var(--hot); }
.deck-label.b { color: var(--cool); }

.mash-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  font-size: 13px;
}

.mash-row .genre-chip[data-from="1"][aria-pressed="true"] {
  border-color: var(--cool);
  background: rgba(63, 210, 255, 0.16);
  box-shadow: 0 0 14px rgba(63, 210, 255, 0.25);
}

#reasons .about-head {
  list-style: none;
  margin: 12px 0 0 -18px;
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#reasons .about-head:first-child { margin-top: 0; }

.with-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.with-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#again .narrow { display: none; }

/* ---- a new contender ---- */

/* Meta is cooking: a repo on its way in, in a row of its own under the HUD */
.cooking {
  grid-column: 1 / -1;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  padding: 8px 8px 8px 16px;
  border: 1px solid rgba(255, 170, 90, 0.45);
  border-radius: 999px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  box-shadow: 0 0 calc(12px + 28px * var(--kick, 0)) rgba(255, 122, 63, 0.5);
  transform: scale(calc(1 + 0.03 * var(--kick, 0)));
  animation: arrive 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.flames {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 22px;
  flex-shrink: 0;
}

.flames i {
  width: 7px;
  height: 18px;
  border-radius: 50% 50% 45% 45% / 65% 65% 35% 35%;
  background: radial-gradient(circle at 50% 75%, #fff6c2, #ffd23f 30%, #ff7a3f 60%, var(--hot));
  transform-origin: bottom;
  animation: flicker 0.42s ease-in-out infinite alternate;
}

.flames i:nth-child(2) { height: 22px; animation-delay: -0.21s; }
.flames i:nth-child(3) { animation-delay: -0.33s; }

@keyframes flicker {
  from { transform: scaleY(0.78) skewX(-4deg); opacity: 0.85; }
  to { transform: scaleY(1.08) skewX(5deg); opacity: 1; }
}

.cooking-text { min-width: 0; text-align: left; }

.cooking-title {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: linear-gradient(100deg, #ffd23f, #ff7a3f 25%, var(--hot) 50%, #ff7a3f 75%, #ffd23f);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sizzle 2.2s linear infinite;
}

@keyframes sizzle { to { background-position: -200% 0; } }

.cooking-step {
  display: block;
  max-width: 52ch;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cooking-close { width: 28px; height: 28px; color: var(--muted); }
.cooking-close svg { width: 15px; height: 15px; }

.cooking.burnt { border-color: rgba(255, 159, 182, 0.5); box-shadow: none; transform: none; }
.cooking.burnt .flames i { animation: none; filter: grayscale(1); opacity: 0.5; }
.cooking.burnt .cooking-title { animation: none; background: none; color: var(--error); }
.cooking.burnt .cooking-step { white-space: normal; }

/* the title card: slams in over the build-up, names the newcomer, and blows apart on the drop */
#hud > .contender { pointer-events: none; }

.contender {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  text-align: center;
}

.contender::before {
  content: '';
  position: absolute;
  inset: 15% 0;
  background: radial-gradient(ellipse at center, rgba(5, 3, 12, 0.8), rgba(5, 3, 12, 0) 68%);
  transition: opacity 0.4s;
}

.contender.blast::before { opacity: 0; }

.contender-inner {
  position: relative;
  max-width: 100%;
  transform: scale(calc(1 + 0.035 * var(--hit, 0)));
}

.contender-one {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(30px, 7.4vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: -0.04em 0 rgba(255, 63, 164, 0.9), 0.04em 0 rgba(63, 210, 255, 0.9), 0 0 40px rgba(255, 63, 164, 0.5);
  opacity: 0;
}

.contender-two {
  margin: 0.2em 0 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(20px, 4.6vw, 60px);
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: linear-gradient(100deg, #ffe066, #ff7a3f 50%, var(--hot));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0;
}

.contender-name {
  margin: 28px 0 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(18px, 3vw, 36px);
  color: #c2f0ff;
  text-shadow: 0 0 24px var(--cool);
  overflow-wrap: anywhere;
  opacity: 0;
}

.contender-meta {
  margin: 10px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12.5px;
  opacity: 0;
}

.contender.show .contender-one {
  animation: slam 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.15) both, glitch 2.4s steps(1) 0.8s infinite;
}
.contender.show .contender-two { animation: slam 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.15) 0.32s both; }
.contender.reveal .contender-name { animation: reveal 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
.contender.reveal .contender-meta { animation: reveal 0.5s ease 0.15s both; }
.contender.blast .contender-inner { animation: blast 0.6s cubic-bezier(0.5, 0, 0.9, 0.4) forwards; }

@keyframes slam {
  0% { opacity: 0; transform: scale(2.6); }
  60% { opacity: 1; transform: scale(0.96); }
  100% { opacity: 1; transform: none; }
}

@keyframes glitch {
  0%, 84%, 100% { opacity: 1; transform: none; }
  86% { opacity: 1; transform: translate(-4px, 1px) skewX(-8deg); }
  90% { opacity: 1; transform: translate(5px, -1px); }
  94% { opacity: 1; transform: translate(-1px, 0); }
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(14px) scale(0.92); }
  to { opacity: 1; transform: none; }
}

@keyframes blast {
  to { opacity: 0; transform: scale(1.9); }
}

/* bringing a repo in */
.add-panel h2 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.add-note { margin: 0 0 12px; color: var(--muted); font-size: 13px; }

.add-row { display: flex; gap: 8px; }

#add-url {
  flex: 1;
  min-width: 0;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  outline: none;
}

#add-url::placeholder { color: rgba(244, 240, 255, 0.38); }
#add-url:focus { border-color: var(--cool); box-shadow: 0 0 0 3px rgba(63, 210, 255, 0.15); }
#add-go:disabled { opacity: 0.45; cursor: default; box-shadow: none; }

/* ---- finding a gig ---- */

.go-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; }

/* a song for the second deck */
.song-pick {
  flex-shrink: 0;
  padding: 13px 16px;
  border: 1px dashed rgba(63, 210, 255, 0.5);
  border-radius: 999px;
  color: #c2f0ff;
  font-size: 13.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.song-pick:hover, .song-pick:focus-within { background: rgba(63, 210, 255, 0.1); border-color: var(--cool); }

.song-chip {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px 9px 20px;
  border: 1px solid var(--cool);
  border-radius: 999px;
  background: rgba(63, 210, 255, 0.1);
  box-shadow: 0 0 20px rgba(63, 210, 255, 0.2);
}

#song-name { overflow: hidden; color: #c2f0ff; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }

#song-clear {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  font-size: 16px;
  line-height: 1;
}

.add-or { margin: 10px 0 0; color: var(--muted); font-size: 12.5px; }
.file-link { color: var(--cool); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.file-link:focus-within { outline: 2px solid var(--cool); outline-offset: 2px; }
.mash-song { margin: 0; color: var(--muted); font-size: 13px; }
.gig-button { padding: 12px 20px; font-size: 13.5px; }
.gig-button svg { width: 17px; height: 17px; }

.gigs {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(340px, 440px) 1fr;
  background: var(--bg);
  animation: arrive 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.gig-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  padding: 16px 18px 28px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: rgba(9, 6, 22, 0.96);
  font-size: 13.5px;
  line-height: 1.55;
}

.gig-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.gig-head h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
  background: linear-gradient(100deg, var(--hot), #ffd23f 60%, var(--cool));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.gig-lede { margin: 0; color: var(--muted); }

.gig-live {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 12px;
  border: 1px solid rgba(255, 63, 164, 0.4);
  border-radius: 999px;
  background: rgba(255, 63, 164, 0.08);
  color: #ffc2e2;
  font-size: 12.5px;
}

.live-dot { width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; background: var(--hot); box-shadow: 0 0 10px var(--hot); animation: mic-pulse 1s ease-in-out infinite; }
.gig-lede b { color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.gigs .notice { margin: 0; max-width: none; font-size: 13px; }

.gig-search { display: flex; flex-wrap: wrap; gap: 8px; }

.gigs input[type=text], .gigs input[type=email], .gigs select, .gigs textarea {
  min-width: 0;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  outline: none;
}

.gigs select { border-radius: 999px; }
.gigs select option { background: #120c24; }
.gigs input:focus, .gigs select:focus, .gigs textarea:focus { border-color: var(--cool); box-shadow: 0 0 0 3px rgba(63, 210, 255, 0.15); }
.gigs input::placeholder, .gigs textarea::placeholder { color: rgba(244, 240, 255, 0.38); }
#gig-city { flex: 1 1 160px; border-radius: 999px; }

.gig-me {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.gig-me summary, .draft-sources summary {
  cursor: pointer;
  font-family: var(--display);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gig-me summary span { margin-left: 6px; color: var(--muted); font-family: var(--sans); font-weight: 400; font-size: 12px; letter-spacing: 0; text-transform: none; }
.gig-me label:not(.check), .draft label { display: grid; gap: 4px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.gig-me .check { margin-top: 10px; justify-content: flex-start; }
.gigs textarea { resize: vertical; line-height: 1.5; }

.gig-status { margin: 0; color: var(--muted); font-size: 12.5px; }

.gig-list { display: flex; flex-direction: column; gap: 6px; }

.gig-item {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}

.gig-item:hover { background: rgba(255, 255, 255, 0.05); }
.gig-item[aria-pressed="true"] { border-color: var(--hot); background: rgba(255, 63, 164, 0.1); }
.gig-when { color: #ffe066; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.gig-what { font-weight: 500; font-size: 14px; }
.gig-where { color: var(--muted); font-size: 12px; }

.gig-detail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(255, 63, 164, 0.4);
  border-radius: 16px;
  background: rgba(255, 63, 164, 0.05);
  scroll-margin: 12px;
}

#gig-image { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; }
.gig-detail h3 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 17px; line-height: 1.3; }
.gig-facts, .gig-more { margin: 0; color: var(--muted); font-size: 12.5px; }
.gig-link { color: var(--cool); font-size: 12.5px; }

.draft-working { justify-self: start; width: fit-content; max-width: 100%; margin-top: 4px; }
.draft-error { padding: 10px 12px; border: 1px solid rgba(255, 159, 182, 0.4); border-radius: 12px; color: var(--error); }
.draft-error p { margin: 0 0 8px; }
.draft-error p:only-child { margin: 0; }

.draft { display: flex; flex-direction: column; gap: 2px; }
.draft-who { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.draft-who a, .draft-sources a { color: var(--cool); overflow-wrap: anywhere; }
.draft-how { color: var(--warn-ink); }
.draft-maybe { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; padding: 8px 10px; border: 1px dashed var(--warn-line); border-radius: 10px; }
.draft-maybe p { flex-basis: 100%; margin: 0; color: var(--warn-ink); font-size: 12.5px; }
.draft label { color: var(--ink); }

.clip {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.clip-genre, .clip-note { margin: 0; font-size: 12.5px; }
.clip-note { color: var(--muted); font-family: var(--mono); font-size: 11px; }
#clip-player { width: 100%; height: 36px; margin: 8px 0 4px; }

.send-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.send-row a { text-decoration: none; }
.send { padding: 10px 20px; font-size: 13px; }
.send-note { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.draft-sources { margin-top: 10px; }
.draft-sources ul { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; }

.gig-map { min-height: 0; background: #0b0816; }

.gig-pin {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: radial-gradient(circle, var(--hot), #b51f6f);
  box-shadow: 0 0 16px var(--hot);
  color: #fff;
  font: 700 11px var(--sans);
  transition: transform 0.15s;
}

.gig-pin.on { background: radial-gradient(circle, #ffe066, #ff7a3f); box-shadow: 0 0 22px #ffe066; color: #1a0012; transform: scale(1.3); }

.gigs .leaflet-container { background: #0b0816; font-family: var(--sans); }
/* OpenStreetMap's light tiles, turned into a night map */
.gigs .leaflet-tile-pane { filter: invert(1) hue-rotate(200deg) brightness(0.8) contrast(1.1) saturate(0.6); }
.gigs .leaflet-bar a { background: #150f2a; color: var(--ink); border-color: var(--line); }
.gigs .leaflet-control-attribution { background: rgba(9, 6, 22, 0.8); color: var(--muted); }
.gigs .leaflet-control-attribution a { color: var(--cool); }

@media (max-width: 760px) {
  .gigs { grid-template-columns: 1fr; grid-template-rows: 38vh 1fr; }
  .gig-map { grid-row: 1; }
  .gig-panel { grid-row: 2; border-right: 0; border-top: 1px solid var(--line); }
}

/* voice commands: what Muse Voice Transcribe heard, and what it did */
#hud > .heard { pointer-events: none; }

.heard {
  position: absolute;
  left: 50%;
  bottom: 160px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 32px);
  padding: 10px 18px;
  border: 1px solid rgba(77, 148, 255, 0.6);
  border-radius: 999px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  box-shadow: 0 0 26px rgba(8, 102, 255, 0.35);
  font-size: 15px;
  transform: translateX(-50%);
  animation: heard-in 0.25s ease-out both;
}

@keyframes heard-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

.heard-dot { width: 10px; height: 10px; flex-shrink: 0; border-radius: 50%; background: #4d94ff; }
.heard.listening .heard-dot { background: #ff4d6d; animation: mic-pulse 0.9s ease-in-out infinite; }
.heard.speak { border-color: rgba(80, 230, 140, 0.8); box-shadow: 0 0 26px rgba(80, 230, 140, 0.45); }
.heard.speak .heard-dot { background: #50e68c; }
.heard.thinking .heard-dot { animation: mic-pulse 0.5s ease-in-out infinite; }
.heard.error { border-color: rgba(255, 159, 182, 0.5); box-shadow: none; }
.heard.error .heard-dot { background: var(--error); }
#heard-text { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.heard.error #heard-text { white-space: normal; }

/* how loud the mic is while you hold V */
.heard-level { display: none; width: 46px; height: 6px; flex-shrink: 0; overflow: hidden; border-radius: 3px; background: rgba(255, 255, 255, 0.14); }
.heard.listening .heard-level { display: block; }
.heard-level i { display: block; width: calc(var(--level, 0) * 100%); height: 100%; background: #ff4d6d; transition: width 0.08s linear; }

@keyframes mic-pulse { 50% { transform: scale(1.5); opacity: 0.55; } }

#voice.on, #d-voice.on { background: rgba(255, 77, 109, 0.25); color: #ff8fa3; box-shadow: 0 0 14px rgba(255, 77, 109, 0.5); }

/* with the controls in their own window, this one is all show */
body.remote .controls,
body.remote .panel { display: none !important; }

/* now playing */
#caption {
  position: absolute;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  width: min(760px, calc(100% - 32px));
  text-align: center;
  pointer-events: none;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.9);
  transition: opacity 0.18s ease, bottom 1s ease;
}

#caption.fading { opacity: 0; }
body.idle #caption { bottom: 40px; }

#caption-tag {
  margin: 0 0 6px;
  color: var(--cool);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

body[data-section="drop"] #caption-tag { color: #ffe066; }
body.battle #caption[data-deck="0"] #caption-tag { color: var(--hot); }
body.battle #caption[data-deck="1"] #caption-tag { color: var(--cool); }

#caption-msg {
  margin: 0 0 6px;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(17px, 2.4vw, 26px);
  line-height: 1.25;
  color: var(--ink);
  overflow-wrap: anywhere;
}

#caption-meta {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
}

.controls {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  white-space: nowrap;
}

.drop-button {
  padding: 7px 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(100deg, var(--hot), #ff7a3f);
  color: #12001a;
  font-family: var(--display);
  font-weight: 800;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform 0.12s, box-shadow 0.2s;
}

.drop-button:hover { box-shadow: 0 0 20px rgba(255, 63, 164, 0.6); }
.drop-button:active { transform: scale(0.94); }
.drop-button.armed { animation: armed 0.4s ease-in-out 4; }

@keyframes armed {
  50% { box-shadow: 0 0 28px #ffe066; transform: scale(1.08); }
}

.icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
}

.icon:hover { background: rgba(255, 255, 255, 0.08); }

.icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#sound .cross { display: none; }
#sound.muted .cross { display: inline; }
#sound.muted .waves { display: none; }

#volume {
  width: 90px;
  accent-color: var(--hot);
}

@media (max-width: 600px) {
  #volume { display: none; }
  #again .wide { display: none; }
  #again .narrow { display: inline; }
  .inst, .visual-row { grid-template-columns: 1fr 96px; }
  .hud-top { padding: 16px; }
  #repo-name { font-size: 17px; }
  #section { font-size: 18px; }
  .panel { top: 130px; right: 16px; }
  #caption { bottom: 78px; }
  .controls { gap: 4px; }
  .controls .ghost { padding: 6px 10px; }
  .controls .icon { width: 30px; height: 30px; }
  .drop-button { padding: 7px 12px; }
  #mixer-toggle svg { display: none; }
  #add .wide { display: none; }
  #pop-out { display: none; }  /* a phone has no second window to put it in */
  #voice { display: none; }  /* nor room for the mic; voice commands are for the decks */
  #gigs-open .wide { display: none; }
  .heard { bottom: 140px; font-size: 13.5px; }
  .cooking-step { max-width: 60vw; }
  .deck-inputs { flex-direction: column; }
  #repo-url, #repo-url-b { width: 100%; }
  body.battle .hud-top { grid-template-columns: 1fr 1fr; }
  body.battle .deck-b { grid-column: 2; }
  body.battle .vs { grid-column: 1 / -1; grid-row: 2; justify-self: center; padding-top: 0; }
  body.battle .deck-state { grid-column: 1 / -1; grid-row: 3; }
  .meter { width: 60vw; }
  .mash-row { grid-template-columns: 1fr; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .eq span { animation-duration: 3s; }
  .screen { animation: none; }
  .drop-button.armed { animation: none; }
  .cooking { animation: none; transform: none; }
  .flames i, .cooking-title { animation: none; }
  .contender-inner { transform: none; }
  .contender.show .contender-one,
  .contender.show .contender-two,
  .contender.reveal .contender-name,
  .contender.reveal .contender-meta { animation: fade-in 0.4s ease both; }
  .contender.blast .contender-inner { animation: fade-out 0.4s ease forwards; }
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { to { opacity: 0; } }
