/* /live — visor del asistente. Hereda tokens de brand.css */

html,
body {
  height: 100%;
}
body {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg2); /* letterbox alrededor del marco */
}

#doc {
  flex: none; /* tamaño lo fija view-mode.js (marco 16:9 / 9:16) */
  border: 0;
  background: #fff;
}

.pdf-stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg2);
  overflow: auto;
}

.pdf-stage canvas {
  max-width: 100%;
  max-height: 100%;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
  background: #fff;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  /* fondo de marca opaco: cubre cualquier documento detrás (evita el flash blanco) */
  background: radial-gradient(1100px 560px at 50% -8%, rgba(255, 26, 26, 0.16) 0%, var(--bg) 60%),
    var(--bg);
}

.overlay[hidden] {
  display: none;
}

.overlay-card {
  text-align: center;
  max-width: 32rem;
}

.overlay-card .brand-logo {
  margin-bottom: 26px;
}

.overlay-card .eyebrow {
  display: block;
  margin-bottom: 28px;
}

.overlay-card h1 {
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  line-height: 1.05;
  margin: 0.4em 0 0.3em;
}
.overlay-card h1 em {
  font-style: normal;
  color: var(--amber);
}

.overlay-card p {
  color: var(--muted);
  line-height: 1.5;
}

.spinner {
  width: 40px;
  height: 40px;
  margin: 8px auto 4px;
  border: 4px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

.toast {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  backdrop-filter: blur(6px);
}

.toast[hidden] {
  display: none;
}

/* Botón de pantalla completa: esquina, discreto, siempre accesible */
.fs-btn {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 20;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--text);
  background: color-mix(in srgb, var(--surface2) 82%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  cursor: pointer;
  backdrop-filter: blur(6px);
  opacity: 0.75;
  transition: opacity 0.15s;
}
.fs-btn:hover {
  opacity: 1;
}
.fs-btn[hidden] {
  display: none;
}

/* Botón flotante para pedir el resumen: arriba a la derecha (libre del chip de
   nombre del modo juego, abajo-izquierda, y del botón de pantalla completa,
   abajo-derecha). z-index 25: por encima del lobby/presentación, por debajo del
   overlay del juego (30) y del propio modal (40). */
.lead-btn {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 25;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  background: color-mix(in srgb, var(--amber) 22%, var(--surface2));
  border: 1px solid color-mix(in srgb, var(--amber) 45%, var(--line));
  border-radius: var(--radius-pill);
  cursor: pointer;
  backdrop-filter: blur(6px);
  opacity: 0.95;
}
.lead-btn:hover {
  opacity: 1;
}
.lead-btn[hidden] {
  display: none;
}

/* CTA destacado dentro de la pantalla de espera (donde aterrizan al escanear). */
.lead-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 13px 22px;
  font-size: 0.98rem;
  font-weight: 700;
  color: #1a1320;
  background: var(--amber);
  border: 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: transform 0.12s;
}
.lead-cta:hover {
  transform: translateY(-1px);
}
.lead-cta[hidden] {
  display: none;
}

.lead-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
}
.lead-modal[hidden] {
  display: none;
}

.lead-card {
  position: relative;
  width: 100%;
  max-width: 30rem;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px 24px 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}
.lead-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
}
.lead-close:hover {
  color: var(--text);
  background: var(--surface2);
}
.lead-card h2 {
  font-size: 1.3rem;
  line-height: 1.15;
  margin: 0 24px 6px 0;
}
.lead-sub {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 16px;
}
.lead-field {
  display: block;
  margin-bottom: 12px;
}
.lead-field span {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 5px;
}
.lead-field em {
  font-style: normal;
  opacity: 0.7;
}
.lead-field input {
  width: 100%;
  padding: 11px 13px;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.lead-field input:focus {
  outline: none;
  border-color: var(--amber);
}
.lead-check {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 0.86rem;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 11px;
  cursor: pointer;
}
.lead-check input {
  margin-top: 2px;
  flex: none;
  width: 17px;
  height: 17px;
  accent-color: var(--amber);
}
.lead-check a {
  color: var(--amber);
}
.lead-info {
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--muted);
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 4px 0 16px;
}
.lead-info a {
  color: var(--muted);
  text-decoration: underline;
}
.lead-submit {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  font-weight: 700;
  color: #1a1320;
  background: var(--amber);
  border: 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
}
.lead-submit:disabled {
  opacity: 0.6;
  cursor: default;
}
.lead-msg {
  margin-top: 12px;
  text-align: center;
  font-size: 0.9rem;
}
.lead-msg.ok {
  color: #36d6a0;
}
.lead-msg.err {
  color: var(--amber);
}
.lead-msg[hidden] {
  display: none;
}
