/* Camijetas 80 — piel de álbum de fotos de casa: papel, rótulo de feria y flash quemado. */

:root {
  --papel: #F2E4C9;
  --papel-oscuro: #E4D2B0;
  --tinta: #241C16;
  --noche: #1B1A2E;
  --noche-2: #262445;
  --naranja: #E2611C;
  --magenta: #E8175D;
  --turquesa: #00A9B7;
  --amarillo: #F0B310;
  --crema: #FFF8EA;
  --sombra-dura: 4px 4px 0 var(--tinta);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: Archivo, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
}

/* Grano de película sobre todo el papel */
.grano {
  position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .32;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.envoltorio { width: min(1080px, 92vw); margin: 0 auto; }
.centrado { text-align: center; }
.seccion { padding: clamp(2.5rem, 7vw, 5rem) 0; }
.seccion-oscura { background: var(--noche); color: var(--crema); }
.seccion-oscura .titulo-seccion { color: var(--crema); }

/* ---------- Cabecera ---------- */
.cabecera {
  background:
    radial-gradient(ellipse at 50% 120%, #F0B310 0%, transparent 60%),
    repeating-linear-gradient(180deg, transparent 0 38px, rgba(36,28,22,.035) 38px 40px),
    linear-gradient(170deg, #F7E9CE, #E9D3A9);
  padding: clamp(2rem, 6vw, 4.5rem) 0 clamp(2.5rem, 7vw, 4rem);
  text-align: center;
  border-bottom: 6px solid var(--tinta);
  position: relative;
}

.sello {
  display: inline-block;
  font-weight: 800; font-size: .78rem; letter-spacing: .22em; text-transform: uppercase;
  background: var(--tinta); color: var(--papel);
  padding: .35rem .9rem; margin: 0 0 1.4rem;
  transform: rotate(-1.5deg);
}

.titulazo {
  font-family: "Alfa Slab One", Georgia, serif;
  font-weight: 400; margin: 0; line-height: 1;
  display: flex; flex-direction: column; align-items: center;
}
.titulazo span { display: block; }
.linea-1 { font-size: clamp(1.6rem, 6vw, 3rem); color: var(--tinta); transform: rotate(-2deg); margin-bottom: .18em; }
.linea-2 {
  font-size: clamp(4rem, 18vw, 9.5rem); letter-spacing: -.02em; color: var(--magenta);
  text-shadow: 5px 5px 0 var(--amarillo), 10px 10px 0 var(--tinta);
  transform: rotate(1deg) scaleY(1.06); line-height: .85; margin-bottom: .1em;
}
.linea-3 { font-size: clamp(1.6rem, 6vw, 3rem); color: var(--turquesa); transform: rotate(-1deg); text-shadow: 3px 3px 0 var(--tinta); }

.entradilla { max-width: 44ch; margin: 1.8rem auto 1.6rem; font-size: clamp(1rem, 2.2vw, 1.15rem); }
.entradilla strong { background: linear-gradient(transparent 62%, var(--amarillo) 62%); font-weight: 800; }

.letra-pequena { font-size: .8rem; opacity: .68; max-width: 46ch; margin: 1rem auto 0; }
.seccion-oscura .letra-pequena { opacity: .55; }

/* ---------- Botones ---------- */
.boton {
  display: inline-block; cursor: pointer;
  font-family: inherit; font-weight: 800; font-size: 1rem;
  padding: .8rem 1.5rem; border: 3px solid var(--tinta); border-radius: 2px;
  background: var(--crema); color: var(--tinta);
  box-shadow: var(--sombra-dura);
  transition: transform .08s ease, box-shadow .08s ease;
  text-decoration: none;
}
.boton:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--tinta); }
.boton:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--tinta); }
.boton-grande { background: var(--naranja); color: var(--crema); font-size: clamp(1rem, 2.6vw, 1.2rem); padding: .95rem 2rem; }
.boton-fantasma { background: transparent; color: inherit; border-color: currentColor; box-shadow: none; }
.boton-fantasma:hover { box-shadow: none; background: rgba(255,255,255,.08); }
.boton-reclamo { background: var(--amarillo); color: var(--tinta); }
.boton:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: var(--sombra-dura); }

/* ---------- Títulos de sección ---------- */
.titulo-seccion {
  font-family: "Alfa Slab One", Georgia, serif; font-weight: 400;
  font-size: clamp(1.5rem, 4.5vw, 2.3rem); margin: 0 0 .4rem;
  display: flex; align-items: center; gap: .7rem;
}
.titulo-seccion.sin-numero { justify-content: center; }
.titulo-seccion span {
  background: var(--magenta); color: var(--crema);
  width: 1.6em; height: 1.6em; display: grid; place-items: center;
  border-radius: 50%; font-size: .65em; flex: none;
}
.ayuda { margin: 0 0 2rem; opacity: .8; max-width: 52ch; }

/* ---------- Rejilla de escenas ---------- */
.rejilla {
  display: grid; gap: clamp(1.2rem, 3vw, 2rem); margin-top: 2rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.escena {
  display: block; position: relative; cursor: pointer; text-align: left;
  background: var(--crema); border: 3px solid var(--tinta); padding: .8rem .8rem 1rem;
  box-shadow: var(--sombra-dura);
  font-family: inherit; color: inherit;
  transition: transform .12s ease, box-shadow .12s ease;
}
.escena:nth-child(odd) { transform: rotate(-.9deg); }
.escena:nth-child(even) { transform: rotate(.7deg); }
.escena:hover, .escena:focus-visible { transform: rotate(0) translate(-3px, -3px); box-shadow: 8px 8px 0 var(--tinta); outline: none; }
.escena.elegida { box-shadow: 8px 8px 0 var(--magenta); border-color: var(--magenta); transform: rotate(0); }

.escena-lienzo { display: block; position: relative; aspect-ratio: 4/3; overflow: hidden; background: var(--noche-2); }
.escena-lienzo svg,
.escena-foto { width: 100%; height: 100%; display: block; object-fit: cover; }
.escena-anio {
  position: absolute; right: .5rem; bottom: .4rem; z-index: 2;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .8rem; font-weight: 700;
  color: #FF9B3D; text-shadow: 0 0 6px rgba(255,120,0,.9); letter-spacing: .04em;
}
.escena-titulo { font-family: "Alfa Slab One", serif; font-weight: 400; font-size: 1.15rem; margin: .8rem 0 .1rem; line-height: 1.15; }
.escena-epigrafe { font-family: Caveat, cursive; font-size: 1.1rem; margin: 0 0 .4rem; color: var(--naranja); }
.escena-pie { font-size: .85rem; margin: 0; opacity: .78; }

/* ---------- Subida ---------- */
.zona-subida {
  border: 3px dashed rgba(255,248,234,.4); padding: clamp(2rem, 6vw, 3.5rem) 1.5rem;
  text-align: center; border-radius: 4px; transition: background .15s;
}
.zona-subida.encima { background: rgba(240,179,16,.14); border-color: var(--amarillo); }

.previa { text-align: center; }
.previa img { max-width: min(320px, 80vw); border: 6px solid var(--crema); box-shadow: 0 12px 40px rgba(0,0,0,.5); }
.previa-acciones { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-top: 1.6rem; }
.cupo { font-size: .85rem; opacity: .6; margin-top: 1rem; }

/* ---------- Revelado ---------- */
.cuarto-oscuro { display: grid; place-items: center; height: 140px; }
.bombilla {
  width: 70px; height: 70px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #FF6B4A, #B3160B 70%);
  box-shadow: 0 0 60px 22px rgba(226,40,20,.42);
  animation: parpadeo 1.8s ease-in-out infinite;
}
@keyframes parpadeo { 0%,100% { opacity: .5; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.04); } }
.chascarrillo { font-family: Caveat, cursive; font-size: clamp(1.2rem, 3.6vw, 1.7rem); color: var(--amarillo); min-height: 2.4em; }

/* ---------- Resultado ---------- */
.marco-foto {
  display: inline-block; margin: 0 auto 2rem; padding: 14px 14px 56px;
  background: var(--crema); box-shadow: 0 18px 50px rgba(0,0,0,.55);
  transform: rotate(-1.2deg); max-width: min(560px, 92vw);
}
.foto-contenedor { position: relative; line-height: 0; background: #111; }
.foto-contenedor img { width: 100%; display: block; }
.fecha-camara {
  position: absolute; right: 10px; bottom: 8px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: clamp(.7rem, 2.2vw, .95rem); font-weight: 700;
  color: #FF9B3D; text-shadow: 0 0 8px rgba(255,110,0,.95); letter-spacing: .08em;
}
.marco-foto figcaption {
  font-family: Caveat, cursive; font-size: clamp(1.1rem, 3vw, 1.45rem);
  color: #2C3E7B; margin-top: 14px; line-height: 1.2; text-align: center;
}
.resultado-acciones { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.reclamo {
  margin-top: 3rem; padding: 1.8rem 1.2rem; border: 3px solid var(--amarillo);
  background: rgba(240,179,16,.09);
}
.reclamo-texto { font-family: "Alfa Slab One", serif; font-size: clamp(1.1rem, 3.2vw, 1.5rem); margin: 0 0 1rem; }

/* ---------- Error / cerrado ---------- */
.cartel-cerrado {
  display: inline-block; background: var(--papel); color: var(--tinta);
  border: 4px solid var(--tinta); padding: 2rem 2.4rem; transform: rotate(-2deg);
  box-shadow: 0 14px 40px rgba(0,0,0,.5); margin-bottom: 2rem; max-width: 44ch;
}
.cartel-titulo { font-family: "Alfa Slab One", serif; font-size: clamp(1.3rem, 4vw, 1.9rem); margin: 0 0 .6rem; }
.cartel-texto { margin: 0; }

/* ---------- Pie ---------- */
.pie { background: var(--tinta); color: var(--papel); padding: 2.5rem 0; text-align: center; }
.pie p { margin: .4rem 0; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Visor: ajustado o a tamaño real ---------- */
.visor {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(12, 11, 24, .95);
  display: flex; flex-direction: column;
  padding: clamp(.8rem, 3vw, 1.6rem);
  overscroll-behavior: contain;
}
.visor[hidden] { display: none; }

.visor-lienzo {
  flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
  gap: 1rem; overflow: hidden;
}
.visor-marco {
  margin: 0; background: var(--crema); padding: 10px 10px 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.7);
  max-width: 100%; max-height: 100%;
  display: flex; flex-direction: column; min-height: 0;
}
.visor-img {
  display: block; min-height: 0; max-width: 100%; max-height: 100%;
  width: auto; height: auto; object-fit: contain; cursor: zoom-in;
}
.visor-pie {
  font-family: Caveat, cursive; font-size: 1.15rem; color: #2C3E7B;
  text-align: center; margin-top: 8px; flex: none;
}

/* Tamaño real: la foto se muestra a sus píxeles y el lienzo se recorre arrastrando. */
.visor.a-tamano-real .visor-lienzo { overflow: auto; align-items: start; justify-content: start; cursor: grab; }
.visor.a-tamano-real .visor-lienzo.arrastrando { cursor: grabbing; }
.visor.a-tamano-real .visor-marco { max-width: none; max-height: none; padding: 0; margin: auto; }
.visor.a-tamano-real .visor-img {
  max-width: none; max-height: none;
  width: auto; height: auto; cursor: zoom-out;
  image-rendering: auto;
}
.visor.a-tamano-real .visor-pie { display: none; }

.visor-barra {
  flex: none; display: flex; align-items: center; justify-content: center;
  gap: 1rem; flex-wrap: wrap; padding-top: 1rem;
}
.visor-medidas {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .85rem;
  color: var(--crema); opacity: .6; letter-spacing: .04em;
}
.visor-bajar { background: var(--amarillo); color: var(--tinta); }
.visor-modo { background: var(--crema); color: var(--tinta); }

.visor-cerrar {
  position: absolute; top: max(.8rem, env(safe-area-inset-top)); right: .8rem; z-index: 2;
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(12,11,24,.7); color: var(--crema);
  border: 2px solid rgba(255,248,234,.5); font-size: 1.7rem; line-height: 1;
  cursor: pointer; display: grid; place-items: center;
}
.visor-cerrar:hover { background: rgba(255,248,234,.28); }
.ampliable { cursor: zoom-in; }

/* Comparar: la foto de partida junto al resultado. En móvil, una encima de otra. */
.visor.comparando .visor-lienzo { flex-wrap: wrap; }
.visor.comparando .visor-marco { max-width: calc(50% - .5rem); }
.visor.a-tamano-real.comparando .visor-marco { max-width: none; }
.visor-marco-original[hidden] { display: none; }
.visor-marco-original { outline: 2px dashed rgba(255,248,234,.35); outline-offset: 6px; }
@media (max-width: 640px) {
  .visor.comparando .visor-lienzo { flex-direction: column; overflow: auto; }
  .visor.comparando .visor-marco { max-width: 100%; }
}
