/*
 * Copyright (c) Starry Systems and Nijika Softworks.
 */


:root {
  /* Color Palette */
  --primary: #e74c3c;
  --primary-hover: #c0392b;
  --secondary: #3498db;
  --accent: #9b59b6;
  --dark: #2c3e50;
  --light: #ecf0f1;
  --success: #2ecc71;
  --warning: #f1c40f;

  /* Backgrounds */
  --bg-body: #f4f7f6;
  --bg-glass: rgba(255, 255, 255, 0.7);
  --bg-card: #ffffff;
  --bg-nav: rgba(44, 62, 80, 0.95);

  /* Text */
  --text-main: #2c3e50;
  --text-muted: #7f8c8d;
  --text-light: #ffffff;

  /* Shadows & Borders */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
  --border-radius: 12px;
  --border-glass: 1px solid rgba(255, 255, 255, 0.3);

  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Dark Theme Variables */
body.dark-theme {
  --bg-body: #121212;
  --bg-glass: rgba(30, 30, 30, 0.7);
  --bg-card: #1e1e1e;
  --bg-nav: rgba(20, 20, 20, 0.95);

  --text-main: #ecf0f1;
  --text-muted: #bdc3c7;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.5);
  --border-glass: 1px solid rgba(255, 255, 255, 0.05);
}

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

body {
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  background-color: var(--bg-body);
  color: var(--text-main);
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin-bottom: 1rem;
  font-weight: 700;
  line-height: 1.2;
  color: inherit;
}

h1 {
  font-size: 3rem;
  letter-spacing: -1px;
}

h2 {
  font-size: 2.2rem;
  letter-spacing: -0.5px;
}

h3 {
  font-size: 1.5rem;
}

p {
  margin-bottom: 1rem;
}

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

a:hover {
  color: var(--primary);
}

/* Survey Popup Styles */
.survey-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}
.survey-popup {
  background: var(--bg-card);
  padding: 30px;
  border-radius: var(--border-radius);
  max-width: 400px;
  width: 90%;
  text-align: center;
  position: relative;
  border: var(--border-glass);
  box-shadow: var(--shadow-lg);
  color: var(--text-main);
}
.survey-close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}
.survey-close:hover {
  color: var(--text-main);
}
.survey-btn {
  display: inline-block;
  margin-top: 15px;
  background: var(--secondary);
  color: white;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 6px;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}
.survey-btn:hover {
  background: var(--primary);
  color: white;
}

/* Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navigation - Glassmorphism */
.topnav {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--bg-nav);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0.5rem 0;
  box-shadow: var(--shadow-md);
  flex-wrap: wrap;
}

.topnav a {
  color: var(--text-light);
  padding: 0.8rem 1.2rem;
  font-weight: 500;
  border-radius: 8px;
  margin: 0 0.2rem;
  transition: var(--transition);
}

.topnav a:hover,
.topnav a.active {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--primary);
  transform: translateY(-2px);
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #2c3e50 0%, #e74c3c 100%);
  color: var(--text-light);
  padding: 80px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 40px;
  border-bottom-left-radius: 50% 20px;
  border-bottom-right-radius: 50% 20px;
  box-shadow: var(--shadow-lg);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3");
  pointer-events: none;
}

.hero h1 {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.25rem;
  opacity: 0.9;
  max-width: 700px;
  margin: 0 auto 2rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary);
  color: white;
  padding: 12px 28px;
  border-radius: 30px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
  transition: var(--transition);
}

.btn:hover {
  background-color: var(--primary-hover);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(231, 76, 60, 0.6);
  color: white;
  text-decoration: none;
}

/* Cards & Sections */
.features,
.featured-games,
.credits-section,
.license-section,
.marquee-container {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  border: var(--border-glass);
}

.features h2,
.featured-games h2 {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}

.features h2::after,
.featured-games h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--primary);
  margin: 10px auto 0;
  border-radius: 2px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.feature {
  text-align: center;
  padding: 1.5rem;
  background: var(--bg-body);
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.feature:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.feature h3 {
  color: var(--primary);
  margin-bottom: 1rem;
}

/* Game Items - Modernized */
.games-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 25px;
  padding: 20px 0;
}

.game-item {
  width: 160px;
  text-align: center;
  transition: var(--transition);
  position: relative;
}

.game-item.ad-item {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 160px; /* Match height of other game buttons if needed, or just let it be taller */
  min-height: 240px;
}

.game-item button {
  width: 100%;
  height: 160px;
  /* Square aspect ratio */
  border: none;
  border-radius: 20px;
  background: var(--bg-card);
  cursor: pointer;
  padding: 15px;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.game-item img {
  max-width: 100px;
  max-height: 100px;
  object-fit: contain;
  transition: var(--transition);
  z-index: 2;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.game-item p {
  margin-top: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
  transition: var(--transition);
}

/* Hover Effects */
.game-item:hover button {
  transform: translateY(-10px) scale(1.02);
  box-shadow: var(--shadow-lg);
  background: var(--bg-card);
  /* Ensure background stays consistent */
}

.game-item:hover img {
  transform: scale(1.15) rotate(3deg);
}

.game-item:hover p {
  color: var(--primary);
}

/* Footer */
footer {
  background-color: var(--dark);
  color: var(--text-light);
  padding: 60px 0 30px;
  margin-top: 60px;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 30px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
}

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

.copyright {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.85rem;
  margin-top: 20px;
}

/* Utilities */
.text-center {
  text-align: center;
}

.mt-2 {
  margin-top: 2rem;
}

.mb-2 {
  margin-bottom: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
  h1 {
    font-size: 2.2rem;
  }

  .hero {
    padding: 60px 15px;
  }

  .topnav {
    flex-direction: column;
    padding: 10px;
  }

  .topnav a {
    width: 100%;
    text-align: center;
    margin: 2px 0;
  }

  .game-item {
    width: 140px;
  }

  .game-item button {
    height: 140px;
  }
}

/* Eplinx Ads */
.ins-zone {
  display: block;
  width: 120px;
  height: 240px;
  background: rgba(0, 0, 0, 0.05); /* Placeholder background */
  border-radius: 8px;
  overflow: hidden;
  margin: 0 auto;
}

.aso-zone {
  display: block;
  width: 468px;
  max-width: 100%;
  height: 60px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  overflow: hidden;
  margin: 10px auto;
}

/* Responsive */
@media (max-width: 768px) {
  .aso-zone {
    width: 320px;
    height: 50px;
  }
}

.ad-container-changelog {
  display: flex;
  justify-content: center;
  padding: 20px 0;
}

/* Loading Spinner */
#loading-spinner {
  background: var(--bg-body) !important;
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--dark);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}
/* GitHub Stats Container */
.stats-container {
  background: var(--bg-card);
  border: var(--border-glass);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.stats-container h3 {
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.stats-container p {
  font-size: 1.1rem;
  color: var(--text-main);
}

.stats-container small {
  display: block;
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* --- Premium Design System --- */

.glass-panel {
  background: rgba(15, 15, 15, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.glass-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 32px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.premium-hero {
  padding: 80px 0;
  background: radial-gradient(circle at top left, rgba(231, 76, 60, 0.1), transparent),
              radial-gradient(circle at bottom right, rgba(52, 152, 219, 0.1), transparent),
              #121212;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.premium-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 24px;
  border-radius: 16px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all 0.3s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.premium-btn-primary {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.premium-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(231, 76, 60, 0.5);
}

.premium-btn-secondary {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.premium-btn-outline {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
}

.premium-btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
  border-color: rgba(255, 255, 255, 0.2);
}

.premium-input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 16px;
  color: white;
  width: 100%;
  font-family: inherit;
  transition: all 0.3s ease;
}

.premium-input:focus {
  border-color: #e74c3c;
  outline: none;
  background: rgba(231, 76, 60, 0.05);
}

.premium-toggle-bg {
  width: 60px;
  height: 32px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
}

.premium-toggle-bg.active {
  background: #3498db;
  border-color: #3498db;
}

.premium-toggle-knob {
  width: 24px;
  height: 24px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.premium-toggle-bg.active .premium-toggle-knob {
  left: 31px;
}

.animate-pulse-glow {
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(46, 204, 113, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}
