/* =========================================================
   Encuestas en Vivo — estilos
   ========================================================= */
:root {
  --ink: #1b1f3b;
  --ink-2: #3a3f63;
  --muted: #6b7090;
  --line: #e4e2dc;
  --paper: #f6f5f1;
  --card: #ffffff;
  --accent: #ff5a36;
  --accent-2: #ff7a5c;
  --accent-ink: #ffffff;
  --good: #13b07b;
  --bad: #e5484d;
  --warn: #ffb020;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(27, 31, 59, .06), 0 6px 24px rgba(27, 31, 59, .06);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Segoe UI", "Inter", system-ui, -apple-system, Roboto, sans-serif;
  --c0: #ff5a36; --c1: #2f6bff; --c2: #13b07b; --c3: #ffb020; --c4: #9b51e0; --c5: #00a3c4;
  --c6: #e83e8c; --c7: #6d7a8a; --c8: #7cb518; --c9: #ff8a00; --c10: #3d3bd6; --c11: #c0392b;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--paper); line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.right { text-align: right; }
button { font-family: inherit; }

/* ---------- Marca ---------- */
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; color: var(--ink); font-size: 1.05rem; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand.big { font-size: 1.35rem; }
.brand.light { color: #fff; }
.logo { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); position: relative; flex: none;
  background-image: linear-gradient(#fff, #fff), linear-gradient(#fff, #fff), linear-gradient(#fff, #fff), linear-gradient(#fff, #fff);
  background-size: 3px 10px, 3px 15px, 3px 7px, 3px 12px; background-repeat: no-repeat;
  background-position: 6px 12px, 11px 7px, 16px 15px, 21px 10px; }
.brand.big .logo { width: 34px; height: 34px; background-position: 8px 15px, 14px 10px, 20px 18px, 26px 13px; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .62rem 1.05rem; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 600; font-size: .95rem; cursor: pointer;
  transition: transform .08s, background .15s, border-color .15s, box-shadow .15s; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #cfccc3; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 2px 0 #d9431f; }
.btn.primary:hover { background: #ff6a49; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: rgba(27, 31, 59, .06); }
.btn.ghost.light { color: rgba(255, 255, 255, .85); }
.btn.ghost.light:hover { background: rgba(255, 255, 255, .1); }
.btn.danger, .icon.danger { color: var(--bad); }
.btn.small { padding: .38rem .7rem; font-size: .83rem; border-radius: 8px; }
.btn.xl { padding: .95rem 1.4rem; font-size: 1.12rem; border-radius: 12px; }
.btn.block { display: flex; width: 100%; }
.icon { border: 0; background: transparent; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; color: var(--ink-2); font-size: 1rem; }
.icon:hover { background: rgba(27, 31, 59, .07); }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font-size: .82rem; }

/* ---------- Formularios ---------- */
.form { display: flex; flex-direction: column; gap: .85rem; }
.form label { display: flex; flex-direction: column; gap: .3rem; font-size: .86rem; font-weight: 600; color: var(--ink-2); }
.form label.check { flex-direction: row; align-items: center; gap: .55rem; font-weight: 500; }
input, select, textarea { font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .6rem .75rem; width: 100%;
  transition: border-color .15s, box-shadow .15s; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 90, 54, .15); }
textarea { resize: vertical; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: .7rem; margin: 0; }
legend { font-weight: 700; padding: 0 .4rem; }
details summary { cursor: pointer; font-size: .86rem; font-weight: 600; color: var(--ink-2); }
details[open] summary { margin-bottom: .6rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.self-end { align-self: end; padding-bottom: .6rem; }
.inline-form { display: flex; gap: .6rem; }
.inline-form input { flex: 1; }

.flash { max-width: 1100px; margin: 1rem auto 0; padding: .75rem 1rem; border-radius: 10px; font-weight: 500; }
.flash-ok { background: #e3f7ee; color: #0d6e4d; }
.flash-err { background: #fde8e8; color: #a8262b; }
.auth .flash { margin: 0 0 .5rem; }
.alert { background: #fff6df; color: #7a5300; padding: .7rem .9rem; border-radius: 10px; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; padding: .12rem .45rem; border-radius: 6px; background: #efeee9; color: var(--ink-2); margin-left: .35rem; }
.type-tag { display: inline-block; font-size: .75rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .03em; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); background: var(--ink); color: #fff; padding: .7rem 1.1rem;
  border-radius: 10px; font-weight: 600; opacity: 0; pointer-events: none; transition: all .25s; z-index: 1000; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--bad); }

/* =========================================================
   Panel (admin)
   ========================================================= */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1.5rem; background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20; gap: 1rem; flex-wrap: wrap; }
.topbar nav { display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap; }
.topbar nav a { color: var(--ink-2); font-weight: 600; font-size: .92rem; }
.container { max-width: 1100px; margin: 0 auto; padding: 1.6rem 1.25rem 4rem; }
.container.narrow { max-width: 760px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.page-head h1 { margin-top: .2rem; }
.head-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1.1rem; border: 1px solid rgba(27, 31, 59, .04); }
.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; border: 2px dashed var(--line); border-radius: var(--radius); }

.auth { display: grid; place-items: center; min-height: 100vh; padding: 1.5rem;
  background: radial-gradient(1200px 600px at 10% -10%, #ffe1d8 0, transparent 60%), var(--paper); }
.auth-card { background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 2rem; width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: .8rem; }
.auth-card.wide { max-width: 560px; }
.auth-card h1 { font-size: 1.4rem; margin-top: .6rem; }

.create-card { display: flex; flex-direction: column; gap: .6rem; }
.demo-form { align-self: flex-start; }
.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.event-card { position: relative; display: flex; flex-direction: column; margin: 0; }
.event-card h3 { padding-right: 5rem; }
.event-card h3 a { color: var(--ink); }
.event-code { position: absolute; top: 1.1rem; right: 1.1rem; font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 800; letter-spacing: .08em;
  background: var(--ink); color: #fff; padding: .2rem .5rem; border-radius: 6px; font-size: .82rem; }
.event-card .actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: auto; padding-top: .6rem; align-items: center; }
.event-card .actions form { display: contents; }

/* Editor */
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1.2rem; align-items: start; }
.list-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .8rem; }
.list-head h2 { margin: 0; display: flex; align-items: center; gap: .5rem; }
.count { background: #efeee9; border-radius: 99px; padding: .05rem .55rem; font-size: .85rem; }
.q-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.q-item { display: flex; align-items: center; gap: .6rem; padding: .7rem .7rem .7rem .4rem; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  transition: box-shadow .15s, border-color .15s; }
.q-item:hover { border-color: #d6d3ca; box-shadow: 0 2px 10px rgba(27, 31, 59, .06); }
.q-item.dragging { opacity: .5; }
.handle { cursor: grab; color: #b8b5ad; font-size: .9rem; letter-spacing: -2px; padding: 0 .2rem; user-select: none; }
.num { width: 28px; height: 28px; border-radius: 8px; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; }
.q-main { flex: 1; min-width: 0; cursor: pointer; }
.q-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-meta { margin-top: .15rem; }
.q-meta .tag:first-of-type { margin-left: .5rem; }
.q-actions { display: flex; gap: .1rem; opacity: .55; transition: opacity .15s; }
.q-item:hover .q-actions { opacity: 1; }

.join-card { display: flex; gap: 1rem; align-items: center; }
.join-card .qr { width: 120px; flex: none; }
.join-card .qr svg { width: 100%; height: auto; display: block; border-radius: 8px; }
.big-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.9rem; font-weight: 800; letter-spacing: .1em; line-height: 1.1; }
.row-gap { display: flex; gap: .4rem; margin-top: .5rem; flex-wrap: wrap; }
.danger-zone { display: flex; flex-direction: column; gap: .3rem; align-items: flex-start; }

/* Modales */
.modal { position: fixed; inset: 0; background: rgba(20, 22, 44, .5); z-index: 100; display: grid; place-items: center; padding: 1rem; backdrop-filter: blur(2px); }
.modal-box { background: #fff; border-radius: 18px; width: 100%; max-width: 760px; max-height: 92vh; overflow: auto; padding: 1.3rem 1.5rem 1.5rem; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal-box.lg { max-width: 680px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.modal-head h2 { margin: 0; }
.x { border: 0; background: #f1f0ec; width: 34px; height: 34px; border-radius: 50%; font-size: 1.3rem; cursor: pointer; line-height: 1; }
.modal-open { overflow: hidden; }
.modal-foot { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .4rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .7rem; }
.type-btn { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: .9rem; cursor: pointer; display: flex; flex-direction: column; gap: .2rem;
  transition: border-color .15s, transform .1s, box-shadow .15s; }
.type-btn:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(255, 90, 54, .15); transform: translateY(-1px); }
.type-btn .ti { font-size: 1.5rem; width: 42px; height: 42px; border-radius: 12px; background: #fff0eb; color: var(--accent); display: grid; place-items: center; margin-bottom: .3rem; }
.type-btn small { color: var(--muted); }
.opts-block .lbl { font-size: .86rem; font-weight: 600; color: var(--ink-2); }
.opts-block p { margin: .2rem 0 .5rem; }
#optList { display: flex; flex-direction: column; gap: .45rem; margin-bottom: .5rem; }
.opt-row { display: flex; align-items: center; gap: .45rem; }
.opt-row .opt-label { flex: 1; }
.rank-n { width: 22px; font-weight: 700; color: var(--muted); text-align: right; }
.opt-row .correct { position: relative; cursor: pointer; }
.opt-row .correct input { position: absolute; opacity: 0; pointer-events: none; }
.opt-row .correct span { width: 36px; height: 36px; border-radius: 10px; border: 2px solid var(--line); display: grid; place-items: center; color: transparent; font-weight: 900; transition: all .15s; }
.opt-row .correct input:checked + span { background: var(--good); border-color: var(--good); color: #fff; }
.opt-row .correct:hover span { border-color: var(--good); color: rgba(19, 176, 123, .4); }

/* Resultados */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin-bottom: 1.1rem; }
.stat { background: #fff; border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.8rem; font-family: var(--display); }
.stat span { color: var(--muted); font-size: .85rem; }
.res-head { display: flex; gap: .8rem; align-items: flex-start; margin-bottom: .8rem; }
.res-head > div:nth-child(2) { flex: 1; }
.res-total { color: var(--muted); white-space: nowrap; }
.res-total b { color: var(--ink); font-size: 1.2rem; }
.mini-bars { display: flex; flex-direction: column; gap: .55rem; }
.mb-top { display: flex; justify-content: space-between; gap: .8rem; font-size: .92rem; margin-bottom: .2rem; }
.mb-top em { color: var(--muted); font-style: normal; font-size: .8rem; }
.mb-track { height: 12px; background: #efeee9; border-radius: 99px; overflow: hidden; }
.mb-fill { height: 100%; border-radius: 99px; transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.mb.correct .mb-top span { color: var(--good); font-weight: 700; }
.cloud { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .2rem .9rem; padding: .5rem; line-height: 1.15; }
.cloud span { font-weight: 700; }
.res-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .6rem; }
.rw { background: #fbfaf7; border: 1px solid var(--line); border-radius: 10px; padding: .7rem; font-size: .92rem; }
.rw.is-hidden { opacity: .45; text-decoration: line-through; }
.rw-foot { display: flex; justify-content: space-between; margin-top: .4rem; color: var(--muted); font-size: .78rem; }
.big-avg { font-size: 2rem; font-weight: 800; margin: 0 0 .5rem; }
.big-avg small { font-size: .9rem; color: var(--muted); font-weight: 500; }
.res-rank { margin: 0; padding-left: 1.3rem; }
.res-rank li { padding: .3rem 0; display: flex; justify-content: space-between; gap: 1rem; }
.res-rank small { color: var(--muted); }
.num-cards { display: flex; gap: .7rem; flex-wrap: wrap; margin-bottom: .6rem; }
.nc { background: #f4f3ef; border-radius: 12px; padding: .7rem 1rem; min-width: 120px; }
.nc small { display: block; color: var(--muted); font-size: .78rem; }
.nc b { font-size: 1.3rem; }
.nc.ok { background: #e3f7ee; color: #0d6e4d; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { padding: .55rem .5rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.tbl th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.qa-res { list-style: none; padding: 0; margin: 0; }
.qa-res li { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.qa-res li.hidden { opacity: .5; }
.inline-details { display: inline-block; }
.inline-details summary { list-style: none; display: inline-flex; }
.inline-details summary::-webkit-details-marker { display: none; }
.inline-details[open] .inline-form { margin-top: .4rem; }

@media (max-width: 900px) {
  .editor-layout, .two-col { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .inline-form { flex-direction: column; }
  .container { padding: 1rem .9rem 3rem; }
  .q-actions { opacity: 1; }
  .q-actions [data-act=up], .q-actions [data-act=down] { display: none; }
}
@media print {
  .topbar, .head-actions, .rw-foot form { display: none; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
}

/* =========================================================
   Participante (celular)
   ========================================================= */
body.part { background: var(--ink); min-height: 100vh; }
.p-app { min-height: 100vh; min-height: 100dvh; }
.p-screen { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.p-hero { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 2rem 1.3rem; text-align: center; color: #fff;
  background: radial-gradient(700px 400px at 100% 0, rgba(255, 90, 54, .35), transparent 60%), radial-gradient(600px 400px at 0 100%, rgba(47, 107, 255, .3), transparent 60%); }
.p-hero h1 { font-size: 2rem; margin: 1.6rem 0 1.2rem; }
.code-form, .name-form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: .7rem; }
#iCode { text-align: center; font-size: 2rem; font-weight: 800; letter-spacing: .25em; padding: .8rem; border-radius: 14px; border: 0; text-transform: uppercase;
  font-family: ui-monospace, Menlo, Consolas, monospace; }
#iName { text-align: center; font-size: 1.2rem; padding: .85rem; border-radius: 14px; border: 0; }
.name-form label { font-weight: 700; font-size: 1.1rem; }
.p-err { color: #ffb3a1; min-height: 1.3em; font-weight: 600; margin: .8rem 0 0; }
.p-foot-link { color: rgba(255, 255, 255, .5); text-align: center; padding: 1rem; font-size: .85rem; }
.p-event-title { font-size: 1.6rem; font-weight: 800; font-family: var(--display); }
.p-event-desc { opacity: .8; max-width: 420px; }

.p-screen.live { background: var(--paper); }
.p-top { background: var(--ink); color: #fff; padding: .8rem 1rem; display: flex; justify-content: space-between; align-items: center; gap: .8rem; position: sticky; top: 0; z-index: 5; }
.p-top-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-score { background: rgba(255, 255, 255, .12); padding: .25rem .6rem; border-radius: 99px; font-size: .85rem; white-space: nowrap; }
.p-tabs { display: flex; background: var(--ink); padding: 0 .6rem; position: sticky; top: 48px; z-index: 5; }
.p-tabs button { flex: 1; background: none; border: 0; color: rgba(255, 255, 255, .6); padding: .7rem .4rem; font-weight: 600; border-bottom: 3px solid transparent; cursor: pointer; position: relative; }
.p-tabs button.active { color: #fff; border-bottom-color: var(--accent); }
.dot { display: inline-block; width: 8px; height: 8px; background: var(--accent); border-radius: 50%; vertical-align: middle; margin-left: .2rem; }
.p-body { flex: 1; padding: 1.1rem 1rem 2rem; max-width: 560px; width: 100%; margin: 0 auto; }
.p-conn { position: fixed; bottom: 0; left: 0; right: 0; background: var(--warn); color: #3a2a00; text-align: center; padding: .4rem; font-weight: 700; font-size: .85rem; }

.p-wait { text-align: center; padding: 3rem 1rem; }
.p-wait h2 { font-size: 1.5rem; margin-top: 1.5rem; }
.p-wait p { color: var(--ink-2); }
.pulse { width: 80px; height: 80px; border-radius: 50%; background: var(--accent); margin: 0 auto; position: relative; }
.pulse::before, .pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
.pulse::after { animation-delay: 1s; }
@keyframes pulse { from { transform: scale(1); opacity: .6; } to { transform: scale(1.9); opacity: 0; } }

.p-q-title { font-size: 1.35rem; font-weight: 800; font-family: var(--display); line-height: 1.25; margin-bottom: .6rem; }
.p-q-body { color: var(--ink-2); margin-bottom: .8rem; }
.p-q-img { width: 100%; border-radius: 12px; margin-bottom: .8rem; max-height: 260px; object-fit: contain; background: #fff; }
.p-wait-small { text-align: center; color: var(--muted); padding: 2rem 0; font-size: 1.1rem; }
.timer { position: relative; height: 26px; background: #e6e4dd; border-radius: 99px; overflow: hidden; margin-bottom: 1rem; }
.timer-bar { height: 100%; background: var(--good); transition: width .25s linear, background .3s; }
.timer-bar.low { background: var(--bad); }
.timer span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: var(--ink); }

.p-form { display: flex; flex-direction: column; gap: .7rem; }
.choices { display: flex; flex-direction: column; gap: .6rem; }
.choices.tf { flex-direction: row; }
.choices.tf .choice { flex: 1; justify-content: center; min-height: 90px; font-size: 1.15rem; }
.choice { display: flex; align-items: center; gap: .8rem; width: 100%; text-align: left; padding: .9rem 1rem; border-radius: 14px; border: 2px solid transparent;
  background: #fff; box-shadow: 0 2px 0 rgba(27, 31, 59, .08); font-size: 1.02rem; font-weight: 600; color: var(--ink); cursor: pointer; transition: all .12s; }
.choice .ch-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--c); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.choice.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); transform: scale(1.01); }
.choices.tf .choice .ch-mark { display: none; }
.choices.tf .choice.on { background: var(--c); color: #fff; }
.hint { color: var(--muted); font-size: .85rem; text-align: center; margin: 0; }
.p-input { font-size: 1.1rem; padding: .85rem 1rem; border-radius: 12px; }
.p-input.big { font-size: 2rem; text-align: center; font-weight: 800; }
.num-wrap { display: flex; align-items: center; gap: .6rem; }
.num-wrap .unit { font-size: 1.3rem; font-weight: 700; color: var(--ink-2); }
.counter { text-align: right; font-size: .8rem; color: var(--muted); margin-top: -.4rem; }
.my-list { margin: 0; padding-left: 1.2rem; color: var(--ink-2); }
.scale { display: flex; gap: .4rem; justify-content: center; flex-wrap: wrap; }
.scale .sc { cursor: pointer; border: 0; background: none; }
.scale.stars .sc { font-size: 2.6rem; color: #d8d5cc; transition: transform .1s, color .1s; padding: 0 .1rem; }
.scale.stars .sc.on { color: #ffb020; transform: scale(1.08); }
.scale.nums .sc { width: 52px; height: 52px; border-radius: 14px; background: #fff; box-shadow: 0 2px 0 rgba(27, 31, 59, .08); font-size: 1.2rem; font-weight: 800; color: var(--ink); }
.scale.nums .sc.on { background: var(--accent); color: #fff; }
.scale-labels { display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted); }
.rank-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .45rem; }
.rank-list li { display: flex; align-items: center; gap: .6rem; background: #fff; border-radius: 12px; padding: .55rem .6rem; box-shadow: 0 2px 0 rgba(27, 31, 59, .06); }
.rank-list li.moved { animation: moved .5s; }
@keyframes moved { from { background: #fff0eb; } to { background: #fff; } }
.rk { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.rank-list .lb { flex: 1; font-weight: 600; }
.mv { width: 40px; height: 40px; border: 0; border-radius: 10px; background: #f1f0ec; font-size: 1rem; cursor: pointer; color: var(--ink); }
.mv:disabled { opacity: .3; }
.send { margin-top: .4rem; }
.p-sent { text-align: center; padding: 2rem 1rem; display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.p-sent b { font-size: 1.3rem; }
.p-sent span { color: var(--muted); }
.check-anim { width: 76px; height: 76px; border-radius: 50%; background: var(--good); color: #fff; font-size: 2.4rem; display: grid; place-items: center; animation: pop .4s cubic-bezier(.2, 1.6, .4, 1); margin-bottom: .6rem; }
.p-sent.closed .check-anim { background: var(--ink-2); font-size: 2rem; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.banner { padding: .9rem 1rem; border-radius: 12px; font-weight: 800; text-align: center; font-size: 1.15rem; margin-bottom: 1rem; animation: pop .4s; }
.banner.good { background: var(--good); color: #fff; }
.banner.bad { background: var(--bad); color: #fff; }
.banner.neutral { background: #e9e7e0; color: var(--ink-2); font-size: 1rem; }
.mb.picked .mb-top span { font-weight: 700; }
.big-stat { text-align: center; font-size: 3rem; font-weight: 800; }
.big-stat small { font-size: 1rem; color: var(--muted); font-weight: 500; }
.mini-wall { display: flex; flex-direction: column; gap: .4rem; }
.mw { background: #fff; padding: .6rem .8rem; border-radius: 10px; font-size: .92rem; }
.mini-rank { padding-left: 1.4rem; font-weight: 600; }
.num-stats { display: flex; gap: .5rem; }
.num-stats div { flex: 1; background: #fff; border-radius: 12px; padding: .6rem; text-align: center; }
.num-stats small { display: block; color: var(--muted); font-size: .75rem; }
.num-stats b { font-size: 1.2rem; }
.p-lb { text-align: center; }
.p-lb ol { list-style: none; padding: 0; text-align: left; display: flex; flex-direction: column; gap: .4rem; }
.p-lb li { display: flex; gap: .7rem; align-items: center; background: #fff; border-radius: 12px; padding: .6rem .9rem; }
.p-lb .pos { width: 30px; text-align: center; font-weight: 800; }
.p-lb .nm { flex: 1; }
.p-myrank { background: var(--ink); color: #fff; padding: .8rem; border-radius: 12px; }

.qa-form { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.qa-list { display: flex; flex-direction: column; gap: .5rem; }
.qa-item { display: flex; gap: .6rem; align-items: center; background: #fff; border-radius: 12px; padding: .7rem .8rem; }
.qa-item.answered { opacity: .6; }
.qa-text { flex: 1; font-size: .95rem; }
.qa-text small { display: block; font-size: .75rem; margin-top: .2rem; }
.qa-pend { color: var(--warn); }
.qa-ans { color: var(--good); }
.like { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: .4rem .6rem; font-weight: 700; cursor: pointer; color: var(--ink-2); white-space: nowrap; }
.like.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* =========================================================
   Presentador (proyector)
   ========================================================= */
body.present { background: #fbfaf6; overflow: hidden; }
.pr-shell { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.pr-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1.4rem; background: var(--ink); color: #fff; flex: none; }
.pr-join { display: flex; align-items: center; gap: .8rem; }
.pr-miniqr { width: 54px; height: 54px; padding: 0; border: 0; border-radius: 8px; overflow: hidden; cursor: zoom-in; background: #fff; }
.pr-miniqr svg { width: 100%; height: 100%; display: block; }
.pr-join-line { font-size: .95rem; opacity: .85; }
.pr-join-code { font-size: 1.1rem; }
.pr-join-code b { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .12em; font-size: 1.5rem; color: #ffd0c3; }
.pr-title { font-weight: 700; opacity: .7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }
.pr-people { display: flex; align-items: center; gap: .45rem; font-size: 1rem; white-space: nowrap; }
.pr-people b { font-size: 1.4rem; }
.live-dot { width: 10px; height: 10px; background: #2fe39b; border-radius: 50%; box-shadow: 0 0 0 0 rgba(47, 227, 155, .7); animation: live 2s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 10px rgba(47, 227, 155, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 227, 155, 0); } }
.pr-stage { flex: 1; overflow: auto; padding: 2rem 3rem 1rem; display: flex; flex-direction: column; }
.pr-controls { flex: none; display: flex; justify-content: space-between; gap: .8rem; padding: .6rem 1rem; background: #fff; border-top: 1px solid var(--line); transition: opacity .3s, transform .3s; flex-wrap: wrap; }
body.idle .pr-controls { opacity: 0; transform: translateY(100%); position: fixed; bottom: 0; left: 0; right: 0; }
body.idle .pr-controls:hover { opacity: 1; transform: none; }
body.idle { cursor: none; }
.grp { display: flex; gap: .4rem; align-items: center; }
.cb { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: .5rem .8rem; font-weight: 700; cursor: pointer; color: var(--ink); font-size: .95rem; text-decoration: none; display: inline-flex; align-items: center; gap: .3rem; }
.cb:hover { border-color: var(--accent); text-decoration: none; }
.cb:disabled { opacity: .35; cursor: default; }
.cb.wide { min-width: 170px; justify-content: center; }
.cb.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.cb.warn { background: #fff6df; border-color: var(--warn); }
#cSelect { max-width: 320px; padding: .5rem; font-weight: 600; }

.qr-overlay { position: fixed; inset: 0; background: rgba(27, 31, 59, .96); z-index: 200; display: flex; align-items: center; justify-content: center; gap: 4vw; color: #fff; padding: 3vw; cursor: zoom-out; }
.qr-big { width: min(70vh, 45vw); background: #fff; border-radius: 20px; padding: 1rem; }
.qr-big svg { width: 100%; height: auto; display: block; }
.qr-info { font-size: 2vw; line-height: 1.4; }
.qr-host { font-size: 3vw; font-weight: 800; color: #ffd0c3; margin: .3em 0; }
.qr-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 6vw; font-weight: 900; letter-spacing: .12em; }

.lobby { flex: 1; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4vw; max-width: 1400px; margin: 0 auto; width: 100%; }
.lobby-qr { width: min(58vh, 38vw); background: #fff; border-radius: 22px; padding: 1rem; box-shadow: 0 10px 40px rgba(27, 31, 59, .12); }
.lobby-qr svg { width: 100%; display: block; }
.lobby-info h1 { font-size: clamp(1.8rem, 3.4vw, 3.4rem); margin-bottom: 1.5rem; }
.steps { font-size: clamp(1.1rem, 1.8vw, 1.8rem); padding-left: 1.4em; margin: 0 0 1.5rem; }
.steps li { margin-bottom: 1rem; font-weight: 600; }
.steps span { color: var(--muted); font-weight: 500; }
.steps b { color: var(--accent); }
.lobby-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: clamp(3rem, 7vw, 7rem); font-weight: 900; letter-spacing: .12em; color: var(--ink); line-height: 1.1; }
.lobby-count { display: inline-block; background: var(--ink); color: #fff; padding: .6rem 1.2rem; border-radius: 99px; font-size: clamp(1rem, 1.4vw, 1.4rem); }
.lobby-count b { color: #2fe39b; font-size: 1.3em; }

.pq { flex: 1; display: flex; flex-direction: column; max-width: 1500px; margin: 0 auto; width: 100%; position: relative; }
.pq-head { display: flex; gap: .6rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.pq-num { background: var(--ink); color: #fff; padding: .25rem .7rem; border-radius: 99px; font-weight: 700; font-size: .95rem; }
.pq-tag { background: #fff0d4; color: #8a5a00; padding: .25rem .7rem; border-radius: 99px; font-weight: 700; font-size: .95rem; }
.pq-count { margin-left: auto; font-size: 1.15rem; color: var(--ink-2); }
.pq-count b { font-size: 2rem; color: var(--ink); vertical-align: middle; }
.pq-timer { background: var(--good); color: #fff; padding: .3rem .9rem; border-radius: 99px; font-weight: 900; font-size: 1.5rem; min-width: 90px; text-align: center; }
.pq-timer.low { background: var(--bad); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .65; } }
.pq-title { font-size: clamp(1.6rem, 3.2vw, 3.2rem); line-height: 1.15; margin-bottom: .4em; }
.pq-body { font-size: clamp(1rem, 1.6vw, 1.6rem); color: var(--ink-2); margin-bottom: 1rem; }
.pq-slide .pq-title { font-size: clamp(2.2rem, 5vw, 5rem); margin-top: auto; }
.pq-slide .pq-body { font-size: clamp(1.2rem, 2.2vw, 2.2rem); margin-bottom: auto; }
.pq-content { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.pq-content.with-img { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 2rem; align-items: start; }
.pq-img { width: 100%; max-height: 55vh; object-fit: contain; border-radius: 14px; background: #fff; }
.pq-slide .pq-content.with-img { grid-template-columns: 1fr; }
.pq-res { flex: 1; }
.pq-closed { position: absolute; top: 0; right: 0; background: var(--ink); color: #fff; padding: .4rem .9rem; border-radius: 99px; font-weight: 700; }

.bars { display: flex; flex-direction: column; gap: 1.1vh; }
.bar-lbl { display: flex; align-items: center; gap: .8rem; font-size: clamp(1rem, 1.8vw, 1.8rem); font-weight: 600; margin-bottom: .35rem; }
.bar-key { width: 1.8em; height: 1.8em; border-radius: .4em; background: var(--c); color: #fff; display: grid; place-items: center; font-weight: 900; flex: none; font-size: .85em; }
.bar-text { flex: 1; }
.bar-val { font-weight: 800; white-space: nowrap; }
.bar-track { height: clamp(14px, 2.6vh, 30px); background: #ecebe5; border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--c); border-radius: 99px; transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.bar.correct .bar-text { color: var(--good); font-weight: 800; }
.bar.correct .bar-text::after { content: "  ✓"; }
.bar.correct .bar-track { box-shadow: 0 0 0 3px var(--good); }
.bar.dim { opacity: .45; }
.bars.n2 .bar-lbl, .bars.n3 .bar-lbl { font-size: clamp(1.2rem, 2.2vw, 2.2rem); }
.res-foot { margin-top: 1.4rem; font-size: clamp(1rem, 1.6vw, 1.6rem); font-weight: 700; color: var(--good); }
.hidden-res { text-align: center; padding: 4vh 0; color: var(--ink-2); font-size: clamp(1rem, 1.6vw, 1.6rem); }
.hidden-res .big-n { font-size: clamp(4rem, 10vw, 10rem); font-weight: 900; color: var(--ink); line-height: 1; }
.hidden-res small { display: block; color: var(--muted); margin-top: 1rem; font-size: .7em; }
.pre-opts { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: center; }
.pre-opts span { background: #fff; padding: .6rem 1rem; border-radius: 12px; font-size: clamp(1rem, 1.5vw, 1.5rem); box-shadow: var(--shadow); }
.big-empty { text-align: center; font-size: 1.4rem; padding: 4vh 0; }

.cloud.big { gap: .3rem 1.6rem; padding: 2vh 2vw; min-height: 40vh; align-content: center; }
.cloud.big span { animation: pop .5s both; line-height: 1.05; }

.wall { columns: 4 260px; column-gap: 1rem; }
.wall-card { break-inside: avoid; margin-bottom: 1rem; background: #fff; border-radius: 14px; padding: 1rem 1.1rem; box-shadow: var(--shadow); border-top: 5px solid var(--c);
  position: relative; animation: pop .4s; }
.wc-t { font-size: clamp(1rem, 1.4vw, 1.4rem); font-weight: 600; }
.wc-n { color: var(--muted); font-size: .9rem; margin-top: .4rem; }
.wc-hide { position: absolute; top: .4rem; right: .4rem; border: 0; background: #f1f0ec; border-radius: 50%; width: 26px; height: 26px; cursor: pointer; opacity: 0; transition: opacity .15s; }
.wall-card:hover .wc-hide { opacity: 1; }

.scale-res { display: grid; grid-template-columns: auto 1fr; gap: 4vw; align-items: end; }
.avg { text-align: center; }
.avg-n { font-size: clamp(4rem, 9vw, 9rem); font-weight: 900; line-height: 1; }
.avg-stars { font-size: clamp(1.6rem, 3vw, 3rem); letter-spacing: .05em; }
.star { position: relative; color: #e0ddd4; display: inline-block; }
.star span { position: absolute; left: 0; top: 0; overflow: hidden; color: #ffb020; white-space: nowrap; }
.cols { display: flex; align-items: flex-end; gap: 1.2vw; height: 42vh; border-bottom: 3px solid var(--ink); padding: 0 1vw; }
.col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; position: relative; }
.col-bar { width: 100%; max-width: 120px; border-radius: 10px 10px 0 0; transition: height .9s cubic-bezier(.2, .8, .2, 1); min-height: 3px; }
.col-n { font-weight: 800; font-size: clamp(1rem, 1.6vw, 1.6rem); margin-bottom: .3rem; }
.col-l { position: absolute; bottom: -2.2em; font-weight: 700; font-size: clamp(.85rem, 1.3vw, 1.3rem); white-space: nowrap; }
.scale-lbls { display: flex; justify-content: space-between; margin-top: 3rem; font-size: 1.2rem; color: var(--muted); }
.hist .col-bar { background: var(--c1); }
.hist .col.has-correct .col-bar { background: var(--good); }
.hist .col-l { font-size: clamp(.7rem, 1vw, 1rem); }

.rank-res { display: flex; flex-direction: column; gap: 1.4vh; }
.rk-row { display: grid; grid-template-columns: 3rem minmax(0, 1.2fr) 2fr auto; gap: 1rem; align-items: center; font-size: clamp(1rem, 1.7vw, 1.7rem); }
.rk-pos { width: 2.2em; height: 2.2em; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: .8em; }
.rk-l { font-weight: 700; }
.rk-track { height: 24px; background: #ecebe5; border-radius: 99px; overflow: hidden; }
.rk-fill { height: 100%; border-radius: 99px; transition: width .9s; }
.rk-v { color: var(--muted); font-size: .7em; white-space: nowrap; }
.correct-order { margin-top: 1.5rem; background: #e3f7ee; color: #0d6e4d; padding: .8rem 1.2rem; border-radius: 12px; font-weight: 700; font-size: clamp(1rem, 1.4vw, 1.4rem); }

.num-res .num-cards { gap: 1.2rem; margin-bottom: 2rem; }
.num-res .nc { padding: 1rem 1.6rem; }
.num-res .nc small { font-size: 1rem; }
.num-res .nc b { font-size: clamp(1.6rem, 3vw, 3rem); }
.num-res .cols { height: 32vh; }
.closest { margin-top: 3.5rem; font-size: clamp(1rem, 1.5vw, 1.5rem); }

.board, .qa-board { max-width: 1100px; margin: 0 auto; width: 100%; text-align: center; }
.board h1, .qa-board h1 { font-size: clamp(2rem, 4vw, 4rem); }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 1.5vw; margin: 2vh 0 3vh; }
.pod { width: min(24vw, 260px); display: flex; flex-direction: column; align-items: center; animation: pop .6s both; }
.pod.p1 { animation-delay: .5s; } .pod.p2 { animation-delay: .25s; }
.pod-name { font-weight: 800; font-size: clamp(1.1rem, 2vw, 2rem); margin-bottom: .2rem; }
.pod-pts { color: var(--ink-2); margin-bottom: .6rem; font-size: clamp(.9rem, 1.3vw, 1.3rem); }
.pod-block { width: 100%; border-radius: 14px 14px 0 0; display: grid; place-items: center; color: #fff; font-size: clamp(2rem, 4vw, 4rem); font-weight: 900; }
.pod.p1 .pod-block { height: 28vh; background: linear-gradient(#ffc93c, #f0a500); }
.pod.p2 .pod-block { height: 20vh; background: linear-gradient(#c9ced8, #9aa3b2); }
.pod.p3 .pod-block { height: 14vh; background: linear-gradient(#e8a77b, #c97a46); }
.board-rest { max-width: 640px; margin: 0 auto; text-align: left; padding-left: 2rem; font-size: clamp(1rem, 1.4vw, 1.4rem); }
.board-rest li { padding: .35rem 0; }
.board-rest li span { display: inline-block; min-width: 70%; }

.qa-cards { display: flex; flex-direction: column; gap: .8rem; text-align: left; }
.qa-card { display: flex; gap: 1rem; align-items: center; background: #fff; border-radius: 14px; padding: 1rem 1.2rem; box-shadow: var(--shadow); }
.qa-card.answered { opacity: .5; }
.qa-card.pending { border: 2px dashed var(--warn); }
.qa-likes { display: flex; flex-direction: column; align-items: center; color: var(--accent); font-weight: 900; min-width: 50px; }
.qa-likes b { font-size: 1.6rem; color: var(--ink); }
.qa-body { flex: 1; }
.qa-t { font-size: clamp(1.1rem, 1.8vw, 1.8rem); font-weight: 600; }
.qa-n { color: var(--muted); }
.qa-acts { display: flex; gap: .3rem; }
.qa-acts button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: .4rem .6rem; cursor: pointer; font-weight: 700; }
.qa-acts button:hover { border-color: var(--accent); }

@media (max-width: 900px) {
  .pr-stage { padding: 1rem; }
  .pr-title { display: none; }
  .lobby { grid-template-columns: 1fr; text-align: center; }
  .lobby-qr { width: min(70vw, 340px); margin: 0 auto; }
  .steps { text-align: left; display: inline-block; }
  .pq-content.with-img, .scale-res { grid-template-columns: 1fr; }
  .rk-row { grid-template-columns: 2.5rem 1fr; }
  .rk-track, .rk-v { grid-column: 2; }
  .qr-overlay { flex-direction: column; }
  .qr-big { width: min(80vw, 60vh); }
  .qr-info { font-size: 5vw; text-align: center; }
  .qr-host { font-size: 7vw; } .qr-code { font-size: 12vw; }
}
