/* ============================================================
   FoxChats Social Promo — скины оверлеев (общие для OBS и кабинета)
   Состояния на корне .sp:  .is-enter → +.is-idle → +.is-finale → .is-exit
   Переменные: --sp-accent, --sp-accent2, --sp-enter, --sp-exit,
               --sp-step, --sp-reveal, --sp-duration
   ============================================================ */

.sp {
  --sp-ink: #ffffff;
  --sp-ink-dim: rgba(255, 255, 255, .72);
  --sp-plate: rgba(12, 11, 18, .82);
  --sp-plate-line: rgba(255, 255, 255, .14);
  --sp-shadow: 0 10px 30px rgba(0, 0, 0, .35), 0 2px 8px rgba(0, 0, 0, .3);
  position: relative;
  display: inline-flex;
  font-family: "Manrope", "Inter", system-ui, sans-serif;
  color: var(--sp-ink);
  line-height: 1.25;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Слот позиции: без transform, чтобы масштаб и enter-анимация не дрались
   и виджет не «шатало» при ресайзе Browser Source в OBS. */
.sp-slot {
  position: absolute;
  display: flex;
  --sp-safe: 56px;
  --sp-safe-x: var(--sp-safe);
  --sp-safe-y: var(--sp-safe);
  --sp-ox: 0px;
  --sp-oy: 0px;
}
.sp-slot.pos-top-left { top: calc(var(--sp-safe-y) + var(--sp-oy)); left: calc(var(--sp-safe-x) + var(--sp-ox)); }
.sp-slot.pos-top-right { top: calc(var(--sp-safe-y) + var(--sp-oy)); right: calc(var(--sp-safe-x) - var(--sp-ox)); justify-content: flex-end; }
.sp-slot.pos-bottom-left { bottom: calc(var(--sp-safe-y) - var(--sp-oy)); left: calc(var(--sp-safe-x) + var(--sp-ox)); align-items: flex-end; }
.sp-slot.pos-bottom-right { bottom: calc(var(--sp-safe-y) - var(--sp-oy)); right: calc(var(--sp-safe-x) - var(--sp-ox)); justify-content: flex-end; align-items: flex-end; }
.sp-slot.pos-top-center {
  top: calc(var(--sp-safe-y) + var(--sp-oy));
  left: 0;
  right: 0;
  justify-content: center;
}
.sp-slot.pos-bottom-center {
  bottom: calc(var(--sp-safe-y) - var(--sp-oy));
  left: 0;
  right: 0;
  justify-content: center;
  align-items: flex-end;
}
.sp-slot.pos-middle-left {
  top: 0;
  bottom: 0;
  left: calc(var(--sp-safe-x) + var(--sp-ox));
  align-items: center;
}
.sp-slot.pos-middle-right {
  top: 0;
  bottom: 0;
  right: calc(var(--sp-safe-x) - var(--sp-ox));
  align-items: center;
  justify-content: flex-end;
}
.sp-slot.pos-top-center > .sp-scale,
.sp-slot.pos-bottom-center > .sp-scale { left: var(--sp-ox); }
.sp-slot.pos-middle-left > .sp-scale,
.sp-slot.pos-middle-right > .sp-scale { top: var(--sp-oy); }

/* Коробка = видимый размер. Scale только на внутреннем слое, origin top left.
   Иначе transform-scale не меняет лейаут: анимация едет «снизу», пружина
   выбрасывает визуал вверх, overflow обрезает, потом прыжок на место коробки. */
.sp-scale {
  display: block;
  position: relative;
  flex: 0 0 auto;
  overflow: visible;
}
.sp-scale-inner {
  position: absolute;
  left: 0;
  top: 0;
  transform: scale(var(--sp-zoom, 1));
  transform-origin: top left;
}

/* Внутренний слой всегда растёт внутрь сцены от выбранного якоря. Размер
   внешней коробки может уточниться после загрузки шрифта, но якорь не скачет. */
.sp-slot.pos-top-right .sp-scale-inner { left: auto; right: 0; transform-origin: top right; }
.sp-slot.pos-bottom-left .sp-scale-inner { top: auto; bottom: 0; transform-origin: bottom left; }
.sp-slot.pos-bottom-right .sp-scale-inner { inset: auto 0 0 auto; transform-origin: bottom right; }
.sp-slot.pos-top-center .sp-scale-inner {
  left: 50%;
  transform: translateX(-50%) scale(var(--sp-zoom, 1));
  transform-origin: top center;
}
.sp-slot.pos-bottom-center .sp-scale-inner {
  left: 50%;
  top: auto;
  bottom: 0;
  transform: translateX(-50%) scale(var(--sp-zoom, 1));
  transform-origin: bottom center;
}
.sp-slot.pos-middle-left .sp-scale-inner {
  top: 50%;
  transform: translateY(-50%) scale(var(--sp-zoom, 1));
  transform-origin: center left;
}
.sp-slot.pos-middle-right .sp-scale-inner {
  inset: 50% 0 auto auto;
  transform: translateY(-50%) scale(var(--sp-zoom, 1));
  transform-origin: center right;
}

.sp-url {
  display: block;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--sp-ink-dim);
  letter-spacing: .15px;
  opacity: .92;
  font-style: normal;
  text-decoration: none;
}

.sp * { box-sizing: border-box; }
.sp b, .sp strong { font-weight: 750; }
.sp img { display: block; }

/* Появление только прозрачностью — без translate/scale на корне.
   Сдвиг + пружина cubic-bezier(..., 1.45, ...) телепортировали виджет. */
.sp { opacity: 0; }
.sp.is-enter { animation: sp-root-in var(--sp-enter, .72s) ease-out forwards; }
.sp.is-idle:not(.is-exit) { opacity: 1; }
.sp.is-exit { animation: sp-root-out var(--sp-exit, .52s) ease-in forwards; }

@keyframes sp-root-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sp-root-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

.sp.is-idle:not(.is-exit)::before { content: ""; position: absolute; inset: 0; pointer-events: none; }
.sp.is-idle:not(.is-exit) > * { animation-play-state: running; }

.sp-thumb-frozen, .sp-thumb-frozen * {
  animation-duration: .01s !important;
  animation-delay: 0s !important;
  animation-iteration-count: 1 !important;
  transition: none !important;
}
.sp.sp-thumb-frozen { opacity: 1 !important; }
.sp.sp-thumb-frozen .sp-mask > *,
.sp.sp-thumb-frozen .sp-kword i { opacity: 1 !important; transform: none !important; }
.sp.sp-thumb-frozen.is-confirmed .sp-action-idle,
.sp.sp-thumb-frozen.is-confirmed .sp-status-word b { opacity: 0 !important; visibility: hidden !important; }
.sp.sp-thumb-frozen.is-confirmed .sp-action-done,
.sp.sp-thumb-frozen.is-confirmed .sp-status-word strong { opacity: 1 !important; visibility: visible !important; transform: none !important; }
.sp.sp-thumb-frozen .sp-action-cursor { display: none !important; }

/* Детерминированное состояние только для layout-измерения. В отличие от
   duration:.01s оно не зависит от того, успел ли Chromium сделать кадр. */
.sp.sp-measure, .sp.sp-measure * {
  animation: none !important;
  transition: none !important;
}
.sp.sp-measure { opacity: 1 !important; }
.sp.sp-measure .sp-mask,
.sp.sp-thumb-frozen .sp-mask { width: max-content !important; max-width: none !important; }
.sp.sp-measure .sp-pill { max-width: 460px !important; }
.sp.sp-measure .sp-ttpulse { max-width: 440px !important; }
.sp.sp-measure .sp-twheart-panel {
  max-width: 420px !important;
  padding-left: 16px !important;
  padding-right: 16px !important;
  opacity: 1 !important;
}
.sp.sp-measure .sp-tgqreveal-drawer { max-width: 480px !important; opacity: 1 !important; }
.sp.sp-measure .sp-ytmorph-body,
.sp.sp-measure .sp-twheartmorph-body,
.sp.sp-measure .sp-ttfloating-body,
.sp.sp-measure .sp-tgqrmorph-drawer,
.sp.sp-measure .sp-tgmessageqr-drawer { max-width: 520px !important; opacity: 1 !important; transform: none !important; }
.sp.sp-measure .sp-ytmorph-body,
.sp.sp-measure .sp-twheartmorph-body,
.sp.sp-measure .sp-ttfloating-body {
  padding-left: 16px !important;
  padding-right: 16px !important;
  border-color: var(--sp-plate-line) !important;
}
.sp.sp-measure .sp-edge-copy { max-width: 300px !important; opacity: 1 !important; padding-right: 14px !important; }
.sp.sp-thumb-frozen .sp-pill { max-width: 460px !important; }
.sp.sp-thumb-frozen .sp-ttpulse { max-width: 440px !important; }
.sp.sp-thumb-frozen .sp-twheart-panel {
  max-width: 420px !important;
  padding-left: 16px !important;
  padding-right: 16px !important;
  opacity: 1 !important;
}
.sp.sp-thumb-frozen .sp-tgqreveal-drawer,
.sp.sp-thumb-frozen .sp-tgqrmorph-drawer,
.sp.sp-thumb-frozen .sp-tgmessageqr-drawer { max-width: 480px !important; opacity: 1 !important; }
.sp.sp-thumb-frozen .sp-ytmorph-body,
.sp.sp-thumb-frozen .sp-twheartmorph-body,
.sp.sp-thumb-frozen .sp-ttfloating-body {
  max-width: 520px !important;
  opacity: 1 !important;
  transform: none !important;
  padding-left: 16px !important;
  padding-right: 16px !important;
  border-color: var(--sp-plate-line) !important;
}
.sp.is-clean { opacity: 0 !important; pointer-events: none !important; }

/* Общие атомы */
.sp-mask { display: block; overflow: hidden; }
.sp-mask > * { display: block; transform: translateY(110%); }
.sp.is-enter .sp-mask > * { animation: sp-mask-up .55s cubic-bezier(.2, .9, .25, 1) forwards; animation-delay: calc(var(--sp-step, .15s) * 1); }
.sp.is-enter .sp-mask.is-second > * { animation-delay: calc(var(--sp-step, .15s) * 2.2); }
.sp.is-enter .sp-mask.is-third > * { animation-delay: calc(var(--sp-step, .15s) * 3.2); }
.sp.is-enter .sp-mask.is-fourth > * { animation-delay: calc(var(--sp-step, .15s) * 4); }
.sp.is-exit .sp-mask > * { animation: sp-mask-down .3s ease forwards; }

@keyframes sp-mask-up { from { transform: translateY(110%); } to { transform: translateY(0); } }
@keyframes sp-mask-down { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-90%); opacity: 0; } }

.sp-pulse-ring {
  position: absolute;
  inset: -4px;
  border: 1.5px solid var(--sp-accent);
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
}
.sp.is-enter .sp-pulse-ring { animation: sp-pulse 1s ease-out .1s; }
.sp.is-idle .sp-pulse-ring { animation: sp-pulse 3.4s ease-out 1.2s infinite; }

@keyframes sp-pulse {
  0% { opacity: .8; transform: scale(.7); }
  70% { opacity: 0; transform: scale(1.5); }
  100% { opacity: 0; transform: scale(1.5); }
}

.sp-qr {
  display: grid;
  place-items: center;
  background: #fff;
  border-radius: 12px;
  padding: 7px;
  box-shadow: var(--sp-shadow);
}
.sp-qr img { width: 100%; height: 100%; }
.sp-qr.is-sm { width: 92px; height: 92px; }
.sp-qr.is-md { width: 120px; height: 120px; }
.sp-qr.is-lg { width: 156px; height: 156px; }

.sp-avatar-fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--sp-accent), #6e5cff);
  color: #fff;
  font-weight: 800;
}

/* ============ Пилюля (общая база: TG 1 и TW 1) ============ */
.sp-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 10px 10px;
  background: var(--sp-plate);
  border: 1px solid var(--sp-plate-line);
  border-radius: 999px;
  box-shadow: var(--sp-shadow);
  backdrop-filter: blur(6px);
  max-width: 60px;
  overflow: hidden;
  white-space: nowrap;
}
.sp-tg-pill.is-enter .sp-pill { animation: sp-pill-grow .6s cubic-bezier(.3, .9, .3, 1) calc(var(--sp-step) * 1.4) forwards; }
.sp-tg-pill.is-idle .sp-pill, .sp-tg-pill.is-finale .sp-pill { max-width: 460px; }
.sp-tg-pill.is-exit .sp-pill { animation: sp-pill-shrink .45s ease-in forwards; }

@keyframes sp-pill-grow { from { max-width: 60px; } to { max-width: 460px; } }
@keyframes sp-pill-shrink { from { max-width: 460px; opacity: 1; } to { max-width: 56px; opacity: 0; } }

.sp-pill-icon { position: relative; width: 40px; height: 40px; flex: 0 0 auto; }
.sp-pill-icon svg { width: 100%; height: 100%; }
.sp-tg-pill.is-enter .sp-pill-icon { animation: sp-icon-pop .55s cubic-bezier(.34, 1.6, .45, 1) both; }

@keyframes sp-icon-pop {
  0% { transform: scale(0); }
  70% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.sp-pill-body { display: grid; gap: 1px; min-width: 0; }
.sp-pill-body b { font-size: 17px; }
.sp-pill-body small { font-size: 13px; color: var(--sp-ink-dim); }
.sp-pill-arrow { width: 20px; height: 20px; color: var(--sp-accent); flex: 0 0 auto; }
.sp-pill-arrow svg { width: 100%; height: 100%; }
.sp-tg-pill.is-idle .sp-pill-arrow { animation: sp-nudge 2.6s ease-in-out 1.4s infinite; }

@keyframes sp-nudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

/* ============ TG 2 · QR Reveal ============ */
.sp-tg-qr-reveal .sp-qrcard {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--sp-plate);
  border: 1px solid var(--sp-plate-line);
  border-radius: 18px;
  box-shadow: var(--sp-shadow);
  backdrop-filter: blur(6px);
  overflow: hidden;
}
.sp-qrcard-main { display: flex; align-items: center; gap: 13px; padding: 16px 18px; }
.sp-qrcard-icon { width: 44px; height: 44px; flex: 0 0 auto; }
.sp-qrcard-icon svg { width: 100%; height: 100%; }
.sp-tg-qr-reveal.is-enter .sp-qrcard-icon { animation: sp-icon-pop .55s cubic-bezier(.34, 1.6, .45, 1) both; }
.sp-qrcard-copy { display: grid; gap: 2px; }
.sp-qrcard-copy b { font-size: 16.5px; }
.sp-qrcard-copy small { font-size: 13.5px; color: var(--sp-ink-dim); font-weight: 650; }
.sp-qrcard-copy em { font-style: normal; font-size: 12px; color: var(--sp-accent); font-weight: 750; letter-spacing: .4px; text-transform: uppercase; }
.sp-qrcard-copy u { text-decoration: none; font-size: 12px; color: var(--sp-ink-dim); }

.sp-qrcard-qr {
  margin: 12px 12px 12px 0;
  flex: 0 0 auto;
  clip-path: inset(0 100% 0 0 round 12px);
  transform: scale(.86);
  opacity: 0;
}
.sp-tg-qr-reveal.is-enter .sp-qrcard-qr {
  animation: sp-qr-open .7s cubic-bezier(.25, .9, .3, 1) calc(var(--sp-reveal, .9s)) forwards;
}
.sp-tg-qr-reveal.is-exit .sp-qrcard-qr { animation: sp-qr-close .4s ease-in forwards; }
.sp-tg-qr-reveal.is-exit .sp-qrcard { animation: sp-root-out .4s ease-in .28s forwards; }
.sp-tg-qr-reveal.is-exit { animation-delay: .25s; }

@keyframes sp-qr-open {
  from { clip-path: inset(0 100% 0 0 round 12px); transform: scale(.86); opacity: 0; }
  to { clip-path: inset(0 0 0 0 round 12px); transform: scale(1); opacity: 1; }
}
@keyframes sp-qr-close {
  from { clip-path: inset(0 0 0 0 round 12px); opacity: 1; }
  to { clip-path: inset(0 100% 0 0 round 12px); opacity: 0; }
}

/* ============ TG 3 · Сообщение ============ */
.sp-tg-message .sp-bubble { display: flex; align-items: flex-end; gap: 10px; }
.sp-bubble-avatar { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 50%; overflow: hidden; box-shadow: var(--sp-shadow); }
.sp-bubble-img { width: 100%; height: 100%; object-fit: cover; }
.sp-tg-message.is-enter .sp-bubble-avatar { animation: sp-icon-pop .5s cubic-bezier(.34, 1.6, .45, 1) both; }
.sp-bubble-card {
  position: relative;
  min-width: 210px;
  max-width: 360px;
  padding: 11px 15px 12px;
  background: var(--sp-plate);
  border: 1px solid var(--sp-plate-line);
  border-radius: 16px 16px 16px 5px;
  box-shadow: var(--sp-shadow);
  backdrop-filter: blur(6px);
}
.sp-tg-message.is-enter .sp-bubble-card { animation: sp-bubble-in .5s cubic-bezier(.3, 1.3, .4, 1) calc(var(--sp-step) * 1.6) both; }

@keyframes sp-bubble-in {
  from { opacity: 0; transform: translateY(8px) scale(.9); transform-origin: bottom left; }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.sp-bubble-name { display: block; font-size: 12px; font-weight: 800; color: var(--sp-accent); margin-bottom: 3px; }
.sp-bubble-typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.sp-bubble-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--sp-ink-dim); animation: sp-typing 1s ease-in-out infinite; }
.sp-bubble-typing i:nth-child(2) { animation-delay: .16s; }
.sp-bubble-typing i:nth-child(3) { animation-delay: .32s; }

@keyframes sp-typing {
  0%, 100% { transform: translateY(0); opacity: .5; }
  40% { transform: translateY(-4px); opacity: 1; }
}

.sp-bubble-text, .sp-bubble-link { display: none; }
.sp-bubble-text { font-size: 15px; font-weight: 650; }
.sp-bubble-link { margin-top: 4px; font-size: 13px; color: var(--sp-accent); font-weight: 700; }
/* после «печатает…» показываем текст */
.sp-tg-message.is-content-ready .sp-bubble-typing, .sp-tg-message.is-idle .sp-bubble-typing, .sp-tg-message.is-finale .sp-bubble-typing, .sp-tg-message.is-exit .sp-bubble-typing { display: none; }
.sp-tg-message.is-content-ready .sp-bubble-text, .sp-tg-message.is-idle .sp-bubble-text, .sp-tg-message.is-finale .sp-bubble-text, .sp-tg-message.is-exit .sp-bubble-text { display: block; animation: sp-fade-in .35s ease both; }
.sp-tg-message.is-content-ready .sp-bubble-link, .sp-tg-message.is-idle .sp-bubble-link, .sp-tg-message.is-finale .sp-bubble-link, .sp-tg-message.is-exit .sp-bubble-link { display: block; animation: sp-fade-in .35s ease .12s both; }

@keyframes sp-fade-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }

.sp-bubble-tail { position: absolute; left: -5px; bottom: 0; width: 12px; height: 12px; background: var(--sp-plate); border-left: 1px solid var(--sp-plate-line); border-bottom: 1px solid var(--sp-plate-line); border-radius: 0 0 0 10px; transform: skewX(18deg); }

/* ============ TG 4 · QR-маяк ============ */
.sp-tg-beacon .sp-beacon { display: grid; justify-items: center; gap: 0; }
.sp-beacon-icon { width: 36px; height: 36px; }
.sp-beacon-icon svg { width: 100%; height: 100%; }
.sp-tg-beacon.is-enter .sp-beacon-icon { animation: sp-icon-pop .5s cubic-bezier(.34, 1.6, .45, 1) both; }
.sp-beacon-line { width: 1.5px; height: 26px; background: linear-gradient(180deg, var(--sp-accent), transparent 90%); transform: scaleY(0); transform-origin: top; margin: 6px 0; }
.sp-tg-beacon.is-enter .sp-beacon-line { animation: sp-line-draw .45s ease-out calc(var(--sp-step) * 2.4) forwards; }

@keyframes sp-line-draw { to { transform: scaleY(1); } }

.sp-beacon-qr { opacity: 0; transform: scale(.8); }
.sp-tg-beacon.is-enter .sp-beacon-qr { animation: sp-scale-in .5s cubic-bezier(.3, 1.2, .4, 1) calc(var(--sp-step) * 3.6) forwards; }

@keyframes sp-scale-in { to { opacity: 1; transform: scale(1); } }

.sp-beacon-label { margin-top: 8px; display: grid; justify-items: center; gap: 1px; text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }
.sp-beacon-label b { font-size: 14px; }
.sp-beacon-label small { font-size: 12.5px; color: var(--sp-ink-dim); }
.sp-tg-beacon.is-enter .sp-beacon-label { opacity: 0; animation: sp-fade-in .4s ease calc(var(--sp-step) * 4.6) forwards; }
.sp-tg-beacon.is-exit .sp-beacon-qr { animation: sp-qr-close .35s ease-in forwards; }

/* ============ TG 5 · Стеклянная карта ============ */
.sp-tg-glass .sp-glass { position: relative; display: flex; align-items: center; }
.sp-glass-card {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 20px;
  background: linear-gradient(150deg, rgba(28, 26, 40, .84), rgba(14, 13, 22, .87));
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 16px;
  box-shadow: var(--sp-shadow), inset 0 1px 0 rgba(255, 255, 255, .1);
  backdrop-filter: blur(9px);
  overflow: hidden;
}
.sp-glass-icon { width: 42px; height: 42px; flex: 0 0 auto; filter: drop-shadow(0 3px 8px rgba(42, 171, 238, .4)); }
.sp-glass-icon svg { width: 100%; height: 100%; }
.sp-tg-glass.is-enter .sp-glass-icon { animation: sp-icon-pop .55s cubic-bezier(.34, 1.6, .45, 1) .1s both; }
.sp-glass-copy { display: grid; gap: 2px; }
.sp-glass-copy b { font-size: 16.5px; }
.sp-glass-copy small { font-size: 13.5px; color: var(--sp-ink-dim); font-weight: 650; }
.sp-glass-copy u { text-decoration: none; font-size: 12px; color: var(--sp-accent); font-weight: 700; }
.sp-glass-sheen { position: absolute; top: 0; bottom: 0; width: 40%; background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .07) 45%, transparent 90%); transform: translateX(-160%); }
.sp-tg-glass.is-idle .sp-glass-sheen { animation: sp-sheen 4.6s ease-in-out 1s infinite; }

@keyframes sp-sheen { 0% { transform: translateX(-160%); } 55%, 100% { transform: translateX(320%); } }

.sp-glass-qr { position: relative; z-index: 0; margin-right: -14px; transform: translateX(-70%) scale(.9); opacity: 0; }
.sp-tg-glass.is-enter .sp-glass-qr { animation: sp-glass-qr-out .6s cubic-bezier(.25, 1, .35, 1) calc(var(--sp-reveal)) forwards; }
.sp-tg-glass .sp-glass-qr { order: 2; margin-right: 0; margin-left: -14px; }
.sp-tg-glass.is-exit .sp-glass-qr { animation: sp-glass-qr-in .35s ease-in forwards; }

@keyframes sp-glass-qr-out { to { transform: translateX(0) scale(1); opacity: 1; } }
@keyframes sp-glass-qr-in { from { transform: translateX(0); opacity: 1; } to { transform: translateX(-60%); opacity: 0; } }

/* ============ Кинетическая типографика (TG/YT/TT) ============ */
.sp-kinetic { display: grid; gap: 6px; justify-items: start; text-shadow: 0 2px 12px rgba(0, 0, 0, .65), 0 1px 3px rgba(0, 0, 0, .5); }
.sp-kinetic-icon { width: 40px; height: 40px; }
.sp-kinetic-icon svg { width: 100%; height: 100%; filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .4)); }
.sp.is-enter .sp-kinetic-icon { animation: sp-icon-pop .5s cubic-bezier(.34, 1.6, .45, 1) both; }
.sp-kinetic-words { display: grid; gap: 0; }
.sp-kword { display: block; overflow: hidden; }
.sp-kword i {
  display: block;
  font-style: normal;
  font-size: 30px;
  font-weight: 850;
  letter-spacing: .3px;
  line-height: 1.12;
  transform: translateY(115%);
}
.sp.is-enter .sp-kword i { animation: sp-mask-up .5s cubic-bezier(.2, .9, .25, 1) forwards; animation-delay: calc(var(--sp-step) * (1.6 + var(--i) * 1.15)); }
.sp.is-exit .sp-kword i { animation: sp-mask-down .28s ease forwards; animation-delay: calc(var(--i) * 40ms); }
.sp-kinetic.is-tg .sp-kword:last-of-type i, .sp-kinetic .sp-kword i em { color: var(--sp-accent); }
.sp-kinetic-handle { font-size: 15px; font-weight: 750; color: var(--sp-ink-dim); opacity: 0; }
.sp.is-enter .sp-kinetic-handle { animation: sp-fade-in .45s ease calc(var(--sp-step) * 6) forwards; }
.sp-kinetic .sp-url { margin-top: 4px; opacity: 0; }
.sp.is-enter .sp-kinetic .sp-url { animation: sp-fade-in .45s ease calc(var(--sp-step) * 7) forwards; }
.sp-kinetic.is-yt .sp-kword i { color: #fff; }
.sp-kinetic.is-yt .sp-kword:nth-child(3) i { color: var(--sp-accent); }
.sp-kinetic.is-tt .sp-kword i { text-shadow: 2px 2px 0 rgba(37, 244, 238, .5), -2px -2px 0 rgba(254, 44, 85, .5), 0 2px 12px rgba(0, 0, 0, .65); }

/* ============ YT 1 · Minimal Subscribe ============ */
.sp-yt-minimal .sp-ytmin {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 14px;
  background: var(--sp-plate);
  border: 1px solid var(--sp-plate-line);
  border-radius: 14px;
  box-shadow: var(--sp-shadow);
  backdrop-filter: blur(6px);
}
.sp-ytmin-icon { width: 42px; height: 30px; flex: 0 0 auto; }
.sp-ytmin-icon svg { width: 100%; height: 100%; }
.sp-yt-minimal.is-enter .sp-ytmin-icon { animation: sp-icon-pop .5s cubic-bezier(.34, 1.6, .45, 1) both; }
.sp-ytmin-copy { display: grid; gap: 3px; min-width: 0; }
.sp-ytmin-copy b { font-size: 15.5px; }
.sp-ytmin-copy small { font-size: 13px; color: var(--sp-ink-dim); font-weight: 650; }
.sp-ytmin-copy .sp-url { font-size: 11.5px; }
.sp-sub-btn {
  position: relative;
  flex: 0 0 auto;
  border: 0;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--sp-accent);
  color: #fff;
  font: inherit;
  font-size: 13.5px;
  font-weight: 800;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transform: scale(.8);
}
.sp-yt-minimal.is-enter .sp-sub-btn { animation: sp-scale-in .45s cubic-bezier(.3, 1.4, .4, 1) calc(var(--sp-step) * 3.4) forwards; }
.sp-sub-done { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; gap: 5px; background: #1d8a4e; font-size: 13px; }
.sp-sub-done svg { width: 14px; height: 14px; }
.sp-yt-minimal.is-finale .sp-sub-label { visibility: hidden; }
.sp-yt-minimal.is-finale .sp-sub-done { display: inline-flex; animation: sp-fade-in .3s ease both; }

/* ============ YT 2 · Мини-плеер ============ */
.sp-yt-player .sp-player {
  display: grid;
  gap: 0;
  min-width: 300px;
  background: var(--sp-plate);
  border: 1px solid var(--sp-plate-line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--sp-shadow);
  backdrop-filter: blur(6px);
}
.sp-player-frame { display: flex; align-items: center; gap: 13px; padding: 14px 16px; }
.sp-player-morph { position: relative; width: 46px; height: 34px; flex: 0 0 auto; }
.sp-player-morph i { position: absolute; inset: 0; display: grid; place-items: center; }
.sp-player-play { color: #fff; }
.sp-player-play svg { width: 26px; height: 26px; }
.sp-player-logo svg { width: 46px; height: 34px; }
.sp-player-logo { opacity: 0; transform: scale(.7); }
.sp-yt-player.is-enter .sp-player-play { animation: sp-morph-out .4s ease calc(var(--sp-reveal) * .7) forwards; }
.sp-yt-player.is-enter .sp-player-logo { animation: sp-morph-in .45s cubic-bezier(.3, 1.3, .4, 1) calc(var(--sp-reveal) * .78) forwards; }

@keyframes sp-morph-out { to { opacity: 0; transform: scale(.6) rotate(-8deg); } }
@keyframes sp-morph-in { to { opacity: 1; transform: scale(1); } }

.sp-player-copy { display: grid; gap: 3px; }
.sp-player-copy b { font-size: 15.5px; }
.sp-player-copy small { font-size: 13px; color: var(--sp-ink-dim); font-weight: 650; }
.sp-yt-player.is-enter .sp-player-copy { opacity: 0; animation: sp-fade-in .5s ease calc(var(--sp-reveal)) forwards; }
.sp-player-bar { height: 4px; background: rgba(255, 255, 255, .14); }
.sp-player-bar i { display: block; height: 100%; width: 0; background: var(--sp-accent); }
.sp-yt-player.is-enter .sp-player-bar i { animation: sp-bar-fill 1.1s cubic-bezier(.3, .7, .3, 1) calc(var(--sp-step)) forwards; }
.sp-yt-player.is-idle .sp-player-bar i { width: 34%; animation: sp-bar-drift 5.5s ease-in-out 1.4s infinite alternate; }

@keyframes sp-bar-fill { from { width: 0; } to { width: 34%; } }
@keyframes sp-bar-drift { from { width: 34%; } to { width: 82%; } }

/* ============ YT 3 · Карточка канала ============ */
.sp-yt-card .sp-ytcard {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 16px;
  background: var(--sp-plate);
  border: 1px solid var(--sp-plate-line);
  border-radius: 16px;
  box-shadow: var(--sp-shadow);
  backdrop-filter: blur(6px);
}
.sp-ytcard-avatar { position: relative; width: 50px; height: 50px; flex: 0 0 auto; }
.sp-ytcard-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.sp-ytcard-badge { position: absolute; right: -5px; bottom: -4px; width: 24px; height: 18px; }
.sp-ytcard-badge svg { width: 100%; height: 100%; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .5)); }
.sp-yt-card.is-enter .sp-ytcard-avatar { animation: sp-icon-pop .55s cubic-bezier(.34, 1.6, .45, 1) both; }
.sp-ytcard-copy { display: grid; gap: 3px; min-width: 0; }
.sp-ytcard-copy b { font-size: 16px; }
.sp-ytcard-copy small { font-size: 13px; color: var(--sp-ink-dim); font-weight: 650; }
.sp-yt-card.is-enter .sp-ytcard-copy { opacity: 0; animation: sp-fade-in .5s ease calc(var(--sp-step) * 2.4) forwards; }
.sp-ytcard-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--sp-accent);
  font-size: 13px;
  font-weight: 800;
  opacity: 0;
  transform: translateY(6px);
}
.sp-ytcard-cta svg { width: 14px; height: 14px; }
.sp-yt-card.is-enter .sp-ytcard-cta { animation: sp-rise-in .45s cubic-bezier(.3, 1.3, .4, 1) calc(var(--sp-step) * 3.8) forwards; }
.sp-yt-card.is-idle .sp-ytcard-cta svg { animation: sp-bell-ring 4.8s ease-in-out 2s infinite; }

@keyframes sp-rise-in { to { opacity: 1; transform: translateY(0); } }
@keyframes sp-bell-ring {
  0%, 88%, 100% { transform: rotate(0); }
  90% { transform: rotate(14deg); }
  93% { transform: rotate(-11deg); }
  96% { transform: rotate(6deg); }
}

/* ============ YT 5 · Progress Bar ============ */
.sp-yt-progress .sp-progress { display: grid; gap: 0; justify-items: start; }
.sp-progress-line { position: relative; display: block; width: 0; height: 3px; border-radius: 3px; background: var(--sp-accent); box-shadow: 0 0 10px rgba(255, 0, 51, .5); }
.sp-yt-progress.is-enter .sp-progress-line { animation: sp-progress-draw .8s cubic-bezier(.3, .7, .2, 1) forwards; }
.sp-yt-progress.is-idle .sp-progress-line, .sp-yt-progress.is-finale .sp-progress-line, .sp-yt-progress.is-exit .sp-progress-line { width: 100%; }

@keyframes sp-progress-draw { from { width: 0; } to { width: 100%; } }

.sp-progress-timer { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; border-radius: inherit; background: rgba(255, 255, 255, .85); transform-origin: left; transform: scaleX(0); }
.sp-yt-progress.is-idle .sp-progress-timer { animation: sp-timer-run var(--sp-duration, 8s) linear forwards; }

@keyframes sp-timer-run { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.sp-progress-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding: 12px 15px;
  background: var(--sp-plate);
  border: 1px solid var(--sp-plate-line);
  border-radius: 13px;
  box-shadow: var(--sp-shadow);
  backdrop-filter: blur(6px);
  opacity: 0;
  transform: translateY(8px);
}
.sp-yt-progress.is-enter .sp-progress-card { animation: sp-rise-in .5s cubic-bezier(.3, 1.2, .4, 1) .55s forwards; }
.sp-progress-icon { width: 38px; height: 27px; }
.sp-progress-icon svg { width: 100%; height: 100%; }
.sp-progress-copy { display: grid; gap: 3px; }
.sp-progress-copy b { font-size: 15px; }
.sp-progress-copy small { font-size: 12.5px; color: var(--sp-ink-dim); font-weight: 650; }

/* ============ YT 6 · Угловой бейдж ============ */
.sp-yt-badge .sp-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  background: var(--sp-plate);
  border: 1px solid var(--sp-plate-line);
  border-radius: 11px;
  box-shadow: var(--sp-shadow);
  backdrop-filter: blur(6px);
}
.sp-badge-icon { width: 30px; height: 22px; flex: 0 0 auto; }
.sp-badge-icon svg { width: 100%; height: 100%; }
.sp-badge-copy { display: grid; gap: 2px; }
.sp-badge-copy b { font-size: 13.5px; }
.sp-badge-copy small { font-size: 11.5px; color: var(--sp-ink-dim); font-weight: 650; }
.sp-badge-arrow { display: inline-block; font-style: normal; color: var(--sp-accent); }
.sp-yt-badge.is-idle .sp-badge-arrow { animation: sp-nudge 2.4s ease-in-out 1s infinite; }

/* ============ TT 1 · Floating Profile ============ */
.sp-tt-profile .sp-ttprofile {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 16px;
  background: var(--sp-plate);
  border: 1px solid var(--sp-plate-line);
  border-radius: 999px;
  box-shadow: var(--sp-shadow);
  backdrop-filter: blur(6px);
}
.sp-ttprofile-avatar { position: relative; width: 48px; height: 48px; flex: 0 0 auto; }
.sp-ttprofile-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.sp-tt-ring { position: absolute; inset: -3px; border-radius: 50%; border: 2px solid transparent; background: conic-gradient(from 180deg, var(--sp-accent), var(--sp-accent2, #fe2c55), var(--sp-accent)) border-box; -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.sp-tt-profile.is-enter .sp-ttprofile-avatar { animation: sp-spring-pop .65s cubic-bezier(.3, 1.75, .4, 1) both; }
.sp-tt-profile.is-idle .sp-tt-ring { animation: sp-ring-spin 6s linear infinite; }

@keyframes sp-spring-pop {
  0% { transform: scale(0) rotate(-14deg); }
  60% { transform: scale(1.14) rotate(3deg); }
  100% { transform: scale(1) rotate(0); }
}
@keyframes sp-ring-spin { to { transform: rotate(360deg); } }

.sp-ttprofile-copy { display: grid; gap: 1px; min-width: 0; }
.sp-ttprofile-copy b { font-size: 16px; }
.sp-ttprofile-copy small { font-size: 12.5px; color: var(--sp-ink-dim); font-weight: 650; }
.sp-tt-profile.is-enter .sp-ttprofile-copy { opacity: 0; animation: sp-slide-in .45s cubic-bezier(.25, 1, .35, 1) calc(var(--sp-step) * 2.2) forwards; }

@keyframes sp-slide-in { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }

.sp-ttprofile-cta {
  flex: 0 0 auto;
  padding: 8px 15px;
  border-radius: 999px;
  background: var(--sp-accent2, #fe2c55);
  font-size: 13px;
  font-weight: 800;
  opacity: 0;
  transform: scale(.85);
}
.sp-tt-profile.is-enter .sp-ttprofile-cta { animation: sp-scale-in .4s cubic-bezier(.3, 1.5, .4, 1) calc(var(--sp-step) * 3.4) forwards; }

/* ============ TT 2 · Social Pulse ============ */
.sp-tt-pulse .sp-ttpulse {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 10px 10px;
  background: var(--sp-plate);
  border: 1px solid var(--sp-plate-line);
  border-radius: 999px;
  box-shadow: var(--sp-shadow);
  backdrop-filter: blur(6px);
  max-width: 58px;
  overflow: hidden;
  white-space: nowrap;
}
.sp-tt-pulse.is-enter .sp-ttpulse { animation: sp-pill-grow .55s cubic-bezier(.3, .9, .3, 1) calc(var(--sp-step) * 1.6) forwards; }
.sp-tt-pulse.is-idle .sp-ttpulse, .sp-tt-pulse.is-finale .sp-ttpulse { max-width: 440px; }
.sp-tt-pulse.is-exit .sp-ttpulse { animation: sp-pill-shrink .45s ease-in forwards; }
.sp-ttpulse-icon { position: relative; width: 38px; height: 38px; flex: 0 0 auto; }
.sp-ttpulse-icon svg { width: 100%; height: 100%; }
.sp-tt-pulse.is-enter .sp-ttpulse-icon { animation: sp-icon-pop .5s cubic-bezier(.34, 1.6, .45, 1) both; }
.sp-ttpulse-icon .sp-pulse-ring.is-a { border-color: var(--sp-accent); }
.sp-ttpulse-icon .sp-pulse-ring.is-b { border-color: var(--sp-accent2, #fe2c55); }
.sp-tt-pulse.is-idle .sp-pulse-ring.is-b { animation-delay: 2.4s; }
.sp-ttpulse-body { display: grid; gap: 1px; min-width: 0; }
.sp-ttpulse-body b { font-size: 16px; }
.sp-ttpulse-body small { font-size: 13px; color: var(--sp-ink-dim); font-weight: 650; }

/* ============ TT 3 · Вертикальное видео ============ */
.sp-tt-vertical .sp-ttvert { display: flex; align-items: center; gap: 14px; }
.sp-ttvert-frame {
  position: relative;
  width: 74px;
  height: 128px;
  flex: 0 0 auto;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 255, 255, .35);
  background: linear-gradient(165deg, rgba(20, 19, 30, .85), rgba(10, 9, 16, .9));
  box-shadow: var(--sp-shadow), inset 0 0 24px rgba(37, 244, 238, .06);
  overflow: hidden;
}
.sp-tt-vertical.is-enter .sp-ttvert-frame { animation: sp-spring-pop .6s cubic-bezier(.3, 1.6, .4, 1) both; }
.sp-ttvert-step { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; opacity: 0; }
.sp-ttvert-step svg { width: 30px; height: 30px; }
.sp-ttvert-step.is-logo svg { width: 38px; height: 38px; }
.sp-tt-vertical.is-enter .sp-ttvert-step.is-play { animation: sp-step-show .55s ease calc(var(--sp-step) * 1.6) both; }
.sp-tt-vertical.is-enter .sp-ttvert-step.is-swipe { animation: sp-step-swipe .55s ease calc(var(--sp-step) * 4) both; }
.sp-tt-vertical.is-enter .sp-ttvert-step.is-logo { animation: sp-scale-in .5s cubic-bezier(.3, 1.4, .4, 1) calc(var(--sp-step) * 6.2) forwards; }
.sp-tt-vertical.is-idle .sp-ttvert-step.is-logo { opacity: 1; transform: scale(1); }

@keyframes sp-step-show {
  0% { opacity: 0; transform: scale(.7); }
  35%, 70% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(.9); }
}
@keyframes sp-step-swipe {
  0% { opacity: 0; transform: translateY(20px); }
  35%, 70% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-22px); }
}

.sp-ttvert-scan { position: absolute; left: 8%; right: 8%; height: 1.5px; top: 12%; background: linear-gradient(90deg, transparent, rgba(37, 244, 238, .8), transparent); opacity: 0; }
.sp-tt-vertical.is-idle .sp-ttvert-scan { animation: sp-scan 3.4s ease-in-out 1s infinite; }

@keyframes sp-scan {
  0%, 100% { top: 12%; opacity: 0; }
  12% { opacity: 1; }
  50% { top: 84%; opacity: 1; }
  62%, 99% { opacity: 0; }
}

.sp-ttvert-copy { display: grid; gap: 2px; text-shadow: 0 2px 10px rgba(0, 0, 0, .6); }
.sp-ttvert-copy b { font-size: 17px; }
.sp-ttvert-copy small { font-size: 13.5px; color: var(--sp-ink-dim); font-weight: 650; }
.sp-tt-vertical.is-enter .sp-ttvert-copy { opacity: 0; animation: sp-slide-in .5s ease calc(var(--sp-step) * 7) forwards; }

/* ============ TW 1 · Минимальная пилюля ============ */
.sp-tw-pill.is-enter .sp-pill { animation: sp-pill-grow .6s cubic-bezier(.3, .9, .3, 1) calc(var(--sp-step) * 1.4) forwards; }
.sp-tw-pill.is-idle .sp-pill, .sp-tw-pill.is-finale .sp-pill { max-width: 460px; }
.sp-tw-pill.is-exit .sp-pill { animation: sp-pill-shrink .45s ease-in forwards; }
.sp-tw-pill.is-enter .sp-pill-icon { animation: sp-icon-pop .55s cubic-bezier(.34, 1.6, .45, 1) both; }
.sp-twpill-cta { display: inline-flex; align-items: center; gap: 4px; }
.sp-heart-beat { display: inline-grid; width: 14px; height: 14px; color: var(--sp-accent); }
.sp-heart-beat svg { width: 100%; height: 100%; }
.sp.is-idle .sp-heart-beat { animation: sp-heartbeat 2.2s ease-in-out 1.2s infinite; transform-origin: center; }

@keyframes sp-heartbeat {
  0%, 30%, 100% { transform: scale(1); }
  10% { transform: scale(1.25); }
  20% { transform: scale(1.08); }
}

/* ============ TW 2 · Кнопка Follow ============ */
.sp-tw-button .sp-twbtn {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 14px;
  background: var(--sp-plate);
  border: 1px solid var(--sp-plate-line);
  border-radius: 15px;
  box-shadow: var(--sp-shadow);
  backdrop-filter: blur(6px);
}
.sp-twbtn-avatar { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 50%; overflow: hidden; border: 2px solid var(--sp-accent); }
.sp-twbtn-img { width: 100%; height: 100%; object-fit: cover; }
.sp-tw-button.is-enter .sp-twbtn-avatar { animation: sp-icon-pop .5s cubic-bezier(.34, 1.6, .45, 1) both; }
.sp-twbtn-copy { display: grid; gap: 1px; min-width: 0; }
.sp-twbtn-copy b { font-size: 15px; }
.sp-twbtn-copy small { font-size: 12.5px; color: var(--sp-ink-dim); font-weight: 650; }
.sp-follow-btn {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  padding: 9px 16px;
  border-radius: 10px;
  background: var(--sp-accent);
  color: #fff;
  font-size: 13.5px;
  font-weight: 800;
  opacity: 0;
  transform: scale(.82);
}
.sp-tw-button.is-enter .sp-follow-btn { animation: sp-scale-in .45s cubic-bezier(.3, 1.5, .4, 1) calc(var(--sp-step) * 3.2) forwards; }
.sp-tw-button.is-idle:not(.is-finale) .sp-follow-btn { opacity: 1; transform: none; }
.sp-follow-idle, .sp-follow-done { display: inline-flex; align-items: center; gap: 6px; }
.sp-follow-idle i, .sp-follow-done i { display: inline-grid; width: 15px; height: 15px; }
.sp-follow-idle svg, .sp-follow-done svg { width: 100%; height: 100%; }
.sp-follow-done { position: absolute; inset: 0; justify-content: center; border-radius: inherit; background: #17b269; opacity: 0; }
/* «нажатие»: finale — кнопка сжимается и меняет состояние + бёрст */
.sp-tw-button.is-finale .sp-follow-btn { animation: sp-press .45s cubic-bezier(.3, 1.4, .4, 1); }
.sp-tw-button.is-finale .sp-follow-done { opacity: 1; transition: opacity .18s ease .12s; }
.sp-tw-button.is-finale .sp-follow-idle { visibility: hidden; }

@keyframes sp-press {
  0% { transform: scale(1); }
  35% { transform: scale(.88); }
  70% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.sp-burst { position: absolute; inset: 0; pointer-events: none; }
.sp-burst b {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sp-accent);
  opacity: 0;
}
.sp-tw-button.is-finale .sp-burst b { animation: sp-burst .55s ease-out .1s forwards; }
.sp-burst b:nth-child(1) { --bx: -32px; --by: -20px; background: #ff7ab8; }
.sp-burst b:nth-child(2) { --bx: 30px; --by: -24px; }
.sp-burst b:nth-child(3) { --bx: -24px; --by: 22px; background: #8fc7ff; }
.sp-burst b:nth-child(4) { --bx: 34px; --by: 16px; background: #ffd166; }
.sp-burst b:nth-child(5) { --bx: 0px; --by: -32px; background: #7fe0b5; }
.sp-burst b:nth-child(6) { --bx: 6px; --by: 30px; background: #ff7ab8; }

@keyframes sp-burst {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(.4); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--bx)), calc(-50% + var(--by))) scale(1); }
}

/* ============ TW 3 · Карточка стримера ============ */
.sp-tw-card .sp-twcard {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
  background: linear-gradient(150deg, rgba(24, 18, 38, .88), rgba(12, 10, 20, .9));
  border: 1px solid var(--sp-plate-line);
  border-radius: 17px;
  box-shadow: var(--sp-shadow), inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(7px);
}
.sp-twcard-avatar { position: relative; width: 52px; height: 52px; flex: 0 0 auto; }
.sp-twcard-img { width: 100%; height: 100%; border-radius: 16px; object-fit: cover; }
.sp-twcard-glyph { position: absolute; right: -6px; bottom: -6px; width: 22px; height: 22px; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .5)); }
.sp-twcard-glyph svg { width: 100%; height: 100%; }
.sp-tw-card.is-enter .sp-twcard-avatar { animation: sp-spring-pop .6s cubic-bezier(.3, 1.7, .4, 1) both; }
.sp-twcard-copy { display: grid; gap: 1px; min-width: 0; }
.sp-twcard-copy b { font-size: 16px; }
.sp-twcard-copy small { font-size: 13px; color: var(--sp-ink-dim); font-weight: 650; }
.sp-twcard-copy em { font-style: normal; font-size: 12px; color: var(--sp-ink-dim); opacity: .8; }
.sp-tw-card.is-enter .sp-twcard-copy { opacity: 0; animation: sp-slide-in .5s cubic-bezier(.25, 1, .35, 1) calc(var(--sp-step) * 2.4) forwards; }
.sp-twcard-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 9px 15px;
  border-radius: 999px;
  background: var(--sp-accent);
  font-size: 13px;
  font-weight: 800;
  opacity: 0;
  transform: translateY(6px);
}
.sp-twcard-cta svg { width: 14px; height: 14px; }
.sp-tw-card.is-enter .sp-twcard-cta { animation: sp-rise-in .45s cubic-bezier(.3, 1.3, .4, 1) calc(var(--sp-step) * 3.8) forwards; }
.sp-tw-card.is-idle .sp-twcard-cta svg { animation: sp-heartbeat 3s ease-in-out 1.6s infinite; }

/* ============ TW 4 · Сердечко ============ */
.sp-tw-heart .sp-twheart { display: flex; align-items: center; gap: 0; }
.sp-twheart-icon { position: relative; width: 46px; height: 46px; flex: 0 0 auto; color: var(--sp-accent); filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .45)); }
.sp-twheart-icon i { position: absolute; inset: 0; }
.sp-twheart-icon svg { width: 100%; height: 100%; }
.sp-twheart-fill { opacity: 0; transform: scale(.6); }
.sp-tw-heart.is-enter .sp-twheart-icon { animation: sp-heart-arrive .9s cubic-bezier(.3, 1.4, .4, 1) both; }
/* сердце заполняется в финале */
.sp-tw-heart.is-finale .sp-twheart-fill { animation: sp-heart-fill .5s cubic-bezier(.3, 1.5, .4, 1) forwards; }
.sp-tw-heart.is-finale .sp-twheart-outline { animation: sp-morph-out .3s ease forwards; }

@keyframes sp-heart-arrive {
  0% { opacity: 0; transform: scale(.3); }
  45% { opacity: 1; transform: scale(1.16); }
  70% { transform: scale(.94); }
  100% { transform: scale(1); }
}
@keyframes sp-heart-fill { to { opacity: 1; transform: scale(1); } }

.sp-tw-heart.is-idle .sp-twheart-icon { animation: sp-heartbeat 2.4s ease-in-out .8s infinite; }
.sp-twheart-panel {
  display: grid;
  gap: 2px;
  margin-left: 12px;
  padding: 12px 16px;
  background: var(--sp-plate);
  border: 1px solid var(--sp-plate-line);
  border-radius: 14px;
  box-shadow: var(--sp-shadow);
  backdrop-filter: blur(6px);
  max-width: 0;
  padding-left: 0;
  padding-right: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
}
.sp-tw-heart.is-enter .sp-twheart-panel { animation: sp-panel-unfold .6s cubic-bezier(.3, .9, .3, 1) calc(var(--sp-reveal) * .75) forwards; }
.sp-tw-heart.is-exit .sp-twheart-panel { animation: sp-panel-fold .4s ease-in forwards; }
.sp-tw-heart.is-exit .sp-twheart-icon { animation: sp-heart-arrive .45s ease-in reverse forwards; animation-delay: .3s; }

@keyframes sp-panel-unfold { to { max-width: 420px; padding-left: 16px; padding-right: 16px; opacity: 1; } }
@keyframes sp-panel-fold { from { max-width: 420px; padding-left: 16px; padding-right: 16px; opacity: 1; } to { max-width: 0; padding-left: 0; padding-right: 0; opacity: 0; } }

.sp-twheart-panel b { font-size: 15.5px; }
.sp-twheart-panel small { font-size: 13px; color: var(--sp-ink-dim); font-weight: 650; }

/* ============ TW 5 · Кромка экрана ============ */
.sp-tw-edge .sp-twedge { display: flex; align-items: center; }
.sp-twedge-rail { width: 3px; height: 44px; border-radius: 3px; background: var(--sp-accent); box-shadow: 0 0 12px var(--sp-accent); flex: 0 0 auto; }
.sp-twedge-body {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px 9px 11px;
  background: var(--sp-plate);
  border: 1px solid var(--sp-plate-line);
  border-left: 0;
  border-radius: 0 12px 12px 0;
  box-shadow: var(--sp-shadow);
  backdrop-filter: blur(6px);
  clip-path: inset(0 100% 0 0);
}
.sp-tw-edge.is-enter .sp-twedge-body { animation: sp-edge-out .55s cubic-bezier(.3, 1, .35, 1) calc(var(--sp-step) * 1.6) forwards; }
.sp-tw-edge.is-exit .sp-twedge-body { animation: sp-edge-in .4s ease-in forwards; }

@keyframes sp-edge-out { to { clip-path: inset(0 0 0 0); } }
@keyframes sp-edge-in { from { clip-path: inset(0 0 0 0); } to { clip-path: inset(0 100% 0 0); } }

/* у правого края — зеркалим */
.sp-tw-edge[data-pos*="right"] .sp-twedge { flex-direction: row-reverse; }
.sp-tw-edge[data-pos*="right"] .sp-twedge-body { border-radius: 12px 0 0 12px; border-left: 1px solid var(--sp-plate-line); border-right: 0; clip-path: inset(0 0 0 100%); }
.sp-tw-edge[data-pos*="right"].is-enter .sp-twedge-body { animation-name: sp-edge-out-r; }
.sp-tw-edge[data-pos*="right"].is-exit .sp-twedge-body { animation-name: sp-edge-in-r; }

@keyframes sp-edge-out-r { to { clip-path: inset(0 0 0 0); } }
@keyframes sp-edge-in-r { from { clip-path: inset(0 0 0 0); } to { clip-path: inset(0 0 0 100%); } }

.sp-twedge-icon { width: 26px; height: 26px; flex: 0 0 auto; }
.sp-twedge-icon svg { width: 100%; height: 100%; }
.sp-twedge-copy { display: grid; gap: 0; }
.sp-twedge-copy b { font-size: 13.5px; }
.sp-twedge-copy small { font-size: 11.5px; color: var(--sp-ink-dim); font-weight: 650; }

/* ============ TW 6 · Кинетический вопрос ============ */
.sp-tw-kinetic .sp-twkin { display: grid; gap: 8px; justify-items: start; text-shadow: 0 2px 12px rgba(0, 0, 0, .65); }
.sp-twkin-stack { position: relative; display: grid; min-height: 44px; min-width: 300px; }
.sp-twkin-word { grid-area: 1 / 1; overflow: hidden; }
.sp-twkin-word i {
  display: block;
  font-style: normal;
  font-size: 36px;
  font-weight: 850;
  letter-spacing: .5px;
  transform: translateY(115%);
  opacity: 0;
}
/* слова сменяют друг друга: каждое живёт ~0.9s */
.sp-tw-kinetic.is-enter .sp-twkin-word:nth-child(1) i { animation: sp-word-cycle 1.05s cubic-bezier(.2, .9, .25, 1) calc(var(--sp-step) * 1) both; }
.sp-tw-kinetic.is-enter .sp-twkin-word:nth-child(2) i { animation: sp-word-cycle 1.05s cubic-bezier(.2, .9, .25, 1) calc(var(--sp-step) * 1 + .95s) both; }
.sp-tw-kinetic.is-enter .sp-twkin-word:nth-child(3) i { animation: sp-word-final .7s cubic-bezier(.2, .9, .25, 1) calc(var(--sp-step) * 1 + 1.9s) both; color: var(--sp-accent); }
.sp-tw-kinetic.is-exit .sp-twkin-word:nth-child(3) i { animation: sp-mask-down .3s ease forwards; }

@keyframes sp-word-cycle {
  0% { transform: translateY(115%); opacity: 0; }
  18%, 70% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-115%); opacity: 0; }
}
@keyframes sp-word-final {
  0% { transform: translateY(115%); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.sp-twkin-tail { display: inline-flex; align-items: center; gap: 8px; opacity: 0; }
.sp-twkin-tail svg { width: 24px; height: 24px; }
.sp-twkin-tail small { font-size: 15px; font-weight: 750; color: var(--sp-ink-dim); }
.sp-tw-kinetic.is-enter .sp-twkin-tail { animation: sp-fade-in .5s ease calc(var(--sp-step) * 1 + 2.35s) forwards; }

/* ============ TW 7 · Аватар с кольцом ============ */
.sp-tw-avatar .sp-twava {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px 12px 12px;
  background: var(--sp-plate);
  border: 1px solid var(--sp-plate-line);
  border-radius: 999px;
  box-shadow: var(--sp-shadow);
  backdrop-filter: blur(6px);
}
.sp-twava-wrap { position: relative; width: 52px; height: 52px; flex: 0 0 auto; }
.sp-twava-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.sp-twava-ring { position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--sp-accent); border-right-color: transparent; border-bottom-color: transparent; opacity: 0; }
.sp-twava-ring.is-b { inset: -8px; border-width: 1px; border-color: color-mix(in srgb, var(--sp-accent) 55%, transparent); border-left-color: transparent; border-top-color: transparent; }
.sp-tw-avatar.is-enter .sp-twava-wrap { animation: sp-icon-pop .55s cubic-bezier(.34, 1.6, .45, 1) both; }
.sp-tw-avatar.is-enter .sp-twava-ring { animation: sp-ring-in .7s ease calc(var(--sp-step) * 2) forwards; }
.sp-tw-avatar.is-idle .sp-twava-ring { opacity: 1; animation: sp-ring-spin 5s linear infinite; }
.sp-tw-avatar.is-idle .sp-twava-ring.is-b { animation-duration: 8s; animation-direction: reverse; }

@keyframes sp-ring-in { from { opacity: 0; transform: rotate(-120deg) scale(.8); } to { opacity: 1; transform: rotate(0) scale(1); } }

.sp-twava-copy { display: grid; gap: 2px; min-width: 0; }
.sp-twava-copy b { font-size: 16px; }
.sp-twava-cta { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--sp-ink-dim); font-weight: 700; }
.sp-twava-cta svg { width: 13px; height: 13px; color: var(--sp-accent); }

/* ============ TW 8 · Линия-таймер ============ */
.sp-tw-progress .sp-twprog { display: grid; gap: 7px; min-width: 250px; }
.sp-twprog-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  background: var(--sp-plate);
  border: 1px solid var(--sp-plate-line);
  border-radius: 12px;
  box-shadow: var(--sp-shadow);
  backdrop-filter: blur(6px);
  opacity: 0;
  transform: translateY(6px);
}
.sp-tw-progress.is-enter .sp-twprog-row { animation: sp-rise-in .5s cubic-bezier(.3, 1.2, .4, 1) .5s forwards; }
.sp-twprog-icon { width: 26px; height: 26px; }
.sp-twprog-icon svg { width: 100%; height: 100%; }
.sp-twprog-copy { display: grid; gap: 0; }
.sp-twprog-copy b { font-size: 14px; }
.sp-twprog-copy small { font-size: 12px; color: var(--sp-ink-dim); font-weight: 650; }
.sp-twprog-line { position: relative; display: block; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .16); overflow: hidden; width: 0; }
.sp-tw-progress.is-enter .sp-twprog-line { animation: sp-progress-draw .7s cubic-bezier(.3, .7, .2, 1) forwards; }
.sp-tw-progress.is-idle .sp-twprog-line, .sp-tw-progress.is-finale .sp-twprog-line, .sp-tw-progress.is-exit .sp-twprog-line { width: 100%; }
.sp-twprog-timer { position: absolute; inset: 0; background: var(--sp-accent); transform-origin: left; transform: scaleX(0); }
.sp-tw-progress.is-idle .sp-twprog-timer { animation: sp-timer-run var(--sp-duration, 7s) linear forwards; }

/* ============ TW 9 · Орбита ============ */
.sp-tw-orbit .sp-tworbit { display: flex; align-items: center; gap: 14px; }
.sp-tworbit-core { position: relative; width: 58px; height: 58px; flex: 0 0 auto; }
.sp-tworbit-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; box-shadow: var(--sp-shadow); }
.sp-tw-orbit.is-enter .sp-tworbit-core { animation: sp-icon-pop .55s cubic-bezier(.34, 1.6, .45, 1) both; }
.sp-tworbit-sat { position: absolute; inset: 0; opacity: 0; }
.sp-tworbit-sat i { position: absolute; left: 50%; top: -13px; width: 24px; height: 24px; margin-left: -12px; filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .5)); }
.sp-tworbit-sat svg { width: 100%; height: 100%; }
/* два оборота вокруг аватара → стыковка в правый нижний угол */
.sp-tw-orbit.is-enter .sp-tworbit-sat { animation: sp-orbit-fly 1.5s cubic-bezier(.45, .1, .35, 1) calc(var(--sp-step) * 1.4) forwards; }
.sp-tw-orbit.is-idle .sp-tworbit-sat { opacity: 1; transform: rotate(315deg); }
.sp-tw-orbit.is-idle .sp-tworbit-sat i { transform: rotate(-315deg); }

@keyframes sp-orbit-fly {
  0% { opacity: 0; transform: rotate(0); }
  12% { opacity: 1; }
  100% { opacity: 1; transform: rotate(675deg); }
}

.sp-tworbit-copy { display: grid; gap: 2px; text-shadow: 0 2px 10px rgba(0, 0, 0, .55); }
.sp-tworbit-copy b { font-size: 17px; }
.sp-tworbit-copy small { font-size: 13.5px; color: var(--sp-ink-dim); font-weight: 650; }

/* ============ TW 10 · Штамп ============ */
.sp-tw-stamp .sp-twstamp {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--sp-plate);
  border: 1px solid var(--sp-plate-line);
  border-radius: 14px;
  box-shadow: var(--sp-shadow);
  backdrop-filter: blur(6px);
}
.sp-twstamp-copy { display: grid; gap: 1px; }
.sp-twstamp-copy b { font-size: 15.5px; }
.sp-twstamp-copy small { font-size: 13px; color: var(--sp-ink-dim); font-weight: 650; }
.sp-tw-stamp.is-enter .sp-twstamp-copy { opacity: 0; animation: sp-fade-in .4s ease calc(var(--sp-step)) forwards; }
.sp-twstamp-seal {
  display: grid;
  place-items: center;
  padding: 7px 14px;
  border: 2.5px solid var(--sp-accent);
  border-radius: 8px;
  color: var(--sp-accent);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transform: rotate(-8deg) scale(3);
  opacity: 0;
}
.sp-twstamp-seal i { font-style: normal; }
.sp-tw-stamp.is-enter .sp-twstamp-seal { animation: sp-stamp-hit .5s cubic-bezier(.3, 1.2, .3, 1) calc(var(--sp-step) * 3.2) forwards; }
.sp-tw-stamp.is-enter .sp-twstamp { animation: sp-stamp-shake .3s ease calc(var(--sp-step) * 3.2 + .32s); }

@keyframes sp-stamp-hit {
  0% { opacity: 0; transform: rotate(-8deg) scale(3); }
  60% { opacity: 1; transform: rotate(-8deg) scale(.92); }
  100% { opacity: 1; transform: rotate(-8deg) scale(1); }
}
@keyframes sp-stamp-shake {
  0%, 100% { transform: translate(0, 0); }
  30% { transform: translate(1.5px, -1px) rotate(.4deg); }
  60% { transform: translate(-1.5px, 1px) rotate(-.4deg); }
}

/* ============ TW 11 · Нижняя треть с подчёркиванием ============ */
.sp-tw-underline .sp-twline { display: flex; align-items: flex-start; gap: 12px; text-shadow: 0 2px 12px rgba(0, 0, 0, .65); }
.sp-twline-icon { width: 30px; height: 30px; flex: 0 0 auto; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .45)); }
.sp-twline-icon svg { width: 100%; height: 100%; }
.sp-tw-underline.is-enter .sp-twline-icon { animation: sp-icon-pop .5s cubic-bezier(.34, 1.6, .45, 1) both; }
.sp-twline-copy { display: grid; gap: 4px; }
.sp-twline-copy b { font-size: 22px; font-weight: 800; letter-spacing: .2px; }
.sp-twline-copy small { font-size: 13.5px; color: var(--sp-ink-dim); font-weight: 650; }
.sp-twline-stroke { display: block; height: 3px; width: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--sp-accent), transparent 90%); transform: scaleX(0); transform-origin: left; }
.sp-tw-underline.is-enter .sp-twline-stroke { animation: sp-underline-draw .55s cubic-bezier(.3, .8, .2, 1) calc(var(--sp-step) * 2.6) forwards; }
.sp-tw-underline.is-exit .sp-twline-stroke { animation: sp-underline-erase .3s ease forwards; }

@keyframes sp-underline-draw { to { transform: scaleX(1); } }
@keyframes sp-underline-erase { from { transform: scaleX(1); transform-origin: right; } to { transform: scaleX(0); transform-origin: right; } }

/* ============ TW 12 · Монохромный глиф ============ */
.sp-tw-glyph .sp-twglyph {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  background: rgba(8, 8, 12, .55);
  backdrop-filter: blur(5px);
  color: #fff;
}
.sp-twglyph-icon { width: 18px; height: 18px; }
.sp-twglyph-icon svg { width: 100%; height: 100%; }
.sp-tw-glyph.is-idle .sp-twglyph-icon { animation: sp-glyph-tilt 5s ease-in-out 1.4s infinite; }

@keyframes sp-glyph-tilt {
  0%, 90%, 100% { transform: rotate(0); }
  93% { transform: rotate(-8deg); }
  97% { transform: rotate(5deg); }
}

.sp-twglyph-copy { font-size: 13px; font-weight: 700; letter-spacing: .4px; }
.sp-twglyph-copy em { font-style: normal; color: rgba(255, 255, 255, .65); }

/* ============ TG 7 · Эластичная лента ============ */
.sp-tg-ribbon .sp-ribbon { display: flex; align-items: center; gap: 0; }
.sp-ribbon-icon { position: relative; z-index: 1; width: 44px; height: 44px; flex: 0 0 auto; filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .4)); }
.sp-ribbon-icon svg { width: 100%; height: 100%; }
.sp-tg-ribbon.is-enter .sp-ribbon-icon { animation: sp-icon-pop .5s cubic-bezier(.34, 1.6, .45, 1) both; }
.sp-ribbon-band {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-left: -20px;
  padding: 11px 18px 11px 32px;
  background: linear-gradient(90deg, var(--sp-accent), color-mix(in srgb, var(--sp-accent) 60%, #0c2740));
  border-radius: 0 12px 12px 0;
  box-shadow: var(--sp-shadow);
  color: #fff;
  transform: scaleX(0);
  transform-origin: left;
  white-space: nowrap;
}
.sp-tg-ribbon.is-enter .sp-ribbon-band { animation: sp-ribbon-stretch .75s cubic-bezier(.3, 1.45, .35, 1) calc(var(--sp-step) * 1.6) forwards; }
.sp-tg-ribbon.is-exit .sp-ribbon-band { animation: sp-ribbon-retract .4s ease-in forwards; }

@keyframes sp-ribbon-stretch {
  0% { transform: scaleX(0); }
  70% { transform: scaleX(1.06); }
  100% { transform: scaleX(1); }
}
@keyframes sp-ribbon-retract { from { transform: scaleX(1); } to { transform: scaleX(0); } }

.sp-ribbon-band b { font-size: 15.5px; }
.sp-ribbon-band small { font-size: 13px; opacity: .85; font-weight: 650; }

/* ============ TG 8 · Самолётик на орбите ============ */
.sp-tg-orbit .sp-tgorbit { display: flex; align-items: center; gap: 13px; }
.sp-tgorbit-core { position: relative; width: 54px; height: 54px; flex: 0 0 auto; }
.sp-tgorbit-circle { position: absolute; inset: 6px; border-radius: 50%; border: 1.5px dashed color-mix(in srgb, var(--sp-accent) 70%, transparent); opacity: 0; }
.sp-tg-orbit.is-enter .sp-tgorbit-circle { animation: sp-fade-in .4s ease .2s forwards; }
.sp-tg-orbit.is-idle .sp-tgorbit-circle { opacity: 1; animation: sp-ring-spin 14s linear infinite; }
.sp-tgorbit-plane { position: absolute; inset: 0; color: var(--sp-accent); opacity: 0; }
.sp-tgorbit-plane svg { position: absolute; left: 50%; top: -4px; width: 20px; height: 20px; margin-left: -10px; transform: rotate(45deg); }
.sp-tg-orbit.is-enter .sp-tgorbit-plane { animation: sp-orbit-fly 1.4s cubic-bezier(.45, .1, .35, 1) calc(var(--sp-step) * 1.2) forwards; }
.sp-tg-orbit.is-idle .sp-tgorbit-plane { opacity: 1; transform: rotate(675deg); }
.sp-tgorbit-copy { display: grid; gap: 2px; text-shadow: 0 2px 10px rgba(0, 0, 0, .55); }
.sp-tgorbit-copy b { font-size: 16.5px; }
.sp-tgorbit-copy small { font-size: 13.5px; color: var(--sp-ink-dim); font-weight: 650; }

/* ============ TG 9 · Неоновая линия ============ */
.sp-tg-mono .sp-tgmono { display: flex; align-items: stretch; gap: 13px; text-shadow: 0 2px 10px rgba(0, 0, 0, .6); }
.sp-tgmono-line { width: 2.5px; border-radius: 3px; background: var(--sp-accent); box-shadow: 0 0 14px color-mix(in srgb, var(--sp-accent) 80%, transparent); transform: scaleY(0); transform-origin: top; }
.sp-tg-mono.is-enter .sp-tgmono-line { animation: sp-line-draw .5s cubic-bezier(.3, .8, .2, 1) forwards; }
.sp-tg-mono.is-exit .sp-tgmono-line { animation: sp-line-draw .3s ease reverse forwards; }
.sp-tgmono-copy { display: grid; gap: 2px; align-content: center; }
.sp-tgmono-copy b { font-size: 19px; font-weight: 800; letter-spacing: .2px; }
.sp-tgmono-copy small { font-size: 13px; color: var(--sp-ink-dim); font-weight: 650; }
.sp-tg-mono.is-enter .sp-tgmono-copy { opacity: 0; animation: sp-slide-in .5s ease calc(var(--sp-step) * 1.8) forwards; }

/* ============ YT 7 · Жидкая маска ============ */
.sp-yt-liquid .sp-ytliquid { position: relative; }
.sp-ytliquid-blob {
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, color-mix(in srgb, var(--sp-accent) 88%, #300), color-mix(in srgb, var(--sp-accent) 55%, #14060a));
  border-radius: 18px;
  box-shadow: var(--sp-shadow);
  clip-path: circle(9% at 12% 50%);
}
.sp-yt-liquid.is-enter .sp-ytliquid-blob { animation: sp-liquid-spread .9s cubic-bezier(.3, .7, .25, 1) calc(var(--sp-step)) forwards; }
.sp-yt-liquid.is-exit .sp-ytliquid-blob { animation: sp-liquid-gather .5s ease-in forwards; }

@keyframes sp-liquid-spread {
  0% { clip-path: circle(9% at 12% 50%); border-radius: 50%; }
  55% { clip-path: circle(75% at 40% 50%); }
  100% { clip-path: circle(140% at 50% 50%); border-radius: 18px; }
}
@keyframes sp-liquid-gather {
  0% { clip-path: circle(140% at 50% 50%); }
  100% { clip-path: circle(0% at 12% 50%); }
}

.sp-ytliquid-copy { position: relative; display: flex; align-items: center; gap: 13px; padding: 16px 20px; color: #fff; }
.sp-ytliquid-icon { width: 40px; height: 29px; flex: 0 0 auto; --sp-accent: #fff; }
.sp-ytliquid-icon svg path:last-child { fill: #d01; }
.sp-ytliquid-icon svg rect { fill: #fff; }
.sp-yt-liquid.is-enter .sp-ytliquid-copy { opacity: 0; animation: sp-fade-in .5s ease calc(var(--sp-reveal) * .8) forwards; }
.sp-ytliquid-copy b { display: block; font-size: 16px; }
.sp-ytliquid-copy small { display: block; font-size: 13px; opacity: .85; font-weight: 650; margin-top: 2px; }
.sp-ytliquid-copy .sp-url { margin-top: 2px; opacity: .8; }

/* ============ YT 8 · Сплит-строка ============ */
.sp-yt-split .sp-ytsplit { position: relative; display: grid; gap: 0; min-width: 280px; text-shadow: 0 2px 10px rgba(0, 0, 0, .6); }
.sp-ytsplit-line { position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; background: var(--sp-accent); transform: scaleX(0); }
.sp-yt-split.is-enter .sp-ytsplit-line { animation: sp-underline-draw .45s cubic-bezier(.3, .8, .2, 1) forwards; }
.sp-yt-split.is-idle .sp-ytsplit-line, .sp-yt-split.is-finale .sp-ytsplit-line { transform: scaleX(1); opacity: .35; }
.sp-ytsplit-halves { display: grid; }
.sp-ytsplit-top, .sp-ytsplit-bottom { display: flex; align-items: center; gap: 9px; overflow: hidden; }
.sp-ytsplit-top b { font-size: 21px; font-weight: 800; transform: translateY(105%); display: block; padding-bottom: 4px; }
.sp-ytsplit-bottom { padding-top: 5px; }
.sp-ytsplit-bottom small { font-size: 14px; color: var(--sp-ink-dim); font-weight: 700; transform: translateY(-110%); display: block; }
.sp-ytsplit-badge { width: 26px; height: 19px; transform: translateY(-130%); }
.sp-ytsplit-badge svg { width: 100%; height: 100%; }
.sp-yt-split.is-enter .sp-ytsplit-top b { animation: sp-mask-up .5s cubic-bezier(.2, .9, .25, 1) calc(var(--sp-step) * 2.2) forwards; }
.sp-yt-split.is-enter .sp-ytsplit-bottom small, .sp-yt-split.is-enter .sp-ytsplit-badge { animation: sp-split-down .5s cubic-bezier(.2, .9, .25, 1) calc(var(--sp-step) * 2.8) forwards; }
.sp-yt-split.is-exit .sp-ytsplit-top b { animation: sp-mask-down .3s ease forwards; }
.sp-yt-split.is-exit .sp-ytsplit-bottom small, .sp-yt-split.is-exit .sp-ytsplit-badge { animation: sp-split-up .3s ease forwards; }

@keyframes sp-split-down { from { transform: translateY(-110%); } to { transform: translateY(0); } }
@keyframes sp-split-up { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-110%); opacity: 0; } }

/* ============ YT 9 · HUD-рамка ============ */
.sp-yt-hud .sp-ythud {
  position: relative;
  padding: 15px 20px;
  background: rgba(8, 8, 12, .5);
  backdrop-filter: blur(4px);
}
.sp-ythud-corner { position: absolute; width: 16px; height: 16px; border: 2px solid var(--sp-accent); opacity: 0; }
.sp-ythud-corner.is-tl { left: 0; top: 0; border-right: 0; border-bottom: 0; }
.sp-ythud-corner.is-tr { right: 0; top: 0; border-left: 0; border-bottom: 0; }
.sp-ythud-corner.is-bl { left: 0; bottom: 0; border-right: 0; border-top: 0; }
.sp-ythud-corner.is-br { right: 0; bottom: 0; border-left: 0; border-top: 0; }
.sp-yt-hud.is-enter .sp-ythud-corner { animation: sp-hud-corner .4s ease forwards; }
.sp-yt-hud.is-enter .sp-ythud-corner.is-tr { animation-delay: .12s; }
.sp-yt-hud.is-enter .sp-ythud-corner.is-bl { animation-delay: .2s; }
.sp-yt-hud.is-enter .sp-ythud-corner.is-br { animation-delay: .3s; }

@keyframes sp-hud-corner { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }

.sp-ythud-scan { position: absolute; left: 3px; right: 3px; top: 0; height: 1.5px; background: linear-gradient(90deg, transparent, var(--sp-accent), transparent); opacity: 0; }
.sp-yt-hud.is-idle .sp-ythud-scan { animation: sp-scan 4.2s ease-in-out .8s infinite; }
.sp-ythud-copy { display: flex; align-items: center; gap: 12px; }
.sp-ythud-icon { width: 34px; height: 25px; flex: 0 0 auto; }
.sp-ythud-icon svg { width: 100%; height: 100%; }
.sp-yt-hud.is-enter .sp-ythud-copy { opacity: 0; animation: sp-fade-in .5s ease calc(var(--sp-step) * 3) forwards; }
.sp-ythud-copy b { display: block; font-size: 14.5px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 800; }
.sp-ythud-copy small { display: block; font-size: 12px; color: var(--sp-ink-dim); font-weight: 650; letter-spacing: .6px; margin-top: 2px; }
.sp-ythud-copy .sp-url { letter-spacing: .2px; text-transform: none; }

/* ============ TT 5 · Глитч-строка ============ */
.sp-tt-glitch .sp-ttglitch { display: grid; gap: 4px; justify-items: start; }
.sp-ttglitch-stack { position: relative; display: grid; }
.sp-ttglitch-stack b {
  grid-area: 1 / 1;
  font-size: 27px;
  font-weight: 850;
  letter-spacing: .4px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .6);
  white-space: nowrap;
}
.sp-ttglitch-stack .is-cyan { color: var(--sp-accent); opacity: 0; }
.sp-ttglitch-stack .is-pink { color: var(--sp-accent2, #fe2c55); opacity: 0; }
.sp-ttglitch-stack .is-base { opacity: 0; }
.sp-tt-glitch.is-enter .is-cyan { animation: sp-glitch-cyan .8s cubic-bezier(.2, .8, .25, 1) calc(var(--sp-step)) forwards; }
.sp-tt-glitch.is-enter .is-pink { animation: sp-glitch-pink .8s cubic-bezier(.2, .8, .25, 1) calc(var(--sp-step) * 1.4) forwards; }
.sp-tt-glitch.is-enter .is-base { animation: sp-fade-in .3s ease calc(var(--sp-step) * 3) forwards; }
.sp-tt-glitch.is-idle .is-cyan { opacity: .35; transform: translate(-1.5px, -1px); }
.sp-tt-glitch.is-idle .is-pink { opacity: .35; transform: translate(1.5px, 1px); }
.sp-tt-glitch.is-idle .is-base { opacity: 1; }

@keyframes sp-glitch-cyan {
  0% { opacity: 0; transform: translate(-26px, -6px) skewX(-8deg); }
  55% { opacity: .9; transform: translate(3px, 1px) skewX(2deg); }
  100% { opacity: .35; transform: translate(-1.5px, -1px) skewX(0); }
}
@keyframes sp-glitch-pink {
  0% { opacity: 0; transform: translate(26px, 6px) skewX(8deg); }
  55% { opacity: .9; transform: translate(-3px, -1px) skewX(-2deg); }
  100% { opacity: .35; transform: translate(1.5px, 1px) skewX(0); }
}

.sp-ttglitch-handle { font-size: 14px; font-weight: 750; color: var(--sp-ink-dim); text-shadow: 0 2px 8px rgba(0, 0, 0, .6); opacity: 0; }
.sp-tt-glitch.is-enter .sp-ttglitch-handle { animation: sp-fade-in .4s ease calc(var(--sp-step) * 4) forwards; }

/* ============ TT 6 · Мини-виджет ============ */
.sp-tt-corner .sp-ttcorner {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  background: var(--sp-plate);
  border: 1px solid var(--sp-plate-line);
  border-radius: 11px;
  box-shadow: var(--sp-shadow);
  backdrop-filter: blur(6px);
}
.sp-ttcorner-icon { width: 22px; height: 22px; }
.sp-ttcorner-icon svg { width: 100%; height: 100%; }
.sp-ttcorner-copy { display: grid; gap: 0; }
.sp-ttcorner-copy b { font-size: 12.5px; }
.sp-ttcorner-copy small { font-size: 11px; color: var(--sp-ink-dim); font-weight: 650; }
.sp-ttcorner-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sp-accent2, #fe2c55); align-self: flex-start; }
.sp-tt-corner.is-idle .sp-ttcorner-dot { animation: sp-dot-blink 2.6s ease-in-out 1s infinite; }

@keyframes sp-dot-blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.8); }
}

/* ============ QR-бокс: подача импортированного (прозрачного) QR ============
   Сам QR остаётся неподвижным и неискажённым — анимируется только контейнер. */
.sp-qrbox {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--qr-size, 156px);
  /* Высота подстраивается под пропорции ассета: вертикальные Telegram-QR
     (аватар сверху, ник снизу) не обрезаются. Потолок — 1.6 ширины. */
  height: auto;
  min-height: calc(var(--qr-size, 156px) * .55);
  padding: var(--qr-pad, 10px);
  border-radius: var(--qr-radius, 16px);
  box-sizing: content-box;
}

.sp-qrbox img {
  width: 100%;
  height: auto;
  max-height: calc(var(--qr-size, 156px) * 1.6);
  object-fit: contain;
  border-radius: calc(var(--qr-radius, 16px) * .55);
}

.sp-qrbox.is-fit-fill { height: var(--qr-size, 156px); }
.sp-qrbox.is-fit-fill img { height: 100%; object-fit: cover; }
.sp-qrbox.is-fit-natural { width: auto; min-width: calc(var(--qr-size, 156px) * .55); }
.sp-qrbox.is-fit-natural img { width: auto; height: auto; max-width: var(--qr-size, 156px); max-height: calc(var(--qr-size, 156px) * 1.6); }

/* Подложки */
.sp-qrbox.is-plate-none { padding: 0; }
.sp-qrbox.is-plate-soft { background: rgba(12, 11, 18, .62); border: 1px solid rgba(255, 255, 255, .1); }
.sp-qrbox.is-plate-glass { background: rgba(20, 19, 30, .45); border: 1px solid rgba(255, 255, 255, .2); backdrop-filter: blur(8px); }
.sp-qrbox.is-plate-card { background: #fff; border: 1px solid rgba(0, 0, 0, .06); }
.sp-qrbox.is-plate-glow { background: transparent; }
.sp-qrbox.is-plate-glow::before {
  content: "";
  position: absolute;
  inset: -14%;
  border-radius: 50%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(12, 11, 18, .78), transparent 72%);
  z-index: -1;
}

/* Эффекты — позади кода, не поверх */
.sp-qrbox.has-shadow { filter: drop-shadow(0 12px 28px rgba(0, 0, 0, .45)); }
.sp-qrbox.has-glow::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  box-shadow: 0 0 26px color-mix(in srgb, var(--sp-accent) 55%, transparent);
  pointer-events: none;
  z-index: -1;
}
.sp-qrbox.has-outline { outline: 1.5px solid rgba(255, 255, 255, .35); outline-offset: 2px; }
.sp-qrbox.is-tinted.is-plate-soft, .sp-qrbox.is-tinted.is-plate-glass { border-color: color-mix(in srgb, var(--sp-accent) 55%, transparent); }
.sp-qrbox.is-tinted.has-outline { outline-color: color-mix(in srgb, var(--sp-accent) 70%, transparent); }

/* ============ TGQ 1 · Свободный QR ============ */
.sp-tgq-float .sp-tgqfloat { display: grid; gap: 8px; justify-items: center; text-shadow: 0 2px 10px rgba(0, 0, 0, .6); }
.sp-tgqfloat-label b { font-size: 15px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; }
.sp-tgqfloat-handle small { font-size: 13.5px; color: var(--sp-ink-dim); font-weight: 700; }
.sp-tgqfloat-qr { opacity: 0; transform: scale(.86); }
.sp-tgq-float.is-enter .sp-tgqfloat-qr { animation: sp-scale-in .65s cubic-bezier(.25, 1.1, .35, 1) calc(var(--sp-step) * 1.6) forwards; }
.sp-tgq-float.is-idle .sp-tgqfloat-qr { opacity: 1; transform: scale(1); animation: sp-qr-float 5.6s ease-in-out 1.2s infinite; }
.sp-tgq-float.is-exit .sp-tgqfloat-qr { animation: sp-qr-away .45s ease-in forwards; }

@keyframes sp-qr-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-5px) scale(1.005); }
}
@keyframes sp-qr-away { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(.9); } }

/* ============ TGQ 2 · Аватар-промо ============ */
.sp-tgq-avatar .sp-tgqavatar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 17px;
  background: var(--sp-plate);
  border: 1px solid var(--sp-plate-line);
  border-radius: 19px;
  box-shadow: var(--sp-shadow);
  backdrop-filter: blur(7px);
}
.sp-tgqavatar-side { display: grid; gap: 10px; justify-items: start; }
.sp-tgqavatar-face { position: relative; width: 54px; height: 54px; }
.sp-tgqavatar-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.sp-tgqavatar-badge { position: absolute; right: -6px; bottom: -5px; width: 22px; height: 22px; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .5)); }
.sp-tgqavatar-badge svg { width: 100%; height: 100%; }
.sp-tgq-avatar.is-enter .sp-tgqavatar-face { animation: sp-spring-pop .6s cubic-bezier(.3, 1.7, .4, 1) both; }
.sp-tgqavatar-copy { display: grid; gap: 2px; }
.sp-tgqavatar-copy b { font-size: 16px; }
.sp-tgqavatar-copy small { font-size: 13.5px; color: var(--sp-ink-dim); font-weight: 700; }
.sp-tgqavatar-copy em { font-style: normal; font-size: 12px; color: var(--sp-accent); font-weight: 750; letter-spacing: .4px; text-transform: uppercase; }
.sp-tgqavatar-qr { opacity: 0; transform: scale(.82); }
.sp-tgq-avatar.is-enter .sp-tgqavatar-qr { animation: sp-scale-in .6s cubic-bezier(.25, 1.15, .35, 1) calc(var(--sp-step) * 2.6) forwards; }
.sp-tgq-avatar.is-exit .sp-tgqavatar-qr { animation: sp-qr-away .35s ease-in forwards; }
.sp-tgq-avatar.is-exit .sp-tgqavatar-face { animation: sp-icon-pop .4s ease-in reverse forwards; animation-delay: .2s; }

/* ============ TGQ 3 · Мини-маяк ============ */
.sp-tgq-beacon .sp-tgqbeacon { display: flex; align-items: center; gap: 0; }
.sp-tgqbeacon-icon { position: relative; width: 34px; height: 34px; flex: 0 0 auto; }
.sp-tgqbeacon-icon svg { width: 100%; height: 100%; }
.sp-tgq-beacon.is-enter .sp-tgqbeacon-icon { animation: sp-icon-pop .5s cubic-bezier(.34, 1.6, .45, 1) both; }
.sp-tgqbeacon-line { width: 26px; height: 1.5px; background: linear-gradient(90deg, var(--sp-accent), transparent 92%); transform: scaleX(0); transform-origin: left; margin: 0 4px; }
.sp-tgq-beacon.is-enter .sp-tgqbeacon-line { animation: sp-underline-draw .45s ease-out calc(var(--sp-step) * 2.2) forwards; }
.sp-tgqbeacon-body { display: grid; gap: 6px; justify-items: center; }
.sp-tgqbeacon-qr { opacity: 0; transform: scale(.85); }
.sp-tgq-beacon.is-enter .sp-tgqbeacon-qr { animation: sp-scale-in .55s cubic-bezier(.25, 1.15, .35, 1) calc(var(--sp-step) * 3.4) forwards; }
.sp-tgq-beacon.is-exit .sp-tgqbeacon-qr { animation: sp-qr-away .35s ease-in forwards; }
.sp-tgqbeacon-label { font-size: 12.5px; font-weight: 750; color: var(--sp-ink-dim); text-shadow: 0 1px 6px rgba(0, 0, 0, .6); opacity: 0; }
.sp-tgq-beacon.is-enter .sp-tgqbeacon-label { animation: sp-fade-in .4s ease calc(var(--sp-step) * 4.4) forwards; }

/* ============ TGQ 4 · Опорная карта ============ */
.sp-tgq-card .sp-tgqcard {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  background: linear-gradient(155deg, rgba(26, 24, 38, .82), rgba(13, 12, 20, .88));
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 20px;
  box-shadow: var(--sp-shadow), inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(8px);
}
.sp-tgqcard-qr { flex: 0 0 auto; opacity: 0; transform: translateY(6px) scale(.92); }
.sp-tgq-card.is-enter .sp-tgqcard-qr { animation: sp-qr-settle .6s cubic-bezier(.25, 1.1, .35, 1) calc(var(--sp-step) * 1.4) forwards; }

@keyframes sp-qr-settle { to { opacity: 1; transform: translateY(0) scale(1); } }

.sp-tgqcard-copy { display: grid; gap: 3px; }
.sp-tgqcard-icon { width: 30px; height: 30px; margin-bottom: 3px; }
.sp-tgqcard-icon svg { width: 100%; height: 100%; }
.sp-tgqcard-copy b { font-size: 16.5px; }
.sp-tgqcard-copy small { font-size: 13.5px; color: var(--sp-ink-dim); font-weight: 700; }
.sp-tgqcard-copy u { text-decoration: none; font-size: 12px; color: var(--sp-accent); font-weight: 700; }
.sp-tgqcard-copy em { font-style: normal; font-size: 11.5px; color: var(--sp-ink-dim); letter-spacing: .4px; text-transform: uppercase; font-weight: 750; }
.sp-tgq-card.is-enter .sp-tgqcard-copy { opacity: 0; animation: sp-slide-in .5s ease calc(var(--sp-step) * 2.8) forwards; }

/* ============ TGQ 5 · Раскрытие ============ */
.sp-tgq-reveal .sp-tgqreveal {
  display: flex;
  align-items: stretch;
  background: var(--sp-plate);
  border: 1px solid var(--sp-plate-line);
  border-radius: 18px;
  box-shadow: var(--sp-shadow);
  backdrop-filter: blur(6px);
  overflow: hidden;
}
.sp-tgqreveal-card { display: flex; align-items: center; gap: 12px; padding: 15px 17px; }
.sp-tgqreveal-icon { width: 40px; height: 40px; flex: 0 0 auto; }
.sp-tgqreveal-icon svg { width: 100%; height: 100%; }
.sp-tgq-reveal.is-enter .sp-tgqreveal-icon { animation: sp-icon-pop .55s cubic-bezier(.34, 1.6, .45, 1) both; }
.sp-tgqreveal-copy { display: grid; gap: 2px; }
.sp-tgqreveal-copy b { font-size: 15.5px; }
.sp-tgqreveal-copy small { font-size: 12.5px; color: var(--sp-ink-dim); font-weight: 700; }
.sp-tgqreveal-drawer {
  display: grid;
  place-items: center;
  padding: 12px 12px 12px 0;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
}
.sp-tgq-reveal.is-enter .sp-tgqreveal-drawer { animation: sp-drawer-open .7s cubic-bezier(.25, .95, .3, 1) var(--sp-reveal, .9s) forwards; }
.sp-tgq-reveal.is-exit .sp-tgqreveal-drawer { animation: sp-drawer-close .45s ease-in forwards; }
.sp-tgq-reveal.is-exit .sp-tgqreveal-card { animation: sp-root-out .4s ease-in .3s forwards; }

@keyframes sp-drawer-open { to { max-width: 480px; opacity: 1; } }
@keyframes sp-drawer-close { from { max-width: 480px; opacity: 1; } to { max-width: 0; opacity: 0; } }

/* ============ TGQ 6 · Спотлайт ============ */
.sp-tgq-spotlight .sp-tgqspot { display: grid; gap: 10px; justify-items: center; text-shadow: 0 2px 12px rgba(0, 0, 0, .65); }
.sp-tgqspot-words { display: flex; gap: 10px; }
.sp-tgqspot-words .sp-kword i { font-size: 26px; letter-spacing: 2.5px; }
.sp-tgqspot-words .sp-kword:last-child i { color: var(--sp-accent); }
.sp-tgqspot-stage { position: relative; display: grid; place-items: center; }
.sp-tgqspot-qr { opacity: 0; clip-path: inset(50% 50% 50% 50% round 20px); }
.sp-tgq-spotlight.is-enter .sp-tgqspot-qr { animation: sp-spot-open .8s cubic-bezier(.25, .95, .3, 1) calc(var(--sp-step) * 3.4) forwards; }
.sp-tgq-spotlight.is-exit .sp-tgqspot-qr { animation: sp-spot-close .45s ease-in forwards; }

@keyframes sp-spot-open { from { opacity: 0; clip-path: inset(50% 50% 50% 50% round 20px); } to { opacity: 1; clip-path: inset(0 0 0 0 round 8px); } }
@keyframes sp-spot-close { from { opacity: 1; clip-path: inset(0 0 0 0 round 8px); } to { opacity: 0; clip-path: inset(50% 50% 50% 50% round 20px); } }

.sp-tgqspot-halo { position: absolute; inset: -12px; border-radius: 26px; border: 1.5px solid color-mix(in srgb, var(--sp-accent) 65%, transparent); opacity: 0; pointer-events: none; }
.sp-tgq-spotlight.is-enter .sp-tgqspot-halo { animation: sp-halo-once 1s ease-out calc(var(--sp-step) * 3.4 + .5s); }

@keyframes sp-halo-once {
  0% { opacity: .9; transform: scale(.92); }
  100% { opacity: 0; transform: scale(1.12); }
}

.sp-tgqspot-handle { font-size: 14px; font-weight: 750; color: var(--sp-ink-dim); opacity: 0; }
.sp-tgq-spotlight.is-enter .sp-tgqspot-handle { animation: sp-fade-in .45s ease calc(var(--sp-step) * 5) forwards; }

/* ============ Action atoms: one component in Preview and OBS ============ */
.sp-action-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 410px;
  padding: 13px 15px;
  border: 1px solid var(--sp-plate-line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(20, 18, 29, .96), rgba(10, 10, 16, .9));
  box-shadow: var(--sp-shadow);
  overflow: visible;
}
.sp-action-avatar { position: relative; width: 52px; height: 52px; flex: 0 0 auto; }
.sp-action-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.sp-action-avatar > i { position: absolute; width: 22px; height: 22px; right: -5px; bottom: -4px; filter: drop-shadow(0 2px 5px #0009); }
.sp-action-avatar > i svg { width: 100%; height: 100%; }
.sp-action-copy { display: grid; gap: 3px; min-width: 120px; flex: 1 1 auto; }
.sp-action-copy b { font-size: 16px; }
.sp-action-copy small { color: var(--sp-ink-dim); font-size: 12.5px; font-weight: 650; }
.sp-action-button {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 118px;
  min-height: 38px;
  padding: 9px 14px;
  border-radius: 11px;
  background: var(--sp-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  transform-origin: center;
  transition: transform .09s ease, filter .14s ease, box-shadow .18s ease;
}
.sp-action-button.is-tiktok { color: #080a0e; box-shadow: 3px 3px 0 var(--sp-accent2); }
.sp-action-idle, .sp-action-done { grid-area: 1 / 1; display: inline-flex; align-items: center; gap: 5px; }
.sp-action-done { opacity: 0; transform: translateY(110%); }
.sp-action-done svg { width: 15px; height: 15px; }
.sp-action-ripple { position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border: 2px solid #fff; border-radius: 50%; opacity: 0; }
.sp-action-cursor { position: absolute; z-index: 8; left: 0; top: 0; width: 27px; height: 34px; opacity: 0; pointer-events: none; filter: drop-shadow(0 3px 5px #0008); will-change: left, top, opacity, transform; }
.sp-action-cursor svg { width: 100%; height: 100%; }
.sp-action-cursor > i { position: absolute; width: 9px; height: 9px; border: 1.5px solid #fff; border-radius: 50%; left: -3px; top: -3px; opacity: 0; }
.sp.is-cursor-disabled .sp-action-cursor { display: none !important; }
.sp.sp-cursor-dark .sp-action-cursor path { fill: #11131a; stroke: #fff; }
.sp.sp-cursor-light .sp-action-cursor { filter: drop-shadow(0 2px 6px #000) drop-shadow(0 0 3px #fff8); }
.sp.sp-cursor-minimal .sp-action-cursor { width: 22px; height: 28px; filter: drop-shadow(0 2px 4px #0009); }
.sp.is-enter .sp-action-card { animation: sp-action-card-in .68s cubic-bezier(.22, 1.22, .3, 1) both; }
.sp.is-hover .sp-action-button { filter: brightness(1.12); }
.sp.is-pressed .sp-action-button { transform: scale(.96); filter: brightness(1.2); }
.sp.is-clicked .sp-action-button { animation: sp-action-feedback .38s cubic-bezier(.25, 1.25, .35, 1) both; }
.sp.is-confirmed .sp-action-idle { animation: sp-action-old-out .2s ease forwards; }
.sp.is-confirmed .sp-action-done { animation: sp-action-new-in .34s cubic-bezier(.2, 1.2, .3, 1) .08s forwards; }
.sp.is-clicked .sp-action-ripple { animation: sp-action-ripple .52s ease-out; }
.sp.is-cursor-moving .sp-action-cursor { animation: sp-cursor-travel var(--sp-cursor-travel, .52s) cubic-bezier(.22, .72, .22, 1) both; }
.sp.is-clicked .sp-action-cursor > i { animation: sp-click-ring .38s ease-out; }
.sp.is-pressed .sp-action-cursor svg { transform: scale(.84); transform-origin: 4px 3px; }
.sp.is-confirmed .sp-action-cursor { animation: sp-cursor-away .3s ease-in both; }
.sp.is-exit .sp-action-cursor { opacity: 0 !important; animation: none !important; }
.sp.is-exit .sp-action-card { animation: sp-action-card-out .55s cubic-bezier(.55, 0, .8, .4) forwards; }

@keyframes sp-action-card-in { from { opacity: 0; transform: translateY(18px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes sp-action-card-out { 0% { opacity: 1; transform: none; } 55% { opacity: 1; transform: translateY(4px) scale(.98); } 100% { opacity: 0; transform: translateY(14px) scale(.9); } }
@keyframes sp-action-press { 0%, 100% { transform: scale(1); } 46% { transform: scale(.89); filter: brightness(1.18); } }
@keyframes sp-action-feedback { 0% { transform: scale(.96); } 55% { transform: scale(1.035); } 100% { transform: scale(1); } }
@keyframes sp-action-old-out { to { opacity: 0; transform: translateY(-110%); } }
@keyframes sp-action-new-in { to { opacity: 1; transform: translateY(0); } }
@keyframes sp-action-ripple { 0% { opacity: .7; transform: scale(.2); } 100% { opacity: 0; transform: scale(5); } }
@keyframes sp-click-ring { 0% { opacity: .9; transform: scale(.3); } 100% { opacity: 0; transform: scale(2.4); } }
@keyframes sp-cursor-travel {
  0% { opacity: 0; left: var(--sp-cursor-start-x); top: var(--sp-cursor-start-y); transform: rotate(-7deg) scale(.94); }
  16% { opacity: 1; }
  72% { opacity: 1; transform: rotate(-2deg) scale(1.02); }
  100% { opacity: 1; left: var(--sp-cursor-target-x); top: var(--sp-cursor-target-y); transform: rotate(0) scale(1); }
}
@keyframes sp-cursor-away {
  from { opacity: 1; left: var(--sp-cursor-target-x); top: var(--sp-cursor-target-y); }
  to { opacity: 0; left: calc(var(--sp-cursor-target-x) + 18px); top: calc(var(--sp-cursor-target-y) + 20px); transform: rotate(5deg) scale(.92); }
}

/* ============ Status glitch ============ */
.sp-status-glitch { position: relative; display: grid; justify-items: start; gap: 7px; min-width: 340px; text-shadow: 0 3px 14px #000a; }
.sp-status-brand { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--sp-ink-dim); font-weight: 700; }
.sp-status-brand > svg { width: 31px; height: 25px; }
.sp-status-word { position: relative; display: grid; font-size: 34px; line-height: 1; font-weight: 900; letter-spacing: 2px; }
.sp-status-word > * { grid-area: 1 / 1; }
.sp-status-word strong { opacity: 0; color: #fff; }
.sp-status-word > i, .sp-status-word > em { font-style: normal; opacity: 0; overflow: hidden; background: var(--sp-accent); mix-blend-mode: screen; }
.sp-status-glitch.is-placeholder { visibility: hidden; }
.sp.is-enter .sp-status-glitch { animation: sp-glitch-enter .55s ease both; }
.sp.is-clicked .sp-status-word b { animation: sp-glitch-old .42s steps(2, end) forwards; }
.sp.is-confirmed .sp-status-word strong { animation: sp-glitch-new .5s steps(2, end) forwards; }
.sp.is-clicked .sp-status-word > i { animation: sp-glitch-slice-a .45s steps(3, end) .03s; }
.sp.is-clicked .sp-status-word > em { animation: sp-glitch-slice-b .38s steps(2, end) .08s; }
.sp.is-exit .sp-status-glitch { animation: sp-glitch-exit .5s ease-in forwards; }
@keyframes sp-glitch-enter { from { opacity: 0; transform: translateX(-18px); filter: blur(5px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes sp-glitch-old { 20% { transform: translateX(8px); color: var(--sp-accent); } 50% { transform: translateX(-5px); clip-path: inset(30% 0 35% 0); } 100% { opacity: 0; transform: scaleX(.2); } }
@keyframes sp-glitch-new { 0% { opacity: 0; transform: translateX(12px); } 45% { opacity: .5; color: var(--sp-accent); transform: translateX(-4px); } 100% { opacity: 1; transform: none; } }
@keyframes sp-glitch-slice-a { 0%, 100% { opacity: 0; } 25%, 70% { opacity: .8; clip-path: inset(18% 0 62% 0); transform: translateX(12px); } }
@keyframes sp-glitch-slice-b { 0%, 100% { opacity: 0; } 30%, 72% { opacity: .65; clip-path: inset(66% 0 12% 0); transform: translateX(-10px); background: var(--sp-accent2, #36e6ff); } }
@keyframes sp-glitch-exit { 0% { opacity: 1; } 45% { opacity: 1; transform: skewX(-8deg) scaleY(.18); } 75% { opacity: .8; transform: scaleX(.55) scaleY(.04); } 100% { opacity: 0; transform: scaleX(0) scaleY(.02); } }

/* ============ Morphing and creator compositions ============ */
.sp-ytmorph, .sp-twheartmorph, .sp-ttfloating { position: relative; display: flex; align-items: center; }
.sp-ytmorph-core, .sp-twheartmorph-core, .sp-ttfloating-glyph { position: relative; z-index: 2; display: grid; place-items: center; width: 62px; height: 62px; flex: 0 0 auto; border-radius: 18px; background: rgba(12, 11, 18, .94); border: 1px solid var(--sp-plate-line); box-shadow: var(--sp-shadow); color: var(--sp-accent); }
.sp-ytmorph-core i { grid-area: 1 / 1; width: 30px; height: 30px; }
.sp-ytmorph-core i svg, .sp-twheartmorph-core i svg, .sp-ttfloating-glyph > svg { width: 100%; height: 100%; }
.sp-ytmorph-core .is-logo { opacity: 0; width: 38px; }
.sp-twheartmorph-core i { position: absolute; inset: 12px; }
.sp-twheartmorph-core .is-fill { opacity: 0; transform: scale(.65); }
.sp-ytmorph-body, .sp-twheartmorph-body, .sp-ttfloating-body { display: grid; gap: 3px; max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap; padding: 11px 0; background: rgba(12, 11, 18, .94); border: 1px solid transparent; border-radius: 0 16px 16px 0; }
.sp-ytmorph-body b, .sp-twheartmorph-body b, .sp-ttfloating-body b { font-size: 16px; }
.sp-ytmorph-body small, .sp-twheartmorph-body small, .sp-ttfloating-body small { font-size: 12.5px; color: var(--sp-ink-dim); font-weight: 650; }
.sp-ytmorph-body .sp-action-button, .sp-twheartmorph-body .sp-action-button, .sp-ttfloating-body .sp-action-button { margin-top: 5px; justify-self: start; min-height: 32px; padding: 7px 12px; }
.sp-yt-morph-play.is-enter .sp-ytmorph-core .is-play { animation: sp-morph-out .35s ease .3s forwards; }
.sp-yt-morph-play.is-enter .sp-ytmorph-core .is-logo { animation: sp-morph-in .42s cubic-bezier(.2, 1.3, .3, 1) .48s forwards; }
.sp-yt-morph-play.is-enter .sp-ytmorph-body,
.sp-tw-heart-morph.is-enter .sp-twheartmorph-body,
.sp-tt-floating-glyph.is-enter .sp-ttfloating-body { animation: sp-morph-panel-in .68s cubic-bezier(.2, .9, .25, 1) .42s forwards; }
.sp-tw-heart-morph.is-confirmed .sp-twheartmorph-core .is-outline,
.sp-tw-docked-heart-follow.is-confirmed .sp-twheartmorph-core .is-outline { animation: sp-morph-out .3s ease forwards; }
.sp-tw-heart-morph.is-confirmed .sp-twheartmorph-core .is-fill,
.sp-tw-docked-heart-follow.is-confirmed .sp-twheartmorph-core .is-fill { animation: sp-heart-fill .42s cubic-bezier(.2, 1.4, .3, 1) forwards; }
.sp-ttfloating-glyph > i, .sp-ttfloating-glyph > em { position: absolute; inset: -6px; border: 2px solid var(--sp-accent); border-radius: 50%; opacity: 0; }
.sp-tt-floating-glyph.is-idle .sp-ttfloating-glyph > i { animation: sp-pulse 2.8s ease-out infinite; }
.sp-tt-floating-glyph.is-idle .sp-ttfloating-glyph > em { border-color: var(--sp-accent2); animation: sp-pulse 2.8s ease-out 1.4s infinite; }
.sp-yt-morph-play.is-exit .sp-ytmorph-body, .sp-tw-heart-morph.is-exit .sp-twheartmorph-body, .sp-tt-floating-glyph.is-exit .sp-ttfloating-body { animation: sp-morph-panel-out .42s ease-in forwards; }
.sp-yt-morph-play.is-exit .sp-ytmorph-core .is-logo { animation: sp-morph-out .25s ease .22s forwards; }
.sp-yt-morph-play.is-exit .sp-ytmorph-core .is-play { animation: sp-morph-in .28s ease .32s forwards; }
@keyframes sp-morph-panel-in { to { max-width: 360px; opacity: 1; padding-left: 16px; padding-right: 16px; border-color: var(--sp-plate-line); } }
@keyframes sp-morph-panel-out { from { max-width: 360px; opacity: 1; padding-left: 16px; padding-right: 16px; } to { max-width: 0; opacity: 0; padding-left: 0; padding-right: 0; } }

.sp-ytfloatcreator, .sp-twcreator { position: relative; display: grid; grid-template-columns: auto minmax(150px, 1fr) auto; align-items: center; gap: 14px; padding: 16px 18px; border: 1px solid var(--sp-plate-line); border-radius: 22px; background: linear-gradient(135deg, rgba(22, 19, 30, .98), rgba(9, 9, 14, .91)); box-shadow: var(--sp-shadow); overflow: visible; }
.sp-ytfloat-avatar, .sp-twcreator-avatar { position: relative; width: 66px; height: 66px; }
.sp-ytfloat-img, .sp-twcreator-img { width: 100%; height: 100%; border-radius: 20px; object-fit: cover; }
.sp-ytfloat-avatar i, .sp-twcreator-avatar i { position: absolute; right: -7px; bottom: -6px; width: 26px; height: 22px; }
.sp-ytfloat-avatar i svg, .sp-twcreator-avatar i svg { width: 100%; height: 100%; }
.sp-ytfloat-copy, .sp-twcreator-copy { display: grid; gap: 3px; }
.sp-ytfloat-copy small, .sp-twcreator-copy small { font-size: 10px; letter-spacing: 1.4px; color: var(--sp-accent); font-weight: 850; }
.sp-ytfloat-copy b, .sp-twcreator-copy b { font-size: 17px; }
.sp-twcreator-copy em { font-style: normal; font-size: 12px; color: var(--sp-ink-dim); }
.sp-ytfloat-action, .sp-twcreator-action { position: relative; }
.sp-twcreator-accent { position: absolute; left: 0; top: 15px; bottom: 15px; width: 3px; background: var(--sp-accent); border-radius: 3px; }
.sp-yt-floating-creator.is-enter .sp-ytfloat-avatar, .sp-tw-streamer-card.is-enter .sp-twcreator-avatar { animation: sp-spring-pop .65s cubic-bezier(.3, 1.7, .4, 1) both; }
.sp-yt-floating-creator.is-enter .sp-ytfloat-copy, .sp-tw-streamer-card.is-enter .sp-twcreator-copy { animation: sp-slide-in .5s ease .25s both; }
.sp-yt-floating-creator.is-enter .sp-ytfloat-action, .sp-tw-streamer-card.is-enter .sp-twcreator-action { animation: sp-rise-in .5s ease .42s both; }
.sp-yt-floating-creator.is-exit .sp-ytfloatcreator, .sp-tw-streamer-card.is-exit .sp-twcreator { animation: sp-layered-card-out .62s ease-in forwards; }
@keyframes sp-layered-card-out { 0% { opacity: 1; transform: none; } 40% { transform: translateY(3px) scale(.98); } 100% { opacity: 0; transform: translateX(-24px) scale(.92); } }

/* ============ Edge CTA ============ */
.sp-edge-action { position: relative; display: flex; align-items: center; min-height: 60px; overflow: visible; }
.sp-edge-rail { width: 4px; height: 58px; border-radius: 4px; background: var(--sp-accent); box-shadow: 0 0 14px color-mix(in srgb, var(--sp-accent) 70%, transparent); }
.sp-edge-logo { display: grid; place-items: center; width: 54px; height: 54px; background: rgba(10, 10, 15, .94); }
.sp-edge-logo svg { width: 29px; height: 26px; }
.sp-edge-copy { display: grid; gap: 4px; max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap; background: rgba(10, 10, 15, .94); border-radius: 0 13px 13px 0; }
.sp-edge-copy small { font-size: 11px; color: var(--sp-ink-dim); font-weight: 700; }
.sp-edge-copy .sp-action-button { min-width: 112px; min-height: 31px; padding: 6px 10px; }
.sp.is-enter .sp-edge-rail { animation: sp-edge-rail-in .42s ease-out both; transform-origin: center; }
.sp.is-enter .sp-edge-copy { animation: sp-edge-copy-in .55s cubic-bezier(.2, .9, .25, 1) .3s forwards; }
.sp.is-exit .sp-edge-copy { animation: sp-edge-copy-out .38s ease-in forwards; }
.sp.is-exit .sp-edge-logo { animation: sp-root-out .25s ease .28s forwards; }
.sp.is-exit .sp-edge-rail { animation: sp-line-draw .3s ease .32s reverse forwards; }
@keyframes sp-edge-copy-in { to { max-width: 260px; opacity: 1; padding: 8px 14px 8px 2px; } }
@keyframes sp-edge-copy-out { from { max-width: 260px; opacity: 1; padding-right: 14px; } to { max-width: 0; opacity: 0; padding-right: 0; } }
/* sp-line-draw растёт из scaleY(0), но у рейла нет такого базового состояния —
   анимация была no-op. Явный from чинит прорисовку линии. */
@keyframes sp-edge-rail-in { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* ============ TikTok swipe / side clip ============ */
.sp-ttswipe { position: relative; display: flex; align-items: center; gap: 14px; }
.sp-ttswipe-frame { position: relative; display: grid; place-items: center; width: 80px; height: 126px; border: 2px solid var(--sp-plate-line); border-radius: 20px; background: #0c0d13; overflow: hidden; box-shadow: var(--sp-shadow); }
.sp-ttswipe-frame > i, .sp-ttswipe-frame > em, .sp-ttswipe-frame > strong { position: absolute; width: 32px; height: 32px; display: grid; place-items: center; font-style: normal; }
.sp-ttswipe-frame svg { width: 100%; height: 100%; }
.sp-ttswipe-frame > em, .sp-ttswipe-frame > strong { opacity: 0; }
.sp-ttswipe-frame > u { position: absolute; left: 8px; right: 8px; height: 2px; top: 90%; background: linear-gradient(90deg, var(--sp-accent), var(--sp-accent2)); }
.sp-tt-swipe-reveal.is-enter .sp-ttswipe-frame { animation: sp-spring-pop .58s cubic-bezier(.3, 1.6, .4, 1) both; }
.sp-tt-swipe-reveal.is-enter .sp-ttswipe-frame > i { animation: sp-step-show .5s ease .25s both; }
.sp-tt-swipe-reveal.is-enter .sp-ttswipe-frame > em { animation: sp-step-swipe .58s ease .62s both; }
.sp-tt-swipe-reveal.is-enter .sp-ttswipe-frame > strong { animation: sp-scale-in .4s ease 1.03s forwards; }
.sp-ttswipe-profile { display: grid; gap: 3px; min-width: 190px; opacity: 0; }
.sp-ttswipe-profile b { font-size: 17px; }
.sp-ttswipe-profile small { color: var(--sp-ink-dim); font-size: 12.5px; font-weight: 650; }
.sp-ttswipe-profile .sp-action-button { justify-self: start; margin-top: 6px; }
.sp-tt-swipe-reveal.is-enter .sp-ttswipe-profile { animation: sp-slide-in .5s ease 1.1s forwards; }
.sp-tt-swipe-reveal.is-exit .sp-ttswipe { animation: sp-action-card-out .55s ease-in forwards; }
.sp-ttsideclip { display: flex; align-items: stretch; min-height: 122px; border-radius: 18px; overflow: hidden; background: rgba(10, 10, 15, .94); border: 1px solid var(--sp-plate-line); box-shadow: var(--sp-shadow); }
.sp-ttside-frame { position: relative; width: 76px; background: linear-gradient(160deg, #161922, #08090d); display: grid; place-items: center; }
.sp-ttside-frame > i { position: absolute; inset: 7px; border: 1px solid color-mix(in srgb, var(--sp-accent) 45%, transparent); border-radius: 12px; }
.sp-ttside-frame b { width: 34px; height: 34px; }
.sp-ttside-frame svg { width: 100%; height: 100%; }
.sp-ttside-copy { display: grid; align-content: center; gap: 4px; padding: 14px 18px; }
.sp-ttside-copy small { color: var(--sp-accent); font-size: 10px; letter-spacing: 1.5px; font-weight: 850; }
.sp-ttside-copy b { font-size: 18px; }
.sp-ttside-copy em { font-style: normal; color: var(--sp-ink-dim); font-size: 12.5px; font-weight: 650; }
.sp-tt-side-clip.is-enter .sp-ttsideclip { animation: sp-sideclip-in .68s cubic-bezier(.2, 1.1, .25, 1) both; }
.sp-tt-side-clip.is-idle .sp-ttside-frame > i { animation: sp-scan 3.4s ease-in-out infinite; }
.sp-tt-side-clip.is-exit .sp-ttsideclip { animation: sp-sideclip-out .48s ease-in forwards; }
@keyframes sp-sideclip-in { from { opacity: 0; transform: translateX(-44px) scaleY(.82); } to { opacity: 1; transform: none; } }
@keyframes sp-sideclip-out { to { opacity: 0; transform: translateX(-42px) scaleY(.72); } }

/* ============ Telegram QR concepts ============ */
.sp-tgqrhero { display: grid; justify-items: center; gap: 10px; }
.sp-tgqrhero-qr { opacity: 0; transform: translateY(14px) scale(.92); }
.sp-tgqrhero > span:last-child { display: flex; align-items: center; gap: 8px; text-shadow: 0 2px 10px #000b; }
.sp-tgqrhero > span:last-child svg { width: 27px; height: 27px; }
.sp-tgqrhero > span:last-child small { color: var(--sp-ink-dim); font-weight: 650; }
.sp-tg-transparent-qr.is-enter .sp-tgqrhero-qr { animation: sp-qr-settle .68s cubic-bezier(.25, 1.15, .35, 1) .18s forwards; }
.sp-tg-transparent-qr.is-idle .sp-tgqrhero-qr { animation: sp-qr-float 5.8s ease-in-out 1s infinite; opacity: 1; transform: none; }
.sp-tg-transparent-qr.is-exit .sp-tgqrhero-qr { animation: sp-qr-away .45s ease-in forwards; }
.sp-tgqrmorph { display: flex; align-items: center; }
.sp-tgqrmorph-icon { position: relative; z-index: 2; width: 58px; height: 58px; flex: 0 0 auto; }
.sp-tgqrmorph-icon svg { width: 100%; height: 100%; }
.sp-tgqrmorph-drawer { display: grid; justify-items: center; gap: 5px; max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap; background: rgba(10, 12, 18, .92); border-radius: 0 18px 18px 0; }
.sp-tgqrmorph-drawer b { font-size: 15px; }
.sp-tgqrmorph-drawer small { font-size: 12px; color: var(--sp-ink-dim); font-weight: 650; }
.sp-tg-qr-morph.is-enter .sp-tgqrmorph-icon { animation: sp-icon-pop .55s cubic-bezier(.3, 1.6, .4, 1) both; }
.sp-tg-qr-morph.is-enter .sp-tgqrmorph-drawer { animation: sp-tgdrawer-open .72s cubic-bezier(.2, .95, .25, 1) .4s forwards; }
.sp-tg-qr-morph.is-exit .sp-tgqrmorph-drawer { animation: sp-tgdrawer-close .42s ease-in forwards; }
.sp-tg-qr-morph.is-exit .sp-tgqrmorph-icon { animation: sp-root-out .25s ease .36s forwards; }
@keyframes sp-tgdrawer-open { to { max-width: 360px; opacity: 1; padding: 14px 16px; } }
@keyframes sp-tgdrawer-close { from { max-width: 360px; opacity: 1; padding: 14px 16px; } to { max-width: 0; opacity: 0; padding: 14px 0; } }
.sp-tgqravatar { position: relative; display: grid; justify-items: center; padding-top: 28px; }
.sp-tgqravatar-face { position: absolute; z-index: 2; top: 0; left: 50%; width: 62px; height: 62px; transform: translateX(-50%); }
.sp-tgqravatar-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid #11131a; }
.sp-tgqravatar-face i { position: absolute; right: -5px; bottom: -4px; width: 23px; height: 23px; }
.sp-tgqravatar-face i svg { width: 100%; height: 100%; }
.sp-tgqravatar-copy { display: grid; justify-items: center; gap: 2px; margin-top: 8px; text-shadow: 0 2px 10px #000b; }
.sp-tgqravatar-copy b { font-size: 15px; }
.sp-tgqravatar-copy small { color: var(--sp-ink-dim); font-size: 12px; font-weight: 650; }
.sp-tg-qr-avatar.is-enter .sp-tgqravatar-qr { animation: sp-qr-settle .62s cubic-bezier(.2, 1.12, .3, 1) .2s both; }
.sp-tg-qr-avatar.is-enter .sp-tgqravatar-face { animation: sp-spring-pop .64s cubic-bezier(.3, 1.7, .4, 1) .48s both; }
.sp-tg-qr-avatar.is-exit .sp-tgqravatar { animation: sp-qr-away .48s ease-in forwards; }
.sp-tgmessageqr { display: flex; align-items: flex-end; gap: 0; }
.sp-tgmessageqr-bubble { display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 9px; min-width: 230px; padding: 13px 15px; border-radius: 18px 18px 5px 18px; background: rgba(12, 15, 22, .96); border: 1px solid var(--sp-plate-line); box-shadow: var(--sp-shadow); }
.sp-tgmessageqr-bubble > i { grid-row: 1 / 3; width: 28px; height: 28px; }
.sp-tgmessageqr-bubble svg { width: 100%; height: 100%; }
.sp-tgmessageqr-bubble > em { display: flex; gap: 4px; }
.sp-tgmessageqr-bubble > em b { width: 5px; height: 5px; border-radius: 50%; background: var(--sp-ink-dim); animation: sp-typing 1s ease-in-out infinite; }
.sp-tgmessageqr-bubble > em b:nth-child(2) { animation-delay: .15s; }.sp-tgmessageqr-bubble > em b:nth-child(3) { animation-delay: .3s; }
.sp-tgmessageqr-bubble > strong { display: none; font-size: 14px; }
.sp-tg-message-qr.is-content-ready .sp-tgmessageqr-bubble > em, .sp-tg-message-qr.is-idle .sp-tgmessageqr-bubble > em, .sp-tg-message-qr.is-action .sp-tgmessageqr-bubble > em { display: none; }
.sp-tg-message-qr.is-content-ready .sp-tgmessageqr-bubble > strong, .sp-tg-message-qr.is-idle .sp-tgmessageqr-bubble > strong, .sp-tg-message-qr.is-action .sp-tgmessageqr-bubble > strong { display: block; animation: sp-fade-in .3s ease both; }
.sp-tgmessageqr-drawer { display: grid; justify-items: center; gap: 5px; max-width: 0; opacity: 0; overflow: hidden; }
.sp-tgmessageqr-drawer small { font-size: 11.5px; color: var(--sp-ink-dim); font-weight: 650; }
.sp-tg-message-qr.is-enter .sp-tgmessageqr-bubble { animation: sp-bubble-in .5s cubic-bezier(.3, 1.3, .4, 1) both; }
.sp-tg-message-qr.is-idle .sp-tgmessageqr-drawer { animation: sp-msgqr-open .65s cubic-bezier(.2, .95, .25, 1) forwards; }
.sp-tg-message-qr.is-exit .sp-tgmessageqr-drawer { animation: sp-msgqr-close .4s ease-in forwards; }
.sp-tg-message-qr.is-exit .sp-tgmessageqr-bubble { animation: sp-root-out .3s ease .3s forwards; }
@keyframes sp-msgqr-open { to { max-width: 280px; opacity: 1; padding-left: 12px; } }
@keyframes sp-msgqr-close { from { max-width: 280px; opacity: 1; padding-left: 12px; } to { max-width: 0; opacity: 0; padding-left: 0; } }
.sp-tgcornerbeacon { display: flex; align-items: center; }
.sp-tgcornerbeacon-icon { width: 40px; height: 40px; flex: 0 0 auto; }
.sp-tgcornerbeacon-icon svg { width: 100%; height: 100%; }
.sp-tgcornerbeacon-line { width: 74px; height: 2px; background: linear-gradient(90deg, var(--sp-accent), transparent); transform: scaleX(0); transform-origin: left; }
.sp-tgcornerbeacon-qr { display: grid; justify-items: center; gap: 4px; opacity: 0; transform: scale(.86); }
.sp-tgcornerbeacon-qr small { font-size: 11px; color: var(--sp-ink-dim); font-weight: 650; }
.sp-tg-corner-beacon.is-enter .sp-tgcornerbeacon-icon { animation: sp-icon-pop .5s cubic-bezier(.3, 1.6, .4, 1) both; }
.sp-tg-corner-beacon.is-enter .sp-tgcornerbeacon-line { animation: sp-underline-draw .48s ease .38s forwards; }
.sp-tg-corner-beacon.is-enter .sp-tgcornerbeacon-qr { animation: sp-scale-in .55s cubic-bezier(.2, 1.2, .3, 1) .7s forwards; }
.sp-tg-corner-beacon.is-exit .sp-tgcornerbeacon-qr { animation: sp-qr-away .35s ease-in forwards; }
.sp-tg-corner-beacon.is-exit .sp-tgcornerbeacon-line { animation: sp-underline-erase .3s ease .25s forwards; }
.sp-tg-corner-beacon.is-exit .sp-tgcornerbeacon-icon { animation: sp-root-out .25s ease .42s forwards; }

/* ============ Управляемые пресеты хореографии ============ */
/* :not(.is-exit) обязателен: эти правила ниже базового .sp.is-exit, и без
   guard пресет появления «побеждал» уход — виджет не исчезал, а мигал. */
.sp-enter-soft.is-enter:not(.is-exit) { animation: sp-preset-soft-in var(--sp-enter) cubic-bezier(.2, .8, .25, 1) forwards; }
.sp-enter-spring.is-enter:not(.is-exit) { animation: sp-preset-spring-in var(--sp-enter) cubic-bezier(.22, 1.25, .32, 1) forwards; }
.sp-enter-slide.is-enter:not(.is-exit) { animation: sp-preset-slide-in var(--sp-enter) cubic-bezier(.2, .82, .24, 1) forwards; }
.sp-enter-mask.is-enter:not(.is-exit) { animation: sp-preset-mask-in var(--sp-enter) cubic-bezier(.2, .82, .24, 1) forwards; }
.sp-enter-scale.is-enter:not(.is-exit) { animation: sp-preset-scale-in var(--sp-enter) cubic-bezier(.2, .95, .25, 1) forwards; }
.sp-enter-glitch.is-enter:not(.is-exit) { animation: sp-preset-glitch-in var(--sp-enter) steps(4, end) forwards; }
.sp-enter-edge.is-enter:not(.is-exit) { animation: sp-preset-edge-in var(--sp-enter) cubic-bezier(.2, .86, .24, 1) forwards; }
.sp-enter-edge[data-pos*="right"].is-enter:not(.is-exit) { animation-name: sp-preset-edge-in-right; }
.sp-enter-fast.is-enter:not(.is-exit) { animation: sp-preset-fast-in .36s cubic-bezier(.18, .86, .25, 1) forwards; }

.sp-exit-reverse.is-exit { animation: sp-preset-reverse-out var(--sp-exit) ease-in forwards; }
.sp-exit-collapse.is-exit { animation: sp-preset-collapse-out var(--sp-exit) cubic-bezier(.55, 0, .8, .4) forwards; }
.sp-exit-slide.is-exit { animation: sp-preset-slide-out var(--sp-exit) ease-in forwards; }
.sp-exit-mask.is-exit { animation: sp-preset-mask-out var(--sp-exit) ease-in forwards; }
.sp-exit-fade-scale.is-exit { animation: sp-preset-fade-scale-out var(--sp-exit) ease-in forwards; }
.sp-exit-glitch-out.is-exit { animation: sp-preset-glitch-out var(--sp-exit) steps(4, end) forwards; }
.sp-exit-edge.is-exit { animation: sp-preset-edge-out var(--sp-exit) ease-in forwards; }
.sp-exit-edge[data-pos*="right"].is-exit { animation-name: sp-preset-edge-out-right; }

@keyframes sp-preset-soft-in { from { opacity: 0; transform: translateY(8px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes sp-preset-spring-in { 0% { opacity: 0; transform: translateY(18px) scale(.9); } 72% { opacity: 1; transform: translateY(-3px) scale(1.018); } 100% { opacity: 1; transform: none; } }
@keyframes sp-preset-slide-in { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: none; } }
@keyframes sp-preset-mask-in { from { opacity: .3; clip-path: inset(0 100% 0 0 round 18px); } to { opacity: 1; clip-path: inset(-8% -8% -8% -8% round 18px); } }
@keyframes sp-preset-scale-in { from { opacity: 0; transform: scale(.84); } to { opacity: 1; transform: none; } }
@keyframes sp-preset-glitch-in { 0% { opacity: 0; transform: translateX(-20px); filter: hue-rotate(70deg); } 45% { opacity: .8; transform: translateX(8px) skewX(-5deg); } 75% { transform: translateX(-3px); } 100% { opacity: 1; transform: none; filter: none; } }
@keyframes sp-preset-edge-in { from { opacity: 0; transform: translateX(-44px); } to { opacity: 1; transform: none; } }
@keyframes sp-preset-edge-in-right { from { opacity: 0; transform: translateX(44px); } to { opacity: 1; transform: none; } }
@keyframes sp-preset-fast-in { from { opacity: 0; transform: translateY(7px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes sp-preset-reverse-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(10px) scale(.94); } }
@keyframes sp-preset-collapse-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: scaleX(.08) scaleY(.7); } }
@keyframes sp-preset-slide-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(34px); } }
@keyframes sp-preset-mask-out { from { opacity: 1; clip-path: inset(-8% -8% -8% -8% round 18px); } to { opacity: .2; clip-path: inset(0 0 0 100% round 18px); } }
@keyframes sp-preset-fade-scale-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: scale(.86); } }
@keyframes sp-preset-glitch-out { 0% { opacity: 1; } 35% { transform: translateX(-8px) skewX(8deg); filter: hue-rotate(80deg); } 70% { opacity: .7; transform: translateX(10px) scaleY(.25); } 100% { opacity: 0; transform: scaleX(.1) scaleY(.03); } }
@keyframes sp-preset-edge-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(-48px); } }
@keyframes sp-preset-edge-out-right { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(48px); } }

/* Действие меняет акцент, но не нарушает общий порядок cursor → click → confirm. */
.sp-action-button-only .sp-action-cursor { display: none !important; }
.sp-action-glitch.is-clicked .sp-action-button { animation: sp-action-glitch .38s steps(3, end) both; }
.sp-action-heart.is-confirmed .sp-action-done svg { animation: sp-heart-fill .48s cubic-bezier(.2, 1.45, .3, 1) both; }
.sp-action-ripple.is-clicked .sp-action-ripple { border-width: 3px; animation-duration: .68s; }
.sp-action-morph.is-confirmed .sp-action-button { border-radius: 999px; transition: border-radius .3s ease, transform .12s ease; }
@keyframes sp-action-glitch { 0%, 100% { transform: none; filter: none; } 25% { transform: translateX(3px) scale(.97); filter: hue-rotate(75deg); } 55% { transform: translateX(-3px) scale(1.02); } }

/* ============ Новые качественные motion-варианты ============ */
.sp-tw-docked-heart-follow .sp-twheartmorph-body { margin-left: -10px; padding-left: 10px; border-left-color: transparent; }
.sp-tw-docked-heart-follow.is-enter .sp-twheartmorph-core { animation: sp-docked-heart-in .72s cubic-bezier(.22, 1.3, .3, 1) both; }
.sp-tw-docked-heart-follow.is-idle .sp-twheartmorph-core { box-shadow: var(--sp-shadow), 0 0 0 5px color-mix(in srgb, var(--sp-accent) 15%, transparent); }
@keyframes sp-docked-heart-in { 0% { opacity: 0; transform: scale(.55); } 64% { opacity: 1; transform: scale(1.09); } 100% { opacity: 1; transform: none; } }

.sp-tw-cursor-spring .sp-action-card { border-color: color-mix(in srgb, var(--sp-accent) 45%, var(--sp-plate-line)); }
.sp-tw-cursor-spring.is-cursor-moving .sp-action-cursor { animation-name: sp-cursor-spring-travel; }
@keyframes sp-cursor-spring-travel {
  0% { opacity: 0; left: var(--sp-cursor-start-x); top: var(--sp-cursor-start-y); transform: rotate(-9deg) scale(.9); }
  18% { opacity: 1; }
  76% { opacity: 1; left: calc(var(--sp-cursor-target-x) + 5px); top: calc(var(--sp-cursor-target-y) + 3px); transform: rotate(1deg) scale(1.03); }
  100% { opacity: 1; left: var(--sp-cursor-target-x); top: var(--sp-cursor-target-y); transform: none; }
}
.sp-tw-glitch-following.is-confirmed .sp-status-word { text-shadow: 2px 0 color-mix(in srgb, var(--sp-accent) 70%, transparent), -2px 0 #39e7ff99; }

.sp-yt-cursor-precision .sp-action-card { box-shadow: var(--sp-shadow), inset 0 -2px color-mix(in srgb, var(--sp-accent) 70%, transparent); }
.sp-yt-play-morph-subscribe .sp-ytmorph-core { border-radius: 50%; }
.sp-yt-glitch-confirm.is-confirmed .sp-status-word strong { color: #fff; text-shadow: 2px 0 #ff003388, -2px 0 #55d8ff88; }

.sp-tt-swipe-follow .sp-ttswipe-frame > u { animation: sp-swipe-accent 1.1s ease-in-out infinite; }
.sp-tt-cursor-pop.is-clicked .sp-action-card { box-shadow: var(--sp-shadow), 4px 4px 0 var(--sp-accent2); }
.sp-tt-rgb-confirm.is-confirmed .sp-status-word strong { text-shadow: 3px 0 var(--sp-accent2), -3px 0 var(--sp-accent); }
@keyframes sp-swipe-accent { 0%, 100% { transform: translateY(0); opacity: .45; } 50% { transform: translateY(-68px); opacity: 1; } }

.sp-tg-typing-message .sp-bubble-card { min-width: 270px; }
.sp-tg-icon-qr-morph .sp-tgqrmorph-icon { z-index: 3; filter: drop-shadow(0 0 14px color-mix(in srgb, var(--sp-accent) 38%, transparent)); }
.sp-tg-docked-qr-reveal .sp-tgqreveal-drawer { margin-left: -8px; padding-left: 8px; }

/* YouTube children finish before the root disappears; no early overflow clipping. */
.sp.is-youtube.is-exit { animation: sp-youtube-root-out var(--sp-exit, .62s) linear forwards; }
.sp.is-youtube.is-exit .sp-action-cursor { display: none !important; }
.sp-yt-minimal.is-exit .sp-ytmin-copy,
.sp-yt-card.is-exit .sp-ytcard-copy,
.sp-yt-player.is-exit .sp-player-copy,
.sp-yt-progress.is-exit .sp-progress-copy { animation: sp-mask-down .3s ease forwards; }
.sp-yt-minimal.is-exit .sp-sub-btn,
.sp-yt-card.is-exit .sp-ytcard-cta { animation: sp-action-old-out .3s ease .12s forwards; }
.sp-yt-player.is-exit .sp-player-bar i,
.sp-yt-progress.is-exit .sp-progress-line { animation: sp-yt-line-retract .38s ease .16s forwards; transform-origin: right; }
@keyframes sp-youtube-root-out { 0%, 52% { opacity: 1; } 100% { opacity: 0; } }
@keyframes sp-yt-line-retract { to { transform: scaleX(0); opacity: 0; } }

/* Пользовательский уход имеет приоритет и на YouTube-шаблонах. */
.sp.is-youtube.sp-exit-reverse.is-exit { animation: sp-preset-reverse-out var(--sp-exit) ease-in forwards; }
.sp.is-youtube.sp-exit-collapse.is-exit { animation: sp-preset-collapse-out var(--sp-exit) cubic-bezier(.55, 0, .8, .4) forwards; }
.sp.is-youtube.sp-exit-slide.is-exit { animation: sp-preset-slide-out var(--sp-exit) ease-in forwards; }
.sp.is-youtube.sp-exit-mask.is-exit { animation: sp-preset-mask-out var(--sp-exit) ease-in forwards; }
.sp.is-youtube.sp-exit-fade-scale.is-exit { animation: sp-preset-fade-scale-out var(--sp-exit) ease-in forwards; }
.sp.is-youtube.sp-exit-glitch-out.is-exit { animation: sp-preset-glitch-out var(--sp-exit) steps(4, end) forwards; }
.sp.is-youtube.sp-exit-edge.is-exit { animation: sp-preset-edge-out var(--sp-exit) ease-in forwards; }
.sp.is-youtube.sp-exit-edge[data-pos*="right"].is-exit { animation-name: sp-preset-edge-out-right; }

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  .sp *, .sp::before, .sp::after { animation-duration: .01s !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; }
  .sp.is-enter { animation: sp-fade-in .2s ease forwards; }
  .sp.is-exit { animation: sp-root-out .2s ease forwards; }
}

.sp-reduced .sp *, .sp.sp-reduced * { animation-duration: .01s !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; }
