/* Landing Page Redesign - Full Screen Non-Scrollable Layout */

/* ===== RESET & BASE STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== SPACING SCALE ===== */
:root {
  /* Consistent spacing scale */
  --space-xs: 0.25rem;   /* 4px */
  --space-sm: 0.5rem;    /* 8px */
  --space-md: 1rem;      /* 16px */
  --space-lg: 1.5rem;    /* 24px */
  --space-xl: 2rem;      /* 32px */
  --space-2xl: 3rem;     /* 48px */
  --space-3xl: 4rem;     /* 64px */
  
  /* Container max widths */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
}

/* Explicitly set heights on all parent containers for consistent centering */
html {
  width: 100%;
  height: 100%;
  /* Use percentage instead of 100vh for root element */
  overflow: hidden;
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  /* Safari/iOS specific height fix */
  height: -webkit-fill-available;
}

body {
  width: 100%;
  height: 100%;
  /* Use percentage to inherit from html */
  overflow: hidden; /* Prevent scrolling */
  font-family: inherit;
  color: #ffffff;
  background-color: transparent; /* Allow background image to show through */

  /* Use CSS custom property for dynamic viewport height */
  --actual-vh: 100vh; /* Fallback for browsers that don't support custom properties */
  --dynamic-vh: var(--vh, 1vh); /* Will be set by JavaScript */

  /* Safari/iOS specific height fix */
  min-height: 100%;
  min-height: -webkit-fill-available;
}

/* ===== FULL SCREEN BACKGROUND ===== */
.landing-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Use consistent viewport height across browsers */
  height: calc(var(--dynamic-vh, 1vh) * 100);

  /* NO background here - moved to pseudo-element for Safari fix */

  /* Vendor prefixes for maximum compatibility */
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  
  /* Flex direction with vendor prefixes */
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -moz-box-orient: vertical;
  -moz-box-direction: normal;
  -webkit-flex-direction: column;
  -ms-flex-direction: column;
  flex-direction: column;
  
  /* Justify content with vendor prefixes */
  -webkit-box-pack: center;
  -moz-box-pack: center;
  -ms-flex-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  
  /* Align items with vendor prefixes */
  -webkit-box-align: center;
  -moz-box-align: center;
  -ms-flex-align: center;
  -webkit-align-items: center;
  align-items: center;
  
  z-index: 1;

  /* Ensure minimum height consistency */
  min-height: 100%;
  min-height: calc(var(--dynamic-vh, 1vh) * 100);

  /* Safari/iOS specific viewport height fix */
  min-height: -webkit-fill-available;
}

/* Dynamic viewport height support */
.viewport-calculated {
  --vh: calc(var(--actual-vh) / 100);
  --vw: calc(100vw / 100);
}

/* Force repaint class for viewport updates */
.force-repaint {
  transform: translateZ(0);
}

/* Universal Background Fill Solution */
.background-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  z-index: -2;
  /* Removed gradient background to show image */
  background-color: transparent; /* Ensure transparency for image visibility */
  min-width: 100vw;
  min-height: 100vh;
}

.background-image {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  font-size: 0;
  color: transparent;
  transform: translateZ(0);
  will-change: transform;
  transition: opacity 0.3s ease-in-out;
  opacity: 1; /* Ensure image is visible */
  z-index: -1; /* Ensure proper layering */
}

/* Fading transition class for background switching */
.background-image.fading-out {
  opacity: 0;
}

/* Smooth transitions for background image switching */
.background-image {
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

/* Mobile viewport unit correction - iOS Safari */
@supports (-webkit-touch-callout: none) {
  .background-container {
    height: -webkit-fill-available;
  }
}

/* Additional mobile fixes */
@media (max-width: 768px) {
  .background-container {
    /* Ensure full coverage on mobile */
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: -webkit-fill-available;
  }

  .background-image {
    /* Mobile-specific background image handling */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;

    /* Force hardware acceleration for mobile */
    transform: translateZ(0);
    will-change: transform;
  }

  /* Mobile portrait specific adjustments */
  .background-image.portrait {
    object-fit: cover;
    object-position: center;
    /* Ensure portrait images cover full mobile screen */
    width: 100%;
    height: 100%;
  }

  /* Mobile landscape specific adjustments */
  .background-image.landscape {
    object-fit: cover;
    object-position: center;
  }
}

/* Mobile portrait mode specific optimizations - HIGH PRIORITY */
@media (max-width: 768px) and (orientation: portrait) {
  .background-image.portrait.mobile {
    /* Ensure portrait images cover full screen in mobile portrait mode */
    object-fit: cover !important;
    object-position: center !important;
    width: 100% !important;
    height: 100% !important;
    transform: none !important;
    display: block !important;
  }
  
  /* Hide landscape images in mobile portrait mode */
  .background-image.landscape.mobile {
    display: none !important;
  }
}

/* Additional mobile portrait detection for devices that don't report orientation correctly */
@media (max-width: 768px) and (max-aspect-ratio: 1/1) {
  .background-image.portrait.mobile {
    object-fit: cover !important;
    object-position: center !important;
    width: 100% !important;
    height: 100% !important;
    transform: none !important;
    display: block !important;
  }
  
  .background-image.landscape.mobile {
    display: none !important;
  }
}

/* Mobile landscape mode specific optimizations - HIGH PRIORITY */
@media (max-width: 768px) and (orientation: landscape) {
  .background-image.landscape.mobile {
    /* Ensure landscape images cover full screen in mobile landscape mode */
    object-fit: cover !important;
    object-position: center !important;
    width: 100% !important;
    height: 100% !important;
    transform: none !important;
  }
  
  /* Hide portrait images in mobile landscape mode */
  .background-image.portrait.mobile {
    display: none;
  }
}

/* Enhanced mobile detection - also include user-agent based detection */
@media (max-width: 1024px) and (pointer: coarse) {
  /* This catches mobile devices and tablets */
  .background-image.portrait.mobile {
    object-fit: cover !important;
    object-position: center !important;
    width: 100% !important;
    height: 100% !important;
    transform: none !important;
  }
  
  .background-image.landscape.mobile {
    object-fit: cover !important;
    object-position: center !important;
    width: 100% !important;
    height: 100% !important;
    transform: none !important;
  }
}

/* Responsive background image handling */
.background-image.portrait {
  object-fit: cover;
  object-position: center;
}

.background-image.landscape {
  object-fit: cover;
  object-position: center;
}

/* Special handling for ultra-wide screens */
@media (min-aspect-ratio: 21/9) {
  .background-image.landscape {
    object-fit: cover;
    object-position: center;
  }
}

/* Special handling for very tall/narrow screens */
@media (max-aspect-ratio: 9/16) {
  .background-image.portrait {
    object-fit: cover;
    object-position: center;
  }
}

/* Aspect ratio-based responsive handling - matches JavaScript logic */
@media (max-aspect-ratio: 1.2/1) {
  /* For half-screen and narrow aspect ratios (< 1.2), ensure portrait images work well */
  .background-image.portrait {
    object-fit: cover !important;
    object-position: center center !important;
    transform: none !important;
  }
  
  /* Hide any scaling on landscape images in narrow aspect ratios */
  .background-image.landscape {
    object-fit: cover !important;
    object-position: center center !important;
  }
}

/* Broader narrow window support */
@media (max-aspect-ratio: 1.4/1) {
  /* For narrow aspect ratios (< 1.4), ensure portrait images work well */
  .background-image.portrait {
    object-fit: cover !important;
    object-position: center center !important;
    transform: none !important;
  }
}

/* Desktop specific optimizations */
@media (min-width: 1024px) {
  .background-image {
    /* Better performance for desktop */
    transform: none;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
}

/* Ensure background always covers viewport to eliminate edges */
@media all {
  .background-image {
    object-fit: cover !important;
    width: 100% !important;
    height: 100% !important;
  }
}

/* Medium window adjustments (between narrow and wide) */
.background-image.landscape.desktop.medium-window {
  /* Smart scaling for medium-width windows (900-1400px) */
  object-fit: cover;
  object-position: center;
  transform: scale(calc(min(1, 1400 / 100vw)));
  transform-origin: center center;
}

/* Narrow window adjustments (split screen) - Enhanced with dynamic scaling */
@media (max-width: 1400px) {
  .background-container {
    /* Remove padding since portrait mode handles visibility */
    padding: 0;
    box-sizing: border-box;
  }
  
  /* Dynamic scaling for narrow desktop windows to prevent text cutoff */
  .background-image.landscape:not(.medium-window) {
    /* Scale down landscape images on narrow windows to fit content */
    transform: scale(calc(100vw / 1400));
    transform-origin: center center;
    object-fit: cover;
    object-position: center;
  }
  
  /* Portrait image will be used automatically via JavaScript */
  .background-image.portrait {
    object-fit: cover;
    object-position: center;
  }
}

/* Medium window responsive handling - matches JavaScript logic */
@media (min-width: 769px) and (max-width: 1199px) {
  .background-image.landscape.desktop {
    /* Responsive scaling for split-screen and medium windows */
    object-fit: cover;
    object-position: center center;
    transform: scale(calc(min(1, max(0.7, 1200 / 100vw))));
    transform-origin: center center;
  }
  
  .background-image.portrait.desktop {
    /* Ensure portrait works well in split-screen scenarios */
    object-fit: cover !important;
    object-position: center center !important;
    transform: none !important;
  }
}

/* Additional scaling for very narrow windows */
@media (max-width: 1200px) {
  .background-image.landscape:not(.medium-window) {
    /* More aggressive scaling for very narrow windows */
    transform: scale(calc(100vw / 1200));
    transform-origin: center center;
  }
}

/* Ultra-narrow window scaling */
@media (max-width: 1000px) {
  .background-image.landscape {
    /* Maximum scaling to ensure text is always visible */
    transform: scale(calc(100vw / 1000));
    transform-origin: center center;
  }
}

/* Ensure background covers viewport with narrow-window class */
.background-image.narrow-window {
  /* Use cover to eliminate edges */
  object-fit: cover !important;
  transform: scale(1) !important;
  object-position: center center !important;
}

/* Portrait mode in narrow windows - optimized for half-screen and split-screen */
.background-image.portrait.narrow-window {
  object-fit: cover !important;
  width: 100% !important;
  height: 100% !important;
  transform: none !important;
  object-position: center center !important;
  /* Ensure portrait images fill narrow windows properly */
  min-width: 100%;
  min-height: 100%;
}

/* Mobile portrait orientation */
.background-image.portrait.mobile {
  object-fit: cover !important;
  width: 100% !important;
  height: 100% !important;
}

/* Mobile landscape orientation */
.background-image.landscape.mobile {
  object-fit: cover !important;
  width: 100% !important;
  height: 100% !important;
}

/* Ensure z-index hierarchy */
.landing-container {
  position: relative;
  z-index: 1;
}

/* Background overlay for better text readability */
.background-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: transparent;
  z-index: -1;
  pointer-events: none;
}

/* Enhanced Purple glow effect - moved to overlay */
.background-overlay::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100vmax;
  height: 100vmax;
  background: radial-gradient(
    circle at center,
    rgba(147, 51, 234, 0.35) 0%,
    rgba(139, 48, 220, 0.30) 5%,
    rgba(130, 45, 206, 0.25) 10%,
    rgba(122, 42, 192, 0.20) 15%,
    rgba(113, 39, 178, 0.15) 20%,
    rgba(105, 36, 164, 0.12) 25%,
    rgba(96, 33, 150, 0.09) 30%,
    rgba(88, 30, 136, 0.06) 35%,
    rgba(79, 27, 122, 0.04) 40%,
    rgba(71, 24, 108, 0.02) 45%,
    transparent 55%
  );
  pointer-events: none;
  z-index: 0;
  animation: enhancedPulseGlow 8s ease-in-out infinite;
}

/* Additional purple ambient glow layer */
.background-overlay::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80vmax;
  height: 80vmax;
  background: radial-gradient(
    circle at center,
    rgba(92, 0, 153, 0.20) 0%,
    rgba(92, 0, 153, 0.17) 8%,
    rgba(92, 0, 153, 0.14) 16%,
    rgba(92, 0, 153, 0.11) 24%,
    rgba(92, 0, 153, 0.08) 32%,
    rgba(92, 0, 153, 0.05) 40%,
    rgba(92, 0, 153, 0.02) 48%,
    transparent 60%
  );
  pointer-events: none;
  z-index: 1;
  animation: ambientPulse 10s ease-in-out infinite reverse;
}

@keyframes enhancedPulseGlow {
  0%, 100% {
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(1);
  }
  25% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(1.02);
  }
  50% {
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(1.04);
  }
  75% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(1.02);
  }
}

@keyframes ambientPulse {
  0%, 100% {
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(1);
  }
  33% {
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(1.03);
  }
  66% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(1.05);
  }
}

/* Legacy keyframe for compatibility */
@keyframes pulseGlow {
  0%, 100% {
    opacity: 0.3;
    transform: translate(-50%, -50%) scale(0.9);
  }
  50% {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(1.1);
  }
}

/* ===== HERO NAVIGATION ===== */
.hero-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 30;
  /* Equal spacing from top and right - increased top padding for visual balance */
  padding: calc(var(--space-xl) + var(--space-sm)) var(--space-xl) var(--space-xl) var(--space-xl);
  background: transparent;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
}

.nav-links {
  display: flex;
  gap: var(--space-2xl);
  align-items: center;
  height: 100%;
}

.nav-link {
  color: #ffffff;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  opacity: 0.9;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: #594461;
  transition: width 0.3s ease;
}

.nav-link:hover {
  opacity: 1;
  color: #594461;
}

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

.nav-contact-btn {
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.1) 0%, 
    rgba(255, 255, 255, 0.05) 100%);
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  border: 1px solid rgba(89, 68, 97, 0.3);
  color: #ffffff;
  padding: 0.75rem 2rem;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 
    0 4px 16px 0 rgba(31, 38, 135, 0.2),
    inset 0 1px 1px rgba(255, 255, 255, 0.1);
  z-index: 31;
  pointer-events: auto !important;
}

.nav-contact-btn:hover {
  background: #594461;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 0 15px rgba(89, 68, 97, 0.3), 0 0 25px rgba(89, 68, 97, 0.2);
}

.nav-contact-btn:active {
  transform: translateY(0);
}

/* ===== MAIN CONTENT ===== */
.main-content {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: var(--space-xl);
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ===== ACTION AREA ===== */
.action-area {
  position: absolute !important;
  bottom: 0 !important;
  left: 0;
  right: 0;
  z-index: 20;
  
  /* Enhanced padding for better bottom spacing */
  padding-left: var(--space-xl);
  padding-right: var(--space-xl);
  padding-bottom: calc(var(--space-2xl) + env(safe-area-inset-bottom, 0));
  
  /* Perfect flexbox centering for 5 icons */
  display: flex !important;
  justify-content: center !important;
  align-items: center;
  
  /* Enhanced spacing between icons */
  gap: calc(var(--space-lg) + var(--space-sm)); /* 24px + 8px = 32px between icons */
  
  width: 100%;
  pointer-events: none;
  
  /* Ensure icons stay in a single row */
  flex-wrap: nowrap;
  
  /* Additional centering insurance */
  text-align: center;
}

/* Ensure children are clickable */
.action-area > * {
  pointer-events: auto !important;
}

/* Removed unused .contact-btn and .contact-btn-outline classes (HTML uses .nav-contact-btn instead) */

/* Remove duplicate action-area styles */

/* Remove action area pseudo-elements */

.social-link {
  /* Fixed size for consistency */
  width: 52px;
  height: 52px;
  
  /* Modern flexbox centering */
  display: flex;
  align-items: center;
  justify-content: center;
  
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 50%;
  color: #ffffff;
  font-size: 1.3rem;
  transition: all 0.3s ease;
  text-decoration: none;
  position: relative;
  overflow: hidden;

  /* Improve mobile interaction */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;

  /* Ensure consistent appearance across browsers */
  box-sizing: border-box;
  
  /* Remove margin - spacing handled by parent gap */
  margin: 0;
  
  /* Reset any inherited styles */
  float: none;
  clear: none;
  padding: 0;
  
  /* Explicit cursor pointer for better UX */
  cursor: pointer;
  /* Ensure proper cursor detection */
  pointer-events: auto;
  /* Force hardware acceleration for better cursor detection */
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
}

.social-link::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(89, 68, 97, 0.4) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: all 0.3s ease;
  pointer-events: none;
  border-radius: 50%;
}

.social-link:hover {
  background: rgba(89, 68, 97, 0.9);
  border-color: rgba(89, 68, 97, 1);
  transform: translateY(-2px);
  color: #ffffff;
}

.social-link:hover::before {
  width: 120%;
  height: 120%;
  box-shadow: 0 0 15px rgba(89, 68, 97, 0.5), 0 0 30px rgba(89, 68, 97, 0.3);
}

/* Policies Button - Circle design matching social links */
.policies-btn {
  /* Fixed size for consistency */
  width: 52px;
  height: 52px;
  
  /* Modern flexbox centering */
  display: flex;
  align-items: center;
  justify-content: center;
  
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 50%;
  color: #ffffff;
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  /* Ensure policies button is always visible */
  opacity: 1;
  visibility: visible;
  /* Ensure proper cursor detection */
  pointer-events: auto !important;
  /* Force hardware acceleration for better cursor detection */
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  
  /* Remove margin - spacing handled by parent gap */
  margin: 0;
  padding: 0;
  
  /* Reset any inherited styles */
  float: none;
  clear: none;
  font-family: "Font Awesome 6 Free", sans-serif;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  box-sizing: border-box;
  flex-shrink: 0;
  flex-grow: 0;
  z-index: 21;
}

.policies-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(89, 68, 97, 0.4) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: all 0.3s ease;
  pointer-events: none;
  border-radius: 50%;
}

.policies-btn:hover {
  background: rgba(89, 68, 97, 0.9);
  border-color: rgba(89, 68, 97, 1);
  transform: translateY(-2px);
  color: #ffffff;
}

.policies-btn:hover::before {
  width: 120%;
  height: 120%;
  box-shadow: 0 0 15px rgba(89, 68, 97, 0.5), 0 0 30px rgba(89, 68, 97, 0.3);
}

/* ===== MODAL STYLES ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 10, 0.95);
  /* backdrop-filter removed for clearer view */
  
  /* Vendor prefixes for maximum compatibility */
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  
  /* Justify content with vendor prefixes */
  -webkit-box-pack: center;
  -moz-box-pack: center;
  -ms-flex-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  
  /* Align items with vendor prefixes */
  -webkit-box-align: center;
  -moz-box-align: center;
  -ms-flex-align: center;
  -webkit-align-items: center;
  align-items: center;
  
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  /* Ensure modal doesn't interfere with cursor detection on child elements */
  cursor: default;
  /* Prevent modal backdrop from interfering with child element cursor detection */
  pointer-events: auto;
}

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

.modal-content {
  background: linear-gradient(135deg,
    rgba(26, 16, 51, 0.95) 0%,
    rgba(26, 16, 51, 0.9) 100%);
  /* backdrop-filter removed - solid background instead */
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 2.5rem;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 
    0 20px 60px rgba(31, 38, 135, 0.4),
    inset 0 1px 2px rgba(255, 255, 255, 0.1),
    inset 0 -1px 2px rgba(0, 0, 0, 0.2);
  transform: scale(0.9);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  /* Ensure content is properly layered */
  z-index: 1001;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
  opacity: 1;
}

/* Close Button */
.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  background: rgba(89, 68, 97, 0.3);
  border: 1px solid rgba(89, 68, 97, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: #ffffff;
  font-size: 1.5rem;
  line-height: 1;
  font-weight: 300;
  font-family: "Inter", sans-serif;
  text-align: center;
  padding: 0;
  padding-bottom: 2px;
  margin: 0;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  transform-origin: center center;
  transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-sizing: border-box;
  z-index: 1010;
  /* Improve touch target for mobile */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  /* Ensure cursor is always visible */
  pointer-events: auto;
  /* Force hardware acceleration for better cursor detection */
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
}

.modal-close:hover {
  background: rgba(89, 68, 97, 0.5);
  border-color: rgba(89, 68, 97, 0.6);
  transform: rotate(180deg);
  box-shadow: 0 2px 10px rgba(89, 68, 97, 0.25);
}

.modal-close:active,
.modal-close:focus {
  background: rgba(89, 68, 97, 0.6);
  border-color: rgba(89, 68, 97, 0.7);
  transform: rotate(180deg) scale(0.95);
  box-shadow: 0 0 0 2px rgba(89, 68, 97, 0.2);
}

/* Mobile-specific close button improvements */
@media (max-width: 768px) {
  .modal-close {
    width: 48px;
    height: 48px;
    top: 1rem;
    right: 1rem;
    font-size: 1.6rem;
  }
}

/* Contact Form Styles */
.contact-form {
  /* Vendor prefixes for maximum compatibility */
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  
  /* Flex direction with vendor prefixes */
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -moz-box-orient: vertical;
  -moz-box-direction: normal;
  -webkit-flex-direction: column;
  -ms-flex-direction: column;
  flex-direction: column;
  
  gap: var(--space-lg);
  /* Ensure form is properly positioned */
  position: relative;
  z-index: 1003;
}

.contact-form h2 {
  font-size: 2rem;
  margin-bottom: var(--space-md);
  color: #ffffff;
  text-align: center;
}

.form-group {
  /* Vendor prefixes for maximum compatibility */
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  
  /* Flex direction with vendor prefixes */
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -moz-box-orient: vertical;
  -moz-box-direction: normal;
  -webkit-flex-direction: column;
  -ms-flex-direction: column;
  flex-direction: column;
  
  gap: var(--space-sm);
  /* Ensure form groups are properly positioned */
  position: relative;
  z-index: 1004;
  /* Prevent any overlapping */
  margin-bottom: 0.5rem;
}

.form-group label {
  color: #b8b8b8;
  font-size: 0.875rem;
  font-weight: 500;
}

.form-input,
.form-textarea {
  background: rgba(10, 10, 10, 0.6);
  border: 1px solid rgba(89, 68, 97, 0.3);
  border-radius: 8px;
  padding: 1rem;
  color: #ffffff;
  font-size: 1rem;
  transition: all 0.3s ease;
  font-family: inherit;
  position: relative;
  z-index: 1005;
  cursor: text !important;
  /* Ensure proper cursor detection */
  pointer-events: auto !important;
  /* Fix for clickability */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  /* Force layer creation */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  /* Ensure inputs are interactive */
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  /* Remove any tap highlight on mobile */
  -webkit-tap-highlight-color: transparent;
  /* Ensure inputs are above any overlays */
  isolation: isolate;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: rgba(89, 68, 97, 0.6);
  background: rgba(10, 10, 10, 0.8);
  box-shadow: 0 0 10px rgba(89, 68, 97, 0.15);
  caret-color: #594461;
  z-index: 1006;
  position: relative;
  cursor: text !important;
  /* Ensure cursor remains visible during focus */
  pointer-events: auto !important;
}

/* Enhanced cursor styling for better visibility */
.form-input,
.form-textarea {
  caret-color: rgba(89, 68, 97, 0.8);
}

/* Fix for input hover and click issues */
.form-input:hover,
.form-textarea:hover {
  cursor: text !important;
  border-color: rgba(89, 68, 97, 0.4);
}

/* Specific fix for form elements in modal */
.modal-overlay.active .form-input,
.modal-overlay.active .form-textarea {
  pointer-events: auto !important;
  cursor: text !important;
}

.modal-overlay.active .form-submit {
  pointer-events: auto !important;
  cursor: pointer !important;
}

/* Ensure labels don't interfere */
.form-group label {
  pointer-events: auto;
  user-select: none;
  cursor: default;
  margin-bottom: 0.5rem;
  display: block;
}

/* Fix any potential dead zones in form inputs */
.modal-content .form-input,
.modal-content .form-textarea {
  position: relative;
  z-index: 1006;
  width: 100%;
  box-sizing: border-box;
  pointer-events: auto !important;
  cursor: text !important;
  /* Remove any transforms that might cause issues */
  transform: none !important;
  /* Ensure clickable area fills the entire input */
  margin: 0;
  display: block;
}

/* Ensure form submit button doesn't overlap */
.contact-form .form-submit {
  margin-top: 1.5rem;
  position: relative;
  z-index: 1007;
}

/* Remove any potential overlays */
.form-input::before,
.form-input::after,
.form-textarea::before,
.form-textarea::after {
  display: none !important;
}

/* Blinking cursor animation - Desktop only to avoid mobile conflicts */
@media (hover: hover) and (pointer: fine) {
  .form-input:focus,
  .form-textarea:focus {
    animation: textCursorBlink 1s infinite;
  }

  @keyframes textCursorBlink {
    0%,
    50% {
      caret-color: #594461;
    }
    51%,
    100% {
      caret-color: transparent;
    }
  }
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
  /* Fix dead zones */
  width: 100%;
  box-sizing: border-box;
  display: block;
}

/* Placeholder text styling */
.form-input::placeholder,
.form-textarea::placeholder {
  color: rgba(184, 184, 184, 0.6);
  transition: all 0.3s ease;
}

/* Desktop placeholder animations */
@media (hover: hover) and (pointer: fine) {
  .form-input:focus::placeholder,
  .form-textarea:focus::placeholder {
    color: rgba(89, 68, 97, 0.5);
    transform: translateX(4px);
  }
}

/* Mobile placeholder - no transform to avoid shifting */
@media (hover: none) and (pointer: coarse) {
  .form-input:focus::placeholder,
  .form-textarea:focus::placeholder {
    color: rgba(89, 68, 97, 0.5);
    opacity: 0.7;
  }
}

.form-submit {
  background: linear-gradient(135deg, #594461 0%, #3d3341 100%);
  border: none;
  color: white;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1rem;
  /* Ensure proper cursor detection */
  pointer-events: auto;
  /* Force hardware acceleration for better cursor detection */
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  /* Improve z-index to prevent conflicts */
  position: relative;
  z-index: 1002;
}

.form-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(89, 68, 97, 0.25);
}

/* Policies Modal Styles */
.policies-modal .modal-content {
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
}

/* Back to Home Button */
.back-to-home-btn {
  background: linear-gradient(135deg, #594461 0%, #3d3341 100%);
  border: none;
  color: white;
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 3rem;
  margin-bottom: 2rem;
  
  /* Vendor prefixes for maximum compatibility */
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  
  /* Align items with vendor prefixes */
  -webkit-box-align: center;
  -moz-box-align: center;
  -ms-flex-align: center;
  -webkit-align-items: center;
  align-items: center;
  
  /* Justify content with vendor prefixes */
  -webkit-box-pack: center;
  -moz-box-pack: center;
  -ms-flex-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  
  gap: 0.5rem;
  width: 100%;
  box-shadow: 0 4px 12px rgba(89, 68, 97, 0.2);
}

.back-to-home-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(89, 68, 97, 0.3);
}

.back-to-home-btn:active {
  transform: translateY(0);
}

.policies-nav {
  /* Vendor prefixes for maximum compatibility */
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  
  /* Ensure horizontal alignment */
  -webkit-box-orient: horizontal;
  -webkit-box-direction: normal;
  -moz-box-orient: horizontal;
  -moz-box-direction: normal;
  -webkit-flex-direction: row;
  -ms-flex-direction: row;
  flex-direction: row;
  
  /* Center items */
  -webkit-box-align: center;
  -moz-box-align: center;
  -ms-flex-align: center;
  -webkit-align-items: center;
  align-items: center;
  
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(89, 68, 97, 0.3);
}

.policy-nav-btn {
  background: transparent;
  border: 1px solid rgba(89, 68, 97, 0.3);
  color: #b8b8b8;
  padding: 0.5rem 1.5rem;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.875rem;
}

.policy-nav-btn:hover,
.policy-nav-btn.active {
  background: rgba(89, 68, 97, 0.2);
  border-color: rgba(89, 68, 97, 0.6);
  color: #ffffff;
}

.policy-content {
  color: #e0e0e0;
  line-height: 1.6;
  max-height: 60vh;
  overflow-y: auto;
  padding: 1rem;
  background: rgba(10, 10, 10, 0.3);
  border-radius: 8px;
  border: 1px solid rgba(89, 68, 97, 0.2);
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Force visibility class for CSP compliance */
.policy-content-visible {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Error message styling for policy content */
.policy-error-message {
  text-align: center;
  padding: 2rem;
  color: #ff6b6b;
}

.policy-error-message h2 {
  color: #ff6b6b;
  font-weight: bold;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.policy-error-message p {
  margin-bottom: 1rem;
  color: #e0e0e0;
}

.policy-debug-info {
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: 4px;
  padding: 1rem;
  margin: 1rem 0;
  text-align: left;
}

.policy-debug-info p {
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.policy-debug-info ul {
  margin-left: 1rem;
  color: #ffcccc;
}

.policy-debug-info li {
  margin-bottom: 0.25rem;
}

.policy-content h2 {
  color: #ffffff;
  margin-bottom: 1rem;
  margin-top: 1.5rem;
  font-size: 1.75rem;
}

.policy-content h3 {
  color: #ffffff;
  margin-bottom: 1rem;
  margin-top: 1.25rem;
  font-size: 1.5rem;
}

.policy-content p {
  margin-bottom: 1rem;
}

.policy-content ul {
  margin-left: 2rem;
  margin-bottom: 1rem;
}

.policy-content li {
  margin-bottom: 0.5rem;
}

/* Legal section styling from policy pages */
.legal-section {
  margin-bottom: 2rem;
}

.legal-section h2 {
  color: #ffffff;
  margin-bottom: 1rem;
  font-size: 1.75rem;
  font-weight: 600;
}

.legal-section h3 {
  color: #e0e0e0;
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
  font-weight: 500;
}

/* Scrollbar styling for policy content */
.policy-content::-webkit-scrollbar {
  width: 8px;
}

.policy-content::-webkit-scrollbar-track {
  background: rgba(10, 10, 10, 0.4);
  border-radius: 4px;
}

.policy-content::-webkit-scrollbar-thumb {
  background: rgba(89, 68, 97, 0.6);
  border-radius: 4px;
}

.policy-content::-webkit-scrollbar-thumb:hover {
  background: rgba(89, 68, 97, 0.8);
}

/* Message Modal Styles (moved from JS for CSP compliance) */
.message-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.message-icon.success {
  color: #10B981;
}

.message-icon.error {
  color: #EF4444;
}

#messageContent h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: #FFFFFF;
}

#messageContent p {
  color: #B8B8B8;
  line-height: 1.5;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  /* Hero Navigation Mobile - balanced spacing */
  .hero-nav {
    /* Maintain balanced top/right spacing on mobile */
    padding: calc(var(--space-lg) + var(--space-xs)) var(--space-lg) var(--space-lg) var(--space-lg);
  }

  .nav-container {
    flex-direction: column;
    gap: var(--space-lg);
  }

  .nav-links {
    gap: var(--space-lg);
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav-link {
    font-size: 0.9rem;
  }

  .nav-contact-btn {
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
  }

  /* Removed unused .main-title class */

  .action-area {
    /* Mobile specific adjustments - consistent with hero-nav */
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
    padding-bottom: calc(var(--space-2xl) + var(--space-md) + env(safe-area-inset-bottom, 0));
    /* Enhanced mobile spacing between icons */
    gap: var(--space-lg); /* 24px between icons on mobile */
    /* Ensure full width flex container */
    width: 100%;
    left: 0;
    right: 0;
    transform: none;
  }

  /* Removed unused .contact-btn mobile styles */

  /* Remove conflicting social-links styles */
  
  .social-link {
    /* Ensure minimum touch target size */
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
  }

  .policies-btn {
    /* Ensure minimum touch target size */
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
    flex-shrink: 0;
    /* Simplified appearance styles */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-sizing: border-box;
    touch-action: manipulation;
  }

  .modal-content {
    padding: 2rem;
    margin: 1rem;
  }

  .back-to-home-btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
  }

  .policies-nav {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .policy-content {
    max-height: 50vh;
    padding: 0.75rem;
  }

  .landing-container::after {
    width: 600px;
    height: 600px;
  }
}

@media (max-width: 480px) {
  /* Removed unused .main-title small screen class */

  .action-area {
    /* Consistent spacing for small screens */
    padding-left: var(--space-md);
    padding-right: var(--space-md);
    padding-bottom: calc(var(--space-xl) + var(--space-lg) + env(safe-area-inset-bottom, 0));
    /* Optimized spacing for very small screens */
    gap: var(--space-lg); /* 24px between icons on small screens */
  }

  /* Removed unused .contact-btn small screen styles */

  /* Removed conflicting .social-links styles */

  .social-link {
    /* Smaller size for very small screens */
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }

  .policies-btn {
    /* Smaller size for very small screens */
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }

  .game-btn {
    /* Smaller size for very small screens */
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }

  .modal-content {
    padding: 1.5rem;
  }

  .back-to-home-btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.85rem;
    margin-top: 2rem;
    margin-bottom: 1.25rem;
  }

  .modal-close {
    width: 36px;
    height: 36px;
    font-size: 1.25rem;
    top: 1rem;
    right: 1rem;
  }
}

/* ===== LOADING STATE ===== */
.loading {
  pointer-events: none;
  opacity: 0.7;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid rgba(89, 68, 97, 0.3);
  border-top-color: #594461;
  border-radius: 50%;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* ===== ACCESSIBILITY ===== */
:focus-visible {
  outline: 2px solid #594461;
  outline-offset: 2px;
}

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

/* ===== BROWSER-SPECIFIC FIXES ===== */

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
  .landing-container {
    /* Fix for iOS Safari viewport issues */
    height: 100%;
    min-height: calc(var(--dynamic-vh, 1vh) * 100);
    /* Ensure consistent background positioning on iOS */
    background-attachment: scroll;
    background-position: center center;
  }

  .action-area {
    /* iOS Safari safe area support - keep at bottom with proper spacing */
    padding-bottom: calc(var(--space-xl) + env(safe-area-inset-bottom, 0));
  }
}

/* Browser compatibility enhancements */
@supports not (--css: variables) {
  html,
  body {
    height: 100vh;
  }

  .landing-container {
    height: 100vh;
    min-height: 100vh;
  }

  .action-area {
    bottom: 0;
    padding-bottom: 2rem;
  }

  @media (max-width: 768px) {
    .action-area {
      bottom: 0;
      padding-bottom: 3rem;
    }
  }

  @media (max-width: 480px) {
    .action-area {
      bottom: 0;
      padding-bottom: 2.5rem;
    }
  }
}

/* Clean mobile alignment */
@media (max-width: 768px) {
  .landing-container {
    /* Ensure consistent background behavior */
    background-attachment: scroll;
    background-position: center center;
  }
}

/* ===== CSS CUSTOM PROPERTIES FROM DATA ATTRIBUTES (CSP Compliant) ===== */
/* Set CSS variables based on data attributes to avoid inline styles */
html.viewport-calculated {
  --vh: calc(attr(data-vh) * 1px);
  --vw: calc(attr(data-vw) * 1px);
  --dynamic-vh: calc(attr(data-vh) * 1px);
  --actual-vh: calc(attr(data-actual-vh) * 1px);
}

/* Force repaint class for CSP compliance */
body.force-repaint {
  transform: translateZ(0);
}

/* Background image fade transitions for CSP compliance */
.background-image {
  transition: opacity 0.15s ease-in-out;
}

.background-image.fading-out {
  opacity: 0 !important;
}

/* ===== ESSENTIAL RESPONSIVE FIXES FROM REMOVED FILES ===== */

/* Desktop: Keep button to the right */
@media (min-width: 769px) {
  .hero-nav {
    display: flex !important;
    justify-content: flex-end !important;
    padding: var(--space-md) var(--space-xl) !important;
  }
  
  .nav-container {
    width: 100% !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
  }
}

/* Large desktop screens - ensure right alignment */
@media (min-width: 1200px) {
  .hero-nav {
    justify-content: center !important;
  }
  
  .nav-container {
    width: 100% !important;
    max-width: 1400px !important;
    display: flex !important;
    justify-content: flex-end !important;
  }
}

/* Safari white bar fix */
@supports (-webkit-touch-callout: none) {
  body {
    min-height: 100vh !important;
    position: relative;
    background-color: #0a0a0f !important;
  }
  
  .background-container {
    height: calc(100vh + 1px);
    bottom: -1px;
  }
}

/* Mobile glow reduction for better performance */
@media (max-width: 768px) {
  .background-overlay::after {
    background: radial-gradient(
      circle at center,
      rgba(147, 51, 234, 0.12) 0%,
      rgba(139, 48, 220, 0.10) 5%,
      rgba(130, 45, 206, 0.08) 10%,
      rgba(122, 42, 192, 0.06) 15%,
      rgba(113, 39, 178, 0.05) 20%,
      rgba(105, 36, 164, 0.04) 25%,
      transparent 30%
    ) !important;
  }
  
  .background-overlay::before {
    background: radial-gradient(
      circle at center,
      rgba(92, 0, 153, 0.08) 0%,
      rgba(92, 0, 153, 0.06) 8%,
      rgba(92, 0, 153, 0.04) 16%,
      rgba(92, 0, 153, 0.02) 24%,
      transparent 32%
    ) !important;
  }
  
  .background-overlay {
    background: rgba(10, 10, 15, 0.65) !important;
  }
}

/* High performance mode for mobile */
@media (max-width: 768px) and (hover: none) {
  .background-overlay::after,
  .background-overlay::before {
    animation: none !important;
  }
}

/* =====================================================
   Bouncing Ball Game Styles
   ===================================================== */

/* Game Button - Matching social links style */
.game-btn {
  /* Fixed size for consistency */
  width: 52px;
  height: 52px;
  
  /* Modern flexbox centering */
  display: flex;
  align-items: center;
  justify-content: center;
  
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 50%;
  color: #ffffff;
  
  /* Animation and interaction */
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  
  /* Reset default button styles */
  padding: 0;
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  
  /* Spacing */
  margin: 0 var(--space-sm);
  flex-shrink: 0;
  
  /* Ensure stacking context and clickability */
  z-index: 10;
  pointer-events: auto;
  touch-action: manipulation;
}

/* Game button hover effect */
.game-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(89, 68, 97, 0.4) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: all 0.3s ease;
  pointer-events: none;
  border-radius: 50%;
}

.game-btn:hover {
  background: rgba(89, 68, 97, 0.9);
  border-color: rgba(89, 68, 97, 1);
  transform: translateY(-2px);
  color: #ffffff;
}

.game-btn:hover::before {
  width: 120%;
  height: 120%;
  box-shadow: 0 0 15px rgba(89, 68, 97, 0.5), 0 0 30px rgba(89, 68, 97, 0.3);
}

.game-btn:active {
  transform: translateY(0);
}

/* Game Modal */
.game-modal {
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  background: rgba(20, 20, 30, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-container {
  padding: 2rem;
  text-align: center;
}

.game-container h2 {
  color: #fff;
  margin-bottom: 1.5rem;
  font-size: 2rem;
  text-shadow: 0 2px 10px rgba(138, 43, 226, 0.5);
}

/* Game Stats */
.game-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
}

.stat-label {
  color: rgba(255, 255, 255, 0.7);
}

.stat-value {
  color: #fff;
  font-weight: bold;
  font-size: 1.3rem;
}

.stat-value.low-lives {
  color: #ff4444;
  animation: pulse 1s infinite;
}

/* Game Canvas */
.game-canvas {
  position: relative;
  width: 100%;
  height: 400px;
  background: linear-gradient(135deg, rgba(92, 0, 153, 0.1) 0%, rgba(20, 20, 30, 0.3) 100%);
  border: 2px solid rgba(138, 43, 226, 0.3);
  border-radius: 10px;
  margin: 1.5rem auto;
  overflow: hidden;
  cursor: crosshair;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  /* Flexbox centering for intro content */
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-canvas.miss-effect {
  animation: shake 0.3s;
  border-color: #ff4444;
}

/* Game Ball */
.game-ball {
  position: absolute;
  width: 50px;
  height: 50px;
  background: radial-gradient(circle at 30% 30%, #a855f7, #6b21a8);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s ease;
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
  z-index: 100;
  pointer-events: auto !important;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.game-ball:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(168, 85, 247, 0.7);
}

.game-ball.caught {
  animation: catchPulse 0.3s ease;
}

.game-ball.bounce-effect {
  animation: bounce 0.2s ease;
}

/* Game Controls */
.game-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.game-control-btn {
  padding: 0.8rem 2rem;
  background: rgba(138, 43, 226, 0.8);
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.game-control-btn:hover {
  background: rgba(138, 43, 226, 1);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(138, 43, 226, 0.4);
}

.game-control-btn:active {
  transform: translateY(0);
}

/* Game Messages */
.game-message {
  margin-top: 1rem;
  min-height: 30px;
  font-size: 1.1rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.game-message:not(:empty) {
  opacity: 1;
}

.game-message.success {
  color: #4caf50;
}

.game-message.error {
  color: #ff4444;
}

.game-message.warning {
  color: #ff9800;
}

/* Animations */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

@keyframes catchPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.5);
    opacity: 0.5;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes bounce {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.9);
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .game-modal {
    width: 95%;
    max-height: 95vh;
  }
  
  .game-container {
    padding: 1rem;
  }
  
  .game-container h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }
  
  .game-stats {
    gap: 1rem;
  }
  
  .stat-item {
    font-size: 0.9rem;
  }
  
  .stat-value {
    font-size: 1.1rem;
  }
  
  .game-canvas {
    height: 300px;
    margin: 1rem auto;
  }
  
  .game-ball {
    width: 40px;
    height: 40px;
  }
  
  .game-control-btn {
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
  }
  
  .game-btn {
    /* Match social links size on mobile */
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
  }
}

/* =====================================================
   Card Guessing Game Styles
   ===================================================== */

/* Card Grid Layout */
.game-canvas.card-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
  padding: 1rem;
  background: transparent;
  height: auto;
  max-height: 70vh;
  overflow-y: auto;
  margin: 1.5rem auto;
}

/* Game Intro Screen */
.game-intro {
  text-align: center;
  padding: 3rem 1rem;
  color: #ffffff;
}

.game-intro h3 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: #ffffff;
}

.game-intro p {
  font-size: 1.1rem;
  margin: 0.5rem 0;
  color: rgba(255, 255, 255, 0.8);
}

.game-intro strong {
  color: #ff6b6b;
  font-weight: 600;
}

.game-stats-info {
  margin-top: 2rem;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Card Styles */
.game-card {
  aspect-ratio: 1;
  cursor: pointer;
  perspective: 1000px;
  border-radius: 8px;
  position: relative;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.game-card.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: bold;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.card-front {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.card-front:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.4);
}

.card-back {
  background: #2d2d3d;
  color: white;
  transform: rotateY(180deg);
}

.card-number {
  font-size: 0.9rem;
  opacity: 0.8;
}

.card-result {
  font-size: 2rem;
}

/* Card States */
.game-card.winner .card-back {
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  animation: pulse 0.5s ease-in-out;
}

.game-card.loser .card-back {
  background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

.game-card.revealed-winner .card-back {
  background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
  animation: glow 1s ease-in-out infinite;
}

/* Animations */
@keyframes pulse {
  0% { transform: rotateY(180deg) scale(1); }
  50% { transform: rotateY(180deg) scale(1.1); }
  100% { transform: rotateY(180deg) scale(1); }
}

@keyframes glow {
  0% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.5); }
  50% { box-shadow: 0 0 15px rgba(255, 215, 0, 0.5), 0 0 25px rgba(255, 215, 0, 0.3); }
  100% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.5); }
}

/* Confetti Animation */
.confetti-particle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #ff0000;
  border-radius: 50%;
  animation: confetti-fall linear forwards;
  pointer-events: none;
  z-index: 1000;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Responsive Design for Cards */
@media (max-width: 768px) {
  .game-canvas.card-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    padding: 0.5rem;
  }
  
  .card-front, .card-back {
    font-size: 1rem;
  }
  
  .card-number {
    font-size: 0.8rem;
  }
  
  .card-result {
    font-size: 1.5rem;
  }
  
  .game-intro h3 {
    font-size: 1.4rem;
  }
  
  .game-intro p {
    font-size: 1rem;
  }
}

/* Scrollbar Styling for Card Grid */
.game-canvas.card-grid::-webkit-scrollbar {
  width: 8px;
}

.game-canvas.card-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.game-canvas.card-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.game-canvas.card-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Fix Reset Button */
#resetGameBtn {
  margin-left: var(--space-sm);
}

/* Chess Game Styles */
.chess-board-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: var(--space-lg) 0;
  min-height: 400px;
}

.chess-canvas {
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  cursor: pointer;
  max-width: 100%;
  height: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.game-info {
  text-align: center;
  margin-bottom: var(--space-md);
}

.game-status {
  font-size: 1.2rem;
  color: var(--accent-color);
  margin-bottom: var(--space-sm);
  font-weight: 600;
}

.player-info {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: var(--space-xs);
}

.turn-indicator {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  padding: var(--space-xs) var(--space-md);
  border-radius: 20px;
  display: inline-block;
  background: rgba(255, 255, 255, 0.1);
  margin-top: var(--space-sm);
}

.turn-indicator.turn-white {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.turn-indicator.turn-black {
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Invite Modal Styles */
.invite-modal {
  max-width: 500px;
  width: 90%;
  background: rgba(20, 20, 30, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.invite-container {
  padding: var(--space-lg);
}

.invite-container h3 {
  color: var(--text-color);
  margin-bottom: var(--space-lg);
  text-align: center;
}

.invite-container .form-group {
  margin-bottom: var(--space-md);
}

.invite-container label {
  display: block;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: var(--space-xs);
  font-size: 0.9rem;
}

.invite-container input,
.invite-container textarea {
  width: 100%;
  padding: var(--space-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #fff;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.invite-container input:focus,
.invite-container textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  background: rgba(255, 255, 255, 0.08);
}

.invite-result {
  margin-top: var(--space-md);
  text-align: center;
}

.invite-result .success-message {
  color: #4caf50;
  padding: var(--space-md);
  background: rgba(76, 175, 80, 0.1);
  border-radius: 4px;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.invite-result .error-message {
  color: #f44336;
  padding: var(--space-md);
  background: rgba(244, 67, 54, 0.1);
  border-radius: 4px;
  border: 1px solid rgba(244, 67, 54, 0.3);
}

.invite-result input[type="text"] {
  margin-top: var(--space-sm);
  font-size: 0.9rem;
  cursor: pointer;
}

/* Move List */
.move-list {
  max-height: 150px;
  overflow-y: auto;
  margin-top: var(--space-md);
  padding: var(--space-sm);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
}

/* Responsive Chess */
@media (max-width: 768px) {
  .chess-board-container {
    min-height: 300px;
  }
  
  .game-info {
    font-size: 0.9rem;
  }
  
  .game-status {
    font-size: 1rem;
  }
}