/* Song board and DJ view. Tokens only, like site.css. */

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Rows (board, search results, DJ queue) ---------- */
.song-board, .song-results {
  list-style: none; margin: 0; padding: 0;
  display: grid;
}
.song-row, .song-result {
  display: grid; align-items: center; gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--rule);
  min-width: 0;
}
.song-row { grid-template-columns: 1.5em 48px minmax(0, 1fr) auto; }
.song-result { grid-template-columns: 48px minmax(0, 1fr) auto; }
.song-board > :first-child, .song-results > :first-child { border-top: 1px solid var(--rule); }
.song-rank {
  font-variant-numeric: tabular-nums lining-nums; text-align: right;
  color: var(--brass-deep); font-weight: 700; font-size: 15px;
}
.song-art {
  width: 48px; height: 48px; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--surface-sunk); display: grid; place-items: center; color: var(--text-muted);
}
.song-art img { width: 48px; height: 48px; object-fit: cover; display: block; }
.song-art svg { width: 22px; height: 22px; }
.song-meta { min-width: 0; }
.song-meta p { margin: 0; overflow-wrap: anywhere; }
.song-title { font-weight: 700; font-size: 16px; line-height: 1.35; }
.song-link {
  color: inherit; text-decoration: underline; text-decoration-color: var(--rule);
  text-underline-offset: 3px; text-decoration-thickness: 1px;
  transition: text-decoration-color .15s ease;
}
.song-link:hover { text-decoration-color: currentColor; }
.song-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.song-artist { font-size: 14px; color: var(--text-muted); line-height: 1.4; }
.song-by { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); margin-top: 2px !important; }
.song-empty { padding: var(--space-5) 0; text-align: center; color: var(--text-muted); font-style: italic; }

/* Played songs sink to the bottom and quiet down. */
.song-row.is-played .song-title, .song-row.is-played .song-artist { color: var(--text-muted); }
.song-row.is-played .song-art { opacity: .55; }
.song-played {
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700;
  color: var(--success); white-space: nowrap;
}

/* ---------- Vote button ---------- */
.song-vote {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  min-width: 52px; min-height: 52px; padding: var(--space-1) var(--space-2);
  border: 1px solid var(--brand); border-radius: var(--radius-sm);
  background: transparent; color: var(--brand);
  font-family: var(--font-serif); cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.song-vote svg { width: 16px; height: 16px; }
.song-count { font-weight: 700; font-size: 16px; line-height: 1.1; font-variant-numeric: tabular-nums lining-nums; }
.song-vote:hover:not([disabled]) { background: var(--french-blue-wash); }
.song-vote:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.song-vote.is-voted { background: var(--brand); color: var(--on-brand); }
.song-vote[disabled]:not(.is-voted) { border-color: var(--border); color: var(--text-muted); cursor: not-allowed; }
.song-vote[disabled].is-voted { cursor: default; }

/* ---------- Manual entry ---------- */
.song-manual summary {
  cursor: pointer; color: var(--link); font-style: italic; font-weight: 700;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
  min-height: 44px; display: inline-flex; align-items: center;
}
.song-manual summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.song-manual[open] summary { margin-bottom: var(--space-3); }

/* ---------- Toast (a Notice pinned to the bottom of the screen) ---------- */
.song-toast {
  position: fixed; left: var(--space-4); right: var(--space-4);
  bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
  max-width: 560px; margin: 0 auto; z-index: 20;
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}
.song-toast.is-on { opacity: 1; transform: none; }
.song-toast .kt-notice { box-shadow: var(--shadow-card); background: var(--surface); }
.song-toast .kt-notice-info { background: var(--french-blue-wash); }
@media (prefers-reduced-motion: reduce) { .song-toast, .song-vote { transition: none; } }

/* ---------- DJ view ---------- */
.dj-row { grid-template-columns: 1.5em minmax(0, 1fr) auto; }
.dj-votes { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; font-size: 15px; }
.dj-actions { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.dj-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(10em, 1fr)); gap: var(--space-4); }
.dj-toggles { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.dj-meta { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; }
.dj-rule { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--rule); }
.dj-rule p { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.dj-kind { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-muted); }

/* The Hotel Room Service note. */
.song-egg { border: 0; margin: auto; width: min(26rem, calc(100vw - 2 * var(--space-4))); box-sizing: border-box; color: var(--text); background: var(--surface); box-shadow: var(--shadow-card); }
.song-egg::backdrop { background: var(--scrim); }
.song-egg:not([open]) { display: none; }
