/* ==========================================================================
   MoPreps.com
   Visual idiom: the printed sports section. Condensed athletic type, box-score
   number columns, hairline rules doing the work that drop shadows usually do,
   and warm newsprint stock instead of blue-gray. Structure follows the
   dashboard reference: fixed icon rail, top bar with search + filter tabs.
   ========================================================================== */

:root {
  /* Ink + stock */
  --paper:      #f4f1ec;
  --panel:      #ffffff;
  --panel-2:    #faf8f4;
  --panel-3:    #f0ece5;
  --ink:        #16181c;
  --ink-2:      #4c525c;
  --ink-3:      #878d97;
  --rule:       #e0dad0;
  --rule-2:     #cec6b8;

  /* Team colors, taken off the logo */
  --crimson:    #c8102e;
  --crimson-2:  #a30c24;
  --crimson-in: #ffffff;
  --crimson-wash: rgba(200, 16, 46, .07);
  --gold:       #b8801b;
  --gold-wash:  rgba(212, 154, 43, .14);

  --turf:       #1d6b45;
  --turf-wash:  rgba(29, 107, 69, .1);
  --flag:       #a3341c;
  --flag-wash:  rgba(163, 52, 28, .1);

  --ink-invert: #f4f1ec;
  --dark:       #131519;
  --dark-2:     #1b1e24;
  --dark-rule:  rgba(255, 255, 255, .1);
  /* The rail sits darker than everything else so it anchors the layout in
     both themes rather than merging into the top bar. */
  --rail-bg:    #131519;

  --drop:       0 14px 30px -12px rgba(22, 24, 28, .28);

  --display: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --body:    "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;

  --r1: 3px;
  --r2: 6px;
  --r3: 9px;

  /* Chat nick palette (light) */
  --n0:#a8102b; --n1:#123f6d; --n2:#1c5c3c; --n3:#7d5f10;
  --n4:#5d1a2b; --n5:#2f4552; --n6:#0f5f63; --n7:#96461f;

  --rail-w: 72px;
  --bar-h:  62px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:    #0e0f12;
    --panel:    #16181d;
    --panel-2:  #1c1f25;
    --panel-3:  #23262d;
    --ink:      #eceef2;
    --ink-2:    #a5abb6;
    --ink-3:    #6d7480;
    --rule:     #262a31;
    --rule-2:   #363b44;
    --crimson:  #e4364c;
    --crimson-2:#c8102e;
    --crimson-wash: rgba(228, 54, 76, .13);
    --gold:     #d9a441;
    --gold-wash: rgba(217, 164, 65, .15);
    --turf:     #47b07d;
    --turf-wash: rgba(71, 176, 125, .14);
    --flag:     #e07a5f;
    --flag-wash: rgba(224, 122, 95, .14);
    --ink-invert: #f4f1ec;
    --n0:#ff7d8c; --n1:#79b0ec; --n2:#5fc38c; --n3:#e0b354;
    --n4:#e792a6; --n5:#a6bccb; --n6:#4fc9c9; --n7:#eaa172;
    --rail-bg:  #08090b;
    --dark:     #16181d;
    --dark-2:   #1c1f25;
    --drop:     0 16px 34px -12px rgba(0, 0, 0, .7);
  }
}

[data-theme="dark"] {
  --paper:    #0e0f12;
  --panel:    #16181d;
  --panel-2:  #1c1f25;
  --panel-3:  #23262d;
  --ink:      #eceef2;
  --ink-2:    #a5abb6;
  --ink-3:    #6d7480;
  --rule:     #262a31;
  --rule-2:   #363b44;
  --crimson:  #e4364c;
  --crimson-2:#c8102e;
  --crimson-wash: rgba(228, 54, 76, .13);
  --gold:     #d9a441;
  --gold-wash: rgba(217, 164, 65, .15);
  --turf:     #47b07d;
  --turf-wash: rgba(71, 176, 125, .14);
  --flag:     #e07a5f;
  --flag-wash: rgba(224, 122, 95, .14);
  --ink-invert: #f4f1ec;
  --n0:#ff7d8c; --n1:#79b0ec; --n2:#5fc38c; --n3:#e0b354;
  --n4:#e792a6; --n5:#a6bccb; --n6:#4fc9c9; --n7:#eaa172;
  --rail-bg:  #08090b;
  --dark:     #16181d;
  --dark-2:   #1c1f25;
  --drop:     0 16px 34px -12px rgba(0, 0, 0, .7);
}

/* --------------------------------------------------------------- base ---- */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0 0 .35em; font-weight: 600; line-height: 1.15; }

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

img { max-width: 100%; }
svg.ico { display: block; flex: none; }

button { font: inherit; color: inherit; }

::selection { background: var(--crimson); color: #fff; }

:focus-visible { outline: 2px solid var(--crimson); outline-offset: 2px; border-radius: 2px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 400;
  background: var(--ink); color: var(--paper); padding: 10px 16px;
}
.skip-link:focus { left: 0; }

.muted { color: var(--ink-3); }
.sep { color: var(--rule-2); margin: 0 3px; }
.ta-r { text-align: right; }
.num { font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- shell ---- */

.shell { display: flex; min-height: 100vh; }

.rail {
  position: fixed; inset: 0 auto 0 0; z-index: 60;
  width: var(--rail-w);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 0 14px;
  background: var(--rail-bg);
  border-right: 1px solid rgba(255,255,255,.08);
}
/* The logo's white keyline carries it against the dark rail, so it needs no
   tile behind it. 58px wide is the smallest size where MOPREPS still reads. */
.rail-mark {
  display: grid; place-items: center;
  width: 62px; height: 48px; margin-bottom: 12px;
  border-radius: var(--r2);
}
.rail-mark img { width: 58px; height: auto; display: block; }
.rail-mark:hover { background: rgba(255, 255, 255, .07); text-decoration: none; }
.rail-nav { display: flex; flex-direction: column; gap: 4px; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.rail-btn {
  position: relative;
  display: grid; place-items: center;
  width: 44px; height: 42px;
  border: 0; background: none; cursor: pointer;
  border-radius: var(--r2);
  color: rgba(244, 241, 236, .55);
}
.rail-btn:hover { color: #fff; background: rgba(255, 255, 255, .07); text-decoration: none; }
.rail-btn.active { color: #fff; background: rgba(255, 255, 255, .1); }
.rail-btn.active::before {
  content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px; background: var(--crimson); border-radius: 0 2px 2px 0;
}
.rail-count {
  position: absolute; top: 4px; right: 4px;
  min-width: 15px; height: 15px; padding: 0 4px;
  background: var(--crimson); color: #fff;
  font: 600 10px/15px var(--body); text-align: center;
  border-radius: 8px;
}
/* Specificity has to beat `svg.ico { display: block }` above. */
svg.ico-sun { display: none; }
[data-theme="dark"] svg.ico-sun { display: block; }
[data-theme="dark"] svg.ico-moon { display: none; }

.frame { flex: 1; min-width: 0; margin-left: var(--rail-w); display: flex; flex-direction: column; }

/* -------------------------------------------------------------- topbar ---- */

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 14px;
  height: var(--bar-h); padding: 0 22px;
  background: var(--panel);
  border-bottom: 1px solid var(--rule);
}
.tb-menu {
  display: none; place-items: center;
  width: 38px; height: 38px; border-radius: var(--r2);
  border: 1px solid var(--rule); background: none; cursor: pointer;
}
.tb-brand { display: none; }
.tb-brand img { height: 38px; width: auto; display: block; }

.tb-search {
  display: flex; align-items: center; gap: 9px;
  width: 300px; height: 38px; padding: 0 13px;
  background: var(--panel-2);
  border: 1px solid var(--rule);
  border-radius: var(--r2);
  color: var(--ink-3);
}
.tb-search:focus-within { border-color: var(--rule-2); background: var(--panel); }
/* Needs to out-specify the shared input rules further down, or the field draws
   its own box inside the wrapper and sits off-center from the icon. */
.tb-search input[type="search"] {
  flex: 1; min-width: 0; width: auto;
  height: 100%; padding: 0; margin: 0;
  border: 0; border-radius: 0; outline: 0; background: none;
  font: 400 14px var(--body); color: var(--ink);
}

.tb-tabs { position: relative; display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; }
.tb-tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; z-index: 1;
  padding: 8px 15px; border-radius: var(--r2); white-space: nowrap;
  border: 1px solid var(--rule);
  font: 500 13.5px var(--body); color: var(--ink-2);
  transition: color .18s ease, border-color .18s ease;
}
.tab:hover { color: var(--ink); border-color: var(--rule-2); text-decoration: none; }
.tab.active { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* The filter tabs share one traveling highlight rather than each carrying its
   own background, so changing board reads as movement. */
.tb-tabs .tab.active { background: transparent; border-color: transparent; color: var(--paper); }
.tab-slider {
  position: absolute; left: 0; top: 0; height: 100%;
  background: var(--ink); border-radius: var(--r2);
  pointer-events: none; z-index: 0; opacity: 0;
  transition: transform .32s cubic-bezier(.34, .82, .28, 1),
              width .32s cubic-bezier(.34, .82, .28, 1),
              opacity .2s ease;
}
.tab-slider.ready { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .tab-slider { transition: opacity .2s ease; }
}

.tb-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.tb-alert {
  position: relative; display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: var(--r2);
  border: 1px solid var(--rule); color: var(--ink-2);
}
.tb-alert:hover { color: var(--ink); border-color: var(--rule-2); }
.tb-alert .dot {
  position: absolute; top: 8px; right: 9px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--crimson); border: 1.5px solid var(--panel);
}

.account { position: relative; }
.account-btn {
  display: flex; align-items: center; gap: 9px;
  padding: 4px 6px 4px 4px; border: 0; background: none; cursor: pointer;
  border-radius: var(--r2);
}
.account-btn:hover { background: var(--panel-2); }
.account-av { position: relative; display: block; }
.presence {
  position: absolute; right: -1px; bottom: -1px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--turf); border: 2px solid var(--panel);
}
.account-id { display: flex; flex-direction: column; line-height: 1.2; text-align: left; }
.account-name { font: 600 13.5px var(--body); color: var(--ink); }
.account-handle { font: 400 11.5px var(--body); color: var(--ink-3); }
.account-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 80;
  min-width: 208px; padding: 5px;
  background: var(--panel); border: 1px solid var(--rule);
  border-radius: var(--r3); box-shadow: var(--drop);
}
.account-menu a, .account-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 11px; border: 0; background: none; cursor: pointer;
  border-radius: var(--r2); text-align: left;
  font: 500 14px var(--body); color: var(--ink);
}
.account-menu a:hover, .account-menu button:hover { background: var(--panel-2); text-decoration: none; }
.account-menu .ico { color: var(--ink-3); }
.account-menu form { border-top: 1px solid var(--rule); margin-top: 4px; padding-top: 4px; }

/* Anchored under the sticky bar rather than sitting in the page flow, so it
   opens where the reader is instead of back at the top of the document. */
.drawer {
  display: none; flex-direction: column;
  position: fixed; top: var(--bar-h); left: 0; right: 0; z-index: 45;
  max-height: calc(100vh - var(--bar-h));
  overflow-y: auto; overscroll-behavior: contain;
  padding: 8px 14px 16px;
  border-bottom: 1px solid var(--rule);
  background: var(--panel);
  box-shadow: var(--drop);
}
.drawer-scrim {
  position: fixed; inset: var(--bar-h) 0 0 0; z-index: 44;
  background: rgba(8, 9, 11, .42);
  border: 0;
}
.drawer a { display: flex; align-items: center; gap: 11px; padding: 11px 8px; font-weight: 500; border-radius: var(--r2); }
.drawer a:hover { background: var(--panel-2); text-decoration: none; }
.drawer .ico { color: var(--ink-3); }

/* ------------------------------------------------------------- content ---- */

.content { flex: 1; width: 100%; max-width: 1260px; margin: 0 auto; padding: 22px 24px 56px; }

.cols { display: grid; grid-template-columns: minmax(0, 1fr) 316px; gap: 20px; align-items: start; }
.col-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--bar-h) + 18px); }
.narrow { max-width: 600px; }
.narrow.wide { max-width: 820px; }

/* --------------------------------------------------------------- parts ---- */

.panel {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--r3);
}
.panel.pad { padding: 18px 20px; }

.rule-head {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 14px;
  font: 600 12px var(--display); letter-spacing: .13em; text-transform: uppercase;
  color: var(--ink-2);
}
.rule-head::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

.section-label {
  display: flex; align-items: center; gap: 11px;
  margin: 0 0 11px;
  font: 600 13px var(--display); letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-2);
}
.section-label::before { content: ""; width: 16px; height: 3px; background: var(--crimson); flex: none; }
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

h1.title, .title { font-family: var(--display); font-weight: 700; letter-spacing: .005em; }

.notice {
  display: flex; align-items: center; gap: 11px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 16px;
  border: 1px solid var(--rule); border-left: 3px solid var(--ink-3);
  border-radius: var(--r2);
  background: var(--panel); font-size: 14px;
}
.notice .ico { color: inherit; }
.notice-warn    { border-left-color: var(--gold);    background: var(--gold-wash);    color: var(--ink); }
.notice-error   { border-left-color: var(--crimson); background: var(--crimson-wash); color: var(--ink); }
.notice-success { border-left-color: var(--turf);    background: var(--turf-wash);    color: var(--ink); }
.notice a { text-decoration: underline; }

/* ------------------------------------------------------------- buttons ---- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--r2);
  font: 600 14px var(--body); cursor: pointer; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.btn-primary:hover { background: var(--crimson-2); border-color: var(--crimson-2); }
.btn-quiet { background: var(--panel); border-color: var(--rule-2); color: var(--ink); }
.btn-quiet:hover { background: var(--panel-2); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-dark:hover { opacity: .9; }
.btn-sm { height: 34px; padding: 0 13px; font-size: 13px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn-lg { height: 46px; padding: 0 24px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }

/* ------------------------------------------------------------ masthead ---- */

.masthead {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: center;
  padding: 30px 32px;
  margin-bottom: 22px;
  background: var(--dark);
  border: 1px solid var(--dark-rule);
  border-radius: var(--r3);
  color: var(--ink-invert);
}
/* Jersey striping, kept faint so it reads as texture rather than decoration. */
.masthead::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(64deg, rgba(255,255,255,.045) 0 2px, transparent 2px 13px);
  pointer-events: none;
}
.masthead > * { position: relative; }
.masthead h1 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(30px, 4.4vw, 46px); line-height: .98;
  text-transform: uppercase; letter-spacing: .008em;
  margin: 0 0 12px; color: #fff;
}
.masthead h1 em { font-style: normal; color: var(--crimson); }
.mast-rule { width: 62px; height: 4px; background: var(--crimson); margin-bottom: 15px; }
.masthead p { margin: 0 0 20px; max-width: 46ch; color: rgba(244, 241, 236, .68); font-size: 15.5px; }
.mast-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.mast-actions .btn-quiet { background: transparent; border-color: rgba(255,255,255,.28); color: #fff; }
.mast-actions .btn-quiet:hover { background: rgba(255,255,255,.09); }
.mast-score {
  display: flex; gap: 0;
  border: 1px solid rgba(255, 255, 255, .14); border-radius: var(--r2);
  overflow: hidden;
}
.mast-score div { padding: 14px 20px; text-align: center; }
.mast-score div + div { border-left: 1px solid rgba(255, 255, 255, .14); }
.mast-score dt { font: 500 10.5px var(--display); letter-spacing: .14em; text-transform: uppercase; color: rgba(244,241,236,.55); }
.mast-score dd {
  margin: 3px 0 0; font: 700 24px var(--display); color: #fff;
  font-variant-numeric: tabular-nums;
}

.welcome {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin-bottom: 20px;
  padding-bottom: 14px; border-bottom: 2px solid var(--ink);
}
.welcome h1 { font-family: var(--display); font-size: 27px; text-transform: uppercase; margin: 0; }
.welcome p { margin: 2px 0 0; color: var(--ink-3); font-size: 14px; }

/* --------------------------------------------------------- board lists ---- */

/* Anchor jumps should clear the sticky top bar rather than hide under it. */
.group, #boards { scroll-margin-top: calc(var(--bar-h) + 18px); }

.group { margin-bottom: 26px; }

.board-list { overflow: hidden; }
.board-row {
  display: grid; grid-template-columns: 42px minmax(0, 1fr) 120px 200px;
  align-items: center; gap: 16px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
}
.board-row:last-child { border-bottom: 0; }
.board-row:hover { background: var(--panel-2); text-decoration: none; }
.board-row .ico { color: var(--crimson); }
.b-icon {
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--rule); border-radius: var(--r2);
  background: var(--panel-2);
}
.b-name { font: 600 15.5px var(--body); display: flex; align-items: center; gap: 7px; }
.b-name .ico { color: var(--ink-3); }
.b-desc {
  display: block; margin-top: 1px; font-size: 13.5px; color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.b-counts { display: flex; gap: 14px; font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.b-counts b { display: block; color: var(--ink); font-weight: 600; font-size: 14.5px; }
.b-counts span { display: block; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; font-family: var(--display); }
.b-last { display: flex; align-items: center; gap: 9px; min-width: 0; }
.b-last-t { display: block; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-last-m { display: block; font-size: 12px; color: var(--ink-3); }

/* ------------------------------------------------------- thread tables ---- */

.crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); margin-bottom: 13px; flex-wrap: wrap; }
.crumb a { color: var(--ink-2); }
.crumb .ico { color: var(--rule-2); }
.crumb .here { color: var(--ink); font-weight: 500; }

.head-strip {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 18px 20px; margin-bottom: 16px;
}
.head-strip .b-icon { width: 46px; height: 46px; }
.head-strip .b-icon .ico { color: var(--crimson); }
.head-strip h1 { font-family: var(--display); font-size: 25px; text-transform: uppercase; margin: 0; }
.head-info { flex: 1; min-width: 200px; }
.head-info p { margin: 1px 0 0; color: var(--ink-3); font-size: 13.5px; }
.head-meta { margin-top: 5px; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.thread-list { overflow: hidden; }
.t-row {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) 110px 128px;
  align-items: center; gap: 14px;
  padding: 12px 18px; border-bottom: 1px solid var(--rule);
  color: var(--ink);
}
.t-row:last-child { border-bottom: 0; }
.t-row:hover { background: var(--panel-2); text-decoration: none; }
.t-row.pinned { background: var(--gold-wash); box-shadow: inset 3px 0 0 var(--gold); }
.t-title { font: 600 15px var(--body); display: block; }
.t-meta { display: block; margin-top: 1px; font-size: 12.5px; color: var(--ink-3); }
.t-counts { display: flex; gap: 12px; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.t-counts b { display: block; color: var(--ink); font-size: 14px; font-weight: 600; }
.t-counts span { display: block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; font-family: var(--display); }
.t-last { text-align: right; font-size: 12.5px; }
.t-last b { display: block; font-weight: 600; }
.t-last span { color: var(--ink-3); }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 7px; margin-right: 6px; border-radius: var(--r1);
  font: 600 10.5px var(--display); letter-spacing: .1em; text-transform: uppercase;
  vertical-align: 1px;
}
.chip-pin  { background: var(--gold-wash); color: var(--gold); }
.chip-lock { background: var(--panel-3); color: var(--ink-3); }
.chip-del  { background: var(--crimson-wash); color: var(--crimson); }

/* --------------------------------------------------------------- posts ---- */

.thread-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
  flex-wrap: wrap; padding: 18px 20px; margin-bottom: 14px;
}
.thread-top h1 { font-family: var(--display); font-size: 27px; line-height: 1.1; margin: 0 0 5px; }
.thread-top .head-meta { display: flex; align-items: center; gap: 8px; }
.thread-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.posts { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.post { overflow: hidden; }
.post.removed { opacity: .7; }
.post-by {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 18px; border-bottom: 1px solid var(--rule);
  background: var(--panel-2);
}
.post-who { flex: 1; min-width: 0; line-height: 1.25; }
.post-name { font: 600 14.5px var(--body); }
.post-sub { display: block; font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.post-no { font: 600 12.5px var(--display); letter-spacing: .08em; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.post-no:hover { color: var(--ink); }
.post-edit-note { font-size: 11.5px; color: var(--ink-3); font-style: italic; }
.post-body { padding: 16px 18px; font-size: 15px; line-height: 1.68; overflow-wrap: break-word; }
.post-body p { margin: 0 0 .85em; }
.post-body p:last-child { margin-bottom: 0; }
.post-img {
  display: block; max-width: min(100%, 460px); height: auto;
  margin: 8px 0; border-radius: var(--r2); border: 1px solid var(--rule);
  background: var(--panel-2);
}
.chat-img {
  display: block; max-width: min(100%, 260px); height: auto;
  margin: 4px 0 2px; border-radius: var(--r2); border: 1px solid var(--rule);
  background: var(--panel-2);
}
.chat-send { flex-wrap: wrap; }
.composer-bar.chat-bar { margin: 0 0 0 0; gap: 3px; }
.composer-bar.chat-bar button { width: 32px; height: 40px; }
.chat-send input[type="text"] { flex: 1; min-width: 140px; }
.mention { color: var(--crimson); font-weight: 600; }
.post-body a:not(.mention) { color: var(--crimson); text-decoration: underline; text-underline-offset: 2px; }

.quote {
  margin: 12px 0; padding: 11px 15px;
  background: var(--panel-2);
  border-left: 3px solid var(--rule-2);
  border-radius: 0 var(--r2) var(--r2) 0;
  font-size: 14px; color: var(--ink-2);
}
.quote-author { font: 600 12px var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }

.post-sig { margin: 0 18px; padding: 10px 0; border-top: 1px dashed var(--rule); font-size: 12.5px; color: var(--ink-3); }
.post-sig p { margin: 0; }

.post-tools {
  display: flex; align-items: center; gap: 2px; flex-wrap: wrap;
  padding: 8px 14px; border-top: 1px solid var(--rule);
}
.post-tools form { display: inline-flex; }
.tool {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border: 0; background: none; cursor: pointer;
  border-radius: var(--r2);
  font: 500 13px var(--body); color: var(--ink-3);
}
.tool:hover { background: var(--panel-2); color: var(--ink); text-decoration: none; }
.tool .ico { width: 16px; height: 16px; }
.tool.on { color: var(--crimson); }
.tool.on .ico { fill: var(--crimson-wash); }
.tool:disabled { opacity: .45; cursor: default; }
.tool:disabled:hover { background: none; color: var(--ink-3); }
.tool .num { font-variant-numeric: tabular-nums; }

.removed-note { padding: 14px 18px; color: var(--ink-3); font-style: italic; }
.mod-peek { margin: 0 18px 14px; padding: 12px 15px; background: var(--crimson-wash); border-radius: var(--r2); font-size: 14px; }

/* --------------------------------------------------------- mod dropdown -- */

.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-body {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 70;
  min-width: 216px; padding: 6px;
  background: var(--panel); border: 1px solid var(--rule);
  border-radius: var(--r3); box-shadow: var(--drop);
  display: flex; flex-direction: column; gap: 2px;
}
.menu-body form { display: flex; flex-direction: column; gap: 2px; }
.menu-body button, .menu-body a {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 11px; border: 0; background: none; cursor: pointer;
  border-radius: var(--r2); text-align: left;
  font: 500 13.5px var(--body); color: var(--ink);
}
.menu-body button:hover, .menu-body a:hover { background: var(--panel-2); text-decoration: none; }
.menu-body .ico { color: var(--ink-3); }
.menu-split { border-top: 1px solid var(--rule); margin-top: 4px; padding-top: 6px; }
/* While open, a menu is positioned against the viewport by app.js so no
   scrolling or clipping ancestor can cut it off. Without JS it stays absolute,
   which still works, just inside its container. */
.menu-body.floating,
.account-menu.floating {
  position: fixed;
  right: auto; bottom: auto;
  z-index: 200;
  overscroll-behavior: contain;
}

.menu-split select, .menu-body select, .menu-body input[type="text"] {
  width: 100%; height: 34px; padding: 0 9px; margin-bottom: 5px;
  border: 1px solid var(--rule); border-radius: var(--r2);
  background: var(--panel-2); color: var(--ink); font: 400 13px var(--body);
}

/* --------------------------------------------------------------- forms ---- */

.field { display: block; margin-bottom: 15px; }
.field-label { display: block; margin-bottom: 6px; font: 600 13px var(--body); }
.field-note { display: block; margin-top: 5px; font-size: 12.5px; color: var(--ink-3); }
.field-note-in { font-weight: 400; color: var(--ink-3); font-size: 12.5px; }

input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="number"], select, textarea {
  width: 100%; font: 400 14.5px var(--body); color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--rule); border-radius: var(--r2);
  outline: 0;
}
input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="number"], select { height: 42px; padding: 0 13px; }
textarea { padding: 12px 13px; line-height: 1.6; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--crimson); background: var(--panel); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }

.field-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 15px; }

.check { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 16px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check.tight { margin: 8px 0; }
.check input { margin-top: 3px; accent-color: var(--crimson); }
.radio-set { display: flex; flex-direction: column; gap: 6px; }
.radio {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 13px; border: 1px solid var(--rule); border-radius: var(--r2);
  font-size: 14px; cursor: pointer;
}
.radio:hover { border-color: var(--rule-2); }
.radio input { accent-color: var(--crimson); }

.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.form-note { font-size: 12.5px; color: var(--ink-3); }

.composer-bar { display: flex; gap: 4px; margin-bottom: 8px; flex-wrap: wrap; align-items: center; }
.composer-bar button {
  display: grid; place-items: center;
  width: 34px; height: 32px; border-radius: var(--r2);
  border: 1px solid var(--rule); background: var(--panel-2); cursor: pointer; color: var(--ink-2);
}
.composer-bar button:hover { color: var(--ink); border-color: var(--rule-2); }
.bar-split { width: 1px; height: 20px; background: var(--rule); margin: 0 3px; }
.gif-tag { font: 700 10px var(--display); letter-spacing: .06em; }

.composer { position: relative; }
.composer textarea.drop-target {
  border-color: var(--crimson); border-style: dashed;
  background: var(--crimson-wash);
}
.composer-status {
  margin-top: 7px; font-size: 12.5px; color: var(--ink-2);
  display: flex; align-items: center; gap: 7px;
}
.composer-status.bad { color: var(--crimson); }
.composer-hint { margin: 7px 0 0; font-size: 12px; color: var(--ink-3); }

/* ------------------------------------------------ emoji / GIF popovers ---- */

.pop {
  position: fixed; z-index: 210;
  display: flex; flex-direction: column;
  width: 340px; max-width: calc(100vw - 20px);
  background: var(--panel); border: 1px solid var(--rule-2);
  border-radius: var(--r3); box-shadow: var(--drop);
  overflow: hidden;
}
.pop-emoji { height: 372px; }
.pop-gif { width: 380px; height: 420px; }

.pop-head { position: relative; display: flex; gap: 7px; padding: 10px; border-bottom: 1px solid var(--rule); }
.pop-search { flex: 1; height: 34px; }
.skin-btn {
  width: 38px; height: 34px; flex: none;
  border: 1px solid var(--rule); border-radius: var(--r2);
  background: var(--panel-2); cursor: pointer; font-size: 15px; line-height: 1;
}
.skin-btn:hover { border-color: var(--rule-2); }
.skin-row {
  position: absolute; right: 10px; top: calc(100% - 4px); z-index: 3;
  display: flex; gap: 2px; padding: 4px;
  background: var(--panel); border: 1px solid var(--rule-2);
  border-radius: var(--r2); box-shadow: var(--drop);
}
.skin-swatch {
  width: 30px; height: 30px; border: 0; border-radius: var(--r1);
  background: none; cursor: pointer; font-size: 15px; line-height: 1;
}
.skin-swatch:hover, .skin-swatch.on { background: var(--panel-3); }

.pop-tabs { display: flex; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--rule); }
.pop-tab {
  flex: 1; height: 30px; border: 0; border-radius: var(--r2);
  background: none; cursor: pointer; font-size: 15px; line-height: 1;
}
.pop-tab:hover { background: var(--panel-2); }

.pop-body { flex: 1; overflow-y: auto; padding: 8px 10px 12px; overscroll-behavior: contain; }
.pop-empty { padding: 26px 12px; text-align: center; color: var(--ink-3); font-size: 13.5px; }
.pop-note { padding: 7px 10px; border-top: 1px solid var(--rule); font-size: 11px; color: var(--ink-3); }

.emoji-label {
  position: sticky; top: -8px; z-index: 1;
  margin: 6px 0 4px; padding: 4px 0;
  background: var(--panel);
  font: 600 10.5px var(--display); letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3);
}
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 1px; }
.emoji-btn {
  aspect-ratio: 1; border: 0; border-radius: var(--r2);
  background: none; cursor: pointer; font-size: 20px; line-height: 1;
  padding: 0;
}
.emoji-btn:hover { background: var(--panel-3); }

.gif-grid { columns: 2; column-gap: 6px; }
.gif-cell {
  display: block; width: 100%; margin: 0 0 6px; padding: 0;
  border: 1px solid var(--rule); border-radius: var(--r2);
  background: var(--panel-2); cursor: pointer; overflow: hidden;
  break-inside: avoid;
}
.gif-cell img { display: block; width: 100%; height: auto; }
.gif-cell:hover { border-color: var(--crimson); }

/* ----------------------------------------------------------- auth pages ---- */

.auth { width: 100%; max-width: 412px; margin: 26px auto 0; }
.auth-panel { padding: 30px 32px 26px; }
.auth-mark { display: flex; justify-content: center; margin-bottom: 18px; }
.auth-mark img { width: 172px; height: auto; }
.auth h1 {
  font-family: var(--display); font-weight: 700; font-size: 30px;
  text-transform: uppercase; text-align: center; margin: 0 0 6px; line-height: 1.05;
}
.auth-sub { text-align: center; color: var(--ink-3); font-size: 14px; margin: 0 0 20px; }
.auth-alt { text-align: center; font-size: 13.5px; color: var(--ink-3); margin: 16px 0 0; }
.auth-alt a, .auth-row a { color: var(--crimson); font-weight: 600; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 16px; font-size: 13.5px; }

/* -------------------------------------------------------------- avatars ---- */

.avatar { border-radius: 50%; object-fit: cover; background: var(--panel-3); flex: none; }

.badge {
  display: inline-flex; align-items: center;
  padding: 1px 7px; border-radius: var(--r1);
  font: 600 10.5px var(--display); letter-spacing: .11em; text-transform: uppercase;
  vertical-align: 1.5px;
}
.badge-admin { background: var(--crimson); color: #fff; }
.badge-mod   { background: var(--gold-wash); color: var(--gold); border: 1px solid var(--gold); }
.badge-ok    { background: var(--turf-wash); color: var(--turf); }
.badge-warn  { background: var(--gold-wash); color: var(--gold); }
.badge-bad   { background: var(--crimson-wash); color: var(--crimson); }

/* ----------------------------------------------------------- line score ---- */

.linescore { display: flex; margin: 0 0 16px; border: 1px solid var(--rule); border-radius: var(--r2); overflow: hidden; }
.linescore div { flex: 1; padding: 11px 8px; text-align: center; }
.linescore div + div { border-left: 1px solid var(--rule); }
.linescore dt { font: 500 10px var(--display); letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3); }
.linescore dd { margin: 2px 0 0; font: 700 19px var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
.linescore.light dd { font-size: 21px; }

/* ------------------------------------------------------- featured board ---- */

.board {
  padding: 20px; color: var(--ink-invert);
  background: var(--dark); border-color: var(--dark-rule);
  position: relative; overflow: hidden;
}
.board::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(64deg, rgba(255,255,255,.04) 0 2px, transparent 2px 13px);
  pointer-events: none;
}
.board > * { position: relative; }
.board-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.board-flag {
  padding: 3px 9px; background: var(--crimson); color: #fff;
  font: 600 10.5px var(--display); letter-spacing: .13em; text-transform: uppercase;
  border-radius: var(--r1);
}
.board-forum { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: rgba(244,241,236,.6); }
.board-title { font-family: var(--display); font-size: 21px; line-height: 1.15; margin: 0 0 12px; }
.board-title a { color: #fff; }
.board-by { display: flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(244,241,236,.68); margin-bottom: 15px; }
.board-by b { color: #fff; font-weight: 600; }
.board .linescore { border-color: rgba(255,255,255,.15); }
.board .linescore div + div { border-left-color: rgba(255,255,255,.15); }
.board .linescore dt { color: rgba(244,241,236,.55); }
.board .linescore dd { color: #fff; }

/* ---------------------------------------------------------------- feed ---- */

.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.feed li { display: flex; gap: 10px; }
.feed-title {
  display: block; font-size: 13.5px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.feed-meta { display: block; margin-top: 1px; font-size: 12px; color: var(--ink-3); }
.newest { margin: 12px 0 0; font-size: 13px; color: var(--ink-3); }
.newest a { color: var(--ink); font-weight: 600; }

/* --------------------------------------------------------- empty states ---- */

.blank { padding: 46px 24px; text-align: center; }
.blank.tall { padding: 90px 24px; }
.blank .ico { margin: 0 auto 12px; color: var(--rule-2); }
.blank h3 { font-family: var(--display); font-size: 19px; text-transform: uppercase; margin: 0 0 4px; }
.blank p { margin: 0; color: var(--ink-3); font-size: 14px; }

/* ---------------------------------------------------------- pagination ---- */

.pager { display: flex; gap: 5px; align-items: center; margin: 18px 0; flex-wrap: wrap; }
.pg {
  display: grid; place-items: center; min-width: 36px; height: 36px; padding: 0 9px;
  border: 1px solid var(--rule); border-radius: var(--r2);
  font: 500 13.5px var(--body); color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.pg:hover { border-color: var(--rule-2); color: var(--ink); text-decoration: none; }
.pg.active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.pg-gap { color: var(--ink-3); padding: 0 2px; }

/* --------------------------------------------------------- page headers ---- */

.page-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-top h1 { font-family: var(--display); font-size: 27px; text-transform: uppercase; margin: 0; }
.tally {
  font: 600 13px var(--body); color: var(--ink-3); font-variant-numeric: tabular-nums;
  border: 1px solid var(--rule); border-radius: var(--r1); padding: 2px 9px; vertical-align: 3px;
}
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filters input[type="search"], .filters select { height: 38px; width: auto; min-width: 150px; }

/* -------------------------------------------------------------- members ---- */

.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 12px; }
.member {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 5px;
  padding: 20px 14px; color: var(--ink);
}
.member:hover { border-color: var(--rule-2); text-decoration: none; }
.member-name { font: 600 15px var(--body); }
.member-sub { font-size: 12.5px; color: var(--ink-2); }
.member-meta { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------------- profile ---- */

.profile { overflow: hidden; margin-bottom: 18px; }
.profile-band { height: 92px; background: var(--dark); position: relative; overflow: hidden; }
.profile-band::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(64deg, rgba(255,255,255,.05) 0 2px, transparent 2px 13px);
}
.profile-band::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--crimson); }
/* Positioned so the avatar overlaps the band; without this the band's own
   positioned pseudo-elements paint over it. */
.profile-id {
  position: relative; z-index: 1;
  display: flex; align-items: flex-end; gap: 16px; padding: 0 22px 16px; margin-top: -34px; flex-wrap: wrap;
}
.profile-id .avatar { border: 3px solid var(--panel); }
.profile-who { flex: 1; min-width: 190px; padding-top: 38px; }
.profile-who h1 { font-family: var(--display); font-size: 26px; text-transform: uppercase; margin: 0 0 3px; }
.profile-meta { font-size: 13px; color: var(--ink-3); }
.profile-acts { display: flex; gap: 8px; padding-top: 38px; }
.live { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--rule-2); margin-right: 5px; }
.live.on { background: var(--turf); }
.profile .linescore { margin: 0 22px 20px; max-width: 420px; }

.post-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.post-log li { padding: 13px 0; border-bottom: 1px solid var(--rule); }
.post-log li:last-child { border-bottom: 0; padding-bottom: 0; }
.post-log a { font-weight: 600; font-size: 14.5px; }
.post-log p { margin: 3px 0 2px; font-size: 13.5px; color: var(--ink-2); }
.post-log time { font-size: 12px; color: var(--ink-3); }

/* --------------------------------------------------------------- search ---- */

.search-box { display: flex; gap: 9px; margin-bottom: 16px; }
.search-box input { height: 44px; }
.hit { padding: 15px 18px; margin-bottom: 10px; }
.hit-title { font: 600 15.5px var(--body); }
.hit-snip { margin: 5px 0 7px; font-size: 13.5px; color: var(--ink-2); }
.hit-meta { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-3); }
.result-count { margin: 0 0 12px 2px; font-size: 13.5px; color: var(--ink-3); }

/* -------------------------------------------------------- notifications ---- */

.notif-list { overflow: hidden; }
.notif {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 18px; border-bottom: 1px solid var(--rule); color: var(--ink);
}
.notif:last-child { border-bottom: 0; }
.notif:hover { background: var(--panel-2); text-decoration: none; }
.notif.new { background: var(--crimson-wash); box-shadow: inset 3px 0 0 var(--crimson); }
.notif-txt { flex: 1; font-size: 14px; }
.notif-txt time { display: block; font-size: 12px; color: var(--ink-3); margin-top: 1px; }

/* ------------------------------------------------------------- messages ---- */

.dm { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.dm-side { padding: 12px; }
.dm-list { display: flex; flex-direction: column; gap: 2px; max-height: 540px; overflow-y: auto; margin-top: 10px; }
.dm-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r2); color: var(--ink); }
.dm-item:hover { background: var(--panel-2); text-decoration: none; }
.dm-item.active { background: var(--crimson-wash); box-shadow: inset 3px 0 0 var(--crimson); }
.dm-item.new .dm-who { font-weight: 700; }
.dm-txt { flex: 1; min-width: 0; }
.dm-who { display: block; font-size: 14px; font-weight: 600; }
.dm-prev { display: block; font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-when { font-size: 11.5px; color: var(--ink-3); flex: none; }
.dm-main { display: flex; flex-direction: column; min-height: 460px; }
.dm-head { display: flex; align-items: center; gap: 10px; padding: 13px 18px; border-bottom: 1px solid var(--rule); }
.dm-head b { font-size: 15px; }
.dm-thread { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; max-height: 460px; }
.bubble-row { display: flex; gap: 8px; align-items: flex-end; max-width: 76%; }
.bubble-row.mine { align-self: flex-end; flex-direction: row-reverse; }
.bubble { padding: 9px 13px; border-radius: var(--r3); background: var(--panel-2); border: 1px solid var(--rule); font-size: 14px; line-height: 1.5; }
.bubble-row.mine .bubble { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.bubble time { display: block; margin-top: 3px; font-size: 10.5px; opacity: .65; }
.dm-send { display: flex; gap: 9px; padding: 13px 16px; border-top: 1px solid var(--rule); align-items: flex-end; }
.dm-compose { padding: 24px; max-width: 460px; }

/* ----------------------------------------------------------------- chat ---- */

/* Nick colors go through variables so each theme picks a version that holds
   contrast on its own background. Defaults here are the light set. */
.nick-0 { color: var(--n0); } .nick-1 { color: var(--n1); }
.nick-2 { color: var(--n2); } .nick-3 { color: var(--n3); }
.nick-4 { color: var(--n4); } .nick-5 { color: var(--n5); }
.nick-6 { color: var(--n6); } .nick-7 { color: var(--n7); }

/* Room fills what is left of the viewport, and the log scrolls inside it
   rather than growing the page. */
.chat {
  display: grid; grid-template-columns: minmax(0, 1fr) 212px; gap: 14px;
  height: calc(100vh - var(--bar-h) - 148px);
  min-height: 420px;
}
.chat-main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.chat-head {
  display: flex; align-items: center; gap: 11px; flex-wrap: wrap;
  padding: 11px 16px;
  background: var(--panel-2); border-bottom: 1px solid var(--rule);
  border-radius: var(--r3) var(--r3) 0 0;
}
.chat-room { font: 700 17px var(--display); letter-spacing: .02em; }
.chat-room .hash { color: var(--crimson); }
.chat-topic { font-size: 12.5px; color: var(--ink-3); }
.chat-state {
  margin-left: auto; display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--ink-3); text-transform: uppercase;
  letter-spacing: .09em; font-family: var(--display); font-weight: 600;
}

.chat-log {
  flex: 1; min-height: 0; overflow-y: auto;
  margin: 0; padding: 10px 6px 12px; list-style: none;
  font-size: 14px; line-height: 1.5;
  overscroll-behavior: contain;
  display: flex; flex-direction: column;
}
/* An auto-margin spacer pins a short backlog to the bottom of the pane, the way
   a chat client does, without breaking scrolling once it overflows. */
.chat-log::before { content: ""; margin-top: auto; }
.chat-line {
  position: relative; flex: none;
  padding: 3px 34px 3px 12px;
  border-radius: var(--r1);
  overflow-wrap: break-word;
}
.chat-line:hover { background: var(--panel-2); }
.chat-time {
  display: inline-block; min-width: 38px;
  color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums;
  user-select: none;
}
.chat-nick { font-weight: 700; margin-right: 5px; }
.chat-nick::after { content: ""; }
.chat-body { color: var(--ink); }
.chat-body a { text-decoration: underline; text-underline-offset: 2px; }
.chat-line.action .chat-body { font-style: italic; color: var(--ink-2); }
.chat-line.action .chat-body::before { content: "\2022  "; color: var(--ink-3); font-style: normal; }
.chat-line.system .chat-body { color: var(--ink-3); font-size: 13px; font-style: italic; }
.chat-line.mentions-me { background: var(--gold-wash); box-shadow: inset 3px 0 0 var(--gold); }

.chat-del {
  position: absolute; right: 6px; top: 3px;
  width: 22px; height: 22px; line-height: 1;
  border: 0; background: none; cursor: pointer;
  color: var(--ink-3); font-size: 17px; border-radius: var(--r1);
  opacity: 0;
}
.chat-line:hover .chat-del { opacity: 1; }
.chat-del:hover { background: var(--crimson-wash); color: var(--crimson); }

.chat-send { display: flex; gap: 8px; padding: 11px 12px; border-top: 1px solid var(--rule); }
.chat-send input { flex: 1; height: 40px; }
.chat-hint {
  margin: 0; padding: 0 14px 10px;
  font-size: 11.5px; color: var(--ink-3);
}
.chat-hint code {
  background: var(--panel-2); border: 1px solid var(--rule);
  padding: 1px 5px; border-radius: var(--r1); font-size: 11px;
}

.ulink-quiet { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }
.ulink-quiet:hover { color: var(--crimson); }

.chat-side { display: flex; flex-direction: column; padding: 14px; overflow: hidden; }
.chat-side .rule-head { margin-bottom: 10px; }
.chat-users {
  list-style: none; margin: 0; padding: 0;
  flex: 1; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 1px;
}
.chat-users li {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 7px; border-radius: var(--r2);
  font-size: 13.5px; font-weight: 600;
}
.chat-users li:hover { background: var(--panel-2); }
.chat-users .badge { margin-left: auto; }

/* Rules gate shown before first entry */
.gate-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 4px; }
.gate-head .ico { color: var(--crimson); flex: none; margin-top: 2px; }
.gate-rules {
  max-height: 340px; overflow-y: auto;
  margin: 16px 0; padding: 16px 18px;
  background: var(--panel-2); border: 1px solid var(--rule); border-radius: var(--r2);
  font-size: 14.5px;
}
.gate-accept { border-top: 1px solid var(--rule); padding-top: 16px; }

/* ---------------------------------------------------------------- admin ---- */

.admin-tabs { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-tabs .tab.active { background: var(--crimson); border-color: var(--crimson); color: #fff; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(146px, 1fr)); gap: 10px; margin-bottom: 18px; }
.tile { padding: 15px 16px; }
.tile.warn { border-color: var(--crimson); box-shadow: inset 3px 0 0 var(--crimson); }
.tile dt { font: 500 10.5px var(--display); letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3); }
.tile dd { margin: 3px 0 0; font: 700 27px var(--display); font-variant-numeric: tabular-nums; }
.tile small { display: block; font-size: 12px; color: var(--ink-3); }

.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 740px; }
table.grid th {
  text-align: left; padding: 12px 15px; border-bottom: 1px solid var(--rule);
  font: 600 11px var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3);
}
table.grid td { padding: 10px 15px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid tbody tr:hover td { background: var(--panel-2); }
/* Keep this a real table cell. Making the <td> a flex container drops it out of
   table layout, so its height and bottom border stop matching the rest of the
   row. Align the avatar and name inline instead. */
table.grid .cell-user { white-space: nowrap; }
table.grid .cell-user .avatar { display: inline-block; vertical-align: middle; margin-right: 9px; }
table.grid .cell-user a { vertical-align: middle; }
.row-off { opacity: .55; }
.clip { max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { background: var(--panel-3); padding: 2px 7px; border-radius: var(--r1); font-size: 12px; font-family: var(--body); }

.report { padding: 16px 18px; margin-bottom: 12px; }
.report-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; font-size: 13.5px; }
.reason {
  padding: 2px 8px; border-radius: var(--r1); background: var(--crimson-wash); color: var(--crimson);
  font: 600 10.5px var(--display); letter-spacing: .11em; text-transform: uppercase;
}
.report-note { font-size: 13.5px; color: var(--ink-2); margin: 4px 0 8px; }
.report-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.report-acts form { display: flex; gap: 8px; flex-wrap: wrap; }

.stack { margin-bottom: 16px; }
.editor-row { padding: 12px 0; border-top: 1px solid var(--rule); }
.editor-row > summary { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14.5px; list-style: none; }
.editor-row > summary::-webkit-details-marker { display: none; }
.editor-row .ico { color: var(--crimson); }
.editor-form { margin-top: 13px; padding: 16px; background: var(--panel-2); border: 1px solid var(--rule); border-radius: var(--r2); }
.inline-form { display: flex; gap: 8px; margin: 10px 0 2px; flex-wrap: wrap; align-items: center; }
.inline-form input[type="text"] { width: auto; flex: 1; min-width: 160px; height: 36px; }
.inline-form input[type="number"] { width: 72px; height: 36px; }

.icon-pick { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.icon-pick label { cursor: pointer; }
.icon-pick input { position: absolute; opacity: 0; pointer-events: none; }
.icon-pick span {
  display: grid; place-items: center; width: 36px; height: 36px;
  border: 1px solid var(--rule); border-radius: var(--r2); background: var(--panel);
  color: var(--ink-2);
}
.icon-pick label:hover span { border-color: var(--rule-2); color: var(--ink); }
.icon-pick input:checked + span { border-color: var(--crimson); color: var(--crimson); background: var(--crimson-wash); }
.pick-group { font: 600 10.5px var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin: 10px 0 2px; }

.avatar-edit { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.avatar-edit form { display: flex; flex-direction: column; gap: 8px; }
input[type="file"] { font-size: 13px; color: var(--ink-2); background: none; border: 0; padding: 0; height: auto; }
.file-acts { display: flex; gap: 8px; }
.test-mail { margin-top: 12px; padding-top: 13px; border-top: 1px dashed var(--rule); }

/* --------------------------------------------------------------- footer ---- */

.foot { border-top: 1px solid var(--rule); background: var(--panel); margin-top: 36px; }
.foot-in { max-width: 1260px; margin: 0 auto; padding: 26px 24px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 36px; }
.foot-mark { display: inline-block; }
.foot-mark img { height: 60px; width: auto; display: block; }
.foot-in p { margin: 10px 0 0; color: var(--ink-3); font-size: 13px; max-width: 44ch; }
.foot-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.foot-nav a { font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
.foot-legal { grid-column: 1 / -1; font-size: 12.5px; color: var(--ink-3); margin-top: 12px !important; }

/* ------------------------------------------------------------- responsive -- */

@media (max-width: 1080px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .col-side { position: static; }
  .dm { grid-template-columns: minmax(0, 1fr); }
  .dm-side { order: 2; }
  .tb-search { width: 210px; }
}

@media (max-width: 940px) {
  .rail { display: none; }
  .frame { margin-left: 0; }
  .tb-menu { display: grid; }
  .tb-brand { display: block; }
  .tb-tabs { display: none; }
  .drawer[hidden] { display: none; }
  .drawer { display: flex; }
  .masthead { grid-template-columns: minmax(0, 1fr); }
  .board-row { grid-template-columns: 42px minmax(0, 1fr); }
  .b-counts, .b-last { display: none; }
  .t-row { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .t-last { display: none; }
}

@media (max-width: 860px) {
  .chat { grid-template-columns: minmax(0, 1fr); height: auto; }
  .chat-main { height: calc(100vh - var(--bar-h) - 220px); min-height: 380px; }
  .chat-side { max-height: 220px; }
  .chat-users { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .chat-users li { background: var(--panel-2); }
}

@media (max-width: 720px) {
  .tb-search { display: none; }
  .chat-topic { display: none; }
  .account-id { display: none; }
  .content { padding: 18px 16px 44px; }
  .field-2 { grid-template-columns: 1fr; }
  .foot-in { grid-template-columns: 1fr; }
  .panel.pad, .head-strip, .thread-top { padding: 15px 16px; }
  .auth-panel { padding: 24px 20px; }
  .post-body { padding: 14px 16px; }
  .masthead { padding: 24px 20px; }
  .mast-score { width: 100%; }
  .profile-id, .profile .linescore { padding-left: 16px; padding-right: 16px; }
  .profile .linescore { margin-left: 0; margin-right: 0; }
}
