:root {
  --bg: #121316;
  --panel: #1c1e22;
  --fg: #e9eaec;
  --muted: #9aa0a6;
  --accent: #c8a35a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

header {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 18px 20px 12px;
  background: linear-gradient(var(--bg), rgba(18, 19, 22, 0.9));
  backdrop-filter: blur(6px);
  border-bottom: 1px solid #2a2c31;
}

h1 { margin: 0 0 10px; font-size: 1.4rem; font-weight: 600; }

.people { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  border: 1px solid #34373d;
  background: var(--panel);
  color: var(--fg);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.chip:hover { border-color: var(--accent); }
.chip-active { background: var(--accent); color: #1b1300; border-color: var(--accent); font-weight: 600; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  padding: 14px;
}

.tile {
  border: 0;
  padding: 0;
  background: #0c0d0f;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 3 / 2;
}
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile:hover img { opacity: 0.9; }

.gate {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
}
.gate form {
  background: var(--panel);
  border: 1px solid #2a2c31;
  border-radius: 12px;
  padding: 28px;
  width: min(340px, 90vw);
  text-align: center;
}
.gate h2 { margin-top: 0; font-size: 1.1rem; }
.gate input {
  width: 100%;
  padding: 10px;
  margin: 12px 0;
  border-radius: 8px;
  border: 1px solid #34373d;
  background: #15161a;
  color: var(--fg);
}
.gate button, .lb-meta .orig-link {
  background: var(--accent);
  color: #1b1300;
  border: 0;
  border-radius: 8px;
  padding: 9px 16px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.error { color: #e6786f; font-size: 0.85rem; }

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  z-index: 10;
}
.lightbox img { max-width: 94vw; max-height: 82vh; object-fit: contain; }
.lb-meta {
  color: var(--muted);
  text-align: center;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}
.lb-close {
  position: fixed;
  top: 14px;
  right: 18px;
  font-size: 2rem;
  line-height: 1;
  background: none;
  border: 0;
  color: var(--fg);
  cursor: pointer;
}

.status { text-align: center; color: var(--muted); padding: 24px; }
