/* PATCH18: centered animation, no white frame, longer elegant loader */

#startupLoader {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  background: #000;
  color: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
  opacity: 1;
  visibility: visible;
  pointer-events: none;
  transition: opacity .42s ease, visibility .42s ease;
  animation: startupBg 3.4s ease forwards;
}

#startupLoader.startup-loader--hide {
  opacity: 0;
  visibility: hidden;
}

.startup-loader__inner {
  width: min(92vw, 460px);
  min-height: 100svh;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  text-align: center;
  padding: clamp(24px, 5vh, 48px) 18px clamp(40px, 8vh, 72px);
}

.startup-loader__title {
  display: grid;
  gap: 2px;
  justify-items: center;
  font-family: Arial, system-ui, sans-serif;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  line-height: .94;
  color: #fff;
  text-shadow: 0 0 18px rgba(255,255,255,.16);
  animation: startupTitle 3.4s ease forwards;
}

.startup-loader__title span {
  display: block;
  font-size: clamp(30px, 8vw, 58px);
  white-space: nowrap;
}

.startup-loader__animation {
  width: 100%;
  display: grid;
  justify-items: center;
  align-items: center;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 auto !important;
  opacity: 0;
  transform: translateY(16px) scale(.985);
  animation: startupAnim .95s ease 2.45s forwards;
}

.startup-loader__animation > * {
  margin-left: auto !important;
  margin-right: auto !important;
}

.startup-loader__subtitle {
  font: 850 clamp(14px, 4vw, 22px)/1.08 Arial, system-ui, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(0,0,0,.58);
  opacity: 0;
  transform: translateY(8px);
  animation: startupSub .85s ease 2.6s forwards;
}

.startup-loader__progress {
  width: min(78vw, 360px);
  height: 8px;
  border-radius: 999px;
  background: rgba(0,0,0,.08);
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px);
  animation: startupSub .85s ease 2.75s forwards;
}

.startup-loader__bar {
  display: block;
  width: 4%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0a6cff, #4aa4ff);
  transition: width .36s ease;
}

.startup-loader__status {
  min-height: 20px;
  font: 760 clamp(12px, 3.4vw, 15px)/1.18 Arial, system-ui, sans-serif;
  color: rgba(0,0,0,.48);
  opacity: 0;
  transform: translateY(8px);
  animation: startupSub .85s ease 2.9s forwards;
}

/* Ключевой блок: принудительное центрирование самой анимации */
#startupLoader .burDrillIntro {
  width: 100%;
  display: grid !important;
  justify-items: center !important;
  align-items: center !important;
  gap: 0 !important;
  margin: 0 auto !important;
}

#startupLoader .burDrill {
  --scale: .66;
  height: 318px;
  margin: 0 auto !important;
  left: auto !important;
  right: auto !important;
}

#startupLoader .burDrill__frame {
  margin: 0 auto !important;
}

#startupLoader .burDrillIntro__bottom,
#startupLoader .burDrillIntro__top {
  display: none !important;
}

@keyframes startupBg {
  0%, 46% { background: #000; }
  78% { background: #101010; }
  100% { background: #fff; }
}

@keyframes startupTitle {
  0%, 46% {
    color: #fff;
    text-shadow: 0 0 18px rgba(255,255,255,.16);
  }
  100% {
    color: #050505;
    text-shadow: none;
  }
}

@keyframes startupSub {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes startupAnim {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 420px) {
  .startup-loader__inner {
    gap: 16px;
    padding-top: 34px;
    padding-bottom: 48px;
  }

  .startup-loader__title span {
    font-size: clamp(28px, 7.8vw, 46px);
  }

  #startupLoader .burDrill {
    --scale: .60;
    height: 286px;
  }

  .startup-loader__subtitle {
    font-size: clamp(13px, 4.1vw, 18px);
  }
}

@media (max-width: 360px) {
  #startupLoader .burDrill {
    --scale: .56;
    height: 262px;
  }
}


/* PATCH20_WATER_AND_CENTER */

/* Визуально центрируем саму сцену: у исходной CSS-машинки масса чуть смещена вправо. */
#startupLoader .burDrill__frame {
  transform: translateX(-7px) scale(var(--scale)) !important;
  transform-origin: center center !important;
}

#startupLoader .startup-loader__animation {
  transform-origin: center center !important;
}

/* Водяная дорожка под текстом */
.startup-loader__subtitle {
  position: relative !important;
  display: inline-block !important;
  padding-bottom: 16px !important;
  color: transparent !important;
  background:
    linear-gradient(
      90deg,
      rgba(0,0,0,.58) 0%,
      rgba(0,0,0,.58) 34%,
      #0a8cff 45%,
      #38b7ff 52%,
      rgba(0,0,0,.58) 64%,
      rgba(0,0,0,.58) 100%
    ) !important;
  background-size: 260% 100% !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  animation:
    startupSub .85s ease 2.9s forwards,
    startupWaterText 2.35s linear 3.7s infinite !important;
}

.startup-loader__subtitle::before {
  content: "";
  position: absolute;
  left: 2%;
  right: 2%;
  bottom: 2px;
  height: 8px;
  border-radius: 999px;
  opacity: .82;
  background:
    radial-gradient(10px 7px at 8px 7px, rgba(10,140,255,.88) 0 45%, transparent 48%),
    radial-gradient(10px 7px at 26px 1px, rgba(53,183,255,.72) 0 42%, transparent 45%),
    linear-gradient(90deg, rgba(10,140,255,.16), rgba(53,183,255,.30), rgba(10,140,255,.16));
  background-size: 36px 10px, 36px 10px, 100% 100%;
  background-position: 0 0, 0 0, 0 0;
  animation: startupWaterRun 1.25s linear infinite;
}

.startup-loader__subtitle::after {
  content: "💧";
  position: absolute;
  right: -18px;
  bottom: -7px;
  font-size: 16px;
  opacity: .68;
  filter: grayscale(.15);
  animation: startupDrop 1.6s ease-in-out infinite;
}

@keyframes startupWaterText {
  0% { background-position: 160% 0; }
  100% { background-position: -120% 0; }
}

@keyframes startupWaterRun {
  0% {
    background-position: 0 0, 18px 0, 0 0;
    transform: translateX(0);
  }
  100% {
    background-position: 36px 0, 54px 0, 0 0;
    transform: translateX(0);
  }
}

@keyframes startupDrop {
  0%, 100% {
    transform: translateY(-1px) scale(.95);
    opacity: .45;
  }
  50% {
    transform: translateY(4px) scale(1.06);
    opacity: .9;
  }
}

/* Длинный первый запуск выглядит лучше, если прогресс тонкий и аккуратный */
.startup-loader__progress {
  height: 7px !important;
}

.startup-loader__status {
  margin-top: 2px !important;
}


/* PATCH21_REMOVE_EXTRA_WATER */

/* Убираем вторую анимационную голубую полоску. Остаётся только реальная полоса загрузки. */
.startup-loader__subtitle::before,
.startup-loader__subtitle::after {
  content: none !important;
  display: none !important;
}

.startup-loader__subtitle {
  padding-bottom: 0 !important;
  color: rgba(0,0,0,.62) !important;
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  animation: startupSub .85s ease 2.9s forwards !important;
}

/* Основная полоса загрузки — одна, чистая, без второго декоративного слоя */
.startup-loader__progress {
  margin-top: 2px !important;
  height: 7px !important;
  background: rgba(0,0,0,.08) !important;
}

.startup-loader__bar {
  background: linear-gradient(90deg, #0074ff, #58adff) !important;
}


/* PATCH31_START */
.startup-loader__bar {
  transition-duration: 1.15s !important;
}
/* PATCH31_END */


/* Lakiza visual override: сохраняем старую анимацию загрузчика, но меняем картинку */
.burDrill__frame {
  background-image: url("/massage-intro.svg?v=lakiza_visual_20260604_3") !important;
  background-size: contain !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-color: transparent !important;
}

.burDrill__frame > * {
  opacity: 0 !important;
  visibility: hidden !important;
}

.burDrill,
.burDrill__frame {
  overflow: visible !important;
}

/* Lakiza size tuning: увеличиваем карточку, не ломая анимацию */
#bur-drill-intro .burDrill {
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: clamp(10px, 2.2vh, 20px) auto !important;
}

#bur-drill-intro .burDrill__frame {
  width: clamp(300px, 86vw, 560px) !important;
  max-width: 560px !important;
  aspect-ratio: 900 / 520 !important;
  height: auto !important;
  min-height: unset !important;
  border-radius: clamp(18px, 3vw, 30px) !important;
  box-shadow: 0 18px 42px rgba(0,0,0,.14) !important;
  background-size: contain !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

#bur-drill-intro .burDrillIntro {
  gap: clamp(12px, 2.2vh, 22px) !important;
}

#bur-drill-intro .burDrillIntro__top {
  font-size: clamp(34px, 8.8vw, 64px) !important;
  line-height: .95 !important;
  letter-spacing: .01em !important;
  margin-bottom: 0 !important;
}

#bur-drill-intro .burDrillIntro__bottom {
  font-size: clamp(20px, 5.4vw, 34px) !important;
  line-height: 1.08 !important;
  margin-top: clamp(10px, 2vh, 18px) !important;
}

@media (max-width: 420px) {
  #bur-drill-intro .burDrill__frame {
    width: min(88vw, 340px) !important;
  }
}

@media (min-width: 900px) {
  #bur-drill-intro .burDrill__frame {
    width: min(42vw, 560px) !important;
  }
}

/* PATCH_LAKIZA_STARTUP_LOADER_EXACT_20260604
   Цель: не менять механику загрузчика, а заменить только центральный визуал и масштаб.
   Видимый загрузчик использует #startupLoader, не #bur-drill-intro.
*/

#startupLoader .startup-loader__animation {
  width: 100% !important;
  height: clamp(210px, 34vh, 360px) !important;
  min-height: 210px !important;
  max-height: 360px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: clamp(8px, 2vh, 18px) auto !important;
  overflow: visible !important;
}

/* Прячем старую CSS-буровую внутри стартового загрузчика */
#startupLoader .startup-loader__animation > * {
  display: none !important;
}

/* Вместо неё показываем массажную SVG-карточку крупно */
#startupLoader .startup-loader__animation::before {
  content: "" !important;
  display: block !important;
  width: min(94vw, 680px) !important;
  max-width: 680px !important;
  aspect-ratio: 900 / 520 !important;
  height: auto !important;
  background-image: url("/massage-intro.svg?v=startup_exact_20260604_1") !important;
  background-size: 100% 100% !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  border-radius: clamp(18px, 4vw, 32px) !important;
  box-shadow: 0 18px 42px rgba(0,0,0,.16) !important;
}

#startupLoader .startup-loader__title {
  font-size: clamp(32px, 9.2vw, 66px) !important;
  line-height: .96 !important;
  margin-bottom: clamp(6px, 1.4vh, 14px) !important;
}

#startupLoader .startup-loader__subtitle {
  font-size: clamp(19px, 5.1vw, 34px) !important;
  line-height: 1.08 !important;
  margin-top: clamp(6px, 1.4vh, 14px) !important;
}

#startupLoader .startup-loader__progress {
  width: min(84vw, 660px) !important;
  margin-top: clamp(8px, 1.8vh, 16px) !important;
}

#startupLoader .startup-loader__status {
  font-size: clamp(15px, 4.2vw, 24px) !important;
  margin-top: clamp(8px, 1.8vh, 16px) !important;
}

@media (max-width: 380px) and (max-height: 820px) {
  #startupLoader .startup-loader__animation {
    height: 250px !important;
    min-height: 250px !important;
  }

  #startupLoader .startup-loader__animation::before {
    width: 94vw !important;
  }
}

@media (min-width: 700px) {
  #startupLoader .startup-loader__animation {
    height: clamp(280px, 38vh, 420px) !important;
  }

  #startupLoader .startup-loader__animation::before {
    width: min(72vw, 720px) !important;
  }
}
