/*
Theme Name: Lucky Year of the Horse
Version: 51.0
Description: Stable Reverted Version with Horse Emojis
*/

/* --- 1. THE FOUNDATION --- */
html, body { 
    margin: 0; 
    padding: 0; 
    min-height: 100vh; 
    width: 100%;
    background: radial-gradient(circle, #8b0000 0%, #4a0000 100%) no-repeat fixed;
    overflow-x: hidden; 
    overflow-y: auto;   /* Standard scroll wheel enabled */
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.bg-pattern-layer {
    position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.15;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23FFD700'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* --- 1. THE MAIN WRAPPER --- */
.main-content {
    position: relative;
    z-index: 10;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;    /* Horizontal Center */
    justify-content: center; /* Vertical Center */
    text-align: center;
    padding: 40px 0;
    pointer-events: none;    /* Allows clicks to pass to the Carrd button */
}

/* --- 2. RE-ENABLE CLICKS FOR FRONTLINE ITEMS --- */
/* We MUST turn pointer-events back ON for these, or you can't click the "Reveal" button! */
.main-content header, 
.orange-container, 
.fortune-scroll, 
.mt-5,
#revealBtn {
    pointer-events: auto !important; 
}

/* --- 3. ENSURE THE HEADER & BUTTON AREA SPAN FULL WIDTH --- */
header, .mt-5 {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
/* --- 2. THE DRAGONS & ORANGE --- */
.orange-container {
    position: relative;
    width: 300px;
    margin: 40px auto;
}

.dragon-img {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 340px !important;
    z-index: -1;
    pointer-events: none;
    filter: drop-shadow(0 10px 30px rgba(0,0,0,0.6));
}

/* Reliable pinning to the sides of the orange */
.d-left { right: 125%; }
.d-right { left: 125%; }

/* Gentle Idle Animation */
@keyframes dragonBob {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-55%) scale(1.02); }
}
.dragon-img { animation: dragonBob 4s infinite ease-in-out; }

/* --- 3. THE REVEAL STATE --- */
.is-peeled .dragon-img {
    filter: drop-shadow(0 0 25px #fbbf24);
}

.number-display {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0);
    display: flex; gap: 6px; z-index: 20;
}
.is-peeled .number-display { transform: translate(-50%, -50%) scale(1); transition: 0.5s; }

.slot {
    width: 36px; height: 56px; background: #fbbf24; border: 2px solid #fff;
    border-radius: 6px; color: #8b0000; font-weight: 900;
    display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
}

.fortune-scroll {
    max-height: 0; overflow: hidden; transition: max-height 0.8s ease;
    background: #fdf5e6; border-left: 10px solid #b8860b; border-right: 10px solid #b8860b;
    width: 300px; margin-top: 20px;
}
.fortune-scroll.is-open { max-height: 300px; }

/* --- 4. PARTICLES & BUTTON --- */
.lantern-item, .gold-particle { position: fixed; z-index: 2; pointer-events: none; }
@keyframes rise { from { transform: translateY(0); opacity: 0; } to { transform: translateY(-110vh); opacity: 0.8; } }
@keyframes fall { from { transform: translateY(0); opacity: 0; } to { transform: translateY(110vh); opacity: 1; } }

#revealBtn {
    margin: 0 auto;
    display: inline-flex;
    position: relative;
    z-index: 100;
}

.gold-particle {
    position: fixed;
    top: -10vh;   /* 👈 THIS FIXES IT */
    left: 0;
    background: #ffd700;
    border-radius: 50%;
    z-index: 2;
    pointer-events: none;
    animation: fall var(--duration, 4s) linear infinite;
}

@keyframes fall {
    0%   { transform: translateY(0) translateX(0); }
    100% { transform: translateY(120vh) translateX(20px); }
}

@keyframes rise {
    0%   { transform: translateY(0) translateX(0); }
    100% { transform: translateY(-120vh) translateX(-20px); }
}
/* --- CARRD FLOATING BUTTON --- */
.carrd-btn {
    position: fixed !important;
    bottom: 30px !important;
    right: 30px !important;
    width: 60px !important;
    height: 60px !important;
    background-color: #49a7ff !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 999999 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5) !important;
    text-decoration: none !important;
}

.carrd-btn:hover {
    transform: scale(1.1) translateY(-5px);
    background-color: #2b94ff !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.6) !important;
}

.carrd-btn svg {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.hover-label {
    position: absolute;
    right: 80px;
    background: #111;
    color: #fff;
    padding: 6px 15px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    border: 1px solid #49a7ff;
    transform: translateX(10px);
}

.carrd-btn:hover .hover-label {
    opacity: 1;
    transform: translateX(0);
}

/* Mobile Adjustments */
@media (max-width: 480px) {
    .carrd-btn {
        bottom: 20px !important;
        right: 20px !important;
        width: 55px !important;
        height: 55px !important;
    }
    .hover-label { display: none; } /* Hide label on mobile to save space */
}