*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: #0d0d0d;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.container { width: 100%; max-width: 560px; position: relative; z-index: 1; }

/* ── Animated page background ─────────────────────────────────────────────── */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #0d0d0d;
}

.page-bg-layer {
  position: absolute;
  width: 160%; height: 160%;
  top: -30%; left: -30%;
  background-size: cover;
  background-position: center;
}

.page-bg-l1 {
  filter: blur(50px) saturate(2.8) brightness(0.55);
  opacity: 0.9;
  animation: s-layer1 50s ease-in-out infinite alternate;
}

.page-bg-l2 {
  filter: blur(65px) saturate(3.5) brightness(0.55);
  opacity: 0.75;
  mix-blend-mode: screen;
  animation: s-layer2 38s ease-in-out infinite alternate;
}

.page-bg-l3 {
  filter: blur(80px) saturate(3) brightness(0.6);
  opacity: 0.6;
  mix-blend-mode: overlay;
  animation: s-layer3 28s ease-in-out infinite alternate;
}

.page-bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.55) 0%,
    rgba(0,0,0,0.35) 40%,
    rgba(0,0,0,0.65) 100%
  );
}

/* Header */
.header { text-align: center; margin-bottom: 28px; }


h1 { font-size: 26px; font-weight: 700; margin-bottom: 8px; }

.subtitle { font-size: 15px; color: rgba(255,255,255,0.85); line-height: 1.5; }
.subtitle + .subtitle { margin-top: 3px; }

/* Platform buttons */
.platforms { display: flex; flex-direction: column; gap: 10px; margin-bottom: 32px; }

.platform-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 20px;
  border-radius: 14px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  transition: opacity 0.15s, transform 0.1s;
  letter-spacing: 0.2px;
}

.platform-btn:hover  { opacity: 0.88; transform: translateY(-1px); }
.platform-btn:active { transform: translateY(0); opacity: 1; }

.btn-spotify { background: #1DB954; color: #000; }
.btn-apple   { background: #fc3c44; color: #fff; }
.btn-youtube { background: #FF0000; color: #fff; }
.btn-tidal   { background: #fff;    color: #000; }
.btn-deezer  { background: #A238FF; color: #fff; }
.btn-amazon  { background: #25D1DA; color: #000; }

.platform-btn img { width: 20px; height: 20px; flex-shrink: 0; }

/* Subscribe form */
.subscribe-section {
  margin-top: 28px;
  text-align: center;
}

.subscribe-label {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 10px;
  letter-spacing: 0.2px;
}

.subscribe-form {
  display: flex;
  gap: 8px;
}

.subscribe-input {
  flex: 1;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 12px 14px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.subscribe-input::placeholder { color: rgba(255,255,255,0.35); }
.subscribe-input:focus { border-color: rgba(255,255,255,0.4); }

.subscribe-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 10px;
  padding: 12px 18px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.subscribe-btn:hover { background: rgba(255,255,255,0.25); }

.subscribe-feedback {
  font-size: 13px;
  margin-top: 8px;
  min-height: 18px;
  color: rgba(255,255,255,0.6);
}

/* Social links */
.social {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 16px;
}

.social-link {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.15s;
}

.social-link:hover { color: #fff; }

/* Skeleton shimmer */
.skeleton {
  background: linear-gradient(90deg, #1a1a1a 25%, #252525 50%, #1a1a1a 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Story ring on cover ───────────────────────────────────────────────────── */
.cover-wrapper {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 18px;
  cursor: pointer;
}

.story-ring {
  position: absolute;
  inset: -4px;
  border-radius: 24px;
  background: linear-gradient(135deg, #f9ce34, #ee2a7b, #6228d7, #1DB954);
  background-size: 300% 300%;
  animation: ring-spin 3s linear infinite;
  z-index: 1;
}

@keyframes ring-spin {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.story-ring-gap {
  position: absolute;
  inset: -1px;
  border-radius: 20px;
  background: #0d0d0d;
  z-index: 2;
}

.cover-img {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  object-fit: cover;
  display: block;
}

.cover-play-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: 18px;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.cover-wrapper:hover .cover-play-overlay { background: rgba(0,0,0,0.45); }

.cover-play-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-size: 16px;
  padding-left: 3px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  transition: transform 0.15s;
}

.cover-wrapper:hover .cover-play-btn { transform: scale(1.08); }

/* ── Stories overlay ───────────────────────────────────────────────────────── */

/* Full screen on mobile, centered 9:16 card on desktop */
.stories-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.85);
}

.stories-overlay.visible { display: flex; }

/* The 9:16 card */
.stories-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

/* On larger screens: constrain to 9:16 with rounded corners */
@media (min-width: 540px) {
  .stories-card {
    height: min(96vh, calc(56vw * 16 / 9));
    width:  min(56vw, calc(96vh * 9 / 16));
    max-height: 900px;
    max-width:  506px;
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.9);
  }
}

/* ── Apple Music animated background ──── */
.stories-bg-wrap {
  position: absolute;
  inset: -80px;
  z-index: 0;
  overflow: hidden;
  background: #000;
}

.stories-bg-base { position: absolute; inset: 0; background: #000; }

.stories-bg-layer {
  position: absolute;
  width: 160%; height: 160%;
  top: -30%; left: -30%;
  background-size: cover;
  background-position: center;
}

.stories-layer-1 {
  filter: blur(40px) saturate(2.2) brightness(0.5);
  opacity: 0.9;
  mix-blend-mode: normal;
  animation: s-layer1 12s ease-in-out infinite alternate;
}

@keyframes s-layer1 {
  0%   { transform: scale(1.0)  translate(0%,  0%)  rotate(0deg);   }
  33%  { transform: scale(1.08) translate(5%, -4%)  rotate(2deg);   }
  66%  { transform: scale(1.04) translate(-4%, 6%)  rotate(-1deg);  }
  100% { transform: scale(1.1)  translate(3%, -6%)  rotate(1.5deg); }
}

.stories-layer-2 {
  filter: blur(55px) saturate(3) brightness(0.55);
  opacity: 0.75;
  mix-blend-mode: screen;
  animation: s-layer2 9s ease-in-out infinite alternate;
}

@keyframes s-layer2 {
  0%   { transform: scale(1.1)  translate(-6%,  4%) rotate(120deg); }
  50%  { transform: scale(1.18) translate(4%,  -7%) rotate(124deg); }
  100% { transform: scale(1.12) translate(-3%,  3%) rotate(118deg); }
}

.stories-layer-3 {
  filter: blur(70px) saturate(2.5) brightness(0.6);
  opacity: 0.6;
  mix-blend-mode: overlay;
  animation: s-layer3 7s ease-in-out infinite alternate;
}

@keyframes s-layer3 {
  0%   { transform: scale(1.15) translate(3%,  -3%) rotate(240deg); }
  50%  { transform: scale(1.22) translate(-5%,  5%) rotate(246deg); }
  100% { transform: scale(1.17) translate(6%,  -4%) rotate(237deg); }
}

.stories-dark-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.4) 0%,
    rgba(0,0,0,0.1) 35%,
    rgba(0,0,0,0.1) 60%,
    rgba(0,0,0,0.6) 100%
  );
}

/* Progress bars */
.stories-progress {
  position: relative;
  z-index: 10;
  display: flex;
  gap: 3px;
  padding: 16px 14px 8px;
}

.sp-seg {
  flex: 1;
  height: 2.5px;
  border-radius: 2px;
  background: rgba(255,255,255,0.25);
  overflow: hidden;
}

.sp-fill {
  height: 100%;
  background: #fff;
  width: 0%;
  border-radius: 2px;
}

/* Top bar */
.stories-topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 10px;
}

.stories-counter {
  color: rgba(255,255,255,0.45);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.stories-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stories-playpause-btn,
.stories-close-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.stories-playpause-btn:hover,
.stories-close-btn:hover { background: rgba(255,255,255,0.25); }

/* Tap zones — always active */
.stories-tap-prev,
.stories-tap-next {
  position: absolute;
  top: 80px;
  bottom: 190px;
  z-index: 10;
  width: 42%;
  cursor: pointer;
}

.stories-tap-prev { left: 0; }
.stories-tap-next { right: 0; }

/* Arrow buttons — only on desktop, inside the card */
.stories-arrow {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 24px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  line-height: 1;
  backdrop-filter: blur(4px);
}

.stories-arrow:hover { background: rgba(255,255,255,0.28); }
.stories-arrow-prev { left: 12px; }
.stories-arrow-next { right: 12px; }

@media (min-width: 540px) {
  .stories-arrow { display: flex; }
}

/* Center art */
.stories-center {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.stories-art {
  width: min(200px, 55vw);
  height: min(200px, 55vw);
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 12px 48px rgba(0,0,0,0.7);
}

@media (min-width: 540px) {
  .stories-art { width: 180px; height: 180px; }
}

/* Bottom */
.stories-bottom {
  position: relative;
  z-index: 10;
  padding: 0 22px 52px;
}

.stories-preview-tag {
  display: inline-block;
  background: rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.8px;
  margin-bottom: 10px;
}

.stories-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stories-artist {
  font-size: 15px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 18px;
}

/* Reactions */
.stories-reactions {
  display: flex;
  gap: 12px;
}

.reaction-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.12);
  border: none;
  border-radius: 20px;
  padding: 7px 14px;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  backdrop-filter: blur(4px);
}

.reaction-btn:hover  { background: rgba(255,255,255,0.22); }
.reaction-btn:active { transform: scale(0.93); }

.reaction-btn.active { background: rgba(255,255,255,0.3); }

/* Social icons */
.social-link svg {
  width: 24px;
  height: 24px;
  fill: rgba(255,255,255,0.75);
  transition: fill 0.15s;
  display: block;
}

.social-link:hover svg { fill: #fff; }
