/* Janan UGC Video Wall v8 — mobile-first, zero webfonts, scoped styles */

/* CRITICAL: class rules like display:flex must never override the [hidden]
 * attribute, or overlays (error, admin tips, disabled buttons) stay visible.
 * This is the root cause of v7's permanent "Video could not load / Retry". */
.janan-ugc-wrap [hidden], .janan-ugc-modal [hidden], .janan-ugc-modal[hidden] {
  display: none !important;
}

.janan-ugc-wrap, .janan-ugc-wrap *, .janan-ugc-modal, .janan-ugc-modal *, .janan-ugc-toast {
  box-sizing: border-box;
}
.janan-ugc-wrap {
  --ugc-gap: 6px;
  --ugc-radius: 12px;
  --ugc-ctrl: 30px;
  --ugc-accent: #16a34a;
  --ugc-like: #f43f5e;
  --ugc-star: #fbbf24;
  width: 100%;
  max-width: 100%;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- heading ---------- */
.janan-ugc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 10px; flex-wrap: wrap; }
.janan-ugc-title { font-size: 17px; font-weight: 700; color: inherit; line-height: 1.25; }
.janan-ugc-sub { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: #6b7280; }
.janan-ugc-count { white-space: nowrap; }
.janan-ugc-avg { color: #b45309; font-weight: 700; white-space: nowrap; }
.janan-ugc-avg > span { color: var(--ugc-star); }

/* ---------- rail ---------- */
.janan-ugc-viewport {
  position: relative;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
}
.janan-ugc-track {
  display: flex;
  gap: var(--ugc-gap);
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 1px 1px 4px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.janan-ugc-track::-webkit-scrollbar { display: none; }

/* ---------- one-time swipe hint (v8.2) ---------- */
.janan-ugc-hint {
  position: absolute; z-index: 8;
  left: 50%; bottom: 12%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 7px;
  padding: 7px 14px 7px 11px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .62);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .2px;
  white-space: nowrap;
  pointer-events: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 6px 22px rgba(0, 0, 0, .4);
  animation: ugc-hint-in .4s ease both;
}
.janan-ugc-hint svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; animation: ugc-hint-hand 1.15s ease-in-out .25s 2; }
.janan-ugc-hint i { font-style: normal; }
.janan-ugc-hint.is-out { animation: ugc-hint-out .4s ease both; }
@keyframes ugc-hint-in { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%); } }
@keyframes ugc-hint-out { to { opacity: 0; transform: translateX(-50%) translateY(8px); } }
@keyframes ugc-hint-hand { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(7px); } }

/* ---------- card ---------- */
.janan-ugc-card {
  position: relative;
  flex: 0 0 62%;                    /* mobile peek: next card hints itself */
  width: 62%;
  min-width: 0;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: var(--ugc-radius);
  background: #14161a;
  scroll-snap-align: start;
  contain: layout paint style;
  isolation: isolate;
  cursor: pointer;
  color: #fff;
  -webkit-user-select: none;
  user-select: none;
}
.janan-ugc-poster {
  position: absolute; inset: 0; z-index: 1;
  display: block; width: 100%; height: 100%;
  object-fit: cover; border: 0; margin: 0; padding: 0;
  background: #14161a;
  pointer-events: none;
}
.janan-ugc-poster--ph {
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255,255,255,.08), transparent 60%),
    linear-gradient(160deg, #23262d, #101216);
}
.janan-ugc-video {
  position: absolute; inset: 0; z-index: 2;
  display: block; width: 100%; height: 100%;
  object-fit: cover; border: 0; margin: 0; padding: 0;
  background: transparent;
  pointer-events: none;             /* clicks fall through to the card handler */
}
.janan-ugc-video::-webkit-media-controls { display: none !important; }
.janan-ugc-scrim {
  position: absolute; inset: 0; z-index: 3;
  background: linear-gradient(180deg, rgba(0,0,0,.34) 0, transparent 22%, transparent 55%, rgba(0,0,0,.66) 100%);
  pointer-events: none;
}

/* center play */
.janan-ugc-center-play {
  position: absolute; z-index: 5;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 46px; height: 46px;
  padding: 0; margin: 0; border: 0;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(0, 0, 0, .55);
  color: #fff; cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .35);
  backdrop-filter: blur(2px);
  transition: opacity .16s ease, transform .12s ease, background .12s ease;
}
.janan-ugc-center-play svg { width: 21px; height: 21px; margin-left: 2px; fill: currentColor; stroke: none; }
.janan-ugc-card.is-playing .janan-ugc-center-play { opacity: 0; pointer-events: none; }
@keyframes ugc-pulse { 0%, 100% { box-shadow: 0 4px 18px rgba(0,0,0,.35), 0 0 0 0 rgba(255,255,255,.35); } 50% { box-shadow: 0 4px 18px rgba(0,0,0,.35), 0 0 0 9px rgba(255,255,255,0); } }
.janan-ugc-card:not(.is-playing) .janan-ugc-center-play { animation: ugc-pulse 2.4s ease-out infinite; }

/* top-right controls */
.janan-ugc-top { position: absolute; z-index: 4; top: 7px; right: 7px; display: flex; gap: 6px; pointer-events: none; }

/* meta (social proof) */
.janan-ugc-meta {
  position: absolute; z-index: 4;
  left: 9px; right: 64px; bottom: 9px;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .55);
}
.janan-ugc-meta-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.janan-ugc-name { font-size: 12.5px; font-weight: 700; line-height: 1.2; }
.janan-ugc-stars { font-size: 11px; letter-spacing: .5px; color: var(--ugc-star); }
.janan-ugc-meta-sub { display: flex; align-items: center; gap: 7px; margin-top: 3px; font-size: 10.5px; color: rgba(255, 255, 255, .92); flex-wrap: wrap; }
.janan-ugc-badge { display: inline-flex; align-items: center; gap: 3px; color: #4ade80; font-weight: 700; }
.janan-ugc-badge svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.janan-ugc-badge i { font-style: normal; }

/* action buttons (sound / like / share) */
.janan-ugc-actions {
  position: absolute; z-index: 4;
  right: 7px; bottom: 9px;
  display: flex; flex-direction: column; gap: 6px;
}
.janan-ugc-ctrl {
  width: var(--ugc-ctrl); height: var(--ugc-ctrl);
  min-width: var(--ugc-ctrl); min-height: var(--ugc-ctrl);
  padding: 0; margin: 0; border: 0;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(0, 0, 0, .55);
  color: #fff; cursor: pointer;
  pointer-events: auto;              /* re-enable inside pointer-events:none containers */
  box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
  transition: transform .12s ease, background .12s ease;
}
.janan-ugc-ctrl:hover { background: rgba(0, 0, 0, .8); }
.janan-ugc-ctrl:active { transform: scale(.9); }
.janan-ugc-ctrl:focus-visible, .janan-ugc-center-play:focus-visible, .janan-ugc-card:focus-visible, .janan-ugc-arrow:focus-visible {
  outline: 2px solid #fff; outline-offset: 2px;
}
.janan-ugc-ctrl svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.janan-ugc-sound svg { margin-left: -1px; }
.janan-ugc-like { flex-direction: column; line-height: 1; }
.janan-ugc-like b { font-size: 9px; font-weight: 700; margin-top: -2px; }
.janan-ugc-like.is-liked svg { fill: var(--ugc-like); stroke: var(--ugc-like); }
.janan-ugc-like.is-liked b { color: var(--ugc-like); }

/* error overlay */
.janan-ugc-error {
  position: absolute; inset: 0; z-index: 10;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px; padding: 14px;
  text-align: center;
  color: #fff; background: rgba(12, 13, 16, .9);
  font-size: 12px; font-weight: 600; line-height: 1.4;
}
.janan-ugc-error-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.janan-ugc-error button, .janan-ugc-error .janan-ugc-open,
.janan-ugc-modal-error button, .janan-ugc-modal-error a {
  border: 0; border-radius: 999px;
  padding: 8px 14px;
  background: #fff; color: #111;
  font-size: 11.5px; font-weight: 700;
  cursor: pointer; text-decoration: none;
  display: inline-block;
}
.janan-ugc-error .janan-ugc-open { background: rgba(255,255,255,.14); color: #fff; }
.janan-ugc-error-admin, .m-err-admin { margin: 0; font-size: 10.5px; font-weight: 500; color: #fca5a5; max-width: 240px; }

/* rail arrows (desktop only) */
.janan-ugc-arrow {
  display: none;
  position: absolute; top: 50%;
  width: 38px; height: 38px;
  padding: 0; border: 0; border-radius: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, .92);
  color: #111;
  cursor: pointer;
  place-items: center;
  box-shadow: 0 3px 14px rgba(0, 0, 0, .22);
  z-index: 6;
}
.janan-ugc-arrow svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.janan-ugc-arrow.is-prev { left: 2px; }
.janan-ugc-arrow.is-next { right: 2px; }
.janan-ugc-arrow:hover { background: #fff; }
.janan-ugc-arrow:active { transform: translateY(-50%) scale(.92); }

/* ---------- grid layout ([layout="grid"]) ---------- */
.janan-ugc-wrap[data-layout="grid"] .janan-ugc-viewport { -webkit-mask-image: none; mask-image: none; overflow: visible; }
.janan-ugc-wrap[data-layout="grid"] .janan-ugc-track {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); /* 3 smaller cols on phones */
  overflow: visible;
  scroll-snap-type: none;
}
.janan-ugc-wrap[data-layout="grid"] .janan-ugc-card { flex: initial; width: auto; content-visibility: auto; contain-intrinsic-size: auto 300px; }
.janan-ugc-wrap[data-layout="grid"] .janan-ugc-arrow { display: none; }

/* ---------- fullscreen viewer ---------- */
.janan-ugc-modal {
  position: fixed; inset: 0; z-index: 999999;
  display: none;
  width: 100%; height: 100%;
  align-items: center; justify-content: center;
  overscroll-behavior: none;
  font-family: inherit;
  color: #fff;
}
.janan-ugc-modal.is-open, .janan-ugc-modal:not([hidden]) { display: flex; }
.janan-ugc-modal-bg { position: absolute; inset: 0; background: rgba(5, 6, 8, .96); }
.janan-ugc-modal-stage {
  position: relative; z-index: 2;
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 14px 0 64px;
}
.janan-ugc-modal-frame {
  position: relative;
  width: min(100vw - 24px, 88vw);
  max-width: 440px;
  aspect-ratio: 9 / 16;
  max-height: 100%;
  overflow: hidden;
  border-radius: 14px;
  background: #0a0b0d;
  box-shadow: 0 18px 70px rgba(0, 0, 0, .6);
  touch-action: none;
}
.janan-ugc-modal-poster { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.janan-ugc-modal-video { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; object-fit: cover; background: transparent; }
.janan-ugc-modal-video::-webkit-media-controls { display: none !important; }

.janan-ugc-modal-progress { position: absolute; top: 0; left: 0; right: 0; z-index: 7; height: 3px; background: rgba(255,255,255,.18); pointer-events: none; }
.janan-ugc-modal-progress i { display: block; height: 100%; background: #fff; border-radius: 0 99px 99px 0; }

.janan-ugc-zone { position: absolute; top: 0; bottom: 0; z-index: 6; cursor: pointer; }
.jz-prev { left: 0; width: 27%; }
.jz-center { left: 27%; width: 46%; }
.jz-next { right: 0; width: 27%; }

.janan-ugc-modal-meta {
  position: absolute; left: 10px; right: 10px; bottom: 52px; z-index: 7;
  pointer-events: none;
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
}
.m-line1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.m-name { font-size: 14px; font-weight: 800; }
.m-stars { font-size: 12.5px; color: var(--ugc-star); letter-spacing: 1px; }
.m-line2 { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-size: 11.5px; color: rgba(255,255,255,.9); flex-wrap: wrap; }
.m-verified { display: inline-flex; align-items: center; gap: 4px; color: #4ade80; font-weight: 700; }
.m-verified svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.m-verified i { font-style: normal; }

.janan-ugc-modal-cta { position: absolute; left: 0; right: 0; bottom: 10px; z-index: 8; display: flex; justify-content: center; }
.m-cta {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 999px;
  background: #fff; color: #111;
  font-size: 13.5px; font-weight: 800;
  text-decoration: none;
  box-shadow: 0 6px 22px rgba(0,0,0,.4);
  max-width: 86%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.m-cta:active { transform: scale(.96); }

.janan-ugc-modal-error {
  position: absolute; inset: 0; z-index: 9;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; padding: 22px; text-align: center;
  background: rgba(10, 11, 13, .92);
  font-size: 13px; font-weight: 600;
}

.janan-ugc-modal-close, .janan-ugc-modal-prev, .janan-ugc-modal-next,
.janan-ugc-modal-play, .janan-ugc-modal-sound, .janan-ugc-modal-like, .janan-ugc-modal-share {
  position: absolute;
  width: 44px; height: 44px; min-width: 44px; min-height: 44px;
  padding: 0; margin: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(0, 0, 0, .62);
  color: #fff; cursor: pointer; z-index: 8;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .3);
  transition: background .12s ease, transform .12s ease;
}
.janan-ugc-modal-close svg, .janan-ugc-modal-prev svg, .janan-ugc-modal-next svg,
.janan-ugc-modal-play svg, .janan-ugc-modal-sound svg, .janan-ugc-modal-share svg, .janan-ugc-modal-like svg {
  width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.janan-ugc-modal-play svg { fill: currentColor; stroke: none; }
.janan-ugc-modal-close:hover, .janan-ugc-modal-prev:hover, .janan-ugc-modal-next:hover,
.janan-ugc-modal-play:hover, .janan-ugc-modal-sound:hover, .janan-ugc-modal-like:hover, .janan-ugc-modal-share:hover { background: rgba(0, 0, 0, .85); }
.janan-ugc-modal-close:active, .janan-ugc-modal-prev:active, .janan-ugc-modal-next:active { transform: scale(.92); }
.janan-ugc-modal-close:focus-visible, .janan-ugc-modal-prev:focus-visible, .janan-ugc-modal-next:focus-visible,
.janan-ugc-modal-play:focus-visible, .janan-ugc-modal-sound:focus-visible, .janan-ugc-modal-like:focus-visible, .janan-ugc-modal-share:focus-visible {
  outline: 2px solid #fff; outline-offset: 2px;
}

.janan-ugc-modal-close { top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right)); }
.janan-ugc-modal-count {
  position: absolute; top: max(14px, env(safe-area-inset-top)); left: max(14px, env(safe-area-inset-left));
  z-index: 8; padding: 5px 11px; border-radius: 999px;
  background: rgba(0, 0, 0, .55); font-size: 11.5px; font-weight: 700; letter-spacing: .3px;
}
.janan-ugc-modal-prev { left: max(8px, env(safe-area-inset-left)); top: 50%; transform: translateY(-50%); }
.janan-ugc-modal-next { right: max(8px, env(safe-area-inset-right)); top: 50%; transform: translateY(-50%); }
.janan-ugc-modal-controls {
  position: absolute;
  left: 50%; bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex; gap: 10px; z-index: 8;
}
.janan-ugc-modal-controls .janan-ugc-modal-play,
.janan-ugc-modal-controls .janan-ugc-modal-sound,
.janan-ugc-modal-controls .janan-ugc-modal-like,
.janan-ugc-modal-controls .janan-ugc-modal-share { position: static; }
.janan-ugc-modal-like.is-liked svg { fill: var(--ugc-like); stroke: var(--ugc-like); }
.janan-ugc-modal-like.is-liked { color: #fff; }

/* double-tap hearts */
.janan-ugc-hearts { position: absolute; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.ugc-heart { position: absolute; transform: translate(-50%, -50%); color: var(--ugc-like); animation: ugc-heart .9s ease-out forwards; }
.ugc-heart svg { width: 64px; height: 64px; fill: var(--ugc-like); stroke: var(--ugc-like); filter: drop-shadow(0 4px 14px rgba(244, 63, 94, .45)); }
@keyframes ugc-heart {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); }
  22% { opacity: 1; transform: translate(-50%, -50%) scale(1.25); }
  40% { transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -85%) scale(1.05); }
}

/* ---------- toast ---------- */
.janan-ugc-toast {
  position: fixed; left: 50%; bottom: 24px;
  transform: translate(-50%, 16px);
  z-index: 9999999;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(17, 18, 21, .95);
  color: #fff; font-size: 13px; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  max-width: 88vw;
  text-overflow: ellipsis; overflow: hidden; white-space: nowrap;
}
.janan-ugc-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

body.janan-ugc-lock { overflow: hidden; }

/* ---------- v9.0 TurboStream — GPU compositing & pressure discipline ----------
 * The <video> elements live on their own GPU layers: translateZ(0) promotes
 * them to composited layers, so browser/pinch zoom scales an already-
 * rasterized texture instead of re-rasterizing every frame (the classic
 * mobile zoom stutter). `will-change` is applied ONLY while playing — a
 * static will-change on a whole wall would burn GPU memory. Cards get
 * layout containment so playback never triggers ancestor reflow. */
.janan-ugc-video,
.janan-ugc-modal-video {
  transform: translateZ(0);
  backface-visibility: hidden;
}
.janan-ugc-card { contain: layout style; }
.janan-ugc-card.is-playing .janan-ugc-video { will-change: transform; }
.janan-ugc-modal-frame { transform: translateZ(0); }

/* progress fill: compositor-only transform — zero layout during playback */
.janan-ugc-modal-progress i {
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  will-change: transform;
}

/* dropped-frame pressure: shed decorative layers, keep the pixels flowing */
.janan-ugc-card.is-underpressure .janan-ugc-scrim { display: none; }
.janan-ugc-card.is-underpressure .janan-ugc-poster--ph { animation: none; }

/* ---------- v10.0 TurboPlayer — full player chrome ---------- */

/* card progress bar (thin, compositor-only) */
.janan-ugc-card-progress {
  position: absolute; z-index: 4;
  left: 8px; right: 8px; bottom: 0;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .18);
  overflow: hidden;
  pointer-events: none;
}
.janan-ugc-card-progress i {
  display: block; width: 100%; height: 100%;
  background: #fff;
  border-radius: 99px;
  transform-origin: 0 50%;
  transform: scaleX(0);
  will-change: transform;
}

/* modal adjustments when the full player is mounted */
.janan-ugc-modal.has-player .janan-ugc-modal-progress { display: none; }        /* real seek bar replaces it */
.janan-ugc-modal.has-player .janan-ugc-modal-play,
.janan-ugc-modal.has-player .janan-ugc-modal-sound { display: none; }           /* bar has play + volume */
.janan-ugc-modal.has-player .janan-ugc-modal-controls { gap: 12px; }
.janan-ugc-modal.has-player .janan-ugc-modal-meta { bottom: 62px; }
.janan-ugc-modal.has-player .janan-ugc-modal-cta { bottom: 104px; }

/* ---------- TurboPlayer UI layer ---------- */
.tp-ui {
  position: absolute; inset: 0; z-index: 12;
  pointer-events: none;                          /* children re-enable */
  font-variant-numeric: tabular-nums;
  -webkit-user-select: none; user-select: none;
}
.tp-ui *, .tp-ui *::before, .tp-ui *::after { box-sizing: border-box; }

.tp-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.42) 0, transparent 20%, transparent 52%, rgba(0,0,0,.68) 100%);
  opacity: 1;
  transition: opacity .25s ease;
}
.tp-ui:not(.tp-shown) .tp-shade { opacity: 0; }

/* center flash feedback */
.tp-center {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 68px; height: 68px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  opacity: 0;
  pointer-events: none;
}
.tp-center svg { width: 30px; height: 30px; fill: currentColor; }
.tp-center.is-on { animation: tp-flash .48s ease both; }
@keyframes tp-flash { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.7); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%,-50%) scale(1.15); } }

/* double-tap seek ripples */
.tp-ripple {
  position: absolute; top: 0; bottom: 0; width: 38%;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
}
.tp-ripple-l { left: 0; }
.tp-ripple-r { right: 0; }
.tp-ripple i {
  display: flex; align-items: center; gap: 6px;
  padding: 14px 18px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .6);
  color: #fff; font-style: normal; font-weight: 800; font-size: 15px;
}
.tp-ripple svg { width: 26px; height: 26px; fill: currentColor; }
.tp-ripple.is-on { animation: tp-ripple .5s ease both; }
@keyframes tp-ripple { 0% { opacity: 0; } 22% { opacity: 1; } 100% { opacity: 0; } }

/* buffering ring — nearly never visible (engine pre-buffers) */
.tp-spinner {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 52px; height: 52px;
  display: none;
  place-items: center;
  pointer-events: none;
}
.tp-ui.tp-buffering .tp-spinner { display: grid; }
.tp-spinner i {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 3.5px solid rgba(255, 255, 255, .22);
  border-top-color: #fff;
  animation: tp-spin .8s linear infinite;
}
@keyframes tp-spin { to { transform: rotate(360deg); } }

/* control bar */
.tp-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  pointer-events: auto;
  transform: translateY(0);
  transition: transform .25s ease, opacity .25s ease;
}
.tp-ui:not(.tp-shown) .tp-bar { transform: translateY(8px); opacity: 0; pointer-events: none; }

/* seek bar */
.tp-seek {
  position: relative;
  height: 26px;                                   /* fat touch target */
  display: flex; align-items: center;
  cursor: pointer;
  touch-action: none;
}
.tp-seek::before {                                /* the visible 4px track */
  content: "";
  position: absolute; left: 0; right: 0; height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .22);
}
.tp-buf, .tp-buf-hop { position: absolute; left: 0; right: 0; height: 4px; border-radius: 99px; overflow: hidden; }
.tp-buf i { position: absolute; top: 0; height: 100%; background: rgba(255, 255, 255, .42); }
.tp-fill {
  position: absolute; left: 0; right: 0; height: 4px;
  border-radius: 99px;
  background: #fff;
  transform-origin: 0 50%;
  transform: scaleX(0);
  will-change: transform;
}
.tp-thumb {
  position: absolute; right: -7px; top: 50%;
  width: 14px; height: 14px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .45);
  transition: transform .15s ease;
}
.tp-seek:hover .tp-thumb, .tp-seek:focus-visible .tp-thumb { transform: translateY(-50%) scale(1.25); }
.tp-seek:focus-visible { outline: 2px solid #fff; outline-offset: 4px; border-radius: 8px; }

.tp-bubble {
  position: absolute; bottom: 30px;
  transform: translateX(-50%);
  padding: 4px 9px;
  border-radius: 7px;
  background: rgba(12, 13, 16, .92);
  color: #fff; font-size: 12px; font-weight: 700;
  opacity: 0; pointer-events: none;
  white-space: nowrap;
}
.tp-bubble::after {
  content: ""; position: absolute; left: 50%; bottom: -4px;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom-width: 0;
  border-top-color: rgba(12, 13, 16, .92);
}

/* transport row */
.tp-row { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.tp-left, .tp-right { display: flex; align-items: center; gap: 2px; min-width: 0; }
.tp-btn {
  width: 42px; height: 42px; min-width: 42px;
  padding: 0; margin: 0; border: 0;
  border-radius: 50%;
  display: grid; place-items: center;
  background: transparent;
  color: #fff; cursor: pointer;
  font: inherit;
  transition: background .15s ease, transform .1s ease;
}
.tp-btn:hover { background: rgba(255, 255, 255, .14); }
.tp-btn:active { transform: scale(.9); }
.tp-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.tp-btn svg { width: 22px; height: 22px; fill: currentColor; }
.tp-play svg { width: 26px; height: 26px; }
.tp-rate { font-size: 13.5px; font-weight: 800; }
.tp-loop.is-on { color: #4ade80; }
.tp-loop.is-on::after {
  content: ""; position: absolute; inset: 8px;
  border-radius: 50%;
  background: rgba(74, 222, 128, .18);
}
.tp-time { font-size: 12.5px; font-weight: 700; color: #fff; margin-left: 4px; white-space: nowrap; }
.tp-time .tp-dur { color: rgba(255, 255, 255, .62); font-weight: 600; }

/* volume */
.tp-vol { display: flex; align-items: center; }
.tp-vol-slide {
  display: none;
  width: 0; overflow: hidden;
  align-items: center;
  transition: width .18s ease, opacity .18s ease;
  opacity: 0;
}
.tp-vol:hover .tp-vol-slide, .tp-vol-slide.is-drag {
  display: flex; width: 78px; opacity: 1; margin: 0 4px;
}
.tp-vol-slide i {
  position: relative;
  display: block; width: 100%; height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .28);
  cursor: pointer;
  touch-action: none;
}
.tp-vol-slide b {
  position: absolute; left: 0; top: 0; height: 100%;
  border-radius: 99px;
  background: #fff;
  transform-origin: 0 50%;
  transform: scaleX(1);
}

/* speed menu */
.tp-menu {
  position: absolute; right: 10px; bottom: 64px;
  min-width: 132px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(12, 13, 16, .94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 38px rgba(0, 0, 0, .5);
  pointer-events: auto;
  animation: tp-menu-in .16s ease both;
}
@keyframes tp-menu-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.tp-menu b { display: block; padding: 2px 8px 7px; font-size: 10.5px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: rgba(255, 255, 255, .55); }
.tp-menu-list { display: flex; flex-direction: column; gap: 1px; }
.tp-menu-item {
  border: 0; border-radius: 9px;
  padding: 9px 10px;
  background: transparent; color: #fff;
  font-size: 13.5px; font-weight: 700;
  text-align: left; cursor: pointer;
}
.tp-menu-item:hover { background: rgba(255, 255, 255, .12); }
.tp-menu-item.is-on { color: #4ade80; }
.tp-menu-item.is-on::after { content: " ✓"; }

/* zoom chip (gestures module) */
.tp-zoomchip {
  position: absolute; left: 50%; top: max(14px, env(safe-area-inset-top, 0px));
  transform: translateX(-50%);
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(12, 13, 16, .78);
  color: #fff; font-size: 12.5px; font-weight: 800;
  letter-spacing: .4px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 13;
}
.tp-zoomchip.is-on { opacity: 1; pointer-events: auto; }

/* touch devices: volume slider is a tap-and-hold popover target, keep simple */
.tp-ui.tp-touch .tp-vol-slide { display: none !important; }

/* compact (rail cards / embeds) */
.tp-ui.tp-compact .tp-time .tp-dur { display: none; }
.tp-ui.tp-compact .tp-loop, .tp-ui.tp-compact .tp-pip { display: none; }

/* motion & input ergonomics */
@media (hover: none) {
  .tp-btn { transition: none; }
  .tp-vol:hover .tp-vol-slide { display: none; width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .tp-bar, .tp-shade, .tp-center, .tp-ripple, .tp-menu, .tp-zoomchip { transition: none; animation: none !important; }
}

/* ---------- desktop ---------- */
@media (min-width: 768px) {
  .janan-ugc-wrap { --ugc-gap: 12px; --ugc-radius: 14px; --ugc-ctrl: 34px; }
  .janan-ugc-title { font-size: 20px; }
  .janan-ugc-sub { font-size: 13px; }
  .janan-ugc-card { flex-basis: calc((100% - (var(--ugc-gap) * 2)) / 3); width: calc((100% - (var(--ugc-gap) * 2)) / 3); }
  .janan-ugc-name { font-size: 13.5px; }
  .janan-ugc-meta-sub { font-size: 11.5px; }
  .janan-ugc-ctrl svg { width: 16px; height: 16px; }
  .janan-ugc-center-play { width: 52px; height: 52px; }
  .janan-ugc-center-play svg { width: 23px; height: 23px; }
  .janan-ugc-card { transition: transform .18s ease, box-shadow .18s ease; }
  .janan-ugc-wrap[data-layout="rail"] .janan-ugc-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0, 0, 0, .22); }
  .janan-ugc-modal-frame { width: auto; height: min(86vh, 860px); max-width: min(64vw, 470px); }
  @supports (height: 1dvh) { .janan-ugc-modal-frame { height: min(86dvh, 860px); } }
  .janan-ugc-modal-stage { padding: 20px 74px 74px; }
  .janan-ugc-wrap[data-layout="grid"] .janan-ugc-track { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* ~5 cols on desktop */ }
}
@media (min-width: 900px) {
  .janan-ugc-arrow { display: grid; }
}
@media (hover: none), (pointer: coarse) {
  .janan-ugc-arrow { display: none !important; }
}
@media (max-width: 379px) {
  .janan-ugc-wrap { --ugc-ctrl: 27px; --ugc-radius: 10px; }
  .janan-ugc-card { flex-basis: 78%; width: 78%; }
  .janan-ugc-center-play { width: 42px; height: 42px; }
}

/* ---------- motion & input ergonomics ---------- */
@media (hover: none) {
  .janan-ugc-ctrl, .janan-ugc-center-play, .janan-ugc-arrow,
  .janan-ugc-modal-close, .janan-ugc-modal-prev, .janan-ugc-modal-next,
  .janan-ugc-modal-play, .janan-ugc-modal-sound, .janan-ugc-modal-like, .janan-ugc-modal-share { transition: none; }
}
@media (prefers-reduced-motion: reduce) {
  .janan-ugc-card:not(.is-playing) .janan-ugc-center-play { animation: none; }
  .janan-ugc-card, .janan-ugc-ctrl, .janan-ugc-center-play, .janan-ugc-arrow,
  .janan-ugc-modal-close, .janan-ugc-modal-prev, .janan-ugc-modal-next,
  .janan-ugc-modal-play, .janan-ugc-modal-sound, .janan-ugc-modal-like, .janan-ugc-modal-share,
  .janan-ugc-toast { transition: none; }
  .janan-ugc-hint svg { animation: none; }   /* hint pill stays, motion removed */
  .ugc-heart { animation: none; display: none; }
}
