/* --- General Styles for Lucky Money Container --- */
#lucky-money-container-wrapper {
    display: flex;
    justify-content: center;
    padding: 20px 10px; /* Add some padding for smaller screens */
    box-sizing: border-box;
}

#lucky-money-container {
    font-family: 'Arial', sans-serif; /* Hoặc một font bạn thích */
    text-align: center;
    padding: 25px;
    border: 1px solid #e0e0e0;
    max-width: 650px; /* Tăng max-width một chút */
    width: 100%; /* Đảm bảo responsive */
    margin: 20px auto;
    background-color: #fff9f0; /* Màu nền hơi kem/vàng nhạt cho không khí Tết */
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    position: relative; /* For absolute positioning of loading/error if needed */
    overflow: hidden; /* Tránh các element con tràn ra ngoài */
    box-sizing: border-box;
}

#lucky-money-container h2 {
    color: #e74c3c; /* Màu đỏ chủ đạo */
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 2em; /* Tăng kích thước */
    font-weight: bold;
}

#lucky-money-container h2 span[role="img"] {
    font-size: 0.9em;
    vertical-align: middle;
}

#lucky-money-container p {
    color: #ff0000;
    font-size: 1.1em; /* Tăng kích thước chữ cho dễ đọc */
    line-height: 1.6;
    margin-bottom: 15px;
}

/* --- User Input Section --- */
#lmp-user-input-section {
    margin-top: 30px;
}

#lmp-user-input-section label {
    display: block;
    margin-bottom: 0px;
    font-weight: bold;
    color: #333;
    font-size: 1.1em;
}

#lmp-user-input-section input[type="text"] {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    width: calc(100% - 32px); /* Account for padding and border */
    max-width: 250px;
    margin-bottom: 5px;
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#lmp-user-input-section input[type="text"]:focus {
    border-color: #e74c3c;
    box-shadow: 0 0 8px rgba(231, 76, 60, 0.3);
    outline: none;
}

/* --- Buttons --- */
.lmp-button {
    background-color: #e74c3c; /* Màu đỏ */
    color: white;
    border: none;
    padding: 5px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 1.1em;
    font-weight: bold;
    margin-top: 0px;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    min-width: 180px; /* Chiều rộng tối thiểu cho button */
}

.lmp-button:hover,
.lmp-button:focus {
    background-color: #c0392b; /* Màu đỏ đậm hơn */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    outline: none;
}
.lmp-button:active {
    transform: translateY(0px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}


.lmp-button-secondary {
    background-color: #7f8c8d; /* Màu xám */
    margin-left: 10px; /* Khoảng cách giữa các button */
}

.lmp-button-secondary:hover,
.lmp-button-secondary:focus {
    background-color: #606c6d; /* Màu xám đậm hơn */
}

.lmp-button-telegram {
    background-color: #0088cc; /* Màu xanh Telegram */
}
.lmp-button-telegram:hover,
.lmp-button-telegram:focus {
    background-color: #0077b3;
}
.lmp-telegram-icon {
    width: 1em;
    height: 1em;
    vertical-align: -0.125em; /* Căn chỉnh icon */
    margin-right: 8px;
}
/* THÊM MỚI: Style cho nút Viber */
.lmp-button-viber {
    background-color: #665CAC; /* Màu tím Viber */
}
.lmp-button-viber:hover,
.lmp-button-viber:focus {
    background-color: #534b8c; /* Màu tím đậm hơn */
}

/* THÊM MỚI: Style chung cho icon trong nút */
.lmp-icon {
    width: 1em;
    height: 1em;
    vertical-align: -0.125em; /* Căn chỉnh icon */
    margin-right: 8px;
}

/* --- Envelopes Section --- */
#lmp-envelopes-section {
    margin-top: 20px;
    padding: 10px;
}
.lmp-envelopes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); /* Responsive grid */
    gap: 20px; /* Tăng khoảng cách */
    margin-top: 20px;
    justify-items: center; /* Căn giữa các item trong grid cell */
}

.lmp-envelope {
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    border-radius: 8px; /* Bo tròn nhẹ nếu ảnh không có */
    padding: 5px; /* Padding nhỏ xung quanh ảnh */
    background-color: transparent; /* Nền trong suốt */
}

.lmp-envelope img {
    width: 100px; /* Kích thước mặc định */
    height: auto;
    display: block;
    border-radius: 6px; /* Bo tròn ảnh nếu có */
    user-select: none; /* Tránh user kéo thả ảnh */
    -webkit-user-drag: none; /* Tránh user kéo thả ảnh */
}

.lmp-envelope:hover {
    transform: scale(1.15) rotate(3deg); /* Hiệu ứng nghiêng nhẹ và phóng to */
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.4); /* Đổ bóng màu đỏ */
}

.lmp-envelope.selected {
    transform: scale(1.25);
    box-shadow: 0 0 25px rgba(46, 204, 113, 0.7); /* Đổ bóng màu xanh khi chọn */
    border: 2px solid #2ecc71; /* Viền xanh khi chọn */
    pointer-events: none; /* Không cho click lại khi đã chọn */
}

.lmp-envelope.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: scale(0.9); /* Thu nhỏ các bao lì xì không được chọn */
    filter: grayscale(50%); /* Hơi xám đi */
}


/* --- Result Section --- */
#lmp-result-section {
    margin-top: 25px;
    padding: 20px;
    border: 1px dashed #f39c12; /* Viền cam */
    background-color: #fff;
    border-radius: 8px;
    animation: fadeInResult 0.5s ease-out;
}

@keyframes fadeInResult {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

#lmp-result-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.8em;
}
#lmp-result-section h3.win { color: #2ecc71; /* Xanh lá cho thắng */ }
#lmp-result-section h3.lose { color: #7f8c8d; /* Xám cho thua */ }
#lmp-result-section h3.no-prize { color: #f39c12; /* Cam cho hết giải */ }


#lmp-prize-details {
    margin-top: 15px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #eee;
}
#lmp-prize-details p {
    font-size: 1.1em;
    color: #333;
    margin: 8px 0;
}
#lmp-prize-details strong {
    color: #e74c3c; /* Màu đỏ cho thông tin giải thưởng */
    font-weight: bold;
}


/* --- Loading and Error Messages --- */
#lmp-loading, #lmp-error-message {
    margin-top: 25px;
    padding: 15px;
    border-radius: 6px;
    font-size: 1.1em;
    font-weight: bold;
}

#lmp-loading {
    color: #3498db; /* Xanh dương cho loading */
    background-color: #eaf5ff;
    border: 1px solid #aed6f1;
}

#lmp-error-message {
    color: #c0392b; /* Đỏ cho lỗi */
    background-color: #fdecea;
    border: 1px solid #f5b7b1;
}
/* Trong style.css */
#lmp-user-input-section input[type="tel"] {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    width: calc(100% - 32px);
    max-width: 250px;
    margin-bottom: 15px; /* Thêm khoảng cách dưới nếu cần */
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#lmp-user-input-section input[type="tel"]:focus {
    border-color: #e74c3c;
    box-shadow: 0 0 8px rgba(231, 76, 60, 0.3);
    outline: none;
}
#lmp-user-input-section {
    display: inline-block;
}

/* THÊM MỚI: Kiểu cho ảnh/gif dưới tiêu đề */
.almp-under-title-image {
    margin-top: 10px; /* Khoảng cách với tiêu đề */
    margin-bottom: 20px; /* Khoảng cách với phần nhập liệu */
    text-align: center; /* Căn giữa ảnh nếu nó nhỏ hơn container */
}

.almp-under-title-image img {
    max-width: 100%; /* Responsive, không vượt quá chiều rộng container */
    height: auto; /* Giữ tỷ lệ khung hình */
    max-height: 200px; /* Giới hạn chiều cao nếu cần, có thể điều chỉnh hoặc xóa bỏ */
    border-radius: 8px; /* Bo góc nhẹ cho đẹp */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Bóng đổ nhẹ */
}

.almp-step-container {
    padding: 10px 0;
}

#lucky-money-container {
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
    padding-bottom: 150px; /* Tăng padding dưới để ảnh nền không che nội dung */
}

.lmp-button-register {
    padding: 5px 10px;
    font-size: 1em;
    border-radius: 50px;
    text-transform: uppercase;
    background: radial-gradient(circle 214px at 49.5% 54.2%, #e10d0d 0, #ffffff 96%);
    border: solid #efecec 3px !important;
    color: #fff !important;
}
.lmp-button-register:hover {
    background-color: #c8a432;
}

.almp-intro-text {
    font-size: 1.2em;
    color: #fff;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    line-height: 1.5;
}

/* --- CSS cho danh sách giải thưởng --- */
.almp-prizes-title {
    color: #ff0000 !important;
    font-size: 1.5em;
    text-transform: uppercase;
    margin-top: 20px;
    margin-bottom: 15px;
}

.almp-prize-list-area ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.almp-prize-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px;
    border-radius: 5px;
    font-size: 1.2em;
    max-width: 300px;
    margin: 0 auto;
}

.almp-prize-item .prize-name {
    color: #ffffff;
    font-weight: bold;
}
.almp-prize-item .prize-value {
    color: #f0e68c; /* Màu vàng nhạt */
}

/* --- CSS LÀM NỔI BẬT GIẢI THƯỞNG --- */
.almp-prize-item.prize-special {
    background: linear-gradient(90deg, #ff5f6d, #ffc371); /* Gradient cam đỏ */
    color: white;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 195, 113, 0.7);
}
.almp-prize-item.prize-special .prize-name,
.almp-prize-item.prize-special .prize-value {
    color: #ffffff;
    text-shadow: 1px 1px 2px #000;
}

.almp-prize-item.prize-first {
    background: #c0c0c0; /* Màu bạc */
    color: #333;
    border-left: 5px solid #ffd700; /* Viền vàng */
}
.almp-prize-item.prize-first .prize-name,
.almp-prize-item.prize-first .prize-value {
    color: #2c3e50;
}
/* --- CSS cho form nhập liệu --- */
#lmp-user-input-section label {
    color: #ffd700;
    text-align: left;
    max-width: 350px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}
.almp-prizes-title {
    margin-bottom: 150px;
}
.almp-prize-list-area {
    margin: -50px 0px 50px 0px;
}
input#lmp-account-name[type=text], input#lmp-phone-number[type=tel] {
    background-color: #ffd700;
}
/* Ẩn ảnh nền khi vào màn chơi chọn lì xì */
#lucky-money-container.game-started {
    background-image: none !important;
}

/* Style cho các nút ở Bước 1 */
#almp-step-1-register .lmp-button {
    display: block;
    width: 80%;
    max-width: 350px;
    margin: 15px auto;
    padding: 12px;
    font-size: 1.1em;
}

#almp-step-1-register .lmp-button-main-register {
    background-color: #d4af37; /* Màu vàng gold */
    color: #fff;
}

#almp-step-1-register .lmp-button-continue {
    background-color: #e74c3c; /* Màu đỏ mặc định */
}

#almp-step-1-register .almp-intro-text {
    color: #ff0000;
    margin: 20px 0;
    font-size: 1em;
}
a.lmp-button.lmp-button-main-register {
    margin-bottom: 150px !important;
}
#lmp-result-title {
    background: linear-gradient(90deg, #ff5f6d, #ffc371);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 195, 113, 0.7);
}
/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    #almp-goto-step-2{
        max-width: 220px!important;
        margin: 0px auto!important;
        padding: 2px!important;
        font-size: 0.9em!important;
    }
    #almp-step-1-register {
        margin-bottom: 80px;
    }
    #almp-step-1-register .almp-intro-text {
        font-size: 0.8em;
    }
    #lucky-money-container {
        padding: 20px;
    }
    #lucky-money-container h2 {
        font-size: 1.8em;
    }
    .lmp-envelopes-grid {
        grid-template-columns: repeat(auto-fit, minmax(85px, 1fr)); /* Lì xì nhỏ hơn trên mobile */
        gap: 15px;
    }
    .lmp-envelope img {
        width: 85px;
    }
    .lmp-button {
        padding: 5px 10px;
        font-size: 0.8em;
    }
    #almp-goto-step-3 {
        max-width: 200px;
    }
    .almp-prize-list-area {
        margin: -80px 0px 80px 0px;
    }
    .almp-prize-item {
        font-size: 0.8em;
        max-width: 220px;
    }
    input#lmp-account-name[type=text], input#lmp-phone-number[type=tel] {
        max-width: 180px;
        height: 1.8em;
    }
    #lmp-user-input-section {
        margin-bottom: 20px;
    }
    a.lmp-button.lmp-button-main-register {
        margin-bottom: 100px !important;
    }
    #lmp-contact-cskh-viber {
        max-width: 300px !important;
    }
}

@media (max-width: 480px) {
    #lucky-money-container h2 {
        font-size: 1.6em;
    }
     #lucky-money-container p {
        font-size: 0.8em;
    }
    .lmp-envelopes-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 cột trên màn hình rất nhỏ */
        gap: 10px;
    }
     .lmp-envelope img {
        width: calc(100% - 10px); /* Cho ảnh full width trong grid cell nhỏ */
        max-width: 100px; /* Giới hạn max width */
    }
    .lmp-button {
        max-width: 100px;
        margin-bottom: 10px;
    }
    .lmp-button-secondary {
        margin-left: 0; /* Stack buttons trên mobile */
    }
    #lmp-result-section h3 {
        font-size: 1.5em;
    }
    /* Điều chỉnh ảnh dưới tiêu đề cho màn hình nhỏ nếu cần */
    .almp-under-title-image img {
        max-height: 150px; /* Giảm chiều cao tối đa trên mobile */
    }
}