/* drst.dev: one stylesheet for every page */

:root {
    --bg: #0b0d10;
    --panel: #14181e;
    --panel-2: #1b2028;
    --line: #262d38;
    --text: #e6e9ee;
    --muted: #8b95a5;
    --accent: #f2a93b;      /* gold: the Golden Zombie, best values */
    --accent-dim: #f2a93b22;
    --red: #e5484d;
    --green: #3ccf7a;
    --cyan: #3fb8d9;        /* the in-game XP bar */
    --radius: 10px;
    --shadow: 0 8px 24px #0006;
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --display: 'Oswald', 'Arial Narrow', Impact, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
    background: radial-gradient(1200px 500px at 50% -200px, #2a1414 0%, transparent 70%), var(--bg);
    color: var(--text);
    font: 15px/1.5 var(--font);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: inherit; }

main {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 24px 16px 48px;
    flex: 1;
}

h1, h2, h3 {
    font-family: var(--display);
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin: 0 0 12px;
}
h1 { font-size: 30px; }
h2 { font-size: 20px; color: var(--muted); }

.muted { color: var(--muted); }
.gold { color: var(--accent); }
.num { font-variant-numeric: tabular-nums; }

/* ---- header ---- */

.site-header {
    border-bottom: 1px solid var(--line);
    background: #0b0d10cc;
    backdrop-filter: blur(6px);
    position: sticky;
    top: 0;
    z-index: 10;
}
.site-header .inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 16px;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.brand {
    font-family: var(--display);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
    white-space: nowrap;
}
.brand span { color: var(--red); }
nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
nav::-webkit-scrollbar { display: none; }
nav a {
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--muted);
    font-weight: 500;
    white-space: nowrap;
}
nav a:hover { color: var(--text); background: var(--panel-2); }
nav a.active { color: var(--text); background: var(--panel-2); box-shadow: inset 0 -2px 0 var(--red); }

.site-footer {
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    text-align: center;
    padding: 18px 16px;
}

/* ---- panels and grids ---- */

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
}

.summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}
.summary .panel { text-align: center; }
.summary .value { font-family: var(--display); font-size: 28px; font-weight: 600; }
.summary .label { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }

.panel.flush { padding: 0; }
.badge-link { text-decoration: none; }
.badge-link:hover { color: var(--text); border-color: var(--accent); }
.record-meta { color: var(--muted); font-size: 12px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 8px 0 12px; flex-wrap: wrap; }

/* ---- servers ---- */

/* minmax(0, 1fr): without it a wide player table stretches the whole page on a phone instead of scrolling */
.servers { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }

.server {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.server-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 16px;
    padding: 16px 18px;
    align-items: center;
}
.server-name { font-weight: 600; font-size: 17px; overflow-wrap: anywhere; }
.server-meta { color: var(--muted); font-size: 14px; display: flex; gap: 14px; flex-wrap: wrap; }
.server-meta b { color: var(--text); font-weight: 600; }
.server-side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.count { font-family: var(--display); font-size: 24px; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--panel-2);
    color: var(--muted);
}
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.online { color: var(--green); border-color: #3ccf7a44; }
.badge.changing { color: var(--accent); border-color: #f2a93b44; }
.badge.offline { color: var(--red); border-color: #e5484d44; }
.badge.locked { color: var(--accent); }
.badge.locked::before { display: none; }

.connect {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 13px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 4px 8px;
    color: var(--text);
    cursor: pointer;
}
.connect:hover { border-color: var(--accent); }

.roster { border-top: 1px solid var(--line); }
.roster table { margin: 0; }
.roster .empty { padding: 12px 18px; color: var(--muted); font-size: 14px; }

/* ---- tables ---- */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #ffffff05; }
td.right, th.right { text-align: right; }
td.name a { text-decoration: none; font-weight: 500; }
td.name a:hover { text-decoration: underline; }
.pos { color: var(--muted); width: 1%; }
tr.top-1 .pos { color: var(--accent); font-weight: 700; }
tr.top-2 .pos, tr.top-3 .pos { color: var(--text); font-weight: 700; }

.level { font-size: 13px; color: var(--muted); }
.level b { color: var(--accent); font-weight: 600; }

.state-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 6px; }
.state-dot.down { background: var(--red); }

/* ---- leaderboards ---- */

.boards {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 14px;
    scrollbar-width: thin;
}
.boards button {
    flex: none;
    font: inherit;
    font-size: 14px;
    color: var(--muted);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 14px;
    cursor: pointer;
}
.boards button:hover { color: var(--text); }
.boards button.active { color: #111; background: var(--accent); border-color: var(--accent); font-weight: 600; }

.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 14px; color: var(--muted); }
.button {
    font: inherit;
    color: var(--text);
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 7px 14px;
    cursor: pointer;
    text-decoration: none;
}
.button:hover:not(:disabled) { border-color: var(--accent); }
.button:disabled { opacity: 0.4; cursor: default; }

/* ---- search ---- */

.search {
    width: 100%;
    font: inherit;
    font-size: 17px;
    color: var(--text);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    outline: none;
    margin-bottom: 16px;
}
.search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

.results { display: grid; gap: 8px; }
.result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 16px;
    text-decoration: none;
}
.result:hover { border-color: var(--accent); }
.result .name { font-weight: 600; overflow-wrap: anywhere; }

/* ---- player ---- */

.profile-head {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
}
.profile-head h1 { font-family: var(--font); text-transform: none; font-size: 30px; letter-spacing: 0; overflow-wrap: anywhere; margin: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.prestige {
    text-align: center;
    border: 1px solid var(--accent);
    background: var(--accent-dim);
    border-radius: var(--radius);
    padding: 10px 18px;
}
.prestige .value { font-family: var(--display); font-size: 34px; color: var(--accent); line-height: 1; }
.prestige .label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

.xp { margin-bottom: 24px; }
.xp-labels { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.xp-labels b { color: var(--text); }
.bar { height: 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, #1f7fa0, var(--cyan)); border-radius: 999px; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 10px;
    margin-bottom: 24px;
}
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.stat .value { font-family: var(--display); font-size: 24px; font-weight: 600; }
.stat .where { font-size: 12px; color: var(--muted); text-decoration: none; }
.stat .where:hover { color: var(--accent); }
.stat.best { border-color: #f2a93b55; }
.stat.best .value { color: var(--accent); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 500; }

/* ---- records ---- */

.record-players { color: var(--muted); font-size: 13px; white-space: normal; min-width: 160px; }
.record-round { font-family: var(--display); font-size: 18px; }
td.none { color: var(--line); }

/* ---- misc ---- */

.notice { text-align: center; color: var(--muted); padding: 40px 16px; }
.error { color: var(--red); }
.loading { color: var(--muted); padding: 24px 0; }

/* ---- admin ---- */

.login { max-width: 380px; margin: 40px auto; }
.login form { display: grid; gap: 12px; }
.admin-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.admin-head h1 { margin-bottom: 8px; }
.admin-gap { margin-bottom: 16px; }
.linklike { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; }
.linklike:hover { text-decoration: underline; }

.field { display: grid; gap: 5px; min-width: 0; }
.field > span { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.field small { font-size: 12px; }
fieldset.field { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 4px; }
fieldset.field > span { width: 100%; }
input, select {
    font: inherit;
    color: var(--text);
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    min-width: 0;
    width: 100%;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
input:disabled { opacity: 0.5; }
.check { display: inline-flex; align-items: center; gap: 8px; margin-right: 16px; color: var(--text); font-size: 14px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; color: var(--text); }

.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; align-items: start; }
.form-grid .wide { grid-column: 1 / -1; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.scope { max-width: 360px; margin-bottom: 12px; }
.quick { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }

.button.primary { background: var(--accent); border-color: var(--accent); color: #111; font-weight: 600; }
.button.primary:hover:not(:disabled) { filter: brightness(1.08); }
.button.danger:hover:not(:disabled) { border-color: var(--red); color: var(--red); }
.button.small { padding: 4px 9px; font-size: 13px; }
a.button { display: inline-block; margin-top: 8px; }

.admin-tabs { margin-top: 4px; margin-bottom: 20px; }
.admin-summary { margin-bottom: 24px; }
.admin-summary .label { text-transform: none; letter-spacing: 0; font-size: 13px; overflow-wrap: anywhere; }
#tab > h2 { margin-top: 4px; }
#tab .two-col { margin-top: 20px; }
.admin-server { margin-bottom: 12px; }
.admin-server-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.chip { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }
.chip.hot { color: #111; background: var(--accent); border-color: var(--accent); font-weight: 600; }
.chip.own { color: var(--cyan); border-color: #3fb8d955; }

ul.plain { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
ul.plain .muted { display: block; font-size: 13px; }
ul.log { list-style: none; padding: 0; margin: 0 0 8px; }
ul.log li { padding: 9px 0; border-bottom: 1px solid var(--line); }
ul.log li:last-child { border-bottom: 0; }
.log-details { font-size: 13px; overflow-wrap: anywhere; }

.repeat-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.every { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.every input { width: 72px; }

tr.event-past { opacity: 0.55; }
tr.event-running td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

.map-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.map-toolbar .search { flex: 1; min-width: 200px; margin: 0; padding: 9px 12px; font-size: 15px; }
.map-table td { padding: 6px 8px; }
.map-table input.position { width: 58px; padding: 6px 6px; text-align: right; }
.map-table input:not([type=checkbox]) { padding: 6px 8px; }
.map-table td:nth-child(3) { min-width: 180px; }
.map-table td:nth-child(4) { min-width: 220px; }
.map-table td:nth-child(5) { min-width: 180px; }
.map-table tr.off input:not([type=checkbox]) { opacity: 0.5; }
.nowrap { white-space: nowrap; }

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translate(-50%, 20px);
    background: var(--panel-2);
    border: 1px solid var(--green);
    color: var(--text);
    border-radius: var(--radius);
    padding: 10px 16px;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    max-width: calc(100% - 32px);
    z-index: 20;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: var(--red); }

/* CoD colour codes: ^0 .. ^9 */
.c0 { color: #808080; } .c1 { color: #ff4f4f; } .c2 { color: #4fd14f; } .c3 { color: #f2e14c; } .c4 { color: #5f8bff; }
.c5 { color: #4fd8e8; } .c6 { color: #e05ad8; } .c7 { color: inherit; } .c8 { color: #ff9a3c; } .c9 { color: #9aa3ad; }

@media (max-width: 720px) {
    h1 { font-size: 24px; }
    .site-header .inner { gap: 12px; }
    .server-top { grid-template-columns: minmax(0, 1fr); }
    .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .summary .value { font-size: 22px; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat .value { font-size: 21px; }
    .brand { font-size: 19px; }
    nav a { padding: 8px 8px; }

    /* the menu gets its own row under the logo */
    .site-header .inner { height: auto; flex-wrap: wrap; gap: 4px 12px; padding: 10px 16px 6px; }
    nav { width: 100%; margin: 0 -8px; }

    /* map records: one card per map, its records listed under the name */
    .records-table table, .records-table tbody, .records-table tr, .records-table td { display: block; }
    .records-table thead { display: none; }
    .records-table tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
    .records-table td { border: 0; padding: 6px 0; white-space: normal; }
    .records-table td.map-name { font-size: 17px; padding-bottom: 8px; }
    .records-table td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
    .records-table td.none { display: none; }

    .repeat-row { grid-template-columns: 1fr auto; }
    .repeat-row input[data-k=text] { grid-column: 1 / -1; }
    .profile-head { grid-template-columns: minmax(0, 1fr); }
    .server-side { align-items: flex-start; text-align: left; flex-direction: row; flex-wrap: wrap; }
    .two-col { grid-template-columns: 1fr; }
    .profile-head { grid-template-columns: 1fr; }
    .hide-sm { display: none; }
    th, td { padding: 9px 10px; }
}
