/* ============================================================
   777LLL FM — Y2K glitter MP3 player
   Floating widget: glossy pink plastic, pixel type, sparkles.
   Audio streams from the official YouTube / SoundCloud players.
   ============================================================ */

.y2k-mp3 {
  --mp-pink: #ff3c8d;
  --mp-hot: #ff0f7b;
  --mp-pale: #ffd6e8;
  --mp-blush: #ff8fc0;
  --mp-ink: #0b0508;
  --mp-ink-2: #180810;
  --mp-lime: #d6ff49;
  --mp-shell: 252px;

  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9998;
  font-family: 'Press Start 2P', 'Courier New', monospace;
  text-align: left;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.y2k-mp3 *,
.y2k-mp3 *::before,
.y2k-mp3 *::after { box-sizing: border-box; }

.y2k-mp3 button {
  font-family: inherit;
  min-height: 0;
  cursor: pointer;
  border: 0;
  padding: 0;
  color: inherit;
  background: none;
}

.y2k-mp3 button:focus-visible,
.y2k-mp3 [role="slider"]:focus-visible {
  outline: 2px solid var(--mp-lime);
  outline-offset: 2px;
}

/* ---------- collapsed orb ---------- */

.y2k-mp3__orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  color: #fff;
  background:
    radial-gradient(circle at 32% 24%, rgba(255,255,255,.92) 0%, rgba(255,255,255,.28) 18%, rgba(255,255,255,0) 46%),
    linear-gradient(168deg, #ff7ab8 0%, var(--mp-pink) 38%, var(--mp-hot) 72%, #a2004a 100%);
  box-shadow:
    inset 0 2px 3px rgba(255,255,255,.85),
    inset 0 -6px 10px rgba(120,0,55,.6),
    0 6px 18px rgba(255,60,141,.45),
    0 0 0 3px #0b0508;
  animation: y2kOrbBob 3.4s ease-in-out infinite;
  transition: transform .18s ease;
}

.y2k-mp3__orb:hover { transform: scale(1.07) rotate(-3deg); }
.y2k-mp3__orb:active { transform: scale(.94); }

.y2k-mp3__orb-glyph {
  font-size: 13px;
  letter-spacing: -1px;
  text-shadow: 0 2px 0 rgba(120,0,55,.75);
  transform: translateY(-1px);
}

/* halo that pings while something is playing */
.y2k-mp3__orb-ring {
  position: absolute;
  inset: -4px;
  border: 2px solid var(--mp-pale);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.y2k-mp3.is-playing .y2k-mp3__orb-ring { animation: y2kPing 1.6s ease-out infinite; }

@keyframes y2kOrbBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}

@keyframes y2kPing {
  0%   { opacity: .85; transform: scale(1); }
  100% { opacity: 0;   transform: scale(1.5); }
}

/* ---------- shell ---------- */

.y2k-mp3__shell {
  position: relative;
  width: var(--mp-shell);
  padding: 9px 10px 11px;
  border-radius: 20px 20px 24px 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.34) 0%, rgba(255,255,255,.05) 12%, rgba(255,255,255,0) 26%),
    linear-gradient(172deg, #ff6fae 0%, var(--mp-pink) 26%, #d40f66 76%, #7d0038 100%);
  box-shadow:
    inset 0 2px 2px rgba(255,255,255,.9),
    inset 0 -8px 14px rgba(105,0,48,.7),
    inset 0 0 0 2px rgba(255,214,232,.35),
    0 10px 28px rgba(0,0,0,.6),
    0 0 22px rgba(255,60,141,.3);
  transform-origin: bottom right;
}

/* open / closed */
.y2k-mp3[data-state="collapsed"] .y2k-mp3__shell { display: none; }
.y2k-mp3[data-state="open"] .y2k-mp3__orb { display: none; }
.y2k-mp3[data-state="open"] .y2k-mp3__shell { animation: y2kPopIn .26s cubic-bezier(.2,1.4,.4,1) both; }

@keyframes y2kPopIn {
  0%   { opacity: 0; transform: scale(.7) translateY(14px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* ---------- sparkles ---------- */

.y2k-mp3__sparkles {
  position: absolute;
  inset: -14px;
  pointer-events: none;
  overflow: visible;
}

.y2k-mp3__star {
  position: absolute;
  width: 11px;
  height: 11px;
  background: #fff;
  clip-path: polygon(50% 0%, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0% 50%, 40% 40%);
  opacity: 0;
  filter: drop-shadow(0 0 3px var(--mp-pale));
  animation: y2kTwinkle 2.8s ease-in-out infinite;
}

.y2k-mp3__star:nth-child(1) { top: -6px;  left: 12%;  animation-delay: .0s;  }
.y2k-mp3__star:nth-child(2) { top: 18%;   right: -8px; width: 8px; height: 8px; animation-delay: .5s; }
.y2k-mp3__star:nth-child(3) { bottom: 12%; left: -9px; width: 9px; height: 9px; animation-delay: 1.1s; }
.y2k-mp3__star:nth-child(4) { top: 44%;   left: 6%;   width: 7px; height: 7px; animation-delay: 1.7s; }
.y2k-mp3__star:nth-child(5) { bottom: -7px; right: 22%; animation-delay: 2.2s; }
.y2k-mp3__star:nth-child(6) { top: 6%;    right: 30%; width: 7px; height: 7px; animation-delay: 1.4s; }

@keyframes y2kTwinkle {
  0%, 100% { opacity: 0;   transform: scale(.3) rotate(0deg); }
  45%      { opacity: 1;   transform: scale(1) rotate(35deg); }
  70%      { opacity: .25; transform: scale(.7) rotate(60deg); }
}

/* ---------- title bar ---------- */

.y2k-mp3__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 2px 8px;
}

.y2k-mp3__brand {
  font-size: 8px;
  color: #fff;
  letter-spacing: .5px;
  text-shadow: 0 2px 0 rgba(112,0,52,.85);
}

.y2k-mp3__brand b {
  color: var(--mp-lime);
  font-weight: 400;
  margin-left: 4px;
}

.y2k-mp3__min {
  display: grid;
  place-items: center;
  width: 22px;
  height: 20px;
  font-size: 8px;
  color: #6d0033;
  border-radius: 6px;
  background: linear-gradient(180deg, #fff 0%, var(--mp-pale) 48%, #ff9ec8 100%);
  box-shadow: inset 0 1px 0 #fff, inset 0 -2px 3px rgba(150,0,70,.35), 0 2px 0 #8d0043;
}

.y2k-mp3__min:active { transform: translateY(2px); box-shadow: inset 0 1px 0 #fff, 0 0 0 #8d0043; }

/* ---------- LCD screen ---------- */

.y2k-mp3__screen {
  position: relative;
  display: flex;
  gap: 9px;
  padding: 8px;
  border-radius: 10px;
  background: linear-gradient(165deg, var(--mp-ink-2) 0%, var(--mp-ink) 60%);
  box-shadow:
    inset 0 2px 6px rgba(0,0,0,.95),
    inset 0 0 0 2px rgba(255,60,141,.55),
    0 1px 0 rgba(255,255,255,.4);
  overflow: hidden;
}

/* CRT scanlines over the screen */
.y2k-mp3__screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(255,60,141,.11) 0 1px, transparent 1px 3px);
}

.y2k-mp3__art {
  position: relative;
  flex: 0 0 auto;
  width: 74px;
  height: 74px;
  border-radius: 5px;
  overflow: hidden;
  background:
    repeating-conic-gradient(#2a0d1b 0% 25%, #1a0611 0% 50%) 0 0 / 12px 12px;
  box-shadow: inset 0 0 0 2px var(--mp-pink), 0 0 10px rgba(255,60,141,.35);
}

.y2k-mp3__art-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  image-rendering: auto;
}

/* YouTube iframe lives here, sized to the art square */
.y2k-mp3__art-stage {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}

.y2k-mp3__art-stage iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.y2k-mp3__art.is-video .y2k-mp3__art-stage { opacity: 1; pointer-events: auto; }
.y2k-mp3__art.is-video .y2k-mp3__art-img { opacity: 0; }

/* glossy diagonal sweep across the art */
.y2k-mp3__art-shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(128deg, rgba(255,255,255,.5) 0%, rgba(255,255,255,.08) 30%, transparent 52%);
  mix-blend-mode: screen;
}

.y2k-mp3__meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2px 0 1px;
}

/* ---------- scrolling title ---------- */

.y2k-mp3__marquee {
  position: relative;
  overflow: hidden;
  height: 12px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6px, #000 calc(100% - 6px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 6px, #000 calc(100% - 6px), transparent 100%);
}

.y2k-mp3__marquee-track {
  display: flex;
  gap: 26px;
  width: max-content;
  animation: y2kScroll var(--mp-scroll, 11s) linear infinite;
}

.y2k-mp3__marquee-track span {
  font-size: 8px;
  color: var(--mp-pale);
  white-space: nowrap;
  text-shadow: 0 0 6px rgba(255,60,141,.9);
}

@keyframes y2kScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-50% - 13px)); }
}

.y2k-mp3__artist {
  font-size: 7px;
  color: var(--mp-blush);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: .9;
}

.y2k-mp3__status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 6px;
  color: var(--mp-lime);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.y2k-mp3__led {
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #4a1a30;
  box-shadow: 0 0 0 1px rgba(255,255,255,.15);
}

.y2k-mp3.is-playing .y2k-mp3__led {
  background: var(--mp-lime);
  box-shadow: 0 0 6px var(--mp-lime);
  animation: y2kBlink 1.1s steps(1) infinite;
}

@keyframes y2kBlink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: .25; } }

/* ---------- progress ---------- */

.y2k-mp3__progress {
  position: relative;
  height: 20px;
  margin-top: 9px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}

.y2k-mp3__progress-track {
  position: relative;
  width: 100%;
  height: 9px;
  border-radius: 5px;
  background: linear-gradient(180deg, #4d0022 0%, #240010 100%);
  box-shadow: inset 0 2px 3px rgba(0,0,0,.9), 0 1px 0 rgba(255,255,255,.4);
  overflow: visible;
}

.y2k-mp3__progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: 5px;
  background: linear-gradient(180deg, #fff 0%, var(--mp-pale) 30%, var(--mp-pink) 62%, var(--mp-hot) 100%);
  box-shadow: 0 0 8px rgba(255,60,141,.8);
}

.y2k-mp3__knob {
  position: absolute;
  top: 50%;
  left: 0;
  width: 13px;
  height: 13px;
  margin-left: -6px;
  border-radius: 50%;
  transform: translateY(-50%);
  background:
    radial-gradient(circle at 34% 28%, #fff 0%, rgba(255,255,255,.35) 30%, transparent 58%),
    linear-gradient(180deg, #ffd6e8 0%, var(--mp-pink) 60%, #a2004a 100%);
  box-shadow: 0 0 0 1.5px #2a0011, 0 2px 5px rgba(0,0,0,.7);
}

.y2k-mp3__times {
  display: flex;
  justify-content: space-between;
  font-size: 6px;
  color: #ffe4f0;
  padding: 1px 2px 0;
  text-shadow: 0 1px 0 rgba(110,0,50,.8);
}

/* ---------- transport ---------- */

.y2k-mp3__transport {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 0 8px;
}

.y2k-mp3__btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 34px;
  border-radius: 11px;
  color: #6d0033;
  background:
    linear-gradient(180deg, rgba(255,255,255,.95) 0%, rgba(255,255,255,.3) 34%, rgba(255,255,255,0) 55%),
    linear-gradient(180deg, #ffe6f1 0%, #ffb4d5 52%, #ff6aa9 100%);
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 -3px 5px rgba(160,0,76,.35),
    0 3px 0 #8d0043,
    0 5px 10px rgba(0,0,0,.4);
  transition: transform .1s ease, box-shadow .1s ease;
}

.y2k-mp3__btn:hover { filter: brightness(1.06); }

.y2k-mp3__btn:active {
  transform: translateY(3px);
  box-shadow: inset 0 1px 0 #fff, inset 0 2px 6px rgba(120,0,55,.45), 0 0 0 #8d0043;
}

.y2k-mp3__btn--play {
  width: 58px;
  height: 40px;
  border-radius: 13px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.95) 0%, rgba(255,255,255,.32) 36%, rgba(255,255,255,0) 58%),
    linear-gradient(180deg, #fbffd6 0%, var(--mp-lime) 46%, #8fb300 100%);
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 -3px 6px rgba(90,120,0,.4),
    0 3px 0 #5d7500,
    0 6px 12px rgba(0,0,0,.45);
  color: #2b3a00;
}

.y2k-mp3__btn--play:active { box-shadow: inset 0 1px 0 #fff, inset 0 2px 6px rgba(70,95,0,.5), 0 0 0 #5d7500; }

.y2k-mp3__btn svg { display: block; }
.y2k-mp3__btn .y2k-icon-pause { display: none; }
.y2k-mp3.is-playing .y2k-mp3__btn .y2k-icon-play  { display: none; }
.y2k-mp3.is-playing .y2k-mp3__btn .y2k-icon-pause { display: block; }

/* ---------- bottom row: volume + playlist ---------- */

.y2k-mp3__bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px;
}

.y2k-mp3__mute {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: #fff;
  border-radius: 6px;
  background: rgba(60,0,28,.4);
  box-shadow: inset 0 0 0 1px rgba(255,214,232,.4);
}

.y2k-mp3__mute:active { transform: translateY(1px); }
.y2k-mp3__mute .y2k-icon-muted { display: none; }
.y2k-mp3.is-muted .y2k-mp3__mute .y2k-icon-vol   { display: none; }
.y2k-mp3.is-muted .y2k-mp3__mute .y2k-icon-muted { display: block; }

.y2k-mp3__vol {
  flex: 1 1 auto;
  position: relative;
  height: 22px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
  min-width: 54px;
}

.y2k-mp3__vol-track {
  position: relative;
  width: 100%;
  height: 7px;
  border-radius: 4px;
  background: linear-gradient(180deg, #4d0022 0%, #240010 100%);
  box-shadow: inset 0 2px 3px rgba(0,0,0,.9), 0 1px 0 rgba(255,255,255,.35);
}

.y2k-mp3__vol-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 70%;
  border-radius: 4px;
  background: linear-gradient(180deg, #fff 0%, var(--mp-pale) 40%, var(--mp-pink) 100%);
}

.y2k-mp3__vol .y2k-mp3__knob { width: 11px; height: 11px; margin-left: -5px; }

.y2k-mp3__list-btn {
  flex: 0 0 auto;
  height: 22px;
  padding: 0 8px;
  font-size: 6px;
  color: #6d0033;
  border-radius: 7px;
  background: linear-gradient(180deg, #fff 0%, var(--mp-pale) 46%, #ff9ec8 100%);
  box-shadow: inset 0 1px 0 #fff, 0 2px 0 #8d0043;
}

.y2k-mp3__list-btn:active { transform: translateY(2px); box-shadow: inset 0 1px 0 #fff, 0 0 0 #8d0043; }
.y2k-mp3.is-listing .y2k-mp3__list-btn { background: linear-gradient(180deg, #fbffd6 0%, var(--mp-lime) 60%, #9dc400 100%); }

/* ---------- playlist ---------- */

.y2k-mp3__list {
  display: none;
  margin-top: 9px;
  max-height: 158px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 9px;
  background: linear-gradient(165deg, var(--mp-ink-2) 0%, var(--mp-ink) 70%);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.95), inset 0 0 0 2px rgba(255,60,141,.5);
  scrollbar-width: thin;
  scrollbar-color: var(--mp-pink) #2a0011;
}

.y2k-mp3.is-listing .y2k-mp3__list { display: block; }

.y2k-mp3__list::-webkit-scrollbar { width: 6px; }
.y2k-mp3__list::-webkit-scrollbar-track { background: #2a0011; }
.y2k-mp3__list::-webkit-scrollbar-thumb { background: var(--mp-pink); border-radius: 3px; }

.y2k-mp3__list ol { list-style: none; margin: 0; padding: 4px; }

.y2k-mp3__row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 5px;
  border-radius: 5px;
  text-align: left;
  color: var(--mp-pale);
  transition: background .14s ease;
}

.y2k-mp3__row:hover { background: rgba(255,60,141,.18); }

.y2k-mp3__row-num {
  flex: 0 0 auto;
  font-size: 6px;
  color: var(--mp-pink);
  width: 14px;
}

.y2k-mp3__row-text { min-width: 0; flex: 1; }

.y2k-mp3__row-title {
  display: block;
  font-size: 7px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.y2k-mp3__row-artist {
  display: block;
  font-size: 6px;
  line-height: 1.5;
  color: var(--mp-blush);
  opacity: .8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.y2k-mp3__row-src {
  flex: 0 0 auto;
  font-size: 5px;
  color: #ff7ab8;
  padding: 3px 4px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(255,122,184,.45);
}

.y2k-mp3__row.is-current { background: rgba(255,60,141,.28); }
.y2k-mp3__row.is-current .y2k-mp3__row-num { color: var(--mp-lime); }
.y2k-mp3__row.is-current .y2k-mp3__row-title { color: #fff; text-shadow: 0 0 7px rgba(255,60,141,.95); }
.y2k-mp3__row.is-unavailable { opacity: .42; }

/* ---------- mobile ---------- */

@media (max-width: 640px) {
  .y2k-mp3 { right: 12px; bottom: 12px; --mp-shell: min(84vw, 244px); }
  .y2k-mp3__orb { width: 56px; height: 56px; }
  .y2k-mp3__list { max-height: 132px; }
}

/* keep clear of the cart drawer when it is open on small screens */
@media (max-width: 480px) {
  .y2k-mp3 { bottom: 10px; }
}

/* The persistent mobile tab bar owns the bottom of the screen under 900px,
   so the player parks above it instead of sitting on top of it. */
@media (max-width: 900px) {
  .y2k-mp3 { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
  .y2k-mp3 *,
  .y2k-mp3 *::before,
  .y2k-mp3 *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .y2k-mp3__star { opacity: .8; }
  .y2k-mp3__marquee-track { animation: none; }
}

/* ---------- playlist row internals ---------- */

.y2k-mp3__row-main {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
  text-align: left;
  color: inherit;
}

.y2k-mp3__row-src:hover { color: var(--mp-lime); box-shadow: inset 0 0 0 1px var(--mp-lime); }

/* SoundCloud's widget is the audio engine for SC tracks; it is not part of
   the visual design, so it sits out of the way. Every SC track keeps a
   visible credit line plus a link back to the original in the playlist. */
.y2k-mp3__sc {
  position: absolute;
  width: 1px;
  height: 1px;
  left: -9999px;
  border: 0;
  opacity: 0;
  pointer-events: none;
}
