:root {
  --bg-color: linear-gradient(135deg, #232526, #414345);
  --text-color: white;
  --card-bg: rgba(255, 255, 255, 0.05);
  --hover-bg: rgba(255, 255, 255, 0.15);
  --title-gradient: linear-gradient(45deg, #9b59b6, #8e44ad);
}

body.light {
  --bg-color: linear-gradient(135deg, #f5f7fa, #c3cfe2);
  --text-color: #222;
  --card-bg: rgba(0, 0, 0, 0.05);
  --hover-bg: rgba(0, 0, 0, 0.1);
  --title-gradient: linear-gradient(45deg, #8e44ad, #6a3093);
}

body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  transition: all 0.3s ease;
  min-height: 100vh;
}

.container {
  text-align: center;
  padding: 20px;
}

.logo {
  width: 100px;
  height: auto;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 10px #8e44ad);
}

h1 {
  font-size: 2.5em;
  margin-bottom: 40px;
  background: var(--title-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: fadeIn 2s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.game-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.game-card {
  background: var(--card-bg);
  border: 2px solid #8e44ad;
  border-radius: 12px;
  padding: 15px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
  width: 180px;
  box-sizing: border-box;
}

.game-card:hover {
  background: var(--hover-bg);
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.game-card img {
  width: 100%;
  border-radius: 10px;
  margin-bottom: 10px;
}

.game-title {
  font-size: 1.2em;
  font-weight: bold;
}

/* Toggle Switch */
.toggle-container {
  position: absolute;
  top: 10px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  background-color: #ccc;
  transition: .4s;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #8e44ad;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.mode-label {
  font-size: 1.3em;
  color: var(--text-color);
  transition: color 0.3s ease;
}

@media (max-width: 500px) {
  .game-card {
    width: 140px;
  }

  h1 {
    font-size: 1.8em;
  }
}
