/* Sesh, "Sharp edge": square corners, flat colour blocks, lilac and red accents.
   Sekuya for display type, Space Grotesk for everything else.
   Dark by default; each device can switch to light (the page sets data-theme on <html>). */

:root {
  --accent: #ae94ff; /* lilac: the one pop of colour */
  --accent-hi: #c3b0ff;
  --on-accent: #111111;
  --red: #ff4d4d;
  --on-red: #111111;
  --display: "Sekuya", "Arial Black", sans-serif;
  --font: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;

  /* Dark: graphite with a hint of blue, near-black bars */
  --bg: #1b1c20;
  --panel: #25262b;
  --ink: #efefeb; /* text */
  --ink-2: #a3a5ac;
  --dim: #7f818a;
  --line: #34363c; /* dividers */
  --edge: #45474e; /* panel borders */
  --solid: #101114; /* the black bars and blocks */
  --solid-hi: #1d1e23;
  --solid-edge: #55575f;
  --solid-line: #2c2d33;
  --on-solid: #efefeb;
  --on-solid-2: #b1b3ba;
  --field: #1b1c20;
  --solid-field: #1f2025; /* text boxes inside the black blocks */
  --solid-field-ink: #efefeb;
  --solid-field-edge: #45474e;
  --placeholder: #7f818a;
  --knob: #a3a5ac;
  --pop-edge: #101114; /* around the coloured blocks */
  --attention: var(--accent);
  --meter: var(--accent);
  --art: var(--solid); /* the tile shown when a song has no picture */
  --art-bar: var(--accent);
  --hover: rgba(255, 255, 255, 0.06);
  --hover-2: rgba(255, 255, 255, 0.09);
  --code: #34363c;
  --shadow: rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #d9d9d9;
  --panel: #f4f4f4;
  --ink: #111111;
  --ink-2: #3f3f3f;
  --dim: #898989;
  --line: #c4c4c4;
  --edge: #898989;
  --solid: #111111;
  --solid-hi: #2a2a2a;
  --solid-edge: #898989;
  --solid-line: #3a3a3a;
  --on-solid: #f4f4f4;
  --on-solid-2: #c4c4c4;
  --field: #f4f4f4;
  --solid-field: #f4f4f4;
  --solid-field-ink: #111111;
  --solid-field-edge: #f4f4f4;
  --placeholder: #6b6b6b;
  --knob: #f4f4f4;
  --pop-edge: #111111;
  --attention: #111111;
  --meter: #111111;
  --art: var(--red);
  --art-bar: #111111;
  --hover: rgba(17, 17, 17, 0.06);
  --hover-2: rgba(17, 17, 17, 0.08);
  --code: #e8e8e8;
  --shadow: rgba(17, 17, 17, 0.2);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 2px; }
svg { flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.dark :focus-visible { outline-color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Type ---------- */

.wordmark { font-family: var(--display); letter-spacing: 0.02em; line-height: 1; margin: 0; }
.label {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.display { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: 0.01em; }
.mono { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }

/* ---------- Surfaces ---------- */

.panel { background: var(--panel); border: 1px solid var(--edge); }
.dark { background: var(--solid); color: var(--on-solid); }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

.banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 18px;
  background: var(--red);
  color: var(--on-red);
  border: 1px solid var(--pop-edge);
  font-size: 14px;
  line-height: 1.4;
}
.banner.calm { background: var(--accent); color: var(--on-accent); }
.banner svg { margin-top: 1px; }

/* ---------- Buttons ---------- */

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  border: 1px solid var(--edge);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-ink { background: var(--solid); color: var(--accent); border-color: var(--solid); }
.btn-ink:hover { background: var(--solid-hi); }
.btn-accent { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn-accent:hover { background: var(--accent-hi); }
.dark .btn { color: var(--on-solid); border-color: var(--solid-edge); }
.dark .btn:hover { background: rgba(244, 244, 244, 0.08); }
.dark .btn-accent { color: var(--on-accent); border-color: var(--accent); }
.dark .btn-accent:hover { background: var(--accent-hi); }
.btn-small { height: 36px; padding: 0 12px; font-size: 12px; }
.btn-wide { width: 100%; }

.square {
  appearance: none;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 0;
  background: var(--solid);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.square:disabled { opacity: 0.4; cursor: not-allowed; }

.icon-btn {
  appearance: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
}
.icon-btn:hover { background: var(--hover-2); color: var(--ink); }
.icon-btn.on { color: var(--ink); }
.dark .icon-btn { color: var(--on-solid-2); }
.dark .icon-btn:hover { background: rgba(244, 244, 244, 0.08); color: var(--on-solid); }

.link-btn {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- Form controls ---------- */

.field {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--edge);
  border-radius: 0;
  background: var(--field);
  color: var(--ink);
  font-size: 16px; /* 16px stops iPhones zooming in */
}
.field:focus { outline: 2px solid var(--ink); outline-offset: -2px; }
.field::placeholder { color: var(--placeholder); }
.field-sm { height: 36px; padding: 0 10px; font-size: 15px; }
select.field {
  appearance: none;
  padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.num { width: 76px; text-align: center; }

/* Square on/off switch: a real checkbox, so it works with labels and the keyboard */
.switch {
  appearance: none;
  flex: none;
  width: 48px;
  height: 28px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: var(--edge) linear-gradient(var(--knob), var(--knob)) no-repeat 3px 3px / 22px 22px;
  cursor: pointer;
}
.switch:checked { background: var(--solid) linear-gradient(var(--accent), var(--accent)) no-repeat 23px 3px / 22px 22px; }
.switch:disabled { opacity: 0.4; cursor: not-allowed; }

.stepper { display: inline-flex; align-items: center; gap: 8px; }
.stepper button {
  appearance: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--edge);
  border-radius: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.stepper button:hover { background: var(--hover); }
.stepper output { min-width: 34px; text-align: center; font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }

.seg { display: flex; border: 1px solid var(--edge); }
.seg button {
  appearance: none;
  flex: 1;
  height: 38px;
  border: 0;
  border-left: 1px solid var(--edge);
  border-radius: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.seg button:first-child { border-left: 0; }
.seg button[aria-pressed="true"] { background: var(--solid); color: var(--accent); }
.seg button:disabled { opacity: 0.35; cursor: not-allowed; }
.dark .seg { border-color: var(--solid-edge); }
.dark .seg button { border-color: var(--solid-edge); color: var(--on-solid); }
.dark .seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

/* A setting: text on the left, its control on the right */
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.row > span:first-child { flex: 1; }
.hint { display: block; font-size: 13px; font-weight: 400; color: var(--ink-2); }
.stack { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }

/* ---------- Chips ---------- */

.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--ink);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.chip-youtube { background: var(--solid); color: var(--accent); border-color: var(--pop-edge); }
.chip-soundcloud { background: transparent; color: var(--ink); }
.chip-spotify { background: var(--accent); color: var(--on-accent); border-color: var(--pop-edge); }
.chip-file { background: var(--line); color: var(--ink); border-color: var(--pop-edge); }
.chip-cohost { background: var(--solid); color: var(--accent); border-color: var(--pop-edge); }

/* ---------- Song lists ---------- */

.list { list-style: none; margin: 0; padding: 0; }
.song {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  background: var(--panel);
}
.song .pos { width: 28px; flex: none; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.song .text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.song .title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song .meta { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song .by { width: 120px; flex: none; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song .chips { display: flex; gap: 6px; flex: none; }
.queue-panel .song .chips, .requests .song .chips { width: 190px; }
.song .reason { font-size: 13px; color: var(--ink); }
.song .thumb { width: 44px; height: 44px; flex: none; object-fit: cover; background: var(--line); }
.empty { padding: 18px 0; color: var(--ink-2); border-top: 1px solid var(--line); }

.grip { cursor: grab; touch-action: none; }
.sorting, .sorting * { cursor: grabbing !important; user-select: none; }
.song.dragging { position: relative; z-index: 2; outline: 2px solid var(--ink); box-shadow: 0 8px 20px var(--shadow); }
.sorting .song:not(.dragging) { transition: transform 120ms ease; }

/* ---------- Progress and art ---------- */

.progress { display: flex; align-items: center; gap: 14px; font-variant-numeric: tabular-nums; }
.progress .bar { flex: 1; height: 6px; background: var(--line); position: relative; }
.progress .bar > div { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--meter); }

.art {
  background: var(--art);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6%;
  padding: 16%;
}
.art i { display: block; width: 7%; background: var(--art-bar); }
.art i:nth-child(1) { height: 41%; } .art i:nth-child(2) { height: 76%; } .art i:nth-child(3) { height: 59%; }
.art i:nth-child(4) { height: 100%; } .art i:nth-child(5) { height: 68%; } .art i:nth-child(6) { height: 88%; }
.art i:nth-child(7) { height: 47%; }
@media (prefers-reduced-motion: no-preference) {
  .playing .art i, .stage[data-state="playing"] .art i { animation: bounce 1.1s ease-in-out infinite alternate; transform-origin: bottom; }
  .playing .art i:nth-child(2n), .stage[data-state="playing"] .art i:nth-child(2n) { animation-duration: 0.8s; }
  .playing .art i:nth-child(3n), .stage[data-state="playing"] .art i:nth-child(3n) { animation-duration: 1.4s; }
}
@keyframes bounce { from { transform: scaleY(0.35); } to { transform: scaleY(1); } }

/* ---------- Start screen (host) ---------- */

.start { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 32px; }
.start-inner { max-width: 560px; }
.start .wordmark { font-size: clamp(88px, 16vw, 168px); color: var(--accent); }
.start p { margin: 28px 0 32px; font-size: 18px; color: var(--on-solid-2); }
.start a { color: var(--accent); }
.start .btn { height: 58px; padding: 0 30px; font-size: 16px; }

/* ---------- Host screen ---------- */

.topbar {
  height: 84px;
  padding: 0 40px;
  display: flex;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid var(--solid-edge);
}
.topbar .wordmark { font-size: 40px; color: var(--accent); }
.topbar .status { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; }
.topbar .status > span:not(.dot) { overflow: hidden; text-overflow: ellipsis; }
.topbar .status .sub { color: var(--dim); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .grow { flex: 1; }
.uptime { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.dark .uptime { color: var(--on-solid-2); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--dim); }
.dot.live { background: var(--red); box-shadow: 0 0 0 4px rgba(255, 77, 77, 0.25); }
.dot.ok { background: var(--accent); }

.host-main { display: flex; gap: 28px; padding: 28px 40px 40px; align-items: flex-start; }
.col-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.col-side { width: 384px; flex: none; display: flex; flex-direction: column; gap: 18px; }

.now { display: flex; gap: 32px; padding: 28px; }
.media { position: relative; width: 420px; aspect-ratio: 16 / 9; flex: none; background: var(--solid); align-self: center; }
.media > * { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.media #cover { object-fit: cover; }
.media:not([data-mode="youtube"]) #yt,
.media:not([data-mode="soundcloud"]) #sc { visibility: hidden; }
.media:not([data-mode="cover"]) #cover { display: none; }
.media:not([data-mode="art"]):not([data-mode="empty"]) .art { display: none; }
.now-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.now-title {
  margin: 0;
  font-size: clamp(30px, 3.4vw, 52px);
  line-height: 1.1;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.now-title.mid { font-size: clamp(28px, 2.8vw, 40px); }
.now-title.long { font-size: clamp(22px, 2.2vw, 32px); }
.now-artist { font-size: 20px; }
.now-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
.now-meta strong { color: var(--ink); }
.controls { display: flex; align-items: center; gap: 12px; margin-top: 6px; flex-wrap: wrap; }
.votes { font-size: 14px; color: var(--ink-2); }

.queue-panel, .requests { padding: 22px 24px 10px; }
.queue-panel .panel-head, .requests .panel-head { padding-bottom: 10px; }
.requests { border-color: var(--attention); border-width: 2px; }
.requests .song { flex-wrap: wrap; }
.requests .actions { display: flex; gap: 8px; }

.join { background: var(--accent); color: var(--on-accent); border: 1px solid var(--edge); padding: 26px 24px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.join h2 { margin: 0; font-size: 22px; line-height: 1.15; }
.qr { width: 220px; height: 220px; padding: 14px; background: #f4f4f4; } /* stays light so phones can read it */
.qr img, .qr canvas { width: 192px !important; height: 192px !important; }
.join-url { font-size: 18px; letter-spacing: 0.02em; word-break: break-all; }
.join-note { display: flex; align-items: center; gap: 8px; font-size: 13px; }

.settings { padding: 0 24px 16px; }
.tabs { display: flex; margin: 0 -24px 6px; border-bottom: 1px solid var(--edge); }
.tabs button {
  appearance: none;
  flex: 1;
  height: 48px;
  border: 0;
  border-left: 1px solid var(--edge);
  border-radius: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.tabs button:first-child { border-left: 0; }
.tabs button[aria-selected="true"] { background: var(--solid); color: var(--accent); }
.tab-note { font-size: 13px; color: var(--ink-2); margin: 12px 0 0; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline .field { flex: 1; }
.inline .field.num { flex: none; width: 76px; }
.person { display: flex; align-items: center; gap: 10px; min-height: 52px; border-bottom: 1px solid var(--line); }
.person .name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .small { color: var(--ink-2); }
.steps { margin: 8px 0; padding-left: 20px; font-size: 14px; }
.steps li { margin: 4px 0; }
.code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; background: var(--code); padding: 2px 6px; word-break: break-all; }
.service { padding: 14px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.service-head { display: flex; align-items: center; gap: 10px; font-weight: 700; }

@media (max-width: 1180px) {
  .topbar { padding: 0 20px; gap: 16px; }
  .topbar .status .sub { display: none; }
  .topbar .btn { padding: 0 14px; }
  .host-main { flex-direction: column; align-items: stretch; padding: 20px; }
  .col-side { width: 100%; }
  .now { flex-direction: column; }
  .media { width: 100%; }
}
@media (max-width: 900px) {
  .topbar #screenBtn span { display: none; } /* the TV icon alone */
}
@media (max-width: 700px) {
  .topbar { padding: 12px 16px; gap: 10px; height: auto; min-height: 0; flex-wrap: wrap; }
  .topbar .status .sub { display: none; }
  .song .by { display: none; }
  /* A phone as the host screen: SESH, the status and the theme on one line, the buttons under them */
  .topbar .wordmark { font-size: 30px; }
  .topbar .status { flex: 1; font-size: 14px; }
  .topbar .grow, .topbar .uptime { display: none; }
  .topbar #themeBtn { order: 2; }
  .topbar::after { content: ""; order: 3; flex-basis: 100%; }
  .topbar .btn { order: 4; flex: 1 1 0; height: 40px; padding: 0 10px; font-size: 12px; }
  .host-main { padding: 12px; gap: 12px; }
  .now { padding: 16px; gap: 14px; }
  .now-title { font-size: 28px; }
  .controls .btn { flex: 1 1 auto; }
  /* The energy range gets a whole line, so it's easy to drag with a finger */
  .energy-row { flex-wrap: wrap; row-gap: 8px; }
  .energy-row output { order: -1; flex: 1 0 100%; text-align: left; }
}
@media (pointer: coarse) {
  .dual { height: 32px; }
  .dual::before, .dual-fill { top: 14px; }
  .dual input { height: 32px; }
  .dual input::-webkit-slider-thumb { width: 26px; height: 26px; }
  .dual input::-moz-range-thumb { width: 22px; height: 22px; }
}

/* ---------- Guest page ---------- */

.guest-main { max-width: 440px; margin: 0 auto; padding: 20px 18px 40px; display: flex; flex-direction: column; gap: 16px; }
.guest-head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; gap: 10px; }
.guest-head .wordmark { font-size: 30px; }
.head-group { display: flex; align-items: center; gap: 12px; flex: none; }
.head-group:last-child { flex: 1; min-width: 0; justify-content: flex-end; gap: 8px; }
.pill {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--edge);
  border-radius: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  max-width: 100%;
  min-width: 0;
}
.pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.join-form { display: flex; flex-direction: column; gap: 12px; padding: 22px 18px; }
.join-form h1 { margin: 0; font-size: 26px; line-height: 1.15; }

.now-mini { display: flex; align-items: center; gap: 14px; padding: 14px; }
.now-mini .tile { width: 64px; height: 64px; flex: none; }
.now-mini .tile img { width: 100%; height: 100%; object-fit: cover; }
.now-mini .text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.now-mini .title { font-size: 17px; line-height: 1.2; overflow-wrap: anywhere; }
.now-mini .progress .bar { height: 4px; }
.now-mini .progress { margin-top: 6px; }
.now-actions { display: flex; align-items: center; gap: 8px; padding: 0 14px 14px; flex-wrap: wrap; }
.now-actions .chip-cohost { margin-left: auto; }

.add { display: flex; flex-direction: column; gap: 10px; padding: 18px; border: 1px solid var(--pop-edge); }
.add h2 { margin: 0; font-size: 24px; line-height: 1.15; }
.add .hint { font-size: 14px; color: var(--on-solid-2); margin: 0; }
.add .field { background: var(--solid-field); color: var(--solid-field-ink); border-color: var(--solid-field-edge); }
.add .input { position: relative; }
.add .input svg { position: absolute; left: 14px; top: 15px; color: var(--solid-field-ink); pointer-events: none; }
.add .input .field { padding-left: 42px; }
.status { min-height: 1.4em; margin: 0; font-size: 14px; }
.dark .status { color: var(--on-solid-2); }
.dark .status.ok { color: var(--accent); }
.dark .status.error { color: #ff8a8a; }
.add .results .song { background: transparent; border-top-color: var(--solid-line); color: var(--on-solid); }
.add .results .meta { color: var(--on-solid-2); }
.upload-row { display: flex; align-items: center; gap: 10px; }
.upload-bar { flex: 1; height: 4px; background: var(--solid-line); }
.upload-bar > div { height: 100%; width: 0; background: var(--accent); }

.ticket { display: flex; align-items: center; gap: 16px; padding: 16px 18px; background: var(--red); color: var(--on-red); border: 1px solid var(--pop-edge); }
.ticket .big { font-family: var(--display); font-size: 40px; line-height: 1; white-space: nowrap; }
.ticket .text { display: flex; flex-direction: column; gap: 3px; }
.ticket .text strong { font-size: 15px; }
.ticket .text span { font-size: 13px; }

.guest-list .song { padding: 6px 10px; border-top: 0; border-bottom: 1px solid var(--line); background: transparent; }
.guest-list .song.mine { background: var(--panel); }
.guest-list .song .pos { width: 22px; }
.guest-list .you { font-weight: 700; color: var(--ink); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 2px 8px; }
.crew { padding: 16px 18px; }

/* ---------- Atmosphere ---------- */

.atmosphere-chip { gap: 8px; background: transparent; color: var(--ink); border-color: var(--edge); font-weight: 600; }
button.atmosphere-chip { appearance: none; border-radius: 0; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
button.atmosphere-chip:hover { background: var(--hover-2); }
.atmosphere-chip.off { border-style: dashed; color: var(--ink-2); }
.meter { display: inline-flex; align-items: flex-end; gap: 2px; }
.meter i { width: 3px; height: 10px; background: var(--line); }
.meter i.on { background: var(--accent); }
.with-atmosphere .song .chips { width: 280px; }
.now-meta .atmosphere-chip { height: 24px; }

.scene-now { margin: 4px 0 0; font-size: 14px; }
.scene-now strong { font-family: var(--display); font-weight: 400; text-transform: uppercase; }
.curve-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.curve-row > .mono { width: 16px; text-align: center; }
.curve-row.current > .mono { color: var(--accent); }
.curve-row select { width: 130px; flex: none; }
.curve-row .grow { flex: 1; }
.curve-actions { margin-top: 6px; }
.range-row { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.range-row input { flex: 1; accent-color: var(--accent); }
.range-row output { min-width: 64px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

.fix { width: min(440px, calc(100vw - 32px)); padding: 22px 24px; color: var(--ink); }
.fix::backdrop { background: rgba(0, 0, 0, 0.55); }
.fix form { display: flex; flex-direction: column; gap: 12px; }
.fix h2 { margin: 0; }
.fix-song { margin: 0; font-weight: 700; font-size: 17px; }
.fix p { margin: 0; }
.fix-actions { justify-content: flex-end; margin-top: 4px; }
.fix .num { width: 96px; }

.scene-line { margin: 0; font-size: 14px; color: var(--on-solid-2); }
.scene-line .scene-name { color: var(--on-solid); font-family: var(--display); font-weight: 400; text-transform: uppercase; }

.ask-card { padding: 16px 18px; border: 2px solid var(--accent); display: flex; flex-direction: column; gap: 18px; }
.ask { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.ask p { margin: 0; }
.ask-q { font-size: 16px; }
.ask .seg { align-self: stretch; }
.ask-actions { display: flex; align-items: center; gap: 16px; margin-top: 4px; }

/* ---------- Scenes, genres and moods ---------- */

.picks { display: flex; flex-wrap: wrap; gap: 6px; }
.pick { appearance: none; height: 30px; padding: 0 10px; border: 1px solid var(--edge); border-radius: 0; background: transparent; color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; }
.pick:hover { background: var(--hover); }
.pick[aria-pressed="true"] { background: var(--solid); color: var(--accent); border-color: var(--solid); }
.pick-sm { height: 26px; padding: 0 8px; font-size: 12px; font-weight: 500; }
.picks-note { align-self: center; margin-left: 4px; }
.scene-edit { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; padding: 12px; border: 1px solid var(--line); }
.scene-edit .label { margin-top: 6px; }
.scene-edit .link-btn { align-self: flex-start; margin-top: 4px; }
.label-note { text-transform: none; letter-spacing: 0; font-weight: 400; }
.sub-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sub-row > .small { width: 100%; margin-top: 4px; }
.energy-row { display: flex; align-items: center; gap: 10px; }
.energy-row output { min-width: 64px; text-align: right; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.dual { position: relative; flex: 1; height: 24px; }
.dual::before { content: ""; position: absolute; left: 0; right: 0; top: 10px; height: 4px; background: var(--line); }
.dual-fill { position: absolute; top: 10px; height: 4px; background: var(--accent); }
.dual input { position: absolute; inset: 0; width: 100%; height: 24px; margin: 0; -webkit-appearance: none; appearance: none; background: none; pointer-events: none; }
.dual input::-webkit-slider-runnable-track { background: none; }
.dual input::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; background: var(--solid); border: 2px solid var(--accent); border-radius: 0; pointer-events: auto; cursor: pointer; }
.dual input::-moz-range-thumb { width: 12px; height: 12px; background: var(--solid); border: 2px solid var(--accent); border-radius: 0; pointer-events: auto; cursor: pointer; }
.more-rules summary { cursor: pointer; padding: 14px 0; font-weight: 600; border-bottom: 1px solid var(--line); }
.more-rules[open] summary { border-bottom: 0; }
.fix select { width: 100%; }
.fix .fix-label { width: 52px; }

/* ---------- Seeking (host) ---------- */

.seek { -webkit-appearance: none; appearance: none; flex: 1; min-width: 0; height: 22px; margin: 0; background: transparent; cursor: pointer; --fill: 0%; }
.seek:disabled { cursor: default; }
.seek::-webkit-slider-runnable-track { height: 6px; background: linear-gradient(var(--meter), var(--meter)) 0 0 / var(--fill) 100% no-repeat, var(--line); }
.seek::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; margin-top: -4px; background: var(--solid); border: 2px solid var(--accent); border-radius: 0; }
.seek:hover::-webkit-slider-thumb, .seek:focus-visible::-webkit-slider-thumb { width: 16px; height: 16px; margin-top: -5px; }
.seek::-moz-range-track { height: 6px; background: var(--line); border: 0; }
.seek::-moz-range-progress { height: 6px; background: var(--meter); }
.seek::-moz-range-thumb { width: 12px; height: 12px; background: var(--solid); border: 2px solid var(--accent); border-radius: 0; }
.seek:focus-visible { outline: none; }
.seek:focus-visible::-webkit-slider-runnable-track { outline: 2px solid var(--ink); outline-offset: 4px; }
.progress .seek-time { min-width: 3.2em; }
.progress .seek-time.end { text-align: right; }

/* ---------- The big screen: theatre mode and the TV ---------- */

.stage {
  --stage-ink: #f4f4f0;
  --stage-ink-2: rgba(244, 244, 240, 0.7);
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 3vh;
  padding: 4.5vh 4.5vw;
  background: #08080a;
  color: var(--stage-ink);
  font-family: var(--font);
}
.stage .lights { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.stage[data-lights="off"] .lights { display: none; }
.lights-layer { position: absolute; inset: 0; transition: opacity 2.4s ease; }
.glow { position: absolute; left: 0; top: 0; width: 120vmax; height: 120vmax; margin: -60vmax 0 0 -60vmax; border-radius: 50%; will-change: transform, opacity; opacity: 0; }
.lights.aurora .glow { width: 175vmax; height: 46vmax; margin: -23vmax 0 0 -87.5vmax; }
.stage-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse 50% 60% at 72% 52%, rgba(8, 8, 10, 0.38), rgba(8, 8, 10, 0) 72%),
    linear-gradient(to top, rgba(8, 8, 10, 0.62), rgba(8, 8, 10, 0) 30%),
    rgba(8, 8, 10, 0.14);
}
.stage > :not(.lights):not(.stage-shade) { position: relative; z-index: 2; min-width: 0; }
.stage .label { color: var(--stage-ink-2); }

.stage-top { display: flex; align-items: center; justify-content: space-between; gap: 2vw; }
.stage-top .wordmark { font-size: clamp(22px, 2.4vw, 52px); color: var(--accent); }
.stage .uptime { color: var(--stage-ink-2); font-size: clamp(13px, 1.1vw, 22px); }
.stage .uptime svg { width: 1em; height: 1em; }

.stage-main { display: flex; align-items: center; gap: 4.5vw; min-height: 0; }
.stage-art { --art-w: min(34vw, 52vh); position: relative; flex: none; width: var(--art-w); aspect-ratio: 1; }
.stage[data-shape="wide"] .stage-art { width: min(46vw, 52vh * 16 / 9); aspect-ratio: 16 / 9; }
.stage-sleeve { position: absolute; inset: 0; z-index: 1; overflow: hidden; background: #101114; }
.stage-pic, .stage-art .art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Slow zoom: the cover drifts in and out over half a minute (the lights become an aurora) */
@keyframes cover-drift {
  from { transform: scale(1.02) translate(1.5%, -1.5%); }
  to { transform: scale(1.16) translate(-4%, 3%); }
}
.stage[data-cover="zoom"] .stage-pic { animation: cover-drift 26s ease-in-out infinite alternate paused; will-change: transform; }
.stage[data-cover="zoom"][data-state="playing"] .stage-pic { animation-play-state: running; }

/* Record: the song's record, its label the cover, spins at 33⅓ turns a minute half out of its
   sleeve, and slides out when a new song starts */
.stage-record { display: none; position: absolute; z-index: 0; top: 5%; left: 5%; width: 90%; height: 90%; border-radius: 50%; box-shadow: 0 2vh 6vh rgba(0, 0, 0, 0.6); }
.stage[data-cover="record"] .stage-art { --art-w: min(28vw, 44vh); margin-right: calc(var(--art-w) * 0.56); }
.stage[data-cover="record"] .stage-record { display: block; transform: translateX(66%); }
.stage[data-cover="record"] .stage-record.out { animation: record-out 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.stage[data-cover="record"] .stage-sleeve { box-shadow: 1vw 0 3vw rgba(0, 0, 0, 0.45); }
@keyframes record-out { from { transform: translateX(6%); } to { transform: translateX(66%); } }
@keyframes spin { to { transform: rotate(360deg); } }
.stage-disc {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(0, 0, 0, 0) 0 30%, #0b0b0e 30.5% 33%, rgba(0, 0, 0, 0) 33.5%),
    repeating-radial-gradient(circle, #121215 0 2px, #1c1c21 2px 4px);
  animation: spin 1.8s linear infinite paused;
  will-change: transform; /* its own layer, so the turning never waits for the rest of the page */
}
.stage[data-state="playing"] .stage-disc { animation-play-state: running; }
.stage-disc-label { position: absolute; left: 32%; top: 32%; width: 36%; height: 36%; border-radius: 50%; background: var(--accent) center / cover no-repeat; }
.stage-disc-label::after { content: ""; position: absolute; left: 46%; top: 46%; width: 8%; height: 8%; border-radius: 50%; background: #08080a; }
/* a still shine on the spinning record, so the turning shows from across the room */
.stage-record::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 210deg, rgba(255, 255, 255, 0) 0deg, rgba(255, 255, 255, 0.1) 25deg, rgba(255, 255, 255, 0) 55deg, rgba(255, 255, 255, 0) 180deg, rgba(255, 255, 255, 0.07) 205deg, rgba(255, 255, 255, 0) 235deg);
}
@media (prefers-reduced-motion: reduce) {
  .stage-pic, .stage-disc, .stage-record { animation: none !important; }
}
.stage-art .art { padding: 18%; background: #101114; --art-bar: var(--accent); }
/* A soft glow of the song's main colour behind the picture (a gradient, not a blurred copy of the
   picture: that showed hard edges in Safari and turned light covers into a bright slab) */
.stage-halo { position: absolute; inset: -24%; z-index: -1; pointer-events: none; opacity: 0.55; will-change: opacity; }
.stage[data-state="idle"] .stage-halo, .stage[data-lights="off"] .stage-halo { opacity: 0.35 !important; }

.stage-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1.4vh; text-shadow: 0 2px 28px rgba(0, 0, 0, 0.45); }
.stage-label { font-size: clamp(11px, 0.95vw, 20px); }
.stage-title {
  margin: 0;
  font-size: clamp(30px, 5vw, 112px);
  line-height: 1.04;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.stage-title.mid { font-size: clamp(26px, 3.8vw, 84px); }
.stage-title.long { font-size: clamp(22px, 2.9vw, 64px); }
.stage-artist { font-size: clamp(18px, 2vw, 44px); font-weight: 500; line-height: 1.2; }
.stage-meta { font-size: clamp(13px, 1.1vw, 24px); color: var(--stage-ink-2); }
.stage-meta strong { color: var(--stage-ink); }
.stage-progress { display: flex; align-items: center; gap: 1vw; max-width: 36vw; margin-top: 1vh; font-size: clamp(12px, 0.95vw, 20px); color: var(--stage-ink-2); }
.stage-progress .bar { flex: 1; height: 4px; background: rgba(244, 244, 240, 0.22); overflow: hidden; }
.stage-progress .bar > div { height: 100%; background: var(--stage-ink); transform-origin: left; transform: scaleX(0); }
/* Where theatre mode keeps a YouTube video playing when the song shows its cover. YouTube asks for
   a player of at least 200 by 200 pixels while it plays. */
.stage-pip { width: 356px; height: 200px; margin-top: 2vh; flex: none; background: #101114; }

.stage-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 4vw; }
.stage-next { min-width: 0; }
.stage-next ol { list-style: none; margin: 1.2vh 0 0; padding: 0; display: flex; gap: 2.6vw; }
.stage-next li { display: flex; flex-direction: column; gap: 2px; min-width: 0; max-width: 17vw; }
.stage-next-title { font-weight: 700; font-size: clamp(13px, 1.15vw, 24px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-next-meta { font-size: clamp(11px, 0.95vw, 20px); color: var(--stage-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-join { display: flex; align-items: center; gap: 1.2vw; flex: none; margin-left: auto; }
.stage-join .qr { width: clamp(92px, 15vh, 200px); height: clamp(92px, 15vh, 200px); padding: clamp(6px, 0.9vh, 12px); background: #f4f4f4; }
.stage-join .qr img, .stage-join .qr canvas { width: 100% !important; height: 100% !important; image-rendering: pixelated; }
.stage-join-text { display: flex; flex-direction: column; gap: 0.6vh; }
.stage-join-text .display { font-size: clamp(14px, 1.3vw, 28px); line-height: 1.1; max-width: 9em; }
.stage-url { font-size: clamp(12px, 1vw, 22px); color: var(--stage-ink-2); }

/* Tall or narrow windows: the picture above the words */
@media (max-aspect-ratio: 5 / 4) {
  .stage-main { flex-direction: column; align-items: flex-start; justify-content: center; gap: 3vh; }
  .stage-art, .stage[data-shape="wide"] .stage-art { --art-w: min(80vw, 40vh); width: var(--art-w); }
  .stage[data-cover="record"] .stage-art { --art-w: min(52vw, 40vh); }
  .stage[data-shape="wide"] .stage-art { width: min(88vw, 40vh * 16 / 9); }
  .stage-title { font-size: clamp(26px, 7vw, 80px); }
  .stage-progress { max-width: none; align-self: stretch; }
  .stage-next { display: none; }
  .stage-foot { justify-content: flex-end; }
}

/* ---------- Theatre mode (host) ---------- */

body.theatre { overflow: hidden; }
body.theatre .media { position: fixed; z-index: 31; left: var(--slot-x); top: var(--slot-y); width: var(--slot-w); height: var(--slot-h); align-self: auto; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06); }
body.theatre:not(.theatre-video) .media { visibility: hidden; }
body.theatre:not(.theatre-video) .media > * { visibility: hidden !important; }
.theatre-bar {
  position: fixed;
  z-index: 32;
  left: 50%;
  bottom: 3vh;
  transform: translateX(-50%);
  width: min(920px, calc(100vw - 32px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(16, 17, 20, 0.92);
  border: 1px solid #34363c;
  color: #efefeb;
  transition: opacity 0.3s ease;
}
.theatre-bar.away { opacity: 0; pointer-events: none; }
.stage.away { cursor: none; }
.theatre-bar .square { width: 44px; height: 44px; background: #25262b; }
.theatre-bar .icon-btn { color: #b1b3ba; }
.theatre-bar .icon-btn:hover { background: rgba(244, 244, 240, 0.08); color: #efefeb; }
.theatre-bar .mono { font-size: 13px; color: #b1b3ba; min-width: 3.2em; }
.theatre-bar .mono.end { text-align: right; }
.theatre-bar .seek { --meter: var(--accent); --line: #45474e; --solid: #101114; }

/* ---------- Big screen dialog (host) ---------- */

.screen-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 22px 24px; color: var(--ink); overflow: auto; }
.screen-dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
.screen-dialog form { display: flex; flex-direction: column; gap: 14px; }
.screen-dialog p { margin: 0; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; }
.screen-option { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.screen-option strong { display: block; }
.screen-ways { margin: 0; padding-left: 20px; font-size: 14px; }
.screen-ways li { margin: 6px 0; }
.screen-dialog .code { font-size: 14px; }
.timing { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.timing output { min-width: 7.5em; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- TV screen ---------- */

body.tv { background: #08080a; }
/* Many TVs cut off the edges of the picture ("overscan"), so the TV screen keeps clear of them */
body.tv .stage { padding: 6vh 6.5vw; }
.tv-hint {
  position: fixed;
  z-index: 40;
  left: 50%;
  top: 4.5vh;
  transform: translateX(-50%);
  padding: 10px 16px;
  background: rgba(16, 17, 20, 0.9);
  border: 1px solid #34363c;
  color: #efefeb;
  font-size: clamp(13px, 1vw, 20px);
  transition: opacity 0.6s ease;
  white-space: nowrap;
}
.tv-hint.gone { opacity: 0; pointer-events: none; }
