/* === CSS Variables === */
:root {
  --bg-dark: #0a0a0f;
  --bg-card: #12121a;
  --bg-card-hover: #1a1a25;
  --accent-primary: #00ffaa;
  --accent-secondary: #ff6b35;
  --accent-tertiary: #7b5cff;
  --text-primary: #ffffff;
  --text-secondary: #8888aa;
  --text-muted: #555566;
  --border-color: #2a2a3a;
  --glow-primary: rgba(0, 255, 170, 0.4);
  --glow-secondary: rgba(255, 107, 53, 0.4);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* === Background Effects === */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(123, 92, 255, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(0, 255, 170, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(255, 107, 53, 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.noise {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 1;
}

.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.1) 2px,
    rgba(0, 0, 0, 0.1) 4px
  );
  pointer-events: none;
  z-index: 2;
}

/* === Header === */
.header {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 4rem 2rem 2rem;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.logo-icon {
  font-size: 2.5rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.logo-text {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(1rem, 4vw, 1.5rem);
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-tertiary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 40px var(--glow-primary);
  letter-spacing: 2px;
}

.tagline {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 300;
  letter-spacing: 0.5px;
}

/* === Container === */
.container {
  position: relative;
  z-index: 10;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* === Games Grid === */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  padding: 2rem 0;
}

/* === Game Card === */
.game-card {
  position: relative;
  cursor: pointer;
  transition: transform 0.3s ease;
}

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

.game-card-inner {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
  height: 100%;
}

.game-card:hover .game-card-inner {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.4),
    0 0 60px var(--glow-primary),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* === Game Cover === */
.game-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1a 100%);
}

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

.game-card:hover .game-cover img {
  transform: scale(1.05);
}

.game-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--accent-secondary);
  color: white;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  padding: 6px 10px;
  border-radius: 4px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* === Game Info === */
.game-info {
  padding: 1.5rem;
}

.game-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  line-height: 1.4;
}

.game-credit {
  font-size: 0.85rem;
  color: var(--accent-primary);
  font-style: italic;
  margin-bottom: 0.75rem;
  opacity: 0.9;
}

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

.game-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.game-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
}

/* === Play Button === */
.play-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.9rem 1.5rem;
  background: linear-gradient(135deg, var(--accent-primary) 0%, #00cc88 100%);
  border: none;
  border-radius: 8px;
  color: #000;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.65rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.play-button:hover {
  transform: scale(1.02);
  box-shadow: 0 0 30px var(--glow-primary);
}

.play-icon {
  font-size: 0.8rem;
}

/* === Coming Soon Cards === */
.game-card.coming-soon {
  cursor: default;
  opacity: 0.6;
}

.game-card.coming-soon:hover {
  transform: none;
}

.game-card.coming-soon .game-card-inner:hover {
  border-color: var(--border-color);
  box-shadow: none;
}

.game-cover.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(
    45deg,
    var(--bg-card),
    var(--bg-card) 10px,
    var(--bg-dark) 10px,
    var(--bg-dark) 20px
  );
}

.coming-soon-icon {
  font-size: 3rem;
  opacity: 0.5;
}

/* === Footer === */
.footer {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* === Responsive === */
@media (max-width: 768px) {
  .header {
    padding: 3rem 1.5rem 1.5rem;
  }
  
  .logo {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .logo-text {
    font-size: 0.9rem;
  }
  
  .tagline {
    font-size: 0.95rem;
  }
  
  .games-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .container {
    padding: 1rem;
  }
}

/* === Selection === */
::selection {
  background: var(--accent-primary);
  color: var(--bg-dark);
}
