@font-face { font-family: 'Space Grotesk'; src: url('font.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }

:root {
  --void: #04060a;
  --glass: rgba(255, 255, 255, .035);
  --glass2: rgba(255, 255, 255, .06);
  --edge: rgba(255, 255, 255, .08);
  --edge2: rgba(255, 255, 255, .14);
  --text: #eef3f8;
  --dim: #7f8a99;
  --amber: #ffb000;
  --mint: #14f1a0;
  --rose: #ff3d6e;
  --ice: #7cc8ff;
  --font: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r-lg: 18px; --r-md: 12px; --r-sm: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--void); color: var(--text); font: 15px/1.4 var(--font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
a { color: var(--ice); text-decoration: none; }
b { font-weight: 600; }
.hidden { display: none !important; }
.up { color: var(--mint); } .down { color: var(--rose); } .amber { color: var(--amber); } .ice { color: var(--ice); } .dim { color: var(--dim); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* the one ambient thing: a faint engine-glow and grid behind everything */
.sky { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60vw 40vh at 18% -6%, rgba(255, 176, 0, .13), transparent 70%),
    radial-gradient(50vw 50vh at 100% 110%, rgba(20, 241, 160, .06), transparent 70%),
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px) 0 0 / 44px 44px,
    var(--void);
  -webkit-mask-image: linear-gradient(#000 0%, rgba(0,0,0,.55) 60%, #000 100%); mask-image: linear-gradient(#000 0%, rgba(0,0,0,.55) 60%, #000 100%); }

/* buttons */
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:disabled { opacity: .4; cursor: default; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 10px 18px; font-weight: 600; font-size: 14px; transition: transform .12s, box-shadow .2s, background .2s; text-align: center; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.primary { background: var(--amber); color: #120c00; box-shadow: 0 0 0 1px rgba(255,176,0,.5), 0 8px 28px -8px rgba(255,176,0,.7); }
.btn.ghost { background: var(--glass2); border: 1px solid var(--edge); color: var(--text); }
.btn.ghost:hover:not(:disabled) { border-color: var(--edge2); }
.btn.small { padding: 7px 13px; font-size: 12.5px; }
.btn.big { width: 100%; padding: 15px; font-size: 16px; }
.btn.long { background: var(--mint); color: #00140c; box-shadow: 0 8px 30px -8px rgba(20,241,160,.75); }
.btn.short { background: var(--rose); color: #1a0008; box-shadow: 0 8px 30px -8px rgba(255,61,110,.75); }
.btn.copy { background: linear-gradient(135deg, #ffc93d, var(--amber)); color: #120c00; box-shadow: 0 6px 22px -6px rgba(255,176,0,.8); }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--glass2); border: 1px solid var(--edge); }
.icon-btn svg, .dock svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
input, select { font: inherit; font-size: 16px; color: var(--text); background: rgba(0,0,0,.35); border: 1px solid var(--edge); border-radius: var(--r-md); padding: 12px 14px; width: 100%; transition: border-color .2s, box-shadow .2s; }
input::placeholder { color: #4b5563; }
input:focus { outline: none; border-color: rgba(255,176,0,.6); box-shadow: 0 0 0 3px rgba(255,176,0,.12); }

/* wordmark */
.wordmark { font-weight: 700; letter-spacing: -.02em; font-size: 40px; margin: 0; line-height: 1; }
.wordmark span { font-weight: 300; color: var(--amber); margin-left: .28em; }
.wordmark.small { font-size: 18px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-box { width: 100%; max-width: 420px; text-align: center; }
.emblem { width: 120px; height: 120px; margin: 0 auto 22px; }
.emblem svg { width: 100%; height: 100%; overflow: visible; }
.emblem .ring { fill: none; stroke: var(--amber); stroke-width: 1.5; }
.emblem .r1 { stroke-dasharray: 4 10; opacity: .55; transform-origin: 60px 60px; animation: spin 24s linear infinite; }
.emblem .r2 { stroke-width: 3; filter: drop-shadow(0 0 8px rgba(255,176,0,.7)); }
.emblem .core { fill: var(--amber); filter: drop-shadow(0 0 12px var(--amber)); }
.emblem .ticks { stroke: var(--amber); stroke-width: 3; stroke-linecap: round; }
@keyframes spin { to { transform: rotate(360deg); } }
.lede { color: var(--dim); font-size: 16px; line-height: 1.5; margin: 16px auto 28px; max-width: 34ch; }
.fine { color: var(--dim); font-size: 13px; line-height: 1.5; margin: 12px 0; }
.code { font-size: 48px; font-weight: 700; letter-spacing: .3em; padding-left: .3em; color: var(--amber); text-shadow: 0 0 24px rgba(255,176,0,.6); margin: 4px 0 8px; }
.err { color: var(--rose); min-height: 1em; font-size: 14px; white-space: pre-line; margin-top: 14px; }

/* top bar */
.top { display: flex; align-items: center; gap: 20px; padding: 14px 20px; position: sticky; top: 0; z-index: 5; background: rgba(4,6,10,.72); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-bottom: 1px solid var(--edge); }
.logo { display: flex; align-items: center; gap: 10px; }
.logo img { width: 28px; height: 28px; border-radius: 8px; }
.acct { flex: 1; display: flex; align-items: center; gap: 14px; justify-content: center; min-width: 0; }
.bal { display: flex; align-items: baseline; gap: 10px; }
.bal .num { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.bal .lbl { color: var(--dim); font-size: 12.5px; }
.pill { font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--glass2); white-space: nowrap; }
.pill.up { background: rgba(20,241,160,.12); } .pill.down { background: rgba(255,61,110,.12); }
.me { display: flex; align-items: center; gap: 10px; }
.who { font-size: 13px; color: var(--dim); padding: 7px 12px; border-radius: 999px; border: 1px solid var(--edge); }

/* layout: floating glass panels */
.grid { display: grid; gap: 12px; padding: 12px; grid-template-columns: 340px minmax(0, 1fr) 320px; grid-template-rows: minmax(470px, 64vh) auto; }
.panel { background: var(--glass); border: 1px solid var(--edge); border-radius: var(--r-lg); padding: 16px; min-width: 0; display: flex; flex-direction: column; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.engine { grid-row: 1 / span 2; overflow: auto; }
.chartp { grid-column: 2; grid-row: 1; padding: 16px 16px 12px; }
.ticket { grid-column: 3; grid-row: 1 / span 2; overflow: auto; }
.positions { grid-column: 2; grid-row: 2; }
.ph { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
h2 { font-size: 17px; font-weight: 600; margin: 0; letter-spacing: -.01em; display: flex; align-items: center; gap: 9px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 0 rgba(20,241,160,.6); animation: beat 2s infinite; }
@keyframes beat { 0% { box-shadow: 0 0 0 0 rgba(20,241,160,.55); } 70% { box-shadow: 0 0 0 8px rgba(20,241,160,0); } 100% { box-shadow: 0 0 0 0 rgba(20,241,160,0); } }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: rgba(0,0,0,.35); border: 1px solid var(--edge); border-radius: 999px; }
.seg button { color: var(--dim); padding: 6px 12px; font-size: 12.5px; font-weight: 600; border-radius: 999px; transition: background .2s, color .2s; }
.seg button.on { background: var(--glass2); color: var(--text); box-shadow: inset 0 0 0 1px var(--edge2); }
.list { display: flex; flex-direction: column; gap: 10px; }
.empty { color: var(--dim); font-size: 14px; padding: 22px 6px; line-height: 1.55; text-align: center; }
.record { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.stat { background: rgba(0,0,0,.28); border: 1px solid var(--edge); border-radius: var(--r-md); padding: 10px 12px; }
.stat .v { font-size: 19px; font-weight: 700; letter-spacing: -.02em; display: block; }
.stat .k { font-size: 11.5px; color: var(--dim); }
.record .since { grid-column: 1 / -1; font-size: 12px; color: var(--dim); }

/* trade cards (engine + mine) */
.card { position: relative; background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02)); border: 1px solid var(--edge); border-radius: var(--r-lg); padding: 14px 14px 12px; cursor: pointer; transition: border-color .2s, transform .15s; overflow: hidden; }
.card:hover { border-color: var(--edge2); }
.card.sel { border-color: rgba(255,176,0,.55); box-shadow: 0 0 0 1px rgba(255,176,0,.25), 0 10px 40px -18px rgba(255,176,0,.6); }
.card::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--side, var(--dim)); box-shadow: 0 0 12px var(--side, transparent); }
.card.long { --side: var(--mint); } .card.short { --side: var(--rose); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tick { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.side { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; margin-left: 8px; vertical-align: 4px; }
.side.long { color: var(--mint); background: rgba(20,241,160,.12); } .side.short { color: var(--rose); background: rgba(255,61,110,.12); }
.badge { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; color: var(--ice); background: rgba(124,200,255,.12); margin-left: 6px; vertical-align: 4px; }
.badge.warn { color: var(--rose); background: rgba(255,61,110,.12); }
.px { font-size: 15px; font-weight: 600; transition: color .4s; }
.flash-up { color: var(--mint) !important; } .flash-down { color: var(--rose) !important; }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; font-size: 12.5px; color: var(--dim); min-height: 30px; }
.foot .r { font-weight: 700; font-size: 14px; margin-right: 8px; }
.why { font-size: 12px; color: var(--dim); text-align: right; max-width: 60%; }

/* the trade meter: stop on the left, target on the right, a glowing dot where the price is now */
.meter { margin: 14px 0 4px; }
.track { position: relative; height: 6px; border-radius: 6px; background: rgba(255,255,255,.06); }
.track .risk { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 6px 0 0 6px; background: linear-gradient(90deg, rgba(255,61,110,.85), rgba(255,61,110,.25)); }
.track .reward { position: absolute; top: 0; bottom: 0; right: 0; border-radius: 0 6px 6px 0; background: linear-gradient(90deg, rgba(20,241,160,.25), rgba(20,241,160,.85)); }
.track .entry { position: absolute; top: -4px; width: 2px; height: 14px; background: var(--amber); border-radius: 2px; box-shadow: 0 0 8px var(--amber); }
.track .half { position: absolute; top: -2px; width: 2px; height: 10px; background: rgba(20,241,160,.9); border-radius: 2px; }
.track .now { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.15), 0 0 16px rgba(255,255,255,.8); transition: left .6s cubic-bezier(.2,.8,.2,1); }
.marks { display: grid; grid-template-columns: 1fr 1fr 1fr; margin-top: 9px; font-size: 12px; }
.marks div:nth-child(2) { text-align: center; } .marks div:nth-child(3) { text-align: right; }
.marks span { display: block; color: var(--dim); font-size: 11px; }
.marks b { font-size: 13.5px; }

/* chart */
.mkt-head { flex-shrink: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.mkt-now { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.mkt-now .name { font-size: 15px; color: var(--dim); font-weight: 600; }
.mkt-now .big { font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.mkts { flex-shrink: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 12px 0 10px; }
.mkts::-webkit-scrollbar { display: none; }
.mkts button { font-size: 13px; font-weight: 600; padding: 7px 13px; border-radius: 999px; background: rgba(0,0,0,.3); border: 1px solid var(--edge); color: var(--dim); white-space: nowrap; position: relative; }
.mkts button.on { color: #120c00; background: var(--amber); border-color: var(--amber); box-shadow: 0 4px 18px -4px rgba(255,176,0,.7); }
.mkts button.eng::after { content: ''; position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.mkts button.on.eng::after { background: #120c00; box-shadow: none; }
.chart-wrap { flex: 1; min-height: 300px; position: relative; border-radius: var(--r-md); overflow: hidden; }
.chart { position: absolute; inset: 0; }
.zones { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.zone { position: absolute; border-left: 1px solid; }
.zone.reward { background: linear-gradient(90deg, rgba(20,241,160,.16), rgba(20,241,160,.05)); border-color: rgba(20,241,160,.5); }
.zone.risk { background: linear-gradient(90deg, rgba(255,61,110,.18), rgba(255,61,110,.05)); border-color: rgba(255,61,110,.5); }
.zone.pending { border-left-style: dashed; opacity: .7; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--dim); margin-top: 10px; align-items: center; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 6px; }

/* ticket */
.field { margin-bottom: 14px; }
.field > label { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--dim); margin-bottom: 7px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(0,0,0,.35); border: 1px solid var(--edge); margin-bottom: 16px; }
.sides button { padding: 11px; border-radius: 999px; font-weight: 700; color: var(--dim); transition: background .2s, color .2s, box-shadow .2s; }
.sides button.on.long { background: var(--mint); color: #00140c; box-shadow: 0 6px 22px -6px rgba(20,241,160,.8); }
.sides button.on.short { background: var(--rose); color: #1a0008; box-shadow: 0 6px 22px -6px rgba(255,61,110,.8); }
.ticket-mkt { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.ticket-mkt .tick { font-size: 26px; }
.chips { display: flex; gap: 6px; margin-top: 8px; }
.chips button { flex: 1; padding: 7px 0; font-size: 12.5px; font-weight: 600; border-radius: 999px; background: rgba(0,0,0,.3); border: 1px solid var(--edge); color: var(--dim); }
.chips button:hover { color: var(--text); border-color: var(--edge2); }
input[type=range] { -webkit-appearance: none; appearance: none; height: 6px; padding: 0; border: 0; border-radius: 6px; background: linear-gradient(90deg, var(--amber) var(--fill, 20%), rgba(255,255,255,.08) var(--fill, 20%)); box-shadow: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255,176,0,.35), 0 0 14px rgba(255,176,0,.8); cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255,176,0,.35), 0 0 14px rgba(255,176,0,.8); cursor: pointer; }
.levv { color: var(--amber); font-weight: 700; font-size: 14px; }
.sum { border-radius: var(--r-md); padding: 4px 14px; margin-bottom: 12px; background: rgba(0,0,0,.3); border: 1px solid var(--edge); }
.sum .line { display: flex; justify-content: space-between; padding: 9px 0; font-size: 13.5px; border-bottom: 1px solid var(--edge); }
.sum .line:last-child { border-bottom: 0; }
.sum .line span:first-child { color: var(--dim); }
.hint { font-size: 12.5px; color: var(--dim); line-height: 1.55; margin: 14px 0 0; }
.warn { color: var(--amber); }
.link-btn { color: var(--amber); font-size: 12.5px; font-weight: 600; padding: 0; margin: -4px 0 14px; }

/* positions */
.pnl { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; font-size: 12px; }
.facts span { display: block; color: var(--dim); font-size: 11px; }
.facts b { font-size: 13.5px; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 10px; }
.htable { width: 100%; border-collapse: collapse; font-size: 13px; }
.htable th { text-align: left; color: var(--dim); font-weight: 500; font-size: 12px; padding: 0 8px 8px; }
.htable td { padding: 10px 8px; border-top: 1px solid var(--edge); }
.htable td:nth-child(3), .htable th:nth-child(3) { text-align: right; }
.hsum { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }

/* modal + toast */
.modal { position: fixed; inset: 0; background: rgba(2,3,6,.7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 20; padding: 16px; animation: fade .15s; }
.modal-box { background: #0b0f16; border: 1px solid var(--edge2); border-radius: 22px; padding: 22px; width: 100%; max-width: 400px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.9), 0 0 0 1px rgba(255,176,0,.08); animation: pop .18s cubic-bezier(.2,.8,.2,1); }
#modal-body { line-height: 1.6; font-size: 15px; white-space: pre-line; }
#modal-body input { margin-top: 14px; }
.modal-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: rgba(14,19,28,.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--edge2); border-left: 3px solid var(--mint); border-radius: 14px; padding: 13px 16px; max-width: min(460px, calc(100vw - 32px)); z-index: 30; white-space: pre-line; font-size: 13.5px; line-height: 1.5; box-shadow: 0 20px 50px -10px rgba(0,0,0,.8); animation: pop .18s; cursor: pointer; }
.toast.bad { border-left-color: var(--rose); }
.dock { display: none; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* phones and the Telegram Mini App: one panel at a time, a floating dock at the bottom */
@media (max-width: 980px) {
  .top { padding: 12px 14px; gap: 10px; }
  .logo .wordmark, .who { display: none; }
  .acct { justify-content: flex-start; }
  .bal .num { font-size: 20px; }
  .bal .lbl { display: none; }
  .grid { display: block; padding: 10px 10px 100px; }
  .panel { display: none; padding: 14px; }
  .panel.show { display: flex; }
  .chartp.show { height: calc(100vh - 61px - 128px); min-height: 440px; }
  .mkt-now .big { font-size: 28px; }
  .pos-grid { grid-template-columns: 1fr; }
  .dock { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 10; padding: 6px; border-radius: 24px; background: rgba(12,16,24,.82); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--edge2); box-shadow: 0 18px 50px -12px rgba(0,0,0,.9); }
  .dock button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 4px 7px; font-size: 11.5px; font-weight: 600; color: var(--dim); border-radius: 18px; transition: background .2s, color .2s; }
  .dock button.on { color: var(--amber); background: rgba(255,176,0,.1); }
  .dock svg { width: 21px; height: 21px; }
  .toast { bottom: 104px; }
}
