:root {
  /* Color Palette */
  --bg-primary: #0a0a16;
  --bg-secondary: #13131f;
  --bg-tertiary: #1c1c2a;
  --neon-primary: #f637ec;
  --neon-secondary: #3300ff;
  --neon-accent: #00ff9d;
  --neon-text: #e0e0ff;
  --neon-glow: rgba(246, 55, 236, 0.7);
  --neon-secondary-glow: rgba(51, 0, 255, 0.7);
  --text-primary: #f8f8ff;
  --text-secondary: #c8c8e8;
  --text-muted: #8888a8;

  /* Typography */
  font-family: 'Rajdhani', 'Orbitron', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.5;
  font-weight: 400;

  /* Colors */
  color-scheme: dark;
  color: var(--text-primary);
  background-color: var(--bg-primary);

  /* Font optimization */
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* Spacing system - 8px grid */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 2.5rem;
  --space-6: 3rem;
}

/* Font loading */
@font-face {
  font-family: 'Orbitron';
  src: url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700&display=swap');
  font-display: swap;
}

@font-face {
  font-family: 'Rajdhani';
  src: url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@300;400;500;600;700&display=swap');
  font-display: swap;
}

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

/* Base styles */
html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

/* Particles background */
#particles-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* Main container */
main {
  padding: var(--space-4) var(--space-2);
  max-width: 1440px;
  margin: 0 auto;
  min-height: calc(100vh - 80px - 300px); /* Account for header and footer */
}

/* Headings */
h1, h2, h3, h4 {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-2);
}

/* Links */
a {
  color: var(--neon-primary);
  text-decoration: none;
  transition: color 0.3s, text-shadow 0.3s;
}

a:hover {
  color: var(--neon-accent);
  text-shadow: 0 0 8px var(--neon-glow);
}

/* Header */
header {
  background: rgba(13, 13, 25, 0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid rgba(246, 55, 236, 0.2);
  height: 80px;
}

.logo {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--neon-primary);
  text-shadow: 0 0 10px var(--neon-glow);
  letter-spacing: 2px;
  margin: 0;
}

.logo span {
  color: var(--neon-accent);
  text-shadow: 0 0 10px rgba(0, 255, 157, 0.7);
}

/* Navigation */
nav {
  display: flex;
  align-items: center;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: var(--space-3);
}

.nav-links a {
  color: var(--text-primary);
  font-weight: 500;
  padding: var(--space-1);
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--neon-primary);
  border-bottom: 2px solid var(--neon-primary);
  text-shadow: 0 0 8px var(--neon-glow);
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 24px;
  position: relative;
  z-index: 102;
}

.mobile-menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--neon-primary);
  margin: 5px 0;
  transition: all 0.3s ease;
  box-shadow: 0 0 5px var(--neon-glow);
}

/* Hero section */
.hero {
  height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(10, 10, 22, 0.7) 0%, rgba(19, 19, 31, 0.7) 100%);
  border-radius: 16px;
  margin-bottom: var(--space-5);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5), 0 0 15px var(--neon-glow);
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('https://images.pexels.com/photos/2603464/pexels-photo-2603464.jpeg') center/cover no-repeat;
  opacity: 0.4;
  z-index: -1;
}

.hero-content {
  text-align: center;
  max-width: 800px;
  padding: var(--space-4);
  z-index: 1;
}

.hero-content h2 {
  font-size: 4rem;
  margin-bottom: var(--space-3);
  color: var(--neon-primary);
  text-shadow: 0 0 10px var(--neon-glow);
}

.hero-content p {
  font-size: 1.5rem;
  margin-bottom: var(--space-4);
  color: var(--text-primary);
}

/* Neon Button */
.neon-button {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  background: transparent;
  color: var(--neon-primary);
  border: 2px solid var(--neon-primary);
  border-radius: 4px;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px var(--neon-glow), inset 0 0 10px var(--neon-glow);
  text-shadow: 0 0 5px var(--neon-primary);
  z-index: 1;
}

.neon-button:hover {
  background-color: var(--neon-primary);
  color: var(--bg-primary);
  box-shadow: 0 0 20px var(--neon-glow), inset 0 0 20px var(--neon-glow);
}

.neon-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(246, 55, 236, 0.4), transparent);
  transition: left 0.7s ease;
  z-index: -1;
}

.neon-button:hover::before {
  left: 100%;
}

/* Section titles */
.section-title {
  font-size: 2.5rem;
  text-align: center;
  margin: var(--space-5) 0 var(--space-4);
  color: var(--neon-text);
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}

.section-title::after {
  content: '';
  position: absolute;
  left: 20%;
  bottom: -10px;
  width: 60%;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--neon-primary), transparent);
  border-radius: 2px;
}

/* Game Grid */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.game-card {
  background: var(--bg-tertiary);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(246, 55, 236, 0.2);
}

.game-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.4), 0 0 15px var(--neon-glow);
}

.game-card:hover::before {
  opacity: 1;
}

.game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--neon-primary), var(--neon-secondary)) border-box;
  -webkit-mask:
    linear-gradient(#fff 0 0) padding-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.game-thumbnail {
  width: 100%;
  height: 180px;
  object-fit: cover;
  position: relative;
  overflow: hidden;
}

.game-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.game-card:hover .game-thumbnail img {
  transform: scale(1.1);
}

.game-info {
  padding: var(--space-2);
  text-align: center;
}

.game-title {
  font-size: 1.2rem;
  margin-bottom: var(--space-1);
  color: var(--neon-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  padding: 0 var(--space-1);
}

.game-category {
  display: inline-block;
  background: rgba(246, 55, 236, 0.2);
  color: var(--neon-primary);
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 4px;
  white-space: nowrap;
}

/* Category cards */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-3);
  margin-bottom: var(--space-5);
}

.category-card {
  background: var(--bg-tertiary);
  border-radius: 8px;
  padding: var(--space-3);
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 255, 157, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3), 0 0 15px rgba(0, 255, 157, 0.5);
  background-color: rgba(0, 255, 157, 0.1);
}

.category-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-2);
  background: rgba(0, 0, 0, 0.3);
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px rgba(0, 255, 157, 0.5);
}

.category-card:hover .category-icon {
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(0, 255, 157, 0.7);
}

.category-card h3 {
  color: var(--text-primary);
  font-size: 1.3rem;
  transition: all 0.3s ease;
}

.category-card:hover h3 {
  color: var(--neon-accent);
  text-shadow: 0 0 8px rgba(0, 255, 157, 0.7);
}

/* Filter Section */
.filter-section {
  background: var(--bg-tertiary);
  padding: var(--space-3);
  border-radius: 8px;
  margin-bottom: var(--space-4);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(246, 55, 236, 0.2);
}

.filter-container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: space-between;
  align-items: center;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.filter-group label {
  color: var(--text-secondary);
}

.filter-group select {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid rgba(246, 55, 236, 0.4);
  padding: 8px 16px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.3s ease;
}

.filter-group select:focus {
  border-color: var(--neon-primary);
  box-shadow: 0 0 5px var(--neon-glow);
}

.search-group {
  display: flex;
  gap: 8px;
}

.search-group input {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid rgba(246, 55, 236, 0.4);
  padding: 8px 16px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  width: 250px;
  transition: all 0.3s ease;
}

.search-group input:focus {
  border-color: var(--neon-primary);
  box-shadow: 0 0 5px var(--neon-glow);
}

.search-group button {
  background-color: var(--neon-primary);
  color: var(--bg-primary);
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.search-group button:hover {
  background-color: var(--neon-accent);
  box-shadow: 0 0 10px rgba(0, 255, 157, 0.7);
}

/* Page header */
.page-header {
  text-align: center;
  margin-bottom: var(--space-4);
}

.page-header h2 {
  font-size: 3rem;
  color: var(--neon-primary);
  text-shadow: 0 0 10px var(--neon-glow);
}

/* Game Detail Page */
.game-detail-header {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-4);
}

.back-button {
  background: transparent;
  border: none;
  color: var(--neon-primary);
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 4px;
  transition: all 0.3s ease;
  margin-right: var(--space-3);
}

.back-button:hover {
  text-shadow: 0 0 8px var(--neon-glow);
}

.back-icon {
  font-size: 1.2rem;
}

.game-title {
  font-size: 1.0rem;
  color: var(--neon-accent);
  text-shadow: 0 0 8px rgba(0, 255, 157, 0.7);
  margin: 0;
  flex-grow: 1;
}

.game-detail-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.game-info {
  display: flex;
  gap: var(--space-4);
  background: var(--bg-tertiary);
  border-radius: 12px;
  overflow: hidden;
  /*box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);*/
  /*border: 1px solid rgba(246, 55, 236, 0.2);*/
}





.game-thumbnail {
  flex: 0 0 300px;
  height: 300px;
  position: relative;
}

.game-thumbnail {
  width: 100%;
  height: 180px;
  object-fit: cover;
  position: relative;
  overflow: hidden;
}

.game-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-info-text {
  flex: 1;
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
}

.game-categories {
  display: flex;
  gap: 8px;
  margin-bottom: var(--space-2);
  flex-wrap: wrap;
}

.game-category-tag {
  background: rgba(246, 55, 236, 0.2);
  color: var(--neon-primary);
  font-size: 0.9rem;
  padding: 4px 12px;
  border-radius: 4px;
  display: inline-block;
}

.game-description {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: var(--space-3);
  flex-grow: 1;
}

.play-button {
  background-color: var(--neon-primary);
  color: var(--bg-primary);
  border: none;
  padding: var(--space-2) var(--space-4);
  border-radius: 8px;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px var(--neon-glow);
  align-self: flex-start;
}

.play-button:hover {
  background-color: var(--neon-accent);
  box-shadow: 0 0 20px rgba(0, 255, 157, 0.7);
}

.game-play-section {
  margin-top: var(--space-4);
  margin-bottom: var(--space-5);
  display: none;
}

.game-container {
  background: var(--bg-tertiary);
  border-radius: 12px;
  padding: var(--space-3);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(246, 55, 236, 0.2);
  position: relative;
}

.game-frame-container {
  width: 100%;
  height: 600px;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background-color: #000;
}

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

.fullscreen-toggle {
  position: absolute;
  bottom: var(--space-3);
  right: var(--space-3);
  background: rgba(19, 19, 31, 0.7);
  color: var(--neon-primary);
  border: 1px solid var(--neon-primary);
  padding: 8px 16px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}

.fullscreen-toggle:hover {
  background-color: var(--neon-primary);
  color: var(--bg-primary);
}

/* Similar games section */
.similar-games {
  margin-top: var(--space-5);
}

/* Footer */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid rgba(246, 55, 236, 0.2);
  padding-top: var(--space-4);
  color: var(--text-secondary);
  width: 100%;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-4);
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--space-3) var(--space-4);
}

.footer-section {
  display: flex;
  flex-direction: column;
}

.footer-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  color: var(--neon-primary);
  text-shadow: 0 0 8px var(--neon-glow);
  margin-bottom: var(--space-2);
}

.footer-title span {
  color: var(--neon-accent);
  text-shadow: 0 0 8px rgba(0, 255, 157, 0.7);
}

.footer-section h3 {
  color: var(--neon-text);
  font-size: 1.2rem;
  margin-bottom: var(--space-2);
}

.footer-section p {
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 8px;
}

.footer-section ul li a {
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.footer-section ul li a:hover {
  color: var(--neon-primary);
  text-shadow: 0 0 5px var(--neon-glow);
}

.social-icons {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg-tertiary);
  border-radius: 50%;
  color: var(--neon-primary);
  transition: all 0.3s ease;
  font-size: 0.8rem;
  font-weight: 600;
}

.social-icon:hover {
  background-color: var(--neon-primary);
  color: var(--bg-primary);
  box-shadow: 0 0 10px var(--neon-glow);
}

.footer-bottom {
  background: rgba(10, 10, 16, 0.8);
  text-align: center;
  padding: var(--space-2);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Fullscreen mode */
.fullscreen-mode .game-frame-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  border-radius: 0;
}

/* Mobile responsive styles */
@media (max-width: 992px) {
  .game-info {
    flex-direction: column;
  }

  .game-thumbnail {
    flex: 0 0 auto;
    height: 250px;
    width: 100%;
  }

  .hero-content h2 {
    font-size: 3rem;
  }

  .hero-content p {
    font-size: 1.2rem;
  }

  .game-frame-container {
    height: 500px;
  }
}

@media (max-width: 768px) {
  header {
    padding: var(--space-2);
  }

  .mobile-menu-toggle {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background: var(--bg-secondary);
    flex-direction: column;
    padding: 100px var(--space-3) var(--space-3);
    transition: right 0.3s ease;
    border-left: 1px solid rgba(246, 55, 236, 0.2);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
    z-index: 101;
  }

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

  .hero {
    height: 60vh;
  }

  .hero-content h2 {
    font-size: 2.5rem;
  }

  .hero-content p {
    font-size: 1rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .filter-container {
    flex-direction: column;
    align-items: stretch;
  }

  .search-group {
    width: 100%;
  }

  .search-group input {
    flex-grow: 1;
    width: auto;
  }

  .game-frame-container {
    height: 400px;
  }

  /* Mobile game detail page */
  .game-detail-page.fullscreen-mode {
    overflow: hidden;
  }

  .game-detail-page.fullscreen-mode header,
  .game-detail-page.fullscreen-mode footer,
  .game-detail-page.fullscreen-mode .game-detail-header,
  .game-detail-page.fullscreen-mode .game-info,
  .game-detail-page.fullscreen-mode .similar-games {
    display: none;
  }

  .game-detail-page.fullscreen-mode .game-play-section {
    margin: 0;
    height: 100vh;
  }

  .game-detail-page.fullscreen-mode .game-container {
    border-radius: 0;
    padding: 0;
    height: 100vh;
  }

  .game-detail-page.fullscreen-mode .game-frame-container {
    border-radius: 0;
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 1.4rem;
  }

  .hero {
    height: 50vh;
  }

  .hero-content h2 {
    font-size: 2rem;
  }

  .hero-content p {
    font-size: 0.9rem;
  }

  .neon-button {
    font-size: 1rem;
    padding: var(--space-1) var(--space-3);
  }

  .section-title {
    font-size: 1.8rem;
  }

  .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  .game-title {
    font-size: 2rem;
  }

  .game-frame-container {
    height: 300px;
  }

  /* For mobile game fullscreen */
  .game-detail-page.fullscreen-mode .game-frame-container {
    height: 100vh;
  }
}
