/* Walkthrough tooltip */
.walkthrough-tooltip {
  position: fixed;
  z-index: 1000;
  background: linear-gradient(135deg, #5865f2, #535ce1);
  color: #fff;
  border-radius: 14px;
  padding: 14px 18px;
  max-width: 320px;
  min-width: 200px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.25),
    inset 0 0 12px rgba(255, 255, 255, 0.06);
  animation: tooltipFadeIn 0.2s ease;
}

/* Sheen highlight across the top — inset so it doesn't touch edges */
.walkthrough-tooltip::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 8px;
  right: 8px;
  height: 30%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
  pointer-events: none;
  border-radius: 9px 9px 0 0;
  overflow: hidden;
}

@keyframes tooltipFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.tooltip-fade-delayed {
  animation: tooltipFadeIn 0.25s ease 0.05s both;
}

.tooltip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.tooltip-step {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
}

.tooltip-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.25;
}

.tooltip-desc {
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255,255,255,0.88);
}

.tooltip-btn-group {
  display: flex;
  gap: 6px;
  align-items: center;
}

.tooltip-next-btn,
.tooltip-back-btn {
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  position: relative;
  z-index: 2;
}

.tooltip-back-btn {
  background: rgba(255,255,255,0.08);
}

.tooltip-next-btn:hover,
.tooltip-back-btn:hover {
  background: rgba(255,255,255,0.3);
  border-color: rgba(255,255,255,0.25);
  box-shadow: 0 2px 12px rgba(88, 101, 242, 0.3);
}

/* Tooltip arrow — separate SVG element positioned by JS */
.walkthrough-tooltip::before {
  display: none;
}

.tooltip-arrow {
  position: fixed;
  z-index: 1002;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tooltip-arrow.arrow-visible {
  opacity: 1;
}

.tooltip-arrow.arrow-dir-left {
  width: 8px;
  height: 14px;
  background: #5865f2;
  clip-path: polygon(0% 50%, 100% 0%, 100% 100%);
}

.tooltip-arrow.arrow-dir-right {
  width: 8px;
  height: 14px;
  background: #535ce1;
  clip-path: polygon(100% 50%, 0% 0%, 0% 100%);
}

.tooltip-arrow.arrow-dir-top {
  width: 14px;
  height: 8px;
  background: #5865f2;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.tooltip-arrow.arrow-dir-bottom {
  width: 14px;
  height: 8px;
  background: #545de3;
  clip-path: polygon(50% 100%, 0% 0%, 100% 0%);
}

.tooltip-arrow-glow {
  display: none;
}

/* Stat bubble — floats beside the tooltip */
.stat-bubble {
  position: fixed;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  gap: 8px;
  box-sizing: border-box;
}

.stat-bubble .stat-orb-row {
  flex: 1;
}

.stat-orb-row {
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.25), rgba(60, 65, 120, 0.3));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 14px;
  padding: 12px 18px 12px 14px;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: statOrbPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  box-sizing: border-box;
}

.stat-orb-row:nth-child(2) { animation-delay: 0.12s; }
.stat-orb-row:nth-child(3) { animation-delay: 0.24s; }

@keyframes statOrbPop {
  0% { opacity: 0; transform: scale(0.3); }
  70% { opacity: 1; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}

.stat-orb {
  width: 4px;
  align-self: stretch;
  border-radius: 3px;
  background: linear-gradient(180deg, #7983f5, #5865f2);
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(88, 101, 242, 0.6);
}

.stat-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.stat-orb-number {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  letter-spacing: -0.5px;
}

.stat-orb-label {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.45);
  max-width: 150px;
  line-height: 1.3;
}

.stat-source-link {
  color: rgba(255, 255, 255, 0.3);
  font-size: 13px;
  margin-left: auto;
  align-self: center;
  transition: color 0.2s;
  text-decoration: none;
  flex-shrink: 0;
}

.stat-source-link:hover {
  color: rgba(255, 255, 255, 0.7);
}

/* Welcome screen (step 1) */
.welcome-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background:
    radial-gradient(ellipse at 30% 80%, rgba(88, 101, 242, 0.25) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 30%, rgba(110, 93, 231, 0.18) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 50%, rgba(55, 60, 120, 0.2) 0%, transparent 60%),
    linear-gradient(180deg, #2c2f7c 0%, #1a1b4b 40%, #111236 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.3s ease;
}

.welcome-screen.hidden {
  display: flex !important;
  opacity: 0;
  pointer-events: none;
}

/* Asymmetric dark gradient from the left */
.welcome-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 0% 60%, rgba(0, 0, 0, 0.7) 0%, transparent 55%),
    radial-gradient(ellipse at 0% 30%, rgba(0, 0, 0, 0.5) 0%, transparent 50%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.2) 35%, transparent 60%);
  pointer-events: none;
}

/* Blurred star sprites */
.welcome-star {
  position: absolute;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.6);
  filter: blur(2px);
  pointer-events: none;
  z-index: 1;
  animation: starPulse 3s ease-in-out infinite;
}

.welcome-star-lg {
  filter: blur(3px);
  background: rgba(255, 255, 255, 0.5);
  animation-duration: 5s;
}

.welcome-star-sm {
  filter: blur(1.5px);
  background: rgba(255, 255, 255, 0.7);
  animation-duration: 4s;
}

@keyframes starPulse {
  0% { opacity: 0.15; transform: scale(0.9); }
  50% { opacity: 0.6; transform: scale(1.3); }
  100% { opacity: 0.15; transform: scale(0.9); }
}

/* Two-column layout */
.welcome-layout {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 1100px;
  padding: 0 48px;
  gap: 40px;
}

.welcome-text-side {
  flex: 0 0 42%;
  animation: welcomeTextIn 0.6s ease both;
}

@keyframes welcomeTextIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.welcome-logo {
  font-size: 40px;
  color: #fff;
  margin-bottom: 20px;
}

.welcome-logo-mobile {
  display: none;
}

.welcome-eyebrow {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 16px;
}

.welcome-headline {
  font-size: 44px;
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -1px;
}

.welcome-headline-logo {
  display: none;
  margin-bottom: 20px;
}

.welcome-subtext {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
  margin-bottom: 32px;
}

/* Hero scene — right side */
.welcome-hero-side {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: welcomeHeroIn 0.7s ease 0.2s both;
}

@keyframes welcomeHeroIn {
  from { opacity: 0; transform: scale(0.92) translateY(16px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.welcome-hero-scene {
  position: relative;
  width: 100%;
  max-width: 480px;
}

/* Main monitor/phone image */
.welcome-hero-monitor {
  width: 100%;
  border-radius: 12px;
  filter: drop-shadow(0 20px 60px rgba(0, 0, 0, 0.5));
  position: relative;
  z-index: 2;
}

/* Characters positioned around the monitor like toys */
.welcome-char {
  position: absolute;
  pointer-events: none;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.5));
}

.welcome-char-boy {
  width: 120px;
  bottom: -20px;
  left: -40px;
  z-index: 3;
  animation: charFloat 6s ease-in-out infinite alternate;
}

@keyframes charFloat {
  from { transform: translateY(0) rotate(0deg); }
  to { transform: translateY(-8px) rotate(2deg); }
}

.welcome-next-btn {
  background: #fff;
  color: #1e1f22;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 32px;
  border-radius: 28px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 2;
}

.welcome-next-btn:hover {
  background: #f2f3f5;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* Responsive welcome screen for small devices */
@media (max-width: 768px) {
  .welcome-layout {
    flex-direction: column-reverse;
    padding: 0 24px;
    gap: 24px;
    text-align: center;
  }

  .welcome-text-side {
    flex: none;
    width: 100%;
  }

  .welcome-subtext {
    font-size: 14px;
    margin-bottom: 24px;
  }

  .welcome-view-picker {
    flex-direction: column;
    gap: 10px;
  }

  .welcome-logo {
    display: none;
  }

  .welcome-eyebrow {
    display: none;
  }

  .welcome-headline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 28px;
    letter-spacing: -0.5px;
  }

  .welcome-headline-logo {
    display: block;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }

  .welcome-hero-side {
    flex: none;
    width: 100%;
    flex-direction: column;
  }

  .welcome-hero-scene {
    max-width: 280px;
    margin: 0 auto;
  }

  .welcome-char-boy {
    width: 80px;
    bottom: -14px;
    left: -20px;
  }

  .welcome-screen::before {
    background:
      radial-gradient(ellipse at 50% 80%, rgba(0, 0, 0, 0.6) 0%, transparent 60%),
      linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.5) 100%);
  }
}

