/* Aplicativo do DigitX Alpha no celular — mesmas cores do site e do canal Tecnobots. */
:root {
    --fundo: #0b1622;
    --cartao: #12212f;
    --cartao-2: #172a3b;
    --borda: #22394d;
    --texto: #e8f0f5;
    --fraco: #9fb1c1;
    --verde: #6bdc45;
    --verde-escuro: #3f9d28;
    --vermelho: #ff6b6b;
    --amarelo: #f5c451;
    --azul: #5aa9ff;
    --topo-altura: 56px;
    --menu-altura: 62px;
}

* { box-sizing: border-box; }
html, body {
    margin: 0;
    height: 100%;
    background: var(--fundo);
    color: var(--texto);
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 15px;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none;
}
[hidden] { display: none !important; }
button { font-family: inherit; }
b { font-weight: 700; }
.verde { color: var(--verde); }
.vermelho { color: var(--vermelho); }

/* ---------- botões ---------- */
.botao {
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    color: var(--texto);
    background: var(--cartao-2);
    transition: transform 0.08s, opacity 0.2s;
}
.botao:active:not([disabled]) { transform: scale(0.97); }
.botao[disabled] { opacity: 0.4; cursor: default; }
.botao-verde { background: var(--verde); color: #0b1622; }
.botao-vermelho { background: var(--vermelho); color: #2a0b0b; }
.botao-contorno { background: transparent; border: 1px solid var(--borda); }
.botao-perigo { color: var(--vermelho); }
.botao-grande { padding: 16px; font-size: 17px; width: 100%; }
.botao-largo { width: 100%; margin-top: 8px; }
.botao-link { background: none; border: none; color: var(--verde); font-weight: 700; padding: 6px 0; font-size: 14px; cursor: pointer; }
.botao-icone { background: var(--cartao-2); border: 1px solid var(--borda); color: var(--texto); border-radius: 10px; width: 38px; height: 34px; font-size: 18px; }
.linha-botoes { display: flex; gap: 10px; margin-top: 10px; }
.linha-botoes .botao { flex: 1; }

/* ---------- tela de entrar ---------- */
.tela-entrar { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); }
.entrar-caixa { width: 100%; max-width: 420px; text-align: center; }
.entrar-logo { width: 96px; height: 96px; border-radius: 24px; box-shadow: 0 0 40px rgba(107, 220, 69, 0.25); }
.entrar-caixa h1 { margin: 14px 0 4px; font-size: 30px; color: var(--verde); }
.entrar-sub { margin: 0 0 18px; color: var(--fraco); }
.entrar-lista { text-align: left; list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 10px; }
.entrar-lista li { background: var(--cartao); border: 1px solid var(--borda); border-radius: 14px; padding: 12px 14px; line-height: 1.4; color: var(--fraco); }
.entrar-lista b { color: var(--texto); }
.entrar-nota { color: var(--fraco); font-size: 13px; line-height: 1.5; margin: 12px 0; }
.entrar-risco { color: var(--fraco); font-size: 12px; margin-top: 18px; }
.entrar-esperando { display: flex; gap: 12px; align-items: center; text-align: left; background: rgba(245, 196, 81, 0.1); border: 1px solid rgba(245, 196, 81, 0.4); border-radius: 14px; padding: 12px; margin-bottom: 14px; font-size: 13px; line-height: 1.45; color: var(--fraco); }
.entrar-esperando b { color: var(--amarelo); }
#btnInstalarEntrar { width: 100%; }

.girando { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; border: 3px solid var(--borda); border-top-color: var(--verde); animation: girar 0.9s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- aplicativo ---------- */
.tela-app { position: fixed; inset: 0; display: flex; flex-direction: column; }
.topo {
    flex: 0 0 auto;
    height: calc(var(--topo-altura) + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 12px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--cartao);
    border-bottom: 1px solid var(--borda);
}
.topo-marca { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topo-marca img { width: 36px; height: 36px; border-radius: 9px; }
.topo-nome { font-weight: 800; font-size: 16px; color: var(--verde); }
.topo-conta { font-size: 12px; color: var(--fraco); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topo-direita { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.pilula { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--cartao-2); border: 1px solid var(--borda); font-size: 13px; font-weight: 700; color: var(--fraco); }
.bolinha { width: 9px; height: 9px; border-radius: 50%; background: #6c7f90; }
.pilula.rodando { color: var(--verde); border-color: rgba(107, 220, 69, 0.5); }
.pilula.rodando .bolinha { background: var(--verde); box-shadow: 0 0 8px var(--verde); animation: pulsar 1.4s ease-in-out infinite; }
@keyframes pulsar { 50% { opacity: 0.4; } }

.faixa-conexao { flex: 0 0 auto; background: rgba(245, 196, 81, 0.15); color: var(--amarelo); text-align: center; font-size: 13px; padding: 6px; }
.faixa-tela-cheia { flex: 0 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: calc(4px + env(safe-area-inset-top)) 10px 4px; background: var(--cartao); border-bottom: 1px solid var(--borda); font-size: 13px; color: var(--fraco); }
.botao-faixa { background: var(--cartao-2); color: var(--texto); border: 1px solid var(--borda); border-radius: 8px; padding: 5px 10px; font-size: 13px; font-weight: 700; }

.conteudo { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; position: relative; }
.aba { padding: 12px 12px 20px; max-width: 720px; margin: 0 auto; }
.aba-blocos { padding: 0; max-width: none; height: 100%; position: relative; }
.aba-blocos iframe { border: 0; width: 100%; height: 100%; display: block; background: #fff; }
.blocos-carregando { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; color: var(--fraco); background: var(--fundo); }

.menu {
    flex: 0 0 auto;
    display: flex;
    height: calc(var(--menu-altura) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--cartao);
    border-top: 1px solid var(--borda);
}
.menu-item { flex: 1; background: none; border: none; color: var(--fraco); font-size: 11px; font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer; }
.menu-icone { font-size: 22px; line-height: 1; filter: grayscale(1); opacity: 0.7; }
.menu-item.ativo { color: var(--verde); }
.menu-item.ativo .menu-icone { filter: none; opacity: 1; }

/* Tela cheia dos blocos (deita o celular para ver mais). */
.tela-app.tela-cheia .topo, .tela-app.tela-cheia .menu { display: none; }

/* Celular deitado: menu mais baixo para sobrar espaço. */
@media (orientation: landscape) and (max-height: 500px) {
    :root { --topo-altura: 46px; --menu-altura: 48px; }
    .menu-item { flex-direction: row; gap: 6px; font-size: 12px; }
    .menu-icone { font-size: 18px; }
    .topo-marca img { width: 30px; height: 30px; }
}

/* ---------- cartões ---------- */
.cartao { background: var(--cartao); border: 1px solid var(--borda); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.cartao-alerta { border-color: rgba(245, 196, 81, 0.55); background: rgba(245, 196, 81, 0.08); color: var(--amarelo); line-height: 1.45; display: flex; flex-direction: column; gap: 10px; }
.cartao-titulo { font-weight: 800; font-size: 16px; margin-bottom: 10px; }
.rotulo { display: block; font-size: 13px; color: var(--fraco); margin-bottom: 6px; font-weight: 600; }
.rotulo small { font-weight: 400; }
.campo { width: 100%; background: var(--fundo); color: var(--texto); border: 1px solid var(--borda); border-radius: 10px; padding: 12px; font-size: 16px; margin-bottom: 12px; }
select.campo { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--fraco) 50%), linear-gradient(135deg, var(--fraco) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.saldo-linha { display: flex; justify-content: space-between; align-items: baseline; color: var(--fraco); }
.saldo-linha b { font-size: 22px; color: var(--texto); }
.texto { margin: 0 0 6px; line-height: 1.45; }
.texto-fraco { margin: 0 0 10px; color: var(--fraco); font-size: 13px; line-height: 1.45; }

.numeros { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.numero { background: var(--cartao-2); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.numero span { font-size: 12px; color: var(--fraco); }
.numero b { font-size: 20px; }
.numero-grande { grid-column: 1 / -1; }
.numero-grande b { font-size: 30px; }
.numero-largo { grid-column: 1 / -1; }
@media (min-width: 560px) { .numero-largo { grid-column: auto; } }
@media (min-width: 560px) { .numeros { grid-template-columns: repeat(4, 1fr); } }

.botoes-robo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.passos ol { margin: 0; padding-left: 22px; display: grid; gap: 8px; color: var(--fraco); line-height: 1.4; }
.passos li.feito { color: var(--verde); text-decoration: line-through; }
.passos li.feito .botao-link { display: none; }
.passos .botao-link { display: block; }

/* estratégias */
.lista-estrategias { display: grid; gap: 8px; }
.estrategia { background: var(--cartao-2); border-radius: 12px; padding: 10px 12px; display: flex; gap: 10px; align-items: center; }
.estrategia-info { flex: 1; min-width: 0; }
.estrategia-nome { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.estrategia-sub { font-size: 12px; color: var(--fraco); margin-top: 3px; line-height: 1.35; }
.estrategia-lucro { font-weight: 800; text-align: right; flex: 0 0 auto; }
.estrategia-lucro small { display: block; font-weight: 400; font-size: 11px; color: var(--fraco); }
.botao-lixo { flex: 0 0 auto; background: none; border: 1px solid var(--borda); border-radius: 10px; width: 40px; height: 40px; font-size: 18px; color: var(--texto); }
.vazio { color: var(--fraco); font-size: 14px; text-align: center; padding: 14px 6px; line-height: 1.5; }

/* painel */
.robo-painel { margin-bottom: 14px; }
.robo-painel-topo { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 2px 8px; }
.robo-painel-nome { font-weight: 800; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.robo-painel-lucro { font-weight: 800; flex: 0 0 auto; }
.cartoes-mercado { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .cartoes-mercado { grid-template-columns: repeat(3, 1fr); } }
.cartao-mercado { text-align: left; background: var(--cartao); border: 1px solid var(--borda); border-radius: 14px; padding: 12px; color: var(--texto); cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.cartao-mercado:active { transform: scale(0.98); }
/* linhas do bloco "📊 mostrar no Dashboard" (cortadas com "..." no cartão; inteiras ao abrir o cartão) */
.cartao-mercado { min-width: 0; }
.cartao-mercado > * { pointer-events: none; }   /* o toque é sempre do cartão (o conteúdo é trocado a cada resumo) */
.cm-dash { border-top: 1px solid var(--borda); padding-top: 6px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cm-dash-linha { font-size: 12px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.det-linhas { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--borda); border-radius: 12px; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.det-linhas[hidden] { display: none; }
.cm-nome { font-weight: 700; font-size: 14px; }
.cm-lucro { font-size: 22px; font-weight: 800; }
.cm-linha { font-size: 12px; color: var(--fraco); }
.etiqueta { align-self: flex-start; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: var(--cartao-2); color: var(--fraco); }
.etiqueta.operando { background: rgba(107, 220, 69, 0.15); color: var(--verde); }
.etiqueta.pausado { background: rgba(245, 196, 81, 0.15); color: var(--amarelo); }
.det-sub { color: var(--fraco); font-size: 13px; margin: -4px 0 12px; }

/* registro */
.seletor { display: flex; background: var(--cartao); border: 1px solid var(--borda); border-radius: 12px; padding: 4px; margin-bottom: 12px; position: sticky; top: 0; z-index: 2; }
.seletor-item { flex: 1; background: none; border: none; color: var(--fraco); padding: 10px; border-radius: 9px; font-weight: 700; font-size: 14px; }
.seletor-item.ativo { background: var(--cartao-2); color: var(--texto); }
.lista-operacoes, .lista-mensagens { display: grid; gap: 6px; }
.operacao { background: var(--cartao); border: 1px solid var(--borda); border-left: 4px solid var(--borda); border-radius: 12px; padding: 10px 12px; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; }
.operacao.ganhou { border-left-color: var(--verde); }
.operacao.perdeu { border-left-color: var(--vermelho); }
.operacao.aberta { border-left-color: var(--azul); }
.op-titulo { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-lucro { font-weight: 800; text-align: right; }
.op-sub { font-size: 12px; color: var(--fraco); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-hora { font-size: 12px; color: var(--fraco); text-align: right; }
.mensagem { background: var(--cartao); border-radius: 10px; padding: 8px 10px; font-size: 13px; line-height: 1.4; display: flex; gap: 8px; }
.mensagem .hora { color: var(--fraco); flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.mensagem.success { color: var(--verde); }
.mensagem.warn { color: var(--amarelo); }
.mensagem.error { color: var(--vermelho); font-weight: 600; }
.mensagem.info { color: #bcd3e6; }

.rodape { color: var(--fraco); font-size: 12px; text-align: center; line-height: 1.6; margin-top: 18px; }

/* ---------- janela ---------- */
.janela-fundo { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 70; }
.janela { width: 100%; max-width: 440px; max-height: 100%; overflow-y: auto; background: var(--cartao); border: 1px solid var(--borda); border-radius: 18px; padding: 18px; }
.janela-titulo { font-size: 18px; font-weight: 800; margin-bottom: 10px; }
.janela-corpo { color: var(--fraco); line-height: 1.5; font-size: 14px; }
.janela-corpo ol { padding-left: 20px; margin: 6px 0; display: grid; gap: 8px; }
.janela-corpo b { color: var(--texto); }
.janela-botoes { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }

/* ---------- avisos rápidos ---------- */
.avisos { position: fixed; left: 12px; right: 12px; top: calc(var(--topo-altura) + env(safe-area-inset-top) + 8px); display: flex; flex-direction: column; gap: 8px; z-index: 60; pointer-events: none; }
.aviso { max-width: 520px; margin: 0 auto; width: 100%; padding: 12px 14px; border-radius: 12px; font-weight: 600; font-size: 14px; line-height: 1.4; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4); background: #1d3347; color: var(--texto); animation: entrar 0.2s ease-out; pointer-events: auto; }
.aviso.success { background: #1f4d22; }
.aviso.warn { background: #5a4515; }
.aviso.error { background: #5a1f1f; }
@keyframes entrar { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
