/* Clips feed. Immersive dark surface; the shop's primary colour drives accents. */
html, body { background: #050507 !important; }
body { overflow: hidden; overscroll-behavior: none; }

.cl-shell {
  --cl-accent: var(--primary, #2563eb);
  --cl-h: calc(100dvh - var(--header-h, 62px));
  --cl-btn: clamp(38px, 5.4vh, 46px);
  --cl-glass: rgba(18, 18, 24, .5);
  --cl-like: #fe2c55;
  --cl-save: #facc15;
  --cl-safe-b: env(safe-area-inset-bottom, 0px);
  --cl-safe-t: env(safe-area-inset-top, 0px);
  position: relative;
  height: var(--cl-h);
  color: #fff;
  background: #050507;
  font-feature-settings: "tnum" 1;
  -webkit-tap-highlight-color: transparent;
}
.cl-shell.is-fullscreen { --cl-h: 100vh; --cl-h: 100dvh; }

.cl-feed {
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
  outline: none;
}
.cl-feed::-webkit-scrollbar { display: none; }

.cl-slide {
  position: relative;
  height: var(--cl-h);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  background: #050507;
}
.cl-bg {
  position: absolute; top: -40px; right: -40px; bottom: -40px; left: -40px;
  background-size: cover; background-position: center;
  filter: blur(40px) brightness(.42) saturate(1.25);
  transform: scale(1.05);
}

/* Stage: the clip itself. Full screen on phones, a 9:16 card on desktop. */
.cl-stage {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  z-index: 2;
}
.cl-media {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  background: transparent;
}
.cl-media video, .cl-media iframe, .cl-media img {
  position: relative;
  width: 100%; height: 100%;
  object-fit: contain;
  border: 0;
  background: transparent;
}
.cl-media.is-landscape-embed iframe { width: 118%; height: 128%; }

.cl-gesture {
  position: absolute; top: 64px; right: 0; bottom: 0; left: 0;
  z-index: 3;
  touch-action: pan-y;
  cursor: pointer;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}

/* Feedback layers */
.cl-flash {
  position: absolute; top: 50%; left: 50%; z-index: 6;
  width: 84px; height: 84px; margin: -42px 0 0 -42px;
  border-radius: 999px; background: rgba(0, 0, 0, .45);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; opacity: 0; pointer-events: none;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.cl-flash.is-on { animation: clFlash .7s ease-out; }
@keyframes clFlash { 0% { opacity: 0; transform: scale(.7); } 20% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.25); } }

.cl-slide.is-paused .cl-stage::after,
.cl-slide.is-blocked .cl-stage::after {
  content: "\f04b";
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", sans-serif; font-weight: 900;
  position: absolute; top: 50%; left: 50%; z-index: 5;
  width: 78px; height: 78px; margin: -39px 0 0 -39px; padding-left: 6px;
  border-radius: 999px; background: rgba(0, 0, 0, .42);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: rgba(255, 255, 255, .95);
  pointer-events: none;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}

.cl-spinner {
  position: absolute; top: 50%; left: 50%; z-index: 5;
  width: 48px; height: 48px; margin: -24px 0 0 -24px;
  display: none; align-items: center; justify-content: center;
  font-size: 32px; color: rgba(255, 255, 255, .85); pointer-events: none;
}
.cl-slide.is-active.is-loading .cl-spinner { display: flex; }

.cl-dead {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 7;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .7rem;
  padding: 2rem; text-align: center; color: #e7e5e4; background: rgba(0, 0, 0, .72);
}
.cl-dead[hidden] { display: none; }
.cl-dead i { font-size: 32px; opacity: .55; }
.cl-dead p { font-size: 14px; margin: 0; }

.cl-heart {
  position: absolute; z-index: 8; pointer-events: none;
  font-size: 92px; line-height: 1;
  color: var(--cl-like);
  filter: drop-shadow(0 8px 24px rgba(254, 44, 85, .45));
  transform: translate(-50%, -50%) rotate(var(--tilt, 0deg)) scale(0);
  animation: clHeart .9s cubic-bezier(.2, .9, .3, 1.2) forwards;
}
@keyframes clHeart {
  0% { transform: translate(-50%, -50%) rotate(var(--tilt)) scale(0); opacity: 0; }
  18% { transform: translate(-50%, -50%) rotate(var(--tilt)) scale(1.15); opacity: 1; }
  32% { transform: translate(-50%, -50%) rotate(var(--tilt)) scale(.95); }
  70% { transform: translate(-50%, -60%) rotate(var(--tilt)) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -140%) rotate(var(--tilt)) scale(1.3); opacity: 0; }
}

/* Caption and author */
.cl-info {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 9;
  padding: 4rem calc(var(--cl-btn) + 1.5rem) calc(1.9rem + var(--cl-safe-b)) 1rem;
  background: linear-gradient(to top, rgba(0, 0, 0, .78) 0%, rgba(0, 0, 0, .35) 55%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
  transition: opacity .2s ease;
}
.cl-info > * { pointer-events: auto; }
.cl-author { display: flex; align-items: center; gap: .55rem; margin-bottom: .5rem; }
.cl-avatar {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: 999px;
  object-fit: cover; border: 2px solid rgba(255, 255, 255, .9);
  display: flex; align-items: center; justify-content: center;
  background: var(--cl-accent); color: #fff; font-weight: 800; font-size: 15px;
}
img.cl-avatar { background: #fff; }
.cl-handle { font-size: 14px; font-weight: 700; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.cl-title { margin: 0; font-size: 16px; line-height: 1.3; font-weight: 700; text-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.cl-caption {
  margin: .3rem 0 0; font-size: 13.5px; line-height: 1.45; color: rgba(255, 255, 255, .88);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cl-slide.is-expanded .cl-caption { -webkit-line-clamp: unset; display: block; max-height: 38vh; overflow-y: auto; }
.cl-more[hidden] { display: none; }
.cl-more {
  margin: .15rem 0 0; padding: 0; border: 0; background: none; cursor: pointer;
  color: #fff; font: inherit; font-size: 13px; font-weight: 700; opacity: .85;
}
.cl-more:hover { opacity: 1; text-decoration: underline; }
.cl-meta {
  margin: .55rem 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .9rem;
  font-size: 12px; color: rgba(255, 255, 255, .75);
}
.cl-meta i { font-size: 11px; margin-right: .2rem; }
.cl-audio { display: inline-flex; align-items: center; gap: .25rem; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cl-cta {
  margin-top: .8rem;
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .7rem 1.1rem .7rem 1rem; border-radius: 999px;
  background: var(--cl-accent); color: #fff; text-decoration: none;
  font-size: 14px; font-weight: 700;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
  transition: transform .15s ease, filter .15s ease;
}
.cl-cta:hover { transform: translateY(-1px); filter: brightness(1.08); }
.cl-cta-arrow { font-size: 12px; opacity: .85; transition: transform .15s ease; }
.cl-cta:hover .cl-cta-arrow { transform: translateX(3px); }

/* Right action rail */
.cl-rail {
  position: absolute; right: .55rem; bottom: calc(2.2rem + var(--cl-safe-b)); z-index: 10;
  display: flex; flex-direction: column; align-items: center; gap: .6rem;
  transition: opacity .2s ease;
}
.cl-act { display: flex; flex-direction: column; align-items: center; gap: .2rem; position: relative; }
.cl-round {
  width: var(--cl-btn); height: var(--cl-btn);
  border-radius: 999px; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--cl-glass); color: #fff;
  font-size: calc(var(--cl-btn) * .4);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.cl-round:hover { transform: scale(1.07); background: rgba(40, 40, 50, .65); }
.cl-round:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.cl-round.is-on { background: rgba(255, 255, 255, .92); color: #111; }
.cl-cnt { font-size: 11.5px; font-weight: 700; line-height: 1; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); min-height: 11px; }
.cl-act.is-on[data-act="like"] .cl-round { color: var(--cl-like); background: rgba(255, 255, 255, .95); }
.cl-act.is-on[data-act="save"] .cl-round { color: #111; background: var(--cl-save); }
.cl-act.is-pop .cl-round { animation: clPop .45s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes clPop { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }
.cl-speed .sp-speed-label { font-size: calc(var(--cl-btn) * .3); font-weight: 800; letter-spacing: -.01em; }
.cl-speed.is-active { background: var(--cl-accent); color: #fff; }

/* Seek strip along the bottom of the clip */
.cl-seek {
  position: absolute; left: 0; right: 0; bottom: var(--cl-safe-b); z-index: 11;
}
.cl-seek .sp-seek--feed { --sp-accent: #fff; }
.cl-seek .sp-seek-fill { background: #fff; }
.cl-seek .sp-seek-track { background: rgba(255, 255, 255, .25); }
.cl-slide.is-scrubbing .cl-info, .cl-slide.is-scrubbing .cl-rail { opacity: 0; pointer-events: none; }

/* Speed menu inside a slide */
.cl-stage .sp-speed-menu { right: calc(var(--cl-btn) + 1.3rem); bottom: calc(2.4rem + var(--cl-safe-b)); }

/* Fixed chrome */
.cl-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(.75rem + var(--cl-safe-t)) .75rem .75rem;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .45), rgba(0, 0, 0, 0));
}
.cl-top > * { pointer-events: auto; }
.cl-brand {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .5rem .85rem; border-radius: 999px;
  background: var(--cl-glass); color: #fff; text-decoration: none;
  font-size: 15px; font-weight: 800; letter-spacing: .01em;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.cl-brand i { font-size: 13px; opacity: .85; }
.cl-brand:hover { background: rgba(40, 40, 50, .7); }
.cl-top-right { display: flex; gap: .5rem; }
.cl-chip {
  width: 40px; height: 40px; border-radius: 999px; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--cl-glass); color: #fff; text-decoration: none; font-size: 17px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.cl-chip:hover { background: rgba(40, 40, 50, .7); }
.cl-keys-btn { display: none; }
.cl-shell.is-pointer .cl-keys-btn { display: inline-flex; }

.cl-nav {
  position: absolute; right: 1.25rem; top: 50%; z-index: 20;
  transform: translateY(-50%);
  display: none; flex-direction: column; align-items: center; gap: .6rem;
}
.cl-shell.is-pointer .cl-nav { display: flex; }
.cl-nav-btn {
  width: 48px; height: 48px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .1); color: #fff; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: background .15s ease, transform .15s ease, opacity .15s ease;
}
.cl-nav-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .22); transform: scale(1.06); }
.cl-nav-btn:disabled { opacity: .3; cursor: default; }
.cl-nav-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.cl-nav-count { font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, .7); min-height: 1em; }

.cl-toast {
  position: absolute; left: 50%; bottom: calc(6rem + var(--cl-safe-b)); z-index: 40;
  transform: translate(-50%, 8px);
  max-width: calc(100% - 2rem);
  padding: .6rem 1rem; border-radius: 999px;
  background: rgba(18, 18, 24, .9); color: #fff;
  font-size: 13px; font-weight: 600; text-align: center;
  opacity: 0; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.cl-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.cl-boost {
  position: absolute; top: calc(4.5rem + var(--cl-safe-t)); left: 50%; z-index: 40;
  transform: translate(-50%, -6px);
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .45rem .9rem; border-radius: 999px;
  background: rgba(18, 18, 24, .82); color: #fff; font-size: 13px; font-weight: 800;
  opacity: 0; pointer-events: none; transition: opacity .15s ease, transform .15s ease;
}
.cl-boost.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Comments: bottom sheet on phones, side panel on desktop */
.cl-sheet-back {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 60;
  background: rgba(0, 0, 0, .5);
}
.cl-sheet-back[hidden], .cl-sheet[hidden] { display: none; }
.cl-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
  max-height: 72vh; max-height: 72dvh;
  display: flex; flex-direction: column;
  background: #15151b; color: #f4f4f5;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -18px 50px rgba(0, 0, 0, .5);
  animation: clSheet .26s cubic-bezier(.16, 1, .3, 1);
}
@keyframes clSheet { from { transform: translateY(40%); opacity: 0; } to { transform: none; opacity: 1; } }
.cl-sheet-head {
  position: relative; display: flex; align-items: center; justify-content: center;
  padding: 1.1rem 3.5rem .8rem; border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.cl-sheet-grip { position: absolute; top: 7px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 4px; background: rgba(255, 255, 255, .2); }
.cl-sheet-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.cl-sheet-n { color: rgba(255, 255, 255, .55); font-weight: 600; margin-left: .25rem; }
.cl-sheet-x {
  position: absolute; right: .75rem; top: 50%; margin-top: -17px;
  width: 34px; height: 34px; border-radius: 999px; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .08); color: #fff;
}
.cl-sheet-list { flex: 1; overflow-y: auto; padding: .5rem 1rem; overscroll-behavior: contain; min-height: 120px; }
.cl-sheet-empty { text-align: center; color: rgba(255, 255, 255, .55); font-size: 14px; padding: 2.2rem 1rem; margin: 0; }
.cl-comment { display: flex; gap: .7rem; padding: .7rem 0; }
.cl-comment + .cl-comment { border-top: 1px solid rgba(255, 255, 255, .06); }
.cl-comment-av {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  background: var(--cl-accent); color: #fff; font-weight: 800; font-size: 14px;
}
.cl-comment-head { margin: 0; display: flex; align-items: baseline; gap: .5rem; font-size: 13px; }
.cl-comment-head span { font-size: 11.5px; color: rgba(255, 255, 255, .5); }
.cl-comment-body { margin: .2rem 0 0; font-size: 14px; line-height: 1.45; color: rgba(255, 255, 255, .9); white-space: pre-line; word-wrap: break-word; }
.cl-sheet-form { padding: .75rem 1rem calc(.9rem + var(--cl-safe-b)); border-top: 1px solid rgba(255, 255, 255, .08); }
.cl-sheet-who { display: flex; gap: .5rem; margin-bottom: .5rem; }
.cl-sheet-form.is-known .cl-sheet-who { display: none; }
.cl-sheet-row { display: flex; gap: .5rem; align-items: flex-end; }
.cl-sheet-form input, .cl-sheet-form textarea {
  width: 100%; min-width: 0; box-sizing: border-box;
  padding: .7rem .9rem; border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .06); color: #fff;
  font: inherit; font-size: 14px; outline: none;
}
.cl-sheet-form textarea { resize: none; line-height: 1.4; max-height: 120px; }
.cl-sheet-form input::placeholder, .cl-sheet-form textarea::placeholder { color: rgba(255, 255, 255, .45); }
.cl-sheet-form input:focus, .cl-sheet-form textarea:focus { border-color: var(--cl-accent); background: rgba(255, 255, 255, .09); }
.cl-sheet-send {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--cl-accent); color: #fff; font-size: 15px;
}
.cl-sheet-send:disabled { opacity: .5; cursor: default; }
.cl-sheet-msg { margin: .45rem .2rem 0; font-size: 12.5px; color: #86efac; min-height: 0; }
.cl-sheet-msg:empty { display: none; }
.cl-sheet-msg.is-error { color: #fca5a5; }

/* Shortcuts dialog */
.cl-keys {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.cl-keys[hidden] { display: none; }
.cl-keys-card {
  width: 100%; max-width: 380px; padding: 1.4rem 1.4rem 1.2rem;
  border-radius: 20px; background: #15151b; color: #f4f4f5;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.cl-keys-card h3 { margin: 0 0 1rem; font-size: 16px; font-weight: 800; }
.cl-keys-card dl { display: grid; grid-template-columns: auto 1fr; gap: .6rem 1rem; margin: 0; align-items: center; }
.cl-keys-card dt { white-space: nowrap; }
.cl-keys-card dd { margin: 0; font-size: 13.5px; color: rgba(255, 255, 255, .8); }
.cl-keys-card kbd {
  display: inline-block; min-width: 26px; padding: .2rem .45rem; border-radius: 7px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14);
  font: 700 12px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; text-align: center; color: #fff;
}
.cl-keys-ok {
  margin-top: 1.2rem; width: 100%; padding: .75rem; border-radius: 12px; border: 0; cursor: pointer;
  background: var(--cl-accent); color: #fff; font: inherit; font-weight: 700;
}

/* Empty feed */
.cl-slide--empty { background: radial-gradient(120% 80% at 50% 0%, #1d1d26 0%, #050507 70%); }
.cl-empty { text-align: center; padding: 2rem; max-width: 360px; }
.cl-empty-icon {
  display: inline-flex; width: 76px; height: 76px; border-radius: 24px; margin-bottom: 1.2rem;
  align-items: center; justify-content: center; font-size: 30px;
  background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .8);
}
.cl-empty h1 { font-size: 22px; font-weight: 800; margin: 0 0 .4rem; }
.cl-empty p { font-size: 14px; color: rgba(255, 255, 255, .65); margin: 0 0 1.5rem; }
.cl-empty-btn { display: inline-block; padding: .75rem 1.4rem; border-radius: 999px; background: #fff; color: #111; font-weight: 700; text-decoration: none; }

/* Desktop: the clip becomes a card with the rail beside it */
@media (min-width: 900px) and (min-height: 560px) {
  .cl-stage {
    position: relative; top: auto; right: auto; bottom: auto; left: auto;
    height: calc(100% - 2.5rem);
    aspect-ratio: 9 / 16;
    max-width: calc(100vw - 260px);
  }
  .cl-slide.is-landscape .cl-stage { aspect-ratio: 16 / 9; height: auto; width: min(calc(100vw - 380px), calc((var(--cl-h) - 2.5rem) * 16 / 9), 1180px); margin-right: 60px; }
  .cl-media { border-radius: 22px; background: #000; box-shadow: 0 30px 80px rgba(0, 0, 0, .55); }
  .cl-media.is-landscape-embed iframe { width: 100%; height: 100%; }
  .cl-gesture { top: 0; border-radius: 22px; }
  .cl-info { border-radius: 0 0 22px 22px; padding-right: 1.25rem; padding-left: 1.25rem; }
  .cl-seek { bottom: 0; }
  .cl-seek .sp-seek--feed { padding: 0 16px; }
  .cl-rail { right: auto; left: calc(100% + 1rem); bottom: .5rem; gap: .75rem; }
  .cl-stage .sp-speed-menu { right: auto; left: calc(100% + var(--cl-btn) + 1.8rem); bottom: .5rem; }
  .cl-sheet {
    top: 0; left: auto; right: 0; bottom: 0; width: 400px; max-height: none;
    border-radius: 22px 0 0 22px;
    animation-name: clSheetSide;
  }
  .cl-sheet-grip { display: none; }
  .cl-toast { bottom: 2rem; }
}
@keyframes clSheetSide { from { transform: translateX(30%); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-height: 640px) {
  .cl-shell { --cl-btn: 36px; }
  .cl-rail { gap: .4rem; }
  .cl-cnt { font-size: 10.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .cl-shell *, .cl-sheet, .cl-keys { animation: none !important; transition: none !important; }
  .cl-feed { scroll-behavior: auto; }
}
