.red-envelope-rain {
    position: absolute;
    width: 40px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background-color: #ff4d4f;
    border: 2px solid #ffd700;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 999999;
}

.red-envelope-rain .flap {
    position: absolute;
    width: 100%;
    height: 40%;
    top: 0;
    background-color: #e53935;
    border-radius: 27px 27px 50px 50px;
}

.red-envelope-rain .circle {
    font-family: "Arial", sans-serif;
    position: absolute;
    width: 20px;
    height: 20px;
    bottom: 20px;
    background: #ffd700;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    font-weight: bold;
    color: #ff4d4f;
}


.red-envelope {
    position: absolute;
    width: 70vw;  /* Thay đổi chiều rộng thành 70% chiều rộng của viewport */
    height: 98vw; /* Chiều cao tương ứng để giữ tỷ lệ cho bao lì xì */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background-color: #ff4d4f;
    border: 1vw solid #ffd700;
    border-radius: 5vw;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    animation: shake 2s ease-in-out 0s infinite;
    overflow: hidden;
}
.red-envelope.pc {
    width: 50vh;  /* Thay đổi chiều rộng thành 50% chiều rộng của viewport */
    height: 70vh; /* Chiều cao tương ứng để giữ tỷ lệ cho bao lì xì */
    border: 1vh solid #ffd700;
    border-radius: 4.3vh;
}

.red-envelope.opened {
    animation: none;
}

.red-envelope .flap {
    position: absolute;
    width: 100%;
    height: 40%;
    top: 0;
    background-color: #e53935;
    border-radius: 4.3vw 4.3vw 13vw 13vw;
    transform-origin: top;
    transition: transform 1s ease;
    transform: rotateX(0deg);
}
.red-envelope.pc .flap {
    border-radius: 3.5vh 3.5vh 11.5vh 11.5vh;
}

.red-envelope.opened .flap {
    transform: rotateX(90deg);
}

.red-envelope .circle {
    font-family: "Arial", sans-serif;
    position: absolute;
    width: 14vw;  /* Điều chỉnh kích thước vòng tròn theo tỷ lệ */
    height: 14vw; /* Điều chỉnh kích thước vòng tròn theo tỷ lệ */
    bottom: 55%;
    background: #ffd700;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    font-size: 8vw;  /* Điều chỉnh kích thước chữ trong vòng tròn */
    font-weight: bold;
    color: #ff4d4f;
    opacity: 1;
    transition: all 1s ease-in-out;
}
.red-envelope.pc .circle {
    width: 9vh;  /* Điều chỉnh kích thước vòng tròn theo tỷ lệ */
    height: 9vh; /* Điều chỉnh kích thước vòng tròn theo tỷ lệ */
    font-size: 5vh;  /* Điều chỉnh kích thước chữ trong vòng tròn */
}

.red-envelope.opened .circle {
    bottom: 25%;
    opacity: 0;
}

@keyframes shake {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(10deg); }
    50% { transform: rotate(-10deg); }
    75% { transform: rotate(5deg); }
    100% { transform: rotate(0deg); }
}

/* Nền mờ phía sau popup */
.popup-container {
    font-family: "Arial", sans-serif;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* Popup */
.popup {
    background-color: #fff;
    color: #4CAF50;  /* Màu chữ xanh */
    border-radius: 15px;
    padding: 20px;
    width: 200px;
    text-align: center;
    font-size: 16px;
    opacity: 1;
    transform: scale(0);
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

/* Nút đóng */
.popup-btn {
    background-color: #FFD700;  /* Màu vàng cho nút */
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 20px;
    transition: background-color 0.3s;
}

.popup-btn:hover {
    background-color: #ffcc00;  /* Thay đổi màu khi hover */
}

/* Hiệu ứng mở popup */
.popup.open {
    transform: scale(1);  /* Phóng to popup từ 0px */
    opacity: 1;
}

/* Phần thưởng văn bản */
.reward-text {
    font-size: 18px;
    margin-bottom: 20px;
}