/* Ожидание распознавания блюда (RecipeTab): размытое фото + лупа, из тумана — блюдо */
@property --lx { syntax: "<length>"; inherits: false; initial-value: 95px; }
@property --ly { syntax: "<length>"; inherits: false; initial-value: 95px; }

.cook-wait { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 0 6px; }
.cook-wait-cap { font: 800 16px/1.2 Nunito, system-ui, sans-serif; color: var(--text, #2b2b2b); }
.cook-photo { position: relative; width: 190px; height: 190px; border-radius: 22px; overflow: hidden; background: #f4efe4;
  box-shadow: 0 0 0 5px #fff, 0 10px 24px rgba(0, 0, 0, .18); }
.cook-photo img { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); object-fit: contain; }
.cook-blur { filter: blur(11px) saturate(1.1); transform: scale(1.06); }

/* лупа обходит фото по кругу и «проявляет» то, что под ней */
.cook-sharp { animation: cook-reveal 3.2s linear infinite;
  -webkit-mask-image: radial-gradient(circle at var(--lx) var(--ly), #000 0 24px, transparent 25px);
          mask-image: radial-gradient(circle at var(--lx) var(--ly), #000 0 24px, transparent 25px); }
.cook-lens { position: absolute; left: 0; top: 0; width: 70px; height: 70px; animation: cook-move 3.2s linear infinite;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .25)); }
@keyframes cook-reveal {
  0% { --lx: 133px; --ly: 87px; }
  12.5% { --lx: 120px; --ly: 120px; }
  25% { --lx: 87px; --ly: 133px; }
  37.5% { --lx: 54px; --ly: 120px; }
  50% { --lx: 41px; --ly: 87px; }
  62.5% { --lx: 54px; --ly: 54px; }
  75% { --lx: 87px; --ly: 41px; }
  87.5% { --lx: 120px; --ly: 54px; }
  100% { --lx: 133px; --ly: 87px; }
}
@keyframes cook-move {
  0% { transform: translate(113px, 67px); }
  12.5% { transform: translate(100px, 100px); }
  25% { transform: translate(67px, 113px); }
  37.5% { transform: translate(34px, 100px); }
  50% { transform: translate(21px, 67px); }
  62.5% { transform: translate(34px, 34px); }
  75% { transform: translate(67px, 21px); }
  87.5% { transform: translate(100px, 34px); }
  100% { transform: translate(113px, 67px); }
}

/* концовка: фото тает в тумане, из него вырастает наше блюдо */
.cook-fade { animation: cook-melt .9s .1s ease-in both; }
@keyframes cook-melt { to { opacity: 0; filter: blur(22px); } }
.cook-fog i { position: absolute; width: 130px; height: 130px; border-radius: 50%; opacity: 0; filter: blur(10px);
  background: radial-gradient(circle, rgba(255, 252, 242, .95) 0, rgba(255, 250, 236, .75) 42%, rgba(255, 250, 236, 0) 70%);
  animation: cook-bloom 1.5s ease-out both; }
.cook-fog i:nth-child(1) { left: -6px; top: 36px; }
.cook-fog i:nth-child(2) { right: -6px; top: 30px; animation-delay: .08s; }
.cook-fog i:nth-child(3) { left: 30px; top: -8px; animation-delay: .14s; }
.cook-fog i:nth-child(4) { left: 30px; bottom: -8px; animation-delay: .1s; }
.cook-fog i:nth-child(5) { left: 22px; top: 22px; width: 150px; height: 150px; animation-delay: .04s; }
@keyframes cook-bloom {
  0%   { opacity: 0; transform: scale(.2); }
  30%  { opacity: 1; transform: scale(1.1); }
  70%  { opacity: .95; transform: scale(1.2); }
  100% { opacity: 0; transform: scale(1.5) translateY(-14px); }
}
.cook-done .cook-dish { opacity: 0; animation: cook-pop .7s .55s cubic-bezier(.3, 1.6, .5, 1) both;
  filter: drop-shadow(0 8px 8px rgba(0, 0, 0, .22)); }
@keyframes cook-pop { 0% { opacity: 0; transform: translateY(26px) scale(.3) rotate(-14deg); } 30% { opacity: 1; } 100% { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .cook-sharp, .cook-lens, .cook-fog i, .cook-fade { animation: none; }
  .cook-lens, .cook-fog { display: none; }
  .cook-done .cook-dish { animation: none; opacity: 1; }
  .cook-done .cook-fade { opacity: 0; }
}
