/* Cassette music player (cassette.js). Only transform and opacity animate; the reels are turned by script
   (rotate only) and stay still for reduced-motion visitors. */
.cassette { --w: 260px; --pink: var(--verm, #ff5fa2); position: fixed; left: 16px; bottom: 16px; z-index: 80;
  width: min(var(--w), calc(100vw - 24px)); border-radius: 14px; background: #141113; color: #fff;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .08);
  opacity: 0; transform: translateY(16px) scale(.92); transform-origin: bottom left;
  transition: opacity .3s ease, transform .3s cubic-bezier(.2, .9, .3, 1.2); }
.cassette[hidden] { display: none; }
.cassette.on { opacity: 1; transform: none; }
.cassette.moved { bottom: auto; }
.cassette.dragging { transition: none; }

/* top bar: drag handle, title and the four window icons */
.cs-bar { display: flex; align-items: center; gap: 6px; padding: 6px 6px 4px 10px; cursor: grab; touch-action: none; user-select: none; }
.cassette.dragging .cs-bar { cursor: grabbing; }
.cs-grip { width: 10px; height: 10px; flex: none; opacity: .45;
  background: radial-gradient(circle, #fff 1px, transparent 1.4px) 0 0 / 5px 5px; }
.cs-title { flex: 1; min-width: 0; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-icons { display: flex; gap: 2px; flex: none; }
.cs-icons button, .cs-ctrl button { border: 0; background: transparent; color: rgba(255, 255, 255, .78); display: grid; place-items: center; cursor: pointer; border-radius: 8px; padding: 0; }
.cs-icons button { width: 26px; height: 26px; }
.cs-icons svg { width: 15px; height: 15px; }
.cs-icons button:hover, .cs-ctrl button:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.cs-pin[aria-pressed="true"] { color: var(--pink); background: color-mix(in srgb, var(--pink) 16%, transparent); }
.cassette button:focus-visible, .cs-seek:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

/* the cassette itself, with the white label across the top as on a real tape */
.cs-body { position: relative; padding: 0 8px; }
.cs-art { display: block; width: 100%; height: auto; }
.cs-label { position: absolute; left: calc(8px + 9%); right: calc(8px + 9%); top: 9%; padding: 4px 8px 5px; border-radius: 3px;
  background: #f4f2ee; color: #1b1618; display: grid; gap: 1px; line-height: 1.2; }
.cs-row { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.cs-tag { font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: color-mix(in srgb, var(--pink) 70%, #000); font-weight: 600; }
.cs-kind { font-size: 9px; opacity: .65; text-align: end; }
.cs-name { font-size: 11px; line-height: 1.25; overflow-wrap: anywhere; }
.cs-name b { font-weight: 700; }
.cassette[data-size="medium"] .cs-name { font-size: 13px; }
.cassette[data-size="medium"] .cs-tag, .cassette[data-size="medium"] .cs-kind { font-size: 10px; }
.cassette[data-size="large"] .cs-name { font-size: 16px; }
.cassette[data-size="large"] .cs-tag, .cassette[data-size="large"] .cs-kind { font-size: 11.5px; }

/* music controls */
.cs-ctrl { display: grid; grid-template-columns: auto auto auto 1fr; grid-template-areas: "prev play next time" "seek seek seek seek"; align-items: center; gap: 2px 4px; padding: 6px 10px 10px; }
.cs-prev { grid-area: prev; } .cs-play { grid-area: play; } .cs-next { grid-area: next; }
.cs-ctrl button { width: 32px; height: 32px; }
.cs-ctrl svg { width: 16px; height: 16px; }
.cs-ctrl .cs-play { background: var(--pink); color: #fff; border-radius: 50%; width: 36px; height: 36px; box-shadow: 0 4px 12px rgba(0, 0, 0, .35); }
.cs-play .pa { display: none; } .cs-play.on .pa { display: inline; } .cs-play.on .pl { display: none; }
.cs-time { grid-area: time; justify-self: end; font-size: 11px; opacity: .7; font-variant-numeric: tabular-nums; }
.cs-seek { grid-area: seek; width: 100%; margin: 6px 0 0; accent-color: var(--pink); height: 18px; }

/* minimised: one spinning pink reel; tap it to bring the player back */
.cs-restore { display: none; }
.cassette.mini { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; }
.cassette.mini > :not(.cs-restore) { display: none; }
.cassette.mini .cs-restore { display: block; width: 64px; height: 64px; border: 0; padding: 0; background: transparent; cursor: pointer; border-radius: 50%; }
.cassette.mini .cs-restore svg { width: 100%; height: 100%; display: block; }

[dir="rtl"] .cassette:not(.moved) { left: auto; right: 16px; transform-origin: bottom right; }
@media (max-width: 520px) {
  .cassette:not(.moved) { left: 12px; bottom: 12px; }
  [dir="rtl"] .cassette:not(.moved) { right: 12px; }
  .cassette[data-size="small"] .cs-kind { display: none; }
}
@media (prefers-reduced-motion: reduce) { .cassette { transition: opacity .2s linear; transform: none; } }
