/* StockVerse landing — terminal theme (selaras SpikeScan) */
:root {
  --bg: #0b0e13; --surface: #11151c; --surface-2: #171c25; --surface-3: #1d2330;
  --line: #222935; --line-strong: #2f3846;
  --text: #e7eaf0; --text-2: #aab3c2; --text-3: #6f7a8b;
  --accent: #e3ac4d; --accent-soft: #2a2314; --accent-text: #f0c46a;
  --up: #3ddc97; --down: #ff5c7a;
  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --topbar-h: 56px; --panel-w: 352px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--sans); font-size: 13.5px; line-height: 1.45; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); font-size: 12px; margin: 0; }
h3 { margin: 0; font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }

/* topbar */
.topbar { position: relative; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: 14px; padding: 0 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.brand strong { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.brand span { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; }
.topbar-status { margin-left: auto; display: inline-flex; align-items: center; gap: 9px; padding: 5px 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); font-family: var(--mono); font-size: 11.5px; color: var(--text-2); white-space: nowrap; }
.topbar-status b { color: var(--text); font-weight: 600; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex: none; }
.dot.ok { background: var(--up); box-shadow: 0 0 8px var(--up); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.btn { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--surface-2); font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; color: var(--text-2); transition: background .15s, border-color .15s, color .15s; }
.btn svg { width: 14px; height: 14px; }
.btn:hover { background: var(--surface-3); color: var(--text); border-color: var(--text-3); }
.btn-primary { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent); color: #14100a; border-color: var(--accent); }

/* hero layout */
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) var(--panel-w); height: calc(100vh - var(--topbar-h)); height: calc(100dvh - var(--topbar-h)); }
.stage { position: relative; min-width: 0; overflow: hidden; background: var(--bg); cursor: grab; }
.stage canvas { display: block; width: 100% !important; height: 100% !important; }
.stage::before { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(11,14,19,.75) 100%),
              linear-gradient(180deg, rgba(11,14,19,.55), transparent 18%, transparent 82%, rgba(11,14,19,.7)); }
.stage::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: .18;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px; mask-image: radial-gradient(ellipse at center, transparent 40%, #000 100%); -webkit-mask-image: radial-gradient(ellipse at center, transparent 40%, #000 100%); }
.hud { position: absolute; z-index: 5; left: 16px; top: 14px; display: flex; align-items: center; gap: 10px; pointer-events: none; }
.live { display: inline-flex; align-items: center; gap: 8px; height: 26px; padding: 0 11px 0 9px; border: 1px solid color-mix(in srgb, var(--up) 35%, transparent); border-radius: 999px; background: rgba(17,21,28,.85); font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--up); }
.live i { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--up); box-shadow: 0 0 8px var(--up); }
.live i::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--up); animation: radar 1.8s ease-out infinite; }
@keyframes radar { 0% { opacity: .9; transform: scale(.5); } 100% { opacity: 0; transform: scale(1.7); } }
.count { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.hint { position: absolute; z-index: 5; left: 16px; bottom: 14px; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); pointer-events: none; }
.legend { position: absolute; z-index: 5; right: 16px; bottom: 14px; display: flex; gap: 12px; font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); pointer-events: none; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 14px; height: 2px; background: var(--c); box-shadow: 0 0 6px var(--c); }
.stage-error { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; padding: 24px; text-align: center; font-family: var(--mono); font-size: 12px; color: var(--down); }

/* hover card */
.hover-card { position: absolute; z-index: 10; width: 220px; display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; align-items: center; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: rgba(17,21,28,.94); backdrop-filter: blur(8px); box-shadow: 0 10px 30px rgba(0,0,0,.5); pointer-events: none; font-size: 11.5px; }
.hover-card[hidden] { display: none; }
.hover-card b { font-family: var(--mono); font-size: 15px; letter-spacing: .04em; }
.hover-card small { grid-column: 1 / -1; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.hover-card small.num { color: var(--text-3); }

/* badge status */
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 4px; font-family: var(--mono); font-size: 9.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); white-space: nowrap; }

/* panel */
.panel { position: relative; z-index: 3; display: flex; flex-direction: column; gap: 12px; padding: 16px 18px 14px; border-left: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.link { background: none; border: 1px solid transparent; padding: 2px 7px; border-radius: 4px; color: var(--text-3); font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; }
.link:hover { color: var(--accent-text); }
.link.is-active { border-color: var(--line-strong); color: var(--accent-text); background: var(--accent-soft); }

.selected { border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); padding: 12px 13px 10px; box-shadow: 0 1px 0 rgba(255,255,255,.02) inset, 0 6px 24px rgba(0,0,0,.35); }
.sel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sel-ticker { font-family: var(--mono); font-size: 24px; font-weight: 700; letter-spacing: .02em; line-height: 1.1; }
.sel-name { margin-top: 3px; min-height: 18px; color: var(--text-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 10px; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: var(--line); }
.sel-grid > div { display: grid; gap: 2px; padding: 7px 9px; background: var(--surface); min-width: 0; }
.sel-grid span { font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.sel-grid b { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-grid b.acc { color: var(--accent-text); }
.sel-grid b.sector { font-family: var(--sans); font-size: 12px; }

.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.chip { display: flex; align-items: center; gap: 7px; min-width: 0; height: 32px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--text-3); font-size: 11.5px; opacity: .55; transition: opacity .15s, border-color .15s, background .15s; }
.chip i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--c); flex: none; }
.chip span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.chip em { font-style: normal; font-size: 10.5px; padding: 0 5px; border-radius: 3px; background: var(--surface-3); color: var(--text-2); }
.chip:hover { opacity: .85; border-color: var(--line-strong); }
.chip.is-active { opacity: 1; color: var(--text); border-color: color-mix(in srgb, var(--c) 45%, var(--line)); background: color-mix(in srgb, var(--c) 8%, var(--surface-2)); }
.chip.is-active i { background: var(--c); box-shadow: 0 0 8px var(--c); }
.chip.is-active em { color: var(--c); }

.hotlist { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.hot-item { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 2px 6px; min-width: 0; padding: 6px 8px; border: 1px solid color-mix(in srgb, var(--c) 40%, var(--line)); border-radius: 6px; background: linear-gradient(135deg, var(--surface-2), color-mix(in srgb, var(--c) 6%, var(--surface))); color: var(--text); text-align: left; transition: border-color .15s, background .15s; }
.hot-item i { grid-row: 1 / 3; font-family: var(--mono); font-style: normal; font-size: 10px; color: var(--text-3); }
.hot-item b { font-family: var(--mono); font-size: 12.5px; font-weight: 700; letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; }
.hot-item .num { font-size: 11.5px; font-weight: 600; color: var(--c); }
.hot-item small { grid-column: 2 / 4; font-size: 10px; color: var(--text-3); }
.hot-item:hover { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--surface-2)); }
.hot-item.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, 0 0 14px color-mix(in srgb, var(--accent) 25%, transparent); }
.foot-note { margin: auto 0 0; font-family: var(--mono); font-size: 10px; letter-spacing: .04em; color: var(--text-3); line-height: 1.6; }

@media (max-width: 860px) {
  body { overflow: auto; }
  .hero { grid-template-columns: 1fr; height: auto; }
  .stage { height: 62vh; min-height: 420px; }
  .panel { border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; }
  .topbar-status { margin-left: 0; order: 3; width: 100%; justify-content: center; }
  .legend { display: none; }
}
.hint-touch { display: none; }
@media (pointer: coarse) { .hint-desktop { display: none; } .hint-touch { display: inline; } }
