/* Колесо бонусов ELIAN — «жидкое стекло» поверх ночного неба адвента.
   Сетка отступов кратна 4, цели нажатия не меньше 48px, текст полей 16px+ (без зума в iOS). */
:root {
  color-scheme: dark;
  --bg: #0b1236;
  --bg-2: #141d52;
  --ink: #f6efe2;              /* основной текст, кремовый */
  --muted: #c0c8e8;            /* второстепенный: контраст на стекле ≥ 7:1 */
  --gold: #e2bf7c;
  --gold-deep: #c4974c;
  --on-gold: #1a1630;
  --error: #ffb4a6;

  /* стекло */
  --glass: rgba(255, 255, 255, .08);
  --glass-strong: rgba(255, 255, 255, .13);
  --glass-line: rgba(255, 255, 255, .18);
  --glass-hi: rgba(255, 255, 255, .42);
  --glass-blur: blur(26px) saturate(170%);
  --shadow: 0 24px 60px rgba(3, 6, 28, .55);

  /* колесо */
  --seg-a: rgba(36, 52, 128, .92);
  --seg-b: rgba(52, 72, 160, .92);
  --seg-c: rgba(28, 40, 104, .92);
  --seg-d: var(--gold);
  --seg-text: #f6efe2;
  --seg-top-text: var(--on-gold);
  --seg-line: rgba(255, 236, 200, .55);
  --hub: #101850;

  --r-card: 28px;
  --r-field: 16px;
  --font-display: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  --font-body: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: hidden; overflow-x: clip; }
html { background: var(--bg); }
body {
  min-height: 100vh; min-height: 100svh;
  color: var(--ink);
  font: 16px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
  display: flex; justify-content: center; align-items: flex-start;
  padding: max(20px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
  background:
    radial-gradient(60% 40% at 15% 10%, rgba(226, 191, 124, .16), transparent 70%),
    radial-gradient(70% 50% at 90% 85%, rgba(98, 120, 230, .22), transparent 70%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 70%);
  background-attachment: fixed;
}

/* размытая картинка адвента за стеклом — даёт стеклу живые цвета */
.backdrop {
  position: fixed; inset: -12%; z-index: -1; pointer-events: none;
  background: url(/advent.webp) center 30% / cover no-repeat;
  filter: blur(48px) saturate(1.4) brightness(.72);
  opacity: .85;
}

#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }

/* ---------- стеклянная карточка ---------- */
.card {
  position: relative; z-index: 1;
  width: 100%; max-width: 460px;
  padding: 24px 20px 28px;
  border-radius: var(--r-card);
  background: linear-gradient(160deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .05) 45%, rgba(255, 255, 255, .08));
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-hi), inset 0 -1px 0 rgba(255, 255, 255, .06);
  isolation: isolate;
}
/* светлый ободок: ярче сверху-слева, гаснет книзу — как у стекла на свету */
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(150deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, .08) 40%, rgba(255, 255, 255, .02) 70%, rgba(226, 191, 124, .35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
/* блик на стекле */
.card::after {
  content: ""; position: absolute; z-index: -1; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 60% at 0% 0%, rgba(255, 255, 255, .12), transparent 55%);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card { background: rgba(24, 34, 92, .94); }
}

.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.logo { display: block; width: 92px; height: auto; }

/* индикатор шагов */
.progress { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.progress li {
  width: 8px; height: 8px; border-radius: 99px; overflow: hidden; text-indent: 99px; white-space: nowrap;
  background: rgba(255, 255, 255, .22); transition: width .3s, background .3s;
}
.progress li.done { background: rgba(226, 191, 124, .6); }
.progress li.now { width: 24px; background: var(--gold); }
.progress[hidden] { display: none; }

/* ---------- типографика ---------- */
h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(32px, 8.6vw, 38px); line-height: 1.05; letter-spacing: .005em;
  margin: 0 0 12px; text-wrap: balance;
}
.lead { color: var(--muted); font-size: 16px; margin: 0 0 24px; text-wrap: pretty; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: 12px; font-weight: 600; color: var(--gold); margin: 0 0 6px; }
.prize { font-size: clamp(56px, 16vw, 68px); line-height: 1; color: var(--gold); text-shadow: 0 0 30px rgba(226, 191, 124, .35); }

/* ---------- поля ---------- */
.field { display: block; margin: 0 0 16px; }
.field > span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.field small { display: block; color: var(--muted); font-size: 13px; margin-top: 8px; line-height: 1.45; }
input[type=email], input[type=tel], input.code {
  width: 100%; min-height: 54px; font: inherit; font-size: 17px; padding: 14px 16px;
  color: var(--ink); background: var(--glass);
  border: 1px solid var(--glass-line); border-radius: var(--r-field);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
  outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder { color: rgba(192, 200, 232, .55); }
input:focus { border-color: var(--gold); background: var(--glass-strong); box-shadow: 0 0 0 4px rgba(226, 191, 124, .2); }
input.code { font-size: 28px; letter-spacing: .45em; text-align: center; font-weight: 600; }

/* ---------- согласия ---------- */
.consents { margin: 20px 0 4px; display: grid; gap: 12px; }
.check {
  display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start;
  font-size: 13.5px; line-height: 1.5; color: var(--muted); cursor: pointer;
}
.check input {
  -webkit-appearance: none; appearance: none; margin: 0; width: 24px; height: 24px; flex: none;
  border-radius: 8px; border: 1px solid var(--glass-line); background: var(--glass);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); cursor: pointer; position: relative;
  transition: background .15s, border-color .15s;
}
.check input:checked { background: linear-gradient(180deg, #f0d39c, var(--gold-deep)); border-color: transparent; }
.check input:checked::after {
  content: ""; position: absolute; left: 8px; top: 4px; width: 6px; height: 11px;
  border: solid var(--on-gold); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.check input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.check a, .steps a { color: var(--ink); text-decoration-color: rgba(226, 191, 124, .8); text-underline-offset: 2px; }
.captcha { margin: 14px 0 4px; min-height: 0; }

/* ---------- анкета ---------- */
fieldset { border: 0; padding: 0; margin: 0 0 24px; min-width: 0; }
legend { font-weight: 600; font-size: 16px; line-height: 1.35; margin-bottom: 12px; padding: 0; }
legend small { display: block; font-weight: 500; font-size: 13px; color: var(--muted); margin-top: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { cursor: pointer; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips span {
  display: inline-flex; align-items: center; min-height: 46px; padding: 10px 18px; border-radius: 999px;
  font-size: 15.5px; color: var(--ink);
  background: var(--glass); border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.chips label:hover span { border-color: rgba(226, 191, 124, .7); }
.chips label:active span { transform: scale(.97); }
.chips input:checked + span {
  background: linear-gradient(180deg, #f0d39c, var(--gold-deep)); border-color: transparent;
  color: var(--on-gold); font-weight: 600; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 6px 18px rgba(196, 151, 76, .3);
}
.chips input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- кнопки ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 58px;
  margin-top: 20px; padding: 14px 24px;
  font-family: inherit; font-weight: 700; font-size: 18px; line-height: 1.2; letter-spacing: .005em;
  text-align: center; text-decoration: none;
  color: var(--on-gold);
  background: linear-gradient(180deg, #f3daa6 0%, var(--gold) 45%, var(--gold-deep) 100%);
  border: 0; border-radius: 999px; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -2px 6px rgba(120, 80, 20, .25), 0 12px 30px rgba(196, 151, 76, .35);
  transition: transform .12s, box-shadow .2s, opacity .2s, filter .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: scale(.98); }
.btn:disabled {
  cursor: default; color: rgba(246, 239, 226, .55); filter: none;
  background: var(--glass); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), inset 0 0 0 1px var(--glass-line);
}
.btn:focus-visible, .link:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; }
.link {
  background: none; border: 0; min-height: 44px; padding: 8px 0; font: inherit; font-size: 15px;
  color: var(--ink); text-decoration: underline; text-decoration-color: rgba(226, 191, 124, .8);
  text-underline-offset: 3px; cursor: pointer;
}
.link:disabled { color: var(--muted); text-decoration: none; cursor: default; }
.error { color: var(--error); font-size: 14px; margin: 10px 0 0; }
.error:empty { display: none; }

/* ---------- колесо ---------- */
.wheel-wrap { position: relative; width: 100%; max-width: 330px; margin: 8px auto 0; aspect-ratio: 1; }
/* стеклянное кольцо вокруг колеса */
.wheel-wrap::before {
  content: ""; position: absolute; inset: -10px; border-radius: 50%; pointer-events: none;
  background: linear-gradient(150deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .04) 50%, rgba(226, 191, 124, .18));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 20px 50px rgba(3, 6, 28, .5);
}
#wheel { position: relative; width: 100%; height: 100%; transition: transform 5.2s cubic-bezier(.12, .7, .08, 1); }
#wheel text { font: 700 13px var(--font-body); }
.pointer {
  position: absolute; left: 50%; top: -16px; transform: translateX(-50%); z-index: 2;
  width: 0; height: 0; border-left: 15px solid transparent; border-right: 15px solid transparent;
  border-top: 28px solid var(--gold); filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .45));
}

/* ---------- результат ---------- */
.steps { padding: 16px 16px 16px 40px; margin: 0 0 16px; border-radius: 20px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-line), inset 0 1px 0 rgba(255, 255, 255, .12); }
.steps li { margin-bottom: 10px; }
.steps li:last-child { margin-bottom: 0; }
.steps li::marker { color: var(--gold); font-weight: 700; }
.note { font-size: 14.5px; color: var(--muted); margin: 0; }
.note b, .steps b { color: var(--gold); }
#r-phone { white-space: nowrap; }

/* ---------- вводный экран ---------- */
.intro {
  position: relative; z-index: 1; width: 100%; max-width: 460px; min-height: calc(100svh - 56px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
}
.intro-title {
  font-size: clamp(32px, 9.6vw, 46px); line-height: 1.04; margin: 0 0 8px;
  text-transform: uppercase; letter-spacing: .06em; color: var(--gold);
  text-shadow: 0 0 28px rgba(226, 191, 124, .4);
}
.intro-stage {
  position: relative; display: block; width: min(74vw, 310px); margin: 36px auto 4px;
  padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.intro-stage:focus-visible { outline: 2px solid var(--gold); outline-offset: 10px; border-radius: 8px; }
/* луч света сверху: размытый конус, мягко «дышит» */
.intro-beam {
  position: absolute; z-index: 0; left: 50%; top: -58%; width: 240%; height: 175%;
  transform: translateX(-50%); pointer-events: none;
  background: conic-gradient(from 0deg at 50% 0%,
    rgba(255, 226, 170, 0) 158deg, rgba(255, 226, 170, .26) 168deg, rgba(255, 238, 205, .5) 180deg,
    rgba(255, 226, 170, .26) 192deg, rgba(255, 226, 170, 0) 202deg);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 12%, #000 60%, transparent 95%);
          mask-image: linear-gradient(180deg, transparent 0%, #000 12%, #000 60%, transparent 95%);
  filter: blur(8px); mix-blend-mode: screen;
  animation: beam 6s ease-in-out infinite;
}
.intro-floor {
  position: absolute; z-index: 0; left: 50%; bottom: -26px; width: 150%; height: 70px;
  transform: translateX(-50%); pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%, rgba(255, 232, 190, .38), rgba(255, 232, 190, 0) 70%);
  filter: blur(6px);
}
.intro-box {
  position: relative; z-index: 1; display: block; border-radius: 6px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 236, 200, .35), 0 0 70px rgba(255, 228, 176, .28), 0 34px 60px rgba(4, 7, 26, .7);
  animation: float 6s ease-in-out infinite;
  transition: transform .6s cubic-bezier(.3, .7, .2, 1), box-shadow .6s;
}
.intro-box img { display: block; width: 100%; height: auto; }
.intro-box::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(70% 55% at 50% 0%, rgba(255, 240, 212, .42), rgba(255, 240, 212, 0) 70%);
}
.intro-btn { max-width: 320px; margin-top: 36px; }
body.opening .intro-box {
  transform: scale(1.06); animation: none;
  box-shadow: 0 0 0 1px rgba(255, 236, 200, .6), 0 0 120px rgba(255, 228, 176, .6), 0 34px 60px rgba(4, 7, 26, .7);
}
body.opening .intro { opacity: 0; transition: opacity .35s ease .3s; }

/* появление экранов */
.card section:not([hidden]) { animation: rise .35s ease both; }

@keyframes beam { 0%, 100% { opacity: .85; } 50% { opacity: 1; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .intro-beam, .intro-box, .card section:not([hidden]) { animation: none; }
  #wheel { transition-duration: 1s; }
}

[hidden] { display: none !important; }
