/* =========================================================
   Date with Polina — warm romantic, «поинтереснее» edition
   Палитра ui-ux-pro-max: роза #db2777 + золото #ca8a04,
   фон #fdf2f8, винный текст #831843.
   ========================================================= */

:root {
  --bg-1: #fff7f3;
  --bg-2: #fdecf3;
  --bg-3: #f7d2e2;

  --rose: #db2777;
  --rose-deep: #be185d;
  --pink: #f472b6;
  --pink-soft: #fbcfe3;
  --gold: #ca8a04;
  --gold-soft: #ecc774;
  --ember: #e0533b;
  --ember-deep: #c33f2c;

  --ink: #831843;
  --ink-soft: #8c4368;
  --ink-mut: #a86d8b;
  --white: #ffffff;

  --card: rgba(255, 255, 255, 0.66);
  --card-strong: rgba(255, 255, 255, 0.9);
  --hair: rgba(190, 24, 93, 0.14);

  --sh-sm: 0 2px 10px rgba(190, 24, 93, 0.10);
  --sh-md: 0 14px 34px -12px rgba(190, 24, 93, 0.26);
  --sh-lg: 0 30px 70px -20px rgba(190, 24, 93, 0.40);
  --sh-rose: 0 18px 38px -12px rgba(219, 39, 119, 0.58);
  --sh-ember: 0 18px 40px -12px rgba(224, 83, 59, 0.58);

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 28px;
  --r-pill: 999px;

  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-script: "Caveat", "Comic Sans MS", cursive;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 260ms;

  --z-bg: 0;
  --z-stage: 1;
  --z-fs: 30;
  --z-flee: 40;
  --z-confetti: 50;
  --z-toast: 60;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
}

* { box-sizing: border-box; }

/* hidden должен побеждать любые display из классов (.btn и т.п.) */
[hidden] { display: none !important; }

html, body { height: 100%; margin: 0; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg-2);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.6;
}

/* ---------- ФОН ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: var(--z-bg);
  overflow: hidden;
  background: radial-gradient(125% 95% at 50% -10%, var(--bg-1) 0%, var(--bg-2) 45%, var(--bg-3) 100%);
}
/* зернистость для «дороже» */
.bg::after {
  content: "";
  position: absolute;
  inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.05;
  mix-blend-mode: soft-light;
  pointer-events: none;
}
.bg__par { position: absolute; inset: -6%; will-change: transform; }

.aurora {
  position: absolute;
  left: 50%; top: 42%;
  width: 130vmax; height: 130vmax;
  margin-left: -65vmax; margin-top: -65vmax;
  border-radius: 46% 54% 58% 42% / 52% 46% 54% 48%;
  background: conic-gradient(from 0deg,
    rgba(244, 114, 182, 0.30),
    rgba(236, 199, 116, 0.26),
    rgba(224, 83, 59, 0.22),
    rgba(219, 39, 119, 0.30),
    rgba(244, 114, 182, 0.30));
  filter: blur(60px);
  opacity: 0.6;
  will-change: transform;
  animation: spin 42s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.glow { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.5; will-change: transform; animation: drift 18s var(--ease) infinite alternate; }
.glow--1 { width: 44vmax; height: 44vmax; left: -12vmax; top: -10vmax; background: radial-gradient(circle, rgba(244, 114, 182, 0.6), transparent 65%); }
.glow--2 { width: 38vmax; height: 38vmax; right: -10vmax; top: 8vmax; background: radial-gradient(circle, rgba(236, 199, 116, 0.5), transparent 65%); animation-delay: -6s; }
.glow--3 { width: 48vmax; height: 48vmax; left: 16vmax; bottom: -20vmax; background: radial-gradient(circle, rgba(219, 39, 119, 0.32), transparent 65%); animation-delay: -11s; }
@keyframes drift { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(3vmax, 2vmax, 0) scale(1.12); } }

.petals, .hearts { position: absolute; inset: 0; pointer-events: none; }
.petal {
  position: absolute; top: -6vh;
  width: var(--sz, 14px); height: var(--sz, 14px);
  border-radius: 80% 10% 80% 10%;
  background: radial-gradient(circle at 35% 30%, var(--pink-soft), rgba(244, 114, 182, 0.35));
  opacity: 0; will-change: transform, opacity;
  animation: fall var(--du, 16s) linear var(--de, 0s) infinite;
}
.heart-float {
  position: absolute; top: -8vh;
  font-size: 26px; line-height: 1;
  opacity: 0; will-change: transform, opacity;
  animation: floatHeart var(--du, 18s) linear var(--de, 0s) infinite;
}
@keyframes fall {
  0% { transform: translate3d(0, 0, 0) rotate(0); opacity: 0; }
  10% { opacity: var(--op, 0.7); }
  90% { opacity: var(--op, 0.7); }
  100% { transform: translate3d(var(--dx, 6vw), 112vh, 0) rotate(320deg); opacity: 0; }
}
@keyframes floatHeart {
  0% { transform: translate3d(0, 0, 0) scale(var(--sc, 1)) rotate(-8deg); opacity: 0; }
  12% { opacity: var(--op, 0.4); }
  88% { opacity: var(--op, 0.4); }
  100% { transform: translate3d(var(--dx, 6vw), 116vh, 0) scale(var(--sc, 1)) rotate(10deg); opacity: 0; }
}

/* ---------- СЦЕНА / ЭКРАНЫ ---------- */
.stage { position: fixed; inset: 0; z-index: var(--z-stage); }
.screen {
  position: absolute; inset: 0;
  display: flex;
  padding:
    calc(var(--safe-t) + clamp(20px, 5vh, 56px))
    calc(var(--safe-r) + clamp(18px, 5vw, 40px))
    calc(var(--safe-b) + clamp(20px, 5vh, 56px))
    calc(var(--safe-l) + clamp(18px, 5vw, 40px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0; visibility: hidden;
  transform: translateY(14px) scale(0.992);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease), visibility 0s linear 0.55s;
  pointer-events: none;
}
.screen.is-active {
  opacity: 1; visibility: visible; transform: none; pointer-events: auto;
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}
.screen__inner { margin: auto; width: min(640px, 100%); text-align: center; }

/* ---------- ТИПОГРАФИКА ---------- */
.eyebrow {
  font-family: var(--font-script);
  font-size: clamp(1.4rem, 5vw, 2.05rem);
  color: var(--rose); margin: 0 0 0.4rem; font-weight: 600;
}
.display {
  font-family: var(--font-display); font-weight: 800; color: var(--ink);
  line-height: 1.05; letter-spacing: -0.01em; margin: 0 0 1rem;
  font-size: clamp(2.5rem, 9vw, 4.7rem); text-wrap: balance;
}
.display--sm { font-size: clamp(2rem, 7vw, 3.4rem); }
.display em {
  font-family: var(--font-script); font-style: normal; font-weight: 700;
  font-size: 1.2em; line-height: 0.8;
  background: linear-gradient(100deg, var(--rose) 0%, var(--ember) 58%, var(--gold) 120%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 6px 16px rgba(219, 39, 119, 0.22));
}
.lede {
  font-size: clamp(1.05rem, 2.6vw, 1.3rem); color: var(--ink-soft);
  max-width: 38ch; margin: 0 auto 2rem; line-height: 1.65;
}
.lede b { color: var(--rose-deep); font-weight: 800; }
.sub { font-size: clamp(1.05rem, 2.6vw, 1.25rem); color: var(--ink-soft); margin: 0 0 2rem; }
.muted { color: var(--ink-mut); }
.emoji { font-style: normal; }

/* ---------- КНОПКИ ---------- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  font-family: var(--font-body); font-weight: 800;
  font-size: clamp(1rem, 2.4vw, 1.15rem); line-height: 1.15;
  padding: clamp(0.85rem, 2.4vw, 1.05rem) clamp(1.4rem, 4vw, 2rem);
  min-height: 52px;
  border: 0; border-radius: var(--r-pill); cursor: pointer;
  color: var(--white); background: var(--rose); box-shadow: var(--sh-rose);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), filter var(--dur) var(--ease);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn svg { flex: none; position: relative; z-index: 1; }
.btn:hover { transform: translateY(-2px); box-shadow: var(--sh-lg); filter: saturate(1.05); }
.btn:active { transform: translateY(0) scale(0.98); }

.btn--primary { background: linear-gradient(135deg, var(--rose) 0%, var(--rose-deep) 100%); }
/* блик-проблеск */
.btn--primary::after, .btn--mystery::after {
  content: ""; position: absolute; top: 0; left: 0; width: 38%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: translateX(-220%) skewX(-18deg); pointer-events: none;
  animation: sheen 4.8s var(--ease) infinite;
}
@keyframes sheen { 0% { transform: translateX(-220%) skewX(-18deg); } 55%, 100% { transform: translateX(460%) skewX(-18deg); } }

.btn--mystery {
  background: linear-gradient(135deg, #f97362 0%, var(--ember) 55%, var(--ember-deep) 100%);
  box-shadow: var(--sh-ember); animation: tempt 2.6s var(--ease) infinite;
}
@keyframes tempt {
  0%, 100% { transform: translateY(0); box-shadow: var(--sh-ember); }
  50% { transform: translateY(-3px); box-shadow: 0 24px 48px -12px rgba(224, 83, 59, 0.72); }
}
.btn--mystery:hover { animation-play-state: paused; }
.btn--mystery.is-ready { filter: saturate(1.12) brightness(1.04); animation-duration: 1.5s; }
.btn--mystery.shake { animation: shake 0.55s var(--ease); }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60% { transform: translateX(8px); }
}

/* «классика» — соблазнительная, но недостижимая; многострочный текст подколов */
.btn--classic {
  background: linear-gradient(135deg, #ffd9e7 0%, var(--pink-soft) 100%);
  color: var(--rose-deep); box-shadow: var(--sh-md);
  white-space: normal; text-align: center; max-width: min(82vw, 340px);
}
.flee {
  position: fixed; left: 0; top: 0; z-index: var(--z-flee); margin: 0;
  will-change: transform;
  transition: transform 0.3s var(--ease), box-shadow var(--dur) var(--ease);
}

:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* ---------- КАРТОЧКИ ---------- */
.cards { display: grid; grid-template-columns: 1fr; gap: clamp(14px, 3vw, 22px); margin-bottom: 1.4rem; }
.card {
  position: relative; isolation: isolate;
  background: var(--card);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--hair); border-radius: var(--r-lg);
  padding: clamp(1.3rem, 4vw, 2rem) clamp(1.2rem, 4vw, 1.8rem);
  box-shadow: var(--sh-md); text-align: center; overflow: hidden;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 45%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.card__badge { font-size: clamp(2rem, 7vw, 2.8rem); line-height: 1; margin-bottom: 0.5rem; filter: drop-shadow(0 6px 12px rgba(190, 24, 93, 0.25)); }
.card__title { font-family: var(--font-display); font-weight: 700; color: var(--ink); font-size: clamp(1.35rem, 4.4vw, 1.85rem); margin: 0 0 0.45rem; line-height: 1.12; }
.card__text { color: var(--ink-soft); font-size: clamp(0.98rem, 2.4vw, 1.08rem); margin: 0 0 1.3rem; }
.btn-slot { height: 52px; }

.card--mystery { border-color: rgba(224, 83, 59, 0.3); box-shadow: var(--sh-ember); }
.card--mystery .card__title {
  background: linear-gradient(100deg, var(--ember-deep), var(--rose));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}
.card--mystery::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(70% 80% at 50% 0%, rgba(224, 83, 59, 0.2), transparent 70%);
  pointer-events: none;
}

.dodge-hint {
  font-family: var(--font-script); font-size: clamp(1.25rem, 4vw, 1.7rem);
  color: var(--rose-deep); min-height: 1.8em; margin: 0;
  transition: opacity var(--dur) var(--ease);
}

/* ---------- ЭКРАН «ДА» ---------- */
.yes-mark { font-size: clamp(2.6rem, 9vw, 4rem); line-height: 1; margin-bottom: 0.3rem; }
.deal {
  list-style: none; margin: 0 auto 1.8rem; padding: clamp(1rem, 3vw, 1.4rem) clamp(1rem, 3vw, 1.6rem);
  max-width: 30rem; display: grid; gap: 0.7rem; text-align: left;
  background: var(--card-strong); border: 1px solid var(--hair); border-radius: var(--r-md);
  box-shadow: var(--sh-sm); color: var(--ink); font-size: clamp(1rem, 2.6vw, 1.12rem); font-weight: 600;
}
.deal li { display: flex; align-items: center; gap: 0.7rem; }
.deal__ic { font-size: 1.4em; flex: none; }

.addr { max-width: 30rem; margin: 0 auto; }
.addr__label { display: block; font-family: var(--font-display); font-weight: 700; color: var(--ink); font-size: clamp(1.2rem, 3.6vw, 1.55rem); margin: 0 0 0.3rem; }
.addr__hint { color: var(--ink-soft); font-size: clamp(0.98rem, 2.5vw, 1.1rem); margin: 0 0 1.1rem; }

.footer-note {
  position: absolute; left: 0; right: 0; bottom: calc(var(--safe-b) + 14px);
  text-align: center; font-family: var(--font-script); font-size: 1.25rem; color: var(--ink-mut); margin: 0;
}

/* ---------- FULLSCREEN TOGGLE ---------- */
.fs-toggle {
  position: fixed; top: calc(var(--safe-t) + 14px); right: calc(var(--safe-r) + 14px);
  z-index: var(--z-fs); width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--hair); border-radius: var(--r-pill);
  background: var(--card-strong); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--rose-deep); cursor: pointer; box-shadow: var(--sh-sm);
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.fs-toggle:hover { transform: translateY(-1px); background: var(--white); }

/* ---------- КОНФЕТТИ ---------- */
#confetti { position: fixed; inset: 0; z-index: var(--z-confetti); pointer-events: none; }

/* ---------- ТОСТ ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--safe-b) + 84px); transform: translate(-50%, 20px);
  z-index: var(--z-toast); max-width: min(90vw, 30rem); padding: 0.85rem 1.25rem;
  background: var(--ink); color: #fff; font-weight: 700; border-radius: var(--r-pill);
  box-shadow: var(--sh-lg); opacity: 0; pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- REVEAL ---------- */
.reveal { opacity: 0; transform: translateY(16px); animation: reveal 0.7s var(--ease) forwards; animation-delay: var(--d, 0ms); }
@keyframes reveal { to { opacity: 1; transform: none; } }

/* ---------- АДАПТИВ ---------- */
@media (min-width: 720px) {
  .cards { grid-template-columns: 1fr 1fr; align-items: stretch; }
  .card { display: flex; flex-direction: column; }
  .card__text { flex: 1; }
}
@media (min-width: 1100px) {
  .screen__inner { width: min(760px, 100%); }
  .screen--choose .screen__inner { width: min(900px, 100%); }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .glow, .petals, .hearts, .aurora { display: none; }
  .bg__par { transform: none !important; }
  .reveal { opacity: 1; transform: none; }
  .flee { transition: none; }
  .btn--mystery, .btn--primary::after, .btn--mystery::after { animation: none; }
}
