:root {
  color-scheme: dark;
  --bg: #2D3436;
  --card: #353B48;
  --card-light: #3D4452;
  --tabbar: #1E2225;
  --skeleton: #2C2C2E;
  --border: #444C56;
  --line: #3D4450;
  --text: #DFE6E9;
  --text-bright: #F4F4F6;
  --text-secondary: #B2BEC3;
  --text-muted: #8A9299;
  --primary: #6C5CE7;
  --primary-light: #A29BFE;
  --primary-dark: #5A4BD6;
  --success: #00B894;
  --warm: #FDCB6E;
  --error: #FF6B6B;
  --gold: #E8B84A;
  --primary-subtle: #6C5CE71A;
  --primary-border: #6C5CE740;
  --success-subtle: #00B8941A;
  --success-border: #00B89440;
  --warm-subtle: #FDCB6E1A;
  --warm-border: #FDCB6E40;
  --error-subtle: #FF6B6B1A;
  --error-border: #FF6B6B40;
  --gold-subtle: #E8B84A1A;
  --gold-border: #E8B84A40;
  --text-subtle: #B2BEC31A;
  --text-border: #B2BEC340;
  --transparent: transparent;
  --font: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-width: 300px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 3px;
}
[hidden] { display: none !important; }
.wrap { width: min(100%, 1000px); margin: 0 auto; padding: 0 16px; }
.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;
}

.spectrum {
  position: fixed;
  z-index: 2;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--success), var(--warm), var(--gold), var(--primary));
}

.masthead {
  margin-top: 16px;
  padding: 24px 16px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--tabbar);
}
.brand { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.brand-logo {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.brand-copy { min-width: 0; }
.brand-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.brand h1 {
  color: var(--text-bright);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.brand h1 span { color: var(--primary-light); }
.brand-kicker {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.freshness { color: var(--text-muted); font-size: 12px; }
.lede { max-width: 700px; margin-bottom: 24px; color: var(--text-secondary); font-size: 16px; }
.priority-note {
  max-width: 760px;
  margin: -12px 0 24px;
  color: var(--text-secondary);
  font-size: 13px;
}

.pulse {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(360px, auto);
  gap: 20px;
  align-items: center;
  margin-bottom: 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--tabbar);
}
.pulse-totals { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.pulse-totals strong { color: var(--text-bright); font-size: 24px; line-height: 1.2; }
.pulse-totals strong:last-child { color: var(--success); }
.pulse-totals > span { color: var(--text-muted); }
.pulse-stats { display: flex; align-items: stretch; }
.pulse-stats > div { min-width: 112px; padding: 0 12px; border-left: 1px solid var(--line); }
.pulse-stats dt { color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.pulse-stats dd {
  color: var(--text-bright);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}
.period-delta {
  display: block;
  min-height: 16px;
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.period-delta.positive { color: var(--success); }
.period-delta.negative { color: var(--error); }
.idea-link {
  display: inline-flex;
  gap: 6px;
  margin: -12px 0 20px 16px;
  color: var(--primary-light);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.idea-link:hover { color: var(--primary); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tab {
  position: relative;
  appearance: none;
  padding: 12px 16px;
  border: 0;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: color 140ms ease;
}
.tab:hover { color: var(--text-secondary); }
.tab[aria-selected='true'] { color: var(--text-bright); }
.tab[aria-selected='true']::after {
  content: '';
  position: absolute;
  right: 16px;
  bottom: -1px;
  left: 16px;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: var(--primary);
}
.tab .count { margin-left: 4px; color: var(--text-muted); font-size: 12px; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 20px 0 8px;
}
.open-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.sort-line, .search-line { display: flex; min-width: 0; flex-wrap: wrap; gap: 8px; align-items: center; width: 100%; }
.toolbar-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.search-line .search { max-width: 420px; }
.filter-groups { display: grid; gap: 8px; }
.filter-group {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--tabbar) 72%, transparent);
}
.filter-group .toolbar-label { padding: 6px 0 0 4px; }
.filters { display: flex; min-width: 0; flex: 1 1 480px; flex-wrap: wrap; gap: 4px; }
.search {
  flex: 1 1 220px;
  min-width: 180px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  font-size: 14px;
}
.search::placeholder { color: var(--text-secondary); }
.search:focus { border-color: var(--primary); outline-color: var(--primary-light); }
.sorts {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--tabbar);
}
.sort {
  appearance: none;
  padding: 8px 12px;
  border: 1px solid var(--transparent);
  border-radius: 999px;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 140ms ease, background 140ms ease;
}
.sort:hover { color: var(--text-bright); }
.sort[aria-pressed='true'] { border-color: var(--primary); background: var(--primary-dark); color: var(--text-bright); }
.sort:disabled { color: var(--text-muted); cursor: not-allowed; }
.sort-availability {
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--tabbar);
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
}
.result-count {
  min-height: 20px;
  padding: 4px 12px 0;
  color: var(--text-secondary);
  font-size: 12px;
}

.list { padding: 8px 0 56px; }
.loading, .error {
  margin: 24px 0;
  padding: 20px;
  border: 1px solid var(--text-border);
  border-radius: 12px;
  background: var(--skeleton);
  color: var(--text-secondary);
  font-size: 14px;
}
.error { border-color: var(--error-border); background: var(--error-subtle); color: var(--error); }
.empty-state {
  margin: 16px 0 48px;
  padding: 24px;
  border: 1px solid var(--text-border);
  border-radius: 12px;
  background: var(--skeleton);
  color: var(--text-secondary);
}
.empty-mark {
  display: block;
  margin-bottom: 8px;
  color: var(--warm);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.empty-state h2 { color: var(--text-bright); font-size: 20px; font-weight: 700; }
.empty-state p { max-width: 460px; margin-top: 4px; font-size: 14px; }
.empty-clear {
  margin-top: 16px;
  padding: 8px 12px;
  border: 1px solid var(--primary-border);
  border-radius: 6px;
  background: var(--primary-subtle);
  color: var(--primary-light);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.empty-clear:hover { border-color: var(--primary); color: var(--text-bright); }

.row {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  margin-bottom: 8px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  transition: background 140ms ease, border-color 140ms ease;
}
.row:hover { border-color: var(--primary-border); background: var(--card-light); }
.row.rank-first {
  grid-template-columns: 96px minmax(0, 1fr) auto;
  margin-bottom: 12px;
  padding: 20px;
  border-color: var(--gold);
  background: var(--card-light);
}
.row.rank-first .body h2 { font-size: 20px; }
.row.rank-top3 { border-color: var(--primary); background: var(--card-light); }
.row.in-progress { border-color: var(--warm); }
.row.in-progress:hover { border-color: var(--warm); }
.rank {
  min-height: 20px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.rank-first .rank { color: var(--primary-light); font-size: 18px; }
.rank-top3 .rank { font-size: 15px; }
.rank-top10 .rank { color: var(--primary-light); font-size: 14px; }
.votes { display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 4px; }
.votes .n {
  display: flex;
  gap: 4px;
  align-items: center;
  color: var(--primary-light);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}
.vote-heart { font-size: 12px; }
.prism { width: 44px; height: 4px; overflow: hidden; border-radius: 999px; background: var(--line); }
.prism i { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.trend {
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}
.trend.positive { padding: 2px 4px; border-radius: 6px; background: var(--tabbar); color: var(--success); }
.trend.negative { padding: 2px 4px; border-radius: 6px; background: var(--tabbar); color: var(--error); }
.trend.unknown, .trend.zero { color: var(--text-secondary); }
.body { min-width: 0; }
.body h2, .body p, .shipped-row .title { overflow-wrap: anywhere; }
.body h2 {
  margin-bottom: 4px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
}
.body h2 a, .shipped-row .title a { color: var(--text-bright); text-decoration: none; }
.body h2 a:hover { color: var(--primary-light); }
.body > p { margin-bottom: 8px; color: var(--text); font-size: 14px; }
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  color: var(--text-secondary);
  font-size: 12px;
}
.card-action {
  display: inline-flex;
  padding: 4px 8px;
  border: 1px solid var(--primary-border);
  border-radius: 999px;
  background: var(--primary-subtle);
  color: var(--primary-light);
  font-weight: 600;
  text-decoration: none;
  transition: background 140ms ease, color 140ms ease;
}
.card-action:hover { border-color: var(--primary); background: var(--primary-border); color: var(--text-bright); }
.reaction-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.reaction-pill, .comment-pill {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid color-mix(in srgb, var(--chip-color) 25%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--chip-color) 10%, transparent);
  color: var(--chip-text, var(--chip-color));
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}
.reaction-emoji { line-height: 1; }
.custom-emoji { display: block; object-fit: contain; }
.reaction-fallback { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comment-pill {
  border-color: var(--border);
  background: transparent;
  color: var(--text-secondary);
  text-decoration: none;
}
.comment-pill::after { content: ''; width: 0; overflow: hidden; transition: width 140ms ease; }
.comment-pill:hover { color: var(--text-bright); }
.comment-pill:hover::after { content: '↗'; width: auto; }
.relative-age { margin-left: 2px; color: var(--text-secondary); font-size: 12px; }
.note {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--primary-border);
  border-radius: 12px;
  background: var(--primary-subtle);
}
.note .who {
  display: block;
  margin-bottom: 4px;
  color: var(--primary-light);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.note p { color: var(--text); font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; max-width: 240px; }
.chip {
  appearance: none;
  padding: 4px 8px;
  border: 1px solid color-mix(in srgb, var(--chip-color, var(--text-secondary)) 25%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--chip-color, var(--text-secondary)) 10%, transparent);
  color: var(--chip-text, var(--chip-color, var(--text-secondary)));
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.filter-chip { cursor: pointer; }
.filter-chip:hover { filter: brightness(1.15); }
.filter-chip[aria-pressed='true'] {
  border-color: var(--chip-selected, var(--chip-color));
  background: var(--chip-selected, var(--chip-color));
  color: var(--tabbar);
  box-shadow: none;
}
.filter-chip[aria-pressed='true']::before { content: '✓'; font-weight: 900; }
.chip.new { --chip-color: #55EFC4; }
.chip.in-progress-chip { --chip-color: var(--warm); }
.chip.hot { border-color: var(--warm-border); background: var(--warm-subtle); color: var(--warm); }

.shipped-list { padding-top: 16px; }
.release { margin-bottom: 32px; }
.release:last-child { margin-bottom: 0; }
.release-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
  padding: 0 12px 8px;
  border-bottom: 1px solid var(--line);
}
.release-head .month { color: var(--success); font-size: 14px; font-weight: 700; }
.release-head .month::before { content: '✓ '; }
.release-head .detail { color: var(--text-secondary); font-size: 12px; }
.release.earlier { margin-top: 40px; }
.release.earlier .month { color: var(--text-secondary); }
.release.earlier .month::before { content: ''; }
.shipped-card { border-left: 3px solid var(--success); }
.shipped-card:hover { border-color: var(--success-border); border-left-color: var(--success); }
.shipped-card .votes .n { color: var(--success); }
.shipped-card .prism i { background: var(--success); }
.shipped-card .body h2 > span { color: var(--text-bright); }
.shipped-action {
  border-color: var(--success-border);
  background: var(--success-subtle);
  color: #55EFC4;
}
.shipped-action:hover { border-color: var(--success); background: var(--success-border); }
.archived-chip {
  border-color: var(--border);
  background: var(--tabbar);
  color: var(--text-muted);
}
.shipped-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 8px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}
.shipped-row:hover { border-color: var(--success-border); background: var(--card-light); }
.shipped-row .title { font-size: 15px; font-weight: 600; }
.shipped-row .title a:hover { color: var(--text-bright); text-decoration: underline; text-decoration-color: var(--success); }
.delivery-badge {
  display: inline-flex;
  margin-left: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.delivery-badge.express { border: 1px solid var(--warm-border); background: var(--warm-subtle); color: var(--warm); }
.delivery-badge.worth-wait { border: 1px solid var(--primary); background: var(--tabbar); color: var(--primary-light); }
.delivery-time.neutral { color: var(--text-secondary); font-size: 11px; font-weight: 600; white-space: nowrap; }
.shipped-row .requesters { color: var(--text-secondary); font-size: 12px; white-space: nowrap; }

.discord-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}
.discord-cta h2 {
  margin-bottom: 4px;
  color: var(--text-bright);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.discord-cta p { max-width: 600px; color: var(--text); font-size: 14px; }
.discord-cta-button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 16px;
  border: 1px solid var(--primary);
  border-radius: 12px;
  background: var(--primary-dark);
  color: var(--text-bright);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background 140ms ease, transform 140ms ease;
}
.discord-cta-button:hover { background: var(--primary-dark); transform: translateY(-1px); }

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0 48px;
  border-top: 1px solid var(--line);
  color: var(--text-secondary);
  font-size: 13px;
}
.foot a { color: var(--primary-light); text-decoration: none; }
.foot a:hover { color: var(--primary-light); text-decoration: underline; }
.stamp { display: flex; gap: 8px; font-size: 12px; }
noscript { display: block; padding: 20px; color: var(--text); text-align: center; }

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .masthead { margin-top: 12px; padding: 20px 12px 0; }
  .brand { gap: 12px; }
  .brand-logo { width: 56px; height: 56px; }
  .brand h1 { font-size: 24px; }
  .lede { font-size: 15px; }
  .pulse { grid-template-columns: 1fr; gap: 12px; padding: 16px; }
  .pulse-stats > div:first-child { padding-left: 0; border-left: 0; }
  .idea-link { margin-left: 0; }
  .toolbar { align-items: stretch; }
  .search-line .search { max-width: none; flex-basis: 100%; }
  .filter-group { grid-template-columns: 1fr; gap: 4px; }
  .filter-group .toolbar-label { padding-top: 0; }
  .filters { flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .filters .filter-chip { flex: 0 0 auto; }
  .sorts { width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; }
  .sort-availability { max-width: 100%; }
  .sort { flex: 1 0 auto; }
  .sort-availability { flex-basis: 100%; }
  .row, .row.rank-first { grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 12px; }
  .row.rank-first .body h2 { font-size: 18px; }
  .chips { grid-column: 2; justify-content: flex-start; max-width: none; margin-top: 4px; }
  .reaction-row { margin-top: 8px; }
  .tab { padding: 12px; font-size: 13px; }
  .tab[aria-selected='true']::after { right: 12px; left: 12px; }
  .shipped-row { padding: 12px; }
  .release-head { padding-right: 4px; padding-left: 4px; }
  .discord-cta { grid-template-columns: 1fr; gap: 16px; padding: 20px 16px; }
  .discord-cta-button { width: 100%; }
}

@media (max-width: 420px) {
  .brand-line { display: block; }
  .freshness { display: block; margin-top: 4px; }
  .pulse-stats > div { min-width: 0; flex: 1; padding: 0 12px; }
  .pulse-stats dt { white-space: normal; }
  .shipped-row { grid-template-columns: 1fr; gap: 4px; }
  .shipped-row .requesters { font-size: 11px; }
  .delivery-badge { margin: 4px 0 0 8px; }
  .foot { flex-direction: column; }
}

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