* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: #0a2c71;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-family: Georgia, 'Times New Roman', serif;
}
.stage {
  position: relative;
  width: min(100vw, 150vh);
  aspect-ratio: 3 / 2;
}
.bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.slot {
  position: absolute;
  overflow: hidden;
  background: transparent;
}
.slot video, .slot img.photo-full {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
}
.slot.left {
  left: 52.31%; top: 43.60%; width: 22.575%; aspect-ratio: 330 / 368;
  transform: translate(-50%, -50%) rotate(-2.4deg);
}
.slot.right {
  left: 81.97%; top: 46.88%; width: 22.05%; aspect-ratio: 322 / 366;
  transform: translate(-50%, -50%);
}
#video { transform: scaleX(-1); filter: sepia(0.55); }
#photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; cursor: pointer; filter: sepia(0.55); }
#aged { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: sepia(0.55); }
#btnTake {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: flex; flex-direction: column; gap: 10px;
  align-items: center; justify-content: center;
  background: rgba(10, 44, 113, 0.45);
  color: #fff; border: 0; cursor: pointer;
  font-family: inherit; font-size: clamp(14px, 2.2vw, 24px); letter-spacing: .02em;
  transition: transform .15s ease, background .15s ease;
}
#btnTake:hover { background: rgba(10, 44, 113, 0.6); transform: scale(1.03); }
.msg {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; gap: 12px;
  align-items: center; justify-content: center; text-align: center;
  background: rgba(10, 44, 113, 0.55); color: #fff;
  font-size: clamp(12px, 1.8vw, 20px); padding: 12px;
}
/* Pie de foto en la franja del papel, estilo cartel "wanted" */
.cap {
  position: absolute;
  transform: translate(-50%, -50%);
  text-align: center; white-space: nowrap;
  font-family: 'Rye', Georgia, serif;
  text-transform: uppercase;
  color: #4a2f1d;
  font-size: clamp(10px, 2vw, 30px);
  letter-spacing: .04em;
  pointer-events: none;
}
.cap.left { left: 52.31%; top: 69.2%; transform: translate(-50%, -50%) rotate(-2.4deg); }
.cap.right { left: 81.97%; top: 72.1%; }
button.msg { border: 0; cursor: pointer; font-family: inherit; }
.spinner {
  width: 42px; height: 42px; border-radius: 50%;
  border: 4px solid rgba(255,255,255,.35); border-top-color: #fff;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
canvas { display: none; }

/* Acciones al terminar: imprimir + rehacer */
.actions {
  position: fixed; right: 18px; bottom: 18px; z-index: 10;
  display: flex; gap: 12px;
}
.actions button {
  width: 56px; height: 56px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.85);
  background: rgba(10, 44, 113, 0.85); color: #fff;
  display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.4);
  transition: transform .15s ease;
  padding: 0;
}
.actions button:hover { transform: scale(1.08); }

/* Hoja de impresión: sale todo tal cual se ve en pantalla */
@page { size: landscape; margin: 0; }
@media print {
  .actions { display: none !important; }
  html, body { overflow: visible; }
  body { display: block; background: #0a2c71; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .stage { width: 100vw; }
}
