:root {
    --bg: #0f1117;
    --card: #1a1d29;
    --card-alt: #1e2235;
    --border: #2a2d3a;
    --text: #e4e4e7;
    --text-dim: #9ca3af;
    --green: #22c55e;
    --red: #ef4444;
    --yellow: #f59e0b;
    --blue: #3b82f6;
    --purple: #a855f7;
    --cyan: #06b6d4;
    --green-dim: #86efac;
    --red-dim: #fca5a5;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    background: var(--bg);
    color: var(--text);
    padding: 16px;
    max-width: 1500px;
    margin: 0 auto;
}

h1 { font-size: 1.4rem; margin-bottom: 4px; }
h2 { font-size: 1rem; margin-bottom: 8px; color: var(--text-dim); font-weight: normal; }
h3 { font-size: 0.95rem; margin-bottom: 6px; }

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.header .updated { font-size: 0.8rem; color: var(--text-dim); }

/* Grid layouts */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }

/* Card */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}

/* Price cards */
.price-card { text-align: center; }
.price-card .price { font-size: 1.6rem; font-weight: bold; }
.price-card .pair-name { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 4px; }
.price-card .change { font-size: 0.9rem; margin-top: 4px; }

.up { color: var(--green); }
.down { color: var(--red); }
.neutral { color: var(--yellow); }

/* Version badge */
.version-badge {
    font-size: 0.75rem;
    font-weight: bold;
    background: rgba(59,130,246,0.2);
    color: var(--blue);
    border: 1px solid var(--blue);
    border-radius: 10px;
    padding: 1px 8px;
    vertical-align: middle;
    margin-left: 6px;
}

/* ============================================================
   Consensus Matrix
   ============================================================ */
.consensus-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.consensus-table th,
.consensus-table td {
    padding: 8px 10px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}
.consensus-table th {
    color: var(--text-dim);
    font-weight: normal;
    font-size: 0.75rem;
}
.consensus-table th:first-child,
.consensus-table td:first-child {
    text-align: left;
    font-weight: bold;
}
.consensus-table tr:last-child td {
    border-top: 2px solid var(--border);
    font-weight: bold;
    font-size: 0.9rem;
}

/* Signal badges */
.signal-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: bold;
    letter-spacing: 0.3px;
}
.signal-BULLISH { background: rgba(34,197,94,0.2); color: var(--green); border: 1px solid var(--green); }
.signal-BEARISH { background: rgba(239,68,68,0.2); color: var(--red); border: 1px solid var(--red); }
.signal-NEUTRAL { background: rgba(245,158,11,0.15); color: var(--yellow); border: 1px solid var(--yellow); }

/* Confidence bar */
.conf-bar {
    display: inline-block;
    height: 4px;
    border-radius: 2px;
    margin-top: 3px;
    opacity: 0.7;
}

/* ============================================================
   Fear & Greed Gauge
   ============================================================ */
.fg-gauge {
    position: relative;
    width: 200px;
    height: 110px;
    margin: 0 auto;
}
.fg-gauge canvas {
    width: 200px;
    height: 110px;
}
.fg-value {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    font-weight: bold;
}
.fg-label {
    text-align: center;
    font-size: 0.85rem;
    margin-top: 4px;
    font-weight: bold;
}

/* Sentiment card */
.sentiment-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.sentiment-item {
    text-align: center;
    min-width: 140px;
}
.sentiment-item .label { font-size: 0.75rem; color: var(--text-dim); margin-bottom: 4px; }
.sentiment-item .value { font-size: 1.1rem; font-weight: bold; }

/* ============================================================
   Analysis Method Cards
   ============================================================ */
.method-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    position: relative;
}
.method-card .method-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.method-card .method-name {
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--text-dim);
}
.method-card .method-signal {
    font-size: 1.1rem;
    font-weight: bold;
}

.method-reasons {
    font-size: 0.75rem;
    line-height: 1.5;
}
.method-reasons .bull { color: var(--green-dim); }
.method-reasons .bear { color: var(--red-dim); }

.method-details {
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-dim);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 12px;
}
.method-details .val { text-align: right; color: var(--text); }

/* Pair section */
.pair-section {
    margin-bottom: 20px;
}
.pair-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: var(--card-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 10px;
}
.pair-section-header .pair-title {
    font-size: 1.1rem;
    font-weight: bold;
}
.pair-section-header .pair-consensus {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Method grid */
.method-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

/* Chart container */
.chart-container { position: relative; height: 280px; }
.chart-container-sm { position: relative; height: 200px; }

/* Cross card */
.cross-card {
    background: linear-gradient(135deg, var(--card) 0%, #1e2235 100%);
    border: 1px solid var(--blue);
    text-align: center;
    padding: 20px;
}
.cross-card .verdict { font-size: 1.1rem; margin-top: 8px; }

/* Loading */
.loading {
    text-align: center;
    padding: 60px;
    color: var(--text-dim);
}
.loader {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.changelog-link {
    font-size: 0.9rem;
    text-decoration: none;
    vertical-align: middle;
    margin-left: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.changelog-link:hover { opacity: 1; }

/* Responsive */
@media (max-width: 1100px) {
    .grid-3 { grid-template-columns: 1fr 1fr; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .method-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
    .grid-3, .grid-2, .grid-4 { grid-template-columns: 1fr; }
    .method-grid { grid-template-columns: 1fr; }
    body { padding: 8px; }
    .price-card .price { font-size: 1.2rem; }
    .sentiment-row { flex-direction: column; }
}
