:root {
  --bg-light: #e0eafc;
  --bg-dark: #121212;
  --text-light: #000;
  --text-dark: #fff;
  --card-bg-light: #ffffffd2;
  --card-bg-dark: #1f1f1fd2;
  --blue: #007bff;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #e0eafc, #cfdef3);
  color: var(--text-light);
  overflow-x: hidden;
  transition: 0.3s ease;
}

body.dark-mode {
  background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
  color: var(--text-dark);
}

.background-circles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

.background-circles span {
  position: absolute;
  display: block;
  width: 40px;
  height: 40px;
  background: rgba(0, 123, 255, 0.3);
  border-radius: 50%;
  animation: float 20s linear infinite;
}

.background-circles span:nth-child(1) { top: 20%; left: 10%; animation-delay: 0s; }
.background-circles span:nth-child(2) { top: 40%; left: 80%; animation-delay: 5s; }
.background-circles span:nth-child(3) { top: 70%; left: 30%; animation-delay: 2s; }
.background-circles span:nth-child(4) { top: 50%; left: 50%; animation-delay: 8s; }

@keyframes float {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  50% { transform: translateY(-50px) scale(1.2); opacity: 0.6; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background-color: var(--blue);
  color: white;
  padding: 15px 20px;
  font-size: 1.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 5;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
}

nav a {
  color: white;
  text-decoration: none;
  font-size: 1rem;
}

.theme-toggle {
  background: none;
  border: none;
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
}

/* Category Dropdown */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropbtn {
  background: none;
  border: none;
  color: white;
  font-size: 1rem;
  cursor: pointer;
}

.new-badge {
  background: red;
  color: white;
  font-size: 0.7rem;
  padding: 2px 4px;
  border-radius: 5px;
  margin-left: 5px;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: white;
  min-width: 120px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
  z-index: 10;
}

.dropdown-content a {
  color: black;
  padding: 8px 12px;
  text-decoration: none;
  display: block;
}

.dropdown-content a:hover {
  background-color: #ddd;
}

.dropdown:hover .dropdown-content {
  display: block;
}

.container {
  padding: 20px;
  width: 100%;
  flex: 1;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
}

.game-card {
  background-color: var(--card-bg-light);
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  text-align: center;
  cursor: pointer;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  animation: fadeInUp 0.8s ease forwards;
  opacity: 0;
}

body.dark-mode .game-card {
  background-color: var(--card-bg-dark);
}

.game-card:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 30px rgba(0,0,0,0.2);
}

.game-card i {
  font-size: 2rem;
  margin-bottom: 10px;
  display: block;
  color: var(--blue);
}

.game-card span {
  display: block;
  margin-top: 8px;
  font-size: 1.1rem;
  font-weight: 600;
}

.special-tools {
  background: linear-gradient(135deg, #ff6a00, #ee0979) !important;
  color: white !important;
}

.special-tools i {
  color: white !important;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

#more-games {
  text-align: center;
  margin-top: 30px;
  font-size: 1.2rem;
  font-weight: bold;
}

footer {
  background-color: #000;
  color: white;
  text-align: center;
  padding: 15px 10px;
  font-size: 14px;
}

footer a {
  color: #00bfff;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

@media screen and (max-width: 600px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }
  nav {
    margin-top: 10px;
  }
}