body {
  margin: 0;
  background: #3b3332 url('https://www.transparenttextures.com/patterns/black-linen.png');
  font-family: Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  flex-direction: column;
  overflow: auto;
}

.envelope {
  position: relative;
  width: 320px;
  height: 200px;
  background: #b59d7b url('https://www.transparenttextures.com/patterns/paper-fibers.png');
  border: 2px solid #8b7655;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  perspective: 1000px;
  border-radius: 8px;
  overflow: hidden;
}

.flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: #a78c6d url('https://www.transparenttextures.com/patterns/paper-fibers.png');
  transform-origin: top;
  transition: transform 1s ease;
  z-index: 2;
}

.envelope.open .flap {
  transform: rotateX(-180deg);
}

.seal-img {
  position: absolute;
  width: 60px;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  pointer-events: none;
}

.book {
  width: 90%;
  max-width: 800px;
  display: none;
  position: relative;
  perspective: 2000px;
}

.page {
  position: absolute;
  width: 100%;
  background: #f4ebd4 url('https://www.transparenttextures.com/patterns/old-wall.png');
  border: 1px solid #bba68f;
  border-radius: 6px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  backface-visibility: hidden;
  transform-style: preserve-3d;
  transition: transform 1s;
  overflow-y: auto;
  max-height: 85vh;
}

.page.left {
  z-index: 2;
}

.page.right {
  transform: rotateY(180deg);
  left: 0;
}

.book.flipped .left {
  transform: rotateY(-180deg);
}

.book.flipped .right {
  transform: rotateY(0deg);
}

.letter {
  white-space: pre-wrap;
  color: #3b2f1c;
  font-size: 18px;
  min-height: 300px;
}

.btn {
  margin-top: 16px;
  padding: 10px 18px;
  border: none;
  background: #6b1603;
  color: white;
  cursor: pointer;
  border-radius: 5px;
}

.btn:hover {
  background: #5a1202;
}

.cursive {
  font-family: 'Great Vibes', cursive;
  font-size: 20px;
}

.cursor {
  display: inline-block;
  width: 2px;
  height: 20px;
  background: #6b1603;
  margin-left: 3px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

.nav-btns {
  margin-top: 30px;
  display: none;
  justify-content: center;
  gap: 10px;
}
