/* Deliberately hand-written and tiny. The scaffold shipped bootstrap and jQuery -- about
   a megabyte of vendored JavaScript for what is a table, a form and a login box. */

:root {
    --bg: #14161a;
    --panel: #1c1f25;
    --panel-2: #22262d;
    --line: #2e333c;
    --text: #e2e4e8;
    --muted: #8b929e;
    --accent: #6ea8fe;
    --good: #74b874;
    --warn: #d9993a;
    --bad: #d9614f;
}

* { box-sizing: border-box; }

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

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 20px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
}

.brand { color: var(--text); font-weight: 700; letter-spacing: .06em; text-decoration: none; }
.brand span { color: var(--muted); font-weight: 400; letter-spacing: 0; margin-left: 6px; }
.who { color: var(--muted); margin-right: 10px; }
.inline { display: inline-flex; align-items: center; margin: 0; }

main { max-width: 1500px; margin: 0 auto; padding: 20px; }

h1 { font-size: 19px; margin: 0 0 4px; }
h2 { font-size: 15px; margin: 22px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
a { color: var(--accent); }

/* ── filters ─────────────────────────────────────────────────────────── */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: end;
    margin: 14px 0 18px;
    padding: 12px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
}
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); }

input, select, textarea, button {
    font: inherit;
    color: var(--text);
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 6px 8px;
}
textarea { width: 100%; min-height: 90px; resize: vertical; }
button { cursor: pointer; }
button.primary { background: #2f4f7a; border-color: #3d648f; }
button.link { background: none; border: none; color: var(--accent); padding: 0; }
button.danger { background: #4a2320; border-color: #6d3630; color: #f0c4bd; }

/* ── table ───────────────────────────────────────────────────────────── */
.wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; }
table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--panel-2); }
tbody tr:hover { background: var(--panel-2); }
td.ref a { font-family: ui-monospace, monospace; font-weight: 600; text-decoration: none; }
td.desc { max-width: 460px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* ── chips ───────────────────────────────────────────────────────────── */
.chip {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 11px;
    border: 1px solid var(--line);
    background: var(--panel-2);
    color: var(--muted);
    white-space: nowrap;
}
.chip.new { border-color: #3d648f; color: #9cc4ff; }
.chip.fixed { border-color: #3d6b3d; color: #a8d8a8; }
.chip.spam, .chip.wontfix { border-color: #5a3a33; color: #d0a79e; }
.chip.dupe { opacity: .65; }
.chip.crash { border-color: #6d3630; color: #f0a89e; }
.chip.ok { border-color: #3d6b3d; color: #a8d8a8; }
.chip.pending { border-color: #6b5a2a; color: #e0c98a; }
.chip.rejected { border-color: #6d3630; color: #f0a89e; }

/* ── detail ──────────────────────────────────────────────────────────── */
.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 900px) { .cols { grid-template-columns: minmax(0, 1fr); } }

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 16px;
}
.card h3 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

dl { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 4px 14px; margin: 0; }
dt { color: var(--muted); font-size: 12px; }
dd { margin: 0; overflow-wrap: anywhere; }

/* Player-written text. Preserved as typed, never rendered as markup. */
.player-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; font: inherit; }

pre.json {
    margin: 0;
    padding: 12px;
    background: #0f1114;
    border: 1px solid var(--line);
    border-radius: 4px;
    overflow-x: auto;
    font-family: ui-monospace, monospace;
    font-size: 12px;
    max-height: 520px;
}

.notice { padding: 10px 12px; border-radius: 4px; margin-bottom: 14px; }
.notice.error { background: #3a1f1c; border: 1px solid #6d3630; color: #f0c4bd; }
.notice.info { background: #1e2a3a; border: 1px solid #3d648f; color: #cfe0f7; }

.login { max-width: 340px; margin: 8vh auto; }
.login label { display: block; margin-bottom: 10px; font-size: 12px; color: var(--muted); }
.login input { width: 100%; margin-top: 4px; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
