/* --- Base page --- */
body {
  background: #000;
  height: 100vh;
  margin: 0;
  overflow: hidden;
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;
}

/* --- Quick links (translated) --- */
.quick-link {
  position: fixed;
  right: 10px;
  width: 35px;
  height: 35px;
  z-index: 999;
  background: #696969;
  border-radius: 50%;
  padding: 1px;
  text-align: center;
  color: #ddd;
  text-decoration: none;
  line-height: 35px;
  font-size: 13px;
  user-select: none;
}
.quick-link:nth-of-type(1) {
  top: 10%;
}
.quick-link:nth-of-type(2) {
  top: 4%;
  z-index: 998;
}
.quick-link:nth-of-type(3) {
  top: 16%;
  z-index: 997;
}
.quick-link:nth-of-type(4) {
  top: 22%;
  z-index: 996;
}

/* --- Love words --- */
#ui .love {
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -225px 0 0 -225px;
  --i: 1;
}
#ui .love:last-child .love_word {
  color: #ea80b0;
  font-size: 1.4rem;
  text-shadow: 0 0 10px #fff;
}

#ui .love_word {
  color: #ea80b0;
  font-size: 1.4rem;
  transform: translateY(-100%) rotateZ(-30deg);
  text-shadow: 0 0 10px #fff;
  letter-spacing: 2px;
  white-space: nowrap;
}
#ui .love_horizontal {
  animation: horizontal 10000ms infinite alternate ease-in-out;
  animation-delay: calc(var(--i) * -300ms);
}
#ui .love_vertical {
  animation: vertical 20000ms infinite linear;
  animation-delay: calc(var(--i) * -300ms);
}

/* مقیاس قلب روی صفحه‌های مختلف */
:root {
  --heart-scale: 1;
  --name-scale: 1;
}
@media (max-width: 1000px) {
  :root {
    --heart-scale: 0.85;
    --name-scale: 0.9;
  }
}

@media (max-width: 700px) {
  :root {
    --heart-scale: 0.7;
    --name-scale: 0.9;
  }
}

@media (max-width: 520px) {
  :root {
    --heart-scale: 0.65;
    --name-scale: 1;
  }
}

@media (max-width: 400px) {
  :root {
    --heart-scale: 0.48;
    --name-scale: 0.6;
  }
}

@media (max-width: 340px) {
  :root {
    --heart-scale: 0.38;
    --name-scale: 0.5;
  }
}

@media (min-width: 700px) {
  :root {
    --heart-scale: 1.15;
    --name-scale: 1.3;
  }
}

/* --- Center name --- */
:root {
  --name-offset: 10px; /* لپ‌تاپ */
  --heart-offset: -45px; /* لپ‌تاپ */
}

/* روی موبایل مقادیر عوض بشن */
@media (max-width: 600px) {
  :root {
    --name-offset: 5px; /* گوشی */
    --heart-offset: -40px; /* گوشی - این عدد رو کم و زیاد کن */
  }
}

@media (max-width: 400px) {
  :root {
    --name-offset: -10px; /* گوشی */
    --heart-offset: -40px; /* گوشی - این عدد رو کم و زیاد کن */
  }
}

/* استایل اسم Diana */
.partner-name {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(calc(-50% + var(--name-offset)), -58%);
  z-index: 10;
  color: #ff6b9d;
  font-family: "Dancing Script", cursive;
  font-size: clamp(2.2rem, calc(3rem * var(--name-scale, 1)), 7.5rem);
  font-weight: 600;
  letter-spacing: 3px;
  text-shadow:
    0 0 10px #ff6b9d,
    0 0 30px #ff2d75,
    0 0 60px rgba(255, 45, 117, 0.5);
  pointer-events: none;
  animation: heartbeat 2.4s ease-in-out infinite;
  white-space: nowrap;
}

@keyframes heartbeat {
  0%,
  100% {
    transform: translate(calc(-50% + var(--name-offset)), -58%) scale(1);
  }
  14% {
    transform: translate(calc(-50% + var(--name-offset)), -58%) scale(1.07);
  }
  28% {
    transform: translate(calc(-50% + var(--name-offset)), -58%) scale(1);
  }
  42% {
    transform: translate(calc(-50% + var(--name-offset)), -58%) scale(1.05);
  }
  70% {
    transform: translate(calc(-50% + var(--name-offset)), -58%) scale(1);
  }
}

/* استایل ظرف قلب */
.heart-container {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 450px;
  height: 450px;
  transform: translate(calc(-50% + var(--heart-offset)), -50%)
    scale(var(--heart-scale, 1));
  transform-origin: center center;
}
/* --- Message below the heart --- */
.love-dedication {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  width: min(90vw, 340px);
  color: #ffb6c1;
  font-size: clamp(0.85rem, 3.8vw, 1.05rem);
  font-family: "Dancing Script", cursive;
  letter-spacing: 1.5px;
  text-align: center;
  opacity: 0.8;
  text-shadow: 0 0 10px rgba(255, 182, 193, 0.5);
  pointer-events: none;
}

/* --- Animations --- */
@keyframes horizontal {
  from {
    transform: translateX(0px);
  }
  to {
    transform: translateX(450px);
  }
}
@keyframes vertical {
  0% {
    transform: translateY(180px);
  }
  10% {
    transform: translateY(45px);
  }
  15% {
    transform: translateY(4.5px);
  }
  18% {
    transform: translateY(0px);
  }
  20% {
    transform: translateY(4.5px);
  }
  22% {
    transform: translateY(34.61538px);
  }
  24% {
    transform: translateY(64.28571px);
  }
  25% {
    transform: translateY(112.5px);
  }
  26% {
    transform: translateY(64.28571px);
  }
  28% {
    transform: translateY(34.61538px);
  }
  30% {
    transform: translateY(4.5px);
  }
  32% {
    transform: translateY(0px);
  }
  35% {
    transform: translateY(4.5px);
  }
  40% {
    transform: translateY(45px);
  }
  50% {
    transform: translateY(180px);
  }
  71% {
    transform: translateY(428.57143px);
  }
  72.5% {
    transform: translateY(441.17647px);
  }
  75% {
    transform: translateY(450px);
  }
  77.5% {
    transform: translateY(441.17647px);
  }
  79% {
    transform: translateY(428.57143px);
  }
  100% {
    transform: translateY(180px);
  }
}
/* ========== INTRO SCREEN ========== */
#intro {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 100;
  background: radial-gradient(ellipse at center, #1a0a12 0%, #000 70%);
  transition:
    opacity 0.8s ease,
    visibility 0.8s;
}

#intro.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.from-text {
  font-size: clamp(1.4rem, 5vw, 2rem);
  font-family: "dancing script", cursive;
  letter-spacing: 3px;
  margin-bottom: 40px;
  color: #ffb6c1;
  text-shadow: 0 0 15px rgba(255, 182, 193, 0.5);
  animation: fadeIn 1.2s ease;
}

.envelope-wrapper {
  cursor: pointer;
  position: relative;
  width: 220px;
  height: 150px;
  animation: float 3s ease-in-out infinite;
}

.envelope {
  position: relative;
  width: 100%;
  height: 100%;
  background: #f8e1e7;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(255, 105, 180, 0.25);
  transition: transform 0.3s ease;
}

.envelope-wrapper:hover .envelope {
  transform: scale(1.05);
}

.flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background: #f0c6d0;
  clip-path: polygon(0 0, 50% 70%, 100% 0);
  transform-origin: top;
  transition: transform 0.6s ease;
  z-index: 2;
}

.envelope.open .flap {
  transform: rotateX(180deg);
}

.seal {
  position: absolute;
  top: 45px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 36px;
  background: #ff4d6d;
  border-radius: 50%;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(255, 77, 109, 0.6);
  transition: opacity 0.4s ease;
}

.seal::after {
  content: "♥";
  color: white;
  font-size: 18px;
}

.envelope.open .seal {
  opacity: 0;
}

.letter {
  position: absolute;
  bottom: 8px;
  left: 10px;
  right: 10px;
  height: 100px;
  background: #fff9fb;
  border-radius: 3px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-family: "Dancing Script", cursive;
  color: #c45c7a;
  letter-spacing: 1px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.7s ease 0.2s;
}

.envelope.open .letter {
  transform: translateY(-60px);
}

.tap-hint {
  margin-top: 35px;
  font-size: 0.95rem;
  letter-spacing: 2px;
  opacity: 0.7;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 0.9;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Heart scene initially hidden */
#heart-scene {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s ease 0.3s;
}

#heart-scene.show {
  opacity: 1;
  visibility: visible;
}
