/* A1 Signals: themes and look follow the Meme Desk dashboard (Space, Solana, Aurora, Dark). */
:root {
  --sans: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --paper-bg: #2B2412; --paper-ink: #F2C66B;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}
:root, :root[data-theme="space"] {
  color-scheme: dark;
  --bg: #05071A; --card: rgba(13, 18, 48, 0.92); --pop: #0E1432; --border: #222C66; --divider: #1A2255;
  --ink: #E8ECFF; --muted: #98A2D6; --tile: rgba(26, 34, 84, 0.7);
  --logo-bg: linear-gradient(135deg, #7C5CFF, #3BA3FF); --logo-ink: #FFFFFF;
  --accent: #5EEAD4; --loss: #FF7A9C; --open: #8EAAFF; --hl: #5B6CF5; --on-hl: #FFFFFF; --stars: 1;
  --bg-art: radial-gradient(900px 520px at 85% -8%, rgba(124, 92, 255, 0.30), transparent 62%), radial-gradient(760px 480px at -5% 18%, rgba(40, 120, 255, 0.22), transparent 60%), radial-gradient(700px 420px at 60% 110%, rgba(0, 200, 200, 0.10), transparent 60%);
}
:root[data-theme="solana"] {
  --bg: #0A0612; --card: rgba(22, 14, 42, 0.92); --pop: #150D2B; --border: #33265A; --divider: #271B49;
  --ink: #F1EBFF; --muted: #A99CCF; --tile: rgba(40, 26, 76, 0.7);
  --logo-bg: linear-gradient(135deg, #9945FF, #14F195); --logo-ink: #0A0612;
  --accent: #14F195; --loss: #FF6B8E; --open: #B58CFF; --hl: #8A3FF0; --on-hl: #FFFFFF; --stars: 0;
  --bg-art: radial-gradient(900px 520px at 100% -10%, rgba(153, 69, 255, 0.32), transparent 62%), radial-gradient(800px 500px at -8% 105%, rgba(20, 241, 149, 0.14), transparent 60%);
}
:root[data-theme="aurora"] {
  --bg: #03111A; --card: rgba(8, 28, 40, 0.92); --pop: #0A2231; --border: #17415A; --divider: #11344A;
  --ink: #E6FAFF; --muted: #86B4C4; --tile: rgba(14, 48, 66, 0.7);
  --logo-bg: linear-gradient(135deg, #22E0E8, #7C6CFF); --logo-ink: #02121A;
  --accent: #5BF0B0; --loss: #FF6F9C; --open: #6FD3FF; --hl: #0EA5C6; --on-hl: #FFFFFF; --stars: 1;
  --bg-art: radial-gradient(ellipse 26% 70% at 14% -6%, rgba(91, 240, 176, 0.30), transparent 72%), radial-gradient(ellipse 34% 78% at 48% -10%, rgba(34, 224, 232, 0.26), transparent 72%), radial-gradient(ellipse 28% 72% at 84% -6%, rgba(124, 108, 255, 0.30), transparent 72%);
}
:root[data-theme="dark"] {
  --bg: #0E1110; --card: #161A18; --pop: #161A18; --border: #262C29; --divider: #222825;
  --ink: #EEF2EF; --muted: #9AA39E; --tile: #1F2522;
  --logo-bg: #EEF2EF; --logo-ink: #0E1110;
  --accent: #4ADE80; --loss: #FF8A7A; --open: #7AA7FF; --hl: #EEF2EF; --on-hl: #161A18; --stars: 0;
  --bg-art: none;
}
:root { --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent); --loss-soft: color-mix(in srgb, var(--loss) 12%, transparent); --open-soft: color-mix(in srgb, var(--open) 12%, transparent); }

* { box-sizing: border-box; }
html { background: var(--bg); transition: background-color .5s ease; }
body { margin: 0; min-height: 100vh; color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; background: transparent; }
body::before { content: ''; position: fixed; inset: 0; z-index: -2; pointer-events: none; background: var(--bg-art); }
#stars { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; opacity: var(--stars); transition: opacity .5s ease; }
#stars circle { fill: #fff; animation: tw 3.2s ease-in-out infinite; }
.card, .tile, .chip, .seg, .iconbtn, .mchip { transition: background-color .5s ease, border-color .5s ease, color .5s ease; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 560px; margin: 0 auto; padding: 18px 16px calc(28px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 44px; height: 44px; border-radius: 12px; background: var(--logo-bg); color: var(--logo-ink); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
h1 { margin: 0; font-size: 21px; line-height: 1.1; font-weight: 700; letter-spacing: -0.01em; }
h2 { margin: 0; font-size: 16px; font-weight: 700; }
.tags { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.badge { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; padding: 3px 8px; border-radius: 6px; background: var(--paper-bg); color: var(--paper-ink); }
.status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.8s ease-in-out infinite; }
.status b { font-weight: 600; color: var(--accent); }
.status.off .dot { background: var(--loss); animation: none; }
.status.off b { color: var(--loss); }
.right { position: relative; display: flex; gap: 8px; }
.iconbtn { width: 44px; height: 44px; padding: 0; border-radius: 12px; border: 1px solid var(--border); background: var(--card); color: var(--ink); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.cap { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; }
.menu { position: absolute; right: 0; top: 54px; z-index: 10; width: 248px; padding: 14px; border-radius: 14px; background: var(--pop); border: 1px solid var(--border); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; animation: rise .25s ease-out both; }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 12px; background: var(--tile); }
.seg button, .seg a { height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; transition: background-color .25s ease, color .25s ease; }
.seg [aria-pressed="true"], .seg [aria-current="page"] { background: var(--hl); color: var(--on-hl); }
.views { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.market { display: flex; gap: 8px; }
.mchip { flex: 1 1 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 11px; border-radius: 14px; border: 1px solid var(--border); background: var(--card); color: var(--muted); text-align: left; }
.mchip .mn { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 700; }
.mchip .md { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.mchip small { font: 500 10.5px var(--mono); }
.mchip.on { border: 1.5px solid var(--accent); box-shadow: 0 0 14px var(--accent-soft); color: var(--ink); }
.mchip.on .md { background: var(--accent); animation: pulse 1.8s ease-in-out infinite; }
.mchip.on small { color: var(--accent); }

.page { display: flex; flex-direction: column; gap: 14px; animation: page .45s ease-out both; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sub { font-size: 12px; color: var(--muted); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.lbl { font-size: 13px; color: var(--muted); }
.mult { font-size: 14px; font-weight: 700; padding: 4px 10px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.mult.neg { background: var(--loss-soft); color: var(--loss); }
.big { font-size: 46px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.big small { font-size: 27px; color: var(--muted); }
.subrow { display: flex; justify-content: space-between; font-size: 14px; }
.pos { color: var(--accent); }
.neg { color: var(--loss); }
.b { font-weight: 600; }
.mono { font-family: var(--mono); }
.empty { margin: 6px 0; font-size: 13px; color: var(--muted); text-align: center; }

/* open position */
.pcard { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 12px; border-radius: 12px; }
.pcard .ants { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.pcard .ants rect { fill: none; stroke: var(--open); stroke-width: 1.5; stroke-dasharray: 6 5; animation: ants 1.2s linear infinite; }
.ic { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ic.long { background: var(--accent-soft); color: var(--accent); }
.ic.short { background: var(--loss-soft); color: var(--loss); }
.body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.nm { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sym { font-size: 15px; font-weight: 600; }
.tag { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; padding: 2px 6px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); }
.tag.short, .tag.sl { background: var(--loss-soft); color: var(--loss); }
.tag.open { background: var(--open-soft); color: var(--open); }
.tag.manual { background: var(--tile); color: var(--muted); }
.lines { display: flex; flex-direction: column; gap: 3px; font: 500 12px var(--mono); }
.lines div { display: flex; justify-content: space-between; gap: 8px; }
.lines span:first-child { color: var(--muted); }
.pl { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-family: var(--mono); }
.pl b { font-size: 14px; }
.pl span { font-size: 12px; }
.sbtn { align-self: flex-start; min-height: 30px; margin-top: 2px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--tile); color: var(--ink); font: 600 12px var(--sans); cursor: pointer; }
.sbtn:disabled { opacity: .5; cursor: default; }

/* closed trade */
.hcard { padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 12px; display: flex; flex-direction: column; gap: 4px; }
.hcard.win { border-color: var(--accent); }
.hcard.loss { border-color: var(--loss); }
.hcard.manual { border-style: dashed; }
.hcard .l1 { display: flex; align-items: center; gap: 8px; }
.hcard .lpl { margin-left: auto; font: 700 13px var(--mono); }
.hcard .l2 { font: 500 11.5px var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--border); }
.chip b { font-weight: 600; }

/* stats */
svg.chart { width: 100%; height: auto; display: block; }
.chart .base { stroke: var(--border); stroke-dasharray: 3 4; }
.chart .area { fill: var(--accent); fill-opacity: .12; animation: fade .8s ease-out .9s both; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: var(--len); animation: draw 1.4s ease-out both; }
.chart .dot { fill: var(--bg); stroke-width: 2; animation: fade .8s ease-out .9s both; }
.chart .dot.hi { stroke: var(--accent); }
.chart .dot.lo { stroke: var(--loss); }
.axis { display: flex; justify-content: space-between; font: 500 11px var(--mono); color: var(--muted); }
.donut { flex-direction: row; align-items: center; gap: 24px; padding: 16px 20px; }
.ring { position: relative; width: 132px; height: 132px; flex-shrink: 0; }
.ring .trk { fill: none; stroke: var(--border); stroke-width: 14; opacity: .5; }
.ring .g, .ring .r { fill: none; stroke-width: 14; }
.ring .g { stroke: var(--accent); animation: arc .9s ease-out .2s both; }
.ring .r { stroke: var(--loss); animation: arc .5s ease-out 1.1s both; }
.ring .mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.ring .mid b { font-size: 34px; line-height: 1; }
.legend { display: flex; flex-direction: column; gap: 14px; }
.legend > div { display: flex; align-items: center; gap: 10px; }
.legend i { width: 12px; height: 12px; border-radius: 50%; }
.legend .t { font-size: 14px; font-weight: 700; }
.legend .v { font: 500 12px var(--mono); color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tile { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tile .v { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }

/* login */
.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; gap: 32px; padding: 0 28px; max-width: 420px; margin: 0 auto; }
.login .top { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.login .logo { width: 68px; height: 68px; border-radius: 18px; animation: glow 3s ease-in-out infinite; }
.login h1 { font-size: 26px; }
.login form { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 20px; border-radius: 16px; background: var(--card); border: 1px solid var(--border); animation: page .45s ease-out both; }
.login label { font-size: 13px; color: var(--muted); }
.login input { width: 100%; height: 48px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--ink); font: 500 16px var(--mono); }
.btn { height: 48px; border: 0; border-radius: 12px; background: var(--hl); color: var(--on-hl); font: 600 15px var(--sans); cursor: pointer; }
.btn:disabled { opacity: .6; }
.err { margin: 0; font-size: 13px; color: var(--loss); min-height: 1em; }
.foot { text-align: center; font: 500 12px var(--mono); color: var(--muted); }

/* motion */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes tw { 0%, 100% { opacity: 1; } 50% { opacity: .15; } }
@keyframes page { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ants { to { stroke-dashoffset: -22; } }
@keyframes draw { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }
@keyframes arc { from { stroke-dasharray: 0 326.7; } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 24px rgba(124, 92, 255, .35); } 50% { box-shadow: 0 0 40px rgba(59, 163, 255, .55); } }
@keyframes drop { 0% { opacity: 0; transform: translateY(-22px); } 60% { opacity: 1; transform: translateY(2px); box-shadow: 0 0 0 2px var(--open), 0 0 24px var(--open); } 100% { transform: none; box-shadow: 0 0 0 0 transparent; } }
@keyframes outw { 35% { transform: scale(1.02); box-shadow: 0 0 0 2px var(--accent), 0 0 28px var(--accent); } 100% { opacity: 0; transform: translateX(110%) scale(.96); } }
@keyframes outl { 35% { transform: scale(1.02); box-shadow: 0 0 0 2px var(--loss), 0 0 28px var(--loss); } 100% { opacity: 0; transform: translateX(110%) scale(.96); } }
@keyframes outm { 100% { opacity: 0; transform: translateX(110%) scale(.96); } }
@keyframes wing { 40% { box-shadow: 0 0 0 2px var(--accent), 0 0 22px color-mix(in srgb, var(--accent) 60%, transparent); } }
@keyframes shake { 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
.in { animation: rise .5s ease-out both; }
.drop { animation: drop .9s cubic-bezier(.2, .8, .2, 1) both; }
.out-win { animation: outw .7s ease-in both; }
.out-loss { animation: outl .7s ease-in both; }
.out-manual { animation: outm .5s ease-in both; }
.hcard.win.in { animation: rise .5s ease-out both, wing 1.2s ease-out both; }
.hcard.loss.in { animation: rise .5s ease-out both, shake .5s ease-in-out both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
