* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #faf7f2;
  color: #3a3a3a;
}
header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 1rem 1.25rem;
  background: #fffdfa;
  border-bottom: 1px solid #eadfd0;
}
h1 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
}
main {
  padding: 1rem;
  padding-bottom: 5.5rem;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.tile {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 8px;
  background: #eee;
  border: none;
  padding: 0;
  cursor: pointer;
}
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.empty {
  text-align: center;
  color: #999;
  margin-top: 3rem;
}

.fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #c9a15a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  z-index: 20;
}
.fab input {
  display: none;
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 30;
  align-items: center;
  justify-content: center;
}
.lightbox.open {
  display: flex;
}
.lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
}
.lightbox-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox-download {
  position: absolute;
  bottom: 1.25rem;
  right: 1.25rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
