/* Regalos en el live (regalos-v5.mjs), con el lenguaje de TikTok Shop:
   negro sólido, rojo TikTok para la acción, regalos sin cajas y la moneda
   dorada. Nada de degradados: lo que se toca es rojo y lo demás se apaga. */
:root {
  --rg-rojo: #FE2C55; --rg-rojo-2: #e0244a;
  --rg-hoja: #121212; --rg-gris: #1f1f23; --rg-gris-2: #2a2a2f; --rg-linea: rgba(255,255,255,.08);
  --rg-txt: #fff; --rg-txt-2: rgba(255,255,255,.62); --rg-oro: #fbbf24;
  --rg-f: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ── botón 🎁 en la columna (como el Me gusta) ────────────────────────── */
.rg-boton {
  position: fixed; left: 16px; bottom: 92px; z-index: 25;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 0; border: 0; background: none; color: #fff; cursor: pointer;
  font: 600 10px/1 var(--rg-f); text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
.rg-b-ico {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
  background: rgba(0,0,0,.42); border: 1px solid rgba(255,255,255,.18); font-size: 23px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: rg-latido 2.8s ease-in-out infinite;
}
.rg-boton:active .rg-b-ico { scale: .92; }
.rg-boton.rg-col { bottom: auto; transform: translateX(-50%); }
@keyframes rg-latido { 0%, 84%, 100% { rotate: 0deg; } 88% { rotate: -12deg; } 92% { rotate: 10deg; } 96% { rotate: -6deg; } }

/* ── avisos de regalo (izquierda) ─────────────────────────────────────── */
.rg-capa { position: fixed; inset: 0; z-index: 30; pointer-events: none; overflow: hidden; }
.rg-avisos { position: absolute; left: 10px; top: 36%; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 90px); }
.rg-aviso {
  display: flex; align-items: center; gap: 8px; width: max-content; max-width: 100%;
  padding: 3px 12px 3px 3px; border-radius: 999px; color: #fff;
  background: linear-gradient(90deg, rgba(0,0,0,.6), rgba(0,0,0,.15));
  font: 12px/1.2 var(--rg-f); animation: rg-entra .35s cubic-bezier(.2,.9,.3,1.3);
}
.rg-ava { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--rg-rojo); font-weight: 800; font-size: 14px; border: 2px solid #fff; }
.rg-txt { display: flex; flex-direction: column; min-width: 0; }
.rg-txt b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.rg-txt span { color: rgba(255,255,255,.75); font-size: 11px; white-space: nowrap; }
.rg-emo { font-size: 30px; line-height: 1; filter: drop-shadow(0 2px 6px rgba(0,0,0,.4)); }
.rg-x { font: italic 900 22px/1 var(--rg-f); color: #fff; -webkit-text-stroke: 1px var(--rg-rojo); text-shadow: 0 2px 0 var(--rg-rojo); }
.rg-pop .rg-x, .rg-pop.rg-mandar, .rg-combo.rg-pop { animation: rg-pop .3s ease-out; }
.rg-sale { opacity: 0; translate: -30px 0; transition: opacity .3s, translate .3s; }
@keyframes rg-entra { from { opacity: 0; translate: -60px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes rg-pop { 0% { scale: 1; } 40% { scale: 1.4; } 100% { scale: 1; } }

/* ── regalo grande al centro (99 monedas o más) ───────────────────────── */
.rg-grande { position: absolute; left: 50%; top: 42%; translate: -50% -50%; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.rg-g-emo { font-size: min(34vw, 150px); line-height: 1; filter: drop-shadow(0 0 30px rgba(254,44,85,.55)); animation: rg-grande 3.2s cubic-bezier(.2,.9,.3,1.2) forwards; }
.rg-g-txt { color: #fff; font: 600 15px/1.3 var(--rg-f); padding: 6px 14px; border-radius: 999px; background: rgba(0,0,0,.55); animation: rg-texto 3.2s ease forwards; }
.rg-g-txt b { color: var(--rg-oro); }
@keyframes rg-grande {
  0% { scale: .2; rotate: -25deg; opacity: 0; } 18% { scale: 1.15; rotate: 8deg; opacity: 1; } 30% { scale: 1; rotate: 0deg; }
  80% { scale: 1; opacity: 1; translate: 0 0; } 100% { scale: .6; opacity: 0; translate: 0 -60px; }
}
@keyframes rg-texto { 0%, 15% { opacity: 0; } 25%, 80% { opacity: 1; } 100% { opacity: 0; } }

/* ── top de fans (arriba) ─────────────────────────────────────────────── */
.rg-top { position: fixed; left: 10px; top: 58px; z-index: 26; display: flex; gap: 6px; flex-wrap: wrap; max-width: calc(100vw - 120px);
  pointer-events: none; font: 700 11px/1 var(--rg-f); color: #fff; }
.rg-top-total, .rg-top-fan { padding: 5px 9px; border-radius: 999px; background: rgba(0,0,0,.45); white-space: nowrap; }
.rg-top-total { background: var(--rg-rojo); }
.rg-top-fan { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }

/* ── hoja de abajo ────────────────────────────────────────────────────── */
.rg-fondo { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.35); opacity: 0; transition: opacity .2s; }
.rg-fondo.on { opacity: 1; }
.rg-hoja {
  position: fixed; left: 50%; bottom: 0; z-index: 41; width: min(100%, 480px); max-height: 78vh; overflow: auto;
  translate: -50% 100%; transition: translate .22s cubic-bezier(.2,.8,.3,1);
  background: var(--rg-hoja); color: var(--rg-txt); border-radius: 14px 14px 0 0;
  padding: 6px 12px calc(14px + env(safe-area-inset-bottom, 0px));
  font: 14px/1.35 var(--rg-f); -webkit-font-smoothing: antialiased;
}
.rg-hoja.on { translate: -50% 0; }
.rg-hoja button { font-family: inherit; color: inherit; }
.rg-asa { display: block; width: 36px; height: 4px; margin: 2px auto 8px; border-radius: 2px; background: rgba(255,255,255,.22); }

.rg-cab { display: flex; align-items: center; gap: 6px; margin: 0 2px 10px; }
.rg-titulo { flex: 1; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.rg-atras, .rg-cerrar { flex: none; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; font-size: 24px; line-height: 1; color: var(--rg-txt-2) !important; }
.rg-atras { font-size: 30px; margin-left: -6px; }
.rg-cerrar:hover, .rg-atras:hover { color: #fff !important; }

/* saldo: moneda + número + › en gris; "Recargar" en rojo */
.rg-saldo { display: flex; align-items: center; gap: 4px; height: 30px; padding: 0 10px; border: 0; border-radius: 999px; background: var(--rg-gris-2); cursor: pointer; font-size: 14px; }
.rg-saldo .rg-n { font-weight: 700; }
.rg-chev { font-style: normal; color: var(--rg-txt-2); font-size: 16px; margin-left: 1px; }
.rg-recargar { height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--rg-rojo); cursor: pointer; font-weight: 700; font-size: 13px; }
.rg-recargar:active { background: var(--rg-rojo-2); }

/* regalos: sin cajas, solo el ícono; la celda elegida se ilumina y trae "Enviar" */
.rg-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.rg-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 2px 8px;
  border-radius: 10px; border: 1px solid transparent; cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; }
.rg-item:focus-visible { border-color: rgba(255,255,255,.4); }
.rg-item.sel { background: var(--rg-gris); border-color: rgba(255,255,255,.14); padding-bottom: 0; overflow: hidden; }
.rg-i-emo { font-size: 38px; line-height: 1.05; transition: scale .15s; }
.rg-item.sel .rg-i-emo { scale: 1.12; }
.rg-i-nom { font-size: 12px; color: var(--rg-txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rg-i-mon { display: flex; align-items: center; font-size: 11px; color: var(--rg-txt-2); }
.rg-mandar { width: 100%; margin-top: 5px; padding: 8px 0; border: 0; border-radius: 0; background: var(--rg-rojo); cursor: pointer; font-weight: 700; font-size: 13px; }
.rg-mandar:active { background: var(--rg-rojo-2); }
.rg-mandar:disabled { opacity: .6; }
.rg-combo { position: absolute; top: 4px; right: 6px; font: italic 900 17px/1 var(--rg-f); color: #fff; -webkit-text-stroke: 1px var(--rg-rojo); text-shadow: 0 2px 0 var(--rg-rojo); }
@media (max-width: 340px) { .rg-grid { grid-template-columns: repeat(3, 1fr); } }

/* botón principal: rojo TikTok */
.rg-rojo { display: block; width: 100%; height: 46px; margin-top: 12px; border: 0; border-radius: 6px; background: var(--rg-rojo); cursor: pointer; font-weight: 700; font-size: 15px; letter-spacing: .01em; }
.rg-rojo:active { background: var(--rg-rojo-2); }
.rg-rojo:disabled { opacity: .45; cursor: default; }
.rg-link { display: block; width: 100%; margin-top: 8px; padding: 10px; border: 0; background: none; cursor: pointer; color: var(--rg-txt-2) !important; font-size: 13px; }
.rg-link-in { border: 0; background: none; padding: 0; cursor: pointer; color: var(--rg-rojo) !important; font-weight: 700; font-size: 13px; }

/* datos / código */
.rg-intro { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 8px 14px; text-align: center; }
.rg-intro .rg-moneda { width: 40px; height: 40px; margin: 0 0 6px; }
.rg-intro b { font-size: 17px; }
.rg-intro span { color: var(--rg-txt-2); font-size: 13px; }
.rg-form { display: flex; flex-direction: column; gap: 8px; }
.rg-form input { height: 46px; padding: 0 14px; border: 0; border-radius: 6px; background: var(--rg-gris); color: #fff; font: 16px var(--rg-f); }
.rg-form input::placeholder { color: rgba(255,255,255,.4); }
.rg-form input:focus { outline: 1.5px solid var(--rg-rojo); outline-offset: 0; }
.rg-form .rg-rojo { margin-top: 4px; }

/* recarga: cuadros de paquetes, el elegido con borde rojo */
.rg-tengo { display: flex; align-items: center; gap: 4px; margin: 0 2px 12px; font-size: 13px; color: var(--rg-txt-2); }
.rg-tengo span { margin-right: 4px; }
.rg-tengo b { color: #fff; font-size: 15px; }
.rg-paquetes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rg-paq { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 4px 12px; border: 1.5px solid transparent; border-radius: 8px; background: var(--rg-gris); cursor: pointer; }
.rg-paq b { display: flex; align-items: center; font-size: 17px; font-weight: 800; }
.rg-paq span { color: var(--rg-txt-2); font-size: 13px; }
.rg-paq.sel { border-color: var(--rg-rojo); background: rgba(254,44,85,.1); }
.rg-paq.sel span { color: #fff; }
@media (max-width: 340px) { .rg-paquetes { grid-template-columns: repeat(2, 1fr); } }
.rg-tarjeta { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding: 0 2px; font-size: 13px; color: var(--rg-txt-2); }
.rg-tarjeta b { color: #fff; }
.rg-resumen { display: flex; align-items: center; gap: 4px; padding: 12px 14px; border-radius: 8px; background: var(--rg-gris); margin-bottom: 12px; }
.rg-resumen b { flex: 1; }
.rg-resumen span { font-weight: 800; }
.rg-stripe { min-height: 120px; }

.rg-nota { margin: 0 2px 12px; color: var(--rg-txt-2); font-size: 13px; }
.rg-legal { margin: 10px 2px 0; color: rgba(255,255,255,.38); font-size: 11px; text-align: center; }
.rg-msg { margin: 10px 2px 0; color: #ff6b81; font-size: 13px; }
.rg-ok { margin: 0 0 10px; padding: 9px 12px; border-radius: 8px; background: rgba(37,244,238,.1); color: #25F4EE; font-weight: 600; font-size: 13px; }

/* Moneda dibujada (el emoji de moneda no existe en todos los sistemas) */
.rg-moneda { display: inline-block; flex: none; width: 1em; height: 1em; margin-right: .28em; border-radius: 50%; vertical-align: -.14em;
  background: radial-gradient(circle at 35% 30%, #fff6c2 0 16%, #fcd34d 17% 55%, #f59e0b 56% 100%); box-shadow: inset 0 0 0 1.5px #d97706, 0 1px 2px rgba(0,0,0,.35); }

/* hidden tiene que ganarle a los display:flex de arriba */
[class^="rg-"][hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .rg-b-ico, .rg-aviso, .rg-g-emo, .rg-pop .rg-x, .rg-pop.rg-mandar, .rg-combo.rg-pop { animation: none; }
}
