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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f0f0f;
    color: #ffffff;
    min-height: 100vh;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

h1 {
    color: #00d4aa;
    font-size: 1.8em;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

#last-updated {
    color: #888;
    font-size: 0.9em;
}

#refresh-btn {
    background: #00d4aa;
    color: #0f0f0f;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

#refresh-btn:hover {
    background: #00b894;
}

#refresh-btn:disabled {
    background: #555;
    cursor: not-allowed;
}

#wallets-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.wallet-card {
    background: #1a1a2e;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #2a2a4a;
}

.wallet-header {
    margin-bottom: 20px;
    border-bottom: 1px solid #2a2a4a;
    padding-bottom: 15px;
}

.wallet-header h2 {
    color: #ffffff;
    margin-bottom: 5px;
    font-size: 1.3em;
}

.wallet-address {
    color: #888;
    font-family: monospace;
    font-size: 0.9em;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.metric {
    background: #252540;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.metric.wide {
    grid-column: span 2;
}

.metric-label {
    display: block;
    color: #888;
    font-size: 0.85em;
    margin-bottom: 5px;
}

.metric-value {
    display: block;
    font-size: 1.4em;
    font-weight: bold;
    color: #00d4aa;
}

.metric-value.rank {
    color: #ffd700;
}

.metric-value.fees {
    color: #4ecdc4;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #888;
    grid-column: 1 / -1;
}

.error-card {
    background: #2a1a1a;
    border: 1px solid #4a2a2a;
}

.error-card .error-message {
    color: #ff6b6b;
    text-align: center;
    padding: 20px;
}

footer {
    margin-top: 40px;
    text-align: center;
    color: #666;
    padding: 20px;
}

footer a {
    color: #00d4aa;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .metric.wide {
        grid-column: span 1;
    }

    #wallets-container {
        grid-template-columns: 1fr;
    }
}
