/* BharatPe Half yearly Townhall — attendee pages (entry + hall). White theme taken from the event backdrop. */
@font-face { font-family: 'Inter'; src: url(/fonts/inter-latin-wght-normal.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
:root {
  --paper: #F5FBFD; --panel: #FFFFFF; --soft: #F4F9FB; --line: #E1EBF0; --line-2: #CBD9E1;
  --text: #1E1B22; --body: #2B3445; --muted: #5E6B7E; --dim: #8D99AB;
  --teal: #3FB5C7;           /* BharatPe "Pe" / ring */
  --teal-strong: #12808F;    /* same hue, dark enough for white text and links */
  --teal-soft: #E5F6F9;
  --red: #F05454; --green: #2F7F70;
  --live: #E5484D; --warn: #C27803; --ok: #15803D;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(16,40,60,.05), 0 12px 32px -14px rgba(16,60,80,.18);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; color: var(--body); font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; }
body { background: var(--paper) url(/brand/backdrop-clean.jpg) center bottom / cover no-repeat fixed; }
button, input, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }

/* ---------- entry: the backdrop, rebuilt as a page ---------- */
.entry-body { min-height: 100%; }
.entry { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; padding: 36px 18px 48px; text-align: center; }
.entry .logo { height: clamp(42px, 6vw, 64px); width: auto; display: block; }
.entry h1 { margin: clamp(26px, 5vh, 52px) 0 0; font-size: clamp(30px, 4.6vw, 66px); line-height: 1.06; letter-spacing: -.035em; font-weight: 800; color: var(--text); max-width: 1100px; text-wrap: balance; }
.date-rule { margin-top: 18px; display: flex; align-items: center; gap: 18px; color: var(--text); font-size: clamp(16px, 2vw, 24px); font-weight: 500; letter-spacing: -.01em; }
.date-rule::before, .date-rule::after { content: ''; width: clamp(40px, 12vw, 150px); height: 2px; border-radius: 2px; background: var(--teal); }
.entry-card { width: min(440px, 100%); margin-top: clamp(28px, 5vh, 48px); padding: 26px 26px 22px; border-radius: 22px; text-align: left;
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.9); box-shadow: 0 30px 60px -28px rgba(20,90,110,.35), 0 0 0 1px rgba(63,181,199,.12); }
.card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.card-top b { font-size: 17px; color: var(--text); letter-spacing: -.01em; }
.live-chip { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .08em; background: var(--soft); color: var(--muted); border: 1px solid var(--line); }
.live-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: #F2A83B; }
.live-chip.live { background: #FFECEC; color: var(--live); border-color: #FFD3D3; } .live-chip.live .dot { background: var(--live); animation: pulse 1.4s infinite; }
.live-chip.ended .dot { background: #9AA6B6; }
.entry-copy { margin: 4px 0 18px; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 7px; color: var(--text); }
.field input { width: 100%; height: 50px; border: 1.5px solid var(--line-2); border-radius: 13px; padding: 0 15px; font-size: 16px; color: var(--text); background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
.field input:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(63,181,199,.18); }
.field input.bad { border-color: #E5484D; box-shadow: 0 0 0 4px rgba(229,72,77,.12); }
.field small { display: block; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.field small b { color: var(--teal-strong); }
.primary-button { width: 100%; height: 52px; margin-top: 4px; border: 0; border-radius: 14px; cursor: pointer; color: #fff; font-size: 16.5px; font-weight: 750;
  background: linear-gradient(180deg, #1793A3, var(--teal-strong)); box-shadow: 0 12px 24px -12px rgba(18,128,143,.8); transition: filter .15s, transform .15s; }
.primary-button:hover { filter: brightness(1.07); } .primary-button:active { transform: translateY(1px); }
.primary-button:disabled { opacity: .6; cursor: default; }
.entry-status { min-height: 20px; margin: 12px 0 0; font-size: 14px; color: #C4262B; text-align: center; font-weight: 600; }

/* ---------- hall ---------- */
.hall-body { overflow: hidden; }
/* fixed + inset tracks the visible area exactly, including mobile browsers whose toolbars collapse */
.hall { position: fixed; inset: 0; display: grid; grid-template-rows: auto 1fr; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 22px; background: rgba(255,255,255,.88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); position: relative; z-index: 3; }
.topbar .logo { height: 32px; width: auto; flex: none; }
.topbar .sep { width: 1px; height: 30px; background: var(--line-2); flex: none; }
.topbar .titles { min-width: 0; }
.topbar .titles b { display: block; font-size: 15.5px; color: var(--text); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .titles small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .grow { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--text); font-weight: 700; font-size: 13.5px; white-space: nowrap; }
.pill svg { width: 15px; height: 15px; color: var(--muted); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #9AA6B6; }
.pill.live { background: var(--live); border-color: var(--live); color: #fff; letter-spacing: .06em; } .pill.live .dot { background: #fff; animation: pulse 1.4s infinite; }
.pill.soon .dot { background: #F2A83B; }
@keyframes pulse { 50% { opacity: .3; } }
.ghost-button { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--muted); }
.ghost-button:hover { color: var(--text); border-color: #A9BAC6; }
.icon-button { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); background: #fff; cursor: pointer; color: var(--muted); }
.icon-button:hover { color: var(--text); } .icon-button svg { width: 17px; height: 17px; }

.hall-main { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; padding: 20px 22px 22px; }
.stage-col { min-height: 0; display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.player-shell { position: relative; width: 100%; max-height: calc(100dvh - 180px); aspect-ratio: 16 / 9; margin: 0 auto; border-radius: var(--radius); overflow: hidden; background: #0C1A22;
  box-shadow: 0 30px 60px -30px rgba(16,70,90,.5), 0 0 0 1px rgba(16,60,80,.08); }
.player-shell iframe, .player-shell video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
/* before / after the stream: the event backdrop itself is the holding slide */
.stream-empty { position: absolute; inset: 0; background: #EAF7FA url(/brand/og.jpg) center / cover no-repeat; }
.stream-empty .note { position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 10px; max-width: calc(100% - 32px);
  padding: 10px 16px; border-radius: 999px; background: rgba(255,255,255,.94); color: var(--text); box-shadow: 0 10px 30px -12px rgba(16,70,90,.45); font-size: clamp(12.5px, 1.2vw, 15px); font-weight: 600; text-align: left; }
.stream-empty .note .dot { width: 9px; height: 9px; border-radius: 50%; background: #F2A83B; flex: none; animation: pulse 1.6s infinite; }
.stream-empty.ended .note .dot { background: var(--teal); animation: none; }
.stream-empty .note b { font-weight: 800; }

.reaction-bar { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 6px; margin: 0 auto; border-radius: 999px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.reaction-bar .lbl { font-size: 12.5px; color: var(--muted); font-weight: 700; padding: 0 8px 0 10px; }
.reaction-button { width: 46px; height: 46px; border: 0; border-radius: 50%; display: grid; place-items: center; background: transparent; font-size: 25px; cursor: pointer; transition: transform .15s, background .15s; }
.reaction-button:hover { background: var(--teal-soft); transform: scale(1.1); }
.reaction-button:active { transform: scale(.88); }
.reaction-bar.off { opacity: .45; pointer-events: none; }
.floats { position: fixed; inset: 0; z-index: 20; pointer-events: none; overflow: hidden; }
.floating-reaction { position: absolute; bottom: -60px; font-size: clamp(30px, 3vw, 46px); filter: drop-shadow(0 8px 10px rgba(16,60,80,.22));
  animation: rise var(--d, 4.4s) cubic-bezier(.2,.7,.25,1) forwards; }
@keyframes rise {
  0% { opacity: 0; transform: translate(0, 0) scale(var(--s, 1)); }
  10% { opacity: 1; } 80% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--x, 0px), calc(-1 * var(--h, 70vh))) scale(var(--s, 1)) rotate(var(--r, 0deg)); }
}

/* side panel */
.side { min-height: 0; display: flex; flex-direction: column; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 6px; gap: 6px; border-bottom: 1px solid var(--line); flex: none; background: var(--soft); }
.tab { height: 40px; border-radius: 11px; border: 0; background: transparent; cursor: pointer; font-weight: 700; font-size: 14px; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.tab[aria-selected="true"] { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(16,40,60,.08), 0 0 0 1px var(--line); }
.tab .badge { min-width: 19px; height: 19px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; display: inline-grid; place-items: center; }
.panel { min-height: 0; flex: 1; display: flex; flex-direction: column; }

.feed { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 14px 6px; display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; position: relative; }
.feed-empty { margin: auto; text-align: center; color: var(--dim); font-size: 14px; padding: 20px; }
.msg { display: grid; grid-template-columns: 32px 1fr; gap: 10px; }
.msg.new { animation: slidein .25s ease-out; }
@keyframes slidein { from { opacity: 0; transform: translateY(6px); } }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; }
.msg .who { font-size: 12.5px; font-weight: 700; color: var(--text); display: flex; gap: 8px; align-items: baseline; }
.msg .who time { font-weight: 500; color: var(--dim); font-size: 11.5px; }
.msg .text { margin-top: 2px; font-size: 14.5px; line-height: 1.45; color: var(--body); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.mine .who span:first-child { color: var(--teal-strong); }
.msg.pending .text { color: var(--muted); }
.msg .state { display: inline-block; margin-top: 5px; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #FFF4E0; color: var(--warn); }
.msg.rejected .state { background: #FFECEC; color: #C4262B; }
.jump { position: sticky; bottom: 4px; align-self: center; margin-top: auto; border: 0; cursor: pointer; padding: 7px 14px; border-radius: 999px; background: var(--teal-strong); color: #fff; font-weight: 750; font-size: 12.5px; box-shadow: 0 8px 20px -8px rgba(16,60,80,.5); }

.composer { flex: none; display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--soft); }
.composer input { flex: 1; min-width: 0; height: 44px; border-radius: 12px; border: 1.5px solid var(--line-2); background: #fff; padding: 0 14px; outline: none; font-size: 14.5px; color: var(--text); }
.composer input:focus, .ask textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(63,181,199,.18); }
.send { height: 44px; padding: 0 16px; border-radius: 12px; border: 0; cursor: pointer; font-weight: 750; background: var(--teal-strong); color: #fff; }
.send:hover { filter: brightness(1.08); }
.send:disabled { opacity: .5; cursor: default; }
.hint { flex: none; margin: 0; padding: 0 14px 12px; font-size: 11.5px; color: var(--muted); background: var(--soft); }

.ask { flex: none; padding: 14px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; background: var(--soft); }
.ask textarea { width: 100%; min-height: 76px; max-height: 160px; resize: vertical; border-radius: 12px; border: 1.5px solid var(--line-2); background: #fff; padding: 11px 13px; outline: none; font-size: 14.5px; line-height: 1.45; color: var(--text); }
.ask-row { display: flex; align-items: center; gap: 10px; }
.ask-row label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--body); cursor: pointer; flex: 1; }
.ask-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--teal-strong); }
.ask .note { margin: -2px 0 0; font-size: 11.5px; color: var(--muted); }
.qa-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 12px 14px 2px; }
.qa-head b { font-size: 13px; color: var(--muted); flex: 1; font-weight: 700; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); }
.seg button { height: 26px; padding: 0 11px; border-radius: 999px; border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(16,40,60,.1); }
#qaCards { display: flex; flex-direction: column; gap: 10px; }
.q { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 12px 13px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.q.new { animation: slidein .25s ease-out; } /* only genuinely new cards — re-renders for vote counts must not flicker */
.q .text { font-size: 14.5px; line-height: 1.45; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.q .meta { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; color: var(--dim); }
.q .tag { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; letter-spacing: .02em; }
.q .tag.answering { background: var(--teal-soft); color: var(--teal-strong); }
.q .tag.answered { background: #E7F6EC; color: var(--ok); }
.q .tag.pending { background: #FFF4E0; color: var(--warn); }
.q .tag.rejected { background: #FFECEC; color: #C4262B; }
.q.answering { border-color: var(--teal); background: linear-gradient(180deg, #F0FAFC, #fff); box-shadow: 0 0 0 3px rgba(63,181,199,.14); }
.q.answered { opacity: .7; }
.q.mine-pending { border-style: dashed; background: var(--soft); }
.vote { align-self: start; min-width: 48px; height: 52px; border-radius: 12px; border: 1.5px solid var(--line-2); background: #fff; cursor: pointer; display: grid; place-items: center; align-content: center; gap: 1px; color: var(--muted); font-weight: 800; font-size: 14px; transition: all .15s; }
.vote svg { width: 16px; height: 16px; }
.vote:hover { border-color: var(--teal); color: var(--teal-strong); }
.vote.on { background: var(--teal-soft); border-color: var(--teal); color: var(--teal-strong); }
.vote:disabled { cursor: default; opacity: .55; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 40; background: #1E1B22; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; opacity: 0; transition: opacity .2s; pointer-events: none; box-shadow: 0 10px 30px -10px rgba(0,0,0,.4); max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; }

/* ---------- small screens: video on top, chat / Q&A below ---------- */
@media (max-width: 980px) {
  body { background-attachment: scroll; }
  .topbar { padding: 8px 12px; gap: 8px; }
  .topbar .logo { height: 26px; }
  .topbar .sep, .topbar .titles, .pill.name, #fullscreenBtn { display: none; }
  .hall-main { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); gap: 10px; padding: 10px 10px 0; }
  .stage-col { gap: 8px; }
  /* phones: the video is the point — run it edge to edge, as wide as the screen allows */
  .stage-col { margin: -10px -10px 0; }
  .player-shell { border-radius: 0; max-height: none; box-shadow: none; }
  .reaction-bar { width: calc(100% - 20px); margin: 0 10px; }
  .reaction-bar { justify-content: space-around; padding: 3px; } .reaction-bar .lbl { display: none; }
  .reaction-button { width: 42px; height: 42px; font-size: 23px; }
  .side { border-radius: 16px 16px 0 0; border-bottom: 0; }
  .ask textarea { min-height: 56px; }
  .stream-empty .note { bottom: 4%; padding: 6px 12px; white-space: nowrap; }
  .stream-empty .note #emptyText { display: none; } /* keep the slide's date visible on small players */
}
@media (max-width: 380px) { .pill { padding: 0 9px; font-size: 12.5px; } .reaction-button { width: 38px; height: 38px; font-size: 21px; } }
@media (orientation: landscape) and (max-height: 560px) and (max-width: 980px) {
  .hall-main { grid-template-columns: minmax(0, 1fr) 320px; grid-template-rows: 1fr; padding: 8px; }
  .stage-col { margin: 0; } .reaction-bar { width: auto; margin: 0 auto; }
  .player-shell { max-height: calc(100dvh - 120px); border-radius: 14px; } .side { border-radius: 14px; border-bottom: 1px solid var(--line); }
}
