/* "Mi boda en fotos": hereda colores, tipografías y botones de styles.css */

.app { min-height: 100dvh; padding-bottom: env(safe-area-inset-bottom); }
.oculto { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* Barra superior */
.app-top {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: rgba(245, 245, 243, 0.9);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(167, 159, 159, 0.18);
}
.app-volver { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--tinta); }
.app-volver svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.app-marca { text-align: center; }
.app-marca .script { font-size: 1.7rem; line-height: 1; }
.app-sub { font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gris); }
.app-contador { font-size: 0.8rem; color: var(--azul); background: var(--blanco); padding: 6px 10px; border-radius: 999px; box-shadow: 0 6px 16px -10px rgba(27, 36, 63, 0.5); white-space: nowrap; }

.app-main { width: min(720px, 100%); margin: 0 auto; padding: 22px 18px 60px; position: relative; overflow-x: clip; }
.app-main section { padding: 0; overflow: visible; }
.app-main .avisos { padding: 18px; }
.app-flor { position: absolute; width: 96px; opacity: 0.9; z-index: 0; }
.af-1 { top: -14px; left: -30px; transform: rotate(150deg); }
.af-2 { top: 120px; right: -34px; transform: rotate(-150deg) scaleX(-1); }

/* Ronda */
.ronda { position: relative; z-index: 1; text-align: center; padding: 10px 6px 0; }
.ronda-etiqueta { font-size: 0.78rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--azul); }
.ronda-titulo { font-family: "Titulos", Georgia, serif; font-weight: 400; text-transform: uppercase; color: var(--gris); font-size: 1.85rem; line-height: 1.05; margin: 8px 0 12px; overflow-wrap: anywhere; }
.ronda-puntos { display: flex; justify-content: center; gap: 10px; min-height: 18px; }
.ronda-puntos span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--azul); transition: background 0.3s, transform 0.4s var(--rebote); }
.ronda-puntos span.lleno { background: var(--azul); transform: scale(1.15); }
.ronda-texto { margin-top: 12px; font-size: 1.05rem; }

/* Cámara */
.camara { position: relative; z-index: 1; display: grid; justify-items: center; gap: 12px; margin: 26px 0 8px; }
.btn-camara {
  width: 176px; height: 176px; border-radius: 50%;
  display: grid; place-items: center; align-content: center; gap: 6px;
  background: var(--azul); color: var(--blanco);
  font-size: 1.1rem; cursor: pointer;
  box-shadow: 0 0 0 10px rgba(105, 141, 201, 0.16), 0 22px 40px -18px rgba(105, 141, 201, 1);
  transition: transform 0.25s var(--rebote), box-shadow 0.25s;
  animation: latido 2.6s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
}
.btn-camara svg { width: 56px; height: 56px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.btn-camara:active { transform: scale(0.92); animation: none; }
.btn-camara:focus-within, #in-camara:focus-visible + .btn-camara { outline: 2px solid var(--tinta); outline-offset: 6px; }

/* Cola de subida */
.cola { list-style: none; display: grid; gap: 10px; margin: 14px 0 0; position: relative; z-index: 1; }
.cola li { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 12px; background: var(--blanco); border-radius: 14px; padding: 8px 12px 8px 8px; box-shadow: 0 8px 20px -16px rgba(27, 36, 63, 0.6); animation: entra 0.45s var(--rebote) both; }
.cola img { width: 52px; height: 52px; object-fit: cover; border-radius: 10px; }
.cola-estado { font-size: 0.9rem; }
.cola-barra { height: 4px; border-radius: 4px; background: #E3E6EE; overflow: hidden; margin-top: 6px; }
.cola-barra span { display: block; height: 100%; width: 0; background: var(--azul); transition: width 0.2s; }
.cola li.ok .cola-barra span { background: #5BAA7C; }
.cola li.error .cola-estado { color: #B4483B; }
.cola-reintentar { font-size: 0.85rem; color: var(--azul); padding: 8px; }
.cola-ok { width: 26px; height: 26px; fill: none; stroke: #5BAA7C; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@keyframes entra { from { opacity: 0; transform: translateY(12px) scale(0.96); } to { opacity: 1; transform: none; } }

.listo { display: flex; align-items: center; gap: 10px; justify-content: center; margin: 16px 0 0; padding: 14px 16px; border-radius: 14px; background: #EAF3EE; color: #2F6B4A; font-size: 0.98rem; text-align: left; animation: entra 0.45s var(--rebote) both; }
.listo svg { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* Avisos */
.avisos { position: relative; z-index: 1; display: grid; grid-template-columns: 48px 1fr; gap: 14px; margin: 30px 0 0; padding: 18px; background: var(--blanco); border-radius: 20px; box-shadow: var(--sombra); text-align: left; }
.avisos-icono { width: 48px; height: 48px; border-radius: 14px; background: rgba(105, 141, 201, 0.14); display: grid; place-items: center; color: var(--azul); }
.avisos-icono svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.avisos-titulo { font-size: 1.1rem; line-height: 1.25; }
.avisos-texto { font-size: 0.95rem; color: #5A6B85; margin-top: 4px; }
.avisos-pasos { margin: 12px 0 0 18px; display: grid; gap: 6px; font-size: 0.95rem; }
.i-compartir { width: 18px; height: 18px; vertical-align: -3px; fill: none; stroke: var(--azul); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-avisos { font-family: "Texto", Georgia, serif; text-transform: none; font-size: 1rem; letter-spacing: 0; margin-top: 14px; padding: 12px 18px; }
.avisos.activos .btn-avisos { display: none; }

/* Álbum */
.album { margin-top: 44px; text-align: center; position: relative; z-index: 1; }
.titulo-album { font-size: 2.2rem; margin-bottom: 18px; }
.album-vacio { color: var(--gris); font-size: 1rem; }
.rejilla { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.rejilla button { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 6px; background: #E8E9EC; }
.rejilla img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s var(--suave); }
.rejilla button:hover img { transform: scale(1.05); }
.rejilla .nueva { animation: entra 0.5s var(--rebote) both; }
.mas { margin-top: 18px; }
.descargas { display: grid; justify-items: center; gap: 8px; margin-top: 18px; }
.descargas[hidden] { display: none; }
.descargas-nota { font-size: 0.9rem; color: #5A6B85; }

/* Paso del nombre */
.paso-nombre { position: relative; z-index: 1; display: grid; gap: 12px; margin: 26px auto 8px; padding: 22px 18px; max-width: 460px; background: var(--blanco); border-radius: 22px; box-shadow: var(--sombra); text-align: center; animation: entra 0.45s var(--rebote) both; }
.paso-num { font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--azul); }
.paso-titulo { font-family: "Titulos", Georgia, serif; text-transform: uppercase; color: var(--gris); font-size: 1.9rem; line-height: 1.05; }
.paso-texto { color: #5A6B85; font-size: 0.98rem; margin-top: -4px; }
.btn-paso { font-family: "Texto", Georgia, serif; text-transform: none; letter-spacing: 0; font-size: 1.1rem; border-radius: 999px; }
.btn-paso svg { width: 22px; height: 22px; }
.saludo { font-size: 1rem; color: #5A6B85; }
.saludo button { color: var(--azul); text-decoration: underline; text-underline-offset: 3px; font-size: 0.9rem; margin-left: 4px; }
.camara { animation: entra 0.45s var(--rebote) both; }

.campo { font: inherit; font-size: 1.1rem; padding: 14px 16px; border-radius: 14px; border: 1.5px solid #D6DCE8; background: var(--blanco); color: var(--tinta); }
.campo:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 4px rgba(105, 141, 201, 0.18); }
.btn-texto { color: var(--gris); font-size: 0.95rem; padding: 6px; }
@keyframes fundido { from { opacity: 0; } }

/* Visor */
.visor { position: fixed; inset: 0; z-index: 70; background: rgba(12, 16, 28, 0.94); display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); padding: calc(64px + env(safe-area-inset-top)) 12px calc(108px + env(safe-area-inset-bottom)); animation: fundido 0.2s ease both; }
.visor[hidden] { display: none; }
.visor-lienzo { min-width: 0; min-height: 0; overflow: hidden; touch-action: none; cursor: zoom-in; }
.visor-lienzo.con-zoom { cursor: grab; }
.visor-lienzo.con-zoom:active { cursor: grabbing; }
.visor-lienzo img { display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.visor-zoom { position: absolute; bottom: calc(52px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); }
.visor-zoom button { min-width: 44px; height: 40px; padding: 0 8px; border-radius: 999px; color: var(--blanco); font-size: 1.25rem; line-height: 1; }
.visor-zoom #zoom-ajustar { min-width: 60px; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.visor-zoom button:hover:not(:disabled), .visor-zoom button:focus-visible { background: rgba(255, 255, 255, 0.16); }
.visor-zoom button:disabled { opacity: 0.4; }
.visor-cerrar { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--blanco); background: rgba(255, 255, 255, 0.12); }
.visor-cerrar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
/* Flechas: centradas sobre la foto (el lienzo tiene 44px más de margen abajo que arriba) */
.visor-flecha { position: absolute; top: 50%; margin-top: -22px; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--blanco); background: rgba(12, 16, 28, 0.55); }
.visor-flecha[hidden] { display: none; }
.visor-flecha:hover, .visor-flecha:focus-visible { background: rgba(12, 16, 28, 0.8); }
.visor-flecha svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.visor-anterior { left: 16px; }
.visor-siguiente { right: 16px; }
.visor-guardar { position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 12px; height: 44px; padding: 0 16px 0 12px; border-radius: 999px; display: flex; align-items: center; gap: 6px; color: var(--blanco); background: rgba(255, 255, 255, 0.12); font-size: 0.95rem; }
.visor-guardar:hover, .visor-guardar:focus-visible { background: rgba(255, 255, 255, 0.22); }
.visor-guardar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.visor-pie { position: absolute; bottom: calc(20px + env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; color: rgba(255, 255, 255, 0.85); font-size: 0.95rem; }

@media (min-width: 700px) {
  .rejilla { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .app-flor { width: 140px; }
}

/* ---------- Reglas y botón deshabilitado ---------- */
.reglas { font-size: 0.95rem; color: #5A6B85; max-width: 300px; text-align: center; }
.btn-camara:disabled { background: #C9D3E6; box-shadow: none; animation: none; cursor: default; }
.btn-camara:disabled svg { opacity: 0.6; }
body.con-camara { overflow: hidden; }

/* ---------- Cámara de la app ---------- */
.cam {
  position: fixed; inset: 0; z-index: 80;
  display: grid; grid-template-rows: auto 1fr auto;
  background: radial-gradient(120% 80% at 50% 45%, #FFFFFF 0%, var(--fondo) 60%, #E9ECF2 100%);
  padding: calc(12px + env(safe-area-inset-top)) 18px calc(22px + env(safe-area-inset-bottom));
  animation: fundido 0.25s ease both;
}
.cam-top { display: grid; grid-template-columns: 44px 1fr 72px; align-items: center; }
.cam-cerrar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--tinta); background: var(--blanco); box-shadow: 0 6px 16px -10px rgba(27, 36, 63, 0.6); }
.cam-cerrar svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.cam-cuenta { text-align: center; font-family: "Titulos", Georgia, serif; text-transform: uppercase; color: var(--gris); font-size: 1.35rem; }
.cam-reloj {
  justify-self: end; min-width: 68px; text-align: center;
  font-family: "Titulos", Georgia, serif; font-size: 1.3rem; font-variant-numeric: tabular-nums;
  color: var(--blanco); background: var(--azul); padding: 6px 10px; border-radius: 999px;
  transition: background 0.3s;
}
.cam-reloj.urgente { background: #C0564A; animation: latido 1s ease-in-out infinite; }

.cam-centro { display: grid; place-items: center; align-content: center; gap: 14px; min-height: 0; }
.cam-marco { position: relative; width: min(92vw, 62vh, 520px); aspect-ratio: 1; }
/* El video ocupa el círculo interior de la corona */
.cam-video, .cam-flash {
  position: absolute; inset: 13%; width: 74%; height: 74%;
  border-radius: 50%; object-fit: cover; background: #1B243F;
  box-shadow: 0 0 0 5px var(--blanco), 0 20px 40px -18px rgba(27, 36, 63, 0.7);
}
.cam-video.espejo { transform: scaleX(-1); }
.cam-flash { background: var(--blanco); opacity: 0; pointer-events: none; box-shadow: none; }
.cam-flash.activo { animation: flash 0.45s ease-out; }
@keyframes flash { 0% { opacity: 0.95; } 100% { opacity: 0; } }
.cam-corona { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; animation: girar-corona 60s linear infinite; }
@keyframes girar-corona { to { transform: rotate(360deg); } }
.cam-ayuda { font-size: 0.9rem; color: #5A6B85; }

.cam-bottom { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.cam-tomadas { display: flex; gap: 6px; }
.cam-tomadas img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--blanco); box-shadow: 0 4px 10px -6px rgba(0, 0, 0, 0.5); animation: entra 0.4s var(--rebote) both; }
.cam-disparo {
  width: 78px; height: 78px; border-radius: 50%;
  background: var(--blanco); box-shadow: 0 0 0 5px var(--azul), 0 12px 24px -10px rgba(105, 141, 201, 1);
  display: grid; place-items: center; transition: transform 0.15s var(--rebote);
}
.cam-disparo span { width: 60px; height: 60px; border-radius: 50%; background: var(--azul); transition: transform 0.15s; }
.cam-disparo:active { transform: scale(0.9); }
.cam-disparo:active span { transform: scale(0.85); }
.cam-girar { justify-self: end; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: var(--tinta); background: var(--blanco); box-shadow: 0 6px 16px -10px rgba(27, 36, 63, 0.6); }
.cam-girar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.cam-final { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 6px; background: rgba(245, 245, 243, 0.94); text-align: center; animation: fundido 0.3s ease both; }
.cam-final .script { font-size: 3.6rem; animation: entra 0.5s var(--rebote) both; }
.cam-final-texto { font-size: 1.1rem; color: var(--tinta); }

@media (prefers-reduced-motion: reduce) { .cam-corona { animation: none; } }
