/* =================================================================
   GAMIFICATION STYLES (v6.0 - Smart Position & Real Wheel Icon)
   ================================================================= */

/* Nút kích hoạt nổi */
.sbm-lucky-wheel-btn {
    position: fixed;
    /* Vị trí mặc định: Nằm trên nút Footer Toggle (Footer cao ~50px + khoảng cách) */
    bottom: 90px; 
    right: 20px;
    width: 55px; height: 55px;
    
    /* Nền trắng để làm nổi bật Icon màu sắc */
    background: #fff; 
    border-radius: 50%;
    
    /* Shadow nhẹ + Viền trắng để tách biệt nền */
    box-shadow: 0 4px 15px rgba(0,0,0,0.15), 0 0 0 2px #fff;
    
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; 
    z-index: 9990; 
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden; /* Cắt gọn SVG bên trong */
}

/* Hiệu ứng khi di chuột: Xoay nhẹ */
.sbm-lucky-wheel-btn:hover { 
    transform: scale(1.1) rotate(180deg); 
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

/* SVG Icon lấp đầy nút */
.sbm-lucky-wheel-btn svg { 
    width: 100%; 
    height: 100%; 
    display: block;
}

/* --- LOGIC VỊ TRÍ THÔNG MINH --- */

/* Khi Footer mở rộng (để xem Cơ sở pháp lý) -> Đẩy nút Vòng quay lên cao hẳn */
body.sbm-footer-expanded .sbm-lucky-wheel-btn {
    bottom: 260px; /* Đủ cao để né danh sách link trong Footer */
}

/* --- TOOLTIP THÔNG BÁO (Giữ nguyên) --- */
.sbm-wheel-tooltip {
    position: absolute; right: 70px; top: 50%; transform: translateY(-50%);
    background-color: #fff; color: #ef4444; padding: 6px 12px;
    border-radius: 20px; font-size: 0.85rem; font-weight: 700; white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); pointer-events: none; display: flex; align-items: center;
}
.sbm-wheel-tooltip::after {
    content: ''; position: absolute; right: -6px; top: 50%; transform: translateY(-50%);
    border-left: 6px solid #fff; border-top: 6px solid transparent; border-bottom: 6px solid transparent;
}
.sbm-wheel-tooltip.is-blinking { animation: sbm-tooltip-bounce 2s infinite; }
@keyframes sbm-tooltip-bounce {
    0%, 100% { transform: translateY(-50%) translateX(0); }
    50% { transform: translateY(-50%) translateX(-5px); }
}

/* --- CÁC PHẦN POPUP (Giữ nguyên không đổi) --- */
.sbm-wheel-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 100000; display: none; overflow-y: auto; padding: 20px 0; backdrop-filter: blur(8px); opacity: 0; transition: opacity 0.3s ease; align-items: flex-start; }
.sbm-wheel-overlay.is-visible { opacity: 1; }
.sbm-wheel-wrapper-col { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px; margin: auto; padding: 20px; position: relative; }
.sbm-wheel-container { position: relative; width: 500px; height: 500px; border-radius: 50%; box-shadow: 0 0 60px rgba(251, 191, 36, 0.4); transition: transform 0.3s ease; flex-shrink: 0; }
.sbm-wheel-timer { display: none; min-width: 300px; padding: 15px 30px; background: rgba(31, 41, 55, 0.9); border: 2px solid rgba(255, 255, 255, 0.2); border-radius: 16px; color: #e5e7eb; font-size: 1.1rem; font-weight: 500; text-align: center; box-shadow: 0 10px 25px rgba(0,0,0,0.5); animation: sbm-slide-up-fade 0.5s ease forwards; z-index: 100; }
.sbm-wheel-timer span { display: block; color: #fbbf24; font-family: 'Courier New', monospace; font-size: 2rem; font-weight: 800; letter-spacing: 4px; margin-top: 5px; text-shadow: 0 2px 10px rgba(251, 191, 36, 0.3); }
@keyframes sbm-slide-up-fade { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.sbm-wheel-canvas { width: 100%; height: 100%; border-radius: 50%; position: relative; overflow: hidden; border: 10px solid #fff; box-sizing: border-box; transition: transform 4s cubic-bezier(0.25, 0.1, 0.25, 1); box-shadow: inset 0 0 30px rgba(0,0,0,0.3); }
.sbm-wheel-segment-content { position: absolute; top: 0; left: 50%; width: 0; height: 50%; transform-origin: 50% 100%; display: flex; justify-content: center; padding-top: 30px; pointer-events: none; }
.sbm-wheel-icon { text-align: center; color: white; text-shadow: 0 2px 4px rgba(0,0,0,0.4); display: flex; flex-direction: column; align-items: center; width: 100px; }
.sbm-wheel-icon span.icon { font-size: 32px; margin-bottom: 5px; filter: drop-shadow(0 2px 2px rgba(0,0,0,0.3)); }
.sbm-wheel-text { font-size: 13px; font-weight: 800; text-transform: uppercase; line-height: 1.2; font-family: 'Segoe UI', Roboto, sans-serif; }
.sbm-wheel-pointer { position: absolute; top: -30px; left: 50%; transform: translateX(-50%); z-index: 20; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.4)); }
.sbm-wheel-spin-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 80px; height: 80px; border-radius: 50%; background: #fff; border: 5px solid #e5e7eb; font-weight: 900; color: #1f2937; cursor: pointer; z-index: 10; box-shadow: 0 0 20px rgba(0,0,0,0.15); font-size: 16px; transition: all 0.2s; }
.sbm-wheel-spin-btn:hover:not(:disabled) { transform: translate(-50%, -50%) scale(1.1); color: #ef4444; border-color: #ef4444; }
.sbm-wheel-spin-btn:disabled { background: #f3f4f6; color: #ccc; cursor: not-allowed; }
.sbm-wheel-result-layer { position: absolute; inset: 0; background: rgba(255, 255, 255, 0.98); border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; z-index: 30; opacity: 0; visibility: hidden; transform: scale(0.8); transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); padding: 40px; }
.sbm-wheel-result-layer.is-visible { opacity: 1; visibility: visible; transform: scale(1); }
.sbm-result-icon { 
    font-size: 4rem; 
    line-height: 1 !important; /* Ép bỏ các khoảng trống thừa bên trên/dưới của icon */
    margin: 0 auto 15px auto !important; /* Căn giữa ngang và tạo khoảng cách 15px với chữ Chúc mừng */
    display: flex;
    align-items: center;
    justify-content: center;
    animation: sbm-bounce 1s infinite; 
}
.sbm-result-title { font-size: 1.5rem; font-weight: 800; color: #111; margin-bottom: 5px; }
.sbm-result-desc { font-size: 1rem; color: #4b5563; line-height: 1.5; margin-bottom: 20px; font-weight: 500; }
.sbm-result-note { font-size: 0.85rem; color: #ef4444; font-weight: 600; margin-top: 15px; }
.sbm-close-wheel-btn { 
    background: linear-gradient(135deg, #ef4444, #b91c1c); 
    color: #fff; 
    border: none; 
    padding: 12px 30px !important; /* Chỉnh lại padding cho cân đối */
    border-radius: 50px; 
    font-size: 1rem; 
    font-weight: 600; 
    cursor: pointer; 
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3); 
    transition: transform 0.2s; 
    
    /* Bổ sung Flexbox để ép chữ nằm ngay chính giữa tâm của nút */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}
.sbm-close-wheel-btn:hover { 
    transform: scale(1.05); 
}

@media (max-width: 600px) {
    .sbm-wheel-container { width: 320px; height: 320px; }
    
    /* Căn lại lề trên để cụm nội dung không bị rớt ra ngoài vòng quay nhỏ */
    .sbm-wheel-segment-content {
        padding-top: 15px !important; 
    }

    /* BỌC THÉP CỤM ICON: Thu nhỏ tỷ lệ 70% và cấm trình duyệt bóp méo */
    .sbm-wheel-icon {
        transform: scale(0.7) !important; /* Thu nhỏ đồng bộ cả icon lẫn chữ */
        transform-origin: top center !important;
        flex-shrink: 0 !important; /* KHÔNG CHO PHÉP FLEXBOX NGHIỀN NÁT ICON */
        width: 100px !important; 
    }

    /* Đảm bảo hiển thị đầy đủ */
    .sbm-wheel-icon span.icon { 
        display: block !important;
        font-size: 32px !important; 
        margin-bottom: 5px !important;
    }
    .sbm-wheel-text { 
        display: block !important; 
        color: #fff !important; 
    }

    /* Mobile Position (Tooltips & Buttons) */
    .sbm-wheel-tooltip { font-size: 0.75rem; right: 65px; padding: 4px 8px; }
    .sbm-lucky-wheel-btn { bottom: 80px; right: 10px; } 
    body.sbm-footer-expanded .sbm-lucky-wheel-btn { bottom: 220px; }
}