/* Web chat da Comuniki.me: botao flutuante + painel (ocupa o lugar do .float-whatsapp).
   Copiado de h2online.com.br src/components/library/WebChat.css; diferencas marcadas [H2 Club]. */
.h2-webchat {
  position: fixed;
  right: 2rem;
  bottom: 2rem;
  z-index: 998;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-end;
  pointer-events: none;
}
.h2-webchat > * { pointer-events: auto; }

/* Painel */
.h2-webchat__panel {
  display: flex;
  visibility: hidden;
  flex-direction: column;
  width: 380px;
  max-width: calc(100vw - 2rem);
  height: 560px;
  max-height: calc(100dvh - 9rem);
  overflow: hidden;
  background: #121018;
  border: 1px solid rgb(119 21 142 / 55%);
  border-radius: 20px;
  box-shadow:
    0 24px 60px rgb(0 0 0 / 60%),
    0 0 0 1px rgb(255 255 255 / 3%),
    0 0 40px rgb(119 21 142 / 25%);
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  transform-origin: bottom right;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0s linear 0.2s;
}

.h2-webchat__panel--open {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

/* Cabecalho */
.h2-webchat__header {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 14px 14px 18px;
  color: #fff;
  background: linear-gradient(120deg, #321160 0%, #77158e 100%);
  border-bottom: 1px solid rgb(255 255 255 / 8%);
}

.h2-webchat__logo {
  /* [H2 Club] logo do site e mais alto que o do H2 Poker */
  width: auto;
  height: 40px;
}

.h2-webchat__heading {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  padding-left: 12px;
  border-left: 1px solid rgb(255 255 255 / 25%);
}

.h2-webchat__title {
  font-family: "MonumentRegular", "Red Hat Display", Arial, sans-serif;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.h2-webchat__status {
  display: flex;
  gap: 6px;
  align-items: center;
  font-family: Roboto, Arial, sans-serif;
  font-size: 12px;
  color: rgb(255 255 255 / 75%);
}

.h2-webchat__dot {
  width: 8px;
  height: 8px;
  background: #27cfa5;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgb(39 207 165 / 25%);
}

.h2-webchat__dot--off {
  background: #8d8a99;
  box-shadow: 0 0 0 3px rgb(141 138 153 / 25%);
}

/* Fora do horario: chat bloqueado, so o aviso no lugar do iframe */
.h2-webchat__offline {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 32px 28px;
  color: #8d8a99;
  text-align: center;
  background:
    radial-gradient(120% 60% at 100% 0%, rgb(119 21 142 / 18%), transparent 60%),
    #121018;
}

.h2-webchat__offline-title {
  margin: 6px 0 0;
  font-family: "MonumentRegular", "Red Hat Display", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: #fff;
}

.h2-webchat__offline-text {
  max-width: 280px;
  margin: 0;
  font-family: Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #c9c6d3;
}

.h2-webchat__minimize {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: #fff;
  cursor: pointer;
  background: rgb(255 255 255 / 10%);
  border: 0;
  border-radius: 50%;
  transition: background 0.15s;
}
.h2-webchat__minimize:hover { background: rgb(255 255 255 / 20%); }

.h2-webchat__frame {
  flex: 1;
  width: 100%;
  background: #121018;
  border: 0;
}

/* Botao flutuante */
.h2-webchat__toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  padding: 0;
  color: #0f0d14;
  cursor: pointer;
  background: #27cfa5;
  border: 0;
  border-radius: 50%;
  box-shadow:
    0 8px 24px rgb(0 0 0 / 45%),
    0 0 0 4px rgb(39 207 165 / 18%);
  transition:
    transform 0.15s ease,
    background 0.2s ease,
    color 0.2s ease;
}
.h2-webchat__toggle:hover { transform: scale(1.07); }

.h2-webchat__toggle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.h2-webchat__toggle::after {
  position: absolute;
  inset: 0;
  content: "";
  border: 2px solid #27cfa5;
  border-radius: 50%;
  animation: h2-webchat-pulse 2.4s ease-out infinite;
}

.h2-webchat__toggle--open {
  color: #fff;
  background: #77158e;
  box-shadow: 0 8px 24px rgb(0 0 0 / 45%);
}
.h2-webchat__toggle--open::after { display: none; }

.h2-webchat__icon {
  position: absolute;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.h2-webchat__icon--close {
  opacity: 0;
  transform: rotate(-90deg);
}

.h2-webchat__toggle--open .h2-webchat__icon--chat {
  opacity: 0;
  transform: rotate(90deg);
}

.h2-webchat__toggle--open .h2-webchat__icon--close {
  opacity: 1;
  transform: none;
}

@keyframes h2-webchat-pulse {
  0% {
    opacity: 0.7;
    transform: scale(1);
  }

  70%, 100% {
    opacity: 0;
    transform: scale(1.45);
  }
}

@media (prefers-reduced-motion: reduce) {
  .h2-webchat__toggle::after { animation: none; }
  .h2-webchat__panel, .h2-webchat__icon { transition: none; }
}

@media (max-width: 600px) {
  .h2-webchat {
    right: 1rem;
    bottom: 1rem;
  }

  .h2-webchat__panel {
    height: calc(100dvh - 7.5rem);
    max-height: 620px;
  }

  .h2-webchat__toggle {
    width: 56px;
    height: 56px;
  }

  /* Aberto no mobile: tela cheia, acima do header, sem botao flutuante por cima */
  .h2-webchat--open {
    z-index: 10000;
  }

  .h2-webchat__panel--open {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .h2-webchat__panel--open .h2-webchat__header {
    padding-top: calc(14px + env(safe-area-inset-top));
  }

  .h2-webchat__panel--open .h2-webchat__frame {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .h2-webchat--open .h2-webchat__toggle {
    display: none;
  }
}

/* [H2 Club] Envolve o iframe e o aviso (no React eles eram filhos diretos do painel) */
.h2-webchat__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

/* [H2 Club] Isola do Bootstrap/CSS do site */
.h2-webchat, .h2-webchat * { box-sizing: border-box; }
.h2-webchat button { line-height: 1; text-transform: none; }
.h2-webchat p { margin-bottom: 0; }
.h2-webchat [hidden] { display: none !important; }