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

/* Background canvases */
#waveCanvas, #shapeCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.cards-container {
  position: relative;
  z-index: 10;
}

html, body {
  font-family: 'Orbitron', sans-serif;
  background-color: #000000;
  background-image: radial-gradient(circle at center, #00000000, #000000);
  color: #ffffff;
  scroll-behavior: smooth;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1, h2, h3, p {
  font-weight: 400;
  letter-spacing: 1px;
}

h1 {
  font-size: 2rem;
  color: #00ffcc;
}

h3 {
  font-size: 1.5rem;
  color: #ffffff;
}

p {
  font-size: 1.1rem;
  color: #ccc;
}

/* Navigation */
.nav-glass {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  backdrop-filter: blur(10px);
  background-color: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid rgba(0,255,170,0.2);
  flex-wrap: wrap;
  gap: 1rem;
}

.nav-glass a {
  color: #ffffff;
  text-decoration: none;
  margin-left: 1rem;
  font-size: 1rem;
  white-space: nowrap;
}

/* Buttons */
.btn-main {
  background: #00ff88;
  padding: 0.5rem 1.25rem;
  color: #000;
  border-radius: 5px;
  font-weight: bold;
  text-decoration: none;
  transition: all 0.3s ease-in-out;
  animation: pulseGlow 2s infinite;
}
.btn-main:hover {
  background: #00c266;
  color: #fff;
}

/* Cards grid */
#cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  padding: 3rem 2rem;
}

/* Card styling */
.game-card {
  background-color: #0f0f0f;
  border: 2px solid #00ffcc44;
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  /* add z-index for stacking */
  position: relative;
  z-index: 1;
}

.game-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.game-card:hover {
  transform: scale(1.03);
  box-shadow: 0 0 25px #00ffccaa;
}

.game-card article {
  display: flex;
  flex-direction: column;
}

.game-card figure {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.game-card figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.4s ease;
  position: relative;
  z-index: 1;
}

/* Overlay image should be stacked on top */
.game-card figure img.overlay {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none; /* prevents blocking clicks */
}

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

.game-card section {
  padding: 1rem;
  text-align: center;
}

/* Footer */
footer {
  background-color: #000000;
  text-align: center;
  padding: 2rem;
  font-size: 0.9rem;
  color: #ccc; /* changed from #000000 for visibility */
  align-items: unset;
}

/* Mode Toggle button */
#mode-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2000;
  background: #00ffcc26;
  border: 2px solid #00ffcc;
  color: #00ffcc;
  font-size: 1.4rem;
  padding: 10px 14px;
  border-radius: 50px;
  cursor: pointer;
  font-family: 'Orbitron', sans-serif;
  backdrop-filter: blur(6px);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  box-shadow: 0 0 12px rgba(0, 255, 204, 0.3);
}
#mode-toggle:hover {
  background: #00ffcc;
  color: #000;
  box-shadow: 0 0 20px #00ffcc;
}
body.light-mode #mode-toggle {
  background: rgba(0, 0, 0, 0.08);
  border-color: #0077ff;
  color: #0077ff;
  box-shadow: 0 0 10px rgba(0, 119, 255, 0.3);
}
body.light-mode #mode-toggle:hover {
  background: #0077ff;
  color: white;
  box-shadow: 0 0 20px #0077ff;
}

/* Light mode overrides */
body.light-mode {
  background-color: #f8f9fa;
  color: #1b1b1b;
}
body.light-mode .nav-glass {
  background-color: rgba(0, 119, 255, 0.15);
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}
body.light-mode .btn-main {
  background: #0077ff;
  color: white;
}
body.light-mode .btn-main:hover {
  background: #005fcc;
  color: white;
}
body.light-mode .game-card {
  background-color: #ffffff;
  border: 2px solid #00bbaa44;
}
body.light-mode .game-card:hover {
  box-shadow: 0 0 25px #00bbaa88;
}
body.light-mode h1 {
  color: #0077ff;
}
body.light-mode h3 {
  color: #111;
}
body.light-mode p {
  color: #333;
}
body.light-mode footer {
  background-color: #e6e6e6;
  color: #333; /* better footer text color */
}



/* === Custom Toggle Switch === */
.toggle-switch {
  position: fixed;
  top: 20px;
  right: 40px;
  width: 70px;
  height: 34px;
  z-index: 2000;
}

/* Hide native checkbox */
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* Switch background */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #333;
  border-radius: 34px;
  transition: 0.4s;
  box-shadow: 0 0 12px rgba(0, 255, 204, 0.3);
  background-image: url('https://img.icons8.com/ios-filled/50/ffffff/crescent-moon.png');
  background-repeat: no-repeat;
  background-position: 10px center;
  background-size: 20px;
}

/* Toggle circle (thumb) */
.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  border-radius: 50%;
  transition: 0.4s;
}

/* Light mode state */
.toggle-switch input:checked + .slider {
  background-color: #0ff14f;
  background-image: url('https://img.icons8.com/ios-filled/50/000000/sun--v1.png');
  background-position: 42px center;
}

/* Move the thumb */
.toggle-switch input:checked + .slider:before {
  transform: translateX(36px);
}

/* Neon button pulse */
@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 5px #00ff88;
  }
  50% {
    box-shadow: 0 0 15px #00ff88, 0 0 30px #00c266;
  }
  100% {
    box-shadow: 0 0 5px #00ff88;
  }
}

/* Responsive tweaks */
@media (max-width: 768px) {
  h1 {
    font-size: 1.5rem;
  }
  h3 {
    font-size: 1.2rem;
  }
  .nav-glass .btn-main {
    margin-left: 0.5rem;
  }
  .nav-glass a {
    margin-left: 0;
    margin-bottom: 0.5rem;
    font-size: 1rem;
  }
  #cards {
    padding: 2rem 1rem;
    gap: 1.5rem;
  }
  footer {
    padding: 1.5rem 1rem;
    font-size: 0.8rem;
  }
}
@media (max-width: 480px) {
  h1 {
    font-size: 1.3rem;
  }
  h3 {
    font-size: 1rem;
  }
  .btn-main {
    padding: 0.35rem 0.9rem;
    font-size: 0.85rem;
  }
  .nav-glass {
    padding: 0.8rem 1rem;
  }
  .game-card section {
    padding: 0.75rem;
  }
  p {
    font-size: 1rem;
  }
}
