* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', Arial, sans-serif;
}

body {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    perspective: 1200px;
    background: url("../image/background.jpg") repeat-x center/auto 100%;
    animation: scrollBg 60s linear infinite;
}

body::after {
    content: "";
    position: fixed;
    left: 0; bottom: 0;
    width: 100%; height: 40%;
    background: linear-gradient(to bottom, rgba(255,250,240,0), rgba(255,250,240,.9));
    pointer-events: none;
}

@keyframes scrollBg {
    to { background-position: -2000px 0; }
}

/* Bao lì xì 3D */
.red-envelope {
    width: 300px;
    height: 550px;
    position: relative;
    transform-style: preserve-3d;
    animation: spinEnvelope 10s linear infinite;
    cursor: pointer;
}

@keyframes spinEnvelope {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}

.red-envelope:hover {
    animation-play-state: paused;
    transform: scale(1.1);
}

.face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    backface-visibility: hidden;
    background-size: cover;
    background-position: center;
    box-shadow: 0 30px 50px rgba(0,0,0,0.4);
    overflow: hidden;
}

.front {
    background-image: url('../image/front.png');
    transform: translateZ(4px);
}

.back {
    background-image: url('../image/back.png');
    transform: rotateY(180deg) translateZ(4px);
}

/* ============================= */
/* NÚT & POPUP (giữ nguyên) */
/* ============================= */

 .open-btn {
            position: fixed;
            bottom: 80px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 26px;
            font-weight: bold;
            color: #fff;
            background: #c8102e;
            padding: 15px 40px;
            border-radius: 50px;
            box-shadow: 0 10px 30px rgba(200, 16, 46, 0.5);
            cursor: pointer;
            z-index: 100;
            transition: all 0.3s;
        }

 .open-btn:hover {
            transform: translateX(-50%) scale(1.1);
            background: #b4ed38;
        }
.popup {
    position: absolute;
    padding: 30px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
    display: none;
    text-align: center;
}

.popup h1 {
    color: #d40000;
}
/* Làm ảnh có kích thước định sẵn */
.custom-card .card-img-top {
    height: 240px;           /* ← Mức định sẵn mình gợi ý (có thể đổi thành 200px, 220px, 260px...) */
    width: 100%;
    object-fit: cover;       /* Giữ nguyên tỷ lệ, không bị méo, cắt vừa khung */
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

/* Làm card đẹp hơn, nút button luôn nằm dưới cùng */
.custom-card {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.custom-card:hover {
    transform: translateY(-8px);
}

.custom-card .card-body {
    padding: 20px;
}