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

:root {
    --bg: #0d1117;
    --surface: #161b22;
    --surface-hover: #21262d;
    --border: #30363d;
    --text: #c9d1d9;
    --text-muted: #8b949e;
    --text-heading: #f0f6fc;
    
    --tier-s: #7ee787;
    --tier-a: #a5d6ff;
    --tier-b: #79c0ff;
    --tier-c: #ffd166;
    --tier-d: #ff9e64;
    --tier-f: #ff7b72;
    
    --pass: #3fb950;
    --fail: #f85149;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    padding: 3rem 2rem 2rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

header h1 {
    color: var(--text-heading);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
}

.about-section {
    margin-bottom: 2rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.about-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--surface);
    border: none;
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    font-weight: 500;
}

.about-toggle:hover {
    background: var(--surface-hover);
}

.toggle-icon {
    font-size: 1.25rem;
    color: var(--text-muted);
}

.about-content {
    display: none;
    background: var(--bg);
    border-top: 1px solid var(--border);
}

.about-content.expanded {
    display: block;
}

.about-inner {
    padding: 1.5rem;
    max-width: 800px;
}

.about-inner h3 {
    color: var(--text-heading);
    margin: 1.5rem 0 0.75rem;
    font-size: 1rem;
}

.about-inner h3:first-child {
    margin-top: 0;
}

.about-inner p {
    color: var(--text);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.about-inner ul {
    margin: 0.75rem 0 1rem 1.5rem;
    color: var(--text);
}

.about-inner li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.about-inner strong {
    color: var(--text-heading);
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    align-items: center;
}

.filter-group, .sort-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.controls label {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.15s;
}

.filter-btn:hover {
    border-color: var(--text-muted);
}

.filter-btn.active {
    background: var(--text-heading);
    color: var(--bg);
    border-color: var(--text-heading);
}

select {
    padding: 0.5rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    min-width: 150px;
}

select:focus {
    outline: none;
    border-color: var(--text-muted);
}

.tier-lists {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tier-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.tier-section:has(.tier-models:empty) {
    display: none;
}

.tier-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.tier-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    border-radius: 4px;
}

.tier-s { background: rgba(126, 231, 135, 0.15); color: var(--tier-s); }
.tier-a { background: rgba(165, 214, 255, 0.15); color: var(--tier-a); }
.tier-b { background: rgba(121, 192, 255, 0.15); color: var(--tier-b); }
.tier-c { background: rgba(255, 209, 102, 0.15); color: var(--tier-c); }
.tier-d { background: rgba(255, 158, 100, 0.15); color: var(--tier-d); }
.tier-f { background: rgba(255, 123, 114, 0.15); color: var(--tier-f); }

.tier-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.tier-models {
    padding: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.model-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    min-width: 200px;
}

.model-card:hover {
    border-color: var(--text-muted);
    background: var(--surface-hover);
}

.model-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.model-status.pass {
    background: var(--pass);
}

.model-status.fail {
    background: var(--fail);
}

.model-info {
    flex: 1;
    min-width: 0;
}

.model-name {
    font-weight: 500;
    color: var(--text-heading);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.model-provider {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.model-cost {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: monospace;
}

.model-cost:empty::before {
    content: "N/A";
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-heading);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

.modal-content h2 {
    padding: 1.5rem 1.5rem 0;
    color: var(--text-heading);
}

#modal-body {
    padding: 1.5rem;
}

.detail-section {
    margin-bottom: 1.5rem;
}

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

.detail-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    display: block;
}

.detail-value {
    color: var(--text);
}

.detail-value.pass {
    color: var(--pass);
}

.detail-value.fail {
    color: var(--fail);
}

.ratings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.rating-item {
    text-align: center;
    padding: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.rating-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.rating-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.rating-value.tier-s { color: var(--tier-s); }
.rating-value.tier-a { color: var(--tier-a); }
.rating-value.tier-b { color: var(--tier-b); }
.rating-value.tier-c { color: var(--tier-c); }
.rating-value.tier-d { color: var(--tier-d); }
.rating-value.tier-f { color: var(--tier-f); }

.notes {
    line-height: 1.7;
    color: var(--text);
}

footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.75rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group, .sort-group {
        justify-content: space-between;
    }
    
    .model-card {
        width: 100%;
    }
    
    .ratings-grid {
        grid-template-columns: 1fr;
    }
}
