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

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #e5e9f2;
    min-height: 100vh;
    color: #1f2933;
}

main {
    padding-bottom: 72px;
}

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

.site-header {
    background: #ffffff;
    border-bottom: 1px solid #d3dae4;
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(8px);
}

.nav-container {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1d4ed8;
    text-decoration: none;
}

.primary-nav {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.primary-nav a {
    text-decoration: none;
    font-weight: 500;
    color: #394150;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
}

.primary-nav a:hover,
.primary-nav a:focus {
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
}

.primary-nav a[aria-current="page"] {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
}

.hero {
    padding: 72px 0 48px;
}

.hero.hero-compact {
    padding: 48px 0 32px;
}

.hero-title {
    font-size: 2.75rem;
    line-height: 1.2;
    margin-bottom: 16px;
}

.hero-lead {
    font-size: 1.05rem;
    color: #4b5563;
    line-height: 1.6;
}

.leaderboard-card {
    background: #ffffff;
    border: 1px solid #d3dae4;
    border-radius: 12px;
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.controls {
    padding: 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e1e7ef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.search-box {
    flex: 1;
    min-width: 200px;
}

.search-box input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #cbd2d9;
    border-radius: 6px;
    font-size: 1em;
    transition: border 0.2s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.refresh-btn {
    padding: 10px 20px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: background 0.2s ease;
}

.refresh-btn:hover {
    background: #1d4ed8;
}

.refresh-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #2563eb;
    font-size: 1.2em;
}

.error {
    text-align: center;
    padding: 40px;
    color: #c2410c;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f1f5f9;
    color: #1f2937;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9em;
    color: #52606d;
}

th.rank {
    width: 80px;
    text-align: center;
}

th.challenges {
    width: 200px;
    text-align: center;
}

tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background 0.2s ease;
}

tbody tr:hover {
    background: #f8fafc;
}

td {
    padding: 15px;
}

td.rank {
    text-align: center;
    font-weight: 600;
    font-size: 1.1em;
}

td.challenges {
    text-align: center;
    font-weight: 600;
    color: #2563eb;
    font-size: 1.1em;
}

.rank-badge {
    display: inline-block;
    min-width: 36px;
    padding: 4px 10px;
    border-radius: 18px;
    font-size: 0.85em;
    font-weight: 600;
}

.rank-1 {
    background: #facc15;
    color: #1f2937;
}

.rank-2 {
    background: #e5e7eb;
    color: #1f2937;
}

.rank-3 {
    background: #f97316;
    color: #ffffff;
}

.agent-name {
    font-weight: 500;
    color: #1f2937;
}

.agent-id {
    color: #6c757d;
    font-size: 0.85em;
    font-family: monospace;
}

.stats {
    display: flex;
    justify-content: space-around;
    padding: 20px;
    background: #f8fafc;
    border-top: 1px solid #e1e7ef;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.6em;
    font-weight: 600;
    color: #1f2937;
}

.stat-label {
    color: #7b8794;
    font-size: 0.9em;
    margin-top: 5px;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #7b8794;
}

.section {
    padding: 64px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 32px;
}

.section-copy {
    color: #4b5563;
    max-width: 560px;
    margin: 0 auto;
}

.page-section {
    padding: 24px 0;
}

.page-section h2 {
    font-size: 1.6rem;
    margin-bottom: 12px;
}

.page-section p {
    color: #4b5563;
    line-height: 1.6;
}

.container.narrow {
    max-width: 720px;
}

.content-list {
    list-style: disc;
    margin: 16px 0 0 20px;
    color: #4b5563;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        height: auto;
        gap: 12px;
        padding: 16px 0;
    }

    .primary-nav {
        width: 100%;
        justify-content: center;
    }

    .hero {
        padding: 64px 0 48px;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .controls {
        flex-direction: column;
    }

    th, td {
        padding: 10px;
        font-size: 0.85em;
    }

    .agent-id {
        display: none;
    }
}
