@font-face {
  font-family: Manrope;
  src: url("./fonts/manrope.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #0e1022;
  --panels: #171a33;
  --deep: #14172e;
  --line: #303451;
  --text: #f2f2fe;
  --muted: #b0b4ce;
  --mint: #9fe8d5;
  --lilac: #c9c3ff;
  --red: #ff9f9e;
  font-family: Manrope, "Avenir Next", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; }
body::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: 495px;
  background: radial-gradient(ellipse at 74% 7%, #302960 0%, #191932 42%, transparent 73%);
  pointer-events: none;
}
h1, h2, h3, p { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .52; cursor: default; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
.wrap { width: min(1380px, calc(100% - 80px)); margin-inline: auto; }
:not([data-surface="market"]) > body .public-feature,
[data-surface="market"] .account-feature,
html:not([data-surface="terminal"]) .terminal-feature { display: none !important; }

.masthead { border-bottom: 1px solid #bcb6ea27; }
.nav { display: flex; justify-content: space-between; align-items: center; gap: 24px; min-height: 73px; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 480; letter-spacing: -.06em; white-space: nowrap; }
.brand strong { font-weight: 850; }
.brand-mark {
  width: 26px;
  height: 22px;
  display: inline-block;
  background: linear-gradient(135deg, var(--mint) 18%, var(--lilac) 83%);
  clip-path: polygon(0 25%, 18% 15%, 18% 74%, 82% 0, 100% 0, 100% 78%, 82% 88%, 82% 28%, 18% 100%, 0 100%);
}
nav, .userbar { display: flex; align-items: center; gap: 24px; }
nav a, .text-button { color: var(--muted); }
nav a { font-size: 13px; font-weight: 630; }
nav a:hover, .text-button:hover, .home-link:hover { color: var(--mint); }
.text-button, .home-link {
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.home-link span { color: var(--lilac); margin-left: 4px; }
.sim-label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.sim-label span, .connection { width: 7px; height: 7px; border-radius: 50%; background: #a5a9c1; flex: none; }
.sim-label span, .connection.live { background: var(--mint); }
.connection.live { box-shadow: 0 0 13px #8de8cb70; }

.intro { position: relative; display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 48px 0 31px; }
.intro::before {
  content: "";
  position: absolute;
  inset: 0 -3% 0 49%;
  background-image: radial-gradient(circle, #bbb6ee40 1.1px, transparent 1.4px);
  background-size: 18px 18px;
  mask-image: radial-gradient(ellipse at 80% 42%, black, transparent 67%);
  pointer-events: none;
}
.intro-copy, .balance { position: relative; }
h1 { font-weight: 780; font-size: clamp(37px,5.5vw,76px); letter-spacing: -.068em; line-height: 1.01; }
.intro p { max-width: 58ch; color: var(--muted); margin-top: 15px; line-height: 1.58; font-size: clamp(13px,1.2vw,16px); }
.intro-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 19px; }
.intro-actions .action { width: auto; }
.intro-actions a, .intro-actions button { display: inline-flex; align-items: center; justify-content: center; }
.balance { text-align: right; white-space: nowrap; }
.balance small { display: block; color: var(--muted); font-size: 12px; }
.balance strong { color: var(--mint); font-size: clamp(19px,2.5vw,31px); font-weight: 750; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }

.terminal {
  display: grid;
  grid-template-columns: minmax(173px,.75fr) minmax(325px,2.55fr) minmax(227px,1.04fr);
  background: var(--panels);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 75px #090b1a70;
}
.market-list { background: var(--deep); border-right: 1px solid var(--line); }
.market-list h2 { font-size: 15px; padding: 24px 17px 15px; }
.market-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 13px 12px 13px 14px;
  text-align: left;
  border: 0;
  border-left: 3px solid transparent;
  border-top: 1px solid #30345185;
  background: none;
  color: var(--text);
}
.market-row:hover, .market-row.selected { background: #242748; }
.market-row.selected { border-left-color: var(--lilac); }
.market-row small { display: block; color: var(--muted); font-size: 10px; white-space: nowrap; }
.market-row strong { display: block; font-size: 12px; line-height: 1.35; }
.asset-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #221923; font-size: 16px; font-weight: 800; }
.doge { background: #efd17b; }
.shib { background: #f1abac; }
.btc { background: #f9aa6b; }
.asset-price { color: var(--muted); font-size: 10px; font-weight: 740; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ticker-note { display: flex; align-items: center; gap: 8px; margin: 19px 16px; font-size: 11px; color: var(--muted); }
.chart-panel { min-width: 0; padding: 20px 21px 13px; }
.chart-header, .section-head, .chart-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.chart-header h2 { font-size: 16px; font-weight: 760; }
.chart-header p, .chart-footer, .dim { font-size: 11px; color: var(--muted); }
.chart-header p { margin-top: 3px; }
.intervals { display: flex; flex-shrink: 0; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: #11142b; }
.intervals button { padding: 5px 7px; border: 0; border-radius: 4px; background: none; color: var(--muted); font-size: 11px; font-weight: 750; }
.intervals button[aria-pressed=true] { background: #2d3156; color: var(--text); }
.quote-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 9px; margin: 13px 0 6px; min-height: 44px; }
.quote-line strong { font-size: clamp(25px,3.6vw,48px); letter-spacing: -.064em; font-variant-numeric: tabular-nums; line-height: 1.06; }
.change, .positive { color: var(--mint); }
.change { font-size: 12px; font-weight: 760; }
.change.negative, .negative { color: var(--red); }
.chart-stage { position: relative; height: 283px; }
.chart-stage canvas { display: block; height: 100%; width: 100%; }
.chart-stage > p { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.chart-tooltip { position: absolute; top: 0; left: 8px; z-index: 1; padding: 5px 8px; color: var(--text); background: #24284b; border: 1px solid #4c517d; border-radius: 5px; font-size: 11px; pointer-events: none; }
.chart-footer { border-top: 1px solid var(--line); padding-top: 10px; }

.order-panel, .coins-panel { min-width: 0; padding: 22px 18px; border-left: 1px solid var(--line); background: var(--deep); }
.order-panel h2, .bot-card h3 { font-size: 15px; }
.coins-panel { position: relative; display: flex; flex-direction: column; align-items: flex-start; background: radial-gradient(ellipse at 98% 0%, #352b60, transparent 68%), var(--deep); }
.coin-emblem {
  display: grid;
  place-items: center;
  width: 53px;
  height: 53px;
  margin-bottom: 18px;
  border-radius: 50%;
  color: #202042;
  background: conic-gradient(from 45deg, #a6a2df, #dbd3fa, #a1dcca, #b3aeed, #a6a2df);
}
.coin-emblem span { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #201d4545; border-radius: 50%; font-size: 14px; font-weight: 850; letter-spacing: -.09em; }
.coins-panel h2 { color: var(--text); font-size: 15px; }
.bonus-display { color: var(--lilac); font-size: clamp(43px,4.7vw,64px); line-height: 1.14; letter-spacing: -.078em; }
.coins-panel p { color: var(--muted); font-size: 12px; line-height: 1.55; }
.coins-panel .secondary { margin-top: 22px; width: 100%; }
.coins-panel .purchase-state { margin-top: 12px; max-width: 28ch; }
.side-group { display: grid; grid-template-columns: 1fr 1fr; margin: 16px 0 15px; padding: 3px; background: #101329; border: 1px solid var(--line); border-radius: 7px; }
.side { padding: 7px; border: none; border-radius: 4px; background: none; color: var(--muted); }
.side.current { background: #2a3151; color: var(--mint); font-weight: 750; }
.side[data-side=sell].current { color: var(--red); }
label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
input { width: 100%; min-width: 0; padding: 10px; color: var(--text); background: #202442; border: 1px solid var(--line); border-radius: 6px; }
.input-shell { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 6px; background: #202442; }
.input-shell input { border: 0; background: transparent; }
.input-shell span { padding-right: 10px; font-size: 12px; color: var(--muted); }
.receipt { display: grid; gap: 5px; margin: 14px 0; font-size: 11px; }
.receipt div { display: flex; justify-content: space-between; gap: 5px; }
.receipt dt, .position-summary, .bot-note { color: var(--muted); }
.receipt dd { margin: 0; }
.action, .secondary { min-height: 42px; padding: 9px 12px; border-radius: 7px; font-weight: 780; }
.action { width: 100%; border: 0; color: #141733; background: var(--lilac); }
.action:hover { background: #dddaff; }
.secondary { background: #292e50; border: 1px solid #444971; color: var(--text); }
.secondary:hover { background: #373d68; }
.form-message { min-height: 1.45em; margin: 7px 0; font-size: 12px; color: var(--muted); }
.form-message.error { color: var(--red); }
.bot-card { display: flex; justify-content: space-between; align-items: center; gap: 7px; margin-top: 8px; padding-top: 13px; border-top: 1px solid var(--line); }
.bot-card p, .bot-note { font-size: 11px; margin-top: 4px; }
.toggle-button { display: flex; align-items: center; width: 38px; height: 22px; flex: none; padding: 3px; border: 1px solid #4e557a; border-radius: 20px; background: #282e52; }
.toggle-button span { width: 13px; height: 13px; border-radius: 50%; background: #a7afd1; }
.toggle-button[aria-pressed=true] { justify-content: flex-end; background: #31534d; border-color: #72a297; }
.toggle-button[aria-pressed=true] span { background: var(--mint); }

.portfolio, .backtest, .learning { margin-top: 30px; }
.lessons { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 12px; align-items: start; }
.lessons details { background: var(--deep); border: 1px solid var(--line); border-radius: 9px; padding: 0 14px; }
.lessons summary { cursor: pointer; font-weight: 760; padding: 13px 0; }
.lessons p { color: var(--muted); line-height: 1.6; margin: 0 0 12px; }
.lessons p strong { color: var(--text); }
.lessons a { display: inline-block; color: var(--lilac); text-decoration: underline; margin-bottom: 14px; font-size: 12px; }
.portfolio-head { padding: 0 0 12px; border-bottom: 1px solid var(--line); }
.portfolio-head h2 { font-size: 24px; letter-spacing: -.048em; }
.portfolio-head p { margin-top: 5px; font-size: 12px; color: var(--muted); }
.portfolio-grid { display: grid; grid-template-columns: 1fr 1.18fr; gap: 22px; margin-top: 12px; }
.portfolio-grid > div { min-width: 0; }
.portfolio-grid h3 { font-size: 13px; margin-bottom: 6px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; font-variant-numeric: tabular-nums; }
th { font-weight: 650; color: var(--muted); }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:hover { background-color: #181b38; }
.empty { padding: 13px 12px; color: var(--muted); background: #191c37; border: 1px solid var(--line); border-radius: 7px; font-size: 12px; }
#test-summary { margin-top: 9px; }
.page-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 35px; padding: 16px 0 25px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }

dialog { width: min(460px,calc(100% - 30px)); padding: 23px; color: var(--text); background: #191c38; border: 1px solid #525986; border-radius: 14px; }
dialog::backdrop { background: #08091bcf; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dialog-head h2 { font-size: 25px; letter-spacing: -.052em; }
.close { background: none; color: var(--text); border: 0; padding: 0 7px; font-size: 24px; }
dialog p { color: var(--muted); margin: 6px 0 13px; line-height: 1.5; }
dialog input { margin-bottom: 10px; }
dialog .action { margin-top: 6px; }
#packs { display: grid; gap: 7px; }
#packs .secondary { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; }
#packs button:disabled { opacity: 1; }
.pack-coins { display: grid; gap: 2px; text-align: right; }
.pack-coins small { color: var(--muted); font-weight: 500; }

@media (max-width: 1180px) {
  .wrap { width: calc(100% - 48px); }
  .terminal { grid-template-columns: minmax(145px,.7fr) minmax(305px,2.4fr) minmax(192px,.95fr); }
  .market-row { grid-template-columns: 28px 1fr; }
  .asset-price { grid-column: 2; }
}
@media (max-width: 820px) {
  .wrap { width: calc(100% - 28px); }
  .nav { min-height: 61px; gap: 10px; }
  .brand { gap: 7px; font-size: 17px; }
  .brand-mark { width: 21px; height: 18px; }
  .nav nav { display: none; }
  .userbar { gap: 10px; }
  .intro { padding: 30px 0 22px; }
  .intro p { max-width: 43ch; margin-top: 11px; }
  .terminal { grid-template-columns: minmax(0,1fr); }
  .market-list { border-right: 0; border-bottom: 1px solid var(--line); }
  .market-list h2, .ticker-note { display: none; }
  #symbols { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
  .market-row { grid-template-columns: 24px 1fr; gap: 5px; padding: 10px 5px 8px 8px; border: 0; border-bottom: 2px solid transparent; }
  .market-row.selected { border-bottom-color: var(--lilac); }
  .asset-price { display: none; }
  .market-row strong { font-size: 11px; }
  .market-row small { font-size: 9px; }
  .asset-icon { width: 22px; height: 22px; font-size: 13px; }
  .chart-panel { padding: 13px 12px 10px; }
  .chart-stage { height: 230px; }
  .order-panel, .coins-panel { border-left: 0; border-top: 1px solid var(--line); }
  .coins-panel { display: grid; grid-template-columns: 60px 1fr; gap: 5px 13px; }
  .coin-emblem { margin: 0; grid-row: 1 / span 3; }
  .coins-panel .secondary { margin-top: 9px; width: fit-content; grid-column: 2; }
  .coins-panel .purchase-state { grid-column: 2; margin-top: 5px; }
  .portfolio-grid { grid-template-columns: 1fr; gap: 10px; }
  .lessons { grid-template-columns: 1fr; }
  .portfolio-head h2 { font-size: 21px; }
  th, td { padding: 9px 7px; font-size: 12px; }
  #test-summary th, #test-summary td { padding-inline: 5px; font-size: 11px; }
}
@media (max-width: 395px) {
  .sim-label { display: none; }
  .chart-stage { height: 202px; }
  .chart-footer { font-size: 10px; }
  .backtest .portfolio-head { align-items: start; }
  #test-period { text-align: right; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
