/* ============================================================
   styles.css — Números Complejos · minimalista + diapositivas
   UI monocroma; el color se reserva para la matemática.
   ============================================================ */

:root {
  --ink: #1b1b1c;
  --ink-soft: #55585f;
  --muted: #9498a1;
  --line: #ececea;
  --line-soft: #f3f3f1;
  --paper: #ffffff;
  --bg: #fbfbf9;          /* off-white cálido */
  --accent: #1b1b1c;      /* la UI es monocroma */

  /* colores con significado matemático */
  --z: #e5484d;
  --w: #2f6df0;
  --result: #11998e;
  --alpha: #8a3ffc;
  --angle: #e8a33d;

  --ok: #11998e;
  --bad: #e5484d;

  --head-h: 64px;
  --maxw: 1120px;
  --radius: 14px;
}

* { box-sizing: border-box; }
/* Tamaño base fijo (prolijo). Lo importante se agranda con valores deliberados,
   no escalando toda la página con el ancho. Subí/bajá este número al gusto. */
html { font-size: 21px; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}
/* Las páginas con diapositivas se fijan a la pantalla (las slides scrollean por
   dentro). La portada y la página de votar scrollean normalmente. */
body:has(.deck) { height: 100dvh; overflow: hidden; }
.deck { min-height: 0; }

a { color: var(--ink); text-underline-offset: 2px; }

/* ---------------- Header / tabs ---------------- */
.site-header {
  flex: none;
  height: var(--head-h);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0 1.4rem;
  background: rgba(251, 251, 249, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  z-index: 50;
}
.brand { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; color: var(--ink); }
.brand-mark { font-family: Georgia, serif; font-size: 1.3rem; font-weight: 700; }
.brand-text { font-weight: 650; font-size: 0.95rem; letter-spacing: -0.01em; }
@media (max-width: 560px) { .brand-text { display: none; } }

.site-nav { display: flex; gap: 0.25rem; margin-left: auto; flex-wrap: wrap; }
.site-nav a {
  display: inline-flex; align-items: center; gap: 0.4rem;
  text-decoration: none; color: var(--ink-soft);
  font-size: 0.85rem; padding: 0.32rem 0.7rem; border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}
.site-nav a:hover { background: #f0f0ee; color: var(--ink); }
.site-nav a.active { background: var(--ink); color: #fff; }
.site-nav .nn { font-family: Georgia, serif; font-style: italic; opacity: 0.6; }
.site-nav a.active .nn { opacity: 0.85; }
@media (max-width: 720px) { .site-nav .tt { display: none; } .site-nav a { padding: 0.32rem 0.6rem; } }

/* ---------------- Deck / slides ---------------- */
.deck-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: var(--ink); z-index: 60; transition: width 0.35s ease;
}

.deck { position: relative; flex: 1; overflow: hidden; }

.slide {
  position: absolute; inset: 0;
  display: flex;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}
.slide.active { opacity: 1; transform: none; pointer-events: auto; }

.slide-inner {
  margin: auto;
  width: 100%;
  max-width: var(--maxw);
  padding: 4vh 2.2rem 112px;   /* espacio inferior para la barra de nav */
}

/* Formato presentación: las slides con título (h2) ponen el header arriba y el
   contenido debajo (no centrado verticalmente). El resto queda centrado. */
.slide:has(h2) { align-items: flex-start; }
.slide:has(h2) .slide-inner { margin: 0 auto; padding-top: 5vh; }

/* tipografía de slide */
.kicker {
  font-size: 0.85rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin-bottom: 0.8rem;
}
.slide h1 { font-size: 2.8rem; line-height: 1.1; margin: 0 0 0.6rem; letter-spacing: -0.02em; font-weight: 700; }
/* h2 = header de la diapositiva */
.slide h2 {
  font-size: 2.4rem; line-height: 1.12; font-weight: 700; letter-spacing: -0.02em;
  margin: 0 0 1.6rem; padding-bottom: 0.7rem; border-bottom: 2px solid var(--line);
}
.slide h2 .muted { font-weight: 600; }
.slide .lead { font-size: 1.55rem; color: var(--ink-soft); margin: 0 0 1.2rem; line-height: 1.5; }
.slide p { margin: 1rem 0; font-size: 1.4rem; line-height: 1.65; }
.slide ul, .slide ol { padding-left: 1.6rem; color: var(--ink-soft); font-size: 1.4rem; }
.slide li { margin: 0.55rem 0; line-height: 1.6; }
.muted { color: var(--muted); }
strong { font-weight: 650; color: var(--ink); }

/* slide de SIMULADOR: el widget es el protagonista, centrado y a lo ancho */
.slide.sim .slide-inner { display: flex; align-items: center; max-width: 1340px; }
.slide.sim .widget { margin: 0; width: 100%; }

/* slide de portada de sección (centrada, grande) */
.slide.title .slide-inner { text-align: center; max-width: 700px; }
.slide.title h1 { font-size: 3.6rem; }
.slide.title .lead { font-size: 1.6rem; }
.big-eq { font-size: 2rem; margin: 1.8rem 0; }

/* nota / definición: minimal, sólo una línea de acento */
.note {
  border-left: 3px solid var(--ink);
  padding: 0.3rem 0 0.3rem 1.1rem;
  margin: 1.3rem 0;
  color: var(--ink-soft);
  font-size: 1.35rem;
  line-height: 1.6;
}
.note .tag {
  display: block; font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin-bottom: 0.3rem;
}
.note.accent { border-color: var(--alpha); }

/* ---------------- Barra de navegación del deck ---------------- */
.deck-nav {
  position: absolute; bottom: 0; left: 0; right: 0; height: 80px;
  display: flex; align-items: center; justify-content: center; gap: 1.2rem;
  background: linear-gradient(180deg, rgba(251,251,249,0), var(--bg) 55%);
  z-index: 20;
}
.deck-btn {
  width: 50px; height: 50px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  font-size: 1.6rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
  transition: border-color 0.15s, background 0.15s, opacity 0.15s;
}
.deck-btn:hover { border-color: var(--ink); }
.deck-btn:disabled { opacity: 0.3; cursor: default; }
.deck-dots { display: flex; gap: 0.55rem; align-items: center; }
.deck-dot {
  width: 12px; height: 12px; border-radius: 999px; border: none; padding: 0;
  background: #d4d4d0; cursor: pointer; transition: transform 0.15s, background 0.15s;
}
.deck-dot:hover { background: var(--muted); }
.deck-dot.active { background: var(--ink); transform: scale(1.4); }
.deck-counter { font-size: 0.95rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 3.4em; text-align: center; }

/* ---------------- Widgets ---------------- */
.widget {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 1.2rem 0;
  overflow: hidden;
}
.widget-head {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 1rem; border-bottom: 1px solid var(--line-soft);
}
.widget-head .ico { font-size: 1rem; opacity: 0.85; }
.widget-head h4 { margin: 0; font-size: 0.9rem; font-weight: 600; }
.widget-head .hint { font-size: 0.74rem; color: var(--muted); }
.widget-head-right { margin-left: auto; display: flex; align-items: center; gap: 0.7rem; }
.widget-fs {
  border: 1px solid var(--line); background: var(--paper); color: var(--ink-soft);
  width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.widget-fs:hover { border-color: var(--ink); color: var(--ink); }
.widget-body { padding: 1rem; }
.widget-canvas-wrap { display: grid; grid-template-columns: 1.55fr 1fr; gap: 1.2rem; align-items: start; }
@media (max-width: 640px) { .widget-canvas-wrap { grid-template-columns: 1fr; } }

canvas.plane {
  width: 100%; max-width: 76vh; aspect-ratio: 1 / 1; background: var(--paper);
  border-radius: 8px; border: 1px solid var(--line-soft);
  touch-action: none; display: block; justify-self: center;
}

/* ---- Simulador con panel flotante (slides .sim y pantalla completa) ---- */
.widget.float .widget-body { padding: 0; position: relative; }
.widget.float .widget-canvas-wrap { display: block; }
.widget.float canvas.plane {
  width: 100%; height: 76vh; max-width: none; aspect-ratio: auto;
  border: none; border-radius: 0 0 14px 14px;
}
.float-panel-base, .widget.float .side, .widget.float .legend {
  background: rgba(255, 255, 255, 0.94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 34px rgba(20, 20, 30, 0.16);
}
.widget.float .side {
  position: absolute; top: 1rem; right: 1rem; width: 360px; max-width: 42%;
  max-height: calc(100% - 2rem); overflow-y: auto; padding: 0.9rem 1rem;
}
.widget.float .legend {
  position: absolute; left: 1rem; bottom: 1rem; margin: 0; padding: 0.5rem 0.85rem;
  border-radius: 10px;
}
.widget.float .controls, .widget.float .readout { border: none; background: transparent; padding: 0; }
.widget.float .controls:not(:empty) { border-bottom: 1px solid var(--line-soft); padding-bottom: 0.7rem; }

/* Panel flotante compacto y prolijo (la legibilidad fina del valor importa menos que el orden) */
.widget.float .side { width: 300px; padding: 0.8rem 0.9rem; gap: 0.7rem; }
.widget.float .side::-webkit-scrollbar { width: 8px; }
.widget.float .side::-webkit-scrollbar-thumb { background: #d6d8de; border-radius: 8px; }
.widget.float .readout { font-size: 0.88rem; }
.widget.float .readout .row { padding: 0.32rem 0; gap: 0.7rem; }
.widget.float .readout .k { font-size: 0.84rem; }
.widget.float .readout .v { font-size: 1rem; }
.widget.float .readout .v .katex { font-size: 0.95em; }
.widget.float .controls .slider label { font-size: 0.82rem; }
.widget.float .controls .slider { margin: 0.45rem 0; }
.widget.float .param-input { margin: 0.1rem 0 0.55rem; }
.widget.float .param-input label, .widget.float .param-field { font-size: 0.95rem; }
.widget.float .controls .btn { font-size: 0.8rem; padding: 0.35rem 0.6rem; }
.widget.float .controls::before, .widget.float .readout::before { font-size: 0.66rem; margin-bottom: 0.4rem; }

/* Pantalla completa real: el cuerpo llena la pantalla */
.widget:fullscreen { background: var(--bg); border: none; border-radius: 0; display: flex; flex-direction: column; }
.widget:fullscreen .widget-body { flex: 1; min-height: 0; }
.widget:fullscreen canvas.plane { height: 100%; border-radius: 0; }

@media (max-width: 680px) {
  .widget.float .widget-body { position: static; }
  .widget.float .widget-canvas-wrap { display: grid; }
  .widget.float .side, .widget.float .legend { position: static; width: auto; max-width: none; max-height: none; backdrop-filter: none; box-shadow: none; }
  .widget.float canvas.plane { height: auto; aspect-ratio: 1/1; }
}

/* Panel lateral del simulador: tarjetas "Controles" y "Valores" */
.side { display: flex; flex-direction: column; gap: 1rem; }
.controls:not(:empty), .readout:not(:empty) {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 1rem 0.85rem;
  background: #fcfcfb;
}
.controls:not(:empty)::before,
.readout:not(:empty)::before {
  display: block; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  font-weight: 700; color: var(--muted); margin-bottom: 0.55rem;
}
.controls:not(:empty)::before { content: "Controles"; }
.readout:not(:empty)::before { content: "Valores"; }

.readout { font-size: 1rem; }
.readout .row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 0.5rem 0; border-bottom: 1px solid var(--line-soft);
}
.readout .row:last-child { border-bottom: none; }
.readout .k { color: var(--ink-soft); font-size: 0.95rem; flex: 0 1 auto; }
.readout .v { font-weight: 650; font-size: 1.2rem; text-align: right; }
.readout .v.z { color: var(--z); }
.readout .v.w { color: var(--w); }
.readout .v.r { color: var(--result); }
.readout .v.a { color: var(--alpha); }
/* primer slider/botón sin margen superior dentro de la tarjeta */
.controls > :first-child { margin-top: 0; }
.slider { margin: 0.6rem 0; }
.slider label { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--ink-soft); margin-bottom: 0.15rem; }
.slider-label { font-weight: 600; }
.slider-val { font-family: ui-monospace, monospace; color: var(--ink); }
.slider input[type=range] {
  width: 100%; height: 8px; -webkit-appearance: none; appearance: none;
  background: var(--line); border-radius: 999px; outline: none;
}
.slider input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 24px; height: 24px;
  border-radius: 999px; background: var(--ink); cursor: pointer; border: 3px solid var(--paper); box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.slider input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 999px; background: var(--ink); cursor: pointer; border: 3px solid var(--paper); }
.slider-val.editable { cursor: pointer; padding: 0 0.2rem; border-radius: 5px; }
.slider-val.editable:hover { background: #eef0f4; text-decoration: underline dotted; }
.slider-edit { width: 5.5em; border: 1px solid var(--ink); border-radius: 6px; padding: 0.05rem 0.35rem; font-size: 0.95rem; font-family: ui-monospace, monospace; text-align: right; }
.slider-edit:focus { outline: none; }

/* campo de texto para editar un punto a mano */
.param-input { display: flex; align-items: center; gap: 0.6rem; margin: 0.2rem 0 0.7rem; }
.param-input label { font-size: 1rem; font-weight: 650; color: var(--ink-soft); white-space: nowrap; }
.param-field {
  flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 8px;
  padding: 0.45rem 0.6rem; font-size: 1.1rem; font-family: ui-monospace, monospace; color: var(--ink);
}
.param-field:focus { outline: none; border-color: var(--ink); }

.btn {
  border: 1px solid var(--ink); background: var(--ink); color: #fff;
  border-radius: 8px; padding: 0.4rem 0.8rem; font-size: 0.85rem; cursor: pointer;
  transition: opacity 0.15s; font-family: inherit;
}
.btn:hover { opacity: 0.85; }
.btn.ghost { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); opacity: 1; }
.btn-row { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.7rem; }

.legend { display: flex; gap: 0.9rem; flex-wrap: wrap; font-size: 0.78rem; margin-top: 0.7rem; color: var(--ink-soft); }
.legend:empty { display: none; }
.legend .dot { display: inline-block; width: 0.65rem; height: 0.65rem; border-radius: 50%; margin-right: 0.3rem; vertical-align: middle; }

/* ---------------- Chequeo de conocimiento (minimal) ---------------- */
.quiz {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem; margin: 1.2rem 0; background: var(--paper);
}
.quiz::before {
  content: "Chequeo de conocimiento";
  display: block; font-size: 0.82rem; letter-spacing: 0.1em; text-transform: uppercase;
  font-weight: 600; color: var(--muted); margin-bottom: 0.7rem;
}
.quiz-q { font-weight: 600; margin-bottom: 1rem; font-size: 1.35rem; line-height: 1.5; }
.quiz-opts { display: grid; gap: 0.5rem; }
.quiz-opt {
  text-align: left; border: 1px solid var(--line); background: var(--paper);
  border-radius: 8px; padding: 0.7rem 1rem; cursor: pointer; font-size: 1.15rem;
  transition: border-color 0.12s, background 0.12s; font-family: inherit; color: var(--ink);
}
.quiz-opt:hover { border-color: var(--ink); }
.quiz-opt.ok { border-color: var(--ok); background: #f0faf8; }
/* "todavía no": ámbar suave y amable, sin rojo de rechazo */
.quiz-opt.try { border-color: #e3b341; background: #fffaf0; }
.quiz-feedback { margin-top: 0.75rem; font-size: 1.1rem; line-height: 1.5; }
.quiz-feedback.ok { color: var(--ok); }
.quiz-feedback.hint { color: #9a6a00; }

/* "Para pensar": ejercicio más difícil con pista/solución revelables */
.challenge {
  border: 1px solid #d6deef; background: linear-gradient(180deg, #f7f9fe, #f1f5fc);
  border-radius: var(--radius); padding: 1.1rem 1.2rem; margin: 1.2rem 0;
}
.challenge::before {
  content: "Para pensar"; display: block; font-size: 0.82rem; letter-spacing: 0.1em;
  text-transform: uppercase; font-weight: 700; color: var(--w); margin-bottom: 0.6rem;
}
.challenge-q { font-weight: 600; margin-bottom: 1rem; font-size: 1.35rem; line-height: 1.5; }
.challenge-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.challenge .reveal {
  margin-top: 0.9rem; padding: 0.9rem 1.1rem; background: #fff;
  border-left: 3px solid var(--w); border-radius: 0 10px 10px 0; font-size: 1.15rem; line-height: 1.75;
}
.challenge .reveal[hidden] { display: none; }
.quiz-input-row { display: flex; gap: 0.5rem; }
.quiz-input { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem 0.7rem; font-family: ui-monospace, monospace; }

/* ---------------- Portada (index) ---------------- */
/* portada: una sola pantalla, centrada vertical, sin scroll en laptop */
.home {
  min-height: 100vh; max-width: 880px; margin: 0 auto;
  padding: clamp(1.2rem, 4vh, 3rem) 1.5rem;
  display: flex; flex-direction: column; justify-content: center;
  gap: clamp(1.1rem, 3.5vh, 2.2rem);
}
.hero { text-align: center; }
.hero .brand-mark { font-family: Georgia, serif; font-size: 2rem; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); line-height: 1.05; margin: 0.5rem 0 0.5rem; letter-spacing: -0.03em; }
.hero .lead { font-size: clamp(1rem, 2vw, 1.2rem); color: var(--ink-soft); max-width: 36rem; margin: 0 auto; }

/* figura estática del triángulo rectángulo (justificación del arcotangente) */
.trig-fig { margin: 0.6rem auto; max-width: 280px; text-align: center; }
.trig-fig svg { width: 100%; height: auto; display: block; }
.trig-fig figcaption { font-size: 0.92rem; color: var(--ink-soft); margin-top: 0.5rem; line-height: 1.45; }

.toc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.7rem; }
.toc-card {
  display: flex; align-items: baseline; gap: 0.9rem; text-decoration: none; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem;
  background: var(--paper); transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.toc-card:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(20,20,30,0.07); }
.toc-card .num { font-family: Georgia, serif; font-style: italic; font-size: 1.5rem; color: var(--muted); min-width: 2.4rem; }
.toc-card h3 { margin: 0 0 0.15rem; font-size: 1.02rem; }
.toc-card p { margin: 0; font-size: 0.85rem; color: var(--ink-soft); line-height: 1.4; }
.toc-card.soon { grid-column: 1 / -1; opacity: 0.6; background: transparent; }
.toc-card.soon:hover { border-color: var(--line); transform: none; box-shadow: none; }
.pill { display:inline-block; font-size:0.65rem; letter-spacing:0.08em; text-transform:uppercase; background:#f0f0ee; color:var(--muted); padding:0.12rem 0.5rem; border-radius:999px; margin-left:0.4rem; vertical-align: middle; }
.credit { font-size: 0.78rem; color: var(--muted); text-align: center; }

@media (max-width: 560px) { .toc-grid { grid-template-columns: 1fr; } }

/* ---------------- Votación en vivo (profe) ---------------- */
.live-fab {
  position: fixed; bottom: 14px; left: 14px; z-index: 45;
  display: inline-flex; align-items: center; gap: 0.5rem;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  border-radius: 999px; padding: 0.5rem 0.9rem; font-size: 0.82rem; font-family: inherit;
  cursor: pointer; box-shadow: 0 2px 10px rgba(20,20,30,0.08); transition: border-color 0.15s;
}
.live-fab:hover { border-color: var(--ink); }
.live-fab.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.live-dot { width: 9px; height: 9px; border-radius: 999px; background: var(--muted); display: inline-block; }
.live-dot.on { background: #e5484d; box-shadow: 0 0 0 0 rgba(229,72,77,0.6); animation: livepulse 1.6s infinite; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(229,72,77,0.5); } 70% { box-shadow: 0 0 0 7px rgba(229,72,77,0); } 100% { box-shadow: 0 0 0 0 rgba(229,72,77,0); } }

/* pastilla mínima en la esquina: solo el código de sala, discreta y clickeable */
.live-bar {
  position: fixed; bottom: 64px; left: 14px; z-index: 44;
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  box-shadow: 0 2px 10px rgba(20,20,30,0.08);
  padding: 0.28rem 0.7rem; cursor: pointer; opacity: 0.7;
  font-size: 0.8rem; color: var(--ink-soft); white-space: nowrap;
  transition: opacity 0.15s;
}
.live-bar:hover { opacity: 1; }
.live-bar strong { font-family: ui-monospace, monospace; font-size: 0.95rem; letter-spacing: 0.12em; color: var(--ink); }
.live-pill-k { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.68rem; color: var(--muted); }
.live-qr-fail { font-size: 0.72rem; color: var(--muted); padding: 1rem; }

/* overlay a pantalla completa con el QR grande */
.live-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(15,15,22,0.86); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
}
.live-overlay[hidden] { display: none; }
.live-overlay-inner {
  background: var(--paper); border-radius: 20px; padding: 2.2rem 2.6rem;
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1rem;
  box-shadow: 0 20px 70px rgba(0,0,0,0.4); max-width: 92vw;
}
.live-overlay-kicker { font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 0; }
.live-overlay-qr { display: block; border-radius: 10px; max-width: 100%; height: auto; }
.live-overlay-code { font-size: 1.4rem; }
.live-overlay-code strong { font-family: ui-monospace, monospace; font-size: 2.4rem; letter-spacing: 0.2em; display: block; margin-top: 0.2rem; }
.live-overlay-hint { font-size: 1rem; color: var(--ink-soft); margin: 0; }
.live-overlay-hint a { font-weight: 600; }
.live-overlay-close {
  position: fixed; top: 18px; right: 24px; border: none; background: none;
  font-size: 2.4rem; line-height: 1; color: #fff; cursor: pointer; opacity: 0.85;
}
.live-overlay-close:hover { opacity: 1; }

/* ---------------- Panel de votación dentro del quiz ---------------- */
.poll { display: none; margin-top: 1rem; padding-top: 0.9rem; border-top: 1px dashed var(--line); }
.poll.ready { display: block; }
.poll-head { display: flex; align-items: center; gap: 0.5rem; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 0.6rem; }
.poll-title { font-weight: 600; }
.poll-status { color: var(--ink-soft); text-transform: none; letter-spacing: 0; font-size: 0.78rem; }
.poll-timer { text-transform: none; letter-spacing: 0; font-variant-numeric: tabular-nums; color: var(--ink-soft); font-weight: 600; }
.poll-timer[hidden] { display: none; }
.poll-total { margin-left: auto; text-transform: none; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.poll-actions { display: flex; gap: 0.5rem; margin-top: 0.7rem; }
.poll.live-active { }

.bar-row { display: flex; align-items: center; gap: 0.6rem; margin: 0.35rem 0; }
.bar-key { font-family: ui-monospace, monospace; font-weight: 700; width: 1.2rem; text-align: center; color: var(--ink-soft); }
.bar-track { flex: 1; height: 32px; background: #f1f1ef; border-radius: 7px; overflow: hidden; }
.poll-secret { text-align: center; color: var(--ink-soft); padding: 0.8rem; font-size: 1.05rem; }
.poll-secret small { color: var(--muted); font-size: 0.8em; }
.bar-fill { height: 100%; width: 0; background: var(--ink); border-radius: 6px; transition: width 0.4s ease; }
.bar-n { width: 2rem; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 0.9rem; }
/* la barra MÁS votada se resalta en neutro (NO indica si es la correcta) */
.bar-row.top .bar-fill { background: var(--ink); }
.bar-row.top .bar-key { font-weight: 700; }
.bar-row:not(.top) { opacity: 0.72; }

/* ---------------- Página del alumno (votar.html) ---------------- */
.student-body { display: block; background: var(--bg); }
#app { max-width: 460px; margin: 0 auto; padding: 1.2rem; min-height: 100dvh; display: flex; align-items: center; }
.st-card { width: 100%; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 1.4rem; box-shadow: var(--shadow, 0 4px 18px rgba(20,20,30,0.06)); }
.st-join { text-align: center; }
.st-mark { font-family: Georgia, serif; font-size: 2.4rem; color: var(--ink); }
.st-card h1 { font-size: 1.7rem; margin: 0.3rem 0; }
.st-sub { color: var(--ink-soft); font-size: 0.95rem; margin: 0.4rem 0 1rem; }
.st-input { width: 100%; font-size: 2rem; text-align: center; letter-spacing: 0.4em; text-transform: uppercase; font-family: ui-monospace, monospace; border: 2px solid var(--line); border-radius: 12px; padding: 0.6rem; margin-bottom: 0.9rem; }
.st-input:focus { outline: none; border-color: var(--ink); }
.st-big { width: 100%; border: none; background: var(--ink); color: #fff; font-size: 1.1rem; padding: 0.9rem; border-radius: 12px; cursor: pointer; font-family: inherit; }
.st-room { font-size: 0.95rem; color: var(--ink-soft); margin-bottom: 1rem; }
.st-room strong { font-family: ui-monospace, monospace; letter-spacing: 0.15em; }
.st-room.small { font-size: 0.78rem; color: var(--muted); margin-bottom: 0.7rem; }
.st-wait { text-align: center; }
.st-spinner { width: 34px; height: 34px; margin: 1rem auto; border: 3px solid var(--line); border-top-color: var(--ink); border-radius: 999px; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* aviso de reconexión (aparece solo cuando se cae el enlace) */
.st-conn {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  background: #b4541e; color: #fff; text-align: center;
  font-size: 0.82rem; font-weight: 600; padding: 0.4rem;
  transform: translateY(-100%); transition: transform 0.2s;
}
.st-conn.show { transform: translateY(0); }
.st-q { font-size: 1.25rem; font-weight: 650; margin-bottom: 1rem; line-height: 1.4; }
.st-opts { display: grid; gap: 0.6rem; }
.st-opt {
  display: flex; align-items: center; gap: 0.8rem; text-align: left;
  border: 2px solid var(--line); background: var(--paper); border-radius: 14px;
  padding: 1rem; font-size: 1.05rem; cursor: pointer; font-family: inherit; color: var(--ink);
  transition: border-color 0.12s, background 0.12s, transform 0.08s;
}
.st-opt:active { transform: scale(0.985); }
.st-opt .st-key { font-family: ui-monospace, monospace; font-weight: 700; width: 1.7rem; height: 1.7rem; display: grid; place-items: center; border-radius: 8px; background: #f1f1ef; color: var(--ink-soft); flex: none; }
.st-opt.sel { border-color: var(--ink); background: #f6f6f4; }
.st-opt.sel .st-key { background: var(--ink); color: #fff; }
.st-opt.ok { border-color: var(--ok); background: #f0faf8; }
.st-opt.ok .st-key { background: var(--ok); color: #fff; }
.st-opt.mine { border-color: var(--muted); background: #f4f4f2; }
.st-opt.mine .st-key { background: var(--muted); color: #fff; }
.st-opt:disabled { cursor: default; }
.st-hint { font-size: 0.9rem; color: var(--ink-soft); margin-top: 1rem; text-align: center; }

/* KaTeX */
.katex { font-size: 1.04em; }
.katex-display { margin: 1rem 0; overflow-x: auto; overflow-y: hidden; }
