/* Leave room around the deck for the angled cards and clip only at the outer edge. */
.photo-stack {
  max-width: 780px;
  margin-inline: auto;
  overflow: clip;
  padding: 12px 24px 4px;
}

.photo-stack-inner {
  position: relative;
  aspect-ratio: 16 / 10;
  perspective: 600px;
  margin-bottom: 20px;
}

.stack-slot {
  position: absolute;
  inset: 0 3% 0 0;
  transform-origin: 90% 90%;
  pointer-events: none;
}

.stack-slot--top { pointer-events: auto; }

.stack-card {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  box-shadow: 0 10px 24px rgba(var(--sakura-shadow-rgb), .28);
}

.stack-card--draggable {
  touch-action: pan-y pinch-zoom;
  cursor: grab;
}
.stack-card--draggable:active { cursor: grabbing; }

.stack-card picture,
.stack-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

.stack-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--nav-text);
}

.stack-controls span,
.stack-controls button {
  border-radius: var(--r-md);
  background: var(--nav-bg);
  color: inherit;
  border: 1px solid var(--nav-edge);
}

.stack-controls span { padding: 4px 9px; }
.stack-controls button {
  width: 44px;
  height: 44px;
  font: inherit;
  font-size: 1.25rem;
  cursor: pointer;
}
.stack-controls button:disabled { opacity: .55; cursor: default; }
.stack-controls button:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

.stack-ph,
.stack-empty {
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--text-2);
  border-radius: var(--r-lg);
}
.stack-ph { height: 100%; }
.stack-empty { min-height: 180px; }

@media (max-width: 768px) {
  .photo-stack { padding-inline: 14px; }
  .photo-stack-inner { aspect-ratio: 4 / 3; margin-bottom: 14px; }
}
