:root {
  --bg-dark: #05070f;
  --bg-card: #0b101e;
  --bg-element: #131a2e;
  --border: #1e2842;
  --border-hi: rgba(255, 255, 255, 0.08);
  --text-main: #f1f5f9;
  --text-muted: #8392ad;
  --red: #ff3b30;
  --red-deep: #c4161c;
  --green: #2fd36b;
  --blue: #3b82f6;
  --cyan: #38bdf8;
  --gold: #fbbf24;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Plus Jakarta Sans', sans-serif; }

body.dash-body,
body.landing-body {
  background-color: var(--bg-dark);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(255, 59, 48, 0.12), transparent),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: auto, 48px 48px, 48px 48px;
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ============ MARQUEE (reusable) ============ */
.marquee { overflow: hidden; width: 100%; white-space: nowrap; }
.marquee-track {
  display: flex;
  width: max-content;
  gap: 36px;
  animation: marqueeScroll 35s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee.fast .marquee-track { animation-duration: 20s; }
.marquee.reverse .marquee-track { animation-direction: reverse; }
@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.tick-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--text-muted);
}
.tick-item b { font-family: var(--mono); color: var(--text-main); font-weight: 700; }
.tick-item.up b, .tick-item.up .chg { color: var(--green); }
.tick-item.down b, .tick-item.down .chg { color: var(--red); }
.tick-item .chg { font-family: var(--mono); font-size: 0.7rem; }
.tick-item::after { content: "•"; margin-left: 28px; color: var(--border); }

/* ============ LANDING: TOP TICKER ============ */
.asset-ticker-bar {
  background: #080c18;
  border-bottom: 1px solid var(--border);
  padding: 9px 0;
  overflow: hidden;
  display: flex;
  gap: 32px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}
.asset-ticker-bar > span { padding-left: 20px; }
.asset-ticker-bar .marquee-track { padding: 0; }

/* ============ LANDING: HEADER ============ */
.landing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 32px;
  max-width: 1300px;
  margin: 0 auto;
}
.btn-login-now {
  background: linear-gradient(135deg, var(--red), var(--red-deep));
  color: #fff;
  text-decoration: none;
  padding: 10px 22px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 8px 24px rgba(255, 59, 48, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-login-now:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(255, 59, 48, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25); }

/* ============ LANDING: HERO ============ */
.hero-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 70px 24px 50px;
  text-align: center;
}
.hero-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--red);
  border: 1px solid rgba(255, 59, 48, 0.35);
  background: rgba(255, 59, 48, 0.08);
  padding: 6px 16px;
  border-radius: 99px;
  margin-bottom: 26px;
}
.hero-section h1 {
  font-size: clamp(1.9rem, 4.5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  background: linear-gradient(180deg, #ffffff 30%, #9aa8c4);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-cta-group { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }
.btn-hero-start {
  background: linear-gradient(135deg, var(--red), var(--red-deep));
  color: #fff;
  text-decoration: none;
  padding: 14px 30px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 10px 30px rgba(255, 59, 48, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.2s;
}
.btn-hero-start:hover { transform: translateY(-3px) scale(1.02); }
.btn-hero-signup {
  color: var(--text-main);
  text-decoration: none;
  padding: 14px 30px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.2s, background 0.2s;
}
.btn-hero-signup:hover { border-color: var(--text-muted); background: rgba(255, 255, 255, 0.07); }
.hero-subtext { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; margin-top: 22px; font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }

/* ============ LANDING: TESTIMONIALS + METRICS ============ */
.testimonials-grid {
  max-width: 1200px;
  margin: 30px auto 50px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
  perspective: 1200px;
}
.testi-card {
  background: linear-gradient(160deg, var(--bg-element), var(--bg-card));
  border: 1px solid var(--border);
  border-top-color: var(--border-hi);
  border-radius: 16px;
  padding: 26px;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  transform-style: preserve-3d;
}
.testi-card:hover {
  transform: rotateX(4deg) rotateY(-6deg) translateY(-6px);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 59, 48, 0.25);
}
.testi-avatar {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--red), var(--red-deep));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.85rem;
  margin-bottom: 16px;
}
.testi-card p { font-size: 0.88rem; line-height: 1.65; color: #cbd5e1; margin-bottom: 18px; }
.testi-card h4 { font-size: 0.95rem; font-weight: 700; }
.testi-role { font-size: 0.75rem; color: var(--text-muted); }
.stars { color: var(--gold); font-size: 0.85rem; letter-spacing: 2px; margin-top: 10px; }

.landing-metrics {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 70px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  text-align: center;
  border-top: 1px solid var(--border);
}
.landing-metrics h2 { font-family: var(--mono); font-size: 2rem; font-weight: 800; color: #fff; }
.landing-metrics span { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }

/* ============ 3D TRADES SCENE ============ */
.trade-scene {
  perspective: 1100px;
  height: 340px;
  max-width: 760px;
  margin: 10px auto 0;
  position: relative;
}
.trade-stage {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(18deg) rotateY(-22deg);
  animation: stageSway 12s ease-in-out infinite alternate;
}
@keyframes stageSway {
  from { transform: rotateX(18deg) rotateY(-22deg); }
  to { transform: rotateX(14deg) rotateY(18deg); }
}
.trade-floor {
  position: absolute;
  left: 4%; right: 4%; bottom: 20px; height: 70%;
  transform: rotateX(78deg) translateZ(-40px);
  transform-origin: bottom;
  background-image:
    linear-gradient(rgba(255, 59, 48, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 59, 48, 0.35) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to top, #000, transparent);
  -webkit-mask-image: linear-gradient(to top, #000, transparent);
}
.candle {
  position: absolute;
  bottom: 50px;
  left: calc(var(--i) * 8.2% + 4%);
  width: 5%;
  min-width: 18px;
  height: var(--h);
  border-radius: 4px;
  background: linear-gradient(180deg, var(--c, var(--green)), rgba(0, 0, 0, 0.55));
  box-shadow: 0 0 22px var(--c, var(--green)), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transform-origin: bottom;
  transform: translateZ(var(--z, 0px));
  animation: candlePulse 3.2s ease-in-out infinite;
  animation-delay: calc(var(--i) * -0.35s);
}
.candle::before {
  content: "";
  position: absolute;
  left: 50%; width: 2px;
  top: -16px; bottom: -12px;
  transform: translateX(-50%);
  background: var(--c, var(--green));
  opacity: 0.7;
}
.candle.red { --c: var(--red); }
@keyframes candlePulse {
  0%, 100% { transform: translateZ(var(--z, 0px)) scaleY(1); }
  50% { transform: translateZ(var(--z, 0px)) scaleY(1.14); }
}

.coin {
  position: absolute;
  top: 6%; right: 8%;
  width: 78px; height: 78px;
  border-radius: 50%;
  transform-style: preserve-3d;
  animation: coinSpin 5s linear infinite, coinFloat 3s ease-in-out infinite alternate;
  background: radial-gradient(circle at 30% 30%, #fde68a, var(--gold) 55%, #b45309);
  border: 4px solid #d97706;
  box-shadow: 0 10px 30px rgba(251, 191, 36, 0.35);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 800; color: #78350f;
}
@keyframes coinSpin { from { transform: rotateY(0deg); } to { transform: rotateY(360deg); } }
@keyframes coinFloat { from { margin-top: 0; } to { margin-top: 18px; } }

/* ============ DASHBOARD HEADER ============ */
.dash-top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: rgba(11, 16, 30, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 15px;
}
.dash-header-left { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.menu-btn { background: none; border: none; color: #fff; font-size: 1.3rem; cursor: pointer; display: none; }
.brand-logo-text { font-size: 1.2rem; font-weight: 800; cursor: pointer; white-space: nowrap; letter-spacing: -0.3px; }
.logo-box-red { background: linear-gradient(135deg, var(--red), var(--red-deep)); color: #fff; padding: 2px 8px; border-radius: 6px; }
.logo-text-white { color: #fff; margin-left: 2px; }

.dash-nav-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  flex-grow: 1;
  padding: 2px 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.dash-nav-tabs::-webkit-scrollbar { height: 4px; }
.dash-nav-tabs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.nav-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 7px 12px;
  font-weight: 600;
  font-size: 0.78rem;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
}
.nav-tab:hover { background: var(--bg-element); color: #fff; }
.nav-tab.active {
  background: var(--bg-element);
  color: #fff;
  border-color: var(--border);
  box-shadow: inset 0 -2px 0 var(--red);
}

.dash-header-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.btn-withdraw {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-withdraw:hover { border-color: var(--blue); background: rgba(59, 130, 246, 0.1); }

.btn-deriv-login {
  background: linear-gradient(135deg, var(--red), var(--red-deep));
  color: #fff;
  text-decoration: none;
  padding: 7px 18px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.8rem;
  box-shadow: 0 6px 16px rgba(255, 59, 48, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.2s;
  white-space: nowrap;
}
.btn-deriv-login:hover { transform: translateY(-1px); }

.account-dropdown-pill {
  background: var(--bg-element);
  border: 1px solid rgba(47, 211, 107, 0.5);
  padding: 5px 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.bal-amount { color: var(--green); font-family: var(--mono); }
.dropdown-arrow { font-size: 0.6rem; color: var(--text-muted); }

/* ============ RED TICKER (works as plain text OR marquee) ============ */
.red-announcement-ticker {
  background: linear-gradient(90deg, var(--red-deep), var(--red), var(--red-deep));
  color: #fff;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 7px 0;
  letter-spacing: 1px;
  overflow: hidden;
}
.red-announcement-ticker .marquee-track { gap: 60px; animation-duration: 28s; }
.red-announcement-ticker .marquee-track span { padding-right: 0; }

/* ============ WORKSPACE ============ */
.workspace-container { max-width: 1350px; margin: 24px auto; padding: 0 20px; }

.filter-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 26px;
  flex-wrap: wrap;
  gap: 14px;
}
.filter-dropdown-group { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.select-box {
  background: var(--bg-element);
  border: 1px solid var(--border);
  color: #fff;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}
.select-box:focus { border-color: var(--blue); }
.search-box-wrapper { position: relative; }
.search-bot-input {
  background: var(--bg-element);
  border: 1px solid var(--border);
  color: #fff;
  padding: 9px 14px 9px 36px;
  border-radius: 10px;
  font-size: 0.85rem;
  outline: none;
  width: 260px;
  max-width: 100%;
  transition: border-color 0.2s;
}
.search-bot-input:focus { border-color: var(--blue); }
.search-icon { position: absolute; left: 12px; top: 10px; font-size: 0.85rem; color: var(--text-muted); }

.action-pills-group { display: flex; gap: 8px; flex-wrap: wrap; }
.action-pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 9px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}
.action-pill:hover { color: #fff; border-color: var(--text-muted); }
.action-pill.active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ============ SIGNALS ============ */
.live-signals-section { margin-bottom: 30px; }
.section-title-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.section-title-row h3 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.3px; }
.signal-count-badge {
  font-size: 0.72rem;
  color: var(--green);
  background: rgba(47, 211, 107, 0.1);
  padding: 3px 10px;
  border-radius: 99px;
  border: 1px solid rgba(47, 211, 107, 0.3);
  font-weight: 700;
}

.signals-cards-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; perspective: 1200px; }
@media(max-width: 768px) { .signals-cards-grid { grid-template-columns: 1fr; } }

.signal-card {
  background: linear-gradient(160deg, var(--bg-element), var(--bg-card));
  border: 1px solid var(--border);
  border-top-color: var(--border-hi);
  border-radius: 14px;
  padding: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  transform-style: preserve-3d;
}
.signal-card:hover {
  transform: rotateX(3deg) rotateY(-5deg) translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}
.signal-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sig-num { font-size: 0.75rem; color: var(--text-muted); font-weight: 700; font-family: var(--mono); }
.sig-tag { font-size: 0.7rem; font-weight: 800; padding: 3px 9px; border-radius: 6px; letter-spacing: 0.5px; }
.sig-tag.odd { background: rgba(255, 59, 48, 0.15); color: var(--red); }
.sig-tag.fall { background: rgba(59, 130, 246, 0.15); color: var(--blue); }
.signal-card h4 { font-size: 1rem; font-weight: 700; margin-bottom: 12px; }
.confidence-row { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 6px; }
.conf-val { font-weight: 700; color: #fff; font-family: var(--mono); }
.progress-bar-container { height: 6px; background: #0a0f1d; border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; }
.progress-fill.odd { background: linear-gradient(90deg, var(--red-deep), var(--red)); height: 100%; }
.progress-fill.fall { background: linear-gradient(90deg, #1d4ed8, var(--blue)); height: 100%; }

/* ============ TERMINAL ============ */
.terminal-card-container {
  background: linear-gradient(160deg, #0e1526, var(--bg-card));
  border: 1px solid var(--border);
  border-top-color: var(--border-hi);
  border-radius: 16px;
  padding: 26px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
}
.terminal-top-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; flex-wrap: wrap; gap: 10px; }
.terminal-top-row h2 { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.3px; }
.live-quote-box {
  background: #070b16;
  border: 1px solid var(--border);
  padding: 7px 16px;
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
}

.digit-grid-view {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 22px;
  perspective: 1000px;
}
@media(max-width: 600px) { .digit-grid-view { grid-template-columns: repeat(2, 1fr); } }
.digit-box-card {
  background: linear-gradient(160deg, var(--bg-element), #0d1426);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  font-family: var(--mono);
}
.digit-box-card:hover { box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4); }

/* ============ BOT RUNNER ============ */
.bot-runner-footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0a0f1d;
  border: 1px solid var(--border);
  padding: 14px 18px;
  border-radius: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.runner-controls-left { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.runner-controls-right { display: flex; gap: 12px; align-items: center; }
.token-input-sm {
  background: var(--bg-element);
  border: 1px solid var(--border);
  color: #fff;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-family: var(--mono);
  outline: none;
}
.token-input-sm:focus { border-color: var(--blue); }
.btn-run-bot {
  background: linear-gradient(135deg, #3be07f, var(--green));
  color: #04210f;
  border: none;
  padding: 10px 22px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 8px 20px rgba(47, 211, 107, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-run-bot:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(47, 211, 107, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.execution-speed-tag {
  font-size: 0.7rem;
  color: var(--gold);
  font-weight: 800;
  letter-spacing: 1px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  padding: 4px 10px;
  border-radius: 6px;
}

.terminal-log-box {
  background: #05080f;
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.6;
  height: 130px;
  overflow-y: auto;
  color: var(--text-muted);
}

/* ============ FLOATING AI ============ */
.floating-ai-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background: radial-gradient(circle at 30% 30%, #a78bfa 0%, #5b21b6 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  cursor: pointer;
  z-index: 1000;
  animation: aiBob 3s ease-in-out infinite alternate;
}
@keyframes aiBob { from { transform: translateY(0); } to { transform: translateY(-6px); } }
.ai-glow-circle { font-weight: 800; font-size: 1rem; color: #fff; }

/* ============ MOBILE NAV ============ */
@media(max-width: 992px) {
  .menu-btn { display: block; }
  .dash-nav-tabs {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-card);
    flex-direction: column;
    padding: 14px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 200;
  }
  .dash-nav-tabs.mobile-open { display: flex; }
  .nav-tab { width: 100%; text-align: left; padding: 10px 14px; }
  .landing-header { padding: 14px 18px; }
  .trade-scene { height: 260px; }
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  .marquee-track, .trade-stage, .candle, .coin, .floating-ai-btn { animation: none !important; }
}