/* Discord invite popup — bas droite */
.di-pop {
  --di-bg: #0d0d14;
  --di-border: rgba(88, 101, 242, 0.28);
  --di-discord: #5865f2;
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 120000;
  width: min(380px, calc(100vw - 28px));
  padding: 1.15rem 1.15rem 1.05rem;
  border-radius: 22px;
  border: 1px solid var(--di-border);
  background: linear-gradient(160deg, rgba(22, 24, 40, 0.98), rgba(10, 10, 16, 0.98));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  color: #fff;
  font-family: 'Outfit', system-ui, sans-serif;
  opacity: 0;
  transform: translateY(18px) scale(0.97);
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.35s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.35s;
}
.di-pop.is-on {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
  visibility: visible;
}
.di-pop[hidden] {
  display: none !important;
}

.di-pop-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.75);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.di-pop-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.di-pop-close svg {
  width: 14px;
  height: 14px;
}

.di-pop-row {
  display: flex;
  align-items: flex-start;
  gap: 0.95rem;
  padding-right: 1.5rem;
}
.di-pop-icon {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--di-discord);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(88, 101, 242, 0.45);
}
.di-pop-icon svg {
  width: 28px;
  height: 28px;
  fill: #fff;
}
.di-pop-copy {
  min-width: 0;
  flex: 1;
}
.di-pop-badge {
  display: inline-flex;
  align-items: center;
  margin: 0 0 0.45rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: rgba(88, 101, 242, 0.16);
  color: #aeb5ff;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.di-pop-title {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #fff;
}
.di-pop-text {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.5;
  color: rgba(230, 232, 255, 0.62);
}

.di-pop-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 1rem;
  padding-left: calc(52px + 0.95rem);
}
.di-pop-join {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.15rem;
  border-radius: 12px;
  border: 0;
  background: var(--di-discord);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(88, 101, 242, 0.35);
  transition: background 0.2s, transform 0.2s;
}
.di-pop-join:hover {
  background: #4752c4;
  transform: translateY(-1px);
}
.di-pop-later {
  border: 0;
  background: none;
  color: rgba(230, 232, 255, 0.7);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.4rem 0.2rem;
  transition: color 0.2s;
}
.di-pop-later:hover {
  color: #fff;
}

@media (max-width: 520px) {
  .di-pop {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: max(12px, env(safe-area-inset-bottom));
  }
  .di-pop-actions {
    padding-left: 0;
    flex-wrap: wrap;
  }
}
@media (max-width: 900px) {
  .di-pop {
    bottom: calc(var(--mobile-nav-h, 64px) + 14px);
  }
}
