* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0a0a0a;
  color: #fff;
  min-height: 100vh;
  padding: 40px 20px;
}

.container {
  max-width: 650px;
  margin: 0 auto;
}

.back-link {
  display: inline-block;
  color: #999;
  text-decoration: none;
  margin-bottom: 40px;
  font-size: 14px;
  transition: color 0.2s;
}

.back-link:hover {
  color: #fff;
}

header {
  text-align: center;
  margin-bottom: 60px;
}

header h1 {
  font-size: 64px;
  margin-bottom: 16px;
}

header h2 {
  font-size: 36px;
  margin-bottom: 8px;
  font-weight: 600;
}

header p {
  color: #999;
  font-size: 16px;
}

.letter-paper {
  background: #fff;
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 24px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

textarea {
  width: 100%;
  height: 400px;
  background: transparent;
  border: none;
  padding: 32px;
  color: #000;
  font-size: 18px;
  font-family: 'Georgia', serif;
  line-height: 1.8;
  resize: none;
}

textarea:focus {
  outline: none;
}

textarea::placeholder {
  color: #999;
  opacity: 0.6;
}

.primary-button {
  width: 100%;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
}

.primary-button:active {
  transform: translateY(0);
}

.secondary-button {
  padding: 12px 32px;
  background: #222;
  border: 1px solid #444;
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 24px;
}

.secondary-button:hover {
  background: #333;
  border-color: #666;
}

#envelope-container {
  text-align: center;
  padding-top: 40px;
}

.envelope {
  width: 300px;
  height: 200px;
  margin: 0 auto 32px;
  position: relative;
  animation: float 3s ease-in-out infinite;
}

.envelope .body {
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.envelope .flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: #f5f5f5;
  transform-origin: top;
  border-radius: 4px 4px 0 0;
  animation: flapClose 2s ease-out forwards;
}

@keyframes flapClose {
  0% {
    transform: rotateX(0deg);
  }
  100% {
    transform: rotateX(180deg);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.success-message {
  font-size: 20px;
  color: #999;
  margin-bottom: 8px;
}

.hidden {
  display: none;
}

/* Fade out animation */
.fade-out {
  animation: fadeOut 0.5s ease-out forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: scale(0.95);
  }
}

/* Mobile */
@media (max-width: 768px) {
  body {
    padding: 24px 16px;
  }

  header h1 {
    font-size: 48px;
  }

  header h2 {
    font-size: 28px;
  }

  textarea {
    height: 300px;
    font-size: 16px;
    padding: 24px;
  }

  .envelope {
    width: 240px;
    height: 160px;
  }
}