/* ============================================================
   SUPERNOVA — Trading Terminal CSS V4
   16:9 single-page, no-scroll dashboard
   Premium glassmorphism dark theme
   ============================================================ */

/* Login overlay — all styles inline in index.html */
#login-overlay.hidden { display: none !important; }

:root {
    /* Core palette */
    --bg-deep: #050510;
    --bg-primary: #0a0a1a;
    --bg-secondary: #0f0f23;
    --bg-card: rgba(15, 15, 35, 0.6);
    --bg-card-solid: #12122a;
    --bg-hover: rgba(99, 102, 241, 0.08);

    /* Glass */
    --glass-bg: rgba(15, 15, 35, 0.45);
    --glass-border: rgba(99, 102, 241, 0.15);
    --glass-shadow: rgba(0, 0, 0, 0.4);

    /* Text */
    --text-primary: #e8eaed;
    --text-secondary: #7a7f9a;
    --text-muted: #4a4f6a;

    /* Accents */
    --accent-green: #10b981;
    --accent-green-glow: rgba(16, 185, 129, 0.4);
    --accent-red: #ef4444;
    --accent-red-glow: rgba(239, 68, 68, 0.4);
    --accent-amber: #f59e0b;
    --accent-amber-glow: rgba(245, 158, 11, 0.3);
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-cyan-glow: rgba(6, 182, 212, 0.3);
    --accent-purple: #8b5cf6;
    --accent-purple-glow: rgba(139, 92, 246, 0.3);
    --accent-indigo: #6366f1;
    --accent-indigo-glow: rgba(99, 102, 241, 0.3);

    /* Gradients */
    --grad-primary: linear-gradient(135deg, #6366f1, #06b6d4);
    --grad-green: linear-gradient(135deg, #10b981, #06b6d4);
    --grad-red: linear-gradient(135deg, #ef4444, #f59e0b);
    --grad-purple: linear-gradient(135deg, #8b5cf6, #6366f1);

    /* Sizing */
    --header-h: 40px;
    --footer-h: 26px;
    --radius: 10px;
    --radius-sm: 6px;
    --gap: 8px;
}

/* ---- Reset ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100vh;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.4;
    display: flex;
    flex-direction: column;
}

/* ---- Animated Background ---- */
#bg-grid {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}

.bg-glow {
    position: fixed;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.12;
    pointer-events: none;
    z-index: 0;
}

#bg-glow-1 {
    background: var(--accent-indigo);
    top: -200px;
    left: -100px;
    animation: glowFloat1 20s ease-in-out infinite;
}

#bg-glow-2 {
    background: var(--accent-cyan);
    bottom: -200px;
    right: -100px;
    animation: glowFloat2 25s ease-in-out infinite;
}

@keyframes glowFloat1 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(100px, 80px); }
    66% { transform: translate(-50px, 120px); }
}

@keyframes glowFloat2 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(-80px, -60px); }
    66% { transform: translate(60px, -100px); }
}

/* ---- Glass Card ---- */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: 0 4px 20px var(--glass-shadow);
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}

/* Golden double-border on hover */
.glass-card::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--radius) + 2px);
    border: 1.5px solid transparent;
    background: linear-gradient(135deg, rgba(245,158,11,0.5), rgba(234,179,8,0.3), rgba(245,158,11,0.5)) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.glass-card:hover::after { opacity: 1; }
.glass-card:hover {
    border-color: rgba(245, 158, 11, 0.25);
    box-shadow: 0 4px 24px rgba(245, 158, 11, 0.08), 0 8px 40px rgba(99, 102, 241, 0.06);
    transform: translateY(-1px);
}

/* Wallet glow pulse */
.wallet-glow { animation: walletGlow 1s ease-out; }
@keyframes walletGlow {
    0% { text-shadow: 0 0 20px var(--accent-green-glow), 0 0 40px var(--accent-green-glow); }
    100% { text-shadow: none; }
}
.wallet-loss-glow { animation: walletLossGlow 0.8s ease-out; }
@keyframes walletLossGlow {
    0% { text-shadow: 0 0 15px var(--accent-red-glow); }
    100% { text-shadow: none; }
}

/* Win streak badge */
.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    background: linear-gradient(135deg, rgba(16,185,129,0.2), rgba(6,182,212,0.2));
    border: 1px solid rgba(16,185,129,0.3);
    color: var(--accent-green);
    animation: streakPulse 2s ease-in-out infinite;
}
@keyframes streakPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.3); }
    50% { box-shadow: 0 0 10px 3px rgba(16,185,129,0.15); }
}

/* Card shine sweep */
@keyframes shineSweep {
    0% { left: -100%; }
    100% { left: 200%; }
}
.card-shine {
    position: absolute;
    top: 0;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
    transform: skewX(-20deg);
    pointer-events: none;
    animation: shineSweep 0.8s ease-out;
}

/* ---- HEADER ---- */
header {
    flex-shrink: 0;
    height: var(--header-h);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: rgba(10, 10, 26, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--glass-border);
}

.header-left, .header-center, .header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.header-left { flex: 1; }
.header-center { flex: 0 0 auto; }
.header-right { flex: 1; justify-content: flex-end; }

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo-icon {
    display: flex;
    animation: logoSpin 30s linear infinite;
}
@keyframes logoSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}
.logo-title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 2px;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.logo-sub {
    font-size: 8px;
    font-weight: 500;
    letter-spacing: 3px;
    color: var(--text-muted);
}

/* Header Profit */
.header-profit {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 8px;
    background: rgba(15, 15, 35, 0.5);
    border: 1px solid var(--glass-border);
}
.header-profit-label {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}
.header-profit-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    transition: color 0.3s;
}
.header-profit-value.positive {
    color: var(--accent-green);
    text-shadow: 0 0 10px var(--accent-green-glow);
}
.header-profit-value.negative {
    color: var(--accent-red);
    text-shadow: 0 0 10px var(--accent-red-glow);
}
.header-profit-value.neutral { color: var(--text-muted); }
.header-profit.profit-up {
    border-color: rgba(16, 185, 129, 0.25);
    background: rgba(16, 185, 129, 0.06);
}
.header-profit.profit-down {
    border-color: rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.04);
}

/* Clock */
.live-clock {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.1;
}
#clock-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
#clock-date {
    font-size: 9px;
    color: var(--text-muted);
}

/* Connection badge */
.conn-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 16px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    border: 1px solid;
}
.conn-badge.online {
    border-color: var(--accent-green);
    color: var(--accent-green);
    background: rgba(16, 185, 129, 0.1);
}
.conn-badge.offline {
    border-color: var(--accent-red);
    color: var(--accent-red);
    background: rgba(239, 68, 68, 0.1);
}
.conn-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}
.conn-badge.online .conn-dot {
    animation: dotPulse 2s ease-in-out infinite;
    box-shadow: 0 0 6px var(--accent-green-glow);
}
@keyframes dotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.mode-badge {
    padding: 3px 10px;
    border-radius: 16px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.5px;
    background: var(--grad-primary);
    color: white;
}

.uptime-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.1;
}
.uptime-label {
    font-size: 8px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 1px;
}
.uptime-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ---- MAIN 3-COLUMN GRID ---- */
main {
    flex: 1;
    min-height: 0;
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 260px 1fr 240px;
    gap: var(--gap);
    padding: var(--gap);
    overflow: hidden;
}

h2 {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* ---- LEFT PANEL ---- */
.panel-left {
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    min-height: 0;
    overflow: hidden;
}

/* Signal Card */
.signal-card {
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}

.signal-glow {
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}
.signal-card.safe-state .signal-glow {
    opacity: 1;
    box-shadow: inset 0 0 40px var(--accent-green-glow), 0 0 30px var(--accent-green-glow);
    animation: safeBreathing 2s ease-in-out infinite;
}
@keyframes safeBreathing {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}
.signal-card.skip-state { border-color: rgba(122, 127, 154, 0.15); }
.signal-card.safe-state { border-color: rgba(16, 185, 129, 0.4); }

.signal-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    z-index: 1;
}
.signal-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-muted);
}
.signal-text {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 3px;
    transition: color 0.3s;
}
.signal-card.safe-state .signal-text {
    color: var(--accent-green);
    text-shadow: 0 0 20px var(--accent-green-glow);
}
.signal-card.skip-state .signal-text { color: var(--text-muted); }
.signal-direction {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

/* Signal Ring (EV gauge) */
.signal-ring {
    position: relative;
    width: 88px;
    height: 88px;
    z-index: 1;
    flex-shrink: 0;
}
.signal-ring svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}
.ring-bg {
    fill: none;
    stroke: rgba(99, 102, 241, 0.1);
    stroke-width: 5;
}
.ring-fill {
    fill: none;
    stroke: url(#logo-grad);
    stroke-width: 5;
    stroke-linecap: round;
    stroke-dasharray: 339.29;
    stroke-dashoffset: 339.29;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.ring-value, .ring-label {
    position: absolute;
    left: 50%;
    text-align: center;
    white-space: nowrap;
}
.ring-value {
    top: 50%;
    transform: translate(-50%, -60%);
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}
.ring-label {
    top: 50%;
    transform: translate(-50%, 40%);
    font-size: 8px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 2px;
}

/* Metrics panel */
.metrics-panel {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}
.mc-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.mc-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.mc-dot.up { background: var(--accent-green); }
.mc-dot.cyan { background: var(--accent-cyan); }
.mc-dot.warn { background: var(--accent-amber); }
.mc-dot.neutral { background: var(--accent-indigo); }
.mc-dot.purple { background: var(--accent-purple); }
.mc-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    flex: 1;
}
.mc-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    text-align: right;
}
.mc-bar-wrap {
    width: 100%;
    height: 2px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 1px;
    overflow: hidden;
    margin-top: 2px;
}
.metric-bar {
    height: 100%;
    border-radius: 1px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}
.metric-bar.time { background: var(--grad-primary); }
.metric-bar.vol { background: var(--grad-red); }
.metric-bar.buffer { background: var(--grad-green); }

/* Capital section */
.capital-section {
    padding: 10px 12px;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.capital-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.pnl-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
}
.pnl-badge.positive { color: var(--accent-green); background: rgba(16, 185, 129, 0.15); }
.pnl-badge.negative { color: var(--accent-red); background: rgba(239, 68, 68, 0.15); }
.pnl-badge.neutral { color: var(--text-muted); background: rgba(99, 102, 241, 0.1); }

.capital-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    flex: 1;
}
.cap-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: rgba(99, 102, 241, 0.04);
    border: 1px solid rgba(99, 102, 241, 0.08);
    transition: background 0.2s;
}
.cap-item:hover { background: rgba(99, 102, 241, 0.08); }
.cap-item.primary {
    grid-column: 1 / -1;
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.2);
}
.cap-label {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1.5px;
}
.cap-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px;
    font-weight: 700;
}
.cap-item.primary .cap-value {
    font-size: 20px;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Wallet progress bar */
.wallet-progress-wrap {
    width: 100%;
    height: 4px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}
.wallet-progress-bar {
    height: 100%;
    border-radius: 2px;
    background: var(--grad-primary);
    transition: width 0.6s ease, background 0.3s;
    min-width: 0;
}
.wallet-progress-bar.danger {
    background: linear-gradient(90deg, #ef4444, #f97316);
}
.wallet-progress-bar.warning {
    background: linear-gradient(90deg, #f59e0b, #eab308);
}
.wallet-pct-label {
    font-size: 8px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-top: 1px;
}

/* Capital on-chain item */
.cap-capital {
    border-color: rgba(16, 185, 129, 0.15) !important;
    background: rgba(16, 185, 129, 0.04) !important;
}
.cap-capital .cap-value {
    color: var(--accent-green);
}
.capital-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-green);
    margin-left: 3px;
    vertical-align: middle;
    animation: dotPulse 2s ease-in-out infinite;
}
.capital-dot.offline {
    background: var(--accent-red);
    animation: none;
}

/* ---- CENTER PANEL ---- */
.panel-center {
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    min-height: 0;
    overflow: hidden;
}

/* Price Chart — single unified chart fills the center */
.chart-main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px 0;
    flex-shrink: 0;
}
.chart-header.compact {
    padding: 8px 12px 0;
}
.chart-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.chart-pair {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}
.chart-live-price {
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}
.chart-change {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
}
.chart-change.positive { color: var(--accent-green); background: rgba(16, 185, 129, 0.1); }
.chart-change.negative { color: var(--accent-red); background: rgba(239, 68, 68, 0.1); }
.chart-change.neutral { color: var(--text-muted); background: rgba(99, 102, 241, 0.05); }

.chart-controls { display: flex; gap: 3px; }
.chart-btn {
    padding: 3px 10px;
    border-radius: 5px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.chart-btn:hover { background: var(--bg-hover); }
.chart-btn.active {
    background: var(--accent-indigo);
    color: white;
    border-color: var(--accent-indigo);
}

.chart-body {
    flex: 1;
    min-height: 0;
    padding: 4px 10px 10px;
    position: relative;
}
/* TradingView Lightweight Charts container */
#main-chart {
    overflow: hidden;
}

/* PnL badge colors (used elsewhere) */
.pnl-positive { color: var(--accent-green) !important; }
.pnl-negative { color: var(--accent-red) !important; }
.pnl-neutral { color: var(--text-muted) !important; }

/* Chart legend items */
.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 14px;
}
.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.dot-binance {
    background: #e8eaed;
    box-shadow: 0 0 6px rgba(232, 234, 237, 0.5);
}
.dot-pyth {
    background: #3b82f6;
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.5);
}
.dot-btc {
    background: #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
}
.chart-spread {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-cyan);
    padding: 1px 8px;
    border-radius: 4px;
    background: rgba(6, 182, 212, 0.1);
}
.chart-right-group {
    display: flex;
    align-items: center;
    gap: 10px;
}
.chart-window-selector {
    display: flex;
    gap: 2px;
    background: rgba(15, 15, 40, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 2px;
}
.window-btn {
    padding: 3px 10px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
}
.window-btn:hover {
    color: var(--text-secondary);
    background: rgba(99, 102, 241, 0.1);
}
.window-btn.active {
    background: var(--accent-indigo);
    color: #fff;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}

/* ---- RIGHT PANEL ---- */
.panel-right {
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    min-height: 0;
    overflow: hidden;
}

.market-card { padding: 10px 12px; flex-shrink: 0; }
.market-pair-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.market-coin {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 1px;
}
.market-price {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 600;
}
.sparkline-container {
    height: 32px;
    margin: 4px 0;
}
.sparkline { width: 100%; height: 100%; }
.market-change {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
}
.market-change.positive { color: var(--accent-green); }
.market-change.negative { color: var(--accent-red); }
.market-change.neutral { color: var(--text-muted); }

.market-card.compact {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.compact-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.compact-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
}
.compact-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
}
.vol-bar-wrap {
    height: 2px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 1px;
    overflow: hidden;
}

/* Gauges 2x2 grid */
.gauges-grid {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: var(--gap);
}
.gauge-card {
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.gauge-container {
    position: relative;
    width: 52px;
    height: 52px;
}
.gauge-svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}
.gauge-bg {
    fill: none;
    stroke: rgba(99, 102, 241, 0.12);
    stroke-width: 5;
}
.gauge-card:hover .gauge-fill {
    filter: drop-shadow(0 0 8px currentColor);
}
.gauge-fill {
    fill: none;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-dasharray: 263.89;
    stroke-dashoffset: 263.89;
    transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 4px currentColor);
}
.gauge-center {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gauge-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    transform-origin: center center;
    will-change: transform;
}
.gauge-label {
    font-size: 8px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    text-align: center;
}

/* ---- FOOTER ---- */
footer {
    flex-shrink: 0;
    height: var(--footer-h);
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    border-top: 1px solid var(--glass-border);
    background: rgba(10, 10, 26, 0.6);
}
.footer-brand {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 1px;
}
.footer-ws {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    color: var(--text-muted);
}
.ws-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent-red);
}
.demo-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-amber);
    border: 1px solid rgba(245, 158, 11, 0.3);
    animation: demoPulse 3s ease-in-out infinite;
}
@keyframes demoPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ---- HELP TOOLTIP SYSTEM ---- */
/* ---- Help Mode Toggle Button ---- */
.help-toggle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.help-toggle:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--accent-indigo);
    color: var(--text-primary);
}
.help-toggle.active {
    background: var(--accent-indigo);
    border-color: var(--accent-indigo);
    color: #fff;
    box-shadow: 0 0 14px var(--accent-indigo-glow), 0 0 30px rgba(99, 102, 241, 0.15);
    animation: helpPulse 2s ease-in-out infinite;
}
@keyframes helpPulse {
    0%, 100% { box-shadow: 0 0 14px var(--accent-indigo-glow); }
    50% { box-shadow: 0 0 20px var(--accent-indigo-glow), 0 0 40px rgba(99, 102, 241, 0.2); }
}

/* ---- Help Mode: Card Glow on Hover ---- */
body.help-mode [data-help] {
    cursor: help;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
body.help-mode [data-help]:hover {
    border-color: rgba(99, 102, 241, 0.5) !important;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.15), 0 4px 20px var(--glass-shadow) !important;
}

/* ---- Help Tooltip Floating Bubble ---- */
#help-bubble {
    position: fixed;
    z-index: 9999;
    width: 240px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(12, 12, 35, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(99, 102, 241, 0.35);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(99, 102, 241, 0.12);
    font-size: 11px;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.55;
    letter-spacing: 0.2px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
#help-bubble.visible {
    opacity: 1;
    transform: translateY(0);
}
#help-bubble .hb-title {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-indigo);
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.15);
}
#help-bubble .hb-line {
    display: block;
    padding-left: 10px;
    position: relative;
    margin-bottom: 3px;
}
#help-bubble .hb-line::before {
    content: '\2022';
    position: absolute;
    left: 0;
    color: var(--accent-indigo);
}

.hidden { display: none !important; }

/* Number pop animation */
@keyframes numberPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.06); }
    100% { transform: scale(1); }
}
.number-updated { animation: numberPop 0.25s ease-out; }

/* Flash effects */
@keyframes flashGreen {
    0% { background: rgba(16, 185, 129, 0.2); }
    100% { background: transparent; }
}
@keyframes flashRed {
    0% { background: rgba(239, 68, 68, 0.2); }
    100% { background: transparent; }
}
.flash-green { animation: flashGreen 0.5s ease-out; }
.flash-red { animation: flashRed 0.5s ease-out; }

/* ---- CONTROLS SECTION ---- */
.controls-section {
    padding: 8px 12px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ctrl-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.ctrl-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.ctrl-label {
    font-size: 8px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1.5px;
}
.ctrl-status {
    font-size: 10px;
    font-weight: 600;
    transition: color 0.3s;
}
.ctrl-status.active { color: var(--accent-green); }
.ctrl-status.killed { color: var(--accent-red); }
.ctrl-address {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ctrl-balance {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-cyan);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Toggle Switch */
.toggle-switch {
    width: 40px;
    height: 22px;
    border-radius: 11px;
    background: rgba(239, 68, 68, 0.3);
    border: 1px solid rgba(239, 68, 68, 0.4);
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}
.toggle-switch.active {
    background: rgba(16, 185, 129, 0.3);
    border-color: rgba(16, 185, 129, 0.4);
}
.toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-red);
    transition: all 0.3s ease;
    box-shadow: 0 0 8px var(--accent-red-glow);
}
.toggle-switch.active .toggle-knob {
    left: 20px;
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green-glow);
}

/* Mode badge clickable */
.mode-badge {
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}
.mode-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}
.mode-badge.live-mode {
    background: linear-gradient(135deg, #10b981, #06b6d4);
    animation: liveModePulse 2s ease-in-out infinite;
}
@keyframes liveModePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.3); }
    50% { box-shadow: 0 0 12px 4px rgba(16, 185, 129, 0.2); }
}

/* Polymarket badge */
.poly-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 16px;
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border: 1px solid;
    transition: all 0.3s;
    white-space: nowrap;
}
.poly-badge.offline {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
    color: var(--accent-purple);
}
.poly-badge.online {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--accent-green);
}
.poly-balance {
    font-size: 9px;
    font-weight: 600;
    opacity: 0.9;
    margin-left: 2px;
}

/* Capital header right */
.capital-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Settings button */
.settings-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}
.settings-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    border-color: var(--accent-indigo);
    transform: rotate(30deg);
}

/* ---- SETTINGS MODAL ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 5, 16, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.modal-card {
    width: 340px;
    padding: 0;
    border-radius: 14px;
    background: var(--glass-bg) !important;
    border: 1px solid rgba(99, 102, 241, 0.25) !important;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px 10px;
    border-bottom: 1px solid var(--glass-border);
}
.modal-header h2 {
    font-size: 13px;
    letter-spacing: 1px;
}
.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}
.modal-close:hover { color: var(--accent-red); }
.modal-body {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.setting-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.setting-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.setting-hint {
    font-size: 9px;
    color: var(--text-muted);
    line-height: 1.3;
}
.setting-input {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(10, 10, 26, 0.6);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.setting-input:focus {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}
.setting-input::-webkit-inner-spin-button { opacity: 0.3; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 18px 14px;
    border-top: 1px solid var(--glass-border);
}
.modal-btn {
    padding: 6px 18px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    letter-spacing: 0.5px;
}
.modal-btn.cancel {
    background: transparent;
    border-color: var(--glass-border);
    color: var(--text-muted);
}
.modal-btn.cancel:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
}
.modal-btn.apply {
    background: var(--grad-primary);
    color: white;
    border: none;
}
.modal-btn.apply:hover {
    box-shadow: 0 0 16px var(--accent-indigo-glow);
    transform: translateY(-1px);
}

/* Vault transfer flash */
@keyframes vaultFlash {
    0% { box-shadow: inset 0 0 30px rgba(6, 182, 212, 0.4), 0 0 20px rgba(6, 182, 212, 0.3); border-color: var(--accent-cyan); }
    100% { box-shadow: none; border-color: rgba(99, 102, 241, 0.08); }
}
.vault-transfer { animation: vaultFlash 1.2s ease-out; }

