/* UI layer — the top "island" now-playing pill. Shares the overlay variables from modal.css. */
.island {
  top: calc(env(safe-area-inset-top, 0px) + 6px); /* 6 px (TZ: 10): the island is 53 px tall; its bottom edge stays above the first list row's buttons (a core e2e clicks there) */
  transform-origin: 50% 100%; /* the hover/focus +2 % grows upward: the bottom edge never moves down onto the content */
  width: min(92vw, 420px); max-width: none; height: 52px; padding: 0 6px 0 8px; gap: 6px;
  background: var(--ov-bg); border: 1px solid var(--ov-line); box-shadow: var(--ov-shadow);
  transform: translateY(-22px);
  transition: opacity var(--ov-out) ease-in, transform var(--ov-out) var(--ov-ease), border-color 180ms var(--ov-ease), box-shadow 280ms var(--ov-ease);
}
.island.is-visible { transform: none; transition: opacity var(--ov-in) var(--ov-ease), transform var(--ov-in) var(--ov-spring), border-color 180ms var(--ov-ease), box-shadow 280ms var(--ov-ease); }
.island.is-visible:hover, .island.is-visible:focus-within { transform: scale(1.02); border-color: var(--ov-line-strong); }
html[data-player="playing"] .island { box-shadow: var(--ov-shadow), 0 0 26px rgb(242 163 58 / 0.2); }
.island::after { left: 22px; right: 22px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--c-ochre); }

.island__open { gap: 12px; min-height: 48px; padding: 0 4px 0 0; border-radius: var(--radius-pill); }
.island__title { font-size: 0.875rem; line-height: 1.25; color: var(--c-cream); }
.island__artist { font-size: 0.75rem; line-height: 1.25; opacity: 1; color: rgb(242 230 201 / 0.65); }
.island__eq { display: flex; align-items: flex-end; gap: 2px; flex: none; height: 14px; margin-left: auto; }
.island__eq i { width: 3px; height: 100%; border-radius: 2px; background: var(--c-ochre); transform-origin: bottom; transform: scaleY(0.3); animation: island-eq 0.9s ease-in-out infinite alternate; animation-play-state: paused; }
.island__eq i:nth-child(2) { animation-delay: -0.3s; animation-duration: 0.7s; }
.island__eq i:nth-child(3) { animation-delay: -0.6s; animation-duration: 1.1s; }
html[data-player="playing"] .island__eq i { animation-play-state: running; }
@keyframes island-eq { from { transform: scaleY(0.25); } to { transform: scaleY(1); } }
.island__open[aria-disabled="true"] { cursor: default; }
.island__lyr { flex: none; width: 16px; height: 16px; margin-left: auto; color: var(--c-cream); opacity: 0.85; } /* "the lyrics follow the preview — tap" */
.island__lyr + .island__eq { margin-left: 0; }
.island__open[aria-disabled="true"] :is(.island__eq, .island__lyr) { display: none; }

.island__toggle { width: 40px; height: 40px; }
.island__skip { width: 34px; height: 34px; border-color: transparent; background: transparent; }
.island__skip .ico { width: 16px; height: 16px; }
.island__skip[aria-disabled="true"] { opacity: 0.4; cursor: default; }
.island__toggle .ico { width: 18px; height: 18px; }
.island__stop { position: relative; width: 32px; height: 32px; border-color: transparent; background: transparent; }
.island__stop::before { content: ""; position: absolute; inset: -6px -3px; } /* keeps a 44 px touch target */
.island__stop .ico { width: 16px; height: 16px; }

@media (max-width: 380px) { .island { height: 48px; } .island__open { min-height: 44px; } }
@media (max-width: 360px) { .island__artist { display: none; } .island__skip { width: 30px; height: 30px; } .island__toggle { width: 38px; height: 38px; } }
@media (prefers-reduced-motion: reduce) {
  .island, .island.is-visible { transform: none; transition: opacity 1ms; }
  .island.is-visible:hover, .island.is-visible:focus-within { transform: none; }
  .island__eq i { animation: none; }
  .island__eq i { transform: scaleY(0.7); }
}

/* ---- Vinyl record: the cover is the label of a black disc that spins while a preview plays (island + lyrics modal).
   Wrapper .vinyl stays still (static light sheen, drop shadow, tonearm); .vinyl__disc rotates (grooves + two soft bands, so the
   motion reads even at 40 px). Paused = frozen in place; the modal's tonearm lifts off the record. Decorative: aria-hidden. ---- */
.vinyl { --vs: 40px; position: relative; display: block; flex: none; width: var(--vs); height: var(--vs); border-radius: 50%; filter: drop-shadow(0 2px 5px rgb(0 0 0 / 0.55)); transition: filter 400ms var(--ov-ease); }
.vinyl--modal { --vs: 64px; }
html[data-player="playing"] .vinyl { filter: drop-shadow(0 2px 5px rgb(0 0 0 / 0.55)) drop-shadow(0 0 9px rgb(242 163 58 / 0.32)); }
.vinyl__disc {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%; overflow: hidden;
  background:
    conic-gradient(from 0deg, rgb(255 255 255 / 0) 0deg, rgb(255 255 255 / 0.1) 22deg, rgb(255 255 255 / 0) 52deg, rgb(255 255 255 / 0) 180deg, rgb(255 255 255 / 0.1) 202deg, rgb(255 255 255 / 0) 232deg),
    repeating-radial-gradient(circle at 50% 50%, #0d0d12 0, #0d0d12 1.2px, #1c1c24 1.2px, #1c1c24 2.4px),
    #0b0b0f;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.14), inset 0 0 0 calc(var(--vs) * 0.04) rgb(0 0 0 / 0.55);
  animation: vinyl-spin 3.2s linear infinite; animation-play-state: paused;
}
html[data-player="playing"] .vinyl__disc { animation-play-state: running; }
@keyframes vinyl-spin { to { transform: rotate(360deg); } }
.vinyl__disc > * { grid-area: 1 / 1; }
.vinyl__disc > img { width: 44%; height: 44%; border: 0; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 calc(var(--vs) * 0.035) var(--c-ochre), 0 0 0 calc(var(--vs) * 0.055) #0b0b0f; background: var(--c-cobalt); }
.vinyl__disc::after { content: ""; grid-area: 1 / 1; width: 11%; aspect-ratio: 1; border-radius: 50%; background: var(--c-night); box-shadow: 0 0 0 1px rgb(242 230 201 / 0.6); }
/* Static glints (do not rotate with the disc): two soft reflections, label area masked out. */
.vinyl::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 305deg, transparent 0 6%, rgb(255 255 255 / 0.26) 11%, transparent 17% 56%, rgb(255 255 255 / 0.17) 61%, transparent 67%);
  -webkit-mask: radial-gradient(circle, transparent 0 27%, #000 28%); mask: radial-gradient(circle, transparent 0 27%, #000 28%);
}
/* Tonearm (lyrics modal only): rests off the record when paused, swings onto the outer groove while playing. */
.vinyl--modal::before {
  content: ""; position: absolute; z-index: 1; top: calc(var(--vs) * -0.0625 - 2px); right: calc(var(--vs) * -0.03);
  width: calc(var(--vs) * 0.375); height: 4px; border-radius: 3px;
  background: linear-gradient(90deg, var(--c-ochre) 0 6px, var(--c-cream) 6px);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.6);
  transform-origin: 100% 50%; transform: rotate(-8deg); transition: transform 520ms var(--ov-spring);
}
html[data-player="playing"] .vinyl--modal::before { transform: rotate(-48deg); }
@media (max-width: 560px) { .vinyl--modal { --vs: 52px; } }
@media (max-height: 480px) { .vinyl--modal { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .vinyl__disc { animation: none; }
  .vinyl, .vinyl--modal::before { transition: none; }
}

/* Calm error toast (a preview that could not be played): same overlay language, same spot as the island. */
.toast {
  position: fixed; top: calc(env(safe-area-inset-top, 0px) + 6px); left: 0; right: 0; z-index: var(--z-island); width: min(92vw, 420px); margin-inline: auto;
  display: grid; gap: 2px; padding: 10px 18px; color: var(--c-cream); background: var(--ov-bg); border: 1px solid var(--ov-line); border-radius: var(--radius-3); box-shadow: var(--ov-shadow);
  opacity: 0; transform: translateY(-22px); transition: opacity var(--ov-out) ease-in, transform var(--ov-out) var(--ov-ease);
}
.toast.is-visible { opacity: 1; transform: none; transition: opacity var(--ov-in) var(--ov-ease), transform var(--ov-in) var(--ov-spring); }
.toast span { font-size: var(--fs-0); color: rgb(242 230 201 / 0.7); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
@media (prefers-reduced-motion: reduce) { .toast, .toast.is-visible { transform: none; transition: opacity 1ms; } }
