* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: 'Georgia', serif;
  background: #1e1e2f;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  flex-direction: column;
  overflow: hidden;
}
.intro {
  text-align: center;
  font-size: 1.4rem;
  margin-bottom: 30px;
  opacity: 1;
  transition: opacity 1s ease;
}
.btn {
  padding: 10px 20px;
  font-size: 1rem;
  background: #f5eeef;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  color: rgb(5, 2, 2);
  transition: 0.3s;
}
.btn:hover {
  background: #b1acad;
}
.letter-container {
  display: none;
  gap: 30px;
  align-items: center;
  justify-content: center;
  width: 90%;
  max-width: 1200px;
  opacity: 0;
  animation: fadeIn 5s ease-in forwards;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.letter {
  background: repeating-linear-gradient(to bottom, #fdf6e3 0px, #fdf6e3 27px, #d2d2d2 28px);
  color: #333;
  padding: 30px 30px 30px 70px;
  border-radius: 10px;
  width: 45%;
  height: 600px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
  font-size: 1rem;
  line-height: 1.6;
  text-align: left;
  position: relative;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  font-family: 'Courier New', monospace;
  overflow: hidden;
}
.letter p {
  margin-top: -55px;
  overflow: auto;
  padding-right: 10px;
}
.letter::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 25px;
  height: 100%;
  background-image: radial-gradient(circle, #1e1e2f 6px, transparent 7px);
  background-size: 25px 40px;
  background-repeat: repeat-y;
  background-position: center;
  pointer-events: none;
}
.page-left {
  transform: rotate(-1deg);
}
.page-right {
  transform: rotate(1deg);
}
.signature {
  display: none;
  position: absolute;
  bottom: 50px;
  right: 35px;
  width: 80px;
  opacity: 0.9;
  pointer-events: none;
  transform: rotate(-2deg);
}
.date-text {
  display: none;
  position: absolute;
  bottom: 20px;
  right: 30px;
  font-family: 'Georgia', serif;
  font-size: 0.85rem;
  color: #000;
  font-style: italic;
  opacity: 1;
  font-weight: bold;
  z-index: 10;
}

.next-btn {
  display: none;
  position: absolute !important;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) !important;
  padding: 12px 30px;
  font-size: 1rem;
  background: linear-gradient(145deg, #f4e4bc 0%, #e8d5b7 50%, #d4c4a8 100%);
  border: 2px solid #8b6f47;
  border-radius: 25px;
  cursor: pointer;
  color: #3d2914;
  font-family: 'Georgia', serif;
  font-weight: 500;
  font-style: italic;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
  transition: all 0.4s ease;
  box-shadow:
    0 4px 15px rgba(139, 111, 71, 0.3),
    inset 0 1px 3px rgba(255, 255, 255, 0.5),
    inset 0 -1px 3px rgba(139, 111, 71, 0.2);
  z-index: 1000;
  opacity: 0;
  animation: romanticEntrance 1.5s ease forwards;
  overflow: hidden;
}

.next-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.6s ease;
}

.next-btn:hover {
  background: linear-gradient(145deg, #f9e9cd 0%, #eddbbc 50%, #ddc9a3 100%);
  transform: translate(-50%, -50%) translateY(-3px) scale(1.02);
  box-shadow:
    0 6px 20px rgba(139, 111, 71, 0.4),
    inset 0 1px 3px rgba(255, 255, 255, 0.6),
    inset 0 -1px 3px rgba(139, 111, 71, 0.3),
    0 0 15px rgba(212, 175, 55, 0.3);
  border-color: #a0845a;
}

.next-btn:hover::after {
  left: 100%;
}

.next-btn:active {
  transform: translate(-50%, -50%) translateY(-1px) scale(0.98);
  box-shadow:
    0 2px 10px rgba(139, 111, 71, 0.4),
    inset 0 2px 5px rgba(139, 111, 71, 0.2);
}

@keyframes romanticEntrance {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) translateY(30px) scale(0.8);
  }
  50% {
    opacity: 0.8;
    transform: translate(-50%, -50%) translateY(-5px) scale(1.05);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.mobile-message {
  display: none;
  text-align: center;
  font-size: 1.2rem;
  color: #f5eeef;
  padding: 20px;
}

/* Password Modal Styles */
.password-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: #2a2a3e;
  padding: 40px;
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 0 30px rgba(245, 238, 239, 0.2);
  max-width: 400px;
  width: 90%;
}

.modal-content h2 {
  color: #f5eeef;
  margin-bottom: 25px;
  font-size: 1.5rem;
  font-weight: normal;
  letter-spacing: 2px;
}

.modal-content input {
  width: 100%;
  padding: 12px 15px;
  background: #1e1e2f;
  border: 1px solid #444;
  border-radius: 8px;
  color: #f5eeef;
  font-size: 1rem;
  margin-bottom: 20px;
  font-family: 'Georgia', serif;
  transition: border-color 0.3s;
}

.modal-content input:focus {
  outline: none;
  border-color: #f5eeef;
}

.modal-content input::placeholder {
  color: #777;
}

.modal-content button {
  padding: 10px 25px;
  margin: 0 10px;
  background: #f5eeef;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  color: rgb(5, 2, 2);
  font-size: 1rem;
  transition: 0.3s;
  font-family: 'Georgia', serif;
}

.modal-content button:hover {
  background: #b1acad;
  transform: translateY(-2px);
}

.modal-content button:last-child {
  background: transparent;
  border: 1px solid #f5eeef;
  color: #f5eeef;
}

.modal-content button:last-child:hover {
  background: rgba(245, 238, 239, 0.1);
}

.password-hint {
  color: #888;
  font-size: 0.85rem;
  font-style: italic;
  margin: 10px 0;
  text-align: center;
  font-family: 'Georgia', serif;
}

.error-message {
  color: #ff6b6b;
  font-size: 0.9rem;
  margin-bottom: 15px;
  height: 20px;
  transition: opacity 0.3s ease;
}

/* Vintage Collage Styles */
.collage-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: #1e1e2f;
  /* Shown as flex by goToNext() */
  display: none;
  justify-content: center;
  align-items: center;
  font-family: 'Courier New', monospace;
  padding: 20px;
  zoom: 110%;
  opacity: 0;
  transition: opacity 1s ease;
}

.collage-container.show {
  opacity: 1;
}

@media (max-width: 768px) {
  .mobile-message {
    display: block;
  }
  .intro,
  .btn,
  .letter-container,
  .collage-container {
    display: none !important;
  }
}
