/* Clark Moody Bitcoin Style */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: #ffffff;
    color: #24292f;
    line-height: 1.6;
    font-size: 14px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    border-bottom: 1px solid #d1d5da;
    padding: 20px 0;
    margin-bottom: 30px;
    position: relative;
}

header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #24292f;
    margin-bottom: 8px;
}

header p {
    font-size: 16px;
    color: #57606a;
    font-weight: 400;
}

.connection-status {
    position: absolute;
    top: 25px;
    right: 20px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #dc3545; /* Red by default (disconnected) */
    transition: background-color 0.3s ease;
}

.connection-status.connected {
    background: #28a745; /* Green when connected */
    animation: pulse 2s infinite;
}

.connection-status.connecting {
    background: #ffc107; /* Yellow when connecting */
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid #d1d5da;
    border-radius: 6px;
    padding: 20px;
    text-align: center;
    transition: border-color 0.2s ease;
}

.stat-card:hover {
    border-color: #0969da;
}

.stat-card h3 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #57606a;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 32px;
    font-weight: 600;
    color: #24292f;
    font-feature-settings: 'tnum';
}

/* Winner modifiers removed; fallback uses base .stat-number color */

/* Force trend leader text to match default widget text color */
.stat-card.race-leader .stat-number {
    color: #24292f;
}

.stat-card.race-leader .leader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.leader-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/* Battle Widget */
.battle-widget {
    background: #ffffff;
    border: 1px solid #d1d5da;
    border-radius: 6px;
    padding: 24px;
    margin-bottom: 30px;
}

.battle-widget h2 {
    font-size: 18px;
    font-weight: 600;
    color: #24292f;
    margin-bottom: 8px;
}

.battle-subtitle {
    font-size: 14px;
    color: #57606a;
    margin-bottom: 24px;
}

.battle-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.battle-participant {
    text-align: center;
    flex: 1;
}

/* Implementation-specific participant colors removed; fallback is inherited text color */

.battle-stats.three-way {
    justify-content: space-around;
}

.battle-vs {
    font-size: 14px;
    font-weight: 600;
    color: #57606a;
    margin: 0 20px;
}

.battle-logo {
    margin-bottom: 12px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.battle-logo img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.battle-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.battle-count {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
    font-feature-settings: 'tnum';
}

.battle-percentage {
    font-size: 16px;
    font-weight: 500;
    color: #57606a;
    font-feature-settings: 'tnum';
}

.battle-bar {
    height: 8px;
    background: #f6f8fa;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 16px;
    display: flex;
}

.battle-progress {
    height: 100%;
    transition: width 0.3s ease;
    background: #d1d5da; /* Generic fallback until config-driven color arrives */
}
/* Implementation-specific progress colors removed; JS sets backgroundColor per config */

.battle-total {
    text-align: center;
    font-size: 12px;
    color: #57606a;
    font-weight: 500;
}

/* Charts Container */
.charts-container {
    margin-bottom: 30px;
}

.chart-section {
    background: #ffffff;
    border: 1px solid #d1d5da;
    border-radius: 6px;
    padding: 24px;
}

.chart-section h2 {
    font-size: 18px;
    font-weight: 600;
    color: #24292f;
    margin-bottom: 20px;
}

.implementation-list {
    /* No scroll - show all implementations */
}

.implementation-item {
    padding: 12px 0;
    border-bottom: 1px solid #d1d5da;
}

.implementation-item:last-child {
    border-bottom: none;
}

/* Collapsible UI removed */

.implementation-item.minor {
    padding: 8px 0;
    font-size: 12px;
}

.implementation-item.minor .implementation-name {
    font-size: 13px;
}

.implementation-item.minor .implementation-stats {
    font-size: 11px;
}

.implementation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.implementation-name {
    font-weight: 600;
    font-size: 14px;
    color: #24292f;
}

.implementation-stats {
    font-size: 12px;
    color: #57606a;
    font-feature-settings: 'tnum';
}

.progress-bar {
    height: 6px;
    background: #f6f8fa;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #d1d5da;
    transition: width 0.3s ease;
}

/* Recent Nodes */
.recent-nodes {
    background: #ffffff;
    border: 1px solid #d1d5da;
    border-radius: 6px;
    margin-bottom: 30px;
}

.recent-nodes h2 {
    font-size: 18px;
    font-weight: 600;
    color: #24292f;
    padding: 20px 24px 0;
    margin-bottom: 16px;
}

.nodes-table {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

thead th {
    background: #f6f8fa;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #24292f;
    border-bottom: 1px solid #d1d5da;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #d1d5da;
    color: #24292f;
}

tbody tr:hover {
    background: #f6f8fa;
}

.node-address {
    font-family: 'SF Mono', Monaco, Inconsolata, 'Roboto Mono', monospace;
    font-size: 11px;
}

.user-agent {
    font-family: 'SF Mono', Monaco, Inconsolata, 'Roboto Mono', monospace;
    font-size: 11px;
    color: #0969da;
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.status-badge.active {
    background: #dafbe1;
    color: #1a7f37;
}

.status-badge.explored {
    background: #fff8c5;
    color: #9a6700;
}

.timestamp {
    color: #57606a;
    font-size: 11px;
}


/* Footer */
footer {
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid #d1d5da;
    margin-top: 40px;
}

footer p {
    font-size: 14px;
    color: #57606a;
}

.bitcoin-address {
    font-family: 'SF Mono', Monaco, Inconsolata, 'Roboto Mono', monospace;
    font-size: 13px;
    color: #f7931e;
    text-decoration: none;
    padding: 4px 8px;
    background: #fff8e1;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.bitcoin-address:hover {
    background: #f7931e;
    color: #ffffff;
    text-decoration: none;
}

/* Donation Buttons */
.donation-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.donation-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 9999px;
    border: 1px solid #d1d5da;
    background: #ffffff;
    color: #24292f;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.donation-button:hover {
    background: #f6f8fa;
    border-color: #b9c1c9;
}

.donation-button:active {
    transform: translateY(1px);
}

.donation-button:focus-visible {
    outline: 2px solid #0969da;
    outline-offset: 2px;
}

.donation-button .donation-icon {
    font-size: 14px;
    line-height: 1;
}

.bitcoin-button {
    border-color: #f7931e;
    color: #bf6d12;
}

.bitcoin-button:hover {
    background: #fff4e5;
    border-color: #f7931e;
}

.lightning-button {
    border-color: #f2c94c;
    color: #6b4f00;
}

.lightning-button:hover {
    background: #fff9db;
    border-color: #f2c94c;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    header {
        padding: 16px 0;
        margin-bottom: 20px;
    }
    
    header h1 {
        font-size: 24px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .battle-stats {
        flex-direction: column;
        gap: 20px;
    }
    
    .battle-vs {
        order: 1;
        margin: 0;
    }
    
    .stat-number {
        font-size: 28px;
    }
    
    .battle-count {
        font-size: 20px;
    }
    
    table {
        font-size: 11px;
    }
    
    thead th,
    tbody td {
        padding: 8px 12px;
    }
    
    .bitcoin-address {
        font-size: 11px;
        display: inline-block;
        word-break: break-all;
        max-width: 90%;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d1d5da;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #586069;
}