/* Стартовые экраны квеста — по макету Claude Design «Стартовый экран» (цвета переведены из oklch в sRGB для старых браузеров).
   Макет 390×844 целиком масштабируется под экран (js/start.js → --k); регистрация и «готово» — в обычных размерах. */
@font-face { font-family: Montserrat; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../assets/fonts/montserrat-cyr.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Montserrat; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../assets/fonts/montserrat-lat.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root { --cream: #fdfaf3; --gold: #efcc83; --red: #c21725; --ink: #231717; --muted: #745d5b;
  --grad: linear-gradient(160deg, #de3b3d, #9a0b2c); --k: 1; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { overflow: hidden; background: var(--grad) fixed; font-family: Montserrat, system-ui, sans-serif; color: var(--ink); -webkit-font-smoothing: antialiased; }
button, input { font-family: inherit; }
button { cursor: pointer; }
a { color: var(--red); text-decoration: underline; text-underline-offset: 2px; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid #e9ca89; outline-offset: 3px; }
input::placeholder { color: #baaaa5; }
.ic { fill: none; stroke: currentColor; stroke-width: 24; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic .f, .ic.fill path { fill: currentColor; stroke: none; }
.ic.thin { stroke-width: 6; color: var(--cream); }

/* ---------- падающий снег (весь экран) ---------- */
.snow { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.snow span { position: absolute; top: -10px; border-radius: 50%; }

/* ---------- макет (масштабируется) ---------- */
.stage-wrap { position: fixed; inset: 0; overflow: hidden; }
.stage { position: absolute; left: 50%; top: 50%; width: 390px; height: 808px; margin: -404px 0 0 -195px; transform: scale(var(--k)); }
.stage > * { translate: 0 -36px; }                         /* в макете сверху 52px под строку состояния — в браузере она своя */
.st-logo { position: absolute; top: 52px; left: 16px; right: 16px; height: 50px; display: flex; align-items: center; justify-content: center; animation: fadeDown .6s ease-out .1s both; transition: opacity .3s; }
.tree { position: absolute; left: 50%; top: 168px; width: 230px; height: 300px; margin-left: -115px; transform-origin: 50% 0; transition: transform .7s cubic-bezier(.2, .8, .2, 1), top .7s cubic-bezier(.2, .8, .2, 1), opacity .4s; }
.tree > svg { position: absolute; left: 0; top: 0; overflow: visible; }
body[data-screen="done"] .tree { top: 150px; transform: scale(.72); }
body:is([data-screen="phone"], [data-screen="code"], [data-screen="callin"], [data-screen="max"], [data-screen="choose"], [data-screen="push"], [data-screen="install"], [data-screen="friend"]) .tree { opacity: 0; }
body:is([data-screen="phone"], [data-screen="code"], [data-screen="callin"], [data-screen="max"], [data-screen="choose"], [data-screen="push"], [data-screen="install"], [data-screen="friend"]) .st-logo { visibility: hidden; }   /* у регистрации свой логотип */

.hello { position: absolute; left: 24px; right: 24px; top: 478px; text-align: center; pointer-events: none; opacity: 0; transform: translateY(-30px); transition: opacity .4s, transform .6s cubic-bezier(.2, .8, .2, 1); }
body[data-screen="welcome"] .hello { opacity: 1; transform: none; }
.hello__k { display: block; font-size: 12.5px; font-weight: 700; letter-spacing: .16em; color: rgba(255,255,255,0.82); animation: fadeUp .6s ease-out .3s both; }
.hello__l { overflow: hidden; }
.hello__l:first-of-type { margin-top: 12px; }
.hello__l span { display: block; font-size: 46px; font-weight: 800; line-height: 1.04; letter-spacing: -.03em; white-space: nowrap; color: var(--cream); animation: lineUp .8s cubic-bezier(.2, .8, .2, 1) both; }

/* отсчёт */
.cd { display: none; position: absolute; left: 0; right: 0; top: 478px; bottom: 0; flex-direction: column; align-items: center; text-align: center; padding: 0 16px; }
body[data-screen="countdown"] .cd { display: flex; }
.cd__k { font-size: 12.5px; font-weight: 700; letter-spacing: .16em; color: rgba(255,255,255,0.82); animation: fadeUp .6s ease-out .3s both; }
.cd__n { position: relative; margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 14px; animation: fadeUp .6s ease-out .45s both; }
.cd__line { height: 1px; width: 44px; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5)); }
.cd__line--r { background: linear-gradient(90deg, rgba(255,255,255,0.5), transparent); }
.cd__num { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cd__spark { position: absolute; right: -22px; top: -4px; color: var(--gold); filter: drop-shadow(0 0 6px #efcc83); animation: twinkle 2.4s ease-in-out infinite; }
.cd__num b { font-size: 96px; font-weight: 800; letter-spacing: -.05em; line-height: .85; color: var(--cream); font-variant-numeric: tabular-nums; text-shadow: 0 6px 24px rgba(92,0,18,0.35); }
.cd__num small { font-size: 15px; font-weight: 700; letter-spacing: .2em; color: rgba(255,255,255,0.85); padding-left: .2em; }
.cd__t { margin-top: 18px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: var(--cream); animation: fadeUp .6s ease-out .6s both; }
.cd__d { margin-top: 6px; font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.82); animation: fadeUp .6s ease-out .7s both; }
.cd__btn { position: absolute; left: 16px; right: 16px; bottom: 30px; height: 64px; border-radius: 20px; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.35); display: flex; align-items: center; justify-content: center; gap: 10px; overflow: hidden;
  color: var(--cream); font-size: 16px; font-weight: 700; animation: fadeUp .6s ease-out .85s both; }
.cd__btn > * { position: relative; }
.cd__fill { position: absolute !important; left: 0; top: 0; bottom: 0; width: 4%; background: rgba(255,255,255,0.12); transition: width 1s linear; }

/* добро пожаловать: бегущая строка и «Начать квест» */
.wl { display: none; position: absolute; inset: 0; pointer-events: none; }
body[data-screen="welcome"] .wl { display: block; }
.wl__go { pointer-events: auto; position: absolute; left: 16px; right: 16px; bottom: 30px; height: 64px; border: 0; border-radius: 20px; overflow: hidden; background: var(--cream); display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px 0 24px; color: #c21725; font-size: 18px; font-weight: 800; box-shadow: 0 12px 28px rgba(70,0,12,0.35); animation: fadeUp .6s ease-out 1.25s both; transition: transform .15s; }
.wl__go:active { transform: scale(.97); }
.wl__shine { position: absolute; top: 0; bottom: 0; left: 0; width: 56px; background: linear-gradient(90deg, transparent, rgba(230,202,145,0.6), transparent); animation: shimmer 3.6s ease-in-out 2.4s infinite; pointer-events: none; }
.wl__t { position: relative; }
.wl__ar { position: relative; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--grad); color: var(--cream); }

/* ---------- регистрация (обычные размеры) ---------- */
.auth { display: none; position: fixed; inset: 0; z-index: 3; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }   /* длинные экраны (MAX, запасные способы) — прокручиваются */
body:is([data-screen="phone"], [data-screen="code"], [data-screen="callin"], [data-screen="max"], [data-screen="choose"], [data-screen="push"], [data-screen="install"], [data-screen="friend"]) .auth { display: block; }
.auth__top { z-index: 2; position: absolute; top: calc(env(safe-area-inset-top, 0px) + 14px); left: 16px; right: 16px; height: 50px; display: flex; align-items: center; justify-content: center; animation: fadeDown .5s ease-out both; }
.auth__back { position: absolute; left: 0; top: 0; width: 50px; height: 50px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(255,255,255,0.14); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.22); color: var(--cream); }
.auth__back:active { transform: scale(.94); }
.card { position: relative; width: calc(100% - 24px); max-width: 440px; margin: calc(env(safe-area-inset-top, 0px) + 78px) auto 28px; padding: 22px 18px 18px; border-radius: 30px; background: var(--cream);
  box-shadow: 0 18px 40px rgba(70,0,12,0.3); animation: fadeUp .6s cubic-bezier(.2, .9, .25, 1.05) .1s both; transition: translate .25s ease-out; }
.step { display: none; flex-direction: column; gap: 16px; margin: 0; }
body[data-screen="phone"] .step--phone, body[data-screen="code"] .step--code, body[data-screen="callin"] .step--callin, body[data-screen="max"] .step--max, body[data-screen="choose"] .step--choose, body[data-screen="push"] .step--push, body[data-screen="install"] .step--install, body[data-screen="friend"] .step--friend { display: flex; }
.step__h { display: flex; flex-direction: column; gap: 6px; animation: fadeUp .5s ease-out .2s both; }
.step__k { font-size: 12.5px; font-weight: 700; letter-spacing: .12em; color: var(--red); }
.step__t { margin: 0; font-size: 26px; font-weight: 800; line-height: 1.1; letter-spacing: -.01em; }
.step__s { font-size: 14px; font-weight: 500; color: var(--muted); }
.step__legal { font-size: 12px; line-height: 1.5; color: var(--muted); animation: fadeUp .5s ease-out .45s both; }
.ph { display: flex; flex-direction: column; gap: 8px; animation: fadeUp .5s ease-out .3s both; }
.ph__box { height: 62px; padding: 0 16px; border-radius: 18px; background: #f7ece6; display: flex; align-items: center; gap: 12px; transition: box-shadow .2s; cursor: text; }
.ph__box.is-ok { box-shadow: inset 0 0 0 2px #298646; }
.ph__box.is-err { box-shadow: inset 0 0 0 2px #cc272e; animation: shake .4s ease-in-out; }
.ph__cc { font-size: 20px; font-weight: 800; }
.ph__sep { width: 1.5px; height: 26px; background: #ddcdc7; }
.ph__box input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; font-size: 20px; font-weight: 700; letter-spacing: .02em; color: var(--ink); }
.ph__ok { display: none; color: #298646; animation: pop .4s ease-out both; }
.ph__box.is-ok .ph__ok { display: block; }
.ph__err, .code__err { font-size: 13px; font-weight: 600; color: var(--red); }
.btn-red { height: 60px; border: 0; border-radius: 18px; display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--grad); color: var(--cream); font-size: 16px; font-weight: 800; text-decoration: none;
  box-shadow: 0 8px 18px rgba(165,0,19,0.35); transition: opacity .3s, transform .15s; }
.btn-red:active { transform: scale(.97); }
#btnSend { animation: fadeUp .5s ease-out .4s both; }
#btnSend.is-off { opacity: .45; }
.code { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; cursor: text; animation: fadeUp .5s ease-out .25s both; }
.code.is-err { animation: shake .4s ease-in-out; }
.code__b { position: relative; height: 68px; border-radius: 18px; background: #f7ece6; display: grid; place-items: center; font-size: 30px; font-weight: 800; transition: transform .2s, box-shadow .2s; }
.code__b.is-on { box-shadow: inset 0 0 0 2px rgba(204,39,46,0.5); }
.code__b.is-on::after { content: ""; position: absolute; width: 2.5px; height: 30px; border-radius: 2px; background: #cc272e; animation: blink 1s step-end infinite; }
.code__b.is-full { box-shadow: inset 0 0 0 2px #cc272e; transform: translateY(-3px); }
.code.is-err .code__b.is-full { box-shadow: inset 0 0 0 2px #cc272e; color: var(--red); }
.code input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; font-size: 16px; color: transparent; caret-color: transparent; }
.code__row { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; font-weight: 600; animation: fadeUp .5s ease-out .35s both; }
.lnk { border: 0; background: none; padding: 8px 0; color: var(--red); font-size: 13.5px; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.code__wait { color: var(--muted); }
.code__demo { font-size: 12px; color: #8c7c79; }
/* скрытое — всегда скрыто (display у блоков ниже иначе перебивает атрибут hidden) */
[hidden] { display: none !important; }
#phMasked, #ciMasked { white-space: nowrap; }
/* запасные способы подтверждения */
.code__help { display: flex; flex-direction: column; gap: 8px; animation: fadeUp .4s ease-out both; }
.code__help-t { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.code__alt { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.alt { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; padding: 11px 12px; border: 0; border-radius: 16px; background: #f7ece6; color: var(--ink); text-align: left; }
.alt b { font-size: 14px; font-weight: 800; color: var(--red); }
.alt small { font-size: 11.5px; line-height: 1.3; color: var(--muted); }
.alt:active { transform: scale(.97); }
.alt.is-busy { opacity: .5; pointer-events: none; }
.btn-red.is-busy { opacity: .6; pointer-events: none; }
/* «позвоните нам» */
.step--callin .btn-red { font-size: 20px; letter-spacing: .02em; }
.ci__qr { align-self: center; width: 160px; height: 160px; border-radius: 12px; }
.ci__wait { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.ci__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: ciPulse 1.2s ease-in-out infinite; }
@keyframes ciPulse { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }

/* ---------- готово ---------- */
.done { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; max-width: 520px; margin: 0 auto; padding: 30px 20px calc(env(safe-area-inset-bottom, 0px) + 30px); border-radius: 32px 32px 0 0; background: var(--cream);
  box-shadow: 0 -14px 40px rgba(70,0,12,0.3); flex-direction: column; align-items: center; text-align: center; gap: 18px; animation: sheetIn .7s cubic-bezier(.2, .9, .25, 1.05) both; }
body[data-screen="done"] .done { display: flex; }
.done__burst { position: absolute; inset: 0; pointer-events: none; }
.done__burst span { position: absolute; left: 42px; top: 42px; animation: burst 1.1s cubic-bezier(.2, .8, .3, 1) both; }
.done__go { align-self: stretch; animation: fadeUp .5s ease-out .75s both; }

/* компьютер: макет в рамке телефона, как в прототипе */
@media (min-width: 700px) and (min-height: 700px) {
  body { background: radial-gradient(ellipse at 50% 0%, #7c2529, #2e1011) fixed; }
  .stage { border-radius: 44px; overflow: hidden; background: var(--grad); box-shadow: 0 30px 70px rgba(28,2,4,0.5); }
  .auth, .done { max-width: 390px; margin: 0 auto; }
  .snow { display: none; }
}

@keyframes snowfall { from { transform: translateY(-20px); } to { transform: translateY(110vh); } }
@keyframes sheetIn { from { transform: translateY(105%); } to { transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@keyframes lineUp { from { transform: translateY(110%); } to { transform: none; } }
@keyframes pop { 0% { transform: scale(0); opacity: 0; } 70% { transform: scale(1.3); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes twinkle { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .3; transform: scale(.65); } }
@keyframes starIn { 0% { transform: translateY(-50px) scale(.2) rotate(-120deg); opacity: 0; } 70% { transform: translateY(4px) scale(1.15) rotate(10deg); opacity: 1; } 100% { transform: none; opacity: 1; } }
@keyframes drift { 0%, 100% { transform: rotate(-10deg) translateY(0); } 50% { transform: rotate(-4deg) translateY(-10px); } }
@keyframes shimmer { 0% { transform: translateX(-140%) skewX(-20deg); } 55%, 100% { transform: translateX(620%) skewX(-20deg); } }
@keyframes shake { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes burst { from { transform: translate(0, 0) scale(.4) rotate(0); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(1) rotate(160deg); opacity: 0; } }
@keyframes draw { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes ftw { 0%, 100% { opacity: .18; } 50% { opacity: .06; } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
.code__alt > .alt:only-child { grid-column: 1 / -1; }   /* одна кнопка — на всю ширину */

/* звонок робота: «возьмите трубку» и что со звонком */
.call-warn { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 12px 14px; border-radius: 16px; background: #fff1d6; color: #5a3a00; box-shadow: inset 0 0 0 1.5px #f0c25a; }
.call-warn svg { flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; animation: phoneShake 1.2s ease-in-out infinite; }
.call-warn b { display: block; font-size: 16px; line-height: 1.25; }
.call-warn span { font-size: 14px; line-height: 1.3; }
@keyframes phoneShake { 0%, 60%, 100% { transform: rotate(0); } 10%, 30%, 50% { transform: rotate(-14deg); } 20%, 40% { transform: rotate(14deg); } }
@media (prefers-reduced-motion: reduce) { .call-warn svg { animation: none; } }
.call-st { display: flex; align-items: center; gap: 8px; margin: -4px 2px 12px; font-size: 14px; line-height: 1.3; font-weight: 600; color: #6b5559; }
.call-st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.call-st.is-calling::before { animation: callPulse 1s ease-in-out infinite; }
.call-st.is-ok { color: #1f8a4c; }
.call-st.is-bad { color: #c0322d; }
@keyframes callPulse { 50% { opacity: .25; } }

/* подтверждение через бота MAX */
.step--max .btn-red { font-size: 18px; }
.mx__steps { margin: 0; padding: 0 0 0 4px; list-style: none; display: grid; gap: 8px; counter-reset: mx; }
.mx__steps li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.35; }
.mx__steps li::before { counter-increment: mx; content: counter(mx); flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--red); color: #fff; font-size: 13px; font-weight: 700; }
.mx__desk { font-size: 13.5px; color: var(--muted); text-align: center; }
#mxMasked { white-space: nowrap; }

/* выбор способа после ввода номера: MAX или «позвоню сам» — оба бесплатные */
.ch { display: grid; gap: 10px; }
.ch__b { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px; border: 0; border-radius: 20px; background: #f6ece6; color: inherit; font: inherit; text-align: left; cursor: pointer; box-shadow: inset 0 0 0 1.5px rgba(200, 40, 58, .14); transition: transform .12s, box-shadow .2s; }
.ch__b:active { transform: scale(.98); }
.ch__b:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.ch__b.is-busy { opacity: .6; pointer-events: none; }
.ch__ic { flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--red); color: #fff; }
.ch__ic svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ch__ic--max { background: linear-gradient(135deg, #4b6bff, #8a3dff); font-size: 15px; font-weight: 800; line-height: 1; letter-spacing: .02em; }
.ch__t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ch__t b { font-size: 17px; line-height: 1.2; }
.ch__t small { font-size: 13.5px; line-height: 1.3; color: var(--muted); }
.ch__ar { margin-left: auto; flex: none; color: var(--red); font-size: 22px; }

/* MAX: тот же номер; MAX на другом телефоне — QR-код и ссылка */
.mx__warn { margin: 0; padding: 10px 12px; border-radius: 14px; background: #fff1d6; color: #5a3a00; font-size: 14px; line-height: 1.4; }
.mx__warn b { white-space: nowrap; }
.mx__warn .lnk { font: inherit; font-weight: 700; padding: 0; }
.mx__other { border-radius: 16px; background: #f6ece6; padding: 0 14px; }
.mx__other summary { cursor: pointer; padding: 12px 0; font-weight: 700; font-size: 15px; color: var(--red); list-style: none; }
.mx__other summary::-webkit-details-marker { display: none; }
.mx__other summary::after { content: " ▸"; }
.mx__other[open] summary::after { content: " ▾"; }
.mx__other p { margin: 0 0 10px; font-size: 14px; line-height: 1.4; color: var(--muted); }
.mx__qr { display: grid; place-items: center; margin: 0 auto 12px; width: 184px; height: 184px; padding: 8px; border-radius: 14px; background: #fff; }
.mx__qr svg { width: 100%; height: 100%; display: block; }
.mx__btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-bottom: 14px; }
.mx__btns:has(#btnMxShare[hidden]) { grid-template-columns: 1fr; }   /* «Отправить» нет (компьютер) — «Скопировать» на всю ширину */

/* SIM-push */
.ch__ic--push { background: #2f8a55; }
.ps__code { display: grid; gap: 8px; }
.ps__lab { font-size: 14px; font-weight: 600; }
.ps__row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.ps__row input { min-width: 0; height: 56px; border: 0; border-radius: 16px; padding: 0 16px; background: #f6ece6; font: inherit; font-size: 20px; font-weight: 700; letter-spacing: .1em; color: inherit; }
.ps__row input:focus { outline: 2px solid var(--red); }
.ps__row .btn-red { height: 56px; padding: 0 20px; font-size: 16px; }

/* MAX: выбор «на этом телефоне» / «на другом» */
.ch__ic--qr { background: #2a1d4f; }
.ch__b.is-on { box-shadow: inset 0 0 0 2px var(--red); background: #fbe9e6; }
.ch__b:not(.is-on) .ch__ar { opacity: .7; }
.mx__panel { display: grid; gap: 12px; padding: 14px; border-radius: 18px; background: #f6ece6; }
.mx__panel .mx__qr { margin: 2px auto; }
.mx__panel > .lnk { justify-self: start; font-size: 14px; }
.mx__or { margin: 0; font-size: 13.5px; line-height: 1.35; color: var(--muted); text-align: center; }
.mx__chg { font: inherit; font-weight: 700; padding: 0; }
#mxPick .ch__b { text-decoration: none; color: inherit; }
.mx__panel .alt { background: #fff; box-shadow: inset 0 0 0 1.5px rgba(200, 40, 58, .18); text-align: center; }

/* автозаполнение Chrome красит поле в голубой — возвращаем наш фон и цвет текста */
.ph__box input:-webkit-autofill, .ph__box input:-webkit-autofill:hover, .ph__box input:-webkit-autofill:focus,
.mx__edit input:-webkit-autofill, .mx__edit input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 100px #f7ece6 inset; box-shadow: 0 0 0 100px #f7ece6 inset;
  -webkit-text-fill-color: var(--ink); caret-color: var(--ink); transition: background-color 99999s;
}
.ph__box input:autofill { background: none; }
/* экран MAX: номер можно поправить прямо тут */
.mx__num { font: inherit; padding: 0; border: 0; background: none; color: var(--ink); font-weight: 700; cursor: pointer; white-space: nowrap; }
.mx__num::after { content: " ✎"; color: var(--red); font-weight: 600; }
.mx__edit { display: flex; align-items: center; gap: 8px; height: 50px; padding: 0 6px 0 14px; border-radius: 16px; background: #f7ece6; box-shadow: inset 0 0 0 2px var(--red); }
.mx__edit span { font-weight: 700; }
.mx__edit input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; font: inherit; font-size: 18px; font-weight: 700; color: var(--ink); }
.mx__edit .btn-red { height: 40px; padding: 0 16px; font-size: 15px; border-radius: 12px; }

.ch__ic--vk { background: #0077ff; font-size: 17px; font-weight: 800; letter-spacing: .02em; }

/* первый экран: «Войти через MAX» и «или по номеру» */
.ph__max { margin-bottom: 2px; }
.ph__or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.ph__or::before, .ph__or::after { content: ""; flex: 1; height: 1px; background: rgba(120, 60, 60, .18); }

/* пока набирают номер — без «Войти через MAX» и подзаголовка: поле и кнопка выше, клавиатура их не закрывает */
body.ph-typing .step--phone :is(#btnPhMax, #phOr, .step__s) { display: none; }

/* значок MAX — логотип (картинка), без фона и надписи */
img.ch__ic--max { background: none; display: block; object-fit: cover; padding: 0; }

/* «Вперёд за подарком» с билетом и приглашением: шторка может быть выше экрана — прокручивается */
.done { max-height: 100dvh; overflow-y: auto; overscroll-behavior: contain; }
.done__lot { align-self: stretch; animation: fadeUp .5s ease-out .7s both; }
.done__lot:empty { display: none; }
/* «готово»: без заголовка — сразу билет и кнопка «Вперёд за подарком»; салют — над билетом */
.done > .done__burst { position: absolute; inset: auto; left: calc(50% - 46px); top: 60px; width: 92px; height: 92px; z-index: 2; }

/* ---------- «Установите приложение» (перед регистрацией) ---------- */
.inst { display: grid; gap: 10px; margin: 4px 0 6px; }
.inst__p { margin: 0; font-size: 15px; line-height: 1.45; color: var(--muted); }
.inst__steps { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: st; }
.inst__steps li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 16px; background: #f7efe3; font-size: 15px; line-height: 1.35; font-weight: 600; color: var(--ink); counter-increment: st; }
.inst__steps li::before { content: counter(st); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fdfaf3; background: #c8283a; }
.inst__steps svg { display: inline-block; width: 20px; height: 20px; margin: 0 2px -4px; fill: none; stroke: #c8283a; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.inst__ok { padding: 14px; border-radius: 16px; background: #e4f0e8; color: #1f6b4a; font-weight: 700; font-size: 15px; line-height: 1.4; }
.inst__go { width: 100%; margin-top: 4px; }
.inst__skip { width: 100%; height: 44px; margin-top: 2px; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.inst__copy { justify-self: start; height: 40px; padding: 0 14px; border: 0; border-radius: 12px; font: inherit; font-size: 14px; font-weight: 700; color: #c8283a; background: #f7efe3; cursor: pointer; }
.inst:empty { display: none; }
.inst__go.is-wait { opacity: .85; }
.inst__go.is-ready { animation: instPulse 1.2s ease-in-out 3; }
@keyframes instPulse { 50% { transform: scale(1.03); } }
.inst__spin { display: inline-block; width: 16px; height: 16px; margin: 0 10px -3px 0; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: instSpin .8s linear infinite; }
@keyframes instSpin { to { transform: rotate(360deg); } }

/* ==========================================================================
   СТИЛЬ 13 (css из Claude Design «tatneft-style-13») — поверх стартовых экранов.
   Красный градиент со снегом, кремовые карточки, Origin — заголовки и крупные цифры, Montserrat — текст.
   Ёлка-спираль — наша анимированная (не статичная из макета).
   ========================================================================== */
:root { --s13-brand: #c8283a; --s13-cream: #fdfaf3; --s13-tile: #f4ede5; --s13-line: #e6dcd2; --s13-ink: #231717; --s13-muted: #745d5b;
  --s13-gold: #f3d48f; --s13-grad-screen: linear-gradient(170deg, #de3b3d 0%, #c22a37 40%, #a9152f 75%, #9a0b2c 100%);
  --s13-grad-btn: linear-gradient(160deg, #de3b3d 0%, #9a0b2c 100%);
  --s13-sh-card: 0 24px 44px -24px rgba(60, 0, 15, .55); --s13-sh-btn: 0 14px 24px -12px rgba(154, 11, 44, .65);
  --s13-display: "Origin", "Montserrat", sans-serif; --grad: var(--s13-grad-screen); --red: var(--s13-brand); }
body { background: var(--s13-grad-screen) fixed; }

/* шапка регистрации: круглая «назад» с тонкой кремовой обводкой */
.auth__back { width: 46px; height: 46px; top: 2px; background: rgba(253, 250, 243, .14); box-shadow: none; border: 1px solid rgba(253, 250, 243, .35); }

/* кремовая карточка */
.card { width: calc(100% - 32px); padding: 20px; border-radius: 28px; box-shadow: var(--s13-sh-card); }
.step__k { font-size: 12px; line-height: 16px; letter-spacing: .16em; color: var(--s13-brand); }
.step__t { font: 700 28px/32px var(--s13-display); letter-spacing: 0; }
.step__s { font-size: 14px; line-height: 20px; font-weight: 400; color: var(--s13-muted); }
.step__legal { font-size: 12px; line-height: 17px; }

/* плитки, поле ввода, код */
.ch__b, .alt, .mx__other, .mx__panel, .inst__steps li { background: var(--s13-tile); box-shadow: none; border: 1px solid rgba(200, 40, 58, .08); }
.ch__b { padding: 12px 14px; border-radius: 18px; }
.ch__ic:not(img) { width: 44px; height: 44px; border-radius: 14px; background: var(--s13-grad-btn); box-shadow: var(--s13-sh-btn); }
img.ch__ic { width: 44px; height: 44px; border-radius: 14px; }
.ch__b.is-on { background: #fbe9e6; border-color: transparent; box-shadow: inset 0 0 0 2px var(--s13-brand); }
.ph__lbl { font-size: 13px; line-height: 17px; font-weight: 700; color: var(--s13-ink); }
.ph__box { height: 58px; padding: 0 18px; border-radius: 18px; background: var(--s13-tile); }
.ph__cc { font-size: 18px; font-weight: 700; }
.ph__box input { font-size: 18px; font-weight: 600; }
.ph__sep { background: var(--s13-line); }
.code__b, .ps__row input, .mx__edit { background: var(--s13-tile); border-radius: 18px; }
.ph__box input:-webkit-autofill, .ph__box input:-webkit-autofill:hover, .ph__box input:-webkit-autofill:focus { -webkit-box-shadow: 0 0 0 100px var(--s13-tile) inset; box-shadow: 0 0 0 100px var(--s13-tile) inset; }

/* кнопки */
.btn-red { height: 56px; border-radius: 20px; background: var(--s13-grad-btn); box-shadow: var(--s13-sh-btn); font-size: 16px; font-weight: 700; }
.step--callin .btn-red, .step--max .btn-red { font-size: 17px; }

/* в браузере телефона — «Установите приложение» под кнопкой */
.ph__app { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 1px solid rgba(200, 40, 58, .08); border-radius: 18px; background: var(--s13-tile); color: var(--s13-ink); text-align: left; }
.ph__app svg { width: 26px; height: 26px; flex: none; fill: none; stroke: var(--s13-brand); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ph__app span { flex: 1; font-size: 13px; line-height: 17px; color: var(--s13-muted); }
.ph__app b { display: block; font-size: 15px; line-height: 20px; color: var(--s13-ink); }
.ph__app i { font-style: normal; font-size: 22px; color: var(--s13-brand); }
.ph__app[hidden] { display: none !important; }

/* отсчёт: крупная цифра Origin с линиями, стеклянная кнопка-заглушка */
.cd__k, .cd__num small { font-size: 12px; line-height: 16px; letter-spacing: .16em; color: rgba(253, 250, 243, .85); }
.cd__num b { font: 700 104px/106px var(--s13-display); letter-spacing: 0; text-shadow: 0 10px 30px rgba(90, 0, 20, .35); }
.cd__line { width: 56px; background: linear-gradient(90deg, transparent, rgba(253, 250, 243, .5)); }
.cd__line--r { background: linear-gradient(90deg, rgba(253, 250, 243, .5), transparent); }
.cd__t { font: 700 26px/30px var(--s13-display); letter-spacing: 0; }
.cd__d { font-size: 15px; font-weight: 500; color: rgba(253, 250, 243, .9); }
.cd__btn { height: 58px; border-radius: 22px; background: rgba(253, 250, 243, .1); box-shadow: none; border: 1px solid rgba(253, 250, 243, .28); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); font-size: 17px; }

/* добро пожаловать */
.hello__k { font-size: 12px; letter-spacing: .16em; color: rgba(253, 250, 243, .85); }
.hello__l span { font-family: var(--s13-display); font-weight: 700; font-size: 44px; letter-spacing: 0; }
.wl__go { border-radius: 20px; font-weight: 700; color: var(--s13-brand); }
.wl__ar { border-radius: 14px; background: var(--s13-grad-btn); }

/* «готово»: шторка — кремовая карточка стиля 13 */
.done { border-radius: 28px 28px 0 0; padding: 24px 20px calc(env(safe-area-inset-bottom, 0px) + 24px); box-shadow: var(--s13-sh-card); }
/* «Вперёд за подарком» всегда видна внизу шторки, даже когда билетов несколько */
.done__go { position: sticky; bottom: 0; z-index: 2; flex: none; box-shadow: 0 -10px 18px 6px var(--s13-cream), var(--s13-sh-btn); }

/* приглашение друга на экране номера */
.ref { display: grid; gap: 8px; }
.ref__ok { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: #fbefd6; border: 1px solid rgba(168, 116, 47, .25); }
.ref__ok svg { width: 22px; height: 22px; flex: none; fill: none; stroke: #a8742f; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ref__ok span { flex: 1; min-width: 0; font-size: 12.5px; line-height: 17px; color: var(--s13-muted); }
.ref__ok b { display: block; font-size: 14px; line-height: 19px; color: var(--s13-ink); }
.ref__ok em { font-style: normal; letter-spacing: .06em; color: var(--s13-brand); }
.ref__chg, .ref__ask { border: 0; background: none; padding: 6px 0; font: inherit; font-size: 13.5px; font-weight: 700; color: var(--s13-brand); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ref__chg { flex: none; padding: 6px 2px; font-size: 12.5px; }
.ref__ask { justify-self: start; }
.ref__form { display: grid; gap: 6px; }
.ref__lbl { font-size: 12.5px; line-height: 17px; color: var(--s13-muted); }
.ref__row { display: flex; gap: 8px; }
.ref__row input { flex: 1; min-width: 0; height: 48px; padding: 0 14px; border: 0; border-radius: 14px; background: var(--s13-tile); font: inherit; font-size: 17px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--s13-ink); }
.ref__row input:focus { outline: 2px solid var(--s13-brand); }
.ref__go { flex: none; height: 48px; padding: 0 16px; border: 0; border-radius: 14px; background: var(--s13-grad-btn); color: var(--s13-cream); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.ref__go:disabled { opacity: .6; }
.ref__err { font-size: 13px; font-weight: 600; color: var(--s13-brand); }
body.ph-typing .step--phone .ref { display: none; }
.ref { grid-template-columns: minmax(0, 1fr); }
.ref__form, .ref__row { min-width: 0; }
.ref__row input { width: 100%; }
.ref__ok em { font-weight: 700; }

/* ---------- билет после регистрации (стиль 13) ---------- */
body[data-screen="done"] .tree, body[data-screen="done"] .hello { opacity: 0; }
.dn { display: none; position: fixed; inset: 0; z-index: 4; overflow: hidden; align-items: center; justify-content: center; color: var(--s13-cream); }
body[data-screen="done"] .dn { display: flex; }
.dn__in { position: relative; width: 100%; max-width: 420px; padding: 0 20px calc(env(safe-area-inset-bottom, 0px) + 12px); display: flex; flex-direction: column; align-items: center; text-align: center; }
.dn__t { margin: 0; font: 700 40px/44px var(--s13-display); opacity: 0; transform: translateY(14px); transition: opacity .5s .15s, transform .6s .15s cubic-bezier(.2, .8, .2, 1); }
.dn__s { margin: 6px 0 0; font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: rgba(253, 250, 243, .85); opacity: 0; transition: opacity .5s .3s; }
.dn.is-on .dn__t { opacity: 1; transform: none; } .dn.is-on .dn__s { opacity: 1; }
.dn__tk { position: relative; width: 100%; margin-top: 32px; perspective: 900px; }
.dn__tk .s13t { max-width: 340px; transform-origin: 50% 0; opacity: 0; }
.dn.is-on .dn__tk .s13t { animation: dnDrop 1s cubic-bezier(.2, .9, .25, 1.12) .25s both; }
/* блик по билету — один раз, когда приземлился */
.dn__tk .s13t::after { content: ""; position: absolute; inset: 7% 3%; border-radius: 18px; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 246, 225, .55) 48%, transparent 62%) -160% 0 / 60% 100% no-repeat; }
.dn.is-burst .dn__tk .s13t::after { animation: dnShine 1.1s ease-in-out .35s both; }
.dn__reel { display: inline-block; height: 40px; overflow: hidden; vertical-align: bottom; }
.dn__reel > span { display: flex; flex-direction: column; transform: translateY(0); transition: transform 1.4s cubic-bezier(.15, .85, .25, 1); }
.dn__reel b { display: block; height: 40px; line-height: 40px; font-weight: 700; }
.dn__gap { display: inline-block; width: .28em; }
.dn__tk.is-none .s13t { opacity: .5; }
.dn__none { margin: 12px 0 0; font-size: 14px; color: rgba(253, 250, 243, .85); }
/* свечение и лучи за билетом */
.dn__glow { position: absolute; left: 50%; top: 46%; width: 560px; height: 560px; margin: -280px 0 0 -280px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 214, 150, .42) 0%, rgba(255, 190, 120, .14) 35%, rgba(255, 190, 120, 0) 65%); opacity: 0; transform: scale(.6); transition: opacity .8s .6s, transform 1.2s .6s cubic-bezier(.2, .8, .2, 1); }
.dn.is-on .dn__glow { opacity: 1; transform: none; }
.dn__rays { position: absolute; left: 50%; top: 46%; width: 900px; height: 900px; margin: -450px 0 0 -450px; pointer-events: none; opacity: 0;
  background: repeating-conic-gradient(from 0deg, rgba(255, 236, 200, .09) 0deg 6deg, transparent 6deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 0%, transparent 60%); mask: radial-gradient(circle, #000 0%, transparent 60%); transition: opacity 1s .8s; }
.dn.is-on .dn__rays { opacity: 1; animation: dnRays 14s linear .8s 1 both; }
/* искры */
.dn__sparks { position: absolute; left: 50%; top: 52%; width: 0; height: 0; pointer-events: none; }
.dn__sparks i { position: absolute; left: calc(var(--s) / -2); top: calc(var(--s) / -2); width: var(--s); height: var(--s); border-radius: 50%; background: #fdfaf3; opacity: 0; }
.dn__sparks i.st { border-radius: 0; background: #f3d48f; clip-path: path("M7 0C7.5 3.8 10.2 6.5 14 7 10.2 7.5 7.5 10.2 7 14 6.5 10.2 3.8 7.5 0 7 3.8 6.5 6.5 3.8 7 0Z"); }
.dn.is-burst .dn__sparks i { animation: dnSpark 1.3s cubic-bezier(.15, .7, .3, 1) both; }
/* кнопка «Забрать» — кремовая на красном */
.dn__go { margin-top: 36px; width: 100%; max-width: 340px; height: 60px; border: 0; border-radius: 22px; background: var(--s13-cream); color: var(--s13-brand); font-family: inherit; font-size: 18px; font-weight: 800;
  box-shadow: 0 18px 32px -14px rgba(40, 0, 10, .6); cursor: pointer; opacity: 0; transform: translateY(16px); transition: opacity .5s 1.6s, transform .6s 1.6s cubic-bezier(.2, .8, .2, 1); }
.dn.is-on .dn__go { opacity: 1; transform: none; }
.dn__go:active { transform: scale(.97); }
/* «Забрать»: билет уменьшается и улетает вниз — к карте */
.dn.is-take .dn__tk .s13t { animation: dnTake .65s cubic-bezier(.5, 0, .75, .2) both; }
.dn.is-take :is(.dn__t, .dn__s, .dn__go, .dn__glow, .dn__rays) { opacity: 0 !important; transition: opacity .3s; transition-delay: 0s; }
@keyframes dnDrop { 0% { opacity: 0; transform: translateY(-90vh) rotateX(70deg) rotate(-10deg) scale(.9); } 55% { opacity: 1; transform: translateY(12px) rotateX(-12deg) rotate(2deg) scale(1.02); }
  75% { transform: translateY(-6px) rotateX(5deg) rotate(-1deg); } 100% { opacity: 1; transform: none; } }
@keyframes dnShine { from { background-position: -160% 0; } to { background-position: 260% 0; } }
@keyframes dnSpark { 0% { opacity: 0; transform: translate(0, 0) scale(.3); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1) rotate(120deg); } }
@keyframes dnRays { to { transform: rotate(40deg); } }
@keyframes dnTake { 0% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(55vh) scale(.3) rotate(8deg); } }
@media (prefers-reduced-motion: reduce) { .dn__tk .s13t { opacity: 1; } .dn__reel > span { transition: none; } }

/* «Вас пригласил друг?» — крупное поле ID после регистрации */
body[data-screen="friend"] .auth__back { visibility: hidden; }
.fr__box { display: flex; flex-direction: column; gap: 6px; padding: 14px 18px 12px; border-radius: 20px; background: var(--s13-tile); border: 1.5px solid rgba(200, 40, 58, .18); cursor: text; }
.fr__box:focus-within { border-color: var(--s13-brand); }
.fr__lbl { font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--s13-brand); }
.fr__box input { width: 100%; min-width: 0; height: 44px; border: 0; padding: 0; background: none; outline: none; font: 700 34px/44px var(--s13-display); letter-spacing: .18em; text-transform: uppercase; color: var(--s13-ink); }
.fr__box input::placeholder { color: #cdbdb4; }
.ref__ok { display: flex; }
.inst__ok .inst__spin { border-color: rgba(200, 40, 58, .25); border-top-color: #c8283a; vertical-align: -3px; }
