:root {
  --bg: #150e1c;
  --ink: #f7eff4;
  --ink-soft: #cbb6c6;
  --ink-faint: #8f7c8d;
  --rose: #ff6f93;
  --rose-deep: #d33a68;
  --gold: #f5cb74;
  --gold-deep: #c9922e;
  --card: #2b1b32;
  --card-2: #1e1324;
  --edge: rgba(255, 255, 255, 0.09);
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}

body {
  background:
    radial-gradient(115% 55% at 50% 0%, #48204a 0%, rgba(72, 32, 74, 0) 62%),
    radial-gradient(90% 45% at 0% 100%, #2d1533 0%, rgba(45, 21, 51, 0) 72%),
    radial-gradient(70% 40% at 100% 88%, #3a1c2c 0%, rgba(58, 28, 44, 0) 70%),
    var(--bg);
  background-attachment: fixed;
}

.hidden { display: none !important; }
.serif { font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
.muted { color: var(--ink-soft); font-size: 15px; line-height: 1.6; margin: 0; }
.muted.small { font-size: 13.5px; }
.narrow { max-width: 330px; margin: 0 auto; }
.row { display: flex; gap: 10px; }
.row .btn { flex: 1; }

/* ---------- фон: искры ---------- */

.sparkles { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.sparkles i {
  position: absolute;
  display: block;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  animation: twinkle 4s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(0.6); }
  50% { opacity: 0.75; transform: scale(1); }
}

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; }

/* ---------- каркас ---------- */

.screen { position: relative; z-index: 1; padding: 0 18px 44px; max-width: 620px; margin: 0 auto; }

.centered {
  min-height: 84vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; text-align: center;
}

.loader-gift { font-size: 58px; animation: bob 1.7s ease-in-out infinite; }
.big-emoji { font-size: 46px; }
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-12px) rotate(4deg); }
}

/* ---------- онбординг ---------- */

.slide-wrap { min-height: 86vh; display: flex; align-items: center; }

.slide {
  width: 100%;
  text-align: center;
  padding: 28px 6px 10px;
  animation: slidein 0.45s cubic-bezier(0.2, 0.9, 0.25, 1);
}

@keyframes slidein {
  from { opacity: 0; transform: translateX(28px); }
  to { opacity: 1; transform: translateX(0); }
}

.slide-counter {
  display: inline-block;
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--rose);
  border: 1px solid rgba(255, 111, 147, 0.4);
  border-radius: 999px; padding: 6px 15px; margin-bottom: 30px;
}
.slide.golden .slide-counter { color: var(--gold); border-color: rgba(245, 203, 116, 0.45); }

.orb {
  width: 148px; height: 148px; margin: 0 auto 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 68px;
  background: radial-gradient(circle at 32% 28%, rgba(255, 111, 147, 0.34), rgba(255, 111, 147, 0.05) 68%);
  box-shadow: 0 0 0 1px rgba(255, 111, 147, 0.22), 0 20px 50px rgba(211, 58, 104, 0.28);
  animation: float 4.5s ease-in-out infinite;
}
.slide.golden .orb {
  background: radial-gradient(circle at 32% 28%, rgba(245, 203, 116, 0.38), rgba(245, 203, 116, 0.05) 68%);
  box-shadow: 0 0 0 1px rgba(245, 203, 116, 0.3), 0 20px 50px rgba(201, 146, 46, 0.3);
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.slide-title {
  font-size: 31px; line-height: 1.2; margin: 0 0 16px;
  background: linear-gradient(180deg, #fff 0%, #ffcfdb 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.slide.golden .slide-title { background: linear-gradient(180deg, #fff6e2 0%, #f5cb74 100%); -webkit-background-clip: text; background-clip: text; }

.slide-text { color: var(--ink-soft); font-size: 15.5px; line-height: 1.62; margin: 0 auto 24px; max-width: 400px; }

.qty {
  display: inline-flex; align-items: baseline; gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--edge);
  border-radius: 14px; padding: 12px 20px; margin-bottom: 34px;
}
.qty b { font-size: 26px; font-weight: 700; }
.qty span { font-size: 13px; color: var(--ink-faint); }
.slide.golden .qty b { color: var(--gold); }

.dots { display: flex; justify-content: center; gap: 7px; padding-bottom: 8px; }
.dots i {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}
.dots i.on { background: var(--rose); width: 20px; border-radius: 3px; }

/* ---------- шапка колоды ---------- */

.hero { padding: 38px 4px 26px; text-align: center; }

.ribbon {
  display: inline-block;
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--rose);
  border: 1px solid rgba(255, 111, 147, 0.36);
  border-radius: 999px; padding: 5px 15px; margin-bottom: 18px;
}

.hero-title {
  font-size: 32px; line-height: 1.16; margin: 0 0 12px;
  background: linear-gradient(180deg, #fff 0%, #ffcfdb 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.preview-badge {
  margin-top: 16px; font-size: 12px; color: var(--gold);
  border: 1px dashed rgba(245, 203, 116, 0.42);
  border-radius: 10px; padding: 8px 12px; display: inline-block;
}

/* ---------- карточки ---------- */

.cards { display: flex; flex-direction: column; gap: 16px; }

.card {
  position: relative;
  background: linear-gradient(160deg, var(--card) 0%, var(--card-2) 100%);
  border: 1px solid var(--edge);
  border-radius: 20px;
  padding: 20px 20px 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.16s ease, opacity 0.3s ease;
}
.card:active { transform: scale(0.985); }

.card::before, .card::after {
  content: ""; position: absolute;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg); bottom: 66px;
}
.card::before { left: -11px; }
.card::after { right: -11px; }

.card.golden {
  background: linear-gradient(160deg, #3d2c15 0%, #241a0f 100%);
  border-color: rgba(245, 203, 116, 0.45);
}
.card.golden .card-title { color: var(--gold); }
.card.spent { opacity: 0.42; }

.card-head { display: flex; align-items: flex-start; gap: 14px; }
.card-emoji { font-size: 34px; line-height: 1; flex: 0 0 auto; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45)); }
.card-title { font-family: Georgia, serif; font-size: 20px; font-weight: 400; margin: 0 0 6px; line-height: 1.25; }
.card-sub { font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); margin: 0; }

.pips { display: flex; flex-wrap: wrap; gap: 5px; margin: 18px 0 14px; }
.pip { width: 9px; height: 9px; border-radius: 50%; background: var(--rose); box-shadow: 0 0 8px rgba(255, 111, 147, 0.5); }
.pip.off { background: rgba(255, 255, 255, 0.13); box-shadow: none; }
.golden .pip { background: var(--gold); box-shadow: 0 0 8px rgba(245, 203, 116, 0.55); }
.golden .pip.off { background: rgba(255, 255, 255, 0.13); box-shadow: none; }

.divider { border: none; border-top: 1px dashed rgba(255, 255, 255, 0.16); margin: 0 -20px 14px; }

.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-left { font-size: 13px; color: var(--ink-faint); }
.card-left b { color: var(--ink); font-size: 16px; font-weight: 600; }

/* ---------- кнопки ---------- */

.btn {
  font: inherit; font-size: 14px; font-weight: 600;
  border: none; border-radius: 13px; padding: 12px 20px;
  cursor: pointer; transition: transform 0.12s ease, filter 0.2s ease;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.wide { width: 100%; }

.btn-primary {
  background: linear-gradient(135deg, var(--rose) 0%, var(--rose-deep) 100%);
  color: #fff; box-shadow: 0 10px 24px rgba(211, 58, 104, 0.36);
}
.golden .btn-primary, .slide.golden .btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 100%);
  color: #2c1d05; box-shadow: 0 10px 24px rgba(201, 146, 46, 0.36);
}
.btn-ghost { background: rgba(255, 255, 255, 0.07); color: var(--ink-soft); }
.btn-big { font-size: 15px; padding: 15px 30px; border-radius: 15px; }

/* ---------- история ---------- */

.history-block { margin-top: 36px; }
.section-label {
  font-size: 11.5px; letter-spacing: 0.17em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 600; margin: 0 0 14px;
}
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.history li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.035); font-size: 13.5px;
}
.history .h-emoji { font-size: 16px; }
.history .h-title { flex: 1; color: var(--ink-soft); }
.history .h-date { color: var(--ink-faint); font-size: 12px; font-variant-numeric: tabular-nums; }

.footer { margin-top: 38px; text-align: center; font-size: 12.5px; color: var(--ink-faint); line-height: 1.6; }

/* ---------- оверлеи ---------- */

.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(9, 5, 12, 0.74);
  backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 16px; animation: fade 0.2s ease;
}
.overlay.center { align-items: center; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  background: linear-gradient(160deg, #30203a 0%, #1d1326 100%);
  border: 1px solid var(--edge); border-radius: 24px;
  padding: 28px 22px 22px; width: 100%; max-width: 420px;
  text-align: center; box-shadow: var(--shadow);
  animation: rise 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.sheet h2 { font-size: 21px; margin: 0 0 10px; }
.sheet-emoji { font-size: 42px; margin-bottom: 12px; }
.sheet .row { margin-top: 22px; }
@keyframes rise { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---------- предъявленный купон ---------- */

.ticket {
  background: linear-gradient(160deg, #fdf7ef 0%, #f2e3d5 100%);
  color: #2b1a21; border-radius: 24px;
  padding: 34px 26px 26px; width: 100%; max-width: 400px;
  text-align: center; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.62);
  animation: pop 0.42s cubic-bezier(0.2, 1.2, 0.4, 1);
}
@keyframes pop { from { transform: scale(0.85) rotate(-2deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }

.ticket-emoji { font-size: 58px; margin-bottom: 10px; }
.ticket-title { font-size: 24px; margin: 0 0 20px; }

.stamp {
  display: inline-block;
  border: 3px solid rgba(190, 40, 62, 0.72);
  color: rgba(190, 40, 62, 0.85);
  font-size: 17px; font-weight: 800; letter-spacing: 0.22em; text-transform: uppercase;
  padding: 8px 16px; border-radius: 8px; transform: rotate(-9deg);
  animation: slam 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) 0.16s both;
}
@keyframes slam {
  from { transform: rotate(-9deg) scale(2.5); opacity: 0; }
  to { transform: rotate(-9deg) scale(1); opacity: 1; }
}

.ticket-meta { color: #7c626b; font-size: 13px; margin: 20px 0 4px; font-variant-numeric: tabular-nums; }
.ticket-sent { color: #3d8a5c; font-size: 13.5px; font-weight: 600; margin: 0 0 22px; }

/* ---------- серебряный уровень ---------- */

:root { --silver: #d8e2ee; --silver-deep: #7d8b9c; }

.slide.silver .slide-counter { color: var(--silver); border-color: rgba(216, 226, 238, 0.42); }
.slide.silver .orb {
  background: radial-gradient(circle at 32% 28%, rgba(216, 226, 238, 0.32), rgba(216, 226, 238, 0.04) 68%);
  box-shadow: 0 0 0 1px rgba(216, 226, 238, 0.28), 0 20px 50px rgba(125, 139, 156, 0.28);
}
.slide.silver .slide-title {
  background: linear-gradient(180deg, #ffffff 0%, #c9d4e0 100%);
  -webkit-background-clip: text; background-clip: text;
}
.slide.silver .qty b { color: var(--silver); }

.card.silver {
  background: linear-gradient(160deg, #2b3038 0%, #1a1d23 100%);
  border-color: rgba(216, 226, 238, 0.38);
}
.card.silver .card-title { color: var(--silver); }

.silver .pip { background: var(--silver); box-shadow: 0 0 8px rgba(216, 226, 238, 0.5); }
.silver .pip.off { background: rgba(255, 255, 255, 0.13); box-shadow: none; }

.silver .btn-primary, .slide.silver .btn-primary {
  background: linear-gradient(135deg, #eef3f9 0%, var(--silver-deep) 100%);
  color: #1b2027;
  box-shadow: 0 10px 24px rgba(125, 139, 156, 0.38);
}

/* ---------- бриллиантовый уровень ---------- */

:root { --ice: #a8e9ff; --ice-deep: #2f9dc4; }

.slide.diamond .slide-counter { color: var(--ice); border-color: rgba(168, 233, 255, 0.45); }
.slide.diamond .orb {
  background: radial-gradient(circle at 32% 28%, rgba(168, 233, 255, 0.4), rgba(168, 233, 255, 0.05) 68%);
  box-shadow: 0 0 0 1px rgba(168, 233, 255, 0.34), 0 20px 50px rgba(47, 157, 196, 0.32);
}
.slide.diamond .slide-title {
  background: linear-gradient(180deg, #ffffff 0%, #a8e9ff 100%);
  -webkit-background-clip: text; background-clip: text;
}
.slide.diamond .qty b { color: var(--ice); }

.card.diamond {
  background: linear-gradient(160deg, #16323d 0%, #101d26 100%);
  border-color: rgba(168, 233, 255, 0.5);
  animation: gleam 3.4s ease-in-out infinite;
}
.card.diamond .card-title { color: var(--ice); }

@keyframes gleam {
  0%, 100% { box-shadow: var(--shadow), 0 0 0 rgba(168, 233, 255, 0); }
  50% { box-shadow: var(--shadow), 0 0 28px rgba(168, 233, 255, 0.3); }
}

.diamond .pip { background: var(--ice); box-shadow: 0 0 9px rgba(168, 233, 255, 0.65); }
.diamond .pip.off { background: rgba(255, 255, 255, 0.13); box-shadow: none; }

.diamond .btn-primary, .slide.diamond .btn-primary {
  background: linear-gradient(135deg, #dcf7ff 0%, var(--ice-deep) 100%);
  color: #0b2733;
  box-shadow: 0 10px 24px rgba(47, 157, 196, 0.4);
}
