/* ==========================================================================
   /player-two — vertical snap-feed, midnight glass aesthetic.
   Every selector + keyframe is feed-prefixed: this file is globbed into the
   coverflow player's layout too (stylesheet_link_tag :app) and must be inert there.
   ========================================================================== */

body.feed-body {
  margin: 0;
  height: 100dvh;
  overflow: hidden;
  background: #05060c;
  color: #f4f5fb;
  font-family: "Outfit", system-ui, sans-serif;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

.feed-shell { position: relative; height: 100dvh; }

/* --- ambient background ------------------------------------------------- */
.feed-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.feed-glow {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: .35;
  animation: feed-drift 26s ease-in-out infinite alternate;
}
.fg1 { width: 55vmax; height: 55vmax; top: -20%; left: -15%;
       background: radial-gradient(circle, #7c5cff, transparent 65%); }
.fg2 { width: 50vmax; height: 50vmax; bottom: -25%; right: -15%;
       background: radial-gradient(circle, #ff4fa3, transparent 65%);
       animation-delay: -13s; }
@keyframes feed-drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(6vw, 4vh) scale(1.15); }
}

/* --- the scroll-snap feed ------------------------------------------------ */
.feed-scroll {
  position: relative; z-index: 1;
  height: 100dvh; overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}
.feed-scroll::-webkit-scrollbar { display: none; }

.feed-card {
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: grid; place-items: center;
  padding: 12px;
}

.feed-frame {
  position: relative;
  width: min(94vw, calc(92dvh * 9 / 16));
  aspect-ratio: 9 / 16;
  border-radius: 28px;
  overflow: hidden;
  background: #0a0c16;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .07),
              0 0 70px rgba(124, 92, 255, .22),
              0 30px 80px rgba(0, 0, 0, .65);
  transition: box-shadow .5s ease, transform .5s cubic-bezier(.2, .9, .3, 1.2);
}
.feed-card.is-active .feed-frame {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .12),
              0 0 90px rgba(255, 79, 163, .30),
              0 30px 90px rgba(0, 0, 0, .7);
}

.feed-frame video {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  cursor: pointer;
}

/* fresh upload: springy pop-in — scale/glow only, never opacity-from-0 */
.feed-card.is-fresh .feed-frame { animation: feed-pop .9s cubic-bezier(.2, 1.4, .3, 1) both; }
@keyframes feed-pop {
  0%   { transform: scale(.55) rotate(-4deg); }
  60%  { transform: scale(1.06) rotate(1.5deg); }
  100% { transform: scale(1) rotate(0); }
}

/* --- card chrome ---------------------------------------------------------- */
.feed-shade {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(4, 5, 12, .78), transparent 42%),
              linear-gradient(to bottom, rgba(4, 5, 12, .35), transparent 22%);
}

.feed-playglyph {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 3.2rem; color: rgba(255, 255, 255, .92);
  text-shadow: 0 6px 30px rgba(0, 0, 0, .6);
  pointer-events: none; transform: scale(0);
  transition: transform .25s cubic-bezier(.2, 1.4, .3, 1);
}
.feed-card.is-active.is-paused .feed-playglyph { transform: scale(1); }

.feed-meta {
  position: absolute; left: 18px; right: 78px; bottom: 26px;
  pointer-events: none;
}
.feed-title {
  margin: 0; font-size: clamp(1.4rem, 4.5vw, 1.9rem); font-weight: 800;
  letter-spacing: .01em; text-shadow: 0 3px 18px rgba(0, 0, 0, .55);
}
.feed-subtitle {
  margin: .2em 0 0; font-size: .92rem; font-weight: 500;
  color: rgba(244, 245, 251, .78);
}

/* equalizer — animates while the active card is playing */
.feed-eq { display: flex; gap: 3px; align-items: flex-end; height: 16px; margin-top: 10px; }
.feed-eq span {
  width: 4px; height: 100%; border-radius: 2px;
  background: linear-gradient(to top, #ff4fa3, #7c5cff);
  transform: scaleY(.25); transform-origin: bottom;
}
.feed-card.is-active:not(.is-paused) .feed-eq span { animation: feed-eq .9s ease-in-out infinite alternate; }
.feed-eq span:nth-child(2) { animation-delay: -.25s; }
.feed-eq span:nth-child(3) { animation-delay: -.5s; }
.feed-eq span:nth-child(4) { animation-delay: -.7s; }
@keyframes feed-eq { from { transform: scaleY(.2); } to { transform: scaleY(1); } }

/* --- glass action rail ----------------------------------------------------- */
.feed-rail {
  position: absolute; right: 12px; bottom: 90px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.feed-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800; font-size: 1.3rem; color: #fff;
  background: linear-gradient(135deg, #ff4fa3, #7c5cff);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .85), 0 0 24px rgba(255, 79, 163, .5);
}
.feed-rail-btn {
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .16);
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .09);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  color: #fff; font-size: 1.15rem; cursor: pointer;
  transition: transform .2s cubic-bezier(.2, 1.4, .3, 1), background .2s ease;
}
.feed-rail-btn:hover { transform: scale(1.14); background: rgba(255, 255, 255, .18); }
.feed-rail-btn:active { transform: scale(.94); }

.feed-like { position: relative; }
.feed-like-heart { line-height: 1; transition: transform .25s cubic-bezier(.2, 1.6, .3, 1); }
.feed-like.is-liked .feed-like-heart { transform: scale(1.25); }
.feed-like-count {
  position: absolute; bottom: -16px; left: 0; right: 0;
  font-size: .68rem; font-weight: 700; color: rgba(244, 245, 251, .85);
  text-shadow: 0 2px 8px rgba(0, 0, 0, .6);
}

/* --- seek bar ---------------------------------------------------------------- */
.feed-seek {
  position: absolute; left: 0; right: 0; bottom: 0; height: 22px;
  display: flex; align-items: flex-end; cursor: pointer;
  touch-action: none;
}
.feed-seek-fill {
  height: 4px; width: 0%;
  background: linear-gradient(90deg, #ff4fa3, #7c5cff, #3fd8ff);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 12px rgba(255, 79, 163, .8);
  transition: height .15s ease;
}
.feed-seek:hover .feed-seek-fill { height: 8px; }

/* --- particles / heart bursts ------------------------------------------------- */
.feed-particle {
  position: absolute; left: 50%; top: 50%; z-index: 30;
  font-size: 1.3rem; pointer-events: none;
  animation: feed-fly 1.1s ease-out forwards;
}
@keyframes feed-fly {
  to { transform: translate(var(--dx, 0), var(--dy, -200px)) scale(.3) rotate(140deg); opacity: 0; }
}
.feed-heart-pop {
  position: absolute; left: 50%; top: 50%; z-index: 30;
  font-size: 5rem; pointer-events: none;
  transform: translate(-50%, -50%);
  animation: feed-heart .8s cubic-bezier(.2, 1.4, .3, 1) forwards;
}
@keyframes feed-heart {
  0%   { transform: translate(-50%, -50%) scale(0) rotate(-12deg); }
  55%  { transform: translate(-50%, -50%) scale(1.25) rotate(4deg); opacity: 1; }
  100% { transform: translate(-50%, -80%) scale(1) rotate(0); opacity: 0; }
}

/* --- dropzone card ---------------------------------------------------------- */
.feed-dropframe {
  display: grid; place-items: center;
  border: 2px dashed rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .04);
  cursor: pointer; overflow: visible;
  transition: border-color .3s ease, background .3s ease;
}
.feed-dropframe:hover {
  border-color: rgba(255, 79, 163, .75);
  background: rgba(124, 92, 255, .08);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .07), 0 0 90px rgba(124, 92, 255, .4);
}
.feed-drop-input { display: none; }
.feed-drop-inner { text-align: center; padding: 24px; pointer-events: none; }
.feed-drop-icon { font-size: 3rem; animation: feed-bob 2.6s ease-in-out infinite; }
@keyframes feed-bob {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50%      { transform: translateY(-12px) rotate(6deg); }
}
.feed-drop-title { margin: .6em 0 0; font-size: 1.35rem; font-weight: 800; }
.feed-drop-hint { margin: .3em 0 0; color: rgba(244, 245, 251, .6); font-size: .9rem; }

.feed-drop-bar {
  height: 6px; margin: 18px auto 0; width: 70%;
  border-radius: 3px; background: rgba(255, 255, 255, .12); overflow: hidden;
  visibility: hidden;
}
.feed-drop-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #ff4fa3, #7c5cff, #3fd8ff);
  transition: width .2s ease;
}
.feed-dropframe.is-uploading .feed-drop-bar { visibility: visible; }
.feed-dropframe.is-uploading .feed-drop-icon { animation: feed-spin 1s linear infinite; }
@keyframes feed-spin { to { transform: rotate(360deg); } }
.feed-drop-status { margin-top: 12px; min-height: 1.3em; font-weight: 700; font-size: .95rem; }
.feed-dropframe.is-error { border-color: rgba(255, 90, 90, .8); animation: feed-shake .45s ease; }
.feed-dropframe.is-error .feed-drop-status { color: #ff7b7b; }
@keyframes feed-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); } 75% { transform: translateX(10px); }
}

/* full-screen drop veil */
#feed-drop-overlay {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  background: rgba(5, 6, 12, .65);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
#feed-drop-overlay.is-visible { opacity: 1; }
.feed-drop-overlay-box {
  border: 3px dashed rgba(255, 79, 163, .8); border-radius: 32px;
  padding: 60px 80px; text-align: center;
  font-size: 1.6rem; font-weight: 800;
  background: rgba(124, 92, 255, .12);
}
.feed-drop-overlay-icon { font-size: 4rem; animation: feed-bob 1.6s ease-in-out infinite; }

/* --- intro -------------------------------------------------------------------- */
#feed-intro {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: #04050b; overflow: hidden; cursor: pointer;
  transition: opacity .55s ease, visibility .55s;
}
#feed-intro.is-done { opacity: 0; visibility: hidden; }

.feed-aurora {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5;
  animation: feed-drift 14s ease-in-out infinite alternate;
}
.fa1 { width: 60vmax; height: 40vmax; top: -15%; left: -20%;
       background: radial-gradient(ellipse, #7c5cff, transparent 65%); }
.fa2 { width: 50vmax; height: 35vmax; bottom: -20%; right: -15%;
       background: radial-gradient(ellipse, #ff4fa3, transparent 65%); animation-delay: -5s; }
.fa3 { width: 40vmax; height: 30vmax; top: 30%; left: 35%;
       background: radial-gradient(ellipse, #3fd8ff, transparent 65%);
       opacity: .3; animation-delay: -9s; }

.feed-intro-inner { position: relative; text-align: center; }
.feed-intro-word {
  margin: 0; overflow: hidden; padding: .12em .1em;
  font-size: clamp(2.6rem, 9vw, 5.5rem); font-weight: 800; letter-spacing: .01em;
  background: linear-gradient(100deg, #ff4fa3, #7c5cff 40%, #3fd8ff 70%, #ff4fa3);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: feed-shimmer 4.5s linear infinite;
}
@keyframes feed-shimmer { to { background-position: -220% 0; } }
.feed-intro-word span {
  display: inline-block;
  /* rise out of the h1's overflow mask — geometry hides them, not opacity */
  transform: translateY(140%) rotate(6deg);
  animation: feed-rise .7s cubic-bezier(.2, 1.3, .3, 1) forwards;
  animation-delay: calc(var(--i) * 65ms + 250ms);
}
@keyframes feed-rise { to { transform: translateY(0) rotate(0); } }

.feed-intro-by {
  margin: .8em 0 0; font-weight: 700; letter-spacing: .35em; text-transform: uppercase;
  font-size: clamp(.7rem, 2vw, .95rem); color: rgba(244, 245, 251, .75);
  transform: translateY(30px); filter: blur(6px);
  animation: feed-focus .8s ease 1.2s forwards;
}
@keyframes feed-focus { to { transform: translateY(0); filter: blur(0); } }

.feed-intro-skip {
  position: absolute; bottom: 42px; left: 0; right: 0; text-align: center;
  font-size: .95rem; font-weight: 700; color: rgba(244, 245, 251, .65);
  animation: feed-pulse 1.8s ease-in-out infinite;
}
@keyframes feed-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
