/* ============================================================
   HHPoker Interstellar Theme - Custom Styles
   Design: Deep Space / SpaceX-inspired
   ============================================================ */

/* --- CSS Variables --- */
:root {
  --space-black: #0b0b1a;
  --deep-indigo: #1a1040;
  --deep-violet: #1e1040;
  --star-white: #e8e8f0;
  --accent-blue: #6366f1;
  --accent-purple: #8b5cf6;
  --accent-cyan: #22d3ee;
  --glow-indigo: rgba(99, 102, 241, 0.5);
  --glow-purple: rgba(139, 92, 246, 0.5);
  --text-primary: #e8e8f0;
  --text-secondary: #a5a5c0;
  --card-bg: rgba(20, 20, 50, 0.6);
  --card-border: rgba(99, 102, 241, 0.2);
}

/* --- Reset & Base --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  background-color: var(--space-black);
  color: var(--text-primary);
  overflow-x: hidden;
  line-height: 1.6;
}

/* --- Starfield Canvas --- */
#starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* --- Animated Gradient Background --- */
.bg-space-gradient {
  background: linear-gradient(135deg, #0b0b1a 0%, #1a1040 30%, #1e1040 60%, #0b0b1a 100%);
  background-size: 400% 400%;
  animation: spaceShift 20s ease-in-out infinite;
}

@keyframes spaceShift {
  0%, 100% { background-position: 0% 50%; }
  25% { background-position: 100% 0%; }
  50% { background-position: 100% 100%; }
  75% { background-position: 0% 100%; }
}

/* --- Glow Effects --- */
.glow-text {
  text-shadow: 0 0 20px var(--glow-indigo), 0 0 40px var(--glow-purple);
}

.glow-border {
  box-shadow: 0 0 15px var(--glow-indigo), 0 0 30px var(--glow-purple), inset 0 0 15px rgba(99, 102, 241, 0.1);
}

.glow-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  transition: all 0.3s ease;
}

.glow-card:hover {
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 0 20px var(--glow-indigo), 0 0 40px var(--glow-purple);
  transform: translateY(-4px);
}

/* --- Ring UI Elements (Planet Ring Style) --- */
.ring-element {
  position: relative;
}

.ring-element::before {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  border: 2px solid transparent;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.1), rgba(99, 102, 241, 0.3)) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
  animation: ringRotate 8s linear infinite;
}

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

/* --- Orbit Line Decoration --- */
.orbit-line {
  position: relative;
}

.orbit-line::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-indigo), var(--accent-purple), transparent);
  opacity: 0.6;
}

/* --- Button Styles --- */
.btn-primary {
  display: inline-block;
  padding: 14px 36px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 50px;
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4), 0 4px 15px rgba(0, 0, 0, 0.3);
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.6), 0 8px 25px rgba(0, 0, 0, 0.4);
  background: linear-gradient(135deg, #7577f5, #9b6ff9);
}

.btn-outline {
  display: inline-block;
  padding: 14px 36px;
  background: transparent;
  color: var(--star-white);
  font-weight: 700;
  font-size: 1rem;
  border-radius: 50px;
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  border: 2px solid rgba(139, 92, 246, 0.6);
  cursor: pointer;
}

.btn-outline:hover {
  border-color: #8b5cf6;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.1);
}

/* --- Icon Circle --- */
.icon-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #a78bfa;
  font-size: 1.5rem;
  margin: 0 auto 1rem auto;
  transition: all 0.3s ease;
}

.glow-card:hover .icon-circle {
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
  color: #c4b5fd;
}

/* --- Stat Counter --- */
.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Pulse Dot Indicator --- */
.pulse-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22d3ee;
  box-shadow: 0 0 10px #22d3ee;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

/* --- Navbar --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: all 0.3s ease;
  padding: 1rem 0;
}

.navbar.scrolled {
  background: rgba(11, 11, 26, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  padding: 0.5rem 0;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--star-white);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* --- Hero Particles --- */
.hero-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 6px #a78bfa, 0 0 12px #6366f1;
  animation: floatUp 6s ease-in-out infinite;
  opacity: 0;
}

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

/* --- Section Title --- */
.section-title {
  font-size: 2.25rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #e8e8f0, #c4b5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  font-size: 1.05rem;
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* --- FAQ Accordion --- */
.faq-item {
  border-bottom: 1px solid rgba(99, 102, 241, 0.15);
  overflow: hidden;
}

.faq-question {
  padding: 1.25rem 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.05rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-primary);
  transition: color 0.3s ease;
  user-select: none;
}

.faq-question:hover {
  color: #c4b5fd;
}

.faq-question i {
  font-size: 0.85rem;
  transition: transform 0.3s ease;
  color: var(--accent-purple);
}

.faq-item.active .faq-question i {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  color: var(--text-secondary);
  line-height: 1.7;
}

.faq-item.active .faq-answer {
  max-height: 300px;
  padding-bottom: 1.25rem;
}

/* --- Download Card --- */
.download-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
}

.download-card:hover {
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
  transform: translateY(-4px);
}

.download-card.featured {
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.2);
  position: relative;
}

.download-card.featured::before {
  content: '热门推荐';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 16px;
  border-radius: 20px;
}

/* --- Platform Badge --- */
.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.platform-badge.android {
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.3);
  color: #22d3ee;
}

.platform-badge.ios {
  background: rgba(168, 139, 250, 0.1);
  border: 1px solid rgba(168, 139, 250, 0.3);
  color: #a78bfa;
}

/* --- Scroll Animation --- */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Footer --- */
.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: #c4b5fd;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .section-title {
    font-size: 1.75rem;
  }

  .section-subtitle {
    font-size: 0.95rem;
  }

  .btn-primary,
  .btn-outline {
    padding: 12px 28px;
    font-size: 0.9rem;
  }

  .stat-number {
    font-size: 2rem;
  }

  .mobile-menu {
    display: none;
  }

  .mobile-menu.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(11, 11, 26, 0.95);
    backdrop-filter: blur(20px);
    padding: 1.5rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
  }
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--space-black);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #6366f1, #8b5cf6);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #7577f5, #9b6ff9);
}

/* --- Selection --- */
::selection {
  background: rgba(99, 102, 241, 0.4);
  color: #fff;
}
