* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: transparent; overflow: hidden; }
body { font-family: system-ui, "Segoe UI", Roboto, sans-serif; color: #fff; }

/* 4 x 2 grid of exact squares, scaled to fit the viewport and pinned to the bottom edge */
#wall {
  --gap: 1.2vmin;
  --w: min(100vw, 200vh);
  position: absolute; left: 50%; bottom: var(--gap); transform: translateX(-50%);
  width: var(--w); height: calc(var(--w) / 2 - var(--gap) * 1.5);
  display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr);
  gap: var(--gap); padding: 0 var(--gap);
}
.tile { position: relative; overflow: hidden; border-radius: 1.2vmin; background: rgba(0, 0, 0, .25); }
.tile.qr { background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.tile.qr img { width: 100%; flex: 1; min-height: 0; object-fit: contain; }
.tile.qr .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: .6vmin 1vmin;
  text-align: center; background: #fff; color: #111; font-weight: 700; font-size: 1.7vmin;
}
.tile.qr img { padding-bottom: 3.2vmin; }
.tile.empty { border: .35vmin dashed rgba(255, 255, 255, .35); background: transparent; }
.tile .photo {
  position: absolute; inset: 0; opacity: 0; transition: opacity 1s ease;
}
.tile .photo.show { opacity: 1; }
.tile .photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .photo .name {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 4vmin 1.2vmin 1.2vmin;
  background: linear-gradient(transparent, rgba(0, 0, 0, .75));
  font-size: 2.6vmin; font-weight: 700; text-align: center;
  text-shadow: 0 .2vmin .6vmin rgba(0, 0, 0, .8);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
