/* ==========================================
   CSS Variables & Reset
   ========================================== */
:root {
    --bg-dark:       #0a0e17;
    --bg-card:       #111827;
    --bg-card-hover: #1a2235;
    --bg-header:     #0d1117;
    --border:        #1e293b;
    --border-light:  #2d3748;
    --text-primary:  #e2e8f0;
    --text-secondary:#94a3b8;
    --text-muted:    #64748b;
    --accent:        #3b82f6;
    --accent-hover:  #2563eb;
    --accent-glow:   rgba(59, 130, 246, 0.15);
    --green:         #10b981;
    --green-bg:      rgba(16, 185, 129, 0.1);
    --red:           #ef4444;
    --red-bg:        rgba(239, 68, 68, 0.1);
    --yellow:        #f59e0b;
    --yellow-bg:     rgba(245, 158, 11, 0.1);
    --purple:        #8b5cf6;
    --radius:        12px;
    --radius-sm:     8px;
    --shadow:        0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -2px rgba(0,0,0,0.2);
    --shadow-lg:     0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -4px rgba(0,0,0,0.3);
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans SC', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}
a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    color: var(--accent-hover);
}
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}
/* ==========================================
   Header
   ========================================== */
.header {
    background: var(--bg-header);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px 0;
}
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}
.logo:hover { color: var(--accent); }
.logo-icon { font-size: 1.5rem; }
.nav {
    display: flex;
    gap: 4px;
}
.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}
.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}
.nav-link.active {
    color: var(--accent);
    background: var(--accent-glow);
}
.coin-selector {
    margin-left: auto;
}
.coin-selector select {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
}
.coin-selector select:focus {
    border-color: var(--accent);
}
/* Search bar */
.search-bar {
    display: flex;
    gap: 8px;
    padding-bottom: 16px;
}
.search-input {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    outline: none;
    transition: border-color 0.2s;
}
.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.search-input::placeholder {
    color: var(--text-muted);
}
.search-btn {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
.search-btn:hover {
    background: var(--accent-hover);
}
/* ==========================================
   Coin Banner
   ========================================== */
.coin-banner {
    background: linear-gradient(135deg, rgba(59,130,246,0.08) 0%, rgba(139,92,246,0.08) 100%);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
}
.coin-banner-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.coin-badge {
    font-weight: 700;
    font-size: 1.1rem;
}
.coin-algo, .coin-fee {
    color: var(--text-secondary);
    font-size: 0.85rem;
    background: var(--bg-card);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
}
/* ==========================================
   Main Content
   ========================================== */
.main {
    padding: 24px 20px;
}
/* ==========================================
   Stats Grid
   ========================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.stats-grid--3 {
    grid-template-columns: repeat(3, 1fr);
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.2s;
}
.stat-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.stat-card--primary {
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(59,130,246,0.05) 100%);
}
.stat-card__header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.stat-card__icon {
    font-size: 1.2rem;
}
.stat-card__title {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.stat-card__value {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.2;
}
.stat-card__sub {
    color: var(--text-muted);
    font-size: 0.85rem;
}
.stat-card__sub strong {
    color: var(--text-secondary);
}
/* ==========================================
   Two Column Layout
   ========================================== */
.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}
/* ==========================================
   Panel
   ========================================== */
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
    overflow: hidden;
}
.panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.panel__header h2 {
    font-size: 1.05rem;
    font-weight: 600;
}
.panel__link {
    font-size: 0.85rem;
    color: var(--accent);
}
.panel__meta {
    color: var(--text-muted);
    font-size: 0.85rem;
}
.panel__body {
    padding: 0;
}
.panel__body > .empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}
/* ==========================================
   Table
   ========================================== */
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.88rem;
}
.table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}
.table td {
    border-bottom: 1px solid rgba(30, 41, 59, 0.5);
}
.table tbody tr:hover {
    background: var(--bg-card-hover);
}
.table tbody tr:last-child td {
    border-bottom: none;
}
.table-full {
    /* Full-width table variant */
}
/* ==========================================
   Info Table (key-value)
   ========================================== */
.info-table {
    width: 100%;
    border-collapse: collapse;
}
.info-table th,
.info-table td {
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.info-table th {
    color: var(--text-muted);
    font-weight: 500;
    width: 160px;
    white-space: nowrap;
}
.info-table tr:last-child th,
.info-table tr:last-child td {
    border-bottom: none;
}
/* ==========================================
   Utility Classes
   ========================================== */
.mono {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.85rem;
}
.full-address {
    word-break: break-all;
    font-size: 0.82rem;
    color: var(--text-secondary);
}
.addr-link {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
}
.hashrate {
    font-weight: 600;
    color: var(--green);
}
.reward {
    color: var(--yellow);
    font-weight: 600;
}
.badge {
    display: inline-block;
    background: var(--accent-glow);
    color: var(--accent);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 600;
}
.rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
    background: var(--bg-dark);
    color: var(--text-muted);
}
.rank-1 { background: rgba(255,215,0,0.15); color: #ffd700; }
.rank-2 { background: rgba(192,192,192,0.15); color: #c0c0c0; }
.rank-3 { background: rgba(205,127,50,0.15); color: #cd7f32; }
.status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
}
.status-active {
    background: var(--green-bg);
    color: var(--green);
}
.status-inactive {
    background: var(--red-bg);
    color: var(--red);
}
.luck-good   { color: var(--green); font-weight: 600; }
.luck-normal { color: var(--yellow); font-weight: 600; }
.luck-bad    { color: var(--red); font-weight: 600; }
.text-muted  { color: var(--text-muted); }
.text-danger { color: var(--red); }
.block-height {
    font-weight: 600;
    color: var(--text-primary);
}
/* ==========================================
   Alerts
   ========================================== */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    font-size: 0.9rem;
}
.alert-error {
    background: var(--red-bg);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--red);
}
.alert-warning {
    background: var(--yellow-bg);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--yellow);
}
/* ==========================================
   Stratum Info
   ========================================== */
.stratum-info {
    padding: 8px 0;
}
.stratum-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    flex-wrap: wrap;
}
.stratum-label {
    color: var(--text-muted);
    font-size: 0.88rem;
    min-width: 120px;
}
.stratum-value {
    background: var(--bg-dark);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--green);
    border: 1px solid var(--border);
    user-select: all;
}
.stratum-note {
    color: var(--text-muted);
    font-size: 0.82rem;
}
/* ==========================================
   Footer
   ========================================== */
.footer {
    border-top: 1px solid var(--border);
    padding: 32px 0;
    margin-top: 48px;
}
.footer-inner {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.footer-inner p + p {
    margin-top: 8px;
}
.footer-note {
    font-size: 0.78rem;
}
.footer a {
    color: var(--accent);
}
/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .stats-grid--3 {
        grid-template-columns: repeat(2, 1fr);
    }
    .two-columns {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
        gap: 12px;
    }
    .nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
    }
    .coin-selector {
        margin-left: 0;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .stats-grid--3 {
        grid-template-columns: 1fr;
    }
    .stat-card__value {
        font-size: 1.3rem;
    }
    .table th, .table td {
        padding: 10px 12px;
    }
    .stratum-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .info-table th {
        width: auto;
        display: block;
        padding-bottom: 4px;
    }
    .info-table td {
        display: block;
        padding-top: 0;
    }
}
/* ==========================================
   Animations
   ========================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.stat-card, .panel {
    animation: fadeIn 0.3s ease-out;
}