/* Galería pública: pensada primero para el móvil */

body { padding-bottom: env(safe-area-inset-bottom); }

.cabecera {
  display: flex; align-items: center; justify-content: space-between;
  padding: max(16px, env(safe-area-inset-top)) 16px 8px;
  max-width: 1200px; margin: 0 auto;
}
.logo { height: 22px; width: auto; display: block; }
.fecha { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ceniza); font-weight: 600; }

.portada { padding: 8px 16px 14px; max-width: 1200px; margin: 0 auto; }
.portada h1 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 11vw, 72px);
  line-height: 0.95; margin: 6px 0 10px; letter-spacing: -0.01em;
}
.portada h1 em { color: var(--fuego); }
.entradilla { margin: 0 0 16px; color: var(--hueso-2); max-width: 34em; font-size: 15px; }
.boton.grande { min-height: 54px; font-size: 16px; padding: 14px 26px; }
.portada .boton.grande { width: 100%; max-width: 420px; }
/* «Solo tus fotos», antes del selfie: pantalla de entrada centrada */
.portada.entrada { min-height: 62vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.portada.entrada h1 { font-size: clamp(48px, 14vw, 88px); margin-bottom: 16px; }
.portada.entrada .entradilla { margin: 0 auto 26px; font-size: 17px; max-width: 24em; }
.portada.entrada .boton.grande { min-height: 62px; font-size: 18px; }
.tuyas-barra p[hidden] { display: none; }
.boton.ancho { width: 100%; }

.momentos {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 12px;
  scrollbar-width: none; max-width: 1200px; margin: 0 auto;
  position: sticky; top: 0; z-index: 5; background: linear-gradient(var(--negro) 80%, rgba(0, 0, 0, 0));
}
.momentos::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--linea); background: transparent; border-radius: 999px;
  padding: 8px 14px; font-size: 13px; font-weight: 600; white-space: nowrap; min-height: 38px;
}
.chip .n { color: var(--ceniza); font-weight: 400; margin-left: 4px; }
.chip[aria-pressed="true"] { background: var(--hueso); color: var(--negro); border-color: var(--hueso); }
.chip[aria-pressed="true"] .n { color: var(--humo); }
.chip.tuyo { border-color: var(--fuego); }
.chip.tuyo[aria-pressed="true"] { background: var(--fuego); border-color: var(--fuego); color: #fff; }
.chip.tuyo[aria-pressed="true"] .n { color: rgba(255, 255, 255, 0.8); }

.tuyas-barra { max-width: 1200px; margin: 0 auto; padding: 0 16px 12px; }
.tuyas-barra p { margin: 0 0 10px; font-size: 15px; }
.tuyas-barra strong { color: var(--rosa); }
.tuyas-botones { display: flex; gap: 8px; flex-wrap: wrap; }

.aviso-nuevas {
  position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top)); transform: translateX(-50%);
  z-index: 20; background: var(--hueso); color: var(--negro); border: 0; border-radius: 999px;
  padding: 10px 18px; font-weight: 700; font-size: 14px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  animation: bajar 0.3s ease-out;
}
@keyframes bajar { from { transform: translate(-50%, -20px); opacity: 0; } }

main { max-width: 1200px; margin: 0 auto; }
.rejilla { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 0 3px; }
@media (min-width: 640px) { .rejilla { grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 0 16px; } }
@media (min-width: 1000px) { .rejilla { grid-template-columns: repeat(6, 1fr); } }
.celda {
  position: relative; aspect-ratio: 1; padding: 0; border: 0; background: var(--brasa); overflow: hidden; display: block;
  -webkit-tap-highlight-color: transparent;
}
.celda img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity 0.25s; }
.celda img.cargada { opacity: 1; }
.celda.nueva::after {
  content: ""; position: absolute; inset: 0; border: 2px solid var(--fuego); pointer-events: none; animation: apagar 3s forwards;
}
@keyframes apagar { to { opacity: 0; } }

.separador-posibles {
  margin: 18px 16px 10px; font-size: 13px; color: var(--ceniza); letter-spacing: 0.04em;
  border-top: 1px solid var(--linea); padding-top: 14px;
}
.centinela { height: 1px; }
.vacio { text-align: center; color: var(--ceniza); padding: 40px 24px; max-width: 30em; margin: 0 auto; }

.pie-pagina {
  max-width: 1200px; margin: 40px auto 0; padding: 24px 16px 40px; border-top: 1px solid var(--linea);
  color: var(--ceniza); font-size: 13px;
}
.pie-pagina p { margin: 0 0 8px; max-width: 46em; }
.pie-pagina a { color: var(--hueso-2); }
.enlace { background: none; border: 0; padding: 0; color: var(--hueso-2); text-decoration: underline; font-size: 13px; }

/* Antes de entrar: aviso de protección de datos */
.entrada-legal {
  position: fixed; inset: 0; z-index: 60; background: var(--negro); overflow-y: auto;
  padding: max(20px, env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom));
}
.entrada-legal-caja { max-width: 560px; margin: 0 auto; }
.entrada-legal h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 11vw, 60px); line-height: 0.95; margin: 22px 0 14px; }
.entrada-legal h1 em { color: var(--fuego); }
.entrada-legal p { color: var(--hueso-2); font-size: 15px; }
.casilla { display: flex; gap: 12px; align-items: flex-start; margin: 18px 0 14px; font-size: 15px; line-height: 1.4; cursor: pointer; }
.casilla input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--fuego); }
.selfie-botones.apagado label { opacity: 0.4; pointer-events: none; }

/* Política de privacidad */
.legal { max-width: 720px; margin: 0 auto; padding: 8px 16px 60px; }
.legal h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 10vw, 64px); line-height: 0.95; margin: 10px 0 8px; }
.legal h1 em { color: var(--fuego); }
.legal h2 { font-family: var(--serif); font-weight: 400; font-size: 28px; margin: 34px 0 10px; }
.legal p, .legal li { color: var(--hueso-2); font-size: 15px; }
.legal li { margin-bottom: 8px; }
.legal li strong { color: var(--hueso); }
.legal .boton { margin-top: 24px; text-decoration: none; }

/* Hojas (selfie, información) */
.hoja-fondo {
  position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.72);
  display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 640px) { .hoja-fondo { align-items: center; } }
.hoja {
  position: relative; width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto;
  background: var(--carbon); border: 1px solid var(--linea); border-radius: 22px 22px 0 0;
  padding: 26px 20px calc(24px + env(safe-area-inset-bottom));
  animation: subir 0.25s ease-out;
}
@media (min-width: 640px) { .hoja { border-radius: 22px; } }
@keyframes subir { from { transform: translateY(30px); opacity: 0; } }
.hoja h2 { font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1; margin: 0 40px 14px 0; }
.hoja h2 em { color: var(--fuego); }
.hoja p { color: var(--hueso-2); font-size: 15px; }
.hoja .boton { margin-top: 10px; }
.privacidad { padding-left: 18px; margin: 0 0 18px; color: var(--hueso-2); font-size: 14px; }
.privacidad li { margin-bottom: 6px; }
.privacidad strong { color: var(--hueso); }
.cerrar {
  position: absolute; right: 14px; top: 14px; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--linea); background: transparent; font-size: 16px;
}
.barra { height: 6px; background: var(--brasa); border-radius: 3px; overflow: hidden; margin: 12px 0; }
.barra-relleno { height: 100%; width: 0; background: var(--fuego); transition: width 0.3s; }
.nota { font-size: 13px !important; color: var(--ceniza) !important; }

/* Visor */
.visor {
  position: fixed; inset: 0; z-index: 30; background: var(--negro);
  display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.visor-barra { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; min-height: 56px; }
.visor-barra .cerrar { position: static; }
#visor-cuenta { font-size: 13px; color: var(--ceniza); }
.visor-escena { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; position: relative; padding: 0 8px; touch-action: pan-y; }
.visor-lienzo { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; position: relative; }
.visor-lienzo canvas { max-width: 100%; max-height: 100%; object-fit: contain; display: block; box-shadow: 0 0 0 1px var(--linea); }
.flecha {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 44px; height: 64px; border: 0;
  background: rgba(0, 0, 0, 0.35); color: var(--hueso); font-size: 34px; line-height: 1; border-radius: 10px; display: none;
}
@media (hover: hover) and (min-width: 640px) { .flecha { display: block; } }
.flecha.izq { left: 12px; }
.flecha.der { right: 12px; }
.visor-controles { padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.estilos { display: flex; gap: 8px; justify-content: center; }
.estilo {
  border: 1px solid var(--linea); background: transparent; border-radius: 12px; padding: 8px 12px; font-size: 13px; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 88px;
}
.estilo[aria-checked="true"] { border-color: var(--hueso); background: rgba(230, 230, 230, 0.08); }
.muestra { width: 46px; height: 34px; border-radius: 4px; position: relative; overflow: hidden; background: var(--humo); }
.muestra::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 9px; background: var(--negro); }
.muestra.encima::after { background: linear-gradient(transparent, rgba(0, 0, 0, 0.85)); height: 14px; }
.muestra.marco { background: var(--humo); box-shadow: inset 0 0 0 3px #efe9df; }
.muestra.marco::after { background: #efe9df; height: 10px; }
.visor-botones { display: flex; gap: 10px; width: 100%; max-width: 420px; }
.visor-botones .boton { flex: 1; }
.cargando {
  position: absolute; width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--linea); border-top-color: var(--hueso); animation: girar 0.8s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

.tostada {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 50; background: var(--hueso); color: var(--negro); border-radius: 14px; padding: 12px 18px;
  font-size: 14px; font-weight: 600; max-width: calc(100% - 32px); text-align: center; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}
