:root {
    color-scheme: dark;
    --page-bg: #111;
    --table-bg: #050505;
    --header-bg: #101010;
    --border: #333;
    --text: #d6d6d6;
    --dim: #aaa;
    --link: #55ffff;
    --points: #ffff55;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--page-bg);
    color: var(--text);
    font: 14px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

main {
    width: min(1180px, calc(100vw - 24px));
    margin: 16px auto;
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 20px;
    margin-bottom: 12px;
}

h1 {
    margin: 0;
    color: #fff;
    font-size: 20px;
}

a {
    color: var(--link);
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.ranking-options,
.filters {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 8px;
    margin-bottom: 10px;
}

.ranking-options {
    align-items: center;
}

.ranking-options label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filters label {
    display: grid;
    gap: 2px;
    color: var(--dim);
}

input,
button {
    min-height: 28px;
    color: #fff;
    background: var(--table-bg);
    border: 1px solid #555;
    border-radius: 0;
    font: inherit;
    padding: 4px 6px;
}

input[type="checkbox"] {
    width: 16px;
    min-height: 16px;
    height: 16px;
    margin: 0;
    padding: 0;
    accent-color: var(--link);
}

button {
    cursor: pointer;
}

.summary {
    margin: 8px 0 4px;
    color: var(--dim);
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
}

table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    background: var(--table-bg);
}

.capture-table {
    min-width: 820px;
}

th,
td {
    padding: 6px 8px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

th:last-child,
td:last-child {
    border-right: 0;
}

tbody tr:last-child td {
    border-bottom: 0;
}

th {
    color: var(--dim);
    background: var(--header-bg);
    font-weight: 400;
}

.points {
    color: var(--points);
    text-align: right;
    white-space: nowrap;
}

.empty,
.loading {
    color: var(--dim);
}

.error {
    color: #ff5555;
}

@media (max-width: 720px) {
    main {
        width: calc(100vw - 8px);
        margin: 4px auto;
    }

    .page-header {
        align-items: flex-start;
    }

    .filters label {
        flex: 1 1 140px;
    }

    .filters input {
        width: 100%;
        min-width: 0;
    }

    table {
        font-size: 12px;
    }

    th,
    td {
        padding: 4px;
    }
}
