/* === 全域變數 === */
:root {
    --topbar-height: 64px;
    --sidebar-width: 260px; /* 側邊欄寬度 */
    --primary-neon: #00f2ff;
    --bg-dark: #050505;
    --accent-font: "Monomaniac One", sans-serif;
}
body {
    background-color: #050505;
    background-image: linear-gradient(rgba(0, 20, 40, 0.7), rgba(0, 10, 20, 0.4)), url('../images/bg.jpg');
    background-size: cover;
    background-attachment: fixed;
    min-height: 100vh;
    color: #e0e0e0;
    font-family: 'Segoe UI', 'Roboto', monospace;
    /* font-family: 'Noto Sans TC', sans-serif; */
    overflow-x: hidden; /* 防止側邊欄滑出時爆版 */
}

.text-dark { color: #e0e0e0 !important; }
.text-muted { color: #8b9bb4 !important; }
.bg-light, .bg-white { background-color: transparent !important; }
.top-navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-height);
    background: rgba(15, 20, 30, 0.95); /* 深色半透明背景 */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1050; /* 最高層級，蓋過 Sidebar */
    display: flex;
    align-items: center;
    justify-content: space-between; /* 左右撐開 */
    padding: 0 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.brand-title {
    font-family: "Monomaniac One", sans-serif;
    font-size: 1.5rem;
    color: #fff;
    letter-spacing: 1px;
    text-shadow: 0 0 10px var(--primary-neon);
}

/* === 2. 左側側邊欄 (只放選單) === */
.sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: rgba(20, 25, 30, 0.98);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    overflow-y: auto;
    z-index: 1040;
    padding-top: 20px;
    /* ★★★ 關鍵修改：預設將其推到螢幕外 (隱藏) ★★★ */
    transform: translateX(-100%); 
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
/* 當有 .open 類別時滑入顯示 */
.sidebar.open {
    transform: translateX(0);
}
.sidebar-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    
    /* 確保這層黑色遮罩可以蓋住內容，但不要蓋住 Sidebar */
    /* Sidebar z-index 是 1040，所以這裡設 1035 是對的 */
    /* 但 Topbar z-index 是 1050，所以 Topbar 不會被遮住 */
    background: rgba(0,0,0,0.7);
    z-index: 1035; 
    
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    backdrop-filter: blur(3px);
    
    /* ★★★ 關鍵：加上 cursor pointer 讓使用者知道可以點 */
    cursor: pointer;
}

/* 顯示時的狀態 */
.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}
/* === 3. 選單項目 (關鍵修正：加大左側留白) === */
.nav-item-custom {
    /* 上 | 右 | 下 | 左 (左邊加大到 30px，讓文字往右縮) */
    padding: 15px 20px 15px 30px; 
    
    width: 100%; /* 佔滿寬度 */
    box-sizing: border-box; /* 確保 padding 包含在寬度內 */
    
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-family: "Monomaniac One", sans-serif;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    border-left: 4px solid transparent; /* 左側指示條 */
    cursor: pointer;
    transition: all 0.2s;
}

.nav-item-custom:hover, .nav-item-custom.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(0, 242, 255, 0.1), transparent);
    border-left-color: var(--primary-neon); /* 亮起左側邊框 */
}

.nav-item-custom i {
    margin-right: 15px;
    width: 24px;
    text-align: center;
    color: var(--primary-neon);
}

/* === 4. 右側主內容區 (關鍵修正：強制推開) === */
.main-content {
    margin-top: var(--topbar-height);
    
    /* ★★★ 關鍵修改：移除左邊距，讓內容佔滿全螢幕 ★★★ */
    margin-left: 0 !important; 
    padding: 30px;
    width: 100%; 
    transition: all 0.3s;
}



/* === 1. 內容寬度限制 (針對電腦版優化) === */
.limit-width {
    max-width: 1000px; /* 限制最大寬度，讓卡片集中 */
    margin: 0 auto;    /* 置中 */
}

.floating-lottery-card {
    position: fixed;
    bottom: 20px;
    z-index: 1030; /* 層級要高，浮在內容之上 */
    opacity: 0.8;
    /* 手機版位置 (左下角) */
    left: 20px; 
    
    background: rgba(15, 20, 25, 0.95);
    border: 1px solid rgba(0, 242, 255, 0.5);
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 15px;
    
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    
    transition: all 0.3s ease;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* 為了不讓內容被底部 Footer 擋住，Main Content 要加 padding-bottom */
.main-content {
    padding-bottom: 100px !important; 
}

/* === 3. Sidebar 內的個人資訊區塊 === */
.sidebar-user-section {
    padding: 20px;
    margin: 10px 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}
.card {
    background-color: rgba(30, 35, 45, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #fff;
}
.card-header {
    background-color: rgba(40, 45, 60, 0.9) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* === 全域酷炫 Scrollbar (水平+垂直通用) === */
::-webkit-scrollbar {
    width: 10px;  /* 垂直捲軸寬度 */
    height: 10px; /* 水平捲軸高度 */
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 5px;
}
::-webkit-scrollbar-thumb {
    /* 酷炫漸層色：青 -> 藍 */
    background: linear-gradient(90deg, #00f2ff, #0077ff); 
    border-radius: 5px;
    border: 2px solid #1a1a1a; /* 增加邊框讓它看起來更立體 */
    box-shadow: 0 0 8px rgba(0, 242, 255, 0.5); /* 發光效果 */
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #fff, #00f2ff);
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.8);
}
/* 修正水平捲軸的漸層方向 */
::-webkit-scrollbar-thumb:horizontal {
    background: linear-gradient(180deg, #00f2ff, #0077ff);
}

/* === 球號樣式 === */
.ball { 
    width: 45px; height: 45px; border-radius: 50%; 
    display: inline-flex; align-items: center; justify-content: center; 
    margin: 6px; font-weight: bold; cursor: pointer; 
    font-size: 1.1rem; 
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: #1a1a1a;
    position: relative;
    overflow: visible;
}
.ball::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.2), transparent 60%);
    border-radius: 50%;
}
.ball:hover { transform: scale(1.15) translateY(-2px); z-index: 10; }

.ball-hit { 
    background-color: rgba(0, 255, 0, 0.2); 
    border: 2px solid #00ff00; 
    color: #00ff00; 
    box-shadow: 0 0 15px #00ff00;
    text-shadow: 0 0 5px #00ff00;
}
.ball-miss { background-color: #2a2a2a; border: 2px solid #444; color: #666; }
.ball-sm { 
    width: 32px; height: 32px; font-size: 0.85rem; margin: 2px; cursor: default; 
    background-color: #222; color: #aaa; border: 1px solid #444; border-radius: 50%; 
    display: inline-flex; align-items: center; justify-content: center; font-weight: bold; 
}

/* === 霓虹小球樣式 === */
.tiny-ball {
    width: 30px; height: 30px; font-size: 0.8rem; 
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    background: rgba(0, 20, 30, 0.8); 
    border: 1px solid rgba(0, 242, 255, 0.4); 
    color: rgba(0, 242, 255, 0.9);
    box-shadow: inset 0 0 5px rgba(0, 242, 255, 0.1);
    text-shadow: 0 0 2px rgba(0, 242, 255, 0.5);
}
.tiny-ball.hot {
    border: 1px solid #ffd700; color: #ffd700; 
    background: rgba(255, 215, 0, 0.15);
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.4), inset 0 0 5px rgba(255, 215, 0, 0.2);
    text-shadow: 0 0 3px #ffd700;
    font-weight: bold; transform: scale(1.1); z-index: 1;
}

/* === Raw Table 布局 (關鍵修改) === */
/* 1. 外層容器：負責水平滾動 */
.raw-scroll-container {
    overflow-x: auto; /* 水平滾動 */
    overflow-y: visible; /* 垂直不滾動，直接撐開 */
    padding-bottom: 10px; /* 預留捲軸空間 */
}

/* 2. 內層寬度容器：確保內容足夠寬，觸發滾動 */
.raw-table-inner {
    min-width: 1400px; /* 強制寬度，確保39顆球不換行 */
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 3. 單一列樣式 */
.neon-row-item {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 242, 255, 0.2);
    border-left: 4px solid #00f2ff;
    padding: 8px 0; /* 上下padding */
    display: flex;
    align-items: center;
    position: relative; /* 為了sticky定位 */
}
.neon-row-item:hover {
    background: rgba(0, 242, 255, 0.05);
    border-color: #00f2ff;
}
.neon-row-double {
    border-left: 4px solid #ff00de;
    border-color: rgba(255, 0, 222, 0.2);
}
.neon-row-double:hover {
    border-color: #ff00de;
    background: rgba(255, 0, 222, 0.05);
}
.neon-row-double .sticky-col {
    border-left-color: #ff00de;
}

/* 4. 凍結首欄 (Sticky Column) */
.sticky-col {
    position: sticky;
    left: 0;
    z-index: 10;
    
    /* ★ 關鍵：給定與卡片一致的不透明背景色 */
    background-color: #212529; /* 使用 Bootstrap 的 dark 顏色，或 #1a1a1a */
    /* 為了保險，可以用 linear-gradient 模擬背景，確保完全遮蓋 */
    background: linear-gradient(90deg, #1a1a1a 95%, rgba(26,26,26,0)); 
    
    border-right: 2px solid #333;
    box-shadow: 5px 0 15px rgba(0,0,0,0.9); /* 加深陰影 */
    
    padding: 0 15px;
    width: 140px;
    height: 60px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
/* === 文字霓虹閃爍效果 === */
@keyframes text-neon-pulse {
    0%, 100% { text-shadow: 0 0 5px currentColor, 0 0 10px currentColor; opacity: 1; }
    50% { text-shadow: 0 0 15px currentColor, 0 0 25px currentColor; opacity: 0.8; }
}

.trigger-badge {
    font-family: 'Consolas', monospace;
    font-size: 1.2rem;
    font-weight: bold;
    /* 套用動畫 */
    animation: text-neon-pulse 2s infinite alternate;
}
/* 針對單球/雙球設定不同的基礎顏色，讓 currentColor 生效 */
.trigger-single { color: #00f2ff; }
.trigger-double { color: #ff00de; }
.result-balls {
    display: flex;
    gap: 8px;
    padding-left: 15px;
    flex-grow: 1;
}

/* 其他原有樣式 */
.ball-selected {
    background-color: rgba(0, 242, 255, 0.2) !important;
    border: 2px solid #00f2ff !important;
    color: #00f2ff !important;
    box-shadow: 0 0 15px #00f2ff, 0 0 30px rgba(0, 242, 255, 0.5);
    text-shadow: 0 0 5px #00f2ff;
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 15px #00f2ff; }
    50% { box-shadow: 0 0 25px #00f2ff, 0 0 10px #fff; }
    100% { box-shadow: 0 0 15px #00f2ff; }
}

/* === 新增：雙球專用霓虹效果 (#ff00de) === */
.ball-selected-double {
    background-color: rgba(255, 0, 222, 0.2) !important;
    border: 2px solid #ff00de !important;
    color: #ff00de !important;
    /* 預設陰影 */
    box-shadow: 0 0 15px #ff00de;
    text-shadow: 0 0 5px #ff00de;
    /* 套用專屬動畫 */
    animation: pulse-magenta 1.5s infinite;
}

@keyframes pulse-magenta {
    0% { box-shadow: 0 0 15px #ff00de; }
    50% { box-shadow: 0 0 25px #ff00de, 0 0 10px #fff; } /* 中間閃爍白光 */
    100% { box-shadow: 0 0 15px #ff00de; }
}
.list-group-item { background-color: rgba(255, 255, 255, 0.03); border: 1px solid #333; color: #ddd; }
.modal-content { background-color: #1a1e24; border: 1px solid #444; color: #fff; }
.modal-header { border-bottom: 1px solid #333; }
.modal-header .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
.modal-footer { border-top: 1px solid #333; }
.hover-link:hover { color: #00f2ff !important; text-shadow: 0 0 10px rgba(0, 242, 255, 0.8); }
.highlight-ref { background-color: rgba(255, 215, 0, 0.2) !important; color: #ffd700 !important; border: 2px solid #ffd700; }
.highlight-trigger { background-color: rgba(255, 50, 50, 0.2) !important; color: #ff3333 !important; border: 2px solid #ff3333; }
.highlight-match { background-color: rgba(0, 255, 136, 0.2) !important; color: #00ff88 !important; border: 2px solid #00ff88; }
.algo-header:hover { background-color: rgba(255, 255, 255, 0.05); }
.rotate-icon.open { transform: rotate(180deg); }
.match-block { background: rgba(0, 0, 0, 0.3); border-radius: 8px; padding: 12px; margin-bottom: 15px; border: 1px solid #333; }
.match-success { background-color: rgba(0, 255, 136, 0.1) !important; border-left: 4px solid #00ff88; }
.match-predict { background-color: rgba(0, 242, 255, 0.1) !important; border-left: 4px solid #00f2ff; }
.match-tolerance { background-color: rgba(255, 215, 0, 0.1) !important; border-left: 4px solid #ffd700; }
.formula-text { font-family: 'Consolas', 'Courier New', monospace; letter-spacing: 0.5px; color: #aab; }
.row-label { color: #888; font-size: 0.85rem; font-weight: bold; width: 70px; display: inline-block; }
.text-success { color: #00ff88 !important; }
.text-primary { color: #00f2ff !important; }
.text-warning { color: #ffd700 !important; }

/* === 入口大門 (全螢幕覆蓋) === */
.entry-gate {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(2, 10, 15, 0.95); /* 更深的背景，減少透光干擾 */
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px; /* 增加邊距，避免貼邊 */
}

/* === 內容區塊 (RWD 優化版) === */
.gate-content {
    width: 100%;
    max-width: 500px; /* 手機版不需要太寬 */
    max-height: 90vh; /* 限制高度不超過螢幕 90% */
    display: flex;
    flex-direction: column; /* 垂直排列 */
    
    /* 視覺風格 */
    border: 1px solid rgba(0, 242, 255, 0.3);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(10, 20, 30, 0.95), rgba(5, 10, 15, 0.98));
    box-shadow: 0 0 40px rgba(0, 242, 255, 0.1), inset 0 0 20px rgba(0, 242, 255, 0.05);
    position: relative;
    overflow: hidden; /* 防止內容爆出圓角 */
}

/* 固定頭部 (標題區) */
.gate-header {
    padding: 25px 20px 10px;
    text-align: center;
    flex-shrink: 0; /* 防止被壓縮 */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* 滾動內容區 (聲明文本) */
.gate-body {
    flex-grow: 1; /* 佔滿剩餘空間 */
    overflow-y: auto; /* 允許垂直滾動 */
    padding: 20px;
    text-align: left;
    
    /* 自訂捲軸樣式 */
    scrollbar-width: thin;
    scrollbar-color: #00f2ff #111;
}
.gate-body::-webkit-scrollbar { width: 6px; }
.gate-body::-webkit-scrollbar-track { background: #111; }
.gate-body::-webkit-scrollbar-thumb { background: #00f2ff; border-radius: 3px; }

/* 固定底部 (按鈕區) */
.gate-footer {
    padding-bottom: 20px;
    text-align: center;
    flex-shrink: 0; /* 防止被壓縮 */
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0,0,0,0.2);
    
}

/* 聲明文本樣式優化 */
.disclaimer-list {
    list-style: none; /* 移除預設黑點 */
    padding: 0;
    margin: 0;
    font-size: 0.95rem;
    color: #b0c4de;
    line-height: 1.7;
}
.disclaimer-list li {
    margin-bottom: 15px;
    padding-left: 10px;
    border-left: 3px solid rgba(0, 242, 255, 0.3);
}
.disclaimer-list strong { color: #fff; display: block; margin-bottom: 4px; }

/* 禁用狀態的按鈕 */
.enter-btn:disabled {
    border-color: #444;
    color: #666;
    cursor: not-allowed;
    background: transparent;
    box-shadow: none;
    opacity: 0.5;
}

/* 閱讀進度提示 */
.read-hint {
    font-size: 0.8rem;
    color: #ff5e62;
    animation: pulse 1.5s infinite;
}
@keyframes pulse { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.5; } }

/* 霓虹文字專用 Class */
.text-neon {
    color: #00f2ff !important;
    text-shadow: 0 0 15px rgba(0, 242, 255, 0.8);
}

/* 按鈕特效 - 霓虹青 */
.enter-btn {
    border: 2px solid #00f2ff;
    color: #00f2ff;
    background: transparent;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.enter-btn:hover {
    background-color: #00f2ff;
    color: #000; /* 懸停時文字變黑，對比更強 */
    box-shadow: 0 0 30px rgba(0, 242, 255, 0.8);
    transform: scale(1.05);
    font-weight: bold;
}

/* 離開按鈕樣式微調 */
.btn-outline-secondary:hover {
    background-color: #333;
    color: #fff;
    border-color: #555;
}

/* Vue 過渡動畫 */
.fade-enter-active, .fade-leave-active { transition: opacity 0.6s; }
.fade-enter-from, .fade-leave-to { opacity: 0; }

/* 當遮罩顯示時，背景稍微模糊一點 (選用) */
.blur-bg { filter: blur(3px); transition: filter 0.5s; }
/* 強制將確認按鈕 (confirm button) 的文字改成黑色，並加粗 */
.swal2-confirm.swal2-styled {
    color: #000 !important; /* 強制黑色字體 */
    font-weight: 500 !important; /* 特粗體，讓字在霓虹色上更清楚 */
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.5) !important; /* 增加一點霓虹光暈 */
}

/* 如果您也想調整取消按鈕的樣式 (選用) */
.swal2-cancel.swal2-styled {
    color: #fff !important;
    font-weight: 500 !important;
}
/* Footer 連結特效 */
.hover-link { transition: all 0.3s; }
.hover-link:hover { 
    color: #00f2ff !important; 
    text-shadow: 0 0 10px rgba(0, 242, 255, 0.8);
}
/* === 鎖定內容樣式 === */
.locked-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed #666;
    color: #888;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.locked-badge:hover {
    border-color: #ffd700;
    color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}
.locked-badge i { font-size: 0.9rem; }
/* === 強制提升 SweetAlert2 層級 === */
/* 確保它永遠在最上層，蓋過 Bootstrap Modal 和 Entry Gate */
div.swal2-container {
    z-index: 20000 !important;
}

/* 確保遮罩層也同步提升 */
div.swal2-backdrop-show {
    z-index: 19999 !important;
}

/* === 社群登入按鈕樣式 === */
.btn-social {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    margin: 0 5px;
}
.btn-social:hover { transform: scale(1.1); filter: brightness(1.1); }

.btn-google { background-color: #db4437; }
.btn-facebook { background-color: #4267B2; }
.btn-line { background-color: #06c755; }

/* === 新增：懸浮導覽列 (Glassmorphism) === */
.sticky-nav {
    position: sticky;
    top: 70px; /* 留一點縫隙比較好看 */
    z-index: 1000;
    background: rgba(20, 25, 35, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 0 10px;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    overflow-x: auto; /* 手機版可橫向滑動 */
}

.nav-link-custom {
    color: #aaa;
    text-decoration: none;
    padding: 12px 15px;
    font-size: 0.9rem;
    font-weight: bold;
    white-space: nowrap;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.nav-link-custom:hover, .nav-link-custom.active {
    color: #fff;
    text-shadow: 0 0 8px rgba(255,255,255,0.5);
}
.nav-link-custom.active {
    border-bottom-color: #00f2ff;
    color: #00f2ff;
}
/* 圖標外框：確保圖片位置固定，並加上一點陰影 */
.algo-icon-wrapper {
    width: 48px;  /* 設定固定大小 */
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(0,0,0,0) 70%); /* 背景微光 */
    border-radius: 50%; /* 圓形底座 */
    transition: transform 0.2s ease;
}

/* 圖片本體 */
.algo-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* 保持圖片比例，不會被壓扁 */
    filter: drop-shadow(0 0 5px rgba(100, 100, 255, 0.4)); /* 藍色微光暈染 */
}

/* 滑鼠移過去時的特效 (選用) */
.card-body:hover .algo-icon-wrapper {
    transform: scale(1.15) rotate(-5deg); /* 稍微放大並傾斜，像遊戲按鈕 */
}
.card-body:hover .algo-icon-img {
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6)); /* 變成金色光暈 */
}

/* === 新增：演算法分組列表樣式 === */
.algo-row-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    overflow: hidden;
    transition: all 0.3s;
}

.algo-row-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 242, 255, 0.3);
    transform: translateX(5px);
}

/* 左側：演算法標題與圖示 */
.algo-label-box {
    width: 130px; /* 固定寬度 */
    flex-shrink: 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-align: center;
}

.algo-label-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(0, 242, 255, 0.5));
}

.algo-label-text {
    font-size: 0.85rem;
    font-weight: bold;
    color: #e0e0e0;
    line-height: 1.2;
}

/* 右側：球號滾動區 */
.algo-numbers-box {
    flex-grow: 1;
    overflow-x: auto;
    padding: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
    /* 隱藏捲軸但保留功能 */
    scrollbar-width: thin; 
}
.algo-numbers-box::-webkit-scrollbar {
    height: 4px;
}
.algo-numbers-box::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

/* 手機版適配：標題稍微縮小 */
@media (max-width: 992px) {
    .algo-label-box {
        width: 100px;
    }
    .algo-label-icon {
        width: 32px;
        height: 32px;
    }
    .algo-label-text {
        font-size: 0.75rem;
    }
    .floating-lottery-card {
        left: 20px; /* Sidebar (260px) + 20px 間距 */
    }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    
    /* 手機版：內容貼左邊 (因為 Sidebar 會隱藏) */
    .main-content { 
        margin-left: 0 !important; 
        width: 100%; 
        padding: 20px; 
    }
}
/* === 2. 球號跳動動畫 === */
@keyframes ball-jump {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); } /* 往上跳 8px */
}

.jumping-ball {
    width: 32px; height: 32px;
    font-size: 0.85rem; font-weight: bold;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid #fff;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    
    /* 套用跳動動畫 */
    animation: ball-jump 2s infinite ease-in-out;
}

/* 依序設定延遲，製造波浪效果 */
.jumping-ball:nth-child(1) { animation-delay: 0.0s; }
.jumping-ball:nth-child(2) { animation-delay: 0.2s; }
.jumping-ball:nth-child(3) { animation-delay: 0.4s; }
.jumping-ball:nth-child(4) { animation-delay: 0.6s; }
.jumping-ball:nth-child(5) { animation-delay: 0.8s; }

/* === 3. Sidebar 霓虹登入按鈕 === */
.btn-neon-google {
    background: transparent;
    border: 1px solid #ff3e3e;
    color: #ff3e3e;
    text-shadow: 0 0 8px rgba(255, 62, 62, 0.8); /* 紅色霓虹字 */
    transition: all 0.3s;
    font-weight: bold;
    letter-spacing: 1px;
}
.btn-neon-google:hover {
    background: rgba(255, 62, 62, 0.1);
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 62, 62, 0.4);
    border-color: #fff;
}

.btn-neon-line {
    background: transparent;
    border: 1px solid #06c755;
    color: #06c755;
    text-shadow: 0 0 8px rgba(6, 199, 85, 0.8); /* 綠色霓虹字 */
    transition: all 0.3s;
    font-weight: bold;
    letter-spacing: 1px;
}
.btn-neon-line:hover {
    background: rgba(6, 199, 85, 0.1);
    color: #fff;
    box-shadow: 0 0 15px rgba(6, 199, 85, 0.4);
    border-color: #fff;
}
/* === 首頁歡迎圖特效 === */
.welcome-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh; /* 讓它垂直置中 */
    text-align: center;
}

.welcome-img {
    max-width: 100%;
    max-height: 450px; /* 限制高度，避免太大 */
    object-fit: cover;
    border-radius: 20px;
    border: 1px solid rgba(0, 242, 255, 0.3);
    box-shadow: 0 0 30px rgba(0, 242, 255, 0.15);
    animation: floatImg 3s ease-in-out infinite; /* 懸浮動畫 */
}

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

.start-btn {
    background: linear-gradient(90deg, #00f2ff, #0077ff);
    border: none;
    color: #000;
    font-weight: 900;
    letter-spacing: 2px;
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.4);
    transition: all 0.3s;
}

.start-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(0, 242, 255, 0.8);
    color: #fff;
}
.cursor-pointer { cursor: pointer; }
.hover-text-white:hover { color: #fff !important; }
.ball-dim {
    border-color: #444 !important;
    color: #666 !important;
    background: transparent !important;
}