* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #E7E0D7;
  overscroll-behavior: none;
}

.page {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100svh;
  overflow: hidden;
}

.viewport {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100svh;
  overflow: hidden;
  background: #ffffff;
  touch-action: none;
  cursor: grab;
}

.viewport.is-dragging {
  cursor: grabbing;
}

.viewport-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

/*
  Mundo lógico:
  - PNG/WebP: 4800×2400
  - Vídeos: 2400×1200, pero se muestran dentro del mismo mundo lógico.
*/
.world {
  position: absolute;
  left: 0;
  top: 0;
  width: 4800px;
  height: 2400px;
  transform-origin: 0 0;
  will-change: transform;
  user-select: none;
  z-index: 1;
}

.media {
  position: absolute;
  inset: 0;
  display: block;
  width: 4800px;
  height: 2400px;
  object-fit: fill;
  opacity: 0;
  pointer-events: none;
  user-select: none;
}

.media-visible {
  opacity: 1;
}

.media-fade {
  transition: opacity 120ms linear;
}

.stage-controls {
  position: absolute;
  left: 50%;
  bottom: max(24px, 6svh);
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  flex-wrap: wrap;
  max-width: calc(100vw - 24px);
}

.stage-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  background: rgba(36, 30, 24, 0.82);
  color: white;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: auto;
  white-space: nowrap;
}

.stage-button:hover {
  background: rgba(36, 30, 24, 0.95);
}

.stage-button[hidden] {
  display: none;
}

@media (max-width: 520px) {
  .stage-button {
    font-size: 13px;
    padding: 10px 14px;
  }

  .stage-controls {
    gap: 8px;
    bottom: max(18px, 4svh);
  }
}