/* badabadoo · estilos (sin dependencias) */
:root {
  --ink: #1d1640; --ink2: #4a4370; --ink3: #8a84a8;
  --paper: #fff8ef; --card: #ffffff; --line: #ece2d3; --soft: #f6eee2;
  --coral: #ff5a5f; --sky: #2f80ed; --sun: #ffb400; --mint: #00b894;
  --grape: #8e44ef; --pink: #ff5fb4; --teal: #0fb5c9; --lime: #5fae2e;
  --ok: #00b894; --bad: #ff5a5f;
  --r: 14px; --r-lg: 22px;
  --shadow: 0 2px 0 rgba(29,22,64,.08), 0 10px 30px -12px rgba(29,22,64,.25);
  --font: "Baloo 2", ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.45; color: var(--ink); background: var(--paper); min-height: 100vh; }
a { color: var(--sky); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.1; margin: 0 0 .4em; font-weight: 800; letter-spacing: -.01em; }
p { margin: 0 0 .8em; }
.muted { color: var(--ink3); }
.center { text-align: center; }
.right { text-align: right; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.eyebrow { text-transform: uppercase; font-size: .78rem; letter-spacing: .1em; font-weight: 700; color: var(--ink3); margin: 0 0 .3em; }
[hidden] { display: none !important; }

/* logo */
.logo { font-weight: 800; font-size: 1.7rem; letter-spacing: -.02em; line-height: 1; white-space: nowrap; }
.logo b { font-weight: 800; }
.logo b:nth-child(1) { color: var(--coral); } .logo b:nth-child(2) { color: var(--sun); }
.logo b:nth-child(3) { color: var(--mint); } .logo b:nth-child(4) { color: var(--grape); }
.logo-sm { font-size: 1.35rem; }
.brand:hover { text-decoration: none; }

/* botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; border: 0; border-radius: 999px; padding: .62em 1.3em; font: inherit; font-weight: 700; cursor: pointer;
  background: var(--ink); color: #fff; box-shadow: 0 3px 0 rgba(0,0,0,.25); transition: transform .08s, filter .15s; text-decoration: none; white-space: nowrap; }
.btn:hover { filter: brightness(1.15); text-decoration: none; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-sm { padding: .38em .9em; font-size: .92rem; }
.btn-lg { padding: .75em 1.5em; font-size: 1.1rem; }
.btn-xl { padding: .7em 1.6em; font-size: 1.35rem; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn-ghost:hover { background: var(--soft); filter: none; }
.btn-danger { color: var(--coral); }
.btn.btn-danger:not(.btn-ghost) { background: var(--coral); color: #fff; }
.confirm-inline { display: inline-flex; align-items: center; gap: .35em; font-weight: 700; font-size: .92rem; }

/* barra superior */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem clamp(16px, 3vw, 40px); border-bottom: 2px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 20; }
.topnav { display: flex; align-items: center; gap: clamp(.6rem, 2vw, 1.4rem); flex-wrap: wrap; justify-content: flex-end; }
.topnav a:not(.btn) { color: var(--ink); }
.topnav .who { color: var(--ink3); }

/* páginas */
.page { padding: clamp(16px, 3vw, 40px); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.page-head h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin: 0; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }
.card { background: var(--card); border-radius: var(--r-lg); padding: clamp(18px, 2.4vw, 28px); box-shadow: var(--shadow); }
.card h3 { font-size: 1.3rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 1.2rem; }
.empty { padding: 3rem 1rem; text-align: center; color: var(--ink2); border: 3px dashed var(--line); border-radius: var(--r-lg); }
.note { padding: .8rem 1.1rem; border-radius: var(--r); margin: 0 0 1rem; font-weight: 600; }
.note-error { background: #ffe9e9; color: #b3262b; }
.note-ok { background: #ddf7ef; color: #087a5f; }
.note-info { background: #e6f0ff; color: #1d5fbf; }
.note-warn { background: #fff3d6; color: #8a6100; }

/* formularios */
label { display: block; font-weight: 700; margin: 0 0 1rem; }
input, select, textarea { display: block; width: 100%; margin-top: .3rem; font: inherit; font-weight: 500; color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: var(--r); padding: .62em .85em; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 4px rgba(47,128,237,.15); }
input:disabled { background: var(--soft); color: var(--ink3); }
textarea { resize: vertical; }
label.check { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
label.check input { width: auto; margin: 0; }
.form-msg { color: var(--coral); font-weight: 700; min-height: 1.4em; margin-top: .6rem; }

/* inicio */
.home { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 4rem); padding: clamp(24px, 5vw, 70px) clamp(16px, 4vw, 60px); align-items: center; min-height: calc(100vh - 70px); }
.home-title { font-size: clamp(2.6rem, 6vw, 5rem); line-height: .95; letter-spacing: -.03em; }
.home-title span { color: var(--coral); }
.home-sub { font-size: 1.25rem; color: var(--ink2); max-width: 36ch; }
.pin-form { display: flex; gap: .7rem; flex-wrap: wrap; margin: 1.6rem 0; }
.pin-input { flex: 1 1 260px; max-width: 420px; margin: 0; font-size: 2rem; font-weight: 800; letter-spacing: .25em; text-align: center; padding: .4em .5em; border-width: 3px; border-radius: 18px; }
.pin-input::placeholder { letter-spacing: .02em; font-size: 1.2rem; font-weight: 600; color: var(--ink3); }
.home-host { color: var(--ink2); }
.home-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.tile { border-radius: var(--r-lg); padding: 1.2rem 1.3rem; color: #fff; display: flex; flex-direction: column; gap: .2rem; box-shadow: var(--shadow); transform: rotate(var(--rot, 0deg)); }
.tile:nth-child(odd) { --rot: -1.2deg; } .tile:nth-child(even) { --rot: 1deg; }
.tile b { font-size: 1.3rem; } .tile small { opacity: .92; font-size: .95rem; line-height: 1.3; }
.tile-ico { font-weight: 800; font-size: 1.5rem; line-height: 1; }
.t-quiz { background: var(--coral); } .t-truefalse { background: var(--sky); } .t-poll { background: var(--sun); }
.t-wordcloud { background: var(--mint); } .t-scale { background: var(--grape); } .t-qa { background: var(--pink); } .t-slide { background: var(--ink2); }
@media (max-width: 820px) { .home { grid-template-columns: 1fr; min-height: 0; } }

/* autenticación */
.auth { display: grid; grid-template-columns: 1fr minmax(0, 460px); gap: clamp(1.5rem, 5vw, 5rem); padding: clamp(24px, 6vw, 80px) clamp(16px, 5vw, 70px); align-items: center; }
.auth-side h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.auth-side p { font-size: 1.2rem; color: var(--ink2); max-width: 40ch; }
.auth-card h2 { font-size: 1.6rem; }
@media (max-width: 760px) { .auth { grid-template-columns: 1fr; } }

/* panel de actividades */
.live-strip { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.2rem; }
.chip { display: inline-flex; align-items: center; gap: .3em; padding: .35em .9em; border-radius: 999px; background: var(--soft); color: var(--ink); font-weight: 700; }
.chip-live { background: #ddf7ef; color: #087a5f; }
.act-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 1.1rem; }
.act-card { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.act-main { padding: 1.2rem 1.3rem .6rem; color: var(--ink); flex: 1; }
.act-main:hover { text-decoration: none; background: #fffdfa; }
.act-main h3 { font-size: 1.35rem; margin: .5rem 0 .2rem; }
.act-main p { font-size: .95rem; margin: 0; }
.act-strip { display: flex; gap: 4px; flex-wrap: wrap; }
.dot { width: 18px; height: 8px; border-radius: 4px; display: inline-block; }
.act-actions { display: flex; gap: .4rem; flex-wrap: wrap; padding: .8rem 1.3rem 1.1rem; }
.act-actions form { margin: 0; }

/* tablas y reportes */
.table-wrap { overflow-x: auto; background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .75rem 1rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink3); }
.table tr:last-child td { border-bottom: 0; }
.table td .btn { margin-left: .3rem; }
.badge { display: inline-block; padding: .15em .65em; border-radius: 999px; font-size: .85rem; font-weight: 700; background: var(--soft); }
.b-live, .b-lobby { background: #ddf7ef; color: #087a5f; } .b-ended { background: var(--soft); color: var(--ink2); }
.b-admin { background: #efe3ff; color: #6a2bc4; } .b-off { background: #ffe9e9; color: #b3262b; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.stat { background: var(--card); border-radius: var(--r-lg); padding: 1rem 1.3rem; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 2.2rem; line-height: 1; }
.stat span { color: var(--ink3); font-weight: 600; }
.rank-list { margin: 0; padding: 0; list-style: none; counter-reset: r; }
.rank-list li { counter-increment: r; display: flex; align-items: center; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.rank-list li::before { content: counter(r); width: 1.8em; font-weight: 800; color: var(--ink3); }
.rank-list .pts { margin-left: auto; font-weight: 800; }
.av { font-size: 1.3em; line-height: 1; }
.rep-item { padding: .9rem 0; border-bottom: 1px solid var(--line); }
.rep-item:last-child { border-bottom: 0; }
.rbar { position: relative; display: flex; justify-content: space-between; gap: 1rem; padding: .35rem .7rem; margin-top: .35rem; background: var(--soft); border-radius: 8px; overflow: hidden; font-size: .95rem; }
.rbar span { position: absolute; inset: 0 auto 0 0; background: rgba(47,128,237,.18); }
.rbar.ok span { background: rgba(0,184,148,.28); }
.rbar em, .rbar i { position: relative; font-style: normal; }
.rbar.ok em::after { content: ' ✓'; color: var(--ok); font-weight: 800; }
.words span { display: inline-block; margin: .2rem .3rem 0 0; padding: .1rem .55rem; background: var(--soft); border-radius: 999px; }
.words i, .qa-rep i { font-style: normal; color: var(--ink3); font-size: .85em; }
.qa-rep { margin: .4rem 0 0; padding-left: 1.2rem; }

/* toasts */
.toasts { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: .5rem; align-items: center; pointer-events: none; width: min(92vw, 520px); }
.toast { background: var(--ink); color: #fff; padding: .7rem 1.2rem; border-radius: 14px; font-weight: 700; box-shadow: 0 10px 30px -8px rgba(0,0,0,.4); opacity: 0; transform: translateY(10px); transition: all .25s; text-align: center; }
.toast.in { opacity: 1; transform: none; }
.toast-error { background: var(--coral); } .toast-ok { background: var(--mint); }
body.offline::after { content: 'Reconectando…'; position: fixed; top: 10px; left: 50%; transform: translateX(-50%); background: var(--sun); color: var(--ink); padding: .3rem 1rem; border-radius: 999px; font-weight: 800; z-index: 200; }

/* ===================================================================== editor */
.page-editor { background: var(--soft); }
.editor { padding: 0 clamp(12px, 2vw, 28px) 2rem; }
.ed-bar { display: flex; align-items: center; gap: .8rem; padding: 1rem 0; flex-wrap: wrap; position: sticky; top: 64px; z-index: 10; background: var(--soft); }
.ed-bar form { margin: 0; }
.ed-title { flex: 1 1 280px; margin: 0; font-size: 1.5rem; font-weight: 800; border-color: transparent; background: transparent; padding: .25em .4em; }
.ed-title:hover { border-color: var(--line); background: #fff; }
.ed-status { font-weight: 700; font-size: .9rem; color: var(--ink3); min-width: 9em; text-align: right; }
.ed-status.ok { color: var(--mint); } .ed-status.err { color: var(--coral); } .ed-status.pending { color: var(--sun); }
.ed-problems { background: #fff3d6; color: #6b4b00; border-radius: var(--r); padding: .8rem 1.2rem; margin-bottom: 1rem; }
.ed-problems ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.ed-body { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 1.4rem; align-items: start; }
.ed-list { display: flex; flex-direction: column; gap: .6rem; }
.ed-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.ed-item { background: #fff; border-radius: var(--r); padding: .6rem .7rem; cursor: pointer; border: 2px solid transparent; box-shadow: 0 1px 0 rgba(29,22,64,.06); transition: border-color .15s, box-shadow .15s; }
.ed-item:hover { box-shadow: 0 6px 18px -10px rgba(29,22,64,.35); }
.ed-item.on { border-color: var(--ink); }
.ed-item.drag { opacity: .4; }
.ed-row { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.ed-n { font-weight: 800; color: var(--ink3); width: 1.4em; text-align: center; flex: none; }
.ed-txt { flex: 1; min-width: 0; font-weight: 600; font-size: .95rem; line-height: 1.25; }
.ed-txt small { display: block; color: var(--ink3); font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-txt > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.ed-txt em { color: var(--ink3); }
.ed-thumb { flex: none; width: 44px; height: 32px; border-radius: 8px; background: var(--soft) center / cover no-repeat; }
.ed-tools { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .55rem; padding-top: .55rem; border-top: 1px solid var(--line); }
.ed-tools button { border: 0; background: var(--soft); border-radius: 999px; padding: .28rem .75rem; cursor: pointer; font: inherit; font-weight: 700; font-size: .82rem; color: var(--ink2); white-space: nowrap; }
.ed-tools button:hover:not(:disabled) { background: var(--line); color: var(--ink); }
.ed-tools button:disabled { opacity: .4; cursor: default; }
.ed-tools button.danger { margin-left: auto; color: var(--coral); }
.ed-tools button.ask { background: var(--coral); color: #fff; }
.ed-empty { color: var(--ink3); padding: 1.2rem; text-align: center; border: 2px dashed var(--line); border-radius: var(--r); }
.ed-settings { display: flex; align-items: center; gap: .65rem; width: 100%; text-align: left; background: #fff; border: 2px solid transparent; border-radius: var(--r); padding: .6rem .7rem; font: inherit; cursor: pointer; color: var(--ink); box-shadow: 0 1px 0 rgba(29,22,64,.06); }
.ed-settings.on { border-color: var(--ink); }
.set-ico { background: var(--ink); }
.ed-addmain { width: 100%; border: 2px dashed var(--ink3); background: transparent; color: var(--ink); border-radius: var(--r); padding: .8rem; font: inherit; font-weight: 800; font-size: 1.05rem; cursor: pointer; transition: background .15s, border-color .15s; }
.ed-addmain:hover { background: #fff; border-color: var(--ink); }
.ed-form { background: #fff; border-radius: var(--r-lg); padding: clamp(18px, 2.5vw, 32px); box-shadow: var(--shadow); min-height: 420px; }
.ef-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.4rem; }
.ef-head h2 { margin: 0; font-size: 1.6rem; }
.ef-head p.muted { margin: 0; }
.ef-fields { display: flex; flex-wrap: wrap; gap: 0 1.2rem; }
.ef-field { flex: 1 1 100%; margin-bottom: 1.2rem; }
.ef-field.half { flex-basis: calc(50% - .6rem); }
.ef-field.short { flex: 0 1 220px; }
.ef-field > label { margin-bottom: .3rem; }
.ef-field input[data-k="q"] { font-size: 1.35rem; font-weight: 700; }
.ef-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: .6rem; }
.ef-opts > .btn { justify-self: start; align-self: center; }
.ef-opt { display: flex; align-items: center; gap: .4rem; border-radius: var(--r); padding: .35rem; background: var(--c, var(--soft)); }
.ef-opt input { margin: 0; border: 0; background: rgba(255,255,255,.95); }
.ef-opt .ol { color: #fff; font-weight: 800; width: 1.8rem; text-align: center; flex: none; }
.ef-opt.is-ok { box-shadow: 0 0 0 3px var(--ok); }
.ok-tog, .ef-opt .rm { border: 0; border-radius: 10px; padding: .45rem .6rem; font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer; background: rgba(255,255,255,.3); color: #fff; white-space: nowrap; }
.ef-opt.is-ok .ok-tog { background: #fff; color: var(--ok); }
.seg { display: inline-flex; background: var(--soft); border-radius: 999px; padding: 4px; gap: 4px; margin-top: .3rem; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: .45em 1.1em; font: inherit; font-weight: 700; cursor: pointer; color: var(--ink2); white-space: nowrap; }
.seg button.on { background: var(--ink); color: #fff; }
@media (max-width: 860px) {
  .ed-body { grid-template-columns: 1fr; }
  .ed-bar { top: 0; position: static; }
  .ef-field.half { flex-basis: 100%; }
}

/* colores de opciones */
.o0 { --c: var(--coral); } .o1 { --c: var(--sky); } .o2 { --c: var(--sun); } .o3 { --c: var(--mint); }
.o4 { --c: var(--grape); } .o5 { --c: var(--pink); } .o6 { --c: var(--teal); } .o7 { --c: var(--lime); }

/* ===================================================================== escenario (anfitrión y proyector) */
.page-stage { background: #15102f; color: #fff; overflow: hidden; }
.stage { display: grid; grid-template-rows: auto 1fr auto; height: 100vh; height: 100dvh;
  background: radial-gradient(1200px 600px at 10% -10%, rgba(142,68,239,.35), transparent 60%), radial-gradient(900px 500px at 110% 110%, rgba(255,90,95,.25), transparent 60%), #15102f; }
.stage-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem clamp(16px, 2.5vw, 36px); font-size: clamp(1rem, 1.5vw, 1.35rem); }
.st-join { background: rgba(255,255,255,.1); padding: .25rem 1rem; border-radius: 999px; }
.st-join b { color: var(--sun); }
.st-title { opacity: .7; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; text-align: center; }
.st-stats { display: flex; gap: 1rem; font-weight: 800; }
.stage-main { overflow: auto; padding: clamp(10px, 2vw, 30px) clamp(16px, 3vw, 48px); display: flex; flex-direction: column; }
.stage-main > * { flex: 1; }
.stage-wait { margin: auto; opacity: .6; font-size: 1.5rem; }
.stage-ctrl { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .7rem clamp(12px, 2vw, 24px); background: rgba(0,0,0,.35); flex-wrap: wrap; }
.ctrl-left, .ctrl-mid, .ctrl-right { display: flex; gap: .5rem; align-items: center; }
.ctrl-pos { opacity: .75; font-weight: 600; }
.cbtn { border: 0; background: rgba(255,255,255,.12); color: #fff; font: inherit; font-weight: 700; padding: .5rem .95rem; border-radius: 12px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: .3rem; }
.cbtn:hover { background: rgba(255,255,255,.22); text-decoration: none; }
.cbtn:disabled { opacity: .35; cursor: default; }
.cbtn-main { background: var(--sun); color: var(--ink); padding: .55rem 1.6rem; font-size: 1.15rem; box-shadow: 0 3px 0 rgba(0,0,0,.35); }
.cbtn-main:hover { background: #ffc633; }
.cbtn-danger { background: rgba(255,90,95,.25); }
.cbtn-sm { padding: .3rem .65rem; font-size: .9rem; }
.stage-ctrl .confirm-inline .btn { font-size: .9rem; }
.screen-full { position: fixed; right: 14px; bottom: 14px; opacity: .3; }
.screen-full:hover { opacity: 1; }
.stage-screen .stage { grid-template-rows: auto 1fr; }
.stage.stage-screen { grid-template-rows: auto 1fr; }

/* sala de espera */
.lobby { display: grid; grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.4fr); gap: clamp(1rem, 3vw, 3rem); align-items: stretch; }
.lobby-join { background: #fff; color: var(--ink); border-radius: 28px; padding: clamp(20px, 3vw, 40px); display: flex; flex-direction: column; justify-content: center; text-align: center; box-shadow: 0 20px 60px -20px rgba(0,0,0,.6); }
.lj-1, .lj-2 { font-size: clamp(1.1rem, 1.6vw, 1.5rem); color: var(--ink2); margin: 0; font-weight: 600; }
.lj-url { font-size: clamp(1.8rem, 3.4vw, 3.2rem); font-weight: 800; margin: .1em 0 .3em; word-break: break-all; line-height: 1.05; color: var(--grape); }
.lj-pin { font-size: clamp(3.5rem, 8vw, 7.5rem); font-weight: 800; line-height: 1; margin: .1em 0 .2em; letter-spacing: .06em; }
.lj-qr canvas { width: clamp(150px, 16vw, 240px); height: auto; aspect-ratio: 1; border-radius: 12px; }
.lj-qr small { display: block; color: var(--ink3); font-weight: 600; }
.lobby-people { display: flex; flex-direction: column; min-height: 0; }
.lp-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.lp-head h2 { font-size: clamp(1.8rem, 3vw, 2.8rem); margin: 0; }
.lp-head h2 span { color: var(--sun); }
.lp-lock { background: rgba(255,90,95,.25); padding: .3rem 1rem; border-radius: 999px; font-weight: 700; }
.lp-grid { display: flex; flex-wrap: wrap; gap: .6rem; align-content: flex-start; margin-top: 1rem; flex: 1; overflow: hidden; }
.lp-empty { opacity: .6; font-size: 1.4rem; }
.lp-title { opacity: .5; margin-top: auto; padding-top: 1rem; font-size: 1.3rem; }
.pchip { display: inline-flex; align-items: center; gap: .4rem; background: rgba(255,255,255,.12); padding: .4rem .95rem .4rem .5rem; border-radius: 999px; font-weight: 700; font-size: clamp(1rem, 1.4vw, 1.3rem); animation: pop .35s cubic-bezier(.2,1.6,.4,1); cursor: default; position: relative; }
.pchip i { font-style: normal; font-size: 1.3em; }
.pchip.off { opacity: .45; }
[data-mode="host"] .pchip { cursor: pointer; }
[data-mode="host"] .pchip:hover { background: rgba(255,255,255,.2); }
.pchip.ask { background: var(--coral); }
.pchip.ask::after { content: 'Clic para retirar'; position: absolute; top: -1.6em; left: 50%; transform: translateX(-50%); font-size: .7rem; white-space: nowrap; background: var(--coral); padding: .1rem .5rem; border-radius: 6px; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 900px) { .lobby { grid-template-columns: 1fr; } }

/* encabezado de dinámicas */
.dyn { display: flex; flex-direction: column; }
.dyn > div { flex: 1; display: flex; flex-direction: column; }
.dq-head { display: flex; align-items: center; gap: 1.5rem; margin-bottom: clamp(1rem, 2.5vw, 2rem); }
.dq-q { flex: 1; font-size: clamp(1.8rem, 3.6vw, 3.4rem); margin: 0; background: #fff; color: var(--ink); border-radius: 22px; padding: .45em .8em; box-shadow: 0 14px 40px -18px rgba(0,0,0,.6); }
.dq-meta { text-align: center; flex: none; min-width: 5.5rem; }
.dq-count { display: block; font-size: clamp(2.2rem, 4vw, 3.6rem); font-weight: 800; line-height: 1; }
.dq-meta small { opacity: .7; font-weight: 600; }
.timer { position: relative; width: clamp(80px, 8vw, 120px); aspect-ratio: 1; flex: none; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 4; }
.tr-bg { stroke: rgba(255,255,255,.15); }
.tr-fg { stroke: var(--sun); stroke-linecap: round; transition: stroke .3s; }
.timer b { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(1.8rem, 3vw, 2.8rem); font-weight: 800; }
.timer.low .tr-fg { stroke: var(--coral); }
.timer.low b { color: var(--coral); animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.12); } }

/* opciones (abiertas) */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(.6rem, 1.2vw, 1.1rem); flex: 1; align-content: end; }
.tiles.n3 .otile:last-child, .tiles.n5 .otile:last-child { grid-column: span 2; }
.otile { background: var(--c); border-radius: 20px; padding: clamp(.8rem, 1.6vw, 1.4rem) 1.3rem; display: flex; align-items: center; gap: 1rem; min-height: clamp(80px, 13vh, 150px); font-size: clamp(1.3rem, 2.3vw, 2.2rem); font-weight: 800; box-shadow: 0 6px 0 rgba(0,0,0,.25); }
.ol { background: rgba(0,0,0,.18); border-radius: 12px; min-width: 1.8em; height: 1.8em; display: grid; place-items: center; flex: none; font-weight: 800; }
.otile .ot { flex: 1; line-height: 1.15; }

/* barras */
.bars { display: flex; flex-direction: column; gap: clamp(.5rem, 1vw, .9rem); flex: 1; justify-content: center; }
.bar { display: grid; grid-template-columns: auto minmax(8em, 1.2fr) 3fr auto; align-items: center; gap: 1rem; font-size: clamp(1.1rem, 2vw, 1.9rem); font-weight: 800; }
.bar .bar-l { background: var(--c); border-radius: 12px; min-width: 1.8em; height: 1.8em; display: grid; place-items: center; }
.bar-t { line-height: 1.1; }
.bar-track { height: clamp(26px, 4.5vh, 50px); background: rgba(255,255,255,.08); border-radius: 12px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--c); border-radius: 12px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.bar-n { min-width: 6.5em; text-align: right; font-variant-numeric: tabular-nums; opacity: .9; }
.bars-reveal .bar:not(.is-ok) { opacity: .45; }
.bars-reveal .bar.is-ok .bar-t::after { content: ' ✓'; color: var(--mint); }
.bars-reveal .bar.is-ok .bar-l { box-shadow: 0 0 0 4px #fff; }

/* diapositiva */
.dslide { justify-content: center; max-width: 1400px; }
.dslide h1 { font-size: clamp(2.6rem, 6vw, 6rem); line-height: 1; margin-bottom: .4em; }
.dslide p { font-size: clamp(1.3rem, 2.4vw, 2.3rem); opacity: .9; max-width: 40ch; }

/* nube */
.cloud { flex: 1; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: .2em .7em; padding: 1rem; background: rgba(255,255,255,.05); border-radius: 28px; }
.cw { font-weight: 800; line-height: 1.05; transition: font-size .5s; animation: pop .4s; }
.cw.c0 { color: var(--sun); } .cw.c1 { color: #ff8a8d; } .cw.c2 { color: #45e0bd; } .cw.c3 { color: #79b0ff; } .cw.c4 { color: #c39bff; } .cw.c5 { color: #ff8fd0; }
.cloud-empty { opacity: .5; font-size: 1.5rem; margin: auto; }

/* escala */
.scale-wrap { flex: 1; display: grid; grid-template-columns: auto 1fr; gap: clamp(1rem, 3vw, 3rem); align-items: stretch; }
.scale-avg { display: flex; flex-direction: column; justify-content: center; align-items: center; background: #fff; color: var(--ink); border-radius: 28px; padding: 1rem clamp(1.2rem, 3vw, 3rem); }
.scale-avg b { font-size: clamp(3.5rem, 8vw, 7rem); line-height: 1; color: var(--grape); }
.scale-avg small { font-weight: 700; color: var(--ink3); font-size: 1.1rem; }
.hist { display: flex; gap: clamp(.3rem, 1vw, .9rem); align-items: stretch; }
.hcol { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.hbar { flex: 1; width: 100%; background: rgba(255,255,255,.07); border-radius: 12px; display: flex; align-items: flex-end; overflow: hidden; min-height: 120px; }
.hbar i { display: block; width: 100%; background: linear-gradient(var(--pink), var(--grape)); border-radius: 12px; transition: height .6s cubic-bezier(.2,.8,.2,1); }
.hcol em { font-style: normal; font-weight: 800; font-size: clamp(1.1rem, 1.8vw, 1.6rem); }
.hn { font-size: 1.1rem; opacity: .8; }
.scale-labels { display: flex; justify-content: space-between; padding: .6rem 0 0; opacity: .75; font-size: 1.2rem; font-weight: 700; margin-left: auto; width: 70%; }

/* preguntas del público */
.qa-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; overflow: hidden; }
.qa-item { display: flex; align-items: center; gap: 1rem; background: #fff; color: var(--ink); border-radius: 18px; padding: .8rem 1.1rem; font-size: clamp(1.1rem, 1.9vw, 1.7rem); font-weight: 700; animation: pop .35s; }
.qa-item small { color: var(--ink3); font-weight: 600; }
.qa-votes { background: var(--pink); color: #fff; border-radius: 12px; padding: .2rem .7rem; font-weight: 800; flex: none; min-width: 3.4em; text-align: center; }
.qa-text { flex: 1; }
.qa-item.is-done { opacity: .5; }
.qa-item.is-done .qa-text { text-decoration: line-through; text-decoration-thickness: 2px; }
.qa-item.is-hidden { opacity: .35; background: #ddd; }
.qa-act { display: flex; gap: .3rem; flex: none; }
.qa-act .cbtn { background: var(--soft); color: var(--ink); }
.qa-empty { opacity: .6; font-size: 1.4rem; }

/* tabla de posiciones y podio */
.board { max-width: 1200px; width: 100%; margin: 0 auto; }
.board h1 { text-align: center; font-size: clamp(2rem, 4vw, 3.4rem); }
.board ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.board li { display: grid; grid-template-columns: 2.4em auto minmax(6em, 14em) auto 1fr auto; align-items: center; gap: .8rem; background: rgba(255,255,255,.08); border-radius: 16px; padding: .55rem 1rem; font-size: clamp(1.1rem, 2vw, 1.7rem); font-weight: 800; animation: slidein .5s both; animation-delay: var(--d); }
.board li:first-child { background: var(--sun); color: var(--ink); }
.board .bp { opacity: .7; text-align: center; }
.board .streak { font-size: .8em; }
.btrack { height: 10px; background: rgba(255,255,255,.1); border-radius: 5px; overflow: hidden; }
.btrack i { display: block; height: 100%; background: currentColor; opacity: .55; border-radius: 5px; }
.bs { font-variant-numeric: tabular-nums; }
@keyframes slidein { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
.podium { text-align: center; display: flex; flex-direction: column; }
.podium h1 { font-size: clamp(2rem, 4vw, 3.6rem); }
.pods { display: flex; justify-content: center; align-items: flex-end; gap: clamp(.6rem, 2vw, 2rem); flex: 1; }
.pod { display: flex; flex-direction: column; align-items: center; width: clamp(140px, 20vw, 280px); font-weight: 800; animation: rise .8s both cubic-bezier(.2,1.2,.4,1); }
.pod .av { font-size: clamp(3rem, 6vw, 5.5rem); }
.pod b { font-size: clamp(1.3rem, 2.4vw, 2.2rem); line-height: 1.1; overflow-wrap: anywhere; }
.pod span:not(.av) { opacity: .8; margin-bottom: .5rem; }
.pod-col { width: 100%; border-radius: 18px 18px 0 0; display: grid; place-items: center; font-size: clamp(2.5rem, 5vw, 4.5rem); color: rgba(0,0,0,.35); }
.pod-1 .pod-col { height: 34vh; background: var(--sun); } .pod-2 .pod-col { height: 24vh; background: #c9d3e6; } .pod-3 .pod-col { height: 17vh; background: #f0a36a; }
.pod-1 { animation-delay: .9s; } .pod-2 { animation-delay: .4s; } .pod-3 { animation-delay: .1s; }
.pod.empty { opacity: .3; }
@keyframes rise { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }
.pod-rest { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.4rem; padding: 1rem 0 0; margin: 0; font-weight: 700; font-size: 1.15rem; opacity: .85; }
.pod-rest li i { font-style: normal; opacity: .6; margin-left: .4rem; }
.thanks { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.thanks h1 { font-size: clamp(2.5rem, 6vw, 5rem); }
.thanks p { font-size: 1.6rem; opacity: .7; }
.confetti { position: fixed; top: -12px; width: 10px; height: 16px; border-radius: 2px; z-index: 50; animation: fall linear forwards; pointer-events: none; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); } }

/* ===================================================================== jugador */
.page-play { background: var(--ink); color: #fff; }
.play { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: radial-gradient(600px 400px at 0 0, rgba(142,68,239,.4), transparent 70%), radial-gradient(500px 400px at 100% 100%, rgba(255,90,95,.3), transparent 70%), var(--ink); }
.play-top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .7rem 16px; padding-top: max(.7rem, env(safe-area-inset-top)); }
.play-me { display: flex; align-items: center; gap: .45rem; font-weight: 700; min-width: 0; }
.play-me b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }
.play-me .score { background: rgba(255,255,255,.14); padding: .1rem .7rem; border-radius: 999px; font-variant-numeric: tabular-nums; }
.play-main { flex: 1; display: flex; padding: 0 16px 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.play-card { flex: 1; display: flex; flex-direction: column; width: 100%; max-width: 760px; margin: 0 auto; }
.play-card > h2, .play-card > p, .play-card > form, .play-card > .eyebrow { text-align: center; }
.play-card:has(> h2) { justify-content: center; }
.play-card .eyebrow { color: rgba(255,255,255,.6); }
.play-card .pin-input { color: var(--ink); }
.play-card .pin-form { justify-content: center; }
.join-form { background: #fff; color: var(--ink); border-radius: 24px; padding: 1.4rem; text-align: left !important; margin-top: 1rem; }
.join-form input { font-size: 1.5rem; font-weight: 800; text-align: center; margin-bottom: 1rem; }
.join-form label { margin: 0; text-align: center; }
.p-body { flex: 1; display: flex; flex-direction: column; }
.p-wait, .p-res { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .2rem; padding: 1rem; }
.p-wait h2, .p-res h2 { font-size: clamp(1.7rem, 7vw, 2.4rem); }
.p-wait p, .p-res p { font-size: 1.15rem; opacity: .85; margin: 0 0 .3rem; }
.p-ico { font-size: 4rem; line-height: 1; margin-bottom: .6rem; animation: pop .4s; }
.p-big { font-size: 6rem; }
.p-pts { font-size: 2.6rem !important; font-weight: 800; opacity: 1 !important; color: var(--sun); }
.p-res.ok { background: var(--mint); border-radius: 26px; }
.p-res.no { background: var(--coral); border-radius: 26px; }
.p-res .muted { color: rgba(255,255,255,.85); }
.p-final .btn { margin-top: 1rem; color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.p-q { font-size: clamp(1.2rem, 5vw, 1.6rem); font-weight: 800; line-height: 1.2; text-align: center; margin: .3rem 0 1rem; }
.p-opts { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.p-opts.n2 { grid-template-columns: 1fr; }
.p-opts.n3 .p-opt:last-child, .p-opts.n5 .p-opt:last-child { grid-column: span 2; }
.p-opt { border: 0; border-radius: 20px; background: var(--c); color: #fff; font: inherit; font-weight: 800; font-size: clamp(1.05rem, 4.5vw, 1.4rem); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; padding: .8rem; cursor: pointer; box-shadow: 0 6px 0 rgba(0,0,0,.28); min-height: 90px; line-height: 1.15; transition: transform .08s; }
.p-opt:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,.28); }
.p-opt:disabled { opacity: .6; }
.p-opt .ol { font-size: 1.3rem; }
.p-list { display: flex; flex-direction: column; gap: .6rem; }
.p-row { flex-direction: row; justify-content: flex-start; text-align: left; min-height: 64px; padding: .7rem 1rem; }
.p-form { display: flex; flex-direction: column; gap: .7rem; }
.p-in { margin: 0; font-size: 1.3rem; font-weight: 700; color: var(--ink); text-align: center; border: 0; }
textarea.p-in { text-align: left; font-size: 1.1rem; }
.p-scale { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 1rem; }
.p-scale output { font-size: 6rem; font-weight: 800; text-align: center; line-height: 1; color: var(--sun); }
.p-scale input[type=range] { -webkit-appearance: none; appearance: none; height: 14px; border-radius: 7px; background: rgba(255,255,255,.2); border: 0; padding: 0; }
.p-scale input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 42px; height: 42px; border-radius: 50%; background: var(--sun); border: 4px solid #fff; cursor: pointer; }
.p-scale input[type=range]::-moz-range-thumb { width: 36px; height: 36px; border-radius: 50%; background: var(--sun); border: 4px solid #fff; cursor: pointer; }
.p-scale-l { display: flex; justify-content: space-between; font-weight: 700; opacity: .8; gap: 1rem; }
.p-qa { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.p-qa li { display: flex; gap: .7rem; align-items: center; background: rgba(255,255,255,.1); border-radius: 14px; padding: .55rem .7rem; font-weight: 600; }
.p-qa li.is-done { opacity: .55; }
.p-qa small { opacity: .7; }
.p-qa .tag { background: rgba(255,255,255,.18); border-radius: 6px; padding: 0 .4rem; margin-left: .4rem; }
.p-vote { border: 0; flex: none; background: rgba(255,255,255,.15); color: #fff; border-radius: 12px; min-width: 3.2rem; padding: .3rem .4rem; font: inherit; font-weight: 800; cursor: pointer; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.p-vote.on { background: var(--pink); }
.p-vote:disabled { opacity: .4; }
.p-timer { height: 8px; background: rgba(255,255,255,.12); border-radius: 4px; overflow: hidden; margin-bottom: .8rem; }
.p-timer i { display: block; height: 100%; width: 100%; background: var(--sun); border-radius: 4px; }
.p-timer i.low { background: var(--coral); }
.dots { display: flex; gap: .5rem; margin-top: 1rem; }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--sun); animation: bounce 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; background: var(--mint); } .dots i:nth-child(3) { animation-delay: .3s; background: var(--coral); }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-12px); } }
.play .note { color: var(--ink); }

/* ===================================================================== admin e instalador */
.admin-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.4rem; border-bottom: 2px solid var(--line); }
.admin-tabs a { padding: .55rem 1.1rem; border-radius: 12px 12px 0 0; color: var(--ink2); margin-bottom: -2px; border: 2px solid transparent; }
.admin-tabs a.on { background: var(--card); color: var(--ink); border-color: var(--line); border-bottom-color: var(--card); }
.admin-tabs a:hover { text-decoration: none; background: var(--soft); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.4rem; margin: 0; }
.kv dt { color: var(--ink3); font-weight: 700; } .kv dd { margin: 0; font-weight: 600; }
.drop { border: 3px dashed var(--line); border-radius: var(--r-lg); padding: 1.6rem; text-align: center; background: var(--soft); margin-bottom: 1rem; }
.drop input { background: #fff; }
.log { background: #15102f; color: #d7d3f0; border-radius: var(--r); padding: 1rem; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; white-space: pre-wrap; max-height: 320px; overflow: auto; }
.inst { min-height: 100vh; display: grid; grid-template-columns: minmax(260px, 360px) 1fr; }
.inst-side { background: var(--ink); color: #fff; padding: 2rem; }
.inst-side .logo { font-size: 2.2rem; }
.inst-steps { list-style: none; padding: 0; margin: 2rem 0 0; counter-reset: s; }
.inst-steps li { counter-increment: s; display: flex; align-items: center; gap: .8rem; padding: .6rem 0; opacity: .5; font-weight: 700; }
.inst-steps li::before { content: counter(s); width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); }
.inst-steps li.on { opacity: 1; } .inst-steps li.on::before { background: var(--sun); color: var(--ink); }
.inst-steps li.done { opacity: .85; } .inst-steps li.done::before { content: '✓'; background: var(--mint); }
.inst-main { padding: clamp(20px, 4vw, 60px); }
.inst-main .card { max-width: 820px; }
.req { list-style: none; padding: 0; margin: 0 0 1.2rem; }
.req li { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.req .y { color: var(--mint); font-weight: 800; } .req .n { color: var(--coral); font-weight: 800; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 760px) { .inst { grid-template-columns: 1fr; } .inst-steps { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; } .row-2 { grid-template-columns: 1fr; } }

/* ===================================================================== 1.1 · barras de desplazamiento discretas */
* { scrollbar-width: thin; scrollbar-color: rgba(29,22,64,.25) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(29,22,64,.22); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background-color: rgba(29,22,64,.4); }
.page-stage *, .page-play * { scrollbar-color: rgba(255,255,255,.25) transparent; }
.page-stage *::-webkit-scrollbar-thumb, .page-play *::-webkit-scrollbar-thumb { background-color: rgba(255,255,255,.22); }
.stage-main { scrollbar-width: none; }
.stage-main::-webkit-scrollbar { display: none; }

/* ===================================================================== 1.1 · temas */
.theme-noche     { --tb: #15102f; --t1: rgba(142,68,239,.38); --t2: rgba(255,90,95,.26); --tp: #8e44ef; --ts: #ff5a5f; }
.theme-aurora    { --tb: #0b1f2e; --t1: rgba(0,184,148,.40);  --t2: rgba(142,68,239,.38); --tp: #00b894; --ts: #8e44ef; }
.theme-oceano    { --tb: #0a2340; --t1: rgba(47,128,237,.45); --t2: rgba(15,181,201,.35); --tp: #2f80ed; --ts: #0fb5c9; }
.theme-selva     { --tb: #0e2619; --t1: rgba(95,174,46,.38);  --t2: rgba(0,184,148,.30);  --tp: #5fae2e; --ts: #00b894; }
.theme-atardecer { --tb: #35102f; --t1: rgba(255,90,95,.45);  --t2: rgba(255,180,0,.32);  --tp: #ff5a5f; --ts: #ffb400; }
.theme-pizarra   { --tb: #1f2a2a; --t1: rgba(255,255,255,.07); --t2: rgba(255,255,255,.04); --tp: #4f6b63; --ts: #c9d6cf; }
.theme-dulce     { --tb: #3a1747; --t1: rgba(255,95,180,.45); --t2: rgba(255,180,0,.30);  --tp: #ff5fb4; --ts: #ffb400; }
.theme-mono      { --tb: #121212; --t1: rgba(255,255,255,.06); --t2: rgba(255,255,255,.03); --tp: #3a3a3a; --ts: #9a9a9a; }
.stage[class*="theme-"], .play[class*="theme-"] {
  background: radial-gradient(1200px 620px at 8% -10%, var(--t1), transparent 62%), radial-gradient(900px 520px at 110% 110%, var(--t2), transparent 62%), var(--tb);
}
.stage.theme-pizarra, .play.theme-pizarra {
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px), radial-gradient(1000px 600px at 50% 0, rgba(255,255,255,.06), transparent 70%);
  background-size: 48px 48px, 48px 48px, auto; background-color: var(--tb);
}
.stage { position: relative; isolation: isolate; }
.stage-bg { position: absolute; inset: 0; z-index: -1; background: center / cover no-repeat; pointer-events: none; }
.stage.has-bg .stage-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,6,30,.55), rgba(10,6,30,.72)); }
.play.has-bg { background-size: cover !important; background-position: center !important; }

/* tarjetas de vista previa de tema (demo, panel, editor) */
.tpl-cover, .act-cover, .th-card .th-sw, .tpl-mini {
  background: radial-gradient(260px 160px at 0 0, var(--t1), transparent 70%), radial-gradient(240px 160px at 100% 100%, var(--t2), transparent 70%), var(--tb);
}

/* ===================================================================== 1.1 · escenario */
.dyn-box.has-img .tiles { flex: 0 0 auto; }
.dyn-box.has-img .otile { min-height: clamp(60px, 9vh, 110px); }
.dq-img { flex: 1 1 auto; min-height: 0; display: flex; justify-content: center; align-items: center; margin: -.5rem 0 1rem; }
.dq-img img { max-height: 34vh; max-width: 100%; border-radius: 18px; box-shadow: 0 20px 50px -20px rgba(0,0,0,.7); object-fit: contain; }
.dslide.has-img { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; align-items: center; max-width: none; }
.dslide.has-img .dq-img { margin: 0; }
.dslide.has-img .dq-img img { max-height: 60vh; }
.type-wait { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8rem; font-size: clamp(1.4rem, 2.6vw, 2.4rem); font-weight: 800; opacity: .9; }
.type-wait .kbd { font-size: 3.5em; line-height: 1; animation: pulse 1.8s infinite; }
.type-ans { align-self: center; display: flex; flex-direction: column; align-items: center; background: var(--mint); color: #fff; border-radius: 24px; padding: .6rem 2.4rem 1rem; box-shadow: 0 8px 0 rgba(0,0,0,.25); margin-bottom: 1.4rem; }
.type-ans span { text-transform: uppercase; letter-spacing: .12em; font-weight: 700; font-size: .9rem; opacity: .9; }
.type-ans b { font-size: clamp(2.2rem, 5vw, 4.4rem); line-height: 1.05; }
.type-list { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; }
.type-sum { width: 100%; text-align: center; font-size: 1.3rem; font-weight: 700; opacity: .85; margin: 0 0 .4rem; }
.type-chip { background: rgba(255,255,255,.12); padding: .35rem 1rem; border-radius: 999px; font-weight: 800; font-size: clamp(1rem, 1.8vw, 1.5rem); }
.type-chip.ok { background: rgba(0,184,148,.35); }
.type-chip i { font-style: normal; opacity: .7; margin-left: .3rem; }
.order-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: clamp(.5rem, 1vw, .8rem); flex: 1; justify-content: center; }
.order-list li { display: flex; align-items: center; gap: 1rem; background: var(--c); border-radius: 18px; padding: .7rem 1.2rem; font-size: clamp(1.2rem, 2.2vw, 2rem); font-weight: 800; box-shadow: 0 5px 0 rgba(0,0,0,.25); }
.order-list li b { background: rgba(0,0,0,.2); border-radius: 12px; min-width: 1.8em; height: 1.8em; display: grid; place-items: center; }
.order-list.is-correct li { background: rgba(255,255,255,.1); box-shadow: none; }
.order-list.is-correct li b { background: var(--mint); }
.order-sum { text-align: center; font-size: 1.4rem; font-weight: 700; opacity: .85; margin: 1rem 0 0; }
.qbtn { border: 0; background: var(--soft); color: var(--ink); font: inherit; font-weight: 700; font-size: .85rem; padding: .3rem .75rem; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.qbtn:hover { background: var(--line); }
.lp-demo { background: rgba(255,180,0,.16); border-radius: 12px; padding: .5rem 1rem; margin: .6rem 0 0; font-weight: 600; }
.pchip.bot small { font-size: .7em; opacity: .75; margin-left: .2rem; }
.demo-end { display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.4rem; background: rgba(255,255,255,.1); border-radius: 18px; padding: .8rem 1.2rem; font-size: 1.1rem; }
.screen-tools { position: fixed; right: max(14px, env(safe-area-inset-right, 0px)); bottom: max(14px, env(safe-area-inset-bottom, 0px)); display: flex; gap: .4rem; opacity: .35; transition: opacity .2s; }
.screen-tools:hover { opacity: 1; }
.stage-ctrl { flex-wrap: nowrap; }
.ctrl-left { min-width: 0; flex: 1; }
.ctrl-left .ctrl-pos { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctrl-right { flex: 1; justify-content: flex-end; }
.cbtn { white-space: nowrap; }
@media (max-width: 760px) { .stage-ctrl { flex-wrap: wrap; } .ctrl-left, .ctrl-right { flex: 1 1 100%; justify-content: center; } }

/* ===================================================================== 1.1 · jugador */
.nick-row { display: flex; gap: .5rem; margin-bottom: 1rem; }
.nick-row input { margin: 0; flex: 1; min-width: 0; }
.nick-dice { flex: none; width: 3.4rem; border: 2px solid var(--line); background: var(--soft); border-radius: var(--r); font-size: 1.6rem; cursor: pointer; }
.nick-dice:hover { background: var(--line); }
.av-cur { border: 0; background: transparent; cursor: pointer; color: inherit; font: inherit; }
.p-avbtn { margin-top: 1rem; color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.3); }
.p-avbtn:hover { background: rgba(255,255,255,.12); }
.av-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .4rem; margin-top: .8rem; width: 100%; max-width: 360px; }
.av-opt { border: 0; background: rgba(255,255,255,.1); border-radius: 12px; font-size: 1.7rem; padding: .3rem 0; cursor: pointer; }
.av-opt.on { background: var(--sun); }
.p-hint { text-align: center; opacity: .8; margin: -.4rem 0 .8rem; font-size: .95rem; }
.p-opt.is-picked { box-shadow: inset 0 0 0 4px #fff, 0 6px 0 rgba(0,0,0,.28); }
.p-opt.is-picked .ol { background: #fff; color: var(--ink); }
.p-row-actions { display: flex; gap: .6rem; margin-top: 1rem; }
.p-row-actions .btn { flex: 1; }
.p-row-actions .btn-ghost { color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.3); flex: 0 0 auto; }
.p-ans { background: rgba(0,0,0,.2); border-radius: 12px; padding: .4rem .9rem; margin: .4rem 0 .6rem !important; opacity: 1 !important; }

/* ===================================================================== 1.1 · editor */
.ef-sec { padding: 1.2rem 0; border-top: 1px solid var(--line); }
.ef-sec:first-of-type { border-top: 0; padding-top: 0; }
.ef-sec h3 { font-size: 1.15rem; margin-bottom: .7rem; }
.md-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: .7rem; }
.md-card { text-align: left; border: 2px solid var(--line); background: #fff; border-radius: var(--r); padding: .8rem 1rem; font: inherit; cursor: pointer; color: var(--ink); display: flex; flex-direction: column; gap: .2rem; }
.md-card small { color: var(--ink2); line-height: 1.3; }
.md-card.on { border-color: var(--ink); background: var(--soft); }
.th-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .7rem; }
.th-card { border: 2px solid transparent; background: transparent; padding: 0; font: inherit; cursor: pointer; color: var(--ink); display: flex; flex-direction: column; gap: .3rem; text-align: left; }
.th-card .th-sw { height: 64px; border-radius: 12px; display: flex; align-items: flex-end; gap: 5px; padding: 8px; }
.th-sw i { width: 18px; height: 10px; border-radius: 4px; background: var(--tp); }
.th-sw i:nth-child(2) { background: var(--ts); } .th-sw i:nth-child(3) { background: #fff; opacity: .85; }
.th-card b { font-size: .95rem; padding-left: .2rem; }
.th-card.on .th-sw { box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--ink); }
.ef-img { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.ef-img-prev { width: 160px; height: 96px; border-radius: 12px; background: var(--soft) center / cover no-repeat; display: grid; place-items: center; color: var(--ink3); font-weight: 600; font-size: .9rem; border: 2px dashed var(--line); flex: none; }
.ef-img-prev:not(.empty) { border-style: solid; border-color: transparent; }
.ef-img.tall .ef-img-prev { width: 240px; height: 135px; }
.ef-img-act { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.ef-img-act small { flex-basis: 100%; }
.ef-img-act label.btn { margin: 0; }
.ef-img.busy { opacity: .6; pointer-events: none; }
.ef-answers { display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; }
.ef-ans { display: flex; gap: .4rem; width: 100%; max-width: 560px; }
.ef-ans input { margin: 0; }
.ef-ans .rm, .ef-opt .rm { flex: none; }
.ef-ans .rm { border: 0; background: var(--soft); border-radius: 10px; width: 2.6rem; cursor: pointer; font: inherit; color: var(--ink2); }
.ef-opts.numbered .ef-opt { background: var(--ink2); }
.ef-addopt { align-self: center; justify-self: start; }
.ok-tog { min-width: 6.5em; }
.tog { display: flex; align-items: center; gap: .8rem; font-weight: 600; margin: 0 0 .8rem; cursor: pointer; }
.tog input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tog span { flex: none; width: 46px; height: 26px; border-radius: 999px; background: var(--line); position: relative; transition: background .2s; }
.tog span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.tog input:checked + span { background: var(--mint); }
.tog input:checked + span::after { transform: translateX(20px); }
.tog input:focus-visible + span { box-shadow: 0 0 0 3px rgba(47,128,237,.35); }
.picker { position: fixed; inset: 0; z-index: 60; background: rgba(21,16,47,.55); display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); animation: fadein .15s; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.pk-box { background: var(--paper); border-radius: 26px; width: min(980px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: clamp(18px, 3vw, 32px); box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); }
.pk-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.pk-head h2 { margin: 0; font-size: 1.7rem; }
.pk-close { border: 0; background: var(--soft); width: 2.4rem; height: 2.4rem; border-radius: 50%; font-size: 1.1rem; cursor: pointer; color: var(--ink); }
.pk-box .eyebrow { margin-top: 1rem; }
.pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: .7rem; }
.pk-card { text-align: left; background: #fff; border: 2px solid transparent; border-radius: 18px; padding: .9rem 1rem; font: inherit; color: var(--ink); cursor: pointer; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .8rem; row-gap: .15rem; box-shadow: var(--shadow); transition: transform .12s, border-color .12s; }
.pk-card:hover, .pk-card:focus-visible { border-color: var(--ink); transform: translateY(-2px); outline: none; }
.pk-ico { grid-row: span 2; width: 3rem; height: 3rem; border-radius: 14px; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1rem; }
.pk-card b { font-size: 1.1rem; line-height: 1.1; align-self: end; }
.pk-card small { color: var(--ink2); line-height: 1.3; font-size: .88rem; }
.t-typeanswer { background: var(--teal); } .t-order { background: var(--lime); }
@media (max-width: 860px) { .ed-bar { position: static; } }

/* ===================================================================== 1.1 · demo y plantillas */
.demo { padding-block: clamp(24px, 4vw, 56px); padding-left: max(16px, 4vw); padding-right: max(16px, 4vw); display: flex; flex-direction: column; gap: 2rem; }
.demo-hero h1 { font-size: clamp(2.4rem, 5.5vw, 4.4rem); line-height: .98; letter-spacing: -.03em; margin: .2rem 0 .6rem; text-wrap: balance; }
.demo-lead { font-size: 1.2rem; color: var(--ink2); max-width: 62ch; }
.demo-steps { list-style: none; padding: 0; margin: 1.2rem 0 0; display: flex; flex-wrap: wrap; gap: .6rem; counter-reset: st; }
.demo-steps li { counter-increment: st; background: #fff; border-radius: 999px; padding: .4rem 1rem .4rem .45rem; display: flex; align-items: center; gap: .55rem; box-shadow: var(--shadow); }
.demo-steps li::before { content: counter(st); width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--sun); display: grid; place-items: center; font-weight: 800; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 1.2rem; }
.tpl { background: var(--card); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.tpl-cover { color: #fff; padding: 1.1rem 1.3rem 1rem; min-height: 150px; display: flex; flex-direction: column; justify-content: flex-end; gap: .5rem; position: relative; }
.tpl-cover h2 { font-size: 1.6rem; margin: 0; text-wrap: balance; }
.tpl-mode { position: absolute; top: .9rem; left: 1.3rem; font-size: .8rem; font-weight: 700; background: rgba(255,255,255,.16); padding: .15rem .65rem; border-radius: 999px; }
.tpl-icons { display: flex; gap: .3rem; flex-wrap: wrap; }
.tpl-icons i { font-style: normal; font-weight: 800; font-size: .78rem; background: rgba(255,255,255,.16); border-radius: 8px; padding: .15rem .45rem; }
.tpl-body { padding: 1rem 1.3rem 1.2rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.tpl-body p { margin: 0; }
.tpl-tags { display: flex; gap: .35rem; flex-wrap: wrap; }
.tpl-tags span { background: var(--soft); border-radius: 999px; padding: .1rem .65rem; font-size: .85rem; font-weight: 700; }
.tpl-list { font-size: .9rem; }
.tpl-act { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin-top: auto; padding-top: .4rem; }
.tpl-act .check { margin: 0; font-size: .92rem; }
.demo-cta { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; background: var(--ink); color: #fff; border-radius: var(--r-lg); padding: 1.4rem 1.6rem; }
.demo-cta h2 { margin: 0 0 .2rem; } .demo-cta p { margin: 0; opacity: .85; max-width: 60ch; }
.demo-cta .btn { background: var(--sun); color: var(--ink); }
.act-cover { display: block; height: 72px; padding: .9rem 1.3rem; }
.act-cover .dot { box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.tpl-strip { margin-top: 2.4rem; }
.tpl-strip .page-head { margin-bottom: .8rem; }
.tpl-strip h2 { margin: 0; font-size: 1.5rem; }
.tpl-mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: .8rem; }
.tpl-mini { color: #fff; border-radius: var(--r-lg); padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .3rem; margin: 0; }
.tpl-mini b { font-size: 1.15rem; line-height: 1.15; }
.tpl-mini small { opacity: .85; }
.tpl-mini .btn { align-self: flex-start; margin-top: .5rem; background: #fff; color: var(--ink); }
.topnav .nav-demo { color: var(--coral) !important; }
.home-demo { display: inline-flex; align-items: center; gap: .5rem; margin-top: .4rem; font-size: 1.1rem; }
