/* ============================================================
   live.css — Render de diapositivas (1280x720 escalado),
   overlay de salida y monitor de retorno (stage.html)
   ============================================================ */

/* Contenedor genérico escalable: su primer hijo se transforma */
.slide-thumb-canvas, .theme-card-canvas, .te-preview-screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}
.te-preview-screen { aspect-ratio: 16/9; border-radius: 8px; border: 1px solid #34343a; }

/* ---------- Diapositiva renderizada ---------- */
.slide-render {
  position: absolute;
  top: 0; left: 0;
  transform-origin: top left;
  overflow: hidden;
  font-family: 'Segoe UI', sans-serif;
}
.sl-bg { position: absolute; inset: 0; }
.sl-bg-media { width: 100%; height: 100%; object-fit: cover; }
.sl-dim { position: absolute; inset: 0; background: rgba(0,0,0,.14); }
.sl-text {
  position: absolute; inset: 48px 70px 64px;
  display: flex; flex-direction: column;
  align-items: center;
  word-wrap: break-word;
  overflow: hidden;
}
.sl-text p { margin: 0; width: 100%; }
.sl-strip {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 54px;
  display: flex; align-items: center;
  padding: 0 26px;
  font-size: 22px;
  font-family: inherit;
}
.sl-strip-lbl span { opacity: .75; font-size: 19px; }
.sl-counter {
  position: absolute; right: 18px; bottom: 66px;
  padding: 3px 14px; border-radius: 16px;
  font-size: 20px; color: #fff;
}

/* ---------- Overlay de salida integrada ---------- */
#liveOverlay {
  position: fixed; inset: 0; z-index: 200;
  background: #000;
}
#liveOverlay .live-stage { position: absolute; inset: 0; }

/* ---------- Monitor de retorno (stage.html) ---------- */
.stage-wrap {
  height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  grid-template-rows: auto 1fr auto auto;
  gap: 12px;
  padding: 18px;
  background:
    radial-gradient(1200px 600px at 20% 0%, rgba(47,129,247,.10), transparent 60%),
    #0b0b0e;
  color: #e8e8ee;
  font-family: 'Segoe UI', system-ui, sans-serif;
  box-sizing: border-box;
}
.stage-clock {
  grid-column: 1 / -1;
  font-size: 44px; font-weight: 300;
  letter-spacing: 2px;
  color: #9ecbff;
  text-align: center;
}
.stage-now, .stage-next {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 12px;
  padding: 14px 18px;
  overflow: hidden;
  display: flex; flex-direction: column; gap: 6px;
}
.stage-next { grid-column: 2; grid-row: 2; }
.stage-now { grid-column: 1; grid-row: 2; }
.stg-lbl { font-size: 12px; letter-spacing: 2px; color: #7d87f7; font-weight: 700; }
.stg-title { font-size: 22px; font-weight: 700; }
.stg-title.dim { opacity: .6; }
.stg-text { font-size: 17px; line-height: 1.45; max-height: 5.8em; overflow: hidden; opacity: .92; }
.stg-text.dim { opacity: .45; }
.stage-msg {
  grid-column: 1 / -1;
  background: rgba(47,129,247,.18);
  border: 1px solid rgba(47,129,247,.5);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 20px;
  text-align: center;
}
.stage-alert {
  grid-column: 1 / -1;
  background: rgba(229,72,77,.2);
  border: 1px solid rgba(229,72,77,.6);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  animation: stg-blink 1s step-end infinite;
}
@keyframes stg-blink { 50% { opacity: .35; } }
.stage-countdown {
  grid-column: 1 / 2;
  background: rgba(70,167,88,.15);
  border: 1px solid rgba(70,167,88,.5);
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 34px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.stage-countdown.low { color: #ff9c9f; border-color: rgba(229,72,77,.6); }
.stage-counter {
  grid-column: 2 / 3;
  background: rgba(245,166,35,.12);
  border: 1px solid rgba(245,166,35,.5);
  border-radius: 10px;
  padding: 10px 18px;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  font-size: 30px;
}
.stage-counter span { font-size: 16px; opacity: .7; }

/* ---------- Miniatura del monitor en preview ---------- */
.stg-mini {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, #14141c, #1b1b26);
  color: #e8e8ee;
  display: flex; flex-direction: column;
  gap: 4px; padding: 7% 9%;
  font-family: 'Segoe UI', sans-serif;
}
.stgm-clock { font-size: 12px; color: #9ecbff; text-align: center; }
.stgm-lbl { font-size: 8px; letter-spacing: 2px; color: #7d87f7; font-weight: 700; }
.stgm-title { font-size: 12px; font-weight: 700; }
.stgm-title.dim { opacity: .55; }
.stgm-text { font-size: 10px; opacity: .8; max-height: 2.6em; overflow: hidden; }
.stgm-text.dim { opacity: .4; }
.stgm-block { border: 1px solid rgba(255,255,255,.09); border-radius: 6px; padding: 4px 8px; margin-top: 3px; }
.stgm-msg { margin-top: auto; font-size: 10px; color: #9ecbff; min-height: 12px; }
