@import url('https://fonts.googleapis.com/css2?family=Mochiy+Pop+P+One&display=swap');

body {
    height: 100vh;
    font-family: 'Mochiy Pop P One', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: lightcoral;
}

/* Add media query for smaller screens */
@media screen and (max-width: 600px) {
    .valentines-day-card {
        width: 100%; /* Make the card take up the full width of the screen */
        max-width: 300px; /* Set a maximum width for larger screens */
    }

    .note {
        width: 100%; /* Make the note take up the full width of the screen */
        max-width: 200px; /* Set a maximum width for larger screens */
        left: 0; /* Center the note on smaller screens */
    }

    .text-one {
        width: 100%; /* Make the text take up the full width of the screen */
        max-width: 300px; /* Set a maximum width for larger screens */
    }

    .heart {
        top: 10%; /* Adjust the position of the heart on smaller screens */
        left: 50%; /* Center the heart on smaller screens */
        transform: translateX(-50%) rotate(-45deg); /* Center the heart horizontally */
    }

    .smile {
        top: 15%; /* Adjust the position of the smile on smaller screens */
        left: 50%; /* Center the smile on smaller screens */
        transform: translateX(-50%); /* Center the smile horizontally */
    }

    .eyes {
        top: 13%; /* Adjust the position of the eyes on smaller screens */
        left: 50%; /* Center the eyes on smaller screens */
        transform: translateX(-50%); /* Center the eyes horizontally */
    }
}

input#open {    
    display: none;
}

.valentines-day-card {
    position: relative;
    width: 300px;
    height: 300px;
    transform-style: preserve-3d;
    transform: perspective(2500px);
    transition: .3s;
}

.card-front {
    position: relative;
    background-color: #fff0f3;
    width: 300px;
    height: 300px;
    transform-origin: left;
    box-shadow: inset 100px 20px 100px rgba(0, 0, 0,.15), 30px 0 50px rgba(0, 0, 0,.3);
    transition: .3s;
}

.card-front:before {
    content:"";
    position: absolute;
    width: 280px;
    height: 280px;
    background-color: pink;
    top:10px;
    left:10px;
}

.card-inside {
    position: absolute;
    background-color: #fff0f3;
    width: 300px;
    height: 300px;
    z-index: -1;
    left: 0;
    top: 0;
    box-shadow: inset 100px 20px 100px rgba(0,0,0,.22), 100px 20px 100px rgba(0,0,0,.1);
}

.open {
    position: absolute;
    width: 300px;
    height: 300px;
    left: 0;
    top: 0;
    background-color: transparent;
    z-index: 7;
    cursor: pointer;
}

#open:checked ~ .card-front {
    transform: rotateY(-155deg);
    box-shadow: inset 100px 20px 100px rgba(0, 0, 0,.13), 30px 0 50px rgba(0,0,0,.1);
}

#open:checked ~ .card-front:before {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    background-color: pink;
    top: 10px;
    left: 10px;
    z-index: 5;
    box-shadow: inset 100px 20px 100px rgba(0, 0, 0, .1) 30px 0 50px rgba(0, 0, 0, .1); }

.note {
    position: relative;
    width: 200px;
    height: 150px;
    top: 75px;
    left: 50px;
    color: red;
    background-color: beige;
    font-size: 30px;
    display: flex;
    align-items: center;
    text-align: center;
    filter: drop-shadow(0 0 20px rgba(0,0,0,0.3));
}

.note:before, .note:after {
    content:"";
    position:absolute;
    background-color: #ba1c1c;
    width: 40px;
    height: 40px;
}

.note::before {
    transform: rotate(-45deg);
    top: -20px;
    left: 80px;
}

.note:after {
    border-radius: 50%;
    top:-35px;
    left:65px;
    box-shadow: 30px 0 #ba1c1c;
}

.text-one {
    position: absolute;
    color: #333;
    font-size: 30px;
    top: 30px;
    width: 300px;
    text-align: center;
}

.text-one:before, .text-one::after {
    position: absolute;
    left: 5px;
    text-align: center;
    width: 300px;
}

.text-one:before {
    content:"Valentine's";
    top: 30px;
    color: #d04e4e;
}

.text-one::after {
    content:"day!";
    top: 60px;
}

.heart {
    position: relative;
    background-color: #d04e4e;
    height: 60px;
    width:60px;
    top:180px;
    left:120px;
    transform: rotate(-45deg);
    animation: .8s beat infinite;
  }

  body {
    overflow: hidden;
    margin: 0;
    padding: 0;
    height: 100vh;
  }
  
  .heart2 {
    width: 10px;
    height: 10px;
    background: red;
    position: absolute;
    animation: float .3s linear infinite;
  }
  
  @keyframes float {
    0% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(-100vh);
    }
    100% {
      transform: translateY(-200vh);
    }
  }
  
  #heart2-container {
    position: absolute;
    top: 50%;
    left: 25%;
    transform: translate(-50%, -50%);
}

  
    
  .heart:before, .heart:after {
    content:"";
    background-color: #d04e4e;
    border-radius:50%;
    height: 60px;
    width: 60px;
    position: absolute;
    }
    
  .heart:before {
    top:-30px;
    left:0;
  }
    
  .heart:after {
    left:30px;
    top:0;
  }
  
  .smile {
    position: absolute;
    width:30px;
    height:15px;
    background-color: #333;
    z-index:1;
    border-radius: 0 0 100px 100px;
    top:200px;
    left:135px;
    overflow: hidden;
  }
  
  .smile:before {
    content:"";
    position: absolute;
    border-radius:50%;
    width:20px;
    height:20px;
    background-color: #030202;
    top:5px;
    left:5px;
  }
  
  .eyes {
    position: absolute;
    border-radius: 50%;
    background-color: #333;
    width:10px;
    height:10px;
    z-index:1;
    top:190px;
    left:165px;
    box-shadow: -40px 0 #333;
    transform-origin: 50%;
    animation: close 2s infinite;
  }
  
  @keyframes close {
      0%, 100% {
          transform: scale(1, .05);
      }
      5%, 95% {
          transform: scale(1, 1);
      }
  }
  
  @keyframes beat {
    0%, 40%, 100% {
      transform: scale(1) rotate(-45deg);
    }
    25%, 60% {
      transform: scale(1.1) rotate(-45deg);
    }
  }