/*
 * Assist (assist.js): the right-hand end of the top menu line, the Assist
 * button, the "?" markers, the explanation pop-up and the corner boxes.
 * Its own file, loaded by the menu partial, because not every page with the
 * menu loads score.css.
 */

/* The menu line: links on the left, Assist (and page buttons) on the right. */
.site-menu { display: flex; flex-wrap: wrap; align-items: center; }
.site-menu .menu-right {
  order: 99;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding-left: 0.8rem;
}
.site-menu .menu-right:empty { display: none; }

.assist-toggle.is-on {
  background: #ffd166;
  border-color: #ffd166;
  color: #1b1b1b;
}

/* "?" beside everything that explains itself, only while Assist is on. */
.assist-on [data-assist] { position: relative; }
.assist-on [data-assist]::after {
  content: "?";
  position: absolute;
  top: -0.45rem;
  right: -0.45rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #ffd166;
  color: #1b1b1b;
  font: 700 0.68rem/1rem system-ui, sans-serif;
  text-align: center;
  pointer-events: none;
  z-index: 3;
}

.assist-pop {
  position: absolute;
  z-index: 3000;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  background: #1b2233;
  color: #f2f4f8;
  border: 1px solid #ffd166;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  font-size: 0.85rem;
  line-height: 1.4;
  pointer-events: none;
}
.assist-pop[hidden] { display: none; }

.assist-toasts {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(22rem, calc(100vw - 2rem));
}
.assist-toast {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: #1b2233;
  color: #f2f4f8;
  border-left: 4px solid #ffd166;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  font-size: 0.86rem;
  line-height: 1.4;
  transition: opacity 0.4s;
}
.assist-toast.is-going { opacity: 0; }
.assist-toast-close {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
}
.assist-toast-close:hover { opacity: 1; }

/* Text shown ONLY while Assist is on: any element with class assist-only.
   (Rehearse's "Practise running your show..." line is the first.) */
.assist-only { display: none; }
.assist-on .assist-only { display: block; }
.assist-on span.assist-only { display: inline; }
