:root {
  --rose: #e8a0b4;
  --rose-deep: #c45c7a;
  --blush: #fce4ec;
  --night: #1a0f14;
  --night-soft: #2d1a22;
  --gold: #f4d58d;
  --cream: #fff8f5;
  --glow: rgba(232, 160, 180, 0.45);
  --font-display: "Marck Script", cursive;
  --font-body: "Cormorant Garamond", Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--cream);
  background: radial-gradient(ellipse at 20% 0%, #3d1f2e 0%, var(--night) 45%, #0d0609 100%);
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* ── Фон ── */
.stars {
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 30% 65%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1.5px 1.5px at 55% 15%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 70% 45%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 85% 75%, rgba(255,255,255,0.55), transparent),
    radial-gradient(1.5px 1.5px at 92% 30%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 45% 88%, rgba(255,255,255,0.45), transparent);
  animation: twinkle 6s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

@keyframes twinkle {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

.hearts-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 80% 90%, var(--glow) 0%, transparent 35%),
    radial-gradient(circle at 15% 80%, rgba(244, 213, 141, 0.12) 0%, transparent 30%);
  pointer-events: none;
  z-index: 0;
}

/* ── Музыка ── */
.music-widget {
  position: fixed;
  top: 1.2rem;
  right: 1.2rem;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.music-hint {
  font-size: 0.78rem;
  font-style: italic;
  color: rgba(255, 248, 245, 0.65);
  text-align: right;
  line-height: 1.3;
  max-width: 7.5rem;
  margin: 0;
  animation: hint-glow 2.5s ease-in-out infinite;
}

@keyframes hint-glow {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}

.music-arrow {
  display: block;
  width: 2rem;
  height: 1rem;
  flex-shrink: 0;
  position: relative;
  animation: arrow-nudge 1.8s ease-in-out infinite;
}

.music-arrow::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0.45rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--rose));
  transform: translateY(-50%);
}

.music-arrow::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  width: 0.45rem;
  height: 0.45rem;
  border-top: 1.5px solid var(--rose);
  border-right: 1.5px solid var(--rose);
  transform: translateY(-50%) rotate(45deg);
}

@keyframes arrow-nudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

.music-toggle {
  position: relative;
  top: auto;
  right: auto;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(45, 26, 34, 0.75);
  backdrop-filter: blur(8px);
  color: var(--rose);
  font-size: 1.3rem;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.music-toggle:hover {
  transform: scale(1.08);
  border-color: var(--rose);
  box-shadow: 0 0 20px var(--glow);
}

.music-toggle.playing .music-icon {
  animation: pulse-music 1.2s ease-in-out infinite;
}

@keyframes pulse-music {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* ── Контейнер ── */
.container {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem 4rem;
}

.screen {
  display: none;
  width: 100%;
  max-width: 34rem;
  text-align: center;
  animation: fadeUp 0.9s ease both;
}

.screen.active {
  display: block;
}

/* ── Приветствие для дизайнера ── */
.designer-card {
  text-align: left;
  background: rgba(45, 26, 34, 0.7);
  border: 1px solid rgba(232, 160, 180, 0.3);
  border-radius: 1rem;
  padding: 1.75rem 1.5rem 1.5rem;
  backdrop-filter: blur(14px);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
}

.designer-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--rose-deep), var(--gold), var(--rose));
}

.designer-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.designer-badge {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  background: rgba(244, 213, 141, 0.1);
  border: 1px solid rgba(244, 213, 141, 0.25);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

.designer-tag {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 248, 245, 0.4);
}

.designer-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  font-weight: 400;
  color: var(--cream);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.designer-text {
  font-size: 1.05rem;
  color: rgba(255, 248, 245, 0.82);
  white-space: pre-line;
  line-height: 1.65;
  margin-bottom: 1rem;
}

.designer-footer {
  font-size: 0.72rem;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  color: rgba(255, 248, 245, 0.35);
  margin-bottom: 1.5rem;
  letter-spacing: 0.02em;
}

.screen-welcome .btn-primary {
  width: 100%;
}

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

.eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rose);
  margin-bottom: 1rem;
  opacity: 0.85;
}

.title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 10vw, 4.2rem);
  font-weight: 400;
  line-height: 1.15;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--cream), var(--rose));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 1.15rem;
  color: rgba(255, 248, 245, 0.82);
  white-space: pre-line;
  margin-bottom: 2rem;
}

.hint {
  margin-top: 2rem;
  font-size: 0.8rem;
  font-style: italic;
  color: rgba(255, 248, 245, 0.35);
}

/* ── Карточки ── */
.card {
  background: rgba(45, 26, 34, 0.55);
  border: 1px solid rgba(232, 160, 180, 0.25);
  border-radius: 1.5rem;
  padding: 2.5rem 2rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.card-glow {
  position: relative;
  overflow: hidden;
}

.card-glow::before {
  content: "";
  position: absolute;
  inset: -50%;
  background: conic-gradient(from 0deg, transparent, var(--glow), transparent 30%);
  animation: rotate-glow 8s linear infinite;
  opacity: 0.4;
}

.card-glow > * {
  position: relative;
  z-index: 1;
}

@keyframes rotate-glow {
  to { transform: rotate(360deg); }
}

.sparkle {
  display: block;
  font-size: 1.5rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
  animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

.question-text {
  font-size: 1.25rem;
  white-space: pre-line;
  margin-bottom: 2rem;
  line-height: 1.7;
}

/* ── Письмо (экран признания) ── */
.screen-question .card-letter {
  text-align: left;
  max-width: 36rem;
}

.letter-label {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rose);
  opacity: 0.75;
  margin-bottom: 1.25rem;
}

.letter-scroll-wrap {
  position: relative;
  margin-bottom: 1.75rem;
}

.question-letter {
  max-height: min(52vh, 24rem);
  overflow-y: auto;
  padding-right: 0.6rem;
  margin-bottom: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 160, 180, 0.35) transparent;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.letter-scroll-hint {
  position: absolute;
  left: 0;
  right: 0.6rem;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 2.5rem 0 0.65rem;
  border: none;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(45, 26, 34, 0.55) 35%,
    rgba(45, 26, 34, 0.95) 100%
  );
  color: rgba(255, 248, 245, 0.55);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-style: italic;
  letter-spacing: 0.08em;
  cursor: pointer;
  z-index: 2;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.letter-scroll-hint.is-hidden {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}

.letter-scroll-hint__arrow {
  display: block;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 1.5px solid var(--rose);
  border-bottom: 1.5px solid var(--rose);
  transform: rotate(45deg);
  animation: scroll-hint-bounce 1.6s ease-in-out infinite;
}

@keyframes scroll-hint-bounce {
  0%, 100% { transform: rotate(45deg) translateY(0); opacity: 0.5; }
  50% { transform: rotate(45deg) translateY(5px); opacity: 1; }
}

.question-letter::-webkit-scrollbar {
  width: 4px;
}

.question-letter::-webkit-scrollbar-thumb {
  background: rgba(232, 160, 180, 0.35);
  border-radius: 4px;
}

.question-letter p {
  font-size: 1.08rem;
  line-height: 1.75;
  color: rgba(255, 248, 245, 0.88);
  text-wrap: pretty;
  opacity: 0;
  transform: translateY(14px);
}

.question-letter p + p {
  margin-top: 1.1rem;
}

.question-letter p:first-child::first-letter {
  font-family: var(--font-display);
  font-size: 2.1rem;
  line-height: 1;
  float: left;
  margin: 0.08rem 0.45rem 0 0;
  color: var(--rose);
}

.question-letter p:nth-last-child(2) {
  color: rgba(255, 248, 245, 0.92);
}

.question-letter p:last-child {
  font-style: italic;
  color: var(--gold);
  padding-top: 0.85rem;
  border-top: 1px solid rgba(232, 160, 180, 0.18);
  margin-top: 1.25rem;
}

.question-letter.is-visible p {
  animation: letter-line-in 0.75s ease forwards;
  animation-delay: calc(0.15s + var(--i, 0) * 0.4s);
}

@keyframes letter-line-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.date-details {
  font-size: 1.1rem;
  white-space: pre-line;
  margin: 1rem 0 1.25rem;
  color: var(--gold);
}

.date-message {
  font-size: 1rem;
  color: rgba(255, 248, 245, 0.8);
  margin-bottom: 1.75rem;
}

/* ── Экран «дальше» ── */
.screen-date .card-offer {
  max-width: 36rem;
  text-align: left;
}

.date-letter {
  max-height: min(48vh, 22rem);
  overflow-y: auto;
  padding-right: 0.6rem;
  margin-bottom: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 160, 180, 0.35) transparent;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.date-letter::-webkit-scrollbar {
  width: 4px;
}

.date-letter::-webkit-scrollbar-thumb {
  background: rgba(232, 160, 180, 0.35);
  border-radius: 4px;
}

.date-letter .date-para {
  font-size: 1.08rem;
  line-height: 1.75;
  color: rgba(255, 248, 245, 0.9);
  text-wrap: pretty;
  opacity: 0;
  transform: translateY(14px);
}

.date-letter .date-para + .date-para {
  margin-top: 1rem;
}

.date-letter .date-para:first-child::first-letter {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
  float: left;
  margin: 0.08rem 0.4rem 0 0;
  color: var(--rose);
}

.date-quote {
  margin: 1.5rem 0 0;
  padding: 1.15rem 0 0 1.1rem;
  border: none;
  border-left: 2px solid rgba(244, 213, 141, 0.45);
  border-top: 1px solid rgba(232, 160, 180, 0.15);
}

.date-quote p {
  font-size: 1rem;
  line-height: 1.7;
  font-style: italic;
  color: var(--gold);
  text-wrap: pretty;
  opacity: 0;
  transform: translateY(14px);
}

.date-quote p + p {
  margin-top: 0.85rem;
}

.date-letter.is-visible .date-para,
.date-letter.is-visible .date-quote p {
  animation: letter-line-in 0.75s ease forwards;
  animation-delay: calc(0.15s + var(--i, 0) * 0.35s);
}

.screen-date .letter-scroll-wrap {
  margin-bottom: 1.5rem;
}

.btn-row-stack {
  flex-direction: column;
  align-items: stretch;
  min-height: auto;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.btn-decline {
  background: transparent;
  color: rgba(255, 248, 245, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.7rem 1.5rem;
  font-size: 0.95rem;
}

.btn-decline:hover {
  color: rgba(255, 248, 245, 0.7);
  border-color: rgba(255, 255, 255, 0.25);
  transform: none;
}

.screen-decline .card {
  max-width: 30rem;
  text-align: center;
}

.screen-decline h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 7vw, 2.6rem);
  color: var(--rose);
  margin-bottom: 1rem;
}

.decline-message {
  font-size: 1.1rem;
  line-height: 1.7;
  color: rgba(255, 248, 245, 0.82);
}

/* ── Кнопки ── */
.btn {
  font-family: var(--font-body);
  font-size: 1.05rem;
  padding: 0.85rem 2rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--rose-deep), var(--rose));
  color: var(--cream);
  box-shadow: 0 8px 30px rgba(196, 92, 122, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(196, 92, 122, 0.55);
}

.btn-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  min-height: 3.5rem;
}

.btn-yes {
  background: linear-gradient(135deg, #7cb87c, #5a9a5a);
  color: white;
  box-shadow: 0 8px 25px rgba(90, 154, 90, 0.35);
}

.btn-yes:hover {
  transform: translateY(-2px) scale(1.03);
}

.btn-no {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 248, 245, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  position: relative;
  transition: left 0.35s ease, top 0.35s ease, transform 0.25s;
}

/* ── Финал ── */
.screen-final h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 3rem);
  margin-bottom: 1rem;
  color: var(--rose);
}

.screen-final p {
  font-size: 1.1rem;
  color: rgba(255, 248, 245, 0.85);
  max-width: 28rem;
  margin: 0 auto 1rem;
}

.final-heart {
  font-size: 4rem;
  color: var(--rose-deep);
  animation: heartbeat 1.2s ease-in-out infinite;
  margin-bottom: 1rem;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.15); }
  30% { transform: scale(1); }
  45% { transform: scale(1.1); }
}

.final-secret {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: 1rem;
  background: rgba(244, 213, 141, 0.12);
  border: 1px dashed var(--gold);
  color: var(--gold);
  font-style: italic;
}

/* ── Пасхалки ── */
.easter-egg {
  position: fixed;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle, rgba(232, 160, 180, 0.35) 0%, transparent 70%);
  cursor: pointer;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.4s, transform 0.3s, box-shadow 0.3s;
}

.easter-egg:hover,
.easter-egg:focus-visible {
  opacity: 1;
  box-shadow: 0 0 20px var(--glow);
  transform: scale(1.2);
  outline: none;
}

.easter-egg.found {
  opacity: 0 !important;
  pointer-events: none;
  transform: scale(0);
}

#egg-1 { top: 12%; left: 8%; }
#egg-2 { top: 28%; right: 6%; }
#egg-3 { bottom: 35%; left: 5%; }
#egg-4 { top: 55%; right: 12%; }
#egg-5 { bottom: 12%; right: 20%; }

.egg-counter {
  position: fixed;
  bottom: 1.2rem;
  left: 1.2rem;
  z-index: 100;
  font-size: 0.8rem;
  color: rgba(255, 248, 245, 0.45);
  letter-spacing: 0.05em;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 200;
  max-width: 22rem;
  padding: 0.9rem 1.4rem;
  border-radius: 1rem;
  background: rgba(45, 26, 34, 0.92);
  border: 1px solid rgba(232, 160, 180, 0.35);
  color: var(--cream);
  font-size: 0.95rem;
  text-align: center;
  backdrop-filter: blur(10px);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ── Плавающие сердечки ── */
.floating-note {
  position: fixed;
  font-size: 1.5rem;
  pointer-events: none;
  z-index: 150;
  animation: float-up 2.5s ease-out forwards;
}

@keyframes float-up {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-120px) scale(1.4);
  }
}

/* ── Конфетти ── */
.confetti {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 300;
  animation: confetti-fall 2.5s ease-out forwards;
}

@keyframes confetti-fall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(100vh) rotate(720deg);
  }
}

/* ── Адаптив ── */
@media (max-width: 768px) {
  .container {
    padding: 5rem 1rem 2.5rem;
    align-items: flex-start;
  }

  .screen {
    max-width: 100%;
  }

  .title {
    font-size: clamp(2.4rem, 12vw, 3.2rem);
  }

  .designer-card,
  .screen-question .card-letter,
  .screen-date .card-offer {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  html { font-size: 16px; }

  .container {
    padding: 4.75rem 0.85rem 1.75rem;
    min-height: 100dvh;
  }

  .music-widget {
    top: max(0.6rem, env(safe-area-inset-top, 0.6rem));
    right: max(0.6rem, env(safe-area-inset-right, 0.6rem));
    gap: 0.3rem;
    max-width: calc(100vw - 1.2rem);
  }

  .music-hint {
    font-size: 0.62rem;
    max-width: 4.8rem;
    line-height: 1.25;
  }

  .music-arrow {
    width: 1rem;
  }

  .music-toggle {
    width: 2.75rem;
    height: 2.75rem;
    flex-shrink: 0;
  }

  .question-letter,
  .date-letter {
    max-height: min(36dvh, 17rem);
    padding-right: 0.25rem;
  }

  .question-letter p,
  .date-letter .date-para,
  .date-quote p {
    font-size: 0.98rem;
    line-height: 1.65;
  }

  .question-letter p:first-child::first-letter,
  .date-letter .date-para:first-child::first-letter {
    font-size: 1.75rem;
  }

  .card {
    padding: 1.5rem 1.1rem;
    border-radius: 1.15rem;
  }

  .designer-title {
    font-size: clamp(1.6rem, 8vw, 2rem);
  }

  .designer-text,
  .subtitle {
    font-size: 1rem;
  }

  .btn {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.8rem 1.25rem;
    font-size: 1rem;
  }

  .btn-row {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    min-height: auto;
    gap: 0.65rem;
  }

  .btn-no {
    position: static !important;
  }

  .btn-row-stack {
    gap: 0.65rem;
  }

  .egg-counter {
    bottom: max(0.75rem, env(safe-area-inset-bottom, 0.75rem));
    left: max(0.75rem, env(safe-area-inset-left, 0.75rem));
    font-size: 0.72rem;
  }

  .toast {
    bottom: max(1.25rem, env(safe-area-inset-bottom, 1.25rem));
    max-width: calc(100vw - 2rem);
    font-size: 0.9rem;
  }

  .easter-egg {
    width: 2.75rem;
    height: 2.75rem;
  }
}

/* Пасхалки на тач-устройствах: слегка видны без hover */
@media (hover: none) and (pointer: coarse) {
  .easter-egg {
    opacity: 0.22;
  }

  .easter-egg:active {
    opacity: 1;
    transform: scale(1.15);
  }

  .music-toggle:active {
    transform: scale(1.05);
  }
}
