/* Shared Continuity Deck + Ambient Stage */
@import url("https://fonts.googleapis.com/css2?family=Oswald:wght@500;600&display=swap");

:root {
  --vcr-player-h: 84px;
}

body.has-vcr-player {
  padding-bottom: calc(var(--vcr-player-h) + env(safe-area-inset-bottom, 0px) + 16px) !important;
}

.vcr-player {
  position: fixed;
  left: max(12px, env(safe-area-inset-left, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  z-index: 500;
  max-width: 920px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 48px minmax(0, 1.1fr) auto minmax(120px, 1.2fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(200,214,230,.12), transparent 42%),
    linear-gradient(180deg, rgba(18,18,20,.92), rgba(10,10,12,.88));
  border: 1px solid rgba(200, 214, 230, 0.22);
  box-shadow:
    0 1px 0 rgba(255,255,255,.12) inset,
    0 0 0 1px rgba(180,198,220,.08) inset,
    0 2px 6px rgba(0, 0, 0, 0.2),
    0 22px 48px rgba(0, 0, 0, 0.35);
  backdrop-filter: saturate(140%) blur(22px);
  -webkit-backdrop-filter: saturate(140%) blur(22px);
  color: #fff;
  transform: translateY(140%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.45s cubic-bezier(0.25, 0.1, 0.25, 1), opacity 0.35s ease, border-color .35s ease, box-shadow .35s ease;
  overflow: hidden;
}
.vcr-player::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    108deg,
    transparent 40%,
    rgba(255,255,255,.06) 48%,
    rgba(200,214,230,.1) 50%,
    transparent 58%
  );
  opacity: .55;
  mix-blend-mode: soft-light;
}
.vcr-player.is-playing {
  border-color: rgba(200, 214, 230, 0.38);
  box-shadow:
    0 1px 0 rgba(255,255,255,.16) inset,
    0 0 0 1px rgba(180,198,220,.14) inset,
    0 0 28px rgba(170,190,220,.15),
    0 22px 48px rgba(0, 0, 0, 0.4);
}

.vcr-player.is-visible {
  transform: none;
  opacity: 1;
  pointer-events: auto;
}

.vcr-player__bug {
  margin: 0 0 2px;
  font-family: var(--callsign, 'Oswald', 'Space Grotesk', sans-serif);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(255,255,255,.42);
}

.vcr-player__title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}

.vcr-player__sub {
  font-size: 12px;
  color: rgba(255,255,255,.48);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vcr-player__upnext {
  margin: 2px 0 0;
  font-family: var(--callsign, 'Oswald', 'Space Grotesk', sans-serif);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.32);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vcr-player__upnext[hidden] { display: none !important; }

.vcr-player__stage-hit {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 0;
  cursor: pointer;
}

.vcr-player > *:not(.vcr-player__stage-hit) {
  position: relative;
  z-index: 1;
}

.vcr-player__art {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  background: #12141a;
  box-shadow:
    0 0 0 1px rgba(200,214,230,.28),
    inset 0 1px 0 rgba(255,255,255,.12);
}

.vcr-player__meta { min-width: 0; }

.vcr-player__title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vcr-player__sub {
  font-size: 12px;
  color: #6e6e73;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vcr-player__controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.vcr-player__btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(17,17,17,.08);
  background: rgba(255,255,255,.72);
  color: #111111;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 6px 16px rgba(17,17,17,.06);
  transition: transform .2s cubic-bezier(.22,1,.36,1), background .2s ease, box-shadow .2s ease, border-color .2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.vcr-player__btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  display: block;
  pointer-events: none;
}
.vcr-player__btn .vcr-ico--pause { display: none; }
.vcr-player__btn.is-playing .vcr-ico--play { display: none; }
.vcr-player__btn.is-playing .vcr-ico--pause { display: block; }

.vcr-player__btn--play {
  width: 46px;
  height: 46px;
  background: #111111;
  color: #fff;
  border-color: #111;
  box-shadow:
    0 1px 0 rgba(255,255,255,.18) inset,
    0 10px 24px rgba(17,17,17,.28);
}
.vcr-player__btn--play svg { width: 15px; height: 15px; }
.vcr-player__btn--play .vcr-ico--play { margin-left: 1px; }

@media (hover:hover) {
  .vcr-player__btn:hover {
    transform: translateY(-1px);
    background: #fff;
    border-color: rgba(17,17,17,.14);
  }
  .vcr-player__btn--play:hover {
    background: #1a1a1a;
    border-color: #1a1a1a;
  }
}
.vcr-player__btn:active { transform: scale(.96); }

.vcr-player__progress-wrap { min-width: 0; }

.vcr-player__scrub,
.vcr-stage__scrub {
  width: 100%;
  accent-color: #111111;
  cursor: pointer;
}

.vcr-player__times {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #86868b;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

.vcr-player__buy {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  color: #111111;
  text-decoration: none;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 980px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.vcr-player__btn {
  color: #fff;
}

.vcr-player__times {
  color: rgba(255,255,255,.45);
}

.vcr-player__close {
  font-size: 18px;
  color: rgba(255,255,255,.5);
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.vcr-player__scrub {
  accent-color: #fff;
}

/* Preview bumper interstitial */
.vcr-bumper {
  position: fixed;
  inset: 0;
  z-index: 560;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.vcr-bumper.is-on {
  opacity: 1;
  pointer-events: auto;
}
.vcr-bumper__card {
  width: min(420px, 100%);
  padding: 28px 24px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: linear-gradient(180deg, rgba(22,22,24,.96), rgba(8,8,10,.94));
  color: #fff;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
  animation: fxBumperIn .35s cubic-bezier(.22,1,.36,1) both;
}
.vcr-bumper__callsign {
  margin: 0 0 12px;
  font-family: var(--callsign, 'Oswald', 'Space Grotesk', sans-serif);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
}
.vcr-bumper__title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.02em;
}
.vcr-bumper__sub {
  margin: 0 0 20px;
  font-size: 13px;
  color: rgba(255,255,255,.5);
}
.vcr-bumper__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.vcr-bumper__btn {
  appearance: none;
  font: inherit;
  cursor: pointer;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 980px;
  border: 1px solid rgba(255,255,255,.16);
  background: #fff;
  color: #111;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.vcr-bumper__btn--ghost {
  background: transparent;
  color: #fff;
}
body.vcr-bumper-open { overflow: hidden; }

.vcr-stage__kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.35);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(255,255,255,.7);
}
.vcr-stage__bug { color: #fff; letter-spacing: .06em; }
.vcr-stage__upnext {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
}
.vcr-stage__upnext[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .vcr-bumper__card { animation: none !important; }
}

/* Play-gate toast (Safari blocked autoplay) */
.vcr-play-gate {
  position: fixed;
  left: 50%;
  bottom: calc(var(--vcr-player-h, 84px) + 28px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(10px);
  z-index: 560;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 980px;
  background: rgba(17,17,17,.92);
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.01em;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s cubic-bezier(.22,1,.36,1);
}
.vcr-play-gate.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.vcr-play-gate button {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 980px;
  border: 0;
  background: #fff;
  color: #111;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 760px) {
  :root { --vcr-player-h: 112px; }
  .vcr-player {
    left: max(10px, env(safe-area-inset-left, 0px));
    right: max(10px, env(safe-area-inset-right, 0px));
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    grid-template-columns: 44px minmax(0, 1fr) auto auto;
    grid-template-areas:
      "art meta controls close"
      "buy buy progress progress";
    gap: 8px 10px;
    padding: 10px 12px 12px;
    border-radius: 20px;
  }
  .vcr-player__art { grid-area: art; width: 44px; height: 44px; border-radius: 10px; }
  .vcr-player__meta { grid-area: meta; }
  .vcr-player__controls { grid-area: controls; gap: 6px; }
  .vcr-player__progress-wrap { grid-area: progress; }
  .vcr-player__close { grid-area: close; }
  .vcr-player__buy {
    grid-area: buy;
    justify-self: start;
    font-size: 11px;
    padding: 6px 10px;
    min-height: 32px;
  }
  .vcr-player__btn {
    width: 44px;
    height: 44px;
  }
  .vcr-player__btn--play {
    width: 48px;
    height: 48px;
  }
  .vcr-player__scrub {
    height: 28px;
    touch-action: none;
  }
  .vcr-stage {
    padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  }
  .vcr-stage__hint { display: none; }
  .vcr-stage__btn {
    width: 52px;
    height: 52px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  .vcr-stage__btn--play {
    width: 64px;
    height: 64px;
  }
  .vcr-stage__scrub {
    height: 28px;
    touch-action: none;
  }
}

/* Ambient Stage */
.vcr-stage {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #fff;
}

.vcr-stage[hidden] { display: none !important; }

.vcr-stage__bg {
  position: absolute;
  inset: -40px;
  background-size: cover;
  background-position: center;
  filter: blur(48px) saturate(1.15) brightness(0.45);
  transform: scale(1.12);
}

.vcr-stage__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 10, 14, 0.35), rgba(8, 10, 14, 0.72));
}

.vcr-stage__close {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top, 0px));
  right: max(18px, env(safe-area-inset-right, 0px));
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.vcr-stage__content {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: vcrStageIn 0.55s cubic-bezier(0.25, 0.1, 0.25, 1);
}

@keyframes vcrStageIn {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.vcr-stage__art {
  width: min(280px, 68vw);
  aspect-ratio: 1;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  margin-bottom: 8px;
}

.vcr-stage__kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}

.vcr-stage__title {
  font-size: clamp(28px, 6vw, 40px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.vcr-stage__artist {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.72);
}

.vcr-stage__controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 4px;
}

.vcr-stage__btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 12px 28px rgba(0,0,0,.25);
  transition: transform .2s cubic-bezier(.22,1,.36,1), background .2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.vcr-stage__btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  display: block;
  pointer-events: none;
}
.vcr-stage__btn .vcr-ico--pause { display: none; }
.vcr-stage__btn.is-playing .vcr-ico--play { display: none; }
.vcr-stage__btn.is-playing .vcr-ico--pause { display: block; }

.vcr-stage__btn--play {
  width: 68px;
  height: 68px;
  background: #fff;
  color: #111;
  border-color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 16px 36px rgba(0,0,0,.35);
}
.vcr-stage__btn--play .vcr-ico--play { margin-left: 2px; }

@media (hover:hover) {
  .vcr-stage__btn:hover { background: rgba(255,255,255,.2); transform: translateY(-1px); }
  .vcr-stage__btn--play:hover { background: #f4f4f4; }
}
.vcr-stage__btn:active { transform: scale(.96); }

.vcr-stage__scrub { width: 100%; margin-top: 8px; }

.vcr-stage__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}

.vcr-stage__link {
  appearance: none;
  font: inherit;
  cursor: pointer;
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 980px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: inline-flex;
  align-items: center;
}

.vcr-stage__hint {
  margin-top: 10px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
}

body.vcr-stage-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .vcr-player,
  .vcr-stage__content,
  .vcr-play-gate {
    transition: none !important;
    animation: none !important;
  }
}
