/* =========================================================================
   Sorteo $50,000 · landing
   Координаты — из макета Figma (PDF-экспорт), в пикселях фрейма:
     мобильный 390 × 693 — единица --m;
     десктоп 1440 × 900 — колонка в единицах --c (вписывается в экран),
                          сцена с подиумами в единицах --z (заполняет экран).
   Вертикальные позиции текста — от базовой линии макета:
     top = baseline − k · font-size, line-height = font-size,
     k = 0.875 (Unbounded), 0.84 (Ubuntu Sans).
   ========================================================================= */

/* ---------- Шрифты ---------- */
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/unbounded-700.woff2") format("woff2"); }
@font-face { font-family: "Ubuntu Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ubuntu-sans-400.woff2") format("woff2"); }
@font-face { font-family: "Ubuntu Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/ubuntu-sans-700.woff2") format("woff2"); }
@font-face { font-family: "Ubuntu Sans"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/ubuntu-sans-800.woff2") format("woff2"); }

/* Запасные шрифты с подогнанными метриками (на случай очень медленной сети) */
@font-face { font-family: "Unbounded Fallback"; src: local("Arial Black"), local("Arial-BoldMT"), local("Arial Bold"); size-adjust: 104%; ascent-override: 95.7%; descent-override: 23.6%; line-gap-override: 0%; }
@font-face { font-family: "Ubuntu Sans Fallback"; src: local("Arial"), local("ArialMT"), local("Helvetica"); size-adjust: 96%; ascent-override: 97.9%; descent-override: 27.1%; line-gap-override: 0%; }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: #000e4d;
  color: #fff;
  font-family: "Ubuntu Sans", "Ubuntu Sans Fallback", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img { display: block; max-width: none; border: 0; }
picture { display: block; }
ol, ul { list-style: none; margin: 0; padding: 0; }
p, h1, h2 { margin: 0; font-weight: inherit; font-size: inherit; }
a { -webkit-tap-highlight-color: transparent; -ms-touch-action: manipulation; touch-action: manipulation; }

/* Пока грузятся шрифты и ключевые картинки — страница прозрачна, idle на паузе */
.page { opacity: 1; -webkit-transition: opacity .3s ease; transition: opacity .3s ease; }
.is-loading .page { opacity: 0; }
.is-loading *, .is-paused * { -webkit-animation-play-state: paused !important; animation-play-state: paused !important; }

/* ---------- Масштаб: мобильная раскладка ---------- */
:root { --m: 1px; }
@media (max-width: 379px), (max-height: 659px) { :root { --m: .85px; } }
@supports (width: min(1px, 2px)) {
  :root { --m: min(calc(100vw / 390), calc(100vh / 693)); }
}
@supports (width: min(1px, 2px)) and (height: 100svh) {
  :root { --m: min(calc(100vw / 390), calc(100svh / 693)); }
}
:root { --c: var(--m); --z: var(--m); }

.page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;
}
@supports (min-height: 100svh) { .page { min-height: 100svh; } }

/* Поля вокруг мобильного фрейма — размытая копия фона, без видимых швов */
.fill { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.fill img {
  width: 100%; height: 100%; object-fit: cover;
  -webkit-filter: blur(48px) brightness(.72); filter: blur(48px) brightness(.72);
  -webkit-transform: scale(1.3); transform: scale(1.3);
}

.stage {
  position: relative;
  z-index: 1;
  width: calc(390 * var(--m));
  height: calc(693 * var(--m));
  -ms-flex-negative: 0; flex-shrink: 0;
}
.scene, .col { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.scene { z-index: 0; pointer-events: none; }
.col { z-index: 1; }

.scene__bg, .scene__bg img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.scene__bg img { object-fit: cover; }

/* Края мобильного фона плавно переходят в размытую заливку */
@media (min-aspect-ratio: 390/693) {
  .scene__bg { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 3%, #000 97%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 3%, #000 97%, transparent 100%); }
}
@media (max-aspect-ratio: 389/693) {
  .scene__bg { -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 2%, #000 98%, transparent 100%); mask-image: linear-gradient(180deg, transparent 0, #000 2%, #000 98%, transparent 100%); }
}

/* ---------- Общие текстовые стили ---------- */
.unb { font-family: "Unbounded", "Unbounded Fallback", "Arial Black", sans-serif; font-weight: 700; }
.title__text, .steps-title, .cta__label { font-family: "Unbounded", "Unbounded Fallback", "Arial Black", sans-serif; font-weight: 700; line-height: 1; white-space: nowrap; }

/* ---------- Мобильная раскладка (по умолчанию) — координаты фрейма 390 × 693 ---------- */
.logo { position: absolute; left: calc(146 * var(--c)); top: calc(12.9 * var(--c)); width: calc(98 * var(--c)); height: calc(72.1 * var(--c)); }
.logo img { width: 100%; height: 100%; }

.title { position: static; }
.title__text {
  position: absolute; left: 0; width: 100%;
  top: calc(93.875 * var(--c));
  font-size: calc(23 * var(--c));
  text-align: center;
  color: #fff;
}
.amount { position: absolute; left: calc(18 * var(--c)); top: calc(108.1 * var(--c)); width: calc(353.9 * var(--c)); height: calc(118 * var(--c)); pointer-events: none; }
.amount picture, .amount__img { width: 100%; height: 100%; }

.winners {
  position: absolute;
  left: calc(76 * var(--c)); top: calc(224 * var(--c));
  width: calc(238 * var(--c)); height: calc(30 * var(--c));
  border: calc(1.2 * var(--c)) solid #35d9ff;
  border-radius: calc(15 * var(--c));
  background: #0558dc;
  background: linear-gradient(180deg, #078aff 0%, #0336c6 45%, #057bfa 100%);
  box-shadow: inset 0 calc(1 * var(--c)) calc(2 * var(--c)) rgba(255, 255, 255, .35);
}
.winners span {
  position: absolute; left: 0; width: 100%;
  top: calc((229.04 - 224 - 1.2) * var(--c));
  font-size: calc(19 * var(--c)); line-height: 1;
  font-weight: 800;
  text-align: center; white-space: nowrap;
}

/* Подписи на подиумах — в координатах сцены */
.prize { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.prize__place, .prize__amount { position: absolute; display: block; line-height: 1; text-align: center; white-space: nowrap; }
.prize__place { font-weight: 800; color: #000f38; }
.prize__amount { font-weight: 800; color: #fff; }

.prize--1 .prize__place  { left: calc((195 - 70) * var(--z)); width: calc(140 * var(--z)); top: calc(395.25 * var(--z)); font-size: calc(12.8 * var(--z)); }
.prize--1 .prize__amount { left: calc((195 - 70) * var(--z)); width: calc(140 * var(--z)); top: calc(422.8 * var(--z));  font-size: calc(30 * var(--z)); }
.prize--2 .prize__place  { left: calc((74 - 50) * var(--z));  width: calc(100 * var(--z)); top: calc(415.09 * var(--z)); font-size: calc(11.8 * var(--z)); }
.prize--2 .prize__amount { left: calc((74 - 50) * var(--z));  width: calc(100 * var(--z)); top: calc(435.58 * var(--z)); font-size: calc(25.5 * var(--z)); }
.prize--3 .prize__place  { left: calc((316 - 50) * var(--z)); width: calc(100 * var(--z)); top: calc(416.09 * var(--z)); font-size: calc(11.8 * var(--z)); }
.prize--3 .prize__amount { left: calc((317 - 50) * var(--z)); width: calc(100 * var(--z)); top: calc(435.58 * var(--z)); font-size: calc(25.5 * var(--z)); }

.steps-title {
  position: absolute; left: 0; width: 100%;
  top: calc(491 * var(--c));
  font-size: calc(16 * var(--c));
  text-align: center;
}
.step { position: absolute; left: 0; top: 0; width: 100%; }
.step__num {
  position: absolute;
  left: calc(64 * var(--c));
  width: calc(28 * var(--c)); height: calc(28 * var(--c));
  border: calc(1.2 * var(--c)) solid #38cdff;
  border-radius: 50%;
  background: #0750d3;
  background: linear-gradient(180deg, #00c8ff 0%, #0750d3 50%, #002a99 100%);
  font-size: calc(24 * var(--c)); line-height: 1;
  font-weight: 700;
  text-align: center;
  padding-top: calc((1.34 - 1.2) * var(--c));
}
.step__text {
  position: absolute;
  left: calc(105 * var(--c));
  font-size: calc(12 * var(--c)); line-height: calc(16 * var(--c));
  font-weight: 700;
  white-space: pre-line;
}
.step--1 .step__num { top: calc(515 * var(--c)); }
.step--2 .step__num { top: calc(550 * var(--c)); }
.step--3 .step__num { top: calc(585 * var(--c)); }
.step--1 .step__text { top: calc(520.92 * var(--c)); }
.step--2 .step__text { top: calc(547.92 * var(--c)); }
.step--3 .step__text { top: calc(590.92 * var(--c)); }

.cta {
  position: absolute;
  left: calc(35.47 * var(--c)); top: calc(621.15 * var(--c));
  width: calc(319.06 * var(--c)); height: calc(48.77 * var(--c));
  display: block;
  color: #001544;
  text-decoration: none;
  border-radius: calc(24 * var(--c));
  outline: none;
  -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
.cta__body {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  display: block;
  border-radius: inherit;
  -webkit-transform-origin: 50% 50%; transform-origin: 50% 50%;
}
.cta__bg, .cta__bg img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.cta__label {
  position: absolute; left: 0; width: 100%;
  top: calc((637 - 621.15) * var(--c));
  font-size: calc(16 * var(--c));
  text-align: center;
}
.cta:focus-visible .cta__body { box-shadow: 0 0 0 calc(3 * var(--c)) #fff, 0 0 0 calc(6 * var(--c)) #078aff; }

.legal {
  position: absolute; left: 0; width: 100%;
  top: calc(676.44 * var(--c));
  font-size: calc(9 * var(--c)); line-height: 1;
  color: #bcd2f7;
  text-align: center; white-space: nowrap;
}

/* Подсветка и блики — только на десктопе (мобильный макет статичен) */
.glow, .glint { display: none; pointer-events: none; }

/* =========================================================================
   Десктоп: эталон 1440 × 900.
   Сцена заполняет экран и прижата вправо (обрезается тёмный левый край или
   однотонные верх/низ). Колонка вписывается в экран и прижата влево.
   ========================================================================= */
@media (min-width: 900px) and (min-aspect-ratio: 29/20) {
  :root {
    --c: calc(100vh / 900);
    --z: calc(100vw / 1440);
  }
  @supports (width: min(1px, 2px)) {
    :root {
      --c: min(calc(100vw / 1440), calc(100vh / 900));
      --z: max(calc(100vw / 1440), calc(100vh / 900));
    }
  }

  .fill { display: none; }
  .page { display: block; height: 100vh; }
  .stage { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }

  .scene {
    left: auto; right: 0;
    top: 50%;
    width: calc(1440 * var(--z)); height: calc(900 * var(--z));
    -webkit-transform: translateY(-50%); transform: translateY(-50%);
  }
  .scene__bg { -webkit-mask-image: none; mask-image: none; }

  .col {
    top: 50%;
    width: calc(1440 * var(--c)); height: calc(900 * var(--c));
    -webkit-transform: translateY(-50%); transform: translateY(-50%);
    pointer-events: none;
  }
  .col > * { pointer-events: auto; }
  .col > .glint { pointer-events: none; }

  .logo { left: calc(82 * var(--c)); top: calc(33.2 * var(--c)); width: calc(115 * var(--c)); height: calc(84.7 * var(--c)); }

  .title__text { left: calc(82 * var(--c)); width: auto; top: calc(157 * var(--c)); font-size: calc(32 * var(--c)); text-align: left; }
  .amount { left: calc(64.1 * var(--c)); top: calc(196.2 * var(--c)); width: calc(629.8 * var(--c)); height: calc(209.9 * var(--c)); }

  .winners {
    left: calc(76 * var(--c)); top: calc(410 * var(--c));
    width: calc(328 * var(--c)); height: calc(44 * var(--c));
    border-radius: calc(22 * var(--c));
  }
  .winners span { top: calc((420.16 - 410 - 1.2) * var(--c)); font-size: calc(26 * var(--c)); }

  .prize--1 .prize__place  { left: calc((1023 - 120) * var(--z));   width: calc(240 * var(--z)); top: calc(551.84 * var(--z)); font-size: calc(24 * var(--z)); }
  .prize--1 .prize__amount { left: calc((1024 - 120) * var(--z));   width: calc(240 * var(--z)); top: calc(609.16 * var(--z)); font-size: calc(51 * var(--z)); }
  .prize--2 .prize__place  { left: calc((769 - 100) * var(--z));    width: calc(200 * var(--z)); top: calc(594.36 * var(--z)); font-size: calc(21 * var(--z)); }
  .prize--2 .prize__amount { left: calc((770.45 - 100) * var(--z)); width: calc(200 * var(--z)); top: calc(639.88 * var(--z)); font-size: calc(43 * var(--z)); }
  .prize--3 .prize__place  { left: calc((1289.45 - 100) * var(--z)); width: calc(200 * var(--z)); top: calc(594.36 * var(--z)); font-size: calc(21 * var(--z)); }
  .prize--3 .prize__amount { left: calc((1289.45 - 100) * var(--z)); width: calc(200 * var(--z)); top: calc(639.88 * var(--z)); font-size: calc(43 * var(--z)); }

  .steps-title { left: calc(84 * var(--c)); width: auto; top: calc(513.75 * var(--c)); font-size: calc(22 * var(--c)); text-align: left; }
  .step__num {
    left: calc(84 * var(--c));
    width: calc(42 * var(--c)); height: calc(42 * var(--c));
    font-size: calc(32 * var(--c));
    padding-top: calc((5.12 - 1.2) * var(--c));
  }
  .step__text { left: calc(144 * var(--c)); font-size: calc(22 * var(--c)); line-height: calc(25 * var(--c)); }
  .step--1 .step__num { top: calc(562 * var(--c)); }
  .step--2 .step__num { top: calc(618 * var(--c)); }
  .step--3 .step__num { top: calc(674 * var(--c)); }
  .step--1 .step__text { top: calc(570.02 * var(--c)); }
  .step--2 .step__text { top: calc(614.02 * var(--c)); }
  .step--3 .step__text { top: calc(682.02 * var(--c)); }

  .cta {
    left: calc(91.87 * var(--c)); top: calc(745.6 * var(--c));
    width: calc(459.2 * var(--c)); height: calc(70.2 * var(--c));
    border-radius: calc(35 * var(--c));
  }
  .cta__label { top: calc((768 - 745.6) * var(--c)); font-size: calc(24 * var(--c)); }

  .legal { left: calc(84 * var(--c)); width: auto; top: calc(846.24 * var(--c)); font-size: calc(14 * var(--c)); text-align: left; }

  /* ---------- Подсветка под подиумами (радиальные градиенты, Screen) ---------- */
  .glow { display: block; position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
  .glow__spot, .glow__edge { position: absolute; display: block; mix-blend-mode: screen; }
  .glow__spot {
    background: radial-gradient(closest-side, rgba(61, 212, 255, 1) 0%, rgba(9, 150, 255, .78) 30%, rgba(3, 74, 255, .30) 65%, rgba(3, 74, 255, 0) 100%);
  }
  .glow__edge {
    background: radial-gradient(closest-side, rgba(189, 250, 255, 1) 0%, rgba(36, 204, 255, .85) 45%, rgba(5, 112, 255, 0) 100%);
  }
  .glow__spot.glow--l { left: calc(633 * var(--z));  top: calc(675 * var(--z)); width: calc(270 * var(--z)); height: calc(98 * var(--z)); }
  .glow__spot.glow--c { left: calc(861 * var(--z));  top: calc(686 * var(--z)); width: calc(326 * var(--z)); height: calc(116 * var(--z)); }
  .glow__spot.glow--r { left: calc(1155 * var(--z)); top: calc(673 * var(--z)); width: calc(270 * var(--z)); height: calc(98 * var(--z)); }
  .glow__edge.glow--l { left: calc(662 * var(--z));  top: calc(699 * var(--z)); width: calc(213 * var(--z)); height: calc(12 * var(--z)); }
  .glow__edge.glow--c { left: calc(902 * var(--z));  top: calc(716 * var(--z)); width: calc(244 * var(--z)); height: calc(12 * var(--z)); }
  .glow__edge.glow--r { left: calc(1192 * var(--z)); top: calc(701 * var(--z)); width: calc(212 * var(--z)); height: calc(12 * var(--z)); }

  .glow--side   { opacity: .82; -webkit-animation: glow-side 6s infinite; animation: glow-side 6s infinite; }
  .glow--center { opacity: .25; -webkit-animation: glow-center 6s infinite; animation: glow-center 6s infinite; }

  /* ---------- Блики на золотых гранях суммы ---------- */
  .glint {
    display: block;
    position: absolute;
    width: calc(34 * var(--c)); height: calc(34 * var(--c));
    margin: calc(-17 * var(--c)) 0 0 calc(-17 * var(--c));
    opacity: .05;
    mix-blend-mode: screen;
    background:
      radial-gradient(closest-side, rgba(255, 255, 255, 1) 0%, rgba(255, 244, 196, .9) 18%, rgba(255, 214, 102, 0) 60%),
      linear-gradient(90deg, rgba(255, 250, 220, 0) 0%, rgba(255, 250, 220, 1) 50%, rgba(255, 250, 220, 0) 100%) 50% 50% / 100% 8% no-repeat,
      linear-gradient(180deg, rgba(255, 250, 220, 0) 0%, rgba(255, 250, 220, 1) 50%, rgba(255, 250, 220, 0) 100%) 50% 50% / 8% 100% no-repeat;
  }
  .glint--1 { left: calc(268 * var(--c)); top: calc(231 * var(--c)); -webkit-animation: glint-1 6s infinite; animation: glint-1 6s infinite; }
  .glint--2 { left: calc(640 * var(--c)); top: calc(253 * var(--c)); -webkit-animation: glint-2 6s infinite; animation: glint-2 6s infinite; }

  /* ---------- Сумма: только translateY, 0 → −4 → 0 px за 6 с ---------- */
  .amount picture { -webkit-animation: amount 6s infinite; animation: amount 6s infinite; will-change: transform; }

  /* ---------- CTA: scale 1 → 1.035 → 1 за 3 с ---------- */
  .cta__body { -webkit-animation: cta-pulse 3s infinite; animation: cta-pulse 3s infinite; will-change: transform; }
  .cta.is-hold .cta__body { -webkit-animation: none; animation: none; }
}

/* ---------- Ключевые кадры (easing по ТЗ: cubic-bezier(0.42, 0, 0.58, 1) на каждом участке) ---------- */
@-webkit-keyframes amount { 0%, 100% { -webkit-transform: translateY(0); -webkit-animation-timing-function: cubic-bezier(.42, 0, .58, 1); } 50% { -webkit-transform: translateY(calc(-4 * var(--c))); -webkit-animation-timing-function: cubic-bezier(.42, 0, .58, 1); } }
@keyframes amount { 0%, 100% { transform: translateY(0); animation-timing-function: cubic-bezier(.42, 0, .58, 1); } 50% { transform: translateY(calc(-4 * var(--c))); animation-timing-function: cubic-bezier(.42, 0, .58, 1); } }

@-webkit-keyframes cta-pulse { 0%, 100% { -webkit-transform: scale(1); -webkit-animation-timing-function: cubic-bezier(.42, 0, .58, 1); } 50% { -webkit-transform: scale(1.035); -webkit-animation-timing-function: cubic-bezier(.42, 0, .58, 1); } }
@keyframes cta-pulse { 0%, 100% { transform: scale(1); animation-timing-function: cubic-bezier(.42, 0, .58, 1); } 50% { transform: scale(1.035); animation-timing-function: cubic-bezier(.42, 0, .58, 1); } }

@-webkit-keyframes glow-side { 0%, 100% { opacity: .82; -webkit-animation-timing-function: cubic-bezier(.42, 0, .58, 1); } 50% { opacity: .25; -webkit-animation-timing-function: cubic-bezier(.42, 0, .58, 1); } }
@keyframes glow-side { 0%, 100% { opacity: .82; animation-timing-function: cubic-bezier(.42, 0, .58, 1); } 50% { opacity: .25; animation-timing-function: cubic-bezier(.42, 0, .58, 1); } }
@-webkit-keyframes glow-center { 0%, 100% { opacity: .25; -webkit-animation-timing-function: cubic-bezier(.42, 0, .58, 1); } 50% { opacity: .9; -webkit-animation-timing-function: cubic-bezier(.42, 0, .58, 1); } }
@keyframes glow-center { 0%, 100% { opacity: .25; animation-timing-function: cubic-bezier(.42, 0, .58, 1); } 50% { opacity: .9; animation-timing-function: cubic-bezier(.42, 0, .58, 1); } }

/* Блик 1: 0.90 / 1.35 / 1.80 с из 6 с → 15% / 22.5% / 30%; блик 2: 2.10 / 2.55 / 3.00 с → 35% / 42.5% / 50% */
@-webkit-keyframes glint-1 { 0%, 15%, 30%, 100% { opacity: .05; -webkit-animation-timing-function: cubic-bezier(.42, 0, .58, 1); } 22.5% { opacity: .85; -webkit-animation-timing-function: cubic-bezier(.42, 0, .58, 1); } }
@keyframes glint-1 { 0%, 15%, 30%, 100% { opacity: .05; animation-timing-function: cubic-bezier(.42, 0, .58, 1); } 22.5% { opacity: .85; animation-timing-function: cubic-bezier(.42, 0, .58, 1); } }
@-webkit-keyframes glint-2 { 0%, 35%, 50%, 100% { opacity: .05; -webkit-animation-timing-function: cubic-bezier(.42, 0, .58, 1); } 42.5% { opacity: .85; -webkit-animation-timing-function: cubic-bezier(.42, 0, .58, 1); } }
@keyframes glint-2 { 0%, 35%, 50%, 100% { opacity: .05; animation-timing-function: cubic-bezier(.42, 0, .58, 1); } 42.5% { opacity: .85; animation-timing-function: cubic-bezier(.42, 0, .58, 1); } }

/* ---------- prefers-reduced-motion: без циклического движения;
   сумма, кнопка и мягкая подсветка — статичные ---------- */
@media (prefers-reduced-motion: reduce) {
  .amount picture, .cta__body, .glow__spot, .glow__edge, .glint { -webkit-animation: none !important; animation: none !important; }
  .glow__spot, .glow__edge { opacity: .6 !important; }
  .glint { opacity: 0 !important; }
  .page { -webkit-transition: none; transition: none; }
}

.cta__body {
  -webkit-animation: cta-pulse 3s infinite;
  animation: cta-pulse 3s infinite;
  will-change: transform;
}

.cta.is-hold .cta__body {
  -webkit-animation: none;
  animation: none;
}