@import 'https://fonts.googleapis.com/css?family=Roboto+Mono:100';

html,
body {
  font-family: 'Roboto Mono', monospace;
  background: #212121;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

.container {
  height: 100%;
  width: 100%;
  justify-content: center;
  align-items: center;
  display: flex;
  flex-direction: column;
  position: relative;
}

.text {
  font-weight: 100;
  font-size: 40px;
  /* Increased from 28px */
  color: #fafafa;
  margin-bottom: 80px;
  /* Increased margin */
  min-height: 60px;
  text-align: center;
  padding: 0 20px;
}

.dud {
  color: #757575;
}

/* Envelope Styles */
.envelope-wrapper {
  position: relative;
  width: 240px;
  /* Doubled from 120px */
  height: 160px;
  /* Doubled from 80px */
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s ease, transform 1s ease;
  pointer-events: none;
}

.envelope-wrapper.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.envelope {
  position: relative;
  width: 100%;
  height: 100%;
  background: #d32f2f;
  border-radius: 0 0 10px 10px;
  /* Increased radius */
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}

.envelope .front {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 120px solid transparent;
  /* Adjusted for new width */
  border-right: 120px solid transparent;
  border-bottom: 100px solid #e53935;
  /* Adjusted height */
  z-index: 3;
  border-radius: 0 0 10px 10px;
}

.envelope .top {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 120px solid transparent;
  border-right: 120px solid transparent;
  border-top: 80px solid #f44336;
  /* Adjusted height */
  transform-origin: top;
  transition: transform 0.5s ease;
  z-index: 4;
}

.envelope:hover .top {
  transform: rotateX(180deg);
}

.envelope .back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #c62828;
  border-radius: 10px;
  z-index: 1;
}

.envelope .letter-preview {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  bottom: 20px;
  background: #fff;
  z-index: 2;
  transition: transform 0.5s ease;
}

.envelope:hover .letter-preview {
  transform: translateY(-20px);
}

.envelope .shadow {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  filter: blur(10px);
  z-index: 0;
}

/* Flying Photos */
.flying-photo {
  position: absolute;
  width: 150px;
  height: auto;
  border: 5px solid white;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  z-index: 50;
  transition: all 1.5s cubic-bezier(0.25, 1, 0.5, 1);
  pointer-events: none;
  opacity: 0;
}

/* Overlay Styles */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  backdrop-filter: blur(5px);
}

.overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.letter-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  transform: scale(0.8);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.overlay.active .letter-content {
  transform: scale(1);
}

.letter-content img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: block;
}

.close-hint {
  color: #fff;
  text-align: center;
  margin-top: 15px;
  font-family: 'Roboto Mono', monospace;
  font-size: 16px;
  opacity: 0.7;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
  .text {
    font-size: 24px;
    margin-bottom: 40px;
  }

  .envelope-wrapper {
    width: 160px;
    height: 106px;
  }

  .envelope .front {
    border-left-width: 80px;
    border-right-width: 80px;
    border-bottom-width: 70px;
  }

  .envelope .top {
    border-left-width: 80px;
    border-right-width: 80px;
    border-top-width: 53px;
  }

  .flying-photo {
    width: 100px;
  }
}