* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: #111;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.gallery {
  display: flex;
  gap: 16px;
  padding: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  width: 100%;
}
.gallery img {
  height: 80vh;
  max-height: 640px;
  width: auto;
  flex-shrink: 0;
  border-radius: 8px;
  scroll-snap-align: center;
  object-fit: contain;
  background: #222;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.gallery img.selected {
  box-shadow: 0 0 0 4px #fff;
}
.empty {
  color: #888;
  margin: auto;
  text-align: center;
}
.back-link {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 20;
  color: #ccc;
  text-decoration: none;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.5);
  padding: 6px 12px;
  border-radius: 999px;
}
.back-link:hover {
  color: #fff;
}
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 10;
}
.overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.overlay img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  cursor: zoom-out;
}
