/* ===== RESET & BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; min-height: 100vh; overflow: hidden; font-family: 'Rajdhani', sans-serif; background: #080300; color: #fff8e1; }

/* ===== BACKGROUND FILL (prevents black bottom) ===== */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse at 50% 100%, #2d1000 0%, #1a0800 40%, #080300 100%);
  pointer-events: none;
}

/* ===== BACKGROUND ===== */
.bg-layer { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.city-bg { width: 100%; height: 100%; object-fit: cover; object-position: center bottom; }

/* ===== PARTICLES ===== */
#particles { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* ===== APP ===== */
.app {
  position: relative; z-index: 1;
  height: 100vh; min-height: 100vh; display: flex; flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(10,5,0,0.45) 0%, rgba(10,5,0,0.65) 40%, rgba(12,5,0,0.82) 70%, rgba(8,3,0,0.95) 100%);
}

/* ===== HEADER ===== */
.header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: linear-gradient(90deg, rgba(20,8,0,0.95), rgba(30,12,0,0.95));
  border-bottom: 1px solid rgba(255,140,0,0.3); flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(255,100,0,0.15);
}
.header-left { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.character-mini { font-size: 22px; filter: drop-shadow(0 0 6px #ff8c00); }
.profile-info { display: flex; flex-direction: column; }
.profile-name { font-size: 11px; font-weight: 700; color: #ffd700; line-height: 1.2; text-shadow: 0 0 8px #ff8c00; }
.profile-rank { font-size: 9px; color: #ff8c00; }
.header-center { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.level-badge {
  font-family: 'Orbitron', sans-serif; font-size: 12px; color: #ffd700; font-weight: 900;
  text-shadow: 0 0 10px #ffd700, 0 0 20px #ff8c00;
}
.xp-bar-wrap { width: 100%; max-width: 120px; height: 4px; background: #2d1200; border-radius: 2px; overflow: hidden; box-shadow: 0 0 4px rgba(255,100,0,0.3); }
.xp-bar-fill { height: 100%; background: linear-gradient(90deg, #ff6600, #ffd700); border-radius: 2px; transition: width 0.5s ease; box-shadow: 0 0 6px #ffd700; }
.xp-text { font-size: 8px; color: #888; }
.header-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.ai-status { display: flex; align-items: center; gap: 4px; }
.ai-dot { width: 6px; height: 6px; border-radius: 50%; background: #00ff88; animation: pulse 2s infinite; box-shadow: 0 0 6px #00ff88; }
.ai-label { font-size: 9px; color: #00ff88; font-weight: 700; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.3;transform:scale(0.8)} }
.balance-display { text-align: right; }
.balance-label { font-size: 8px; color: #888; }
.balance-val { font-size: 11px; color: #ffd700; font-weight: 700; text-shadow: 0 0 6px rgba(255,215,0,0.4); }

/* ===== PRICE PANEL ===== */
.price-panel {
  background: linear-gradient(135deg, rgba(25,8,0,0.97), rgba(40,15,0,0.97));
  border-bottom: 1px solid rgba(255,140,0,0.25);
  padding: 8px 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 2px 16px rgba(255,100,0,0.1);
}
.price-symbol { font-size: 10px; color: #ff8c00; font-weight: 700; letter-spacing: 1px; }
.price-time { font-size: 9px; color: #666; margin-left: 6px; }
.price-main { display: flex; align-items: baseline; gap: 10px; }
.price-bid {
  font-family: 'Orbitron', sans-serif; font-size: 22px; font-weight: 900; color: #ffd700;
  transition: color 0.3s, text-shadow 0.3s;
  text-shadow: 0 0 12px rgba(255,215,0,0.5);
}
.price-bid.flash-up { color: #00ff88; text-shadow: 0 0 20px #00ff88; }
.price-bid.flash-down { color: #ff3366; text-shadow: 0 0 20px #ff3366; }
.price-detail { display: flex; flex-direction: column; }
.price-ask-label { font-size: 8px; color: #666; }
.price-ask { font-size: 11px; color: #aaa; }
.price-change { font-size: 10px; font-weight: 700; }
.price-change.up { color: #00ff88; text-shadow: 0 0 6px #00ff88; }
.price-change.down { color: #ff3366; text-shadow: 0 0 6px #ff3366; }

/* ===== EMA ROW ===== */
.ema-row {
  display: flex; gap: 4px; padding: 5px 12px;
  background: rgba(12,4,0,0.92); border-bottom: 1px solid rgba(255,100,0,0.15);
  flex-shrink: 0; overflow-x: auto;
}
.ema-item { display: flex; align-items: center; gap: 3px; flex-shrink: 0; }
.ema-tf { font-size: 9px; color: #666; }
.ema-badge { font-size: 8px; font-weight: 700; padding: 2px 5px; border-radius: 3px; transition: all 0.3s; }
.ema-badge.buy { background: rgba(0,255,136,0.15); color: #00ff88; border: 1px solid #00ff88; box-shadow: 0 0 6px rgba(0,255,136,0.2); }
.ema-badge.sell { background: rgba(255,51,102,0.15); color: #ff3366; border: 1px solid #ff3366; box-shadow: 0 0 6px rgba(255,51,102,0.2); }
.ema-badge.neutral { background: rgba(255,140,0,0.08); color: #888; border: 1px solid #3d1a00; }

/* ===== CHARTS ===== */
.charts-row { display: flex; gap: 6px; padding: 6px 10px; flex-shrink: 0; }
.chart-box {
  flex: 1; background: rgba(15,5,0,0.92); border: 1px solid rgba(255,100,0,0.2);
  border-radius: 6px; overflow: hidden;
  box-shadow: inset 0 0 12px rgba(255,100,0,0.05);
}
.chart-header { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px; font-size: 10px; color: #ff8c00; font-weight: 700; background: rgba(30,10,0,0.8); border-bottom: 1px solid rgba(255,100,0,0.1); }
.chart-badge { font-size: 8px; font-weight: 700; padding: 1px 5px; border-radius: 3px; }
.chart-badge.bull { background: rgba(0,255,136,0.2); color: #00ff88; }
.chart-badge.bear { background: rgba(255,51,102,0.2); color: #ff3366; }
.chart-badge.neutral { background: rgba(100,100,100,0.2); color: #888; }
.chart-box canvas { display: block; width: 100%; height: 60px; }

/* ===== DISCIPLINE BAR ===== */
.discipline-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 12px; background: rgba(10,3,0,0.9);
  border-bottom: 1px solid rgba(255,100,0,0.1); flex-shrink: 0;
  font-size: 9px; min-height: 22px;
}
.disc-badge {
  padding: 1px 6px; border-radius: 8px; font-weight: 700; font-size: 8px;
  background: rgba(0,255,136,0.15); color: #00ff88; border: 1px solid rgba(0,255,136,0.3);
}
.disc-badge.locked { background: rgba(255,51,102,0.2); color: #ff3366; border-color: rgba(255,51,102,0.4); }
.disc-badge.warning { background: rgba(255,215,0,0.15); color: #ffd700; border-color: rgba(255,215,0,0.3); }
.disc-multiplier { color: #ffd700; font-weight: 700; }
.disc-timer { color: #ff3366; font-size: 8px; font-weight: 700; font-family: 'Orbitron', sans-serif; }
.disc-badges-row { display: flex; gap: 3px; margin-left: auto; }
.shame-badge { font-size: 10px; filter: drop-shadow(0 0 3px rgba(255,50,0,0.5)); }

/* ===== TABS ===== */
.tab-bar {
  display: flex; background: rgba(12,4,0,0.97);
  border-bottom: 1px solid rgba(255,100,0,0.2); flex-shrink: 0;
}
.tab-btn {
  flex: 1; padding: 8px 4px; background: none; border: none;
  color: #666; font-size: 10px; font-family: 'Rajdhani', sans-serif;
  font-weight: 700; cursor: pointer; transition: all 0.2s;
  border-bottom: 2px solid transparent; position: relative;
}
.tab-btn.active { color: #ffd700; border-bottom-color: #ffd700; background: rgba(255,215,0,0.04); text-shadow: 0 0 8px rgba(255,215,0,0.4); }
.tab-btn::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 0; height: 2px; background: #ffd700; transition: width 0.3s; }
.tab-btn.active::after { width: 80%; box-shadow: 0 0 8px #ffd700; }

/* ===== TAB CONTENT ===== */

/* ===== SIGNAL PANEL ===== */
.signal-panel {
  background: linear-gradient(135deg, rgba(18,6,0,0.95), rgba(25,9,0,0.95));
  border: 1px solid rgba(255,100,0,0.2); border-radius: 10px; padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,140,0,0.1);
}
.signal-row { display: flex; gap: 8px; }
.signal-item { flex: 1; }
.signal-item.full { flex: none; width: 100%; }
.sig-label { font-size: 9px; color: #666; margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.5px; }
.sig-val { font-size: 12px; font-weight: 700; color: #fff8e1; }
.sig-val.small { font-size: 10px; color: #ff8c00; }
.zone-badge { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 5px; display: inline-block; letter-spacing: 0.5px; }
.zone-badge.high { background: rgba(0,255,136,0.15); color: #00ff88; border: 1px solid rgba(0,255,136,0.4); box-shadow: 0 0 8px rgba(0,255,136,0.2); }
.zone-badge.low { background: rgba(255,215,0,0.15); color: #ffd700; border: 1px solid rgba(255,215,0,0.4); box-shadow: 0 0 8px rgba(255,215,0,0.2); }
.zone-badge.no-zone { background: rgba(100,100,100,0.1); color: #888; border: 1px solid #333; }

/* ===== TRADE BUTTONS ===== */
.trade-row { display: flex; gap: 10px; }
.btn-buy, .btn-sell {
  flex: 1; padding: 14px 8px; border: none; border-radius: 12px;
  font-family: 'Orbitron', sans-serif; font-size: 15px; font-weight: 900;
  cursor: pointer; display: flex; flex-direction: column; align-items: center;
  transition: all 0.15s; position: relative; overflow: hidden;
  letter-spacing: 1px;
}
.btn-buy {
  background: linear-gradient(135deg, #002512, #004d25, #00cc66);
  color: #fff; border: 2px solid #00ff88;
  box-shadow: 0 4px 16px rgba(0,255,136,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
  text-shadow: 0 0 8px rgba(0,255,136,0.6);
}
.btn-sell {
  background: linear-gradient(135deg, #2a0010, #5a0020, #cc0044);
  color: #fff; border: 2px solid #ff3366;
  box-shadow: 0 4px 16px rgba(255,51,102,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
  text-shadow: 0 0 8px rgba(255,51,102,0.6);
}
.btn-buy:active { transform: scale(0.95); box-shadow: 0 2px 8px rgba(0,255,136,0.2); }
.btn-sell:active { transform: scale(0.95); box-shadow: 0 2px 8px rgba(255,51,102,0.2); }
.btn-buy::before, .btn-sell::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(255,255,255,0); transition: background 0.15s;
}
.btn-buy:active::before { background: rgba(255,255,255,0.05); }
.btn-sell:active::before { background: rgba(255,255,255,0.05); }
.btn-arrow { font-size: 16px; }
.btn-price { font-size: 9px; opacity: 0.8; font-family: 'Rajdhani', sans-serif; margin-top: 2px; }

/* ===== AI PANEL ===== */
.ai-panel {
  background: linear-gradient(135deg, rgba(18,6,0,0.95), rgba(25,9,0,0.95));
  border: 1px solid rgba(255,100,0,0.2); border-radius: 10px; padding: 10px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.ai-header { display: flex; justify-content: space-between; align-items: center; }
.ai-title { font-size: 12px; font-weight: 700; color: #ffd700; text-shadow: 0 0 8px rgba(255,215,0,0.3); }
.ai-running { font-size: 8px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: rgba(0,255,136,0.15); color: #00ff88; border: 1px solid rgba(0,255,136,0.3); animation: pulse 2s infinite; }
.confidence-wrap { display: flex; align-items: center; gap: 8px; }
.conf-label { font-size: 9px; color: #888; width: 70px; flex-shrink: 0; }
.conf-bar-wrap { flex: 1; height: 8px; background: rgba(10,3,0,0.8); border-radius: 4px; overflow: hidden; border: 1px solid rgba(255,100,0,0.1); }
.conf-bar-fill { height: 100%; background: linear-gradient(90deg, #ff6600, #ffd700, #00ff88); border-radius: 4px; transition: width 0.5s ease; box-shadow: 0 0 6px rgba(255,215,0,0.3); }
.conf-val { font-size: 11px; font-weight: 700; color: #ffd700; width: 35px; text-align: right; font-family: 'Orbitron', sans-serif; }
.ai-signal-box { background: rgba(8,3,0,0.8); border: 1px solid rgba(255,100,0,0.15); border-radius: 8px; padding: 8px; box-shadow: inset 0 0 8px rgba(255,100,0,0.05); }
.ai-signal-bias { font-size: 14px; font-weight: 700; color: #ffd700; margin-bottom: 4px; }
.ai-signal-detail { font-size: 10px; color: #ff8c00; }
.weights-title { font-size: 9px; color: #666; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.weights-grid { display: flex; flex-direction: column; gap: 4px; }
.weight-item { display: flex; align-items: center; gap: 8px; }
.weight-item span { font-size: 9px; color: #aaa; width: 65px; flex-shrink: 0; }
.weight-bar { flex: 1; height: 5px; background: rgba(10,3,0,0.8); border-radius: 3px; overflow: hidden; border: 1px solid rgba(255,100,0,0.08); }
.weight-fill { height: 100%; background: linear-gradient(90deg, #ff6600, #ffd700); border-radius: 3px; transition: width 0.5s ease; box-shadow: 0 0 4px rgba(255,150,0,0.2); }
.perf-row { display: flex; gap: 4px; }
.perf-item { flex: 1; background: rgba(10,3,0,0.8); border: 1px solid rgba(255,100,0,0.12); border-radius: 8px; padding: 6px 4px; text-align: center; }
.perf-val { font-size: 14px; font-weight: 700; font-family: 'Orbitron', sans-serif; }
.perf-val.green { color: #00ff88; text-shadow: 0 0 8px rgba(0,255,136,0.3); }
.perf-val.red { color: #ff3366; text-shadow: 0 0 8px rgba(255,51,102,0.3); }
.perf-val.gold { color: #ffd700; text-shadow: 0 0 8px rgba(255,215,0,0.3); }
.perf-label { font-size: 8px; color: #555; margin-top: 2px; }
.daily-row { display: flex; align-items: center; gap: 6px; font-size: 9px; }
.daily-label { color: #666; }
.daily-val { color: #ffd700; font-weight: 700; }

/* ===== HISTORY ===== */
.history-panel { background: rgba(15,5,0,0.95); border: 1px solid rgba(255,100,0,0.2); border-radius: 10px; overflow: hidden; }
.history-header { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: rgba(25,8,0,0.9); font-size: 11px; font-weight: 700; color: #ffd700; border-bottom: 1px solid rgba(255,100,0,0.15); }
.refresh-btn { background: none; border: none; color: #ff8c00; font-size: 16px; cursor: pointer; padding: 2px 6px; transition: transform 0.2s; }
.refresh-btn:active { transform: rotate(180deg); }
.history-empty { text-align: center; color: #666; padding: 20px; font-size: 11px; }
.history-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid rgba(255,100,0,0.06); font-size: 11px; transition: background 0.2s; }
.history-item:active { background: rgba(255,100,0,0.05); }
.history-dir { font-weight: 700; font-size: 12px; }
.history-dir.buy { color: #00ff88; text-shadow: 0 0 4px rgba(0,255,136,0.4); }
.history-dir.sell { color: #ff3366; text-shadow: 0 0 4px rgba(255,51,102,0.4); }
.history-price { color: #888; }
.history-result { font-weight: 700; }
.history-result.win { color: #00ff88; }
.history-result.loss { color: #ff3366; }
.history-result.open { color: #ffd700; }
.history-time { font-size: 9px; color: #444; }

/* ===== XP POPUP ===== */
@keyframes xpFloat {
  0% { opacity:1; transform: translateY(0) scale(1); }
  100% { opacity:0; transform: translateY(-60px) scale(1.3); }
}
.xp-popup {
  position: fixed; z-index: 1000; pointer-events: none;
  font-family: 'Orbitron', sans-serif; font-size: 14px; font-weight: 900;
  color: #ffd700; text-shadow: 0 0 12px #ffd700, 0 0 24px #ff8c00;
  animation: xpFloat 1.5s ease-out forwards;
}

/* ===== TOAST ===== */
#toast-container { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 6px; pointer-events: none; width: 90%; max-width: 340px; }
.toast {
  background: linear-gradient(135deg, rgba(20,8,0,0.97), rgba(35,12,0,0.97));
  border-radius: 12px; padding: 10px 18px; font-size: 12px; font-weight: 700;
  color: #fff8e1; box-shadow: 0 6px 24px rgba(0,0,0,0.7);
  animation: toastIn 0.3s ease;
  backdrop-filter: blur(4px);
}
.toast.buy { border: 2px solid #00ff88; box-shadow: 0 6px 24px rgba(0,0,0,0.7), 0 0 12px rgba(0,255,136,0.2); }
.toast.sell { border: 2px solid #ff3366; box-shadow: 0 6px 24px rgba(0,0,0,0.7), 0 0 12px rgba(255,51,102,0.2); }
.toast.xp { border: 2px solid #ffd700; box-shadow: 0 6px 24px rgba(0,0,0,0.7), 0 0 12px rgba(255,215,0,0.2); }
.toast.info { border: 2px solid #ff8c00; }
@keyframes toastIn { from{opacity:0;transform:translateY(-15px) scale(0.95)} to{opacity:1;transform:translateY(0) scale(1)} }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,100,0,0.3); border-radius: 2px; }


/* ===== BACKGROUND ===== */
.bg-layer { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.city-bg { width: 100%; height: 100%; object-fit: cover; object-position: center bottom; }

/* ===== APP ===== */
.app {
  position: relative; z-index: 1;
  height: 100vh; min-height: 100vh; display: flex; flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(10,5,0,0.5) 0%, rgba(10,5,0,0.7) 50%, rgba(20,8,0,0.88) 100%);
}

/* ===== HEADER ===== */
.header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; background: rgba(20,8,0,0.9);
  border-bottom: 1px solid #3d1a00; flex-shrink: 0;
}
.header-left { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.character-mini { font-size: 22px; }
.profile-info { display: flex; flex-direction: column; }
.profile-name { font-size: 11px; font-weight: 700; color: #ffd700; line-height: 1.2; }
.profile-rank { font-size: 9px; color: #ff8c00; }
.header-center { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.level-badge { font-family: 'Orbitron', sans-serif; font-size: 12px; color: #ffd700; font-weight: 900; }
.xp-bar-wrap { width: 100%; max-width: 120px; height: 4px; background: #2d1200; border-radius: 2px; overflow: hidden; }
.xp-bar-fill { height: 100%; background: linear-gradient(90deg, #ff6600, #ffd700); border-radius: 2px; transition: width 0.5s ease; }
.xp-text { font-size: 8px; color: #888; }
.header-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.ai-status { display: flex; align-items: center; gap: 4px; }
.ai-dot { width: 6px; height: 6px; border-radius: 50%; background: #00ff88; animation: pulse 2s infinite; }
.ai-label { font-size: 9px; color: #00ff88; font-weight: 700; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }
.balance-display { text-align: right; }
.balance-label { font-size: 8px; color: #888; }
.balance-val { font-size: 11px; color: #ffd700; font-weight: 700; }

/* ===== PRICE PANEL ===== */
.price-panel {
  background: linear-gradient(135deg, rgba(30,10,0,0.95), rgba(45,18,0,0.95));
  border-bottom: 1px solid #3d1a00;
  padding: 8px 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
}
.price-symbol { font-size: 10px; color: #ff8c00; font-weight: 700; }
.price-time { font-size: 9px; color: #666; margin-left: 6px; }
.price-main { display: flex; align-items: baseline; gap: 10px; }
.price-bid { font-family: 'Orbitron', sans-serif; font-size: 22px; font-weight: 900; color: #ffd700; transition: color 0.3s; }
.price-detail { display: flex; flex-direction: column; }
.price-ask-label { font-size: 8px; color: #666; }
.price-ask { font-size: 11px; color: #aaa; }
.price-change { font-size: 10px; font-weight: 700; }
.price-change.up { color: #00ff88; }
.price-change.down { color: #ff3366; }

/* ===== EMA ROW ===== */
.ema-row {
  display: flex; gap: 4px; padding: 5px 12px;
  background: rgba(15,5,0,0.9); border-bottom: 1px solid #2d1200;
  flex-shrink: 0; overflow-x: auto;
}
.ema-item { display: flex; align-items: center; gap: 3px; flex-shrink: 0; }
.ema-tf { font-size: 9px; color: #666; }
.ema-badge { font-size: 8px; font-weight: 700; padding: 2px 5px; border-radius: 3px; }
.ema-badge.buy { background: rgba(0,255,136,0.2); color: #00ff88; border: 1px solid #00ff88; }
.ema-badge.sell { background: rgba(255,51,102,0.2); color: #ff3366; border: 1px solid #ff3366; }
.ema-badge.neutral { background: rgba(255,140,0,0.15); color: #888; border: 1px solid #3d1a00; }

/* ===== CHARTS ===== */
.charts-row {
  display: flex; gap: 6px; padding: 6px 10px;
  flex-shrink: 0;
}
.chart-box { flex: 1; background: rgba(20,8,0,0.9); border: 1px solid #3d1a00; border-radius: 6px; overflow: hidden; }
.chart-header { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px; font-size: 10px; color: #ff8c00; font-weight: 700; background: rgba(30,10,0,0.8); }
.chart-badge { font-size: 8px; font-weight: 700; padding: 1px 5px; border-radius: 3px; }
.chart-badge.bull { background: rgba(0,255,136,0.2); color: #00ff88; }
.chart-badge.bear { background: rgba(255,51,102,0.2); color: #ff3366; }
.chart-badge.neutral { background: rgba(100,100,100,0.2); color: #888; }
.chart-box canvas { display: block; width: 100%; height: 60px; }

/* ===== TABS ===== */
.tab-bar {
  display: flex; background: rgba(15,5,0,0.95);
  border-bottom: 1px solid #3d1a00; flex-shrink: 0;
}
.tab-btn {
  flex: 1; padding: 8px 4px; background: none; border: none;
  color: #666; font-size: 10px; font-family: 'Rajdhani', sans-serif;
  font-weight: 700; cursor: pointer; transition: all 0.2s;
  border-bottom: 2px solid transparent;
}
.tab-btn.active { color: #ffd700; border-bottom-color: #ffd700; background: rgba(255,215,0,0.05); }

/* ===== TAB CONTENT ===== */
.tab-content { display: none; flex: 1; overflow-y: auto; padding: 8px 10px; background: linear-gradient(180deg, transparent 0%, rgba(8,3,0,0.5) 100%); min-height: 0; }
.tab-content.active { display: flex; flex-direction: column; gap: 8px; }
.tab-content.active::after { content: ''; flex-shrink: 0; height: 40px; background: linear-gradient(0deg, rgba(5,2,0,0.8) 0%, transparent 100%); }

/* ===== SIGNAL PANEL ===== */
.signal-panel { background: rgba(20,8,0,0.9); border: 1px solid #3d1a00; border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.signal-row { display: flex; gap: 8px; }
.signal-item { flex: 1; }
.signal-item.full { flex: none; width: 100%; }
.sig-label { font-size: 9px; color: #888; margin-bottom: 3px; }
.sig-val { font-size: 12px; font-weight: 700; color: #fff8e1; }
.sig-val.small { font-size: 10px; color: #ff8c00; }
.zone-badge { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 4px; display: inline-block; }
.zone-badge.high { background: rgba(0,255,136,0.2); color: #00ff88; border: 1px solid #00ff88; }
.zone-badge.low { background: rgba(255,215,0,0.2); color: #ffd700; border: 1px solid #ffd700; }
.zone-badge.no-zone { background: rgba(100,100,100,0.2); color: #888; border: 1px solid #444; }

/* ===== TRADE BUTTONS ===== */
.trade-row { display: flex; gap: 10px; }
.btn-buy, .btn-sell {
  flex: 1; padding: 14px 8px; border: none; border-radius: 10px;
  font-family: 'Orbitron', sans-serif; font-size: 14px; font-weight: 900;
  cursor: pointer; display: flex; flex-direction: column; align-items: center;
  transition: all 0.15s; position: relative; overflow: hidden;
}
.btn-buy { background: linear-gradient(135deg, #003820, #00ff88); color: #fff; border: 2px solid #00ff88; }
.btn-sell { background: linear-gradient(135deg, #380010, #ff3366); color: #fff; border: 2px solid #ff3366; }
.btn-buy:active { transform: scale(0.96); }
.btn-sell:active { transform: scale(0.96); }
.btn-arrow { font-size: 16px; }
.btn-price { font-size: 9px; opacity: 0.8; font-family: 'Rajdhani', sans-serif; margin-top: 2px; }

/* ===== AI PANEL ===== */
.ai-panel { background: rgba(20,8,0,0.9); border: 1px solid #3d1a00; border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.ai-header { display: flex; justify-content: space-between; align-items: center; }
.ai-title { font-size: 12px; font-weight: 700; color: #ffd700; }
.ai-running-badge { font-size: 8px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: rgba(0,255,136,0.2); color: #00ff88; border: 1px solid #00ff88; }
.confidence-wrap { display: flex; align-items: center; gap: 8px; }
.conf-label { font-size: 9px; color: #888; width: 70px; flex-shrink: 0; }
.conf-bar-wrap { flex: 1; height: 8px; background: #1a0800; border-radius: 4px; overflow: hidden; }
.conf-bar-fill { height: 100%; background: linear-gradient(90deg, #ff6600, #ffd700, #00ff88); border-radius: 4px; transition: width 0.5s ease; }
.conf-val { font-size: 11px; font-weight: 700; color: #ffd700; width: 35px; text-align: right; }
.ai-signal-box { background: rgba(10,5,0,0.8); border: 1px solid #3d1a00; border-radius: 6px; padding: 8px; }
.ai-signal-bias { font-size: 14px; font-weight: 700; color: #ffd700; margin-bottom: 4px; }
.ai-signal-detail { font-size: 10px; color: #ff8c00; }
.weights-title { font-size: 9px; color: #888; font-weight: 700; }
.weights-grid { display: flex; flex-direction: column; gap: 4px; }
.weight-item { display: flex; align-items: center; gap: 8px; }
.weight-item span { font-size: 9px; color: #aaa; width: 65px; flex-shrink: 0; }
.weight-bar { flex: 1; height: 5px; background: #1a0800; border-radius: 3px; overflow: hidden; }
.weight-fill { height: 100%; background: linear-gradient(90deg, #ff6600, #ffd700); border-radius: 3px; transition: width 0.5s ease; }
.perf-row { display: flex; gap: 4px; }
.perf-item { flex: 1; background: rgba(10,5,0,0.8); border: 1px solid #2d1200; border-radius: 6px; padding: 6px 4px; text-align: center; }
.perf-val { font-size: 14px; font-weight: 700; font-family: 'Orbitron', sans-serif; }
.perf-val.green { color: #00ff88; }
.perf-val.red { color: #ff3366; }
.perf-val.gold { color: #ffd700; }
.perf-label { font-size: 8px; color: #666; margin-top: 2px; }
.daily-row { display: flex; align-items: center; gap: 6px; font-size: 9px; }
.daily-label { color: #888; }
.daily-val { color: #ffd700; font-weight: 700; }

/* ===== HISTORY ===== */
.history-panel { background: rgba(20,8,0,0.9); border: 1px solid #3d1a00; border-radius: 8px; overflow: hidden; }
.history-header { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: rgba(30,10,0,0.9); font-size: 11px; font-weight: 700; color: #ffd700; border-bottom: 1px solid #3d1a00; }
.refresh-btn { background: none; border: none; color: #ff8c00; font-size: 16px; cursor: pointer; padding: 2px 6px; }
.history-empty { text-align: center; color: #666; padding: 20px; font-size: 11px; }
.history-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid #1a0800; font-size: 11px; }
.history-dir { font-weight: 700; font-size: 12px; }
.history-dir.buy { color: #00ff88; }
.history-dir.sell { color: #ff3366; }
.history-price { color: #aaa; }
.history-result { font-weight: 700; }
.history-result.win { color: #00ff88; }
.history-result.loss { color: #ff3366; }
.history-result.open { color: #ffd700; }
.history-time { font-size: 9px; color: #555; }

/* ===== TOAST ===== */
#toast-container { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.toast { background: linear-gradient(135deg, #1a0800, #2d1200); border-radius: 10px; padding: 10px 18px; font-size: 12px; font-weight: 700; color: #fff8e1; box-shadow: 0 4px 20px rgba(0,0,0,0.7); animation: toastIn 0.3s ease; }
.toast.buy { border: 2px solid #00ff88; }
.toast.sell { border: 2px solid #ff3366; }
.toast.xp { border: 2px solid #ffd700; }
@keyframes toastIn { from{opacity:0;transform:translateY(-10px)} to{opacity:1;transform:translateY(0)} }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #3d1a00; border-radius: 2px; }
/* Fix black bottom */
.app { background-attachment: fixed; }
.tab-content { background: linear-gradient(180deg, transparent, rgba(8,3,0,0.6)) no-repeat; background-size: 100% 100%; }

/* Fix black bottom */
.tab-content { background: linear-gradient(180deg, transparent, rgba(8,3,0,0.7)) fixed; }
