/* The phone remote for Sakura Karaoke Studio (`pages/remote.rs`): one
   column, sized for a phone held in one hand. It reuses the party page's
   inputs, tabs, thumbnails, search results, and queue rows. */

.remote-page {
  width: min(100%, var(--width-remote));
  margin: 0 auto;
  padding: var(--space-3);
}

.remote {
  display: grid;
  gap: var(--space-3);
}

/* Every one-column grid on the page may shrink below its content: a grid
   column is otherwise as wide as its longest line, and one long suggestion
   or title (which do not wrap) would widen the page past the screen, so a
   phone zooms out to show it. */
.remote,
.remote-page .remote__head,
.remote-page .remote__name,
.remote-page .remote__notices,
.remote-page .remote__panel,
.remote-page .remote-search,
.remote-page .remote-queue,
.remote-page .remote-list,
.remote-page .remote-now,
.remote-page .remote-song,
.remote-page .remote-song-settings,
.remote-page .remote-settings,
.remote-page .remote-settings__group,
.remote-page .remote-failed,
.remote-page .remote-playlists,
.remote-page .remote-suggestions {
  grid-template-columns: minmax(0, 1fr);
}

.remote-suggestion {
  min-width: 0;
}

.remote__head {
  display: grid;
  gap: var(--space-2);
}

.remote__title {
  margin: 0;
  font-size: var(--text-lg);
}

.remote__name {
  display: grid;
  gap: var(--space-1);
}

.remote__hint {
  margin: 0;
  color: var(--color-danger);
  font-size: var(--text-sm);
}

.remote__notices {
  display: grid;
  gap: var(--space-2);
}

.remote__notices:empty {
  display: none;
}

.remote__outcome {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  background: var(--color-accent-soft);
  color: var(--color-accent-text);
  font-size: var(--text-sm);
}

.remote__outcome--failed {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.remote__panel,
.remote-search,
.remote-queue {
  display: grid;
  gap: var(--space-3);
}

.remote-list {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.remote-empty {
  margin: 0;
  padding: var(--space-4) 0;
  text-align: center;
}

/* Now playing */

.remote-now {
  display: grid;
  gap: var(--space-2);
}

.remote-now__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.remote-now__actions .button {
  flex: 1 1 auto;
  min-height: var(--size-control-large);
}

/* A row's buttons are thumb-sized on a phone. */
.remote-page .queue-item__actions .button--icon,
.remote-page .search-result__button {
  min-width: var(--size-control-large);
  min-height: var(--size-control-large);
}

/* PIN screen */

.remote-gate {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  padding: var(--space-6) 0;
  text-align: center;
}

.remote-gate__title {
  margin: 0;
  font-size: var(--text-xl);
}

.remote-gate__form {
  display: grid;
  gap: var(--space-3);
  width: min(100%, var(--width-remote-pin));
}

.remote-gate__input {
  min-height: var(--size-control-large);
  font-size: var(--text-xl);
  letter-spacing: var(--tracking-pin);
  text-align: center;
}

/* A song's settings, and the karaoke screen's */

.remote-song {
  display: grid;
  gap: var(--space-2);
}

.remote-song-settings,
.remote-settings,
.remote-settings__group {
  display: grid;
  gap: var(--space-3);
}

.remote-song-settings {
  padding: var(--space-3);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.remote-settings__hint {
  margin: 0;
  font-size: var(--text-sm);
}

.remote-stepper {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.remote-stepper__label {
  flex: 1 1 auto;
  font-size: var(--text-sm);
}

.remote-stepper__value {
  min-width: var(--width-remote-value);
  text-align: center;
}

.remote-stepper .button {
  min-width: var(--size-control-large);
  min-height: var(--size-control-large);
}

.remote-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--size-control);
  font-size: var(--text-sm);
}

.remote-toggle input {
  width: var(--size-check);
  height: var(--size-check);
  accent-color: var(--color-primary-deep);
}

/* Failed downloads */

.remote-failed {
  display: grid;
  gap: var(--space-2);
}

.remote-failed__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

/* The host's playlists */

.remote-playlists {
  display: grid;
  gap: var(--space-3);
}

.remote-playlists__head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.remote-playlists__title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: var(--text-md);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remote-playlist {
  justify-content: flex-start;
  width: 100%;
  min-height: var(--size-control-large);
}

.remote-playlist__name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-align: start;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Four tabs fit a narrow phone by scrolling sideways. Only sideways: the
   selected tab's underline overlaps the strip's border by a pixel, which
   would otherwise give the strip a vertical scrollbar. */
.remote .party-tabs {
  overflow: auto hidden;
  scrollbar-width: none;
}

/* Shared out evenly, and narrower than the party page's, so all four fit a
   375px phone. */
.remote .party-tab {
  flex: 1 0 auto;
  justify-content: center;
  padding: 0 var(--space-2);
}

/* Search results: one column of rows, the thumbnail, the title, and a
   thumb-sized "Add" at the end; "Save to a playlist" goes under the title. */
.remote .search-results {
  grid-template-columns: minmax(0, 1fr);
}

.remote .search-result {
  grid-template-areas:
    "thumb text add"
    "thumb save save";
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}

.remote .search-result .party-thumb {
  grid-area: thumb;
  align-self: start;
  width: var(--size-queue-thumb);
}

.remote .search-result__text {
  grid-area: text;
}

.remote .search-result__actions {
  display: contents;
}

.remote .search-result__button {
  grid-area: add;
  flex: none;
}

.remote .remote-save {
  grid-area: save;
  min-height: var(--size-control-small);
  font-size: var(--text-sm);
}

/* Search suggestions, and saving a result to a playlist */

.remote-suggestions {
  display: grid;
  margin: 0;
  padding: var(--space-1);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-raised);
  list-style: none;
}

.remote-suggestion {
  justify-content: flex-start;
  width: 100%;
}

.remote-save {
  flex: none;
  max-width: 100%;
}

/* The lyrics bar: the line being sung, wiped as it goes, and the next. */

.remote-lyrics {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3);
  border-radius: var(--radius);
  background: var(--color-video);
  color: var(--color-on-video);
  text-align: center;
}

.remote-lyrics__line {
  min-height: 1lh;
  margin: 0;
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
}

.remote-lyrics__sung {
  color: var(--color-overlay-pink);
}

.remote-lyrics__line--next {
  color: var(--color-overlay-muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

