/* tvz-phone.css — смартфон с живым экраном в карточке «Приложение» блока «Это вас заинтересует».
   Встаёт на место .tvz-video внутри .tvz-card--app. Смартфон выходит за верхний край белой карточки:
   запас сверху у ленты задаёт tvz-certs.css (--tvz-over); если карточка сертификатов не подключена — раскомментировать:
   .tvz{ --tvz-over:72px; } .tvz-viewport{ padding-top:var(--tvz-over); margin-top:calc(var(--tvz-over) * -1); } */
.tvz-card--app{ overflow:visible; }

.tvz-phone{
  position:absolute; right:6%; top:-14%; width:30%; height:110%;
  pointer-events:none; z-index:1;
}
.tvz-phone__item{ position:absolute; opacity:0; transition:opacity .7s ease; will-change:transform; }
.tvz-phone__item.is-ready{ opacity:1; }
.tvz-phone__cv{ position:absolute; inset:0; width:100%; height:100%; display:block; }
.tvz-phone__shadow{
  position:absolute; left:26%; right:26%; bottom:6%; height:6%;
  border-radius:50%;
  background:radial-gradient(closest-side, rgba(84,80,44,.34), rgba(84,80,44,0));
  filter:blur(6px);
}
/* экран: та же перспектива и тот же угол, что у камеры Blender. Кадр 1,3 × 1,56 м, экран 0,536 × 1,156 м по центру. */
.tvz-phone__persp{ position:absolute; inset:0; perspective-origin:50% 50%; }
.tvz-phone__plane{
  position:absolute; left:29.3846%; top:12.9487%; width:41.2308%; height:74.1026%;
  --t:0;
}
.tvz-phone__screen{
  position:absolute; inset:0; overflow:hidden;
  border-radius:16.8% / 7.79%;
  background:#faf7ef;
  -webkit-mask-image:-webkit-radial-gradient(white, black);
}
.tvz-phone__sheen{
  position:absolute; top:-20%; bottom:-20%; left:-90%; width:280%;
  background:linear-gradient(104deg, rgba(255,255,255,0) 42%, rgba(255,255,255,.26) 50%, rgba(255,255,255,0) 58%);
  transform:translateX(calc(var(--t) * -26%));
}

/* ── интерфейс на экране: логический размер 320 × 690, масштаб ставит JS ── */
.tp-ui{
  --T:10s; --olive:#828634; --lime:#a3a932; --mute:#9a9d5e; --line:rgba(130,134,52,.16);
  position:absolute; left:0; top:0; width:320px; height:690px; transform-origin:0 0;
  color:var(--olive); font-size:17px; line-height:1.2; font-weight:400; letter-spacing:0;
}
.tp-ui *{ box-sizing:border-box; }
.tp-ui i{ display:block; font-style:normal; }
.tp-status{ position:absolute; left:26px; right:24px; top:15px; display:flex; justify-content:space-between; align-items:center; font-size:14px; }
.tp-status__r{ display:flex; align-items:center; gap:6px; }
.tp-sig{ width:17px; height:11px; background:
  linear-gradient(var(--olive),var(--olive)) 0 100% / 3px 4px no-repeat,
  linear-gradient(var(--olive),var(--olive)) 4.6px 100% / 3px 6px no-repeat,
  linear-gradient(var(--olive),var(--olive)) 9.2px 100% / 3px 8.5px no-repeat,
  linear-gradient(var(--olive),var(--olive)) 13.8px 100% / 3px 11px no-repeat; }
.tp-bat{ width:24px; height:11.5px; border:1.2px solid var(--olive); border-radius:3.5px; background:linear-gradient(var(--olive),var(--olive)) 1.6px 50% / 15px 6.5px no-repeat; }
.tp-cam{ position:absolute; left:50%; top:13px; width:15px; height:15px; margin-left:-7.5px; border-radius:50%; background:#16170f; }
.tp-top{ position:absolute; left:20px; right:20px; top:54px; display:flex; align-items:center; justify-content:space-between; }
.tp-studio{ display:flex; align-items:center; gap:7px; min-width:0; height:36px; padding:0 14px; border-radius:18px; background:#fff; font-size:14.5px; box-shadow:inset 0 0 0 1px var(--line); white-space:nowrap; }
.tp-studio__n{ min-width:0; overflow:hidden; text-overflow:ellipsis; }   /* длинное название студии не ломает строку */
.tp-chev{ flex:0 0 auto; width:7px; height:7px; border-right:1.4px solid var(--olive); border-bottom:1.4px solid var(--olive); transform:rotate(45deg) translate(-1.5px,-1.5px); }
.tp-dots{ display:flex; gap:5px; flex:0 0 auto; margin-left:12px; }
.tp-dot{ width:6px; height:6px; border-radius:3px; background:rgba(130,134,52,.25); }
.tp-track{ position:absolute; left:0; top:108px; width:960px; height:548px; display:flex; }
.tp-s{ position:relative; width:320px; height:100%; padding:0 20px; }
.tp-h{ margin:6px 0 18px; font-size:29px; line-height:1.1; font-weight:400; color:var(--olive); }
.tp-h--c{ text-align:center; margin:20px 0 18px; }
.tp-list{ list-style:none; margin:0; padding:0; display:grid; gap:10px; }
.tp-row{ position:relative; display:flex; align-items:center; gap:12px; height:60px; padding:0 13px; font-size:16px; white-space:nowrap; border-radius:18px; background:#fff; box-shadow:inset 0 0 0 1px var(--line); }
.tp-ic{ flex:0 0 auto; width:34px; height:34px; border-radius:11px; }
.tp-ic--1{ background:linear-gradient(135deg,#ffd7e7,#f4a9c8); }
.tp-ic--2{ background:linear-gradient(135deg,#f5ead2,#e6c98f); }
.tp-ic--3{ background:linear-gradient(135deg,#e3e6b4,#b9bf58); }
.tp-ic--4{ background:linear-gradient(135deg,#fde6da,#f3b79c); }
.tp-ic--5{ background:linear-gradient(135deg,#ebe0f5,#c9addf); }
.tp-chk{ margin-left:auto; width:24px; height:24px; border-radius:50%; background:var(--lime); position:relative; }
.tp-chk::after{ content:''; position:absolute; left:8.5px; top:5px; width:6px; height:11px; border-right:2px solid #fff; border-bottom:2px solid #fff; transform:rotate(45deg); }
.tp-days{ display:grid; grid-template-columns:repeat(5,1fr); gap:7px; }
.tp-days span{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; height:64px; border-radius:16px; background:#fff; box-shadow:inset 0 0 0 1px var(--line); font-size:19px; }
.tp-days b{ font-weight:400; font-size:12.5px; color:var(--mute); }
.tp-days .is-on{ background:#f3f4dc; box-shadow:inset 0 0 0 1.5px var(--lime); }
.tp-slots{ margin-top:18px; display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.tp-slots span{ display:flex; align-items:center; justify-content:center; height:48px; border-radius:16px; background:#fff; box-shadow:inset 0 0 0 1px var(--line); font-size:17px; }
.tp-note{ margin-top:20px; font-size:14.5px; color:var(--mute); text-align:center; }
.tp-s--done{ padding-top:44px; }
.tp-ok{ width:96px; height:96px; margin:0 auto; }
.tp-ok svg{ display:block; width:100%; height:100%; fill:none; stroke:var(--lime); stroke-width:3; stroke-linecap:round; stroke-linejoin:round; }
.tp-ok circle{ stroke-dasharray:183; transform:rotate(-90deg); transform-origin:50% 50%; }
.tp-ok path{ stroke-dasharray:37; }
.tp-ticket{ display:grid; gap:7px; padding:18px 18px; border-radius:20px; background:#fff; box-shadow:inset 0 0 0 1px var(--line); text-align:center; font-size:15.5px; color:var(--mute); }
.tp-ticket b{ font-weight:400; font-size:18px; color:var(--olive); }
.tp-cta{ position:absolute; left:20px; right:20px; bottom:12px; height:54px; border-radius:27px; display:flex; align-items:center; justify-content:center; background:linear-gradient(to right,#828634,#969d08); color:#fcfcf7; font-size:17px; }
.tp-btn{ margin-top:16px; height:54px; border-radius:27px; display:flex; align-items:center; justify-content:center; background:linear-gradient(to right,#828634,#969d08); color:#fcfcf7; font-size:17px; }
.tp-tap{ position:absolute; left:-18px; top:-18px; width:36px; height:36px; border-radius:50%; background:rgba(130,134,52,.26); box-shadow:0 0 0 1.5px rgba(130,134,52,.34); opacity:0; }
.tp-home{ position:absolute; left:50%; bottom:9px; width:112px; height:4.5px; margin-left:-56px; border-radius:3px; background:rgba(130,134,52,.4); }

/* ── сценарий: один общий цикл 10 с; идёт, только пока блок на экране (.is-playing) ── */
.tp-track{ animation:tp-fade var(--T) linear infinite, tp-slide var(--T) linear infinite; }
.tp-row--pick{ animation:tp-pick var(--T) linear infinite; }
.tp-chk{ animation:tp-chk var(--T) linear infinite; }
.tp-slot--pick{ animation:tp-slot var(--T) linear infinite; }
.tp-tap{ animation:tp-tap var(--T) linear infinite; }
.tp-ok circle{ animation:tp-ring var(--T) linear infinite; }
.tp-ok path{ animation:tp-tick var(--T) linear infinite; }
.tp-h--c, .tp-ticket{ animation:tp-rise var(--T) linear infinite; }
.tp-btn{ animation:tp-rise2 var(--T) linear infinite; }
.tp-cta--1{ animation:tp-cta1 var(--T) linear infinite; }
.tp-cta--2{ animation:tp-cta2 var(--T) linear infinite; }
.tp-dot--1{ animation:tp-d1 var(--T) linear infinite; }
.tp-dot--2{ animation:tp-d2 var(--T) linear infinite; }
.tp-dot--3{ animation:tp-d3 var(--T) linear infinite; }
.tvz-phone:not(.is-playing) .tp-ui *{ animation-play-state:paused; }
.tvz-phone.is-static .tp-ui *{ animation:none; }

@keyframes tp-fade{ 0%{opacity:0} 4%{opacity:1} 93%{opacity:1} 100%{opacity:0} }
@keyframes tp-slide{
  0%,24%{ transform:translateX(0); animation-timing-function:cubic-bezier(.42,0,.2,1); }
  29.5%,52%{ transform:translateX(-320px); animation-timing-function:cubic-bezier(.42,0,.2,1); }
  57.5%,100%{ transform:translateX(-640px); }
}
@keyframes tp-pick{
  0%,16%{ background-color:#fff; box-shadow:inset 0 0 0 1px rgba(130,134,52,.16); }
  17.5%,100%{ background-color:#f3f4dc; box-shadow:inset 0 0 0 1.5px #a3a932; }
}
@keyframes tp-chk{ 0%,16.5%{ opacity:0; transform:scale(.4); } 18.5%,100%{ opacity:1; transform:scale(1); } }
@keyframes tp-slot{
  0%,44%{ background-color:#fff; color:#828634; box-shadow:inset 0 0 0 1px rgba(130,134,52,.16); }
  45.5%,100%{ background-color:#8d9221; color:#fcfcf7; box-shadow:inset 0 0 0 1px rgba(130,134,52,0); }
}
@keyframes tp-tap{
  0%,9%{ opacity:0; transform:translate(262px,330px) scale(1); }
  12.5%{ opacity:1; transform:translate(236px,203px) scale(1); }
  15.5%{ opacity:1; transform:translate(236px,203px) scale(.7); }
  17.5%{ opacity:1; transform:translate(236px,203px) scale(1); }
  21%{ opacity:0; transform:translate(236px,203px) scale(1); }
  22%,37%{ opacity:0; transform:translate(150px,430px) scale(1); }
  40.5%{ opacity:1; transform:translate(66px,343px) scale(1); }
  43.5%{ opacity:1; transform:translate(66px,343px) scale(.7); }
  45.5%{ opacity:1; transform:translate(66px,343px) scale(1); }
  49%,100%{ opacity:0; transform:translate(66px,343px) scale(1); }
}
@keyframes tp-ring{ 0%,57%{ stroke-dashoffset:183; } 64%,100%{ stroke-dashoffset:0; } }
@keyframes tp-tick{ 0%,62.5%{ stroke-dashoffset:37; } 67.5%,100%{ stroke-dashoffset:0; } }
@keyframes tp-rise{ 0%,61%{ opacity:0; transform:translateY(14px); } 68%,100%{ opacity:1; transform:translateY(0); } }
@keyframes tp-rise2{ 0%,65%{ opacity:0; transform:translateY(14px); } 72%,100%{ opacity:1; transform:translateY(0); } }
@keyframes tp-cta1{ 0%,17%{ opacity:.35; } 19.5%,100%{ opacity:1; } }
@keyframes tp-cta2{ 0%,45%{ opacity:.35; } 47.5%,100%{ opacity:1; } }
@keyframes tp-d1{ 0%,26%{ width:18px; background-color:#a3a932; } 28%,100%{ width:6px; background-color:rgba(130,134,52,.25); } }
@keyframes tp-d2{ 0%,26%{ width:6px; background-color:rgba(130,134,52,.25); } 28%,54%{ width:18px; background-color:#a3a932; } 56%,100%{ width:6px; background-color:rgba(130,134,52,.25); } }
@keyframes tp-d3{ 0%,54%{ width:6px; background-color:rgba(130,134,52,.25); } 56%,100%{ width:18px; background-color:#a3a932; } }

@media (max-width:900px){
  /* S3: смартфон виден целиком — полоса сверху карточки по высоте корпуса (8:7), смартфон по высоте полосы (--ph:1,
     tvz-phone.js), без обрезки снизу; верх, как прежде, чуть выходит за карточку. Было: полоса 16:10, смартфон ×1,6 —
     нижние ~40 % корпуса срезались краем полосы и под ним начинался белый блок с текстом. */
  .tvz-phone{
    position:relative; right:auto; top:auto;
    width:100%; height:auto; aspect-ratio:8/7; margin-top:-7%;
    --ph:1;
  }
  .tvz-phone__shadow{ display:none; }
}
@media (prefers-reduced-motion:reduce){
  .tvz-phone__item{ transition:none; }
}
