/* ═══════════════ БАЗА ═══════════════ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --pink-1: #ffe3ec;
  --pink-2: #ffd0dd;
  --peach:  #ffe8d6;
  --rose:   #ff7aa2;
  --rose-deep: #e05780;
  --text:   #6b3a4b;
  --text-soft: #9c6b7c;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Montserrat', sans-serif;
  color: var(--text);
  background: linear-gradient(160deg, #fff5f8 0%, #ffe3ec 40%, #ffe8d6 100%);
  overflow-x: hidden;
}

.hidden { display: none !important; }

/* ═══════════════ ЭКРАН ВХОДА ═══════════════ */
#lock-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #ffd0dd 0%, #ffb3c8 50%, #ffc9a8 100%);
  padding: 20px;
}

.lock-card {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  padding: 48px 36px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(224, 87, 128, 0.25);
  animation: cardIn 0.8s ease;
}

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

.lock-heart {
  font-size: 64px;
  animation: beat 1.4s ease-in-out infinite;
  display: inline-block;
}

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

.lock-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 34px;
  font-weight: 600;
  margin: 12px 0 28px;
  color: var(--rose-deep);
}

.lock-sub {
  font-size: 14px;
  color: var(--text-soft);
  margin-bottom: 28px;
}

#login-form { display: flex; flex-direction: column; gap: 16px; }

.field { display: flex; flex-direction: column; gap: 7px; }

.hint {
  font-size: 12px;
  color: var(--text-soft);
  text-align: left;
  padding-left: 4px;
}
.spoiler {
  display: inline-block;
  background: linear-gradient(135deg, var(--rose), var(--rose-deep));
  color: transparent;
  border-radius: 6px;
  padding: 1px 10px;
  cursor: pointer;
  user-select: none;
  transition: background 0.4s ease, color 0.4s ease;
  box-shadow: inset 0 0 6px rgba(0,0,0,0.08);
  position: relative;
}
.spoiler.revealed {
  background: rgba(255, 122, 162, 0.16);
  color: var(--rose-deep);
  font-weight: 500;
  box-shadow: none;
  cursor: default;
}

#login-form input {
  padding: 15px 18px;
  border: 1px solid rgba(224, 87, 128, 0.25);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  transition: 0.25s;
  outline: none;
}

#login-form input:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 4px rgba(255, 122, 162, 0.18);
}

#login-form button {
  margin-top: 6px;
  padding: 15px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--rose) 0%, var(--rose-deep) 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: 0.25s;
  box-shadow: 0 8px 24px rgba(224, 87, 128, 0.35);
}

#login-form button:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(224, 87, 128, 0.45); }
#login-form button:active { transform: translateY(0); }

.login-error {
  color: var(--rose-deep);
  font-size: 13px;
  min-height: 18px;
  margin-top: 4px;
}

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

/* ═══════════════ ФОН С СЕРДЕЧКАМИ ═══════════════ */
.hearts-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating-heart {
  position: absolute;
  bottom: -40px;
  color: var(--rose);
  opacity: 0.5;
  animation: floatUp linear infinite;
  user-select: none;
}

@keyframes floatUp {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.5; }
  100% { transform: translateY(-105vh) rotate(360deg); opacity: 0; }
}

/* ═══════════════ ЭКРАНЫ ═══════════════ */
.screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
}

/* ─── Голосовое сообщение ─── */
.voice-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 26px;
  padding: 40px 34px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 18px 50px rgba(224, 87, 128, 0.22);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.voice-play {
  width: 74px; height: 74px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose) 0%, var(--rose-deep) 100%);
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(224, 87, 128, 0.4);
  transition: 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.voice-play:hover { transform: scale(1.08); }
.voice-play .voice-icon { margin-left: 3px; }
.voice-play.playing .voice-icon { margin-left: 0; }

.voice-wave {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  margin: 14px 0 6px;
}
.voice-wave span {
  width: 4px;
  height: 8px;
  border-radius: 4px;
  background: var(--rose);
  opacity: 0.55;
}
.voice-wave.animating span { animation: wave 1s ease-in-out infinite; }
.voice-wave.animating span:nth-child(1) { animation-delay: 0s; }
.voice-wave.animating span:nth-child(2) { animation-delay: 0.1s; }
.voice-wave.animating span:nth-child(3) { animation-delay: 0.2s; }
.voice-wave.animating span:nth-child(4) { animation-delay: 0.3s; }
.voice-wave.animating span:nth-child(5) { animation-delay: 0.4s; }
.voice-wave.animating span:nth-child(6) { animation-delay: 0.5s; }
.voice-wave.animating span:nth-child(7) { animation-delay: 0.4s; }
.voice-wave.animating span:nth-child(8) { animation-delay: 0.3s; }
.voice-wave.animating span:nth-child(9) { animation-delay: 0.2s; }
.voice-wave.animating span:nth-child(10) { animation-delay: 0.1s; }
@keyframes wave {
  0%, 100% { height: 8px; opacity: 0.5; }
  50%      { height: 30px; opacity: 1; }
}

.voice-caption {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(20px, 3.4vw, 26px);
  color: var(--rose-deep);
  text-align: center;
}
.voice-subcaption {
  font-family: 'Marck Script', cursive;
  font-size: clamp(18px, 3vw, 22px);
  color: var(--rose);
  text-align: center;
}

/* ─── Приветствие ─── */
.pre-title {
  font-size: 16px;
  color: var(--text-soft);
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.hero-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(32px, 6vw, 58px);
  font-weight: 600;
  line-height: 1.2;
  color: var(--rose-deep);
  max-width: 800px;
}

.hero-name {
  font-family: 'Marck Script', cursive;
  font-size: clamp(24px, 4vw, 36px);
  color: var(--rose);
  margin-top: 20px;
}

.scroll-hint {
  margin-top: 60px;
  font-size: 14px;
  color: var(--text-soft);
  animation: bounce 2s infinite;
}
@keyframes bounce { 0%,100%{transform:translateY(0);} 50%{transform:translateY(10px);} }

/* ─── Заглавные фразы ─── */
.phrases { gap: 40px; }
.phrase {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(26px, 5vw, 46px);
  font-weight: 500;
  color: var(--rose-deep);
  max-width: 760px;
  line-height: 1.3;
}

/* ─── Заголовки секций ─── */
.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 600;
  color: var(--rose-deep);
  margin-bottom: 48px;
}

/* ─── Галерея ─── */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 920px;
  width: 100%;
}
@media (max-width: 760px) {
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}
@media (max-width: 460px) {
  .gallery { grid-template-columns: 1fr; }
}

.photo-card {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 12px 34px rgba(224, 87, 128, 0.18);
  transition: 0.35s;
}
.photo-card:hover { transform: translateY(-8px) rotate(-1deg); box-shadow: 0 18px 44px rgba(224, 87, 128, 0.3); }

.photo-card img,
.photo-placeholder {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
}

.photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 54px;
  background: linear-gradient(135deg, var(--pink-2), var(--peach));
  color: var(--rose);
}

.photo-caption {
  padding: 14px 16px;
  font-family: 'Marck Script', cursive;
  font-size: 20px;
  color: var(--rose-deep);
  text-align: center;
}

/* ─── Стих ─── */
.poem-section { position: relative; overflow: hidden; }

.poem-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(1.5px) saturate(1);
  transform: scale(1.08);
  opacity: 0;
  transition: opacity 2s ease;
  z-index: 0;
}
.poem-bg.loaded { opacity: 0.62; }

/* Вуаль поверх фото — чтобы стих читался, и края таяли в фон */
.poem-veil {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse at center, rgba(255,245,248,0.05) 0%, rgba(255,227,236,0.4) 60%, rgba(255,232,214,0.85) 100%),
    linear-gradient(180deg, rgba(255,245,248,0.75) 0%, rgba(255,245,248,0.15) 22%, rgba(255,245,248,0.15) 78%, rgba(255,232,214,0.85) 100%);
}

.poem-section .section-title,
.poem-section .poem { position: relative; z-index: 1; }
.poem-section .section-title { text-shadow: 0 1px 12px rgba(255, 245, 248, 0.9); }
.poem-section .poem {
  text-shadow: 0 1px 10px rgba(255, 245, 248, 0.95), 0 0 3px rgba(255, 245, 248, 0.9);
}

.poem {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(20px, 3.4vw, 30px);
  font-style: italic;
  line-height: 1.9;
  color: var(--text);
  max-width: 680px;
}
.poem .poem-line { display: block; }
.poem .poem-space { height: 22px; }

/* ─── За что я тебя люблю ─── */
.love-inner {
  display: flex;
  align-items: center;
  gap: 48px;
  max-width: 900px;
  width: 100%;
  text-align: left;
}

.love-photo {
  flex: 0 0 auto;
  margin: 0;
  background: #fff;
  padding: 12px 12px 0;
  border-radius: 8px;
  box-shadow: 0 18px 46px rgba(224, 87, 128, 0.28);
  transform: rotate(-3deg);
  transition: 0.4s;
}
.love-photo:hover { transform: rotate(0deg) scale(1.02); }
.love-photo img {
  display: block;
  width: 280px;
  height: 350px;
  object-fit: cover;
  border-radius: 4px;
}
.love-photo figcaption {
  font-family: 'Marck Script', cursive;
  font-size: 22px;
  color: var(--rose-deep);
  text-align: center;
  padding: 12px 6px 14px;
}

.love-text {
  flex: 1 1 auto;
  font-size: clamp(16px, 2.3vw, 20px);
  font-weight: 300;
  line-height: 1.9;
  color: var(--text);
}

@media (max-width: 760px) {
  .love-inner { flex-direction: column; gap: 28px; text-align: center; }
  .love-photo { transform: rotate(-2deg); }
  .love-photo img { width: 230px; height: 288px; }
  .love-text { text-align: center; }
}

/* ─── Финальные слова ─── */
.final-section {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(255,208,221,0.5), rgba(255,232,214,0.5));
}

/* Твоё фото фоном за финалом */
.final-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(2px) saturate(0.95);
  transform: scale(1.08);
  opacity: 0;
  transition: opacity 2s ease;
  z-index: 0;
}
.final-bg.loaded { opacity: 0.5; }

.final-veil {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse at center, rgba(255,245,248,0.15) 0%, rgba(255,227,236,0.55) 60%, rgba(255,232,214,0.9) 100%),
    linear-gradient(180deg, rgba(255,245,248,0.85) 0%, rgba(255,245,248,0.3) 25%, rgba(255,245,248,0.3) 75%, rgba(255,232,214,0.9) 100%);
}

.final-section .final-words,
.final-section .signature { position: relative; z-index: 1; }

.final-words {
  max-width: 620px;
  font-size: clamp(16px, 2.4vw, 20px);
  font-weight: 300;
  line-height: 1.9;
  color: var(--text);
  text-shadow: 0 1px 10px rgba(255, 245, 248, 0.95), 0 0 3px rgba(255, 245, 248, 0.9);
}
.final-words p {
  margin-bottom: 22px;
  text-align: left;
}
.final-words p:last-child {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 600;
  color: var(--rose-deep);
  text-align: center;
  margin-top: 24px;
  line-height: 1.3;
}

.signature {
  margin-top: 50px;
  font-family: 'Marck Script', cursive;
  font-size: clamp(26px, 4vw, 40px);
  color: var(--rose);
}

/* ─── Признание ошибки (драматичный экран) ─── */
.regret-section {
  background: linear-gradient(160deg, #4a2733 0%, #6b3a4b 55%, #7d4459 100%);
}
.regret-inner { max-width: 760px; }
.regret-line1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(24px, 4.6vw, 42px);
  font-weight: 500;
  line-height: 1.35;
  color: #ffd7e2;
}
.regret-line2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(28px, 5.4vw, 52px);
  font-weight: 600;
  line-height: 1.35;
  color: #fff;
  margin-top: 14px;
  text-shadow: 0 2px 30px rgba(255, 122, 162, 0.5);
}

/* ═══════════════ АНИМАЦИЯ ПОЯВЛЕНИЯ ═══════════════ */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s ease, transform 1s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ═══════════════ МОБИЛЬНЫЕ ═══════════════ */
@media (max-width: 600px) {
  .lock-card { padding: 40px 24px; }
  .screen { padding: 60px 20px; }
}
