:root {
  --bg: #0a0a0d; --panel: #131318; --panel2: #1a1a21; --line: #2a2a33;
  --text: #f4f4f5; --muted: #a1a1aa; --danger: #ef4444; --ok: #22c55e;
  --radius: 14px; --accent: #22c55e;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.fine { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.opt { font-weight: 400; color: var(--muted); }
.error { background: #3a1214; border: 1px solid #7f1d1d; color: #fecaca; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.ok { background: #0f2a1a; border: 1px solid #166534; color: #bbf7d0; padding: 10px 12px; border-radius: 10px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.logo { max-height: 36px; width: auto; display: block; margin-bottom: 18px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Botones y campos */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: 12px 18px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; min-height: 44px; transition: transform .15s ease, filter .15s ease; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-lg { padding: 16px 26px; font-size: 18px; }
.btn-sm { padding: 8px 12px; min-height: 36px; font-size: 14px; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-danger { background: var(--danger); }
.btn-pulse { animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 50% { box-shadow: 0 0 0 10px transparent; } }
@media (prefers-reduced-motion: reduce) { .btn-pulse { animation: none; } * { transition: none !important; } }
button.link { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: 13px; padding: 4px 6px; min-height: 32px; }
label, .label { display: block; font-size: 14px; font-weight: 600; margin: 14px 0 6px; }
input, select, textarea { width: 100%; background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font: inherit; min-height: 46px; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--accent); }
input[type=color] { padding: 4px; height: 46px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }

/* Cuenta regresiva */
.countdown { display: flex; gap: 8px; margin: 6px 0 4px; }
.countdown div { flex: 1; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; text-align: center; padding: 8px 4px; }
.countdown b { display: block; font-size: 24px; font-variant-numeric: tabular-nums; }
.countdown span { font-size: 12px; color: var(--muted); }

/* Registro */
.reg { max-width: 1120px; margin: 0 auto; padding: 32px 20px 60px; display: grid; gap: 32px; }
@media (min-width: 900px) { .reg { grid-template-columns: 1fr 400px; align-items: start; padding-top: 56px; } .reg-card { position: sticky; top: 24px; } }
.eyebrow { display: inline-block; color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; margin-bottom: 10px; }
.reg h1 { font-size: clamp(30px, 5vw, 48px); font-weight: 800; letter-spacing: -.02em; }
.lead { font-size: 19px; color: #d4d4d8; }
.cover { width: 100%; border-radius: var(--radius); margin: 18px 0; aspect-ratio: 16/9; object-fit: cover; background: var(--panel); }
.cover-photo { aspect-ratio: 4/3; }
.desc { color: #d4d4d8; }
.bullets { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 10px; }
.bullets li { padding: 12px 14px 12px 44px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; position: relative; }
.bullets li::before { content: "✓"; position: absolute; left: 14px; top: 11px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; display: grid; place-items: center; font-weight: 800; }
.presenter { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.presenter img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.presenter b { display: block; }
.presenter span { color: var(--muted); font-size: 14px; }
.reg-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.reg-card h2 { font-size: 22px; }
.reg-card form .btn { margin-top: 18px; }

/* Páginas centradas */
.center-page { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 28px; width: 100%; }
.narrow { max-width: 520px; }
.check { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font-size: 28px; font-weight: 800; margin-bottom: 14px; }
.when { font-weight: 600; }
.when::first-letter { text-transform: uppercase; }
.copy { display: flex; gap: 8px; }
.copy input { flex: 1; min-width: 0; }
.card .row { margin-top: 16px; }

/* Sala */
body.dark { background: #07070a; }
.room { display: grid; grid-template-rows: auto auto 1fr; min-height: 100dvh; }
.room-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
.room-title { display: flex; align-items: center; gap: 10px; font-weight: 700; min-width: 0; }
.room-title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-title .logo { margin: 0; max-height: 26px; }
.room-meta { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.meta { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.badge.live { background: #dc2626; color: #fff; font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 6px; letter-spacing: .05em; }
.stage { padding: 12px; display: grid; gap: 12px; align-content: start; }
.screen { position: relative; aspect-ratio: 16/9; background: #000; border-radius: 12px; overflow: hidden; }
.screen:fullscreen { border-radius: 0; }
.player, .player iframe, .player video, .player > div { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player video { object-fit: contain; background: #000; }
.player vturb-smartplayer { position: absolute; inset: 0; display: block; width: 100%; }
.player::after { content: ""; position: absolute; inset: 0; } /* escudo: el asistente no puede pausar ni adelantar */
.replay .player::after { display: none; }
.state { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; padding: 20px; background: radial-gradient(circle at 50% 30%, #1d1d26, #050507); }
.state .big { font-size: clamp(20px, 3vw, 30px); font-weight: 800; margin: 0; }
.state .muted { max-width: 440px; margin: 0; }
.big-count { font-size: clamp(36px, 7vw, 72px); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.state .presenter { margin: 6px 0; text-align: left; }
.spinner { width: 38px; height: 38px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.controls { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 28px 12px 10px; z-index: 2; background: linear-gradient(transparent, rgba(0,0,0,.75)); }
.controls button { background: rgba(0,0,0,.55); color: #fff; border: 1px solid rgba(255,255,255,.2); border-radius: 10px; min-width: 44px; min-height: 44px; font-size: 16px; cursor: pointer; padding: 0 12px; font-family: inherit; font-weight: 700; }
.controls #seek { flex: 1; min-width: 60px; min-height: 0; height: 6px; padding: 0; border: 0; border-radius: 999px; accent-color: #ef4444; background: rgba(255,255,255,.25); cursor: pointer; }
.controls .ctime { color: #fff; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.controls .livebtn { font-size: 13px; letter-spacing: .03em; }
.controls .livebtn.on { background: #dc2626; border-color: #dc2626; }
.controls.no-dvr { justify-content: flex-end; }
.controls.no-dvr .dvr { display: none; }
@media (max-width: 520px) { .controls { gap: 6px; padding: 24px 8px 8px; } .controls .ctime { display: none; } .controls button { min-width: 40px; padding: 0 8px; } }
.offer { display: flex; gap: 14px; align-items: center; background: var(--panel); border: 2px solid var(--accent); border-radius: var(--radius); padding: 14px; animation: rise .3s ease-out; }
.offer img { width: 110px; height: 110px; object-fit: cover; border-radius: 10px; flex-shrink: 0; }
.offer-body { flex: 1; min-width: 0; }
.offer h3 { font-size: 19px; margin-bottom: 4px; }
.offer p { margin: 0 0 10px; color: #d4d4d8; font-size: 15px; }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }
.side { display: flex; flex-direction: column; background: var(--panel); border-top: 1px solid var(--line); min-height: 420px; }
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; background: none; border: 0; color: var(--muted); padding: 12px; font: inherit; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; min-height: 44px; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.pane { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.pin { display: flex; gap: 8px; margin: 10px 10px 0; padding: 10px 12px; background: color-mix(in srgb, var(--accent) 14%, var(--panel2)); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 10px; font-size: 14px; }
.chat { list-style: none; margin: 0; padding: 10px; overflow-y: auto; flex: 1; min-height: 220px; max-height: 60vh; display: flex; flex-direction: column; gap: 8px; }
.msg { background: var(--panel2); border-radius: 10px; padding: 8px 10px; font-size: 14px; }
.msg p { margin: 2px 0 0; word-wrap: break-word; white-space: pre-wrap; }
.msg-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.msg.host { border-left: 3px solid var(--accent); }
.msg.private { background: #1d1a2e; }
.msg.mine { background: #182118; }
.tag-host { background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 5px; }
.tag-priv { background: #3b3360; color: #ddd6fe; font-size: 11px; padding: 1px 6px; border-radius: 5px; }
.hidden-msg { opacity: .4; }
.msg-actions { display: flex; gap: 4px; margin-top: 2px; }
.chat-form { border-top: 1px solid var(--line); padding: 10px; }
.chat-to { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.chat-to label { margin: 0; font-weight: 500; font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.chat-input { display: flex; gap: 8px; }
.chat-input input { flex: 1; min-width: 0; }
.files { list-style: none; padding: 12px; margin: 0; display: grid; gap: 8px; }
.files a { display: block; padding: 12px; background: var(--panel2); border-radius: 10px; text-decoration: none; font-weight: 600; }
.poll { margin: 10px 10px 0; padding: 12px; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; }
.poll h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin: 0 0 4px; }
.poll-q { font-weight: 700; margin: 0 0 8px; }
.poll-opt { display: block; width: 100%; text-align: left; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 6px; font: inherit; cursor: pointer; min-height: 44px; }
.poll-opt:hover { border-color: var(--accent); }
.poll-res { position: relative; display: flex; justify-content: space-between; padding: 8px 10px; margin-top: 6px; border-radius: 8px; overflow: hidden; background: var(--panel); font-size: 14px; }
.poll-res span, .poll-res b { position: relative; z-index: 1; }
.poll-res i { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--accent) 30%, transparent); }
.poll-res.me { outline: 1px solid var(--accent); }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #18181b; border: 1px solid var(--line); padding: 12px 18px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.5); z-index: 50; max-width: calc(100% - 32px); }
@media (min-width: 1000px) {
  .room { grid-template-columns: 1fr 380px; grid-template-rows: auto 1fr; height: 100dvh; }
  .room-top { grid-column: 1 / -1; }
  .stage { overflow-y: auto; padding: 18px; }
  .side { border-top: 0; border-left: 1px solid var(--line); min-height: 0; }
  .chat { max-height: none; }
}
@media (max-width: 520px) { .offer { flex-direction: column; align-items: stretch; } .offer img { width: 100%; height: auto; aspect-ratio: 16/9; } .room-title span { max-width: 46vw; } }

/* Repetición */
.replay { max-width: 1000px; margin: 0 auto; padding-bottom: 40px; }
.replay-video { position: relative; aspect-ratio: 16/9; background: #000; margin: 16px; border-radius: 12px; overflow: hidden; }
.offer.static { margin: 0 16px; }

/* Admin */
.admin-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--panel); }
.admin-brand { font-weight: 800; text-decoration: none; }
.admin-top nav { display: flex; gap: 16px; }
.admin-top nav a { color: var(--muted); text-decoration: none; }
.admin-main { max-width: 1000px; margin: 0 auto; padding: 24px 20px 120px; }
.admin-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-head h1 { margin: 4px 0 0; font-size: 28px; }
.admin-head a.muted { text-decoration: none; font-size: 14px; }
.wlist { display: grid; gap: 12px; }
.wrow { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.wrow h2 { font-size: 19px; margin: 6px 0 2px; }
.wrow h2 a { text-decoration: none; }
.wrow p { margin: 0; font-size: 14px; }
.wrow-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.wrow-actions form { margin: 0; }
.tag { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: #1e293b; color: #bae6fd; }
.tag.live { background: #3f1d1d; color: #fecaca; }
.empty { text-align: center; padding: 60px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.panel h2 { font-size: 18px; }
.panel.danger { border-color: #7f1d1d; }
.sub { padding-left: 14px; border-left: 2px solid var(--line); margin-top: 8px; }
.f small, .f-check small { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
.f-check label { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.grid2 { display: grid; gap: 0 16px; }
@media (min-width: 720px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.seg { display: grid; gap: 10px; }
@media (min-width: 720px) { .seg { grid-template-columns: 1fr 1fr; } }
.seg label { margin: 0; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer; font-weight: 400; }
.seg label:has(input:checked) { border-color: var(--accent); }
.seg small { display: block; color: var(--muted); margin-top: 4px; }
.days { display: flex; gap: 8px; flex-wrap: wrap; }
.days label { margin: 0; display: flex; gap: 6px; align-items: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-weight: 500; }
.checks { display: grid; gap: 0 16px; }
@media (min-width: 720px) { .checks { grid-template-columns: 1fr 1fr; } }
.savebar { position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 35%); z-index: 5; }
.linkbox { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.linkbox span { font-size: 13px; color: var(--muted); display: block; margin-bottom: 6px; }
.subcard { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-top: 12px; }
.subcard .row { margin-top: 12px; }
.inline-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.inline-row.add input { flex: 1; min-width: 180px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.table th { color: var(--muted); font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.kpi span { display: block; font-size: 13px; color: var(--muted); }
.kpi b { font-size: 28px; font-variant-numeric: tabular-nums; }
.kpi small { display: block; color: var(--muted); font-size: 12px; }
.chart { width: 100%; height: auto; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart text { fill: var(--muted); font-size: 11px; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.chart .mark { stroke: #f59e0b; stroke-dasharray: 4 4; }
.chart .marktxt { fill: #f59e0b; }

/* Consola */
.hostpage { min-height: 100dvh; display: flex; flex-direction: column; }
.host-grid { display: grid; gap: 0; flex: 1; min-height: 0; }
@media (min-width: 900px) { .host-grid { grid-template-columns: 380px 1fr; height: calc(100dvh - 58px); } .host-col { overflow-y: auto; } }
.host-col { padding: 16px; border-right: 1px solid var(--line); }
.host-col h2 { font-size: 16px; }
.host-col h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 0 8px; }
.chatcol { display: flex; flex-direction: column; min-height: 60vh; }
.chatcol .chat { max-height: none; border: 1px solid var(--line); border-radius: 12px; }
.stack { display: grid; gap: 8px; }
.ctrl-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.ctrl-row.col { flex-direction: column; align-items: stretch; }
.ctrl-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ctrl-row.on { border-color: var(--accent); }
.people { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.people li { background: var(--panel2); border-radius: 999px; padding: 4px 10px; font-size: 13px; }
.filters label { margin: 0 0 8px; font-weight: 500; display: flex; gap: 6px; align-items: center; color: var(--muted); }

.mobile-only { margin: 8px 0 12px; }
@media (min-width: 900px) { .mobile-only { display: none; } }

/* El video + la oferta caben en la pantalla sin bajar (computador) */
@media (min-width: 1000px) {
  .stage > .screen, .stage > .offer { width: min(100%, calc((100dvh - 290px) * 16 / 9)); justify-self: center; }
  .stage { align-content: center; }
}
.unmute { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3; background: rgba(0,0,0,.75); color: #fff; border: 2px solid #fff; border-radius: 12px; padding: 14px 22px; font: inherit; font-weight: 700; font-size: 18px; cursor: pointer; }
.msg p a { color: var(--accent); text-decoration: underline; word-break: break-all; }
#seek:disabled { opacity: 1; cursor: default; pointer-events: none; }
#seek:disabled { -webkit-appearance: none; appearance: none; }
#seek:disabled::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 0; height: 0; border: 0; }
#seek:disabled::-moz-range-thumb { width: 0; height: 0; border: 0; }
.pin-text { white-space: pre-wrap; word-break: break-word; }
.pin-text a { color: var(--accent); text-decoration: underline; }
.pin { max-height: 38vh; overflow-y: auto; }
