/* ═══ Live: stream player, join card, link window, presenter screen ═══ */

/* player */
.lv-wrap { margin: 0 0 16px; }
.lv-event { display: grid; gap: 10px; margin: 14px 0 6px; }
.lv-player { border-radius: 18px; overflow: hidden; background: #000; border: 1px solid rgba(255,255,255,.1); box-shadow: 0 14px 40px rgba(0,0,0,.35); }
.lv-frame { position: relative; aspect-ratio: 16 / 9; background: #0b0b0d; }
.lv-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.lv-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; filter: brightness(.72) saturate(1.05); transition: filter .2s, transform .4s; }
.lv-thumb-blank { background: radial-gradient(120% 90% at 30% 20%, rgba(200,16,46,.55), transparent 60%), linear-gradient(135deg, #1a0d11, #050405); }
.lv-player:hover .lv-thumb { filter: brightness(.82); transform: scale(1.015); }
.lv-play { position: absolute; inset: 0; margin: auto; width: 84px; height: 84px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  color: #fff; background: linear-gradient(135deg, rgba(255,58,92,.95), rgba(200,16,46,.9)); box-shadow: 0 10px 34px rgba(200,16,46,.55), 0 0 0 10px rgba(255,255,255,.08); transition: transform .18s; }
.lv-play span { display: grid; place-items: center; transform: translateX(2px); }
.lv-play:hover { transform: scale(1.07); }
.lv-play:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
.lv-badge { position: absolute; top: 14px; left: 14px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px;
  background: #e3264a; color: #fff; font: 800 .72rem var(--font-body, 'Inter', sans-serif); letter-spacing: .08em; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.lv-badge svg { animation: lvPulse 1.6s ease-in-out infinite; }
@keyframes lvPulse { 50% { opacity: .45; } }
.lv-player.on .lv-badge, .lv-player.on .lv-play { display: none; }
.lv-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 11px 16px; background: var(--card, #17171b); font-size: .82rem; color: var(--muted, #a08184); }
.lv-bar span { font-weight: 650; color: var(--text-2, #d4b8ba); }
.lv-bar a { display: inline-flex; align-items: center; gap: 5px; color: var(--muted, #a08184); text-decoration: none; font-weight: 700; }
.lv-bar a:hover { color: var(--text-1, #fff); }

/* meeting link */
.lv-join { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 18px; border-radius: 16px; background: rgba(255,58,92,.07); border: 1px solid rgba(255,90,115,.28); }
.lv-join > div { flex: 1 1 220px; min-width: 0; display: grid; gap: 3px; }
.lv-join b { font-size: .98rem; font-weight: 800; color: var(--text-1, #fff); }
.lv-join small { font-size: .82rem; color: var(--muted, #a08184); line-height: 1.45; }
.lv-join-ic { width: 46px; height: 46px; flex: none; border-radius: 14px; display: grid; place-items: center; color: var(--red-bright, #ff4d6a); background: rgba(200,16,46,.16); }

/* buttons */
.lv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 999px; cursor: pointer; white-space: nowrap; text-decoration: none;
  color: var(--text-1, #fff); font: 700 .88rem var(--font-body, 'Inter', sans-serif); letter-spacing: .01em; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.16); transition: background .15s, border-color .15s, transform .15s, box-shadow .15s; }
.lv-btn:hover { background: rgba(255,58,92,.12); border-color: rgba(255,90,115,.5); }
.lv-btn:disabled { opacity: .55; cursor: default; }
.lv-btn.lv-sm { height: 36px; padding: 0 14px; font-size: .8rem; justify-self: start; }
.lv-primary { color: #fff; background: linear-gradient(135deg, rgba(255,58,92,.88), rgba(200,16,46,.74)); border-color: rgba(255,110,130,.75); box-shadow: 0 5px 16px rgba(200,16,46,.38), inset 0 1px 0 rgba(255,255,255,.24); }
.lv-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(200,16,46,.45), inset 0 1px 0 rgba(255,255,255,.28); }
.lv-danger { color: #fff; background: rgba(200,16,46,.28); border-color: rgba(255,90,115,.6); }

/* link window */
.lv-ov { position: fixed; inset: 0; z-index: 10100; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(5,3,4,.72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: lvFade .16s ease; }
@keyframes lvFade { from { opacity: 0; } }
.lv-box { position: relative; width: 100%; max-width: 480px; max-height: calc(100dvh - 32px); overflow-y: auto; padding: 26px 24px 22px; border-radius: 20px; background: var(--card, #1b1b1f); color: var(--text-1, #f2eaea);
  border: 1px solid rgba(255,255,255,.1); box-shadow: 0 30px 80px rgba(0,0,0,.5); font-family: var(--font-body, 'Inter', sans-serif); animation: lvUp .22s cubic-bezier(.2,1.2,.4,1); }
@keyframes lvUp { from { transform: translateY(18px); opacity: 0; } }
.lv-x { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.05); color: inherit; display: grid; place-items: center; cursor: pointer; }
.lv-badge-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: var(--red-bright, #ff4d6a); background: rgba(200,16,46,.14); border: 1px solid rgba(255,90,115,.3); margin-bottom: 12px; }
.lv-box h3 { margin: 0 0 6px; font-size: 1.2rem; font-weight: 800; }
.lv-lead { margin: 0 0 14px; font-size: .88rem; line-height: 1.55; color: var(--muted, #a08184); }
.lv-lead b { color: var(--text-1, #fff); }
.lv-form { display: grid; gap: 8px; }
.lv-input { width: 100%; box-sizing: border-box; height: 50px; padding: 0 16px; border-radius: 12px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.04); color: inherit; font: 500 .95rem var(--font-body, 'Inter', sans-serif); }
.lv-input:focus { outline: none; border-color: rgba(255,90,115,.7); box-shadow: 0 0 0 3px rgba(255,58,92,.15); }
.lv-hint { margin: 0; min-height: 1.1em; font-size: .8rem; color: var(--muted, #a08184); }
.lv-hint.ok { color: #4ade80; }
.lv-err { margin: 0; min-height: 1em; font-size: .84rem; font-weight: 600; color: #ff6b81; }
.lv-row { display: flex; gap: 8px; flex-wrap: wrap; }
.lv-help { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08); font-size: .84rem; }
.lv-help summary { cursor: pointer; font-weight: 700; }
.lv-help ol { margin: 10px 0 0; padding-left: 18px; line-height: 1.6; color: var(--text-2, #d4b8ba); }

/* ═══ presenter screen ═══ */
html.lv-lock body { overflow: hidden; }
.lv-present { position: fixed; inset: 0; z-index: 10120; display: none; flex-direction: column; color: #fff; overflow: auto;
  background: radial-gradient(90% 70% at 85% 10%, rgba(200,16,46,.38), transparent 60%), radial-gradient(70% 60% at 0% 100%, rgba(122,10,26,.45), transparent 60%), #0a0608;
  font-family: var(--font-body, 'Inter', sans-serif); -webkit-font-smoothing: antialiased; padding: clamp(16px, 2.4vw, 36px); gap: clamp(14px, 2vh, 26px); }
.lv-present.open { display: flex; animation: lvFade .2s ease; }
.lv-p-load { margin: auto; width: 46px; height: 46px; border-radius: 50%; border: 3px solid rgba(255,255,255,.15); border-top-color: #ff4d6a; animation: lvSpin .8s linear infinite; }
@keyframes lvSpin { to { transform: rotate(360deg); } }
.lv-p-err { margin: auto; text-align: center; display: grid; gap: 12px; }
.lv-p-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.lv-p-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.lv-p-brand img { width: clamp(40px, 4vw, 56px); height: clamp(40px, 4vw, 56px); border-radius: 12px; object-fit: cover; background: #fff; }
.lv-p-brand b { display: block; font-family: var(--font-display, 'Jost', sans-serif); font-size: clamp(1.2rem, 2.2vw, 2rem); font-weight: 700; line-height: 1.15; }
.lv-p-brand small { display: block; font-size: clamp(.8rem, 1vw, 1rem); color: rgba(255,255,255,.6); margin-top: 2px; }
.lv-p-tools { display: flex; gap: 8px; }
.lv-icon { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: #fff; display: grid; place-items: center; cursor: pointer; }
.lv-icon:hover { background: rgba(255,255,255,.14); }
.lv-p-main { flex: 1; display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); align-items: center; gap: clamp(24px, 5vw, 90px); max-width: 1400px; width: 100%; margin: 0 auto; }
.lv-p-qr { display: grid; justify-items: center; gap: 12px; }
.lv-p-qr-tile { padding: clamp(14px, 1.6vw, 24px); border-radius: 26px; background: #fff; box-shadow: 0 24px 70px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.2); }
.lv-p-qr-tile img { display: block; width: clamp(200px, min(34vw, 52vh), 460px); height: auto; aspect-ratio: 1; }
.lv-p-scan { margin: 6px 0 0; font-family: var(--font-display, 'Jost', sans-serif); font-size: clamp(1.3rem, 2.4vw, 2.2rem); font-weight: 700; }
.lv-p-url { margin: 0; font-size: clamp(.95rem, 1.4vw, 1.3rem); color: rgba(255,255,255,.7); font-weight: 600; letter-spacing: .01em; }
.lv-p-info { display: grid; gap: clamp(14px, 2.6vh, 30px); align-content: center; min-width: 0; }
.lv-p-pill { justify-self: start; display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 999px; font-size: clamp(.95rem, 1.4vw, 1.3rem); font-weight: 800; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); }
.lv-p-pill.lv-voting { background: rgba(74,222,128,.14); border-color: rgba(74,222,128,.45); color: #6ee7a0; }
.lv-p-pill.lv-voting i { width: 11px; height: 11px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 0 rgba(74,222,128,.7); animation: lvRing 1.6s infinite; }
@keyframes lvRing { 70% { box-shadow: 0 0 0 12px rgba(74,222,128,0); } 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); } }
.lv-p-pill.lv-closed { background: rgba(255,58,92,.16); border-color: rgba(255,90,115,.45); color: #ff8a9e; }
.lv-p-codebox { display: grid; gap: 4px; }
.lv-p-codebox small { font-size: clamp(.8rem, 1vw, 1rem); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.55); }
.lv-p-codebox b { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: clamp(2rem, 5vw, 4.6rem); font-weight: 800; letter-spacing: .06em; line-height: 1; }
.lv-p-count { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.lv-p-count b { font-family: var(--font-display, 'Jost', sans-serif); font-size: clamp(4rem, 11vw, 10rem); font-weight: 700; line-height: .9; letter-spacing: -.03em; font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff, #ffb3c0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lv-p-count b.lv-bump { animation: lvBump .5s cubic-bezier(.3,1.6,.5,1); }
@keyframes lvBump { 40% { transform: scale(1.06); } }
.lv-p-count span { font-size: clamp(1.1rem, 2vw, 1.8rem); font-weight: 700; color: rgba(255,255,255,.75); }
.lv-p-sub { margin: 0; font-size: clamp(1.05rem, 1.8vw, 1.6rem); color: rgba(255,255,255,.75); }
.lv-p-sub b { color: #fff; font-variant-numeric: tabular-nums; }
.lv-p-ctrl { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.lv-p-ctrl .lv-btn { height: 50px; padding: 0 24px; font-size: .95rem; }
.lv-p-foot { display: flex; align-items: center; justify-content: center; gap: 12px; color: rgba(255,255,255,.5); font-size: clamp(.75rem, .9vw, .9rem); }
.lv-p-foot img { height: 20px; opacity: .9; }

/* results */
.lv-r { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; display: grid; gap: clamp(18px, 3vh, 34px); align-content: center; }
.lv-r-pos h3 { margin: 0 0 14px; font-family: var(--font-display, 'Jost', sans-serif); font-size: clamp(1.4rem, 2.6vw, 2.4rem); font-weight: 700; }
.lv-r-row { display: grid; grid-template-columns: minmax(120px, 28%) 1fr clamp(90px, 9vw, 130px); align-items: center; gap: clamp(10px, 1.6vw, 22px); padding: 8px 0; opacity: 0; animation: lvIn .5s ease forwards; animation-delay: var(--d); }
@keyframes lvIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.lv-r-name { display: flex; align-items: center; gap: 10px; font-size: clamp(1rem, 1.7vw, 1.5rem); font-weight: 750; min-width: 0; }
.lv-r-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-r-track { height: clamp(18px, 2.6vh, 30px); border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.lv-r-fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, rgba(255,255,255,.35), rgba(255,255,255,.55)); transition: width 1.4s cubic-bezier(.2,.9,.2,1); transition-delay: var(--d); }
.lv-r-row.win .lv-r-fill { background: linear-gradient(90deg, #ff4d6a, #ffb347); box-shadow: 0 0 24px rgba(255,90,115,.55); }
.lv-r-row.win .lv-r-name { color: #ffd27a; }
.lv-r-num { display: grid; justify-items: end; min-width: 84px; }
.lv-r-num b { font-family: var(--font-display, 'Jost', sans-serif); font-size: clamp(1.2rem, 2.2vw, 2rem); font-weight: 700; font-variant-numeric: tabular-nums; }
.lv-r-num small { font-size: clamp(.75rem, 1vw, .95rem); color: rgba(255,255,255,.55); }
.lv-r-note { margin: 4px 0 0; color: #fcd34d; font-weight: 700; }

@media (max-width: 760px) {
  .lv-p-main { grid-template-columns: 1fr; text-align: center; }
  .lv-p-info { justify-items: center; }
  .lv-p-pill { justify-self: center; }
  .lv-p-count { justify-content: center; }
  .lv-p-qr-tile img { width: min(70vw, 340px); }
  .lv-r-row { grid-template-columns: 1fr auto; }
  .lv-r-track { grid-column: 1 / -1; order: 3; }
}
@media (max-width: 600px) {
  .lv-ov { padding: 0; align-items: flex-end; }
  .lv-box { max-width: none; border-radius: 20px 20px 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .lv-play { width: 68px; height: 68px; }
}
@media (prefers-reduced-motion: reduce) {
  .lv-badge svg, .lv-p-pill.lv-voting i, .lv-r-row, .lv-p-count b.lv-bump { animation: none; opacity: 1; }
  .lv-r-fill { transition: none; }
}

[data-theme="light"] .lv-box { background: #fff; color: #16161a; border-color: rgba(20,20,30,.08); }
[data-theme="light"] .lv-lead b { color: #16161a; }
[data-theme="light"] .lv-input { background: #fafafa; border-color: rgba(20,20,30,.15); }
[data-theme="light"] .lv-btn:not(.lv-primary):not(.lv-danger), [data-theme="light"] .lv-x { background: #f6f6f8; border-color: rgba(20,20,30,.12); color: #16161a; }
[data-theme="light"] .lv-bar { background: #fff; }
[data-theme="light"] .lv-bar span { color: #3a3a44; }
[data-theme="light"] .lv-join { background: #fff5f6; border-color: rgba(200,16,46,.2); }
[data-theme="light"] .lv-join b { color: #16161a; }
[data-theme="light"] .lv-help { background: #fafafa; border-color: rgba(20,20,30,.08); }
[data-theme="light"] .lv-help ol { color: #3a3a44; }

/* Votes hub: run your vote live, next to Official elections */
.lv-hub-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; }
.lv-hub-row > .vt-card { margin: 0; height: 100%; box-sizing: border-box; }
.lv-hub-row .bil-vt { flex-direction: column; align-items: flex-start; justify-content: space-between; }
.lv-hub-row .bil-vt > div { flex: 0 0 auto; }
.lv-hub { display: grid; gap: 14px; }
.lv-hub-top { display: flex; gap: 14px; align-items: flex-start; }
.lv-hub-top h3 { margin: 0 0 4px; }
.lv-hub-top .vt-sub { margin: 0; }
.lv-hub-ic { width: 46px; height: 46px; flex: none; border-radius: 14px; display: grid; place-items: center; color: var(--red-bright, #ff4d6a); background: rgba(200,16,46,.14); border: 1px solid rgba(255,90,115,.3); }
.lv-hub-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.lv-hub-chips span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: .78rem; font-weight: 700; color: var(--text-2, #d4b8ba); background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); }
.lv-hub-chips svg { color: var(--red-bright, #ff4d6a); }
.lv-hub-form { display: flex; gap: 10px; }
.lv-hub-pick { flex: 1; min-width: 0; }
.lv-hub-pick .vt-input { width: 100%; box-sizing: border-box; }
.lv-hub-form .vt-btn { flex: none; }
.lv-hub-note { margin: 0; font-size: .8rem; color: var(--muted, #a08184); line-height: 1.5; }
@media (max-width: 900px) { .lv-hub-row { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .lv-hub-form { flex-direction: column; } .lv-hub-form .vt-btn { width: 100%; } }
[data-theme="light"] .lv-hub-chips span { background: #f6f6f8; border-color: rgba(20,20,30,.1); color: #3a3a44; }
