:root {
  --primary: #7f5af0;
  --secondary: #2cb67d;
  --background: #16161a;
  --surface: #242629;
  --text: #fffffe;
  --accent: #ff8906;
  --gradient-start: #7f5af0;
  --gradient-end: #2cb67d;
}

/* Light theme */
.light-theme {
  --primary: #6246ea;
  --secondary: #27ae60;
  --background: #fffffe;
  --surface: #f2f4f6;
  --text: #2b2c34;
  --accent: #ff8e3c;
  --gradient-start: #6246ea;
  --gradient-end: #27ae60;
}

/* Cyberpunk theme */
.cyberpunk-theme {
  --primary: #f72585;
  --secondary: #4cc9f0;
  --background: #10002b;
  --surface: #240046;
  --text: #fffffe;
  --accent: #ffbd00;
  --gradient-start: #f72585;
  --gradient-end: #4cc9f0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--background);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 1rem;
  position: relative;
}

header h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  color: var(--primary);
  background: linear-gradient(45deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

header p {
  font-size: 1.2rem;
  opacity: 0.8;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.game-card {
  background-color: var(--surface);
  border-radius: 15px;
  overflow: hidden;
  height: 350px;
  perspective: 1000px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.game-card:hover {
  transform: translateY(-10px);
}

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

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

.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  text-align: center;
}

.card-front {
  background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
  color: white;
}

.card-front i {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.card-back {
  background-color: var(--surface);
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}

.card-back p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.play-btn {
  background-color: var(--accent);
  color: var(--text);
  padding: 0.8rem 1.5rem;
  border-radius: 30px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.play-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(255, 137, 6, 0.4);
}

footer {
  text-align: center;
  opacity: 0.8;
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Particles */
.particle-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background-color: var(--primary);
  opacity: 0.2;
  animation: float infinite linear;
}

@keyframes float {
  0% {
      transform: translateY(0) translateX(0) rotate(0);
  }
  33% {
      transform: translateY(-30px) translateX(20px) rotate(120deg);
  }
  66% {
      transform: translateY(20px) translateX(-20px) rotate(240deg);
  }
  100% {
      transform: translateY(0) translateX(0) rotate(360deg);
  }
}

/* Glare effect */
.glare {
  position: absolute;
  background: radial-gradient(circle at center, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
  pointer-events: none;
  transition: opacity 0.3s ease;
  border-radius: 50%;
  z-index: 10;
}

/* Card animations */
.game-card {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Theme switcher */
.theme-switcher {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  align-items: center;
}

.theme-switcher span {
  font-size: 0.9rem;
  opacity: 0.8;
}

.theme-btn {
  background-color: rgba(255, 255, 255, 0.1);
  border: none;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.3s ease;
}

.theme-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.theme-btn.active {
  background-color: var(--primary);
}

/* Ripple effect */
.ripple {
  position: absolute;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

@keyframes ripple {
  to {
      transform: scale(4);
      opacity: 0;
  }
}

/* Media Queries */
@media (max-width: 768px) {
  .game-grid {
      grid-template-columns: 1fr;
  }
  
  header h1 {
      font-size: 2.5rem;
  }
  
  .theme-switcher {
      flex-wrap: wrap;
  }
}

/* Animations */
@keyframes pulse {
  0% {
      transform: scale(1);
  }
  50% {
      transform: scale(1.05);
  }
  100% {
      transform: scale(1);
  }
}

.game-card:hover .play-btn {
  animation: pulse 1.5s infinite;
}

.ad-container {
  grid-column: 1 / -1; /* Spans full width */
  margin: 1.5rem 0;
  width: 100%;
  min-height: 90px; /* Minimum height for ads */
}

.ad-wrapper {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.adsbygoogle {
  display: block;
  width: 100%;
  min-height: 90px;
}
