/* ─── PUZZLEVERSE DESIGN SYSTEM ─── */
/* Brand tokens from the app's theme. Edit these to update the entire site. */

:root {
  --bg: #0B1121;
  --bg-alt: #080E1A;
  --surface: #141C2B;
  --surface-glow: #1A2636;
  --surface-elevated: #1E2940;
  --accent: #2EA8A8;
  --accent-glow: rgba(46,168,168,0.15);
  --accent-bright: #3ECECE;
  --accent-dark: #1a7a7a;
  --text: #E8E4DF;
  --text-secondary: #9A9490;
  --text-muted: rgba(154,148,144,0.5);
  --gold: #D4952A;
  --success: #5CC78A;
  --warning: #E09050;
  --border: rgba(255,255,255,0.04);
  --border-accent: rgba(46,168,168,0.12);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --max-width: 1240px;
}

/* ─── RESET ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration: none; transition: color 0.3s; }
a:hover { color: var(--accent-bright); }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* ─── LOADING SCREEN ─── */
#loader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: opacity 0.6s, visibility 0.6s;
}
#loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-logo {
  width: 72px; height: 72px;
  border: 3px solid transparent;
  border-top-color: var(--accent);
  border-radius: 16px;
  animation: loaderSpin 1.2s ease-in-out infinite;
}
.loader-text {
  margin-top: 18px; font-size: 13px; color: var(--text-secondary);
  letter-spacing: 4px; text-transform: uppercase; font-weight: 500;
}
@keyframes loaderSpin {
  0% { transform: rotate(0deg) scale(1); border-radius: 16px; }
  50% { transform: rotate(180deg) scale(1.08); border-radius: 50%; }
  100% { transform: rotate(360deg) scale(1); border-radius: 16px; }
}

/* ─── NAV ─── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 18px 40px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(11,17,33,0.75);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border-accent);
}
.nav-logo {
  display: flex; align-items: center; gap: 12px;
  font-weight: 800; font-size: 19px; letter-spacing: -0.5px;
  color: var(--text);
}
.nav-logo img { width: 34px; height: 34px; border-radius: 9px; }
.nav-right { display: flex; gap: 28px; align-items: center; }
.nav-right a {
  font-size: 14px; font-weight: 500; color: var(--text-secondary);
  position: relative; padding-bottom: 4px;
}
.nav-right a::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 0; height: 2px; background: var(--accent);
  transition: width 0.3s ease;
}
.nav-right a:hover { color: var(--text); }
.nav-right a:hover::after { width: 100%; }
.nav-cta {
  padding: 10px 22px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff; font-weight: 600; font-size: 14px;
  border: none; cursor: pointer; transition: all 0.3s;
}
.nav-cta:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(46,168,168,0.35); }
.nav-mobile-toggle { display: none; background: none; border: none; color: var(--text); font-size: 24px; cursor: pointer; }

/* ─── PAGE CONTAINER ─── */
.page { padding-top: 80px; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* ─── SECTION ─── */
.section { padding: 100px 0; }
.section-header { text-align: center; margin-bottom: 56px; }
.section-tag {
  display: inline-block; padding: 6px 16px; border-radius: 20px;
  background: rgba(46,168,168,0.06); border: 1px solid var(--border-accent);
  font-size: 11px; font-weight: 600; color: var(--accent);
  text-transform: uppercase; letter-spacing: 2.5px;
  margin-bottom: 18px;
}
.section-title {
  font-size: clamp(30px, 4.5vw, 52px);
  font-weight: 800; letter-spacing: -1.5px; line-height: 1.1;
  margin-bottom: 14px;
}
.section-subtitle {
  font-size: 17px; color: var(--text-secondary); line-height: 1.65;
  max-width: 560px; margin: 0 auto;
}

/* ─── HERO (shared) ─── */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.hero-canvas { position: absolute; inset: 0; z-index: 0; }
.hero-content {
  position: relative; z-index: 10;
  text-align: center; padding: 0 20px; max-width: 860px;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 18px; border-radius: 50px;
  background: rgba(46,168,168,0.06); border: 1px solid var(--border-accent);
  font-size: 13px; font-weight: 500; color: var(--accent);
  margin-bottom: 26px;
}
.hero-badge-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.hero-title {
  font-size: clamp(38px, 7vw, 84px);
  font-weight: 900; line-height: 1.04; letter-spacing: -2.5px;
  background: linear-gradient(135deg, #fff 0%, var(--accent-bright) 60%, var(--accent) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 22px;
}
.hero-subtitle {
  font-size: clamp(15px, 2vw, 20px);
  color: var(--text-secondary); line-height: 1.65;
  max-width: 560px; margin: 0 auto 36px;
}
.hero-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-scroll {
  position: absolute; bottom: 36px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--text-muted); font-size: 11px; letter-spacing: 1px;
  animation: scrollBounce 2.5s infinite;
}
@keyframes scrollBounce {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}
.scroll-arrow {
  width: 16px; height: 16px;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: rotate(45deg);
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 30px; border-radius: var(--radius-md);
  font-size: 15px; font-weight: 600;
  cursor: pointer; transition: all 0.3s; border: none;
  position: relative; overflow: hidden;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff; box-shadow: 0 4px 18px rgba(46,168,168,0.25);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 8px 36px rgba(46,168,168,0.4); }
.btn-secondary {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { transform: translateY(-3px); background: var(--surface-glow); }
.btn svg { width: 18px; height: 18px; }

/* ─── STATS STRIP ─── */
.stats-strip {
  padding: 56px 0;
  border-top: 1px solid rgba(46,168,168,0.05);
  border-bottom: 1px solid rgba(46,168,168,0.05);
  background: rgba(20,28,43,0.4);
}
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px;
  text-align: center;
}
.stat-item { opacity: 0; transform: translateY(20px); }
.stat-icon { font-size: 26px; margin-bottom: 10px; }
.stat-number {
  font-size: 40px; font-weight: 800; letter-spacing: -1px;
  background: linear-gradient(135deg, var(--text), var(--accent-bright));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 5px; font-weight: 500; }

/* ─── GAME CARDS ─── */
.games-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 22px;
}
.game-card {
  background: var(--surface);
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer; perspective: 1000px;
  opacity: 0; transform: translateY(36px) scale(0.96);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.game-card:hover {
  transform: translateY(-6px) scale(1.02) !important;
  box-shadow: 0 16px 50px rgba(0,0,0,0.35);
}
.game-card-inner { transition: transform 0.3s ease; }
.game-card-top {
  height: 150px; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.game-card-glow {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 80%, var(--card-color, var(--accent)), transparent 70%);
  opacity: 0.12;
}
.game-card-icon {
  width: 68px; height: 68px; border-radius: 16px;
  position: relative; z-index: 1;
  box-shadow: 0 6px 24px rgba(0,0,0,0.3);
  object-fit: cover;
}
.game-card-icon-emoji {
  width: 68px; height: 68px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; position: relative; z-index: 1;
  box-shadow: 0 6px 24px rgba(0,0,0,0.3);
}
.game-card-body { padding: 22px; }
.game-card-name { font-size: 19px; font-weight: 700; margin-bottom: 3px; }
.game-card-genre {
  font-size: 11px; color: var(--text-secondary); font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 10px;
}
.game-card-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.55; margin-bottom: 14px; }
.game-card-footer { display: flex; align-items: center; justify-content: space-between; }
.game-card-levels {
  font-size: 12px; font-weight: 600;
  padding: 4px 11px; border-radius: 7px;
  background: rgba(255,255,255,0.04);
}
.badge {
  font-size: 10px; font-weight: 700; padding: 3px 9px;
  border-radius: 5px; text-transform: uppercase; letter-spacing: 0.6px;
}
.badge-earn { background: rgba(212,149,42,0.12); color: var(--gold); }
.badge-new { background: rgba(46,168,168,0.1); color: var(--accent); }

/* ─── HOW IT WORKS STEPS ─── */
.steps-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px;
  position: relative;
}
.steps-grid::before {
  content: ''; position: absolute;
  top: 40px; left: 16%; right: 16%;
  height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.15;
}
.step-card {
  text-align: center; opacity: 0; transform: translateY(28px);
}
.step-num {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: #fff;
  margin: 0 auto 18px; position: relative; z-index: 1;
  box-shadow: 0 4px 18px rgba(46,168,168,0.3);
}
.step-icon { font-size: 36px; margin-bottom: 14px; }
.step-title { font-size: 19px; font-weight: 700; margin-bottom: 7px; }
.step-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

/* ─── TRUST BADGES ─── */
.trust-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  margin-top: 48px;
}
.trust-card {
  background: var(--surface); border-radius: var(--radius-md);
  border: 1px solid var(--border); padding: 28px; text-align: center;
  opacity: 0; transform: translateY(24px);
}
.trust-icon { font-size: 32px; margin-bottom: 12px; }
.trust-title { font-size: 15px; font-weight: 700; margin-bottom: 5px; }
.trust-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* ─── FAQ ─── */
.faq-list { max-width: 720px; margin: 0 auto; }
.faq-item {
  border-bottom: 1px solid var(--border);
  opacity: 0; transform: translateY(16px);
}
.faq-question {
  width: 100%; background: none; border: none; color: var(--text);
  font-size: 16px; font-weight: 600; text-align: left;
  padding: 22px 0; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  font-family: inherit;
}
.faq-question:hover { color: var(--accent); }
.faq-arrow { font-size: 18px; transition: transform 0.3s; color: var(--text-secondary); }
.faq-item.open .faq-arrow { transform: rotate(180deg); }
.faq-answer {
  max-height: 0; overflow: hidden; transition: max-height 0.4s ease, padding 0.4s ease;
  font-size: 14px; color: var(--text-secondary); line-height: 1.7;
}
.faq-item.open .faq-answer { max-height: 300px; padding-bottom: 22px; }

/* ─── CTA SECTION ─── */
.cta-section { text-align: center; position: relative; overflow: hidden; }
.cta-glow {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(46,168,168,0.06), transparent 70%);
  pointer-events: none;
}
.cta-title {
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 900; letter-spacing: -1px;
  margin-bottom: 14px; position: relative;
}
.cta-sub { font-size: 17px; color: var(--text-secondary); margin-bottom: 36px; position: relative; }
.cta-buttons { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; position: relative; }

/* ─── FOOTER ─── */
footer {
  padding: 52px 24px 36px;
  border-top: 1px solid var(--border-accent);
}
.footer-inner {
  max-width: var(--max-width); margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 20px;
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand img { width: 28px; height: 28px; border-radius: 7px; }
.footer-brand-name { font-weight: 700; font-size: 16px; }
.footer-links { display: flex; gap: 24px; }
.footer-links a { font-size: 13px; color: var(--text-secondary); }
.footer-links a:hover { color: var(--accent); }
.footer-copy { font-size: 12px; color: var(--text-muted); width: 100%; text-align: center; margin-top: 24px; }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-grid { grid-template-columns: 1fr; gap: 40px; }
  .steps-grid::before { display: none; }
  .trust-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  nav { padding: 14px 18px; }
  .nav-right a:not(.nav-cta) { display: none; }
  .nav-mobile-toggle { display: block; }
  .hero-title { letter-spacing: -1.5px; }
  .section { padding: 72px 0; }
  .stat-number { font-size: 32px; }
  .games-grid { grid-template-columns: 1fr; }
  .footer-inner { justify-content: center; text-align: center; }
  .footer-links { justify-content: center; }
}

/* ─── REDUCED MOTION ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .hero-canvas { display: none; }
  .stat-item, .game-card, .step-card, .trust-card, .faq-item {
    opacity: 1 !important; transform: none !important;
  }
}
