/* CHIX Jackpot — страница игры. Перенос утверждённого макета (Main / Result). */

:root {
  --ink: #3D1530;
  --muted: #7A3D60;
  --accent: #B83A74;
  --pink: #EF8AB3;
  --pale: #F7E2EF;
  --line: #E1ADC6;
  --line-soft: #F3E3EE;
  --border: #C99AB4;
  --err-bg: #FBE3EC;
  --err: #9E1745;
  --reel-big: #EE1C74;
  --reel-small: #C9407A;
  --icon: #C8457F;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #FFFFFF;
  color: var(--ink);
  font-family: Montserrat, system-ui, -apple-system, sans-serif;
}
a { color: var(--ink); }
a:hover { color: var(--accent); }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 0 calc(32px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-x: hidden;
}

/* ---------- Шапка ---------- */
.hero {
  position: relative;
  padding: 26px 20px 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hero-x { position: absolute; right: -8px; top: -8px; width: 150px; height: auto; pointer-events: none; }
.hero-logo { position: relative; display: block; width: 104px; height: auto; margin-left: -4px; }
.hero h1 {
  position: relative;
  margin: 0;
  font-size: 44px;
  line-height: .95;
  font-weight: 900;
  letter-spacing: -.03em;
}
.lead { position: relative; margin: 0; font-size: 16px; line-height: 1.45; }

/* ---------- Автомат ---------- */
.machine {
  position: relative;
  width: 100%;
  aspect-ratio: 1122 / 1402;
  container-type: inline-size;
}
.machine-img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; user-select: none; -webkit-user-drag: none; }
.bulbs {
  position: absolute; left: 22%; top: 0; width: 56%; height: 16%;
  border-radius: 50%;
  background: radial-gradient(ellipse 60% 70% at 50% 70%, rgba(255,255,255,.55) 0%, rgba(255,240,246,.25) 45%, rgba(255,255,255,0) 75%);
  mix-blend-mode: screen;
  pointer-events: none;
}
.bulbs-idle { opacity: 0; }
.bulbs-spin { animation: bulbs .32s steps(2) infinite; }
.bulbs-win { animation: winGlow 1.1s ease-in-out infinite; }

.reel {
  position: absolute;
  top: 32.67%;
  height: 19.4%;
  overflow: hidden;
  border-radius: 4px;
  background:
    radial-gradient(ellipse 80% 40% at 50% 40%, rgba(255,255,255,.7) 0%, rgba(255,255,255,0) 70%),
    linear-gradient(180deg, #D5858E 0%, #F3C0C9 8%, #FCDEE1 20%, #FAD9DE 45%, #EDC3C8 65%, #E0A3AD 85%, #D68995 95%, #C07480 100%);
}
.reel::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  box-shadow: inset 6px 0 8px -6px rgba(150,60,80,.35), inset -6px 0 8px -6px rgba(150,60,80,.35);
}
.reel-1 { left: 27.36%; width: 13.28%; }
.reel-2 { left: 43.32%; width: 13.55%; }
.reel-3 { left: 59.36%; width: 13.37%; }

.strip { animation: reelSpin .3s linear infinite; filter: blur(1.3px); }
.reel-2 .strip { animation-duration: .34s; }
.reel-3 .strip { animation-duration: .38s; }
.land { animation: reelLand .42s cubic-bezier(.2,.7,.3,1); }

.cell {
  position: relative;
  aspect-ratio: 149 / 272;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cell-inner {
  position: absolute; left: 50%; top: 50%;
  width: 182.5%;
  transform: translate(-50%, -50%) rotate(90deg);
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.cell-big {
  font-weight: 800;
  line-height: 1.05;
  color: var(--reel-big);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .02em;
  font-size: 4.87cqw; /* переопределяется скриптом по длине надписи */
}
.cell-small {
  font-family: Caveat, cursive;
  font-weight: 700;
  font-size: 3.33cqw; /* 13px при ширине 390 */
  line-height: 1;
  color: var(--reel-small);
  white-space: nowrap;
}

.lever {
  position: absolute; left: 82.5%; top: 26.5%; width: 14.5%; height: 42%;
  padding: 0; margin: 0; border: 0; border-radius: 30px;
  background: transparent; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.lever:disabled { cursor: default; }

.jolt { animation: jolt .38s ease-out; }
.pop { animation: pop .45s ease-out; }

/* ---------- Форма ---------- */
.form { padding: 0 20px; display: flex; flex-direction: column; gap: 12px; margin: 0; }
.form label { font-size: 14px; font-weight: 700; }
.form input {
  height: 56px;
  padding: 0 18px;
  border-radius: 24px;
  corner-shape: squircle;
  border: 2px solid var(--border);
  background: #FFFFFF;
  color: var(--ink);
  font-family: inherit;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .1em;
  width: 100%;
}
.form input::placeholder { color: #8C4A6E; letter-spacing: .02em; font-size: 17px; font-weight: 600; }
.form input:focus { outline: 2px solid var(--ink); outline-offset: 2px; }
.form input:disabled { opacity: .7; }
.error {
  margin: 0 20px;
  padding: 10px 14px;
  border-radius: 18px;
  corner-shape: squircle;
  background: var(--err-bg);
  font-size: 14px; line-height: 1.4; font-weight: 600;
  color: var(--err);
}
.form .error { margin: 0; }

/* ---------- Кнопки liquid glass ---------- */
.btn {
  height: 60px;
  width: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  -webkit-appearance: none; appearance: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}
.glass, .glass-dark {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  transition: transform .15s ease;
  color: #FFFFFF;
  text-shadow: 0 1px 2px rgba(120,20,70,.35);
  background: linear-gradient(180deg, rgba(242,150,190,.94) 0%, rgba(224,108,156,.94) 50%, rgba(200,69,127,.96) 100%);
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.6), inset 0 -3px 8px rgba(120,20,70,.25), 0 12px 28px -6px rgba(200,69,127,.5), 0 2px 6px rgba(61,21,48,.1);
}
.glass::before, .glass-dark::before {
  content: ""; position: absolute; z-index: -1;
  left: 10%; right: 10%; top: 2px; height: 48%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.42), rgba(255,255,255,0));
  pointer-events: none;
}
.glass::after, .glass-dark::after {
  content: ""; position: absolute; z-index: -1; inset: 0;
  border-radius: inherit;
  background: radial-gradient(120% 90% at 50% 120%, rgba(255,200,226,.45), rgba(255,255,255,0) 60%);
  pointer-events: none;
}
.glass:active, .glass-dark:active { transform: scale(.98); }
button, .glass, .glass-dark { text-transform: uppercase; letter-spacing: .04em; }
button:disabled { opacity: .7; cursor: default; }
.lever:disabled { opacity: 1; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---------- Результат ---------- */
.result { padding: 0 20px; display: flex; flex-direction: column; gap: 18px; }
.card {
  background: var(--pale);
  border-radius: 36px;
  corner-shape: squircle;
  padding: 22px 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.card-label { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.card-prize { font-size: 30px; line-height: 1.05; font-weight: 900; letter-spacing: -.02em; color: var(--accent); overflow-wrap: anywhere; }
.card-row {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.card-confirm { display: flex; flex-direction: column; gap: 4px; }
.card-small { font-size: 12px; font-weight: 600; color: var(--muted); }
.card-code { font-size: 24px; font-weight: 900; letter-spacing: .08em; white-space: nowrap; }
.card-valid { font-size: 12px; font-weight: 600; text-align: right; line-height: 1.35; color: var(--muted); }

.steps { margin: 0; padding: 0 0 0 20px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.45; }

.contacts {
  background: var(--pale);
  border-radius: 26px;
  corner-shape: squircle;
  padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.contacts-title { padding: 4px 6px 2px; font-size: 13px; font-weight: 600; color: var(--muted); }
.contact {
  display: flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 0 16px;
  border-radius: 18px; corner-shape: squircle;
  background: #FFFFFF;
  color: var(--ink);
  font-size: 15px; font-weight: 700;
  text-decoration: none;
}
.contact svg { width: 22px; height: 22px; flex: 0 0 auto; fill: none; stroke: var(--icon); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.contact-name { flex: 1 1 auto; }
.contact-handle { font-size: 12px; font-weight: 600; color: var(--muted); }

.note { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }

/* ---------- Список призов и подвал ---------- */
.prizes { padding: 0 20px; display: flex; flex-direction: column; gap: 10px; }
.prizes h2 { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.prizes ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; border-top: 1px solid var(--line-soft); }
.prizes li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); font-size: 15px; }
.prizes li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--pink); flex: 0 0 auto; }

.footer { padding: 0 20px; display: flex; justify-content: flex-end; gap: 12px; font-size: 13px; color: var(--muted); }

/* ---------- Анимации ---------- */
@keyframes reelSpin { from { transform: translateY(0); } to { transform: translateY(-50%); } }
@keyframes reelLand { 0% { transform: translateY(-28%); } 55% { transform: translateY(6%); } 80% { transform: translateY(-2%); } 100% { transform: translateY(0); } }
@keyframes pop { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes jolt { 0% { transform: translateY(0); } 30% { transform: translateY(5px); } 65% { transform: translateY(-2px); } 100% { transform: translateY(0); } }
@keyframes bulbs { 0%, 100% { opacity: .15; } 50% { opacity: .85; } }
@keyframes winGlow { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .strip { animation-duration: 1.2s; filter: none; }
  .land, .pop, .jolt { animation: none; }
  .bulbs-spin, .bulbs-win { animation: none; opacity: .6; }
}
