:root {
  /* Colors */
  --bg-primary: #080810;
  --bg-secondary: #0f0f1d;
  --card-bg: rgba(18, 18, 32, 0.55);
  --card-hover-bg: rgba(26, 26, 46, 0.8);
  --text-primary: #ffffff;
  --text-secondary: #9ea0c3;
  --text-muted: #64668b;
  
  /* Gradients */
  --grad-cyan-blue: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  --grad-purple-pink: linear-gradient(135deg, #7f00ff 0%, #ff007f 100%);
  --grad-card: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
  --grad-glow: linear-gradient(135deg, rgba(0, 242, 254, 0.15) 0%, rgba(127, 0, 255, 0.15) 100%);
  
  /* Accents and Borders */
  --cyan: #00f2fe;
  --purple: #7f00ff;
  --pink: #ff007f;
  --border-glow: rgba(0, 242, 254, 0.3);
  --glass-border: rgba(255, 255, 255, 0.07);
  --glass-border-hover: rgba(255, 255, 255, 0.2);
  
  /* Fonts */
  --font-title: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Layout */
  --max-width: 1200px;
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-snappy: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

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

/* Background Effects */
.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -2;
  pointer-events: none;
  opacity: 0.45;
  animation: glow-float 15s infinite alternate ease-in-out;
}

.bg-glow-1 {
  width: 40vw;
  height: 40vw;
  background: var(--grad-cyan-blue);
  top: -10vw;
  left: -10vw;
}

.bg-glow-2 {
  width: 50vw;
  height: 50vw;
  background: var(--grad-purple-pink);
  bottom: -10vw;
  right: -10vw;
  animation-delay: -5s;
}

.grid-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: -1;
  pointer-events: none;
}

@keyframes glow-float {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(8vw, 5vw) scale(1.1);
  }
}

/* Header */
header {
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 8, 16, 0.7);
}

.header-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-title);
  font-size: 1.75rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  transition: var(--transition-snappy);
}

.logo:hover {
  opacity: 0.9;
}

.logo-accent {
  background: var(--grad-cyan-blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-right: 1px;
}

.stats-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: var(--transition-smooth);
}

.stats-badge i {
  color: var(--cyan);
}

.stats-badge:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.2);
}

/* Hero Section */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 5rem 2rem 3rem;
  text-align: center;
}

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

.hero-title {
  font-family: var(--font-title);
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 1.5rem;
  letter-spacing: -1.5px;
}

.gradient-text {
  background: linear-gradient(135deg, #00f2fe 10%, #7f00ff 90%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  font-weight: 300;
  max-width: 650px;
  margin: 0 auto;
}

/* Games Section */
.games-section {
  max-width: var(--max-width);
  margin: 0 auto 6rem;
  padding: 0 2rem;
}

.section-header {
  margin-bottom: 3rem;
  text-align: left;
}

.section-title {
  font-family: var(--font-title);
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--grad-cyan-blue);
  border-radius: 2px;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Loading and Errors */
.loading-container, .error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 0;
  gap: 1.5rem;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 255, 255, 0.05);
  border-top: 3px solid var(--cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.error-container i {
  font-size: 3rem;
  color: #ff3838;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.hidden {
  display: none !important;
}

/* Games Grid */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2.5rem;
}

/* Game Card Tile */
.game-card {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  text-decoration: none;
  color: var(--text-primary);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: var(--transition-smooth);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  height: 100%;
}

.game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 20px;
  padding: 1.5px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent 40%, rgba(255, 255, 255, 0.03));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  transition: var(--transition-smooth);
}

/* Thumbnail/Screenshot */
.game-img-container {
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  position: relative;
  overflow: hidden;
  background: #000;
}

.game-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.game-card:hover .game-img {
  transform: scale(1.06);
  filter: brightness(0.65);
}

/* Hover play overlay */
.play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition-smooth);
  z-index: 2;
  background: rgba(8, 8, 16, 0.4);
}

.play-btn {
  background: var(--grad-cyan-blue);
  color: #000;
  padding: 0.8rem 1.8rem;
  border-radius: 50px;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transform: translateY(15px);
  transition: var(--transition-smooth);
  box-shadow: 0 5px 15px rgba(0, 242, 254, 0.4);
}

.game-card:hover .play-overlay {
  opacity: 1;
}

.game-card:hover .play-btn {
  transform: translateY(0);
}

/* Badges on Thumbnail */
.card-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 3;
  padding: 0.35rem 0.85rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.badge-playcount {
  background: rgba(15, 15, 29, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  right: 1rem;
  left: auto;
}

.badge-playcount i {
  color: var(--cyan);
}

/* Card Body */
.game-info {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  z-index: 2;
}

.game-title {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.3px;
  transition: var(--transition-snappy);
}

.game-card:hover .game-title {
  color: var(--cyan);
}

.game-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  font-weight: 300;
  flex-grow: 1;
}

/* Card Hover Animations */
.game-card:hover {
  transform: translateY(-8px);
  border-color: var(--border-glow);
  background: var(--card-hover-bg);
  box-shadow: 0 15px 40px rgba(0, 242, 254, 0.15);
}

.game-card:hover::before {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
}

/* Footer */
footer {
  border-top: 1px solid var(--glass-border);
  padding: 3rem 2rem;
  background: rgba(5, 5, 10, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.footer-brand {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 800;
}

.footer-copyright {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Responsive Media Queries */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
  .hero-subtitle {
    font-size: 1.05rem;
  }
  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
  }
  .header-container {
    padding: 1rem 1.5rem;
  }
  .hero {
    padding: 3.5rem 1.5rem 2rem;
  }
}
