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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0a;
    color: #e5e5e5;
    line-height: 1.5;
}

main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 60px 24px;
}

header {
    text-align: center;
    margin-bottom: 24px;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

header p {
    color: #666;
    font-size: 0.95rem;
}

.github-link {
    display: inline-block;
    margin-top: 12px;
    color: #666;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.15s;
}

.github-link:hover {
    color: #e5e5e5;
}

/* Harness filter tabs */
.harness-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.harness-tab {
    background: #111;
    color: #888;
    border: 1px solid #222;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    font-family: inherit;
}

.harness-tab:hover {
    background: #1a1a1a;
    color: #ccc;
    border-color: #333;
}

.harness-tab.active {
    background: #1a1033;
    color: #a78bfa;
    border-color: #3b2668;
}

.tab-count {
    opacity: 0.5;
    margin-left: 4px;
    font-size: 0.75rem;
}

.back-link {
    display: inline-block;
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 16px;
    transition: color 0.15s;
}

.back-link:hover {
    color: #e5e5e5;
}

section {
    margin-bottom: 48px;
}

h3 {
    font-size: 0.85rem;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}

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

th, td {
    text-align: left;
    padding: 12px 16px;
}

th {
    font-size: 0.75rem;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #222;
}

td {
    border-bottom: 1px solid #1a1a1a;
    font-size: 0.9rem;
}

#leaderboard-table tbody tr {
    transition: background 0.15s;
}

#leaderboard-table tbody tr.clickable {
    cursor: pointer;
}

#leaderboard-table tbody tr.clickable:hover {
    background: #111;
}

.rank {
    color: #444;
    font-weight: 500;
    width: 40px;
}

.model {
    font-weight: 500;
    color: #fff;
}

.badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: 500;
    font-family: 'SF Mono', Monaco, monospace;
    background: #222;
    color: #888;
    border-radius: 4px;
    vertical-align: middle;
}

.badge.harness-badge {
    background: #1a1033;
    color: #a78bfa;
    border: 1px solid #3b2668;
}

.score {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.85rem;
    color: #4ade80;
}

.squares-cell {
    width: 200px;
}

.squares {
    display: flex;
    gap: 4px;
    align-items: center;
}

.square {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.square.passed {
    background: #4ade80;
}

.square.failed {
    background: #f87171;
}

#stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    font-size: 0.85rem;
    color: #555;
    padding: 16px 0;
    border-top: 1px solid #222;
    margin-top: 32px;
}

#stats strong {
    color: #888;
}

#model-stats {
    color: #4ade80;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.95rem;
}

#exams-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.exam-card {
    background: #111;
    border-radius: 8px;
    border: 1px solid #222;
    overflow: hidden;
}

.exam-card.pass {
    border-left: 3px solid #4ade80;
}

.exam-card.fail {
    border-left: 3px solid #f87171;
}

.exam-card.na {
    border-left: 3px solid #333;
}

.exam-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #161616;
}

.exam-meta {
    display: flex;
    align-items: center;
    gap: 16px;
}

.exam-duration {
    font-size: 0.8rem;
    color: #666;
    font-family: 'SF Mono', Monaco, monospace;
}

.exam-turns {
    font-size: 0.8rem;
    color: #666;
    font-family: 'SF Mono', Monaco, monospace;
}

.exam-name {
    font-weight: 600;
    font-size: 1rem;
}

.exam-status {
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 12px;
    border-radius: 4px;
}

.exam-card.pass .exam-status {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
}

.exam-card.fail .exam-status {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
}

.exam-details {
    padding: 20px;
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h4 {
    font-size: 0.75rem;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.collapsible-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    transition: color 0.15s;
}

.collapsible-header:hover {
    color: #888;
}

.toggle-icon {
    font-size: 1rem;
    color: #666;
}

.output-block, .diff-block {
    background: #0a0a0a;
    border: 1px solid #222;
    border-radius: 6px;
    padding: 12px 16px;
    font-family: 'SF Mono', Monaco, 'Consolas', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 300px;
    overflow-y: auto;
}

.output-block.collapsed {
    max-height: 0;
    padding: 0 16px;
    border: none;
    overflow: hidden;
}

.diff-block {
    color: #e5e5e5;
}

.no-data {
    color: #555;
    font-style: italic;
    padding: 8px 0;
}

.error {
    color: #f87171;
}

.pass { color: #4ade80; }
.fail { color: #f87171; }
.na { color: #333; }

@media (max-width: 640px) {
    main {
        padding: 32px 16px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .harness-filters {
        gap: 4px;
    }

    .harness-tab {
        padding: 4px 10px;
        font-size: 0.75rem;
    }

    .squares-cell {
        display: none;
    }

    #stats {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .exam-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .output-block, .diff-block {
        font-size: 0.75rem;
        padding: 10px 12px;
    }
}
