:root {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  touch-action: none; /* block native pinch-zoom / double-tap-zoom across the whole page */
  overscroll-behavior: none;
}

body {
  background: #ffffff;
  overflow: hidden;
}

/* Full-viewport stage. touch-action:none stops the browser hijacking drags for
   scroll/zoom; overscroll-behavior:none kills pull-to-refresh / bounce. */
#stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}

.flyer {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: center;
  contain: layout paint;
  will-change: auto;
  overflow: hidden;
  border-radius: 2px;
  background-size: cover;
  background-position: center;
  cursor: grab;
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.22),
    0 2px 5px rgba(0, 0, 0, 0.16);
}

.flyer:active {
  cursor: grabbing;
}

.flyer img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none; /* let pointerdown target the .flyer box */
  -webkit-user-drag: none;
  user-drag: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.flyer.loaded img {
  opacity: 1;
}

/* Zoom / read mode: an 80%-of-screen poster floating over the base pile. No backdrop
   tint or fade — the full-brightness pile stays visible behind. This transparent layer
   exists only to catch a click outside the poster (to close). */
.zoom-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh; /* fallback */
  height: 100dvh; /* iOS: track the visible viewport (toolbars), not the taller layout one */
  z-index: 2147483000;
  display: none;
  align-items: center;
  justify-content: center;
  background: transparent;
  touch-action: none;
  overscroll-behavior: none;
}

.zoom-overlay.open {
  display: flex;
}

.zoom-img {
  max-width: 90vw;
  max-height: 90vh;
  max-height: 90dvh; /* iOS: size against the visible viewport, not the taller layout one */
  width: auto;
  height: auto;
  border-radius: 3px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  transform-origin: center center;
  will-change: transform;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.zoom-img:active {
  cursor: grabbing;
}

/* The only chrome on the main page: a tiny seafoam dot in the top-right corner linking to
   the submission page. Above the pile and the zoom overlay so it's always reachable. */
.submit-dot {
  position: fixed;
  top: 14px;
  right: 14px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #7ed68d;
  z-index: 2147483001;
}
