/* rateyourbuild — same look-and-feel as sites/tallybot / sites/socialcredit
   (Bluesky app: white/blue, system sans-serif, rounded cards, pill buttons,
   sticky underline tabs), copied and reused since it's the same shape of
   leaderboard site. */

:root {
  --bg: #ffffff;
  --bg-alt: #f7f9fa;
  --ink: #0f1419;
  --muted: #536471;
  --faint: #e1e8ed;
  --accent: #7856ff;
  --accent-dark: #6440e6;
  --card: #ffffff;
  --gold: #c99700;
  --good: #00ba7c;
  --mid: #b8860b;
  --bad: #f91880;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, "Helvetica Neue", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg-alt); color: var(--ink);
  font-family: var(--sans); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap {
  max-width: 680px; margin: 0 auto; padding: 0 0 4rem; background: var(--bg);
  min-height: 100vh; border-left: 1px solid var(--faint); border-right: 1px solid var(--faint);
}

header.top {
  position: sticky; top: 0; z-index: 5; background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding: 0.9rem 1.1rem 0; border-bottom: 1px solid var(--faint);
}
header.top .home-link { font-size: 0.8rem; color: var(--muted); }
header.top h1 {
  font-size: 1.4rem; margin: 0.35rem 0 0.3rem; font-weight: 800; letter-spacing: -0.01em;
}
header.top p.tag { margin: 0 0 0.7rem; color: var(--muted); font-size: 0.88rem; }
nav.tabs { display: flex; gap: 0.2rem; }
nav.tabs a {
  padding: 0.7rem 0.9rem; font-size: 0.92rem; font-weight: 600; color: var(--muted);
  border-bottom: 3px solid transparent; cursor: pointer;
}
nav.tabs a.active { color: var(--ink); border-bottom-color: var(--accent); }
nav.tabs a:hover { text-decoration: none; color: var(--ink); }

section { padding: 1rem 1.1rem; }
section + section { border-top: 1px solid var(--faint); }
.section-title { font-size: 1.02rem; margin: 0 0 0.6rem; font-weight: 800; }

.session-row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.session-row input {
  flex: 1; min-width: 180px; padding: 0.55rem 0.7rem; border: 1px solid var(--faint);
  border-radius: 999px; font-size: 0.9rem; font-family: inherit;
}
button {
  font-family: inherit; cursor: pointer; border: none; border-radius: 999px;
  padding: 0.55rem 1rem; font-weight: 700; font-size: 0.88rem;
  background: var(--accent); color: #fff;
}
button:hover { background: var(--accent-dark); }
button.secondary { background: var(--bg-alt); color: var(--ink); border: 1px solid var(--faint); }
button.secondary:hover { background: var(--faint); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
.status { margin: 0.4rem 0 0; font-size: 0.85rem; color: var(--muted); min-height: 1.2em; }
.status.ok { color: var(--good); }
.status.err { color: var(--bad); }
.status.warn { color: var(--mid); }

.controls { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.controls input, .controls select {
  padding: 0.5rem 0.7rem; border: 1px solid var(--faint); border-radius: 10px;
  font-size: 0.88rem; font-family: inherit; background: var(--bg);
}
.controls input#search { flex: 1 1 200px; }
p.meta { color: var(--muted); font-size: 0.82rem; margin: 0 0 0.7rem; }

.group-header {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted);
  font-weight: 800; margin: 1.1rem 0 0.4rem; padding-bottom: 0.25rem; border-bottom: 1px solid var(--faint);
}
.group-header:first-child { margin-top: 0; }

.card {
  border: 1px solid var(--faint); border-radius: 14px; padding: 0.8rem 0.9rem;
  margin-bottom: 0.6rem; background: var(--card);
}
.card-main { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.card-title { font-weight: 800; font-size: 1rem; }
.pill {
  display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 0.12rem 0.55rem;
  border-radius: 999px; background: var(--bg-alt); color: var(--muted); border: 1px solid var(--faint);
  text-transform: lowercase;
}
a.pill { color: var(--muted); text-decoration: none; }
a.pill:hover { color: var(--ink); background: var(--faint); text-decoration: none; }
.pill-sub { opacity: 0.85; }
.built-badge { font-size: 0.72rem; color: var(--muted); margin-left: auto; }
.card-blurb { margin: 0.35rem 0 0.55rem; color: var(--ink); font-size: 0.88rem; }
.card-links { margin: 0.4rem 0 0; font-size: 0.78rem; color: var(--muted); }
.card-links a.visit-link { font-weight: 600; }
.card-links a.prompter-link {
  font-weight: 700; text-decoration: underline; text-decoration-color: var(--faint);
  text-underline-offset: 2px;
}
.card-links a.prompter-link:hover { text-decoration-color: var(--accent); }

.card-foot { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
.score-block { display: flex; flex-direction: column; align-items: center; min-width: 3.4rem; }
.score-big { font-size: 1.35rem; font-weight: 800; line-height: 1; }
.score-big.unrated { color: var(--muted); font-weight: 600; font-size: 1rem; }
.score-sub { font-size: 0.7rem; color: var(--muted); }
.rate-row { display: flex; gap: 0.2rem; flex-wrap: wrap; }
.rate-btn {
  width: 1.7rem; height: 1.7rem; padding: 0; border-radius: 6px; font-size: 0.75rem;
  font-weight: 700; background: var(--bg-alt); color: var(--muted); border: 1px solid var(--faint);
}
.rate-btn:hover:not(:disabled) { background: var(--faint); color: var(--ink); }
.rate-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.rate-row-status { font-size: 0.78rem; color: var(--muted); flex-basis: 100%; }
.share-link { font-weight: 700; }

.board {
  border: 1px solid var(--faint); border-radius: 14px; padding: 0.4rem 0; margin-bottom: 1.1rem; overflow: hidden;
}
.board-title {
  padding: 0.55rem 0.9rem; font-weight: 800; font-size: 0.95rem; display: flex; justify-content: space-between; align-items: center;
}
.board-title a { font-size: 0.78rem; font-weight: 600; }
.board-title a.board-title-name {
  font-size: inherit; font-weight: inherit; color: var(--ink);
  text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px;
}
.board-title a.board-title-name:hover { color: var(--accent); text-decoration-color: var(--accent); }
.board-subgenres { padding: 0 0.9rem 0.5rem; font-size: 0.78rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.board-subgenres .pill { cursor: pointer; }

.super-group { margin-bottom: 0.3rem; }
.super-heading { margin: 0 0 0.5rem; font-size: 1rem; font-weight: 800; }
.super-heading a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; }
.super-heading a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.super-heading-other { color: var(--muted); }

.mode-toggle { display: inline-flex; gap: 0.2rem; margin-bottom: 0.8rem; background: var(--bg-alt); border: 1px solid var(--faint); border-radius: 999px; padding: 0.2rem; }
.mode-btn {
  background: transparent; color: var(--muted); font-size: 0.78rem; font-weight: 700;
  padding: 0.4rem 0.75rem; border-radius: 999px;
}
.mode-btn:hover { background: var(--faint); color: var(--ink); }
.mode-btn.active { background: var(--accent); color: #fff; }
.mode-btn.active:hover { background: var(--accent-dark); }
.board-row {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.9rem; font-size: 0.86rem;
  border-top: 1px solid var(--faint);
}
.board-row:hover { background: var(--bg-alt); }
.board-rank { width: 1.6rem; color: var(--muted); font-weight: 700; font-size: 0.8rem; }
.board-name { flex: 1; font-weight: 700; }
.board-sub { color: var(--muted); font-size: 0.76rem; }
.board-score { font-weight: 800; min-width: 2.6rem; text-align: right; }
.board-row-nr { opacity: 0.65; }
.board-row-nr .board-name { font-weight: 600; }

p.empty { color: var(--muted); font-size: 0.88rem; }

a.board-row[data-prompter], a.prompter-link { cursor: pointer; }

.modal-overlay {
  position: fixed; inset: 0; z-index: 20; background: rgba(15, 20, 25, 0.5);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 3.5rem 1rem 2rem; overflow-y: auto;
}
.modal-overlay[hidden] { display: none; }
.modal-panel {
  position: relative; width: 100%; max-width: 520px; background: var(--bg);
  border-radius: 16px; border: 1px solid var(--faint); padding: 1.2rem 1.1rem 1.1rem;
  box-shadow: 0 12px 40px rgba(15, 20, 25, 0.25);
}
.modal-close {
  position: absolute; top: 0.6rem; right: 0.6rem; width: 2rem; height: 2rem; padding: 0;
  border-radius: 999px; background: var(--bg-alt); color: var(--muted); font-size: 1.1rem;
  line-height: 1; border: 1px solid var(--faint);
}
.modal-close:hover { background: var(--faint); color: var(--ink); }
.modal-title { margin: 0 1.8rem 0.3rem 0; font-size: 1.15rem; font-weight: 800; }
.modal-actions { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-top: 0.8rem; }
.secondary-link { font-size: 0.82rem; font-weight: 700; }

footer {
  padding: 1.2rem 1.1rem 2rem; color: var(--muted); font-size: 0.8rem; border-top: 1px solid var(--faint);
}
footer code { background: var(--bg-alt); padding: 0.05rem 0.3rem; border-radius: 4px; }

.tab-panel[hidden] { display: none; }

/* --- site/genre/super detail pages ------------------------------------- */

.back-link { display: inline-block; margin-bottom: 0.8rem; font-size: 0.85rem; font-weight: 700; }
.detail-head { margin-bottom: 1rem; }
.detail-title { margin: 0 0 0.35rem; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.01em; }
.detail-blurb { margin: 0 0 0.6rem; color: var(--ink); font-size: 0.92rem; }
.detail-pills { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.detail-meta { margin: 0 0 0.5rem; font-size: 0.82rem; color: var(--muted); }
.rank-list { list-style: none; margin: 0 0 0.2rem; padding: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.rank-list li {
  font-size: 0.82rem; font-weight: 700; color: var(--accent-dark); background: #f4f0ff;
  border-radius: 8px; padding: 0.3rem 0.6rem; display: inline-block; width: fit-content;
}
.subgenre-row { font-size: 0.82rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }

.detail-score { display: flex; flex-direction: column; align-items: flex-start; margin: 0.8rem 0 1.2rem; }
.detail-score .score-big { font-size: 2rem; }
.detail-score .score-sub { font-size: 0.78rem; }

.review-composer {
  border: 1px solid var(--faint); border-radius: 14px; padding: 0.9rem 1rem; margin-bottom: 1.3rem; background: var(--bg-alt);
}
.review-composer h3 { margin: 0 0 0.6rem; font-size: 0.98rem; font-weight: 800; }
.score-picker { display: flex; gap: 0.25rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.review-composer textarea {
  width: 100%; min-height: 5rem; resize: vertical; padding: 0.6rem 0.7rem; border: 1px solid var(--faint);
  border-radius: 10px; font-family: inherit; font-size: 0.88rem; background: var(--bg); margin-bottom: 0.6rem;
}
.review-composer button { margin-right: 0.6rem; }
.bug-flag, .ping-flag {
  display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--muted);
  margin: -0.2rem 0 0.7rem; cursor: pointer;
}
.bug-flag input, .ping-flag input { margin: 0; }

.bug-tag {
  font-size: 0.72rem; font-weight: 700; color: var(--bad); background: rgba(249, 24, 128, 0.1);
  border-radius: 999px; padding: 0.08rem 0.5rem;
}
.ping-tag {
  font-size: 0.72rem; font-weight: 700; color: var(--accent-dark); background: #f4f0ff;
  border-radius: 999px; padding: 0.08rem 0.5rem;
}
.fixed-tag {
  font-size: 0.72rem; font-weight: 700; color: var(--good); background: rgba(0, 186, 124, 0.1);
  border-radius: 999px; padding: 0.08rem 0.5rem;
}
.bug-reports-heading { margin: 1.3rem 0 0.2rem; font-size: 0.98rem; font-weight: 800; }

.review-list h3 { margin: 0 0 0.6rem; font-size: 0.98rem; font-weight: 800; }
.review-row { border-top: 1px solid var(--faint); padding: 0.7rem 0; }
.review-row:first-child { border-top: none; }
.review-row-head { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.review-site { font-weight: 800; }
.review-handle { font-weight: 700; }
.review-score { font-weight: 800; color: var(--accent-dark); font-size: 0.85rem; }
.review-date { font-size: 0.76rem; color: var(--muted); margin-left: auto; }
.review-text { margin: 0.3rem 0 0; font-size: 0.88rem; color: var(--ink); white-space: pre-wrap; }

/* --- vote/reply block, under every review row -------------------------- */

.engagement { margin-top: 0.5rem; }
.vote-row { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.vote-btn {
  width: 1.6rem; height: 1.6rem; padding: 0; border-radius: 6px; font-size: 0.7rem;
  line-height: 1; background: var(--bg-alt); color: var(--muted); border: 1px solid var(--faint);
}
.vote-btn:hover:not(:disabled) { background: var(--faint); color: var(--ink); }
.vote-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.vote-net { font-weight: 800; font-size: 0.85rem; min-width: 1.3rem; text-align: center; color: var(--muted); }
.vote-net.pos { color: var(--good); }
.vote-net.neg { color: var(--bad); }
.vote-counts { font-size: 0.72rem; color: var(--muted); }
.reply-toggle { font-size: 0.78rem; font-weight: 700; }
.reply-count { font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.review-permalink { margin-left: auto; color: var(--muted); font-weight: 700; font-size: 0.76rem; padding: 0 0.2rem; }
.review-permalink:hover { color: var(--accent); text-decoration: none; }
.engagement-err { font-size: 0.78rem; color: var(--bad); margin: 0.3rem 0 0; }
.reply-list {
  margin: 0.5rem 0 0; padding-left: 0.8rem; border-left: 2px solid var(--faint);
  display: flex; flex-direction: column; gap: 0.55rem;
}
.reply-row { font-size: 0.84rem; }
.reply-handle { font-weight: 700; }
.reply-date { font-size: 0.72rem; color: var(--muted); margin-left: 0.4rem; }
.reply-body { margin: 0.15rem 0 0; white-space: pre-wrap; color: var(--ink); }
.reply-composer textarea {
  width: 100%; min-height: 3.2rem; resize: vertical; padding: 0.5rem 0.6rem; border: 1px solid var(--faint);
  border-radius: 10px; font-family: inherit; font-size: 0.85rem; background: var(--bg); margin-bottom: 0.4rem;
}
.reply-composer button { font-size: 0.78rem; padding: 0.4rem 0.8rem; }
.engagement.nested-reply { margin-top: 0.35rem; }
.reply-actions { display: flex; }
.bot-reply { opacity: 0.92; }
.bot-chip { font-weight: 700; color: var(--accent); }
.bot-fix-list { margin: 0.3rem 0 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 0.3rem; color: var(--ink); }

/* --- 🔔 subscriptions + alerts ------------------------------------------ */

#alerts-btn { position: relative; }
.alerts-badge {
  display: inline-block; margin-left: 0.3rem; background: var(--bad); color: #fff;
  border-radius: 999px; font-size: 0.68rem; font-weight: 800; padding: 0.05rem 0.4rem;
}
.sub-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.sub-btn.active:hover { background: var(--accent-dark); }

.alerts-subhead { margin: 1rem 0 0.4rem; font-size: 0.92rem; font-weight: 800; }
.notif-pref {
  display: flex; align-items: center; gap: 0.4rem; font-size: 0.86rem; color: var(--ink);
  cursor: pointer;
}
.notif-pref input { margin: 0; }
.sub-row {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  padding: 0.45rem 0; border-top: 1px solid var(--faint); font-size: 0.86rem;
}
.sub-row:first-child { border-top: none; }
.unsub-btn { font-size: 0.72rem; padding: 0.3rem 0.65rem; }
.alert-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem;
  padding: 0.5rem 0; border-top: 1px solid var(--faint); font-size: 0.84rem; color: var(--ink);
}
.alert-row:first-child { border-top: none; }
.alert-row.unread { font-weight: 700; }
.alert-row .alert-date { color: var(--muted); font-size: 0.72rem; white-space: nowrap; }

/* --- user chips (avatar + display name), wherever a bsky user is named -- */

.user-chip { display: inline-flex; align-items: center; gap: 0.32rem; vertical-align: middle; }
.avatar {
  width: 20px; height: 20px; border-radius: 999px; object-fit: cover; flex: none;
  background: var(--faint); vertical-align: middle;
}
.avatar-placeholder { display: inline-block; border: 1px solid var(--faint); }
.chip-handle { color: var(--muted); font-weight: 600; }
.user-chip-lg .avatar, .user-chip-lg .avatar-placeholder { width: 28px; height: 28px; }
.user-chip-lg { gap: 0.4rem; }
.chip-suffix { margin-left: 0.3rem; font-weight: 700; }
h2.detail-title.user-chip { display: flex; }

/* --- featured tab -------------------------------------------------------- */

.featured-block { margin-bottom: 1.4rem; }
.featured-heading {
  margin: 0 0 0.5rem; font-size: 0.8rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--muted);
}
.featured-cta { margin: 0.5rem 0 0; font-size: 0.8rem; }
.featured-cta a { font-weight: 700; }
