/* =========================================================
   AxisVPN Mini App — Welcome / Onboarding Screen
   Signature Hero Purple Palette with Cyber Grid & 3D Globe
   ========================================================= */

.welcome-screen-overlay {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: linear-gradient(145deg, #1E1035 0%, #351368 45%, #5B21B6 100%);
  background-image: 
    radial-gradient(circle at 85% 15%, rgba(167, 139, 250, 0.28) 0%, transparent 55%),
    radial-gradient(circle at 15% 85%, rgba(139, 92, 246, 0.24) 0%, transparent 55%),
    linear-gradient(to right, rgba(167, 139, 250, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(167, 139, 250, 0.04) 1px, transparent 1px),
    linear-gradient(145deg, #1E1035 0%, #351368 45%, #5B21B6 100%);
  background-size: 100% 100%, 100% 100%, 28px 28px, 28px 28px, 100% 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: calc(44px + var(--tg-safe-top, 0px)) 20px calc(24px + var(--tg-safe-bottom, 0px));
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  animation: welcomeFadeIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.welcome-screen-overlay::before {
  content: "";
  position: absolute;
  top: -30%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.28) 0%, rgba(109, 40, 217, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.welcome-screen-overlay::after {
  content: "";
  position: absolute;
  bottom: -20%;
  left: -20%;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.25) 0%, rgba(91, 33, 182, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

/* Subtle Electric Energy Sweep Layer across Background Grid */
.welcome-grid-electric-beam {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(180deg, transparent 0%, rgba(167, 139, 250, 0.08) 50%, rgba(56, 189, 248, 0.06) 52%, transparent 100%);
  background-size: 100% 260px;
  background-repeat: no-repeat;
  animation: electricGridSweep 7.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  mix-blend-mode: screen;
  will-change: background-position, opacity;
}

@keyframes electricGridSweep {
  0% {
    background-position: 0 -260px;
    opacity: 0;
  }
  15% {
    opacity: 0.8;
  }
  50% {
    background-position: 0 50vh;
    opacity: 0.95;
  }
  85% {
    opacity: 0.8;
  }
  100% {
    background-position: 0 calc(100vh + 260px);
    opacity: 0;
  }
}

@keyframes welcomeFadeIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.welcome-screen-exit {
  animation: welcomeFadeOut 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes welcomeFadeOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.96) translateY(-12px);
  }
}

/* ---------------------------------------------------------
   1. CENTER HERO VISUAL (3D Cyber Globe & Orbiting Flag Bubbles)
   --------------------------------------------------------- */
.welcome-hero-visual {
  position: relative;
  width: 100%;
  max-width: 360px;
  height: 330px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 36px 0 20px;
  flex-shrink: 0;
  perspective: 1000px;
  z-index: 2;
}

.welcome-globe-container {
  position: relative;
  width: 290px;
  height: 290px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.welcome-network-canvas {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 1;
}

/* ---------------------------------------------------------
   CONTINUOUS SLOW ORBITAL SYSTEM FOR COUNTRY FLAG BUBBLES
   --------------------------------------------------------- */
.welcome-orbit-track {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 3;
  animation: slowOrbitRevolution 56s linear infinite;
  will-change: transform;
}

@keyframes slowOrbitRevolution {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.welcome-orbit-item {
  position: absolute;
  width: 0;
  height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(var(--orbit-angle, 0deg)) translateY(-145px);
  will-change: transform;
}

.welcome-orbit-item .welcome-flag-bubble {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 7px;
  border-radius: 9999px;
  background: rgba(30, 16, 53, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(167, 139, 250, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38), 0 0 14px rgba(139, 92, 246, 0.28);
  font-family: var(--font-family);
  user-select: none;
  pointer-events: none;
  direction: ltr !important;
  white-space: nowrap;
  animation: keepBubbleUpright 56s linear infinite;
  will-change: transform;
}

@keyframes keepBubbleUpright {
  0% {
    transform: rotate(calc(-1 * var(--orbit-angle, 0deg))) rotate(0deg);
  }
  100% {
    transform: rotate(calc(-1 * var(--orbit-angle, 0deg))) rotate(-360deg);
  }
}

.flag-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.flag-title {
  font-size: 0.72rem;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: 0.2px;
}

.flag-ping-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.62rem;
  font-weight: 700;
  color: #34D399;
  background: rgba(52, 211, 153, 0.18);
  padding: 1.5px 5px;
  border-radius: 9999px;
  letter-spacing: 0.2px;
}

.ping-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #34D399;
  box-shadow: 0 0 6px #34D399;
  animation: pingPulse 1.8s ease-in-out infinite alternate;
}

@keyframes pingPulse {
  0% { opacity: 0.5; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1.15); }
}

/* ---------------------------------------------------------
   2. CONTENT & TYPOGRAPHY SECTION
   --------------------------------------------------------- */
.welcome-content-block {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 18px;
  flex-grow: 1;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.welcome-category-tracker {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #C084FC;
  margin-bottom: 8px;
  opacity: 0.95;
}

.welcome-headline {
  font-size: 1.32rem;
  font-weight: 900;
  line-height: 1.38;
  color: #FFFFFF;
  margin: 0 0 8px;
  letter-spacing: -0.2px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.welcome-subtext {
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.55;
  color: rgba(233, 213, 255, 0.88);
  margin: 0 0 14px;
  max-width: 320px;
}

/* Pagination indicator (Harmonized Brand Standard) */
.welcome-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 2px;
}

.welcome-page-pill {
  width: 24px;
  height: 4px;
  background: #C084FC;
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.5);
  border-radius: 9999px;
  transition: width 0.3s ease, background 0.3s ease;
}

.welcome-page-dot {
  width: 5px;
  height: 4px;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 9999px;
}

/* ---------------------------------------------------------
   3. BOTTOM ACTION & BUTTON
   --------------------------------------------------------- */
.welcome-bottom-action {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.welcome-continue-btn {
  width: 100%;
  height: 52px;
  min-height: 52px;
  background: #FFFFFF;
  color: #5B21B6;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 9999px;
  font-size: 0.98rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.36), 0 2px 8px rgba(0, 0, 0, 0.18);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, filter 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.welcome-continue-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.45);
  filter: brightness(0.98);
}

.welcome-continue-btn:active {
  transform: scale(0.97);
  filter: brightness(0.94);
}

.welcome-terms-note {
  font-size: 0.70rem;
  font-weight: 500;
  color: rgba(233, 213, 255, 0.65);
  text-align: center;
  line-height: 1.4;
  pointer-events: auto;
}

.welcome-terms-link {
  color: #C084FC;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  display: inline-block;
  padding: 2px 4px;
}

#tos-detail-modal {
  z-index: 10000005 !important;
}

#tos-detail-modal .modal-sheet {
  z-index: 10000006 !important;
}
