:root {
    --primary-font: 'Quicksand', sans-serif;
    --heading-font: 'Playfair Display', serif;
    
    /* --- MÀU SẮC --- */
    
    /* Màu chữ chính */
    --text-color: #333333; 
    
    /* Màu tiêu đề (Hồng Đỏ Neon) */
    --title-color: #ff2e63; 
    
    /* Nền thẻ: Trắng đục */
    --card-bg: rgba(255, 255, 255, 0.85); 
    --card-border: rgba(255, 255, 255, 0.4);
    
    /* Các màu điểm nhấn */
    --accent-color: #d32f2f; 
    --highlight-color: #d32f2f; 
    
    --btn-bg: linear-gradient(45deg, #ff2e63, #ff512f);
    --input-bg: rgba(0, 0, 0, 0.05);
    --modal-overlay: rgba(255, 255, 255, 0.6);
    --reveal-btn-bg: linear-gradient(45deg, #FDC830, #F37335);
}

/* Reset & Base */
* { margin: 0; padding: 0; box-sizing: border-box; transition: all 0.3s ease; }

body {
    font-family: var(--primary-font);
    
    /* --- CẬP NHẬT BACKGROUND --- */
    /* Chỉ dùng 1 lớp đen mờ nhẹ (0.3) để chữ dễ đọc, không đổi màu ảnh */
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)),
        url('https://images.unsplash.com/photo-1467810563316-b5476525c0f9?q=80&w=2069&auto=format&fit=crop');
    
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-color: #1a1a2e; /* Màu nền dự phòng khi ảnh chưa load */
    
    /* ĐÃ XÓA background-blend-mode để giữ nguyên màu ảnh gốc */
    
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* --- TYPOGRAPHY --- */
.title {
    font-family: var(--heading-font);
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    color: var(--title-color);
    /* Tăng bóng đen để chữ nổi bật trên ảnh gốc */
    text-shadow: 0 0 25px rgba(255, 46, 99, 0.8), 2px 2px 4px rgba(0,0,0,0.8); 
}

.year-highlight {
    color: #ffd700;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
    text-shadow: 0 0 15px #ffd700, 2px 2px 4px rgba(0,0,0,0.8);
    margin-left: 10px;
}

.subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    font-weight: 600;
    color: #ffffff; /* Chữ trắng hoàn toàn */
    text-shadow: 0 2px 8px rgba(0,0,0,0.9); /* Bóng đậm để đọc rõ trên mọi nền */
}

/* --- LAYOUT & COMPONENTS --- */
.container {
    width: 100%;
    max-width: 600px;
    padding: 2rem 1rem;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 1;
}

/* Countdown Grid */
.countdown-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 3rem;
}

.time-box {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.2rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    color: var(--text-color);
}

.time-box span:first-child {
    font-size: 2.2rem;
    font-weight: 700;
    font-family: var(--heading-font);
    color: #d32f2f;
}

.label {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 0.3rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #555;
}

/* Glass Card Generic */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    color: var(--text-color);
}

/* --- REVEAL BUTTON & NEW YEAR MSG --- */
#new-year-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

#new-year-message h2 {
    font-family: var(--heading-font);
    font-size: 2.8rem;
    color: var(--title-color);
    text-shadow: 0 0 30px rgba(255, 46, 99, 0.8), 2px 2px 4px rgba(0,0,0,0.8);
    animation: pop 1s infinite alternate;
    line-height: 1.3;
}

.reveal-btn {
    background: var(--reveal-btn-bg);
    color: white;
    border: none;
    padding: 16px 32px;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(243, 115, 53, 0.6);
    animation: pulse 2s infinite;
    font-family: var(--primary-font);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.reveal-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(243, 115, 53, 0.8);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(243, 115, 53, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(243, 115, 53, 0); }
    100% { box-shadow: 0 0 0 0 rgba(243, 115, 53, 0); }
}

/* Animation Reveal */
.wish-section { margin-top: 1rem; }

.reveal-animation {
    animation: slideUpFade 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(40px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- INPUTS & BUTTONS --- */
.wish-section h3 { margin-bottom: 1rem; font-weight: 700; font-size: 1.2rem; color: #333; }

.input-group { display: flex; gap: 10px; flex-wrap: wrap; }

input {
    flex: 1;
    padding: 14px 15px;
    border-radius: 10px;
    border: 1px solid #ccc;
    background: var(--input-bg);
    color: #333;
    outline: none;
    font-size: 1rem;
    font-weight: 600;
}
input::placeholder { color: #888; }

.primary-btn, .secondary-btn {
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-family: var(--primary-font);
}

.primary-btn {
    background: var(--btn-bg);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 46, 99, 0.3);
}

.secondary-btn {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
    flex: 1;
}
.secondary-btn:hover { background: #e0e0e0; }

/* --- MODAL --- */
.wish-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; transition: opacity 0.4s ease;
}
.wish-overlay.active { opacity: 1; pointer-events: all; }

.wish-modal {
    width: 90%; max-width: 500px; position: relative;
    transform: scale(0.8); transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    background: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 2.5rem 2rem;
}
.wish-overlay.active .wish-modal { transform: scale(1); }

.close-btn {
    position: absolute; top: 15px; right: 15px;
    background: #f0f0f0; border: none; color: #333;
    font-size: 1.2rem; width: 30px; height: 30px; border-radius: 50%;
    cursor: pointer; opacity: 1; transition: 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.close-btn:hover { background: #e0e0e0; transform: rotate(90deg); }

.modal-title {
    color: var(--title-color);
    margin-bottom: 1.5rem;
    font-family: var(--heading-font); font-size: 1.8rem; text-align: center;
}

.action-buttons { display: flex; gap: 10px; justify-content: center; margin-top: 2rem; }

/* Text Animation & Highlight */
.animated-text {
    font-size: 1.3rem; line-height: 1.6; min-height: 80px;
    display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem; font-style: italic;
    color: #333;
}
.word { opacity: 0; transform: translateY(20px); display: inline-block; animation: wordReveal 0.6s cubic-bezier(0.2, 1, 0.3, 1) forwards; }

.highlight-name {
    color: var(--highlight-color); font-weight: 800; font-style: normal;
    text-transform: uppercase;
}
@keyframes wordReveal { to { opacity: 1; transform: translateY(0); } }

/* Utilities */
.hidden { display: none !important; }
.error-msg { color: #d32f2f; font-size: 0.9rem; margin-top: 0.8rem; min-height: 1.2rem; font-weight: 700; }

@keyframes pop {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.tick { animation: pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.footer { padding: 1.5rem; font-size: 0.85rem; opacity: 0.8; margin-top: auto; font-weight: 600; color: white; text-shadow: 0 1px 2px rgba(0,0,0,0.8); }

/* Mobile */
@media (max-width: 480px) {
    .title { font-size: 2.5rem; }
    .countdown-grid { gap: 0.5rem; }
    .time-box { padding: 0.8rem 0.2rem; }
    .wish-modal { padding: 2rem 1.5rem; }
}

/* --- 1. MUSIC BUTTON --- */
.music-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1000;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    animation: pulse-music 2s infinite;
}

.music-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

@keyframes pulse-music {
    0% { box-shadow: 0 0 0 0 rgba(255, 46, 99, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(255, 46, 99, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 46, 99, 0); }
}

/* --- 2. LIXI ENVELOPES (MINIGAME) --- */
.lixi-section {
    margin-top: 2rem;
    text-align: center;
    animation: slideUpFade 0.6s ease forwards;
}

.lixi-section h3 {
    color: #ffffff;
    margin-bottom: 2rem;
    font-size: 1.5rem;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.envelopes-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.envelope {
    width: 100px;
    height: 160px;
    background: #d32f2f; /* Đỏ lì xì */
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    border: 2px solid #ffd700; /* Viền vàng */
    display: flex;
    align-items: center;
    justify-content: center;
}

.envelope:hover {
    transform: translateY(-10px) rotate(2deg);
}

/* Nắp bao lì xì */
.envelope-cap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: #b71c1c;
    border-radius: 8px 8px 50% 50%;
    z-index: 2;
    border-bottom: 2px solid #ffd700;
}

/* Chữ trên bao */
.envelope-text {
    font-family: var(--heading-font);
    color: #ffd700;
    font-size: 1.8rem;
    font-weight: bold;
    z-index: 3;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    border: 2px solid #ffd700;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #b71c1c;
}

/* Animation lắc lư mời gọi */
.envelope:nth-child(1) { animation: shake 3s infinite; }
.envelope:nth-child(2) { animation: shake 3s 0.2s infinite; }
.envelope:nth-child(3) { animation: shake 3s 0.4s infinite; }

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    10%, 30%, 50%, 70%, 90% { transform: rotate(-3deg); }
    20%, 40%, 60%, 80% { transform: rotate(3deg); }
}

/* --- 3. LUCKY MONEY DISPLAY --- */
.lucky-money {
    font-size: 1.5rem;
    color: #d32f2f;
    font-weight: 800;
    margin-bottom: 1rem;
    padding: 10px;
    border: 2px dashed #d32f2f;
    border-radius: 10px;
    background: rgba(255, 215, 0, 0.2);
    display: inline-block;
    animation: pop 0.5s ease;
}

/* --- RESPONSIVE --- */
@media (max-width: 480px) {
    .envelopes-container { gap: 10px; }
    .envelope { width: 80px; height: 130px; }
    .envelope-text { font-size: 1.4rem; width: 40px; height: 40px; }
}