:root {
  --bg: #1a0b2e;
  --panel: #0d0618;
  --border: #6a3fb5;
  --green: #33ff66;
  --red: #ff3355;
  --text: #c9b6ff;
  --label: #8a6fd0;
}
* { box-sizing: border-box; }
body {
  margin: 0; padding: 16px;
  background: radial-gradient(circle at 30% 20%, #2a1248, #0d0618);
  font-family: 'Press Start 2P', monospace;
  color: var(--text); font-size: 11px;
}
.trader { max-width: 1000px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.topbar, .bottombar { display: flex; gap: 10px; }
.box {
  background: var(--panel); border: 2px solid var(--border); border-radius: 6px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1;
  box-shadow: 0 0 12px rgba(106, 63, 181, 0.4);
}
.label { color: var(--label); font-size: 8px; }
.value { font-size: 13px; }
.sym { font-size: 12px; } .sub { color: var(--label); font-size: 8px; }
.pnl.up { color: var(--green); } .pnl.down { color: var(--red); }
.position-side.long { color: var(--green); }
.position-side.short { color: var(--red); }
.position-side.flat { color: var(--label); }
.value.liq { color: var(--red); }
.main { display: flex; gap: 10px; }
.chart-wrap { flex: 3; background: var(--panel); border: 2px solid var(--border); border-radius: 6px; padding: 8px; box-shadow: 0 0 12px rgba(106, 63, 181, 0.4); }
#chart { width: 100%; height: 360px; }
.sidebar { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.leverage-box { align-items: center; }
.leverage-display { font-size: 22px; color: #fff; }
.leverage-presets { display: flex; gap: 4px; }
.lev-btn, .chrome-btn {
  background: #1f0f3a; color: var(--text); border: 1px solid var(--border);
  border-radius: 4px; padding: 6px 8px; font-family: inherit; font-size: 9px; cursor: pointer;
}
.lev-btn.active { background: var(--border); color: #fff; box-shadow: 0 0 8px var(--border); }
.margin-input {
  background: #1f0f3a; color: #fff; border: 1px solid var(--border);
  border-radius: 4px; padding: 8px; font-family: inherit; font-size: 12px; width: 100%;
}
.trade-buttons { display: flex; gap: 8px; }
.trade-btn {
  flex: 1; border: none; border-radius: 6px; padding: 14px 8px; cursor: pointer;
  font-family: inherit; font-size: 14px; color: #fff; display: flex; flex-direction: column; gap: 4px;
}
.trade-btn span { font-size: 7px; opacity: 0.8; }
.trade-btn.buy { background: linear-gradient(180deg, #2bbf4f, #178a36); box-shadow: 0 0 14px rgba(51,255,102,0.5); }
.trade-btn.sell { background: linear-gradient(180deg, #d9304b, #a01228); box-shadow: 0 0 14px rgba(255,51,85,0.5); }
.trade-btn:disabled { filter: grayscale(0.7) brightness(0.5); cursor: not-allowed; box-shadow: none; }
.close-btn {
  background: #2a1248; color: var(--text); border: 2px solid var(--border);
  border-radius: 6px; padding: 12px; font-family: inherit; font-size: 11px; cursor: pointer;
}
.close-btn:disabled { filter: brightness(0.5); cursor: not-allowed; }
.chrome-controls { display: flex; gap: 8px; align-items: center; }
.chrome-btn:disabled { opacity: 0.4; cursor: default; }

/* Toast */
#toast-host { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 6px; }
.toast {
  background: var(--red); color: #fff; padding: 10px 16px; border-radius: 6px; font-size: 10px;
  animation: toastfade 3s forwards;
}
@keyframes toastfade { 0%,80% { opacity: 1; } 100% { opacity: 0; } }

/* Liquidation overlay */
#fx-host { position: fixed; inset: 0; z-index: 200; pointer-events: none; }
.liquidation-overlay { position: absolute; inset: 0; background: rgba(255,51,85,0.25); display: flex; align-items: center; justify-content: center; animation: liqflash 2.5s forwards; }
.liquidation-banner { text-align: center; background: #0d0618; border: 3px solid var(--red); border-radius: 10px; padding: 30px 40px; box-shadow: 0 0 30px var(--red); }
.liq-title { color: var(--red); font-size: 24px; margin-bottom: 12px; }
.liq-detail { color: var(--text); font-size: 10px; margin-bottom: 8px; }
.liq-loss { color: var(--red); font-size: 16px; }
@keyframes liqflash { 0% { opacity: 0; } 10% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; } }
