/* =============================================
   TILLYPLAYFABL — ARCANE MAGE ELITE
   Design System & Complete Stylesheet
   ============================================= */

/* --- CSS VARIABLES --- */
:root {
  /* Base */
  --bg-primary: #020203;
  --bg-secondary: #0a0b12;
  --bg-tertiary: #0f1019;

  /* Glass */
  --glass-bg: rgba(255,255,255,0.05);
  --glass-bg-hover: rgba(255,255,255,0.08);
  --glass-border: rgba(255,255,255,0.08);
  --glass-border-hover: rgba(255,255,255,0.14);
  --glass-blur: 22px;
  --glass-overlay: linear-gradient(180deg, rgba(255,255,255,0.08), transparent);

  /* Accents */
  --accent-purple: linear-gradient(135deg, #7c3aed, #a855f7);
  --accent-blue: linear-gradient(135deg, #3b82f6, #22d3ee);
  --accent-spell: linear-gradient(135deg, #c084fc, #60a5fa);
  --purple-solid: #7c3aed;
  --purple-light: #a855f7;
  --blue-solid: #3b82f6;
  --cyan-solid: #22d3ee;

  /* Glows */
  --glow-purple: rgba(124, 58, 237, 0.45);
  --glow-blue: rgba(59, 130, 246, 0.35);
  --glow-magic: rgba(192, 132, 252, 0.4);

  /* Typography */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5f5;
  --text-muted: #6b7280;

  /* Font */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing */
  --section-gap: 120px;
  --container-max: 1280px;
  --container-narrow: 800px;

  /* Radius */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 28px;
  --radius-btn: 18px;

  /* Transitions */
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

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

.container-narrow {
  max-width: var(--container-narrow);
}

/* --- CURSOR GLOW --- */
.cursor-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s;
  opacity: 0;
}

.cursor-glow.active {
  opacity: 1;
}

/* --- FLOATING NAV --- */
.floating-nav {
  position: fixed;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
}

.nav-pill {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 10px;
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  position: relative;
}

.nav-pill::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(124,58,237,0.15), rgba(59,130,246,0.08), transparent);
  z-index: -1;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  padding: 1px;
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  color: var(--text-muted);
  transition: all 0.35s var(--ease-smooth);
  position: relative;
}

.nav-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 16px);
  top: 50%;
  transform: translateY(-50%) translateX(-8px);
  background: rgba(15,16,25,0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s var(--ease-smooth);
}

.nav-icon:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.nav-icon:hover {
  color: var(--text-primary);
  background: rgba(124,58,237,0.12);
  transform: translateY(-2px);
  box-shadow: 0 0 20px var(--glow-purple);
}

.nav-icon.active {
  color: var(--text-primary);
  background: rgba(124,58,237,0.2);
  box-shadow: 0 0 24px var(--glow-purple);
}

.nav-icon svg {
  transition: transform 0.35s var(--ease-spring);
}

.nav-icon:hover svg {
  transform: scale(1.15);
}

/* --- TOP BAR --- */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  background: rgba(2,2,3,0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--accent-purple);
  border-radius: 12px;
  font-size: 16px;
  box-shadow: 0 0 20px var(--glow-purple);
}

.logo-dot {
  color: var(--purple-light);
}

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-btn);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: all 0.35s var(--ease-smooth);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-purple);
  color: #fff;
  box-shadow: 0 4px 20px var(--glow-purple), inset 0 1px 0 rgba(255,255,255,0.15);
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--glass-overlay);
  pointer-events: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 36px var(--glow-purple), inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
}

.btn-glass::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--glass-overlay);
  pointer-events: none;
  border-radius: inherit;
}

.btn-glass:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(124,58,237,0.15);
}

.btn-glass:active {
  transform: translateY(0) scale(0.98);
}

.btn-lg {
  padding: 16px 36px;
  font-size: 15px;
}

.btn-sm {
  padding: 8px 18px;
  font-size: 13px;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

.btn-cast {
  padding: 10px 24px;
  font-size: 13px;
}

.btn-spark {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left 0.6s;
}

.btn:hover .btn-spark {
  left: 100%;
}

/* pulse on CTA */
@keyframes castPulse {
  0%, 100% { box-shadow: 0 4px 20px var(--glow-purple); }
  50% { box-shadow: 0 4px 36px var(--glow-purple), 0 0 60px rgba(124,58,237,0.2); }
}

.btn-cast {
  animation: castPulse 3s ease-in-out infinite;
}

/* --- HERO --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.5;
}

.hero-orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(124,58,237,0.35), transparent 70%);
  top: -10%;
  right: -5%;
  animation: orbFloat1 12s ease-in-out infinite;
}

.hero-orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(59,130,246,0.25), transparent 70%);
  bottom: -15%;
  left: -10%;
  animation: orbFloat2 15s ease-in-out infinite;
}

.hero-orb-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(192,132,252,0.2), transparent 70%);
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
  animation: orbFloat3 10s ease-in-out infinite;
}

@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(-40px, 30px); }
  66% { transform: translate(20px, -20px); }
}

@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(50px, -30px); }
}

@keyframes orbFloat3 {
  0%, 100% { transform: translateX(-50%) translate(0, 0); }
  50% { transform: translateX(-50%) translate(0, -40px); }
}

/* Runes */
.hero-runes {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

.rune {
  position: absolute;
  font-size: 28px;
  color: rgba(124,58,237,0.15);
  animation: runeFloat 20s linear infinite;
  pointer-events: none;
}

.rune-1 { top: 10%; left: 8%; animation-delay: 0s; animation-duration: 18s; }
.rune-2 { top: 20%; right: 12%; animation-delay: -3s; animation-duration: 22s; }
.rune-3 { top: 60%; left: 15%; animation-delay: -6s; animation-duration: 20s; }
.rune-4 { top: 75%; right: 20%; animation-delay: -9s; animation-duration: 16s; }
.rune-5 { top: 40%; left: 80%; animation-delay: -2s; animation-duration: 24s; }
.rune-6 { top: 85%; left: 45%; animation-delay: -4s; animation-duration: 19s; }
.rune-7 { top: 15%; left: 55%; animation-delay: -7s; animation-duration: 21s; }
.rune-8 { top: 50%; left: 30%; animation-delay: -11s; animation-duration: 17s; }

@keyframes runeFloat {
  0% { transform: translateY(0) rotate(0deg); opacity: 0.15; }
  25% { opacity: 0.3; }
  50% { transform: translateY(-30px) rotate(180deg); opacity: 0.15; }
  75% { opacity: 0.25; }
  100% { transform: translateY(0) rotate(360deg); opacity: 0.15; }
}

/* Hero Particles Canvas */
.hero-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 780px;
  padding: 0 24px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.badge-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--purple-light);
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(168,85,247,0.4); }
  50% { opacity: 0.7; box-shadow: 0 0 0 8px rgba(168,85,247,0); }
}

.hero-title {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 24px;
}

.hero-title-accent {
  background: var(--accent-spell);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 40px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.hero-ctas {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.hero-legal {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto;
}

/* Scroll Indicator */
.hero-scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(180deg, rgba(124,58,237,0.6), transparent);
  animation: scrollLine 2s ease-in-out infinite;
}

@keyframes scrollLine {
  0% { opacity: 0; transform: scaleY(0); transform-origin: top; }
  50% { opacity: 1; transform: scaleY(1); transform-origin: top; }
  100% { opacity: 0; transform: scaleY(1); transform-origin: bottom; }
}

/* --- SECTIONS --- */
.game-section,
.features-section,
.about-preview,
.cta-section {
  padding: var(--section-gap) 0;
  position: relative;
}

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

.section-tag {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--purple-light);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto;
}

/* --- GAME SECTION --- */
.game-wrapper {
  max-width: 1200px;
  margin: 0 auto;
}

.game-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.game-card-border {
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-lg);
  background: conic-gradient(from 0deg, rgba(124,58,237,0.4), rgba(59,130,246,0.3), rgba(192,132,252,0.3), rgba(124,58,237,0.4));
  z-index: 0;
  animation: borderGlow 6s linear infinite;
}

@keyframes borderGlow {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

.game-card-inner {
  position: relative;
  z-index: 1;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  margin: 1px;
  overflow: hidden;
}

.game-iframe-container {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-primary);
  position: relative;
}

.game-iframe-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.game-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  background: rgba(255,255,255,0.02);
  border-top: 1px solid var(--glass-border);
  gap: 16px;
  flex-wrap: wrap;
}

.game-name {
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-mono);
  margin-bottom: 2px;
}

.game-desc {
  font-size: 13px;
  color: var(--text-muted);
}

.game-actions {
  display: flex;
  gap: 10px;
}

/* Game card hover */
.game-card:hover .game-card-border {
  animation-duration: 3s;
}

.game-card {
  transition: transform 0.4s var(--ease-smooth), box-shadow 0.4s var(--ease-smooth);
}

.game-card:hover {
  transform: scale(1.01);
  box-shadow: 0 20px 80px rgba(124,58,237,0.15);
}

/* --- FEATURES --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  position: relative;
  overflow: hidden;
  transition: all 0.4s var(--ease-smooth);
}

.feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--glass-overlay);
  pointer-events: none;
}

.feature-card:hover {
  transform: translateY(-6px);
  border-color: var(--glass-border-hover);
  box-shadow: 0 16px 60px rgba(124,58,237,0.1);
  background: var(--glass-bg-hover);
}

.feature-card-lg {
  grid-column: span 1;
}

.feature-card-lg:first-child {
  grid-column: span 2;
  grid-row: span 1;
}

.feature-card-lg:last-child {
  grid-column: span 2;
  grid-row: span 1;
}

.feature-icon-wrap {
  margin-bottom: 20px;
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(124,58,237,0.1);
  color: var(--purple-light);
  transition: all 0.4s var(--ease-smooth);
}

.feature-card:hover .feature-icon {
  background: rgba(124,58,237,0.2);
  box-shadow: 0 0 30px var(--glow-purple);
  transform: scale(1.1);
}

.feature-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.feature-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* --- ABOUT PREVIEW --- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.about-content .section-tag {
  margin-bottom: 12px;
}

.about-content .section-title {
  text-align: left;
  margin-bottom: 24px;
}

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

.about-content .btn {
  margin-top: 12px;
}

.about-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-card-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 340px;
}

.about-float-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 28px 32px;
  text-align: center;
  transition: all 0.4s var(--ease-smooth);
  position: relative;
  overflow: hidden;
}

.about-float-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--glass-overlay);
  pointer-events: none;
}

.about-float-card:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--glass-border-hover);
  box-shadow: 0 12px 40px rgba(124,58,237,0.1);
}

.about-float-1 { animation: floatCard 6s ease-in-out infinite; }
.about-float-2 { animation: floatCard 6s ease-in-out 1s infinite; }
.about-float-3 { animation: floatCard 6s ease-in-out 2s infinite; }

@keyframes floatCard {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.about-stat-number {
  display: block;
  font-size: 36px;
  font-weight: 800;
  background: var(--accent-spell);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
}

.about-stat-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- CTA SECTION --- */
.cta-card {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 80px 40px;
  text-align: center;
  overflow: hidden;
}

.cta-glow {
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 400px;
  background: radial-gradient(circle, rgba(124,58,237,0.15), transparent 70%);
  pointer-events: none;
}

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

.cta-title {
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.cta-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  margin-bottom: 36px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* --- FOOTER --- */
.footer {
  border-top: 1px solid var(--glass-border);
  padding: 80px 0 40px;
  background: var(--bg-secondary);
}

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

.footer-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 16px;
  line-height: 1.7;
  max-width: 340px;
}

.footer-age {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 2px solid var(--glass-border);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-muted);
  margin-top: 16px;
}

.footer-heading {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color 0.3s;
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  border-top: 1px solid var(--glass-border);
  padding-top: 32px;
  text-align: center;
}

.footer-legal {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.footer-copy {
  font-size: 13px;
  color: var(--text-muted);
}

/* --- MOBILE NAV --- */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10,11,18,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  padding: 8px 0;
  padding-bottom: env(safe-area-inset-bottom, 8px);
}

.mobile-nav {
  display: none;
  grid-template-columns: repeat(4, 1fr);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.3s;
}

.mobile-nav-item.active {
  color: var(--purple-light);
}

.mobile-nav-item:hover {
  color: var(--text-primary);
}

/* --- PAGE HERO --- */
.page-hero {
  padding: 160px 0 80px;
  text-align: center;
  position: relative;
  background: radial-gradient(ellipse at center top, rgba(124,58,237,0.08), transparent 60%);
}

.page-hero-content {
  max-width: 640px;
  margin: 0 auto;
}

.page-title {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 16px;
}

.page-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
}

/* --- CONTENT PAGES --- */
.content-section {
  padding: 0 0 var(--section-gap);
}

.content-block {
  margin-bottom: 48px;
}

.content-block h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.content-block p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 12px;
}

.content-block a {
  color: var(--purple-light);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.content-block a:hover {
  color: var(--text-primary);
}

.content-list {
  padding-left: 0;
  margin: 16px 0;
}

.content-list li {
  position: relative;
  padding-left: 24px;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 8px;
}

.content-list li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: var(--purple-light);
  font-size: 10px;
  top: 4px;
}

.highlight-box {
  background: rgba(124,58,237,0.08);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: var(--radius-md);
  padding: 24px 28px;
}

.highlight-box p {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0;
}

/* --- CONTACT FORM --- */
.contact-form-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
}

.contact-form-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--glass-overlay);
  pointer-events: none;
}

.contact-form {
  position: relative;
  z-index: 1;
}

.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.form-input {
  width: 100%;
  padding: 14px 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  font-family: var(--font-main);
  transition: all 0.3s var(--ease-smooth);
  outline: none;
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:focus {
  border-color: rgba(124,58,237,0.5);
  box-shadow: 0 0 0 4px rgba(124,58,237,0.1);
  background: rgba(255,255,255,0.06);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-success {
  text-align: center;
  padding: 40px 20px;
  position: relative;
  z-index: 1;
}

.success-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
  background: var(--accent-spell);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.form-success h3 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.form-success p {
  color: var(--text-secondary);
}

/* --- MODAL --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(2,2,3,0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.35s var(--ease-smooth);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  max-width: 560px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: all 0.4s var(--ease-spring);
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--glass-border);
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 24px;
  color: var(--text-muted);
  transition: all 0.3s;
  background: var(--glass-bg);
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--glass-bg-hover);
}

.modal-body {
  padding: 24px 28px 32px;
}

.modal-step {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 12px;
  background: rgba(124,58,237,0.12);
  color: var(--purple-light);
  font-size: 14px;
  font-weight: 700;
}

.modal-step h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.modal-step p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal-note {
  background: rgba(124,58,237,0.06);
  border: 1px solid rgba(124,58,237,0.15);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-top: 8px;
}

.modal-note p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* --- ANIMATIONS --- */
.animate-fade-in {
  opacity: 0;
  transform: translateY(24px);
  animation: fadeInUp 0.8s var(--ease-smooth) forwards;
}

.delay-1 { animation-delay: 0.15s; }
.delay-2 { animation-delay: 0.3s; }
.delay-3 { animation-delay: 0.45s; }
.delay-4 { animation-delay: 0.6s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s var(--ease-smooth), transform 0.7s var(--ease-smooth);
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger for grid children */
.features-grid .animate-on-scroll:nth-child(1) { transition-delay: 0.05s; }
.features-grid .animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.features-grid .animate-on-scroll:nth-child(3) { transition-delay: 0.15s; }
.features-grid .animate-on-scroll:nth-child(4) { transition-delay: 0.2s; }
.features-grid .animate-on-scroll:nth-child(5) { transition-delay: 0.25s; }

/* Glass shimmer */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* --- RESPONSIVE --- */

/* Tablet */
@media (max-width: 1024px) {
  :root {
    --section-gap: 80px;
  }

  .floating-nav {
    display: none;
  }

  .mobile-nav {
    display: grid;
  }

  body {
    padding-bottom: 72px;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .feature-card-lg:first-child,
  .feature-card-lg:last-child {
    grid-column: span 2;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .about-content .section-title {
    text-align: center;
  }

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

  .about-visual {
    order: -1;
  }

  .about-card-stack {
    flex-direction: row;
    max-width: none;
  }

  .about-float-card {
    flex: 1;
  }

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

  .footer-brand {
    grid-column: span 2;
  }
}

/* Mobile */
@media (max-width: 640px) {
  :root {
    --section-gap: 60px;
  }

  .top-bar {
    padding: 16px 20px;
  }

  .hero-title {
    font-size: 36px;
  }

  .hero-ctas {
    flex-direction: column;
    align-items: center;
  }

  .hero-ctas .btn {
    width: 100%;
    max-width: 320px;
    justify-content: center;
  }

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

  .feature-card-lg:first-child,
  .feature-card-lg:last-child {
    grid-column: span 1;
  }

  .about-card-stack {
    flex-direction: column;
  }

  .game-controls {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
  }

  .game-actions {
    width: 100%;
  }

  .game-actions .btn {
    flex: 1;
    justify-content: center;
  }

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

  .footer-brand {
    grid-column: span 1;
  }

  .cta-card {
    padding: 48px 24px;
  }

  .contact-form-card {
    padding: 32px 24px;
  }

  .section-header {
    margin-bottom: 40px;
  }
}

/* Very small */
@media (max-width: 380px) {
  .hero-title {
    font-size: 30px;
  }

  .section-title {
    font-size: 28px;
  }
}

/* Large screens - show floating nav */
@media (min-width: 1025px) {
  .mobile-nav {
    display: none !important;
  }
}

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

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: rgba(124,58,237,0.3);
  border-radius: 100px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(124,58,237,0.5);
}

/* Selection */
::selection {
  background: rgba(124,58,237,0.3);
  color: var(--text-primary);
}