/* en-vivo.css — el reloj del pitch, la pantalla del mercado embebida y la
   barra del mercado (ver en-vivo.js). Usa los colores de la piel de cada slide. */

/* ---------- el reloj ---------- */
.ev-clock {
  --ev-state: var(--accent);
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: 18px;
  padding: 18px 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ev-clock.is-warn { --ev-state: #d99a00; }
.ev-clock.is-over { --ev-state: #d23a2a; }
.ev-clock-top { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ev-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ev-who b { font-size: 21px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-who--next b { color: var(--ink-soft); font-weight: 600; }
.ev-label { font-size: 15px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
.ev-time-row { display: flex; align-items: center; gap: 22px; }
.ev-time {
  font-size: 118px;
  font-weight: 800;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.ev-clock.is-warn .ev-time, .ev-clock.is-over .ev-time { color: var(--ev-state); }
.ev-clock.is-paused .ev-time { opacity: 0.5; }
.ev-phase { display: flex; flex-direction: column; gap: 6px; }
.ev-phase b { font-size: 24px; }
.ev-phase span { font-size: 16px; color: var(--ink-soft); line-height: 1.35; }
.ev-bar { height: 10px; border-radius: 99px; background: var(--rule); overflow: hidden; }
.ev-bar i { display: block; height: 100%; width: 0; background: var(--ev-state); border-radius: 99px; transition: width 0.25s linear; }
.ev-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ev-actions--tools { gap: 8px; }
.ev-btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 17px;
  line-height: 1.1;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.ev-btn:hover { background: var(--accent-tint); }
.ev-btn:disabled { opacity: 0.4; cursor: default; }
.ev-btn--main { background: var(--accent); border-color: var(--accent); color: var(--paper); font-size: 19px; }
.ev-btn--main:hover { background: var(--accent-strong); }
.ev-btn--quiet { font-size: 15px; font-weight: 600; padding: 9px 13px; }
.ev-sync, .ev-small { font-size: 16px; color: var(--ink-faint); line-height: 1.35; }
.ev-small a, .ev-sync a { color: var(--accent); }
.ev-wake { margin-top: 2px; }

.ev-clock--compact { padding: 14px 18px; gap: 8px; }
.ev-clock--compact .ev-time { font-size: 76px; }
.ev-clock--compact .ev-phase b { font-size: 19px; }
.ev-clock--compact .ev-phase span { font-size: 14px; }
.ev-clock--compact .ev-who b { font-size: 17px; }
.ev-clock--compact .ev-btn { font-size: 15px; padding: 10px 14px; }

/* ---------- la pantalla del mercado, embebida ---------- */
.ev-embed {
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #101611;
  border: 1px solid var(--rule);
}
.ev-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 1600px;
  height: 900px;
  border: 0;
  transform-origin: 0 0;
}
.ev-embed-open {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 15px;
  text-decoration: none;
}
.ev-embed-empty {
  height: 100%;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #e9eee6;
  font-size: 20px;
  text-align: center;
  padding: 20px;
}
.ev-embed-empty span { font-size: 16px; opacity: 0.8; }

/* ---------- layouts de las slides en vivo ---------- */
.ev-layout { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: center; }
.ev-layout--clock { grid-template-columns: 1.45fr 1fr; align-items: stretch; }
.ev-layout--preguntas { grid-template-columns: 330px 1fr; align-items: start; }
.ev-side h2 { margin: 0 0 14px; }
.ev-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; counter-reset: ev; }
.ev-steps li { display: flex; gap: 12px; font-size: 19px; line-height: 1.35; counter-increment: ev; }
.ev-steps li::before {
  content: counter(ev);
  flex: 0 0 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--paper);
  font-weight: 800;
  font-size: 16px;
}
.ev-sortear { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; align-items: flex-start; }
.ev-probar { margin-top: 18px; }
.ev-qr { background: #fff; padding: 8px; border-radius: 10px; display: inline-block; line-height: 0; }
.ev-qr img, .ev-qr canvas { display: block; }
.ev-qr-fallback { line-height: 1.3; font-size: 13px; color: #222; max-width: 150px; word-break: break-all; padding: 6px; }

/* ---------- barra del mercado y reloj chico (fuera de la slide) ---------- */
.ev-mini {
  position: fixed;
  left: 16px;
  top: 14px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(20, 26, 21, 0.88);
  color: #f4f1e6;
  font-size: 15px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}
.ev-mini[hidden] { display: none; }
.ev-mini b { font-size: 20px; font-variant-numeric: tabular-nums; }
.ev-mini-dot { width: 10px; height: 10px; border-radius: 50%; background: #9fd33a; }
.ev-mini.is-warn .ev-mini-dot { background: #f2b51c; }
.ev-mini.is-over { background: rgba(150, 24, 16, 0.92); }
.ev-mini.is-over .ev-mini-dot { background: #fff; }
.ev-mini.is-paused { opacity: 0.7; }

.ev-panel {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(10, 12, 10, 0.55);
  display: grid;
  place-items: center;
  padding: 16px;
}
.ev-panel[hidden] { display: none; }
.ev-panel-card {
  --ink: #221f17; --ink-soft: #5b5745; --ink-faint: #6f6a55; --paper: #f3efe3; --rule: rgba(34, 31, 23, 0.15);
  --accent: #6b3fd6; --accent-strong: #4b2699; --accent-tint: rgba(107, 63, 214, 0.1);
  width: min(640px, 100%);
  background: #fcfaf3;
  color: var(--ink);
  border-radius: 18px;
  padding: 20px 22px 22px;
  font-size: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.ev-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-size: 19px; }
.ev-panel-head .ghost-btn { color: var(--ink); background: transparent; border-color: var(--rule); }
.ev-sala { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.ev-sala label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; flex: 1; min-width: 200px; }
.ev-sala input { font-family: inherit; font-weight: 700; font-size: 22px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--rule); text-transform: uppercase; letter-spacing: 0.06em; }
.ev-panel-grid { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: start; }
.ev-links { display: flex; flex-direction: column; gap: 8px; }
.ev-links a { color: var(--accent-strong); font-weight: 600; text-decoration: none; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 10px; }
.ev-links a:hover { background: var(--accent-tint); }
.ev-qr-box { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-faint); }
.ev-qr-box > div { background: #fff; padding: 8px; border-radius: 10px; line-height: 0; }
@media (max-width: 560px) { .ev-panel-grid { grid-template-columns: 1fr; } }

.ev-toast {
  position: fixed;
  left: 50%;
  bottom: 86px;
  transform: translateX(-50%);
  z-index: 90;
  background: #221f17;
  color: #f4f1e6;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 15px;
  max-width: min(560px, calc(100% - 32px));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* Destello al cruzar un aviso (solo si el deck está a la vista). */
body.ev-flash::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  animation: ev-flash 1.5s ease-out;
}
@keyframes ev-flash {
  0%, 30%, 60% { box-shadow: inset 0 0 0 14px #f2b51c; }
  15%, 45%, 100% { box-shadow: inset 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) { body.ev-flash::after { animation: none; } }
