/* Super Mario Odyssey look: Cappy red, Power Moon gold, the cream of the database folder icon, and a night sky in
   dark mode */

@font-face {
  font-family: "Fredoka";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fredoka.woff2") format("woff2");
}

:root {
  --bg: #eef7ff;
  --bg-sky: linear-gradient(180deg, #d7ecff 0%, #eef7ff 280px, #fbf6ea 100%);
  --surface: #ffffff;
  --surface-2: #fff8e8;
  --text: #22253a;
  --muted: #697089;
  --line: #e6e3da;
  --line-strong: #d4cfc2;
  --accent: #d8232a;
  --accent-text: #ffffff;
  --gold: #f2b705;
  --gold-text: #8a5a00;
  --yes-bg: #c6ecd1;
  --yes-text: #12602c;
  --no-bg: #fbd9d5;
  --no-text: #96231b;
  --hell: #c81d25;
  --god: #b07400;
  --elite: #7a3fd6;
  --elite-on: #ffffff;
  --server: #1769c4;
  --me-bg: #fff1c7;
  --header: linear-gradient(135deg, #e8343a 0%, #c4161f 60%, #a10f17 100%);
  --header-text: #ffffff;
  --shadow: 0 4px 18px rgba(40, 52, 90, 0.1);
  --toast-bg: #22253a;
  --toast-text: #ffffff;
  --error: #c81d25;
  --display: "Fredoka", system-ui, sans-serif;
  --side-w: 210px;
  --col-w: 112px;
  --row-h: 26px;
  --head-h: 112px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1129;
    --bg-sky: linear-gradient(180deg, #121a45 0%, #0c1129 60%, #0a0e22 100%);
    --surface: #161d42;
    --surface-2: #1d2552;
    --text: #eef0fb;
    --muted: #a3aacb;
    --line: #262f5c;
    --line-strong: #364074;
    --accent: #ec3640;
    --accent-text: #ffffff;
    --gold: #ffcf3a;
    --gold-text: #ffd95e;
    --yes-bg: #1c5a39;
    --yes-text: #bdf3cf;
    --no-bg: #5a2230;
    --no-text: #ffc9cc;
    --hell: #f2545b;
    --god: #ffcf3a;
    --elite: #c3a1ff;
    --elite-on: #24124a;
    --server: #7db8ff;
    --me-bg: #3a3462;
    --header: linear-gradient(135deg, #c8222a 0%, #9a1219 60%, #6e0c12 100%);
    --shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
    --toast-bg: #eef0fb;
    --toast-text: #161d42;
    --error: #ec3640;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0c1129;
  --bg-sky: linear-gradient(180deg, #121a45 0%, #0c1129 60%, #0a0e22 100%);
  --surface: #161d42;
  --surface-2: #1d2552;
  --text: #eef0fb;
  --muted: #a3aacb;
  --line: #262f5c;
  --line-strong: #364074;
  --accent: #ec3640;
  --accent-text: #ffffff;
  --gold: #ffcf3a;
  --gold-text: #ffd95e;
  --yes-bg: #1c5a39;
  --yes-text: #bdf3cf;
  --no-bg: #5a2230;
  --no-text: #ffc9cc;
  --hell: #f2545b;
  --god: #ffcf3a;
  --elite: #c3a1ff;
  --elite-on: #24124a;
  --server: #7db8ff;
  --me-bg: #3a3462;
  --header: linear-gradient(135deg, #c8222a 0%, #9a1219 60%, #6e0c12 100%);
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  --toast-bg: #eef0fb;
  --toast-text: #161d42;
  --error: #ec3640;
  color-scheme: dark;
}

@media (max-width: 640px) {
  :root {
    --side-w: 118px;
    --col-w: 84px;
    --row-h: 30px;
    --head-h: 96px;
  }
}

* { box-sizing: border-box; }

/* scrollbars in the theme's colours (a white bar on the night sky stood out). Firefox only takes the colours, not a
   size; the grid has scrollbars of its own (.scrollbar) */
* { scrollbar-color: color-mix(in srgb, var(--muted) 65%, transparent) transparent; }
::-webkit-scrollbar { width: 14px; height: 14px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 55%, transparent); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--muted) 80%, transparent); }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  background-image: var(--bg-sky);
  background-attachment: fixed;
  color: var(--text);
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

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

/* header: a Cappy-red band */
.top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 10px 16px;
  background: var(--header);
  color: var(--header-text);
  box-shadow: 0 2px 10px rgba(120, 10, 20, 0.25);
  position: relative;
  z-index: 2;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img {
  width: 42px;
  height: 42px;
  flex: none;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
}
.brand h1 {
  font: 700 22px/1 var(--display);
  margin: 0;
  white-space: nowrap;
  letter-spacing: 0.3px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
}
.brand .sub { display: block; font: 500 12px/1.2 var(--display); opacity: 0.85; margin-top: 3px; }

.theme-toggle {
  flex: none;
  margin-left: -4px;
  width: 36px;
  height: 36px;
  font-size: 17px;
  line-height: 1;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.14);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
  /* the icon dead centre: no padding (iPhones add some to buttons) */
  display: grid;
  place-items: center;
  padding: 0;
}
.theme-toggle:hover { background: rgba(255, 255, 255, 0.28); transform: rotate(-12deg); }

.user { display: flex; align-items: center; gap: 10px; font-size: 13px; white-space: nowrap; }
.user .muted { opacity: 0.8; }
.button {
  font: 600 13px/1.2 var(--display);
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--line-strong);
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.08s ease, border-color 0.15s ease;
}
.button:hover { border-color: var(--accent); color: var(--accent); }
.button:active { transform: translateY(1px); }
.top .button { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.5); color: #fff; }
.top .button:hover { background: rgba(255, 255, 255, 0.26); border-color: #fff; color: #fff; }
.top .button.primary { background: #5865f2; border-color: #5865f2; }
.top .button.primary:hover { background: #4752c4; border-color: #4752c4; }

/* tabs: pills on a cream bar */
.tabs {
  display: flex;
  gap: 6px;
  padding: 9px 16px;
  overflow-x: auto;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}
.tabs button {
  font: 600 14px/1 var(--display);
  white-space: nowrap;
  color: var(--muted);
  background: transparent;
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 7px 13px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.tabs button:hover { color: var(--text); background: var(--surface); }
.tabs button.hell { color: var(--hell); }
.tabs button.god { color: var(--god); }
.tabs button.elite { color: var(--elite); }
.tabs button[aria-selected="true"] {
  color: var(--accent-text);
  background: var(--accent);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
}
.tabs button.hell[aria-selected="true"] { background: var(--hell); color: #fff; }
.tabs button.god[aria-selected="true"] { background: var(--gold); color: #4a3000; }
.tabs button.elite[aria-selected="true"] { background: var(--elite); color: var(--elite-on); }
.tabs button.main-server { color: var(--server); }
.tabs button.main-server[aria-selected="true"] { background: var(--server); color: var(--surface); }
.tabs .sep { width: 2px; border-radius: 2px; background: var(--line-strong); margin: 4px 4px; flex: none; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
}
.toolbar input:not([type="checkbox"]) {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  width: 220px;
  max-width: 100%;
  box-shadow: var(--shadow);
}
.toolbar input:not([type="checkbox"]):focus { outline: none; border-color: var(--accent); }
.toolbar select {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  max-width: 200px;
  box-shadow: var(--shadow);
}
.toolbar select:focus { outline: none; border-color: var(--accent); }
/* a difficulty tab's filter menus: the same menus as Player Info, shaped like the toolbar's search boxes */
.grid-menus { display: flex; flex-wrap: wrap; gap: 8px; }
.grid-menus .field > span { display: none; }
.toolbar .multi summary {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 6px 28px 6px 14px;
  width: 190px;
  box-shadow: var(--shadow);
}
.toolbar .multi[open] summary { border-color: var(--accent); }
.info { color: var(--muted); font-size: 12px; margin-left: auto; }

.notice {
  margin: 0 16px 10px;
  padding: 9px 14px;
  border: 2px dashed var(--gold);
  border-radius: 12px;
  background: var(--surface);
  font-size: 13px;
}

main { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0 16px 16px; }
.loading, .empty { color: var(--muted); font-family: var(--display); }

/* the sheet grid: a corner, the jump names, the player names and the cells, only the visible ones drawn */
.grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--side-w) 1fr var(--bar);
  grid-template-rows: var(--head-h) 1fr var(--bar);
  --bar: 15px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.corner {
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--muted);
}
.corner strong { color: var(--text); font: 700 18px/1.1 var(--display); }
/* A–Z / Most jumps, at the top of the corner */
.corner .segmented { align-self: flex-start; margin-bottom: auto; padding: 3px; gap: 2px; box-shadow: none; }
.corner .segmented button { padding: 5px 10px; font-size: 12px; white-space: nowrap; }
.corner .narrow { display: none; }
.head-wrap, .side-wrap { overflow: hidden; position: relative; }
.head-wrap { border-bottom: 1px solid var(--line-strong); background: var(--surface-2); }
.side-wrap { border-right: 1px solid var(--line-strong); }
.head, .side { position: absolute; top: 0; left: 0; will-change: transform; }
.corner { grid-area: 1 / 1; }
.head-wrap { grid-area: 1 / 2 / 2 / 4; }
.side-wrap { grid-area: 2 / 1 / 4 / 2; }
.body { grid-area: 2 / 2; overflow: auto; position: relative; scrollbar-width: none; }
.body::-webkit-scrollbar { display: none; }
/* the grid's own scrollbars (see gridScrollbar) */
.scrollbar { position: relative; background: var(--surface-2); touch-action: none; }
.sb-x { grid-area: 3 / 2; border-top: 1px solid var(--line); }
.sb-y { grid-area: 2 / 3; border-left: 1px solid var(--line); }
.grid.no-y { grid-template-columns: var(--side-w) 1fr 0; }
.grid.no-y .sb-y { display: none; }
.scrollbar .thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 55%, transparent);
  cursor: grab;
}
.sb-x .thumb { bottom: 2px; }
.sb-y .thumb { right: 2px; }
.scrollbar .thumb:hover { background: color-mix(in srgb, var(--muted) 85%, transparent); }
.scrollbar .thumb:active { background: var(--accent); cursor: grabbing; }
.scrollbar.idle .thumb { display: none; }
.cells { position: absolute; top: 0; left: 0; }

.h {
  position: absolute;
  top: 0;
  width: var(--col-w);
  height: var(--head-h);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.h .name {
  flex: 1;
  padding: 6px 7px 0;
  font-size: 12px;
  line-height: 15px;
  font-weight: 600;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}
.h .count {
  height: 22px;
  padding: 0 7px;
  font-size: 12px;
  color: var(--gold-text);
  font-weight: 600;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}

.s {
  position: absolute;
  left: 0;
  width: var(--side-w);
  height: var(--row-h);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  font-size: 13px;
}
.s .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s .name small { color: var(--muted); }
.s .count { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }
.s.me { background: var(--me-bg); font-weight: 600; }

.c {
  position: absolute;
  width: var(--col-w);
  height: var(--row-h);
  border-right: 1px solid var(--surface);
  border-bottom: 1px solid var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  user-select: none;
}
/* the crosshair: the hovered cell's row and column */
.band { position: absolute; pointer-events: none; z-index: 1; }
.band-row { left: 0; height: var(--row-h); background: rgba(242, 183, 5, 0.18); box-shadow: inset 0 2px 0 var(--gold), inset 0 -2px 0 var(--gold); }
.band-col { top: 0; width: var(--col-w); background: rgba(242, 183, 5, 0.18); box-shadow: inset 2px 0 0 var(--gold), inset -2px 0 0 var(--gold); }
.h.hover { background: color-mix(in srgb, var(--gold) 28%, transparent); }
.s.hover { background: color-mix(in srgb, var(--gold) 28%, transparent); }
.c.y { background: var(--yes-bg); color: var(--yes-text); }
.c.n { background: var(--no-bg); color: var(--no-text); }

/* Main Server: strips naming the kingdom (top row) and difficulty (second row) over their columns, and a line where
   the next one starts */
.grid.strips { --head-h: 160px; --strip-h: 24px; }
.grid.strips .h { top: calc(2 * var(--strip-h)); height: calc(var(--head-h) - 2 * var(--strip-h)); }
.strip {
  position: absolute;
  height: var(--strip-h);
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--surface);
  background: var(--line);
  color: var(--text);
  font: 700 12px/var(--strip-h) var(--display);
}
.strip.row0 { top: 0; }
.strip.row1 { top: var(--strip-h); }
.strip span { display: inline-block; padding: 0 8px; }
.strip.kingdom { background: var(--server); color: var(--surface); font-size: 13px; }
.strip small { font-weight: 500; opacity: 0.75; }
.strip.hell { background: var(--hell); color: #fff; }
.strip.god { background: var(--gold); color: #4a3000; }
.strip.elite { background: var(--elite); color: var(--elite-on); }
.h.first-d, .c.first-d { box-shadow: inset 2px 0 0 var(--line-strong); }
.h.first-k, .c.first-k { box-shadow: inset 3px 0 0 var(--server); }

/* tables: leaderboard and Player Info */
.board {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.board table { border-collapse: separate; border-spacing: 0; font-size: 13px; width: max-content; min-width: 100%; }
.board th, .board td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.board th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  z-index: 1;
  font: 600 13px/1.25 var(--display);
  color: var(--muted);
}
.board th.hell { color: var(--hell); }
.board th.god { color: var(--god); }
.board th.elite { color: var(--elite); }
.board .rank, .board .player { text-align: left; }
.board td.player { font-weight: 600; }
.board td.zero { color: color-mix(in srgb, var(--muted) 60%, transparent); } /* not opacity: that fades the row's hover colour too */
.board td.total { font: 700 15px/1 var(--display); }
.board tbody tr:hover td { background: var(--surface-2); }
.board tr.me td { background: var(--me-bg); }
.board .player small { color: var(--muted); font-weight: 400; }
.board th small { font-weight: 500; opacity: 0.8; }
.board td.bar { width: 170px; min-width: 120px; }
.board td.bar span { display: block; height: 12px; border-radius: 999px; }
.board th.bar-head { text-align: left; }

/* rank: a gold, silver and bronze Power Moon for the top three */
.medal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 999px;
  font: 700 13px/1 var(--display);
  color: var(--muted);
}
.medal.m1, .medal.m2, .medal.m3 { color: #3d2a00; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18); }
.medal.m1 { background: radial-gradient(circle at 35% 30%, #fff3b0, #f2b705 70%); }
.medal.m2 { background: radial-gradient(circle at 35% 30%, #ffffff, #b9bfcc 70%); }
.medal.m3 { background: radial-gradient(circle at 35% 30%, #ffd9b0, #c27a3c 70%); }

/* which difficulties count on the leaderboard */
.board-page { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.board-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.segmented button {
  font: 600 13px/1 var(--display);
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }
.board-custom {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 13px;
}
.custom-group { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.custom-group label { white-space: nowrap; cursor: pointer; }
.custom-group input { accent-color: var(--accent); }
.link {
  font: 700 14px/1 var(--display);
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  min-width: 56px;
  text-align: left;
  cursor: pointer;
}

/* Player Info */
.find-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 13px;
}
.find-controls .field { display: flex; flex-direction: column; gap: 3px; color: var(--muted); font: 600 12px/1.2 var(--display); }
.find-controls .grow { flex: 1; min-width: 180px; }
.find-controls select, .find-controls input:not([type="checkbox"]), .multi summary {
  font: 14px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 5px 9px;
  max-width: 260px;
}
.find-controls select:focus, .find-controls input:not([type="checkbox"]):focus { outline: none; border-color: var(--accent); }
.find-controls .grow input { max-width: none; }
.picker { position: relative; display: block; }
.picker input { width: 220px; }
.picker .suggestions { font: 14px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; right: auto; min-width: 100%; width: max-content; max-width: min(360px, 90vw); max-height: 50vh; }
.picker .suggestions .aka { font-size: 12px; }
.picked-players .chips { min-height: 34px; align-items: center; }

/* a filter menu: a box that opens a list of checkboxes */
.multi { position: relative; }
.multi summary {
  list-style: none;
  cursor: pointer;
  width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 26px;
  position: relative;
}
.multi summary::-webkit-details-marker { display: none; }
.multi summary::after { content: "▾"; position: absolute; right: 9px; color: var(--muted); }
.multi[open] summary, .multi summary:focus-visible { outline: none; border-color: var(--accent); }
.multi-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 100%;
  width: max-content;
  max-width: min(340px, 90vw);
  max-height: 55vh;
  overflow: auto;
  padding: 8px 10px;
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 10px 30px rgba(20, 25, 60, 0.3);
  font: 14px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.multi:not([open]) .multi-menu { display: none; } /* Firefox lays out a closed menu's contents, which stuck out on phones */
.multi-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin-bottom: 4px; }
.multi-top [data-clear] { margin-left: auto; }
.segmented.small { padding: 3px; box-shadow: none; background: var(--surface-2); }
.segmented.small button { padding: 5px 10px; font-size: 12px; white-space: nowrap; }
.multi-menu label { display: flex; align-items: center; gap: 7px; padding: 3px 4px; border-radius: 8px; cursor: pointer; }
.multi-menu label:hover { background: var(--surface-2); }
.multi-menu label small { color: var(--muted); margin-left: auto; padding-left: 10px; font-variant-numeric: tabular-nums; }
.multi-menu label[hidden] { display: none; }
.multi-search {
  margin: 2px 0 6px;
  padding: 6px 10px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.multi-search:focus { outline: none; border-color: var(--accent); }
.multi-menu input { accent-color: var(--accent); margin: 0; }
.multi-group { display: flex; flex-direction: column; gap: 2px; padding: 4px 0; border-top: 1px solid var(--line); }
.multi-group:first-of-type { border-top: none; }
.multi-group .link { align-self: flex-start; font-size: 13px; }
.profile.nobody p { margin: 6px 0 0; color: var(--muted); }
.find-results { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.find-count { margin: 0 0 6px 4px; color: var(--muted); font: 600 13px/1.2 var(--display); }
.board table.jumps th, .board table.jumps td { text-align: left; white-space: normal; }
.board table.jumps td:first-child { min-width: 180px; }
.board table.jumps td.y, .board table.jumps td.n { width: 64px; font-weight: 600; }
.board table.jumps td.y { background: var(--yes-bg); color: var(--yes-text); text-align: center; }
.board table.jumps td.n { background: var(--no-bg); color: var(--no-text); text-align: center; }
.board table.jumps td.hell { color: var(--hell); font-weight: 600; }
.board table.jumps td.god { color: var(--god); font-weight: 600; }
.board table.jumps td.elite { color: var(--elite); font-weight: 600; }
.board table.jumps a { color: var(--text); text-decoration-color: var(--line-strong); text-underline-offset: 2px; }
.board table.jumps a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.board .more { margin: 12px; }
.sort {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  white-space: nowrap;
}
.sort:hover { color: var(--accent); }
.link-small {
  font: inherit;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.link-small:hover { text-decoration: underline; }

/* names: click for username and ID */
.who {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
}
.who:hover { color: var(--accent); text-decoration: underline; }
.s .who { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

.card {
  position: fixed;
  z-index: 10;
  min-width: 250px;
  max-width: calc(100% - 16px);
  background: var(--surface);
  border: 2px solid var(--line);
  border-top: 5px solid var(--accent);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(20, 25, 60, 0.25);
  padding: 12px 14px;
  font-size: 13px;
}
.card-name { font: 700 18px/1.2 var(--display); margin-bottom: 8px; }
.card-row { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.card-row span { color: var(--muted); }
.card-row code { font: 12px/1.6 ui-monospace, "SF Mono", Consolas, monospace; overflow-wrap: anywhere; text-align: right; }
.card-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.card-buttons .button { font-size: 12px; padding: 4px 10px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  background: var(--toast-bg);
  color: var(--toast-text);
  padding: 9px 16px;
  border-radius: 999px;
  font: 600 13px/1.3 var(--display);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}
.toast.error { background: var(--error); color: #fff; }

/* the search box in the header */
.search { position: relative; flex: 1; max-width: 420px; margin: 0 auto; } /* centred; login and theme button sit together on the right */
.search input {
  width: 100%;
  font: inherit;
  color: #22253a; /* always on a white box, in dark mode too */
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 7px 16px;
}
.search input:focus { outline: none; border-color: var(--gold); }
.search input::placeholder { color: #697089; }
.suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  list-style: none;
  margin: 0;
  padding: 6px;
  background: var(--surface);
  color: var(--text);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(20, 25, 60, 0.3);
  max-height: 70vh;
  overflow: auto;
}
.suggestions li { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 10px; cursor: pointer; }
.suggestions li[aria-selected="true"], .suggestions li:hover { background: var(--surface-2); }
.suggestions li.none { color: var(--muted); cursor: default; }
.suggestions .aka { color: var(--muted); margin-left: 6px; }
.suggestions .kind {
  flex: none;
  min-width: 86px;
  font: 600 11px/1.6 var(--display);
  color: var(--muted);
}
.suggestions .kind.hell { color: var(--hell); }
.suggestions .kind.god { color: var(--god); }
.suggestions .kind.elite { color: var(--elite); }

/* pages that scroll as a whole: Player Info, a jump, Activity */
.page-scroll { flex: 1; min-height: 0; overflow: auto; padding-bottom: 8px; }
.page-scroll .board { overflow: visible; flex: none; }
/* Player Info's jump list scrolls in its own box (sideways too), with the column names kept at its top; letting it
   spill out made the whole page scroll sideways on a narrow screen */
.find-results .board { overflow: auto; max-height: calc(100dvh - 130px); }
.muted { color: var(--muted); }
.jump-link {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
}
.h .name[data-j] { cursor: pointer; }
.jump-link:hover, .h .name[data-j]:hover { color: var(--accent); text-decoration: underline; }
a.video { text-decoration: none; font-size: 11px; opacity: 0.7; }
a.video:hover { opacity: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font: 600 12px/1.3 var(--display);
  color: var(--text);
  background: var(--surface-2);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
}
.chip:hover { border-color: var(--accent); }
.chip.hell { border-color: color-mix(in srgb, var(--hell) 45%, transparent); }
.chip.god { border-color: color-mix(in srgb, var(--god) 45%, transparent); }
.chip.elite { border-color: color-mix(in srgb, var(--elite) 45%, transparent); }
.chip small { color: var(--muted); font-weight: 500; }
.pill { font: 600 13px/1.6 var(--display); padding: 1px 10px; border-radius: 999px; background: var(--surface-2); }
.pill.hell { background: var(--hell); color: #fff; }
.pill.god { background: var(--gold); color: #4a3000; }
.pill.elite { background: var(--elite); color: var(--elite-on); }

/* Player Info's profile */
.profile {
  margin-bottom: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.profile h3 { font: 700 14px/1.2 var(--display); margin: 0 0 6px; color: var(--muted); }
.profile-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.profile-name { font: 700 24px/1.1 var(--display); }
.profile-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.stats { display: flex; align-items: center; gap: 10px; }
.stats .share { align-self: center; }
.stats div {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 84px;
  padding: 6px 12px;
  border-radius: 12px;
  background: var(--surface-2);
}
.stats b { font: 700 18px/1.2 var(--display); }
.stats span { font-size: 11px; color: var(--muted); }
/* Hell, God and Elites side by side, the 21 x/10 difficulties under them in columns */
.progress-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 6px 24px; margin-bottom: 12px; }
.pg-group { display: flex; flex-direction: column; gap: 3px; }
.pg-group.pg-x-10 { grid-column: 1 / -1; display: block; columns: 230px; column-gap: 24px; }
.pg-group.pg-x-10 .pg-row { break-inside: avoid; margin-bottom: 3px; }
.pg-row { display: grid; grid-template-columns: 92px 1fr 80px; align-items: center; gap: 8px; font-size: 12px; }
.pg-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-row.hell .pg-name { color: var(--hell); }
.pg-row.god .pg-name { color: var(--god); }
.pg-row.elite .pg-name { color: var(--elite); }
.pg-bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.pg-bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.pg-row.hell .pg-bar i { background: var(--hell); }
.pg-row.god .pg-bar i { background: var(--gold); }
.pg-row.elite .pg-bar i { background: var(--elite); }
.pg-count { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.pg-count small { color: var(--muted); font-weight: 400; }
.profile-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 10px; }
/* the profile: name, rank, points, jumps and Copy link; the rest behind Show progress */
.profile-more-toggle {
  display: block;
  margin: 4px 0 0;
  padding: 6px 16px;
  border: 2px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font: 600 14px/1.2 var(--display);
}
.profile-more-toggle:hover { text-decoration: none; border-color: var(--accent); }
.profile:not(.more) .profile-more { display: none; }
.profile.more .profile-more { margin-top: 10px; }
.profile-bio { margin: 8px 0 0; max-width: 640px; font-size: 14px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.profile-edit { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; max-width: 520px; }
.profile-edit label { display: flex; flex-direction: column; gap: 3px; color: var(--muted); font: 600 12px/1.2 var(--display); }
.breakdown { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-strong); }
.breakdown p { margin: 0 0 8px; font-size: 12px; }
.breakdown-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.breakdown .pg-row { grid-template-columns: 130px 1fr 110px; margin-bottom: 3px; }

/* the welcome page */
.home { max-width: 980px; margin: 0 auto; padding: 18px 4px 24px; }
.hero { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.hero img { flex: none; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.18)); }
.hero h2 { font: 700 36px/1.1 var(--display); margin: 0 0 6px; }
.tagline { font: 500 17px/1.4 var(--display); color: var(--accent); margin: 0; }
.lead { font-size: 15px; line-height: 1.65; margin: 0 0 18px; max-width: 760px; }
.lead code, .guide code { font: 13px ui-monospace, "SF Mono", Consolas, monospace; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.home-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.button.big { font-size: 16px; padding: 10px 22px; }
.button.primary-red { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.button.primary-red:hover { filter: brightness(1.08); color: var(--accent-text); }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 18px; }
.feature {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  font: inherit;
  color: var(--text);
  padding: 14px 16px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
a.feature { text-decoration: none; }
.home-heading { font: 700 20px/1.2 var(--display); margin: 4px 0 10px; }
.feature:hover { transform: translateY(-2px); border-color: var(--gold); }
.feature b { font: 700 17px/1.2 var(--display); color: var(--accent); }
.feature span { font-size: 13px; color: var(--muted); line-height: 1.45; }
.home-foot { color: var(--muted); font-size: 12px; text-align: center; margin: 8px 0 0; }

/* the guide */
.guide { max-width: 860px; margin: 0 auto; padding: 8px 4px 24px; }
.guide h2 { font: 700 30px/1.1 var(--display); margin: 8px 0 14px; }
.guide section {
  margin-bottom: 12px;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.guide h3 { font: 700 18px/1.2 var(--display); margin: 0 0 8px; color: var(--accent); }
.guide h4 { font: 600 14px/1.2 var(--display); margin: 14px 0 6px; }
.guide h3 + h4 { margin-top: 0; }
.guide section p { margin: 0 0 8px; line-height: 1.6; }
.guide section p:last-child { margin-bottom: 0; }
.guide section { scroll-margin-top: 8px; }
.guide-intro { margin: 0 0 10px; line-height: 1.6; color: var(--muted); }
.guide-contents { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 18px; font-size: 13px; }
.guide h2.guide-part { font-size: 22px; margin: 22px 0 10px; }
.guide ol, .guide ul { margin: 0; padding-left: 22px; line-height: 1.65; }
.guide li { margin-bottom: 4px; }
.command {
  font: inherit;
  padding: 0;
  border: none;
  background: none;
  cursor: copy;
  vertical-align: baseline;
}
.command code { border: 1px solid transparent; transition: border-color 0.12s ease, background 0.12s ease; }
.command:hover code, .command:focus-visible code { border-color: var(--accent); background: var(--surface); }
.points-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 14px; font-size: 13px; }
.points-grid span { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-bottom: 1px dashed var(--line); font-variant-numeric: tabular-nums; }
.points-grid .hell b { color: var(--hell); }
.points-grid .god b { color: var(--god); }
.points-grid .elite b { color: var(--elite); }

/* the Commands page: the guide's look, one card per command */
.commands [hidden] { display: none !important; }
.cmd-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.cmd-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cmd-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; }
.cmd-filters input {
  flex: 1 1 200px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 7px 10px;
}
.cmd-filters input:focus { outline: none; border-color: var(--accent); }
.cmd {
  margin-bottom: 12px;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  scroll-margin-top: 8px;
}
.cmd.hit { outline: 2px solid var(--gold); }
.cmd-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 6px; }
.cmd-head > .command code { font-size: 16px; font-weight: 700; }
.cmd-head .cmd-link { margin-left: auto; font-size: 12px; }
.cmd-title { font: 700 16px/1.2 var(--display); }
.cmd-summary { margin: 0 0 6px; line-height: 1.55; }
.cmd-meta { margin: 0 0 8px; font-size: 13px; line-height: 1.55; color: var(--muted); }
.cmd-meta b { color: var(--text); font-weight: 600; }
.cmd h4 { font: 600 14px/1.2 var(--display); margin: 10px 0 6px; }
.aud { font: 600 11px/1 var(--display); padding: 4px 8px; border-radius: 999px; white-space: nowrap; }
.aud-everyone { background: var(--yes-bg); color: var(--yes-text); }
.aud-helpers { background: color-mix(in srgb, var(--god) 22%, transparent); color: var(--gold-text); }
.aud-moderators { background: var(--no-bg); color: var(--no-text); }
.aud-manage { background: color-mix(in srgb, var(--elite) 20%, transparent); color: var(--elite); }
.cmd-fields { width: 100%; border-collapse: collapse; font-size: 13px; margin: 4px 0 6px; }
.cmd-fields th, .cmd-fields td { text-align: left; vertical-align: top; padding: 6px 8px; border-bottom: 1px solid var(--line); line-height: 1.5; }
.cmd-fields th { font: 600 12px/1.2 var(--display); color: var(--muted); }
.cmd-fields td:first-child { white-space: nowrap; }
.cmd-fields td:last-child { word-break: break-word; min-width: 120px; }
.req, .opt { font-size: 11px; }
.req { color: var(--accent); }
.opt { color: var(--muted); }
.cmd-nofields { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.cmd-examples { margin: 0 0 6px; padding: 0; list-style: none; font-size: 14px; }
.cmd-examples li { margin-bottom: 8px; }
.cmd-examples .command { display: block; text-align: left; line-height: 1.7; }
.cmd-examples .command code { white-space: normal; word-break: break-word; }
.cmd-note { display: block; margin-top: 1px; font-size: 13px; color: var(--muted); }
.cmd-notes { margin: 0 0 4px; padding-left: 20px; line-height: 1.6; font-size: 14px; color: var(--muted); }
.cmd-notes li { margin-bottom: 4px; }
/* a category's own explanation list, above its commands (the Type rule categories) */
.cmd-points { margin: -2px 0 14px; padding-left: 22px; line-height: 1.6; font-size: 14px; color: var(--muted); }
.cmd-points li { margin-bottom: 4px; }

/* a jump's page */
.jump-page { max-width: 1100px; }
.jump-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 4px 0 14px; }
.jump-head h2 { font: 700 28px/1.1 var(--display); margin: 0; }
.jump-body { display: grid; grid-template-columns: minmax(0, 3fr) minmax(240px, 2fr); gap: 16px; margin-bottom: 18px; }
.video-frame {
  margin: 0;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow);
}
.video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.video-frame.missing { display: flex; align-items: center; justify-content: center; background: var(--surface); color: var(--muted); }
.jump-facts { padding: 14px 16px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.jump-facts dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 10px; font-size: 13px; }
.jump-facts dt { color: var(--muted); font: 600 13px/1.4 var(--display); }
.jump-facts dd { margin: 0; }
.jump-facts dd .hell { color: var(--hell); font-weight: 600; }
.jump-facts dd .god { color: var(--god); font-weight: 600; }
.jump-facts dd .elite { color: var(--elite); font-weight: 600; }
.description { font-size: 13px; line-height: 1.5; margin: 0 0 10px; white-space: pre-line; }
.jump-page > h3 { font: 700 18px/1.2 var(--display); margin: 0 0 8px; }
.jump-page > h3 small { color: var(--muted); font-weight: 500; font-size: 13px; }
.holders table { min-width: 0; width: 100%; }
.holders th, .holders td { text-align: left; }
.has { color: var(--yes-text); background: var(--yes-bg); font-weight: 600; padding: 1px 8px; border-radius: 999px; }
.from-player { margin-bottom: 16px; padding: 12px 16px; border-radius: 14px; background: var(--me-bg); box-shadow: var(--shadow); }
.from-player h3 { margin: 0 0 4px; font: 700 17px/1.2 var(--display); }
.from-player h3 .who { font: inherit; }
.from-player p { margin: 0; }

/* Random Jump */
.random-page { max-width: 1100px; }
.random-roll { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 4px 0 16px; }
.random-roll .button[disabled] { opacity: 0.5; cursor: default; filter: none; }
.random-jump .jump-head h2 .jump-link { font: inherit; }
.random-jump .jump-facts p { margin: 8px 0 0; }

/* Submit: the forms that post in Discord, and each channel's earlier posts */
.submit-page { max-width: 900px; margin: 0 auto; }
.submit-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin: 4px 0 10px; }
.submit-card { margin-bottom: 18px; padding: 14px 16px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.submit-card > .submit-switch { margin-bottom: 12px; box-shadow: none; background: var(--surface-2); }
.submit-intro { margin: 0 0 12px; line-height: 1.55; }
.submit-note { margin: 0 0 12px; line-height: 1.55; color: var(--muted); }
.post-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.post-form .field { display: flex; flex-direction: column; gap: 3px; min-width: 0; color: var(--muted); font: 600 12px/1.2 var(--display); }
.post-form .field.wide, .post-form .form-end { grid-column: 1 / -1; }
.post-form .req { font-weight: 500; margin-left: 4px; }
.help, .profile-edit .help { font: 400 12px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--muted); }
.post-form input:not([type="checkbox"]):not([type="file"]), .post-form select, .post-form textarea,
.profile-edit input, .profile-edit textarea, .confirm-panel input {
  width: 100%;
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 6px 9px;
}
.post-form textarea, .profile-edit textarea { resize: vertical; min-height: 70px; }
.post-form input:focus, .post-form select:focus, .post-form textarea:focus,
.profile-edit input:focus, .profile-edit textarea:focus, .confirm-panel input:focus { outline: none; border-color: var(--accent); }
.post-form input[type="file"] { font: 13px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); }
.post-form .picker input { width: 100%; }
.form-end { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.form-error {
  align-self: stretch;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--no-bg);
  color: var(--no-text);
  font-size: 14px;
  line-height: 1.5;
}
.form-error code, .confirm-panel code { font: 13px ui-monospace, "SF Mono", Consolas, monospace; }
.confirm-panel {
  align-self: stretch;
  padding: 10px 12px;
  border-radius: 10px;
  border: 2px solid var(--gold);
  background: var(--surface-2);
  font-size: 14px;
  line-height: 1.5;
}
.confirm-item + .confirm-item { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line-strong); }
.confirm-panel .alias { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; font: 600 12px/1.2 var(--display); color: var(--muted); }
.confirm-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.form-end > .confirm-buttons { margin-top: 0; }
.upload-progress { align-self: stretch; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.upload-progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s ease; }
.button[disabled] { opacity: 0.55; cursor: default; }
.backlog-title { font: 700 18px/1.2 var(--display); margin: 0 0 8px; }
.backlog-title small { color: var(--muted); font-weight: 500; font-size: 13px; }
.post-card {
  margin-bottom: 10px;
  padding: 10px 14px 10px 12px;
  border-radius: 12px;
  border-left: 4px solid var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 14px;
}
.post-card.jumpsubmit { border-left-color: #2fa35b; }
.post-card.editsuggest { border-left-color: #5865f2; }
.post-card.mistakefound { border-left-color: #e67e22; }
.post-card.mine { background: color-mix(in srgb, var(--me-bg) 55%, var(--surface)); }
.post-card.editing { border-left-color: var(--accent); }
.post-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 6px; font-size: 13px; }
.post-head img, .post-head .avatar { width: 24px; height: 24px; border-radius: 999px; background: var(--line); }
.post-open { margin-left: auto; font-size: 12px; }
.post-title { font: 700 16px/1.25 var(--display); margin: 0 0 6px; }
.post-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 14px; margin: 0; }
.post-facts .wide { grid-column: 1 / -1; }
.post-facts dt { color: var(--muted); font: 600 12px/1.3 var(--display); }
.post-facts dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.post-line { margin: 0; line-height: 1.5; overflow-wrap: anywhere; }
.post-current { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.post-reason { margin: 6px 0 0; white-space: pre-line; overflow-wrap: anywhere; line-height: 1.5; }
.post-reason span { display: block; color: var(--muted); font: 600 12px/1.3 var(--display); }
.post-votes { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.vote {
  font: 600 13px/1.2 var(--display);
  color: var(--text);
  background: var(--surface-2);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
}
.vote:hover:not([disabled]) { border-color: var(--accent); }
.vote[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.vote[disabled] { cursor: default; opacity: 0.7; }
.approved { font: 600 12px/1.6 var(--display); padding: 0 8px; border-radius: 999px; background: var(--yes-bg); color: var(--yes-text); }
.post-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 8px; font-size: 13px; }
.post-card.editing .post-form { margin: 2px 0; }
#backlog > .more { display: block; margin: 4px auto 12px; }
.backlog-end { text-align: center; font-size: 13px; }

@media (max-width: 900px) {
  .jump-body { grid-template-columns: 1fr; }
}

/* only phones get the search and Filters buttons */
.search-toggle, .filters-toggle { display: none; }

/* phones: one slim header row, a tab's filters behind a button, a grid that leaves room for the cells */
@media (max-width: 640px) {
  /* the Commands page: each field as a small block instead of a table row */
  .cmd { padding: 12px 14px; }
  .cmd-fields thead { display: none; }
  .cmd-fields tr { display: block; padding: 6px 0; border-bottom: 1px solid var(--line); }
  .cmd-fields td { display: block; border: none; padding: 2px 0; }
  .cmd-fields td:first-child { white-space: normal; }
  .cmd-fields td:last-child { min-width: 0; }
  .top { flex-wrap: wrap; gap: 8px; padding: 8px 10px; }
  .brand { gap: 7px; flex: 1; }
  .brand img { width: 30px; height: 30px; }
  .brand h1 { font-size: 17px; }
  .brand .sub, .user .who-am-i, .user .long { display: none; }
  .theme-toggle, .search-toggle { width: 34px; height: 34px; font-size: 16px; margin: 0; }
  .search-toggle {
    display: grid;
    place-items: center;
    padding: 0;
    flex: none;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.14);
    cursor: pointer;
  }
  .top.searching .search-toggle { background: rgba(255, 255, 255, 0.32); }
  .search { display: none; order: 5; flex-basis: 100%; max-width: none; margin: 0; }
  .top.searching .search { display: block; }
  .tabs { padding: 7px 10px; }
  .tabs button { padding: 6px 11px; }

  main { padding: 0 8px 8px; }
  .toolbar { padding: 8px; gap: 6px; }
  .toolbar.bare { display: none; }
  .toolbar #jump-filter { flex: 1; width: auto; min-width: 0; }
  .filters-toggle { display: block; flex: none; padding: 7px 14px; }
  .filters-toggle[hidden] { display: none; }
  .toolbar #player-filter { width: 100%; }
  /* on a tab, Find a player, the menus and the info line wait behind the Filters button */
  .toolbar:not(.open):has(#filters-toggle:not([hidden])) #player-filter,
  .toolbar:not(.open):has(#filters-toggle:not([hidden])) #grid-filters,
  .toolbar:not(.open) .info { display: none; }
  #grid-filters { width: 100%; }
  .grid-menus { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .toolbar .multi summary { width: 100%; }
  .info { margin-left: 0; flex-basis: 100%; }
  /* a menu opens across the whole screen, right under its box */
  .toolbar .multi-menu, .find-controls .multi-menu { position: fixed; top: auto; left: 10px; right: 10px; max-width: none; width: auto; margin-top: 6px; }
  /* 16px text: iPhones zoom in on anything smaller when it's tapped */
  input:not([type="checkbox"]), select, textarea, .multi summary { font-size: 16px !important; }

  /* Player Info and Random Jump: their filters two to a row, the player box and search across */
  .find-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; }
  .find-controls .player-pick, .find-controls .picked-players, .find-controls .grow { grid-column: 1 / -1; }
  .find-controls .field { min-width: 0; }
  .find-controls select, .find-controls input:not([type="checkbox"]), .find-controls .multi summary { width: 100%; max-width: none; }
  .picker input { width: 100%; }
  .random-roll .button.big { padding: 9px 18px; }
  .post-form { grid-template-columns: 1fr; }
  .post-facts { grid-template-columns: 1fr 1fr; }
  .submit-top .segmented { flex-wrap: wrap; }

  /* the leaderboard: names may wrap (the sheet name under them) so the score fits on the screen */
  .board th, .board td { padding: 6px 7px; }
  .board td.player { white-space: normal; min-width: 110px; }
  .board td.player small { display: block; }
  .board td.bar { width: 90px; min-width: 70px; }
  /* Custom's checkboxes left the table two rows: the page scrolls past them and the table gets the whole screen */
  .board-page { overflow-y: auto; }
  .board-custom + .board { flex: none; height: 100%; }

  .stats { flex-wrap: wrap; gap: 8px; } /* the Copy link button goes under the numbers instead of past the edge */
  .profile-head { margin-bottom: 4px; }
  .profile-more-toggle { width: 100%; }
  .home { padding-top: 8px; }
  .hero { gap: 12px; }
  .hero img { width: 56px; height: 56px; }
  .hero h2 { font-size: 24px; }
  .tagline { font-size: 14px; }
  .lead { font-size: 14px; }

  .grid { border-radius: 10px; }
  .grid.strips { --head-h: 140px; }
  .corner { padding: 6px 8px; }
  .corner strong { font-size: 15px; }
  .corner .segmented button { padding: 4px 8px; font-size: 11px; }
  .corner .wide { display: none; }
  .corner .narrow { display: inline; }
  .h .name { font-size: 11px; line-height: 14px; padding: 5px 5px 0; -webkit-line-clamp: 4; }
  .h .count { font-size: 11px; }
  .s { padding: 0 6px 0 8px; }
  .s .name { font-size: 13px; }
  .c { font-size: 11px; }
}

/* touch screens scroll the grid with a finger, so its scrollbars only take room there */
@media (pointer: coarse) {
  .grid { --bar: 0px; }
  .grid .scrollbar { display: none; }
}
