/* ==========================================================================
   PARADOX WALL — estilos
   Paleta tomada del mockup: degradado azul profundo -> teal, tarjetas píldora
   blancas con avatar circular en degradado y encabezado cian.
   ========================================================================== */
/* Tipografía de marca — mira DESIGN.md. Solo cargamos los dos pesos que se usan. */
@font-face {
  font-family: "D-DIN";
  src: url("/d-din/D-DIN-Bold.otf") format("opentype");
  font-weight: 700;
  font-display: block; /* la pantalla no debe mostrar un flash con la fuente de sistema */
}
@font-face {
  font-family: "D-DIN Exp";
  src: url("/d-din/D-DINExp-Bold.otf") format("opentype");
  font-weight: 700;
  font-display: block;
}

:root {
  --deep: #0a1a3f;
  --deep-2: #0e2a4d;
  --teal: #16c3a6;
  --teal-brand: #00dcb8;
  --card-bg: #ffffff;
  --card-text: #000000;
  --font: "D-DIN", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-exp: "D-DIN Exp", var(--font);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

/* ---------- DISPLAY (pantalla grande) ---------- */
.display-body {
  overflow: hidden;
  /* El degradado queda de respaldo por si la imagen no carga. */
  background:
    url("/img/background-wall.webp") center / cover no-repeat fixed,
    linear-gradient(120deg, var(--deep) 0%, var(--deep-2) 42%, #0f5f63 78%, var(--teal) 100%);
}

#stage {
  position: fixed;
  inset: 0;
  z-index: 1;
}

/* Encabezado (logo + QR) — puedes reemplazar los placeholders por imágenes */
.brand {
  position: fixed;
  top: 36px;
  left: 48px;
  z-index: 3;
  /* Altura = perilla de calibración: súbela/bájala según se vea en la pantalla real. */
  height: 10rem;
  width: auto;
}

.qr-zone {
  position: fixed;
  top: 36px;
  right: 48px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 22px;
  color: #fff;
}
.qr-zone .copy {
  text-align: right;
  font-weight: 700;
  line-height: 1.05;
  max-width: 25vw; /* 20vw +25% */
  /* rem en los topes + vw en medio: escala con el display sin dispararse en los extremos.
     ponytail: el 2.2vw es la perilla de calibración si en la pantalla real queda chico. */
  font-size: clamp(1.5rem, 2.2vw, 3rem);
  /* paint-order pinta el trazo DEBAJO del relleno; sin esto el stroke se come la letra. */
  -webkit-text-stroke: 0.125rem #000;
  paint-order: stroke fill;
  /* Sombra difusa aparte del trazo: despega el texto de las zonas claras del fondo. */
  text-shadow: 0 0.125rem 0.75rem rgba(0, 0, 0, 0.85);
}
.qr-zone .qr-box {
  width: 118px; height: 118px; border-radius: 12px; background: #fff;
  display: flex; align-items: center; justify-content: center;
  color: #123; font-size: 11px; text-align: center;
}

.sponsors {
  position: fixed;
  bottom: 34px; left: 0; right: 0;
  z-index: 3;
  display: flex; gap: 60px; justify-content: center; align-items: center;
}
/* Altura común: cada logo trae su propio ancho, así quedan ópticamente parejos. */
.sponsors img { height: 46px; width: auto; opacity: 0.9; }
/* Este logo es negro sobre transparente; sobre el fondo oscuro hay que blanquearlo. */
.sponsors img.inv { filter: brightness(0) invert(1); }

/* ---------- Tarjeta de mensaje ---------- */
.msg-card {
  position: absolute;
  width: 260px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px 12px 12px;
  background: var(--card-bg);
  color: var(--card-text);
  border-radius: 999px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.28);
  will-change: transform, opacity;
  transform-origin: center;
  /* Estado inicial (entrada) */
  opacity: 0;
  transform: translate(var(--x), var(--y)) scale(0.82);
  transition:
    opacity var(--enter, 520ms) cubic-bezier(0.22, 1, 0.36, 1),
    transform var(--enter, 520ms) cubic-bezier(0.22, 1, 0.36, 1);
}
.msg-card.enter {
  opacity: 1;
  transform: translate(var(--x), var(--y)) scale(1);
}
.msg-card.leave {
  opacity: 0;
  transform: translate(var(--x), var(--y)) scale(0.9);
  transition:
    opacity var(--exit, 420ms) ease,
    transform var(--exit, 420ms) ease;
}

.msg-card .avatar {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  /* `contain` respeta la transparencia del PNG: nada de border-radius que lo recorte. */
  background: url("/img/circulo.png") center / contain no-repeat;
}
.msg-card .body { min-width: 0; }
.msg-card .name {
  font-family: var(--font-exp);
  color: var(--teal-brand);
  /* Solo cargamos el peso 700: pedir 800 haría que el navegador falsee la negrita. */
  font-weight: 700;
  font-size: 16.9px; /* 13px +30% */
  margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.msg-card .text {
  font-size: 15px; /* 12.5px +20% */
  line-height: 1.25;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* HUD de depuración (se activa con ?debug=1) */
#hud {
  position: fixed; bottom: 8px; left: 12px; z-index: 9;
  font: 12px/1.4 monospace; color: #b7ffe9;
  background: rgba(0,0,0,0.45); padding: 6px 10px; border-radius: 8px;
  display: none; white-space: pre;
}

@media (prefers-reduced-motion: reduce) {
  .msg-card { transition-duration: 0.01ms; }
}
