:root {
  --pink: #ff6fa5;
  --pink-deep: #ff3d81;
  --purple: #7b5cff;
  --bg-1: #2a0a3d;
  --bg-2: #4a1259;
  --bg-3: #ff6fa5;
  --card-bg: rgba(255, 255, 255, 0.10);
  --card-border: rgba(255, 255, 255, 0.28);
  --text: #ffffff;
  --text-dim: rgba(255, 255, 255, 0.78);
}

:root[data-theme="cosmic"] {
  --pink: #7cc7ff;
  --pink-deep: #3d8bff;
  --purple: #6a5cff;
  --bg-1: #05070f;
  --bg-2: #0d1230;
  --bg-3: #1b2a6b;
}

:root[data-theme="sunset"] {
  --pink: #ffb15c;
  --pink-deep: #ff6a3d;
  --purple: #ff4d7a;
  --bg-1: #2a0a12;
  --bg-2: #5c1a1a;
  --bg-3: #ff7a45;
}

:root[data-theme="mint"] {
  --pink: #6fe3c0;
  --pink-deep: #2fb894;
  --purple: #4fd1c5;
  --bg-1: #05201c;
  --bg-2: #0c3a30;
  --bg-3: #3fae8f;
}

:root[data-theme="lavender"] {
  --pink: #c9a6ff;
  --pink-deep: #9d6bff;
  --purple: #7c5cff;
  --bg-1: #1a0f2e;
  --bg-2: #2e1a4d;
  --bg-3: #8f6fe0;
}

:root[data-theme="coral"] {
  --pink: #ff9d8a;
  --pink-deep: #ff6f5c;
  --purple: #ff7a9d;
  --bg-1: #2a0e12;
  --bg-2: #4d1f1f;
  --bg-3: #ff8a6b;
}

:root[data-theme="midnight"] {
  --pink: #8fa8ff;
  --pink-deep: #5c7cff;
  --purple: #4b5cc4;
  --bg-1: #02040f;
  --bg-2: #0a1030;
  --bg-3: #1a2456;
}

:root[data-theme="forest"] {
  --pink: #8ee6a8;
  --pink-deep: #4fbf74;
  --purple: #3fae8f;
  --bg-1: #06180f;
  --bg-2: #0e2b1c;
  --bg-3: #2f7a4f;
}

* { box-sizing: border-box; }

/* элементы с authored display (flex/inline-flex/...) иначе перебивают
   встроенное [hidden]{display:none} браузера */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, var(--bg-1), var(--bg-2) 45%, var(--bg-3));
  background-size: 300% 300%;
  animation: gradientShift 14s ease infinite;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

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

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

.stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.screen {
  display: none;
  width: 100%;
  justify-content: center;
}
.screen[data-active="true"] { display: flex; }

.card {
  width: 100%;
  max-width: 460px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  padding: 40px 32px;
  text-align: center;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  animation: cardIn 0.7s cubic-bezier(.2,.9,.25,1.15) both;
}

.card--wide { max-width: 520px; text-align: left; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  color: var(--text-dim);
  margin: 0 0 10px;
  text-align: center;
}

.title {
  font-size: clamp(24px, 6vw, 34px);
  line-height: 1.25;
  margin: 0 0 14px;
  text-align: center;
  text-shadow: 0 2px 20px rgba(0,0,0,0.25);
}

.title--sm { font-size: clamp(20px, 5vw, 26px); }

.subtitle {
  color: var(--text-dim);
  font-size: 15px;
  margin: 0 0 28px;
  text-align: center;
}

.buttons {
  position: relative;
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  min-height: 140px;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 16px 30px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  font-family: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn--yes {
  background: linear-gradient(135deg, var(--pink), var(--pink-deep));
  box-shadow: 0 10px 30px rgba(255, 61, 129, 0.45);
  animation: pulse 1.8s ease-in-out infinite;
}
.btn--yes:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 14px 36px rgba(255, 61, 129, 0.55); }
.btn--yes:active { transform: scale(0.97); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 10px 30px rgba(255, 61, 129, 0.45); }
  50% { box-shadow: 0 10px 40px rgba(255, 61, 129, 0.75); }
}

.btn--no {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: absolute;
  will-change: transform;
  transition: transform 0.18s cubic-bezier(.2,.9,.25,1.2);
}

.btn--submit { width: 100%; margin-top: 22px; animation: none; }

.hint {
  min-height: 22px;
  margin: 18px 0 0;
  font-size: 14px;
  color: var(--text-dim);
  text-align: center;
  transition: opacity 0.2s ease;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin: 18px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.field-label:first-of-type { margin-top: 0; }

.textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.10);
  color: var(--text);
  padding: 14px 16px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
}
.textarea::placeholder { color: rgba(255,255,255,0.5); }
.textarea:focus { border-color: var(--pink); background: rgba(255, 255, 255, 0.14); }

.slots-block { margin-top: 6px; }

.slots-status {
  font-size: 14px;
  color: var(--text-dim);
  padding: 6px 0;
}

.slots-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.slot-chip {
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.10);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  line-height: 1.4;
  transition: all 0.15s ease;
}
.slot-chip:hover { background: rgba(255, 255, 255, 0.18); transform: translateY(-1px); }
.slot-chip.selected {
  background: linear-gradient(135deg, var(--pink), var(--pink-deep));
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(255, 61, 129, 0.45);
}
.slot-chip .slot-date { font-weight: 700; display: block; }
.slot-chip .slot-label { color: var(--text-dim); font-size: 12px; }
.slot-chip.selected .slot-label { color: rgba(255,255,255,0.9); }

.done-emoji {
  font-size: 56px;
  margin-bottom: 8px;
  animation: floatEmoji 2.4s ease-in-out infinite;
}
@keyframes floatEmoji {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

#photos-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating-photo {
  position: absolute;
  padding: 8px 8px 22px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: scale(0.85) rotate(var(--rot, -4deg));
  animation:
    photoAppear 1.4s cubic-bezier(.2,.9,.25,1.1) forwards,
    photoDrift 10s ease-in-out infinite;
  animation-delay: var(--delay, 0s), var(--delay, 0s);
}

.floating-photo img {
  display: block;
  width: var(--size, 140px);
  height: var(--size, 140px);
  object-fit: cover;
  border-radius: 2px;
}

@keyframes photoAppear {
  from { opacity: 0; transform: scale(0.8) rotate(var(--rot, -4deg)) translateY(20px); }
  to { opacity: var(--max-opacity, 0.55); transform: scale(1) rotate(var(--rot, -4deg)) translateY(0); }
}

@keyframes photoDrift {
  0%, 100% { margin-top: 0px; }
  50% { margin-top: -18px; }
}

#hearts-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.floating-heart {
  position: absolute;
  bottom: -40px;
  font-size: 20px;
  opacity: 0.9;
  animation: riseHeart linear forwards;
}
@keyframes riseHeart {
  to { transform: translateY(-110vh) rotate(20deg); opacity: 0; }
}

@media (max-width: 480px) {
  .card { padding: 32px 22px; border-radius: 22px; }
  .buttons { min-height: 170px; }
}

/* ---------- Подарок ---------- */

.gift-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  animation: giftPulse 2s ease-in-out infinite;
}
.gift-badge:hover { background: rgba(255, 255, 255, 0.2); }

@keyframes giftPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 111, 165, 0.5); }
  50% { box-shadow: 0 0 0 10px rgba(255, 111, 165, 0); }
}

.gift-modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.gift-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 4, 20, 0.72);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.25s ease both;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.gift-modal__card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 36px 28px;
  text-align: center;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  animation: cardIn 0.4s cubic-bezier(.2,.9,.25,1.15) both;
}

.gift-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
}
.gift-modal__close:hover { background: rgba(255, 255, 255, 0.22); }

.gift-modal__icon {
  font-size: 46px;
  margin-bottom: 6px;
  animation: floatEmoji 2.4s ease-in-out infinite;
}

.gift-modal__text {
  color: var(--text-dim);
  font-size: 15px;
  margin: 0 0 18px;
}

.gift-modal__input {
  width: 100%;
  min-height: auto;
  text-align: center;
  font-size: 16px;
  margin-bottom: 14px;
}

.gift-modal__error {
  min-height: 20px;
  margin: 14px 0 0;
  font-size: 13px;
  color: #ff9d9d;
}

.gift-modal__error.shake {
  animation: shake 0.4s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.gift-modal__photo {
  width: 100%;
  border-radius: 14px;
  margin-bottom: 16px;
  display: block;
}
