html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

.components-reconnect-first-attempt-visible,
.components-reconnect-repeated-attempt-visible,
.components-reconnect-failed-visible,
.components-pause-visible,
.components-resume-failed-visible,
.components-rejoining-animation {
  display: none;
}

#components-reconnect-modal.components-reconnect-show .components-reconnect-first-attempt-visible,
#components-reconnect-modal.components-reconnect-show .components-rejoining-animation,
#components-reconnect-modal.components-reconnect-paused .components-pause-visible,
#components-reconnect-modal.components-reconnect-resume-failed .components-resume-failed-visible,
#components-reconnect-modal.components-reconnect-retrying,
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-repeated-attempt-visible,
#components-reconnect-modal.components-reconnect-retrying .components-rejoining-animation,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-failed .components-reconnect-failed-visible {
  display: block;
}

#components-reconnect-modal {
  width: 24rem;
  margin: 20vh auto;
  padding: 2rem 2.25rem;
  border: 1px solid rgba(76, 120, 180, 0.45);
  border-radius: 1rem;
  color: var(--text, #d8e3f1);
  background:
    linear-gradient(180deg, rgba(14, 24, 38, 0.98), rgba(9, 16, 28, 0.98)),
    radial-gradient(circle at top, rgba(79, 143, 247, 0.18), transparent 58%);
  box-shadow:
    0 28px 60px rgba(2, 8, 20, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  opacity: 0;
  transition: display 0.5s allow-discrete, overlay 0.5s allow-discrete;
  animation: components-reconnect-modal-fadeOutOpacity 0.5s both;
}

#components-reconnect-modal[open] {
  animation: components-reconnect-modal-slideUp 1.5s cubic-bezier(.05, .89, .25, 1.02) 0.3s, components-reconnect-modal-fadeInOpacity 0.5s ease-in-out 0.3s;
  animation-fill-mode: both;
}

#components-reconnect-modal::backdrop {
  background:
    radial-gradient(circle at center, rgba(18, 34, 54, 0.28), rgba(3, 7, 13, 0.72));
  backdrop-filter: blur(4px);
  animation: components-reconnect-modal-fadeInOpacity 0.5s ease-in-out;
  opacity: 1;
}

@keyframes components-reconnect-modal-slideUp {
  0% {
    transform: translateY(30px) scale(0.95);
  }

  100% {
    transform: translateY(0);
  }
}

@keyframes components-reconnect-modal-fadeInOpacity {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@keyframes components-reconnect-modal-fadeOutOpacity {
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

.components-reconnect-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
}

#components-reconnect-modal p {
  margin: 0;
  text-align: center;
  color: var(--text, #d8e3f1);
  font-size: 1rem;
  line-height: 1.45;
}

#components-reconnect-modal .components-reconnect-first-attempt-visible,
#components-reconnect-modal .components-reconnect-repeated-attempt-visible,
#components-reconnect-modal .components-pause-visible {
  color: #d6e5f7;
  font-weight: 600;
}

#components-reconnect-modal .components-reconnect-failed-visible,
#components-reconnect-modal .components-resume-failed-visible {
  color: #f5c0c8;
  font-weight: 600;
}

#components-reconnect-modal button {
  min-height: 2.25rem;
  border: 1px solid rgba(76, 120, 180, 0.45);
  background: linear-gradient(145deg, #5e46f7 0%, #4f8ff7 100%);
  color: #f7fbff;
  padding: 0 1.25rem;
  border-radius: 0.75rem;
  font: inherit;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(78, 134, 247, 0.24);
}

#components-reconnect-modal button:hover {
  background: linear-gradient(145deg, #6954ff 0%, #61a3ff 100%);
}

#components-reconnect-modal button:active {
  background: linear-gradient(145deg, #513ce4 0%, #4586e8 100%);
}

.components-rejoining-animation {
  position: relative;
  width: 80px;
  height: 80px;
}

.components-rejoining-animation div {
  position: absolute;
  border: 3px solid rgba(79, 143, 247, 0.92);
  opacity: 1;
  border-radius: 50%;
  animation: components-rejoining-animation 1.5s cubic-bezier(0, 0.2, 0.8, 1) infinite;
  box-shadow:
    0 0 0 1px rgba(126, 188, 255, 0.12),
    0 0 20px rgba(79, 143, 247, 0.14);
}

.components-rejoining-animation div:nth-child(2) {
  animation-delay: -0.5s;
}

@keyframes components-rejoining-animation {
  0% {
    top: 40px;
    left: 40px;
    width: 0;
    height: 0;
    opacity: 0;
  }

  4.9% {
    top: 40px;
    left: 40px;
    width: 0;
    height: 0;
    opacity: 0;
  }

  5% {
    top: 40px;
    left: 40px;
    width: 0;
    height: 0;
    opacity: 1;
  }

  100% {
    top: 0;
    left: 0;
    width: 80px;
    height: 80px;
    opacity: 0;
  }
}
