* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }

body {
  font-family:'Montserrat',sans-serif;
  background: linear-gradient(135deg,#ffd6e0 0%,#e6d7ff 50%,#d4e8ff 100%);
  background-size:200% 200%;
  animation: bg 15s ease infinite;
  min-height:100vh;
  color:#5a4a5c;
  overflow-x:hidden;
  position:relative;
  cursor: none;
}
@media (max-width: 768px) { body { cursor: auto; } }
@keyframes bg { 0%,100%{background-position:0% 50%} 50%{background-position:100% 50%} }

#loader {
  position:fixed; inset:0;
  background: linear-gradient(135deg,#ffd6e0,#e6d7ff);
  z-index:99999;
  display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  transition: opacity 0.8s ease, visibility 0.8s;
  padding:20px;
}
#loader.hidden { opacity:0; visibility:hidden; }
.loader-heart {
  font-size:4rem;
  animation: heartbeat 1s ease-in-out infinite;
  margin-bottom:20px;
}
@keyframes heartbeat {
  0%,100%{ transform:scale(1); } 25%{ transform:scale(1.15); }
  50%{ transform:scale(1); } 75%{ transform:scale(1.1); }
}
.loader-text {
  font-family:'Great Vibes',cursive;
  font-size:2rem;
  color:#d97793;
  margin-bottom:22px;
  text-align:center;
}
.loader-bar {
  width:min(320px, 80vw);
  height:8px;
  background: rgba(255,255,255,0.6);
  border-radius:50px;
  overflow:hidden;
  box-shadow: inset 0 2px 6px rgba(217,119,147,0.15);
}
.loader-fill {
  height:100%;
  width:0%;
  background: linear-gradient(90deg,#d97793,#b399d4);
  border-radius:50px;
  transition: width 0.3s ease;
}
.loader-percent {
  margin-top:16px;
  color:#8a7a8c;
  font-size:0.9rem;
  font-weight:500;
}

.cursor-dot {
  position:fixed;
  width:12px; height:12px;
  border-radius:50%;
  background: radial-gradient(circle,#ff8fa8,#d97793);
  pointer-events:none;
  z-index:99998;
  transform: translate(-50%,-50%);
  box-shadow: 0 0 12px rgba(217,119,147,0.8);
  mix-blend-mode: multiply;
}
.cursor-trail {
  position:fixed;
  pointer-events:none;
  z-index:99997;
  font-size:16px;
  transform: translate(-50%,-50%);
  animation: trailFade 0.9s ease-out forwards;
}
@keyframes trailFade {
  0% { opacity:0.9; transform: translate(-50%,-50%) scale(1); }
  100% { opacity:0; transform: translate(-50%,-150%) scale(0.4); }
}
@media (max-width: 768px) { .cursor-dot, .cursor-trail { display:none; } }

.hearts-bg { position:fixed; inset:0; pointer-events:none; z-index:1; overflow:hidden; }
.heart {
  position:absolute; bottom:-50px;
  font-size:1.5rem; opacity:0.6;
  animation: floatUp linear infinite;
}
@keyframes floatUp {
  0%{transform:translateY(0) rotate(0); opacity:0}
  10%{opacity:0.7} 90%{opacity:0.7}
  100%{transform:translateY(-110vh) rotate(360deg); opacity:0}
}

.page {
  min-height:100vh;
  display:none;
  align-items:center;
  justify-content:center;
  padding:70px 20px 40px;
  position:relative;
  z-index:2;
  flex-direction:column;
}
.page.active { display:flex; animation: pageIn 0.9s cubic-bezier(0.4,0.2,0.2,1) both; }
@keyframes pageIn {
  from { opacity:0; transform:translateY(40px) scale(0.98); }
  to   { opacity:1; transform:translateY(0) scale(1); }
}

.glass {
  background: rgba(255,255,255,0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius:40px;
  padding:55px 42px;
  box-shadow: 0 20px 60px rgba(217,119,147,0.18), inset 0 1px 0 rgba(255,255,255,0.9);
  border:1px solid rgba(255,255,255,0.7);
  max-width:760px;
  width:100%;
  text-align:center;
}

.script {
  font-family:'Great Vibes',cursive;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  background: linear-gradient(135deg,#d97793,#b399d4);
  -webkit-background-clip:text; -webkit-text-fill-color:transparent;
  background-clip:text;
  line-height:1.15;
  margin-bottom:8px;
}
.name {
  font-family:'Great Vibes',cursive;
  font-size: clamp(2rem, 5vw, 3.5rem);
  color:#d97793;
  margin-bottom:22px;
}
.sub {
  color:#8a7a8c;
  font-weight:300;
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  line-height:1.7;
  max-width:600px;
  margin:0 auto 24px;
}
.section-title {
  font-family:'Great Vibes',cursive;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  color:#d97793;
  text-align:center;
  margin-bottom:10px;
}

.friendship-counter { text-align:center; margin: 22px 0 12px; }
.fc-label {
  font-family:'Great Vibes',cursive;
  font-size:1.8rem;
  color:#d97793;
  margin-bottom:14px;
}
.fc-numbers {
  display:flex; gap:10px; justify-content:center; flex-wrap:wrap;
}
.fc-item {
  background: rgba(255,255,255,0.85);
  border-radius:18px;
  padding:12px 16px;
  min-width:78px;
  box-shadow: 0 10px 25px rgba(217,119,147,0.18);
  border:1.5px solid rgba(255,255,255,0.95);
  animation: fcPulse 2s ease-in-out infinite;
}
.fc-item:nth-child(2) { animation-delay: 0.15s; }
.fc-item:nth-child(3) { animation-delay: 0.30s; }
.fc-item:nth-child(4) { animation-delay: 0.45s; }
@keyframes fcPulse {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-4px); }
}
.fc-item span {
  font-family:'Great Vibes',cursive;
  font-size:2.2rem;
  background: linear-gradient(135deg,#d97793,#b399d4);
  -webkit-background-clip:text; -webkit-text-fill-color:transparent;
  display:block; line-height:1;
}
.fc-item small {
  font-size:0.7rem;
  color:#8a7a8c;
  letter-spacing:1px;
  text-transform:uppercase;
  display:block; margin-top:6px;
}
.fc-since {
  margin-top:12px;
  font-size:0.9rem;
  color:#8a7a8c;
  font-style:italic;
}

.btn {
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:17px 40px;
  background: linear-gradient(135deg,#d97793,#b399d4);
  color:#fff;
  border:none;
  border-radius:50px;
  font-family:'Montserrat',sans-serif;
  font-size:1.02rem;
  font-weight:500;
  cursor:pointer;
  position:relative;
  overflow:hidden;
  text-decoration:none;
  box-shadow: 0 10px 30px rgba(217,119,147,0.4);
  transition: transform 0.3s, box-shadow 0.3s;
  margin-top:18px;
}
.btn:hover { transform:translateY(-3px) scale(1.04); box-shadow:0 15px 40px rgba(217,119,147,0.6); }
.btn:active { transform:translateY(-1px) scale(1.01); }
.btn::after {
  content:''; position:absolute; top:0; left:-100%;
  width:100%; height:100%;
  background: linear-gradient(90deg,transparent,rgba(255,255,255,0.55),transparent);
  transition: left 0.7s;
}
.btn:hover::after { left:100%; }
.btn-back {
  background: rgba(255,255,255,0.75);
  color:#8a7a8c;
  box-shadow: 0 8px 20px rgba(180,150,180,0.2);
}
.nav-row {
  display:flex; gap:14px; justify-content:center; flex-wrap:wrap;
  margin-top:35px;
}

.tap-hint {
  display: inline-block;
  margin-top:20px;
  padding:11px 24px;
  background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,240,250,0.95));
  border-radius:50px;
  color:#d97793;
  font-size:0.9rem;
  font-weight:500;
  animation: hintPulse 1.6s ease-in-out infinite;
  box-shadow: 0 6px 20px rgba(217,119,147,0.25);
  border:1.5px dashed rgba(217,119,147,0.5);
  text-align:center;
  max-width:90%;
  line-height:1.4;
}
/* Убираем эмодзи-палец */
.tap-hint::before {
  content:'' !important;
  display:none !important;
}
@keyframes hintPulse {
  0%,100%{ transform:scale(1);}
  50%{ transform:scale(1.05);}
}

@keyframes pointDown {
  0%,100%{ transform:translateY(0);}
  50%{ transform:translateY(5px);}
}
.pulse-target { position:relative; }
.pulse-target::before,
.pulse-target::after {
  content:''; position:absolute; inset:-8px;
  border-radius:inherit;
  border:2px solid rgba(217,119,147,0.5);
  animation: ringPulse 2s ease-out infinite;
  pointer-events:none;
}
.pulse-target::after { animation-delay:1s; }
@keyframes ringPulse {
  0%{ transform:scale(1); opacity:0.8;}
  100%{ transform:scale(1.25); opacity:0;}
}

.progress {
  position:fixed;
  top:20px; left:50%;
  transform:translateX(-50%);
  display:flex; gap:8px;
  z-index:50;
  background: rgba(255,255,255,0.55);
  padding:10px 16px;
  border-radius:50px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px rgba(217,119,147,0.15);
}
.dot {
  width:10px; height:10px;
  border-radius:50%;
  background: rgba(217,119,147,0.25);
  transition: all 0.4s;
}
.dot.active {
  background: linear-gradient(135deg,#d97793,#b399d4);
  transform: scale(1.4);
  box-shadow: 0 0 12px rgba(217,119,147,0.6);
}

.easter-egg {
  position:fixed;
  bottom:20px; right:20px;
  font-size:1.8rem;
  cursor:pointer;
  z-index:60;
  transition: transform 0.4s;
  filter: drop-shadow(0 6px 14px rgba(217,119,147,0.4));
  animation: eggFloat 3s ease-in-out infinite;
}
@keyframes eggFloat {
  0%,100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-8px) rotate(-8deg); }
}
.easter-egg:hover { transform: scale(1.2) rotate(15deg); }
.easter-egg.found { animation: eggSpin 0.6s ease-in-out; }
@keyframes eggSpin {
  0% { transform: rotate(0) scale(1); }
  50% { transform: rotate(360deg) scale(1.4); }
  100% { transform: rotate(720deg) scale(1); }
}

.grid {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap:26px;
  margin: 40px 0 10px;
  perspective:1200px;
  width:100%;
  max-width:1000px;
}
.wish {
  height:250px;
  cursor:pointer;
  perspective:1000px;
  position:relative;
}
.wish-inner {
  position:relative; width:100%; height:100%;
  transition: transform 0.8s cubic-bezier(0.4,0.2,0.2,1);
  transform-style: preserve-3d;
}
.wish.flipped .wish-inner { transform: rotateY(180deg); }
.wish-front, .wish-back {
  position:absolute; inset:0;
  backface-visibility:hidden;
  border-radius:30px;
  display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  padding:26px; text-align:center;
  box-shadow: 0 15px 40px rgba(217,119,147,0.15);
  border:2px solid rgba(255,255,255,0.9);
}
.wish-front { background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,240,250,0.95)); }
.wish-back {
  background: linear-gradient(135deg,#ffd6e0,#e6d7ff);
  transform: rotateY(180deg);
}
.wish-icon { font-size:2.8rem; margin-bottom:12px; display:block; }
.wish-front h3 {
  font-family:'Great Vibes',cursive;
  font-size:1.9rem;
  color:#d97793;
  font-weight:400;
}
.wish-back p { font-size:0.95rem; line-height:1.6; color:#5a4a5c; }

.polaroids {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap:30px;
  margin:40px 0 10px;
  padding:15px;
  width:100%;
  max-width:1100px;
}
.polaroid {
  background:#fff;
  padding:14px 14px 56px;
  border-radius:6px;
  box-shadow: 0 15px 35px rgba(217,119,147,0.25), 0 5px 15px rgba(0,0,0,0.08);
  transition: transform 0.5s cubic-bezier(0.4,0.2,0.2,1), box-shadow 0.5s;
  cursor:pointer;
  position:relative;
  opacity: 0;
  animation: polaroidIn 0.7s ease-out forwards;
}
.polaroid:nth-child(1)  { animation-delay: 0.05s; }
.polaroid:nth-child(2)  { animation-delay: 0.12s; }
.polaroid:nth-child(3)  { animation-delay: 0.19s; }
.polaroid:nth-child(4)  { animation-delay: 0.26s; }
.polaroid:nth-child(5)  { animation-delay: 0.33s; }
.polaroid:nth-child(6)  { animation-delay: 0.40s; }
.polaroid:nth-child(7)  { animation-delay: 0.47s; }
.polaroid:nth-child(8)  { animation-delay: 0.54s; }
.polaroid:nth-child(9)  { animation-delay: 0.61s; }
.polaroid:nth-child(10) { animation-delay: 0.68s; }
.polaroid:nth-child(11) { animation-delay: 0.75s; }
.polaroid:nth-child(12) { animation-delay: 0.82s; }

@keyframes polaroidIn {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.polaroid::after {
  content:''; position:absolute; top:-10px; left:50%;
  transform: translateX(-50%) rotate(-3deg);
  width:55px; height:18px;
  background: rgba(255,214,224,0.75);
  border-radius:3px;
}
.polaroid img {
  width:100%; height:260px; object-fit:cover;
  border-radius:3px; display:block;
  background: linear-gradient(135deg,#ffd6e0,#e6d7ff);
}
.polaroid p {
  position:absolute; bottom:14px; left:0; right:0;
  text-align:center;
  font-family:'Great Vibes',cursive;
  font-size:1.2rem;
  color:#5a4a5c;
}
.rot-l { transform: rotate(-3deg); }
.rot-r { transform: rotate(3deg); }
.polaroid:hover { transform: rotate(0) scale(1.08); box-shadow:0 25px 50px rgba(217,119,147,0.4); z-index:5; }

.cake-wrap {
  display:flex; flex-direction:column; align-items:center;
  margin:30px 0 10px; gap:18px;
}
.cake { position:relative; display:flex; flex-direction:column; align-items:center; }
.candle {
  width:14px; height:55px;
  background: linear-gradient(180deg,#ffd6e0,#b399d4);
  border-radius:4px;
  position:relative;
  cursor:pointer;
  transition: transform 0.3s;
}
.candle:hover { transform: scale(1.1); }
.flame {
  position:absolute; top:-26px; left:50%;
  transform:translateX(-50%);
  width:16px; height:26px;
  background: radial-gradient(circle at 50% 70%, #fff8a8, #ffb347 40%, #ff6b6b 90%);
  border-radius:50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: flicker 0.4s ease-in-out infinite alternate;
  box-shadow: 0 0 20px #ffb347, 0 0 40px rgba(255,179,71,0.5);
  transition: opacity 0.4s, transform 0.4s;
}
@keyframes flicker {
  0%{ transform:translateX(-50%) scale(1) rotate(-2deg);}
  100%{ transform:translateX(-50%) scale(1.15) rotate(2deg);}
}
.candle.blown .flame { opacity:0; transform:translateX(-50%) scale(0); }
.cake-body {
  width:180px; height:110px;
  background: linear-gradient(180deg,#ffe5d4,#ffd6e0);
  border-radius: 12px 12px 18px 18px;
  box-shadow: inset 0 -20px 0 rgba(217,119,147,0.25), 0 15px 30px rgba(217,119,147,0.25);
  position:relative;
  margin-top:6px;
}
.cake-body::before {
  content:''; position:absolute; top:18px; left:0; right:0;
  height:14px;
  background: repeating-linear-gradient(90deg,#d97793 0 14px, #ffd6e0 14px 28px);
  border-radius:6px;
  opacity:0.7;
}
.plate {
  width:220px; height:14px;
  background: linear-gradient(180deg,#fff,#e6d7ff);
  border-radius:50%;
  margin-top:4px;
  box-shadow: 0 8px 20px rgba(217,119,147,0.25);
}
.big-heart-wrap {
  margin:40px auto 20px;
  display:flex; flex-direction:column; align-items:center; gap:22px;
}
.big-heart {
  cursor:pointer;
  position:relative;
  width:170px; height:170px;
  animation: heartbeat 1.5s ease-in-out infinite;
  display:flex; align-items:center; justify-content:center;
}
.big-heart.opened { animation: heartbeat 0.7s ease-in-out infinite; }
.heart-shape {
  width:140px; height:140px;
  background: linear-gradient(135deg,#ff8fa8,#d97793);
  transform: rotate(-45deg);
  box-shadow: 0 0 60px rgba(217,119,147,0.6);
  position:relative;
}
.heart-shape::before,
.heart-shape::after {
  content:''; position:absolute;
  width:140px; height:140px;
  background: linear-gradient(135deg,#ff8fa8,#d97793);
  border-radius:50%;
}
.heart-shape::before { top:-70px; left:0; }
.heart-shape::after  { left:70px; top:0; }
.heart-pulse-ring {
  position:absolute; inset:0;
  border-radius:50%;
  border:3px solid rgba(217,119,147,0.7);
  animation: ringPulse 1.8s ease-out infinite;
  pointer-events:none;
}
.heart-pulse-ring:nth-child(2){ animation-delay:0.9s; }

.letter {
  max-height:0; overflow:hidden; opacity:0;
  transition: max-height 1.2s ease, opacity 1s ease, margin 1s ease;
  margin-top:0;
  width:100%;
}
.letter.show { max-height:1000px; opacity:1; margin-top:30px; }
.letter-text {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height:2;
  color:#5a4a5c;
  font-weight:300;
}
.signature {
  font-family:'Great Vibes',cursive;
  font-size:2rem;
  color:#d97793;
  display:inline-block;
  margin-top:18px;
}

.game-area {
  position:relative;
  width:100%;
  max-width:720px;
  height:420px;
  margin: 30px auto;
  background: rgba(255,255,255,0.4);
  border-radius:30px;
  border: 2px dashed rgba(217,119,147,0.4);
  overflow:hidden;
}
.game-heart {
  position:absolute;
  font-size:2rem;
  cursor:pointer;
  transition: transform 0.15s;
  filter: drop-shadow(0 6px 12px rgba(217,119,147,0.4));
  user-select: none;
  animation: heartBob 1.5s ease-in-out infinite;
}
@keyframes heartBob {
  0%,100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-10px) rotate(5deg); }
}
.game-heart:hover { transform: scale(1.3); }
.game-heart.caught { pointer-events:none; animation: caughtPop 0.4s ease-out forwards; }
@keyframes caughtPop {
  0% { transform: scale(1); opacity:1; }
  100% { transform: scale(2.5); opacity:0; }
}
.game-score {
  font-family:'Great Vibes',cursive;
  font-size:2rem;
  color:#d97793;
  text-align:center;
  margin-bottom:10px;
}
.game-timer {
  text-align:center;
  color:#8a7a8c;
  font-size:0.95rem;
  margin-top:10px;
}

.toast {
  position:fixed;
  top:30px; left:50%;
  transform: translateX(-50%) translateY(-150%);
  background: linear-gradient(135deg,#d97793,#b399d4);
  color:#fff;
  padding:13px 26px;
  border-radius:50px;
  font-weight:500;
  font-size:0.95rem;
  box-shadow: 0 15px 40px rgba(217,119,147,0.5);
  z-index:10000;
  transition: transform 0.5s cubic-bezier(0.4,0.2,0.2,1);
  max-width:90vw;
  text-align:center;
}
.toast.show { transform: translateX(-50%) translateY(0); }

.confetti-layer {
  position:fixed; inset:0;
  pointer-events:none; z-index:9999; overflow:hidden;
}
.confetti-piece {
  position:absolute; top:-20px;
  width:12px; height:12px;
  animation: confFall linear forwards;
}
@keyframes confFall {
  0%{ transform:translateY(0) rotate(0); opacity:1;}
  100%{ transform:translateY(110vh) rotate(720deg); opacity:0;}
}


@media (max-width:600px){
  .glass { padding:36px 20px; border-radius:30px; }
  .grid { grid-template-columns:1fr; }
  .wish { height:220px; }
  .polaroids { grid-template-columns:1fr; gap:26px; }
  .polaroid img { height:240px; }
  .heart-shape, .heart-shape::before, .heart-shape::after {
    width:100px; height:100px;
  }
  .heart-shape::before { top:-50px; }
  .heart-shape::after { left:50px; }
  .big-heart { width:140px; height:140px; }
  .progress { top:10px; padding:8px 12px; }
  .btn { padding:15px 30px; font-size:0.95rem; }
  .game-area { height:340px; }
  .easter-egg { bottom:14px; right:14px; font-size:1.5rem; }
}