/* SPOTLIGHT — one mic, one pool of light, one number that matters.
   Every accent-coloured surface reads from the --a1-* / --a2-* custom properties that
   applyPalette() in app.js derives from the DJ's two hex values. Nothing in this file
   hardcodes an accent, which is what stopped the old page from ever restyling. */

:root {
  --bg: #0a0810;
  --bg-2: #130d1c;
  --card: rgba(255, 255, 255, 0.055);
  --card-hi: rgba(255, 255, 255, 0.1);
  --line: rgba(255, 255, 255, 0.1);
  --text: #f4f0f8;
  --muted: #a297b0;

  /* Download state never derives from the accents: a DJ who picks red must not make
     "ready to sing" look like a failure. */
  --ok: #35d67d;
  --warn: #ffb020;
  --bad: #ff5c5c;

  --radius: 16px;
  --on-ink: #0b0712; /* text on any -ink surface; -ink is always L >= 62% */

  /* Overwritten by applyPalette(); these mirror event.js DEFAULTS so the first paint
     is never uncoloured. */
  --a1: #ff2d95;
  --a1-ink: #ff74b8;
  --a1-on: #ffffff;
  --a1-dim: rgba(255, 45, 149, 0.14);
  --a1-soft: rgba(255, 45, 149, 0.3);
  --a2: #8b5cff;
  --a2-ink: #b39bff;
  --a2-on: #ffffff;
  --a2-dim: rgba(139, 92, 255, 0.14);
  --a2-soft: rgba(139, 92, 255, 0.3);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* Several elements are shown and hidden from JS via `.hidden`. Any rule here that sets
   `display` outranks the UA's `[hidden] { display: none }` — which is how a guest with no
   saved name ended up with an empty pill in the header corner. Settle it once. */
[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-2), var(--bg) 42%);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  overflow-x: clip;
}

main {
  position: relative;
  z-index: 2;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px calc(48px + env(safe-area-inset-bottom));
}

/* ---------------------------------------------------------------- artwork */

/* The hero song's sleeve, blurred past recognition. Sits under .ambient so the DJ's
   accent orbs still tint it — the record must not out-shout the venue's branding. */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.backdrop .sheet {
  position: absolute;
  inset: -12%; /* the blur would otherwise show soft edges at the viewport border */
  background-position: center;
  background-size: cover;
  /* 64px source: blur hides that it is tiny, and it costs ~1 KB on venue cellular. */
  filter: blur(64px) saturate(1.35);
  opacity: 0;
  transition: opacity 0.6s ease;
}

.backdrop .sheet.on {
  opacity: 0.34;
}

/* ---------------------------------------------------------------- lighting */

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Accent 2 lives here and nowhere near accent 1 — the two only meet across ~200px of
   blur, which is what lets any hex pair read as stage lighting rather than a clash. */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  will-change: transform;
}

.orb-a {
  width: 72vw;
  height: 72vw;
  left: -24vw;
  bottom: -12vh;
  background: var(--a2-soft);
  animation: drift-a 30s ease-in-out infinite alternate;
}

.orb-b {
  width: 58vw;
  height: 58vw;
  right: -20vw;
  top: 42vh;
  background: var(--a2-dim);
  animation: drift-b 38s ease-in-out infinite alternate;
}

@keyframes drift-a {
  to {
    transform: translate3d(4%, -3%, 0) scale(1.08);
  }
}

@keyframes drift-b {
  to {
    transform: translate3d(-5%, 4%, 0) scale(0.94);
  }
}

/* Film grain — stops the big soft gradients banding on 8-bit panels. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 120px 120px;
}

/* ---------------------------------------------------------------- hero */

/* Venue branding as a page header: logo in the corner, event name and tagline beside it.
   Everything below starts right under it, rather than floating in a centred hero. */
/* Logo and name chip are pulled out of flow into the corners so the event name and
   tagline centre against the full width — symmetric gutters keep that centring honest
   however wide the corners get. */
.topbar {
  position: relative;
  z-index: 3;
  max-width: 640px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 12px) 94px 10px;
  min-height: calc(env(safe-area-inset-top) + 62px);
  text-align: center;
}

#logo {
  position: absolute;
  left: 16px;
  top: calc(env(safe-area-inset-top) + 10px);
  height: clamp(36px, 10vw, 48px);
  max-width: 60px;
  width: auto;
  object-fit: contain;
  border-radius: 8px;
  filter: drop-shadow(0 4px 14px var(--a1-dim));
}

.brand-text {
  min-width: 0;
}

.singer-chip {
  position: absolute;
  right: 12px;
  top: calc(env(safe-area-inset-top) + 14px);
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 86px;
  padding: 5px 10px;
  border-radius: 99px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--muted);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}

.singer-chip:active {
  border-color: var(--a1-ink);
  color: var(--a1-ink);
}

#singer-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  unicode-bidi: plaintext;
}

h1 {
  margin: 0;
  font-size: clamp(17px, 4.8vw, 23px);
  font-weight: 700;
  letter-spacing: -0.01em;
  /* Flat, not a gradient: gradient-on-text is exactly what made an arbitrary pair of
     hexes look accidental on the old page. */
  color: var(--a1-ink);
  unicode-bidi: plaintext;
  line-height: 1.2;
  /* Wraps rather than ellipsises: centred text that has been cut short looks like a bug,
     and the corner gutters leave a long event name too little room for one line. */
  text-wrap: balance;
}

#event-subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
  unicode-bidi: plaintext;
  text-wrap: balance;
}

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.8vh, 16px);
  padding: 6px 0 18px;
  text-align: center;
  /* The light pool deliberately bleeds past the hero, but a pool wider than the phone
     would widen the document and let the page slide sideways. `clip` (not `hidden`)
     leaves the vertical bleed intact and creates no scroll box. */
  overflow-x: clip;
}

/* ---------------------------------------------------------------- the disc */

.stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  padding: 6px 0;
}

/* The pool: one light source, visible falloff edge — not an all-over glow. */
.stage::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  /* Sized to the content box rather than the viewport: a pool wider than the screen
     gets sliced by the hero's overflow clip and the falloff reads as a hard rectangle. */
  width: min(100%, 640px);
  height: min(96vw, 460px);
  transform: translate(-50%, -50%);
  background: radial-gradient(
    ellipse at center,
    var(--a1-soft) 0%,
    var(--a1-dim) 42%,
    transparent 68%
  );
  filter: blur(12px);
  pointer-events: none;
}

.disc {
  position: relative;
  /* Height-capped as well as width-capped, so a short viewport (landscape, or a small
     phone with the URL bar out) still leaves room for the number and the search box. */
  width: min(54vw, 260px, 30vh);
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: inherit;
  font: inherit;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 255, 255, 0.09), transparent 58%),
    radial-gradient(circle at 50% 50%, #17111f, #0a0710 76%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.09),
    0 26px 60px rgba(0, 0, 0, 0.55),
    0 0 54px var(--a1-dim);
}

/* Concentric hairlines — the top of an SM58, not a progress donut. */
.grille {
  position: absolute;
  inset: 9%;
  border-radius: 50%;
  pointer-events: none;
  background: repeating-radial-gradient(
    circle at 50% 50%,
    rgba(255, 255, 255, 0.055) 0 1px,
    transparent 1px 9px
  );
  -webkit-mask: radial-gradient(circle closest-side, #000 99%, transparent 100%);
  mask: radial-gradient(circle closest-side, #000 99%, transparent 100%);
}

/* No rim once there is a sleeve — the disc already has its own dark edge, and an accent
   ring around it just read as a second outline. Only the empty state needs a boundary. */
.ring {
  position: absolute;
  inset: -11px;
  border-radius: 50%;
  pointer-events: none;
}

/* The sleeve fills the disc. With the number moved out from on top of it, the artwork no
   longer has to be dimmed into unreadability — it can just be the record. */
.face {
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  pointer-events: none;
  background-position: center;
  background-size: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.face.has-art {
  opacity: 0.92;
}

/* Edge vignette only, so the sleeve sits in the disc instead of being pasted onto it. */
.disc::after {
  content: '';
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, transparent 0 52%, rgba(0, 0, 0, 0.55) 100%);
}

.idle {
  position: relative;
  z-index: 2;
  font-size: clamp(40px, 15vw, 74px);
  opacity: 0.3;
  filter: grayscale(1);
}

.disc:not(.empty) .idle {
  display: none;
}

.shock {
  position: absolute;
  inset: -11px;
  border-radius: 50%;
  border: 2px solid var(--a1-ink);
  opacity: 0;
  pointer-events: none;
}

/* Sits under the disc now rather than on top of the sleeve — big enough to read across a
   bar, small enough that it is not the only thing on screen. */
.num {
  margin: 0;
  /* SF Pro Rounded on iPhone — the one real typographic differentiator available
     without shipping a webfont over venue cellular. */
  font-family: ui-rounded, -apple-system, 'Segoe UI Rounded', system-ui, sans-serif;
  font-size: clamp(46px, 15vw, 76px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--a1-ink);
  text-shadow: 0 0 28px var(--a1-dim);
}

.disc.empty {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    0 20px 46px rgba(0, 0, 0, 0.45);
}

.disc.empty .ring {
  border: 2px dashed rgba(255, 255, 255, 0.16);
}

/* The hourglass is an emoji, not a digit — it does not need the display size. */
.num.hold {
  font-size: clamp(34px, 10vw, 52px);
  text-shadow: none;
}

/* ---------------------------------------------------------------- hero meta */

.hero-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
}

/* A caption for the number below it, not a badge in its own right. */
.chip {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.chip.hold {
  color: var(--warn);
}

.hero-song {
  margin: 4px 0 0;
  font-size: 17px;
  font-weight: 600;
  unicode-bidi: plaintext;
  max-width: 32ch;
}

.hero-state {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  min-height: 1.2em;
}

/* Extra songs this phone holds. Tap one to promote it into the big disc. */
.satellites {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0 16px;
}

.satellites:empty {
  display: none;
}

.sat {
  position: relative;
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 50%;
  border: 1.5px solid var(--a1-ink);
  background: radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.08), transparent 60%), #14101c;
  color: var(--a1-ink);
  font: inherit;
  font-weight: 700;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.sat:active {
  transform: scale(0.94);
}

.sat.hold {
  border-style: dashed;
  border-color: var(--warn);
  color: var(--warn);
  font-size: 17px;
}

.lyrics-btn {
  margin-top: 8px;
  padding: 7px 16px;
  border-radius: 99px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.14s, color 0.14s;
}

.lyrics-btn:active {
  border-color: var(--a1-ink);
  color: var(--a1-ink);
}

.hero-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

.hero-actions .lyrics-btn {
  margin-top: 0;
}

/* bit's own teal, not an accent token — this is someone else's brand and it should not
   shift when the DJ picks new colours. */
.tip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  border-color: rgba(47, 227, 240, 0.35);
  color: #6ee7f2;
}

.tip-btn img {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

/* ---------------------------------------------------------------- tip dialog */

dialog.tip-dialog {
  width: min(360px, calc(100vw - 40px));
  padding: 24px 22px 20px;
  text-align: center;
}

dialog.tip-dialog[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.tip-logo {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  margin-bottom: 6px;
}

.tip-dialog h3 {
  margin: 0;
  font-size: 20px;
}

.tip-sub {
  margin: 0;
  color: var(--text);
  font-size: 14.5px;
  unicode-bidi: plaintext;
}

.tip-blurb {
  margin: 8px 0 4px;
  color: var(--muted);
  font-size: 13.5px;
}

.tip-cta {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 15px;
  text-align: center;
  text-decoration: none;
  /* bit's brand colours, deliberately not the event accents. */
  background: linear-gradient(135deg, #2fe3f0, #12b5c9);
  color: #04252b;
}

.tip-qr {
  margin: 16px 0 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.tip-qr img {
  width: 132px;
  height: 132px;
  border-radius: 10px;
  background: #fff;
  padding: 6px;
}

.tip-qr span {
  color: var(--muted);
  font-size: 12px;
}

#tip-skip {
  width: 100%;
  margin-top: 6px;
  flex: none;
}

/* ---------------------------------------------------------------- dock */

.dock {
  position: fixed;
  z-index: 40;
  left: 50%;
  top: calc(env(safe-area-inset-top) + 8px);
  transform: translate(-50%, -180%);
  transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.15);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(560px, calc(100vw - 24px));
  /* Logical, so the roomy side follows the text direction on this RTL page. */
  padding-block: 7px;
  padding-inline: 7px 15px;
  border-radius: 99px;
  /* Solid, not backdrop-filter: a blurred full-width bar over a scrolling page is the
     single most expensive thing you can do to an old iPhone. */
  background: rgba(15, 10, 22, 0.94);
  border: 1px solid var(--line);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55);
}

.dock.show {
  transform: translate(-50%, 0);
}

.dock-num {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--a1-ink);
  color: var(--on-ink);
  font-weight: 800;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.dock-song {
  min-width: 0;
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  unicode-bidi: plaintext;
}

.dock-state {
  flex: none;
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- search */

section {
  scroll-margin-top: 68px;
}

.find {
  padding-top: 26px;
}

/* Set while the pill is up, so the sticky search box parks below it instead of
   underneath it — they otherwise pin to the same 8px. */
body.docked {
  --dock-h: 52px;
}

.search {
  position: sticky;
  top: calc(env(safe-area-inset-top) + 8px + var(--dock-h, 0px));
  z-index: 10;
  margin-bottom: 14px;
}

.search input {
  width: 100%;
  padding: 16px 18px;
  font-size: 17px;
  color: var(--text);
  background: rgba(18, 12, 26, 0.96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search input:focus {
  border-color: var(--a1-ink);
  box-shadow: 0 0 0 4px var(--a1-dim);
}

.search input::placeholder {
  color: #6f6579;
}

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

.results,
.queue,
.history {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.track {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  text-align: start;
  color: inherit;
  font: inherit;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.12s, transform 0.08s;
}

.track:active {
  transform: scale(0.985);
  background: var(--card-hi);
}

.track img,
.track .noart {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  flex: none;
  background: linear-gradient(135deg, var(--a2-ink), var(--a1-ink));
}

.track .meta {
  min-width: 0;
  flex: 1;
}

.track .title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  unicode-bidi: plaintext;
}

.track .sub {
  color: var(--muted);
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  unicode-bidi: plaintext;
}

.track .dur {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  flex: none;
}

/* ---------------------------------------------------------------- queue */

section h2 {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 30px 0 12px;
}

.queue li,
.history li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* The one row lit by the spotlight. */
.queue li.mine {
  border-color: var(--a1-ink);
  background: var(--a1-dim);
}

.pos {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 700;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.queue li.mine .pos {
  background: var(--a1-ink);
  color: var(--on-ink);
}

.queue li:first-child .pos {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.22);
}

.row-meta {
  min-width: 0;
  flex: 1;
}

.row-meta .title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  unicode-bidi: plaintext;
}

.row-meta .sub {
  color: var(--muted);
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  unicode-bidi: plaintext;
}

/* ---------------------------------------------------------------- your night */

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 10px;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 99px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}

.tab[aria-selected='true'] {
  background: var(--a1-ink);
  border-color: transparent;
  color: var(--on-ink);
  font-weight: 700;
}

.tab:disabled {
  opacity: 0.35;
  cursor: default;
}

.tab .n {
  font-variant-numeric: tabular-nums;
  opacity: 0.75;
}

.history li.readable {
  cursor: pointer;
}

.history li.readable:active {
  border-color: var(--a1-ink);
}

.history li.sung {
  opacity: 0.62;
}

.history li.rejected {
  border-color: rgba(255, 92, 92, 0.35);
}

.history .when {
  flex: none;
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.history .mark {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  font-size: 15px;
}

/* ---------------------------------------------------------------- misc */

.empty,
.hint {
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  padding: 18px 0;
  margin: 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 160%);
  max-width: min(520px, calc(100vw - 32px));
  padding: 13px 18px;
  border-radius: 14px;
  background: #201434;
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  font-size: 14.5px;
  transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.3);
  z-index: 50;
}

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

.toast.bad {
  border-color: var(--bad);
}

dialog {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #180f22;
  color: var(--text);
  padding: 22px;
  width: min(400px, calc(100vw - 40px));
}

dialog::backdrop {
  background: rgba(4, 2, 7, 0.72);
}

dialog h3 {
  margin: 0 0 4px;
  font-size: 19px;
}

dialog .who {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 16px;
  unicode-bidi: plaintext;
}

dialog input {
  width: 100%;
  padding: 14px 16px;
  font-size: 17px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
}

dialog input:focus {
  border-color: var(--a1-ink);
}

/* ---------------------------------------------------------------- lyrics */

/* Must be scoped to [open]: a bare `dialog.sheet-dialog { display: flex }` ties on
   specificity with the UA's `dialog:not([open]) { display: none }` and, being an author
   rule, wins — leaving the closed dialog painted over the page. */
dialog.sheet-dialog {
  width: min(560px, calc(100vw - 28px));
  max-height: 82dvh;
  padding: 0;
  overflow: hidden;
}

dialog.sheet-dialog[open] {
  display: flex;
  flex-direction: column;
}

.lyrics-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--line);
}

.lyrics-head h3 {
  margin: 0;
  font-size: 18px;
  unicode-bidi: plaintext;
}

.lyrics-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  unicode-bidi: plaintext;
}

.lyrics-head .close {
  margin-inline-start: auto;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.lyrics-body {
  padding: 16px 20px 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* Line breaks are the whole structure of a lyric sheet. */
  white-space: pre-wrap;
  unicode-bidi: plaintext;
  font-size: 15.5px;
  line-height: 1.75;
}

.lyrics-body.muted {
  color: var(--muted);
  text-align: center;
  padding: 40px 20px;
}

/* Backdrop picker — the video that plays behind this singer on the big screen.
   Two columns on a phone: any narrower and the clips stop being recognisable,
   which is the only thing the thumbnail is for. */
.visual-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 16px 20px 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.visual-card {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 2px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  padding: 0;
  cursor: pointer;
}

.visual-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.visual-card.on {
  border-color: var(--a1-ink);
}

.visual-card b {
  position: absolute;
  inset: auto 0 0 0;
  padding: 5px 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  unicode-bidi: plaintext;
}

/* "Whatever the DJ picks" — the default, and the way back from a choice. */
.visual-card.auto {
  display: grid;
  place-items: center;
  border-style: dashed;
  border-color: var(--line);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 8px;
}

.row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

button.btn {
  flex: 1;
  padding: 14px;
  font: inherit;
  font-weight: 700;
  color: var(--on-ink);
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--a1-ink), var(--a2-ink));
  cursor: pointer;
}

button.btn.ghost {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line);
  color: var(--text);
}

.spin {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--a1-ink);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------------------------------------------------------------- reduced motion */

/* Collapse durations rather than killing animations outright, so anything that carries
   state (the progress rim, the docked pill) still lands on its correct final frame.
   The scripted celebrations are gated separately by the `reduced` flag in app.js. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* A theme card shows its first clip, plus a corner mark so it reads as a set
   rather than as one video. */
.visual-card.theme::after {
  content: '⧉';
  position: absolute;
  top: 4px;
  inset-inline-end: 6px;
  font-size: 14px;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.visual-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 20px;
}

.visual-foot span {
  flex: 1;
  color: var(--muted);
  font-size: 13px;
}

.visual-foot .btn {
  flex: none;
  padding: 11px 22px;
}

/* Rotation position. Only shown once more than one clip is ticked — with a
   single choice the number would be noise. */
.visual-card .ord {
  position: absolute;
  top: 5px;
  inset-inline-start: 5px;
  min-width: 21px;
  height: 21px;
  border-radius: 999px;
  background: var(--a1-ink);
  color: var(--on-ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 21px;
  text-align: center;
}
