/* Browser Cast layout: fixed chart and safe, fully visible now-playing card.
   Keep separate from user-customised styles.css/styles-browser-compact.css. */
#screen[data-mode="browser"][data-browser-fullscreen="true"] .layout {
  transform: none !important;
  transition: none !important;
}
#screen[data-mode="browser"][data-browser-fullscreen="true"] .content {
  /* The per-song translation is at most 4px in either direction. Allow space
     for that, receiver overscan, drop shadows, and long titles. */
  right: clamp(30px, 2.2vw, 48px);
  bottom: clamp(30px, 2.2vw, 48px);
  left: auto;
  top: auto;
  box-sizing: border-box;
  min-width: 0;
  width: fit-content;
  max-width: min(440px, calc(100vw - 96px));
  max-height: calc(100vh - 96px);
  overflow: hidden;
  transform: translate3d(var(--browser-card-burn-x, 0px), var(--browser-card-burn-y, 0px), 0);
  transition: transform 550ms ease;
}
#screen[data-mode="browser"][data-browser-fullscreen="true"] .content header,
#screen[data-mode="browser"][data-browser-fullscreen="true"] .content #media-progress {
  min-width: 0;
  max-width: 100%;
}
#screen[data-mode="browser"][data-browser-fullscreen="true"] .content header {
  grid-template-columns: clamp(52px, 4.5vw, 74px) minmax(0, 1fr);
}
#screen[data-mode="browser"][data-browser-fullscreen="true"] h1,
#screen[data-mode="browser"][data-browser-fullscreen="true"] .artist,
#screen[data-mode="browser"][data-browser-fullscreen="true"] .album {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
/* Every other presentation also changes position only between songs, with
   a short track-boundary transition rather than a slow mid-song drift. */
.layout { transition-duration: 550ms, 1600ms, 1600ms, 240ms, 240ms; }

/* Beam's three-bar brand mark is drawn by the receiver at display resolution,
   rather than re-encoding 30-60 JPEG frames through Cast. The 3.2s glint moves
   horizontally (no spinning/scale/flash), and reduced-motion stays static. */
#screen[data-mode="browser"][data-browser-loading="true"] .browser-pane {
  display: flex;
}
#screen[data-mode="browser"][data-browser-loading="true"] .artwork-shell {
  background: #0c0f16;
}
#screen[data-mode="browser"] .browser-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  background: #0c0f16;
}
#screen[data-mode="browser"] .browser-loading[hidden] {
  display: none;
}
.beam-loading-mark {
  width: clamp(48px, 3.8vw, 70px);
  height: clamp(32px, 2.8vw, 50px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.beam-loading-mark span {
  display: block;
  position: relative;
  height: 23%;
  border-radius: 100px;
  background: #4294fa;
  overflow: hidden;
}
.beam-loading-mark span:nth-child(2) { width: 62%; }
.beam-loading-mark span:nth-child(3) { width: 84%; }
.beam-loading-mark span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 20%, rgba(192,225,255,.62) 50%, transparent 80%);
  transform: translate3d(-110%, 0, 0);
  animation: beam-loading-glint 3.2s linear infinite;
  will-change: transform;
}
@keyframes beam-loading-glint {
  from { transform: translate3d(-110%, 0, 0); }
  to { transform: translate3d(110%, 0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .beam-loading-mark span::after { animation: none; display: none; }
}
