:root {
  --bg: #14061f;
  --bg-2: #2a0b3d;
  --pink: #ff4fb8;
  --pink-2: #ff7ccb;
  --violet: #9b5cff;
  --gold: #ffd36b;
  --ink: #fff4fb;
  --muted: #d9bfe0;
  --card: #fff3f8;
  --card-ink: #3a1240;
  --radius: 22px;
  --glow: 0 0 18px rgba(255, 79, 184, .55), 0 0 42px rgba(255, 79, 184, .25);
  --f-hand: "Caveat", cursive;
  --f-body: "Manrope", system-ui, sans-serif;
  --f-num: "Unbounded", "Manrope", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--f-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 15% -10%, #5a1470 0%, transparent 60%),
    radial-gradient(900px 600px at 110% 110%, #3b1a8a 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  background-color: var(--bg);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }

/* ---------- боке на фоне ---------- */
.bokeh { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bokeh span {
  position: absolute; border-radius: 50%;
  filter: blur(6px); opacity: .35;
  animation: float 14s ease-in-out infinite alternate;
}
@keyframes float { to { transform: translate3d(30px, -40px, 0) scale(1.15); opacity: .55; } }

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

/* ---------- экраны ---------- */
.screen { position: relative; z-index: 1; min-height: 100svh; display: none; flex-direction: column; }
.screen.is-active { display: flex; animation: screenIn .6s ease both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(14px); } }

.topbar, .hud {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) clamp(16px, 4vw, 40px) 10px;
  position: relative; z-index: 5;
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: .01em; }
.brand .ico { color: var(--pink); }

.icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--ink); background: rgba(255,255,255,.06);
  border: 1.5px solid rgba(255, 124, 203, .55);
  box-shadow: 0 0 12px rgba(255, 79, 184, .25);
  transition: transform .15s, background .2s;
}
.icon-btn:hover { background: rgba(255,255,255,.12); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.is-muted { opacity: .45; }
.icon-btn.is-muted::after { content: ""; position: absolute; width: 26px; height: 2px; background: currentColor; transform: rotate(-45deg); border-radius: 2px; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 999px;
  padding: 18px 30px; font-weight: 800; font-size: 1.15rem; color: #fff;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .2s ease, filter .2s;
}
.btn--primary {
  background: linear-gradient(135deg, #ff5fc0, #e2348f 55%, #b42ad9);
  box-shadow: var(--glow), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn--primary:hover { filter: brightness(1.08); transform: translateY(-2px); }
.btn--primary:active { transform: scale(.97); }
.btn--ghost { background: transparent; color: var(--ink); border: 1.5px solid rgba(255,255,255,.3); padding: 12px 22px; font-size: 1rem; }
.btn--ghost:hover { border-color: var(--pink-2); }
.btn--sm { padding: 12px 22px; font-size: 1rem; }
.btn__arrow { transition: transform .2s; }
.btn:hover .btn__arrow { transform: translateX(4px); }
.btn:focus-visible, .icon-btn:focus-visible, .modal__close:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* ================= ИНТРО ================= */
.intro {
  flex: 1; display: grid; grid-template-columns: 1.05fr 1fr; align-items: center;
  gap: clamp(20px, 4vw, 60px);
  padding: 10px clamp(16px, 5vw, 72px) 40px;
  max-width: 1280px; width: 100%; margin: 0 auto;
}
.title { margin: 0 0 18px; line-height: .9; position: relative; }
.title__name {
  display: block; font-family: var(--f-hand); font-weight: 700;
  font-size: clamp(4rem, 9vw, 7.5rem); transform: rotate(-4deg); transform-origin: left;
  text-shadow: 0 0 22px rgba(255,255,255,.25);
}
.title__num {
  display: block; font-family: var(--f-num); font-weight: 900;
  font-size: clamp(6rem, 15vw, 12rem); letter-spacing: -.04em; margin: -.05em 0 0 .25em;
  background: linear-gradient(180deg, #ffd1ee 0%, #ff4fb8 55%, #c02ad6 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px rgba(255, 79, 184, .7));
  animation: neon 3.2s ease-in-out infinite;
}
@keyframes neon {
  0%, 100% { filter: drop-shadow(0 0 18px rgba(255, 79, 184, .7)); }
  48% { filter: drop-shadow(0 0 28px rgba(255, 79, 184, .95)); }
  50% { filter: drop-shadow(0 0 6px rgba(255, 79, 184, .4)); }
  52% { filter: drop-shadow(0 0 26px rgba(255, 79, 184, .9)); }
}
.title__tag {
  display: inline-block; margin-top: 10px;
  font-family: var(--f-hand); font-weight: 700; font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  padding: 2px 18px 6px; transform: rotate(-5deg);
  background: linear-gradient(90deg, rgba(255,79,184,.85), rgba(180,42,217,.8));
  border-radius: 6px 20px 8px 18px;
}
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); line-height: 1.55; max-width: 30em; margin: 10px 0 20px; color: var(--muted); }
.lead b { color: var(--pink-2); font-weight: 800; }

.pension-card {
  display: grid; gap: 2px; width: fit-content; max-width: 100%;
  padding: 14px 20px; margin-bottom: 26px;
  border-radius: 16px; background: rgba(255,255,255,.06);
  border: 1px dashed rgba(255, 211, 107, .55);
  transform: rotate(-1.5deg);
}
.pension-card__label { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--gold); font-weight: 800; }
.pension-card__value { font-family: var(--f-num); font-weight: 700; font-size: 1.6rem; }
.pension-card__hint { font-size: .85rem; color: var(--muted); }
.small { font-size: .95rem; color: var(--muted); margin: 16px 0 0; }

.intro__photo { position: relative; justify-self: center; width: min(100%, 440px); }
.hero-photo {
  margin: 0; position: relative; border-radius: 28px; overflow: visible;
  transform: rotate(2.5deg);
  animation: bob 6s ease-in-out infinite;
}
.hero-photo img {
  width: 100%; height: auto; border-radius: 28px;
  border: 3px solid rgba(255, 124, 203, .9);
  box-shadow: 0 0 0 6px rgba(255,79,184,.15), 0 0 40px rgba(255,79,184,.55), 0 30px 80px rgba(0,0,0,.5);
}
@keyframes bob { 50% { transform: rotate(1deg) translateY(-8px); } }
.hero-photo__crown {
  position: absolute; width: 22%; left: 50%; top: 0;
  transform: translate(-46%, -38%) rotate(-10deg);
  filter: drop-shadow(0 0 10px rgba(255, 211, 107, .9));
  animation: crown 3s ease-in-out infinite;
}
@keyframes crown { 50% { transform: translate(-46%, -46%) rotate(-6deg); } }
.scribble {
  position: absolute; left: -18%; bottom: 14%;
  font-family: var(--f-hand); font-weight: 700; font-size: 2rem; line-height: 1; color: var(--pink-2);
  transform: rotate(-12deg); text-shadow: 0 0 12px rgba(255,79,184,.6);
}
.scribble-arrow { position: absolute; left: -8%; bottom: 0; width: 70px; transform: rotate(-30deg); }
.scribble-arrow path { fill: none; stroke: var(--pink-2); stroke-width: 3; stroke-linecap: round; }

/* ================= ИГРА ================= */
.screen--game { height: 100svh; overflow: hidden; }
.hud { background: linear-gradient(180deg, rgba(20,6,31,.85), transparent); }
.hud__progress { flex: 1; max-width: 360px; display: grid; gap: 8px; justify-items: center; }
.hud__label { font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
.hud__label .ico { color: var(--gold); }
.hud__label b { color: var(--pink-2); font-size: 1.15em; }
.bar { width: 100%; height: 10px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; }
.bar__fill {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--pink), var(--violet));
  box-shadow: var(--glow); border-radius: inherit; transition: width .6s cubic-bezier(.2,.9,.3,1.2);
}
.sky { position: absolute; inset: 0; z-index: 2; touch-action: manipulation; }
.gift {
  position: absolute; left: 0; top: 0; padding: 0; border: 0; background: none;
  will-change: transform; cursor: pointer;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.35)) drop-shadow(0 0 14px var(--gc, rgba(255,79,184,.55)));
}
.gift svg { width: 100%; height: 100%; display: block; transition: transform .15s; }
.gift:hover svg { transform: scale(1.08); }
.gift.is-open { pointer-events: none; }
.gift.is-open svg { animation: giftPop .35s ease-in forwards; }
@keyframes giftPop { 40% { transform: scale(1.35); } to { transform: scale(0); opacity: 0; } }
.hint {
  position: absolute; z-index: 3; left: 50%; bottom: max(28px, env(safe-area-inset-bottom));
  transform: translateX(-50%); margin: 0; white-space: nowrap;
  font-family: var(--f-hand); font-weight: 700; font-size: 1.9rem; color: var(--gold);
  text-shadow: 0 0 14px rgba(255,211,107,.6); pointer-events: none;
  animation: pulse 1.6s ease-in-out infinite; transition: opacity .4s;
}
.hint.is-hidden { opacity: 0; }
@keyframes pulse { 50% { transform: translateX(-50%) scale(1.07); } }

/* ================= МОДАЛКА ================= */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 70px 16px 24px; overflow-y: auto; overscroll-behavior: contain; }
.modal__card { margin: auto 0; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(12, 2, 20, .72); backdrop-filter: blur(6px); animation: fade .3s ease both; }
@keyframes fade { from { opacity: 0; } }
.modal__card {
  position: relative; width: min(100%, 520px);
  background:
    radial-gradient(circle at 50% 0%, #ffe3f2 0%, transparent 60%),
    var(--card);
  color: var(--card-ink); border-radius: 28px;
  padding: 64px clamp(20px, 5vw, 36px) 28px;
  box-shadow: 0 0 0 2px rgba(255, 124, 203, .7), 0 0 60px rgba(255,79,184,.55), 0 30px 80px rgba(0,0,0,.5);
  text-align: center;
  animation: cardIn .55s cubic-bezier(.2,1.4,.4,1) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(40px) scale(.85) rotate(-3deg); } }
.modal__gift {
  position: absolute; left: 50%; top: 0; width: 110px; height: 110px;
  transform: translate(-50%, -58%);
  filter: drop-shadow(0 0 20px rgba(255, 211, 107, .9));
  animation: giftBounce .9s cubic-bezier(.2,1.6,.4,1) both;
}
.modal__gift svg { width: 100%; height: 100%; }
@keyframes giftBounce { from { transform: translate(-50%, -20%) scale(.3) rotate(-30deg); opacity: 0; } }
.modal__close {
  position: absolute; right: 14px; top: 12px; width: 38px; height: 38px; border-radius: 50%;
  border: 0; background: rgba(58,18,64,.08); color: var(--card-ink); font-size: 1.6rem; line-height: 1;
}
.modal__close:hover { background: rgba(58,18,64,.16); }
.modal__badge {
  display: inline-block; font-family: var(--f-hand); font-weight: 700; font-size: 1.7rem;
  padding: 0 18px 4px; transform: rotate(-3deg);
  background: linear-gradient(90deg, #ffd36b, #ffb347); color: #3a1240; border-radius: 6px 16px 6px 14px;
}
.modal__title { margin: 14px 0 12px; font-size: clamp(1.25rem, 3.6vw, 1.5rem); font-weight: 800; line-height: 1.2; }
.modal__body { display: flex; gap: 18px; align-items: center; text-align: left; margin-bottom: 24px; }
.modal__text { margin: 0; font-size: 1.08rem; line-height: 1.55; font-weight: 600; flex: 1; }
.modal__next { width: 100%; }

/* ---------- полароиды ---------- */
.polaroid {
  margin: 0; background: #fff; padding: 10px 10px 34px; border-radius: 4px;
  box-shadow: 0 14px 34px rgba(0,0,0,.4); position: relative;
}
.polaroid img { width: 100%; height: auto; aspect-ratio: 42 / 50; object-fit: cover; filter: saturate(1.08) contrast(1.03); }
.polaroid figcaption {
  position: absolute; left: 0; right: 0; bottom: 4px; text-align: center;
  font-family: var(--f-hand); font-weight: 700; font-size: 1.3rem; color: #6d2a76;
}
.polaroid::before {
  content: ""; position: absolute; top: -12px; left: 50%; width: 70px; height: 24px;
  transform: translateX(-50%) rotate(-4deg);
  background: rgba(255, 211, 107, .7); box-shadow: 0 2px 4px rgba(0,0,0,.15);
}
.polaroid--mini { width: 120px; flex: none; padding: 7px 7px 22px; transform: rotate(4deg); }
.polaroid--mini::before { width: 50px; height: 18px; top: -9px; }

/* ================= ФИНАЛ ================= */
.final { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 5vw, 60px) 48px; }
.final__title {
  font-family: var(--f-hand); font-weight: 700; text-align: center; margin: 10px 0 34px;
  font-size: clamp(3rem, 7vw, 5rem); line-height: 1; transform: rotate(-2deg);
  text-shadow: 0 0 22px rgba(255,79,184,.7);
}
.final__grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(28px, 4vw, 56px); align-items: center; }
.polaroids { display: grid; grid-template-columns: repeat(3, 1fr); align-items: center; padding: 20px 10px; }
.polaroids .polaroid { transition: transform .3s; }
.polaroid--1 { transform: rotate(-8deg) translateY(10px); z-index: 1; }
.polaroid--2 { transform: rotate(3deg) scale(1.1); z-index: 2; margin: 0 -14px; }
.polaroid--3 { transform: rotate(9deg) translateY(16px); z-index: 1; }
.polaroids .polaroid:hover { transform: rotate(0) scale(1.15); z-index: 3; }

.final__side { display: grid; gap: 22px; justify-items: center; text-align: center; }
.checklist {
  list-style: none; margin: 0; padding: 18px 26px; display: grid; gap: 6px; text-align: left;
  background: #fff8e8; color: #3a1240; border-radius: 6px; transform: rotate(-2deg);
  font-family: var(--f-hand); font-weight: 700; font-size: 1.6rem; line-height: 1.2;
  box-shadow: 0 14px 34px rgba(0,0,0,.35);
}
.checklist li { display: flex; align-items: center; gap: 12px; opacity: 0; animation: tick .4s ease forwards; }
.checklist li::before {
  content: "✓"; width: 26px; height: 26px; flex: none; display: grid; place-items: center;
  border: 2.5px solid #e2348f; border-radius: 5px; color: #e2348f; font-family: var(--f-body); font-size: 1rem; font-weight: 900;
}
.checklist li:nth-child(1) { animation-delay: .5s; }
.checklist li:nth-child(2) { animation-delay: .9s; }
.checklist li:nth-child(3) { animation-delay: 1.3s; }
.checklist li:nth-child(4) { animation-delay: 1.7s; }
@keyframes tick { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; } }

.insta { display: grid; gap: 14px; justify-items: center; }
.insta[hidden] { display: none; }
.insta__lead { font-family: var(--f-hand); font-weight: 700; font-size: 1.8rem; margin: 0; }
.insta__qr { position: relative; background: #fff; padding: 12px; border-radius: 18px; box-shadow: var(--glow); }
.insta__qr img { width: 180px; height: 180px; image-rendering: pixelated; }
.insta__logo {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  color: #fff; background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
  border: 3px solid #fff; font-size: 1.15rem;
}
.insta__handle { font-weight: 800; letter-spacing: .04em; color: var(--pink-2); margin-top: -4px; }
.signature { font-family: var(--f-hand); font-weight: 700; font-size: 2rem; line-height: 1.1; margin: 0; }
.signature span { color: var(--pink-2); font-size: 2.4rem; text-shadow: 0 0 14px rgba(255,79,184,.6); }

/* ================= АДАПТИВ ================= */
@media (max-width: 860px) {
  .intro { grid-template-columns: 1fr; padding-top: 0; gap: 8px; }
  .intro__photo { order: -1; width: min(62%, 270px); margin-top: 26px; }
  .intro__text { text-align: center; display: flex; flex-direction: column; align-items: center; }
  .title__name { transform: rotate(-4deg); transform-origin: center; }
  .title__num { margin-left: 0; }
  .scribble { left: auto; right: -26%; bottom: 8%; font-size: 1.35rem; transform: rotate(10deg); }
  .scribble-arrow { display: none; }
  .final__grid { grid-template-columns: 1fr; }
  .polaroids { max-width: 460px; margin: 0 auto; }
}
@media (max-width: 480px) {
  .btn { padding: 16px 24px; font-size: 1.05rem; }
  .modal__body { flex-direction: column-reverse; text-align: center; gap: 12px; }
  .polaroid--mini { width: 96px; }
  .modal__card { padding-top: 58px; }
  .modal__gift { width: 92px; height: 92px; }
  .brand { font-size: .92rem; }
  .polaroid figcaption { font-size: 1rem; }
  .polaroid { padding: 6px 6px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
