/* ============================================================================
   PELUQUERO DE ORO — Muro de Fotos
   Sistema visual "Gala editorial" — v2, escena iluminada.

   v1 era plana: oro ocre sólido sobre negro neutro, sin luz ni profundidad.
   v2 trata la pantalla como un escenario: fuente de luz cálida, oro metálico
   con especular, bloom, viñeta y movimiento. El oro es un MATERIAL, no un color.

   Referencias (ui-research/UI-COMBINACION-3-REFERENCIAS-2026-08-21.md):
     · Espacio de eventos ...... luz cálida sobre negro, viñeta, curvas
     · Pilo .................... grilla, tipografía, estados, componentes
     · KICKIT .................. marcos tipo Polaroid, rótulo, saturación

   Reglas LED (GALA-2026/00-DOCS/03-SPECS-TECNICAS.md): zona segura 8%,
   texto mínimo 45 px a 1080, grano sobre degradados, alto contraste opcional.
   ========================================================================== */

/* ------------------------------------------------------------ tipografía -
   Bodoni Moda (didone de alto contraste) para la voz de gala + Archivo
   (grotesca densa) para interfaz. Elegidas a propósito: `system-ui` como
   única tipografía es el tell nº8 del catálogo de "AI design tells", y las
   serif "de buen gusto" por default (Playfair, Fraunces, Instrument) son el
   tell nº0. El didone es el registro real de premiación y moda.
   Self-hosted: la máquina del salón no puede depender de la red del hotel.
   -------------------------------------------------------------------------- */

@font-face {
  font-family: "Bodoni Moda";
  src: url("/assets/fonts/bodoni-moda-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2122;
}
@font-face {
  font-family: "Bodoni Moda";
  src: url("/assets/fonts/bodoni-moda-latinext.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB;
}
@font-face {
  font-family: "Figtree";
  src: url("/assets/fonts/figtree-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2122;
}
@font-face {
  font-family: "Figtree";
  src: url("/assets/fonts/figtree-latinext.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB;
}

/* ---------------------------------------------------------------- tokens - */

/* Los componentes con layout propio no deben anular la semántica nativa del
   atributo hidden (la pantalla de espera, por ejemplo, usa display:flex). */
[hidden] {
  display: none !important;
}

:root {
  /* Negros cálidos: el negro neutro apaga el oro */
  --ink: #08060a;
  --ink-2: #0d0a10;
  --panel: #14101a;
  --panel-2: #1b1622;
  --line: #2e2637;
  --line-strong: #463a52;

  /* Superficies: la jerarquía la da el relleno, no el borde (sistema Pilo) */
  --surface:   #171220;
  --surface-2: #221b2e;
  --surface-3: #2c2439;

  /* Oro eléctrico: la saturación que en Pilo tiene el lima, en clave de oro.
     El metálico se reserva para superficies grandes; la acción usa el plano. */
  --gold-1: #7a5406;
  --gold-2: #d9a208;
  --gold: #ffc931;          /* acción, foco, estado activo */
  --gold-hot: #ffe066;      /* realce y bloom */
  --gold-3: #ffdd77;
  --gold-4: #fff8e0;
  --gold-soft: #ffd75e;
  --gold-deep: #9c7407;

  --grad-gold: linear-gradient(135deg,
    #7a5406 0%, #d9a208 18%, #ffdd77 40%, #fff8e0 50%,
    #ffd75e 60%, #e8b21a 80%, #7a5406 100%);

  /* Acento cálido: da saturación sin salirse de la marca */
  --ember: #ff9d3c;
  --ember-deep: #c2531a;

  --text: #f7f3ea;
  --ivory: #faf6ec;
  --muted: #a79f95;

  --ok: #43d6a0;
  --warn: #ffc44d;
  --danger: #ff6b6b;

  /* Escala de espaciado */
  --s1: 8px; --s2: 12px; --s3: 16px; --s4: 24px; --s5: 40px; --s6: 64px;

  /* Geometría — radios grandes al estilo Pilo */
  --radius: 30px;
  --radius-lg: 38px;
  --radius-sm: 20px;
  --radius-xs: 14px;
  --radius-pill: 999px;
  --touch: 54px;

  /* Tipografía */
  --font: "Figtree", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --tracking-tight: -0.035em;
  --font-display: "Bodoni Moda", ui-serif, Georgia, serif;
  --tracking-wide: 0.18em;

  /* Motion */
  --t-fast: 180ms;
  --t-base: 340ms;
  --t-slow: 520ms;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Bloom dorado reutilizable */
  --bloom: 0 0 40px rgba(217, 171, 44, 0.28);
  --bloom-strong: 0 0 70px rgba(247, 220, 138, 0.42);

  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  background: var(--ink);
}

/* Escenario: luz cálida cenital + rebote inferior + viñeta. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(217,171,44,0.20) 0%, rgba(217,171,44,0.06) 32%, transparent 62%),
    radial-gradient(80% 50% at 50% 108%, rgba(255,157,60,0.12) 0%, transparent 60%),
    radial-gradient(140% 100% at 50% 50%, transparent 40%, rgba(0,0,0,0.75) 100%),
    linear-gradient(180deg, var(--ink-2), var(--ink));
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: var(--grain);
  pointer-events: none;
}

a { color: var(--gold-3); text-underline-offset: 3px; }

:where(button, a, input, textarea, select):focus-visible {
  outline: 2px solid var(--gold-3);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.muted { color: var(--muted); font-size: 0.9rem; }

@keyframes shimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 250% 50%; }
}

.rule-arc {
  height: 3px;
  border: 0;
  margin: var(--s4) 0;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-2) 18%, var(--gold-4) 50%, var(--gold-2) 82%, transparent);
  box-shadow: var(--bloom);
}

/* ------------------------------------------------------------ guest ----- */

.guest-shell {
  max-width: 660px;
  margin: 0 auto;
  padding: var(--s4) var(--s3) calc(var(--s6) + env(safe-area-inset-bottom));
  position: relative;
}

.brand {
  text-align: center;
  margin: var(--s4) 0 var(--s5);
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 7vw, 2.4rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.12;
  color: var(--gold-3);
}

.brand::before {
  content: "";
  display: block;
  width: 84px;
  height: 84px;
  margin: 0 auto var(--s3);
  background: url("/assets/img/emblema-dorado.png") center / contain no-repeat;
  filter: drop-shadow(0 0 18px rgba(255, 201, 49, 0.38));
}

@keyframes emblem-pulse {
  0%, 100% { filter: drop-shadow(0 0 18px rgba(247,220,138,0.42)); transform: translateY(0); }
  50%      { filter: drop-shadow(0 0 34px rgba(247,220,138,0.72)); transform: translateY(-3px); }
}

.brand small {
  display: block;
  margin-top: var(--s2);
  font-family: var(--font);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--gold-soft);
  -webkit-text-fill-color: var(--gold-soft);
}

/* Ritual: escaneá → participá → aparecés */
.ritual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  margin: 0 0 var(--s5);
  padding: 0;
  list-style: none;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.ritual li { display: flex; align-items: center; gap: var(--s2); }
.ritual li + li::before {
  content: "";
  width: 15px; height: 15px;
  background: var(--gold-deep);
  -webkit-mask: var(--ico-arrow) center / contain no-repeat;
  mask: var(--ico-arrow) center / contain no-repeat;
}
.ritual { --ico-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h15M13 6l6 6-6 6'/%3E%3C/svg%3E"); }
.ritual .is-here {
  color: var(--gold-4);
  text-shadow: 0 0 16px rgba(247, 220, 138, 0.6);
}

/* Tarjeta: borde con degradado, luz interior, profundidad real */
.card {
  position: relative;
  background: var(--surface);
  border: 0;
  border-radius: var(--radius);
  padding: var(--s5) var(--s4);
  margin: var(--s3) 0;
}

/* Hairline dorada en el borde superior de cada tarjeta */
/* Jerarquía real: la tarjeta de la acción principal pesa más que el resto,
   y el consentimiento baja a texto de apoyo en vez de competir. */
#photo-panel, #message-panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0) 42%),
    linear-gradient(180deg, #171220, var(--ink-2));
  margin-bottom: var(--s5);
}

#consent-panel {
  background: none;
  box-shadow: none;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: var(--s4) 0 0;
  margin-top: var(--s5);
}
#consent-panel::before { display: none; }
#consent-panel h2 {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
#consent-panel .consent-box { background: none; border-color: var(--line); }

.card h2 {
  margin: 0 0 var(--s2);
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
}

.field { margin: var(--s4) 0; }
.field:last-child { margin-bottom: 0; }

.field label {
  display: block;
  margin-bottom: var(--s1);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

input[type="text"], input[type="email"], input[type="password"], textarea, select {
  width: 100%;
  min-height: var(--touch);
  background: var(--surface-2);
  color: var(--text);
  border: 0;
  border-radius: var(--radius-xs);
  padding: var(--s2) var(--s3);
  font-size: 1rem;
  font-family: var(--font);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}

input::placeholder, textarea::placeholder { color: #746c7f; }

input[type="text"]:focus, input[type="email"]:focus,
input[type="password"]:focus, textarea:focus {
  box-shadow: inset 0 0 0 2px var(--gold);
}

textarea { min-height: 112px; resize: vertical; line-height: 1.45; }

.char-counter {
  text-align: right;
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: var(--s1);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------ botones --- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s1);
  width: 100%;
  min-height: var(--touch);
  border: 0;
  border-radius: var(--radius-sm);
  padding: var(--s2) var(--s4);
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font);
  letter-spacing: 0.03em;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  color: #241a04;
  /* Plano y sólido, como Pilo: el color hace el trabajo, sin degradado. */
  background: var(--gold);
  box-shadow: none;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-base) var(--ease);
}

.btn:hover { background: var(--gold-hot); }
.btn:active { transform: translateY(0); }

.btn.secondary {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: none;
}
.btn.secondary:hover {
  background: var(--surface-3);
}

.btn.danger { background: var(--danger); color: #2a0808; box-shadow: none; }

.btn:disabled { opacity: 0.42; cursor: not-allowed; transform: none; animation: none; }

.btn.inline {
  width: auto;
  min-height: 42px;
  padding: var(--s1) var(--s3);
  font-size: 0.88rem;
}

/* Onda al tocar, la inyecta fx.js */
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(255, 255, 255, 0.55);
  animation: ripple 620ms var(--ease-out);
  pointer-events: none;
  z-index: -1;
}
@keyframes ripple { to { transform: scale(3.2); opacity: 0; } }

.cta-primary {
  border-radius: var(--radius-pill);
  position: relative;
  margin-top: var(--s4);
  font-size: 1.06rem;
  min-height: 56px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.7), 0 0 40px rgba(217,171,44,0.4), inset 0 1px 0 rgba(255,255,255,0.5);
}

/* ------------------------------------------- PHOTO_POLAROID (KICKIT) ---- */

.previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: var(--s5) var(--s3);
  margin-top: var(--s5);
}

.previews figure {
  --rot: 0deg;
  position: relative;
  margin: 0;
  padding: 9px 9px 0;
  background: linear-gradient(180deg, #fffdf7, var(--ivory) 60%, #ece5d4);
  border-radius: 5px;
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 246, 216, 0.10);
  transform: rotate(var(--rot));
  transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease);
  animation: pop-in var(--t-slow) var(--ease-out) backwards;
}

@keyframes pop-in {
  from { opacity: 0; transform: rotate(var(--rot)) translateY(14px) scale(0.94); }
  to   { opacity: 1; transform: rotate(var(--rot)) translateY(0) scale(1); }
}

.previews figure:nth-child(3n + 1) { --rot: -2deg; }
.previews figure:nth-child(3n + 2) { --rot: 0.8deg; }
.previews figure:nth-child(3n + 3) { --rot: 2deg; }
.previews figure:nth-child(2) { animation-delay: 70ms; }
.previews figure:nth-child(3) { animation-delay: 140ms; }
.previews figure:nth-child(4) { animation-delay: 210ms; }
.previews figure:nth-child(5) { animation-delay: 280ms; }

.previews figure:hover {
  transform: rotate(0deg) translateY(-6px) scale(1.03);
  box-shadow: 0 22px 46px rgba(0,0,0,0.7);
}

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

.previews figcaption {
  padding: 7px 2px 9px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #6a6459;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.preview-remove {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  color: #241a04;
  border: 0;
  background: var(--gold);
  font-size: 0;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.6);
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}

.preview-remove::before {
  content: "";
  width: 13px;
  height: 13px;
  background: currentColor;
  -webkit-mask: var(--ico-x) center / contain no-repeat;
  mask: var(--ico-x) center / contain no-repeat;
  --ico-x: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 6 12 12M18 6 6 18'/%3E%3C/svg%3E");
}
.preview-remove:hover {
  background: linear-gradient(135deg, #ff6b6b, #c23232);
  color: #fff;
  border-color: var(--danger);
  transform: scale(1.12);
}

/* ------------------------------------------------------- progreso ------- */

.progress-track {
  height: 10px;
  border-radius: var(--radius-pill);
  background: rgba(8,6,10,0.7);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
  margin: var(--s2) 0;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-2), var(--gold-4), var(--ember), var(--gold-3));
  background-size: 200% 100%;
  box-shadow: 0 0 20px rgba(247, 220, 138, 0.65);
  animation: shimmer 2.4s linear infinite;
  transition: width var(--t-base) var(--ease);
}

/* ------------------------------------------------------- avisos --------- */

.notice {
  border-radius: var(--radius-sm);
  padding: var(--s2) var(--s3);
  margin: var(--s2) 0;
  font-size: 0.92rem;
  display: flex;
  gap: var(--s2);
  align-items: flex-start;
  border: 0;
  background: var(--surface-2);
}

/* Iconos: vectores con trazo de 1.75, no glifos unicode (tell nº7 del
   catálogo). Van por mask-image para que el JS existente no tenga que
   cambiar el markup, y heredan color con currentColor. */
.notice::before {
  content: "";
  flex: none;
  width: 19px;
  height: 19px;
  margin-top: 1px;
  background: currentColor;
  -webkit-mask: var(--ico) center / contain no-repeat;
  mask: var(--ico) center / contain no-repeat;
}

.notice.ok {
  background: rgba(67, 214, 160, 0.12);
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8.5 12.2 2.4 2.4 4.6-4.9'/%3E%3C/svg%3E");
}
.notice.ok::before { color: var(--ok); }

.notice.warn {
  background: rgba(255, 196, 77, 0.12);
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4.5 21 19.5H3z'/%3E%3Cpath d='M12 10v4'/%3E%3Cpath d='M12 17.2h.01'/%3E%3C/svg%3E");
}
.notice.warn::before { color: var(--warn); }

.notice.error {
  background: rgba(255, 107, 107, 0.12);
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m9.2 9.2 5.6 5.6M14.8 9.2l-5.6 5.6'/%3E%3C/svg%3E");
}
.notice.error::before { color: var(--danger); }

/* ------------------------------------------------- consentimiento ------- */

.consent-box {
  display: flex;
  gap: var(--s2);
  align-items: flex-start;
  background: var(--surface-2);
  border: 0;
  border-radius: var(--radius-sm);
  padding: var(--s3);
  margin: var(--s2) 0;
  font-size: 0.86rem;
  line-height: 1.45;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.consent-box:hover { background: var(--surface-3); }
.consent-box input[type="checkbox"] {
  width: 21px; height: 21px; margin: 1px 0 0; flex: none;
  accent-color: var(--gold);
}

/* ------------------------------------------------------- tabs ----------- */

.tabs {
  position: relative;
  display: flex;
  gap: var(--s1);
  margin: var(--s4) 0;
  padding: 5px;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  box-shadow: none;
}

.tabs button {
  flex: 1;
  min-height: 44px;
  padding: var(--s1) var(--s2);
  border-radius: var(--radius-pill);
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.93rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: color var(--t-base) var(--ease), background var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
}

.tabs button[aria-selected="true"] {
  color: #241a04;
  background: var(--gold);
  box-shadow: none;
}

.file-input-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.receipt-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--surface-2);
  border: 0;
  border-radius: var(--radius-sm);
  padding: var(--s3);
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--gold-3);
  word-break: break-all;
}

/* ========================================================== DISPLAY ===== */

.wall {
  --safe-x: 8vw;
  --safe-y: 6vh;
  --band: 18vh;          /* banda inferior: chip de datos + placa del QR */
  --fp: clamp(10px, 0.85vw, 22px);
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(100% 60% at 50% -5%, rgba(217,171,44,0.20), transparent 58%),
    radial-gradient(70% 45% at 50% 106%, rgba(255,157,60,0.13), transparent 62%),
    radial-gradient(150% 110% at 50% 45%, transparent 38%, rgba(0,0,0,0.82) 100%),
    linear-gradient(180deg, #0d0a10, #06040a);
}

/* Partículas doradas: las dibuja fx.js */
#wall-fx {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.wall::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--grain);
  pointer-events: none;
  z-index: 2;
}

.wall-stage {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--safe-y) var(--safe-x) calc(var(--safe-y) + var(--band));
}

/* ---- Tablero de polaroids -------------------------------------------------
   Es un MURO, no un pase de diapositivas: doce fotos conviven y se van
   reemplazando de a una. La recién llegada entra en la baldosa grande, así
   quien acaba de subir se ve destacado y la pantalla nunca queda muerta. */

.wall-board {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Cada foto tiene su lugar, su tamaño y su ángulo, fijados en una tabla del
   runtime. Compuesto a mano, no al azar: aleatorio cambia en cada redibujo. */
.tile {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  aspect-ratio: 1 / 1.18;
  z-index: var(--z, 1);
}
.tile .polaroid { --rot: var(--r, 0deg); }

.polaroid {
  --rot: 0deg;
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--ivory);
  border-radius: 6px;
  padding: 0.5vw 0.5vw 0;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.72);
  transform: rotate(var(--rot));
  animation: tile-in 620ms var(--ease-out);
}

/* Rotación determinista por posición: nunca al azar. */
.tile-hero .polaroid { padding: 0.6vw 0.6vw 0; }

/* La recién llegada se levanta por encima del resto un momento. */
.tile.is-newest { z-index: 20; }
.tile.is-newest .polaroid { box-shadow: 0 26px 60px rgba(0, 0, 0, 0.8); }

/* Entra como si la tiraran sobre el tablero: cae, gira y se asienta. */
@keyframes tile-in {
  from { opacity: 0; transform: rotate(calc(var(--rot) - 9deg)) translateY(-26px) scale(1.06); }
  60%  { opacity: 1; }
  to   { opacity: 1; transform: rotate(var(--rot)) translateY(0) scale(1); }
}

.polaroid img {
  flex: 1;
  width: 100%;
  min-height: 0;
  object-fit: cover;
  border-radius: 3px;
  display: block;
  background: #ddd8cc;
}

.polaroid blockquote {
  flex: 1;
  margin: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 0.6em;
  color: #241a08;
  font-family: var(--font-display);
  font-size: clamp(13px, 1.05vw, 26px);
  line-height: 1.25;
  background: #f0e9d8;
  border-radius: 3px;
  overflow: hidden;
}

.polaroid figcaption {
  flex: none;
  padding: 0.45em 0.2em 0.55em;
  text-align: center;
  color: #6a6459;
  font-size: clamp(11px, 0.78vw, 19px);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Marco dorado metálico con bloom y barrido de luz */
.slide-frame {
  --rot: 0deg;
  --ar: 1.5;
  position: relative;
  width: min(
    calc(100vw - 2 * var(--safe-x)),
    calc((100vh - 2 * var(--safe-y) - var(--band)) * var(--ar))
  );
  padding: var(--fp);
  border-radius: var(--radius);
  background: var(--gold);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.82);
  transform: rotate(var(--rot));
  display: flex;
  animation: frame-in var(--t-slow) var(--ease-out);
  overflow: hidden;
}

/* Barrido de luz que cruza la foto al entrar */
.slide-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,0.42) 50%, transparent 62%);
  transform: translateX(-120%);
  animation: sweep 1100ms var(--ease-out) 260ms;
  pointer-events: none;
}

@keyframes sweep { to { transform: translateX(120%); } }

@keyframes frame-in {
  from { opacity: 0; transform: rotate(var(--rot)) scale(0.965) translateY(16px); }
  to   { opacity: 1; transform: rotate(var(--rot)) scale(1) translateY(0); }
}

/* Ken Burns lento: la foto respira, no se queda muerta */
.slide-frame img.slide-photo {
  width: 100%;
  height: auto;
  display: block;
  border-radius: calc(var(--radius) - var(--fp));
  animation: kenburns 18s ease-out both;
}

@keyframes kenburns {
  from { transform: scale(1); }
  to   { transform: scale(1.055); }
}

.wall-stage > img.slide-photo {
  max-width: calc(100vw - 2 * var(--safe-x));
  max-height: calc(100vh - 2 * var(--safe-y) - var(--band));
  width: auto; height: auto; display: block;
}

/* Zócalo */
.wall-caption {
  position: absolute;
  left: var(--safe-x);
  right: auto;
  max-width: 56%;
  bottom: var(--safe-y);
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 0.28em;
  padding: 0.7em 1.2em;
  background: #0b0810;
  border-radius: var(--radius-sm);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.7);
  animation: caption-in var(--t-slow) var(--ease-out) 200ms backwards;
}

@keyframes caption-in {
  from { opacity: 0; transform: translateX(-28px); }
  to   { opacity: 1; transform: translateX(0); }
}

.wall-caption .text {
  font-size: clamp(24px, 2.5vw, 58px);
  font-weight: 700;
  line-height: 1.18;
  color: var(--text);
  text-shadow: 0 2px 18px rgba(0,0,0,0.9);
}

.wall-caption .who,
.wall-message .who {
  display: block;
  font-size: clamp(16px, 1.4vw, 32px);
  font-weight: 800;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--gold);
}

.wall-message {
  max-width: 74%;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(28px, 3.8vw, 88px);
  line-height: 1.2;
  font-weight: 500;
  color: var(--text);
  text-shadow: 0 4px 40px rgba(0,0,0,0.8), 0 0 70px rgba(217,171,44,0.22);
  animation: frame-in var(--t-slow) var(--ease-out);
  z-index: 3;
}

.wall-message .who { margin-top: 1.1em; font-family: var(--font); }

/* Placa del QR: marfil sólida, con halo dorado */
.wall-overlay {
  position: absolute;
  right: var(--safe-x);
  left: auto;
  bottom: var(--safe-y);
  z-index: 6;
  display: flex;
  gap: var(--s3);
  align-items: center;
  background: var(--ivory);
  border-radius: var(--radius-sm);
  padding: var(--s2) var(--s4) var(--s2) var(--s2);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.75);
  animation: caption-in var(--t-slow) var(--ease-out) 320ms backwards;
}

.wall-overlay img.qr {
  width: clamp(104px, 7.4vw, 158px);
  height: auto;
  display: block;
  border-radius: 6px;
  background: #fff;
}

.wall-overlay .cta { color: #17150f; line-height: 1.25; }

.wall-overlay .cta strong {
  display: block;
  font-size: clamp(19px, 1.6vw, 34px);
  font-weight: 900;
  letter-spacing: 0.05em;
  /* Sólido, no degradado: es lo que tiene que leerse desde la mesa 20. */
  color: #1a1408;
}

.wall-overlay .cta span {
  font-size: clamp(14px, 1.1vw, 23px);
  color: #6b6350;
  font-weight: 700;
}

/* Firma permanente del evento. Vive en la franja superior segura y queda
   por encima del tablero sin competir con la foto protagonista ni el QR. */
.wall-brand {
  position: absolute;
  top: var(--safe-y);
  left: var(--safe-x);
  z-index: 6;
    width: clamp(180px, 16vw, 290px);
  pointer-events: none;
}

.wall-brand img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.72));
}

/* La espera ya tiene un emblema central grande: ahí no duplicamos la firma. */
.holding:not([hidden]) ~ .wall-brand { display: none; }

/* Holding */
.holding {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s4);
  background:
    radial-gradient(90% 60% at 50% 34%, rgba(217,171,44,0.22), transparent 60%),
    radial-gradient(150% 110% at 50% 50%, transparent 32%, rgba(0,0,0,0.88) 100%),
    linear-gradient(180deg, #120e16, #06040a);
  text-align: center;
  padding: var(--safe-y) var(--safe-x);
}

.holding::before {
  content: "";
  width: clamp(110px, 16vh, 250px);
  height: clamp(110px, 16vh, 250px);
  background: url("/assets/img/emblema-dorado.png") center / contain no-repeat;
  filter: drop-shadow(0 0 46px rgba(247, 220, 138, 0.72));
  animation: emblem-pulse 4.5s var(--ease) infinite;
}

.holding h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 5.6vw, 112px);
  margin: 0;
  font-weight: 500;
  letter-spacing: 0.01em;
  background: var(--grad-gold);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 7s linear infinite;
}

.holding p {
  color: var(--gold-3);
  font-size: clamp(18px, 1.8vw, 40px);
  margin: 0;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  text-shadow: 0 0 30px rgba(247,220,138,0.5);
}

.holding img.qr {
  width: min(30vh, 270px);
  height: auto;
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 11px;
  box-shadow: 0 0 70px rgba(247, 220, 138, 0.45);
}

.connection-badge {
  position: absolute;
  top: var(--s4);
  right: var(--s4);
  z-index: 8;
  font-size: 0.78rem;
  color: var(--muted);
  border: 0;
  border-radius: var(--radius-pill);
  padding: 7px 15px;
  background: #0b0810;
  letter-spacing: 0.05em;
  font-weight: 600;
}
/* Conectado lleva punto en vivo; sin conexión, no. */
.connection-badge:not(.offline) {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold-3);

}
.connection-badge:not(.offline)::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold);
  animation: live-pulse 1.9s ease-out infinite;
}

.connection-badge.offline {
  color: var(--warn);
  border-color: var(--warn);
  box-shadow: 0 0 22px rgba(255,196,77,0.35);
}

/* Alto contraste para proyector flojo: ?contrast=high */
.wall.high-contrast {
  --gold-3: #ffe89a;
  --gold-4: #ffffff;
  background: #000;
}
.wall.high-contrast .wall-caption { background: #000; border-image: none; border-left-color: #ffd75e; }
.wall.high-contrast::after,
.wall.high-contrast #wall-fx { display: none; }
.wall.high-contrast .slide-frame { animation: none; }

/* ========================================================= OPERADOR ===== */

.operator-shell { max-width: 1120px; margin: 0 auto; padding: var(--s3) var(--s3) var(--s6); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  padding: var(--s2) 0 var(--s3);
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--s4);
  flex-wrap: wrap;
}

.topbar strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
}

.display-launch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 0.36fr);
  gap: var(--s4);
  align-items: center;
  box-shadow: inset 3px 0 0 var(--gold);
}

.display-launch h2 { margin-bottom: var(--s1); }
.display-launch .eyebrow {
  margin: 0 0 var(--s1);
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.display-launch-btn { min-height: 58px; }
.display-launch .notice { grid-column: 1 / -1; margin: 0; }

@media (max-width: 700px) {
  .display-launch { grid-template-columns: 1fr; }
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: var(--s2);
  margin: var(--s3) 0;
}

.health-tile {
  position: relative;
  background: var(--surface-2);
  border: 0;
  border-radius: var(--radius-sm);
  padding: var(--s4) var(--s3);
  text-align: center;
  overflow: hidden;
}

.health-tile::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-3), transparent);
  opacity: 0.6;
}

.health-tile .n {
  font-size: 2.15rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--gold);
}

.health-tile .l {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}

.filters { display: flex; gap: var(--s1); flex-wrap: wrap; margin: var(--s3) 0; align-items: center; }

.filters select, .filters input {
  width: auto;
  min-height: 42px;
  padding: var(--s1) var(--s2);
  font-size: 0.88rem;
}

.library { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: var(--s3); }

.library-item {
  background: var(--surface);
  border: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease), border-color var(--t-fast) var(--ease);
}
.library-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px rgba(0,0,0,0.55);
}

.library-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--panel-2); }
.library-item .msg { padding: var(--s2) var(--s3); font-size: 0.86rem; line-height: 1.4; min-height: 56px; }

.library-item .meta {
  padding: var(--s1) var(--s3) var(--s2);
  border-top: 1px solid var(--line);
  font-size: 0.7rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: var(--s1);
  align-items: center;
  flex-wrap: wrap;
  margin-top: auto;
}

/* Estados: ícono + texto, nunca sólo color */
.state-chip {
  border-radius: var(--radius-pill);
  padding: 4px 11px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.state-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.state-chip::before {
  content: "";
  width: 13px;
  height: 13px;
  flex: none;
  background: currentColor;
  -webkit-mask: var(--ico) center / contain no-repeat;
  mask: var(--ico) center / contain no-repeat;
}

.state-pending {
  background: rgba(167,159,149,0.14); color: var(--muted);
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5V12l3 1.8'/%3E%3C/svg%3E");
}
.state-allow {
  background: rgba(67,214,160,0.14); color: var(--ok);
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.6 4.4 4.4L19 7.4'/%3E%3C/svg%3E");
}
.state-review {
  background: rgba(255,196,77,0.14); color: var(--warn);
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='m16 16 4.5 4.5'/%3E%3C/svg%3E");
}
.state-block {
  background: rgba(255,107,107,0.14); color: var(--danger);
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E");
}
.state-error {
  background: rgba(255,107,107,0.14); color: var(--danger);
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4.5 21 19.5H3z'/%3E%3Cpath d='M12 10v4M12 17.2h.01'/%3E%3C/svg%3E");
}

.emergency {
  position: sticky;
  bottom: 0;
  z-index: 10;
  background: linear-gradient(180deg, transparent, var(--ink) 34%);
  padding: var(--s4) 0 var(--s2);
  margin-top: var(--s4);
}

.row { display: flex; gap: var(--s1); flex-wrap: wrap; margin-top: var(--s2); }
.row > .btn { flex: 1 1 140px; }
.emergency .btn { padding: var(--s2); font-size: 0.9rem; }

.history {
  font-size: 0.76rem;
  color: var(--muted);
  border-top: 1px dashed var(--line);
  margin-top: var(--s2);
  padding-top: var(--s2);
}
.history div { margin: 3px 0; }

.login-card { max-width: 410px; margin: 12vh auto; }

/* Entrada escalonada de tarjetas, la activa fx.js */
.reveal { opacity: 0; transform: translateY(18px); }
.reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out);
}

/* ======================================== SISTEMA PILO: contraste y datos =
   Tres recursos tomados del proyecto Pilo, con oro en lugar de lima:
   1. tipografía grande y apretada,
   2. chips de datos flotando fuera del contenedor,
   3. la tarjeta elegida se INVIERTE en vez de sólo marcarse.
   ========================================================================== */

/* 1 — Titulares grandes y apretados */
.brand { letter-spacing: -0.02em; line-height: 1.02; }
.card h2 { letter-spacing: var(--tracking-tight); font-size: 1.45rem; line-height: 1.08; font-weight: 800; }
.holding h1 { letter-spacing: -0.025em; line-height: 0.98; }
.wall-caption .text { letter-spacing: -0.02em; }

/* 2 — Chip de dato flotante: etiqueta chica arriba, valor grande abajo */
.chip-float {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  background: #0b0810;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 12px var(--s4);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.65);
}

.chip-float .k {
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.chip-float .v {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.chip-float.on-photo {
  position: absolute;
  left: var(--safe-x);
  bottom: var(--safe-y);
  z-index: 6;
  flex-direction: row;
  align-items: baseline;
  gap: var(--s3);
}
.chip-float.on-photo .k { font-size: clamp(11px, 0.8vw, 18px); }
.chip-float.on-photo .v { font-size: clamp(24px, 2.1vw, 46px); }

/* Punto "en vivo" */
.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--gold);
}
.live-dot::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 0 rgba(255, 201, 49, 0.75);
  animation: live-pulse 1.9s ease-out infinite;
}
@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 201, 49, 0.7); }
  70%  { box-shadow: 0 0 0 11px rgba(255, 201, 49, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 201, 49, 0); }
}

/* 3 — Selección invertida: la elegida se da vuelta, no se subraya */
.library-item.is-selected,
.card.is-selected {
  background: var(--gold);
  border-color: var(--gold);
  color: #1a1408;
  box-shadow: 0 18px 46px rgba(255, 201, 49, 0.35);
}
.library-item.is-selected .meta,
.library-item.is-selected .msg { color: #2b2208; }
/* Sobre oro, el chip de estado se invierte: si no, amarillo sobre amarillo. */
.library-item.is-selected .state-chip {
  background: #1a1408;
  color: var(--gold-3);
}

/* --------------------------------------------- blob líquido (gooey) ----- */
/* La librería del enlace es React y acá está prohibido; el efecto real es un
   filtro SVG: desenfocar y endurecer el alfa hace que las formas se fundan.
   Se usa para el estado "procesando", que si no es una barra muerta. */

.blob-stage {
  position: relative;
  width: 118px;
  height: 118px;
  margin: var(--s2) auto var(--s3);
  filter: url(#gooey) drop-shadow(0 0 26px rgba(255, 201, 49, 0.55));
}

.blob-stage i {
  position: absolute;
  display: block;
  border-radius: 50%;
  background: var(--gold);
}

.blob-stage i:nth-child(1) {
  inset: 18px;
  background: linear-gradient(140deg, var(--gold-hot), var(--gold-2));
  animation: blob-a 5.5s ease-in-out infinite;
}
.blob-stage i:nth-child(2) {
  width: 46px; height: 46px; left: 8px; top: 30px;
  animation: blob-b 4.3s ease-in-out infinite;
}
.blob-stage i:nth-child(3) {
  width: 38px; height: 38px; right: 8px; bottom: 26px;
  animation: blob-c 6.1s ease-in-out infinite;
}

@keyframes blob-a {
  0%,100% { transform: scale(1) translate(0,0); }
  33%     { transform: scale(1.09) translate(5px,-6px); }
  66%     { transform: scale(0.95) translate(-5px,5px); }
}
@keyframes blob-b {
  0%,100% { transform: translate(0,0) scale(1); }
  50%     { transform: translate(30px,-14px) scale(1.22); }
}
@keyframes blob-c {
  0%,100% { transform: translate(0,0) scale(1); }
  50%     { transform: translate(-26px,16px) scale(0.82); }
}

.blob-label {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--gold-3);
}
.blob-label + .muted { text-align: center; }

.gooey-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ==================================================== accesibilidad ===== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

@media (prefers-contrast: more) {
  :root { --line: #5a4a68; --line-strong: #7a6a88; --muted: #cfc7bb; }
}
