/* PRO TRADER ANALYSIS TOOL — visual system derived from the reference dashboard */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
  --shell: #eef1f6;
  --card: #ffffff;
  --card-soft: #f3f5f9;
  --card-line: #e3e7ef;
  --ink: #1b2236;
  --ink-soft: #5d6679;
  --navy: #151b36;
  --navy-2: #1e2649;
  --navy-3: #29335f;
  --navy-ink: #e9ecf8;
  --navy-soft: #98a1c4;
  --brand: #17a6d8;
  --brand-2: #8d97aa;
  --label: #ef6a24;
  --neon: #1ff45a;
  --neon-2: #11d64a;
  --connected: #12b12f;
  --live: #ff5319;
  --teal: #20d8d8;
  --gold: #f4b400;
  --red: #ef334c;
  --win: #22e06a;
  --loss: #ff4d5e;
  --radius-lg: 18px;
  --radius: 12px;
  --radius-sm: 9px;
  --shadow: 0 6px 18px rgba(20, 30, 60, 0.08);
  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

:root[data-theme='dark'] {
  --shell: #0a0f22;
  --card: #121a36;
  --card-soft: #18214a;
  --card-line: #243061;
  --ink: #e9ecf8;
  --ink-soft: #97a0c3;
  --navy: #0f1530;
  --navy-2: #182048;
  --navy-3: #233064;
  --shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background: var(--shell);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.45;
  min-height: 100vh;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- App frame ---------- */
.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 12px 40px;
}
.topbar {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 6px 48px 14px;
}
.brand {
  margin: 0;
  font-size: clamp(1.25rem, 4.4vw, 1.7rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  background: linear-gradient(90deg, var(--brand) 10%, #3fb8e0 45%, var(--brand-2) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-align: center;
}
.icon-btn {
  position: absolute;
  right: 0;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--card-line);
  background: var(--card);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
}
.icon-btn.left { left: 0; right: auto; }
.icon-btn svg { width: 18px; height: 18px; }

.grid-main {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
}
.grid-main > * { min-width: 0; }
@media (min-width: 980px) {
  .grid-main { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .col { display: grid; gap: 12px; }
  .span-2 { grid-column: 1 / -1; }
}
.col { display: grid; gap: 12px; min-width: 0; grid-template-columns: minmax(0, 1fr); }

/* ---------- Light cards (top of reference) ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 12px;
}
.label {
  color: var(--label);
  font-size: 0.78rem;
  font-weight: 600;
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.select {
  width: 100%;
  appearance: none;
  border: 1px solid var(--card-line);
  background: var(--card-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  border-radius: var(--radius-sm);
  padding: 10px 32px 10px 12px;
  font-size: 0.86rem;
  min-height: 44px;
}
.status-pill {
  margin-top: 8px;
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--connected);
  box-shadow: 0 4px 12px rgba(18, 177, 47, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: default;
}
.status-pill.off { background: #c92d3b; box-shadow: 0 4px 12px rgba(201, 45, 59, 0.3); }
.status-pill.wait { background: #c98a12; box-shadow: none; }
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.status-pill:not(.off) .dot { animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

.live-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(180deg, var(--card) 0%, var(--card-soft) 100%);
  border-radius: var(--radius);
}
.live-card .label { justify-content: center; }
.live-price { color: #b8872b; font-size: 0.92rem; margin: 0; }
:root[data-theme='dark'] .live-price { color: #e2b457; }
.live-digit {
  font-size: 3.1rem;
  line-height: 1;
  font-weight: 800;
  color: var(--brand);
  margin: 4px 0 0;
}
.live-digit.bump { animation: bump 0.35s ease-out; }
@keyframes bump { 0% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* ---------- Auto AI patterns ---------- */
.patterns { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.pattern {
  background: var(--card-soft);
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  padding: 8px 6px;
  text-align: center;
}
.pattern small { display: block; font-size: 0.6rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.02em; }
.pattern strong { display: block; font-size: 1.02rem; font-weight: 800; margin: 2px 0; }
.pattern em { font-style: normal; font-size: 0.66rem; color: var(--brand); font-weight: 600; }
.c-gold { color: var(--gold); }
.c-red { color: var(--red); }
.c-teal { color: var(--teal); }
.c-green { color: var(--win); }
.streaks { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.74rem; color: var(--ink-soft); }
.streaks span { background: var(--card-soft); border: 1px solid var(--card-line); border-radius: 20px; padding: 3px 10px; }
.streaks b { color: var(--ink); }

/* ---------- Navy panels ---------- */
.panel {
  background: var(--navy);
  color: var(--navy-ink);
  border-radius: var(--radius-lg);
  padding: 12px;
  box-shadow: 0 10px 24px rgba(12, 18, 44, 0.25);
}
.panel .label { color: var(--label); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.panel-head .label { margin: 0; }

.strategies { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.strategy {
  background: var(--navy-2);
  border: 1px solid transparent;
  border-radius: var(--radius);
  min-height: 70px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 0.74rem;
  color: var(--navy-ink);
  transition: background 0.15s, transform 0.1s;
}
.strategy svg { width: 20px; height: 20px; }
.strategy:hover { background: var(--navy-3); }
.strategy:active { transform: scale(0.97); }
.strategy[aria-pressed='true'] {
  background: var(--teal);
  color: #0c3440;
  box-shadow: 0 0 18px rgba(32, 216, 216, 0.45);
}
.strategy[disabled] { opacity: 0.35; cursor: not-allowed; }

.options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.seg { display: inline-flex; background: var(--navy-2); border-radius: 10px; padding: 3px; }
.seg button {
  border: 0;
  background: transparent;
  color: var(--navy-soft);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  min-height: 34px;
}
.seg button[aria-pressed='true'] { background: var(--navy-3); color: #fff; }
.mini-select {
  background: var(--navy-2);
  border: 1px solid var(--navy-3);
  color: var(--navy-ink);
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 0.78rem;
  min-height: 36px;
}
.opt-label { font-size: 0.72rem; color: var(--navy-soft); }

.digits { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 5px; }
.digit {
  aspect-ratio: 1 / 1.05;
  border-radius: 10px;
  border: 1.5px solid transparent;
  background: var(--navy-2);
  color: #4a5486;
  font-weight: 600;
  font-size: 0.9rem;
  display: grid;
  place-items: center;
  padding: 0;
  position: relative;
  transition: background 0.15s;
}
.digit.live {
  background: linear-gradient(180deg, #ff7a2f, var(--live));
  color: #fff;
  box-shadow: 0 0 14px rgba(255, 83, 25, 0.55);
}
.digit.target { border-color: var(--teal); color: var(--teal); }
.digit.live.target { color: #fff; }
.digit .pct { position: absolute; bottom: -15px; font-size: 0.56rem; color: var(--navy-soft); font-weight: 500; }
.digits-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; font-size: 0.74rem; color: var(--navy-soft); gap: 8px; flex-wrap: wrap; }
.chip-btn {
  background: var(--navy-2);
  border: 1px solid var(--navy-3);
  color: var(--navy-ink);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.74rem;
}
.chip-btn[aria-pressed='true'] { border-color: var(--teal); color: var(--teal); }

.generate {
  margin-top: 12px;
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(90deg, var(--neon) 0%, #34ff7a 50%, var(--neon-2) 100%);
  color: #0b3a1b;
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 0 22px rgba(31, 244, 90, 0.55), inset 0 -3px 0 rgba(0, 0, 0, 0.12);
  transition: transform 0.1s, box-shadow 0.2s, filter 0.2s;
}
.generate:hover { box-shadow: 0 0 34px rgba(31, 244, 90, 0.75), inset 0 -3px 0 rgba(0, 0, 0, 0.12); }
.generate:active { transform: scale(0.99); }
.generate[disabled] { filter: grayscale(0.7) brightness(0.8); cursor: not-allowed; box-shadow: none; }
.generate svg { width: 20px; height: 20px; }

/* ---------- Signal output ---------- */
.signal-box { min-height: 80px; }
.analyzing { list-style: none; padding: 0; margin: 4px 0; font-size: 0.86rem; }
.analyzing li { padding: 3px 0; color: var(--navy-soft); opacity: 0.35; transition: opacity 0.2s, color 0.2s; }
.analyzing li.done { opacity: 1; color: var(--win); }
.analyzing li.head { color: var(--teal); opacity: 1; font-weight: 700; letter-spacing: 0.04em; }

.sig-card {
  border: 1px solid rgba(31, 244, 90, 0.35);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(31, 244, 90, 0.08), transparent 60%), var(--navy-2);
  padding: 14px;
  animation: reveal 0.35s ease-out;
}
@keyframes reveal { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.sig-title { text-align: center; font-weight: 800; letter-spacing: 0.12em; color: var(--neon); font-size: 0.9rem; margin: 0 0 10px; }
.sig-main { text-align: center; margin: 4px 0 12px; }
.sig-main .pred { font-size: 2rem; font-weight: 800; color: #fff; line-height: 1.1; }
.sig-main .mk { color: var(--navy-soft); font-size: 0.8rem; }
.sig-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.sig-grid div { background: var(--navy); border-radius: 10px; padding: 8px 10px; }
.sig-grid dt { font-size: 0.64rem; color: var(--navy-soft); letter-spacing: 0.05em; text-transform: uppercase; }
.sig-grid dd { margin: 2px 0 0; font-weight: 700; font-size: 0.98rem; }
.sig-status { margin-top: 10px; text-align: center; padding: 10px; border-radius: 10px; font-weight: 800; letter-spacing: 0.06em; background: var(--navy); }
.sig-status.win { background: rgba(34, 224, 106, 0.16); color: var(--win); }
.sig-status.loss { background: rgba(255, 77, 94, 0.16); color: var(--loss); }
.sig-status.void { color: var(--navy-soft); }
.tick-track { display: flex; gap: 6px; justify-content: center; margin-top: 8px; }
.tick-track span { width: 34px; height: 34px; border-radius: 9px; background: var(--navy); display: grid; place-items: center; font-weight: 700; color: var(--navy-soft); border: 1px dashed var(--navy-3); }
.tick-track span.on { border-style: solid; border-color: var(--teal); color: #fff; }
.tick-track span.exit { border-color: var(--neon); box-shadow: 0 0 10px rgba(31, 244, 90, 0.4); }
.factor-list { margin-top: 10px; display: grid; gap: 4px; font-size: 0.76rem; }
.factor-list div { display: flex; justify-content: space-between; gap: 8px; color: var(--navy-soft); }
.factor-list b.ok { color: var(--win); }
.factor-list b.no { color: var(--loss); }
.factor-list b.na { color: var(--navy-soft); font-weight: 500; }
.note { font-size: 0.72rem; color: var(--navy-soft); margin: 10px 0 0; }
.empty { text-align: center; color: var(--navy-soft); padding: 14px 6px; font-size: 0.86rem; }
.empty strong { display: block; color: #fff; letter-spacing: 0.06em; margin-bottom: 4px; }

/* ---------- Performance ---------- */
.perf { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.perf div { background: var(--navy-2); border-radius: 12px; padding: 12px 6px; text-align: center; }
.perf strong { display: block; font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.perf small { color: var(--navy-soft); font-size: 0.78rem; }
.perf-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; font-size: 0.72rem; color: var(--navy-soft); text-align: center; }
.perf-meta b { display: block; color: #fff; font-size: 0.92rem; }
.last20 { display: flex; gap: 3px; margin-top: 10px; height: 12px; }
.last20 span { flex: 1; border-radius: 3px; background: var(--navy-3); }
.last20 span.w { background: var(--win); }
.last20 span.l { background: var(--loss); }

/* ---------- Chart, frequency, stream ---------- */
.chart-wrap { position: relative; height: 170px; }
.chart-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.feed-info { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.feed-info div { background: var(--navy-2); border-radius: 10px; padding: 7px 9px; }
.feed-info dt { font-size: 0.6rem; color: var(--navy-soft); text-transform: uppercase; letter-spacing: 0.04em; }
.feed-info dd { margin: 0; font-weight: 700; font-size: 0.86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.freq { display: grid; gap: 5px; }
.freq-row { display: grid; grid-template-columns: 16px 1fr 46px; gap: 8px; align-items: center; font-size: 0.8rem; }
.freq-bar { height: 12px; background: var(--navy-2); border-radius: 6px; overflow: hidden; }
.freq-bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #1d6fd8, var(--teal)); transition: width 0.3s; }
.freq-row.hi .freq-bar i { background: linear-gradient(90deg, #11b844, var(--neon)); }
.freq-row.lo .freq-bar i { background: linear-gradient(90deg, #b8233a, var(--loss)); }
.freq-row span:last-child { text-align: right; color: var(--navy-soft); }
.freq-sum { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; font-size: 0.74rem; }
.freq-sum span { background: var(--navy-2); border-radius: 8px; padding: 4px 8px; color: var(--navy-soft); }
.freq-sum b { color: #fff; }

.stream { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.stream span { flex: 0 0 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 0.86rem; background: var(--navy-2); }
.stream span.even { color: var(--teal); }
.stream span.odd { color: var(--gold); }
.stream span:last-child { background: var(--live); color: #fff; }

/* ---------- History ---------- */
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px; margin-bottom: 10px; }
.filters .mini-select, .filters input { width: 100%; }
.filters input {
  background: var(--navy-2);
  border: 1px solid var(--navy-3);
  color: var(--navy-ink);
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 0.78rem;
  min-height: 36px;
  color-scheme: dark;
}
.table-wrap { overflow-x: auto; }
table.hist { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
table.hist th { text-align: left; color: var(--navy-soft); font-weight: 500; font-size: 0.68rem; letter-spacing: 0.04em; text-transform: uppercase; padding: 6px 8px; border-bottom: 1px solid var(--navy-3); }
table.hist td { padding: 8px; border-bottom: 1px solid var(--navy-2); white-space: nowrap; }
.res { font-weight: 800; font-size: 0.74rem; padding: 2px 8px; border-radius: 6px; }
.res.WIN { background: rgba(34, 224, 106, 0.15); color: var(--win); }
.res.LOSS { background: rgba(255, 77, 94, 0.15); color: var(--loss); }
.res.PENDING { color: var(--gold); }
.res.VOID { color: var(--navy-soft); }

.foot { text-align: center; font-size: 0.72rem; color: var(--ink-soft); margin-top: 18px; padding: 0 10px; }
.foot button { background: none; border: 0; color: var(--brand); text-decoration: underline; font-size: 0.78rem; }

.banner {
  background: #c92d3b;
  color: #fff;
  text-align: center;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 12px;
  margin-bottom: 10px;
}

/* ---------- Auth pages ---------- */
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(circle at 20% 10%, rgba(23, 166, 216, 0.18), transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(31, 244, 90, 0.14), transparent 45%),
    var(--shell);
}
.auth-box { width: 100%; max-width: 400px; }
.auth-box .brand { font-size: 1.9rem; margin-bottom: 4px; }
.auth-sub { text-align: center; color: var(--ink-soft); font-size: 0.86rem; margin: 0 0 18px; }
.auth-card { background: var(--navy); color: var(--navy-ink); border-radius: 20px; padding: 22px 18px; box-shadow: 0 16px 40px rgba(12, 18, 44, 0.3); }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 0.74rem; font-weight: 600; color: var(--label); letter-spacing: 0.06em; }
.field input {
  background: var(--navy-2);
  border: 1px solid var(--navy-3);
  border-radius: 11px;
  padding: 12px 14px;
  min-height: 48px;
  color: #fff;
  font-size: 1rem;
}
.field input:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px rgba(32, 216, 216, 0.2); }
.form-error { background: rgba(255, 77, 94, 0.12); border: 1px solid rgba(255, 77, 94, 0.4); color: #ffb3bb; border-radius: 10px; padding: 10px 12px; font-size: 0.84rem; margin-bottom: 12px; }
.form-error strong { display: block; color: var(--loss); letter-spacing: 0.06em; }
.divider { text-align: center; font-size: 0.76rem; color: var(--navy-soft); margin: 18px 0 10px; letter-spacing: 0.04em; }
.btn-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  border: 1.5px solid #25d366;
  color: #25d366;
  background: transparent;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.04em;
}
.btn-wa:hover { background: rgba(37, 211, 102, 0.1); }
.btn-wa svg { width: 20px; height: 20px; }

@media (max-width: 420px) {
  .strategy { font-size: 0.66rem; min-height: 64px; }
  .digit { font-size: 0.8rem; border-radius: 8px; }
  .sig-main .pred { font-size: 1.7rem; }
  .perf strong { font-size: 1.35rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
