/* ============================================================
   MCenter — effects.css
   Styles for: video launcher, orbit video, welcome popup
   (Extracted from the original inline <style> block)
   ============================================================ */

/* ============================================================
   ORBIT VIDEO + ▶️ LAUNCHER (video opens inside Orbit)
   ============================================================ */

.video-launcher {
  position: relative;               /* part of the normal page flow */
  z-index: 99998;

  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #1a73e8, #1557b0);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;

  box-shadow:
    0 14px 30px rgba(26,115,232,0.45),
    0 0 0 1px rgba(26,115,232,0.35),
    0 0 30px rgba(26,115,232,0.35);

  margin: 14px auto 18px;

  transition:
    transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.25s ease;

  animation: videoLauncherPulse 2.4s ease-in-out infinite;
}

@keyframes videoLauncherPulse {
  0%, 100% {
    box-shadow:
      0 14px 30px rgba(26,115,232,0.45),
      0 0 0 1px rgba(26,115,232,0.35),
      0 0 0 0 rgba(26,115,232,0.55);
  }
  50% {
    box-shadow:
      0 14px 30px rgba(26,115,232,0.55),
      0 0 0 1px rgba(26,115,232,0.45),
      0 0 0 12px rgba(26,115,232,0);
  }
}

.video-launcher:hover {
  transform: scale(1.06);
  animation: none;
  box-shadow:
    0 20px 44px rgba(26,115,232,0.65),
    0 0 0 1px rgba(26,115,232,0.55);
}
.video-launcher:active {
  transform: scale(0.98);
}

.video-launcher svg {
  width: 22px;
  height: 22px;
  margin-left: 2px;
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.5));
}

.video-launcher::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid rgba(26,115,232,0.45);
  animation: videoLauncherRing 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes videoLauncherRing {
  0%   { transform: scale(0.9); opacity: 1; }
  100% { transform: scale(1.35); opacity: 0; }
}

body.popup-open .video-launcher {
  opacity: 0;
  pointer-events: none;
}

/* ---------- INLINE ORBIT VIDEO ---------- */
.orbit-video-panel {
  width: min(760px, 92%);
  margin: 12px auto 4px;
  display: none;
  position: relative;
  z-index: 20;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(0,0,0,0.72);
  border: 1px solid rgba(26,115,232,0.45);
  box-shadow: 0 18px 50px rgba(0,0,0,0.35), 0 0 30px rgba(26,115,232,0.18);
}
.orbit-video-panel.show { display: block; animation: orbitVideoIn 0.35s ease both; }
.orbit-video-panel iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: #000;
}
.orbit-video-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.orbit-video-close:hover { transform: scale(1.06); background: rgba(0,0,0,0.9); }
@keyframes orbitVideoIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- OVERLAY ---------- */
.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 99997;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 8, 19, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.35s ease;
}
body:not(.dark) .welcome-overlay {
  background: rgba(15, 23, 42, 0.55);
}
.welcome-overlay.show {
  display: flex;
  opacity: 1;
}
.welcome-overlay.fade-out { opacity: 0; }

/* ---------- POPUP CARD ---------- */
.welcome-card {
  position: relative;
  width: 100%;
  max-width: 720px;
  background: var(--bg-panel);
  border: 1.5px solid var(--border-soft);
  border-radius: 22px;
  box-shadow:
    0 30px 80px rgba(0,0,0,0.55),
    0 0 0 1px rgba(26,115,232,0.20),
    0 0 60px rgba(26,115,232,0.15);
  padding: 44px 44px 40px;
  overflow: hidden;
  transform: scale(0.94) translateY(14px);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.4s ease;
  backdrop-filter: blur(20px) saturate(160%);
}
.welcome-overlay.show .welcome-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}
body.dark .welcome-card {
  background: rgba(14, 18, 32, 0.92);
}
.welcome-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg,
    #1a73e8 0%, #34A853 33%, #FBBC05 66%, #000000 100%);
}

.welcome-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border-soft);
  color: var(--text-main);
  font-size: 20px; line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: all 0.2s ease;
}
.welcome-close:hover {
  background: rgba(220, 50, 50, 0.18);
  border-color: rgba(220, 50, 50, 0.5);
  color: #ff6b6b;
  transform: rotate(90deg);
}

.welcome-step-1 {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
  padding: 10px 6px 4px;
}

.welcome-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 84px; height: 84px;
  border-radius: 24px;
  background: radial-gradient(circle at 30% 30%,
    rgba(26,115,232,0.20),
    rgba(52,168,83,0.10) 60%,
    transparent 100%);
  border: 2px solid rgba(26,115,232,0.35);
  box-shadow:
    0 0 30px rgba(26,115,232,0.35),
    0 0 60px rgba(52,168,83,0.20);
  margin-bottom: 6px;
  animation: welcomeIconPulse 3s ease-in-out infinite;
}
@keyframes welcomeIconPulse {
  0%, 100% { transform: scale(1);    box-shadow: 0 0 30px rgba(26,115,232,0.35), 0 0 60px rgba(52,168,83,0.20); }
  50%      { transform: scale(1.05); box-shadow: 0 0 40px rgba(26,115,232,0.50), 0 0 80px rgba(52,168,83,0.30); }
}
.welcome-icon-wrap img {
  width: 56px; height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(26,115,232,0.6));
}

.welcome-eyebrow {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 11px; font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--color-blue);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.welcome-eyebrow::before,
.welcome-eyebrow::after {
  content: '';
  width: 22px; height: 1px;
  background: currentColor;
  opacity: 0.5;
}

.welcome-title {
  font-size: clamp(1.5rem, 3.6vw, 2.1rem);
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1.15;
  color: var(--text-main);
  margin: 0;
}
.welcome-title .accent-blue  { color: var(--color-blue); }
.welcome-title .accent-green { color: var(--color-green); }

.welcome-sub {
  font-size: 0.98rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 520px;
  margin: 0;
}

.welcome-ok-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 38px;
  margin-top: 8px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 15px; font-weight: 800;
  letter-spacing: 0.3px;
  color: #fff;
  background: linear-gradient(135deg, #1a73e8, #1557b0);
  border: none;
  cursor: pointer;
  box-shadow:
    0 12px 30px rgba(26,115,232,0.45),
    0 0 0 1px rgba(26,115,232,0.30);
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.welcome-ok-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 18px 44px rgba(26,115,232,0.55),
    0 0 0 1px rgba(26,115,232,0.40);
}
.welcome-ok-btn:active { transform: translateY(0) scale(0.98); }
.welcome-ok-btn .arrow { transition: transform 0.25s ease; }
.welcome-ok-btn:hover .arrow { transform: translateX(4px); }

.welcome-step-2 {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.welcome-step-2.show {
  display: flex;
  animation: welcomeFadeIn 0.4s ease;
}
@keyframes welcomeFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.welcome-video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  border: 2px solid rgba(26,115,232,0.35);
  box-shadow:
    0 20px 60px rgba(26,115,232,0.30),
    0 0 0 1px rgba(26,115,232,0.15) inset;
}
.welcome-video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  border: 0;
  display: block;
}

.welcome-video-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  flex-wrap: wrap;
}
.welcome-video-label {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 11px; font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.welcome-video-label .dot-live {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #34A853;
  box-shadow: 0 0 8px #34A853;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.75); }
}

.welcome-skip-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text-main);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  transition: all 0.22s ease;
}
.welcome-skip-btn:hover {
  border-color: var(--color-blue);
  color: var(--color-blue);
  transform: translateY(-2px);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 820px) {
  .video-launcher { width: 48px; height: 48px; }
  .video-launcher svg { width: 20px; height: 20px; }
}
@media (max-width: 640px) {
  .video-launcher { width: 44px; height: 44px; }
  .video-launcher svg { width: 18px; height: 18px; }

  .welcome-overlay { padding: 14px; }
  .welcome-card { padding: 32px 22px 28px; border-radius: 18px; }
  .welcome-icon-wrap { width: 66px; height: 66px; border-radius: 20px; }
  .welcome-icon-wrap img { width: 42px; height: 42px; }
  .welcome-title { font-size: 1.35rem; }
  .welcome-ok-btn { padding: 13px 30px; font-size: 14px; }
  .welcome-video-info { justify-content: center; }
  .welcome-skip-btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-icon-wrap,
  .welcome-overlay,
  .welcome-card,
  .video-launcher,
  .video-launcher::after,
  .welcome-video-label .dot-live {
    animation: none !important;
    transition: none !important;
  }
}

/* ============================================================
   PERFORMANCE — same look, GPU-accelerated
   ------------------------------------------------------------
   These rules are INVISIBLE to users. They tell the browser:
   "these elements animate independently — don't repaint the
    whole page when they move."
   ============================================================ */

/* GPU-accelerate every animated element (transform + opacity) */
.cosmic-nebula,
.cosmic-stars,
.bright-star,
.shooting-star,
.dust-layer span,
.orbit,
.planet-wrap,
.planet,
.sun img,
.orbit-video-panel,
.video-launcher {
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Isolate the cosmic background from the rest of the page.
   Changes inside don't force the whole page to repaint. */
.cosmic-bg {
  contain: strict;
  pointer-events: none;
}

/* Isolate heavy sections from each other */
.solar-system,
.news-panel {
  contain: layout paint;
}

/* Pause everything when the tab is hidden.
   (Class is toggled by app.js on visibilitychange.) */
body.paused *,
body.paused *::before,
body.paused *::after {
  animation-play-state: paused !important;
}

/* Respect users who ask for less motion — broader version */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}