/* ==========================================================================
   Sistema de Partidas · Presentación SIP Software
   Lienzo lógico de 1920 px de ancho; alto 1080 (16:9) hasta 1440 (4:3).
   Todo se escala proporcionalmente desde assets/js/deck.js.
   ========================================================================== */

:root {
  --green: #00aa55;        /* verde del logo SIP Software */
  --green-text: #007a3d;   /* verde oscuro para texto sobre fondo claro */
  --bg: #ffffff;
  --fg: #1d2227;
  --muted: #47515b;
  --line: #cfd5db;
  --card: #f0f2f4;
  --section-bg: #23292f;
  --section-fg: #ffffff;
  --section-muted: #c3cbd2;
  --shadow: 0 8px 34px rgba(20, 26, 32, .20);
  --slide-h: 1080px;
  --font: "Segoe UI", "Segoe UI Variable Text", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: Consolas, "Cascadia Mono", "Courier New", monospace;
}

/* Tema oscuro opcional (tecla T) para salas completamente a oscuras */
body.theme-dark {
  --green-text: #33cc7a;
  --bg: #1b2025;
  --fg: #f3f5f7;
  --muted: #c3cbd2;
  --line: #3b444d;
  --card: #262d34;
  --section-bg: #111417;
  --shadow: 0 8px 34px rgba(0, 0, 0, .55);
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: var(--font);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
}
body.idle, body.idle * { cursor: none !important; }

/* ---------- Lienzo ---------- */
#deck {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 1920px;
  height: var(--slide-h);
  transform-origin: 50% 50%;
  transform: translate(-50%, -50%) scale(.5);
  user-select: none;
  -webkit-user-select: none;
}

.slide {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: 72px 110px 100px;
  background: var(--bg);
  color: var(--fg);
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease, visibility 0s linear .35s;
  overflow: hidden;
}
.slide.active {
  opacity: 1;
  visibility: visible;
  transition: opacity .35s ease;
}
.slide .notes { display: none !important; }

/* ---------- Tipografía (mínimo 36 px en el lienzo) ---------- */
.slide h1, .slide h2, .slide h3, .slide p { margin: 0; }
.slide h1 { font-size: 120px; font-weight: 700; line-height: 1.05; letter-spacing: -.01em; }
.slide h2 { font-size: 80px; font-weight: 700; line-height: 1.08; letter-spacing: -.005em; }
.slide h3 { font-size: 58px; font-weight: 700; line-height: 1.1; }
.slide .tag {
  font-size: 38px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--green-text);
  margin-bottom: 8px;
}
.slide .lead { font-size: 50px; line-height: 1.2; color: var(--muted); margin-top: 18px; }
.slide .muted { color: var(--muted); }
.slide strong, .slide b { font-weight: 700; }

.body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding-top: 36px;
}
.body.row { flex-direction: row; gap: 80px; }
.col { display: flex; flex-direction: column; gap: 36px; align-items: flex-start; }

/* ---------- Pie con logo y número ---------- */
.foot {
  position: absolute;
  left: 110px;
  right: 110px;
  bottom: 30px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 30px;
  color: var(--muted);
  pointer-events: none;
}
.foot img { height: 46px; width: auto; }

/* ---------- Capturas ---------- */
.shot {
  position: relative;
  flex: none;
  max-width: 1700px;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow);
  outline: 2px solid var(--line);
  overflow: hidden;
  line-height: 0;
}
.shot img { display: block; width: 100%; height: auto; }

/* Recuadro de resaltado. .spot oscurece el resto de la captura. */
.hl {
  position: absolute;
  box-sizing: border-box;
  border: 7px solid var(--green);
  border-radius: 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .5s ease .45s;
}
.hl.spot { box-shadow: 0 0 0 4000px rgba(18, 22, 26, .42); }
.slide.active .hl { opacity: 1; }

/* ---------- Texto impreso de la partida (transcrito, legible) ---------- */
.impreso {
  flex: none;
  max-width: 1700px;
  box-sizing: border-box;
  background: #fff;
  color: #15191d;
  border-radius: 14px;
  border-left: 14px solid var(--green);
  box-shadow: var(--shadow);
  padding: 30px 48px 34px;
  font-family: var(--mono);
  font-size: 40px;
  line-height: 1.35;
}
.impreso.wide { max-width: 1700px; }
.impreso-cap {
  font-family: var(--font);
  font-size: 36px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #5b6570;
  margin-bottom: 14px !important;
}
.impreso .kv { display: grid; grid-template-columns: max-content 1fr; column-gap: 32px; padding: 6px 12px; border-radius: 8px; }
.impreso .k { color: #5b6570; }
.impreso .kv.mark { background: rgba(0, 170, 85, .16); }
.impreso mark { background: rgba(0, 170, 85, .22); color: inherit; padding: 0 6px; border-radius: 6px; }
.impreso .para { font-size: 42px; line-height: 1.45; }

/* ---------- Listas y bloques ---------- */
.bullets { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 44px; }
.bullets li { position: relative; padding-left: 64px; font-size: 58px; line-height: 1.2; }
.bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .38em;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--green);
}
.bullets.narrow li { font-size: 50px; }
.bullets.narrow { gap: 36px; max-width: 760px; }

.agenda { list-style: none; counter-reset: ag; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 30px; align-self: stretch; padding-left: 40px; }
.agenda li { counter-increment: ag; display: flex; align-items: center; gap: 36px; font-size: 56px; line-height: 1.15; }
.agenda li::before {
  content: counter(ag);
  flex: none;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  font-size: 48px;
}
.agenda a { color: inherit; text-decoration: none; }
.agenda a:hover { color: var(--green-text); }

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-self: stretch; }
.card { background: var(--card); border-radius: 22px; padding: 42px 52px 48px; border-top: 12px solid var(--green); }
.card p { font-size: 42px; line-height: 1.25; color: var(--muted); margin-top: 14px; }

.step { display: flex; align-items: center; gap: 26px; font-size: 52px; line-height: 1.15; }
.step span {
  flex: none;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  font-size: 42px;
}
.steps { gap: 40px; }

.callout { font-size: 48px; color: var(--fg); }
.callout strong { color: var(--green-text); }

/* Nota destacada debajo de una pantalla (diap. 6 y 25) */
.nota {
  flex: none;
  max-width: 1700px;
  box-sizing: border-box;
  font-size: 44px;
  line-height: 1.25;
  padding: 20px 36px;
  border-radius: 14px;
  border-left: 12px solid var(--green);
  background: var(--card);
}
.nota b { color: var(--green-text); }


.cta {
  margin-top: 30px !important;
  font-size: 50px;
  font-weight: 700;
  color: var(--green-text);
  border: 5px solid var(--green);
  border-radius: 18px;
  padding: 22px 36px;
}

/* ---------- Portada ---------- */
/* Diapositiva 1: ver la presentación en el teléfono (QR a media página) */
.slide.qr-slide { flex-direction: row; align-items: center; gap: 70px; padding: 60px 90px 60px 110px; }
.qr-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.qr-logo { width: 380px; height: auto; margin-bottom: 56px; }
.qr-slide .lead { margin-top: 28px; }
/* La dirección completa, en verde y en una sola línea */
.qr-url {
  margin-top: 44px !important;
  padding: 22px 26px;
  border: 3px solid rgba(0, 170, 85, .45);
  border-radius: 18px;
  background: rgba(0, 170, 85, .09);
  color: var(--green-text);
  font-size: 50px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.qr-url span { font-weight: 500; }
.qr-hint { margin-top: 34px !important; font-size: 44px; color: var(--muted); }
.qr-card {
  flex: none;
  width: 840px;
  height: 840px;
  box-sizing: border-box;
  padding: 66px;              /* zona en blanco alrededor del código (lectura segura) */
  border-radius: 28px;
  background: #fff;           /* blanco también en el tema oscuro: la cámara lo lee mejor */
  box-shadow: var(--shadow);
}
.qr-card .qr { display: block; width: 100%; height: 100%; fill: #111; }

.slide.cover { justify-content: center; padding-left: 160px; }
.cover-logo { width: 560px; height: auto; margin-bottom: 70px; }
.cover .lead { font-size: 60px; margin-top: 10px; }
.cover-meta { margin-top: 80px; padding-left: 36px; border-left: 10px solid var(--green); display: flex; flex-direction: column; gap: 14px; }
.cover-meta p { font-size: 42px; line-height: 1.25; }

/* ---------- Separadores de sección ---------- */
.slide.divider { background: var(--section-bg); color: var(--section-fg); justify-content: center; padding-left: 160px; }
.slide.divider h2 { font-size: 112px; max-width: 1600px; }
.slide.divider .lead { color: var(--section-muted); font-size: 54px; }
.div-num { font-size: 180px !important; font-weight: 800; line-height: 1; color: var(--green); margin-bottom: 20px !important; }
.pill {
  align-self: flex-start;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--green);
  border: 4px solid var(--green);
  border-radius: 999px;
  padding: 12px 36px;
  margin-bottom: 44px !important;
}

/* ---------- Distintivo del sacramento (data-sacramento en cada <section>) ---------- */
/* Fijo arriba a la derecha, dentro del margen superior: no invade el título (empieza en y=72). */
.slide[data-sacramento]::before {
  content: attr(data-sacramento);
  position: absolute;
  top: 14px;
  right: 110px;
  z-index: 2;
  box-sizing: border-box;
  height: 54px;
  display: flex;
  align-items: center;
  padding: 0 28px;
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--green-text);
  background: var(--card);
  border: 4px solid var(--green);
  border-radius: 999px;
  pointer-events: none;
}
.slide.divider[data-sacramento]::before { color: var(--green); background: transparent; }

/* ---------- Cierre ---------- */
.slide.closing { justify-content: center; padding-left: 160px; }
.closing h2 { font-size: 130px; }
.closing .lead { font-size: 60px; }
.contact { margin-top: 70px; display: grid; grid-template-columns: max-content max-content; gap: 22px 90px; }
.contact p { font-size: 46px; line-height: 1.2; display: flex; flex-direction: column; }
.contact span { font-size: 36px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.closing-logo { position: absolute; right: 130px; bottom: 110px; width: 420px; height: auto; }

/* ==========================================================================
   Interfaz (fuera del lienzo, tamaño real de pantalla)
   ========================================================================== */
#progress {
  position: fixed;
  left: 0;
  bottom: 0;
  height: 6px;
  width: 0;
  background: var(--green);
  z-index: 20;
  transition: width .3s ease;
}

#ui {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(28, 33, 38, .78);
  color: #fff;
  font: 600 16px/1 var(--font);
  transition: opacity .4s ease;
}
body.idle #ui { opacity: 0; pointer-events: none; }
#ui button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: grid;
  place-items: center;
}
#ui button:hover, #ui button:focus-visible { background: rgba(255, 255, 255, .16); outline: none; }
#ui svg { width: 24px; height: 24px; fill: currentColor; }
#ui .count { min-width: 76px; text-align: center; font-variant-numeric: tabular-nums; padding: 0 4px; cursor: pointer; }

#goto {
  position: fixed;
  left: 50%;
  bottom: 60px;
  transform: translateX(-50%);
  z-index: 40;
  padding: 14px 26px;
  border-radius: 12px;
  background: rgba(28, 33, 38, .92);
  color: #fff;
  font: 600 28px/1.2 var(--font);
  display: none;
}
#goto.show { display: block; }
#goto b { color: #5fe0a0; font-variant-numeric: tabular-nums; }

#toast {
  position: fixed;
  left: 50%;
  top: 24px;
  transform: translateX(-50%);
  z-index: 60;
  padding: 12px 22px;
  border-radius: 10px;
  background: rgba(28, 33, 38, .92);
  color: #fff;
  font: 500 20px/1.3 var(--font);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
#toast.show { opacity: 1; }

#blackout { position: fixed; inset: 0; background: #000; z-index: 100; display: none; cursor: none; }
body.black #blackout { display: block; }

/* Vista general */
#overview {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  flex-direction: column;
  background: rgba(20, 24, 28, .97);
  color: #fff;
  font-family: var(--font);
}
body.ov-open #overview { display: flex; }
body.ov-open #ui { display: none; }
#overview header { display: flex; align-items: baseline; gap: 24px; padding: 18px 28px 10px; }
#overview header h2 { margin: 0; font-size: 26px; }
#overview header p { margin: 0; font-size: 17px; color: #b8c1ca; }
#ov-grid {
  flex: 1;
  overflow: auto;
  padding: 10px 28px 28px;
  display: grid;
  grid-template-columns: repeat(auto-fill, 300px);
  gap: 22px;
  justify-content: center;
  align-content: start;
}
.ov-item { cursor: pointer; border-radius: 10px; padding: 6px; outline: 3px solid transparent; }
.ov-item:hover { background: rgba(255, 255, 255, .06); }
.ov-item.sel { outline-color: #5fe0a0; background: rgba(95, 224, 160, .10); }
.ov-item.cur .ov-title b { color: #5fe0a0; }
.ov-title { font-size: 15px; line-height: 1.3; margin-top: 6px; color: #dfe5ea; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Miniaturas (vista general y modo presentador) */
.thumb { position: relative; overflow: hidden; border-radius: 6px; background: var(--bg); }
.thumb-stage { position: absolute; left: 0; top: 0; width: 1920px; transform-origin: 0 0; pointer-events: none; }
.thumb-stage .slide { opacity: 1; visibility: visible; transition: none; }
.thumb-stage .hl { opacity: 1; transition: none; }

/* Ayuda */
#help {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 12, 14, .7);
}
body.help-open #help { display: flex; }
#help .box {
  background: #fff;
  color: #1d2227;
  border-radius: 14px;
  padding: 28px 36px;
  font: 17px/1.5 var(--font);
  max-width: 760px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
}
#help h3 { margin: 0 0 12px; font-size: 24px; }
#help table { border-collapse: collapse; }
#help td { padding: 3px 18px 3px 0; vertical-align: top; }
#help kbd {
  display: inline-block;
  min-width: 18px;
  padding: 1px 7px;
  border: 1px solid #b9c1c9;
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #f4f6f8;
  font: 600 14px/1.5 var(--mono);
  text-align: center;
}

/* ==========================================================================
   Modo presentador (index.html?presentador)
   ========================================================================== */
body.is-presenter { background: #15191d; color: #eef1f4; overflow: hidden; }
body.is-presenter #deck, body.is-presenter #ui, body.is-presenter #progress { display: none !important; }
#pv {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 2fr) minmax(0, 3fr);
  grid-template-areas: "bar bar" "cur next" "cur notes";
  gap: 14px;
  padding: 14px;
  box-sizing: border-box;
  font-family: var(--font);
}
#pv-cur-wrap { grid-area: cur; }
#pv-next-wrap { grid-area: next; }
#pv-notes-wrap { grid-area: notes; }
#pv-nav { grid-area: nav; display: none; }
#pv-bar {
  grid-area: bar;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-radius: 12px;
  background: #22282e;
}
#pv-bar .big { font: 700 44px/1 var(--font); font-variant-numeric: tabular-nums; }
#pv-bar .lbl { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: #9aa6b1; display: block; margin-bottom: 4px; }
#pv-bar .grp { display: flex; flex-direction: column; }
#pv-bar .sep { flex: 1; }
#pv-bar button {
  font: 600 16px/1 var(--font);
  padding: 11px 16px;
  border-radius: 9px;
  border: 1px solid #3c454e;
  background: #2d343b;
  color: #fff;
  cursor: pointer;
}
/* En tablets el «hover» se queda pegado tras tocar: solo con ratón */
@media (hover: hover) { #pv-bar button:hover { background: #38414a; } }
#pv-remaining.over { color: #ff6b6b; }
#pv-pace.ok { color: #5fe0a0; }
#pv-pace.late { color: #ffc65c; }
#pv-pace.very-late { color: #ff6b6b; }
#pv-black { color: #ffc65c; font-weight: 700; display: none; }
#pv-black.on { display: inline; }
.pv-col { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.pv-label { font-size: 14px; text-transform: uppercase; letter-spacing: .07em; color: #9aa6b1; }
.pv-label b { color: #fff; font-size: 18px; letter-spacing: 0; text-transform: none; }
.pv-box { flex: 1; min-height: 0; }
.pv-frame { position: relative; width: 100%; border-radius: 10px; overflow: hidden; background: #000; box-shadow: 0 0 0 2px #2f363d; }
#pv-next-wrap .pv-frame { opacity: .92; }
#pv-bar #pv-blk.on { background: #ffc65c; border-color: #ffc65c; color: #15191d; }
#pv-link { min-width: 0; }
#pv-link.ok { color: #5fe0a0; }
#pv-link.bad { color: #ff6b6b; border-color: #ff6b6b; }
#pv-link.wait, #pv-link.off { color: #b8c1ca; }
#pv-notes {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px 20px;
  border-radius: 12px;
  background: #22282e;
  font-size: 26px;
  line-height: 1.45;
}
#pv-notes p { margin: 0 0 14px; }
#pv-notes .time { font-size: 18px; color: #9aa6b1; margin-bottom: 10px; }
#pv-end { display: grid; place-items: center; height: 100%; color: #9aa6b1; font-size: 28px; }

/* ---------- Tablet (index.html?presentador abierto en la tablet) ---------- */
body.pv-touch #pv {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 3fr) minmax(0, 2fr) auto;
  grid-template-areas: "bar bar" "cur notes" "next notes" "nav nav";
  gap: 10px;
  padding: 10px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}
body.pv-touch #pv-bar { gap: 8px 16px; padding: 8px 12px; }
body.pv-touch #pv-bar .big { font-size: 26px; }
body.pv-touch #pv-bar .lbl { font-size: 11px; margin-bottom: 3px; }
body.pv-touch #pv-bar button { font-size: 16px; padding: 12px 14px; }
body.pv-touch #pv-bar .kb, body.pv-touch #pv-clock-grp { display: none; }
body.pv-touch .pv-col { gap: 6px; }
body.pv-touch .pv-label { font-size: 12px; }
body.pv-touch .pv-label b { font-size: 16px; }
body.pv-touch #pv-notes { font-size: 23px; padding: 12px 16px; -webkit-overflow-scrolling: touch; }
body.pv-touch #pv-notes .time { font-size: 15px; }
body.pv-touch #pv-nav { display: flex; gap: 10px; }
#pv-nav button, #pv-nav select {
  height: 68px;
  border-radius: 12px;
  border: 1px solid #3c454e;
  background: #2d343b;
  color: #fff;
  font: 600 22px/1 var(--font);
  touch-action: manipulation;
}
#pv-nprev { flex: 1; }
#pv-nnext { flex: 2; background: var(--green) !important; border-color: var(--green) !important; }
#pv-goto { flex: 1.2; min-width: 0; padding: 0 12px; font-size: 18px !important; }
#pv-nav button:active { filter: brightness(1.25); }
/* Tablet en vertical: actual y siguiente arriba, notas debajo */
@media (orientation: portrait) {
  body.pv-touch #pv {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    grid-template-areas: "bar bar" "cur next" "notes notes" "nav nav";
  }
  body.pv-touch .pv-box { flex: none; aspect-ratio: var(--pv-ratio, 16 / 9); }
}
/* Celular: solo la actual, las notas y los botones */
@media (max-width: 640px) {
  body.pv-touch #pv {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    grid-template-areas: "bar" "cur" "notes" "nav";
  }
  body.pv-touch #pv-next-wrap { display: none; }
  body.pv-touch .pv-box { flex: none; aspect-ratio: var(--pv-ratio, 16 / 9); }
  body.pv-touch #pv-bar .big { font-size: 22px; }
  body.pv-touch #pv-notes { font-size: 19px; }
  #pv-nav button, #pv-nav select { height: 56px; font-size: 18px; }
}

/* ---------- Puntero y lápiz (lienzo de 1920×1080) ---------- */
.ink { pointer-events: none; }
.ink path { fill: none; stroke: #e5262a; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
#ink { position: absolute; left: 0; top: 0; width: 1920px; height: var(--slide-h); z-index: 5; }
#laser {
  position: absolute;
  left: -18px;
  top: -18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 14%, #ff4b4b 30%, #e5262a 58%, rgba(229, 38, 42, 0) 72%);
  box-shadow: 0 0 26px 10px rgba(255, 40, 40, .45);
  opacity: 0;
  z-index: 6;
  pointer-events: none;
  transition: opacity .2s, transform .16s linear;
}
#laser.on { opacity: 1; }
@media (pointer: coarse) { #laser { transition: opacity .2s, transform .8s ease-out; } }
/* En tiempo real (VPS) el puntero llega hasta 40 veces por segundo: solo se suaviza el último tramo */
body.rt #laser { transition: opacity .2s, transform .05s linear; }

/* ---------- Proyector y celulares (/arq): solo pantalla completa ---------- */
body.is-screen #ui { padding: 4px; }
#rotate-tip { display: none; }
@media (orientation: portrait) and (pointer: coarse) {
  body.is-screen #ui { display: none; }
  body.is-screen #rotate-tip {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: max(20px, env(safe-area-inset-bottom));
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 18px 16px;
    border-radius: 16px;
    background: rgba(28, 33, 38, .92);
    color: #fff;
    font: 17px/1.35 var(--font);
    text-align: center;
  }
  body.is-screen.black #rotate-tip { display: none; }
}
#rotate-tip p { margin: 0; }
#rotate-tip .ico svg { width: 44px; height: 44px; fill: #5fe0a0; animation: tip-rotate 2.4s ease-in-out infinite; }
@keyframes tip-rotate { 0%, 30% { transform: rotate(0); } 55%, 100% { transform: rotate(-90deg); } }
#rotate-tip button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  font: 600 17px/1 var(--font);
}
#rotate-tip button svg { width: 22px; height: 22px; fill: currentColor; }

/* ---------- Tablet: espectadores, señalar y escribir ---------- */
#pv-viewers { color: #5fe0a0; }
.pv-box { position: relative; }
#pv-surface { position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; border-radius: 10px; overflow: hidden; }
#pv-surface .ink { position: absolute; inset: 0; width: 100%; height: 100%; }
#pv-dot {
  position: absolute;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  background: #e5262a;
  box-shadow: 0 0 12px 4px rgba(255, 40, 40, .5);
  display: none;
}
#pv-dot.on { display: block; }
#pv-nav .tool { display: none; }
body.pv-annot #pv-nav .tool { display: block; flex: 1; }
body.pv-annot #pv-nav .tool.sel { background: #e5262a; border-color: #e5262a; }
body.pv-annot #pv-annot, body.pv-annot #pv-goto, body.pv-annot #pv-nav .long { display: none; }
body.pv-annot #pv-nprev { flex: .6; }
body.pv-annot #pv-nnext { flex: .8; }
#pv-annot { flex: 1; }
/* Al señalar, la diapositiva actual ocupa casi toda la pantalla */
body.pv-annot #pv {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  grid-template-areas: "bar" "cur" "nav" !important;
}
body.pv-annot #pv-next-wrap, body.pv-annot #pv-notes-wrap { display: none; }
body.pv-annot #pv-cur-wrap .pv-box { flex: 1 !important; aspect-ratio: auto !important; display: flex; justify-content: center; }
body.pv-annot #pv-surface { pointer-events: auto; touch-action: none; cursor: crosshair; box-shadow: 0 0 0 3px #e5262a; }
/* En la tablet, la pantalla negra se ve en el botón (amarillo): el aviso de texto haría crecer la barra */
body.pv-touch #pv-black.on { display: none; }
/* Aro del borrador */
#pv-eraser {
  position: absolute;
  display: none;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .55), inset 0 0 0 2px rgba(0, 0, 0, .35);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
#pv-eraser.on { display: block; }
/* Siete botones al señalar: un poco más compactos */
body.pv-annot #pv-nav { gap: 8px; }
body.pv-annot #pv-nav button { font-size: 19px; padding: 0 6px; }
@media (max-width: 900px) { body.pv-annot #pv-nav button { font-size: 16px; } }
/* El botón «Lápiz» muestra el color actual */
#pv-nav [data-tool="lapiz"] { box-shadow: inset 0 -7px 0 var(--pen, #e5262a); }

/* Colores del lápiz (encima de la diapositiva, al señalar) */
#pv-colors { display: none; }
body.pv-annot #pv-cur-wrap .pv-label { display: flex; align-items: center; gap: 12px; min-height: 46px; }
body.pv-annot #pv-colors { display: flex; align-items: center; gap: 12px; margin-left: auto; }
#pv-colors .sw {
  position: relative;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 3px solid #15191d;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #4a545e;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .12s;
}
#pv-colors .sw.sel { box-shadow: 0 0 0 3px #fff; transform: scale(1.15); }
/* Otro color: aro de arcoíris; adentro, el color elegido (o un «+») */
#pv-colors .custom { background: conic-gradient(#e5262a, #ff8c00, #f5d000, #00a650, #1e6ff2, #8e44ad, #e5262a); overflow: hidden; }
#pv-colors .custom span { position: absolute; inset: 7px; border-radius: 50%; background: #15191d; display: grid; place-items: center; }
#pv-colors .custom span::after { content: "+"; color: #fff; font: 700 18px/1 var(--font); }
#pv-colors .custom.set span::after { content: ""; }
#pv-colors .custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; cursor: pointer; }

/* Clave para controlar la presentación */
#pin {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 12, 14, .82);
  font-family: var(--font);
}
body.pin-open #pin { display: flex; }
#pin .box {
  width: 100%;
  max-width: 460px;
  box-sizing: border-box;
  padding: 28px;
  border-radius: 16px;
  background: #22282e;
  color: #eef1f4;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
#pin h3 { margin: 0 0 8px; font-size: 26px; }
#pin p { margin: 0 0 16px; font-size: 17px; line-height: 1.45; color: #c3cbd2; }
#pin input {
  width: 100%;
  box-sizing: border-box;
  height: 60px;
  padding: 0 16px;
  border-radius: 10px;
  border: 2px solid #3c454e;
  background: #15191d;
  color: #fff;
  font: 600 30px/1 var(--mono);
  letter-spacing: .3em;
  text-align: center;
}
#pin input:focus { outline: none; border-color: var(--green); }
#pin-msg { min-height: 1.45em; margin: 10px 0 14px !important; }
#pin-msg.err { color: #ff8a8a !important; }
#pin .row { display: flex; gap: 10px; flex-wrap: wrap; }
#pin button {
  flex: 1;
  height: 52px;
  border-radius: 10px;
  border: 1px solid #3c454e;
  background: #2d343b;
  color: #fff;
  font: 600 17px/1 var(--font);
  cursor: pointer;
}
#pin button.pri { background: var(--green); border-color: var(--green); }

@media (prefers-reduced-motion: reduce) {
  .slide, .slide.active, .hl, #progress { transition: none !important; }
}
