/* Base Styles */
body, html {
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #1e3c72, #2a5298);
  color: #fff;
  text-align: center;
  overflow-x: hidden;
}

/* Particle Background */
#particles-js {
  position: fixed;
  width: 100%;
  height: 100%;
  z-index: -4;
  top: 0;
  left: 0;
}

/* Vignette Overlay */
#vignette-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.1) 60%, rgba(0, 0, 0, 0.6) 100%);
  z-index: -3;
}

/* Parallax Background */
#parallax-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('https://via.placeholder.com/1920x1080.webp?text=Math+Mayhem') center/cover no-repeat;
  z-index: -2;
  filter: blur(10px) brightness(0.7);
}

/* Glass Bar (Navigation & Controls) */
#glass-bar {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(15px);
  border-radius: 20px;
  padding: 15px 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.2rem;
}

#player-stats span {
  margin-right: 15px;
  font-size: 1.4rem;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

#controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

#controls button {
  font-size: 1.2rem;
  padding: 8px 12px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.6);
  color: #333;
  transition: transform 0.2s, background 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

#controls button:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.9);
}

#controls input[type="range"] {
  width: 100px;
  cursor: pointer;
  -webkit-appearance: none;
  background: #ccc;
  height: 5px;
  border-radius: 5px;
  outline: none;
}

/* Game Container */
#game-container {
  max-width: 800px;
  margin: 150px auto 50px; /* Margin-top adjusted to clear the glass bar */
  padding: 20px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 1;
}

/* Header */
header {
  padding: 20px;
  background: #ff5722;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

header h1 {
  margin: 0;
  font-size: 2.8rem;
}

header p {
  margin: 10px 0 0;
  font-size: 1.6rem;
}

/* Difficulty Selection & End Screen */
#difficulty-selection, #end-screen {
  text-align: center;
  margin-top: 30px;
}

#difficulty-selection button, #restart-button {
  padding: 12px 20px;
  font-size: 1.2rem;
  margin: 10px;
  background: #4caf50;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}

#difficulty-selection button:hover, #restart-button:hover {
  background: #66bb6a;
  transform: scale(1.05);
}

/* Game Area */
#game-area {
  margin-top: 20px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
  position: relative;
}

/* Heads-Up Display (HUD) */
#hud {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-bottom: 20px;
}

#lives {
  display: flex;
  gap: 5px;
}

.heart {
  width: 30px;
  height: 30px;
  fill: #e91e63;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

#level, #score {
  font-size: 1.5rem;
}

/* Timer Container and SVG */
#timer-container {
  width: 80px;
  height: 80px;
}

#timer-svg {
  width: 100%;
  height: 100%;
}

#timer-circle-bg {
  fill: none;
  stroke: #555;
  stroke-width: 10;
}

#timer-circle {
  fill: none;
  stroke: #76ff03;
  stroke-width: 10;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
}

/* Question & Answers */
#question-container {
  text-align: center;
}

#question {
  font-size: 2.5rem;
  margin-bottom: 20px;
}

#answers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
}

#answers button {
  background: #ff9800;
  border: none;
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 1.4rem;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}

#answers button:hover {
  background: #ffb74d;
  transform: scale(1.05);
}

/* Level Up Animation */
#level-up {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(76, 175, 80, 0.9);
  padding: 20px 40px;
  font-size: 2rem;
  border-radius: 10px;
  animation: fadeInOut 2s;
}

@keyframes fadeInOut {
  0% { opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

.hidden {
  display: none;
}

/* Footer */
footer {
  margin-top: 20px;
  font-size: 1.2rem;
}
