/* Lixi Page Styles */
.lixi-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 20px;
    background: radial-gradient(circle, #ffebee 0%, #ffcdd2 100%);
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}

.lixi-title {
    color: #d32f2f;
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

/* Red Envelope Styles */
.red-envelope {
    width: 200px;
    height: 300px;
    background: #d32f2f;
    position: relative;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.3s ease;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.red-envelope:hover {
    transform: translateY(-5px) scale(1.02);
}

.red-envelope:active {
    transform: scale(0.95);
}

/* Envelope Flap */
.red-envelope::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: #b71c1c;
    border-radius: 0 0 50% 50% / 0 0 20px 20px;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    transform-origin: top;
    transition: transform 0.5s ease-in-out;
    z-index: 12;
}

.red-envelope.active::before {
    transform: rotateX(180deg);
    z-index: 9;
}

/* Decorative Gold Circle */
.gold-seal {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, #fdd835 0%, #fbc02d 100%);
    border-radius: 50%;
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #d32f2f;
    font-weight: bold;
    font-size: 24px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 13;
    border: 2px solid #fff59d;
}

.red-envelope.active .gold-seal {
    display: none;
}

/* Envelope Body Pattern */
.envelope-pattern {
    position: absolute;
    bottom: 20px;
    width: 80%;
    text-align: center;
    color: #fdd835;
    font-family: 'Times New Roman', serif;
    font-size: 32px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.8;
}

/* Coin/Money Animation */
.money-content {
    position: absolute;
    width: 90%;
    height: 80%;
    background: #fff;
    bottom: 0;
    left: 5%;
    border-radius: 5px 5px 0 0;
    transform: translateY(100%);
    transition: transform 0.5s ease-in-out 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 11;
}

.red-envelope.active .money-content {
    transform: translateY(-20px);
}

.reward-amount {
    font-size: 24px;
    color: #d32f2f;
    font-weight: bold;
    margin-bottom: 10px;
}

.reward-msg {
    font-size: 14px;
    color: #555;
    text-align: center;
}

/* Confetti Effect */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #fdd835;
    animation: fall linear forwards;
}

@keyframes fall {
    0% {
        transform: translateY(-50px) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(600px) rotate(360deg);
        opacity: 0;
    }
}

/* Message Box */
.lixi-message {
    margin-top: 30px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.lixi-message p {
    margin: 5px 0;
    color: #444;
}

.btn-open {
    margin-top: 20px;
    background: #d32f2f;
    color: white;
    font-size: 1.1rem;
    padding: 10px 30px;
    border-radius: 25px;
    box-shadow: 0 4px 10px rgba(211, 47, 47, 0.3);
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-open:hover {
    background: #b71c1c;
    transform: scale(1.05);
}

.btn-open:disabled {
    background: #9e9e9e;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ========== HORSE DECORATIONS (Bính Ngọ) ========== */

/* Unopened state centering */
#unopenedState {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Horse container flanking the envelope */
.horse-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 0 auto;
}

.horse-decoration {
    font-size: 4rem;
    animation: horseGallop 1.2s ease-in-out infinite;
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.15));
    user-select: none;
}

.horse-decoration.left {
    transform: scaleX(-1);
    animation-delay: 0.3s;
}

.horse-decoration.right {
    animation-delay: 0s;
}

@keyframes horseGallop {

    0%,
    100% {
        transform: translateY(0);
    }

    25% {
        transform: translateY(-12px) rotate(-3deg);
    }

    50% {
        transform: translateY(-5px);
    }

    75% {
        transform: translateY(-10px) rotate(3deg);
    }
}

.horse-decoration.left {
    animation-name: horseGallopLeft;
}

@keyframes horseGallopLeft {

    0%,
    100% {
        transform: scaleX(-1) translateY(0);
    }

    25% {
        transform: scaleX(-1) translateY(-12px) rotate(-3deg);
    }

    50% {
        transform: scaleX(-1) translateY(-5px);
    }

    75% {
        transform: scaleX(-1) translateY(-10px) rotate(3deg);
    }
}

/* Floating golden coins around the container */
.lixi-container::before {
    content: '🐴';
    position: absolute;
    top: 15px;
    left: 20px;
    font-size: 2.5rem;
    opacity: 0.2;
    animation: floatSlow 4s ease-in-out infinite;
}

.lixi-container::after {
    content: '🐴';
    position: absolute;
    bottom: 15px;
    right: 20px;
    font-size: 2.5rem;
    opacity: 0.2;
    transform: scaleX(-1);
    animation: floatSlow 4s ease-in-out infinite 1s;
}

@keyframes floatSlow {

    0%,
    100% {
        transform: translateY(0);
        opacity: 0.15;
    }

    50% {
        transform: translateY(-8px);
        opacity: 0.25;
    }
}

/* Corner horse trail decorations */
.horse-trail {
    position: absolute;
    font-size: 1.2rem;
    opacity: 0.12;
    pointer-events: none;
}

.horse-trail.tl {
    top: 50px;
    left: 60px;
}

.horse-trail.tr {
    top: 50px;
    right: 60px;
}

.horse-trail.bl {
    bottom: 50px;
    left: 60px;
}

.horse-trail.br {
    bottom: 50px;
    right: 60px;
}

/* Year banner */
.year-banner {
    display: block;
    width: fit-content;
    margin: 0 auto 10px auto;
    background: linear-gradient(135deg, #c62828, #d32f2f);
    color: #fdd835;
    padding: 6px 24px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    letter-spacing: 2px;
    box-shadow: 0 2px 8px rgba(198, 40, 40, 0.3);
    text-align: center;
}

/* Responsive */
@media (max-width: 500px) {
    .horse-decoration {
        font-size: 2.5rem;
    }

    .horse-wrapper {
        gap: 10px;
    }
}