/* ============================================
   Brain Games Hub - Main Stylesheet
   ============================================ */

:root {
  --color-primary: #7C3AED;
  --color-primary-light: #A78BFA;
  --color-primary-dark: #5B21B6;
  --color-accent: #F59E0B;
  --color-accent-light: #FCD34D;
  --color-blue: #3B82F6;
  --color-bg: #F8FAFC;
  --color-surface: #FFFFFF;
  --color-text: #1E293B;
  --color-text-secondary: #64748B;
  --color-text-muted: #94A3B8;
  --color-border: #E2E8F0;
  --gradient-primary: linear-gradient(135deg, #7C3AED 0%, #3B82F6 100%);
  --gradient-hero: linear-gradient(135deg, #667EEA 0%, #7C3AED 50%, #9333EA 100%);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --container-max: 1200px;
  --header-height: 72px;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

ul { list-style: none; }

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================
   Header & Navigation
   ============================================ */

header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
}

nav {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-primary);
}

.nav-logo img {
  height: 44px;
  width: auto;
  border-radius: var(--radius-sm);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  position: relative;
  padding: 4px 0;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-primary);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 1px;
  transition: width 0.3s ease;
}

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

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--color-text);
}

.mobile-menu-btn svg {
  width: 24px;
  height: 24px;
}

/* ============================================
   Hero Section
   ============================================ */

.hero {
  background: var(--gradient-hero);
  padding: 80px 24px;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 50%);
  animation: heroShimmer 20s ease-in-out infinite;
}

@keyframes heroShimmer {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(15%, 15%) scale(1.1); }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

.hero-logo {
  width: 120px;
  height: 120px;
  border-radius: 28px;
  margin: 0 auto 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.3rem;
  font-weight: 500;
  margin-bottom: 16px;
  opacity: 0.95;
}

.hero p {
  font-size: 1.1rem;
  opacity: 0.9;
  line-height: 1.8;
  max-width: 640px;
  margin: 0 auto;
}

.hero-cta {
  margin-top: 32px;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================
   Section Styles
   ============================================ */

.section {
  padding: 80px 24px;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 12px;
}

.section-header p {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================
   Features Grid
   ============================================ */

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  max-width: var(--container-max);
  margin: 0 auto;
}

.feature-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: var(--transition);
}

.feature-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 1.4rem;
}

.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

/* ============================================
   Games Grid
   ============================================ */

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  max-width: var(--container-max);
  margin: 0 auto;
}

.game-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.game-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
}

.game-card-header {
  padding: 24px 24px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.game-card-icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  flex-shrink: 0;
  object-fit: cover;
}

.game-card-info h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.game-category {
  font-size: 0.8rem;
  color: var(--color-primary);
  font-weight: 600;
  background: rgba(124, 58, 237, 0.08);
  padding: 3px 12px;
  border-radius: 12px;
  display: inline-block;
}

.game-card-body {
  padding: 0 24px 20px;
  flex: 1;
}

.game-card-body p {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

.game-card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-learn-more {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-primary);
}

.btn-learn-more:hover {
  color: var(--color-primary-dark);
}

.btn-appstore-sm {
  font-size: 0.8rem;
  font-weight: 500;
  color: white;
  background: #000;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.btn-appstore-sm:hover {
  background: #333;
}

.btn-appstore-sm svg {
  width: 16px;
  height: 16px;
}

/* ============================================
   Game Detail Page
   ============================================ */

.game-hero {
  background: var(--gradient-hero);
  padding: 60px 24px;
  color: white;
}

.game-hero-content {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 40px;
}

.game-hero-icon {
  width: 160px;
  height: 160px;
  border-radius: 36px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  flex-shrink: 0;
  object-fit: cover;
}

.game-hero-text {
  text-align: left;
}

.game-hero-text h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.game-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  font-size: 0.95rem;
  opacity: 0.9;
  flex-wrap: wrap;
}

.game-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.game-hero-text p {
  font-size: 1.1rem;
  opacity: 0.9;
  line-height: 1.8;
  max-width: 600px;
}

.game-hero-cta {
  margin-top: 24px;
}

.game-content {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 60px 24px;
}

.game-description {
  max-width: 800px;
  margin: 0 auto 60px;
}

.game-description h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.game-description p {
  font-size: 1.05rem;
  color: var(--color-text-secondary);
  line-height: 1.8;
  margin-bottom: 12px;
}

.game-features {
  margin-bottom: 60px;
}

.game-features h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: center;
}

.game-features-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.game-feature-item {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 20px 24px;
  border: 1px solid var(--color-border);
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: var(--transition);
}

.game-feature-item:hover {
  box-shadow: var(--shadow);
  border-color: var(--color-primary-light);
}

.feature-check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(124,58,237,0.12), rgba(59,130,246,0.12));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-primary);
  font-size: 0.85rem;
}

.game-feature-item p {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* ============================================
   Download CTA
   ============================================ */

.download-section {
  text-align: center;
  padding: 48px;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
}

.download-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.download-section p {
  color: var(--color-text-secondary);
  margin-bottom: 24px;
  font-size: 1.05rem;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  font-family: inherit;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(124, 58, 237, 0.45);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn-secondary:hover {
  background: rgba(124, 58, 237, 0.05);
}

.btn-appstore {
  background: #000;
  color: white;
  padding: 14px 32px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.btn-appstore:hover {
  background: #333;
  transform: translateY(-2px);
}

.btn-appstore svg {
  width: 22px;
  height: 22px;
}

/* ============================================
   Legal Pages (Privacy, Terms)
   ============================================ */

.legal-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 60px 24px;
}

.legal-page h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 8px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.legal-page .last-updated {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 40px;
}

.legal-page h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-top: 40px;
  margin-bottom: 16px;
  color: var(--color-text);
}

.legal-page h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 12px;
}

.legal-page p {
  font-size: 1rem;
  color: var(--color-text-secondary);
  line-height: 1.8;
  margin-bottom: 16px;
}

.legal-page ul {
  padding-left: 24px;
  margin-bottom: 16px;
}

.legal-page ul li {
  font-size: 1rem;
  color: var(--color-text-secondary);
  line-height: 1.8;
  list-style: disc;
  margin-bottom: 8px;
}

.legal-page a {
  color: var(--color-primary);
}

.legal-page a:hover {
  text-decoration: underline;
}

/* ============================================
   About Page
   ============================================ */

.about-hero {
  background: var(--gradient-hero);
  padding: 80px 24px;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.about-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 50%);
  animation: heroShimmer 20s ease-in-out infinite;
}

.about-hero-content {
  position: relative;
  z-index: 1;
}

.about-hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.about-hero p {
  font-size: 1.2rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

.about-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 60px 24px;
}

.about-content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 16px;
  margin-top: 48px;
}

.about-content h2:first-child {
  margin-top: 0;
}

.about-content p {
  font-size: 1.05rem;
  color: var(--color-text-secondary);
  line-height: 1.8;
  margin-bottom: 16px;
}

.about-values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.about-value-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
}

.about-value-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--color-primary-light);
}

.about-value-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.about-value-card p {
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* ============================================
   Footer
   ============================================ */

footer {
  background: var(--color-text);
  color: white;
  padding: 48px 24px 24px;
  margin-top: auto;
}

.footer-content {
  max-width: var(--container-max);
  margin: 0 auto;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 32px;
}

.footer-brand {
  max-width: 300px;
}

.footer-brand img {
  height: 40px;
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
}

.footer-brand p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.7;
}

.footer-nav h4 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
  color: rgba(255,255,255,0.4);
}

.footer-nav ul li {
  margin-bottom: 10px;
}

.footer-nav ul li a {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
}

.footer-nav ul li a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.4);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-surface);
    padding: 24px;
    flex-direction: column;
    gap: 4px;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links a {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    width: 100%;
  }

  .nav-links a:hover {
    background: rgba(124, 58, 237, 0.05);
  }

  .nav-links a::after {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }

  .hero {
    padding: 56px 20px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .hero-logo {
    width: 88px;
    height: 88px;
    border-radius: 22px;
  }

  .games-grid {
    grid-template-columns: 1fr;
  }

  .game-hero {
    padding: 40px 20px;
  }

  .game-hero-content {
    flex-direction: column;
    text-align: center;
  }

  .game-hero-text {
    text-align: center;
  }

  .game-meta {
    justify-content: center;
  }

  .game-hero-icon {
    width: 120px;
    height: 120px;
    border-radius: 28px;
  }

  .game-hero-text h1 {
    font-size: 1.75rem;
  }

  .game-hero-text p {
    margin: 0 auto;
  }

  .game-hero-cta {
    text-align: center;
  }

  .footer-top {
    flex-direction: column;
  }

  .section {
    padding: 48px 20px;
  }

  .section-header h2 {
    font-size: 1.6rem;
  }

  .legal-page {
    padding: 40px 20px;
  }

  .legal-page h1 {
    font-size: 1.75rem;
  }

  .about-hero {
    padding: 56px 20px;
  }

  .about-hero h1 {
    font-size: 2rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .game-features-list {
    grid-template-columns: 1fr;
  }

  .download-section {
    padding: 32px 20px;
  }
}

@media (max-width: 480px) {
  .game-card-header {
    flex-direction: column;
    text-align: center;
  }

  .hero h1 {
    font-size: 1.65rem;
  }

  .game-card-footer {
    flex-direction: column;
    gap: 12px;
  }
}

/* ============================================
   Utilities
   ============================================ */

.text-center { text-align: center; }

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
