:root {
  --pico-font-size: 100%;
  --heat: 38 92% 50%;
}

body { overflow-x: hidden; }
main.container { padding-top: 1rem; }
.muted, time { color: var(--pico-muted-color); }
.empty { padding: 3rem 0; text-align: center; color: var(--pico-muted-color); }

/* Header */
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1rem;
  padding-block: .75rem;
  border-bottom: 1px solid var(--pico-muted-border-color);
}
.topbar .brand { font-weight: 700; text-decoration: none; color: var(--pico-color); }
.topbar nav { display: flex; gap: 1rem; }
.topbar nav a { text-decoration: none; }
.topbar nav a[aria-current] { font-weight: 700; text-decoration: underline; }

/* Filters */
.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .75rem;
  margin-bottom: .5rem;
}
.filters label { margin: 0; }
.filters label span { font-size: .8rem; color: var(--pico-muted-color); }
.filters select { margin: 0; }
.summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1rem;
  font-size: .9rem;
  color: var(--pico-muted-color);
}

/* Card grid */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: .75rem;
}
@media (min-width: 768px) {
  .grid-cards { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
}
.card {
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: .75rem;
  background: var(--pico-card-background-color);
  box-shadow: var(--pico-card-box-shadow);
}
.thumb { position: relative; }
.thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--pico-muted-border-color);
}
/* Score badge: frosted-glass pill over the photo, bottom left (feed cards and photo page). */
.thumb .score, .pic .score {
  position: absolute;
  bottom: .5rem;
  left: .5rem;
  padding: .2rem .6rem;
  border: 1px solid rgb(255 255 255 / .45);
  border-radius: 999px;
  background: rgb(255 255 255 / .28);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  backdrop-filter: blur(10px) saturate(1.4);
  color: #fff;
  font-weight: 700;
  line-height: 1.5;
  text-decoration: none;
  text-shadow: 0 1px 2px rgb(0 0 0 / .55);
}
.thumb .score::before, .pic .score::before { content: "★ "; font-size: .85em; }
.pic .score { bottom: .75rem; left: .75rem; font-size: 1.15rem; }
.meta { display: grid; gap: .15rem; padding: .6rem .7rem .7rem; }
.who { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.meta time { font-size: .78rem; }

.chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .3rem; }
.chip {
  padding: .05rem .5rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 999px;
  font-size: .75rem;
  color: var(--pico-muted-color);
  text-decoration: none;
  white-space: nowrap;
}
.chip.active { border-color: var(--pico-primary); color: var(--pico-primary); }
.chips.big .chip { padding: .2rem .7rem; font-size: .9rem; }
.more { grid-column: 1 / -1; margin: .5rem 0 0; }

/* Photo page */
.detail { display: grid; gap: 1rem; margin: 0; padding: 0; background: none; box-shadow: none; }
/* The wrapper hugs the image, so the score badge lands on the photo itself. */
.detail .pic { position: relative; width: fit-content; max-width: 100%; margin-inline: auto; }
.detail .pic img { display: block; max-width: 100%; max-height: 80vh; width: auto; height: auto; border-radius: .75rem; }
.detail .byline { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .15rem .75rem; margin-bottom: .9rem; }
.detail h3 {
  margin: 0 0 .25rem;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--pico-muted-color);
}
.detail .text { white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: .8rem; }
@media (min-width: 900px) {
  .detail { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
}

/* Stats */
.table-scroll { overflow-x: auto; margin-bottom: 2rem; }
.stats { margin: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stats th, .stats td { padding: .45rem .5rem; }
.stats .num { text-align: center; }
/* Score columns share one fixed width, whether a cell holds a count or a dot. */
.stats .sc { width: 3rem; min-width: 3rem; max-width: 3rem; padding-inline: .2rem; }
.stats .zero { color: var(--pico-muted-color); opacity: .5; }
.stats .sticky {
  position: sticky;
  left: 0;
  z-index: 1;
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--pico-background-color);
}
.stats tfoot th, .stats tfoot td { font-weight: 700; }
/* The count is always shown as text; the single-hue fill only echoes its magnitude. */
.stats a.heat {
  display: block;
  padding: .1rem 0;
  border-radius: 4px;
  color: var(--pico-color);
  text-decoration: none;
  background: hsl(var(--heat) / calc(.12 + .4 * var(--w)));
}
.stats a.heat:hover { outline: 2px solid var(--pico-primary); }

/* Login */
.login { max-width: 26rem; margin: 12vh auto 0; text-align: center; }
.notice { padding: .6rem .8rem; border-radius: .5rem; background: hsl(var(--heat) / .18); }
