body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: 'Roboto', sans-serif;
    height: 100vh;
    margin: 0;
    padding: 0;
    background-color: #FFF0F5;
}

#envelope {
    position: relative;
    height: 180px;
    width: 280px;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    margin-left: auto;
    margin-right: auto;
    top: 40%;
    background-color: #ff2a22;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

#envelope:hover {
    cursor: pointer;
}

.front {
    position: absolute;
    width: 0;
    height: 0;
    z-index: 3;
}

.flap {
    border-top: 98px solid #ff2a22;
    border-left: 140px solid transparent;
    border-right: 140px solid transparent;
    border-bottom: 82px solid transparent;
    transform-origin: top;
}

.pocket {
    border-left: 140px solid #ff748d;
    border-right: 140px solid #ff748d;
    border-bottom: 90px solid #ff98a7;
    border-top: 90px solid transparent;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}

.letter {
    position: relative;
    background-color: white;
    width: 90%;
    height: 90%;
    top: 5%;
    border-radius: 10px;
    box-shadow: 0 2px 26px rgba(0, 0, 0, .12);
    margin-left: auto;
    margin-right: auto;
}

.letter:after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
}

.super-big-text {
    font-size: clamp(3rem, 10vw, 8rem); /* Responsive font size */
    font-family: 'Roboto', sans-serif;
    text-align: center;
    color: #ff2a22;
    margin-bottom: -30px;
    font-weight: 900;
}

.words {
    position: absolute;
    left: 10%;
    width: 80%;
    height: 14%;
    font-size: 15px;
    font-family: 'Roboto', sans-serif;
    color: black;
}

.line1 {
    top: 15%;
}
.line2 {
    top: 25%;
}
.line3 {
    top: 53%;
    text-align: left;
}
.line4 {
    top: 63%;
    text-align: left;
}

.open .flap {
    transform: rotatex(180deg);
    transition: transform 0.4s ease, z-index 0.6s;
    z-index: 1;
}

.close .flap {
    transform: rotatex(0deg);
    transition: transform 0.4s 0.6s ease, z-index 1s;
    z-index: 5;
}

.open .letter {
    transform: translatey(-120px);
    transition: transform 0.4s 0.6s ease, z-index 0.6s;
    z-index: 2;
}

.close .letter {
    transform: translatey(0deg);
    transition: transform 0.4s ease, z-index 1s;
    z-index: 1;
}

.hearts {
    position: absolute;
    top: 90px;
    left: 0;
    right: 0;
    z-index: 2;
}

.heart {
    position: absolute;
    bottom: 0;
    right: 10%;
}

.heart:before, .heart:after {
    position: absolute;
    content: "";
    background: #d00000;
    width: 50px;
    height: 80px;
    left: 50px;
    top: 0;
    border-radius: 50px 50px 0 0;
    transform: rotate(-45deg);
    transform-origin: 0 100%;
}

.heart:after {
    left: 0;
    transform: rotate(45deg);
    transform-origin: 100% 100%;
}

.close .heart {
    opacity: 0;
    animation: none;
}

.a1 {
    left: 20%;
    transform: scale(0.6);
    opacity: 1;
    animation: slideUp 4s linear 1, sideSway 2s  ease-in-out 4 alternate;
    animation-fill-mode: forwards;
    animation-delay: 0.7s;
}
.a2 {
    left: 55%;
    transform: scale(1);
    opacity: 1;
    animation: slideUp 5s linear 1, sideSway 4s  ease-in-out 2 alternate;
    animation-fill-mode: forwards;
    animation-delay: 0.7s;
}
.a3 {
    left: 10%;
    transform: scale(0.8);
    opacity: 1;
    animation: slideUp 7s linear 1, sideSway 2s  ease-in-out 6 alternate;
    animation-fill-mode: forwards;
    animation-delay: 0.7s;
}

@keyframes slideUp {
    0% {
    top: 0;
    }
    100% {
        top: -600px;
    }
}

@keyframes sideSway {
    0% {
        margin-left: 0px;
    }
    100% {
        margin-left: 50px;
    }
}

.reset {
    text-align: center;
}

.reset button {
    font-weight: 800;
    font-style: normal;
    transition: all 0.1s linear;
    background-color: transparent;
    border: solid 2px #FF6863;
    border-radius: 4px;
    color: #FF6863;
    display: inline-block;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    text-transform: uppercase;
    margin: 20px;
    margin-top: 110px;
    padding: 10px;
    line-height: 2em;
    text-decoration: none;
    min-width: 80px;
    outline: none;
}

.reset button:hover {
    background-color: #FF6863;
    cursor: pointer;
    color: white;
}

.valentine {
    text-align: center;
    font-family: 'Roboto', sans-serif;
    color:rgb(20, 20, 20);
    font-size: 30px;
}

.controls {
    display: flex;
    justify-content: space-between;
    width: 280px;
    margin: 20px auto;
}

.action-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}

.rounded {
    text-decoration: none;
    padding: 10px 30px;
    border-radius: 25px;
    border: 2px solid #FF6863;
    background-color: transparent;
    color: #FF6863;
    font-family: 'Roboto', sans-serif;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rounded:hover {
    background-color: #FF6863;
    color: white;
}

/* Modify existing .reset button styles */
.reset button {
    margin: 20px 0;
}
