/* —— Login gate: PRO glow (CSS-only, sharp — no blur plexus) —— */

.gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: transparent;
  overflow: hidden;
}

.gate.hidden {
  display: none;
}

/* —— Animated background scene —— */
.gate-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.gate-bg__base {
  position: absolute;
  inset: 0;
  background: var(--bg);
}

.gate-bg__top-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 55% at 50% -8%, rgba(94, 255, 178, 0.22), transparent 58%),
    radial-gradient(ellipse 45% 35% at 88% 18%, rgba(94, 255, 178, 0.1), transparent 55%),
    radial-gradient(ellipse 40% 30% at 8% 75%, rgba(255, 92, 122, 0.07), transparent 50%);
  animation: gate-top-glow 8s ease-in-out infinite;
}

@keyframes gate-top-glow {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

.gate-bg__mesh {
  position: absolute;
  inset: 0;
}

.gate-bg__blob {
  position: absolute;
  border-radius: 50%;
  will-change: transform, opacity;
}

.gate-bg__blob--mint {
  width: 55vmax;
  height: 55vmax;
  top: -18%;
  left: 50%;
  margin-left: -27.5vmax;
  background: radial-gradient(circle, rgba(94, 255, 178, 0.14) 0%, transparent 68%);
  animation: gate-blob-mint 14s ease-in-out infinite;
}

.gate-bg__blob--mint2 {
  width: 40vmax;
  height: 40vmax;
  bottom: -12%;
  right: -8%;
  background: radial-gradient(circle, rgba(94, 255, 178, 0.1) 0%, transparent 70%);
  animation: gate-blob-mint2 18s ease-in-out infinite;
}

.gate-bg__blob--dead {
  width: 32vmax;
  height: 32vmax;
  bottom: 20%;
  left: -6%;
  background: radial-gradient(circle, rgba(255, 92, 122, 0.09) 0%, transparent 72%);
  animation: gate-blob-dead 16s ease-in-out infinite;
}

@keyframes gate-blob-mint {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.9; }
  50% { transform: translate(3%, 4%) scale(1.06); opacity: 1; }
}

@keyframes gate-blob-mint2 {
  0%, 100% { transform: translate(0, 0); opacity: 0.75; }
  50% { transform: translate(-4%, -3%); opacity: 1; }
}

@keyframes gate-blob-dead {
  0%, 100% { transform: translate(0, 0); opacity: 0.6; }
  50% { transform: translate(5%, -2%); opacity: 0.9; }
}

.gate-bg__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(94, 255, 178, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 255, 178, 0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 85% 75% at 50% 45%, #000 25%, transparent 78%);
  opacity: 0.85;
  animation: gate-grid-shift 24s linear infinite;
}

@keyframes gate-grid-shift {
  to { background-position: 56px 56px, 56px 56px; }
}

/* Respawn “ping” rings */
.gate-bg__ring {
  position: absolute;
  left: 50%;
  top: 48%;
  border-radius: 50%;
  border: 1px solid rgba(94, 255, 178, 0.35);
  transform: translate(-50%, -50%) scale(0.35);
  opacity: 0;
  animation: gate-ring-ping 5s ease-out infinite;
}

.gate-bg__ring--1 {
  width: min(100vmin, 920px);
  height: min(100vmin, 920px);
}

.gate-bg__ring--2 {
  width: min(100vmin, 920px);
  height: min(100vmin, 920px);
  animation-delay: 1.65s;
}

.gate-bg__ring--3 {
  width: min(100vmin, 920px);
  height: min(100vmin, 920px);
  animation-delay: 3.3s;
}

@keyframes gate-ring-ping {
  0% {
    transform: translate(-50%, -50%) scale(0.32);
    opacity: 0.55;
  }
  70% {
    opacity: 0.12;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
}

/* Crisp scan line (no heavy blur) */
.gate-bg__beam {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(94, 255, 178, 0.15) 20%,
    rgba(94, 255, 178, 0.65) 50%,
    rgba(94, 255, 178, 0.15) 80%,
    transparent 100%
  );
  box-shadow: 0 0 12px rgba(94, 255, 178, 0.35);
  animation: gate-beam 6s ease-in-out infinite;
}

@keyframes gate-beam {
  0%, 100% {
    top: 15%;
    opacity: 0;
  }
  8% {
    opacity: 0.9;
  }
  50% {
    top: 85%;
    opacity: 0.5;
  }
  92% {
    opacity: 0;
  }
}

/* Ghost map cards */
.gate-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.gate-deco__card {
  position: absolute;
  width: min(300px, 44vw);
  padding: 14px 16px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(94, 255, 178, 0.12);
  background: linear-gradient(165deg, rgba(16, 20, 26, 0.85), rgba(10, 12, 16, 0.9));
  opacity: 0.16;
  box-shadow: 0 0 24px rgba(94, 255, 178, 0.04);
}

.gate-deco__card--1 {
  top: 12%;
  left: 5%;
  animation: gate-deco-float 9s ease-in-out infinite;
}

.gate-deco__card--2 {
  bottom: 14%;
  right: 4%;
  animation: gate-deco-float-b 11s ease-in-out infinite;
}

.gate-deco__card--3 {
  top: 50%;
  left: 10%;
  opacity: 0.11;
  animation: gate-deco-float-c 10s ease-in-out infinite 2s;
}

@keyframes gate-deco-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-8px) rotate(-1deg); }
}

@keyframes gate-deco-float-b {
  0%, 100% { transform: translateY(0) rotate(1.5deg); }
  50% { transform: translateY(8px) rotate(2deg); }
}

@keyframes gate-deco-float-c {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-6px) rotate(0deg); }
}

.gate-deco__title {
  display: block;
  height: 10px;
  width: 55%;
  margin-bottom: 14px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.14);
}

.gate-deco__channels {
  display: flex;
  gap: 6px;
}

.gate-deco__channels span {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 92, 122, 0.4);
}

.gate-deco__channels span.alive {
  background: var(--mint);
  box-shadow: 0 0 10px rgba(94, 255, 178, 0.55);
  animation: gate-ch-pulse 2.8s ease-in-out infinite;
}

.gate-deco__channels span.alive:nth-child(2) { animation-delay: 0.4s; }
.gate-deco__channels span.alive:nth-child(4) { animation-delay: 0.9s; }
.gate-deco__channels span.alive:nth-child(5) { animation-delay: 1.2s; }

@keyframes gate-ch-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 10px rgba(94, 255, 178, 0.5); }
  50% { opacity: 0.65; box-shadow: 0 0 4px rgba(94, 255, 178, 0.25); }
}

/* Login card */
.gate-stage {
  position: relative;
  z-index: 2;
  width: min(400px, 100%);
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.gate.gate--ready .gate-stage {
  opacity: 1;
  transform: translateY(0);
}

.gate-auth {
  position: relative;
}

.gate-auth__rim {
  position: absolute;
  inset: -1px;
  border-radius: calc(var(--radius) + 1px);
  padding: 1px;
  background: linear-gradient(
    130deg,
    rgba(94, 255, 178, 0.5),
    rgba(94, 255, 178, 0.08) 35%,
    rgba(255, 92, 122, 0.15) 55%,
    rgba(94, 255, 178, 0.35) 80%,
    rgba(94, 255, 178, 0.5)
  );
  background-size: 200% 200%;
  animation: gate-rim-flow 5s linear infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

@keyframes gate-rim-flow {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.gate-auth__card {
  position: relative;
  padding: 36px 32px 32px;
  border-radius: var(--radius);
  text-align: center;
  background: linear-gradient(
    165deg,
    rgba(22, 26, 32, 0.96) 0%,
    rgba(12, 14, 18, 0.98) 100%
  );
  border: 1px solid rgba(94, 255, 178, 0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: gate-card-breathe 4s ease-in-out infinite;
}

@keyframes gate-card-breathe {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(94, 255, 178, 0.1) inset,
      0 0 36px rgba(94, 255, 178, 0.1),
      0 28px 56px rgba(0, 0, 0, 0.5);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(94, 255, 178, 0.18) inset,
      0 0 52px rgba(94, 255, 178, 0.18),
      0 28px 56px rgba(0, 0, 0, 0.5);
  }
}

.gate-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
}

.gate-brand .gate-brand__icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  box-shadow: 0 0 20px var(--mint-glow);
}

.gate-brand__name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.gate-brand__tag {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.gate-auth__card h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.gate-sub {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 20px;
}

.gate-perks {
  list-style: none;
  text-align: left;
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(94, 255, 178, 0.04);
  border: 1px solid rgba(94, 255, 178, 0.12);
}

.gate-perks li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--muted);
}

.gate-perks i {
  width: 18px;
  text-align: center;
  color: var(--mint);
  font-size: 0.78rem;
}

.gate-divider {
  height: 1px;
  margin: 0 0 20px;
  background: linear-gradient(90deg, transparent, rgba(94, 255, 178, 0.25), transparent);
}

.btn-discord {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #5865f2 0%, #4752c4 100%);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 20px rgba(88, 101, 242, 0.35);
}

.btn-discord:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(88, 101, 242, 0.45);
}

.btn-discord:active {
  transform: translateY(0);
}

.btn-discord i {
  font-size: 1.25rem;
}

.gate-err {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--dead-bg);
  border: 1px solid rgba(255, 92, 122, 0.25);
  color: #ffb3c1;
  font-size: 0.84rem;
  line-height: 1.45;
  display: none;
  text-align: left;
}

.gate-loading {
  color: var(--muted);
  font-size: 0.92rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: 100px;
  justify-content: center;
}

.gate-loading__ring {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(94, 255, 178, 0.15);
  border-top-color: var(--mint);
  box-shadow: 0 0 12px rgba(94, 255, 178, 0.25);
  animation: gate-spin 0.85s linear infinite;
}

.gate-loading.hidden,
.gate-form.hidden {
  display: none;
}

@keyframes gate-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 720px) {
  .gate-deco__card--3 {
    display: none;
  }

  .gate-bg__ring {
    opacity: 0.7;
  }
}

@media (max-width: 480px) {
  .gate-deco {
    display: none;
  }

  .gate-auth__card {
    padding: 28px 22px 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gate-bg__blob,
  .gate-bg__top-glow,
  .gate-bg__grid,
  .gate-bg__ring,
  .gate-bg__beam,
  .gate-deco__card,
  .gate-deco__channels span.alive,
  .gate-auth__rim,
  .gate-auth__card,
  .gate-loading__ring {
    animation: none !important;
  }

  .gate-stage {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .gate-auth__card {
    box-shadow: 0 0 36px rgba(94, 255, 178, 0.12), 0 28px 56px rgba(0, 0, 0, 0.5);
  }
}
