/* Guest page: phone first, one column, big tap targets for guests of every age. */

body {
  font-size: 1.125rem;
  min-height: 100vh;
  min-height: 100dvh;
}

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 16px calc(96px + env(safe-area-inset-bottom, 0px));
}

/* ---------------------------------------------------------------- top bar */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding-top: env(safe-area-inset-top, 0px);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.brand-logo {
  width: 34px;
  height: 34px;
  margin-right: 10px;
  border-radius: 8px;
  object-fit: contain;
}

.brand-name {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.me-btn {
  display: inline-flex;
  align-items: center;
  max-width: 50%;
  min-height: 44px;
  padding: 0 14px 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px; /* unslop-ignore: pill controls are the chosen music-app reference (Spotify/Sonos), see DESIGN.md */
  background: transparent;
  color: var(--text-2);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}

.me-btn span {
  margin-left: 6px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.me-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.top-actions {
  display: flex;
  align-items: center;
  flex: none;
  max-width: 62%;
}

.top-actions > * + * {
  margin-left: 8px;
}

.top-actions .me-btn {
  max-width: none;
  min-width: 0;
}

.lang-toggle {
  display: inline-flex;
  flex: none;
  padding: 2px;
  border-radius: 999px; /* unslop-ignore: pill controls are the chosen music-app reference (Spotify/Sonos), see DESIGN.md */
  border: 1px solid var(--line);
}

.lang-toggle button {
  position: relative;
  min-width: 44px;
  height: 34px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px; /* unslop-ignore: pill controls are the chosen music-app reference (Spotify/Sonos), see DESIGN.md */
  background: transparent;
  color: var(--text-3);
  font-size: 0.8125rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.lang-toggle button.is-on {
  background: var(--surface-3);
  color: var(--text);
}

/* ---------------------------------------------------------------- loading and gates */

.loading {
  display: flex;
  justify-content: center;
  padding: 30vh 0;
}

.gate {
  padding: 14vh 8px 0;
  text-align: center;
}

.gate-art {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 112px;
  height: 112px;
  margin-bottom: 28px;
  border-radius: 28px;
  background: var(--surface-2);
  color: var(--accent);
}

.gate-art .icon {
  width: 56px;
  height: 56px;
  stroke-width: 1.6;
}

.gate h1,
.gate h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.gate p {
  max-width: 30ch;
  margin: 0 auto 20px;
  color: var(--text-2);
  font-size: 1.125rem;
}

/* ---------------------------------------------------------------- now playing */

.now {
  display: grid;
  grid-template-columns: 72px 1fr;
  grid-column-gap: 16px;
  align-items: center;
  margin-top: 4px;
  padding: 16px;
  border-radius: var(--radius-l);
  background: linear-gradient(150deg, var(--cover-tint, var(--surface-2)) 0%, var(--surface-1) 75%);
  box-shadow: inset 0 0 0 1px hsla(var(--hue), 30%, 90%, 0.05);
}

.now .cover {
  border-radius: 8px;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.7);
}

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

.now-title,
.now-artist {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.now-title {
  font-size: 1.25rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.now-artist {
  color: var(--text-2);
  font-size: 1rem;
}

.now-by {
  display: flex;
  align-items: center;
  margin-top: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-2);
}

.now-by > span:last-child {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.now-progress {
  grid-column: 1 / -1;
  margin-top: 14px;
}

/* ---------------------------------------------------------------- closed and offline */

.closed {
  margin-top: 16px;
  padding: 18px;
  border-radius: var(--radius-l);
  border: 1px solid var(--line);
  background: var(--surface-1);
}

.closed h2 {
  font-size: 1.25rem;
  margin-bottom: 4px;
}

.closed p {
  color: var(--text-2);
  font-size: 1rem;
}

.offline {
  position: sticky;
  top: 8px;
  z-index: 5;
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 0.9375rem;
  font-weight: 600;
}

.offline .icon {
  margin-right: 8px;
}

/* ---------------------------------------------------------------- search, the primary action */

.search {
  margin-top: 24px;
}

.search-go {
  min-height: 46px;
  padding: 0 22px;
  font-size: 1.0625rem;
}

.search-hint {
  margin: 8px 18px 0;
  font-size: 0.875rem;
  color: var(--text-3);
}

.search.is-disabled {
  opacity: 0.5;
}

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

.song.is-mine .pos {
  color: var(--accent);
}

.queue .cover {
  margin-right: 14px;
}

.quota-note {
  margin-top: 14px;
  font-size: 0.875rem;
  color: var(--text-3);
}

.results {
  margin-top: 16px;
}

.result {
  border-bottom: 1px solid var(--line);
}

.result:last-child {
  border-bottom: 0;
}

.result .song {
  border-bottom: 0;
}

.result.is-added .song-title {
  color: var(--text-2);
}

.row-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -2px 0 12px 70px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: 0.9375rem;
}

.row-note p {
  margin-right: 10px;
}

.row-note.is-error {
  background: var(--danger-bg);
  color: var(--danger);
}

/* Skeleton rows while searching. */
.skeleton-row {
  display: flex;
  align-items: center;
  height: 72px;
}

.skeleton-row i,
.skeleton-row b {
  display: block;
  border-radius: 6px;
  background: var(--surface-2);
  animation: pulse 1.2s ease-in-out infinite;
}

.skeleton-row i {
  width: 56px;
  height: 56px;
  margin-right: 14px;
}

.skeleton-row b {
  width: 55%;
  height: 16px;
}

/* ---------------------------------------------------------------- name sheet */

.name-field {
  margin-top: 16px;
}

.name-field input {
  font-size: 1.25rem;
  min-height: 56px;
}

@media (min-width: 600px) {
  .app {
    padding-top: 12px;
  }
}

.row-note .btn {
  flex: none;
  white-space: nowrap;
}

.search-hint.is-karaoke {
  color: var(--accent);
  font-weight: 600;
}

/* Thumb-sized targets on the guest page: a phone in one hand, in a dim bar. */
.guest .btn-small {
  min-height: 44px;
  padding: 0 16px;
}

.guest .btn-icon.btn-small {
  width: 44px;
  min-width: 44px;
}

.noscript-note {
  margin: 20px;
}

.results:focus {
  outline: none;
}

.results:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: var(--radius);
}

/* An invitation to add a name, shown in the queue once the guest has a song in it. */
.name-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: 0.9375rem;
  color: var(--text-2);
}

.name-prompt p {
  margin: 0 12px 0 0;
}

.name-prompt .icon {
  margin-right: 6px;
}

.guest-foot {
  margin: 40px 0 calc(24px + env(safe-area-inset-bottom, 0px));
  text-align: center;
}

.link-btn {
  -webkit-appearance: none;
  appearance: none;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  background: none;
  color: var(--text-3);
  font: inherit;
  font-size: 0.875rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link-btn:hover {
  color: var(--text-2);
}

.about-body {
  margin: 8px 0 12px;
}

.about-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.about-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.name-prompt .btn {
  flex: none;
  white-space: nowrap;
}

/* The pill stays 34 px tall to fit the top bar; the tap area is 44 px. */
.lang-toggle button::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -5px;
  bottom: -5px;
}

/* Why the results are the bar's own songs today (YouTube searches used up). */
.search-notice {
  display: flex;
  align-items: flex-start;
  margin: 4px 0 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 0.9375rem;
  line-height: 1.4;
}

.search-notice .icon {
  flex: none;
  margin: 1px 10px 0 0;
  color: var(--text-3);
}

/* Below results from the bar's own library: the way out to all of YouTube. */
.search-all {
  margin: 18px 0 4px;
  text-align: center;
}

.search-all p {
  margin: 0 0 10px;
  color: var(--text-3);
  font-size: 0.9375rem;
}
