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

:root {
    --bg-main: #0b0c15;
    --bg-card: #1a1b2e;
    --primary-purple: #8b5cf6;
    --primary-gradient: linear-gradient(135deg, #8b5cf6, #ec4899);
    --text-white: #ffffff;
    --text-gray: #9ca3af;
    --success-green: #10b981;
    --danger-red: #ef4444;
    --border-color: #2d2f45;
    --nav-height: 75px;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', sans-serif; -webkit-tap-highlight-color: transparent; }
body { background-color: var(--bg-main); color: var(--text-white); height: 100vh; display: flex; flex-direction: column; overflow: hidden; }

/* Top Header */
.top-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--bg-main); z-index: 10; }
.logo { font-size: 1.2rem; font-weight: 800; color: var(--primary-purple); letter-spacing: -0.5px; }
.user-balance { background: var(--bg-card); padding: 6px 12px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.btn-deposit { background: var(--primary-gradient); border: none; color: white; padding: 8px 16px; border-radius: 20px; font-weight: 700; font-size: 0.85rem; cursor: pointer; }

/* Asset Tabs - EXACT MATCH */
.asset-tabs { display: flex; gap: 8px; padding: 0 16px 12px; overflow-x: auto; scrollbar-width: none; align-items: center; }
.asset-tab { 
    background: transparent; border: none; color: var(--text-gray); 
    padding: 8px 14px; border-radius: 20px; font-size: 0.8rem; 
    white-space: nowrap; cursor: pointer; display: flex; align-items: center; gap: 6px;
    transition: all 0.2s;
}
.asset-tab svg { width: 14px; height: 14px; fill: currentColor; }
.asset-tab.active { 
    background: rgba(139, 92, 246, 0.2); 
    color: var(--text-white); 
    font-weight: 600;
}

/* Chart Area */
.chart-wrapper { flex: 1; position: relative; min-height: 0; padding: 0 16px; }
.price-overlay { 
    position: absolute; top: 10px; left: 26px; z-index: 5; 
    background: rgba(26, 27, 46, 0.9); backdrop-filter: blur(8px); 
    padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border-color); 
}
.asset-name { font-size: 0.9rem; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.current-price-lg { font-size: 1.5rem; font-weight: 800; margin-top: 2px; }
#chart { width: 100%; height: 100%; }

/* Digit Frequency Circles - EXACT PROGRESS RINGS */
.digit-row { display: flex; justify-content: space-between; padding: 12px 16px; gap: 2px; }
.digit-circle { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; position: relative; }
.circle-container { width: 38px; height: 38px; position: relative; display: flex; align-items: center; justify-content: center; }
.circle-bg { width: 100%; height: 100%; border-radius: 50%; background: transparent; }
.circle-progress { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    transform: rotate(-90deg); 
}
.circle-progress circle { 
    fill: none; stroke-width: 3; stroke-linecap: round; 
    transition: stroke-dashoffset 0.5s ease, stroke 0.3s ease;
}
.digit-num { position: absolute; font-weight: 800; font-size: 0.95rem; color: white; }
.digit-pct { font-size: 0.6rem; color: var(--text-gray); font-weight: 500; }

/* Trading Controls Panel */
.controls-panel { 
    background: var(--bg-card); border-radius: 24px 24px 0 0; 
    padding: 20px 16px calc(var(--nav-height) + 20px); 
    overflow-y: auto; flex-shrink: 0;
}
.mode-toggle { display: flex; background: var(--bg-main); border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.mode-btn { flex: 1; padding: 10px; border: none; border-radius: 10px; font-weight: 700; font-size: 0.85rem; cursor: pointer; background: transparent; color: var(--text-gray); letter-spacing: 0.5px; }
.mode-btn.active { background: var(--primary-purple); color: white; }

.stake-box { 
    background: var(--bg-main); border: 1px solid var(--border-color); 
    border-radius: 16px; padding: 20px 16px; text-align: center; 
    margin-bottom: 12px; position: relative; 
}
.stake-label { 
    position: absolute; top: -10px; left: 50%; transform: translateX(-50%); 
    background: var(--bg-card); padding: 0 10px; 
    color: var(--primary-purple); font-size: 0.75rem; font-weight: 800; letter-spacing: 1px; 
}
.stake-input { background: transparent; border: none; color: white; font-size: 2.2rem; font-weight: 800; text-align: center; width: 100%; outline: none; }

.quick-stakes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 16px; }
.qs-btn { background: var(--bg-main); border: 1px solid var(--border-color); color: var(--text-gray); padding: 10px 0; border-radius: 10px; font-size: 0.75rem; font-weight: 600; cursor: pointer; }
.qs-btn:hover, .qs-btn:active { border-color: var(--primary-purple); color: white; background: rgba(139, 92, 246, 0.1); }

.trade-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn-trade { border: none; padding: 18px 12px; border-radius: 16px; color: white; font-size: 1.2rem; font-weight: 800; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.btn-even { background: var(--success-green); box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3); }
.btn-odd { background: var(--danger-red); box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3); }
.payout-info { font-size: 0.7rem; font-weight: 500; opacity: 0.9; }

/* Bottom Navigation Bar - EXACT MATCH */
.bottom-nav { 
    position: fixed; bottom: 0; left: 0; right: 0; 
    height: var(--nav-height); background: var(--bg-card); 
    border-top: 1px solid var(--border-color); 
    display: flex; justify-content: space-around; align-items: center; 
    z-index: 100; padding-bottom: env(safe-area-inset-bottom); 
}
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text-gray); text-decoration: none; font-size: 0.7rem; font-weight: 600; flex: 1; height: 100%; justify-content: center; transition: color 0.2s; }
.nav-item.active { color: var(--primary-purple); }
.nav-icon { width: 24px; height: 24px; fill: currentColor; }

/* AI Button Special Styling */
.nav-item.ai-btn { color: white; }
.ai-icon-wrap { 
    width: 44px; height: 44px; border-radius: 50%; 
    background: var(--primary-gradient); 
    display: flex; align-items: center; justify-content: center; 
    margin-bottom: 2px; 
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.6), inset 0 0 10px rgba(255,255,255,0.2);
    position: relative;
}
.ai-icon-wrap::before {
    content: ''; position: absolute; inset: -2px; border-radius: 50%;
    background: var(--primary-gradient); z-index: -1; filter: blur(8px); opacity: 0.7;
}
.ai-icon { width: 22px; height: 22px; fill: white; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); }

/* Auth Pages */
.auth-wrapper { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 20px; }
.auth-card { background: var(--bg-card); padding: 30px; border-radius: 24px; width: 100%; max-width: 400px; border: 1px solid var(--border-color); }
.input-group { margin-bottom: 16px; }
.input-group label { display: block; color: var(--text-gray); margin-bottom: 8px; font-size: 0.85rem; font-weight: 500; }
.input-group input { width: 100%; padding: 14px; background: var(--bg-main); border: 1px solid var(--border-color); color: white; border-radius: 12px; font-size: 1rem; outline: none; transition: border-color 0.2s; }
.input-group input:focus { border-color: var(--primary-purple); }
.btn-primary { background: var(--primary-gradient); color: white; border: none; padding: 16px; border-radius: 12px; font-weight: 700; cursor: pointer; width: 100%; font-size: 1rem; box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4); }
