:root {
  --bg: #070b14;
  --bg2: #0d1424;
  --glass: rgba(20, 30, 52, 0.55);
  --border: rgba(120, 170, 255, 0.14);
  --text: #e8eefc;
  --muted: #8a98b8;
  --green: #22e39a;
  --cyan: #2ed3ff;
  --red: #ff4d6d;
  --gold: #ffc94d;
  --grad: linear-gradient(135deg, #22e39a 0%, #2ed3ff 100%);
  --radius: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, #12305a 0%, transparent 60%),
              radial-gradient(900px 500px at -10% 110%, #0c3b32 0%, transparent 55%),
              var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }

#bg, #confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#bg { z-index: 0; opacity: 0.35; }
#confetti { z-index: 50; }

.app { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; padding: 14px 16px 40px; }

/* ---------- Header ---------- */
.top { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 42px; height: 42px; border-radius: 13px; background: var(--grad);
  display: grid; place-items: center; font-weight: 700; color: #04130d;
  box-shadow: 0 0 24px rgba(34, 227, 154, 0.45);
  animation: float 4s ease-in-out infinite;
}
.brand-name { font-family: 'Space Grotesk', sans-serif; font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
.brand-name em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-sub { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 1.6s infinite; }

.ticker {
  display: flex; gap: 18px; overflow: hidden; white-space: nowrap; font-family: 'JetBrains Mono', monospace;
  font-size: 12px; padding: 8px 12px; border-radius: 12px; background: var(--glass); border: 1px solid var(--border);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ticker-track { display: inline-flex; gap: 22px; animation: marquee 22s linear infinite; }
.ticker .up { color: var(--green); } .ticker .down { color: var(--red); }

/* ---------- Tabs ---------- */
.tabs {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 14px;
  background: var(--glass); border: 1px solid var(--border); margin-bottom: 18px; backdrop-filter: blur(12px);
}
.tab { position: relative; z-index: 1; padding: 10px; font-weight: 600; font-size: 14px; color: var(--muted); transition: color .25s; }
.tab.active { color: #04130d; }
.tab-glider {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 10px;
  background: var(--grad); box-shadow: 0 4px 18px rgba(46, 211, 255, 0.35); transition: transform .35s cubic-bezier(.6,.2,.2,1);
}
.tabs[data-active="signals"] .tab-glider { transform: translateX(100%); }
.tabs.hidden { display: none; }

/* ---------- Views ---------- */
.view { display: none; animation: fadeUp .45s ease both; }
.view.active { display: block; }
h1 { font-family: 'Space Grotesk', sans-serif; font-size: 26px; line-height: 1.15; letter-spacing: -0.5px; margin-bottom: 6px; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.5; margin-bottom: 18px; }
.glass { background: var(--glass); border: 1px solid var(--border); border-radius: var(--radius); backdrop-filter: blur(14px); }

/* ---------- Wizard ---------- */
.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.step-dot { flex: 1; height: 4px; border-radius: 4px; background: rgba(255,255,255,0.08); transition: background .3s; }
.step-dot.active { background: var(--grad); box-shadow: 0 0 10px rgba(34,227,154,.5); }
.wiz { display: none; }
.wiz.active { display: block; animation: fadeUp .4s ease both; }

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card-opt {
  text-align: left; padding: 16px 14px; border-radius: var(--radius); background: var(--glass); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px; transition: transform .15s, border-color .2s, box-shadow .2s;
}
.card-opt .ico { font-size: 26px; margin-bottom: 6px; }
.card-opt b { font-size: 15px; }
.card-opt small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.card-opt:active, .chip:active { transform: scale(.96); }
.card-opt.selected { border-color: var(--green); box-shadow: 0 0 0 1px var(--green), 0 0 26px rgba(34,227,154,.25); background: rgba(34,227,154,.08); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chips.big .chip { flex: 1 1 calc(50% - 8px); padding: 16px; font-size: 15px; }
.chip {
  padding: 10px 16px; border-radius: 12px; background: var(--glass); border: 1px solid var(--border);
  font-weight: 600; font-size: 14px; transition: all .18s;
}
.chip.selected { background: var(--grad); color: #04130d; border-color: transparent; box-shadow: 0 4px 16px rgba(46,211,255,.3); }

.lbl { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .6px; }
.risk-pill { padding: 4px 10px; border-radius: 20px; background: rgba(255,201,77,.15); color: var(--gold); text-transform: none; letter-spacing: 0; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 8px;
  background: linear-gradient(90deg, var(--green), var(--gold), var(--red)); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 5px rgba(255,255,255,.15), 0 4px 12px rgba(0,0,0,.4); }
input[type=range]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 0; }
.risk-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 10px; }

.summary { padding: 6px 16px; margin-bottom: 18px; }
.sum-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.sum-row:last-child { border-bottom: 0; }
.sum-row span { color: var(--muted); }
.sum-row b { font-family: 'JetBrains Mono', monospace; }

.wiz-nav { display: flex; gap: 10px; margin-top: 22px; }
.wiz-nav.hidden { display: none; }

/* ---------- Buttons ---------- */
.btn { flex: 1; padding: 15px 18px; border-radius: 14px; font-weight: 700; font-size: 15px; transition: transform .12s, opacity .2s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .35; pointer-events: none; }
.btn.primary { background: var(--grad); color: #04130d; }
.btn.ghost { background: rgba(255,255,255,.06); border: 1px solid var(--border); flex: 0 0 auto; }
.btn.glow { width: 100%; box-shadow: 0 8px 30px rgba(34,227,154,.35); animation: glow 2.4s ease-in-out infinite; }
.btn.xl { padding: 18px; font-size: 17px; }

/* ---------- Build ---------- */
.ring-wrap { position: relative; width: 150px; height: 150px; margin: 10px auto 16px; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; }
.ring-bg { stroke: rgba(255,255,255,.07); }
.ring-fg { stroke: var(--green); stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset .3s; filter: drop-shadow(0 0 6px var(--green)); }
.ring-txt { position: absolute; inset: 0; display: grid; place-items: center; font-family: 'Space Grotesk'; font-size: 32px; font-weight: 700; }
.build-status { text-align: center; color: var(--cyan); font-size: 14px; margin-bottom: 14px; min-height: 20px; }
.terminal {
  font-family: 'JetBrains Mono', monospace; font-size: 11.5px; line-height: 1.55; color: #9fe8c6;
  background: rgba(3, 8, 16, .85); border: 1px solid var(--border); border-radius: 14px; padding: 14px;
  height: 230px; overflow: hidden; white-space: pre-wrap; word-break: break-word;
}
.terminal .kw { color: #ff7ab8; } .terminal .cm { color: #5c6b8a; } .terminal .nm { color: var(--gold); }
.cursor { display: inline-block; width: 7px; height: 13px; background: var(--green); vertical-align: middle; animation: blink 1s steps(1) infinite; }

/* ---------- Signals ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 20px; }
.stat { padding: 14px 8px; text-align: center; }
.stat b { display: block; font-family: 'Space Grotesk'; font-size: 20px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat small { color: var(--muted); font-size: 11px; }
.sec-title { font-family: 'Space Grotesk'; font-size: 17px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.tag { font-size: 10px; padding: 3px 8px; border-radius: 6px; background: rgba(255,201,77,.15); color: var(--gold); letter-spacing: .8px; }

.signal { padding: 14px 16px; margin-bottom: 10px; }
.sig-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.pair { font-weight: 700; }
.side { font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 8px; }
.side.buy { background: rgba(34,227,154,.15); color: var(--green); }
.side.sell { background: rgba(255,77,109,.15); color: var(--red); }
.sig-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sig-grid small { display: block; color: var(--muted); font-size: 11px; margin-bottom: 2px; }
.sig-grid b { font-family: 'JetBrains Mono'; font-size: 14px; }
.up { color: var(--green); } .down { color: var(--red); }
.sig-foot { margin-top: 10px; font-size: 12px; color: var(--muted); }

.locked-wrap { position: relative; }
.blurred { filter: blur(5px); opacity: .7; }
.lock-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  text-align: center; padding: 20px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(7,11,20,.2), rgba(7,11,20,.85) 45%);
}
.lock-ico { font-size: 38px; animation: wiggle 2.6s ease-in-out infinite; }
.lock-overlay small { color: var(--muted); font-size: 13px; max-width: 260px; margin-bottom: 10px; }
.lock-overlay .btn { max-width: 280px; }
.disclaimer { font-size: 11px; color: #5d6a87; margin-top: 14px; line-height: 1.5; }

/* ---------- Share / Done ---------- */
.share-card { padding: 28px 22px; text-align: center; margin-top: 8px; }
.share-ico { font-size: 58px; margin-bottom: 8px; animation: float 3s ease-in-out infinite; }
.perks { list-style: none; text-align: left; margin: 0 auto 20px; max-width: 320px; }
.perks li { padding: 8px 0; font-size: 14px; display: flex; gap: 10px; }
.perks li::before { content: '✓'; color: var(--green); font-weight: 700; }
.consent { font-size: 11px; color: #63718f; margin-top: 14px; line-height: 1.5; }
.hint { font-size: 13px; color: var(--gold); margin-top: 10px; min-height: 18px; }

.check { width: 90px; height: 90px; margin: 4px auto 14px; }
.check svg { width: 100%; height: 100%; }
.check circle { fill: none; stroke: var(--green); stroke-width: 3; stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw .7s ease forwards; }
.check path { fill: none; stroke: var(--green); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .4s .6s ease forwards; }
#view-done .btn { margin-top: 10px; padding: 12px 30px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 120px); z-index: 60;
  background: #1a2540; border: 1px solid var(--border); padding: 12px 18px; border-radius: 12px; font-size: 14px;
  transition: transform .35s cubic-bezier(.6,.2,.2,1); max-width: 90%;
}
.toast.show { transform: translate(-50%, 0); }

/* ---------- Animations ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes glow { 0%,100% { box-shadow: 0 8px 30px rgba(34,227,154,.3); } 50% { box-shadow: 0 8px 40px rgba(46,211,255,.55); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes wiggle { 0%,85%,100% { transform: rotate(0); } 88% { transform: rotate(-12deg); } 92% { transform: rotate(12deg); } 96% { transform: rotate(-6deg); } }
@keyframes draw { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
