/* --- Global --- */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, sans-serif;
  transition: background 0.3s, color 0.3s;
  position: relative;
  overflow: hidden; /* for particles */
}

/* --- Dark / Normal Mode --- */
body.dark { 
  background: linear-gradient(135deg, #0d0015, #3c004d); /* purple-black gradient */
  color: #e0d7ff;         
}

body.normal { 
  background: linear-gradient(135deg, #e0d7ff, #b784ff); /* light purple gradient */
  color: #333;
}

/* --- Themes --- */
body.purpleBlack .top h1 { color: #b784ff; }
body.blueBlack .top h1 { color: #7fd1ff; }
body.redBlack .top h1 { color: #ff7f7f; }
body.greenBlack .top h1 { color: #7fff7f; }

/* --- Header --- */
.top {
  padding: 30px;
  text-align: center;
  position: relative;
  z-index: 2; /* above particles */
}

.top h1 { margin: 0; font-size: 42px; }

#search {
  margin-top: 15px;
  padding: 12px 18px;
  width: 280px;
  border-radius: 999px;
  border: none;
  background: #1a1a1a;
  color: inherit;
  outline: none;
  position: relative;
  z-index: 2;
}

/* --- Game Grid --- */
#gameGrid {
  padding: 30px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  position: relative;
  z-index: 2;
}

.game {
  background: #151515;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.game img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.game .name {
  padding: 12px;
  font-weight: 600;
  text-align: center;
}

/* --- Floating Button --- */
.floating-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #b784ff;
  color: #0b0b0b;
  border: none;
  border-radius: 50%;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 18px;
  z-index: 1000;
}

/* --- Settings Panel --- */
#settingsPanel {
  position: fixed;
  top: 60px;
  right: 20px;
  background: #1a1a1a;
  color: inherit;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  display: none;
  width: 220px;
  font-size: 14px;
  z-index: 1000;
}

#settingsPanel.show { display: block; }

#settingsPanel h2 { text-align: center; margin: 0 0 10px 0; }

#settingsPanel label { display: flex; justify-content: space-between; margin-bottom: 8px; }

#settingsPanel button {
  width: 100%;
  margin-top: 8px;
  padding: 8px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
}

/* --- Particle Background --- */
.particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1; /* behind content */
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  animation: float 10s infinite linear;
  pointer-events: none;
}

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

/* ===== Custom Purple/Black Scrollbar ===== */

/* Chrome, Edge, Safari, Opera */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: #0f0b1a;
  border-left: 1px solid #3a2558;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #e0d7ff, #b39ddb, #7e57c2);
  border-radius: 6px;
  border: 3px solid #0f0b1a;
  box-shadow: 0 0 10px rgba(179, 157, 219, 0.6);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #f1ebff, #d1c4e9, #9575cd);
  box-shadow: 0 0 14px rgba(179, 157, 219, 0.9);
}

/* Firefox */
html {
  scrollbar-width: thin;
  scrollbar-color: #9575cd #0f0b1a;
}

/* Always show scrollbar */
html {
  overflow-y: scroll;
}



/* --- Background Music Player --- */
.bg-player {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20,20,30,0.9);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  border-radius: 14px;
  z-index: 9999;
  backdrop-filter: blur(10px);
}

.bg-player img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
}

.bg-player button {
  font-size: 18px;
  cursor: pointer;
}

.bg-player #bgTitle {
  font-weight: bold;
  color: #e0d7ff;
}

.bg-player #bgArtist {
  font-size: 12px;
  color: #b39ddb;
}

.bg-player input[type="range"] {
  width: 100px;
  cursor: pointer;
}

