/* ==========================================================================
   Dilings 福袋快問快答 (活動擴充模組專屬樣式)
   ========================================================================== */

/* 1. 漂浮入口群組容器 (手機版預設位置：左上角) */
#event-trigger-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column; 
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    background: transparent; 
    border: none;
    overflow: visible;       
    animation: event-bounce 2s infinite ease-in-out;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), bottom 0.3s, right 0.3s, opacity 0.3s;
}

#event-trigger-btn:hover {
    transform: scale(1.1) rotate(-5deg);
    animation: none; 
}

/* 財袋圖片與發光特效 */
.event-trigger-img {
    width: 65px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0px 0px 15px rgba(244, 63, 94, 0.8)) drop-shadow(0px 4px 5px rgba(0,0,0,0.3));
    transition: width 0.3s;
    
    padding: 20px;              
    margin: -20px;              
    box-sizing: content-box;    
}

/* 「限時領取」標籤樣式 */
.event-trigger-text {
    margin-top: 2px;
    background: linear-gradient(135deg, #f43f5e 0%, #fb7185 100%);
    color: white;
    font-size: 11px;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 20px; 
    letter-spacing: 1px;
    box-shadow: 0 4px 10px rgba(244, 63, 94, 0.5);
    border: 1.5px solid white; 
    white-space: nowrap;
}

/* 針對電腦版重新定位到右下角 Bobo 頭上 */
@media (min-width: 768px) {
    #event-trigger-btn {
        top: auto;
        left: auto;          
        bottom: 380px; 
        right: 35px;         
    }
    
    .event-trigger-img {
        width: 85px;
    }
    
    .event-trigger-text {
        font-size: 13px;
        padding: 4px 12px;
        margin-top: 4px;
    }
}

@keyframes event-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* 2. 活動全螢幕遮罩 */
#event-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#event-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 3. 活動主視窗 (Modal) */
#event-modal {
    background: url('/public/images/event-bg.jpg') center center / cover no-repeat #ffffff;
    width: 90%;
    max-width: 480px;
    border-radius: 30px;
    padding: 20px 20px 8px 20px; 
    max-height: 85vh; 
    overflow-y: auto; 
    border: 4px solid #ffe4e6;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.8) translateY(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

/* 隱藏彈窗內的捲軸以保持美觀 */
#event-modal::-webkit-scrollbar {
    width: 4px;
}
#event-modal::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 10px;
}

#event-overlay.active #event-modal {
    transform: scale(1) translateY(0);
}

/* 4. 驗證碼畫布與錯誤震動特效 */
#event-captcha-canvas {
    background-color: #f3f4f6;
    border-radius: 12px;
    cursor: pointer;
    letter-spacing: 4px;
}

.event-shake-wrong {
    animation: event-shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
    border-color: #ef4444 !important;
}

@keyframes event-shake {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(4px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-8px, 0, 0); }
    40%, 60% { transform: translate3d(8px, 0, 0); }
}

/* 5. 遊戲選項按鈕 */
.event-option-btn {
    width: 100%;
    padding: 16px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    font-weight: bold;
    color: #334155;
    text-align: left;
    transition: all 0.2s;
    cursor: pointer;
    /* ★ 已移除原本的 margin-bottom: 12px; 交由 JS 的 flex gap 控制 ★ */
    -webkit-tap-highlight-color: transparent; 
    outline: none;
}

@media (hover: hover) {
    .event-option-btn:hover:not(:disabled) {
        background: #fff1f2;
        border-color: #fda4af;
        color: #e11d48;
        transform: translateX(4px);
    }
}

.event-option-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.event-option-btn.correct {
    background: #dcfce7 !important;
    border-color: #22c55e !important;
    color: #166534 !important;
}

/* 6. 開獎閃耀特效 */
.event-glow-text {
    background: linear-gradient(135deg, #e11d48 0%, #fb7185 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: text-pulse 2s infinite;
}

@keyframes text-pulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); drop-shadow: 0 0 10px rgba(225, 29, 72, 0.5); }
}

/* 7. 時間倒數進度條 (黃金升級版) */
.event-timer-container {
    width: 100%;
    height: 8px;
    background-color: #fffbeb; 
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.event-timer-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFE57F 0%, #FFB300 50%, #FF8F00 100%);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), 0 0 8px rgba(255, 179, 0, 0.5);
    border-radius: 99px;
    transition: width 1s linear, background 0.3s, box-shadow 0.3s;
}

.event-timer-fill.danger {
    background: linear-gradient(90deg, #ef4444, #dc2626); 
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.3), 0 0 8px rgba(239, 68, 68, 0.6);
}

/* ==========================================
   ★ 活動挑戰成功畫面 (客製化圖片與毛玻璃)
   ========================================== */
.success-image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.success-result-img {
    width: 100%;
    max-width: 260px; 
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0px 8px 15px rgba(255, 126, 95, 0.3));
}

@media (max-width: 767px) {
    .success-result-img {
        max-width: 220px; 
    }
}

/* 專屬黃金開獎按鈕特效 */
.event-gold-btn {
    background: linear-gradient(135deg, #FFE57F 0%, #FFB300 50%, #FF8F00 100%);
    box-shadow: 0 4px 15px rgba(255, 179, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.5);
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
}
.event-gold-btn:hover {
    background: linear-gradient(135deg, #FFF0A5 0%, #FFC107 50%, #FFA000 100%);
}

/* 專屬黃金漸層文字特效 */
.event-gold-text {
    background: linear-gradient(135deg, #FFE57F 0%, #FFB300 50%, #FF8F00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0px 2px 3px rgba(0, 0, 0, 0.4));
}