/* ==========================================================================
   Base
   ========================================================================== */
:root {
  --tt-red: #fe2c55;
  --tt-cyan: #25f4ee;
  --panel-bg: #141418;
  --panel-line: rgba(255, 255, 255, 0.08);
  --muted: rgba(255, 255, 255, 0.55);
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #08080a;
  color: #fff;
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button { font-family: inherit; cursor: pointer; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }

kbd {
  display: inline-block;
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font: 600 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
}

/* ==========================================================================
   Escenario y "móvil"
   ========================================================================== */
#stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 16px;
}

#phone {
  position: relative;
  height: calc(100dvh - 32px);
  aspect-ratio: 9 / 16;
  border-radius: 30px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.07);
  flex: none;
  user-select: none;
  -webkit-user-select: none;
}
/* En iOS, un padre con user-select:none impide escribir en los inputs. */
#phone input { user-select: text; -webkit-user-select: text; }

body.frame-full #stage { padding: 0; gap: 0; }
body.frame-full #phone { height: 100dvh; width: 100vw; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
body.frame-full #panel { position: fixed; right: 16px; top: 16px; bottom: 16px; z-index: 5; }

#cam {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111;
}
body.mirror #cam { transform: scaleX(-1); }
/* Instagram en pantallas altas: el vídeo es una tarjeta 9:16 y la barra de comentarios queda debajo, sobre negro. */
body.ig-card #cam { top: var(--cam-top); height: var(--cam-h); border-radius: var(--cam-r); }

/* La interfaz se diseña a 390 px de ancho (iPhone) y se escala al tamaño real. */
#ui {
  position: absolute;
  left: 0;
  top: 0;
  width: 390px;
  height: var(--ui-h, 693px);
  transform-origin: 0 0;
  transform: scale(var(--s, 1));
  overflow: hidden;
  --safe-top: 12px;
  --safe-bottom: 12px;
  --card-top: 0px;
  --ig-video-bottom: 0px;
  --ig-bar-bottom: var(--safe-bottom);
  --ig-chat-bottom: calc(var(--safe-bottom) + 50px);
  --ig-hearts-bottom: calc(var(--safe-bottom) + 50px);
}
body.statusbar #ui { --safe-top: 44px; --card-top: 47px; }
body.tall #ui { --safe-bottom: 30px; }
body.skin-tiktok #ui { font-family: 'TikTok Sans', var(--font); }

.shade-top, .shade-bottom { position: absolute; left: 0; right: 0; pointer-events: none; }
.shade-top { top: 0; height: 150px; background: linear-gradient(to bottom, rgba(0, 0, 0, 0.32), transparent); }
.shade-bottom { bottom: 0; height: 320px; background: linear-gradient(to top, rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.12) 55%, transparent); }
body.ig-card .shade-bottom { bottom: var(--ig-video-bottom); height: 260px; }
body.ig-card .shade-top { top: var(--card-top); }

body.skin-tiktok .ig-only,
body.skin-instagram .tt-only { display: none !important; }

/* Barra de estado */
#statusbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 47px;
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 6px 28px 0 38px;
  font: 600 16px/1 -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  letter-spacing: -0.2px;
  z-index: 3;
}
body.statusbar #statusbar { display: flex; }
.sb-icons { display: flex; align-items: center; gap: 6px; }

/* ==========================================================================
   TikTok LIVE — cabecera
   ========================================================================== */
.tt-top {
  position: absolute;
  top: var(--safe-top);
  left: 11px;
  right: 11px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
}
.tt-host {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 1px 3px 1px 1px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.3);
}
.tt-host .host-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: #333; }
.tt-host-meta { display: flex; flex-direction: column; justify-content: center; line-height: 1.2; max-width: 92px; padding-right: 2px; }
.tt-host-meta .host-name { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-host-likes { display: flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 500; color: rgba(255, 255, 255, 0.85); white-space: nowrap; }
.tt-host-likes svg { color: #fff; }
.tt-follow {
  height: 26px;
  min-width: 72px;
  padding: 0 10px;
  border: 0;
  border-radius: 13px;
  background: #fe2c55;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.tt-follow.joined { background: #fff; color: #ff8a3d; }
.tt-follow.joined span::before { content: '♥+ '; font-size: 11px; }
.tt-right { display: flex; align-items: center; gap: 9px; }
.tt-audience {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 8px 0 2px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
}
.tt-audience .viewer-count { font-size: 12px; font-weight: 600; }
.tt-topviewers { display: flex; }
.tt-tv { position: relative; width: 21px; height: 21px; margin-right: -2px; }
.tt-tv img { width: 21px; height: 21px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25); }
.tt-tv span {
  position: absolute;
  left: 50%;
  bottom: -3px;
  transform: translateX(-50%);
  min-width: 10px;
  height: 8px;
  padding: 0 2px;
  border-radius: 4px;
  background: #ffc53d;
  color: #5a3a00;
  font-size: 6.5px;
  font-weight: 800;
  line-height: 8px;
  text-align: center;
}
.tt-tv.r2 span, .tt-tv.r3 span { background: #d6dce8; color: #2f3748; }
.tt-topviewers:not(:empty) { margin-right: 3px; }
.tt-more-lives { display: grid; place-items: center; opacity: 0.95; }
.tt-close { width: 22px; height: 22px; padding: 0; border: 0; background: none; display: grid; place-items: center; }

.tt-pills {
  position: absolute;
  top: calc(var(--safe-top) + 39px);
  left: 11px;
  display: flex;
  gap: 6px;
  z-index: 2;
}
.tt-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px 0 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.tt-pill-ic { font-size: 12px; line-height: 1; }
.tt-ball { width: 13px; height: 13px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff9ad5, #b44cff 60%, #6a2cff); }

.tt-goal {
  position: absolute;
  top: calc(var(--safe-top) + 67px);
  right: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  min-width: 64px;
  padding: 0 9px 0 7px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  z-index: 2;
}
.tg-ic { font-size: 22px; line-height: 1; }
.tg-body { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.tg-count { font-size: 13px; font-weight: 700; line-height: 1; }
.tg-count b { color: #ffd23f; }
.tg-timer { padding: 1px 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.18); font-size: 8.5px; font-weight: 600; line-height: 11px; }
.tt-goal.done .tg-count b { color: #3ee08f; }

/* ==========================================================================
   TikTok LIVE — barra inferior
   ========================================================================== */
.tt-bottom {
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: var(--safe-bottom);
  height: 32px;
  display: flex;
  align-items: center;
  gap: 5.7px;
  margin: 0;
  z-index: 3;
}
.tt-input {
  flex: 1;
  min-width: 0;
  height: 32px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 7px 0 12px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.3);
}
.tt-input input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
}
.tt-input input::placeholder { color: rgba(255, 255, 255, 0.75); }
.tt-emoji { flex: none; }
.tt-btn, .tt-send {
  position: relative;
  width: 32px;
  height: 32px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  display: grid;
  place-items: center;
  color: #fff;
}
.tt-btn:active { transform: scale(0.92); }
.tt-rose { font-size: 18px; line-height: 1; }
.tt-share-count {
  position: absolute;
  right: -3px;
  bottom: -4px;
  font-size: 8.5px;
  font-weight: 700;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}
.tt-send { display: none; background: #fe2c55; }
.tt-bottom.has-text .tt-send { display: grid; }
.tt-bottom.has-text .tt-btn { display: none; }
.tt-bottom.has-text .tt-input { background: rgba(0, 0, 0, 0.45); }

/* ==========================================================================
   Chat
   ========================================================================== */
#chatWrap {
  position: absolute;
  left: 11px;
  width: 290px;
  display: flex;
  flex-direction: column;
  z-index: 2;
}
body.skin-tiktok #chatWrap { bottom: calc(var(--safe-bottom) + 43px); height: min(40%, 280px); }
body.skin-instagram #chatWrap { left: 12px; bottom: var(--ig-chat-bottom); height: min(38%, 265px); }

/* El chat se puede desplazar hacia arriba para leer mensajes anteriores. */
#chat {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  overflow-anchor: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 40px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 40px);
}
#chat::-webkit-scrollbar { display: none; }
#chatList { margin-top: auto; padding-bottom: 2px; will-change: transform; }
.rin { animation: rowIn 0.25s ease-out; }
@keyframes rowIn { from { opacity: 0; } }

#newPill {
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  color: #161823;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  z-index: 3;
  animation: joinIn 0.2s ease-out;
}
#newPill::before { content: '↓'; font-size: 13px; }
body.skin-instagram #newPill { background: rgba(38, 38, 38, 0.92); color: #fff; }
@keyframes joinIn { from { opacity: 0; transform: translate(-50%, 8px); } }

.c { display: flex; align-items: flex-start; cursor: pointer; }
.c .av { border-radius: 50%; flex: none; object-fit: cover; background: #444; }
.cb { min-width: 0; }
.ct { word-break: break-word; overflow-wrap: anywhere; }

/* TikTok: sin burbuja, nombre gris encima y mensaje blanco semibold debajo */
body.skin-tiktok #chat { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }
body.skin-tiktok .c { gap: 7px; margin-top: 10px; }
body.skin-tiktok .c .av { width: 25px; height: 25px; }
body.skin-tiktok .cn {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}
body.skin-tiktok .cn .nm { overflow: hidden; text-overflow: ellipsis; }
body.skin-tiktok .ct { margin-top: 1px; font-size: 14px; font-weight: 600; line-height: 18px; color: #fff; }

/* Líneas de sistema de TikTok: icono en círculo + nombre gris + acción en blanco */
.sys-ic {
  width: 25px;
  height: 25px;
  flex: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  display: grid;
  place-items: center;
  font-size: 12.5px;
  line-height: 1;
}
.sys-ic svg { width: 14px; height: 14px; }
body.skin-tiktok .c.sys { align-items: center; }
body.skin-tiktok .c.sys .cb { font-size: 13px; line-height: 17px; }
body.skin-tiktok .c.sys .nm { color: rgba(255, 255, 255, 0.6); font-weight: 600; }
body.skin-tiktok .c.sys .act { color: #fff; font-weight: 700; }
body.skin-tiktok .c.sys.note .cb { color: #fff; font-weight: 600; }
body.skin-tiktok .c.host .cn .nm { color: rgba(255, 255, 255, 0.85); }

/* Insignias de TikTok delante del nombre */
.lvl, .fan, .hostbadge, .chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 14px;
  padding: 0 4px 0 3px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  flex: none;
  line-height: 1;
  text-shadow: none;
}
.lvl i, .fan i { font-style: normal; font-size: 8px; }
.lvl.t1 { background: #6f8ccf; }
.lvl.t2 { background: #7b5cf5; }
.lvl.t3 { background: linear-gradient(90deg, #7b5cf5, #d94cf0); }
.fan { background: #ff4f8b; border-radius: 3px 7px 7px 3px; padding-right: 5px; }
.chip.sub { background: #ff8a1f; }
.chip.top { background: #fe2c55; }
.hostbadge { background: #fe2c55; padding: 0 5px; }

/* Instagram: avatar de 28, nombre en negrita, mensaje debajo */
body.skin-instagram #chat { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
body.skin-instagram .c { gap: 10px; margin-top: 9px; }
body.skin-instagram .c .av { width: 28px; height: 28px; }
body.skin-instagram .cn { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; line-height: 17px; color: #fff; }
body.skin-instagram .ct { font-size: 14px; font-weight: 400; line-height: 18px; color: #fff; }
body.skin-instagram .lvl, body.skin-instagram .fan, body.skin-instagram .chip { display: none; }
body.skin-instagram .hostbadge { display: none; }
body.skin-instagram .c.sys { align-items: center; }
body.skin-instagram .c.sys .cb { font-size: 13.5px; line-height: 17px; color: rgba(255, 255, 255, 0.9); }
body.skin-instagram .c.sys .nm { font-weight: 600; color: #fff; }
body.skin-instagram .c.ig-prompt { align-items: center; gap: 10px; margin-top: 12px; text-shadow: none; }
body.skin-instagram .c.ig-prompt .sys-ic { width: 28px; height: 28px; background: #3797f0; }
body.skin-instagram .c.ig-prompt .cb { flex: 1; font-size: 12.5px; line-height: 16px; color: #fff; }
.ig-pill { flex: none; padding: 6px 10px; border-radius: 8px; background: rgba(38, 38, 38, 0.9); font-size: 12.5px; font-weight: 600; color: #fff; white-space: nowrap; }

/* Insignias de pago de Instagram: chip con 1, 2 o 3 corazones */
.igb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  height: 13px;
  padding: 0 3px;
  border-radius: 3px;
  background: #e1306c;
  text-shadow: none;
  vertical-align: -1px;
}
.igb.h1 { background: #f2542d; }
.igb.h3 { background: #a334c0; }
.igb svg { width: 8px; height: 8px; color: #fff; }

/* Comentario fijado */
#pinned { display: none; margin-bottom: 4px; cursor: pointer; }
#pinned.show { display: block; animation: slideIn 0.25s ease-out; }
#pinned .pin-label { font-size: 11px; font-weight: 700; color: rgba(255, 255, 255, 0.85); margin: 0 0 4px 2px; }
#pinned .c { margin-top: 0; padding: 7px 10px 7px 7px; border-radius: 10px; background: rgba(0, 0, 0, 0.42); }
@keyframes slideIn { from { opacity: 0; transform: translateX(-14px); } }

/* ==========================================================================
   Instagram Live
   ========================================================================== */
.ig-top {
  position: absolute;
  top: calc(var(--card-top) + 9px);
  left: 12px;
  right: 10px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
}
.ig-host { display: flex; align-items: center; gap: 8px; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }
.ig-host .host-avatar { width: 27px; height: 27px; border-radius: 50%; object-fit: cover; background: #333; }
.ig-host .host-name { font-size: 14px; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-host svg { margin-left: -3px; }
.ig-right { display: flex; align-items: center; gap: 3px; }
.ig-live {
  height: 23px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, #d300c5, #e3007a 45%, #ff0069);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.ig-viewers {
  height: 23px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 7px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.4);
  font-size: 12px;
  font-weight: 600;
}
.ig-dots { display: grid; place-items: center; width: 28px; margin-left: 6px; }
.ig-close { width: 28px; height: 28px; padding: 0; border: 0; background: none; display: grid; place-items: center; }

.ig-bottom {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: var(--ig-bar-bottom);
  height: 44px;
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  z-index: 3;
}
.ig-input {
  flex: 1;
  min-width: 0;
  height: 36px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 18px;
  margin-right: 4px;
}
.ig-input input { width: 100%; min-width: 0; border: 0; outline: 0; background: none; color: #fff; font: 400 14px var(--font); }
.ig-input input::placeholder { color: rgba(255, 255, 255, 0.85); }
.ig-btn { width: 31px; height: 31px; flex: none; padding: 0; border: 0; background: none; display: grid; place-items: center; }
.ig-btn:active { transform: scale(0.9); }
.ig-post { display: none; flex: none; padding: 0 0 0 10px; border: 0; background: none; color: #fff; font: 600 14px var(--font); }
.ig-bottom.has-text .ig-post { display: block; }
.ig-bottom.has-text .ig-btn { display: none; }

/* ==========================================================================
   Regalos de TikTok
   ========================================================================== */
#giftLane {
  position: absolute;
  left: 8px;
  bottom: calc(var(--safe-bottom) + 43px + min(40%, 280px) + 6px);
  display: flex;
  flex-direction: column-reverse;
  z-index: 2;
  pointer-events: none;
}
.gift { display: flex; align-items: center; height: 42px; margin-top: 6px; animation: giftIn 0.38s cubic-bezier(0.2, 0.9, 0.3, 1.15); }
.gift.out { animation: giftOut 0.35s ease-in forwards; }
@keyframes giftIn { from { transform: translateX(-110%); opacity: 0; } }
@keyframes giftOut { to { transform: translateY(-12px); opacity: 0; } }
.gift-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 42px;
  min-width: 170px;
  padding: 0 50px 0 4px;
  border-radius: 21px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.15));
}
.gift.first .gift-pill { background: linear-gradient(90deg, rgba(255, 62, 130, 0.75), rgba(255, 62, 130, 0.15)); }
.gift-pill img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.gift-meta { line-height: 1.2; }
.gift-name { font-size: 13px; font-weight: 700; max-width: 118px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gift-sub { font-size: 11px; color: rgba(255, 255, 255, 0.75); white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.gift-sub .gv { color: #ffd66b; font-weight: 700; }
.gift-icon {
  position: absolute;
  right: -4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 44px;
  line-height: 1;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.35));
}
.gift-count {
  margin-left: 10px;
  font-size: 27px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.5px;
  color: #fff;
  -webkit-text-stroke: 1px rgba(0, 0, 0, 0.55);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}
.gift-count.pop { animation: pop 0.26s ease-out; }
@keyframes pop { 0% { transform: scale(1.7); } 100% { transform: scale(1); } }

/* Aviso morado arriba para los regalos grandes */
#topBanner { position: absolute; left: 0; right: 0; top: calc(var(--safe-top) + 30px); height: 32px; z-index: 5; pointer-events: none; overflow: hidden; }
.tb {
  position: absolute;
  top: 0;
  left: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 16px 0 4px;
  border-radius: 16px;
  background: linear-gradient(90deg, #7b2ff7, #c13cff 60%, rgba(193, 60, 255, 0.4));
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 600;
  animation: bannerSlide 6s linear forwards;
}
.tb img { width: 26px; height: 26px; border-radius: 50%; }
.tb .tb-ic { font-size: 22px; }
@keyframes bannerSlide { from { transform: translateX(0); } to { transform: translateX(calc(-390px - 110%)); } }

/* Regalo grande a pantalla completa */
#bigGift { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.bg-show { position: absolute; inset: 0; display: grid; place-items: center; animation: bgFade 4.5s forwards; }
@keyframes bgFade { 0% { opacity: 0; } 6% { opacity: 1; } 88% { opacity: 1; } 100% { opacity: 0; } }
.bg-glow {
  position: absolute;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(255, 214, 102, 0), rgba(255, 214, 102, 0.45), rgba(255, 64, 150, 0.35), rgba(120, 90, 255, 0.35), rgba(255, 214, 102, 0));
  -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 68%);
  mask-image: radial-gradient(circle, #000 20%, transparent 68%);
  animation: spin 4.5s linear;
}
@keyframes spin { to { transform: rotate(240deg); } }
.bg-icon {
  position: relative;
  font-size: 170px;
  line-height: 1;
  filter: drop-shadow(0 16px 30px rgba(0, 0, 0, 0.45));
  animation: bgIcon 4.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
@keyframes bgIcon {
  0% { transform: scale(0.1) translateY(200px) rotate(-20deg); }
  18% { transform: scale(1.15) translateY(0) rotate(4deg); }
  26% { transform: scale(1) rotate(0); }
  60% { transform: scale(1.04) translateY(-8px); }
  86% { transform: scale(1) translateY(0); opacity: 1; }
  100% { transform: scale(1.5) translateY(-60px); opacity: 0; }
}
.confetti, .cash-rain { position: absolute; top: -30px; animation-name: fall; animation-timing-function: linear; animation-fill-mode: forwards; opacity: 0; pointer-events: none; }
.cash-rain { font-size: 26px; z-index: 5; }
@keyframes fall {
  0% { transform: translateY(0) rotate(0); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translateY(760px) rotate(540deg); opacity: 0.8; }
}

/* Botón de combo tras enviar un regalo */
#comboBtn {
  position: absolute;
  right: 14px;
  bottom: calc(var(--safe-bottom) + 44px);
  width: 66px;
  height: 66px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff6f95, #fe2c55 70%);
  color: #fff;
  display: grid;
  place-items: center;
  z-index: 7;
  box-shadow: 0 6px 20px rgba(254, 44, 85, 0.45);
  animation: pop 0.25s ease-out;
}
#comboBtn svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.cb-track { fill: none; stroke: rgba(255, 255, 255, 0.25); stroke-width: 4; }
.cb-ring { fill: none; stroke: #fff; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 182.2; stroke-dashoffset: 0; }
#comboBtn.run .cb-ring { animation: comboRing 3s linear forwards; }
@keyframes comboRing { to { stroke-dashoffset: 182.2; } }
#comboBtn .cb-ic { font-size: 22px; line-height: 1; margin-top: 6px; }
#comboBtn b { font-size: 11px; font-weight: 800; margin-bottom: 10px; }
#comboBtn:active { transform: scale(0.94); }

/* Panel de regalos */
#giftSheet { position: absolute; inset: 0; z-index: 8; }
.gs-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.001); }
.gs-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 0 calc(var(--safe-bottom) - 4px);
  border-radius: 12px 12px 0 0;
  background: #2e2e2e;
  transform: translateY(100%);
  transition: transform 0.25s ease-out;
}
#giftSheet.open .gs-panel { transform: none; }
.gs-head { display: flex; align-items: center; gap: 7px; height: 44px; padding: 0 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); font-size: 12px; color: rgba(255, 255, 255, 0.75); }
.gs-me { width: 24px; height: 24px; border-radius: 50%; }
.gs-lvl { height: 14px; padding: 0 4px; border-radius: 3px; background: #6f8ccf; font-size: 9px; font-weight: 800; color: #fff; line-height: 14px; }
.gs-head-txt { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; padding: 6px 4px; max-height: 236px; overflow-y: auto; }
.gs-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  height: 112px;
  padding: 10px 2px 6px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: #fff;
  font-family: inherit;
}
.gs-item.on { background: rgba(255, 255, 255, 0.08); }
.gs-ic { font-size: 40px; line-height: 56px; height: 56px; }
.gs-name { font-size: 12px; max-width: 88px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: rgba(255, 255, 255, 0.9); }
.gs-price { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: rgba(255, 255, 255, 0.55); }
.gs-item.on .gs-name, .gs-item.on .gs-price { display: none; }
.gs-cell-send { display: none; position: absolute; left: 6px; right: 6px; bottom: 8px; height: 24px; border-radius: 4px; background: #fe2c55; font-size: 12.5px; font-weight: 700; line-height: 24px; text-align: center; }
.gs-item.on .gs-cell-send { display: block; }
.gs-item.on .gs-ic { transform: scale(1.12); }
.coin {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe27a, #f9ce41 55%, #d9a300);
  box-shadow: inset 0 0 0 1.5px rgba(160, 95, 0, 0.5);
  flex: none;
}
.gs-foot { display: flex; align-items: center; gap: 16px; height: 50px; padding: 0 14px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.gs-tab { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 700; color: rgba(255, 255, 255, 0.5); }
.gs-tab.on { color: #fff; }
.gs-recharge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 12px;
  border-radius: 16px;
  background: #3a3a3a;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

/* ==========================================================================
   Corazones
   ========================================================================== */
#hearts {
  position: absolute;
  right: 27px;
  bottom: calc(var(--safe-bottom) + 36px);
  width: 1px;
  height: 1px;
  pointer-events: none;
  z-index: 3;
}
body.skin-instagram #hearts { right: 27px; bottom: var(--ig-hearts-bottom); }
.heart {
  position: absolute;
  left: -9px;
  bottom: 0;
  width: 18px;
  height: 18px;
  color: var(--c);
  animation: heartUp var(--dur, 2.6s) ease-out forwards;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}
body.skin-instagram .heart { left: -11px; width: 22px; height: 22px; }
.heart svg { width: 100%; height: 100%; }
.heart.emoji { font-size: 22px; line-height: 22px; width: 24px; height: 24px; left: -12px; }
@keyframes heartUp {
  0% { transform: translate(0, 0) scale(0.3); opacity: 0; }
  10% { transform: translate(0, -18px) scale(var(--s)); opacity: 1; }
  50% { transform: translate(var(--dx1), -130px) scale(var(--s)); opacity: 1; }
  100% { transform: translate(var(--dx2), -270px) scale(calc(var(--s) * 0.8)); opacity: 0; }
}
#tapHearts { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.tap-heart {
  position: absolute;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  color: #fe2c55;
  transform: rotate(var(--r));
  animation: tapHeart 0.9s ease-out forwards;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.25));
}
.tap-heart svg { width: 100%; height: 100%; }
@keyframes tapHeart {
  0% { transform: rotate(var(--r)) scale(0.2); opacity: 0; }
  20% { transform: rotate(var(--r)) scale(1.15); opacity: 1; }
  35% { transform: rotate(var(--r)) scale(0.95); }
  100% { transform: rotate(var(--r)) translateY(-70px) scale(1.2); opacity: 0; }
}

/* ==========================================================================
   Avisos sobre el vídeo: toast y donaciones
   ========================================================================== */
#toast {
  position: absolute;
  top: calc(var(--safe-top) + 120px);
  left: 50%;
  transform: translateX(-50%);
  max-width: 330px;
  padding: 8px 14px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.62);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 6;
}
#toast.show { opacity: 1; }

.c.don {
  display: block !important;
  width: 262px;
  max-width: 100%;
  margin-top: 8px;
  padding: 0 !important;
  border-radius: 12px !important;
  overflow: hidden;
  background: var(--dc) !important;
  color: var(--dt, #fff);
  text-shadow: none;
}
.don-head { display: flex; align-items: center; gap: 7px; padding: 6px 10px 5px 6px; background: rgba(0, 0, 0, 0.14); }
.don-head .av { width: 24px !important; height: 24px !important; }
.don-head .nm { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; opacity: 0.92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: inherit !important; }
.don-amt { font-size: 14px; font-weight: 800; letter-spacing: -0.2px; }
.don-msg { padding: 6px 11px 8px; font-size: 14px; font-weight: 500; line-height: 18px; word-break: break-word; }
.don-msg:empty { display: none; }

#donAlert { position: absolute; left: 0; right: 0; top: calc(var(--safe-top) + 116px); display: flex; justify-content: center; pointer-events: none; z-index: 5; }
body.skin-instagram #donAlert { top: calc(var(--card-top) + 52px); }
.don-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 330px;
  padding: 10px 14px 10px 10px;
  border-radius: 18px;
  background: linear-gradient(120deg, var(--dc), color-mix(in srgb, var(--dc) 55%, #000));
  color: var(--dt, #fff);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.15) inset;
  animation: donIn 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.25), donOut 0.4s ease-in 4.6s forwards;
}
.don-card img { width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.85); flex: none; }
.don-card .dc-body { flex: 1; min-width: 0; line-height: 1.25; }
.don-card .dc-top { font-size: 12.5px; opacity: 0.92; }
.don-card .dc-top b { font-weight: 700; }
.don-card .dc-amt { font-size: 26px; font-weight: 900; letter-spacing: -0.5px; }
.don-card .dc-msg { font-size: 13px; opacity: 0.95; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.don-card .dc-cash { font-size: 34px; animation: cashBounce 0.9s ease-in-out infinite alternate; }
@keyframes donIn { from { transform: translateY(-30px) scale(0.85); opacity: 0; } }
@keyframes donOut { to { transform: translateY(-20px); opacity: 0; } }
@keyframes cashBounce { to { transform: translateY(-4px) rotate(-8deg); } }

/* ==========================================================================
   Hoja de controles del directo
   ========================================================================== */
#ctrlSheet { position: absolute; inset: 0; z-index: 9; font-family: var(--font); }
.cs-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.35); }
.cs-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px 16px calc(var(--safe-bottom) + 6px);
  border-radius: 16px 16px 0 0;
  background: #1a1a1d;
  transform: translateY(100%);
  transition: transform 0.25s ease-out;
  font-size: 13px;
}
#ctrlSheet.open .cs-panel { transform: none; }
.cs-grip { width: 36px; height: 4px; margin: 0 auto 10px; border-radius: 2px; background: rgba(255, 255, 255, 0.25); }
.cs-panel h4 { margin: 0 0 10px; font-size: 15px; }
.cs-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 6px; }
.cs-actions button, .cs-end { height: 40px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, 0.08); color: #fff; font-size: 13.5px; font-weight: 600; font-family: inherit; }
.cs-actions button.active { background: rgba(254, 44, 85, 0.3); }
.cs-end { width: 100%; margin-top: 10px; background: rgba(254, 44, 85, 0.18); color: #ff8aa0; }


/* ==========================================================================
   Fin del directo
   ========================================================================== */
#ended {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: fadeIn 0.3s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } }
.ended-card { width: 300px; text-align: center; }
.ended-avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 3px solid rgba(255, 255, 255, 0.9); }
.ended-card h2 { margin: 16px 0 4px; font-size: 21px; }
.ended-dur { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.ended-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 26px; }
.ended-grid div { padding: 14px 8px; border-radius: 12px; background: rgba(255, 255, 255, 0.08); display: flex; flex-direction: column; gap: 3px; }
.ended-grid b { font-size: 20px; }
.ended-grid span { font-size: 11.5px; color: var(--muted); }
#backToSetup { width: 100%; height: 46px; border: 0; border-radius: 8px; background: var(--tt-red); color: #fff; font-size: 15px; font-weight: 700; }
body.skin-instagram #backToSetup { background: #0095f6; }

/* ==========================================================================
   Panel de IA
   ========================================================================== */
#panel {
  width: 330px;
  height: calc(100dvh - 32px);
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-line);
  overflow-y: auto;
  font-size: 13px;
}
body.no-panel #panel { display: none; }
#panel header { display: flex; justify-content: space-between; align-items: flex-start; }
#panel h3 { margin: 0; font-size: 16px; }
#panel h4 { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; color: rgba(255, 255, 255, 0.7); display: flex; align-items: center; gap: 6px; }
#panel section { padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.035); border: 1px solid var(--panel-line); }
#aiStatus { margin: 3px 0 0; font-size: 12px; }
.scene { margin: 0; line-height: 1.45; }
.notable { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px; }
.notable li { padding: 2px 8px; border-radius: 10px; background: rgba(37, 244, 238, 0.1); color: #9ff8f5; font-size: 11.5px; }
.hear { margin: 0; line-height: 1.45; max-height: 96px; overflow-y: auto; }
.hear .interim { color: var(--muted); font-style: italic; }
.pill-status { font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 8px; background: rgba(255, 255, 255, 0.1); text-transform: none; letter-spacing: 0; }
.pill-status.on { background: rgba(48, 209, 88, 0.2); color: #6ee79a; }
.pill-status.off { background: rgba(255, 69, 58, 0.2); color: #ff8a80; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.metrics b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.metrics span { font-size: 10.5px; color: var(--muted); }
.range { display: block; margin: 4px 0 10px; font-size: 12.5px; color: rgba(255, 255, 255, 0.85); }
.range output { float: right; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.range input { width: 100%; margin-top: 6px; accent-color: var(--tt-red); }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.actions button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 8px 9px;
  border-radius: 9px;
  border: 1px solid var(--panel-line);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 12.5px;
  text-align: left;
}
.actions button:hover { background: rgba(255, 255, 255, 0.11); }
.actions button.active { background: rgba(254, 44, 85, 0.25); border-color: rgba(254, 44, 85, 0.5); }
.log-section { flex: 1; min-height: 140px; display: flex; flex-direction: column; }
.agents-live { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.agents-live span { padding: 2px 8px; border-radius: 10px; background: rgba(255, 255, 255, 0.07); font-size: 11.5px; }
.log { flex: 1; margin: 0; overflow-y: auto; font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; color: rgba(255, 255, 255, 0.62); white-space: pre-wrap; }

/* ==========================================================================
   Configuración
   ========================================================================== */
#setup {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
  background: radial-gradient(1200px 600px at 20% 0%, rgba(254, 44, 85, 0.18), transparent 60%),
    radial-gradient(900px 500px at 100% 100%, rgba(37, 244, 238, 0.12), transparent 60%),
    rgba(6, 6, 8, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
body.live #setup { display: none; }
.setup-card {
  width: min(920px, 100%);
  padding: 26px 28px 20px;
  border-radius: 22px;
  background: rgba(20, 20, 24, 0.92);
  border: 1px solid var(--panel-line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.setup-head { display: flex; align-items: center; gap: 14px; }
.setup-head h1 { margin: 0; font-size: 22px; letter-spacing: -0.3px; }
.setup-head p { margin: 3px 0 0; font-size: 13.5px; }
.logo-dot { width: 42px; height: 42px; flex: none; border-radius: 12px; background: var(--tt-red); position: relative; box-shadow: -3px -2px 0 var(--tt-cyan); }
.logo-dot::after { content: ''; position: absolute; inset: 13px; border-radius: 50%; background: #fff; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { transform: scale(0.8); opacity: 0.7; } }
.banner { margin: 16px 0 6px; padding: 10px 12px; border-radius: 10px; font-size: 13px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--panel-line); }
.banner.ok { background: rgba(48, 209, 88, 0.1); border-color: rgba(48, 209, 88, 0.3); }
.banner.warn { background: rgba(255, 159, 10, 0.1); border-color: rgba(255, 159, 10, 0.35); }
.banner code { font-size: 12px; background: rgba(255, 255, 255, 0.1); padding: 1px 5px; border-radius: 4px; }
.setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 6px; }
.col > label, .two label { display: block; margin: 12px 0 6px; font-size: 12.5px; font-weight: 600; color: rgba(255, 255, 255, 0.82); }
.col input:not([type]), .col input[type='text'], .col textarea, .col select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font: 14px var(--font);
  outline: none;
  resize: vertical;
}
.col select option { background: #1c1c21; }
.col input:focus, .col textarea:focus, .col select:focus { border-color: rgba(254, 44, 85, 0.7); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.two .range { margin-top: 12px; font-weight: 600; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); }
.seg button { height: 36px; border: 0; border-radius: 9px; background: none; color: rgba(255, 255, 255, 0.75); font-weight: 700; font-size: 14px; }
.seg button.on[data-v='tiktok'] { background: #fff; color: #000; box-shadow: -2px 0 0 var(--tt-cyan) inset, 2px 0 0 var(--tt-red) inset; }
.seg button.on[data-v='instagram'] { background: linear-gradient(45deg, #fa7e1e, #d62976, #962fbf); color: #fff; }
.agent-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.agent-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
  cursor: pointer;
  margin: 0;
}
.agent-list label:has(input:checked) { border-color: rgba(254, 44, 85, 0.55); background: rgba(254, 44, 85, 0.1); }
.agent-list input { accent-color: var(--tt-red); margin: 0; }
.checks { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; font-size: 13.5px; }
.checks label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.checks input { accent-color: var(--tt-red); width: 16px; height: 16px; margin: 0; }
.go-live {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  margin: 22px 0 12px;
  border: 0;
  border-radius: 12px;
  background: var(--tt-red);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.2px;
  box-shadow: 0 10px 30px rgba(254, 44, 85, 0.35);
}
.go-live:hover { filter: brightness(1.08); }
.go-live:disabled { opacity: 0.6; cursor: wait; }
.go-live .dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; animation: pulse 1.2s infinite; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1080px) {
  #panel { position: fixed; right: 12px; top: 12px; bottom: 12px; height: auto; z-index: 5; width: 300px; }
}
@media (max-width: 720px) {
  #stage { padding: 0; }
  #phone { height: 100dvh; width: 100vw; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
  #panel { display: none; }
  .setup-grid, .two { grid-template-columns: 1fr; gap: 0; }
  .setup-card { padding: 20px 16px; }
}

/* ==========================================================================
   Panel y configuración: añadidos
   ========================================================================== */
.meter { flex: 1; height: 4px; margin-left: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: #30d158; transition: width 0.1s linear; }
.metrics .money { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline; padding-top: 8px; margin-top: 2px; border-top: 1px solid var(--panel-line); text-align: left; }
.metrics .money span { font-size: 12px; color: rgba(255, 255, 255, 0.75); }
.metrics .money b { font-size: 15px; color: #ffd66b; }
.ended-grid .wide { grid-column: 1 / -1; }
.ended-grid .wide b { color: #ffd66b; }
.profile-row { display: flex; gap: 12px; align-items: center; }
.avatar-preview { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; background: #222; border: 2px solid rgba(255, 255, 255, 0.15); }
.profile-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.avatar-actions { display: flex; gap: 6px; }
.mini-btn { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.06); color: #fff; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.mini-btn:hover { background: rgba(255, 255, 255, 0.12); }
.hint { margin: 5px 0 0; min-height: 15px; }
@media (max-width: 720px) {
  #stage { top: var(--vvt, 0px); bottom: auto; height: var(--vvh, 100dvh); }
  #phone { height: var(--vvh, 100dvh); }
}
body.frame-full #stage { top: var(--vvt, 0px); bottom: auto; height: var(--vvh, 100dvh); }
body.frame-full #phone { height: var(--vvh, 100dvh); }

/* Límite del directo y tema de conversación en el panel */
.live-clock { margin: 4px 0 0; font: 600 12px ui-monospace, SFMono-Regular, Menlo, monospace; color: rgba(255, 255, 255, 0.75); }
.live-clock.warn { color: #ffb14a; }
.topic { margin: 8px 0 0; font-size: 12px; color: #9ff8f5; }
.topic:empty { display: none; }
.ended-reason { margin: -14px 0 18px; font-size: 13px; color: #ffb14a; }

/* ==========================================================================
   Invitados: entrada, sonido, panel y acceso de anfitrión
   ========================================================================== */
body.guest #setup, body.guest #panel, body.guest #backToSetup { display: none !important; }
#guestJoin {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(700px 500px at 50% 20%, rgba(254, 44, 85, 0.22), transparent 70%), #07070a;
}
.gj-card { width: min(340px, 100%); display: flex; flex-direction: column; align-items: center; text-align: center; }
.gj-avatar { width: 104px; height: 104px; border-radius: 50%; object-fit: cover; background: #222; border: 3px solid #fe2c55; }
.gj-live { margin-top: -12px; position: relative; padding: 2px 9px; border-radius: 4px; background: #fe2c55; font-size: 11px; font-weight: 800; letter-spacing: 0.4px; }
#guestJoin.ig .gj-avatar { border-color: #d62976; }
#guestJoin.ig .gj-live { background: linear-gradient(90deg, #d300c5, #ff0069); }
#guestJoin.over .gj-avatar { filter: grayscale(1); border-color: #444; }
#guestJoin.over .gj-live { display: none; }
.gj-card h2 { margin: 16px 0 4px; font-size: 20px; }
.gj-card p { margin: 0 0 18px; font-size: 14px; }
#gjForm { width: 100%; display: flex; flex-direction: column; gap: 10px; }
#gjName { width: 100%; height: 46px; padding: 0 14px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.06); color: #fff; font: 15px var(--font); outline: none; }
#gjName:focus { border-color: rgba(254, 44, 85, 0.7); }
#gjGo { height: 48px; border: 0; border-radius: 10px; background: #fe2c55; color: #fff; font: 700 16px var(--font); }
#guestJoin.ig #gjGo { background: #0095f6; }
#unmute {
  position: absolute;
  top: calc(var(--safe-top) + 120px);
  left: 50%;
  transform: translateX(-50%);
  padding: 9px 16px;
  border: 0;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font: 700 13px var(--font);
  z-index: 7;
  animation: pop 0.3s ease-out;
}
.share-row { display: flex; gap: 6px; }
.share-row input { flex: 1; min-width: 0; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--panel-line); background: rgba(255, 255, 255, 0.05); color: #fff; font: 11.5px ui-monospace, SFMono-Regular, Menlo, monospace; }
.guest-list { margin: 8px 0 0; }
.login { margin: 10px 0 4px; padding: 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--panel-line); font-size: 13px; }
.login p { margin: 0 0 8px; }
.login-row { display: flex; gap: 8px; }
.login-row input { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.05); color: #fff; font: 14px var(--font); outline: none; }
.login .hint { color: #ff8a80; margin: 6px 0 0; }
