body {
    margin: 0;
    padding: 0;
    overflow: hidden;
}

#video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: black; /* Set the background color to black */
    z-index: -1;
}

video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 3s ease-in-out;
}

#black-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 1);
    z-index: 3;
    pointer-events: none;
    transition: background-color 1s ease-in-out;
    opacity: 0;
}

#video2 {
    opacity: 0;
    z-index: 2;
}

#text-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 24px;
    text-align: center;
    z-index: 10;
    opacity: 0;
    transition: opacity 2s ease-in-out;
}

input#flap {
    display: none;
}

.envelope-container {
    position: relative;
}

.envelope-back {
    position: relative;
    width: 320px;
    height: 200px;
    background-color: #718355;
}

.envelope-back:before {
    content: "";
    position: absolute;
    background-color: rgba(0, 0, 0, 0.07);
    width: 320px;
    height: 10px;
    border-radius: 50%;
    top: 220px;
}

.card {
    position: absolute;
    width: 300px;
    height: 180px;
    background-color: white;
    top: 10px;
    left: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-family: Brush Script MT;
    transition: 1s;
    z-index: 1;
    cursor: pointer;
}

.card-front {
    position: absolute;
    width: 0;
    height: 0;
    border-bottom: 100px solid #860129;
    border-left: 160px solid transparent;
    border-right: 160px solid transparent;
    top: 100px;
    left: 0;
    z-index: 3;
}

.card-front:before, .card-front:after {
    content: "";
    position: absolute;
    border-bottom: 100px solid transparent;
    border-top: 100px solid transparent;
    height: 0;
    width: 0;
}

.card-front:before {
    border-left: 161px solid transparent;
    border-right: 161px solid #a4093c;
    top: -100px;
    left: -162px;
}

.card-front:after {
    border-right: 161px solid transparent;
    border-left: 161px solid #a4093c;
    top: -100px;
    left: -160px;
}

.flap {
    position: absolute;
    width: 0;
    height: 0;
    border-top: 110px solid #bd003e;
    border-left: 160px solid transparent;
    border-right: 160px solid transparent;
    top: 0;
    left: 0;
    cursor: pointer;
    transition: 2s;
    transform-origin: top;
    z-index: 4;
}

#flap:checked + .flap {
    transform: rotateX(180deg);
}

#flap:checked ~ .card-front {
    z-index: 7;
}

#flap:checked ~ .card {
    z-index: 4;
    transform: translateY(-60px);
}

.envelope-div {
    width: 320px;
    height: 200px;
    background-color: red;

    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;

    margin: auto;
}

#text-overlay2 {
    position: absolute;
    top: 20%;
    background-color: transparent;
    z-index: 5;
    pointer-events: none;
}

#envelope-all-div {
    opacity: 1;
    transition: opacity 2s ease-in-out;
}

.shaking {
    animation: shake 0.82s cubic-bezier(.36, .07, .19, .97) both;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}

@keyframes shake {
    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }
    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }
    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }
    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}
