:root {
  --fsd-bg: #f9fafb;
  --fsd-surface: #ffffff;
  --fsd-text: #0f172a;
  --fsd-muted: #64748b;
  --fsd-primary: #E53935; /* Rojo de tu marca */
  --fsd-border: #e5e7eb;
}

/* Contenedor */
.fsd {
  max-width: 760px;
  margin: 0 auto;
  font-family: 'Roboto', system-ui, -apple-system, Segoe UI, sans-serif;
  color: var(--fsd-text);
}

/* Escenario (video + canvas + guía) */
.fsd-stage {
  position: relative;
  width: 100%;
  aspect-ratio: var(--w, 720) / var(--h, 540);
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}

/* Capas */
#fsd-video,
#fsd-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* espejo para que canvas y video coincidan */
}

#fsd-video  { z-index: 1; }
#fsd-canvas { z-index: 2; pointer-events: none; }

/* Guía */
.fsd-guide {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 3; /* por encima del canvas */
}

.fsd-oval {
  width: min(62%, 420px);
  aspect-ratio: 1 / 1.25;
  border: 2px dashed var(--fsd-primary);
  border-radius: 50% / 56%;
  box-shadow: 0 0 0 6px rgba(229, 57, 53, .15) inset;
  animation: fsdPulse 1.8s ease-in-out infinite;
}

.fsd-hint {
  margin-top: .6rem;
  color: #fff;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,.65);
}

@keyframes fsdPulse {
  0% { opacity: .6 }
  50% { opacity: 1 }
  100% { opacity: .6 }
}

/* Respeto por accesibilidad (menos movimiento) */
@media (prefers-reduced-motion: reduce) {
  .fsd-oval { animation: none; }
}

/* Resultado */
.fsd-result {
  display: grid;
  gap: .75rem;
  grid-template-columns: auto 1fr;
  margin-top: 1.2rem;
  align-items: start;
}

.fsd-badge {
  background: var(--fsd-primary);
  color: #fff;
  padding: .8rem 1.2rem;
  border-radius: 12px;
  text-align: center;
}

.fsd-badge span {
  display: block;
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1.2;
}

.fsd-badge small {
  font-weight: 700;
  font-size: 0.9rem;
  opacity: 0.8;
}

.fsd-suggest {
  color: var(--fsd-text);
  background: var(--fsd-surface);
  border: 1px solid var(--fsd-border);
  border-radius: 12px;
  padding: .8rem 1rem;
  font-size: 1.05rem;
}

.fsd-metrics {
  color: var(--fsd-muted);
  font-size: .9rem;
  grid-column: 1 / -1; /* Ocupa todo el ancho */
  text-align: center;
  margin-top: .5rem;
}

#fsd-video, #fsd-canvas{
  position:absolute; inset:0;
  width:100%; height:100%;
  object-fit: contain;     /* <= importante */
  transform: scaleX(-1);   /* espejo */
}
