/* Telegram-only gate — shown when opened outside Telegram */
html.gate-active,
html.gate-active body {
  overflow: hidden;
  height: 100%;
}

html.gate-active #app {
  display: none !important;
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #06080f;
  font-family: var(--font, "DM Sans", system-ui, sans-serif);
  color: #eef0f6;
  overflow: hidden;
}

html.gate-active .gate {
  display: flex;
}

.gate__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.gate__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: gateOrb 14s ease-in-out infinite;
}

.gate__orb--1 {
  width: 340px;
  height: 340px;
  background: #6c5ce7;
  top: -80px;
  left: -60px;
  animation-delay: 0s;
}

.gate__orb--2 {
  width: 280px;
  height: 280px;
  background: #0088cc;
  bottom: -60px;
  right: -40px;
  animation-delay: -4s;
}

.gate__orb--3 {
  width: 200px;
  height: 200px;
  background: #00d68f;
  top: 45%;
  left: 55%;
  animation-delay: -8s;
  opacity: 0.25;
}

@keyframes gateOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.08); }
  66% { transform: translate(-20px, 25px) scale(0.92); }
}

.gate__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, black, transparent);
  animation: gateGridPulse 6s ease-in-out infinite;
}

@keyframes gateGridPulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.6; }
}

.gate__particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.gate__particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(162, 155, 254, 0.8);
  box-shadow: 0 0 12px rgba(108, 92, 231, 0.6);
  animation: gateParticle linear infinite;
}

.gate__particle:nth-child(1) { left: 12%; animation-duration: 9s; animation-delay: 0s; }
.gate__particle:nth-child(2) { left: 28%; animation-duration: 11s; animation-delay: -2s; width: 3px; height: 3px; }
.gate__particle:nth-child(3) { left: 52%; animation-duration: 8s; animation-delay: -4s; }
.gate__particle:nth-child(4) { left: 71%; animation-duration: 12s; animation-delay: -1s; width: 5px; height: 5px; }
.gate__particle:nth-child(5) { left: 88%; animation-duration: 10s; animation-delay: -6s; }
.gate__particle:nth-child(6) { left: 40%; animation-duration: 13s; animation-delay: -3s; width: 2px; height: 2px; }

@keyframes gateParticle {
  0% { transform: translateY(110vh) scale(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

.gate__card {
  position: relative;
  width: min(380px, 100%);
  padding: 36px 28px 32px;
  border-radius: 24px;
  background: rgba(16, 19, 28, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  text-align: center;
  animation: gateCardIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes gateCardIn {
  from {
    opacity: 0;
    transform: translateY(32px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.gate__card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 25px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.6), rgba(0, 136, 204, 0.4), rgba(108, 92, 231, 0.2));
  -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;
  animation: gateBorderSpin 8s linear infinite;
}

@keyframes gateBorderSpin {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

.gate__icon-wrap {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto 22px;
}

.gate__ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: #6c5ce7;
  border-right-color: #0088cc;
  animation: gateRingSpin 2.4s linear infinite;
}

.gate__ring--2 {
  inset: -16px;
  border-top-color: rgba(108, 92, 231, 0.35);
  border-right-color: rgba(0, 136, 204, 0.25);
  animation-duration: 4s;
  animation-direction: reverse;
}

@keyframes gateRingSpin {
  to { transform: rotate(360deg); }
}

.gate__icon {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(108, 92, 231, 0.25), rgba(0, 136, 204, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.12);
  animation: gateIconFloat 3s ease-in-out infinite;
}

@keyframes gateIconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.gate__icon svg {
  width: 44px;
  height: 44px;
}

.gate__lock {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ff6b6b;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 16px rgba(255, 107, 107, 0.45);
  animation: gateLockPulse 2s ease-in-out infinite;
}

@keyframes gateLockPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 16px rgba(255, 107, 107, 0.45); }
  50% { transform: scale(1.08); box-shadow: 0 4px 24px rgba(255, 107, 107, 0.65); }
}

.gate__lock svg {
  width: 14px;
  height: 14px;
  color: #fff;
}

.gate__brand {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8b92a8;
  margin-bottom: 8px;
  animation: gateFadeUp 0.8s 0.15s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.gate__title {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #fff 30%, #a29bfe 70%, #48cae4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gateFadeUp 0.8s 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.gate__text {
  font-size: 0.92rem;
  line-height: 1.55;
  color: #8b92a8;
  margin-bottom: 28px;
  animation: gateFadeUp 0.8s 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes gateFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.gate__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 22px;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  background: linear-gradient(135deg, #0088cc, #6c5ce7);
  box-shadow: 0 8px 32px rgba(108, 92, 231, 0.35);
  position: relative;
  overflow: hidden;
  animation: gateFadeUp 0.8s 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gate__btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  animation: gateShimmer 3s ease-in-out infinite;
}

@keyframes gateShimmer {
  0% { left: -100%; }
  50%, 100% { left: 150%; }
}

.gate__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(108, 92, 231, 0.5);
}

.gate__btn:active {
  transform: translateY(0);
}

.gate__btn svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.gate__hint {
  margin-top: 18px;
  font-size: 0.78rem;
  color: #555e77;
  animation: gateFadeUp 0.8s 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.gate__scanline {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255, 255, 255, 0.012) 2px,
    rgba(255, 255, 255, 0.012) 4px
  );
  opacity: 0.5;
}
