:root {
  --bg: #0b0b12;
  --neon: #22b6f8;
  --neon-dim: #2f7fd0;
  --cyan: #6f5bef;
  --buy: #22b6f8;
  --sell: #ff2e57;
  --amber: #ffcf4d;
  --text: #dfe4ff;
  --muted: #7b7ea8;
  --line: rgba(90, 120, 240, 0.20);
  --line-soft: rgba(90, 120, 240, 0.08);
  --panel: rgba(12, 12, 24, 0.72);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Backgrounds em camadas ---------- */
#matrix {
  position: fixed; inset: 0; z-index: 0;
  opacity: 0.55;
}
.bg-grid {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 40%, #000 30%, transparent 85%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 30%, transparent 85%);
}
.bg-glow {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(900px 600px at 80% -10%, rgba(111,91,239,0.12), transparent 60%),
    radial-gradient(900px 700px at 10% 110%, rgba(34,182,248,0.12), transparent 60%);
}
/* scanlines tipo CRT */
.bg-scan {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.18) 0px, rgba(0,0,0,0.18) 1px, transparent 2px, transparent 4px);
  mix-blend-mode: multiply; opacity: 0.5;
}
.bg-vignette {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  box-shadow: inset 0 0 220px 40px rgba(0,0,0,0.9);
}

/* ---------- Conteúdo ---------- */
.wrap {
  position: relative; z-index: 3;
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 16px calc(108px + env(safe-area-inset-bottom));
}

/* ---------- Topbar (só identidade da marca) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 12px 18px;
  background: rgba(11, 11, 18, 0.78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  box-shadow: 0 6px 28px rgba(0,0,0,0.55);
}
.topbar .brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.topbar .brand-logo {
  width: 42px; height: 42px; display: block;
  filter: drop-shadow(0 0 9px rgba(58,140,255,0.55)) drop-shadow(0 0 18px rgba(111,91,239,0.35));
}
.topbar .brand h1 {
  font-family: "Orbitron", sans-serif; font-size: 18px; font-weight: 900; letter-spacing: 2px;
  background: linear-gradient(120deg, var(--neon), var(--cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 12px rgba(58,140,255,0.4));
}

/* ---------- Bottom dock / tab bar (estilo app de celular) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: stretch; justify-content: center; gap: 10px;
  padding: 9px 14px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(12,12,20,0.86), rgba(6,6,12,0.97));
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
  box-shadow: 0 -10px 34px rgba(0,0,0,0.65), 0 -1px 0 rgba(90,120,240,0.20);
}
.tabbar::before {
  content: ""; position: absolute; top: -1px; left: 50%; transform: translateX(-50%);
  width: 60%; height: 2px; border-radius: 99px;
  background: linear-gradient(90deg, transparent, var(--neon), var(--cyan), transparent);
  box-shadow: 0 0 14px var(--neon); opacity: 0.7;
}
.tabbar a {
  position: relative;
  flex: 1 1 0; max-width: 180px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  padding: 8px 6px; border-radius: 14px; border: 1px solid transparent;
  text-decoration: none; color: var(--muted); text-align: center; line-height: 1.2;
  font-family: "Orbitron", sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 0.6px;
  transition: color .18s, background .18s, border-color .18s, transform .14s, box-shadow .2s;
}
.tabbar a svg { width: 25px; height: 25px; display: block; transition: filter .2s, transform .18s; }
.tabbar a:active { transform: scale(0.94); }
.tabbar a:hover { color: var(--text); }
.tabbar a.active {
  color: var(--neon);
  border-color: rgba(58,140,255,0.45);
  background: rgba(58,140,255,0.10);
  box-shadow: 0 0 18px rgba(58,140,255,0.22), inset 0 0 14px rgba(58,140,255,0.07);
}
.tabbar a.active svg { filter: drop-shadow(0 0 7px rgba(58,140,255,0.85)); transform: translateY(-1px); }


/* ---------- Home / Boas-vindas ---------- */
.hero {
  width: 100%; max-width: 980px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 22px; padding-top: 18px;
}
.hero-logo {
  width: min(290px, 74vw); height: auto; display: block; margin: 6px 0 2px;
  filter: drop-shadow(0 0 26px rgba(58,140,255,0.40)) drop-shadow(0 0 54px rgba(111,91,239,0.24));
  animation: floaty 5s ease-in-out infinite;
}

/* Vídeo */
.video-card {
  width: 100%; max-width: 880px; margin-top: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  backdrop-filter: blur(10px); overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6), inset 0 0 40px rgba(58,140,255,0.03);
}
.video-card .vc-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: rgba(58,140,255,0.05); font-size: 12px;
}
.video-card .vc-head .tag { color: var(--neon); letter-spacing: 1px; font-family: "Orbitron", sans-serif; display: inline-flex; align-items: center; gap: 7px; }
.video-card .vc-head .tag svg { width: 14px; height: 14px; }
.video-frame {
  position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000;
  display: grid; place-items: center;
}
.video-frame iframe, .video-frame video { width: 100%; height: 100%; border: 0; display: block; }
.video-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 14px; color: var(--muted);
  text-align: center; padding: 20px;
}
.video-placeholder .play {
  width: 76px; height: 76px; border-radius: 50%;
  display: grid; place-items: center; color: #0a0a14;
  background: linear-gradient(135deg, var(--neon), var(--cyan));
  box-shadow: 0 0 30px rgba(58,140,255,0.5); animation: floaty 3.2s ease-in-out infinite;
}
@keyframes floaty { 0%,100%{transform:translateY(0);} 50%{transform:translateY(-8px);} }
.video-placeholder .play svg { width: 30px; height: 30px; margin-left: 3px; }
.video-placeholder .ttl { font-family: "Orbitron", sans-serif; color: #eef1ff; letter-spacing: 1px; font-size: 15px; }
.video-placeholder .sub { font-size: 12.5px; max-width: 360px; line-height: 1.7; }

/* ---------- Layout análise ---------- */
.grid {
  width: 100%; max-width: 1180px;
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: stretch;
}
@media (max-width: 920px) { .grid { grid-template-columns: 1fr; } }

.panel-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4), 0 24px 60px rgba(0,0,0,0.6), inset 0 0 40px rgba(58,140,255,0.03);
  overflow: hidden;
  display: flex; flex-direction: column;
}
/* cantinhos de mira tipo HUD */
.panel-card::before, .panel-card::after {
  content: ""; position: absolute; width: 14px; height: 14px; z-index: 4; pointer-events: none;
  border-color: var(--neon); border-style: solid; opacity: 0.7;
}
.panel-card::before { top: 8px; left: 8px; border-width: 2px 0 0 2px; }
.panel-card::after { bottom: 8px; right: 8px; border-width: 0 2px 2px 0; }

.iframe-wrap { position: relative; flex: 1; min-height: 540px; background: #000; }
@media (max-width: 920px) { .iframe-wrap { min-height: 62vh; } }
.iframe-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }
.iframe-wrap::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 120px rgba(58,140,255,0.06);
}

/* Painel direito */
.panel { padding: 18px; display: flex; flex-direction: column; gap: 16px; flex: 1; }
.panel-head { display: flex; align-items: center; justify-content: space-between; }
.panel-head h2 { font-size: 14px; letter-spacing: 1px; color: #eef1ff; }

/* Instrução topo do painel */
.howto {
  display: flex; align-items: flex-start; gap: 10px;
  border: 1px solid var(--line); border-radius: 10px;
  background: rgba(58,140,255,0.06); padding: 12px 13px;
  font-size: 12px; line-height: 1.6; color: var(--text);
}
.howto svg { width: 18px; height: 18px; flex: none; color: var(--neon); margin-top: 1px; }
.howto b { color: var(--neon); }

/* Console output */
.result {
  position: relative; flex: 1; min-height: 250px;
  border: 1px solid var(--line); border-radius: 10px;
  background: rgba(0,0,0,0.45);
  display: grid; place-items: center; text-align: center; padding: 26px 18px;
  overflow: hidden;
}
.result .hint { color: var(--muted); font-size: 13px; line-height: 1.7; max-width: 280px; }
.result .hint .prompt { color: var(--neon); }
.result .hint b { color: var(--text); }

/* Analyzing */
.analyzing { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; }
.ring { position: relative; width: 84px; height: 84px; }
.ring svg { transform: rotate(-90deg); filter: drop-shadow(0 0 6px rgba(58,140,255,0.6)); }
.ring .track { stroke: rgba(90,120,240,0.14); }
.ring .prog { stroke: url(#grad); stroke-linecap: round; animation: dash 1.4s ease-in-out infinite; }
@keyframes dash {
  0%{stroke-dasharray:1 240; stroke-dashoffset:0;}
  50%{stroke-dasharray:130 240; stroke-dashoffset:-46;}
  100%{stroke-dasharray:1 240; stroke-dashoffset:-240;}
}
.ring .count { position: absolute; inset: 0; display: grid; place-items: center;
  font-family: "Orbitron", sans-serif; font-size: 22px; font-weight: 800; color: var(--neon);
  text-shadow: 0 0 12px rgba(58,140,255,0.6); }

.analyzing .label {
  font-family: "Orbitron", sans-serif; font-size: 15px; letter-spacing: 1px; color: #eef1ff;
  text-shadow: 0 0 12px rgba(58,140,255,0.5);
}
.analyzing .label .dotdot::after { content:""; animation: dots 1.3s steps(4,end) infinite; }
@keyframes dots { 0%{content:"";}25%{content:".";}50%{content:"..";}75%{content:"...";}100%{content:"";} }

.console {
  width: 100%; max-width: 290px; text-align: left; font-size: 11.5px; line-height: 1.7;
  color: var(--neon-dim); min-height: 90px;
}
.console .ln::before { content: "> "; color: var(--neon); }
.console .ln.done::after { content: " ✓"; color: var(--neon); }
.console .cursor { display:inline-block; width:8px; height:14px; background:var(--neon); margin-left:2px; vertical-align:-2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 0%,100%{opacity:1;} 50%{opacity:0.25;} }

.scan-bar { width: 230px; height: 5px; border-radius: 99px; background: rgba(90,120,240,0.10); overflow: hidden; }
.scan-bar i { display:block; height:100%; width:40%; border-radius:99px;
  background: linear-gradient(90deg, transparent, var(--neon), var(--cyan), transparent);
  box-shadow: 0 0 12px var(--neon); animation: scan 1.1s ease-in-out infinite; }
@keyframes scan { 0%{transform:translateX(-120%);}100%{transform:translateX(360%);} }

/* Resultado: ponto de saída */
.signal { width: 100%; max-width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; animation: pop 0.5s cubic-bezier(.2,.9,.3,1.4); }
@keyframes pop { 0%{transform:scale(.5);opacity:0;}100%{transform:scale(1);opacity:1;} }
.signal .tag { font-size: 10.5px; letter-spacing: 3px; color: var(--muted); }
.signal .cashlabel {
  font-family: "Orbitron", sans-serif; font-size: 13px; letter-spacing: 4px; color: var(--text);
  display: inline-flex; align-items: center; gap: 7px;
}
.signal .cashlabel svg { width: 16px; height: 16px; }
.signal .verdict {
  font-family: "Orbitron", sans-serif; font-size: clamp(46px, 17vw, 78px); font-weight: 900; letter-spacing: 1px;
  display: flex; align-items: baseline; justify-content: center; gap: 2px; line-height: 1;
  max-width: 100%; overflow-wrap: anywhere;
}
.signal .verdict .x { font-size: clamp(24px, 8vw, 38px); opacity: 0.85; }
.signal .conf { font-size: 12px; color: var(--muted); }
.signal .conf b { color: var(--text); }

.result.hit { border-color: rgba(58,140,255,0.6); box-shadow: inset 0 0 70px rgba(58,140,255,0.14); }
.result.hit .verdict {
  background: linear-gradient(120deg, var(--neon), var(--cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 26px rgba(58,140,255,0.6));
}
.result.hit .cashlabel svg { color: var(--neon); }

.meta-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.meta-box { border: 1px solid var(--line); border-radius: 8px; padding: 11px 13px; background: rgba(58,140,255,0.04); }
.meta-box .k { font-size: 10px; color: var(--muted); letter-spacing: 1.2px; text-transform: uppercase; }
.meta-box .v { font-size: 15px; font-weight: 700; margin-top: 4px; color: #eef1ff; }

/* Botão */
.generate-btn {
  position: relative; border: 0; cursor: pointer; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 24px; font-family: "Orbitron", sans-serif; font-size: 15px; font-weight: 700; letter-spacing: 1.5px;
  color: #0a0a14; border-radius: 10px; overflow: hidden;
  background: linear-gradient(135deg, var(--neon), var(--cyan));
  box-shadow: 0 0 26px rgba(58,140,255,0.5), inset 0 0 10px rgba(255,255,255,0.35);
  transition: transform .12s, box-shadow .22s, filter .2s;
}
.generate-btn::after {
  content:""; position:absolute; inset:0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.5) 50%, transparent 70%);
  transform: translateX(-130%); transition: transform .6s;
}
.generate-btn:hover:not(:disabled)::after { transform: translateX(130%); }
.generate-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 0 38px rgba(58,140,255,0.75); }
.generate-btn:active:not(:disabled) { transform: translateY(0); }
.generate-btn:disabled { filter: grayscale(0.4) brightness(0.85); cursor: progress; }
.generate-btn svg { width: 20px; height: 20px; flex: none; }

footer { color: var(--muted); font-size: 11px; margin-top: 28px; text-align: center; max-width: 640px; line-height: 1.6; }
footer b { color: var(--neon-dim); }

/* ---------- Webview (corretora dentro do app) ---------- */
.webview-overlay {
  position: fixed; inset: 0; z-index: 999;
  display: none; flex-direction: column;
  background: rgba(4, 4, 10, 0.86);
  backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .22s ease;
}
.webview-overlay.open { display: flex; opacity: 1; }
.webview-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px calc(11px + env(safe-area-inset-top));
  background: rgba(11, 11, 18, 0.92);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 24px rgba(0,0,0,0.5);
}
.webview-bar .wv-dot { width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: var(--neon); box-shadow: 0 0 10px var(--neon); }
.webview-bar .wv-title {
  font-family: "Orbitron", sans-serif; font-size: 12px; font-weight: 700; letter-spacing: 1px;
  color: #eef1ff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1;
}
.webview-bar .wv-host { color: var(--muted); font-size: 11px; font-weight: 400; letter-spacing: 0; margin-left: 6px; }
.webview-bar .wv-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: rgba(58,140,255,0.08);
  color: var(--text); border-radius: 9px; padding: 8px 11px;
  font-family: "JetBrains Mono", monospace; font-size: 11px; cursor: pointer;
  transition: background .18s, border-color .18s, transform .12s;
}
.webview-bar .wv-btn:hover { background: rgba(58,140,255,0.16); border-color: rgba(58,140,255,0.45); }
.webview-bar .wv-btn:active { transform: scale(0.95); }
.webview-bar .wv-btn svg { width: 14px; height: 14px; }
.webview-bar .wv-close { padding: 8px; }
.webview-body { position: relative; flex: 1; background: #000; }
.webview-body iframe { width: 100%; height: 100%; border: 0; display: block; }
.webview-body .wv-loading {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  color: var(--neon); font-family: "Orbitron", sans-serif; font-size: 12px; letter-spacing: 2px;
  transition: opacity .3s; text-shadow: 0 0 12px rgba(58,140,255,0.6);
}
.webview-body.loaded .wv-loading { opacity: 0; }
