/* ========================================
   LightandWonder - Premium Casino Experience
   Main Stylesheet
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* ----------------------------------------
   CSS Variables / Design Tokens
   ---------------------------------------- */
:root {
    /* Colors */
    --primary-bg: #050505;
    --secondary-bg: #0a0a0a;
    --card-bg: #1a1a1a;
    --card-bg-alt: #121212;
    --border-light: rgba(255, 255, 255, 0.05);
    --border-medium: rgba(255, 255, 255, 0.1);
    
    /* Accent Colors */
    --neon-pink: #ff00de;
    --gold-primary: #FDB931;
    --gold-light: #F5D061;
    --gold-dark: #D4AF37;
    --pink-primary: #ec008c;
    --purple-primary: #833ab4;
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ----------------------------------------
   Base Styles
   ---------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--primary-bg);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(157, 0, 255, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(255, 0, 222, 0.05) 0%, transparent 40%);
    color: var(--text-primary);
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
}

/* ----------------------------------------
   Utility Classes
   ---------------------------------------- */
.hidden { display: none; }
.hidden-important { display: none !important; }

.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ----------------------------------------
   Glass Panel Effect
   ---------------------------------------- */
.glass-panel {
    background: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
}

/* ----------------------------------------
   Button Styles
   ---------------------------------------- */
.btn-gold {
    background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-light) 50%, var(--gold-dark) 100%);
    color: #1a1a1a;
    font-weight: 800;
    border: 1px solid #FFE57F;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
    cursor: pointer;
}

.btn-gold:active { 
    transform: scale(0.96); 
}

.btn-gold:hover {
    filter: brightness(1.1);
}

.btn-neon {
    background: linear-gradient(90deg, var(--pink-primary), #fc6767);
    color: white;
    box-shadow: 0 0 10px rgba(236, 0, 140, 0.5);
    transition: all var(--transition-normal);
    border: none;
    cursor: pointer;
}

.btn-neon:hover {
    filter: brightness(1.2);
}

/* Partnership Button - Breathing Effect */
.btn-partner-glow {
    background: linear-gradient(90deg, #833ab4 0%, #fd1d1d 100%);
    background-size: 200% 200%;
    animation: partner-breathe 2s infinite, gradient-shift 5s ease infinite;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes partner-breathe {
    0% { 
        box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.4); 
        border-color: rgba(236, 72, 153, 0.5); 
    }
    70% { 
        box-shadow: 0 0 10px 5px rgba(236, 72, 153, 0); 
        border-color: rgba(236, 72, 153, 1); 
    }
    100% { 
        box-shadow: 0 0 0 0 rgba(236, 72, 153, 0); 
        border-color: rgba(236, 72, 153, 0.5); 
    }
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Deposit Method Button */
.deposit-method-btn {
    background: linear-gradient(90deg, #b91c78 0%, #7c1a5d 100%);
    border: 1px solid #d946ef;
    transition: all var(--transition-normal);
}

.deposit-method-btn:hover { 
    filter: brightness(1.2); 
    transform: translateX(5px); 
}

/* ----------------------------------------
   Card Styles
   ---------------------------------------- */
.premium-card {
    background: linear-gradient(145deg, #1a1a1a, #0f0f0f);
    border: 1px solid var(--border-light);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    transition: transform var(--transition-fast);
}

/* Promo Card - Unclaimed (Glowing) */
.promo-glow-card {
    background: linear-gradient(180deg, #2e1065 0%, #0f0518 100%);
    border: 1px solid rgba(217, 70, 239, 0.3);
    animation: border-breathe 3s infinite ease-in-out;
    transition: all var(--transition-normal);
}

/* Promo Card Breathing Animation */
/* Promo Card Breathe Animation */
.promo-card-breathe {
    animation: promo-breathe 2.5s infinite ease-in-out;
    transition: all 0.2s ease;
}

.promo-card-breathe:hover {
    animation-play-state: paused;
    transform: scale(1.03);
}

/* ========================================
   Bonus Card - 金色发光边框效果
   ======================================== */
.bonus-card-glow {
    position: relative;
    background: linear-gradient(135deg, rgba(30, 30, 40, 0.95) 0%, rgba(15, 15, 25, 0.98) 100%);
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    overflow: visible;
    transition: all 0.3s ease;
}

/* 金色发光边框动画 */
.bonus-card-glow::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 14px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(212, 175, 55, 0.8) 25%,
        rgba(255, 215, 0, 1) 50%,
        rgba(212, 175, 55, 0.8) 75%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: border-glow 3s linear infinite;
    z-index: -1;
    opacity: 0.6;
}

/* 内部遮罩 */
.bonus-card-glow::after {
    content: '';
    position: absolute;
    inset: 1px;
    background: linear-gradient(135deg, rgba(25, 25, 35, 0.98) 0%, rgba(15, 15, 25, 0.99) 100%);
    border-radius: 11px;
    z-index: -1;
}

@keyframes border-glow {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 可领取的卡片 - 更亮更快 */
.bonus-card-glow.can-claim {
    border-color: rgba(255, 215, 0, 0.6);
    box-shadow: 
        0 0 15px rgba(255, 215, 0, 0.3),
        0 0 30px rgba(255, 215, 0, 0.1),
        inset 0 0 20px rgba(255, 215, 0, 0.05);
}

.bonus-card-glow.can-claim::before {
    opacity: 1;
    animation: border-glow 2s linear infinite;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 215, 0, 0.9) 20%,
        rgba(255, 255, 255, 1) 50%,
        rgba(255, 215, 0, 0.9) 80%,
        transparent 100%
    );
    background-size: 200% 100%;
}

/* 闪烁星星效果 */
.bonus-card-glow.can-claim .sparkle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, #fff 0%, #ffd700 50%, transparent 70%);
    border-radius: 50%;
    animation: sparkle 1.5s ease-in-out infinite;
    pointer-events: none;
}

.bonus-card-glow.can-claim .sparkle:nth-child(1) { top: -4px; left: 20%; animation-delay: 0s; }
.bonus-card-glow.can-claim .sparkle:nth-child(2) { top: 30%; right: -4px; animation-delay: 0.3s; }
.bonus-card-glow.can-claim .sparkle:nth-child(3) { bottom: -4px; left: 60%; animation-delay: 0.6s; }
.bonus-card-glow.can-claim .sparkle:nth-child(4) { top: 60%; left: -4px; animation-delay: 0.9s; }

@keyframes sparkle {
    0%, 100% { 
        opacity: 0.3; 
        transform: scale(0.8);
    }
    50% { 
        opacity: 1; 
        transform: scale(1.2);
    }
}

/* 不可领取（已登录但条件不符 / 未登录） */
.bonus-card-glow.not-claimable {
    opacity: 0.45;
    filter: grayscale(40%);
}

.bonus-card-glow.not-claimable:hover {
    opacity: 0.65;
    filter: grayscale(20%);
}

/* 禁用状态 */
.bonus-card-glow.disabled {
    border-color: rgba(100, 100, 100, 0.2);
    opacity: 0.35;
    filter: grayscale(60%);
}

.bonus-card-glow.disabled::before {
    opacity: 0.2;
    animation: border-glow 6s linear infinite;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(150, 150, 150, 0.5) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
}

/* Hover 效果 */
.bonus-card-glow:hover {
    transform: translateY(-2px);
}

.bonus-card-glow.can-claim:hover {
    box-shadow: 
        0 0 25px rgba(255, 215, 0, 0.5),
        0 0 50px rgba(255, 215, 0, 0.2),
        inset 0 0 30px rgba(255, 215, 0, 0.1);
}

.bonus-card-glow:hover::before {
    animation-duration: 1.5s;
}

/* 内容层 */
.bonus-card-glow .card-content {
    position: relative;
    z-index: 1;
    padding: 12px;
    text-align: center;
}

/* Promo Card Disabled - Not Eligible */
.promo-card-disabled,
[data-eligible="false"] {
    opacity: 0.35 !important;
    filter: grayscale(80%) !important;
    animation: none !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

.promo-card-disabled:hover,
[data-eligible="false"]:hover {
    opacity: 0.4 !important;
    filter: grayscale(70%) !important;
    transform: none !important;
}

/* Promo Card Active - Eligible to claim */
.promo-card-active {
    animation: promo-breathe 2.5s infinite ease-in-out;
    filter: none;
    opacity: 1;
}

@keyframes promo-breathe {
    0%, 100% { 
        box-shadow: 0 0 5px rgba(236, 72, 153, 0.2), inset 0 0 20px rgba(255, 255, 255, 0.02);
        border-color: rgba(236, 72, 153, 0.3);
    }
    50% { 
        box-shadow: 0 0 20px rgba(236, 72, 153, 0.4), inset 0 0 30px rgba(255, 255, 255, 0.05);
        border-color: rgba(236, 72, 153, 0.8);
    }
}

@keyframes border-breathe {
    0%, 100% { 
        border-color: rgba(217, 70, 239, 0.3); 
        box-shadow: 0 0 5px rgba(217, 70, 239, 0.1); 
    }
    50% { 
        border-color: rgba(217, 70, 239, 1); 
        box-shadow: 0 0 15px rgba(217, 70, 239, 0.5); 
    }
}

/* Promo Card - Claimed (Dark) */
.promo-claimed-card {
    background: #121212;
    border: 1px solid #333;
    opacity: 0.5;
    filter: grayscale(100%);
    transform: scale(0.98);
    pointer-events: none;
}

.promo-claimed-card button {
    background: #333 !important;
    color: #888 !important;
    border: none !important;
}

/* VIP Shimmer Effect */
.vip-shimmer {
    background: linear-gradient(45deg, transparent 40%, rgba(255,215,0,0.1) 50%, transparent 60%);
    background-size: 200% 200%;
    animation: shimmer 5s infinite linear;
}

@keyframes shimmer { 
    0% { background-position: 200% 0; } 
    100% { background-position: -200% 0; } 
}

/* ----------------------------------------
   Form Inputs
   ---------------------------------------- */
.custom-input {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-medium);
    color: white;
    transition: all var(--transition-normal);
    width: 100%;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
}

.custom-input:focus { 
    border-color: var(--gold-primary); 
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2); 
    outline: none; 
}

.custom-input::placeholder {
    color: var(--text-muted);
}

/* ----------------------------------------
   Navigation Styles
   ---------------------------------------- */
.nav-icon { 
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}

.nav-item.active-nav .nav-icon { 
    color: #ffd700; 
    transform: translateY(-5px) scale(1.1); 
    text-shadow: 0 5px 15px rgba(255, 215, 0, 0.5);
}

.nav-item.active-nav span { 
    color: #ffd700; 
    font-weight: 600; 
}

.nav-indicator {
    height: 3px; 
    width: 0; 
    background: #ffd700; 
    margin: 0 auto; 
    border-radius: 10px; 
    transition: width var(--transition-normal);
}

.nav-item.active-nav .nav-indicator { 
    width: 20px; 
}

/* ----------------------------------------
   View Transitions
   ---------------------------------------- */
.view-section {
    display: none; 
    opacity: 0; 
    transform: translateY(10px);
    transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.view-section.active { 
    display: block; 
    opacity: 1; 
    transform: translateY(0); 
}

/* ----------------------------------------
   Modal Styles
   ---------------------------------------- */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(4px);
    padding: 1rem;
    z-index: 200; /* 提高 z-index，在 header/footer 之上 */
}

.modal.hidden {
    display: none !important;
    pointer-events: none !important;
}

.modal-content {
    width: 100%;
    max-width: 24rem;
    max-height: calc(100vh - 140px); /* 留出 header + footer 的空间 */
    max-height: calc(100dvh - 140px);
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-medium);
    position: relative;
    overflow: hidden;
    overflow-y: auto;
}

.modal-enter { 
    animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; 
}

@keyframes modalIn { 
    from { 
        opacity: 0; 
        transform: scale(0.9) translateY(20px); 
    } 
    to { 
        opacity: 1; 
        transform: scale(1) translateY(0); 
    } 
}

/* ----------------------------------------
   Animations
   ---------------------------------------- */
/* Ticker Animation */
.ticker-wrap { 
    animation: ticker 30s linear infinite; 
}

@keyframes ticker { 
    0% { transform: translateX(100%); } 
    100% { transform: translateX(-100%); } 
}

/* Live Feed - 静态列表，不滚动 */
.live-feed-container {
    height: 192px;
    overflow-y: auto;
    position: relative;
}

.live-feed-list {
    display: flex;
    flex-direction: column;
}

/* 隐藏滚动条但保留滚动功能 */
.live-feed-container::-webkit-scrollbar {
    width: 0;
    display: none;
}

/* 旧的 scroll-vertical 保留兼容 */
.scroll-vertical { 
    overflow-y: auto;
}

.scroll-vertical::-webkit-scrollbar {
    width: 0;
    display: none;
}

@keyframes scrollUp { 
    0% { transform: translateY(0); } 
    100% { transform: translateY(-50%); } 
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Ping Animation */
@keyframes ping {
    75%, 100% {
        transform: scale(2);
        opacity: 0;
    }
}

.animate-ping {
    animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* ----------------------------------------
   Toast Notification
   ---------------------------------------- */
.toast {
    position: fixed;
    top: 5rem;
    left: 50%;
    transform: translateX(-50%);
    background: #22c55e;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    z-index: 90;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-normal);
    opacity: 0;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ----------------------------------------
   Live Feed Tabs
   ---------------------------------------- */
.live-tab {
    flex: 1;
    padding: 0.75rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: all var(--transition-normal);
    background: transparent;
    cursor: pointer;
}

.live-tab:hover {
    color: var(--text-secondary);
}

.live-tab.active {
    color: #facc15;
    border-color: #facc15;
    background: rgba(255, 255, 255, 0.05);
}

/* ----------------------------------------
   Responsive Utilities
   ---------------------------------------- */
@media (max-width: 640px) {
    body {
        font-size: 13px;
    }
}

/* Safe area for bottom navigation */
.pb-safe {
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* ----------------------------------------
   Live Feed New Item Animation
   ---------------------------------------- */
@keyframes liveFeedSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-20px);
        max-height: 0;
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        max-height: 60px;
    }
}

.live-feed-new {
    animation: liveFeedSlideIn 0.4s ease-out forwards;
    background: rgba(250, 204, 21, 0.1) !important;
    border-color: rgba(250, 204, 21, 0.3) !important;
}

/* Remove highlight after animation */
.live-feed-new {
    animation: liveFeedSlideIn 0.4s ease-out forwards, liveFeedFadeHighlight 2s ease-out 0.4s forwards;
}

@keyframes liveFeedFadeHighlight {
    0% {
        background: rgba(250, 204, 21, 0.1);
        border-color: rgba(250, 204, 21, 0.3);
    }
    100% {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.05);
    }
}

/* Live Feed New Item Animation */
@keyframes newItemSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-20px);
        background: rgba(34, 197, 94, 0.3);
    }
    50% {
        background: rgba(34, 197, 94, 0.2);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        background: rgba(255, 255, 255, 0.05);
    }
}

.animate-new-item {
    animation: newItemSlideIn 0.8s ease-out forwards;
}

/* Deposit new item — high contrast flash 5 times over 5s */
@keyframes feedDepositFlash {
    0%   { background: rgba(var(--feed-deposit-rgb, 0,255,100), 0.7); color: var(--feed-deposit-text, #00FF64); text-shadow: 0 0 6px var(--feed-deposit-text, #00FF64); }
    8%   { background: transparent; color: inherit; text-shadow: none; }
    20%  { background: rgba(var(--feed-deposit-rgb, 0,255,100), 0.6); color: var(--feed-deposit-text, #00FF64); text-shadow: 0 0 6px var(--feed-deposit-text, #00FF64); }
    28%  { background: transparent; color: inherit; text-shadow: none; }
    40%  { background: rgba(var(--feed-deposit-rgb, 0,255,100), 0.5); color: var(--feed-deposit-text, #00FF64); text-shadow: 0 0 4px var(--feed-deposit-text, #00FF64); }
    48%  { background: transparent; color: inherit; text-shadow: none; }
    60%  { background: rgba(var(--feed-deposit-rgb, 0,255,100), 0.4); color: var(--feed-deposit-text, #00FF64); text-shadow: 0 0 3px var(--feed-deposit-text, #00FF64); }
    68%  { background: transparent; color: inherit; text-shadow: none; }
    80%  { background: rgba(var(--feed-deposit-rgb, 0,255,100), 0.3); color: var(--feed-deposit-text, #00FF64); }
    88%  { background: transparent; color: inherit; }
    100% { background: transparent; color: inherit; }
}

.feed-anim-deposit {
    animation: feedDepositFlash 5s ease-in-out forwards;
}

/* Withdraw new item — high contrast flash 5 times over 5s */
@keyframes feedWithdrawFlash {
    0%   { background: rgba(var(--feed-withdraw-rgb, 255,215,0), 0.7); color: var(--feed-withdraw-text, #FFD700); text-shadow: 0 0 6px var(--feed-withdraw-text, #FFD700); }
    8%   { background: transparent; color: inherit; text-shadow: none; }
    20%  { background: rgba(var(--feed-withdraw-rgb, 255,215,0), 0.6); color: var(--feed-withdraw-text, #FFD700); text-shadow: 0 0 6px var(--feed-withdraw-text, #FFD700); }
    28%  { background: transparent; color: inherit; text-shadow: none; }
    40%  { background: rgba(var(--feed-withdraw-rgb, 255,215,0), 0.5); color: var(--feed-withdraw-text, #FFD700); text-shadow: 0 0 4px var(--feed-withdraw-text, #FFD700); }
    48%  { background: transparent; color: inherit; text-shadow: none; }
    60%  { background: rgba(var(--feed-withdraw-rgb, 255,215,0), 0.4); color: var(--feed-withdraw-text, #FFD700); text-shadow: 0 0 3px var(--feed-withdraw-text, #FFD700); }
    68%  { background: transparent; color: inherit; text-shadow: none; }
    80%  { background: rgba(var(--feed-withdraw-rgb, 255,215,0), 0.3); color: var(--feed-withdraw-text, #FFD700); }
    88%  { background: transparent; color: inherit; }
    100% { background: transparent; color: inherit; }
}

.feed-anim-withdraw {
    animation: feedWithdrawFlash 5s ease-in-out forwards;
}

/* Fade In Animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-fadeIn {
    animation: fadeIn 0.5s ease-out forwards;
}

/* ----------------------------------------
   Hot Game Card - 呼吸发光效果
   ---------------------------------------- */
@keyframes hotGameGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(168, 85, 247, 0.4),
                    0 0 20px rgba(168, 85, 247, 0.2),
                    inset 0 0 10px rgba(168, 85, 247, 0.1);
        border-color: rgba(168, 85, 247, 0.5);
    }
    50% {
        box-shadow: 0 0 15px rgba(236, 72, 153, 0.6),
                    0 0 30px rgba(236, 72, 153, 0.3),
                    inset 0 0 15px rgba(236, 72, 153, 0.15);
        border-color: rgba(236, 72, 153, 0.7);
    }
}

.hot-game-card {
    animation: hotGameGlow 3s ease-in-out infinite;
    border: 2px solid rgba(168, 85, 247, 0.5);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: linear-gradient(145deg, #1a1a2e, #0f0f1a);
}

.hot-game-card:hover {
    transform: scale(1.05);
    animation-play-state: paused;
    box-shadow: 0 0 25px rgba(236, 72, 153, 0.8),
                0 0 50px rgba(168, 85, 247, 0.4);
}

.hot-game-card:active {
    transform: scale(0.98);
}

/* Hide scrollbar for slider */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Light sweep effect on card */
@keyframes lightSweep {
    0% {
        left: -100%;
    }
    100% {
        left: 200%;
    }
}

.hot-game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: lightSweep 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 10;
}

/* ----------------------------------------
   Hot Games Slider - Glow Animation
   ---------------------------------------- */

/* Hide scrollbar for hot games slider */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Hot game card breathing glow effect */
.hot-game-glow {
    animation: hotGameGlow 3s ease-in-out infinite;
}

@keyframes hotGameGlow {
    0%, 100% {
        border-color: rgba(168, 85, 247, 0.5);
        box-shadow: 
            0 0 5px rgba(168, 85, 247, 0.3),
            0 0 10px rgba(168, 85, 247, 0.2),
            inset 0 0 5px rgba(168, 85, 247, 0.1);
    }
    50% {
        border-color: rgba(236, 72, 153, 0.7);
        box-shadow: 
            0 0 10px rgba(236, 72, 153, 0.5),
            0 0 20px rgba(236, 72, 153, 0.3),
            0 0 30px rgba(168, 85, 247, 0.2),
            inset 0 0 10px rgba(236, 72, 153, 0.2);
    }
}

/* Stagger animation for each card */
.hot-game-card:nth-child(1) .hot-game-glow { animation-delay: 0s; }
.hot-game-card:nth-child(2) .hot-game-glow { animation-delay: 0.3s; }
.hot-game-card:nth-child(3) .hot-game-glow { animation-delay: 0.6s; }
.hot-game-card:nth-child(4) .hot-game-glow { animation-delay: 0.9s; }
.hot-game-card:nth-child(5) .hot-game-glow { animation-delay: 1.2s; }
.hot-game-card:nth-child(6) .hot-game-glow { animation-delay: 1.5s; }
.hot-game-card:nth-child(7) .hot-game-glow { animation-delay: 1.8s; }
.hot-game-card:nth-child(8) .hot-game-glow { animation-delay: 2.1s; }
.hot-game-card:nth-child(9) .hot-game-glow { animation-delay: 0.15s; }
.hot-game-card:nth-child(10) .hot-game-glow { animation-delay: 0.45s; }

/* Hover enhanced glow */
.hot-game-card:hover .hot-game-glow,
.hot-game-card:active .hot-game-glow {
    animation: hotGameGlowHover 1s ease-in-out infinite;
}

@keyframes hotGameGlowHover {
    0%, 100% {
        border-color: rgba(236, 72, 153, 0.8);
        box-shadow: 
            0 0 15px rgba(236, 72, 153, 0.6),
            0 0 30px rgba(168, 85, 247, 0.4),
            0 0 45px rgba(168, 85, 247, 0.2);
    }
    50% {
        border-color: rgba(250, 204, 21, 0.9);
        box-shadow: 
            0 0 20px rgba(250, 204, 21, 0.7),
            0 0 40px rgba(236, 72, 153, 0.5),
            0 0 60px rgba(168, 85, 247, 0.3);
    }
}

/* ----------------------------------------
   Flex Container Layout (Header + Footer Fixed)
   ---------------------------------------- */

/* 锁死 HTML 和 BODY */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #0a0a0a;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
}

/* ========================================
   方案 A: Position Fixed 布局
   Header 和 Footer 都用 position: fixed
   ======================================== */

/* 容器 - 不再用 flex 布局 */
#app-layout {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    background: #0a0a0a;
    overflow: hidden;
}

/* 固定 Header - position: fixed */
#app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100 !important;
    background: rgba(5, 5, 5, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* 滚动区域 - 用 padding 留出 header/footer 空间 */
#scroll-content {
    position: fixed;
    top: 56px; /* header 高度 */
    left: 0;
    right: 0;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px)); /* footer 高度 + safe area */
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    z-index: 1; /* 确保在 header/footer 下面 */
}

/* 主内容区 */
#app-main {
    /* 内容自适应高度 */
}

/* 固定 Footer - position: fixed */
#bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100 !important;
    background: rgba(5, 5, 5, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
}

/* 图标容器 */
#nav-icons-container {
    height: 60px;
    width: 100%;
}

/* Safe Area Spacer */
#safe-area-spacer {
    width: 100%;
    height: env(safe-area-inset-bottom, 0px);
    background: transparent;
    flex-shrink: 0;
}

/* iOS Safari 兼容 */
@supports (-webkit-touch-callout: none) {
    #scroll-content {
        /* iOS 特殊处理 */
        -webkit-overflow-scrolling: touch;
    }
    body {
        overscroll-behavior-y: none;
    }
}

/* Chat view 居中 */
#view-chat {
    position: relative;
    height: calc(100vh - 160px);
    height: calc(100dvh - 160px);
}

/* ========================================
   User Card - 发光卡片样式
   ======================================== */

/* 卡片包装层 - 微浮动动画 */
.user-card-wrapper {
    position: relative;
    animation: user-card-float 8s ease-in-out infinite;
}

@keyframes user-card-float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-4px); }
}

/* 背景流光边框 */
.user-card-border-gradient {
    position: absolute;
    inset: -1px;
    border-radius: 18px;
    background: conic-gradient(
        from 0deg,
        transparent 0%,
        transparent 45%,
        rgba(139, 92, 246, 0.5) 50%,
        rgba(236, 72, 153, 0.5) 55%,
        transparent 60%,
        transparent 100%
    );
    animation: user-card-border-spin 6s linear infinite;
    z-index: -1;
    filter: blur(12px);
    opacity: 0.4;
}

@keyframes user-card-border-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 内部边框线 */
.user-card-border-inner {
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: 2;
    pointer-events: none;
}

/* 卡片主体 */
.user-card-body {
    background: rgba(10, 10, 14, 0.7);
    backdrop-filter: blur(24px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
    position: relative;
    overflow: hidden;
    z-index: 10;
}

/* 噪点纹理 */
.user-card-body::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
    opacity: 0.3;
    mix-blend-mode: overlay;
    pointer-events: none;
}

/* 头像光环 */
.user-avatar-glow {
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent, rgba(139, 92, 246, 0.5), rgba(236, 72, 153, 0.5), transparent);
    animation: user-avatar-spin 5s linear infinite;
    filter: blur(6px);
    opacity: 0.5;
}

@keyframes user-avatar-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 在线状态点 */
.user-online-dot {
    box-shadow: 0 0 0 2px #0a0a0e;
}

/* 余额文字光泽 */
.user-balance-shine {
    background: linear-gradient(
        to right, 
        rgba(255,255,255,0.9) 0%, 
        rgba(255,255,255,0.9) 40%, 
        rgba(236, 72, 153, 0.8) 50%, 
        rgba(139, 92, 246, 0.8) 60%, 
        rgba(255,255,255,0.9) 100%
    );
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: user-balance-text-shine 4s ease-in-out infinite;
}

@keyframes user-balance-text-shine {
    to { background-position: 200% center; }
}

/* 按钮效果 */
.user-card-btn {
    transition: all 0.3s ease;
}

.user-card-btn:active {
    transform: scale(0.96);
}

/* Clear Balance 按钮 - 激活状态 */
.user-clear-btn {
    border: 1px solid rgba(239, 68, 68, 0.15);
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.05), rgba(236, 72, 153, 0.05));
    color: rgba(248, 113, 113, 0.8);
    transition: all 0.3s;
}

.user-clear-btn:hover:not(.user-clear-btn-disabled) {
    border-color: rgba(239, 68, 68, 0.3);
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.1), rgba(236, 72, 153, 0.1));
}

/* Clear Balance 按钮 - 禁用状态（暗色） */
.user-clear-btn-disabled {
    border: 1px solid rgba(100, 100, 100, 0.1) !important;
    background: rgba(50, 50, 50, 0.2) !important;
    color: rgba(100, 100, 100, 0.5) !important;
    cursor: not-allowed;
}

/* Clear Balance 按钮 - 激活状态（亮色） */
.user-clear-btn-active {
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.1), rgba(236, 72, 153, 0.1)) !important;
    color: rgba(248, 113, 113, 0.9) !important;
    cursor: pointer;
}

/* ==========================================
   Provider Grid - 3 Column Themed Cards
   ========================================== */
#providers-grid,
#all-providers-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 0 4px;
}

.provider-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 8px;
    border-radius: 12px;
    aspect-ratio: 1;
    transition: all 0.3s ease;
    overflow: hidden;
}

.provider-card:hover .provider-card-inner {
    transform: translateY(-2px);
}

.provider-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.provider-card-img {
    width: 90%;
    height: 70%;
    object-fit: contain;
    border-radius: 8px;
}

.provider-card-icon-fallback {
    width: 100%;
    height: 70%;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
}

.provider-card-name {
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 4px;
}

/* Sun theme - hexagonal clip */
/* Sun theme - warm glow cards with soft animations */
.provider-card-sun {
    position: relative;
    overflow: hidden;
}
.provider-card-sun .provider-card-inner {
    border-radius: 16px;
    padding: 18px 10px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 140, 0, 0.25) !important;
    background: linear-gradient(145deg, #1a0f00, #2a1500) !important;
    animation: sunCardBreathe 4s ease-in-out infinite;
    transition: all 0.4s ease;
}
/* Soft breathing glow */
@keyframes sunCardBreathe {
    0%, 100% { box-shadow: 0 2px 8px rgba(255, 140, 0, 0.1), inset 0 0 15px rgba(255, 69, 0, 0.03); }
    50% { box-shadow: 0 4px 16px rgba(255, 140, 0, 0.2), inset 0 0 20px rgba(255, 69, 0, 0.06); }
}
/* Stagger animation per card */
.provider-card-sun:nth-child(2) .provider-card-inner { animation-delay: 0.5s; }
.provider-card-sun:nth-child(3) .provider-card-inner { animation-delay: 1s; }
.provider-card-sun:nth-child(4) .provider-card-inner { animation-delay: 0.3s; }
.provider-card-sun:nth-child(5) .provider-card-inner { animation-delay: 0.8s; }
.provider-card-sun:nth-child(6) .provider-card-inner { animation-delay: 1.3s; }
.provider-card-sun:nth-child(7) .provider-card-inner { animation-delay: 0.2s; }
.provider-card-sun:nth-child(8) .provider-card-inner { animation-delay: 0.7s; }
.provider-card-sun:nth-child(9) .provider-card-inner { animation-delay: 1.1s; }

/* Shimmer sweep across card */
.provider-card-sun .provider-card-inner::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 200, 100, 0.06), rgba(255, 140, 0, 0.08), transparent);
    animation: sunShimmer 6s ease-in-out infinite;
    z-index: 1;
    pointer-events: none;
}
@keyframes sunShimmer {
    0%, 100% { left: -100%; }
    50% { left: 140%; }
}
.provider-card-sun:nth-child(odd) .provider-card-inner::before { animation-delay: 2s; }
.provider-card-sun:nth-child(3n) .provider-card-inner::before { animation-delay: 3.5s; }

/* Warm ember dot - top corner */
.provider-card-sun .provider-card-inner::after {
    content: '';
    position: absolute;
    top: 6px; right: 6px;
    width: 4px; height: 4px;
    border-radius: 50%;
    background: #FF8C00;
    animation: sunEmberPulse 3s ease-in-out infinite;
    z-index: 2;
    pointer-events: none;
}
@keyframes sunEmberPulse {
    0%, 100% { opacity: 0.2; box-shadow: 0 0 2px rgba(255, 140, 0, 0.3); transform: scale(0.8); }
    50% { opacity: 0.8; box-shadow: 0 0 6px rgba(255, 140, 0, 0.6); transform: scale(1.2); }
}
.provider-card-sun:nth-child(even) .provider-card-inner::after { animation-delay: 1.5s; }

/* Hover: warm lift + stronger glow */
.provider-card-sun:hover .provider-card-inner {
    border-color: rgba(255, 140, 0, 0.5) !important;
    box-shadow: 0 8px 25px rgba(255, 140, 0, 0.25), 0 0 20px rgba(255, 69, 0, 0.1) !important;
    animation: none;
    transform: translateY(-3px);
}
.provider-card-sun:hover .provider-card-inner::before {
    animation: none;
    opacity: 0;
}
/* Active press */
.provider-card-sun:active .provider-card-inner {
    transform: translateY(0) scale(0.97);
}

.provider-card-sun .provider-card-icon {
    border-radius: 12px;
    box-shadow: 0 0 10px rgba(255, 69, 0, 0.3);
}
.provider-card-sun .provider-card-img {
    border-radius: 12px;
}

/* Moon theme - frosted glass pill */
.provider-card-moon .provider-card-inner {
    border-radius: 20px;
    backdrop-filter: blur(10px);
    background: linear-gradient(135deg, rgba(10,10,31,0.8), rgba(26,26,62,0.6)) !important;
    border: 1px solid rgba(192,192,192,0.15) !important;
}
.provider-card-moon .provider-card-icon {
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(192, 192, 192, 0.3);
}

/* Mercury theme - cyber neon border */
.provider-card-mercury .provider-card-inner {
    border-radius: 4px;
    border: 1px solid rgba(0, 229, 255, 0.4) !important;
    box-shadow: inset 0 0 20px rgba(0, 229, 255, 0.05), 0 0 10px rgba(0, 229, 255, 0.15);
}
.provider-card-mercury .provider-card-icon {
    border-radius: 4px;
    border: 1px solid rgba(0, 229, 255, 0.3);
}

/* Venus theme - luxury rounded with gold accent */
.provider-card-venus .provider-card-inner {
    border-radius: 24px;
    border: 1px solid rgba(255, 105, 180, 0.2) !important;
}
.provider-card-venus .provider-card-icon {
    border-radius: 50%;
    width: 52px;
    height: 52px;
    box-shadow: 0 4px 15px rgba(255, 105, 180, 0.3);
}

/* Earth theme - organic leaf shape */
.provider-card-earth .provider-card-inner {
    border-radius: 20px 4px 20px 4px;
    border: 1px solid rgba(0, 200, 83, 0.2) !important;
}
.provider-card-earth .provider-card-icon {
    border-radius: 12px 4px 12px 4px;
    box-shadow: 0 4px 12px rgba(0, 200, 83, 0.25);
}

/* Mars theme - sharp tactical cut corners */
.provider-card-mars .provider-card-inner {
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
    border-radius: 0;
    aspect-ratio: auto;
    padding: 18px 10px;
}
.provider-card-mars .provider-card-icon {
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(255, 61, 0, 0.4);
}

/* Jupiter theme - ornate double border */
.provider-card-jupiter .provider-card-inner {
    border-radius: 16px;
    border: 2px solid rgba(212, 165, 116, 0.3) !important;
    box-shadow: inset 0 0 0 3px rgba(15, 10, 2, 0.8), inset 0 0 0 4px rgba(212, 165, 116, 0.15);
}
.provider-card-jupiter .provider-card-icon {
    border-radius: 50%;
    border: 2px solid rgba(212, 165, 116, 0.3);
}

/* Saturn theme - ring accent */
.provider-card-saturn .provider-card-inner {
    border-radius: 16px;
    border: 1px solid rgba(253, 185, 49, 0.25) !important;
    position: relative;
    overflow: visible;
}
.provider-card-saturn .provider-card-icon {
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(253, 185, 49, 0.15), 0 0 15px rgba(253, 185, 49, 0.2);
}
