/* =========================
   TU ESTILO (se mantiene)
========================= */
.egamroom-wrap { max-width: 520px; margin: 0 auto; }
.egamroom-row { display: flex; gap: 10px; }
.egamroom-field { width: 100%; margin-bottom: 12px; }

.egamroom-form input {
  display: block !important;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 20px;
  background: rgba(0,0,0,.15);
  color: #fff;
  outline: none;
  box-sizing: border-box;
  border: 1px solid rgba(255,255,255,.12);
}

.egamroom-form input::placeholder { color: rgba(255,255,255,.7); }

.egamroom-btn {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
}

.egamroom-btn.is-loading { opacity: .7; pointer-events: none; }

.egamroom-error {
  font-size: 12px;
  margin-top: 6px;
  color: #d92d20;
  min-height: 16px;
}

.egamroom-alert { margin-top: 10px; padding: 10px 12px; border-radius: 12px; }
.egamroom-success { background: rgba(34,197,94,.15); border: 1px solid rgba(34,197,94,.4); color: #fff; }
.egamroom-error   { background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.4); color: #fff; }
.egamroom-info    { background: rgba(59,130,246,.15); border: 1px solid rgba(59,130,246,.4); color: #fff; }

/* =========================
   NUEVO: TOAST POPUP (abajo)
   (no afecta tus inputs)
========================= */

/* Asegura responsive en móvil */
@media (max-width: 520px) {
  .egamroom-row { flex-direction: column; }
}

/* El msgbox se vuelve toast cuando JS le agrega la clase egamroom-toast */
#egamroom-form-message.egamroom-toast {
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(20px);
  width: min(640px, calc(100% - 24px));
  z-index: 999999;

  /* override del estilo anterior (.egamroom-alert tiene margin-top) */
  margin-top: 0;

  display: flex;
  align-items: flex-start;
  gap: 10px;

  padding: 14px 14px;
  border-radius: 14px;

  box-shadow: 0 18px 45px rgba(0,0,0,.40);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  backdrop-filter: blur(10px);
}

/* visible */
#egamroom-form-message.egamroom-toast.is-open {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* texto */
#egamroom-form-message .egamroom-toast-text {
  flex: 1;
  white-space: pre-wrap;
}

/* botón cerrar */
#egamroom-form-message .egamroom-toast-close {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  padding: 2px 6px;
  cursor: pointer;
  opacity: .85;
}
#egamroom-form-message .egamroom-toast-close:hover { opacity: 1; }

/* barra inferior */
#egamroom-form-message .egamroom-toast-bar {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 8px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  overflow: hidden;
}
#egamroom-form-message .egamroom-toast-bar > span {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(1);
}

/* Color de la barra por tipo (coincide con tus colores) */
#egamroom-form-message.egamroom-success .egamroom-toast-bar > span { background: rgba(34,197,94,.9); }
#egamroom-form-message.egamroom-error   .egamroom-toast-bar > span { background: rgba(239,68,68,.9); }
#egamroom-form-message.egamroom-info    .egamroom-toast-bar > span { background: rgba(59,130,246,.9); }
/* Toast global (fuera del popup) */
#egamroom-toast-wrap{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 18px;
  z-index: 999999;
  padding: 0 18px;
  pointer-events: none; /* para que no bloquee clicks */
}

#egamroom-toast{
  width: 100%;
  max-width: 1200px;     /* ajusta si quieres más/menos */
  margin: 0 auto;
  border-radius: 14px;
  padding: 14px 42px 14px 14px;
  backdrop-filter: blur(8px);
  pointer-events: auto;  /* el toast sí puede recibir clicks */
  position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}

/* Botón X */
#egamroom-toast .egamroom-toast-close{
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.85);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
#egamroom-toast .egamroom-toast-close:hover{
  color: #fff;
}

/* Reutiliza tus clases de alertas */
#egamroom-toast.egamroom-success { background: rgba(34,197,94,.15); border: 1px solid rgba(34,197,94,.4); color: #fff; }
#egamroom-toast.egamroom-error   { background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.4); color: #fff; }
#egamroom-toast.egamroom-info    { background: rgba(59,130,246,.15); border: 1px solid rgba(59,130,246,.4); color: #fff; }
