:root {
  color-scheme: dark;
  --bg: #0b0b0c;
  --fg: #f2f2f2;
  --muted: #9a9a9a;
  --accent: #e8e8e8;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100%;
}

/* ---------- Lock screen ---------- */

.lock-screen {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-top: calc(24px + env(safe-area-inset-top));
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.lock-card {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}

.lock-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 4px;
}

.lock-subtitle {
  color: var(--muted);
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.lock-card input[type="password"] {
  background: #1c1c1e;
  border: 1px solid #2e2e30;
  color: var(--fg);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 1rem;
}

.lock-card button {
  background: var(--accent);
  color: #111;
  border: none;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.lock-card button:active {
  opacity: 0.85;
}

.lock-error {
  color: #ff6b6b;
  font-size: 0.9rem;
  margin: 0;
}

/* ---------- Gallery ---------- */

.page-header {
  padding: calc(20px + env(safe-area-inset-top)) 16px 12px;
  text-align: center;
}

.page-header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.page-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 4px;
  padding: 4px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

@media (min-width: 700px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 6px;
    padding: 6px;
  }
}

@media (min-width: 1100px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
    padding: 8px;
  }
}

.grid-item {
  display: block;
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #151516;
}

.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- PhotoSwipe overrides ---------- */

.pswp {
  --pswp-bg: #000;
}
