:root {
  --bg: #080b12;
  --panel: #111726aa;
  --line: #ffffff1a;
  --text: #eef2ff;
  --muted: #93a0bd;
  --accent: #3ddad0;      /* teal - deliberately not the orange the category defaults to */
  --accent2: #6d5cff;
  --ok: #4ade80;
  --radius: 14px;
  color-scheme: dark;
}
/*
 * Themes a listener picks for themselves, in their profile.
 *
 * Only the four colours the whole app is built from change, so a theme cannot
 * make anything unreadable. These are scoped to this stylesheet, which is why
 * the venue screens never inherit one — display.css has its own palette, set
 * by the bar rather than by whoever last stood in the room.
 */
[data-theme="ember"] {
  --accent: #ffb03a;
  --accent2: #ff5b2e;
  --bg: #0d0906;
  --muted: #b39a82;
}
[data-theme="neon"] {
  --accent: #2ff3ff;
  --accent2: #ff3ea5;
  --bg: #07060f;
  --muted: #9a93c4;
}
[data-theme="forest"] {
  --accent: #6ee7a5;
  --accent2: #3f9d7a;
  --bg: #06110d;
  --muted: #8aa79b;
}
[data-theme="mono"] {
  --accent: #e6ebf5;
  --accent2: #8b93a7;
  --bg: #0a0c10;
  --muted: #8d95a6;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(1000px 600px at 12% -10%,
      color-mix(in srgb, var(--accent2) 22%, transparent), transparent 60%),
    radial-gradient(760px 520px at 92% 4%,
      color-mix(in srgb, var(--accent) 16%, transparent), transparent 55%),
    var(--bg);
  color: var(--text);
  font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 900px; margin: 0 auto; padding: 24px 18px 80px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; font-size: 20px; text-decoration: none; }
/*
 * The wordmark ships light, because every surface it sits on is dark. Width is
 * left to the aspect ratio so it never distorts, and the intrinsic size is on
 * the tag so the header does not jump while it loads.
 */
.brand-logo { height: 30px; width: auto; display: block; }
@media (max-width: 420px) { .brand-logo { height: 26px; } }
.brand span { background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand small { color: var(--muted); font-weight: 500; font-size: 12px; letter-spacing: .1em; }
h1 { font-size: clamp(28px, 6vw, 46px); line-height: 1.08; letter-spacing: -.03em; margin: 28px 0 10px; }
h2 { font-size: 18px; letter-spacing: -.01em; margin: 28px 0 12px; }
p.lede { color: var(--muted); font-size: 18px; max-width: 46ch; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
button, .btn {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 650;
  padding: 12px 18px; border-radius: 999px; color: #05131a;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #fff));
  text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
}
button.ghost, .btn.ghost { background: #ffffff12; color: var(--text); border: 1px solid var(--line); }
button:disabled { opacity: .45; cursor: not-allowed; }
input {
  font: inherit; color: var(--text); background: #ffffff0f;
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; width: 100%;
}
input:focus { outline: 2px solid var(--accent2); outline-offset: 1px; }
.track { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; }
.track + .track { border-top: 1px solid var(--line); }
/* .track sets display:flex, so [hidden] alone would not hide one. */
.track[hidden] { display: none; }
.track img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: #ffffff12; flex: none; }
.track .meta { min-width: 0; flex: 1; }
.track .name { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track .artist { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.votebtn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 14px; border-radius: 12px; background: #ffffff12; color: var(--text); border: 1px solid var(--line); }
.votebtn.on { background: linear-gradient(180deg, var(--accent2), color-mix(in srgb, var(--accent2) 70%, #000)); border-color: transparent; }
.votebtn b { font-size: 16px; line-height: 1; }
.votebtn small { font-size: 10px; color: var(--muted); letter-spacing: .08em; }
.votebtn.on small { color: #ffffffcc; }
.pill { font-size: 13px; color: var(--muted); background: #ffffff0f; border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; }
.code { font-family: ui-monospace, monospace; font-size: 30px; letter-spacing: .22em; font-weight: 700; }
.now { display: flex; gap: 14px; align-items: center; }
.now img { width: 76px; height: 76px; border-radius: 10px; }
.muted { color: var(--muted); }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.stack > * + * { margin-top: 10px; }
.warn { border-left: 3px solid var(--accent); background: #3ddad014; padding: 12px 14px; border-radius: 8px; font-size: 14px; }
.art-ph {
  width: 48px; height: 48px; border-radius: 8px; flex: none;
  background: linear-gradient(135deg, #ffffff1a, #ffffff08);
  display: grid; place-items: center; color: var(--muted); font-size: 20px;
}
.art-ph.big { width: 76px; height: 76px; border-radius: 10px; font-size: 30px; }

/* nearby list */
.venue { display: flex; align-items: center; gap: 12px; padding: 12px 10px; text-decoration: none; color: inherit; border-radius: 12px; }
.venue + .venue { border-top: 1px solid var(--line); }
.venue:hover { background: #ffffff0a; }
.venue .badge { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  font-size: 21px; background: #ffffff12; flex: none; }
.venue .meta { flex: 1; min-width: 0; }
.venue .meta b { display: block; font-weight: 650; }
.venue .meta span { color: var(--muted); font-size: 13px; }
.dist { font-size: 13px; color: var(--muted); background: #ffffff0f; border: 1px solid var(--line);
  padding: 5px 11px; border-radius: 999px; white-space: nowrap; }
.lock { font-size: 12px; color: var(--muted); }

/* settings */
.set { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; }
.set + .set { border-top: 1px solid var(--line); }
.set label { font-weight: 600; }
.set .hint { color: var(--muted); font-size: 13px; font-weight: 400; margin-top: 2px; max-width: 42ch; }
.set input[type=text], .set input[type=number] { width: 190px; }
.set select { font: inherit; color: var(--text); background: #ffffff0f; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; }
.switch { width: 50px; height: 30px; border-radius: 999px; background: #ffffff1f; border: 1px solid var(--line);
  position: relative; cursor: pointer; flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; transition: transform .15s; }
.switch[aria-checked=true] { background: var(--ok); border-color: transparent; }
.switch[aria-checked=true]::after { transform: translateX(20px); }

/* now-playing progress */
.bar { height: 4px; border-radius: 999px; background: #ffffff1c; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.times { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; }

dialog { border: 1px solid var(--line); background: #10141f; color: var(--text); border-radius: 16px;
  padding: 22px; max-width: 380px; width: calc(100% - 40px); }
dialog::backdrop { background: #000000b0; backdrop-filter: blur(3px); }
button.ghost.on, .btn.ghost.on {
  background: linear-gradient(180deg, var(--accent2), color-mix(in srgb, var(--accent2) 70%, #000));
  border-color: transparent; color: #fff;
}
.votegroup { display: flex; align-items: center; gap: 6px; flex: none; }
.minus {
  width: 34px; height: 34px; padding: 0; border-radius: 50%;
  background: #ffffff12; color: var(--text); border: 1px solid var(--line);
  font-size: 18px; line-height: 1; display: grid; place-items: center;
}
.venue .meta .playing {
  display: block; font-size: 13px; color: var(--accent);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.venue .meta .playing.idle { color: var(--muted); opacity: .7; }
/* A long list stays inside its card instead of pushing the page down. */
/* clamp, not bare vh: on a short viewport 42vh collapses to nothing. */
.scroller { max-height: clamp(260px, 42vh, 520px); overflow-y: auto; overscroll-behavior: contain; }
.scroller::-webkit-scrollbar { width: 10px; }
.scroller::-webkit-scrollbar-thumb { background: #ffffff24; border-radius: 999px; }
.scroller::-webkit-scrollbar-track { background: transparent; }
.scroller { scrollbar-width: thin; scrollbar-color: #ffffff24 transparent; }
/* track progress line, shared by every surface */
.tl { margin-top: 8px; }
.tl .tl-bar { height: 4px; border-radius: 999px; background: #ffffff1c; overflow: hidden; }
.tl .tl-bar i { display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .5s linear; }
.tl .tl-times { display: flex; justify-content: space-between; font-size: 12px;
  color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.tl.idle .tl-bar i { width: 0; }
.tl.paused .tl-bar i { background: #ffffff44; }
.tl.compact { margin-top: 6px; }
.tl.compact .tl-bar { height: 3px; }
.tl.compact .tl-times { display: none; }
textarea {
  font: inherit; color: var(--text); background: #ffffff0f; border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px; width: 100%; resize: vertical;
  font-family: ui-monospace, monospace; font-size: 13px; line-height: 1.5;
}
textarea:focus { outline: 2px solid var(--accent2); outline-offset: 1px; }

/* ---- now playing, given the space it deserves ---- */
.np-card { text-align: center; }
.np-label {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 12px; letter-spacing: .14em; color: var(--accent); font-weight: 700;
}
.np-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  animation: np-pulse 2s ease-in-out infinite;
}
@keyframes np-pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .3; transform: scale(.72); } }
/* Beats the generic .art-ph sizing, which otherwise leaves the placeholder
   at thumbnail size and hard against the left edge. */
.np-card .np-art {
  width: min(62%, 260px);
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 14px;
  margin: 14px auto 16px;
  display: block;
}
.np-card .np-art.art-ph {
  display: grid; place-items: center; font-size: 40px;
}
.np-title { font-size: 21px; font-weight: 800; line-height: 1.2; }
.np-artist { color: var(--muted); font-size: 15px; margin-top: 2px; }
.np-picked {
  display: inline-block; margin-top: 10px; padding: 6px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent2) 26%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent2) 45%, transparent);
  font-size: 13px; font-weight: 600;
}
.np-card .tl { margin-top: 14px; }

/* ---- voted songs burn ---- */
.track { position: relative; isolation: isolate; border-radius: 12px; }
.ember-layer {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: -1; opacity: 0;
  transition: opacity .5s ease;
}
/* A song with any votes is lit; the front-runner is lit gold. */
.track.voted {
  background: linear-gradient(90deg, color-mix(in srgb, #8b7bff 16%, transparent), transparent 70%);
  box-shadow: inset 2px 0 0 #8b7bff;
}
.track.leading {
  background: linear-gradient(90deg, color-mix(in srgb, #ffc93d 20%, transparent), transparent 72%);
  box-shadow: inset 2px 0 0 #ffc93d;
}
.track.leading .votebtn.on { background: linear-gradient(180deg, #ffc93d, #e0a119); color: #241a00; }
.track.leading .votebtn.on small { color: #241a00cc; }

@media (prefers-reduced-motion: reduce) {
  .ember-layer { display: none; }
  .np-dot { animation: none; }
}

/* who you are in the room, for the winner credit */
.whoami {
  display: inline-flex; align-items: center; gap: 6px;
  background: #ffffff0f; border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px; font-size: 13px; color: var(--muted);
  cursor: pointer;
}
.whoami b { color: var(--text); font-weight: 600; }
.whoami-face { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }

/* ---- profile picture ---- */
.avatar-edit { display: flex; align-items: center; gap: 14px; }
.avatar-edit .face {
  width: 72px; height: 72px; border-radius: 50%; flex: none; overflow: hidden;
  display: grid; place-items: center; font-size: 26px;
  background: #ffffff0f; border: 1px solid var(--line);
}
.avatar-edit .face img { width: 100%; height: 100%; object-fit: cover; }

.queue-more {
  width: 100%; justify-content: center; margin-top: 10px;
  font-size: 14px; padding: 12px;
}

.np-save {
  margin-top: 12px; padding: 9px 16px; font-size: 14px;
  background: #ffffff12; color: var(--text); border: 1px solid var(--line);
}
.np-save.on {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--accent);
}

/* ---- the room's two header rows ---- */
/*
 * The chips naming you, the room and the headcount sit a line under the
 * account buttons and were visibly smaller than them. They take the same
 * metrics, so the two rows read as one block rather than two sizes.
 */
.whoami, #here, #roomname {
  /* Matches the account buttons' height without the 16px text, which pushed
     the three of them onto two lines on a phone. */
  padding: 9px 14px;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.25;
}
.whoami { color: var(--text); }
#here b { font-weight: 800; }

/*
 * The votes-and-countdown pill and the tabs are one control in two halves, so
 * they share a height. Stretching the pill to match only worked while the two
 * sat on one line, and on a phone they wrap.
 */
.tabs, #votePill { min-height: 46px; }
.tabs { align-items: center; }
#votePill {
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  font-size: 14px;
}

.badge img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.avatar-edit .face img { border-radius: inherit; }

/* ---- venue screen palette ---- */
.swatch { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; }
.swatch input[type="color"] {
  width: 46px; height: 34px; padding: 3px; cursor: pointer;
}
.swatch span { font-size: 11px; color: var(--muted); }

/* ---- theme picker ---- */
.themes { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-chip {
  padding: 8px 14px; font-size: 14px; gap: 8px;
}
.theme-swatch {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 1px solid #ffffff2e;
}

/* ---- a listener's own tally ---- */
.statline { display: flex; gap: 10px; flex-wrap: wrap; }
.stat {
  flex: 1; min-width: 92px; text-align: center;
  background: #ffffff08; border: 1px solid var(--line); border-radius: 14px; padding: 14px 10px;
}
.stat b { display: block; font-size: 28px; font-weight: 800; line-height: 1.1; }
.stat span { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }

/* ---- installed to a home screen ---- */
/*
 * Standalone has no browser chrome, so the page owns the whole screen: it has
 * to keep itself clear of the notch, and a pull-down must not bounce the way a
 * web page does when the thing it is sat in looks like an app.
 */
body {
  overscroll-behavior-y: contain;
  -webkit-tap-highlight-color: transparent;
}
@media (display-mode: standalone) {
  body { padding-top: env(safe-area-inset-top); }
  /* Nothing to select on a tap-only surface; long-press should not offer to. */
  .tab, .pill, .person, .react, .whoami { -webkit-user-select: none; user-select: none; }
}

/* ---- floating add button ---- */
.fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: 14px 20px;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 8px 26px -8px rgba(0,0,0,.7), 0 2px 6px rgba(0,0,0,.4);
}
.fab span { font-size: 20px; line-height: 1; margin-top: -2px; }
@media (max-width: 420px) { .fab b { display: none; } .fab { padding: 16px 18px; } }

/* ---- activity feed ---- */
.feed-item { display: flex; gap: 8px; padding: 6px 2px; align-items: flex-start; }
.feed-item + .feed-item { border-top: 1px solid var(--line); }
.feed-dot {
  width: 24px; height: 24px; border-radius: 50%; flex: none; overflow: hidden;
  display: grid; place-items: center; font-size: 12px;
  background: #ffffff10; border: 1px solid var(--line);
}
.feed-dot img { width: 100%; height: 100%; object-fit: cover; }
.feed-body { flex: 1; min-width: 0; }
.feed-line { font-size: 14px; line-height: 1.35; }
.feed-line b { font-weight: 700; }
.feed-line .track { color: var(--muted); }
.feed-when { font-size: 11px; color: var(--muted); white-space: nowrap; }
.feed-reacts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.react {
  border: 1px solid var(--line); background: #ffffff0d; color: var(--text);
  border-radius: 999px; padding: 2px 8px; font-size: 12px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px; line-height: 1.4;
}
.react.mine { background: color-mix(in srgb, var(--accent2) 30%, transparent);
  border-color: color-mix(in srgb, var(--accent2) 55%, transparent); }
.react-add { opacity: .55; }
.react-add:hover, .react:hover { opacity: 1; }

/* ---- tabs ---- */
.tabs { display: inline-flex; gap: 4px; background: #ffffff0d; border: 1px solid var(--line);
  border-radius: 999px; padding: 4px; }
.tab {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-size: 14px; font-weight: 600;
  padding: 8px 15px; border-radius: 999px; background: transparent; color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px;
}
.tab.on { background: linear-gradient(180deg, var(--accent2), color-mix(in srgb, var(--accent2) 70%, #000)); color: #fff; }
.tab-count {
  font-size: 11px; font-weight: 700; background: #ffffff2e; color: inherit;
  border-radius: 999px; padding: 1px 6px; min-width: 18px; text-align: center;
}
.tab-count:empty { display: none; }

/* ---- who's in the room ---- */
.people-head {
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin-bottom: 10px;
}
.people-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.person {
  display: inline-flex; align-items: center; gap: 7px;
  background: #ffffff0f; border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px 5px 5px; font-size: 14px;
}
.person i {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(180deg, var(--accent2), color-mix(in srgb, var(--accent2) 70%, #000));
  color: #fff; font-style: normal; font-size: 11px; font-weight: 700;
}
.person.me { border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 14%, transparent); }
.person.me i { background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #000)); color: #04121a; }
.person img {
  width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex: none;
}
.person.quiet { color: var(--muted); }
.person.quiet i { background: #ffffff1f; color: var(--muted); }
