* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  cursor: none;
}

#gallery {
  position: relative;
  width: 100vw;
  height: 100vh;
}

.tile {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain; /* never stretch/crop — native aspect ratio preserved */
  display: block;
}

.tile .label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 6px 10px;
  font-size: 13px;
  color: #eee;
  background: linear-gradient(to top, rgba(0,0,0,0.75), transparent);
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page {
  position: absolute;
  inset: 0;
  display: flex;
  gap: 4px;
  transition: opacity 0.8s ease;
}

.page.entering { opacity: 0; }
.page.active { opacity: 1; }
.page.leaving { opacity: 0; }

#empty-state {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 22px;
  text-align: center;
}
#empty-state.hidden { display: none; }
#empty-state .sub { font-size: 15px; color: #555; margin-top: 8px; }
#empty-state code { color: #aaa; }

#pager-dots {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}
#pager-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
}
#pager-dots .dot.active { background: rgba(255,255,255,0.85); }
