:root {
  --bg: #0b0b0d; --fg: #f4f4f5; --muted: #9a9aa3; --accent: #e10600; --card: #17171b; --gap: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: inherit; }
.top { padding: 28px 16px 12px; text-align: center; }
.top h1 { margin: 0; font-size: clamp(26px, 5vw, 44px); letter-spacing: -0.02em; text-transform: uppercase; }
.top .sub { margin: 4px 0 16px; color: var(--muted); }
.controls { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; }
.filters { display: inline-flex; gap: 4px; background: var(--card); border-radius: 999px; padding: 4px; }
.filters button { border: 0; background: transparent; color: var(--muted); padding: 8px 16px;
  border-radius: 999px; font-weight: 600; cursor: pointer; min-height: 40px; }
.filters button.on { background: var(--accent); color: #fff; }
.count { margin: 0; color: var(--muted); }
main { padding: 8px 16px 32px; max-width: 1600px; margin: 0 auto; }
.state { text-align: center; padding: 48px 16px; color: var(--muted); }
.state button { margin-top: 12px; background: var(--accent); color: #fff; border: 0; padding: 10px 18px;
  border-radius: 8px; font-weight: 600; cursor: pointer; }
.grid { columns: 2; column-gap: var(--gap); }
@media (min-width: 640px) { .grid { columns: 3; } }
@media (min-width: 1000px) { .grid { columns: 4; } }
@media (min-width: 1400px) { .grid { columns: 5; } }
.tile { display: block; width: 100%; margin: 0 0 var(--gap); break-inside: avoid; background: var(--card);
  border-radius: 8px; overflow: hidden; border: 0; padding: 0; cursor: pointer; position: relative; }
.tile img { display: block; width: 100%; height: auto; }
.tile .badge { position: absolute; top: 6px; left: 6px; background: rgba(0,0,0,.6); color: #fff;
  font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 4px; }
.skel { display: block; width: 100%; margin: 0 0 var(--gap); break-inside: avoid; border-radius: 8px;
  background: linear-gradient(90deg, #1a1a1f 25%, #232329 50%, #1a1a1f 75%); background-size: 200% 100%;
  animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.foot { text-align: center; color: var(--muted); padding: 16px; font-size: 13px; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.95); z-index: 10; display: flex;
  align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column;
  align-items: center; padding: 16px; }
.lightbox img { max-width: 100vw; max-height: 72vh; object-fit: contain; }
.lightbox figcaption { max-width: 720px; width: 100%; padding: 12px 8px 0; color: var(--fg); font-size: 14px; }
.lightbox figcaption .meta { color: var(--muted); font-size: 13px; margin-top: 6px; display: flex;
  flex-wrap: wrap; gap: 12px; }
.lightbox figcaption .cap { white-space: pre-wrap; max-height: 20vh; overflow: auto; margin-top: 6px; }
.lightbox figcaption .orig { display: inline-block; margin-top: 10px; background: var(--accent); color: #fff;
  text-decoration: none; padding: 8px 14px; border-radius: 8px; font-weight: 600; }
.lb-close, .lb-prev, .lb-next { position: absolute; background: rgba(255,255,255,.1); color: #fff; border: 0;
  width: 44px; height: 44px; border-radius: 50%; font-size: 26px; cursor: pointer; }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 8px; top: 50%; transform: translateY(-50%); }
