/* ==========================================================================
   FREE PEOPLE — estilos compartidos
   Paleta: rojo póster + degradado turquesa → salvia → dorado
   (a juego con el banner oficial del encuentro)
   ========================================================================== */

:root {
  --bg: #e2291b;          /* rojo del banner */
  --bg-alt: #c22015;      /* rojo más oscuro, para superficies internas */
  --card: #200907;        /* casi negro cálido, para tarjetas/inputs */
  --text: #fff8f2;
  --muted: #f4bdae;       /* rosa-crema tenue, legible sobre el rojo */
  --accent: #2bb3ad;      /* turquesa (como "ESCOGIDO" del banner) */
  --accent-2: #f2b23e;    /* dorado (como el degradado inferior) */
  --accent-3: #8fc3a6;    /* verde salvia (tono medio del degradado) */
  --ink: #0e211f;         /* texto oscuro sobre botones turquesa/dorado */
  --danger: #ffdd57;
  --radius: 18px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background:
    radial-gradient(circle at 12% -5%, rgba(43, 179, 173, 0.30), transparent 42%),
    radial-gradient(circle at 90% 105%, rgba(242, 178, 62, 0.28), transparent 45%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* textura de grano sutil, como el póster del encuentro */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
}

.app-shell, .wall-header, .wall-grid, main { position: relative; z-index: 1; }

h1, h2, h3, .display {
  font-family: 'Anton', 'Bebas Neue', 'Plus Jakarta Sans', sans-serif;
  letter-spacing: 0.01em;
  line-height: 0.95;
  margin: 0;
}

.mono {
  font-family: 'Space Mono', monospace;
}

a { color: inherit; }

button {
  font-family: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 3px;
}

/* ---------- App shell (index.html) ---------- */

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 20px 40px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

.brand-mark {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(43, 179, 173, 0.25);
  flex-shrink: 0;
}

.eyebrow {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.title-xl {
  font-size: clamp(48px, 14vw, 84px);
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-3) 55%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  color: var(--muted);
  font-size: 16px;
  max-width: 340px;
  margin: 14px 0 32px;
}

#screen-name {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

#screen-name:not(.active) { display: none; }

.card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}

.field-label {
  display: block;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.text-input {
  width: 100%;
  padding: 15px 16px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  background: var(--bg-alt);
  color: var(--text);
  font-size: 17px;
  font-family: inherit;
}

.text-input::placeholder { color: #b5766a; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 700;
  margin-top: 18px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--accent);
  color: var(--ink);
}

.btn-secondary {
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  color: var(--text);
}

.hint {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-top: 16px;
}

.hint a { color: var(--accent-2); text-decoration: underline; }

/* ---------- Camera screen ---------- */

#screen-camera { display: none; width: 100%; max-width: 420px; }
#screen-camera.active { display: flex; flex-direction: column; align-items: center; }

.camera-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 18px;
}

.greeting { font-size: 14px; color: var(--muted); }
.greeting strong { color: var(--text); }

.counter-pill {
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  background: var(--bg-alt);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 6px 14px;
  color: var(--accent-2);
}

.shutter-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0 26px;
}

.flash-ring {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 2px dashed rgba(242, 178, 62, 0.4);
  animation: spin 18s linear infinite;
  pointer-events: none; /* deja pasar el clic hacia el botón que está debajo */
}

@keyframes spin { to { transform: rotate(360deg); } }

.shutter-btn {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  border: 5px solid var(--accent);
  background: radial-gradient(circle at 35% 30%, #3a120c, var(--card) 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 8px rgba(43, 179, 173, 0.12);
}

.shutter-btn::after {
  content: '';
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--accent);
}

.shutter-btn:active::after { background: var(--accent-2); }
.shutter-btn:disabled { opacity: 0.4; }

.shutter-label {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: -14px;
  margin-bottom: 22px;
}

.status-line {
  min-height: 20px;
  font-size: 13px;
  color: var(--accent-3);
  text-align: center;
  margin-bottom: 14px;
}

.status-line.is-error { color: var(--danger); }

.thumbs {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 6px;
}

.thumb {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-alt);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.flash-overlay {
  position: fixed;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 50;
}

.flash-overlay.fire {
  animation: flash-pulse 0.35s ease-out;
}

/* Oculta el input de archivo SIN display:none — en iPhone, un input
   con display:none a veces no se puede abrir vía JS (input.click()).
   Esta técnica lo mantiene "presente" mas invisible, y sí funciona. */
.visually-hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
}

@keyframes flash-pulse {
  0% { opacity: 0.9; }
  100% { opacity: 0; }
}

/* ---------- Gallery wall (gallery.html) ---------- */

.wall-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  background: linear-gradient(180deg, rgba(226, 41, 27, 0.97), rgba(226, 41, 27, 0.85) 70%, transparent);
  backdrop-filter: blur(6px);
}

.wall-title { font-size: clamp(28px, 5vw, 40px); }
.wall-count {
  font-family: 'Space Mono', monospace;
  color: var(--accent-2);
  font-size: 14px;
}

.wall-grid {
  padding: 10px 18px 60px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 18px;
}

.polaroid {
  background: #fff;
  border-radius: 6px;
  padding: 10px 10px 34px;
  box-shadow: var(--shadow);
  transform: rotate(var(--tilt, -2deg));
  animation: drop-in 0.4s ease-out;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.polaroid:hover,
.polaroid:focus-visible {
  transform: rotate(var(--tilt, -2deg)) scale(1.03);
}

@keyframes drop-in {
  from { opacity: 0; transform: translateY(-14px) rotate(var(--tilt, -2deg)); }
  to { opacity: 1; transform: translateY(0) rotate(var(--tilt, -2deg)); }
}

.polaroid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  border-radius: 2px;
  background: #ddd;
}

.polaroid-caption {
  font-family: 'Anton', sans-serif;
  color: #2b0d0a;
  font-size: 15px;
  letter-spacing: 0.02em;
  text-align: center;
  padding-top: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wall-empty {
  color: var(--muted);
  text-align: center;
  padding: 80px 20px;
  font-size: 15px;
}

.wall-empty strong { color: var(--text); display: block; font-size: 22px; margin-bottom: 6px; font-family: 'Anton', sans-serif; }

.back-link {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 8px 14px;
}

/* ---------- Lightbox (ver foto en grande + descargar) ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
  background: rgba(10, 4, 3, 0.88);
  backdrop-filter: blur(4px);
}

.lightbox.open { display: flex; }

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-card {
  margin: 0;
  max-width: min(92vw, 480px);
  background: #fff;
  border-radius: 8px;
  padding: 14px 14px 22px;
  box-shadow: var(--shadow);
}

.lightbox-card img {
  width: 100%;
  max-height: 65vh;
  object-fit: contain;
  border-radius: 3px;
  display: block;
  background: #eee;
}

#lightbox-name {
  font-family: 'Anton', sans-serif;
  color: #2b0d0a;
  text-align: center;
  padding-top: 10px;
  font-size: 16px;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-2);
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 999px;
}
