/* ========== БАЗА ========== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100dvh;
  overflow: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #0f3a4d;
  background: linear-gradient(
    115deg,
    rgba(42, 123, 155, 1)  0%,
    rgba(87, 199, 133, 1)  35%,
    rgba(115, 203, 124, 1) 55%,
    rgba(142, 207, 115, 1) 75%,
    rgba(237, 221, 83, 1) 100%
  );
  background-attachment: fixed;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  min-height: 100dvh;
}

/* Лёгкое смещение градиента, чтоб дышало */
body::before {
  content: '';
  position: fixed;
  inset: -10%;
  background: inherit;
  filter: blur(40px) saturate(110%);
  opacity: 0.55;
  z-index: 0;
  animation: bgDrift 18s ease-in-out infinite alternate;
}

@keyframes bgDrift {
  0%   { transform: translate(0, 0)      rotate(0deg); }
  100% { transform: translate(-3%, 2%)  rotate(2deg);  }
}

/* ========== ПАРЯЩИЕ БЕЛЫЕ КРУГИ ========== */
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(255, 255, 255, 0.5),
    rgba(255, 255, 255, 0.15) 60%,
    rgba(255, 255, 255, 0.05) 100%
  );
  filter: blur(2px);
  animation: orbFloat 22s ease-in-out infinite;
  will-change: transform;
}

.orb-1 { width: 280px; height: 280px; top: -60px;  left: 12%; opacity: 0.45; animation-duration: 26s; animation-delay:  0s;  }
.orb-2 { width: 180px; height: 180px; top: 30%;    right: 8%; opacity: 0.55; animation-duration: 20s; animation-delay: -4s;  }
.orb-3 { width: 220px; height: 220px; bottom: -40px; left: 35%; opacity: 0.4;  animation-duration: 28s; animation-delay: -8s;  }
.orb-4 { width:  90px; height:  90px; top: 18%;    left: 6%;  opacity: 0.6;  animation-duration: 18s; animation-delay: -2s;  }
.orb-5 { width: 140px; height: 140px; bottom: 18%; right: 32%; opacity: 0.5;  animation-duration: 24s; animation-delay: -6s;  }
.orb-6 { width:  70px; height:  70px; top: 55%;    left: 22%; opacity: 0.65; animation-duration: 16s; animation-delay: -3s;  }
.orb-7 { width: 110px; height: 110px; top: 8%;     right: 28%; opacity: 0.5;  animation-duration: 21s; animation-delay: -10s; }

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0)         scale(1);    }
  25%      { transform: translate(20px, -30px)  scale(1.05); }
  50%      { transform: translate(-15px, -50px) scale(0.95); }
  75%      { transform: translate(-25px, -20px) scale(1.02); }
}

@media (max-width: 480px) {
  .orb-1, .orb-3 { width: 180px; height: 180px; }
  .orb-2 { width: 130px; height: 130px; }
  .orb-5, .orb-7 { display: none; }
}

/* ========== ГИФКИ ПО УГЛАМ ========== */
.corner-gif {
  position: fixed;
  width: clamp(140px, 22vw, 260px);
  height: auto;
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 16px 32px rgba(0, 60, 80, 0.25));
  animation: cornerFloat 6s ease-in-out infinite;
}

.corner-top-left {
  top: 24px;
  left: 24px;
  transform-origin: top left;
}

.corner-bottom-right {
  bottom: 24px;
  right: 24px;
  animation-delay: -3s;
  transform-origin: bottom right;
}

.corner-bottom-left {
  bottom: 24px;
  left: 24px;
  width: clamp(120px, 18vw, 200px);
  animation-delay: -1.5s;
  transform-origin: bottom left;
}

@keyframes cornerFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-12px) rotate(2deg); }
}

/* На узких экранах прячем чтоб не мешали карточке */
@media (max-width: 760px) {
  .corner-gif {
    width: clamp(90px, 24vw, 140px);
    opacity: 0.85;
  }
  .corner-top-left     { top: 12px;    left: 12px;  }
  .corner-bottom-right { bottom: 12px; right: 12px; }
}

@media (max-width: 420px) {
  .corner-gif { width: 80px; opacity: 0.7; }
}

/* ========== ДЕКОРАТИВНЫЕ ЦВЕТЫ НА ФОНЕ ========== */
.bg-flowers {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.flower {
  position: absolute;
  filter: drop-shadow(0 8px 14px rgba(0, 60, 80, 0.18));
  animation: flowerDrift 16s ease-in-out infinite;
  will-change: transform;
  user-select: none;
}

/* Разбросаны вокруг центральной карточки. Большие/яркие — крупно
   на углах, мелкие/полупрозрачные — для глубины. */
.fl-1 { top:  6%;  right: 14%; width: 110px; opacity: 0.85; --r:  -8deg; animation-delay:  0s; }
.fl-2 { top: 22%;  right:  4%; width:  80px; opacity: 0.75; --r:  12deg; animation-delay: -2s; }
.fl-3 { top: 48%;  right:  2%; width:  70px; opacity: 0.6;  --r:  -4deg; animation-delay: -4s; filter: drop-shadow(0 6px 10px rgba(0,60,80,0.15)) blur(0.5px); }
.fl-4 { top: 74%;  right: 18%; width:  90px; opacity: 0.8;  --r:  10deg; animation-delay: -6s; }
.fl-5 { top: 90%;  left:  46%; width:  72px; opacity: 0.7;  --r: -14deg; animation-delay: -8s; }
.fl-6 { top: 70%;  left:   5%; width:  95px; opacity: 0.8;  --r:   8deg; animation-delay: -3s; }
.fl-7 { top: 42%;  left:   3%; width:  68px; opacity: 0.6;  --r: -10deg; animation-delay: -5s; filter: drop-shadow(0 6px 10px rgba(0,60,80,0.15)) blur(0.5px); }
.fl-8 { top: 18%;  left:  18%; width:  85px; opacity: 0.75; --r:  14deg; animation-delay: -7s; }

@keyframes flowerDrift {
  0%, 100% { transform: translate(0, 0)        rotate(var(--r, 0deg)); }
  33%      { transform: translate(10px, -14px) rotate(calc(var(--r, 0deg) + 6deg)); }
  66%      { transform: translate(-8px, 10px)  rotate(calc(var(--r, 0deg) - 4deg)); }
}

/* На узких экранах прячем часть, чтоб не загромождало */
@media (max-width: 640px) {
  .fl-3, .fl-7 { display: none; }
  .flower { opacity: 0.55 !important; }
}

@media (max-width: 420px) {
  .fl-2, .fl-4, .fl-8 { display: none; }
}

/* ========== КОНФЕТТИ ========== */
#confettiCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
}

/* ========== ЦЕНТРАЛЬНАЯ КАРТОЧКА ========== */
.card {
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: 460px;
  min-height: 620px;
  max-height: calc(100dvh - 48px);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border-radius: 36px;
  box-shadow:
    0 30px 60px -20px rgba(0, 50, 70, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.7) inset,
    0 -20px 40px -30px rgba(255, 255, 255, 0.5) inset;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: cardIn 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes cardIn {
  0%   { opacity: 0; transform: translateY(40px) scale(0.92); }
  100% { opacity: 1; transform: translateY(0)    scale(1);    }
}

.card-inner {
  position: relative;
  flex: 1;
  padding: 32px 28px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.card-inner::-webkit-scrollbar { width: 0; }

/* ========== SHIMMER ПРИ СМЕНЕ ШАГА ========== */
.shimmer-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    transparent 30%,
    rgba(255, 255, 255, 0.55) 48%,
    rgba(255, 255, 255, 0.75) 50%,
    rgba(255, 255, 255, 0.55) 52%,
    transparent 70%
  );
  transform: translateX(-130%);
  pointer-events: none;
  z-index: 20;
  opacity: 0;
}

.card.transitioning .shimmer-overlay {
  animation: shimmerSweep 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes shimmerSweep {
  0%   { transform: translateX(-130%); opacity: 0;   }
  20%  {                                opacity: 1;   }
  80%  {                                opacity: 1;   }
  100% { transform: translateX(130%);  opacity: 0;   }
}

/* ========== ШАГИ ========== */
.step {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.step.step-active {
  display: flex;
  animation: stepIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

.step.step-leaving {
  display: flex;
  animation: stepOut 0.3s cubic-bezier(0.4, 0, 0.6, 1) forwards;
}

@keyframes stepIn {
  0%   { opacity: 0; transform: translateY(24px) scale(0.96); filter: blur(6px); }
  100% { opacity: 1; transform: translateY(0)    scale(1);    filter: blur(0);   }
}

@keyframes stepOut {
  0%   { opacity: 1; transform: translateY(0)     scale(1);    filter: blur(0);   }
  100% { opacity: 0; transform: translateY(-20px) scale(0.96); filter: blur(6px); }
}

/* ========== ТИПОГРАФИКА ========== */
.title {
  font-family: 'Caveat', cursive;
  font-size: 72px;
  font-weight: 700;
  color: #0d4f47;
  line-height: 0.95;
  margin-top: 8px;
  text-shadow: 0 4px 14px rgba(13, 79, 71, 0.15);
}

.subtitle {
  font-family: 'Unbounded', 'Comfortaa', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: #0f3a4d;
  text-align: center;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.step-title {
  font-family: 'Caveat', cursive;
  font-size: 46px;
  font-weight: 700;
  color: #0d4f47;
  text-align: center;
  line-height: 1;
  margin-top: 4px;
}

.muted {
  font-size: 13px;
  font-weight: 500;
  color: #0f3a4d;
  opacity: 0.65;
  text-align: center;
  letter-spacing: 0.01em;
}

.muted-mt {
  margin-top: 6px;
}

/* ========== КНОПКИ ========== */
.buttons-row {
  display: flex;
  gap: 16px;
  margin-top: auto;
  position: relative;
  min-height: 64px;
  align-items: center;
  justify-content: center;
  padding-top: 24px;
}

.btn {
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 700;
  padding: 16px 32px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.18s ease, box-shadow 0.2s ease, background 0.3s ease;
  user-select: none;
  -webkit-user-select: none;
  letter-spacing: -0.01em;
}

.btn .emo {
  font-size: 20px;
  line-height: 1;
}

.btn-yes {
  background: linear-gradient(135deg, #22c55e, #15803d);
  color: white;
  box-shadow:
    0 14px 28px -8px rgba(21, 128, 61, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.25) inset;
}

.btn-yes:hover {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 20px 36px -8px rgba(21, 128, 61, 0.65);
}

.btn-yes:active {
  transform: translateY(-1px) scale(1.02);
}

.btn-yes.grow {
  animation: yesGrow 1.2s ease-in-out infinite;
}

@keyframes yesGrow {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.1); }
}

.btn-no {
  background: rgba(255, 255, 255, 0.95);
  color: #0f3a4d;
  box-shadow:
    0 10px 20px -6px rgba(0, 50, 70, 0.2),
    0 0 0 2px rgba(34, 197, 94, 0.4) inset;
  transition: left 0.28s cubic-bezier(0.22, 1, 0.36, 1),
              top 0.28s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.18s ease,
              opacity 0.4s ease,
              background 0.2s ease;
}

.btn-no.runaway {
  position: fixed;
  z-index: 100;
}

.btn-next, .btn-send {
  margin-top: auto;
  margin-top: 18px;
  background: linear-gradient(135deg, #22c55e, #15803d);
  color: white;
  box-shadow:
    0 14px 28px -8px rgba(21, 128, 61, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.25) inset;
}

.btn-next:hover:not(:disabled),
.btn-send:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 20px 36px -8px rgba(21, 128, 61, 0.65);
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  filter: grayscale(20%);
}

.hint {
  font-size: 13px;
  color: #0f3a4d;
  opacity: 0.7;
  font-style: italic;
  text-align: center;
  min-height: 18px;
  transition: opacity 0.3s;
}

/* ========== КАЛЕНДАРЬ ========== */
.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  width: 100%;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 20px;
  padding: 12px 8px;
  box-shadow:
    0 6px 12px -4px rgba(0, 50, 70, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.7) inset;
}

.day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 2px;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  color: #0f3a4d;
  transition: all 0.2s ease;
}

.day-name {
  font-size: 10px;
  font-weight: 600;
  opacity: 0.55;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.day-num {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.day-month {
  font-size: 9px;
  opacity: 0.55;
  font-weight: 600;
  text-transform: uppercase;
}

.day:hover {
  background: rgba(34, 197, 94, 0.15);
  transform: translateY(-2px);
}

.day.selected {
  background: linear-gradient(135deg, #22c55e, #15803d);
  color: white;
  box-shadow: 0 8px 16px -4px rgba(21, 128, 61, 0.5);
  transform: translateY(-2px) scale(1.06);
}

.day.selected .day-name,
.day.selected .day-month {
  opacity: 0.95;
}

/* ========== СЛОТЫ ВРЕМЕНИ ========== */
.time-slots {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  width: 100%;
  transition: grid-template-columns 0.3s ease;
}

/* Когда слотов много (выходной) — плотная сетка */
.time-slots-dense {
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
}

.time-slots-dense .time-slot {
  padding: 10px 4px;
  font-size: 13px;
  border-radius: 12px;
}

@media (max-width: 480px) {
  .time-slots-dense { grid-template-columns: repeat(4, 1fr); gap: 4px; }
}

@media (max-width: 420px) {
  .time-slots { gap: 4px; }
  .time-slots-dense .time-slot { font-size: 12px; padding: 8px 2px; }
}

.time-slot {
  padding: 12px 4px;
  background: rgba(255, 255, 255, 0.7);
  border: 2px solid transparent;
  border-radius: 14px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #0f3a4d;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: -0.02em;
  box-shadow: 0 4px 8px -2px rgba(0, 50, 70, 0.1);
}

.time-slot:hover {
  background: rgba(34, 197, 94, 0.15);
  transform: translateY(-2px);
}

.time-slot.selected {
  background: linear-gradient(135deg, #22c55e, #15803d);
  color: white;
  box-shadow: 0 8px 16px -4px rgba(21, 128, 61, 0.5);
  transform: translateY(-2px) scale(1.06);
}

/* ========== АКТИВНОСТИ ========== */
.activities {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
}

.activity {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px;
  background: rgba(255, 255, 255, 0.75);
  border: 2px solid transparent;
  border-radius: 18px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  color: #0f3a4d;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 6px 12px -4px rgba(0, 50, 70, 0.15);
}

.activity-emo {
  font-size: 32px;
  line-height: 1;
  transition: transform 0.3s ease;
}

.activity-label {
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.activity:hover {
  background: rgba(34, 197, 94, 0.18);
  transform: translateY(-3px) scale(1.04);
}

.activity:hover .activity-emo {
  transform: scale(1.2) rotate(-8deg);
}

.activity.selected {
  background: linear-gradient(135deg, #22c55e, #15803d);
  color: white;
  box-shadow: 0 14px 24px -6px rgba(21, 128, 61, 0.55);
  transform: translateY(-3px) scale(1.06);
}

.activity.selected .activity-emo {
  animation: emoBounce 0.5s ease;
}

@keyframes emoBounce {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.45) rotate(-15deg); }
  100% { transform: scale(1)    rotate(0);     }
}

/* ========== ГИФКИ ВНУТРИ ШАГОВ ========== */
.step-gif {
  width: 96px;
  height: 96px;
  border-radius: 28px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(220, 252, 231, 0.7));
  box-shadow:
    0 12px 24px -8px rgba(0, 50, 70, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.9) inset,
    0 -4px 8px -4px rgba(34, 197, 94, 0.2) inset;
  position: relative;
  flex-shrink: 0;
  animation: gifBob 4s ease-in-out infinite;
}

.step-gif-sm {
  width: 72px;
  height: 72px;
  border-radius: 22px;
}

.step-gif-lg {
  width: 140px;
  height: 140px;
  border-radius: 36px;
  animation: gifBobBig 3s ease-in-out infinite;
}

@keyframes gifBob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-6px) rotate(-2deg); }
}

@keyframes gifBobBig {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50%      { transform: scale(1.06) rotate(-3deg); }
}

.step-gif img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

/* Плейсхолдер, если файла гифки нет */
.step-gif.no-gif img { display: none; }

.gif-fallback {
  font-size: 44px;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(13, 79, 71, 0.2));
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.step-gif-sm .gif-fallback { font-size: 32px; }
.step-gif-lg .gif-fallback { font-size: 72px; }

.gif-fallback .ae {
  width: 1em;
  height: 1em;
  vertical-align: middle;
}

/* ========== РЕЗЮМЕ ========== */
.summary-title {
  font-family: 'Caveat', cursive;
  font-size: 44px;
  font-weight: 700;
  color: #0d4f47;
  text-align: center;
  line-height: 1;
}

.summary-block {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-line {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(240, 253, 244, 0.9), rgba(220, 252, 231, 0.85));
  border-radius: 16px;
  border-left: 4px solid #22c55e;
}

.summary-label {
  font-size: 10px;
  font-weight: 700;
  color: #15803d;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.summary-value {
  font-size: 15px;
  font-weight: 600;
  color: #0d4f47;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.summary-foot {
  font-family: 'Caveat', cursive;
  font-size: 22px;
  color: #0f3a4d;
  text-align: center;
  line-height: 1.15;
  margin-top: 4px;
}

/* ========== ФИНАЛ ========== */
.final-title {
  font-family: 'Caveat', cursive;
  font-size: 64px;
  font-weight: 700;
  color: #0d4f47;
  line-height: 1;
  text-align: center;
}

.final-text {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: #0f3a4d;
  text-align: center;
  line-height: 1.55;
  font-weight: 500;
  max-width: 320px;
}

.caveat {
  font-family: 'Caveat', cursive;
  font-size: 26px;
  color: #15803d;
}

/* ========== ЭПЛОВСКИЕ ЭМОДЗИ (img подмена) ========== */
.ae {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.22em;
  object-fit: contain;
  pointer-events: none;
}

/* В кнопках/плитках сделать чуть крупнее */
.activity-emo .ae { width: 1em; height: 1em; vertical-align: middle; }
.step-gif.no-gif .ae { width: 1em; height: 1em; vertical-align: middle; }

/* ========== АДАПТИВ ========== */
@media (max-width: 440px) {
  body { padding: 16px; }
  .card { min-height: calc(100dvh - 32px); border-radius: 28px; }
  .card-inner { padding: 24px 20px; }
  .title { font-size: 60px; }
  .subtitle { font-size: 19px; }
  .step-title { font-size: 38px; }
  .summary-title { font-size: 36px; }
  .final-title { font-size: 56px; }
  .final-emo { font-size: 64px; }
  .activity-emo { font-size: 28px; }
  .activity-label { font-size: 10px; }
}

@media (max-height: 700px) {
  .card { min-height: auto; }
  .card-inner { padding: 22px 24px; }
  .title { font-size: 56px; margin-top: 0; }
  .step-title { font-size: 36px; }
  .summary-title { font-size: 32px; }
}
