/* The admin site's one stylesheet, dark only. No framework; the CSP forbids inline style, so everything visual lives here. */

:root {
    --bg: #14171d;
    --surface: #1c2029;
    --text: #e3e6ec;
    --muted: #9aa3b3;
    --border: #2d3340;
    --accent: #7b93f5;
    --accent-text: #0e1116;
    --notice-bg: #3a3218;
    --notice-border: #7a6526;
    --radius: 6px;
    /* Charts: categorical slots in a fixed order (a series keeps its colour whatever is filtered), the grid, and
       the heatmap's one hue. Validated for colour-vision deficiency on these surfaces; see wwwroot/js/charts.js. */
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --series-5: #d55181;
    --series-6: #008300;
    --series-7: #9085e9;
    --series-8: #e66767;
    --grid: #2a2f3a;
    --heat: #5598e7;
    --danger: #ff8787;
    --ok: #69db7c;
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

code {
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 0.92em;
}

h1 {
    font-size: 1.5rem;
    margin: 0 0 1rem;
}

/* Header */

.topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    padding: 0.75rem 1.25rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.brand {
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
}

.brand-sub {
    color: var(--muted);
    font-weight: 400;
}

.account {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--muted);
}

.account form {
    margin: 0;
}

/* Section navigation */

.sections {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.sections ul {
    display: flex;
    gap: 0.25rem;
    margin: 0;
    padding: 0 1rem;
    list-style: none;
}

.sections a {
    display: block;
    padding: 0.6rem 0.75rem;
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}

.sections a:hover {
    color: var(--text);
}

.sections a.current {
    color: var(--text);
    border-bottom-color: var(--accent);
}

/* Content */

main {
    max-width: 72rem;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.card.narrow {
    max-width: 30rem;
    margin: 3rem auto 0;
}

.notice {
    background: var(--notice-bg);
    border: 1px solid var(--notice-border);
    border-radius: var(--radius);
    padding: 0.6rem 0.9rem;
}

.placeholder {
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    color: var(--muted);
}

.placeholder p {
    margin: 0;
}

.placeholder .placeholder-tag {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
}

/* Buttons */

.button {
    display: inline-block;
    padding: 0.55rem 1.1rem;
    border: 0;
    border-radius: var(--radius);
    background: var(--accent);
    color: var(--accent-text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.button:hover {
    filter: brightness(1.08);
}

.link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent);
    font: inherit;
    cursor: pointer;
}

.link-button:hover {
    text-decoration: underline;
}

/* ---------------------------------------------------------------- data pages */

h2 {
    font-size: 1.15rem;
    margin: 2rem 0 0.75rem;
}

.lede {
    color: var(--muted);
    margin: -0.5rem 0 1.25rem;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 0.85rem;
}

/* Filters: one row above what they filter, wrapping on a phone. */

.filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
    margin: 0 0 1.25rem;
    padding: 0.9rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.filters label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.filters label.inline {
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
    color: var(--text);
}

.filters input[type="text"],
.filters input[type="search"],
.filters input[type="date"],
.filters select {
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.4rem 0.55rem;
    min-width: 0;
}

.filters .grow {
    flex: 1 1 14rem;
}

.filters .grow input {
    width: 100%;
}

.filters .actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.button.small-button {
    padding: 0.4rem 0.9rem;
}

/* Range switcher: 7 / 30 / 90 days. */

.segmented {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.segmented a {
    padding: 0.4rem 0.9rem;
    color: var(--muted);
    text-decoration: none;
    background: var(--surface);
}

.segmented a + a {
    border-left: 1px solid var(--border);
}

.segmented a.current {
    background: var(--accent);
    color: var(--accent-text);
    font-weight: 600;
}

/* Tables */

.table-wrap {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

table.data th,
table.data td {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

table.data th {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

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

table.data td.num,
table.data th.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

table.data td.nowrap {
    white-space: nowrap;
}

table.data td.text {
    word-break: break-word;
    min-width: 16rem;
}

.empty {
    padding: 1rem;
    color: var(--muted);
    margin: 0;
}

.tag {
    display: inline-block;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid var(--border);
    color: var(--muted);
}

.tag-ban {
    color: var(--danger);
    border-color: currentColor;
}

.tag-unban {
    color: var(--ok);
    border-color: currentColor;
}

.tag-ai {
    font-weight: 400;
}

/* Pager */

.pager {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin: 0.6rem 0 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.pager-links {
    display: flex;
    gap: 1rem;
}

/* Tabs on the player page */

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 2rem 0 0.75rem;
    border-bottom: 1px solid var(--border);
}

.tabs a {
    padding: 0.5rem 0.8rem;
    color: var(--muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.tabs a.current {
    color: var(--text);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

.tabs .count {
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    font-weight: 400;
}

/* Stat tiles */

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
    gap: 0.75rem;
    margin: 1.25rem 0;
}

.tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 0.9rem;
}

.tile-label {
    display: block;
    font-size: 0.78rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tile-value {
    display: block;
    font-size: 1.45rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
}

.tile-note {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
}

/* Player header */

.player-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 1rem;
    margin-bottom: 0.25rem;
}

.player-head h1 {
    margin: 0;
}

.names {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.names li {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.35rem 0.65rem;
    font-size: 0.9rem;
}

.names li strong {
    display: block;
}

.names li span {
    color: var(--muted);
    font-size: 0.8rem;
}

.banned {
    margin: 1rem 0 0;
}

/* Search results */

.results {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
}

.results li a {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.65rem 0.9rem;
    color: var(--text);
    text-decoration: none;
}

.results li a:hover {
    border-color: var(--accent);
}

.results .result-name {
    font-weight: 600;
}

.results .result-meta {
    color: var(--muted);
    font-size: 0.85rem;
}

/* Charts */

.charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr));
    align-items: start;
    gap: 1rem;
    margin: 0 0 1.5rem;
}

.chart {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.9rem 1rem 1rem;
    margin: 0;
    min-width: 0;
}

.chart h2,
.chart figcaption {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.15rem;
}

.chart .chart-note {
    color: var(--muted);
    font-size: 0.8rem;
    margin: 0 0 0.6rem;
}

.chart-box {
    position: relative;
    height: 16rem;
}

.chart-box.tall {
    height: 24rem;
}

.chart-message {
    color: var(--muted);
    margin: 0;
    padding: 2rem 0;
    text-align: center;
}

/* The hour x weekday heatmap: a table whose cells are shaded in steps of the one heat hue. */

.heatmap-wrap {
    overflow-x: auto;
}

table.heatmap {
    border-collapse: separate;
    border-spacing: 2px;
    font-size: 0.72rem;
    color: var(--muted);
}

table.heatmap th {
    font-weight: 400;
    padding: 0 0.3rem 0 0;
    text-align: right;
}

table.heatmap thead th {
    text-align: center;
    padding: 0 0 0.2rem;
}

table.heatmap td {
    width: 1.5rem;
    min-width: 1.1rem;
    height: 1.4rem;
    border-radius: 3px;
    background: var(--bg);
}

table.heatmap td.h1 { background: color-mix(in srgb, var(--heat) 18%, var(--surface)); }
table.heatmap td.h2 { background: color-mix(in srgb, var(--heat) 34%, var(--surface)); }
table.heatmap td.h3 { background: color-mix(in srgb, var(--heat) 52%, var(--surface)); }
table.heatmap td.h4 { background: color-mix(in srgb, var(--heat) 72%, var(--surface)); }
table.heatmap td.h5 { background: var(--heat); }

.heat-legend {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--muted);
}

.heat-legend i {
    display: inline-block;
    width: 1rem;
    height: 0.8rem;
    border-radius: 2px;
    background: var(--bg);
}

.heat-legend i.h1 { background: color-mix(in srgb, var(--heat) 18%, var(--surface)); }
.heat-legend i.h2 { background: color-mix(in srgb, var(--heat) 34%, var(--surface)); }
.heat-legend i.h3 { background: color-mix(in srgb, var(--heat) 52%, var(--surface)); }
.heat-legend i.h4 { background: color-mix(in srgb, var(--heat) 72%, var(--surface)); }
.heat-legend i.h5 { background: var(--heat); }

@media (max-width: 40rem) {
    main {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .tile-value {
        font-size: 1.2rem;
    }
}
