/* ============================================================================
   LIVE — the badge that surfaces a broadcast over the feed, and the watch
   screen itself: video full-bleed, name/viewers/follow/close in a scrim at
   the top, comments rising from the bottom, composer beneath.
   ========================================================================= */

.live-badge {
  position: fixed; top: 64px; right: 16px; z-index: 6;
  display: flex; align-items: center; gap: 5px;
  background: #FF3040; color: #fff; font-weight: 700; font-size: 12px;
  padding: 6px 12px; border-radius: 20px; border: none;
  box-shadow: 0 4px 14px rgba(255,48,64,.4);
  animation: liveBadgeIn .3s ease;
}
@keyframes liveBadgeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
/* Not over the room itself: the pill is the way in, and inside it sits on
 * the close button. */
body:has(.live-watch) .live-badge { display: none; }

.live-watch { padding: 0; background: #000; height: 100vh; overflow: hidden; }
.live-watch #lwVideo {
  position: fixed; inset: 0; width: 100%; height: 100%;
  object-fit: cover; background: #000; z-index: 0;
}

.live-scrim-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 2;
  display: flex; align-items: center; gap: 10px;
  padding: 16px; padding-top: calc(16px + env(safe-area-inset-top));
  background: linear-gradient(rgba(0,0,0,.55), transparent);
}
.live-scrim-top .av { background: var(--surface); }

.live-comments {
  position: fixed; left: 0; right: 0; bottom: 66px; z-index: 1;
  max-height: 34vh; overflow-y: auto; padding: 0 16px;
  display: flex; flex-direction: column; gap: 6px;
  mask-image: linear-gradient(to top, #000 85%, transparent);
  -webkit-mask-image: linear-gradient(to top, #000 85%, transparent);
}
.live-comment {
  margin: 0; font-size: 13px; color: #fff;
  background: rgba(0,0,0,.35); display: inline-block;
  padding: 5px 10px; border-radius: 14px; width: fit-content;
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
.live-comment b { font-weight: 700; margin-right: 4px; }

.live-composer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2;
  align-items: center;
  padding: 10px 12px; padding-bottom: calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0,0,0,.55));
}
.live-composer input {
  flex: 1; min-width: 0; background: rgba(255,255,255,.12);
  border: none; border-radius: 20px; padding: 10px 14px;
  color: #fff; font-size: 14px; outline: none;
}
.live-composer input::placeholder { color: rgba(255,255,255,.6); }

/* The host's finish line, over the video.
 *
 * Pinned under the header rather than above the comments: the comment box
 * grows from the bottom, and a bar sitting on top of it would walk up the
 * screen as the room talks. In the app the same strip sits high for the same
 * reason — its column is anchored to the top — so this is the parity, not a
 * departure from it. */
.live-goal {
  position: fixed; z-index: 2;
  left: 16px; top: calc(78px + env(safe-area-inset-top));
  max-width: min(70vw, 260px);
}
.live-goal-top {
  margin: 0 0 5px; display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
.live-goal-label {
  color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.live-goal-count { flex: none; }
.live-goal-track {
  display: block; height: 5px; border-radius: 999px; overflow: hidden;
  background: rgba(255,255,255,.25);
}
.live-goal-fill {
  display: block; height: 100%; border-radius: 999px;
  transition: width .4s ease-out;
}

/* The question on screen, over the video.
 *
 * The bar is the row rather than a line under it: on a phone, over a video, a
 * separate track and label is two things to read where one will do. Same
 * decision as the app's LivePollCard, so a poll looks like the same poll on
 * either screen. */
.live-poll {
  position: fixed; z-index: 2;
  left: 16px; right: 16px; top: calc(126px + env(safe-area-inset-top));
  max-width: min(76vw, 320px);
  padding: 9px 10px; border-radius: 14px;
  background: rgba(0,0,0,.42);
}
.live-poll-q {
  margin: 0 0 7px; font-size: 12px; font-weight: 800; color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
.live-poll-row {
  position: relative; display: flex; align-items: center; gap: 8px;
  width: 100%; margin: 0 0 6px; padding: 6px 10px;
  border: 0; border-radius: 10px; background: rgba(255,255,255,.14);
  color: #fff; font: inherit; font-size: 11.5px; text-align: left;
  overflow: hidden; cursor: pointer;
}
.live-poll-row:disabled { cursor: default; }
.live-poll-fill {
  position: absolute; inset: 0 auto 0 0; z-index: 0;
  background: rgba(255,255,255,.24);
  transition: width .4s ease-out;
}
.live-poll-row.mine .live-poll-fill { background: color-mix(in srgb, var(--accent) 75%, transparent); }
.live-poll-row.mine .live-poll-label { font-weight: 800; }
.live-poll-label {
  position: relative; z-index: 1; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 600;
}
.live-poll-pct { position: relative; z-index: 1; font-weight: 800; }
.live-poll-total { margin: 1px 0 0; font-size: 10px; color: rgba(255,255,255,.65); }

/* A live in the feed.
 *
 * Same shape as any other slide — the creator's face fills it (no stream
 * plays in a card; one opens on the tap), and the one thing there is to do
 * with it sits across the middle. No like, no comment rail, no scrubber: a
 * live is not a video you can seek, and offering the controls of one is a
 * promise the thing cannot keep. */
.live-slide-mid {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; pointer-events: none;
}
.live-slide-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 8px;
  background: var(--live-red, #F0245C); color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: .4px;
}
.live-slide-tap {
  padding: 10px 20px; border-radius: 999px;
  background: rgba(0,0,0,.45); backdrop-filter: blur(6px);
  color: #fff; font-size: 14px; font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
/* The broadcast stopped while somebody was looking at it. The card stays —
 * scrolling past it is how it leaves — but it stops claiming to be live. */
.live-slide-over .live-slide-badge { display: none; }

/* ============================================================================
   The room, level with the app (2026-09-16): dark glass over a full-bleed
   picture. Host top-left (face → profile), LIVE, headcount, Follow, close;
   comments rising over the picture; one bar at the bottom with the comment
   box, hearts, gift and share. The same pieces dress the Go Live page.
   ========================================================================= */

.live-scrim-top {
  padding: 12px 12px; padding-top: calc(12px + env(safe-area-inset-top));
  background: linear-gradient(rgba(0,0,0,.62), rgba(0,0,0,0));
  gap: 8px;
}
.lw-host {
  display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1;
  background: rgba(0,0,0,.42); backdrop-filter: blur(8px);
  border: none; border-radius: 999px; padding: 4px 12px 4px 4px;
  color: #fff; text-align: left; cursor: pointer;
}
.lw-host-av {
  width: 36px; height: 36px; border-radius: 50%; overflow: hidden; flex: none;
  box-shadow: 0 0 0 2px #FF3040;
}
.lw-host-av img { width: 100%; height: 100%; object-fit: cover; }
.lw-host-text { display: flex; flex-direction: column; min-width: 0; }
.lw-host-name { font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lw-host-title { font-size: 11px; color: rgba(255,255,255,.78); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lw-host-title:empty { display: none; }
.lw-live {
  flex: none; display: inline-flex; align-items: center; gap: 5px;
  background: #FF3040; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .5px;
  padding: 6px 10px; border-radius: 999px;
}
.lw-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.lw-pill {
  flex: none; display: inline-flex; align-items: center; gap: 5px;
  background: rgba(0,0,0,.42); backdrop-filter: blur(8px); color: #fff;
  font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 999px; border: none;
}
.lw-pill b { font-weight: 800; }
.lw-follow {
  flex: none; background: #fff; color: #111; border: none; border-radius: 999px;
  font-size: 12px; font-weight: 800; padding: 7px 12px; cursor: pointer;
}
.lw-follow.done { background: rgba(255,255,255,.18); color: #fff; }
.lw-round {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  background: rgba(0,0,0,.42); backdrop-filter: blur(8px); border: none;
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; cursor: pointer;
}
.lw-round svg { width: 20px; height: 20px; fill: currentColor; }
.lw-round:active { background: rgba(255,255,255,.14); }
.lw-heart { color: #FF3040; font-size: 22px; }
.lw-end {
  flex: none; background: #FF3040; color: #fff; border: none; border-radius: 999px;
  font-size: 13px; font-weight: 800; padding: 9px 14px; cursor: pointer;
}
.lw-state {
  position: fixed; left: 0; right: 0; top: 46%; z-index: 2; text-align: center; margin: 0;
  color: #fff; font-size: 14px; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.7); pointer-events: none;
}
.live-comments { bottom: 76px; }
.live-comment.sys { color: rgba(255,255,255,.7); background: transparent; }
.lw-bar {
  display: flex; gap: 8px; align-items: center;
  padding: 10px 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0,0,0,.7));
}
.lw-bar input {
  flex: 1; min-width: 0; height: 40px; background: rgba(255,255,255,.14); backdrop-filter: blur(8px);
  border: none; border-radius: 999px; padding: 0 14px; color: #fff; font-size: 14px; outline: none;
}
.lw-hearts { position: fixed; right: 18px; bottom: 90px; width: 60px; height: 260px; z-index: 1; pointer-events: none; }
.lw-heart-fly {
  position: absolute; bottom: 0; color: #FF3040; font-size: 26px;
  animation: lwHeart 1.5s ease-out forwards; text-shadow: 0 1px 4px rgba(0,0,0,.5);
}
@keyframes lwHeart {
  0% { opacity: 0; transform: translateY(0) scale(.6); }
  15% { opacity: 1; transform: translateY(-20px) scale(1.1); }
  100% { opacity: 0; transform: translateY(-220px) scale(.9); }
}
.lw-sound {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 96px; z-index: 3;
  background: rgba(0,0,0,.6); backdrop-filter: blur(8px); color: #fff; border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px; padding: 9px 14px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.lw-gift-sheet { background: #121218; color: #fff; }
.lw-gift-sheet .sheet-head { border-bottom: 1px solid rgba(255,255,255,.08); }
.lw-gift-sheet .sheet-head .title { color: #fff; }
.lw-gift-sheet .sheet-head .x { color: #fff; }
.lw-gift-bal {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; font-size: 13px; color: rgba(255,255,255,.7);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.lw-gift-bal .bal { font-family: var(--mono); font-size: 15px; color: #fff; font-weight: 700; }
.lw-gift-sheet .gg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.lw-gift {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 12px;
  padding: 10px 4px; display: flex; flex-direction: column; align-items: center; gap: 3px; color: #fff; cursor: pointer;
}
.lw-gift .e { font-size: 24px; line-height: 1; }
.lw-gift .n { font-size: 10px; font-weight: 600; color: rgba(255,255,255,.8); }
.lw-gift .c { font-family: var(--mono); font-size: 10px; color: #FFB800; }
.lw-gift-sheet .topup { background: none; border: none; color: #fff; font-size: 13px; font-weight: 600; text-decoration: underline; }

/* Go Live from the browser. */
.lw-go #lgVideo { transform: scaleX(-1); }   /* the front camera the way a mirror shows it; viewers get it unmirrored */
.lw-setup {
  position: fixed; left: 16px; right: 16px; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 2;
  display: flex; flex-direction: column; gap: 10px;
}
.lw-setup input {
  height: 46px; background: rgba(0,0,0,.5); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px; padding: 0 16px; color: #fff; font-size: 15px; outline: none;
}
.lw-setup-hint { margin: 0; font-size: 12px; color: rgba(255,255,255,.7); text-align: center; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.lw-go-btn {
  height: 52px; border: none; border-radius: 999px; color: #fff; font-size: 16px; font-weight: 800; letter-spacing: .6px;
  background: linear-gradient(90deg, #F9CE34, #EE2A7B, #6228D7); cursor: pointer;
  box-shadow: 0 8px 24px rgba(238,42,123,.35);
}
.lw-go-btn:disabled { opacity: .6; }
.lw-go-small {
  margin-left: auto; background: #FF3040; color: #fff; border: none; border-radius: 999px;
  font-size: 12px; font-weight: 800; padding: 7px 12px; cursor: pointer;
}

/* The live slide in the feed, playing. */
.live-slide video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: transparent;
}
.live-slide-playing .live-slide-tap { display: none; }
.live-slide-over video { opacity: .35; }
