/* ============================================================
   Свидос — конструктор приглашений на свидание
   Все кастомные стили и анимации
   ============================================================ */

:root {
  --bg: #FFF0F2;
  --grad-a: #E84A7F;
  --grad-b: #FF6BA0;
  --text: #4A3340;
  --muted: #B88A9A;
  --card: #FFFFFF;
  --pink-shadow: rgba(232, 74, 127, 0.22);
  --pink-shadow-soft: rgba(255, 107, 160, 0.16);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.font-display { font-weight: 800; letter-spacing: -0.02em; }
.text-muted { color: var(--muted); }

.grad {
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
}
.grad-text {
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.shadow-pink { box-shadow: 0 14px 40px var(--pink-shadow); }
.shadow-pink-soft { box-shadow: 0 8px 24px var(--pink-shadow-soft); }

.wrap {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 0 18px;
}

/* ------------------------------------------------------------
   Фоновые сердечки — бесконечный поток снизу вверх
   ------------------------------------------------------------ */
.hearts-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.hearts-bg .h {
  position: absolute;
  bottom: -40px;
  color: var(--grad-b);
  opacity: 0;
  animation: floatUp linear infinite;
  will-change: transform, opacity;
}
@keyframes floatUp {
  0%   { transform: translateY(0) scale(0.7) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.5; }
  90%  { opacity: 0.35; }
  100% { transform: translateY(-108vh) scale(1) rotate(30deg); opacity: 0; }
}

/* ------------------------------------------------------------
   Кавайный мишка
   ------------------------------------------------------------ */
.bear {
  width: 150px;
  height: 150px;
  display: inline-block;
  transform-origin: 50% 90%;
}
.bear svg { width: 100%; height: 100%; overflow: visible; }

/* базовое покачивание (idle) */
.bear-idle { animation: bearSway 3.2s ease-in-out infinite; }
@keyframes bearSway {
  0%, 100% { transform: rotate(-4deg) translateY(0); }
  50%      { transform: rotate(4deg) translateY(-4px); }
}

/* радость: подпрыгивание + звёздочки */
.bear-happy { animation: bearJump 0.6s ease-in-out infinite; }
@keyframes bearJump {
  0%, 100% { transform: translateY(0) scale(1); }
  35%      { transform: translateY(-16px) scale(1.04); }
  60%      { transform: translateY(0) scale(0.98); }
}

/* грусть: чуть поникает */
.bear-sad { animation: bearSad 2s ease-in-out infinite; }
@keyframes bearSad {
  0%, 100% { transform: rotate(-2deg) translateY(2px); }
  50%      { transform: rotate(2deg) translateY(4px); }
}

/* танец */
.bear-dance { animation: bearDance 0.7s ease-in-out infinite; }
@keyframes bearDance {
  0%   { transform: rotate(-10deg) translateY(0); }
  25%  { transform: rotate(10deg)  translateY(-10px); }
  50%  { transform: rotate(-10deg) translateY(0); }
  75%  { transform: rotate(10deg)  translateY(-10px); }
  100% { transform: rotate(-10deg) translateY(0); }
}

/* глаза/зрачки */
.bear .pupil { transition: r 0.25s ease, transform 0.25s ease; transform-origin: center; }
.bear-sad .pupil { transform: scale(0.5); }
.bear-sad .brow { opacity: 1; }
.bear .brow { opacity: 0; transition: opacity 0.25s ease; }

/* румянец подсвечивается при радости */
.bear .cheek { transition: opacity 0.25s ease; }
.bear-happy .cheek, .bear-dance .cheek { opacity: 1; }

/* звёздочки из глаз (happy) */
.bear .spark { opacity: 0; transform-origin: center; }
.bear-happy .spark { animation: sparkPop 0.7s ease-in-out infinite; }
.bear-dance .spark { animation: sparkPop 0.7s ease-in-out infinite; }
@keyframes sparkPop {
  0%, 100% { opacity: 0; transform: scale(0.4) rotate(0deg); }
  50%      { opacity: 1; transform: scale(1.1) rotate(25deg); }
}

/* ------------------------------------------------------------
   Кнопки
   ------------------------------------------------------------ */
.btn {
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  transition: all 0.3s ease;
  border-radius: 9999px;
}
.btn-grad {
  color: #fff;
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  box-shadow: 0 12px 28px var(--pink-shadow);
}
.btn-grad:hover { transform: translateY(-2px); box-shadow: 0 18px 36px var(--pink-shadow); }
.btn-grad:active { transform: translateY(0); }

.btn-ghost {
  color: var(--grad-a);
  background: #fff;
  border: 2px solid #FFC6D8;
}
.btn-ghost:hover { background: #FFF6F9; }

/* Кнопка "Да" в форме сердца (clip-path) */
.heart-btn {
  position: relative;
  width: 180px;
  height: 158px;
  border: none;
  cursor: pointer;
  color: #fff;
  font-family: inherit;
  font-weight: 800;
  font-size: 22px;
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  clip-path: path('M90,158 C90,158 8,104 8,54 C8,26 30,8 54,8 C72,8 84,20 90,32 C96,20 108,8 126,8 C150,8 172,26 172,54 C172,104 90,158 90,158 Z');
  -webkit-clip-path: path('M90,158 C90,158 8,104 8,54 C8,26 30,8 54,8 C72,8 84,20 90,32 C96,20 108,8 126,8 C150,8 172,26 172,54 C172,104 90,158 90,158 Z');
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 26px;
  filter: drop-shadow(0 12px 22px var(--pink-shadow));
  animation: heartPulse 1.4s ease-in-out infinite;
  transition: transform 0.25s ease;
}
.heart-btn:hover { animation-play-state: paused; transform: scale(1.06); }
@keyframes heartPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}

/* ------------------------------------------------------------
   Рамка телефона (превью)
   ------------------------------------------------------------ */
.phone {
  width: 260px;
  border-radius: 34px;
  background: #fff;
  border: 8px solid #2B1B24;
  box-shadow: 0 22px 50px var(--pink-shadow);
  overflow: hidden;
}
.phone-notch {
  height: 22px;
  background: #2B1B24;
  border-radius: 0 0 14px 14px;
  width: 44%;
  margin: 0 auto;
}
.phone-screen {
  padding: 18px 16px 22px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(180deg, #FFF6F9, #FFFFFF);
}

/* ------------------------------------------------------------
   Визард (create.html)
   ------------------------------------------------------------ */
.stepper { display: flex; align-items: center; gap: 4px; justify-content: center; }
.step-dot {
  width: 34px; height: 34px; border-radius: 9999px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
  background: #FFE1EA; color: var(--muted);
  transition: all 0.3s ease; flex: 0 0 auto;
}
.step-dot.active { background: linear-gradient(135deg, var(--grad-a), var(--grad-b)); color: #fff; transform: scale(1.08); }
.step-dot.done { background: #FFC6D8; color: #fff; }
.step-line { height: 3px; width: 18px; background: #FFE1EA; border-radius: 9999px; }
.step-line.done { background: #FFC6D8; }

.field-label { font-weight: 800; font-size: 14px; color: var(--text); display: block; margin-bottom: 6px; }
.inp {
  width: 100%;
  border: 2px solid #FFDCE6;
  background: #fff;
  border-radius: 18px;
  padding: 12px 14px;
  font-family: inherit; font-size: 15px; color: var(--text);
  outline: none; transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.inp:focus { border-color: var(--grad-b); box-shadow: 0 0 0 4px rgba(255,107,160,0.15); }
textarea.inp { resize: vertical; min-height: 84px; }

.preset-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.preset {
  aspect-ratio: 1; border-radius: 16px; cursor: pointer; overflow: hidden;
  border: 3px solid transparent; transition: all 0.2s ease; position: relative;
}
.preset img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preset.sel { border-color: var(--grad-a); transform: scale(1.03); }
.preset:hover { transform: translateY(-2px); }

.upload-tile {
  aspect-ratio: 1; border-radius: 16px; cursor: pointer;
  border: 3px dashed #FFC6D8; background: #FFF6F9;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--muted); font-weight: 800; font-size: 12px; gap: 4px; text-align: center;
  transition: all 0.2s ease;
}
.upload-tile:hover { border-color: var(--grad-a); color: var(--grad-a); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #FFF6F9; border: 2px solid #FFDCE6; border-radius: 9999px;
  padding: 8px 12px; font-weight: 800; font-size: 14px;
}

/* активность: карточки вариантов */
.act-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.act-emoji {
  width: 46px; height: 46px; flex: 0 0 auto; border-radius: 14px;
  background: #FFF6F9; border: 2px solid #FFDCE6; font-size: 22px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}

/* ------------------------------------------------------------
   Invite (получатель) — полноэкранные экраны
   ------------------------------------------------------------ */
.invite-body { overflow: hidden; }
.screens { position: relative; min-height: 100dvh; }
.screen {
  position: absolute; inset: 0;
  display: none; flex-direction: column; align-items: center; justify-content: center;
  padding: 26px 20px; text-align: center;
  animation: screenIn 0.5s ease;
}
.screen.active { display: flex; }
@keyframes screenIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.screen-img {
  width: 190px; height: 190px; border-radius: 30px; object-fit: cover;
  box-shadow: 0 16px 40px var(--pink-shadow); margin-bottom: 18px;
}

.option-card {
  width: 100%; max-width: 320px; margin: 0 auto 10px;
  background: #fff; border: 3px solid #FFDCE6; border-radius: 22px;
  padding: 14px 16px; display: flex; align-items: center; gap: 12px;
  cursor: pointer; transition: all 0.25s ease; font-weight: 800; font-size: 17px;
  box-shadow: 0 6px 18px var(--pink-shadow-soft);
}
.option-card .oc-emoji { font-size: 26px; }
.option-card.sel { border-color: var(--grad-a); background: #FFF1F5; transform: scale(1.02); }

/* взрыв сердечек в финале */
.burst { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.burst .b {
  position: absolute; left: 50%; top: 50%; font-size: 26px;
  animation: burstOut 1.2s ease-out forwards;
}
@keyframes burstOut {
  0%   { transform: translate(-50%, -50%) scale(0.3); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(1.1) rotate(var(--rot)); opacity: 0; }
}

/* падающие сердечки (финал) */
.rain { position: fixed; inset: 0; pointer-events: none; z-index: 55; overflow: hidden; }
.rain .r {
  position: absolute; top: -40px; font-size: 22px;
  animation: rainDown linear forwards;
}
@keyframes rainDown {
  0%   { transform: translateY(0) rotate(0); opacity: 0; }
  10%  { opacity: 1; }
  100% { transform: translateY(112vh) rotate(90deg); opacity: 0.8; }
}

.voice-player {
  display: inline-flex; align-items: center; gap: 10px;
  background: #fff; border: 2px solid #FFDCE6; border-radius: 9999px;
  padding: 8px 14px; font-weight: 800; color: var(--grad-a); cursor: pointer;
}

/* точки-навигация invite */
.dots { display: flex; gap: 6px; justify-content: center; }
.dots i { width: 8px; height: 8px; border-radius: 9999px; background: #FFC6D8; display: inline-block; transition: all 0.3s; }
.dots i.on { width: 22px; background: var(--grad-a); }

/* rec-индикатор */
.rec-dot { width: 10px; height: 10px; border-radius: 9999px; background: #E84A7F; display: inline-block; animation: recPulse 1s infinite; }
@keyframes recPulse { 0%,100%{opacity:1} 50%{opacity:0.2} }

/* доступность: уважаем reduced motion */
@media (prefers-reduced-motion: reduce) {
  .bear-idle, .bear-happy, .bear-sad, .bear-dance,
  .heart-btn, .hearts-bg .h, .spark { animation: none !important; }
}

/* текстовые правовые страницы */
.legal { max-width: 720px; margin: 0 auto; padding: 40px 22px 80px; line-height: 1.7; }
.legal h1 { font-weight: 800; font-size: 26px; margin-bottom: 6px; }
.legal h2 { font-weight: 800; font-size: 18px; margin-top: 28px; }
.legal p, .legal li { color: #5c4451; }
.legal a { color: var(--grad-a); font-weight: 700; }
