:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-card: rgba(30, 35, 45, 0.85);
    --bg-card-border: rgba(80, 90, 110, 0.3);
    --text-primary: #f0f6fc;
    --text-secondary: #b3b9c2;
    --text-muted: #6e7681;
    --accent-green: #3fb950;
    --accent-purple: #d2a8ff;
    --accent-blue: #58a6ff;
    --status-success: rgba(56, 139, 253, 0.2);
    --status-success-text: #79c0ff;
    --status-error: rgba(248, 81, 73, 0.2);
    --status-error-text: #ff7b72;
    --reward-indicator: #a371f7;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    /* Removed backdrop-filter for performance */
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 10px;
    width: 85%;
}

h1 {
    color: var(--text-primary);
    text-align: center;
    margin: 15px 0;
    font-size: 2em;
    font-weight: 500;
}

#status {
    text-align: center;
    margin: 15px 0;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9em;
    background: var(--status-success);
    color: var(--status-success-text);
    border: 1px solid rgba(56, 139, 253, 0.4);
    /* Removed backdrop-filter for performance */
    max-width: 300px;
    margin: 15px auto;
}

#status.red {
    background: var(--status-error);
    color: var(--status-error-text);
    border: 1px solid rgba(248, 81, 73, 0.4);
}

/* TOP YIELDS SECTION */
.top-section {
    margin: 20px 0;
    padding: 15px;
    background: rgba(22, 27, 34, 0.85);
    border-radius: 12px;
    border-left: 3px solid var(--accent-green);
    /* Removed backdrop-filter for performance */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.top-title {
    color: var(--accent-green);
    font-size: 1.2em;
    font-weight: 500;
    margin-bottom: 15px;
    padding-left: 5px;
}

/* Unified card layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.card {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 10px 13px;
    font-size: 0.85em;
    transition: all 0.2s ease;
    border: 1px solid var(--bg-card-border);
    /* Removed backdrop-filter for performance */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    will-change: transform;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    border-color: rgba(80, 90, 110, 0.5);
}

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

.protocol-header {
    background: rgba(30, 35, 45, 0.9);
    padding: 8px 12px;
    border-radius: 8px;
    margin: 0 0 15px 0;
    font-weight: 500;
    font-size: 1em;
    color: var(--text-primary);
    /* Removed backdrop-filter for performance */
    border: 1px solid rgba(80, 90, 110, 0.3);
}

/* Unified yield line with tooltip */
.token {
    color: var(--text-secondary);
    font-size: 0.95em;
}

.vault-name {
    color: var(--text-muted);
    font-size: 0.7em;
    margin: 4px 0 6px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chain-label {
    font-size: 0.65em;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

/* Category colors */
.low .yield-value { color: #ff7b72; }
.medium .yield-value { color: #e3b341; }
.high .yield-value { color: var(--accent-green); }

/* Responsive */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr 1fr;
    }
    
    body {
        padding: 15px;
    }
    
    .container {
        width: 95%;
    }
}

@media (max-width: 480px) {
    .grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 0 5px;
        width: 95%;
    }
    
    body {
        padding: 10px;
    }
}

/* --- Yield Layout --- */
.yield-line {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin: 3px 0;
    position: relative;
}

.yield-value {
    font-weight: 500;
    font-size: 1.1em;
    color: var(--text-primary);
    white-space: nowrap;
    text-align: right;
    min-width: 60px;
}

.yield-breakdown-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    width: 100%;
}

.yield-breakdown {
    font-size: 0.7em;
    color: var(--text-muted);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.reward-yield {
    color: var(--accent-purple);
    display: flex;
    align-items: center;
    gap: 2px;
}

/* --- Permanent Corner Indicator --- */
.has-reward::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 16px 16px 0;
    border-color: transparent var(--reward-indicator) transparent transparent;
    z-index: 1;
    pointer-events: none;
}

.gas-info {
    font-size: 0.85em;
    color: var(--accent-blue);
    background: rgba(56, 139, 253, 0.15);
    padding: 8px 15px;
    border-radius: 8px;
    text-align: center;
    margin: 15px auto;
    max-width: 300px;
    /* Removed backdrop-filter for performance */
    border: 1px solid rgba(56, 139, 253, 0.3);
    font-weight: 400;
}

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

::-webkit-scrollbar-track {
    background: rgba(13, 17, 23, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(80, 90, 110, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(80, 90, 110, 0.7);
}

/* Performance optimizations */
* {
    transform-style: preserve-3d;
    backface-visibility: hidden;
}