
:root {
  --brand: #561689;
  --brand-dark: #3d0f62;
  --brand-pale: #f4eefa;
  --ink: #1a1a1a;
  --muted: #767676;
  --line: #e2dceb;
  --up: #0a7d33;
  --down: #c02b2b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Verdana, sans-serif;
  color: var(--ink);
  background: #fff;
}
header { background: var(--brand); }
nav {
  max-width: 56rem; margin: 0 auto; padding: 5px 10px;
  display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap;
}
nav a, nav a:visited { color: #e9defa; text-decoration: none; }
nav a:hover { color: #fff; }
nav .brand, nav .brand:visited { color: #fff; font-weight: bold; font-size: 15px; }
nav .log, nav .log:visited { color: #fff; font-weight: bold; }
nav .spacer { flex: 1; }
main { max-width: 56rem; margin: 0 auto; padding: 12px 10px 40px; }
footer {
  max-width: 56rem; margin: 0 auto; padding: 16px 10px 30px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 12px;
}
footer a, footer a:visited { color: var(--muted); }
a { color: var(--brand); }
a:visited { color: var(--brand-dark); }
h1 { font-size: 18px; margin: 8px 0 12px; }
h2 { font-size: 15px; margin: 16px 0 8px; }
.fine { font-size: 11px; }
.muted { color: var(--muted); }
.up { color: var(--up); }
.down { color: var(--down); }
.inline { display: inline; }
button.linkish {
  background: none; border: none; padding: 0; font: inherit;
  color: #e9defa; cursor: pointer;
}
button.linkish:hover { color: #fff; }

/* ── feed ── */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 8px; padding: 5px 0; align-items: baseline; }
.feed .rank { color: var(--muted); min-width: 2ch; text-align: right; }
.votebox { display: flex; flex-direction: column; align-self: center; line-height: 1; }
.votebox button {
  background: none; border: none; cursor: pointer; padding: 0 4px;
  color: #b9a8d1; font-size: 11px;
}
.votebox button.on { color: var(--brand); }
.votebox button:hover { color: var(--brand); }
.rowmain { flex: 1; min-width: 0; }
.rowmain .title a { text-decoration: none; color: var(--ink); }
.rowmain .title a:hover { text-decoration: underline; }
.tick { font-weight: bold; }
.dir-long { color: var(--up); font-weight: bold; font-size: 12px; }
.dir-short { color: var(--down); font-weight: bold; font-size: 12px; }
.sub { font-size: 12px; color: var(--muted); }
.sub a { color: var(--muted); }
.ret { font-weight: bold; }
.status-closed { font-size: 11px; border: 1px solid var(--line); padding: 0 4px; border-radius: 3px; color: var(--muted); }
.status-open { font-size: 11px; border: 1px solid var(--up); padding: 0 4px; border-radius: 3px; color: var(--up); }

/* ── forms ── */
form.stack { max-width: 30rem; }
form.stack label { display: block; margin: 12px 0 4px; font-weight: bold; }
input[type=text], input[type=number], textarea, select {
  width: 100%; padding: 6px; font: inherit;
  border: 1px solid var(--line); border-radius: 3px;
}
textarea { min-height: 10rem; }
button.primary {
  margin-top: 14px; padding: 7px 18px; font: inherit; font-weight: bold;
  background: var(--brand); color: #fff; border: none; border-radius: 3px; cursor: pointer;
}
button.primary:hover { background: var(--brand-dark); }
button.danger { background: var(--down); }
a.btn2, a.btn2:visited {
  display: inline-block; padding: 7px 18px; margin-top: 14px; font-weight: bold;
  background: #ececec; color: var(--ink); border-radius: 3px; text-decoration: none;
}
a.btn2:hover { background: var(--line); }
.notice {
  background: var(--brand-pale); border: 1px solid var(--line);
  padding: 8px 10px; border-radius: 3px; font-size: 13px; margin: 10px 0;
}
ul.notice { padding-left: 28px; }
ul.notice li { margin: 3px 0; }
.error { color: var(--down); font-weight: bold; }
.radio-row { display: flex; gap: 16px; }
.radio-row label { font-weight: normal; margin: 0; }

/* ── call page ── */
.callhead { margin: 4px 0 10px; }
.callhead .big { font-size: 17px; }
.chartbox { margin: 10px 0; }
.chartbox img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 3px; }
.usertext { white-space: pre-wrap; overflow-wrap: break-word; margin: 10px 0; }
.dd-img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 3px; }
#quote-preview { display: block; margin-top: 4px; font-size: 13px; min-height: 1.2em; }
#shot-note { display: block; margin-top: 4px; font-size: 12px; }
.kv { border-collapse: collapse; font-size: 13px; }
.kv td { padding: 2px 14px 2px 0; }
.kv td:first-child { color: var(--muted); }

/* ── comments ── */
.comments { margin-top: 18px; }
.comment { margin: 10px 0 0; }
.comment .body { white-space: pre-wrap; overflow-wrap: break-word; }
.comment .meta { font-size: 12px; color: var(--muted); }
.comment .meta a { color: var(--muted); }
.replies { margin-left: 22px; border-left: 1px solid var(--line); padding-left: 10px; }
.comments textarea { min-height: 5rem; }

/* ── tables (profile, leaderboard) ── */
table.data { border-collapse: collapse; width: 100%; font-size: 13px; }
table.data th, table.data td { text-align: left; padding: 4px 10px 4px 0; border-bottom: 1px solid var(--line); }
table.data th { color: var(--muted); font-weight: normal; }
table.data td.num, table.data th.num { text-align: right; }
.stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.stat {
  border: 1px solid var(--line); border-radius: 3px; padding: 6px 12px; min-width: 7rem;
}
.stat .v { font-size: 16px; font-weight: bold; }
.stat .k { font-size: 11px; color: var(--muted); }

.pager { margin: 14px 0; }
.countdown { font-weight: bold; color: var(--down); }
