/* ============================================================
   PoolDB — design system
   Dense, catalogue-first UI inspired by RateYourMusic
   ============================================================ */

:root {
  --bg: #f1f1ec;
  --surface: #ffffff;
  --surface-2: #f7f7f2;
  --surface-3: #ecece5;
  --ink: #1a1a18;
  --ink-2: #44443f;
  --muted: #6b6b62;
  --line: #d8d8cf;
  --line-strong: #b9b9ae;
  --link: #17558c;
  --link-hover: #0c3760;
  --gold: #c2921f;
  --gold-soft: #e7cf94;
  --good: #397048;
  --bad: #a33f32;
  --topbar: #191a17;
  --topbar-2: #232420;
  --topbar-ink: #e9e6da;
  --topbar-muted: #b7b4a8;
  --shadow: 0 1px 2px rgba(20, 20, 15, .06);
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

[data-theme="dark"] {
  --bg: #131411;
  --surface: #1b1c18;
  --surface-2: #22231e;
  --surface-3: #2a2b25;
  --ink: #e9e6dc;
  --ink-2: #c3c0b5;
  --muted: #93918a;
  --line: #33352d;
  --line-strong: #4a4c42;
  --link: #8db9e8;
  --link-hover: #b6d4f5;
  --gold: #dcb253;
  --gold-soft: #6a5725;
  --good: #79b28b;
  --bad: #d68375;
  --topbar: #0d0e0c;
  --topbar-2: #1a1b17;
  --topbar-ink: #eeeadf;
  --topbar-muted: #a29f94;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 13px/1.45 var(--sans);
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
p a:not(.tag):not(.btn), .note a, .lede a {
  text-decoration: underline;
  text-underline-offset: 2px;
}
button { font: inherit; color: inherit; }
hr { border: 0; border-top: 1px solid var(--line); }

::selection { background: var(--gold-soft); color: #1a1a18; }

:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 1px;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--surface); color: var(--ink); padding: 8px 12px;
}
.skip:focus { left: 8px; top: 8px; }

.wrap {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 18px;
}

/* ---------- top bar ---------- */

.topbar {
  background: var(--topbar);
  color: var(--topbar-ink);
  border-bottom: 1px solid #000;
  position: relative;
  z-index: 20;
}
.topbar .wrap {
  display: flex;
  align-items: baseline;
  gap: 16px;
  min-height: 46px;
  padding-top: 5px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .01em;
  color: #fff;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; color: #fff; }
.brand .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold);
  align-self: center;
  box-shadow: 0 0 0 2px rgba(220, 178, 83, .18);
}
.brand em {
  font-style: normal;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--topbar-muted);
}

.nav {
  display: flex;
  align-items: baseline;
  gap: 1px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  display: inline-block;
  padding: 7px 9px;
  border-radius: 2px;
  font-size: 10.5px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: .085em;
  text-transform: uppercase;
  color: var(--topbar-muted);
  white-space: nowrap;
}
.nav a:hover { color: #fff; background: var(--topbar-2); text-decoration: none; }
.nav a[aria-current="page"] { color: #fff; background: var(--topbar-2); }

.topbar .tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  align-self: center;
}

.gsearch { display: flex; }
.gsearch input {
  width: 170px;
  padding: 6px 9px;
  font-size: 12px;
  color: var(--topbar-ink);
  background: #0c0d0b;
  border: 1px solid #3b3c35;
  border-right: 0;
  border-radius: 2px 0 0 2px;
  outline: none;
}
[data-theme="dark"] .gsearch input { background: #080907; }
.gsearch input::placeholder { color: #83816f; }
.gsearch input:focus { border-color: #6b6c60; }
.gsearch button {
  padding: 0 10px;
  background: var(--topbar-2);
  color: var(--topbar-muted);
  border: 1px solid #3b3c35;
  border-radius: 0 2px 2px 0;
  cursor: pointer;
  font-size: 13px;
}
.gsearch button:hover { color: #fff; }

.icon-btn {
  height: 28px;
  min-width: 28px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: 1px solid #3b3c35;
  border-radius: 2px;
  color: var(--topbar-muted);
  cursor: pointer;
  font-size: 11px;
}
.icon-btn:hover { color: #fff; border-color: #595a50; text-decoration: none; }

.user-chip {
  display: flex; align-items: center; gap: 7px;
  padding: 3px 8px 3px 3px;
  border: 1px solid #3b3c35; border-radius: 2px;
  color: var(--topbar-ink); font-size: 11px;
}
.user-chip:hover { text-decoration: none; background: var(--topbar-2); color: #fff; }
.user-chip .avatar { width: 20px; height: 20px; font-size: 9px; }

/* ---------- breadcrumbs / page chrome ---------- */

.crumbs {
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.crumbs .wrap {
  display: flex; align-items: center; gap: 6px;
  min-height: 30px; flex-wrap: wrap;
}
.crumbs a { color: var(--ink-2); }
.crumbs .sep { color: var(--line-strong); }
.crumbs strong { color: var(--ink); font-weight: 500; }

.page { padding: 22px 0 46px; }

.page-head { margin-bottom: 18px; }
.page-head h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.01em;
}
.page-head .lede { margin: 6px 0 0; color: var(--ink-2); max-width: 72ch; }
.page-head .eyebrow {
  margin: 0 0 3px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  font-weight: 700;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 298px;
  gap: 22px;
  align-items: start;
}
.layout.narrow { grid-template-columns: minmax(0, 1fr); max-width: 900px; }
.main-col { min-width: 0; }
.rail { min-width: 0; display: flex; flex-direction: column; gap: 16px; }

/* ---------- sections & panels ---------- */

.section { margin-bottom: 24px; }
.section:last-child { margin-bottom: 0; }

.section-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--line-strong);
  margin-bottom: 10px;
}
.section-h h2, .section-h h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.section-h .more { font-size: 11px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.panel + .panel { margin-top: 14px; }
.panel-h {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 10px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .085em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.panel-b { padding: 11px; }
.panel-b.flush { padding: 0; }
.panel-b.tight { padding: 8px 10px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 16px;
  box-shadow: var(--shadow);
}

.note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}
.note strong { color: var(--ink-2); }

.rule-list { list-style: none; margin: 0; padding: 0; }
.rule-list li {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 5px 0;
  border-bottom: 1px dotted var(--line);
  font-size: 12px;
}
.rule-list li:last-child { border-bottom: 0; }
.rule-list .k { color: var(--muted); }
.rule-list .v { text-align: right; }

/* ---------- hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid #0e0f0c;
  background: linear-gradient(115deg, #1b2119 0%, #232a1f 48%, #2e3527 100%);
  color: #f0eddf;
  padding: 30px 28px;
  margin-bottom: 22px;
  box-shadow: 0 2px 10px rgba(0,0,0,.16);
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(90deg, transparent 20%, #000 75%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute; right: -90px; top: -130px;
  width: 380px; height: 380px; border-radius: 50%;
  border: 1px solid rgba(220,178,83,.25);
  box-shadow: 0 0 0 44px rgba(220,178,83,.05), 0 0 0 90px rgba(220,178,83,.03);
  pointer-events: none;
}
.hero .inner { position: relative; z-index: 1; max-width: 720px; }
.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(22px, 2.6vw, 28px);
  line-height: 1.2;
  letter-spacing: -.01em;
  font-weight: 700;
}
.hero p { margin: 12px 0 0; color: #c7c4b4; max-width: 62ch; font-size: 13px; }
.hero .cta { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.hero-stats {
  display: flex; gap: 26px; flex-wrap: wrap;
  margin-top: 24px; padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.12);
}
.hero-stats b {
  display: block;
  font-family: var(--sans);
  font-size: 21px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
}
.hero-stats span { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: #a9a795; }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 12px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  line-height: 1.3;
}
.btn:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: #24532f;
  border-color: #1b3f24;
  color: #f3f6ee;
}
.btn.primary:hover { background: #2d6539; color: #fff; }
.btn.gold {
  background: var(--gold);
  border-color: #9a7112;
  color: #221a04;
  font-weight: 600;
}
.btn.gold:hover { background: #d3a53a; color: #1b1403; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--link); padding-left: 4px; padding-right: 4px; }
.btn.ghost:hover { background: transparent; text-decoration: underline; }
.btn.sm { font-size: 11px; padding: 4px 8px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

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

.field { margin-bottom: 12px; }
.field label, .label {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.input, .select, .textarea {
  width: 100%;
  padding: 6px 8px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  font: inherit;
  font-size: 12px;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--link);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--link) 18%, transparent);
}
.textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
.select { cursor: pointer; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-row.three { grid-template-columns: repeat(3, 1fr); }
.check { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); }
.check input { accent-color: var(--link); }

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

.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left;
  padding: 5px 8px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
  background: var(--surface);
}
.tbl td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .rank { width: 26px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; font-size: 11px; }
.tbl .rank.top { color: var(--gold); font-weight: 700; }
.tbl .cover-cell { width: 40px; padding-right: 0; }
.tbl .title-cell { min-width: 180px; }
.tbl .title-cell .t { font-weight: 600; color: var(--link); font-size: 12.5px; display: block; line-height: 1.3; }
.tbl .title-cell .s { color: var(--muted); font-size: 11px; display: block; margin-top: 1px; }
.tbl .tags-cell { color: var(--muted); font-size: 11px; }
.tbl .score-cell { text-align: right; white-space: nowrap; }
.tbl .score-cell .score { font-size: 13px; }
.tbl .date-cell { color: var(--muted); font-size: 11px; white-space: nowrap; }
.tbl.compact td { padding: 4px 7px; }
.tbl.compact th { padding: 4px 7px; }

.table-wrap { overflow-x: auto; }

/* ---------- covers ---------- */

.cover {
  --c1: hsl(210 42% 30%);
  --c2: hsl(150 38% 22%);
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 5%;
  overflow: hidden;
  flex: none;
  background: linear-gradient(135deg, var(--c1) 0%, var(--c2) 100%);
  color: #fff;
  font-family: var(--serif);
  font-weight: 700;
  line-height: .92;
  letter-spacing: -.02em;
  text-shadow: 0 1px 5px rgba(0,0,0,.4);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
  user-select: none;
}
.cover::before {
  content: "";
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(112deg, rgba(255,255,255,.10) 0 1px, transparent 1px 9px),
    radial-gradient(circle at 78% 18%, rgba(255,255,255,.22), transparent 42%);
  opacity: .8;
}
.cover::after {
  content: "";
  position: absolute;
  width: 66%; aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 50%;
  right: -18%; top: -22%;
}
.cover > span { position: relative; z-index: 1; font-size: var(--fs, 10px); }
.cover.xs { width: 32px; height: 32px; --fs: 8px; }
.cover.sm { width: 44px; height: 44px; --fs: 10px; }
.cover.md { width: 64px; height: 64px; --fs: 15px; }
.cover.lg { width: 112px; height: 112px; --fs: 26px; }
.cover.xl { width: 156px; height: 156px; --fs: 38px; }
.cover.hero-cover { width: 100%; height: 100%; }
.cover.is-img {
  background-position: center 30%;
  background-size: cover;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2);
}
.cover.is-img::before, .cover.is-img::after { display: none; }

.banner.is-img {
  background-size: cover;
  background-position: center 25%;
  background-repeat: no-repeat;
}
.banner.is-img::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15, 14, 12, 0) 0%, rgba(15, 14, 12, .78) 100%);
}
.banner.tour {
  margin-bottom: 14px;
  border-radius: 2px;
  min-height: 190px;
}

.banner {
  position: relative;
  overflow: hidden;
  background: linear-gradient(120deg, var(--c1) 0%, var(--c2) 100%);
  color: #fff;
  display: flex;
  align-items: flex-end;
  padding: 18px;
  min-height: 120px;
}
.banner::before {
  content: "";
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(105deg, rgba(255,255,255,.07) 0 1px, transparent 1px 14px),
    radial-gradient(circle at 85% 0%, rgba(255,255,255,.2), transparent 45%);
}
.banner > * { position: relative; z-index: 1; }
.banner .b-kicker { font-size: 9px; letter-spacing: .16em; text-transform: uppercase; opacity: .85; }
.banner .b-title { font-family: var(--serif); font-size: 24px; line-height: 1.05; margin-top: 4px; }

/* ---------- stars & rating ---------- */

.stars {
  --pct: 0%;
  position: relative;
  display: inline-block;
  font-size: 12px;
  letter-spacing: 1.5px;
  line-height: 1;
  color: var(--line-strong);
  white-space: nowrap;
  vertical-align: middle;
  font-family: var(--sans);
}
.stars .fg {
  position: absolute;
  inset: 0;
  width: var(--pct);
  overflow: hidden;
  color: var(--gold);
  white-space: nowrap;
}
.stars.sm { font-size: 10px; letter-spacing: 1px; }
.stars.lg { font-size: 17px; letter-spacing: 2px; }

.score { font-family: var(--sans); font-weight: 700; font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "lnum" 1, "tnum" 1; letter-spacing: -.01em; }
.score-max { font-size: 10px; color: var(--muted); margin-left: 2px; font-family: var(--sans); font-weight: 400; }
.score-n { font-size: 10px; color: var(--muted); font-family: var(--sans); font-weight: 400; }

.rate-box {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.rate-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}
.rate-big { font-family: var(--sans); font-size: 38px; line-height: .95; font-weight: 700; font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "lnum" 1, "tnum" 1; }
.rate-big .den { font-size: 15px; color: var(--muted); font-weight: 400; margin-left: 1px; }
.rate-meta { font-size: 10.5px; color: var(--muted); margin-top: 5px; }
.rate-meta b { color: var(--ink-2); font-weight: 600; }
.rate-body { padding: 11px 12px; }

.hist { display: flex; flex-direction: column; gap: 3px; margin: 8px 0 2px; }
.hist-row { display: grid; grid-template-columns: 24px 1fr 34px; gap: 6px; align-items: center; font-size: 10px; color: var(--muted); }
.hist-bar { height: 8px; background: var(--surface-3); position: relative; border-radius: 1px; overflow: hidden; }
.hist-bar span { display: block; height: 100%; background: var(--gold); opacity: .75; border-radius: 1px; }
.hist-row.me .hist-bar span { background: var(--link); opacity: 1; }
.hist-row.me { color: var(--ink); font-weight: 600; }

.rate-widget { margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); }
.rate-widget .label { display: flex; justify-content: space-between; align-items: baseline; }
.rate-stars {
  position: relative;
  display: block;
  width: 240px;
  height: 36px;
  margin-left: -5px;
  font-size: 28px;
  line-height: 36px;
  color: var(--line-strong);
  white-space: nowrap;
  user-select: none;
}
.rate-layer {
  position: absolute;
  inset: 0;
  display: flex;
}
.rate-layer i {
  flex: 1 1 0;
  font-style: normal;
  text-align: center;
}
.rate-stars .fg {
  color: var(--gold);
  clip-path: inset(0 calc(100% - var(--pct, 0%)) 0 0);
  pointer-events: none;
}
.rate-hits { position: absolute; inset: 0; display: flex; }
.rate-hits button {
  flex: 1;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  border-radius: 2px;
}
.rate-hits button:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.rate-label { font-size: 10px; color: var(--muted); margin-top: 5px; min-height: 14px; }
.rate-label b { color: var(--ink); }

/* ---------- badges & tags ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 10px;
  line-height: 1.45;
  white-space: nowrap;
}
a.tag:hover { border-color: var(--line-strong); background: var(--surface-3); text-decoration: none; color: var(--ink); }
.tag.gold { border-color: #d9c08a; background: #faf3e2; color: #7b5c11; }
[data-theme="dark"] .tag.gold { border-color: #5a4a24; background: #2a2314; color: #e0c37a; }
.tag.mode { font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: 9px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 6px;
  border-radius: 2px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.badge.live { background: #e2efe3; color: #2c5a37; }
.badge.sample { background: #f4ecd8; color: #7a5b13; border: 1px solid #e3d3a8; }
[data-theme="dark"] .badge.live { background: #223528; color: #9ed0ab; }
[data-theme="dark"] .badge.sample { background: #332b16; color: #e1c57f; border-color: #554622; }

.mode-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted); margin-right: 4px; vertical-align: 1px;
}
.mode-dot.osu { background: #d26a9a; }
.mode-dot.taiko { background: #d98b3d; }
.mode-dot.catch { background: #4f9bd0; }
.mode-dot.mania { background: #7b6bd0; }

/* ---------- detail header ---------- */

.pool-head {
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.pool-head h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(24px, 2.4vw, 33px);
  line-height: 1.08;
  letter-spacing: -.015em;
}
.pool-head .sub {
  margin: 5px 0 0;
  font-size: 12px;
  color: var(--ink-2);
}
.pool-head .sub a { font-weight: 500; }
.pool-head .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 9px; }
.pool-head .desc { margin: 11px 0 0; color: var(--ink-2); max-width: 68ch; }

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px 16px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.meta-grid .k { font-size: 9px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.meta-grid .v { font-size: 12px; margin-top: 1px; }

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 22px;
  align-items: start;
  margin-top: 20px;
}

/* ---------- bracket / slots ---------- */

.slot-code {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-2);
  white-space: nowrap;
}
.bm-thumb {
  display: block;
  width: 96px;
  height: 46px;
  border-radius: 2px;
  background: var(--surface-3);
  overflow: hidden;
}
.bm-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.slot-title { font-weight: 600; font-size: 12.5px; line-height: 1.25; }
.slot-diff { color: var(--muted); font-size: 11px; display: block; }
.slot-map { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.sr {
  display: inline-block;
  min-width: 34px;
  padding: 1px 4px;
  border-radius: 2px;
  background: var(--surface-3);
  font-family: var(--mono);
  font-size: 10px;
  text-align: center;
  color: var(--ink-2);
}

/* ---------- reviews ---------- */

.review {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.review:last-child { border-bottom: 0; }
.review-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 2px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-2);
  flex: none;
  text-transform: uppercase;
}
.review-head .who { font-weight: 600; font-size: 12px; }
.review-head .when { color: var(--muted); font-size: 10.5px; margin-left: auto; }
.review h3 { margin: 7px 0 4px; font-size: 14px; font-family: var(--serif); }
.review p { margin: 0 0 8px; color: var(--ink-2); line-height: 1.55; }
.review-foot { display: flex; align-items: center; gap: 12px; font-size: 10.5px; color: var(--muted); }
.like-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: 0; padding: 0;
  color: var(--muted); cursor: pointer; font-size: 10.5px;
}
.like-btn:hover { color: var(--ink); }
.like-btn[aria-pressed="true"] { color: var(--bad); }

.review-card { padding: 12px 0; border-bottom: 1px solid var(--line); }
.review-card:last-child { border-bottom: 0; }
.review-card .rc-top { display: flex; gap: 9px; align-items: flex-start; }
.review-card .rc-cover { flex: none; }
.review-card .rc-body { min-width: 0; flex: 1; }
.review-card .rc-title { display: block; font-family: var(--serif); font-weight: 700; font-size: 13px; line-height: 1.25; padding: 4px 0; }
.review-card .rc-pool { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.review-card .rc-pool a { display: inline-block; padding: 5px 0; }
.review-card .rc-text {
  margin: 6px 0 0; color: var(--ink-2); font-size: 11.5px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.review-card .rc-foot { display: flex; gap: 8px; align-items: center; margin-top: 6px; font-size: 10px; color: var(--muted); }

/* ---------- comments ---------- */

.comment { display: flex; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.comment:last-of-type { border-bottom: 0; }
.comment .c-body { min-width: 0; flex: 1; }
.comment .c-top { display: flex; align-items: baseline; gap: 7px; }
.comment .c-top b { font-size: 11.5px; }
.comment .c-top span { font-size: 10px; color: var(--muted); }
.comment p { margin: 2px 0 0; font-size: 11.5px; color: var(--ink-2); }

/* ---------- tag wall ---------- */

.tag-wall {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag-wall .tag {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface);
}
.tag-wall .muted { margin-left: 2px; font-weight: 400; }

/* ---------- list / cards ---------- */

.list-entry {
  display: grid;
  grid-template-columns: 26px 44px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.list-entry .n { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; text-align: right; padding-top: 2px; }
.list-entry .le-title { font-weight: 600; font-size: 12.5px; }
.list-entry .le-meta { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.list-entry .le-note { font-size: 11px; color: var(--ink-2); margin-top: 4px; line-height: 1.45; }

.cover-stack { display: flex; }
.cover-stack .cover + .cover { margin-left: -10px; box-shadow: -1px 0 0 var(--bg), inset 0 0 0 1px rgba(255,255,255,.12); }

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

.profile-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-strong);
  margin-bottom: 16px;
}
.profile-head .avatar.big {
  width: 72px; height: 72px; font-size: 26px; border-radius: 3px;
}
.profile-head h1 { margin: 0; font-family: var(--serif); font-size: 26px; line-height: 1.1; }
.profile-head .handle { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.profile-head .bio { margin: 7px 0 0; color: var(--ink-2); max-width: 70ch; }
.profile-stats {
  display: flex; gap: 22px; flex-wrap: wrap;
  margin-left: auto; text-align: right;
}
.profile-stats b { display: block; font-family: var(--sans); font-size: 19px; font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "lnum" 1, "tnum" 1; }
.profile-stats span { font-size: 9px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }

.tabs {
  display: flex; gap: 2px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line-strong);
  margin: 16px 0 14px;
}
.tabs a, .tabs button {
  padding: 6px 10px;
  border: 1px solid transparent;
  border-bottom: 0;
  margin-bottom: -1px;
  background: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--muted);
  cursor: pointer;
}
.tabs a:hover, .tabs button:hover { color: var(--ink); text-decoration: none; }
.tabs a.active, .tabs button.active {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}

.mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.mini-pool { display: flex; gap: 8px; align-items: center; min-width: 0; }
.mini-pool .mp-title { font-size: 11.5px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-pool .mp-meta { font-size: 10px; color: var(--muted); margin-top: 1px; }

.bars { display: flex; flex-direction: column; gap: 4px; }
.bar-row { display: grid; grid-template-columns: 54px 1fr 30px; gap: 7px; align-items: center; font-size: 10.5px; color: var(--muted); }
.bar-track { height: 9px; background: var(--surface-3); border-radius: 1px; overflow: hidden; }
.bar-track span { display: block; height: 100%; background: var(--link); opacity: .65; }

/* ---------- tabs / filter bar ---------- */

.filterbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 10px;
  margin-bottom: 14px;
}
.filterbar .field { margin: 0; }
.filterbar .field.grow { flex: 1; min-width: 160px; }
.filterbar .field .select, .filterbar .field .input { min-width: 100px; }
.filterbar .spacer { flex: 1; }

.chart-tabs { display: flex; gap: 2px; flex-wrap: wrap; margin-bottom: 12px; }
.chart-tabs a {
  padding: 5px 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.chart-tabs a:hover { background: var(--surface-2); text-decoration: none; }
.chart-tabs a.active { background: var(--topbar); border-color: var(--topbar); color: #fff; }

/* ---------- maps ---------- */

.map-pools a {
  display: inline-block;
  padding: 5px 0;
  line-height: 1.4;
}

/* ---------- stats / rows ---------- */

.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 20px;
}
.stats-strip > div { background: var(--surface); padding: 11px 13px; }
.stats-strip b { display: block; font-family: var(--sans); font-size: 20px; font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "lnum" 1, "tnum" 1; }
.stats-strip span { font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

.results-count { font-size: 11px; color: var(--muted); margin: 0 0 8px; }

.pagination { display: flex; gap: 4px; align-items: center; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.pagination button, .pagination a {
  min-width: 26px; height: 26px; padding: 0 7px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font-size: 11px; cursor: pointer; border-radius: 2px;
}
.pagination .active { background: var(--topbar); border-color: var(--topbar); color: #fff; }
.pagination button:hover, .pagination a:hover { border-color: var(--line-strong); text-decoration: none; }
.pagination .gap { color: var(--muted); padding: 0 3px; }

.empty {
  padding: 30px 16px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  font-size: 12px;
}
.empty b { display: block; color: var(--ink-2); font-size: 13px; margin-bottom: 4px; }

.quote {
  border-left: 2px solid var(--gold);
  padding: 2px 0 2px 11px;
  color: var(--ink-2);
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.5;
}

.dot-sep { color: var(--line-strong); padding: 0 5px; }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%; bottom: 22px;
  transform: translate(-50%, 12px);
  background: var(--topbar);
  color: var(--topbar-ink);
  border: 1px solid #3d3e36;
  border-radius: 2px;
  padding: 9px 14px;
  font-size: 11.5px;
  box-shadow: 0 8px 26px rgba(0,0,0,.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 80;
  max-width: min(420px, calc(100vw - 32px));
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

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

.footer {
  margin-top: 40px;
  background: var(--topbar);
  color: var(--topbar-muted);
  font-size: 11px;
  border-top: 1px solid #000;
}
.footer .wrap {
  display: flex;
  gap: 26px;
  justify-content: space-between;
  padding-top: 22px;
  padding-bottom: 24px;
  flex-wrap: wrap;
}
.footer .f-brand { font-family: var(--serif); font-size: 15px; color: #fff; margin-bottom: 5px; }
.footer a { color: #cfccc0; }
.footer a:hover { color: #fff; }
.footer .f-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer .f-note { max-width: 44ch; line-height: 1.6; }

/* ---------- auth / submit ---------- */

.auth-wrap { max-width: 380px; margin: 40px auto; }
.auth-card { background: var(--surface); border: 1px solid var(--line-strong); padding: 20px; box-shadow: 0 10px 30px rgba(0,0,0,.06); }
.auth-card h1 { margin: 0 0 4px; font-family: var(--serif); font-size: 24px; }
.auth-card .sub { margin: 0 0 16px; color: var(--muted); font-size: 11.5px; }

.slot-row {
  display: grid;
  grid-template-columns: 62px 62px 1fr 1fr 1fr 62px 28px;
  gap: 6px;
  margin-bottom: 6px;
  align-items: center;
}
.slot-row .input, .slot-row .select { font-size: 11px; padding: 5px 6px; }
.slot-row .del { border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; height: 28px; border-radius: 2px; }
.slot-row .del:hover { color: var(--bad); border-color: var(--bad); }

/* ---------- misc ---------- */

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.hr-tight { margin: 14px 0; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; } .mt8 { margin-top: 8px; } .mt14 { margin-top: 14px; }
.muted { color: var(--muted); }
.small { font-size: 11px; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); }
.hide { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

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

@media (max-width: 1040px) {
  .layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 18px; }
  .detail-layout { grid-template-columns: minmax(0, 1fr) 250px; gap: 18px; }
}

@media (max-width: 860px) {
  .nav {
    order: 3;
    flex: 1 0 100%;
    padding-top: 4px;
    border-top: 1px solid #2b2c26;
  }
  .nav a { padding: 7px 5px; font-size: 9px; letter-spacing: .06em; }
  .topbar .wrap { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; gap: 8px 16px; }
  .topbar .tools { flex: 1; }
  .gsearch { flex: 1; }
  .gsearch input { width: 100%; }
  .layout, .detail-layout { grid-template-columns: minmax(0, 1fr); }
  .rail { order: 2; }
  .pool-head { grid-template-columns: 112px minmax(0, 1fr); gap: 14px; }
  .cover.xl { width: 112px; height: 112px; --fs: 27px; }
  .profile-head { flex-wrap: wrap; }
  .profile-stats { margin-left: 0; text-align: left; width: 100%; }
}

@media (max-width: 620px) {
  .wrap { padding: 0 12px; }
  body { font-size: 12.5px; }
  .hero { padding: 22px 18px; }
  .hero-stats { gap: 18px; }
  .page { padding-top: 16px; }
  .pool-head { grid-template-columns: 84px minmax(0, 1fr); }
  .cover.xl { width: 84px; height: 84px; --fs: 20px; }
  .pool-head h1 { font-size: 23px; }
  .field-row, .field-row.three, .two-col { grid-template-columns: 1fr; }
  .tbl .hide-sm { display: none; }
  .tbl th, .tbl td { padding: 5px 5px; }
  .slot-row {
    grid-template-columns: 58px minmax(0, 1fr) minmax(0, 1fr) 28px;
    grid-template-areas:
      "bracket code code del"
      "artist artist title title"
      "mapper mapper stars stars";
    row-gap: 5px;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--line);
  }
  .slot-row > [data-slot-bracket] { grid-area: bracket; }
  .slot-row > [data-slot-code] { grid-area: code; }
  .slot-row > [data-slot-artist] { grid-area: artist; }
  .slot-row > [data-slot-title] { grid-area: title; }
  .slot-row > [data-slot-mapper] { grid-area: mapper; }
  .slot-row > [data-slot-stars] { grid-area: stars; }
  .slot-row > [data-del-slot] { grid-area: del; }
  .filterbar .spacer { display: none; }
  .footer .wrap { flex-direction: column; gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
