:root {
  --bg: #f3f1ec;
  --panel: #ffffff;
  --ink: #1b1f2a;
  --muted: #6b7180;
  --line: #e4e1da;
  --soft: #f7f6f2;
  --accent: #4f46e5;
  --accent-ink: #ffffff;
  --accent-soft: #ecebff;
  --ok: #1f9d55;
  --bad: #d93a3f;
  --warn: #e0a100;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 20, 40, .06), 0 6px 24px rgba(20, 20, 40, .08);
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
a { color: var(--accent); }
.hidden { display: none !important; }

/* ---------- Botones y campos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  border: 1px solid var(--line); background: var(--panel); border-radius: 10px;
  padding: .55em .95em; font-weight: 700; cursor: pointer; text-decoration: none; color: var(--ink);
  transition: transform .08s, background .15s, border-color .15s; white-space: nowrap;
}
.btn:hover { border-color: #cfcbc2; background: var(--soft); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(0,0,0,.05); }
.btn.big { font-size: 1.15rem; padding: .8em 1.4em; border-radius: 14px; }
.btn.sm { font-size: .82rem; padding: .35em .6em; border-radius: 8px; }
.btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: .6em .75em; background: #fff;
}
.input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
textarea.input { resize: vertical; min-height: 70px; }
label.field { display: grid; gap: .3em; font-size: .85rem; font-weight: 700; color: var(--muted); }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: .3em; padding: .2em .6em; border-radius: 99px; background: var(--soft); border: 1px solid var(--line); font-size: .8rem; font-weight: 700; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .45rem 0; font-weight: 600; }
.switch input { width: 40px; height: 22px; appearance: none; background: #d6d3cc; border-radius: 99px; position: relative; cursor: pointer; transition: .15s; flex: none; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { left: 21px; }

/* ---------- Avisos ---------- */
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 9999; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 10px; font-weight: 700; box-shadow: var(--shadow); animation: up .25s ease; }
.toast.ok { background: var(--ok); } .toast.bad { background: var(--bad); }
.toast.out { opacity: 0; transition: opacity .4s; }
@keyframes up { from { transform: translateY(10px); opacity: 0; } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 9998; }

/* ---------- Portada ---------- */
.landing { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(circle at 15% 20%, #ffe3a8 0, transparent 35%), radial-gradient(circle at 85% 80%, #c9d6ff 0, transparent 40%), var(--bg); }
.landing-card { width: min(440px, 100%); background: var(--panel); border-radius: 22px; padding: 28px; box-shadow: var(--shadow); display: grid; gap: 16px; text-align: center; }
.logo { font-weight: 900; font-size: 1.9rem; letter-spacing: -.02em; display: inline-flex; gap: .3em; align-items: center; justify-content: center; }
.logo .mark { width: 1.3em; height: 1.3em; border-radius: .35em; background: conic-gradient(from 200deg, #e5484d, #f5a524, #30a46c, #3e63dd, #8e4ec6, #e5484d); display: inline-grid; place-items: center; color: #fff; font-size: .8em; }
.pin-input { font-size: 2rem; text-align: center; letter-spacing: .25em; font-weight: 900; padding: .45em; border-radius: 14px; border: 2px solid var(--line); width: 100%; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------- Consola del profesor ---------- */
.host { display: grid; grid-template-rows: auto 1fr; height: 100vh; height: 100dvh; overflow: hidden; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--panel); border-bottom: 1px solid var(--line); min-width: 0; }
.topbar .logo { font-size: 1.15rem; }
.room-title { font-weight: 800; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: .25em .4em; min-width: 80px; max-width: 260px; }
.room-title:hover { border-color: var(--line); }
.pin-chip { display: inline-flex; align-items: center; gap: .5em; background: var(--ink); color: #fff; border-radius: 10px; padding: .35em .75em; font-weight: 800; cursor: pointer; border: 0; }
.pin-chip b { font-size: 1.15rem; letter-spacing: .12em; }
.host-main { display: grid; grid-template-columns: 56px 1fr 340px; min-height: 0; }
.host-main.collapsed { grid-template-columns: 56px 1fr 0; }
.host-main.collapsed .side { display: none; }

.tools { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; overflow-y: auto; }
.tool { width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; font-size: 18px; color: var(--ink); position: relative; flex: none; }
.tool:hover { background: var(--soft); }
.tool.on { background: var(--accent-soft); color: var(--accent); }
.tool svg { width: 20px; height: 20px; }
.tool-sep { width: 28px; height: 1px; background: var(--line); margin: 4px 0; flex: none; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; flex: none; }
.swatch.on { box-shadow: 0 0 0 2px var(--accent); }

.stage-area { display: grid; grid-template-rows: auto 1fr auto; min-width: 0; min-height: 0; background: #e9e6df; }
.stage-tabs { display: flex; gap: 4px; padding: 8px 12px 0; overflow-x: auto; scrollbar-width: none; }
.stage-tabs::-webkit-scrollbar { display: none; }
.stage-tab { border: 0; background: transparent; padding: .5em .9em; border-radius: 10px 10px 0 0; font-weight: 800; color: var(--muted); cursor: pointer; white-space: nowrap; }
.stage-tab.on { background: var(--panel); color: var(--ink); }
.stage-tab .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-left: 4px; vertical-align: middle; }
.stage-wrap { position: relative; margin: 0 12px; background: #dcd8cf; border-radius: 0 var(--radius) var(--radius) var(--radius); min-height: 0; overflow: hidden; display: grid; place-items: center; padding: 10px; }
.stage { position: relative; width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden; }
.board-wrap { position: absolute; inset: 0; display: grid; place-items: center; }
.board-canvas { border-radius: 8px; box-shadow: 0 0 0 1px var(--line), 0 6px 20px rgba(0,0,0,.08); background: #fff; touch-action: none; }
.board-editor { position: absolute; border: 2px dashed var(--accent); border-radius: 6px; outline: none; resize: none; font-family: var(--font); font-weight: 600; line-height: 1.25; overflow: hidden; z-index: 5; }
.board-editor.sticky { border-style: solid; box-shadow: 0 8px 20px rgba(0,0,0,.2); line-height: 1.23; }
.overlay { position: absolute; inset: 0; background: var(--panel); overflow: auto; display: flex; flex-direction: column; z-index: 4; }
.stage-foot { display: flex; align-items: center; gap: 8px; padding: 8px 12px; min-height: 52px; flex-wrap: wrap; }
.page-nav { display: flex; align-items: center; gap: 4px; }
.page-thumb { width: 54px; height: 31px; border-radius: 5px; border: 2px solid var(--line); background: #fff; cursor: pointer; font-size: .7rem; font-weight: 800; color: var(--muted); display: grid; place-items: center; flex: none; }
.page-thumb.on { border-color: var(--accent); color: var(--accent); }
.page-strip { display: flex; gap: 4px; overflow-x: auto; max-width: 40vw; padding: 2px; }
.reactions-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 6; }
.float-emoji { position: absolute; bottom: -40px; font-size: 42px; animation: floatUp 3.2s ease-out forwards; display: grid; justify-items: center; }
.float-emoji small { font-size: 12px; font-weight: 800; background: rgba(255,255,255,.9); padding: 0 6px; border-radius: 6px; }
@keyframes floatUp { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: 1; transform: translateY(-80px) scale(1.1); } 100% { transform: translateY(-520px) scale(1); opacity: 0; } }
.timer-badge { position: absolute; top: 12px; right: 12px; z-index: 7; background: var(--ink); color: #fff; font-weight: 900; font-size: 1.6rem; padding: .2em .6em; border-radius: 12px; font-variant-numeric: tabular-nums; box-shadow: var(--shadow); }
.timer-badge.low { background: var(--bad); animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.collab-badge { position: absolute; top: 12px; left: 12px; z-index: 7; }

.side { background: var(--panel); border-left: 1px solid var(--line); display: grid; grid-template-rows: auto 1fr; min-height: 0; }
.side-tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.side-tab { border: 0; background: transparent; padding: .7em .2em; font-weight: 800; font-size: .82rem; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; position: relative; }
.side-tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.side-tab .badge { position: absolute; top: 4px; right: 8px; background: var(--bad); color: #fff; font-size: .65rem; border-radius: 99px; padding: 0 5px; }
.side-body { overflow-y: auto; padding: 14px; display: grid; gap: 12px; align-content: start; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; gap: 10px; background: #fff; }
.card h4 { margin: 0; font-size: .95rem; }
.section-title { font-size: .75rem; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 4px; }
.launch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.launch { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 10px; text-align: left; cursor: pointer; display: grid; gap: 2px; }
.launch:hover { border-color: var(--accent); background: var(--accent-soft); }
.launch .ico { font-size: 1.4rem; }
.launch b { font-size: .9rem; }
.launch small { color: var(--muted); font-size: .75rem; line-height: 1.2; }
.lib-item { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
.lib-item .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.player-row { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--soft); }
.player-row .av { font-size: 1.4rem; }
.player-row .nm { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-row.off { opacity: .45; }
.player-row .hand { animation: wave 1s infinite; display: inline-block; }
@keyframes wave { 50% { transform: rotate(18deg); } }
.qa-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; gap: 6px; }
.qa-item.answered { opacity: .5; }
.qa-item .votes { font-weight: 900; color: var(--accent); }

/* Constructor de dinámicas */
.modal-back { position: fixed; inset: 0; background: rgba(20, 20, 30, .45); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: var(--panel); border-radius: 18px; width: min(760px, 100%); max-height: 92vh; display: grid; grid-template-rows: auto 1fr auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-head, .modal-foot { padding: 14px 18px; display: flex; align-items: center; gap: 8px; }
.modal-head { border-bottom: 1px solid var(--line); }
.modal-foot { border-top: 1px solid var(--line); justify-content: flex-end; flex-wrap: wrap; }
.modal-body { overflow-y: auto; padding: 16px 18px; display: grid; gap: 12px; align-content: start; }
.q-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 8px; background: var(--soft); }
.opt-row { display: grid; grid-template-columns: 30px 1fr auto; gap: 6px; align-items: center; }
.opt-row .letter { width: 28px; height: 28px; border-radius: 8px; color: #fff; font-weight: 900; display: grid; place-items: center; }
.opt-row input[type=radio] { width: 20px; height: 20px; accent-color: var(--ok); }
.share-qr { width: min(320px, 70vw); aspect-ratio: 1; background: #fff; border-radius: 16px; padding: 10px; }
.share-big { text-align: center; display: grid; gap: 10px; justify-items: center; }
.share-pin { font-size: 3.4rem; font-weight: 900; letter-spacing: .12em; }

/* ---------- Vistas del escenario (proyector) ---------- */
.view { flex: 1; display: flex; flex-direction: column; padding: clamp(14px, 3vw, 32px); gap: 16px; min-height: 0; }
.view-head { display: flex; align-items: flex-start; gap: 12px; }
.view-title { font-size: clamp(1.3rem, 3vw, 2.4rem); font-weight: 900; flex: 1; }
.kicker { font-size: .8rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.count-pill { background: var(--soft); border: 1px solid var(--line); border-radius: 99px; padding: .3em .8em; font-weight: 900; white-space: nowrap; }
.bars { flex: 1; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 14px; min-height: 200px; align-items: end; }
.bar { display: grid; grid-template-rows: 1fr auto; height: 100%; gap: 8px; min-width: 0; }
.bar-track { display: flex; align-items: flex-end; background: var(--soft); border-radius: 12px; overflow: hidden; }
.bar-fill { width: 100%; min-height: 6px; border-radius: 12px 12px 0 0; transition: height .5s cubic-bezier(.2,.9,.3,1.2); display: flex; justify-content: center; }
.bar-n { color: #fff; font-weight: 900; font-size: 1.4rem; padding-top: 6px; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.bar-n small { font-size: .7em; opacity: .85; }
.bar-label { font-weight: 800; text-align: center; font-size: clamp(.8rem, 1.4vw, 1.05rem); overflow-wrap: anywhere; }
.bar-label b { display: inline-grid; place-items: center; width: 1.5em; height: 1.5em; border-radius: 6px; color: #fff; font-size: .85em; }
.bar.dim { opacity: .4; }
.bar.correct .bar-label { color: var(--ok); }
.cloud { flex: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; align-content: center; gap: 6px 18px; padding: 10px; }
.cloud-word { animation: popIn .4s ease backwards; line-height: 1.05; }
@keyframes popIn { from { transform: scale(.3); opacity: 0; } }
.wall { columns: 4 220px; column-gap: 12px; }
.post { break-inside: avoid; margin-bottom: 12px; border-radius: 12px; padding: 12px 14px; font-weight: 700; font-size: 1.05rem; box-shadow: 0 2px 8px rgba(0,0,0,.08); animation: popIn .35s ease backwards; position: relative; overflow-wrap: anywhere; }
.post .by { font-size: .78rem; color: rgba(0,0,0,.55); margin-top: 6px; display: flex; gap: 8px; align-items: center; }
.post.star { outline: 3px solid var(--warn); }
.post.hiddenpost { opacity: .35; }
.post .post-actions { display: flex; gap: 4px; margin-top: 6px; }
.scale-view { flex: 1; display: grid; gap: 16px; align-content: center; }
.scale-avg { font-size: clamp(3rem, 9vw, 6rem); font-weight: 900; text-align: center; line-height: 1; }
.scale-track { height: 18px; border-radius: 99px; background: linear-gradient(90deg, #e5484d, #f5a524, #30a46c); position: relative; }
.scale-marker { position: absolute; top: 50%; width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 4px solid var(--ink); transform: translate(-50%, -50%); transition: left .5s; }
.scale-labels { display: flex; justify-content: space-between; font-weight: 800; color: var(--muted); }

/* Quiz */
.quiz-q { font-size: clamp(1.4rem, 3.6vw, 2.8rem); font-weight: 900; text-align: center; line-height: 1.15; }
.quiz-img { max-height: 32vh; max-width: 100%; border-radius: 12px; align-self: center; object-fit: contain; }
.quiz-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quiz-opt { border-radius: 14px; color: #fff; font-weight: 900; font-size: clamp(1rem, 2vw, 1.5rem); padding: .8em 1em; display: flex; align-items: center; gap: .6em; min-height: 70px; border: 0; text-align: left; transition: opacity .3s, transform .3s; }
.quiz-opt .ic { font-size: 1.3em; opacity: .9; }
.quiz-opt.dim { opacity: .3; }
.quiz-opt.correct { transform: scale(1.02); box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--ok); }
.quiz-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ring { --p: 1; width: 86px; height: 86px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 2rem; background: conic-gradient(var(--accent) calc(var(--p) * 360deg), var(--soft) 0); position: relative; flex: none; }
.ring::before { content: ''; position: absolute; inset: 8px; background: var(--panel); border-radius: 50%; }
.ring span { position: relative; }
.ring.low { background: conic-gradient(var(--bad) calc(var(--p) * 360deg), var(--soft) 0); }
.big-center { flex: 1; display: grid; place-items: center; text-align: center; gap: 14px; align-content: center; }
.lobby-avs { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 900px; }
.lobby-av { background: var(--soft); border: 1px solid var(--line); border-radius: 99px; padding: .35em .8em; font-weight: 800; animation: popIn .3s ease backwards; }
.leader { display: grid; gap: 14px; width: 100%; max-width: 900px; margin: 0 auto; }
.leader-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.leader-list li { display: grid; grid-template-columns: 34px 36px minmax(80px, 1fr) 2fr auto; align-items: center; gap: 10px; background: var(--soft); border-radius: 12px; padding: 8px 12px; font-weight: 800; animation: slideIn .4s ease backwards; }
.leader-list li:nth-child(2) { animation-delay: .05s; } .leader-list li:nth-child(3) { animation-delay: .1s; } .leader-list li:nth-child(4) { animation-delay: .15s; } .leader-list li:nth-child(5) { animation-delay: .2s; }
@keyframes slideIn { from { transform: translateX(-30px); opacity: 0; } }
.leader-list li.me { outline: 3px solid var(--accent); }
.leader-list .rank { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #fff; }
.leader-list .top1 .rank { background: #ffd34d; } .leader-list .top2 .rank { background: #d9dde6; } .leader-list .top3 .rank { background: #f0b27a; }
.leader-list .av { font-size: 1.5rem; }
.leader-list .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-track { height: 12px; background: #fff; border-radius: 99px; overflow: hidden; }
.lb-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #8e4ec6); border-radius: 99px; transition: width .7s cubic-bezier(.2,.9,.3,1); }
.leader-me { text-align: center; font-weight: 800; color: var(--accent); }
.streak { color: #f76b15; }
.team-race { display: grid; gap: 8px; }
.race-row { display: grid; grid-template-columns: 100px 1fr; gap: 10px; align-items: center; font-weight: 800; }
.race-track { background: var(--soft); border-radius: 99px; height: 30px; overflow: hidden; }
.race-fill { height: 100%; border-radius: 99px; display: flex; justify-content: flex-end; align-items: center; padding-right: 10px; color: #fff; transition: width .8s; }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: end; max-width: 640px; margin: 0 auto; width: 100%; }
.pod { display: grid; justify-items: center; gap: 4px; animation: up .6s ease backwards; }
.pod1 { animation-delay: 1.2s; } .pod2 { animation-delay: .6s; } .pod3 { animation-delay: .2s; }
.pod-av { font-size: 3rem; } .pod-nm { font-weight: 900; text-align: center; overflow-wrap: anywhere; } .pod-pts { font-weight: 800; color: var(--muted); }
.pod-block { width: 100%; border-radius: 12px 12px 0 0; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 2rem; }
.pod1 .pod-block { height: 170px; background: #f5a524; } .pod2 .pod-block { height: 120px; background: #8b93a7; } .pod3 .pod-block { height: 90px; background: #c9773b; }

.wheel-view { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; justify-items: center; min-height: 0; }
.wheel-canvas { width: min(64vh, 100%); aspect-ratio: 1; max-width: 560px; }
.wheel-result { font-size: clamp(1.6rem, 4vw, 3rem); font-weight: 900; text-align: center; animation: popIn .4s ease; }
.teams { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.team-card { border: 3px solid; border-radius: 14px; overflow: hidden; background: #fff; }
.team-card h3 { color: #fff; padding: 10px 12px; font-size: 1.1rem; }
.team-card ul { list-style: none; margin: 0; padding: 10px 12px; display: grid; gap: 4px; font-weight: 700; }
.team-card li.me { color: var(--accent); font-weight: 900; }
.media { flex: 1; display: grid; place-items: center; gap: 12px; padding: 16px; min-height: 0; align-content: center; }
.media img, .media video { max-width: 100%; max-height: 70vh; border-radius: 12px; }
.media iframe { width: min(100%, 1100px); aspect-ratio: 16/9; border: 0; border-radius: 12px; background: #000; }
.media-cap { font-size: 1.2rem; font-weight: 800; text-align: center; white-space: pre-wrap; }
.media-text .big-text { font-size: clamp(1.6rem, 4.5vw, 3.6rem); font-weight: 900; text-align: center; white-space: pre-wrap; line-height: 1.2; max-width: 1100px; }
.audio-ico { font-size: 4rem; }
.spot { flex: 1; display: grid; place-items: center; padding: 30px; }
.spot-card { background: #fff3a3; border-radius: 20px; padding: clamp(20px, 4vw, 48px); max-width: 900px; box-shadow: 0 20px 50px rgba(0,0,0,.15); font-size: clamp(1.4rem, 3.5vw, 2.6rem); font-weight: 800; text-align: center; animation: popIn .4s; overflow-wrap: anywhere; }
.spot-card small { display: block; font-size: 1rem; margin-top: 12px; color: rgba(0,0,0,.55); }
.empty { color: var(--muted); font-weight: 700; text-align: center; padding: 30px; }

/* ---------- Alumno ---------- */
.play { min-height: 100%; display: grid; grid-template-rows: auto 1fr auto; height: 100dvh; }
.play-top { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
.play-top .me-av { font-size: 1.6rem; }
.play-top .me-nm { font-weight: 900; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-pill { background: var(--ink); color: #fff; border-radius: 99px; padding: .25em .8em; font-weight: 900; font-variant-numeric: tabular-nums; }
.play-main { position: relative; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.play-board { flex: 1; position: relative; min-height: 220px; }
.play-bottom { display: flex; gap: 6px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--line); overflow-x: auto; align-items: center; }
.react-btn { font-size: 1.5rem; border: 0; background: var(--soft); border-radius: 12px; width: 46px; height: 46px; flex: none; cursor: pointer; }
.react-btn:active { transform: scale(.9); }
.answer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; flex: 1; padding: 12px; }
.answer-btn { border: 0; border-radius: 16px; color: #fff; font-weight: 900; font-size: 1.15rem; padding: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 110px; cursor: pointer; box-shadow: inset 0 -5px 0 rgba(0,0,0,.18); text-align: center; overflow-wrap: anywhere; }
.answer-btn .ic { font-size: 1.8rem; }
.answer-btn:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 rgba(0,0,0,.18); }
.answer-btn.picked { outline: 4px solid var(--ink); outline-offset: 2px; }
.answer-btn.faded { opacity: .35; }
.feedback { flex: 1; display: grid; place-items: center; align-content: center; gap: 10px; text-align: center; padding: 24px; color: #fff; }
.feedback.ok { background: var(--ok); } .feedback.bad { background: var(--bad); } .feedback.wait { background: var(--accent); }
.feedback .big { font-size: 4rem; } .feedback h2 { font-size: 2rem; }
.feedback .pts { font-size: 1.5rem; font-weight: 900; background: rgba(0,0,0,.18); padding: .2em .8em; border-radius: 99px; }
.play-card { background: var(--panel); border-radius: 16px; margin: 12px; padding: 16px; display: grid; gap: 12px; box-shadow: var(--shadow); }
.play-q { font-size: 1.3rem; font-weight: 900; }
.choice { border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 12px 14px; font-weight: 800; text-align: left; cursor: pointer; display: flex; gap: 10px; align-items: center; }
.choice.on { border-color: var(--accent); background: var(--accent-soft); }
.choice b { width: 28px; height: 28px; border-radius: 8px; color: #fff; display: grid; place-items: center; flex: none; }
.scale-btns { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.scale-btns button { aspect-ratio: 1; border-radius: 12px; border: 2px solid var(--line); background: #fff; font-weight: 900; font-size: 1.2rem; cursor: pointer; }
.scale-btns button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.avatar-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.avatar-grid button { font-size: 1.6rem; aspect-ratio: 1; border-radius: 12px; border: 2px solid transparent; background: var(--soft); cursor: pointer; padding: 0; }
.avatar-grid button.on { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.08); }
.draw-bar { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; gap: 4px; background: var(--panel); padding: 6px; border-radius: 14px; box-shadow: var(--shadow); z-index: 5; align-items: center; overflow-x: auto; width: max-content; max-width: calc(100% - 16px); margin: 0 auto; }
.zoom-ctl { position: absolute; right: 10px; top: 10px; display: flex; gap: 4px; z-index: 5; }
.rotate-hint { display: none; position: absolute; top: 12px; left: 12px; z-index: 5; }
@media (orientation: portrait) and (max-width: 600px) { .rotate-hint { display: inline-flex; } }
.notice { background: #fff8db; border: 1px solid #f2dc8b; border-radius: 12px; padding: 10px 12px; font-weight: 700; }

@media (max-width: 1100px) {
  .host-main { grid-template-columns: 52px 1fr 300px; }
}
@media (max-width: 860px) {
  .host-main { grid-template-columns: 52px 1fr; }
  .side { position: fixed; right: 0; top: 54px; bottom: 0; width: min(360px, 92vw); z-index: 50; box-shadow: -10px 0 30px rgba(0,0,0,.15); }
  .host-main.collapsed .side { display: none; }
  .topbar .hide-sm { display: none; }
  .quiz-opts { grid-template-columns: 1fr; }
  .wheel-view { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .answer-grid { grid-template-columns: 1fr 1fr; }
  .avatar-grid { grid-template-columns: repeat(6, 1fr); }
  .leader-list li { grid-template-columns: 28px 30px 1fr auto; }
  .leader-list .lb-track { display: none; }
}

/* Modo proyector: solo el escenario */
body.projector .topbar, body.projector .tools, body.projector .side, body.projector .stage-tabs, body.projector .stage-foot { display: none !important; }
body.projector .host { grid-template-rows: 1fr; }
body.projector .host-main { grid-template-columns: 1fr !important; }
body.projector .stage-wrap { margin: 0; border-radius: 0; }
.exit-projector { position: fixed; bottom: 12px; right: 12px; z-index: 200; opacity: .25; }
.exit-projector:hover { opacity: 1; }
.join-banner { pointer-events: none; position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 7; background: rgba(27,31,42,.92); color: #fff; border-radius: 12px; padding: .35em .9em; font-weight: 800; display: flex; gap: 10px; align-items: center; }
.join-banner b { font-size: 1.3em; letter-spacing: .1em; }
