:root {
  /* Base Colors */
  --bg-primary: #0b021a;
  --bg-secondary: #14052e;
  --surface: #1c0640;
  
  /* Accent Colors */
  --flame-yellow: #ffd60a;
  --amber: #ffb703;
  --fire-orange: #fb8500;
  --neon-purple: #7b2cbf;
  
  /* Gradients */
  --gradient-fire: linear-gradient(135deg, #7b2cbf, #ffd60a, #fb8500);
  --gradient-button: linear-gradient(135deg, #fb8500, #ffd60a);
  --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  
  /* Transparency */
  --glass-panel: rgba(255, 255, 255, 0.06);
  --glow-overlay: rgba(255, 214, 10, 0.15);
  
  /* Text Colors */
  --text-primary: #f8f9fa;
  --text-secondary: #cbd5f5;
  --text-muted: #8d99ae;
  
  /* Spacing */
  --spacing-desktop: 90px;
  --spacing-tablet: 60px;
  --spacing-mobile: 40px;
  
  /* Max Width */
  --max-width: 1350px;
  
  /* Border Radius */
  --radius-btn: 16px;
  --radius-card: 22px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Global Background Noise/Grain Overlay */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: url('assets/subtle-noise-texture.png');
  opacity: 0.03;
  pointer-events: none;
  z-index: 9999;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

ul {
  list-style: none;
}

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

/* Typography */
h1, h2, h3, h4 {
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  background: var(--gradient-fire);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-transform: uppercase;
  letter-spacing: -1px;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--text-primary);
  text-shadow: 0 0 20px rgba(255, 214, 10, 0.2);
}

p {
  color: var(--text-secondary);
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
}

/* Layout Container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header (Smart Auto-Hide) */
.header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 999;
  transition: transform 0.35s ease, background-color 0.3s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(11, 2, 26, 0.8);
  border-bottom: 1px solid rgba(255, 214, 10, 0.2);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 214, 10, 0.1);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

.logo span {
  color: var(--flame-yellow);
  text-shadow: 0 0 10px rgba(255, 214, 10, 0.5);
}

.nav-links {
  display: flex;
  gap: 30px;
}

.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 1rem;
  position: relative;
}

.nav-links a:hover {
  color: var(--flame-yellow);
  text-shadow: 0 0 10px rgba(255, 214, 10, 0.4);
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius-btn);
  background: var(--gradient-button);
  color: #000;
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(251, 133, 0, 0.4);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 30px rgba(255, 214, 10, 0.7);
  color: #000;
}

.btn:active {
  transform: translateY(1px);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.menu-toggle span {
  width: 25px;
  height: 3px;
  background-color: var(--text-primary);
  border-radius: 2px;
  transition: 0.3s;
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
  background-image: url('assets/futuristic-purple-city-fire-sparks.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(11,2,26,0.3) 0%, rgba(11,2,26,0.9) 100%);
}

.hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 150px;
  background: linear-gradient(to top, var(--bg-primary), transparent);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(255, 214, 10, 0.1);
  border: 1px solid var(--flame-yellow);
  border-radius: 30px;
  color: var(--flame-yellow);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 20px;
  box-shadow: 0 0 15px rgba(255, 214, 10, 0.2);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Game Section - Fire Core */
.game-section {
  padding: var(--spacing-desktop) 0;
  background: var(--bg-primary);
  position: relative;
  background-image: url('assets/abstract-purple-fire-glow-waves.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.game-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 2, 26, 0.85);
}

.game-wrapper {
  position: relative;
  z-index: 2;
  max-width: 1250px;
  margin: 0 auto;
  border-radius: var(--radius-card);
  padding: 4px;
  background: var(--gradient-fire);
  box-shadow: 0 0 50px rgba(251, 133, 0, 0.3), inset 0 0 20px rgba(255, 214, 10, 0.2);
  animation: core-flicker 4s infinite alternate ease-in-out;
  transition: transform 0.4s ease;
}

.game-wrapper:hover {
  transform: scale(1.01);
  box-shadow: 0 0 70px rgba(255, 214, 10, 0.5), inset 0 0 30px rgba(255, 214, 10, 0.4);
}

.game-container {
  background: var(--surface);
  border-radius: calc(var(--radius-card) - 4px);
  overflow: hidden;
  position: relative;
  aspect-ratio: 16/9;
  width: 100%;
}

.game-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Game Info / Legal Banner */
.legal-banner {
  background: rgba(123, 44, 191, 0.1);
  border: 1px solid rgba(123, 44, 191, 0.3);
  border-radius: var(--radius-btn);
  padding: 20px;
  margin-top: 40px;
  text-align: center;
  position: relative;
  z-index: 2;
}

.legal-banner p {
  margin: 0;
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.legal-banner strong {
  color: var(--flame-yellow);
}

/* Card System */
.features-section {
  padding: var(--spacing-desktop) 0;
  background: var(--bg-secondary);
  position: relative;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 50px;
}

.card {
  background: var(--gradient-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(123, 44, 191, 0.3);
  border-radius: var(--radius-card);
  padding: 40px 30px;
  text-align: center;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, transparent, rgba(255, 214, 10, 0.1), transparent);
  transform: skewX(-20deg);
  transition: all 0.6s ease;
}

.card:hover {
  transform: translateY(-10px);
  border-color: var(--flame-yellow);
  box-shadow: 0 10px 30px rgba(123, 44, 191, 0.2), 0 0 20px rgba(255, 214, 10, 0.15);
}

.card:hover::before {
  left: 200%;
}

.card-icon {
  font-size: 3rem;
  margin-bottom: 20px;
  display: inline-block;
  background: var(--gradient-fire);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Internal Pages Layout (Terms, Privacy, About) */
.page-header {
  padding: 180px 0 80px;
  background: linear-gradient(to bottom, rgba(20, 5, 46, 0.9), var(--bg-primary));
  text-align: center;
  position: relative;
}

.page-content {
  padding: var(--spacing-tablet) 0 var(--spacing-desktop);
  max-width: 900px;
  margin: 0 auto;
}

.content-box {
  background: var(--gradient-glass);
  border: 1px solid rgba(123, 44, 191, 0.2);
  border-radius: var(--radius-card);
  padding: 50px;
  backdrop-filter: blur(10px);
}

.content-box h2 {
  font-size: 1.8rem;
  margin-top: 30px;
  color: var(--flame-yellow);
}

.content-box p, .content-box ul {
  margin-bottom: 20px;
  color: var(--text-secondary);
}

.content-box ul {
  padding-left: 20px;
  list-style: disc;
}

/* Footer */
.footer {
  background: var(--surface);
  padding: 60px 0 30px;
  border-top: 1px solid rgba(123, 44, 191, 0.3);
  position: relative;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 50px;
  margin-bottom: 50px;
}

.footer-brand p {
  margin-top: 20px;
  font-size: 0.95rem;
}

.footer-links h4 {
  color: var(--text-primary);
  margin-bottom: 20px;
  font-size: 1.2rem;
}

.footer-links ul li {
  margin-bottom: 12px;
}

.footer-links ul li a {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.footer-links ul li a:hover {
  color: var(--flame-yellow);
  padding-left: 5px;
}

.footer-legal {
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
}

.legal-badges {
  display: flex;
  gap: 15px;
}

.badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-legal p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  max-width: 800px;
}

/* Animations */
@keyframes core-flicker {
  0% { box-shadow: 0 0 40px rgba(251, 133, 0, 0.2), inset 0 0 20px rgba(255, 214, 10, 0.1); }
  50% { box-shadow: 0 0 60px rgba(251, 133, 0, 0.4), inset 0 0 30px rgba(255, 214, 10, 0.3); }
  100% { box-shadow: 0 0 45px rgba(251, 133, 0, 0.25), inset 0 0 25px rgba(255, 214, 10, 0.15); }
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Media Queries */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --spacing-desktop: var(--spacing-tablet);
  }
  
  .menu-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 80px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background: rgba(11, 2, 26, 0.98);
    backdrop-filter: blur(15px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: 0.4s ease;
  }

  .nav-links.active {
    left: 0;
  }

  .hero {
    padding-top: 100px;
  }

  .game-wrapper {
    width: 95%;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .content-box {
    padding: 30px 20px;
  }
}

@media (max-width: 480px) {
  :root {
    --spacing-desktop: var(--spacing-mobile);
    --spacing-tablet: var(--spacing-mobile);
  }

  .game-wrapper {
    width: 100%;
    border-radius: 0;
  }
  
  .game-container {
    border-radius: 0;
  }
}