/* ===== Токены ===== */
:root {
  --blush: #FFE3EC;      /* фон */
  --petal: #FFC2D4;      /* рамки, неактивное */
  --rose: #FF7FA6;       /* акцент */
  --rose-deep: #E0507F;  /* кнопки */
  --berry: #B8325F;      /* заголовки, тени кнопок */
  --ink: #5A2A45;        /* текст */
  --honey: #FFC94A;      /* пчёлки, фокус */
  --cream: #FFF7FA;      /* карточка */
  --soft: #8A5A73;       /* второстепенный текст */

  --radius-lg: 32px;
  --radius-md: 20px;
  --radius-pill: 999px;
  --shadow: 0 18px 40px -18px rgba(184, 50, 95, .38);

  --font-hand: 'Caveat', 'Segoe Script', 'Comic Sans MS', cursive;
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--ink);
  line-height: 1.55;
  background-color: var(--blush);
  /* Соты — в честь пчёлок */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66L28 100' fill='none' stroke='%23FFC2D4' stroke-width='1.5' stroke-opacity='.6'/%3E%3C/svg%3E");
  background-size: 56px 100px;
  padding: calc(8px + env(safe-area-inset-top)) 14px calc(28px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}

.app { max-width: 460px; margin: 0 auto; }

/* ===== Прогресс ===== */
.progress { display: flex; justify-content: center; gap: 8px; margin: 10px 0 14px; }
.progress__dot { width: 22px; height: 20px; fill: var(--petal); transition: fill .3s, transform .3s; }
.progress__dot.is-done { fill: var(--rose); }
.progress__dot.is-current { transform: scale(1.25); }

/* ===== Шаги ===== */
.step {
  position: relative;
  background: var(--cream);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px 20px 24px;
}
.step[hidden] { display: none; }
.step.is-active { animation: stepIn .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes stepIn {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

h1, h2 {
  font-family: var(--font-hand);
  font-weight: 700;
  color: var(--berry);
  line-height: 1.05;
  margin: 0 0 12px;
}
h1 { font-size: clamp(2.7rem, 12vw, 3.5rem); text-align: center; }
h2 { font-size: clamp(2.1rem, 9vw, 2.6rem); }
h1:focus, h2:focus { outline: none; }
h3 { font-size: 1.02rem; font-weight: 800; margin: 24px 0 10px; }
h3 .muted { font-weight: 600; font-size: .85rem; }
p { margin: 0 0 14px; }

.lead { font-size: 1.06rem; }
.center { text-align: center; }
.muted { color: var(--soft); }
.small { font-size: .88rem; }

/* ===== Кнопки ===== */
.btn {
  appearance: none;
  border: 0;
  font: 800 1.08rem/1.2 var(--font-body);
  min-height: 54px;
  padding: 15px 24px;
  border-radius: var(--radius-pill);
  background: var(--rose-deep);
  color: #fff;
  box-shadow: 0 5px 0 var(--berry);
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, opacity .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--berry); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn--wide { display: block; width: 100%; }
.btn--ghost { background: transparent; color: var(--berry); box-shadow: inset 0 0 0 2px var(--petal); }
.btn--ghost:active { transform: translateY(1px); box-shadow: inset 0 0 0 2px var(--rose); }

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

.nav { display: flex; gap: 10px; margin-top: 22px; }
.nav .btn { flex: 1; padding-inline: 12px; white-space: nowrap; }

/* ===== Шаг 2: любовометр ===== */
.meter { text-align: center; margin: 8px 0 22px; }
.meter__heart {
  --scale: .9;
  --fill: .5;
  position: relative;
  width: 170px; height: 156px;
  margin: 0 auto;
  display: grid; place-items: center;
  transform: scale(var(--scale));
  transition: transform .25s cubic-bezier(.3, 1.6, .5, 1);
}
.meter__heart svg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  fill: var(--rose);
  fill: color-mix(in srgb, var(--rose-deep) calc(var(--fill) * 100%), var(--petal));
  filter: drop-shadow(0 10px 14px rgba(184, 50, 95, .3));
  transition: fill .25s;
}
.meter__heart.is-max { animation: pulse 1s ease-in-out infinite; }
.meter__value {
  position: relative;
  font: 700 4rem/1 var(--font-hand);
  color: #fff;
  margin-top: -10px;
}
.meter__caption { min-height: 1.6em; font-weight: 800; color: var(--berry); font-size: 1.08rem; margin: 10px 0 14px; }
.meter__range {
  --pct: 44%;
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--rose-deep) var(--pct), var(--petal) var(--pct));
  outline-offset: 6px;
  cursor: pointer;
}
.meter__range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--rose-deep);
  box-shadow: 0 4px 0 var(--berry);
}
.meter__range::-moz-range-thumb {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--rose-deep);
  box-shadow: 0 4px 0 var(--berry);
}
.meter__range:disabled { cursor: default; }
.meter__ends { display: flex; justify-content: space-between; font-weight: 800; color: var(--soft); margin-top: 8px; }
@keyframes pulse { 50% { transform: scale(calc(var(--scale) * 1.08)); } }

/* ===== Поля ===== */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 800; font-size: .95rem; margin-bottom: 6px; }
.field .muted { font-weight: 600; }
.input {
  width: 100%;
  font: 600 16px/1.4 var(--font-body); /* 16px — чтобы iOS не зумил */
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--petal);
  border-radius: 16px;
  padding: 13px 15px;
  min-height: 52px;
  transition: border-color .2s, box-shadow .2s;
}
.input:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 4px rgba(255, 127, 166, .22); }
textarea.input { resize: vertical; min-height: 90px; }


.check { display: flex; align-items: center; gap: 10px; font-weight: 700; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--rose-deep); flex: none; }

.vibe input[type="range"] { width: 100%; accent-color: var(--rose-deep); height: 32px; }
.vibe__ends { display: flex; justify-content: space-between; font-size: .85rem; color: var(--soft); font-weight: 700; }
.vibe__out { text-align: center; font-weight: 800; color: var(--berry); margin: 6px 0 0; }

/* ===== Ошибки и мелочи ===== */
.error { color: #B0103A; font-weight: 800; min-height: 1.4em; margin: 12px 0 0; }
.shake { animation: shake .4s; }
@keyframes shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.float {
  position: fixed; z-index: 999;
  pointer-events: none;
  font-size: 24px;
  animation: floatUp 1s ease-out forwards;
}
@keyframes floatUp {
  from { opacity: 1; transform: translate(-50%, -50%) scale(.6); }
  to   { opacity: 0; transform: translate(-50%, -190%) scale(1.3); }
}


/* ===== Шаг 1: котик, пчёлка и лица на орбите ===== */
.hero-art { position: relative; height: 280px; display: grid; place-items: center; }
.cat--hero { width: 140px; height: 128px; animation: bob 3s ease-in-out infinite; }
.orbit {
  position: absolute; top: 50%; left: 50%;
  width: 0; height: 0;
  animation: orbit var(--dur, 8s) linear infinite;
  animation-delay: var(--delay, 0s);
}
.orbit > * { position: absolute; transform: translate(-50%, -50%); }
.orbit--bee { --r: min(92px, 26vw); --dur: 6s; animation-direction: reverse; }
.orbit--bee .bee { width: 50px; height: 40px; }
.orbit--f1 { --r: min(122px, 34vw); --dur: 11s; --delay: 0s; }
.orbit--f2 { --r: min(122px, 34vw); --dur: 11s; --delay: -3.667s; }
.orbit--f3 { --r: min(122px, 34vw); --dur: 11s; --delay: -7.333s; }
@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes orbit {
  from { transform: rotate(0deg) translateX(var(--r)) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(var(--r)) rotate(-360deg); }
}

.face {
  display: grid; place-items: center;
  width: 54px; height: 54px;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  border: 3px solid #fff;
  box-shadow: 0 6px 14px -6px rgba(184, 50, 95, .55);
  font-size: 28px; line-height: 1;
}
.face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.face--icon { background: var(--cream); border-color: var(--petal); }
.face__svg { width: 80%; height: 80%; }

.btn--gas { font-size: 1.6rem; letter-spacing: .04em; padding: 16px 24px; }

/* ===== Шаг 2: отправить ответ ===== */
.btn.is-knew { background: var(--honey); color: var(--berry); box-shadow: 0 5px 0 #D99A00; }

/* ===== Шаг 3: варианты места ===== */
.options { display: grid; gap: 10px; margin-bottom: 14px; }
.option {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  min-height: 62px;
  padding: 14px 44px 14px 16px;
  text-align: left;
  border: 2px solid var(--petal);
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  font: 700 1.02rem/1.3 var(--font-body);
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .15s;
  -webkit-tap-highlight-color: transparent;
}
.option__emoji { font-size: 1.6rem; line-height: 1; flex: none; }
.option[aria-pressed="true"] { background: var(--blush); border-color: var(--rose-deep); transform: rotate(-1deg); }
.option[aria-pressed="true"]::after { content: '💗'; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); }
.custom-place[hidden] { display: none; }

/* ===== Шаг 4: календарь ===== */
.cal { background: #fff; border: 2px solid var(--petal); border-radius: var(--radius-md); padding: 12px 10px 10px; }
.cal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal__title { font: 700 1.9rem/1 var(--font-hand); color: var(--berry); }
.cal__nav {
  width: 42px; height: 42px;
  border: 0; border-radius: 50%;
  background: var(--blush); color: var(--berry);
  font: 800 1.5rem/1 var(--font-body);
  cursor: pointer;
}
.cal__nav:disabled { opacity: .35; cursor: default; }
.cal__week, .cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal__week { font-size: .78rem; font-weight: 800; color: var(--soft); margin-bottom: 4px; }
.cal__day {
  aspect-ratio: 1;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font: 700 1rem var(--font-body);
  cursor: pointer;
  transition: background .15s, color .15s, transform .15s;
  -webkit-tap-highlight-color: transparent;
}
.cal__day:not(:disabled):active { transform: scale(.9); }
.cal__day.is-today { box-shadow: inset 0 0 0 2px var(--petal); }
.cal__day[aria-pressed="true"] { background: var(--rose-deep); color: #fff; }
.cal__day:disabled { opacity: .28; cursor: default; }
.cal__picked { text-align: center; font-weight: 800; color: var(--berry); margin: 10px 0 12px; }

/* ===== Финал ===== */
.finale { text-align: center; overflow: hidden; }
.finale-sky { position: relative; height: 130px; }
.fly { position: absolute; }
.fly--1 { top: 10px; left: 6%;  animation: buzz1 3.4s ease-in-out infinite; }
.fly--2 { top: 56px; right: 8%; animation: buzz2 2.8s ease-in-out infinite; }
.fly--3 { top: 4px;  left: 42%; animation: buzz1 4s ease-in-out infinite reverse; }
.fly--bee { top: 70px; left: 24%; width: 46px; height: 37px; animation: buzz2 2.2s ease-in-out infinite reverse; }
@keyframes buzz1 {
  0%, 100% { transform: translate(0, 0) rotate(-8deg); }
  25%      { transform: translate(40px, 22px) rotate(10deg); }
  50%      { transform: translate(64px, -4px) rotate(-6deg); }
  75%      { transform: translate(20px, -10px) rotate(8deg); }
}
@keyframes buzz2 {
  0%, 100% { transform: translate(0, 0) rotate(6deg); }
  50%      { transform: translate(-80px, 16px) rotate(-10deg); }
}

.cat-gif {
  max-width: 300px;
  margin: 6px auto 20px;
  border-radius: 24px;
  overflow: hidden;
  background: var(--blush);
}
.couple { display: block; width: 100%; height: auto; overflow: visible; }
.umbrella { transform-box: view-box; transform-origin: 150px 200px; animation: sway 3s ease-in-out infinite; }
.lean { transform-box: fill-box; transform-origin: 50% 100%; }
.lean--l { animation: leanL 3s ease-in-out infinite; }
.lean--r { animation: leanR 3s ease-in-out infinite; }
.love { transform-box: view-box; transform-origin: 150px 105px; animation: love 3s ease-in-out infinite; }
.drop { animation: drop 1.1s linear infinite; }
.d2 { animation-delay: -.3s; } .d3 { animation-delay: -.6s; } .d4 { animation-delay: -.2s; }
.d5 { animation-delay: -.8s; animation-name: dropShort; } .d6 { animation-delay: -.4s; animation-name: dropShort; }
@keyframes sway { 50% { transform: rotate(3deg); } }
@keyframes leanL { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(7deg); } }
@keyframes leanR { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-7deg); } }
@keyframes love {
  0%, 30% { opacity: 0; transform: translateY(8px) scale(.4); }
  50%     { opacity: 1; transform: translateY(-10px) scale(1.2); }
  80%, 100% { opacity: 0; transform: translateY(-34px) scale(.9); }
}
@keyframes drop {
  from { transform: translateY(-20px); opacity: 0; }
  20%  { opacity: 1; }
  to   { transform: translateY(160px); opacity: 0; }
}
@keyframes dropShort {
  from { transform: translateY(-10px); opacity: 0; }
  30%  { opacity: 1; }
  to   { transform: translateY(40px); opacity: 0; }
}
.cat-gif.is-puk { animation: puk .5s ease; }
@keyframes puk {
  0%, 100% { transform: none; }
  20% { transform: scale(1.05, .92); }
  40% { transform: translateX(-8px) rotate(-3deg); }
  60% { transform: translateX(8px) rotate(3deg); }
  80% { transform: scale(.97, 1.04); }
}
.btn--puk { font-size: 1.4rem; }

.place-react { min-height: 1.6em; text-align: center; font-weight: 900; font-size: 1.3rem; color: var(--berry); margin: 4px 0 0; }

.butt {
  position: fixed; left: 0; top: 0; z-index: 1002;
  width: 110px; height: 93px;
  pointer-events: none;
  will-change: transform;
  filter: drop-shadow(0 8px 10px rgba(184, 50, 95, .3));
}
.butt svg { width: 100%; height: 100%; }

.demo-box { margin-top: 22px; text-align: left; }
.demo-box pre {
  margin: 0;
  padding: 14px;
  background: #fff;
  border: 2px dashed var(--petal);
  border-radius: 16px;
  font: 600 .9rem/1.5 var(--font-body);
  white-space: pre-wrap;
  word-break: break-word;
}

@media (min-width: 520px) {
  body { padding-top: 32px; }
  .step { padding: 36px 32px 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
