body {
    font-family: 'Arial', sans-serif;
    background-color: #fde7e7;
    margin: 0;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.container {
    position: relative;
    width: 100%;
    max-width: 800px;
}

.background-hearts {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle, #ff4d4d 5%, transparent 6%),
        radial-gradient(circle, #ff4d4d 5%, transparent 6%);
    background-size: 30px 30px;
    background-position: 0 0, 15px 15px;
    animation: heart-rain 10s linear infinite;
}

@keyframes heart-rain {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(100%);
    }
}

.content {
    position: relative;
    z-index: 1;
}

.envelope-container {
    perspective: 1000px;
    transform-style: preserve-3d;
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.envelope {
    width: 100%;
    height: 250px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.envelope:hover {
    transform: rotateY(180deg);
}

.envelope-front,
.envelope-back {
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden;
    border: 2px solid #ccc;
    border-radius: 10px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.envelope-front {
    background-color: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ff4d4d;
}

.envelope-front .front-content {
    text-align: center;
    padding: 20px;
}

.envelope-back {
    background-color: #fff;
    transform: rotateY(180deg);
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.letter {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.letter-content {
    text-align: center;
}

.letter-content h1 {
    color: #ff4d4d;
    font-size: 24px;
    margin-bottom: 10px;
}

.sender-info {
    font-size: 14px;
    color: #888;
}

.letter-text {
    margin-bottom: 10px;
    font-size: 16px;
    line-height: 1.6;
}

.sender-name {
    font-weight: bold;
    font-style: italic;
    font-size: 18px;
    margin-top: 10px;
}

.heart-emojis {
    font-size: 36px;
    margin-top: 20px;
}

.heart-emojis span {
    margin: 0 5px;
    color: #ff4d4d;
}


@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    .envelope {
        height: 200px;
    }

    .envelope-front .front-content {
        padding: 10px;
    }

    .letter-content h1 {
        font-size: 20px;
    }

    .letter-text {
        font-size: 14px;
    }

    .sender-info,
    .sender-name {
        font-size: 12px;
    }

    .heart-emojis {
        font-size: 24px;
    }
}