:root {
  --live: #ff2e4d;
  --ring-a: #00d2ff;
  --ring-b: #7b5cff;
  --ring-c: #ff4fd8;
  --glass: rgba(20, 20, 24, 0.42);
  --text-shadow: 0 1px 2px rgba(0, 0, 0, .55);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #fff;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
[hidden] { display: none !important; }

/* Desktop: fundo desfocado com a foto do expert */
.backdrop {
  position: fixed; inset: -40px;
  background: #0b0b0f center/cover no-repeat;
  filter: blur(40px) brightness(.45) saturate(1.2);
  transform: scale(1.1);
}

.stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: #000;
}
@media (min-width: 700px) {
  .stage {
    width: min(calc(100dvh * 9 / 16), 480px);
    height: min(100dvh, 853px);
    top: 50%; transform: translateY(-50%);
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  }
}

video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  background: #000;
}

.shade { position: absolute; left: 0; right: 0; pointer-events: none; }
.shade-top { top: 0; height: 140px; background: linear-gradient(rgba(0,0,0,.55), transparent); }
.shade-bottom { bottom: 0; height: 55%; background: linear-gradient(transparent, rgba(0,0,0,.65)); }

/* ---------- Topo ---------- */
.top {
  position: absolute; top: 0; left: 0; right: 0;
  padding: calc(14px + var(--safe-top)) 12px 0 12px;
  display: flex; align-items: center; gap: 8px;
  z-index: 5;
}
.host { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1; }
.ring {
  width: 38px; height: 38px; border-radius: 50%; padding: 2px; flex: none;
  background: conic-gradient(from 210deg, var(--ring-a), var(--ring-b), var(--ring-c), var(--ring-a));
}
.ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid #000; display: block; background: #222; }
.host-text { min-width: 0; text-shadow: var(--text-shadow); }
.handle { display: flex; align-items: center; gap: 4px; font-weight: 700; font-size: 14px; line-height: 1.15; }
.handle span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.verified { width: 15px; height: 15px; color: #3d8bff; flex: none; }
.host-name { font-size: 12px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.badges { display: flex; align-items: center; gap: 6px; flex: none; }
.badge-live {
  /* pílula arredondada igual ao Instagram */
  display: inline-flex; align-items: center; justify-content: center; height: 26px; box-sizing: border-box;
  background: #ff0f6a; color: #fff;
  font-size: 13px; font-weight: 600; letter-spacing: 0; line-height: 1;
  padding: 0 11px; border-radius: 999px;
}
/* centraliza pela altura real das letras (corrige o desvio da fonte do Windows/Android) */
.badge-live, .badge-viewers span { text-box: trim-both cap alphabetic; }
.badge-viewers {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 26px; box-sizing: border-box; line-height: 1;
  background: rgba(40, 40, 46, .62); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-size: 13px; font-weight: 600; padding: 0 10px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.badge-viewers svg { width: 14px; height: 14px; flex: none; display: block; }

.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; flex: none; }
.icon-btn svg { width: 24px; height: 24px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.close svg { width: 22px; height: 22px; }
.sound { width: 36px; }
.sound svg { width: 23px; height: 23px; }

/* ---------- Som / status ---------- */
.unmute {
  position: absolute; top: calc(70px + var(--safe-top)); left: 50%; transform: translateX(-50%);
  z-index: 6; display: inline-flex; align-items: center; gap: 8px;
  background: rgba(0, 0, 0, .55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding: 9px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  animation: fadeIn .3s ease;
}
.unmute svg { width: 18px; height: 18px; }

.status {
  position: absolute; top: 38%; left: 50%; transform: translate(-50%, -50%);
  z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 12px;
  font-size: 13px; font-weight: 600; text-shadow: var(--text-shadow);
}
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.25); border-top-color: #fff;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Offline ---------- */
.offline {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 30px; text-align: center;
  background: radial-gradient(120% 80% at 50% 30%, #1d1830 0%, #07070a 70%);
}
.offline-ring {
  width: 112px; height: 112px; border-radius: 50%; padding: 4px;
  background: conic-gradient(from 210deg, var(--ring-a), var(--ring-b), var(--ring-c), var(--ring-a));
  animation: ringSpin 6s linear infinite;
}
.offline-ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 4px solid #0b0a12; display: block; animation: ringSpin 6s linear infinite reverse; background: #222; }
@keyframes ringSpin { to { transform: rotate(360deg); } }
.offline h1 { font-size: 21px; margin: 22px 0 8px; line-height: 1.25; }
.offline p { font-size: 14px; opacity: .72; margin: 0; max-width: 320px; line-height: 1.45; }
.waiting { display: flex; gap: 6px; margin-top: 24px; }
.waiting span { width: 8px; height: 8px; border-radius: 50%; background: #fff; opacity: .3; animation: dot 1.2s infinite; }
.waiting span:nth-child(2) { animation-delay: .2s; }
.waiting span:nth-child(3) { animation-delay: .4s; }
.waiting-count { margin-top: 14px; font-size: 13px; font-weight: 600; opacity: .7; }
@keyframes dot { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }

/* ---------- Base: comentários, CTA, composer ---------- */
.bottom {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  padding: 0 12px calc(10px + var(--safe-bottom));
  display: flex; flex-direction: column; gap: 10px;
  transition: opacity .25s;
}
.stage.clean .comments, .stage.clean .pinned { opacity: 0; pointer-events: none; }

.pinned {
  /* mesmo visual de um comentário do HOST, com o pino no lugar da tag */
  align-self: flex-start; max-width: 86%;
  display: flex; gap: 9px; align-items: flex-start;
  font-size: 13.5px; line-height: 1.33; text-shadow: var(--text-shadow);
  animation: commentIn .3s ease;
}
.pinned-av {
  width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none; background: #222;
  box-shadow: 0 0 0 2px var(--ring-b);
}
.pinned-body { min-width: 0; }
.pinned-head { display: flex; align-items: center; gap: 0; }
.pinned-head b { font-weight: 700; font-size: 13px; }
.pinned-verified { display: none !important; }
.pinned-tag {
  display: inline-flex; align-items: center; justify-content: center; margin-left: 5px;
  background: linear-gradient(90deg, var(--ring-b), var(--ring-c)); padding: 2px 7px; border-radius: 4px;
  text-shadow: none;
}
.pinned-tag svg { width: 11px; height: 11px; color: #fff; }

.comments {
  list-style: none; margin: 0; padding: 0;
  max-height: 34vh; max-height: 34dvh;
  overflow-y: auto; scrollbar-width: none;
  display: flex; flex-direction: column; gap: 10px;
  /* mensagem do topo vai sumindo (igual ao Instagram) */
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.08) 0, rgba(0,0,0,.45) 26px, #000 84px);
          mask-image: linear-gradient(to bottom, rgba(0,0,0,.08) 0, rgba(0,0,0,.45) 26px, #000 84px);
  padding-top: 14px;
  transition: opacity .25s;
  overscroll-behavior: contain;
}
.comments::-webkit-scrollbar { display: none; }
.comments:empty { padding-top: 0; }
.comments.fading { opacity: 0; transition: opacity .45s ease; }
.comment {
  display: flex; gap: 9px; align-items: flex-start;
  font-size: 13.5px; line-height: 1.33; text-shadow: var(--text-shadow);
  max-width: 86%;
  animation: commentIn .28s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes commentIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.comment .av {
  width: 30px; height: 30px; border-radius: 50%; flex: none; object-fit: cover;
  display: grid; place-items: center; font-size: 12px; font-weight: 800; text-shadow: none;
}
.comment b { font-weight: 700; display: block; font-size: 13px; }
.comment .tag {
  display: inline-block; margin-left: 5px; font-size: 10px; font-weight: 800;
  background: linear-gradient(90deg, var(--ring-b), var(--ring-c)); padding: 1px 6px; border-radius: 4px;
  text-shadow: none; vertical-align: 1px;
}
.comment.host .av { box-shadow: 0 0 0 2px var(--ring-b); }
.comment.system { opacity: .8; font-size: 12.5px; }

.cta {
  display: flex; align-items: center; gap: 14px;
  min-height: 60px; padding: 10px 16px 10px 18px; border-radius: 18px;
  margin-bottom: 12px; /* perto da caixa de comentário */
  color: #fff; text-decoration: none; text-align: left;
  background: var(--cta, #22c55e); opacity: 1;
  animation: ctaIn .45s cubic-bezier(.2, .9, .3, 1.3);
  -webkit-tap-highlight-color: transparent;
}
.cta:active { filter: brightness(.92); }
.cta .cta-ico { width: 26px; height: 26px; flex: none; }
.cta .cta-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cta .cta-title { font-weight: 700; font-size: 16px; line-height: 1.22; white-space: normal; overflow-wrap: anywhere; } /* texto longo quebra para a linha de baixo */
.cta .cta-sub { font-weight: 500; font-size: 13px; line-height: 1.2; opacity: .92; }
.cta .cta-arrow { width: 22px; height: 22px; flex: none; }
@keyframes ctaIn { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }

.composer { display: flex; align-items: center; gap: 4px; }
.input-wrap {
  flex: 1; display: flex; align-items: center;
  border: 1.5px solid rgba(255, 255, 255, .55); border-radius: 999px;
  background: rgba(0, 0, 0, .18);
  height: 44px; padding: 0 6px 0 16px; min-width: 0;
}
.input-wrap input {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: #fff;
  font-size: 16px; /* evita zoom no iOS */
}
.input-wrap input::placeholder { color: rgba(255, 255, 255, .85); }
.send { font-weight: 700; color: #6fb6ff; padding: 0 10px; font-size: 14px; }
.composer.disabled .input-wrap { opacity: .5; pointer-events: none; }
.heart.on svg path { fill: var(--live); stroke: var(--live); }
.heart:active svg { transform: scale(.85); }

/* ---------- Corações flutuantes ---------- */
.hearts { position: absolute; right: 8px; bottom: 180px; width: 70px; height: 60%; pointer-events: none; z-index: 6; }
.fh {
  position: absolute; bottom: 0; left: 50%; width: 30px; height: 30px;
  animation: floatUp var(--d, 2.6s) ease-out forwards;
}
.fh svg { width: 100%; height: 100%; filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); }
@keyframes floatUp {
  0% { transform: translate(-50%, 0) scale(.3); opacity: 0; }
  12% { transform: translate(calc(-50% + var(--x1)), -30px) scale(1.05); opacity: 1; }
  60% { transform: translate(calc(-50% + var(--x2)), -55%) scale(1); opacity: .95; }
  100% { transform: translate(calc(-50% + var(--x3)), -100%) scale(.85); opacity: 0; }
}

/* ---------- Sheet de nome ---------- */
.sheet {
  position: absolute; inset: 0; z-index: 20;
  background: rgba(0, 0, 0, .5); display: flex; align-items: flex-end;
  animation: fadeIn .2s;
}
.sheet-card {
  width: 100%; background: #16161b; border-radius: 22px 22px 0 0;
  padding: 22px 20px calc(22px + var(--safe-bottom));
  animation: slideUp .3s cubic-bezier(.2, .9, .3, 1);
}
.sheet-card h3 { margin: 0 0 4px; font-size: 18px; }
.sheet-card p { margin: 0 0 16px; font-size: 14px; opacity: .65; }
.sheet-card input {
  width: 100%; height: 48px; border-radius: 12px; border: 1px solid #2c2c35;
  background: #0e0e12; color: #fff; padding: 0 14px; font-size: 16px; outline: 0;
}
.sheet-card input:focus { border-color: var(--ring-b); }
.sheet-card button {
  width: 100%; height: 48px; margin-top: 12px; border-radius: 12px;
  background: linear-gradient(90deg, var(--ring-b), var(--ring-c)); font-weight: 800; font-size: 15px;
}
/* ---------- Popup de cadastro ---------- */
.lead {
  position: absolute; inset: 0; z-index: 25;
  background: rgba(0, 0, 0, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn .25s;
}
.lead-card {
  position: relative; width: 100%; max-width: 360px; text-align: center;
  background: #16161b; border: 1px solid #26262e; border-radius: 22px;
  padding: 26px 20px 18px; box-shadow: 0 24px 60px -10px rgba(0, 0, 0, .7);
  animation: popIn .35s cubic-bezier(.2, .9, .3, 1.2);
}
.lead-close { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #fff; opacity: .7; }
.lead-close svg { width: 18px; height: 18px; }
.lead-av { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: #222; box-shadow: 0 0 0 2.5px #16161b, 0 0 0 5px var(--ring-b); margin: 0 auto 12px; display: block; }
.lead-card h3 { margin: 0 0 6px; font-size: 19px; line-height: 1.25; }
.lead-card p { margin: 0 0 16px; font-size: 14px; line-height: 1.4; opacity: .7; }
.lead-card input {
  width: 100%; height: 48px; margin-bottom: 10px; border-radius: 12px; border: 1px solid #2c2c35;
  background: #0e0e12; color: #fff; padding: 0 14px; font-size: 16px; outline: 0;
}
.lead-card input:focus { border-color: var(--cta, var(--ring-b)); }
.lead-card input.bad { border-color: #ff4d5e; }
.lead-err { color: #ff6b78; font-size: 13px; margin: -2px 0 8px; text-align: left; }
.lead-btn {
  width: 100%; height: 50px; margin-top: 2px; border-radius: 12px; color: #fff;
  background: var(--cta, #22c55e); font-weight: 800; font-size: 15.5px;
}
.lead-btn:disabled { opacity: .6; }
.lead-safe { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 12px; font-size: 11.5px; opacity: .5; }
.lead-safe svg { width: 12px; height: 12px; }
.lead-ok { padding: 10px 0 8px; }
.lead-check { width: 58px; height: 58px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: var(--cta, #22c55e); }
.lead-check svg { width: 30px; height: 30px; color: #fff; }
/* ---------- Popup de imagem (banner + botão) ---------- */
.promo {
  position: absolute; inset: 0; z-index: 25;
  background: rgba(0, 0, 0, .62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 22px;
  animation: fadeIn .25s;
}
.promo-card {
  position: relative; width: 100%; max-width: 360px; max-height: calc(100% - 20px);
  display: flex; flex-direction: column; overflow: hidden;
  background: #0c0b0d; border: 1px solid color-mix(in srgb, var(--cta, #e11) 30%, #2a2a2e); border-radius: 22px;
  box-shadow: 0 30px 80px -12px rgba(0, 0, 0, .8);
  animation: popIn .35s cubic-bezier(.2, .9, .3, 1.2);
}
.promo-x {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0, 0, 0, .55); color: #fff;
}
.promo-x svg { width: 16px; height: 16px; }
.promo-logo {
  flex: none; display: flex; align-items: center; justify-content: center;
  padding: 26px 56px 16px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--cta, #e11) 14%, #0c0b0d), #0c0b0d);
}
.promo-logo img { max-height: 46px; max-width: 100%; object-fit: contain; display: block; }
.promo-img { flex: 1 1 auto; min-height: 0; overflow: hidden; }
.promo-img img { display: block; width: 100%; height: 100%; max-height: 58vh; object-fit: cover; object-position: top; }
.promo-foot { flex: none; padding: 18px 18px 10px; background: #131214; box-shadow: 0 -10px 24px rgba(0, 0, 0, .45); }
.promo-btn {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 52px; border-radius: 12px;
  color: #fff; text-decoration: none; text-transform: uppercase; font-style: italic; font-weight: 900; font-size: 16px; letter-spacing: .3px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 55%), var(--cta, #e11);
  box-shadow: 0 8px 26px -4px color-mix(in srgb, var(--cta, #e11) 70%, transparent);
}
.promo-btn:active { filter: brightness(.92); }
.promo-skip { display: block; width: 100%; padding: 14px 0 8px; color: #9b9ba1; font-weight: 600; font-size: 15px; }
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.toast {
  position: absolute; left: 50%; bottom: 130px; transform: translateX(-50%); z-index: 30;
  background: rgba(0,0,0,.8); padding: 9px 14px; border-radius: 10px; font-size: 13px; font-weight: 600;
  white-space: nowrap; animation: fadeIn .2s;
}
.notfound { position: absolute; inset: 0; z-index: 40; background: #07070a; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.notfound h1 { font-size: 22px; margin: 0 0 8px; }
.notfound p { opacity: .6; margin: 0; }
